difftreelog
merge develop into /test/playground-migration
in: master
154 files changed
.docker/Dockerfile-acala.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-acala.j2
@@ -0,0 +1,41 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+RUN rustup toolchain uninstall $(rustup toolchain list) && \
+ rustup toolchain install {{ RUST_TOOLCHAIN }} && \
+ rustup default {{ RUST_TOOLCHAIN }} && \
+ rustup target list --installed && \
+ rustup show
+RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}
+
+RUN mkdir /unique_parachain
+WORKDIR /unique_parachain
+
+# ===== BUILD ACALA =====
+FROM rust-builder as builder-acala-bin
+
+WORKDIR /unique_parachain
+
+RUN git clone -b {{ ACALA_BUILD_BRANCH }} --depth 1 https://github.com/AcalaNetwork/Acala.git && \
+ cd Acala && \
+ make init && \
+ make build-release
+
+# ===== BIN ======
+
+FROM ubuntu:20.04 as builder-acala
+
+COPY --from=builder-acala-bin /unique_parachain/Acala/target/production/acala /unique_parachain/Acala/target/production/acala
.docker/Dockerfile-chain-devdiffbeforeafterboth--- a/.docker/Dockerfile-chain-dev
+++ b/.docker/Dockerfile-chain-dev
@@ -1,17 +1,19 @@
FROM ubuntu:20.04
+ARG RUST_TOOLCHAIN=
+ARG FEATURE=
+
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
-
-RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake
-
+ENV FEATURE=$FEATURE
ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
-RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+RUN echo "$FEATURE\n" && echo "$RUST_TOOLCHAIN\n"
-ARG RUST_TOOLCHAIN=
-ARG FEATURE=
+RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
RUN rustup toolchain uninstall $(rustup toolchain list) && \
rustup toolchain install $RUST_TOOLCHAIN && \
@@ -24,5 +26,6 @@
WORKDIR /dev_chain
RUN cargo build --release
+RUN echo "$FEATURE"
CMD cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external
.docker/Dockerfile-cumulus.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-cumulus.j2
@@ -0,0 +1,40 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+RUN rustup toolchain uninstall $(rustup toolchain list) && \
+ rustup toolchain install {{ RUST_TOOLCHAIN }} && \
+ rustup default {{ RUST_TOOLCHAIN }} && \
+ rustup target list --installed && \
+ rustup show
+RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}
+
+RUN mkdir /unique_parachain
+WORKDIR /unique_parachain
+
+# ===== BUILD CUMULUS =====
+FROM rust-builder as builder-cumulus-bin
+
+WORKDIR /unique_parachain
+
+RUN git clone -b {{ CUMULUS_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/cumulus.git && \
+ cd cumulus && \
+ cargo build --release
+
+# ===== BIN ======
+
+FROM ubuntu:20.04 as builder-cumulus
+
+COPY --from=builder-cumulus-bin /unique_parachain/cumulus/target/release/polkadot-parachain /unique_parachain/cumulus/target/release/polkadot-parachain
.docker/Dockerfile-moonbeam.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-moonbeam.j2
@@ -0,0 +1,41 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+RUN rustup toolchain uninstall $(rustup toolchain list) && \
+ rustup toolchain install {{ RUST_TOOLCHAIN }} && \
+ rustup default {{ RUST_TOOLCHAIN }} && \
+ rustup target list --installed && \
+ rustup show
+RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}
+
+RUN mkdir /unique_parachain
+WORKDIR /unique_parachain
+
+
+# ===== BUILD MOONBEAM =====
+FROM rust-builder as builder-moonbeam-bin
+
+WORKDIR /unique_parachain
+
+RUN git clone -b {{ MOONBEAM_BUILD_BRANCH }} --depth 1 https://github.com/PureStake/moonbeam.git && \
+ cd moonbeam && \
+ cargo build --release
+
+# ===== BIN ======
+
+FROM ubuntu:20.04 as builder-moonbeam
+
+COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/target/release/moonbeam /unique_parachain/moonbeam/target/release/moonbeam
\ No newline at end of file
.docker/Dockerfile-polkadot.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-polkadot.j2
@@ -0,0 +1,40 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+RUN rustup toolchain uninstall $(rustup toolchain list) && \
+ rustup toolchain install {{ RUST_TOOLCHAIN }} && \
+ rustup default {{ RUST_TOOLCHAIN }} && \
+ rustup target list --installed && \
+ rustup show
+RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}
+
+RUN mkdir /unique_parachain
+WORKDIR /unique_parachain
+
+# ===== BUILD POLKADOT =====
+FROM rust-builder as builder-polkadot-bin
+
+WORKDIR /unique_parachain
+
+RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git && \
+ cd polkadot && \
+ cargo build --release
+
+# ===== BIN ======
+
+FROM ubuntu:20.04 as builder-polkadot
+
+COPY --from=builder-polkadot-bin /unique_parachain/polkadot/target/release/polkadot /unique_parachain/polkadot/target/release/polkadot
.docker/Dockerfile-try-runtimediffbeforeafterboth--- a/.docker/Dockerfile-try-runtime
+++ b/.docker/Dockerfile-try-runtime
@@ -47,4 +47,4 @@
cargo build --features=$FEATURE --release
-CMD cargo run --features=$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM
+CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime on-runtime-upgrade live --uri $REPLICA_FROM
.docker/Dockerfile-xcm.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-xcm.j2
@@ -0,0 +1,85 @@
+# ===== Rust builder =====
+FROM ubuntu:20.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+RUN rustup toolchain uninstall $(rustup toolchain list) && \
+ rustup toolchain install {{ RUST_TOOLCHAIN }} && \
+ rustup default {{ RUST_TOOLCHAIN }} && \
+ rustup target list --installed && \
+ rustup show
+RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}
+
+RUN mkdir /unique_parachain
+WORKDIR /unique_parachain
+
+# ===== BUILD ======
+FROM rust-builder as builder-unique
+
+ARG PROFILE=release
+
+WORKDIR /unique_parachain
+
+COPY ./xcm-config/launch-config-xcm-{{ NETWORK }}.json ./launch-config-xcm-{{ NETWORK }}.json
+COPY ./xcm-config/5validators.jsonnet ./5validators.jsonnet
+COPY ./xcm-config/minBondFix.jsonnet ./minBondFix.jsonnet
+
+RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \
+ cd unique-chain && \
+ cargo build --features={{ FEATURE }} --$PROFILE
+
+# ===== RUN ======
+
+FROM ubuntu:20.04
+
+RUN apt-get -y update && \
+ apt-get -y install curl git && \
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \
+ export NVM_DIR="$HOME/.nvm" && \
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
+ nvm install v16.16.0 && \
+ nvm use v16.16.0
+
+RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }}
+
+RUN export NVM_DIR="$HOME/.nvm" && \
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
+ cd /polkadot-launch && \
+ npm install --global yarn && \
+ yarn install
+
+COPY --from=builder-unique /unique_parachain/launch-config-xcm-{{ NETWORK }}.json /polkadot-launch/
+COPY --from=builder-unique /unique_parachain/5validators.jsonnet /polkadot-launch/5validators.jsonnet
+COPY --from=builder-unique /unique_parachain/minBondFix.jsonnet /polkadot-launch/minBondFix.jsonnet
+
+COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/
+
+COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/
+COPY --from=uniquenetwork/builder-moonbeam:{{ MOONBEAM_BUILD_BRANCH }} /unique_parachain/moonbeam/target/release/moonbeam /moonbeam/target/release/
+COPY --from=uniquenetwork/builder-cumulus:{{ CUMULUS_BUILD_BRANCH }} /unique_parachain/cumulus/target/release/polkadot-parachain /cumulus/target/release/cumulus
+COPY --from=uniquenetwork/builder-acala:{{ ACALA_BUILD_BRANCH }} /unique_parachain/Acala/target/production/acala /acala/target/release/
+COPY --from=uniquenetwork/builder-chainql:latest /chainql/target/release/chainql /chainql/target/release/
+
+EXPOSE 9844
+EXPOSE 9933
+EXPOSE 9944
+EXPOSE 9946
+EXPOSE 9947
+EXPOSE 9948
+
+CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" && \
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
+ cd /polkadot-launch && \
+ yarn start launch-config-xcm-{{ NETWORK }}.json
+
.docker/docker-compose.tmp-dev.j2diffbeforeafterboth--- a/.docker/docker-compose.tmp-dev.j2
+++ b/.docker/docker-compose.tmp-dev.j2
@@ -18,4 +18,4 @@
options:
max-size: "1m"
max-file: "3"
- command: cargo run --release --features=$FEATURE -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external
+ command: cargo run --release --features={{ FEATURE }} -- --dev -linfo --unsafe-ws-external --rpc-cors=all --unsafe-rpc-external
.docker/docker-compose.tmp-xcm-tests.j2diffbeforeafterboth--- /dev/null
+++ b/.docker/docker-compose.tmp-xcm-tests.j2
@@ -0,0 +1,25 @@
+version: "3.5"
+
+services:
+ xcm_nodes:
+ image: uniquenetwork/xcm-{{ NETWORK }}-testnet-local:latest
+ container_name: xcm-{{ NETWORK }}-testnet-local
+ expose:
+ - 9844
+ - 9933
+ - 9944
+ - 9946
+ - 9947
+ - 9948
+ ports:
+ - 127.0.0.1:9844:9844
+ - 127.0.0.1:9933:9933
+ - 127.0.0.1:9944:9944
+ - 127.0.0.1:9946:9946
+ - 127.0.0.1:9947:9947
+ - 127.0.0.1:9948:9948
+ logging:
+ options:
+ max-size: "1m"
+ max-file: "3"
+
.docker/xcm-config/5validators.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/5validators.jsonnet
@@ -0,0 +1,50 @@
+
+function(spec)
+ spec {
+ genesis+: {
+ runtime+: {
+ staking+: {
+ validatorCount: 5,
+ invulnerables: [
+ '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY',
+ '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc',
+ '5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT',
+ '5HKPmK9GYtE1PSLsS1qiYU9xQ9Si1NcEhdeCq9sw5bqu4ns8',
+ '5FCfAonRZgTFrTd9HREEyeJjDpT397KMzizE6T3DvebLFE7n',
+ ],
+ stakers: [
+ [
+ '5GNJqTPyNqANBkUVMN1LPPrxXnFouWXoe2wNSmmEoLctxiZY',
+ '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY',
+ 100000000000000,
+ 'Validator',
+ ],
+ [
+ '5HpG9w8EBLe5XCrbczpwq5TSXvedjrBGCwqxK1iQ7qUsSWFc',
+ '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
+ 100000000000000,
+ 'Validator',
+ ],
+ [
+ '5Ck5SLSHYac6WFt5UZRSsdJjwmpSZq85fd5TRNAdZQVzEAPT',
+ '5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y',
+ 100000000000000,
+ 'Validator',
+ ],
+ [
+ '5HKPmK9GYtE1PSLsS1qiYU9xQ9Si1NcEhdeCq9sw5bqu4ns8',
+ '5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy',
+ 100000000000000,
+ 'Validator',
+ ],
+ [
+ '5FCfAonRZgTFrTd9HREEyeJjDpT397KMzizE6T3DvebLFE7n',
+ '5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw',
+ 100000000000000,
+ 'Validator',
+ ],
+ ],
+ },
+ },
+ },
+ }
.docker/xcm-config/launch-config-xcm-opal.jsondiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/launch-config-xcm-opal.json
@@ -0,0 +1,134 @@
+{
+ "relaychain": {
+ "bin": "/polkadot/target/release/polkadot",
+ "chain": "westend-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "5validators.jsonnet"
+ ],
+ "nodes": [
+ {
+ "name": "alice",
+ "wsPort": 9844,
+ "rpcPort": 9843,
+ "port": 30444,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "bob",
+ "wsPort": 9855,
+ "rpcPort": 9854,
+ "port": 30555,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "charlie",
+ "wsPort": 9866,
+ "rpcPort": 9865,
+ "port": 30666,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "dave",
+ "wsPort": 9877,
+ "rpcPort": 9876,
+ "port": 30777,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "eve",
+ "wsPort": 9888,
+ "rpcPort": 9887,
+ "port": 30888,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ }
+
+ ],
+ "genesis": {
+ "runtime": {
+ "runtime_genesis_config": {
+ "parachainsConfiguration": {
+ "config": {
+ "validation_upgrade_frequency": 1,
+ "validation_upgrade_delay": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "parachains": [
+ {
+ "bin": "/unique-chain/target/release/unique-collator",
+ "id": "2095",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "port": 31200,
+ "wsPort": 9944,
+ "rpcPort": 9933,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/cumulus/target/release/cumulus",
+ "id": "1000",
+ "chain": "westmint-local",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9948,
+ "port": 31204,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ }
+ ],
+ "simpleParachains": [],
+ "hrmpChannels": [
+ {
+ "sender": 2095,
+ "recipient": 1000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 1000,
+ "recipient": 2095,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ }
+ ],
+ "finalization": false
+}
+
.docker/xcm-config/launch-config-xcm-quartz.jsondiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/launch-config-xcm-quartz.json
@@ -0,0 +1,199 @@
+{
+ "relaychain": {
+ "bin": "/polkadot/target/release/polkadot",
+ "chain": "westend-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "5validators.jsonnet"
+ ],
+ "nodes": [
+ {
+ "name": "alice",
+ "wsPort": 9844,
+ "rpcPort": 9843,
+ "port": 30444,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "bob",
+ "wsPort": 9855,
+ "rpcPort": 9854,
+ "port": 30555,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "charlie",
+ "wsPort": 9866,
+ "rpcPort": 9865,
+ "port": 30666,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "dave",
+ "wsPort": 9877,
+ "rpcPort": 9876,
+ "port": 30777,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "eve",
+ "wsPort": 9888,
+ "rpcPort": 9887,
+ "port": 30888,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ }
+
+ ],
+ "genesis": {
+ "runtime": {
+ "runtime_genesis_config": {
+ "parachainsConfiguration": {
+ "config": {
+ "validation_upgrade_frequency": 1,
+ "validation_upgrade_delay": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "parachains": [
+ {
+ "bin": "/unique-chain/target/release/unique-collator",
+ "id": "2095",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "port": 31200,
+ "wsPort": 9944,
+ "rpcPort": 9933,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/acala/target/release/acala",
+ "id": "2000",
+ "chain": "karura-dev",
+ "balance": "1000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9946,
+ "port": 31202,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/moonbeam/target/release/moonbeam",
+ "id": 2023,
+ "balance": "1000000000000000000000",
+ "chain": "moonriver-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "minBondFix.jsonnet"
+ ],
+ "nodes": [
+ {
+ "wsPort": 9947,
+ "port": 31203,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "--",
+ "--execution=wasm"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/cumulus/target/release/cumulus",
+ "id": "1000",
+ "chain": "statemine-local",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9948,
+ "port": 31204,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ }
+ ],
+ "simpleParachains": [],
+ "hrmpChannels": [
+ {
+ "sender": 2095,
+ "recipient": 2000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2000,
+ "recipient": 2095,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2095,
+ "recipient": 2023,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2023,
+ "recipient": 2095,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2095,
+ "recipient": 1000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 1000,
+ "recipient": 2095,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ }
+ ],
+ "finalization": false
+}
+
.docker/xcm-config/launch-config-xcm-unique-rococo.jsondiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/launch-config-xcm-unique-rococo.json
@@ -0,0 +1,207 @@
+{
+ "relaychain": {
+ "bin": "/polkadot/target/release/polkadot",
+ "chain": "rococo-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "5validators.jsonnet"
+ ],
+ "nodes": [
+ {
+ "name": "alice",
+ "wsPort": 9844,
+ "rpcPort": 9843,
+ "port": 30444,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "bob",
+ "wsPort": 9855,
+ "rpcPort": 9854,
+ "port": 30555,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "charlie",
+ "wsPort": 9866,
+ "rpcPort": 9865,
+ "port": 30666,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "dave",
+ "wsPort": 9877,
+ "rpcPort": 9876,
+ "port": 30777,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "eve",
+ "wsPort": 9888,
+ "rpcPort": 9887,
+ "port": 30888,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ }
+
+ ],
+ "genesis": {
+ "runtime": {
+ "runtime_genesis_config": {
+ "parachainsConfiguration": {
+ "config": {
+ "validation_upgrade_frequency": 1,
+ "validation_upgrade_delay": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "parachains": [
+ {
+ "bin": "/unique-chain/target/release/unique-collator",
+ "id": "2037",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "port": 31200,
+ "wsPort": 9944,
+ "rpcPort": 9933,
+ "name": "alice",
+ "flags": [
+ "-lruntime=trace",
+ "-lxcm=trace",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/acala/target/release/acala",
+ "id": "2000",
+ "chain": "acala-dev",
+ "balance": "1000000000000000000000",
+ "chainInitializer": [
+ "chainql",
+ "-e",
+ "(import '${spec}') {id+: '-local'}"
+ ],
+ "nodes": [
+ {
+ "wsPort": 9946,
+ "port": 31202,
+ "name": "alice",
+ "flags": [
+ "-lruntime=trace",
+ "-lxcm=trace",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/moonbeam/target/release/moonbeam",
+ "id": "2004",
+ "balance": "1000000000000000000000",
+ "chain": "moonbeam-local",
+ "nodes": [
+ {
+ "wsPort": 9947,
+ "port": 31203,
+ "name": "alice",
+ "flags": [
+ "-lruntime=trace",
+ "-lxcm=trace",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "--",
+ "--execution=wasm"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/cumulus/target/release/cumulus",
+ "id": "1000",
+ "chain": "statemint-local",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9948,
+ "port": 31204,
+ "name": "alice",
+ "flags": [
+ "-lruntime=trace",
+ "-lxcm=trace",
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ }
+ ],
+ "simpleParachains": [],
+ "hrmpChannels": [
+ {
+ "sender": 2037,
+ "recipient": 2000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2000,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2037,
+ "recipient": 2004,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2004,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2037,
+ "recipient": 1000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 1000,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ }
+ ],
+ "finalization": false
+}
+
.docker/xcm-config/launch-config-xcm-unique.jsondiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/launch-config-xcm-unique.json
@@ -0,0 +1,199 @@
+{
+ "relaychain": {
+ "bin": "/polkadot/target/release/polkadot",
+ "chain": "westend-local",
+ "chainInitializer": [
+ "chainql",
+ "--tla-code=spec=import '${spec}'",
+ "5validators.jsonnet"
+ ],
+ "nodes": [
+ {
+ "name": "alice",
+ "wsPort": 9844,
+ "rpcPort": 9843,
+ "port": 30444,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "bob",
+ "wsPort": 9855,
+ "rpcPort": 9854,
+ "port": 30555,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "charlie",
+ "wsPort": 9866,
+ "rpcPort": 9865,
+ "port": 30666,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "dave",
+ "wsPort": 9877,
+ "rpcPort": 9876,
+ "port": 30777,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ },
+ {
+ "name": "eve",
+ "wsPort": 9888,
+ "rpcPort": 9887,
+ "port": 30888,
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "-lparachain::candidate_validation=debug"
+ ]
+ }
+
+ ],
+ "genesis": {
+ "runtime": {
+ "runtime_genesis_config": {
+ "parachainsConfiguration": {
+ "config": {
+ "validation_upgrade_frequency": 1,
+ "validation_upgrade_delay": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "parachains": [
+ {
+ "bin": "/unique-chain/target/release/unique-collator",
+ "id": "2037",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "port": 31200,
+ "wsPort": 9944,
+ "rpcPort": 9933,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/acala/target/release/acala",
+ "id": "2000",
+ "chain": "acala-dev",
+ "balance": "1000000000000000000000",
+ "chainInitializer": [
+ "chainql",
+ "-e",
+ "(import '${spec}') {id+: '-local'}"
+ ],
+ "nodes": [
+ {
+ "wsPort": 9946,
+ "port": 31202,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/moonbeam/target/release/moonbeam",
+ "id": "2004",
+ "balance": "1000000000000000000000",
+ "chain": "moonbeam-local",
+ "nodes": [
+ {
+ "wsPort": 9947,
+ "port": 31203,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external",
+ "--",
+ "--execution=wasm"
+ ]
+ }
+ ]
+ },
+ {
+ "bin": "/cumulus/target/release/cumulus",
+ "id": "1000",
+ "chain": "statemint-local",
+ "balance": "1000000000000000000000000",
+ "nodes": [
+ {
+ "wsPort": 9948,
+ "port": 31204,
+ "name": "alice",
+ "flags": [
+ "--unsafe-rpc-external",
+ "--unsafe-ws-external"
+ ]
+ }
+ ]
+ }
+ ],
+ "simpleParachains": [],
+ "hrmpChannels": [
+ {
+ "sender": 2037,
+ "recipient": 2000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2000,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2037,
+ "recipient": 2004,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2004,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 2037,
+ "recipient": 1000,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ },
+ {
+ "sender": 1000,
+ "recipient": 2037,
+ "maxCapacity": 8,
+ "maxMessageSize": 512
+ }
+ ],
+ "finalization": false
+}
+
.docker/xcm-config/minBondFix.jsonnetdiffbeforeafterboth--- /dev/null
+++ b/.docker/xcm-config/minBondFix.jsonnet
@@ -0,0 +1,10 @@
+function(spec)
+spec {
+ genesis+: {
+ runtime+: {
+ parachainStaking+: {
+ candidates: std.map(function(candidate) [candidate[0], candidate[1] * 1000], super.candidates)
+ },
+ },
+ },
+}
.envdiffbeforeafterboth--- a/.env
+++ b/.env
@@ -12,3 +12,16 @@
OPAL_REPLICA_FROM=wss://eu-ws-opal.unique.network:443
QUARTZ_REPLICA_FROM=wss://eu-ws-quartz.unique.network:443
UNIQUE_REPLICA_FROM=wss://eu-ws.unique.network:443
+
+POLKADOT_LAUNCH_BRANCH=feature/rewrite-chain-id-in-spec
+
+KARURA_BUILD_BRANCH=2.9.1
+ACALA_BUILD_BRANCH=2.9.2
+
+MOONRIVER_BUILD_BRANCH=runtime-1701
+MOONBEAM_BUILD_BRANCH=runtime-1701
+
+STATEMINE_BUILD_BRANCH=parachains-v9270
+STATEMINT_BUILD_BRANCH=release-parachains-v9230
+WESTMINT_BUILD_BRANCH=parachains-v9270
+
.github/workflows/dev-build-tests_v2.ymldiffbeforeafterboth--- a/.github/workflows/dev-build-tests_v2.yml
+++ b/.github/workflows/dev-build-tests_v2.yml
@@ -71,8 +71,8 @@
run: |
yarn install
yarn add mochawesome
+ node scripts/readyness.js
echo "Ready to start tests"
- node scripts/readyness.js
yarn polkadot-types
NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
env:
@@ -95,3 +95,10 @@
- name: Stop running containers
if: always() # run this step always
run: docker-compose -f ".docker/docker-compose-dev.yaml" -f ".docker/docker-compose.${{ matrix.network }}.yml" down
+
+ - name: Remove builder cache
+ if: always() # run this step always
+ run: |
+ docker builder prune -f -a
+ docker system prune -f
+ docker image prune -f -a
\ No newline at end of file
.github/workflows/market-test_v2.ymldiffbeforeafterboth--- a/.github/workflows/market-test_v2.yml
+++ b/.github/workflows/market-test_v2.yml
@@ -45,7 +45,7 @@
repository: 'UniqueNetwork/market-e2e-tests'
ssh-key: ${{ secrets.GH_PAT }}
path: 'qa-tests'
- ref: 'ci_test_v2'
+ ref: 'master'
- name: Read .env file
uses: xom9ikk/dotenv@v1.0.2
@@ -142,7 +142,6 @@
with:
path: qa-tests/
-
- name: local-market:start
run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build
@@ -175,7 +174,6 @@
- name: Stop running containers
if: always() # run this step always
run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes
-# run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down
- name: Remove builder cache
if: always() # run this step always
.github/workflows/node-only-update_v2.ymldiffbeforeafterboth--- a/.github/workflows/node-only-update_v2.yml
+++ b/.github/workflows/node-only-update_v2.yml
@@ -10,7 +10,7 @@
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
- execution-marix:
+ nodes-execution-matrix:
name: execution matrix
@@ -42,8 +42,8 @@
- forkless-update-nodata:
- needs: execution-marix
+ nodes-only-update:
+ needs: nodes-execution-matrix
# The type of runner that the job will run on
runs-on: [self-hosted-ci,large]
@@ -57,7 +57,7 @@
strategy:
matrix:
- include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
+ include: ${{fromJson(needs.nodes-execution-matrix.outputs.matrix)}}
steps:
@@ -156,12 +156,18 @@
exit 0
shell: bash
+ - name: Checkout at '${{ matrix.mainnet_branch }}' branch
+ uses: actions/checkout@master
+ with:
+ ref: ${{ matrix.mainnet_branch }} #Checking out head commit
+ path: ${{ matrix.mainnet_branch }}
+
+
- name: Run tests before Node Parachain upgrade
- working-directory: tests
+ working-directory: ${{ matrix.mainnet_branch }}/tests
run: |
yarn install
yarn add mochawesome
- node scripts/readyness.js
echo "Ready to start tests"
yarn polkadot-types
NOW=$(date +%s) && yarn test --reporter mochawesome --reporter-options reportFilename=test-${NOW}
@@ -174,7 +180,7 @@
if: success() || failure() # run this step even if previous step failed
with:
name: Tests before node upgrade ${{ matrix.network }} # Name of the check run which will be created
- path: tests/mochawesome-report/test-*.json # Path to test results
+ path: ${{ matrix.mainnet_branch }}/tests/mochawesome-report/test-*.json # Path to test results
reporter: mochawesome-json
fail-on-error: 'false'
@@ -263,8 +269,9 @@
- name: Remove builder cache
if: always() # run this step always
run: |
- docker builder prune -f
+ docker builder prune -f -a
docker system prune -f
+ docker image prune -f -a
- name: Clean Workspace
if: always()
.github/workflows/try-runtime_v2.ymldiffbeforeafterboth--- a/.github/workflows/try-runtime_v2.yml
+++ b/.github/workflows/try-runtime_v2.yml
@@ -1,7 +1,6 @@
on:
workflow_call:
-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
try-runtime:
.github/workflows/xcm-testnet-build.ymldiffbeforeafterboth--- a/.github/workflows/xcm-testnet-build.yml
+++ /dev/null
@@ -1,151 +0,0 @@
-name: xcm-testnet-build
-
-# Controls when the action will run.
-on:
- workflow_call:
-
- # Allows you to run this workflow manually from the Actions tab
- workflow_dispatch:
-
-#Define Workflow variables
-env:
- REPO_URL: ${{ github.server_url }}/${{ github.repository }}
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
-
- prepare-execution-marix:
-
- name: Prepare execution matrix
-
- runs-on: [XL]
- outputs:
- matrix: ${{ steps.create_matrix.outputs.matrix }}
-
- steps:
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v1.0.2
-
- - name: Create Execution matrix
- uses: fabiocaccamo/create-matrix-action@v2
- id: create_matrix
- with:
- matrix: |
- network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}
- network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}
- network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}
-
- xcm-build:
-
- needs: prepare-execution-marix
- # The type of runner that the job will run on
- runs-on: [XL]
-
- timeout-minutes: 600
-
- name: ${{ matrix.network }}
-
- continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
-
- strategy:
- matrix:
- include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
-
- steps:
- - name: Skip if pull request is in Draft
- if: github.event.pull_request.draft == true
- run: exit 1
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v1.0.2
-
- - name: Generate ENV related extend Dockerfile file
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/Dockerfile-xcm.j2
- output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- NETWORK=${{ matrix.network }}
- POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
- POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
- FEATURE=${{ matrix.features }}
- RUNTIME=${{ matrix.runtime }}
- BRANCH=${{ github.head_ref }}
- ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
- MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
- CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
-
- - name: Show build Dockerfile
- run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml
-
- - name: Show launch-config-xcm-${{ matrix.network }} configuration
- run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json
-
- - name: Run find-and-replace to remove slashes from branch name
- uses: mad9000/actions-find-and-replace-string@2
- id: branchname
- with:
- source: ${{ github.head_ref }}
- find: '/'
- replace: '-'
-
- - name: Log in to Docker Hub
- uses: docker/login-action@v2.0.0
- with:
- username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
- password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
-
- - name: Pull acala docker image
- run: docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
-
- - name: Pull moonbeam docker image
- run: docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
-
- - name: Pull cumulus docker image
- run: docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
-
- - name: Pull polkadot docker image
- run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
-
- - name: Pull chainql docker image
- run: docker pull uniquenetwork/builder-chainql:latest
-
- - name: Build the stack
- run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest .
-
- - name: Push docker image version
- run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}
-
- - name: Push docker image latest
- run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest
-
- - name: Clean Workspace
- if: always()
- uses: AutoModality/action-clean@v1.1.0
-
- - name: Remove builder cache
- if: always() # run this step always
- run: |
- docker builder prune -f
- docker system prune -f
-
-
-
.github/workflows/xcm-tests_v2.ymldiffbeforeafterboth--- a/.github/workflows/xcm-tests_v2.yml
+++ /dev/null
@@ -1,175 +0,0 @@
-name: xcm-tests
-
-# Controls when the action will run.
-on:
- # Allows you to run this workflow manually from the Actions tab
- workflow_call:
-
-#Define Workflow variables
-env:
- REPO_URL: ${{ github.server_url }}/${{ github.repository }}
-
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
-
- prepare-execution-marix:
-
- name: Prepare execution matrix
-
-# needs: [xcm-testnet-build]
-
- runs-on: XL
- outputs:
- matrix: ${{ steps.create_matrix.outputs.matrix }}
-
- steps:
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v1.0.2
-
- - name: Create Execution matrix
- uses: fabiocaccamo/create-matrix-action@v2
- id: create_matrix
- with:
- matrix: |
- network {opal}, runtime {opal}, features {opal-runtime}, runtest {testXcmOpal}
- network {quartz}, runtime {quartz}, features {quartz-runtime}, runtest {testXcmQuartz}
- network {unique}, runtime {unique}, features {unique-runtime}, runtest {testXcmUnique}
-
- xcm-tests:
- needs: prepare-execution-marix
- # The type of runner that the job will run on
- runs-on: [XL]
-
- timeout-minutes: 600
-
- name: ${{ matrix.network }}
-
- continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
-
- strategy:
- matrix:
- include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
-
-
- steps:
- - name: Skip if pull request is in Draft
- if: github.event.pull_request.draft == true
- run: exit 1
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v1.0.2
-
- - name: Generate ENV related extend file for docker-compose
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/docker-compose.tmp-xcm-tests.j2
- output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
- variables: |
- NETWORK=${{ matrix.network }}
-
- - name: Show build configuration
- run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
-
- - uses: actions/setup-node@v3
- with:
- node-version: 16
-
- - name: Build the stack
- run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
-
- # 🚀 POLKADOT LAUNCH COMPLETE 🚀
- - name: Check if docker logs consist messages related to testing of xcm tests
- if: success()
- run: |
- counter=160
- function check_container_status {
- docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local
- }
- function do_docker_logs {
- docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1
- }
- function is_started {
- if [ "$(check_container_status)" == "true" ]; then
- echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";
- echo "Check Docker logs"
- DOCKER_LOGS=$(do_docker_logs)
- if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
- echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"
- return 0
- else
- echo "Message not found in logs output, repeating..."
- return 1
- fi
- else
- echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"
- echo "Halting all future checks"
- exit 1
- fi
- echo "something goes wrong"
- exit 1
- }
- while ! is_started; do
- echo "Waiting for special message in log files "
- sleep 30s
- counter=$(( $counter - 1 ))
- echo "Counter: $counter"
- if [ "$counter" -gt "0" ]; then
- continue
- else
- break
- fi
- done
- echo "Halting script"
- exit 0
- shell: bash
-
- - name: Run XCM tests
- working-directory: tests
- run: |
- yarn install
- yarn add mochawesome
- node scripts/readyness.js
- echo "Ready to start tests"
- NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
-
- - name: XCM Test Report
- uses: phoenix-actions/test-reporting@v8
- id: test-report
- if: success() || failure() # run this step even if previous step failed
- with:
- name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created
- path: tests/mochawesome-report/test-*.json # Path to test results
- reporter: mochawesome-json
- fail-on-error: 'false'
-
- - name: Stop running containers
- if: always() # run this step always
- run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down
-
- - name: Clean Workspace
- if: always()
- uses: AutoModality/action-clean@v1.1.0
-
- - name: Remove builder cache
- if: always() # run this step always
- run: |
- docker system prune -a -f
-
.github/workflows/xcm.ymldiffbeforeafterboth--- a/.github/workflows/xcm.yml
+++ b/.github/workflows/xcm.yml
@@ -1,19 +1,400 @@
-name: Nesting XCM
+name: xcm-testnet-build
+# Controls when the action will run.
on:
workflow_call:
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+#Define Workflow variables
+env:
+ REPO_URL: ${{ github.server_url }}/${{ github.repository }}
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
- xcm-testnet-build:
- name: testnet build
- uses: ./.github/workflows/xcm-testnet-build.yml
- secrets: inherit
+ prepare-execution-marix:
+
+ name: Prepare execution matrix
+
+ runs-on: [XL]
+ outputs:
+ matrix: ${{ steps.create_matrix.outputs.matrix }}
+
+ steps:
+
+ - name: Clean Workspace
+ uses: AutoModality/action-clean@v1.1.0
+
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.head_ref }} #Checking out head commit
+
+ - name: Read .env file
+ uses: xom9ikk/dotenv@v1.0.2
+
+ - name: Create Execution matrix
+ uses: fabiocaccamo/create-matrix-action@v2
+ id: create_matrix
+ with:
+ matrix: |
+ network {opal}, runtime {opal}, features {opal-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}, runtest {testXcmOpal}
+ network {quartz}, runtime {quartz}, features {quartz-runtime}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}, runtest {testXcmQuartz}
+ network {unique}, runtime {unique}, features {unique-runtime}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}, runtest {testXcmUnique}
+
+ xcm-build:
+
+ needs: prepare-execution-marix
+ # The type of runner that the job will run on
+ runs-on: [XL]
+
+ timeout-minutes: 600
+
+ name: ${{ matrix.network }}
+
+ continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
+
+ strategy:
+ matrix:
+ include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
+
+ steps:
+ - name: Skip if pull request is in Draft
+ if: github.event.pull_request.draft == true
+ run: exit 1
+
+ - name: Clean Workspace
+ uses: AutoModality/action-clean@v1.1.0
+
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.head_ref }} #Checking out head commit
+
+ - name: Read .env file
+ uses: xom9ikk/dotenv@v1.0.2
+
+ - name: Log in to Docker Hub
+ uses: docker/login-action@v2.0.0
+ with:
+ username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+
+ - name: Install jq
+ run: sudo apt install jq -y
+
+ # Check POLKADOT version and build it if it doesn't exist in repository
+ - name: Generate ENV related extend Dockerfile file for POLKADOT
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-polkadot.j2
+ output_file: .docker/Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+
+ - name: Check if the dockerhub repository contains the needed version POLKADOT
+ run: |
+ # aquire token
+ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+ export TOKEN=$TOKEN
+ # Get TAGS from DOCKERHUB POLKADOT repository
+ POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]')
+ # Show TAGS
+ echo "POLKADOT TAGS:"
+ echo $POLKADOT_TAGS
+ # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS
+ if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ env.POLKADOT_BUILD_BRANCH }}"($|[[:space:]]) ]]; then
+ echo "Repository has needed POLKADOT version";
+ docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
+ else
+ echo "Repository has not needed POLKADOT version, so build it";
+ cd .docker/ && docker build --no-cache --file ./Dockerfile-polkadot.${{ env.POLKADOT_BUILD_BRANCH }}.yml --tag uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }} .
+ echo "Push needed POLKADOT version to the repository";
+ docker push uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}
+ fi
+ shell: bash
+
+ # Check ACALA version and build it if it doesn't exist in repository
+ - name: Generate ENV related extend Dockerfile file for ACALA
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-acala.j2
+ output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
+
+ - name: Check if the dockerhub repository contains the needed ACALA version
+ run: |
+ # aquire token
+ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+ export TOKEN=$TOKEN
+
+ # Get TAGS from DOCKERHUB repository
+ ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]')
+ # Show TAGS
+ echo "ACALA TAGS:"
+ echo $ACALA_TAGS
+ # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS
+ if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then
+ echo "Repository has needed ACALA version";
+ docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
+ else
+ echo "Repository has not needed ACALA version, so build it";
+ cd .docker/ && docker build --no-cache --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} .
+ echo "Push needed ACALA version to the repository";
+ docker push uniquenetwork/builder-acala:${{ matrix.acala_version }}
+ fi
+ shell: bash
+
+ # Check MOONBEAM version and build it if it doesn't exist in repository
+ - name: Generate ENV related extend Dockerfile file for MOONBEAM
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-moonbeam.j2
+ output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
+
+ - name: Check if the dockerhub repository contains the needed MOONBEAM version
+ run: |
+ # aquire token
+ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+ export TOKEN=$TOKEN
+
+ # Get TAGS from DOCKERHUB repository
+ MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]')
+ # Show TAGS
+ echo "MOONBEAM TAGS:"
+ echo $MOONBEAM_TAGS
+ # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS
+ if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then
+ echo "Repository has needed MOONBEAM version";
+ docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
+ else
+ echo "Repository has not needed MOONBEAM version, so build it";
+ cd .docker/ && docker build --no-cache --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} .
+ echo "Push needed MOONBEAM version to the repository";
+ docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
+ fi
+ shell: bash
+
+
+ # Check CUMULUS version and build it if it doesn't exist in repository
+ - name: Generate ENV related extend Dockerfile file for CUMULUS
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-cumulus.j2
+ output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
+
+ - name: Check if the dockerhub repository contains the needed CUMULUS version
+ run: |
+ # aquire token
+ TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
+ export TOKEN=$TOKEN
+
+ # Get TAGS from DOCKERHUB repository
+ CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]')
+ # Show TAGS
+ echo "CUMULUS TAGS:"
+ echo $CUMULUS_TAGS
+ # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS
+ if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then
+ echo "Repository has needed CUMULUS version";
+ docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
+ else
+ echo "Repository has not needed CUMULUS version, so build it";
+ cd .docker/ && docker build --no-cache --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} .
+ echo "Push needed CUMULUS version to the repository";
+ docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
+ fi
+ shell: bash
+
+
+ # Build main image for XCM
+ - name: Generate ENV related extend Dockerfile file
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/Dockerfile-xcm.j2
+ output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml
+ variables: |
+ RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ NETWORK=${{ matrix.network }}
+ POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}
+ POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
+ FEATURE=${{ matrix.features }}
+ RUNTIME=${{ matrix.runtime }}
+ BRANCH=${{ github.head_ref }}
+ ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
+ MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
+ CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
+
+ - name: Show build Dockerfile
+ run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml
+
+ - name: Show launch-config-xcm-${{ matrix.network }} configuration
+ run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json
+
+ - name: Run find-and-replace to remove slashes from branch name
+ uses: mad9000/actions-find-and-replace-string@2
+ id: branchname
+ with:
+ source: ${{ github.head_ref }}
+ find: '/'
+ replace: '-'
+
+ - name: Pull chainql docker image
+ run: docker pull uniquenetwork/builder-chainql:latest
+
+ - name: Build the stack
+ run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest .
+
+ - name: Push docker image version
+ run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}
+
+ - name: Push docker image latest
+ run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest
+
+ - name: Remove builder cache
+ if: always() # run this step always
+ run: |
+ docker builder prune -f
+ docker system prune -f
+
xcm-tests:
- name: tests
- needs: [ xcm-testnet-build ]
- uses: ./.github/workflows/xcm-tests_v2.yml
+ needs: [prepare-execution-marix, xcm-build]
+ # The type of runner that the job will run on
+ runs-on: [XL]
+
+ timeout-minutes: 600
+
+ name: ${{ matrix.network }}
+
+ continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
+
+ strategy:
+ matrix:
+ include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
+
+ steps:
+ - name: Skip if pull request is in Draft
+ if: github.event.pull_request.draft == true
+ run: exit 1
+
+ - name: Clean Workspace
+ uses: AutoModality/action-clean@v1.1.0
+
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.head_ref }} #Checking out head commit
+
+ - name: Read .env file
+ uses: xom9ikk/dotenv@v1.0.2
+
+ - name: Generate ENV related extend file for docker-compose
+ uses: cuchi/jinja2-action@v1.2.0
+ with:
+ template: .docker/docker-compose.tmp-xcm-tests.j2
+ output_file: .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
+ variables: |
+ NETWORK=${{ matrix.network }}
+ - name: Show build configuration
+ run: cat .docker/docker-compose.xcm-tests.${{ matrix.network }}.yml
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 16
+
+ - name: Build the stack
+ run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
+
+ # 🚀 POLKADOT LAUNCH COMPLETE 🚀
+ - name: Check if docker logs consist messages related to testing of xcm tests
+ if: success()
+ run: |
+ counter=160
+ function check_container_status {
+ docker inspect -f {{.State.Running}} xcm-${{ matrix.network }}-testnet-local
+ }
+ function do_docker_logs {
+ docker logs --details xcm-${{ matrix.network }}-testnet-local 2>&1
+ }
+ function is_started {
+ if [ "$(check_container_status)" == "true" ]; then
+ echo "Container: xcm-${{ matrix.network }}-testnet-local RUNNING";
+ echo "Check Docker logs"
+ DOCKER_LOGS=$(do_docker_logs)
+ if [[ ${DOCKER_LOGS} = *"POLKADOT LAUNCH COMPLETE"* ]];then
+ echo "🚀 POLKADOT LAUNCH COMPLETE 🚀"
+ return 0
+ else
+ echo "Message not found in logs output, repeating..."
+ return 1
+ fi
+ else
+ echo "Container xcm-${{ matrix.network }}-testnet-local NOT RUNNING"
+ echo "Halting all future checks"
+ exit 1
+ fi
+ echo "something goes wrong"
+ exit 1
+ }
+ while ! is_started; do
+ echo "Waiting for special message in log files "
+ sleep 30s
+ counter=$(( $counter - 1 ))
+ echo "Counter: $counter"
+ if [ "$counter" -gt "0" ]; then
+ continue
+ else
+ break
+ fi
+ done
+ echo "Halting script"
+ exit 0
+ shell: bash
+
+ - name: Run XCM tests
+ working-directory: tests
+ run: |
+ yarn install
+ yarn add mochawesome
+ node scripts/readyness.js
+ echo "Ready to start tests"
+ yarn polkadot-types
+ NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
+ env:
+ RPC_URL: http://127.0.0.1:9933/
+
+ - name: XCM Test Report
+ uses: phoenix-actions/test-reporting@v8
+ id: test-report
+ if: success() || failure() # run this step even if previous step failed
+ with:
+ name: XCM Tests ${{ matrix.network }} # Name of the check run which will be created
+ path: tests/mochawesome-report/test-*.json # Path to test results
+ reporter: mochawesome-json
+ fail-on-error: 'false'
+
+ - name: Stop running containers
+ if: always() # run this step always
+ run: docker-compose -f ".docker/docker-compose.xcm-tests.${{ matrix.network }}.yml" down
+
+ - name: Clean Workspace
+ if: always()
+ uses: AutoModality/action-clean@v1.1.0
+
+ - name: Remove builder cache
+ if: always() # run this step always
+ run: |
+ docker system prune -a -f
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -697,6 +697,26 @@
]
[[package]]
+name = "bondrewd"
+version = "0.1.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d1660fac8d3acced44dac64453fafedf5aab2de196b932c727e63e4ae42d1cc"
+dependencies = [
+ "bondrewd-derive",
+]
+
+[[package]]
+name = "bondrewd-derive"
+version = "0.3.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "723da0dee1eef38edc021b0793f892bdc024500c6a5b0727a2efe16f0e0a6977"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "bounded-vec"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4586,6 +4606,16 @@
]
[[package]]
+name = "logtest"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eb3e43a8657c1d64516dcc9db8ca03826a4aceaf89d5ce1b37b59f6ff0e43026"
+dependencies = [
+ "lazy_static",
+ "log",
+]
+
+[[package]]
name = "lru"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5163,8 +5193,13 @@
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
+ "impl-trait-for-tuples",
"log",
+ "logtest",
+ "orml-tokens",
+ "orml-traits",
"orml-vesting",
+ "orml-xtokens",
"pallet-app-promotion",
"pallet-aura",
"pallet-balances",
@@ -5177,6 +5212,7 @@
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
+ "pallet-foreign-assets",
"pallet-fungible",
"pallet-inflation",
"pallet-nonfungible",
@@ -5282,6 +5318,53 @@
]
[[package]]
+name = "orml-tokens"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "orml-traits",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
+name = "orml-traits"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "impl-trait-for-tuples",
+ "num-traits",
+ "orml-utilities",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+]
+
+[[package]]
+name = "orml-utilities"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
+[[package]]
name = "orml-vesting"
version = "0.4.1-dev"
source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
@@ -5297,6 +5380,41 @@
]
[[package]]
+name = "orml-xcm-support"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "frame-support",
+ "orml-traits",
+ "parity-scale-codec 3.1.5",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+ "xcm-executor",
+]
+
+[[package]]
+name = "orml-xtokens"
+version = "0.4.1-dev"
+source = "git+https://github.com/open-web3-stack/open-runtime-module-library?branch=polkadot-v0.9.27#377213f750755cc48e80a3131eaae63b5eda8362"
+dependencies = [
+ "cumulus-primitives-core",
+ "frame-support",
+ "frame-system",
+ "orml-traits",
+ "orml-xcm-support",
+ "pallet-xcm",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "xcm",
+ "xcm-executor",
+]
+
+[[package]]
name = "os_str_bytes"
version = "6.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5791,6 +5909,34 @@
]
[[package]]
+name = "pallet-foreign-assets"
+version = "0.1.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "hex",
+ "log",
+ "orml-tokens",
+ "pallet-balances",
+ "pallet-common",
+ "pallet-fungible",
+ "pallet-timestamp",
+ "parity-scale-codec 3.1.5",
+ "scale-info",
+ "serde",
+ "serde_json",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "up-data-structs",
+ "xcm",
+ "xcm-builder",
+ "xcm-executor",
+]
+
+[[package]]
name = "pallet-fungible"
version = "0.1.5"
dependencies = [
@@ -6475,7 +6621,7 @@
[[package]]
name = "pallet-unique"
-version = "0.1.4"
+version = "0.2.0"
dependencies = [
"ethereum",
"evm-coder",
@@ -8397,8 +8543,13 @@
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
+ "impl-trait-for-tuples",
"log",
+ "logtest",
+ "orml-tokens",
+ "orml-traits",
"orml-vesting",
+ "orml-xtokens",
"pallet-app-promotion",
"pallet-aura",
"pallet-balances",
@@ -8411,6 +8562,7 @@
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
+ "pallet-foreign-assets",
"pallet-fungible",
"pallet-inflation",
"pallet-nonfungible",
@@ -12134,7 +12286,7 @@
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if 1.0.0",
"digest 0.10.3",
"rand 0.8.5",
"static_assertions",
@@ -12391,8 +12543,13 @@
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
+ "impl-trait-for-tuples",
"log",
+ "logtest",
+ "orml-tokens",
+ "orml-traits",
"orml-vesting",
+ "orml-xtokens",
"pallet-app-promotion",
"pallet-aura",
"pallet-balances",
@@ -12405,6 +12562,7 @@
"pallet-evm-contract-helpers",
"pallet-evm-migration",
"pallet-evm-transaction-payment",
+ "pallet-foreign-assets",
"pallet-fungible",
"pallet-inflation",
"pallet-nonfungible",
@@ -12497,6 +12655,7 @@
name = "up-data-structs"
version = "0.2.2"
dependencies = [
+ "bondrewd",
"derivative",
"frame-support",
"frame-system",
Cargo.tomldiffbeforeafterboth--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,9 +6,12 @@
'client/*',
'primitives/*',
'crates/*',
+ 'runtime/opal',
+ 'runtime/quartz',
+ 'runtime/unique',
'runtime/tests',
]
-exclude = ["runtime/unique", "runtime/quartz"]
+default-members = ['node/*', 'runtime/opal']
[profile.release]
panic = 'unwind'
Makefilediffbeforeafterboth--- a/Makefile
+++ b/Makefile
@@ -128,9 +128,13 @@
bench-rmrk-equip:
make _bench PALLET=proxy-rmrk-equip
+.PHONY: bench-foreign-assets
+bench-foreign-assets:
+ make _bench PALLET=foreign-assets
+
.PHONY: bench-app-promotion
bench-app-promotion:
make _bench PALLET=app-promotion PALLET_DIR=app-promotion
.PHONY: bench
-bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip
+bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip bench-foreign-assets
README.mddiffbeforeafterboth--- a/README.md
+++ b/README.md
@@ -195,7 +195,7 @@
xtokens -> transfer
currencyId:
- ForeingAsset
+ ForeignAsset
<TOKEN_ID>
amount:
crates/evm-coder/procedural/src/solidity_interface.rsdiffbeforeafterboth--- a/crates/evm-coder/procedural/src/solidity_interface.rs
+++ b/crates/evm-coder/procedural/src/solidity_interface.rs
@@ -42,6 +42,7 @@
pascal_call_name: Ident,
snake_call_name: Ident,
via: Option<(Type, Ident)>,
+ condition: Option<Expr>,
}
impl Is {
fn expand_call_def(&self, gen_ref: &proc_macro2::TokenStream) -> proc_macro2::TokenStream {
@@ -64,8 +65,13 @@
generics: &proc_macro2::TokenStream,
) -> proc_macro2::TokenStream {
let pascal_call_name = &self.pascal_call_name;
+ let condition = self.condition.as_ref().map(|condition| {
+ quote! {
+ (#condition) &&
+ }
+ });
quote! {
- <#pascal_call_name #generics>::supports_interface(interface_id)
+ #condition <#pascal_call_name #generics>::supports_interface(this, interface_id)
}
}
@@ -93,8 +99,13 @@
.as_ref()
.map(|(_, i)| quote! {.#i()})
.unwrap_or_default();
+ let condition = self.condition.as_ref().map(|condition| {
+ quote! {
+ if ({let this = &self; (#condition)})
+ }
+ });
quote! {
- #call_name::#name(call) => return <#via_typ as ::evm_coder::Callable<#pascal_call_name #generics>>::call(self #via_map, Msg {
+ #call_name::#name(call) #condition => return <#via_typ as ::evm_coder::Callable<#pascal_call_name #generics>>::call(self #via_map, Msg {
call,
caller: c.caller,
value: c.value,
@@ -138,17 +149,50 @@
}
let name = input.parse::<Ident>()?;
let lookahead = input.lookahead1();
- let via = if lookahead.peek(syn::token::Paren) {
+
+ let mut condition: Option<Expr> = None;
+ let mut via: Option<(Type, Ident)> = None;
+
+ if lookahead.peek(syn::token::Paren) {
let contents;
parenthesized!(contents in input);
- let method = contents.parse::<Ident>()?;
- contents.parse::<Token![,]>()?;
- let ty = contents.parse::<Type>()?;
- Some((ty, method))
- } else if lookahead.peek(Token![,]) {
- None
- } else if input.is_empty() {
- None
+ let input = contents;
+
+ while !input.is_empty() {
+ let lookahead = input.lookahead1();
+ if lookahead.peek(Token![if]) {
+ input.parse::<Token![if]>()?;
+ let contents;
+ parenthesized!(contents in input);
+ let contents = contents.parse::<Expr>()?;
+
+ if condition.replace(contents).is_some() {
+ return Err(syn::Error::new(input.span(), "condition is already set"));
+ }
+ } else if lookahead.peek(kw::via) {
+ input.parse::<kw::via>()?;
+ let contents;
+ parenthesized!(contents in input);
+
+ let method = contents.parse::<Ident>()?;
+ contents.parse::<kw::returns>()?;
+ let ty = contents.parse::<Type>()?;
+
+ if via.replace((ty, method)).is_some() {
+ return Err(syn::Error::new(input.span(), "via is already set"));
+ }
+ } else {
+ return Err(lookahead.error());
+ }
+
+ if input.peek(Token![,]) {
+ input.parse::<Token![,]>()?;
+ } else if !input.is_empty() {
+ return Err(syn::Error::new(input.span(), "expected end"));
+ }
+ }
+ } else if lookahead.peek(Token![,]) || input.is_empty() {
+ // Pass
} else {
return Err(lookahead.error());
};
@@ -157,6 +201,7 @@
snake_call_name: pascal_ident_to_snake_call(&name),
name,
via,
+ condition,
});
if input.peek(Token![,]) {
input.parse::<Token![,]>()?;
@@ -495,6 +540,7 @@
syn::custom_keyword!(weight);
syn::custom_keyword!(via);
+ syn::custom_keyword!(returns);
syn::custom_keyword!(name);
syn::custom_keyword!(is);
syn::custom_keyword!(inline_is);
@@ -996,16 +1042,6 @@
#(#inline_interface_id)*
u32::to_be_bytes(interface_id)
}
- /// Is this contract implements specified ERC165 selector
- pub fn supports_interface(interface_id: ::evm_coder::types::bytes4) -> bool {
- interface_id != u32::to_be_bytes(0xffffff) && (
- interface_id == ::evm_coder::ERC165Call::INTERFACE_ID ||
- interface_id == Self::interface_id()
- #(
- || #supports_interface
- )*
- )
- }
/// Generate solidity definitions for methods described in this interface
pub fn generate_solidity_interface(tc: &evm_coder::solidity::TypeCollector, is_impl: bool) {
use evm_coder::solidity::*;
@@ -1024,7 +1060,7 @@
)*),
};
- let mut out = string::new();
+ let mut out = ::evm_coder::types::string::new();
if #solidity_name.starts_with("Inline") {
out.push_str("/// @dev inlined interface\n");
}
@@ -1062,6 +1098,20 @@
return Ok(None);
}
}
+ impl #generics #call_name #gen_ref
+ #gen_where
+ {
+ /// Is this contract implements specified ERC165 selector
+ pub fn supports_interface(this: &#name, interface_id: ::evm_coder::types::bytes4) -> bool {
+ interface_id != u32::to_be_bytes(0xffffff) && (
+ interface_id == ::evm_coder::ERC165Call::INTERFACE_ID ||
+ interface_id == Self::interface_id()
+ #(
+ || #supports_interface
+ )*
+ )
+ }
+ }
impl #generics ::evm_coder::Weighted for #call_name #gen_ref
#gen_where
{
@@ -1091,7 +1141,7 @@
)*
#call_name::ERC165Call(::evm_coder::ERC165Call::SupportsInterface {interface_id}, _) => {
let mut writer = ::evm_coder::abi::AbiWriter::default();
- writer.bool(&<#call_name #gen_ref>::supports_interface(interface_id));
+ writer.bool(&<#call_name #gen_ref>::supports_interface(self, interface_id));
return Ok(writer.into());
}
_ => {},
@@ -1101,7 +1151,7 @@
#(
#call_variants_this,
)*
- _ => unreachable!()
+ _ => Err(::evm_coder::execution::Error::from("method is not available").into()),
}
}
}
crates/evm-coder/src/abi.rsdiffbeforeafterboth--- a/crates/evm-coder/src/abi.rs
+++ b/crates/evm-coder/src/abi.rs
@@ -313,7 +313,7 @@
/// Finish writer, concatenating all internal buffers
pub fn finish(mut self) -> Vec<u8> {
for (static_offset, part) in self.dynamic_part {
- let part_offset = self.static_part.len() - self.had_call.then(|| 4).unwrap_or(0);
+ let part_offset = self.static_part.len() - if self.had_call { 4 } else { 0 };
let encoded_dynamic_offset = usize::to_be_bytes(part_offset);
self.static_part[static_offset + ABI_ALIGNMENT - encoded_dynamic_offset.len()
crates/evm-coder/src/lib.rsdiffbeforeafterboth--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -74,10 +74,10 @@
/// #[solidity_interface(name = MyContract, is(SuperContract), inline_is(InlineContract))]
/// impl Contract {
/// /// Multiply two numbers
-/// /// @param a First number
-/// /// @param b Second number
-/// /// @return uint32 Product of two passed numbers
-/// /// @dev This function returns error in case of overflow
+/// /// @param a First number
+/// /// @param b Second number
+/// /// @return uint32 Product of two passed numbers
+/// /// @dev This function returns error in case of overflow
/// #[weight(200 + a + b)]
/// #[solidity_interface(rename_selector = "mul")]
/// fn mul(&mut self, a: uint32, b: uint32) -> Result<uint32> {
crates/evm-coder/tests/conditional_is.rsdiffbeforeafterboth--- /dev/null
+++ b/crates/evm-coder/tests/conditional_is.rs
@@ -0,0 +1,44 @@
+use evm_coder::{types::*, solidity_interface, execution::Result, Call};
+
+pub struct Contract(bool);
+
+#[solidity_interface(name = A)]
+impl Contract {
+ fn method_a() -> Result<void> {
+ Ok(())
+ }
+}
+
+#[solidity_interface(name = B)]
+impl Contract {
+ fn method_b() -> Result<void> {
+ Ok(())
+ }
+}
+
+#[solidity_interface(name = Contract, is(
+ A(if(this.0)),
+ B(if(!this.0)),
+))]
+impl Contract {}
+
+#[test]
+fn conditional_erc165() {
+ assert!(ContractCall::supports_interface(
+ &Contract(true),
+ ACall::METHOD_A
+ ));
+ assert!(!ContractCall::supports_interface(
+ &Contract(false),
+ ACall::METHOD_A
+ ));
+
+ assert!(ContractCall::supports_interface(
+ &Contract(false),
+ BCall::METHOD_B
+ ));
+ assert!(!ContractCall::supports_interface(
+ &Contract(true),
+ BCall::METHOD_B
+ ));
+}
crates/evm-coder/tests/generics.rsdiffbeforeafterboth--- a/crates/evm-coder/tests/generics.rs
+++ b/crates/evm-coder/tests/generics.rs
@@ -17,7 +17,7 @@
use std::marker::PhantomData;
use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types::*};
-struct Generic<T>(PhantomData<T>);
+pub struct Generic<T>(PhantomData<T>);
#[solidity_interface(name = GenericIs)]
impl<T> Generic<T> {
crates/evm-coder/tests/random.rsdiffbeforeafterboth--- a/crates/evm-coder/tests/random.rs
+++ b/crates/evm-coder/tests/random.rs
@@ -18,7 +18,7 @@
use evm_coder::{ToLog, execution::Result, solidity_interface, types::*, solidity, weight};
-struct Impls;
+pub struct Impls;
#[solidity_interface(name = OurInterface)]
impl Impls {
crates/evm-coder/tests/solidity_generation.rsdiffbeforeafterboth--- a/crates/evm-coder/tests/solidity_generation.rs
+++ b/crates/evm-coder/tests/solidity_generation.rs
@@ -16,7 +16,7 @@
use evm_coder::{execution::Result, generate_stubgen, solidity_interface, types::*};
-struct ERC20;
+pub struct ERC20;
#[solidity_interface(name = ERC20)]
impl ERC20 {
node/cli/Cargo.tomldiffbeforeafterboth--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -302,7 +302,7 @@
[dependencies]
futures = '0.3.17'
-log = '0.4.14'
+log = '0.4.16'
flexi_logger = "0.22.5"
parking_lot = '0.12.1'
clap = "3.1.2"
node/cli/src/chain_spec.rsdiffbeforeafterboth--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -65,6 +65,14 @@
Unknown(String),
}
+#[cfg(not(feature = "unique-runtime"))]
+/// PARA_ID for Opal/Quartz
+const PARA_ID: u32 = 2095;
+
+#[cfg(feature = "unique-runtime")]
+/// PARA_ID for Unique
+const PARA_ID: u32 = 2037;
+
pub trait RuntimeIdentification {
fn runtime_id(&self) -> RuntimeId;
}
@@ -167,6 +175,7 @@
.collect(),
},
treasury: Default::default(),
+ tokens: TokensConfig { balances: vec![] },
sudo: SudoConfig {
key: Some($root_key),
},
@@ -235,7 +244,7 @@
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
- 1000
+ PARA_ID
)
},
// Bootnodes
@@ -250,7 +259,7 @@
// Extensions
Extensions {
relay_chain: "rococo-dev".into(),
- para_id: 1000,
+ para_id: PARA_ID,
},
)
}
@@ -303,7 +312,7 @@
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
- 1000
+ PARA_ID
)
},
// Bootnodes
@@ -318,7 +327,7 @@
// Extensions
Extensions {
relay_chain: "westend-local".into(),
- para_id: 1000,
+ para_id: PARA_ID,
},
)
}
pallets/app-promotion/Cargo.tomldiffbeforeafterboth--- a/pallets/app-promotion/Cargo.toml
+++ b/pallets/app-promotion/Cargo.toml
@@ -66,8 +66,8 @@
pallet-common ={ default-features = false, path = "../common" }
pallet-unique ={ default-features = false, path = "../unique" }
pallet-evm-contract-helpers ={ default-features = false, path = "../evm-contract-helpers" }
+pallet-evm-migration ={ default-features = false, path = "../evm-migration" }
-[dev-dependencies]
-pallet-evm-migration ={ default-features = false, path = "../evm-migration" }
+# [dev-dependencies]
################################################################################
pallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/benchmarking.rs
+++ b/pallets/app-promotion/src/benchmarking.rs
@@ -20,11 +20,10 @@
use crate::Pallet as PromototionPallet;
use sp_runtime::traits::Bounded;
-use sp_std::vec;
use frame_benchmarking::{benchmarks, account};
use frame_support::traits::OnInitialize;
-use frame_system::{Origin, RawOrigin};
+use frame_system::RawOrigin;
use pallet_unique::benchmarking::create_nft_collection;
use pallet_evm_migration::Pallet as EvmMigrationPallet;
pallets/app-promotion/src/lib.rsdiffbeforeafterboth--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -594,14 +594,14 @@
last_id,
*income_acc.borrow(),
ExistenceRequirement::KeepAlive,
- )
- .and_then(|_| {
- Self::add_lock_balance(last_id, *income_acc.borrow())?;
- <TotalStaked<T>>::try_mutate(|staked| {
- staked
- .checked_add(&*income_acc.borrow())
- .ok_or(ArithmeticError::Overflow.into())
- })
+ )?;
+
+ Self::add_lock_balance(last_id, *income_acc.borrow())?;
+ <TotalStaked<T>>::try_mutate(|staked| -> DispatchResult {
+ *staked = staked
+ .checked_add(&*income_acc.borrow())
+ .ok_or(ArithmeticError::Overflow)?;
+ Ok(())
})?;
Self::deposit_event(Event::StakingRecalculation(
pallets/common/src/benchmarking.rsdiffbeforeafterboth--- a/pallets/common/src/benchmarking.rs
+++ b/pallets/common/src/benchmarking.rs
@@ -19,8 +19,8 @@
use pallet_evm::account::CrossAccountId;
use frame_benchmarking::{benchmarks, account};
use up_data_structs::{
- CollectionMode, CreateCollectionData, CollectionId, Property, PropertyKey, PropertyValue,
- CollectionPermissions, NestingPermissions, MAX_COLLECTION_NAME_LENGTH,
+ CollectionMode, CollectionFlags, CreateCollectionData, CollectionId, Property, PropertyKey,
+ PropertyValue, CollectionPermissions, NestingPermissions, MAX_COLLECTION_NAME_LENGTH,
MAX_COLLECTION_DESCRIPTION_LENGTH, MAX_TOKEN_PREFIX_LENGTH, MAX_PROPERTIES_PER_ITEM,
};
use frame_support::{
@@ -116,7 +116,7 @@
create_collection_raw(
owner,
CollectionMode::NFT,
- |owner, data| <Pallet<T>>::init_collection(owner, data, true),
+ |owner, data| <Pallet<T>>::init_collection(owner, data, CollectionFlags::default()),
|h| h,
)
}
pallets/common/src/erc.rsdiffbeforeafterboth--- a/pallets/common/src/erc.rs
+++ b/pallets/common/src/erc.rs
@@ -194,7 +194,7 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- fn get_collection_sponsor(&self) -> Result<(address, uint256)> {
+ fn collection_sponsor(&self) -> Result<(address, uint256)> {
let sponsor = match self.collection.sponsorship.sponsor() {
Some(sponsor) => sponsor,
None => return Ok(Default::default()),
@@ -406,9 +406,9 @@
true => {
let mut bv = OwnerRestrictedSet::new();
for i in collections {
- bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or(Error::Revert(
- "Can't convert address into collection id".into(),
- ))?)
+ bv.try_insert(crate::eth::map_eth_to_id(&i).ok_or_else(|| {
+ Error::Revert("Can't convert address into collection id".into())
+ })?)
.map_err(|_| "too many collections")?;
}
let mut nesting = permissions.nesting().clone();
pallets/common/src/lib.rsdiffbeforeafterboth--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -70,6 +70,7 @@
COLLECTION_NUMBER_LIMIT,
Collection,
RpcCollection,
+ CollectionFlags,
CollectionId,
CreateItemData,
MAX_TOKEN_PREFIX_LENGTH,
@@ -252,9 +253,9 @@
}
/// Checks that the collection was created with, and must be operated upon through **Unique API**.
- /// Now check only the `external_collection` flag and if it's **true**, then return [`Error::CollectionIsExternal`] error.
+ /// Now check only the `external` flag and if it's **true**, then return [`Error::CollectionIsExternal`] error.
pub fn check_is_internal(&self) -> DispatchResult {
- if self.external_collection {
+ if self.flags.external {
return Err(<Error<T>>::CollectionIsExternal)?;
}
@@ -262,9 +263,9 @@
}
/// Checks that the collection was created with, and must be operated upon through an **assimilated API**.
- /// Now check only the `external_collection` flag and if it's **false**, then return [`Error::CollectionIsInternal`] error.
+ /// Now check only the `external` flag and if it's **false**, then return [`Error::CollectionIsInternal`] error.
pub fn check_is_external(&self) -> DispatchResult {
- if !self.external_collection {
+ if !self.flags.external {
return Err(<Error<T>>::CollectionIsInternal)?;
}
@@ -792,7 +793,7 @@
sponsorship,
limits,
permissions,
- external_collection,
+ flags,
} = <CollectionById<T>>::get(collection)?;
let token_property_permissions = <CollectionPropertyPermissions<T>>::get(collection)
@@ -822,7 +823,8 @@
permissions,
token_property_permissions,
properties,
- read_only: external_collection,
+ read_only: flags.external,
+ foreign: flags.foreign,
})
}
}
@@ -861,11 +863,11 @@
///
/// * `owner` - The owner of the collection.
/// * `data` - Description of the created collection.
- /// * `is_external` - Marks that collection managet by not "Unique network".
+ /// * `flags` - Extra flags to store.
pub fn init_collection(
owner: T::CrossAccountId,
data: CreateCollectionData<T::AccountId>,
- is_external: bool,
+ flags: CollectionFlags,
) -> Result<CollectionId, DispatchError> {
{
ensure!(
@@ -909,7 +911,7 @@
Self::clamp_permissions(data.mode.clone(), &Default::default(), permissions)
})
.unwrap_or_else(|| Ok(CollectionPermissions::default()))?,
- external_collection: is_external,
+ flags,
};
let mut collection_properties = up_data_structs::CollectionProperties::get();
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -169,7 +169,7 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
+ fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
let sponsor =
Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
Ok(pallet_common::eth::convert_cross_account_to_tuple::<T>(
@@ -220,7 +220,7 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
+ fn sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
self.recorder().consume_sload()?;
Ok(<SponsoringRateLimit<T>>::get(contract_address)
@@ -273,7 +273,7 @@
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
+ fn sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
self.recorder().consume_sload()?;
Ok(get_sponsoring_fee_limit::<T>(contract_address))
pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
+++ b/pallets/evm-contract-helpers/src/stubs/ContractHelpers.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -24,15 +20,12 @@
/// @dev inlined interface
contract ContractHelpersEvents {
event ContractSponsorSet(address indexed contractAddress, address sponsor);
- event ContractSponsorshipConfirmed(
- address indexed contractAddress,
- address sponsor
- );
+ event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);
event ContractSponsorRemoved(address indexed contractAddress);
}
/// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
@@ -43,11 +36,7 @@
/// @return address Owner of contract
/// @dev EVM selector for this function is: 0x5152b14c,
/// or in textual repr: contractOwner(address)
- function contractOwner(address contractAddress)
- public
- view
- returns (address)
- {
+ function contractOwner(address contractAddress) public view returns (address) {
require(false, stub_error);
contractAddress;
dummy;
@@ -105,13 +94,9 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0x743fc745,
- /// or in textual repr: getSponsor(address)
- function getSponsor(address contractAddress)
- public
- view
- returns (Tuple0 memory)
- {
+ /// @dev EVM selector for this function is: 0x766c4f37,
+ /// or in textual repr: sponsor(address)
+ function sponsor(address contractAddress) public view returns (Tuple0 memory) {
require(false, stub_error);
contractAddress;
dummy;
@@ -137,11 +122,7 @@
/// @return **true** if contract has pending sponsor.
/// @dev EVM selector for this function is: 0x39b9b242,
/// or in textual repr: hasPendingSponsor(address)
- function hasPendingSponsor(address contractAddress)
- public
- view
- returns (bool)
- {
+ function hasPendingSponsor(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
@@ -150,11 +131,7 @@
/// @dev EVM selector for this function is: 0x6027dc61,
/// or in textual repr: sponsoringEnabled(address)
- function sponsoringEnabled(address contractAddress)
- public
- view
- returns (bool)
- {
+ function sponsoringEnabled(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
@@ -173,13 +150,9 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- /// @dev EVM selector for this function is: 0x610cfabd,
- /// or in textual repr: getSponsoringRateLimit(address)
- function getSponsoringRateLimit(address contractAddress)
- public
- view
- returns (uint32)
- {
+ /// @dev EVM selector for this function is: 0xf29694d8,
+ /// or in textual repr: sponsoringRateLimit(address)
+ function sponsoringRateLimit(address contractAddress) public view returns (uint32) {
require(false, stub_error);
contractAddress;
dummy;
@@ -194,9 +167,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x77b6c908,
/// or in textual repr: setSponsoringRateLimit(address,uint32)
- function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
- public
- {
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) public {
require(false, stub_error);
contractAddress;
rateLimit;
@@ -211,9 +182,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x03aed665,
/// or in textual repr: setSponsoringFeeLimit(address,uint256)
- function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit)
- public
- {
+ function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) public {
require(false, stub_error);
contractAddress;
feeLimit;
@@ -224,13 +193,9 @@
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- /// @dev EVM selector for this function is: 0xc3fdc9ee,
- /// or in textual repr: getSponsoringFeeLimit(address)
- function getSponsoringFeeLimit(address contractAddress)
- public
- view
- returns (uint256)
- {
+ /// @dev EVM selector for this function is: 0x75b73606,
+ /// or in textual repr: sponsoringFeeLimit(address)
+ function sponsoringFeeLimit(address contractAddress) public view returns (uint256) {
require(false, stub_error);
contractAddress;
dummy;
@@ -244,11 +209,7 @@
/// @return bool Is specified users exists in contract allowlist
/// @dev EVM selector for this function is: 0x5c658165,
/// or in textual repr: allowed(address,address)
- function allowed(address contractAddress, address user)
- public
- view
- returns (bool)
- {
+ function allowed(address contractAddress, address user) public view returns (bool) {
require(false, stub_error);
contractAddress;
user;
@@ -284,11 +245,7 @@
/// @return bool Is specified contract has allowlist access enabled
/// @dev EVM selector for this function is: 0xc772ef6c,
/// or in textual repr: allowlistEnabled(address)
- function allowlistEnabled(address contractAddress)
- public
- view
- returns (bool)
- {
+ function allowlistEnabled(address contractAddress) public view returns (bool) {
require(false, stub_error);
contractAddress;
dummy;
pallets/foreign-assets/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/Cargo.toml
@@ -0,0 +1,53 @@
+[package]
+name = "pallet-foreign-assets"
+version = "0.1.0"
+license = "GPLv3"
+edition = "2021"
+
+[dependencies]
+log = { version = "0.4.16", default-features = false }
+serde = { version = "1.0.136", optional = true }
+scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false }
+sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+up-data-structs = { default-features = false, path = '../../primitives/data-structs' }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", default-features = false }
+pallet-common = { default-features = false, path = '../common' }
+pallet-fungible = { default-features = false, path = '../fungible' }
+xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27", default-features = false }
+#orml-tokens = { git = 'https://github.com/UniqueNetwork/open-runtime-module-library', branch = 'unique-polkadot-v0.9.24', version = "0.4.1-dev", default-features = false }
+orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.27", version = "0.4.1-dev", default-features = false }
+frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+
+[dev-dependencies]
+serde_json = "1.0.68"
+hex = { version = "0.4" }
+sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
+
+[features]
+default = ["std"]
+std = [
+ "serde",
+ "log/std",
+ "codec/std",
+ "scale-info/std",
+ "sp-runtime/std",
+ "sp-std/std",
+ "frame-support/std",
+ "frame-system/std",
+ "up-data-structs/std",
+ "pallet-common/std",
+ "pallet-balances/std",
+ "pallet-fungible/std",
+ "orml-tokens/std"
+]
+try-runtime = ["frame-support/try-runtime"]
+runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
\ No newline at end of file
pallets/foreign-assets/src/benchmarking.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/src/benchmarking.rs
@@ -0,0 +1,68 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+#![allow(missing_docs)]
+
+use super::{Config, Pallet, Call};
+use frame_benchmarking::{benchmarks, account};
+use frame_system::RawOrigin;
+use crate::AssetMetadata;
+use xcm::opaque::latest::Junction::Parachain;
+use xcm::VersionedMultiLocation;
+use frame_support::{
+ traits::{Currency},
+};
+use sp_std::boxed::Box;
+
+benchmarks! {
+ register_foreign_asset {
+ let owner: T::AccountId = account("user", 0, 1);
+ let location: VersionedMultiLocation = VersionedMultiLocation::from(Parachain(1000).into());
+ let metadata: AssetMetadata<<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance> = AssetMetadata{
+ name: "name".into(),
+ symbol: "symbol".into(),
+ decimals: 18,
+ minimal_balance: 1u32.into()
+ };
+ let mut balance: <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance =
+ 4_000_000_000u32.into();
+ balance = balance * balance;
+ <T as Config>::Currency::make_free_balance_be(&owner,
+ balance);
+ }: _(RawOrigin::Root, owner, Box::new(location), Box::new(metadata))
+
+ update_foreign_asset {
+ let owner: T::AccountId = account("user", 0, 1);
+ let location: VersionedMultiLocation = VersionedMultiLocation::from(Parachain(2000).into());
+ let metadata: AssetMetadata<<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance> = AssetMetadata{
+ name: "name".into(),
+ symbol: "symbol".into(),
+ decimals: 18,
+ minimal_balance: 1u32.into()
+ };
+ let metadata2: AssetMetadata<<<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance> = AssetMetadata{
+ name: "name2".into(),
+ symbol: "symbol2".into(),
+ decimals: 18,
+ minimal_balance: 1u32.into()
+ };
+ let mut balance: <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance =
+ 4_000_000_000u32.into();
+ balance = balance * balance;
+ <T as Config>::Currency::make_free_balance_be(&owner, balance);
+ Pallet::<T>::register_foreign_asset(RawOrigin::Root.into(), owner, Box::new(location.clone()), Box::new(metadata))?;
+ }: _(RawOrigin::Root, 0, Box::new(location), Box::new(metadata2))
+}
pallets/foreign-assets/src/impl_fungibles.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/src/impl_fungibles.rs
@@ -0,0 +1,454 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+//! Implementations for fungibles trait.
+
+use super::*;
+use frame_system::Config as SystemConfig;
+
+use frame_support::traits::tokens::{DepositConsequence, WithdrawConsequence};
+use pallet_common::CollectionHandle;
+use pallet_fungible::FungibleHandle;
+use pallet_common::CommonCollectionOperations;
+use up_data_structs::budget::Value;
+use sp_runtime::traits::{CheckedAdd, CheckedSub};
+
+impl<T: Config> fungibles::Inspect<<T as SystemConfig>::AccountId> for Pallet<T>
+where
+ T: orml_tokens::Config<CurrencyId = AssetIds>,
+ BalanceOf<T>: From<<T as pallet_balances::Config>::Balance>,
+ BalanceOf<T>: From<<T as orml_tokens::Config>::Balance>,
+ <T as pallet_balances::Config>::Balance: From<BalanceOf<T>>,
+ <T as orml_tokens::Config>::Balance: From<BalanceOf<T>>,
+{
+ type AssetId = AssetIds;
+ type Balance = BalanceOf<T>;
+
+ fn total_issuance(asset: Self::AssetId) -> Self::Balance {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible total_issuance");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::total_issuance()
+ .into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::total_issuance(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ )
+ .into()
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => return Zero::zero(),
+ };
+ let collection_handle = match <CollectionHandle<T>>::try_get(target_collection_id) {
+ Ok(v) => v,
+ Err(_) => return Zero::zero(),
+ };
+ let collection = FungibleHandle::cast(collection_handle);
+ Self::Balance::try_from(collection.total_supply()).unwrap_or(Zero::zero())
+ }
+ }
+ }
+
+ fn minimum_balance(asset: Self::AssetId) -> Self::Balance {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible minimum_balance");
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::minimum_balance()
+ .into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::minimum_balance(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ )
+ .into()
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ AssetMetadatas::<T>::get(AssetIds::ForeignAssetId(fid))
+ .map(|x| x.minimal_balance)
+ .unwrap_or_else(Zero::zero)
+ }
+ }
+ }
+
+ fn balance(asset: Self::AssetId, who: &<T as SystemConfig>::AccountId) -> Self::Balance {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible balance");
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::balance(who).into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::balance(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ )
+ .into()
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => return Zero::zero(),
+ };
+ let collection_handle = match <CollectionHandle<T>>::try_get(target_collection_id) {
+ Ok(v) => v,
+ Err(_) => return Zero::zero(),
+ };
+ let collection = FungibleHandle::cast(collection_handle);
+ Self::Balance::try_from(
+ collection.balance(T::CrossAccountId::from_sub(who.clone()), TokenId(0)),
+ )
+ .unwrap_or(Zero::zero())
+ }
+ }
+ }
+
+ fn reducible_balance(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ keep_alive: bool,
+ ) -> Self::Balance {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible reducible_balance");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::reducible_balance(
+ who, keep_alive,
+ )
+ .into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::reducible_balance(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ keep_alive,
+ )
+ .into()
+ }
+ _ => Self::balance(asset, who),
+ }
+ }
+
+ fn can_deposit(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ mint: bool,
+ ) -> DepositConsequence {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible can_deposit");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::can_deposit(
+ who,
+ amount.into(),
+ mint,
+ )
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::can_deposit(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ amount.into(),
+ mint,
+ )
+ }
+ _ => {
+ if amount.is_zero() {
+ return DepositConsequence::Success;
+ }
+
+ let extential_deposit_value = T::ExistentialDeposit::get();
+ let ed_value: u128 = match extential_deposit_value.try_into() {
+ Ok(val) => val,
+ Err(_) => return DepositConsequence::CannotCreate,
+ };
+ let extential_deposit: Self::Balance = match ed_value.try_into() {
+ Ok(val) => val,
+ Err(_) => return DepositConsequence::CannotCreate,
+ };
+
+ let new_total_balance = match Self::balance(asset, who).checked_add(&amount) {
+ Some(x) => x,
+ None => return DepositConsequence::Overflow,
+ };
+
+ if new_total_balance < extential_deposit {
+ return DepositConsequence::BelowMinimum;
+ }
+
+ DepositConsequence::Success
+ }
+ }
+ }
+
+ fn can_withdraw(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ ) -> WithdrawConsequence<Self::Balance> {
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible can_withdraw");
+ let value: u128 = match amount.try_into() {
+ Ok(val) => val,
+ Err(_) => return WithdrawConsequence::UnknownAsset,
+ };
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ let this_amount: <T as pallet_balances::Config>::Balance = match value.try_into() {
+ Ok(val) => val,
+ Err(_) => {
+ return WithdrawConsequence::UnknownAsset;
+ }
+ };
+ match <pallet_balances::Pallet<T> as fungible::Inspect<T::AccountId>>::can_withdraw(
+ who,
+ this_amount,
+ ) {
+ WithdrawConsequence::NoFunds => WithdrawConsequence::NoFunds,
+ WithdrawConsequence::WouldDie => WithdrawConsequence::WouldDie,
+ WithdrawConsequence::UnknownAsset => WithdrawConsequence::UnknownAsset,
+ WithdrawConsequence::Underflow => WithdrawConsequence::Underflow,
+ WithdrawConsequence::Overflow => WithdrawConsequence::Overflow,
+ WithdrawConsequence::Frozen => WithdrawConsequence::Frozen,
+ WithdrawConsequence::Success => WithdrawConsequence::Success,
+ _ => WithdrawConsequence::NoFunds,
+ }
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ let parent_amount: <T as orml_tokens::Config>::Balance = match value.try_into() {
+ Ok(val) => val,
+ Err(_) => {
+ return WithdrawConsequence::UnknownAsset;
+ }
+ };
+ match <orml_tokens::Pallet<T> as fungibles::Inspect<T::AccountId>>::can_withdraw(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ parent_amount,
+ ) {
+ WithdrawConsequence::NoFunds => WithdrawConsequence::NoFunds,
+ WithdrawConsequence::WouldDie => WithdrawConsequence::WouldDie,
+ WithdrawConsequence::UnknownAsset => WithdrawConsequence::UnknownAsset,
+ WithdrawConsequence::Underflow => WithdrawConsequence::Underflow,
+ WithdrawConsequence::Overflow => WithdrawConsequence::Overflow,
+ WithdrawConsequence::Frozen => WithdrawConsequence::Frozen,
+ WithdrawConsequence::Success => WithdrawConsequence::Success,
+ _ => WithdrawConsequence::NoFunds,
+ }
+ }
+ _ => match Self::balance(asset, who).checked_sub(&amount) {
+ Some(_) => WithdrawConsequence::Success,
+ None => WithdrawConsequence::NoFunds,
+ },
+ }
+ }
+}
+
+impl<T: Config> fungibles::Mutate<<T as SystemConfig>::AccountId> for Pallet<T>
+where
+ T: orml_tokens::Config<CurrencyId = AssetIds>,
+ BalanceOf<T>: From<<T as pallet_balances::Config>::Balance>,
+ BalanceOf<T>: From<<T as orml_tokens::Config>::Balance>,
+ <T as pallet_balances::Config>::Balance: From<BalanceOf<T>>,
+ <T as orml_tokens::Config>::Balance: From<BalanceOf<T>>,
+ u128: From<BalanceOf<T>>,
+{
+ fn mint_into(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ ) -> DispatchResult {
+ //Self::do_mint(asset, who, amount, None)
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible mint_into {:?}", asset);
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ <pallet_balances::Pallet<T> as fungible::Mutate<T::AccountId>>::mint_into(
+ who,
+ amount.into(),
+ )
+ .into()
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ <orml_tokens::Pallet<T> as fungibles::Mutate<T::AccountId>>::mint_into(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ amount.into(),
+ )
+ .into()
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => {
+ return Err(DispatchError::Other(
+ "Associated collection not found for asset",
+ ))
+ }
+ };
+ let collection =
+ FungibleHandle::cast(<CollectionHandle<T>>::try_get(target_collection_id)?);
+ let account = T::CrossAccountId::from_sub(who.clone());
+
+ let amount_data: pallet_fungible::CreateItemData<T> =
+ (account.clone(), amount.into());
+
+ pallet_fungible::Pallet::<T>::create_item_foreign(
+ &collection,
+ &account,
+ amount_data,
+ &Value::new(0),
+ )?;
+
+ Ok(())
+ }
+ }
+ }
+
+ fn burn_from(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ ) -> Result<Self::Balance, DispatchError> {
+ // let f = DebitFlags { keep_alive: false, best_effort: false };
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible burn_from");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ match <pallet_balances::Pallet<T> as fungible::Mutate<T::AccountId>>::burn_from(
+ who,
+ amount.into(),
+ ) {
+ Ok(v) => Ok(v.into()),
+ Err(e) => Err(e),
+ }
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ match <orml_tokens::Pallet<T> as fungibles::Mutate<T::AccountId>>::burn_from(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ who,
+ amount.into(),
+ ) {
+ Ok(v) => Ok(v.into()),
+ Err(e) => Err(e),
+ }
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => {
+ return Err(DispatchError::Other(
+ "Associated collection not found for asset",
+ ))
+ }
+ };
+ let collection =
+ FungibleHandle::cast(<CollectionHandle<T>>::try_get(target_collection_id)?);
+ pallet_fungible::Pallet::<T>::burn_foreign(
+ &collection,
+ &T::CrossAccountId::from_sub(who.clone()),
+ amount.into(),
+ )?;
+
+ Ok(amount)
+ }
+ }
+ }
+
+ fn slash(
+ asset: Self::AssetId,
+ who: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ ) -> Result<Self::Balance, DispatchError> {
+ // let f = DebitFlags { keep_alive: false, best_effort: true };
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible slash");
+ Ok(Self::burn_from(asset, who, amount)?)
+ }
+}
+
+impl<T: Config> fungibles::Transfer<T::AccountId> for Pallet<T>
+where
+ T: orml_tokens::Config<CurrencyId = AssetIds>,
+ BalanceOf<T>: From<<T as pallet_balances::Config>::Balance>,
+ BalanceOf<T>: From<<T as orml_tokens::Config>::Balance>,
+ <T as pallet_balances::Config>::Balance: From<BalanceOf<T>>,
+ <T as orml_tokens::Config>::Balance: From<BalanceOf<T>>,
+ u128: From<BalanceOf<T>>,
+{
+ fn transfer(
+ asset: Self::AssetId,
+ source: &<T as SystemConfig>::AccountId,
+ dest: &<T as SystemConfig>::AccountId,
+ amount: Self::Balance,
+ keep_alive: bool,
+ ) -> Result<Self::Balance, DispatchError> {
+ // let f = TransferFlags { keep_alive, best_effort: false, burn_dust: false };
+ log::trace!(target: "fassets::impl_foreign_assets", "impl_fungible transfer");
+
+ match asset {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => {
+ match <pallet_balances::Pallet<T> as fungible::Transfer<T::AccountId>>::transfer(
+ source,
+ dest,
+ amount.into(),
+ keep_alive,
+ ) {
+ Ok(_) => Ok(amount),
+ Err(_) => Err(DispatchError::Other(
+ "Bad amount to relay chain value conversion",
+ )),
+ }
+ }
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => {
+ match <orml_tokens::Pallet<T> as fungibles::Transfer<T::AccountId>>::transfer(
+ AssetIds::NativeAssetId(NativeCurrency::Parent),
+ source,
+ dest,
+ amount.into(),
+ keep_alive,
+ ) {
+ Ok(_) => Ok(amount),
+ Err(e) => Err(e),
+ }
+ }
+ AssetIds::ForeignAssetId(fid) => {
+ let target_collection_id = match <AssetBinding<T>>::get(fid) {
+ Some(v) => v,
+ None => {
+ return Err(DispatchError::Other(
+ "Associated collection not found for asset",
+ ))
+ }
+ };
+ let collection =
+ FungibleHandle::cast(<CollectionHandle<T>>::try_get(target_collection_id)?);
+
+ pallet_fungible::Pallet::<T>::transfer(
+ &collection,
+ &T::CrossAccountId::from_sub(source.clone()),
+ &T::CrossAccountId::from_sub(dest.clone()),
+ amount.into(),
+ &Value::new(0),
+ )?;
+
+ Ok(amount)
+ }
+ }
+ }
+}
pallets/foreign-assets/src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/src/lib.rs
@@ -0,0 +1,498 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+//! # Foreign assets
+//!
+//! - [`Config`]
+//! - [`Call`]
+//! - [`Pallet`]
+//!
+//! ## Overview
+//!
+//! The foreign assests pallet provides functions for:
+//!
+//! - Local and foreign assets management. The foreign assets can be updated without runtime upgrade.
+//! - Bounds between asset and target collection for cross chain transfer and inner transfers.
+//!
+//! ## Overview
+//!
+//! Under construction
+
+#![cfg_attr(not(feature = "std"), no_std)]
+#![allow(clippy::unused_unit)]
+
+use frame_support::{
+ dispatch::DispatchResult,
+ ensure,
+ pallet_prelude::*,
+ traits::{fungible, fungibles, Currency, EnsureOrigin},
+ RuntimeDebug,
+};
+use frame_system::pallet_prelude::*;
+use up_data_structs::{CollectionMode};
+use pallet_fungible::{Pallet as PalletFungible};
+use scale_info::{TypeInfo};
+use sp_runtime::{
+ traits::{One, Zero},
+ ArithmeticError,
+};
+use sp_std::{boxed::Box, vec::Vec};
+use up_data_structs::{CollectionId, TokenId, CreateCollectionData};
+
+// NOTE:v1::MultiLocation is used in storages, we would need to do migration if upgrade the
+// MultiLocation in the future.
+use xcm::opaque::latest::prelude::XcmError;
+use xcm::{v1::MultiLocation, VersionedMultiLocation};
+use xcm_executor::{traits::WeightTrader, Assets};
+
+use pallet_common::erc::CrossAccountId;
+
+#[cfg(feature = "std")]
+use serde::{Deserialize, Serialize};
+
+// TODO: Move to primitives
+// Id of native currency.
+// 0 - QTZ\UNQ
+// 1 - KSM\DOT
+#[derive(
+ Clone,
+ Copy,
+ Eq,
+ PartialEq,
+ PartialOrd,
+ Ord,
+ MaxEncodedLen,
+ RuntimeDebug,
+ Encode,
+ Decode,
+ TypeInfo,
+)]
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+pub enum NativeCurrency {
+ Here = 0,
+ Parent = 1,
+}
+
+#[derive(
+ Clone,
+ Copy,
+ Eq,
+ PartialEq,
+ PartialOrd,
+ Ord,
+ MaxEncodedLen,
+ RuntimeDebug,
+ Encode,
+ Decode,
+ TypeInfo,
+)]
+#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+pub enum AssetIds {
+ ForeignAssetId(ForeignAssetId),
+ NativeAssetId(NativeCurrency),
+}
+
+pub trait TryAsForeign<T, F> {
+ fn try_as_foreign(asset: T) -> Option<F>;
+}
+
+impl TryAsForeign<AssetIds, ForeignAssetId> for AssetIds {
+ fn try_as_foreign(asset: AssetIds) -> Option<ForeignAssetId> {
+ match asset {
+ AssetIds::ForeignAssetId(id) => Some(id),
+ _ => None,
+ }
+ }
+}
+
+pub type ForeignAssetId = u32;
+pub type CurrencyId = AssetIds;
+
+mod impl_fungibles;
+pub mod weights;
+
+#[cfg(feature = "runtime-benchmarks")]
+mod benchmarking;
+
+pub use module::*;
+pub use weights::WeightInfo;
+
+/// Type alias for currency balance.
+pub type BalanceOf<T> =
+ <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
+
+/// A mapping between ForeignAssetId and AssetMetadata.
+pub trait AssetIdMapping<ForeignAssetId, MultiLocation, AssetMetadata> {
+ /// Returns the AssetMetadata associated with a given ForeignAssetId.
+ fn get_asset_metadata(foreign_asset_id: ForeignAssetId) -> Option<AssetMetadata>;
+ /// Returns the MultiLocation associated with a given ForeignAssetId.
+ fn get_multi_location(foreign_asset_id: ForeignAssetId) -> Option<MultiLocation>;
+ /// Returns the CurrencyId associated with a given MultiLocation.
+ fn get_currency_id(multi_location: MultiLocation) -> Option<CurrencyId>;
+}
+
+pub struct XcmForeignAssetIdMapping<T>(sp_std::marker::PhantomData<T>);
+
+impl<T: Config> AssetIdMapping<ForeignAssetId, MultiLocation, AssetMetadata<BalanceOf<T>>>
+ for XcmForeignAssetIdMapping<T>
+{
+ fn get_asset_metadata(foreign_asset_id: ForeignAssetId) -> Option<AssetMetadata<BalanceOf<T>>> {
+ log::trace!(target: "fassets::asset_metadatas", "call");
+ Pallet::<T>::asset_metadatas(AssetIds::ForeignAssetId(foreign_asset_id))
+ }
+
+ fn get_multi_location(foreign_asset_id: ForeignAssetId) -> Option<MultiLocation> {
+ log::trace!(target: "fassets::get_multi_location", "call");
+ Pallet::<T>::foreign_asset_locations(foreign_asset_id)
+ }
+
+ fn get_currency_id(multi_location: MultiLocation) -> Option<CurrencyId> {
+ log::trace!(target: "fassets::get_currency_id", "call");
+ Some(AssetIds::ForeignAssetId(
+ Pallet::<T>::location_to_currency_ids(multi_location).unwrap_or(0),
+ ))
+ }
+}
+
+#[frame_support::pallet]
+pub mod module {
+ use super::*;
+
+ #[pallet::config]
+ pub trait Config:
+ frame_system::Config
+ + pallet_common::Config
+ + pallet_fungible::Config
+ + orml_tokens::Config
+ + pallet_balances::Config
+ {
+ /// The overarching event type.
+ type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
+
+ /// Currency type for withdraw and balance storage.
+ type Currency: Currency<Self::AccountId>;
+
+ /// Required origin for registering asset.
+ type RegisterOrigin: EnsureOrigin<Self::Origin>;
+
+ /// Weight information for the extrinsics in this module.
+ type WeightInfo: WeightInfo;
+ }
+
+ #[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, TypeInfo)]
+ pub struct AssetMetadata<Balance> {
+ pub name: Vec<u8>,
+ pub symbol: Vec<u8>,
+ pub decimals: u8,
+ pub minimal_balance: Balance,
+ }
+
+ #[pallet::error]
+ pub enum Error<T> {
+ /// The given location could not be used (e.g. because it cannot be expressed in the
+ /// desired version of XCM).
+ BadLocation,
+ /// MultiLocation existed
+ MultiLocationExisted,
+ /// AssetId not exists
+ AssetIdNotExists,
+ /// AssetId exists
+ AssetIdExisted,
+ }
+
+ #[pallet::event]
+ #[pallet::generate_deposit(fn deposit_event)]
+ pub enum Event<T: Config> {
+ /// The foreign asset registered.
+ ForeignAssetRegistered {
+ asset_id: ForeignAssetId,
+ asset_address: MultiLocation,
+ metadata: AssetMetadata<BalanceOf<T>>,
+ },
+ /// The foreign asset updated.
+ ForeignAssetUpdated {
+ asset_id: ForeignAssetId,
+ asset_address: MultiLocation,
+ metadata: AssetMetadata<BalanceOf<T>>,
+ },
+ /// The asset registered.
+ AssetRegistered {
+ asset_id: AssetIds,
+ metadata: AssetMetadata<BalanceOf<T>>,
+ },
+ /// The asset updated.
+ AssetUpdated {
+ asset_id: AssetIds,
+ metadata: AssetMetadata<BalanceOf<T>>,
+ },
+ }
+
+ /// Next available Foreign AssetId ID.
+ ///
+ /// NextForeignAssetId: ForeignAssetId
+ #[pallet::storage]
+ #[pallet::getter(fn next_foreign_asset_id)]
+ pub type NextForeignAssetId<T: Config> = StorageValue<_, ForeignAssetId, ValueQuery>;
+ /// The storages for MultiLocations.
+ ///
+ /// ForeignAssetLocations: map ForeignAssetId => Option<MultiLocation>
+ #[pallet::storage]
+ #[pallet::getter(fn foreign_asset_locations)]
+ pub type ForeignAssetLocations<T: Config> =
+ StorageMap<_, Twox64Concat, ForeignAssetId, MultiLocation, OptionQuery>;
+
+ /// The storages for CurrencyIds.
+ ///
+ /// LocationToCurrencyIds: map MultiLocation => Option<ForeignAssetId>
+ #[pallet::storage]
+ #[pallet::getter(fn location_to_currency_ids)]
+ pub type LocationToCurrencyIds<T: Config> =
+ StorageMap<_, Twox64Concat, MultiLocation, ForeignAssetId, OptionQuery>;
+
+ /// The storages for AssetMetadatas.
+ ///
+ /// AssetMetadatas: map AssetIds => Option<AssetMetadata>
+ #[pallet::storage]
+ #[pallet::getter(fn asset_metadatas)]
+ pub type AssetMetadatas<T: Config> =
+ StorageMap<_, Twox64Concat, AssetIds, AssetMetadata<BalanceOf<T>>, OptionQuery>;
+
+ /// The storages for assets to fungible collection binding
+ ///
+ #[pallet::storage]
+ #[pallet::getter(fn asset_binding)]
+ pub type AssetBinding<T: Config> =
+ StorageMap<_, Twox64Concat, ForeignAssetId, CollectionId, OptionQuery>;
+
+ #[pallet::pallet]
+ #[pallet::without_storage_info]
+ pub struct Pallet<T>(_);
+
+ #[pallet::call]
+ impl<T: Config> Pallet<T> {
+ #[pallet::weight(<T as Config>::WeightInfo::register_foreign_asset())]
+ pub fn register_foreign_asset(
+ origin: OriginFor<T>,
+ owner: T::AccountId,
+ location: Box<VersionedMultiLocation>,
+ metadata: Box<AssetMetadata<BalanceOf<T>>>,
+ ) -> DispatchResult {
+ T::RegisterOrigin::ensure_origin(origin.clone())?;
+
+ let location: MultiLocation = (*location)
+ .try_into()
+ .map_err(|()| Error::<T>::BadLocation)?;
+
+ let md = metadata.clone();
+ let name: Vec<u16> = md.name.into_iter().map(|x| x as u16).collect::<Vec<u16>>();
+ let mut description: Vec<u16> = "Foreign assets collection for "
+ .encode_utf16()
+ .collect::<Vec<u16>>();
+ description.append(&mut name.clone());
+
+ let data: CreateCollectionData<T::AccountId> = CreateCollectionData {
+ name: name.try_into().unwrap(),
+ description: description.try_into().unwrap(),
+ mode: CollectionMode::Fungible(md.decimals),
+ ..Default::default()
+ };
+
+ let bounded_collection_id = <PalletFungible<T>>::init_foreign_collection(
+ CrossAccountId::from_sub(owner),
+ data,
+ )?;
+ let foreign_asset_id =
+ Self::do_register_foreign_asset(&location, &metadata, bounded_collection_id)?;
+
+ Self::deposit_event(Event::<T>::ForeignAssetRegistered {
+ asset_id: foreign_asset_id,
+ asset_address: location,
+ metadata: *metadata,
+ });
+ Ok(())
+ }
+
+ #[pallet::weight(<T as Config>::WeightInfo::update_foreign_asset())]
+ pub fn update_foreign_asset(
+ origin: OriginFor<T>,
+ foreign_asset_id: ForeignAssetId,
+ location: Box<VersionedMultiLocation>,
+ metadata: Box<AssetMetadata<BalanceOf<T>>>,
+ ) -> DispatchResult {
+ T::RegisterOrigin::ensure_origin(origin)?;
+
+ let location: MultiLocation = (*location)
+ .try_into()
+ .map_err(|()| Error::<T>::BadLocation)?;
+ Self::do_update_foreign_asset(foreign_asset_id, &location, &metadata)?;
+
+ Self::deposit_event(Event::<T>::ForeignAssetUpdated {
+ asset_id: foreign_asset_id,
+ asset_address: location,
+ metadata: *metadata,
+ });
+ Ok(())
+ }
+ }
+}
+
+impl<T: Config> Pallet<T> {
+ fn get_next_foreign_asset_id() -> Result<ForeignAssetId, DispatchError> {
+ NextForeignAssetId::<T>::try_mutate(|current| -> Result<ForeignAssetId, DispatchError> {
+ let id = *current;
+ *current = current
+ .checked_add(One::one())
+ .ok_or(ArithmeticError::Overflow)?;
+ Ok(id)
+ })
+ }
+
+ fn do_register_foreign_asset(
+ location: &MultiLocation,
+ metadata: &AssetMetadata<BalanceOf<T>>,
+ bounded_collection_id: CollectionId,
+ ) -> Result<ForeignAssetId, DispatchError> {
+ let foreign_asset_id = Self::get_next_foreign_asset_id()?;
+ LocationToCurrencyIds::<T>::try_mutate(location, |maybe_currency_ids| -> DispatchResult {
+ ensure!(
+ maybe_currency_ids.is_none(),
+ Error::<T>::MultiLocationExisted
+ );
+ *maybe_currency_ids = Some(foreign_asset_id);
+ // *maybe_currency_ids = Some(CurrencyId::ForeignAsset(foreign_asset_id));
+
+ ForeignAssetLocations::<T>::try_mutate(
+ foreign_asset_id,
+ |maybe_location| -> DispatchResult {
+ ensure!(maybe_location.is_none(), Error::<T>::MultiLocationExisted);
+ *maybe_location = Some(location.clone());
+
+ AssetMetadatas::<T>::try_mutate(
+ AssetIds::ForeignAssetId(foreign_asset_id),
+ |maybe_asset_metadatas| -> DispatchResult {
+ ensure!(maybe_asset_metadatas.is_none(), Error::<T>::AssetIdExisted);
+ *maybe_asset_metadatas = Some(metadata.clone());
+ Ok(())
+ },
+ )
+ },
+ )?;
+
+ AssetBinding::<T>::try_mutate(foreign_asset_id, |collection_id| -> DispatchResult {
+ *collection_id = Some(bounded_collection_id);
+ Ok(())
+ })
+ })?;
+
+ Ok(foreign_asset_id)
+ }
+
+ fn do_update_foreign_asset(
+ foreign_asset_id: ForeignAssetId,
+ location: &MultiLocation,
+ metadata: &AssetMetadata<BalanceOf<T>>,
+ ) -> DispatchResult {
+ ForeignAssetLocations::<T>::try_mutate(
+ foreign_asset_id,
+ |maybe_multi_locations| -> DispatchResult {
+ let old_multi_locations = maybe_multi_locations
+ .as_mut()
+ .ok_or(Error::<T>::AssetIdNotExists)?;
+
+ AssetMetadatas::<T>::try_mutate(
+ AssetIds::ForeignAssetId(foreign_asset_id),
+ |maybe_asset_metadatas| -> DispatchResult {
+ ensure!(
+ maybe_asset_metadatas.is_some(),
+ Error::<T>::AssetIdNotExists
+ );
+
+ // modify location
+ if location != old_multi_locations {
+ LocationToCurrencyIds::<T>::remove(old_multi_locations.clone());
+ LocationToCurrencyIds::<T>::try_mutate(
+ location,
+ |maybe_currency_ids| -> DispatchResult {
+ ensure!(
+ maybe_currency_ids.is_none(),
+ Error::<T>::MultiLocationExisted
+ );
+ // *maybe_currency_ids = Some(CurrencyId::ForeignAsset(foreign_asset_id));
+ *maybe_currency_ids = Some(foreign_asset_id);
+ Ok(())
+ },
+ )?;
+ }
+ *maybe_asset_metadatas = Some(metadata.clone());
+ *old_multi_locations = location.clone();
+ Ok(())
+ },
+ )
+ },
+ )
+ }
+}
+
+pub use frame_support::{
+ traits::{
+ fungibles::{Balanced, CreditOf},
+ tokens::currency::Currency as CurrencyT,
+ OnUnbalanced as OnUnbalancedT,
+ },
+ weights::{WeightToFeePolynomial, WeightToFee},
+};
+
+pub struct FreeForAll<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+>(
+ Weight,
+ Currency::Balance,
+ PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>,
+);
+
+impl<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+ > WeightTrader for FreeForAll<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
+{
+ fn new() -> Self {
+ Self(0, Zero::zero(), PhantomData)
+ }
+
+ fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result<Assets, XcmError> {
+ log::trace!(target: "fassets::weight", "buy_weight weight: {:?}, payment: {:?}", weight, payment);
+ Ok(payment)
+ }
+}
+impl<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced> Drop
+ for FreeForAll<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
+where
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+{
+ fn drop(&mut self) {
+ OnUnbalanced::on_unbalanced(Currency::issue(self.1));
+ }
+}
pallets/foreign-assets/src/weights.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/foreign-assets/src/weights.rs
@@ -0,0 +1,94 @@
+// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
+
+//! Autogenerated weights for pallet_foreign_assets
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2022-09-16, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
+
+// Executed Command:
+// target/release/unique-collator
+// benchmark
+// pallet
+// --pallet
+// pallet-foreign-assets
+// --wasm-execution
+// compiled
+// --extrinsic
+// *
+// --template
+// .maintain/frame-weight-template.hbs
+// --steps=50
+// --repeat=80
+// --heap-pages=4096
+// --output=./pallets/foreign-assets/src/weights.rs
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+#![allow(clippy::unnecessary_cast)]
+
+use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
+use sp_std::marker::PhantomData;
+
+/// Weight functions needed for pallet_foreign_assets.
+pub trait WeightInfo {
+ fn register_foreign_asset() -> Weight;
+ fn update_foreign_asset() -> Weight;
+}
+
+/// Weights for pallet_foreign_assets using the Substrate node and recommended hardware.
+pub struct SubstrateWeight<T>(PhantomData<T>);
+impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
+ // Storage: Common CreatedCollectionCount (r:1 w:1)
+ // Storage: Common DestroyedCollectionCount (r:1 w:0)
+ // Storage: System Account (r:2 w:2)
+ // Storage: ForeignAssets NextForeignAssetId (r:1 w:1)
+ // Storage: ForeignAssets LocationToCurrencyIds (r:1 w:1)
+ // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
+ // Storage: ForeignAssets AssetMetadatas (r:1 w:1)
+ // Storage: ForeignAssets AssetBinding (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:0 w:1)
+ // Storage: Common CollectionProperties (r:0 w:1)
+ // Storage: Common CollectionById (r:0 w:1)
+ fn register_foreign_asset() -> Weight {
+ (52_161_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(9 as Weight))
+ .saturating_add(T::DbWeight::get().writes(11 as Weight))
+ }
+ // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
+ // Storage: ForeignAssets AssetMetadatas (r:1 w:1)
+ fn update_foreign_asset() -> Weight {
+ (19_111_000 as Weight)
+ .saturating_add(T::DbWeight::get().reads(2 as Weight))
+ .saturating_add(T::DbWeight::get().writes(2 as Weight))
+ }
+}
+
+// For backwards compatibility and tests
+impl WeightInfo for () {
+ // Storage: Common CreatedCollectionCount (r:1 w:1)
+ // Storage: Common DestroyedCollectionCount (r:1 w:0)
+ // Storage: System Account (r:2 w:2)
+ // Storage: ForeignAssets NextForeignAssetId (r:1 w:1)
+ // Storage: ForeignAssets LocationToCurrencyIds (r:1 w:1)
+ // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
+ // Storage: ForeignAssets AssetMetadatas (r:1 w:1)
+ // Storage: ForeignAssets AssetBinding (r:1 w:1)
+ // Storage: Common CollectionPropertyPermissions (r:0 w:1)
+ // Storage: Common CollectionProperties (r:0 w:1)
+ // Storage: Common CollectionById (r:0 w:1)
+ fn register_foreign_asset() -> Weight {
+ (52_161_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(9 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(11 as Weight))
+ }
+ // Storage: ForeignAssets ForeignAssetLocations (r:1 w:1)
+ // Storage: ForeignAssets AssetMetadatas (r:1 w:1)
+ fn update_foreign_asset() -> Weight {
+ (19_111_000 as Weight)
+ .saturating_add(RocksDbWeight::get().reads(2 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(2 as Weight))
+ }
+}
pallets/fungible/src/erc.rsdiffbeforeafterboth--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -199,7 +199,7 @@
ERC20,
ERC20Mintable,
ERC20UniqueExtensions,
- Collection(common_mut, CollectionHandle<T>),
+ Collection(via(common_mut returns CollectionHandle<T>)),
)
)]
impl<T: Config> FungibleHandle<T> where T::AccountId: From<[u8; 32]> + AsRef<[u8; 32]> {}
pallets/fungible/src/lib.rsdiffbeforeafterboth--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -83,8 +83,8 @@
use frame_support::{ensure};
use pallet_evm::account::CrossAccountId;
use up_data_structs::{
- AccessMode, CollectionId, TokenId, CreateCollectionData, mapping::TokenAddressMapping,
- budget::Budget,
+ AccessMode, CollectionId, CollectionFlags, TokenId, CreateCollectionData,
+ mapping::TokenAddressMapping, budget::Budget,
};
use pallet_common::{
Error as CommonError, Event as CommonEvent, Pallet as PalletCommon,
@@ -212,9 +212,25 @@
owner: T::CrossAccountId,
data: CreateCollectionData<T::AccountId>,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, data, false)
+ <PalletCommon<T>>::init_collection(owner, data, CollectionFlags::default())
}
+ /// Initializes the collection with ForeignCollection flag. Returns [CollectionId] on success, [DispatchError] otherwise.
+ pub fn init_foreign_collection(
+ owner: T::CrossAccountId,
+ data: CreateCollectionData<T::AccountId>,
+ ) -> Result<CollectionId, DispatchError> {
+ let id = <PalletCommon<T>>::init_collection(
+ owner,
+ data,
+ CollectionFlags {
+ foreign: true,
+ ..Default::default()
+ },
+ )?;
+ Ok(id)
+ }
+
/// Destroys a collection.
pub fn destroy_collection(
collection: FungibleHandle<T>,
@@ -257,6 +273,9 @@
.checked_sub(amount)
.ok_or(<CommonError<T>>::TokenValueTooLow)?;
+ // Foreign collection check
+ ensure!(!collection.flags.foreign, <CommonError<T>>::NoPermission);
+
if collection.permissions.access() == AccessMode::AllowList {
collection.check_allowlist(owner)?;
}
@@ -288,6 +307,46 @@
Ok(())
}
+ /// Burns the specified amount of the token.
+ pub fn burn_foreign(
+ collection: &FungibleHandle<T>,
+ owner: &T::CrossAccountId,
+ amount: u128,
+ ) -> DispatchResult {
+ let total_supply = <TotalSupply<T>>::get(collection.id)
+ .checked_sub(amount)
+ .ok_or(<CommonError<T>>::TokenValueTooLow)?;
+
+ let balance = <Balance<T>>::get((collection.id, owner))
+ .checked_sub(amount)
+ .ok_or(<CommonError<T>>::TokenValueTooLow)?;
+ // =========
+
+ if balance == 0 {
+ <Balance<T>>::remove((collection.id, owner));
+ <PalletStructure<T>>::unnest_if_nested(owner, collection.id, TokenId::default());
+ } else {
+ <Balance<T>>::insert((collection.id, owner), balance);
+ }
+ <TotalSupply<T>>::insert(collection.id, total_supply);
+
+ <PalletEvm<T>>::deposit_log(
+ ERC20Events::Transfer {
+ from: *owner.as_eth(),
+ to: H160::default(),
+ value: amount.into(),
+ }
+ .to_log(collection_id_to_address(collection.id)),
+ );
+ <PalletCommon<T>>::deposit_event(CommonEvent::ItemDestroyed(
+ collection.id,
+ TokenId::default(),
+ owner.clone(),
+ amount,
+ ));
+ Ok(())
+ }
+
/// Transfers the specified amount of tokens. Will check that
/// the transfer is allowed for the token.
///
@@ -366,25 +425,14 @@
}
/// Minting tokens for multiple IDs.
- /// See [`create_item`][`Pallet::create_item`] for more details.
- pub fn create_multiple_items(
+ /// It is a utility function used in [`create_multiple_items`][`Pallet::create_multiple_items`]
+ /// and [`create_multiple_items_foreign`][`Pallet::create_multiple_items_foreign`]
+ pub fn create_multiple_items_common(
collection: &FungibleHandle<T>,
sender: &T::CrossAccountId,
data: BTreeMap<T::CrossAccountId, u128>,
nesting_budget: &dyn Budget,
) -> DispatchResult {
- if !collection.is_owner_or_admin(sender) {
- ensure!(
- collection.permissions.mint_mode(),
- <CommonError<T>>::PublicMintingNotAllowed
- );
- collection.check_allowlist(sender)?;
-
- for (owner, _) in data.iter() {
- collection.check_allowlist(owner)?;
- }
- }
-
let total_supply = data
.iter()
.map(|(_, v)| *v)
@@ -442,6 +490,43 @@
Ok(())
}
+ /// Minting tokens for multiple IDs.
+ /// See [`create_item`][`Pallet::create_item`] for more details.
+ pub fn create_multiple_items(
+ collection: &FungibleHandle<T>,
+ sender: &T::CrossAccountId,
+ data: BTreeMap<T::CrossAccountId, u128>,
+ nesting_budget: &dyn Budget,
+ ) -> DispatchResult {
+ // Foreign collection check
+ ensure!(!collection.flags.foreign, <CommonError<T>>::NoPermission);
+
+ if !collection.is_owner_or_admin(sender) {
+ ensure!(
+ collection.permissions.mint_mode(),
+ <CommonError<T>>::PublicMintingNotAllowed
+ );
+ collection.check_allowlist(sender)?;
+
+ for (owner, _) in data.iter() {
+ collection.check_allowlist(owner)?;
+ }
+ }
+
+ Self::create_multiple_items_common(collection, sender, data, nesting_budget)
+ }
+
+ /// Minting tokens for multiple IDs.
+ /// See [`create_item_foreign`][`Pallet::create_item_foreign`] for more details.
+ pub fn create_multiple_items_foreign(
+ collection: &FungibleHandle<T>,
+ sender: &T::CrossAccountId,
+ data: BTreeMap<T::CrossAccountId, u128>,
+ nesting_budget: &dyn Budget,
+ ) -> DispatchResult {
+ Self::create_multiple_items_common(collection, sender, data, nesting_budget)
+ }
+
fn set_allowance_unchecked(
collection: &FungibleHandle<T>,
owner: &T::CrossAccountId,
@@ -615,6 +700,24 @@
)
}
+ /// Creates fungible token.
+ ///
+ /// - `data`: Contains user who will become the owners of the tokens and amount
+ /// of tokens he will receive.
+ pub fn create_item_foreign(
+ collection: &FungibleHandle<T>,
+ sender: &T::CrossAccountId,
+ data: CreateItemData<T>,
+ nesting_budget: &dyn Budget,
+ ) -> DispatchResult {
+ Self::create_multiple_items_foreign(
+ collection,
+ sender,
+ [(data.0, data.1)].into_iter().collect(),
+ nesting_budget,
+ )
+ }
+
/// Returns 10 tokens owners in no particular order
///
/// There is no direct way to get token holders in ascending order,
pallets/fungible/src/stubs/UniqueFungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/fungible/src/stubs/UniqueFungible.soldiffbeforeafterboth--- a/pallets/fungible/src/stubs/UniqueFungible.sol
+++ b/pallets/fungible/src/stubs/UniqueFungible.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -22,7 +18,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
contract Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -30,9 +26,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
+ function setCollectionProperty(string memory key, bytes memory value) public {
require(false, stub_error);
key;
value;
@@ -58,11 +52,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
+ function collectionProperty(string memory key) public view returns (bytes memory) {
require(false, stub_error);
key;
dummy;
@@ -95,6 +85,7 @@
dummy = 0;
}
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() public view returns (bool) {
@@ -124,9 +115,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() public view returns (Tuple6 memory) {
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() public view returns (Tuple6 memory) {
require(false, stub_error);
dummy;
return Tuple6(0x0000000000000000000000000000000000000000, 0);
@@ -234,9 +225,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
+ function setCollectionNesting(bool enable, address[] memory collections) public {
require(false, stub_error);
enable;
collections;
@@ -353,9 +342,9 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() public returns (string memory) {
+ function uniqueCollectionType() public view returns (string memory) {
require(false, stub_error);
- dummy = 0;
+ dummy;
return "";
}
@@ -450,11 +439,7 @@
/// @dev inlined interface
contract ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @dev the ERC-165 identifier for this interface is 0x942e8b22
@@ -537,11 +522,7 @@
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- public
- view
- returns (uint256)
- {
+ function allowance(address owner, address spender) public view returns (uint256) {
require(false, stub_error);
owner;
spender;
@@ -550,11 +531,4 @@
}
}
-contract UniqueFungible is
- Dummy,
- ERC165,
- ERC20,
- ERC20Mintable,
- ERC20UniqueExtensions,
- Collection
-{}
+contract UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}
pallets/nonfungible/src/erc.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -736,7 +736,7 @@
ERC721UniqueExtensions,
ERC721Mintable,
ERC721Burnable,
- Collection(common_mut, CollectionHandle<T>),
+ Collection(via(common_mut returns CollectionHandle<T>)),
TokenProperties,
)
)]
pallets/nonfungible/src/lib.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -100,10 +100,10 @@
weights::{PostDispatchInfo, Pays},
};
use up_data_structs::{
- AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,
- mapping::TokenAddressMapping, budget::Budget, Property, PropertyPermission, PropertyKey,
- PropertyValue, PropertyKeyPermission, Properties, PropertyScope, TrySetProperty, TokenChild,
- AuxPropertyValue,
+ AccessMode, CollectionId, CollectionFlags, CustomDataLimit, TokenId, CreateCollectionData,
+ CreateNftExData, mapping::TokenAddressMapping, budget::Budget, Property, PropertyPermission,
+ PropertyKey, PropertyValue, PropertyKeyPermission, Properties, PropertyScope, TrySetProperty,
+ TokenChild, AuxPropertyValue,
};
use pallet_evm::{account::CrossAccountId, Pallet as PalletEvm};
use pallet_common::{
@@ -408,7 +408,14 @@
data: CreateCollectionData<T::AccountId>,
is_external: bool,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, data, is_external)
+ <PalletCommon<T>>::init_collection(
+ owner,
+ data,
+ CollectionFlags {
+ external: is_external,
+ ..Default::default()
+ },
+ )
}
/// Destroy NFT collection
pallets/nonfungible/src/stubs/UniqueNFT.rawdiffbeforeafterbothbinary blob — no preview
pallets/nonfungible/src/stubs/UniqueNFT.soldiffbeforeafterboth--- a/pallets/nonfungible/src/stubs/UniqueNFT.sol
+++ b/pallets/nonfungible/src/stubs/UniqueNFT.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -85,11 +81,7 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- public
- view
- returns (bytes memory)
- {
+ function property(uint256 tokenId, string memory key) public view returns (bytes memory) {
require(false, stub_error);
tokenId;
key;
@@ -99,7 +91,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
contract Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -107,9 +99,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
+ function setCollectionProperty(string memory key, bytes memory value) public {
require(false, stub_error);
key;
value;
@@ -135,11 +125,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
+ function collectionProperty(string memory key) public view returns (bytes memory) {
require(false, stub_error);
key;
dummy;
@@ -172,6 +158,7 @@
dummy = 0;
}
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() public view returns (bool) {
@@ -201,9 +188,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() public view returns (Tuple17 memory) {
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() public view returns (Tuple17 memory) {
require(false, stub_error);
dummy;
return Tuple17(0x0000000000000000000000000000000000000000, 0);
@@ -311,9 +298,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
+ function setCollectionNesting(bool enable, address[] memory collections) public {
require(false, stub_error);
enable;
collections;
@@ -430,9 +415,9 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() public returns (string memory) {
+ function uniqueCollectionType() public view returns (string memory) {
require(false, stub_error);
- dummy = 0;
+ dummy;
return "";
}
@@ -605,10 +590,7 @@
/// @param tokenIds IDs of the minted NFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- public
- returns (bool)
- {
+ function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
require(false, stub_error);
to;
tokenIds;
@@ -623,10 +605,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- public
- returns (bool)
- {
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) {
require(false, stub_error);
to;
tokens;
@@ -661,11 +640,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- public
- view
- returns (uint256)
- {
+ function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(false, stub_error);
owner;
index;
@@ -728,21 +703,9 @@
/// @dev inlined interface
contract ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -870,11 +833,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- public
- view
- returns (address)
- {
+ function isApprovedForAll(address owner, address operator) public view returns (address) {
require(false, stub_error);
owner;
operator;
pallets/refungible/src/erc.rsdiffbeforeafterboth--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -785,7 +785,7 @@
ERC721UniqueExtensions,
ERC721Mintable,
ERC721Burnable,
- Collection(common_mut, CollectionHandle<T>),
+ Collection(via(common_mut returns CollectionHandle<T>)),
TokenProperties,
)
)]
pallets/refungible/src/lib.rsdiffbeforeafterboth--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -112,10 +112,10 @@
use sp_runtime::{ArithmeticError, DispatchError, DispatchResult, TransactionOutcome};
use sp_std::{vec::Vec, vec, collections::btree_map::BTreeMap};
use up_data_structs::{
- AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionPropertiesVec,
- CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping, MAX_ITEMS_PER_BATCH,
- MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission, PropertyPermission,
- PropertyScope, PropertyValue, TokenId, TrySetProperty,
+ AccessMode, budget::Budget, CollectionId, CollectionMode, CollectionFlags,
+ CollectionPropertiesVec, CreateCollectionData, CustomDataLimit, mapping::TokenAddressMapping,
+ MAX_ITEMS_PER_BATCH, MAX_REFUNGIBLE_PIECES, Property, PropertyKey, PropertyKeyPermission,
+ PropertyPermission, PropertyScope, PropertyValue, TokenId, TrySetProperty,
};
use frame_support::BoundedBTreeMap;
use derivative::Derivative;
@@ -375,7 +375,7 @@
owner: T::CrossAccountId,
data: CreateCollectionData<T::AccountId>,
) -> Result<CollectionId, DispatchError> {
- <PalletCommon<T>>::init_collection(owner, data, false)
+ <PalletCommon<T>>::init_collection(owner, data, CollectionFlags::default())
}
/// Destroy RFT collection
pallets/refungible/src/stubs/UniqueRefungible.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungible.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungible.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungible.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -85,11 +81,7 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- public
- view
- returns (bytes memory)
- {
+ function property(uint256 tokenId, string memory key) public view returns (bytes memory) {
require(false, stub_error);
tokenId;
key;
@@ -99,7 +91,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
contract Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -107,9 +99,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- public
- {
+ function setCollectionProperty(string memory key, bytes memory value) public {
require(false, stub_error);
key;
value;
@@ -135,11 +125,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- public
- view
- returns (bytes memory)
- {
+ function collectionProperty(string memory key) public view returns (bytes memory) {
require(false, stub_error);
key;
dummy;
@@ -172,6 +158,7 @@
dummy = 0;
}
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() public view returns (bool) {
@@ -201,9 +188,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() public view returns (Tuple17 memory) {
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() public view returns (Tuple17 memory) {
require(false, stub_error);
dummy;
return Tuple17(0x0000000000000000000000000000000000000000, 0);
@@ -311,9 +298,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- public
- {
+ function setCollectionNesting(bool enable, address[] memory collections) public {
require(false, stub_error);
enable;
collections;
@@ -430,9 +415,9 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() public returns (string memory) {
+ function uniqueCollectionType() public view returns (string memory) {
require(false, stub_error);
- dummy = 0;
+ dummy;
return "";
}
@@ -607,10 +592,7 @@
/// @param tokenIds IDs of the minted RFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- public
- returns (bool)
- {
+ function mintBulk(address to, uint256[] memory tokenIds) public returns (bool) {
require(false, stub_error);
to;
tokenIds;
@@ -625,10 +607,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- public
- returns (bool)
- {
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) public returns (bool) {
require(false, stub_error);
to;
tokens;
@@ -675,11 +654,7 @@
/// Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- public
- view
- returns (uint256)
- {
+ function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(false, stub_error);
owner;
index;
@@ -740,21 +715,9 @@
/// @dev inlined interface
contract ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -880,11 +843,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- public
- view
- returns (address)
- {
+ function isApprovedForAll(address owner, address operator) public view returns (address) {
require(false, stub_error);
owner;
operator;
pallets/refungible/src/stubs/UniqueRefungibleToken.rawdiffbeforeafterbothbinary blob — no preview
pallets/refungible/src/stubs/UniqueRefungibleToken.soldiffbeforeafterboth--- a/pallets/refungible/src/stubs/UniqueRefungibleToken.sol
+++ b/pallets/refungible/src/stubs/UniqueRefungibleToken.sol
@@ -10,11 +10,7 @@
}
contract ERC165 is Dummy {
- function supportsInterface(bytes4 interfaceID)
- external
- view
- returns (bool)
- {
+ function supportsInterface(bytes4 interfaceID) external view returns (bool) {
require(false, stub_error);
interfaceID;
return true;
@@ -72,11 +68,7 @@
/// @dev inlined interface
contract ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @title Standard ERC20 token
@@ -188,11 +180,7 @@
/// @return A uint256 specifying the amount of tokens still available for the spender.
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- public
- view
- returns (uint256)
- {
+ function allowance(address owner, address spender) public view returns (uint256) {
require(false, stub_error);
owner;
spender;
@@ -201,10 +189,4 @@
}
}
-contract UniqueRefungibleToken is
- Dummy,
- ERC165,
- ERC20,
- ERC20UniqueExtensions,
- ERC1633
-{}
+contract UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions, ERC1633 {}
pallets/scheduler/Cargo.tomldiffbeforeafterboth--- a/pallets/scheduler/Cargo.toml
+++ b/pallets/scheduler/Cargo.toml
@@ -25,7 +25,7 @@
frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" }
-log = { version = "0.4.14", default-features = false }
+log = { version = "0.4.16", default-features = false }
[dev-dependencies]
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
pallets/unique/src/eth/stubs/CollectionHelpers.rawdiffbeforeafterbothbinary blob — no preview
primitives/data-structs/Cargo.tomldiffbeforeafterboth--- a/primitives/data-structs/Cargo.toml
+++ b/primitives/data-structs/Cargo.toml
@@ -27,6 +27,7 @@
struct-versioning = { path = "../../crates/struct-versioning" }
pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
rmrk-traits = { default-features = false, path = "../rmrk-traits" }
+bondrewd = { version = "0.1.14", features = ["derive"], default-features = false }
[features]
default = ["std"]
primitives/data-structs/src/bondrewd_codec.rsdiffbeforeafterboth--- /dev/null
+++ b/primitives/data-structs/src/bondrewd_codec.rs
@@ -0,0 +1,31 @@
+//! Integration between bondrewd and parity scale codec
+//! Maybe we can move it to scale-codec itself in future?
+
+#[macro_export]
+macro_rules! bondrewd_codec {
+ ($T:ty) => {
+ impl Encode for $T {
+ fn encode_to<O: codec::Output + ?Sized>(&self, dest: &mut O) {
+ dest.write(&self.into_bytes())
+ }
+ }
+ impl codec::Decode for $T {
+ fn decode<I: codec::Input + ?Sized>(from: &mut I) -> Result<Self, codec::Error> {
+ let mut bytes = [0; Self::BYTE_SIZE];
+ from.read(&mut bytes)?;
+ Ok(Self::from_bytes(bytes))
+ }
+ }
+ impl MaxEncodedLen for $T {
+ fn max_encoded_len() -> usize {
+ Self::BYTE_SIZE
+ }
+ }
+ impl TypeInfo for $T {
+ type Identity = [u8; Self::BYTE_SIZE];
+ fn type_info() -> scale_info::Type {
+ <[u8; Self::BYTE_SIZE] as TypeInfo>::type_info()
+ }
+ }
+ };
+}
primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -36,6 +36,7 @@
use sp_core::U256;
use sp_runtime::{ArithmeticError, sp_std::prelude::Vec, Permill};
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
+use bondrewd::Bitfields;
use frame_support::{BoundedVec, traits::ConstU32};
use derivative::Derivative;
use scale_info::TypeInfo;
@@ -54,6 +55,7 @@
FixedPart as RmrkFixedPart, SlotPart as RmrkSlotPart,
};
+mod bondrewd_codec;
mod bounded;
pub mod budget;
pub mod mapping;
@@ -357,6 +359,21 @@
pub type CollectionDescription = BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>;
pub type CollectionTokenPrefix = BoundedVec<u8, ConstU32<MAX_TOKEN_PREFIX_LENGTH>>;
+#[derive(Bitfields, Clone, Copy, PartialEq, Eq, Debug, Default)]
+#[bondrewd(enforce_bytes = 1)]
+pub struct CollectionFlags {
+ /// Tokens in foreign collections can be transferred, but not burnt
+ #[bondrewd(bits = "0..1")]
+ pub foreign: bool,
+ /// External collections can't be managed using `unique` api
+ #[bondrewd(bits = "7..8")]
+ pub external: bool,
+
+ #[bondrewd(reserve, bits = "1..7")]
+ pub reserved: u8,
+}
+bondrewd_codec!(CollectionFlags);
+
/// Base structure for represent collection.
///
/// Used to provide basic functionality for all types of collections.
@@ -404,9 +421,8 @@
#[version(2.., upper(Default::default()))]
pub permissions: CollectionPermissions,
- /// Marks that this collection is not "unique", and managed from external.
- #[version(2.., upper(false))]
- pub external_collection: bool,
+ #[version(2.., upper(Default::default()))]
+ pub flags: CollectionFlags,
#[version(..2)]
pub variable_on_chain_schema: BoundedVec<u8, ConstU32<VARIABLE_ON_CHAIN_SCHEMA_LIMIT>>,
@@ -454,6 +470,9 @@
/// Is collection read only.
pub read_only: bool,
+
+ /// Is collection is foreign.
+ pub foreign: bool,
}
/// Data used for create collection.
primitives/data-structs/src/migration.rsdiffbeforeafterboth--- a/primitives/data-structs/src/migration.rs
+++ b/primitives/data-structs/src/migration.rs
@@ -38,3 +38,26 @@
test_to_option(SponsoringRateLimit::SponsoringDisabled);
test_to_option(SponsoringRateLimit::Blocks(10));
}
+
+#[test]
+fn collection_flags_have_same_encoding_as_bool() {
+ use crate::CollectionFlags;
+ use codec::Encode;
+
+ assert_eq!(
+ true.encode(),
+ CollectionFlags {
+ external: true,
+ ..Default::default()
+ }
+ .encode()
+ );
+ assert_eq!(
+ false.encode(),
+ CollectionFlags {
+ external: false,
+ ..Default::default()
+ }
+ .encode()
+ );
+}
runtime/common/config/orml.rsdiffbeforeafterboth--- a/runtime/common/config/orml.rs
+++ b/runtime/common/config/orml.rs
@@ -14,19 +14,87 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-use frame_support::parameter_types;
+use frame_support::{
+ parameter_types,
+ traits::{Contains, Everything},
+ weights::Weight,
+};
use frame_system::EnsureSigned;
-use crate::{Runtime, Event, RelayChainBlockNumberProvider};
+use orml_traits::{location::AbsoluteReserveProvider, parameter_type_with_key};
+use sp_runtime::traits::Convert;
+use xcm::v1::{Junction::*, Junctions::*, MultiLocation, NetworkId};
+use xcm_builder::LocationInverter;
+use xcm_executor::XcmExecutor;
+use sp_std::{vec, vec::Vec};
+use pallet_foreign_assets::{CurrencyId, NativeCurrency};
+use crate::{
+ Runtime, Event, RelayChainBlockNumberProvider,
+ runtime_common::config::{
+ xcm::{
+ SelfLocation, Weigher, XcmConfig, Ancestry,
+ xcm_assets::{CurrencyIdConvert},
+ },
+ pallets::TreasuryAccountId,
+ substrate::{MaxLocks, MaxReserves},
+ },
+};
+
use up_common::{
types::{AccountId, Balance},
constants::*,
};
+// Signed version of balance
+pub type Amount = i128;
+
parameter_types! {
pub const MinVestedTransfer: Balance = 10 * UNIQUE;
pub const MaxVestingSchedules: u32 = 28;
+
+ pub const BaseXcmWeight: Weight = 100_000_000; // TODO: recheck this
+ pub const MaxAssetsForTransfer: usize = 2;
+}
+
+parameter_type_with_key! {
+ pub ParachainMinFee: |_location: MultiLocation| -> Option<u128> {
+ Some(100_000_000_000)
+ };
+}
+
+parameter_type_with_key! {
+ pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance {
+ match currency_id {
+ CurrencyId::NativeAssetId(symbol) => match symbol {
+ NativeCurrency::Here => 0,
+ NativeCurrency::Parent=> 0,
+ },
+ _ => 100_000
+ }
+ };
+}
+
+pub fn get_all_module_accounts() -> Vec<AccountId> {
+ vec![TreasuryAccountId::get()]
}
+pub struct DustRemovalWhitelist;
+impl Contains<AccountId> for DustRemovalWhitelist {
+ fn contains(a: &AccountId) -> bool {
+ get_all_module_accounts().contains(a)
+ }
+}
+
+pub struct AccountIdToMultiLocation;
+impl Convert<AccountId, MultiLocation> for AccountIdToMultiLocation {
+ fn convert(account: AccountId) -> MultiLocation {
+ X1(AccountId32 {
+ network: NetworkId::Any,
+ id: account.into(),
+ })
+ .into()
+ }
+}
+
impl orml_vesting::Config for Runtime {
type Event = Event;
type Currency = pallet_balances::Pallet<Runtime>;
@@ -36,3 +104,38 @@
type MaxVestingSchedules = MaxVestingSchedules;
type BlockNumberProvider = RelayChainBlockNumberProvider<Runtime>;
}
+
+impl orml_tokens::Config for Runtime {
+ type Event = Event;
+ type Balance = Balance;
+ type Amount = Amount;
+ type CurrencyId = CurrencyId;
+ type WeightInfo = ();
+ type ExistentialDeposits = ExistentialDeposits;
+ type OnDust = orml_tokens::TransferDust<Runtime, TreasuryAccountId>;
+ type MaxLocks = MaxLocks;
+ type MaxReserves = MaxReserves;
+ // TODO: Add all module accounts
+ type DustRemovalWhitelist = DustRemovalWhitelist;
+ /// The id type for named reserves.
+ type ReserveIdentifier = ();
+ type OnNewTokenAccount = ();
+ type OnKilledTokenAccount = ();
+}
+
+impl orml_xtokens::Config for Runtime {
+ type Event = Event;
+ type Balance = Balance;
+ type CurrencyId = CurrencyId;
+ type CurrencyIdConvert = CurrencyIdConvert;
+ type AccountIdToMultiLocation = AccountIdToMultiLocation;
+ type SelfLocation = SelfLocation;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+ type Weigher = Weigher;
+ type BaseXcmWeight = BaseXcmWeight;
+ type LocationInverter = LocationInverter<Ancestry>;
+ type MaxAssetsForTransfer = MaxAssetsForTransfer;
+ type MinXcmFee = ParachainMinFee;
+ type MultiLocationsFilter = Everything;
+ type ReserveProvider = AbsoluteReserveProvider;
+}
runtime/common/config/pallets/foreign_asset.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/pallets/foreign_asset.rs
@@ -0,0 +1,9 @@
+use crate::{Runtime, Event, Balances};
+use up_common::types::AccountId;
+
+impl pallet_foreign_assets::Config for Runtime {
+ type Event = Event;
+ type Currency = Balances;
+ type RegisterOrigin = frame_system::EnsureRoot<AccountId>;
+ type WeightInfo = pallet_foreign_assets::weights::SubstrateWeight<Self>;
+}
runtime/common/config/pallets/mod.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -40,6 +40,9 @@
#[cfg(feature = "scheduler")]
pub mod scheduler;
+#[cfg(feature = "foreign-assets")]
+pub mod foreign_asset;
+
#[cfg(feature = "app-promotion")]
pub mod app_promotion;
runtime/common/config/xcm.rsdiffbeforeafterboth--- a/runtime/common/config/xcm.rs
+++ /dev/null
@@ -1,302 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-use frame_support::{
- traits::{
- tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get, Everything,
- },
- weights::{Weight, WeightToFeePolynomial, WeightToFee},
- parameter_types, match_types,
-};
-use frame_system::EnsureRoot;
-use sp_runtime::{
- traits::{Saturating, CheckedConversion, Zero},
- SaturatedConversion,
-};
-use pallet_xcm::XcmPassthrough;
-use polkadot_parachain::primitives::Sibling;
-use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*};
-use xcm::latest::{
- AssetId::{Concrete},
- Fungibility::Fungible as XcmFungible,
- MultiAsset, Error as XcmError,
-};
-use xcm_executor::traits::{MatchesFungible, WeightTrader};
-use xcm_builder::{
- AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
- FixedWeightBounds, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative,
- SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
- SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset,
-};
-use xcm_executor::{Config, XcmExecutor, Assets};
-use sp_std::marker::PhantomData;
-use crate::{
- Runtime, Call, Event, Origin, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue,
-};
-use up_common::{
- types::{AccountId, Balance},
- constants::*,
-};
-
-parameter_types! {
- pub const RelayLocation: MultiLocation = MultiLocation::parent();
- pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
- pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();
- pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
-}
-
-/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
-/// when determining ownership of accounts for asset transacting and when attempting to use XCM
-/// `Transact` in order to determine the dispatch Origin.
-pub type LocationToAccountId = (
- // The parent (Relay-chain) origin converts to the default `AccountId`.
- ParentIsPreset<AccountId>,
- // Sibling parachain origins convert to AccountId via the `ParaId::into`.
- SiblingParachainConvertsVia<Sibling, AccountId>,
- // Straight up local `AccountId32` origins just alias directly to `AccountId`.
- AccountId32Aliases<RelayNetwork, AccountId>,
-);
-
-pub struct OnlySelfCurrency;
-impl<B: TryFrom<u128>> MatchesFungible<B> for OnlySelfCurrency {
- fn matches_fungible(a: &MultiAsset) -> Option<B> {
- match (&a.id, &a.fun) {
- (Concrete(_), XcmFungible(ref amount)) => CheckedConversion::checked_from(*amount),
- _ => None,
- }
- }
-}
-
-/// Means for transacting assets on this chain.
-pub type LocalAssetTransactor = CurrencyAdapter<
- // Use this currency:
- Balances,
- // Use this currency when it is a fungible asset matching the given location or name:
- OnlySelfCurrency,
- // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:
- LocationToAccountId,
- // Our chain's account ID type (we can't get away without mentioning it explicitly):
- AccountId,
- // We don't track any teleports.
- (),
->;
-
-/// No local origins on this chain are allowed to dispatch XCM sends/executions.
-pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>,);
-
-/// The means for routing XCM messages which are not for local execution into the right message
-/// queues.
-pub type XcmRouter = (
- // Two routers - use UMP to communicate with the relay chain:
- cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,
- // ..and XCMP to communicate with the sibling chains.
- XcmpQueue,
-);
-
-/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
-/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can
-/// biases the kind of local `Origin` it will become.
-pub type XcmOriginToTransactDispatchOrigin = (
- // Sovereign account converter; this attempts to derive an `AccountId` from the origin location
- // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
- // foreign chains who want to have a local sovereign account on this chain which they control.
- SovereignSignedViaLocation<LocationToAccountId, Origin>,
- // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when
- // recognised.
- RelayChainAsNative<RelayOrigin, Origin>,
- // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
- // recognised.
- SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,
- // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a
- // transaction from the Root origin.
- ParentAsSuperuser<Origin>,
- // Native signed account converter; this just converts an `AccountId32` origin into a normal
- // `Origin::Signed` origin of the same 32-byte value.
- SignedAccountId32AsNative<RelayNetwork, Origin>,
- // Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
- XcmPassthrough<Origin>,
-);
-
-parameter_types! {
- // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate.
- pub UnitWeightCost: Weight = 1_000_000;
- // 1200 UNIQUEs buy 1 second of weight.
- pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE);
- pub const MaxInstructions: u32 = 100;
-}
-
-match_types! {
- pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {
- MultiLocation { parents: 1, interior: Here } |
- MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }
- };
-}
-
-pub type Barrier = (
- TakeWeightCredit,
- AllowTopLevelPaidExecutionFrom<Everything>,
- // ^^^ Parent & its unit plurality gets free execution
-);
-
-pub struct UsingOnlySelfCurrencyComponents<
- WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
- AssetId: Get<MultiLocation>,
- AccountId,
- Currency: CurrencyT<AccountId>,
- OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
->(
- Weight,
- Currency::Balance,
- PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>,
-);
-impl<
- WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
- AssetId: Get<MultiLocation>,
- AccountId,
- Currency: CurrencyT<AccountId>,
- OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
- > WeightTrader
- for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
-{
- fn new() -> Self {
- Self(0, Zero::zero(), PhantomData)
- }
-
- fn buy_weight(&mut self, weight: Weight, payment: Assets) -> Result<Assets, XcmError> {
- let amount = WeightToFee::weight_to_fee(&weight);
- let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?;
-
- // location to this parachain through relay chain
- let option1: xcm::v1::AssetId = Concrete(MultiLocation {
- parents: 1,
- interior: X1(Parachain(ParachainInfo::parachain_id().into())),
- });
- // direct location
- let option2: xcm::v1::AssetId = Concrete(MultiLocation {
- parents: 0,
- interior: Here,
- });
-
- let required = if payment.fungible.contains_key(&option1) {
- (option1, u128_amount).into()
- } else if payment.fungible.contains_key(&option2) {
- (option2, u128_amount).into()
- } else {
- (Concrete(MultiLocation::default()), u128_amount).into()
- };
-
- let unused = payment
- .checked_sub(required)
- .map_err(|_| XcmError::TooExpensive)?;
- self.0 = self.0.saturating_add(weight);
- self.1 = self.1.saturating_add(amount);
- Ok(unused)
- }
-
- fn refund_weight(&mut self, weight: Weight) -> Option<MultiAsset> {
- let weight = weight.min(self.0);
- let amount = WeightToFee::weight_to_fee(&weight);
- self.0 -= weight;
- self.1 = self.1.saturating_sub(amount);
- let amount: u128 = amount.saturated_into();
- if amount > 0 {
- Some((AssetId::get(), amount).into())
- } else {
- None
- }
- }
-}
-impl<
- WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
- AssetId: Get<MultiLocation>,
- AccountId,
- Currency: CurrencyT<AccountId>,
- OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
- > Drop
- for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
-{
- fn drop(&mut self) {
- OnUnbalanced::on_unbalanced(Currency::issue(self.1));
- }
-}
-
-pub struct XcmConfig<T>(PhantomData<T>);
-impl<T> Config for XcmConfig<T>
-where
- T: pallet_configuration::Config,
-{
- type Call = Call;
- type XcmSender = XcmRouter;
- // How to withdraw and deposit an asset.
- type AssetTransactor = LocalAssetTransactor;
- type OriginConverter = XcmOriginToTransactDispatchOrigin;
- type IsReserve = NativeAsset;
- type IsTeleporter = (); // Teleportation is disabled
- type LocationInverter = LocationInverter<Ancestry>;
- type Barrier = Barrier;
- type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
- type Trader = UsingOnlySelfCurrencyComponents<
- pallet_configuration::WeightToFee<T, Balance>,
- RelayLocation,
- AccountId,
- Balances,
- (),
- >;
- type ResponseHandler = (); // Don't handle responses for now.
- type SubscriptionService = PolkadotXcm;
-
- type AssetTrap = PolkadotXcm;
- type AssetClaims = PolkadotXcm;
-}
-
-impl pallet_xcm::Config for Runtime {
- type Event = Event;
- type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
- type XcmRouter = XcmRouter;
- type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
- type XcmExecuteFilter = Everything;
- type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
- type XcmTeleportFilter = Everything;
- type XcmReserveTransferFilter = Everything;
- type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
- type LocationInverter = LocationInverter<Ancestry>;
- type Origin = Origin;
- type Call = Call;
- const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
- type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
-}
-
-impl cumulus_pallet_xcm::Config for Runtime {
- type Event = Event;
- type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
-}
-
-impl cumulus_pallet_xcmp_queue::Config for Runtime {
- type WeightInfo = ();
- type Event = Event;
- type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
- type ChannelInfo = ParachainSystem;
- type VersionWrapper = ();
- type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
- type ControllerOrigin = EnsureRoot<AccountId>;
- type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
-}
-
-impl cumulus_pallet_dmp_queue::Config for Runtime {
- type Event = Event;
- type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
- type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
-}
runtime/common/config/xcm/foreignassets.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/xcm/foreignassets.rs
@@ -0,0 +1,198 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use frame_support::{
+ traits::{Contains, Get, fungibles},
+ parameter_types,
+};
+use sp_runtime::traits::{Zero, Convert};
+use xcm::v1::{Junction::*, MultiLocation, Junctions::*};
+use xcm::latest::MultiAsset;
+use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId};
+use xcm_executor::traits::{Convert as ConvertXcm, JustTry, FilterAssetLocation};
+use pallet_foreign_assets::{
+ AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, NativeCurrency, FreeForAll, TryAsForeign,
+ ForeignAssetId, CurrencyId,
+};
+use sp_std::{borrow::Borrow, marker::PhantomData};
+use crate::{Runtime, Balances, ParachainInfo, PolkadotXcm, ForeignAssets};
+
+use super::{LocationToAccountId, RelayLocation};
+
+use up_common::types::{AccountId, Balance};
+
+parameter_types! {
+ pub CheckingAccount: AccountId = PolkadotXcm::check_account();
+}
+
+/// Allow checking in assets that have issuance > 0.
+pub struct NonZeroIssuance<AccountId, ForeignAssets>(PhantomData<(AccountId, ForeignAssets)>);
+
+impl<AccountId, ForeignAssets> Contains<<ForeignAssets as fungibles::Inspect<AccountId>>::AssetId>
+ for NonZeroIssuance<AccountId, ForeignAssets>
+where
+ ForeignAssets: fungibles::Inspect<AccountId>,
+{
+ fn contains(id: &<ForeignAssets as fungibles::Inspect<AccountId>>::AssetId) -> bool {
+ !ForeignAssets::total_issuance(*id).is_zero()
+ }
+}
+
+pub struct AsInnerId<AssetId, ConvertAssetId>(PhantomData<(AssetId, ConvertAssetId)>);
+impl<AssetId: Clone + PartialEq, ConvertAssetId: ConvertXcm<AssetId, AssetId>>
+ ConvertXcm<MultiLocation, AssetId> for AsInnerId<AssetId, ConvertAssetId>
+where
+ AssetId: Borrow<AssetId>,
+ AssetId: TryAsForeign<AssetId, ForeignAssetId>,
+ AssetIds: Borrow<AssetId>,
+{
+ fn convert_ref(id: impl Borrow<MultiLocation>) -> Result<AssetId, ()> {
+ let id = id.borrow();
+
+ log::trace!(
+ target: "xcm::AsInnerId::Convert",
+ "AsInnerId {:?}",
+ id
+ );
+
+ let parent = MultiLocation::parent();
+ let here = MultiLocation::here();
+ let self_location = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())));
+
+ if *id == parent {
+ return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent));
+ }
+
+ if *id == here || *id == self_location {
+ return ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here));
+ }
+
+ match XcmForeignAssetIdMapping::<Runtime>::get_currency_id(id.clone()) {
+ Some(AssetIds::ForeignAssetId(foreign_asset_id)) => {
+ ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(foreign_asset_id))
+ }
+ _ => ConvertAssetId::convert_ref(AssetIds::ForeignAssetId(0)),
+ }
+ }
+
+ fn reverse_ref(what: impl Borrow<AssetId>) -> Result<MultiLocation, ()> {
+ log::trace!(
+ target: "xcm::AsInnerId::Reverse",
+ "AsInnerId",
+ );
+
+ let asset_id = what.borrow();
+
+ let parent_id =
+ ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Parent)).unwrap();
+ let here_id =
+ ConvertAssetId::convert_ref(AssetIds::NativeAssetId(NativeCurrency::Here)).unwrap();
+
+ if asset_id.clone() == parent_id {
+ return Ok(MultiLocation::parent());
+ }
+
+ if asset_id.clone() == here_id {
+ return Ok(MultiLocation::new(
+ 1,
+ X1(Parachain(ParachainInfo::get().into())),
+ ));
+ }
+
+ match <AssetId as TryAsForeign<AssetId, ForeignAssetId>>::try_as_foreign(asset_id.clone()) {
+ Some(fid) => match XcmForeignAssetIdMapping::<Runtime>::get_multi_location(fid) {
+ Some(location) => Ok(location),
+ None => Err(()),
+ },
+ None => Err(()),
+ }
+ }
+}
+
+/// Means for transacting assets besides the native currency on this chain.
+pub type FungiblesTransactor = FungiblesAdapter<
+ // Use this fungibles implementation:
+ ForeignAssets,
+ // Use this currency when it is a fungible asset matching the given location or name:
+ ConvertedConcreteAssetId<AssetIds, Balance, AsInnerId<AssetIds, JustTry>, JustTry>,
+ // Convert an XCM MultiLocation into a local account id:
+ LocationToAccountId,
+ // Our chain's account ID type (we can't get away without mentioning it explicitly):
+ AccountId,
+ // We only want to allow teleports of known assets. We use non-zero issuance as an indication
+ // that this asset is known.
+ NonZeroIssuance<AccountId, ForeignAssets>,
+ // The account to use for tracking teleports.
+ CheckingAccount,
+>;
+
+/// Means for transacting assets on this chain.
+pub type AssetTransactors = FungiblesTransactor;
+
+pub struct AllAsset;
+impl FilterAssetLocation for AllAsset {
+ fn filter_asset_location(_asset: &MultiAsset, _origin: &MultiLocation) -> bool {
+ true
+ }
+}
+
+pub type IsReserve = AllAsset;
+
+pub type Trader<T> = FreeForAll<
+ pallet_configuration::WeightToFee<T, Balance>,
+ RelayLocation,
+ AccountId,
+ Balances,
+ (),
+>;
+
+pub struct CurrencyIdConvert;
+impl Convert<AssetIds, Option<MultiLocation>> for CurrencyIdConvert {
+ fn convert(id: AssetIds) -> Option<MultiLocation> {
+ match id {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new(
+ 1,
+ X1(Parachain(ParachainInfo::get().into())),
+ )),
+ AssetIds::NativeAssetId(NativeCurrency::Parent) => Some(MultiLocation::parent()),
+ AssetIds::ForeignAssetId(foreign_asset_id) => {
+ XcmForeignAssetIdMapping::<Runtime>::get_multi_location(foreign_asset_id)
+ }
+ }
+ }
+}
+
+impl Convert<MultiLocation, Option<CurrencyId>> for CurrencyIdConvert {
+ fn convert(location: MultiLocation) -> Option<CurrencyId> {
+ if location == MultiLocation::here()
+ || location == MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())))
+ {
+ return Some(AssetIds::NativeAssetId(NativeCurrency::Here));
+ }
+
+ if location == MultiLocation::parent() {
+ return Some(AssetIds::NativeAssetId(NativeCurrency::Parent));
+ }
+
+ if let Some(currency_id) =
+ XcmForeignAssetIdMapping::<Runtime>::get_currency_id(location.clone())
+ {
+ return Some(currency_id);
+ }
+
+ None
+ }
+}
runtime/common/config/xcm/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/xcm/mod.rs
@@ -0,0 +1,268 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use frame_support::{
+ traits::{Everything, Get},
+ weights::Weight,
+ parameter_types,
+};
+use frame_system::EnsureRoot;
+use pallet_xcm::XcmPassthrough;
+use polkadot_parachain::primitives::Sibling;
+use xcm::v1::{Junction::*, MultiLocation, NetworkId};
+use xcm::latest::prelude::*;
+use xcm_builder::{
+ AccountId32Aliases, EnsureXcmOrigin, FixedWeightBounds, LocationInverter, ParentAsSuperuser,
+ RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
+ SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, ParentIsPreset,
+};
+use xcm_executor::{Config, XcmExecutor, traits::ShouldExecute};
+use sp_std::{marker::PhantomData, vec::Vec};
+use crate::{
+ Runtime, Call, Event, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, XcmpQueue,
+ xcm_barrier::Barrier,
+};
+
+use up_common::types::AccountId;
+
+#[cfg(feature = "foreign-assets")]
+pub mod foreignassets;
+
+#[cfg(not(feature = "foreign-assets"))]
+pub mod nativeassets;
+
+#[cfg(feature = "foreign-assets")]
+pub use foreignassets as xcm_assets;
+
+#[cfg(not(feature = "foreign-assets"))]
+pub use nativeassets as xcm_assets;
+
+use xcm_assets::{AssetTransactors, IsReserve, Trader};
+
+parameter_types! {
+ pub const RelayLocation: MultiLocation = MultiLocation::parent();
+ pub const RelayNetwork: NetworkId = NetworkId::Polkadot;
+ pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into();
+ pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
+ pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into())));
+
+ // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate.
+ pub UnitWeightCost: Weight = 1_000_000;
+ pub const MaxInstructions: u32 = 100;
+}
+
+/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
+/// when determining ownership of accounts for asset transacting and when attempting to use XCM
+/// `Transact` in order to determine the dispatch Origin.
+pub type LocationToAccountId = (
+ // The parent (Relay-chain) origin converts to the default `AccountId`.
+ ParentIsPreset<AccountId>,
+ // Sibling parachain origins convert to AccountId via the `ParaId::into`.
+ SiblingParachainConvertsVia<Sibling, AccountId>,
+ // Straight up local `AccountId32` origins just alias directly to `AccountId`.
+ AccountId32Aliases<RelayNetwork, AccountId>,
+);
+
+/// No local origins on this chain are allowed to dispatch XCM sends/executions.
+pub type LocalOriginToLocation = (SignedToAccountId32<Origin, AccountId, RelayNetwork>,);
+
+/// The means for routing XCM messages which are not for local execution into the right message
+/// queues.
+pub type XcmRouter = (
+ // Two routers - use UMP to communicate with the relay chain:
+ cumulus_primitives_utility::ParentAsUmp<ParachainSystem, ()>,
+ // ..and XCMP to communicate with the sibling chains.
+ XcmpQueue,
+);
+
+/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
+/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can
+/// biases the kind of local `Origin` it will become.
+pub type XcmOriginToTransactDispatchOrigin = (
+ // Sovereign account converter; this attempts to derive an `AccountId` from the origin location
+ // using `LocationToAccountId` and then turn that into the usual `Signed` origin. Useful for
+ // foreign chains who want to have a local sovereign account on this chain which they control.
+ SovereignSignedViaLocation<LocationToAccountId, Origin>,
+ // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when
+ // recognised.
+ RelayChainAsNative<RelayOrigin, Origin>,
+ // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
+ // recognised.
+ SiblingParachainAsNative<cumulus_pallet_xcm::Origin, Origin>,
+ // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a
+ // transaction from the Root origin.
+ ParentAsSuperuser<Origin>,
+ // Native signed account converter; this just converts an `AccountId32` origin into a normal
+ // `Origin::Signed` origin of the same 32-byte value.
+ SignedAccountId32AsNative<RelayNetwork, Origin>,
+ // Xcm origins can be represented natively under the Xcm pallet's Xcm origin.
+ XcmPassthrough<Origin>,
+);
+
+pub trait TryPass {
+ fn try_pass<Call>(origin: &MultiLocation, message: &mut Xcm<Call>) -> Result<(), ()>;
+}
+
+#[impl_trait_for_tuples::impl_for_tuples(30)]
+impl TryPass for Tuple {
+ fn try_pass<Call>(origin: &MultiLocation, message: &mut Xcm<Call>) -> Result<(), ()> {
+ for_tuples!( #(
+ Tuple::try_pass(origin, message)?;
+ )* );
+
+ Ok(())
+ }
+}
+
+pub struct DenyTransact;
+impl TryPass for DenyTransact {
+ fn try_pass<Call>(_origin: &MultiLocation, message: &mut Xcm<Call>) -> Result<(), ()> {
+ let transact_inst = message
+ .0
+ .iter()
+ .find(|inst| matches![inst, Instruction::Transact { .. }]);
+
+ if transact_inst.is_some() {
+ log::warn!(
+ target: "xcm::barrier",
+ "transact XCM rejected"
+ );
+
+ Err(())
+ } else {
+ Ok(())
+ }
+ }
+}
+
+/// Deny executing the XCM if it matches any of the Deny filter regardless of anything else.
+/// If it passes the Deny, and matches one of the Allow cases then it is let through.
+pub struct DenyThenTry<Deny, Allow>(PhantomData<Deny>, PhantomData<Allow>)
+where
+ Deny: TryPass,
+ Allow: ShouldExecute;
+
+impl<Deny, Allow> ShouldExecute for DenyThenTry<Deny, Allow>
+where
+ Deny: TryPass,
+ Allow: ShouldExecute,
+{
+ fn should_execute<Call>(
+ origin: &MultiLocation,
+ message: &mut Xcm<Call>,
+ max_weight: Weight,
+ weight_credit: &mut Weight,
+ ) -> Result<(), ()> {
+ Deny::try_pass(origin, message)?;
+ Allow::should_execute(origin, message, max_weight, weight_credit)
+ }
+}
+
+// Allow xcm exchange only with locations in list
+pub struct DenyExchangeWithUnknownLocation<T>(PhantomData<T>);
+impl<T: Get<Vec<MultiLocation>>> TryPass for DenyExchangeWithUnknownLocation<T> {
+ fn try_pass<Call>(origin: &MultiLocation, message: &mut Xcm<Call>) -> Result<(), ()> {
+ let allowed_locations = T::get();
+
+ // Check if deposit or transfer belongs to allowed parachains
+ let mut allowed = allowed_locations.contains(origin);
+
+ message.0.iter().for_each(|inst| match inst {
+ DepositReserveAsset { dest: dst, .. } => {
+ allowed |= allowed_locations.contains(dst);
+ }
+ TransferReserveAsset { dest: dst, .. } => {
+ allowed |= allowed_locations.contains(dst);
+ }
+ _ => {}
+ });
+
+ if allowed {
+ return Ok(());
+ }
+
+ log::warn!(
+ target: "xcm::barrier",
+ "Unexpected deposit or transfer location"
+ );
+ // Deny
+ Err(())
+ }
+}
+
+pub type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
+
+pub struct XcmConfig<T>(PhantomData<T>);
+impl<T> Config for XcmConfig<T>
+where
+ T: pallet_configuration::Config,
+{
+ type Call = Call;
+ type XcmSender = XcmRouter;
+ // How to withdraw and deposit an asset.
+ type AssetTransactor = AssetTransactors;
+ type OriginConverter = XcmOriginToTransactDispatchOrigin;
+ type IsReserve = IsReserve;
+ type IsTeleporter = (); // Teleportation is disabled
+ type LocationInverter = LocationInverter<Ancestry>;
+ type Barrier = Barrier;
+ type Weigher = Weigher;
+ type Trader = Trader<T>;
+ type ResponseHandler = (); // Don't handle responses for now.
+ type SubscriptionService = PolkadotXcm;
+
+ type AssetTrap = PolkadotXcm;
+ type AssetClaims = PolkadotXcm;
+}
+
+impl pallet_xcm::Config for Runtime {
+ type Event = Event;
+ type SendXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
+ type XcmRouter = XcmRouter;
+ type ExecuteXcmOrigin = EnsureXcmOrigin<Origin, LocalOriginToLocation>;
+ type XcmExecuteFilter = Everything;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+ type XcmTeleportFilter = Everything;
+ type XcmReserveTransferFilter = Everything;
+ type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
+ type LocationInverter = LocationInverter<Ancestry>;
+ type Origin = Origin;
+ type Call = Call;
+ const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100;
+ type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion;
+}
+
+impl cumulus_pallet_xcm::Config for Runtime {
+ type Event = Event;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+}
+
+impl cumulus_pallet_xcmp_queue::Config for Runtime {
+ type WeightInfo = ();
+ type Event = Event;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+ type ChannelInfo = ParachainSystem;
+ type VersionWrapper = ();
+ type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
+ type ControllerOrigin = EnsureRoot<AccountId>;
+ type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
+}
+
+impl cumulus_pallet_dmp_queue::Config for Runtime {
+ type Event = Event;
+ type XcmExecutor = XcmExecutor<XcmConfig<Self>>;
+ type ExecuteOverweightOrigin = frame_system::EnsureRoot<AccountId>;
+}
runtime/common/config/xcm/nativeassets.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/xcm/nativeassets.rs
@@ -0,0 +1,143 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use frame_support::{
+ traits::{tokens::currency::Currency as CurrencyT, OnUnbalanced as OnUnbalancedT, Get},
+ weights::{Weight, WeightToFeePolynomial},
+};
+use sp_runtime::traits::{CheckedConversion, Zero, Convert};
+use xcm::v1::{Junction::*, MultiLocation, Junctions::*};
+use xcm::latest::{
+ AssetId::{Concrete},
+ Fungibility::Fungible as XcmFungible,
+ MultiAsset, Error as XcmError,
+};
+use xcm_builder::{CurrencyAdapter, NativeAsset};
+use xcm_executor::{
+ Assets,
+ traits::{MatchesFungible, WeightTrader},
+};
+use pallet_foreign_assets::{AssetIds, NativeCurrency};
+use sp_std::marker::PhantomData;
+use crate::{Balances, ParachainInfo};
+use super::{LocationToAccountId, RelayLocation};
+
+use up_common::types::{AccountId, Balance};
+
+pub struct OnlySelfCurrency;
+impl<B: TryFrom<u128>> MatchesFungible<B> for OnlySelfCurrency {
+ fn matches_fungible(a: &MultiAsset) -> Option<B> {
+ let paraid = Parachain(ParachainInfo::parachain_id().into());
+ match (&a.id, &a.fun) {
+ (
+ Concrete(MultiLocation {
+ parents: 1,
+ interior: X1(loc),
+ }),
+ XcmFungible(ref amount),
+ ) if paraid == *loc => CheckedConversion::checked_from(*amount),
+ (
+ Concrete(MultiLocation {
+ parents: 0,
+ interior: Here,
+ }),
+ XcmFungible(ref amount),
+ ) => CheckedConversion::checked_from(*amount),
+ _ => None,
+ }
+ }
+}
+
+/// Means for transacting assets on this chain.
+pub type LocalAssetTransactor = CurrencyAdapter<
+ // Use this currency:
+ Balances,
+ // Use this currency when it is a fungible asset matching the given location or name:
+ OnlySelfCurrency,
+ // Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:
+ LocationToAccountId,
+ // Our chain's account ID type (we can't get away without mentioning it explicitly):
+ AccountId,
+ // We don't track any teleports.
+ (),
+>;
+
+pub type AssetTransactors = LocalAssetTransactor;
+
+pub type IsReserve = NativeAsset;
+
+pub struct UsingOnlySelfCurrencyComponents<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+>(
+ Weight,
+ Currency::Balance,
+ PhantomData<(WeightToFee, AssetId, AccountId, Currency, OnUnbalanced)>,
+);
+impl<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+ > WeightTrader
+ for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
+{
+ fn new() -> Self {
+ Self(0, Zero::zero(), PhantomData)
+ }
+
+ fn buy_weight(&mut self, _weight: Weight, payment: Assets) -> Result<Assets, XcmError> {
+ Ok(payment)
+ }
+}
+impl<
+ WeightToFee: WeightToFeePolynomial<Balance = Currency::Balance>,
+ AssetId: Get<MultiLocation>,
+ AccountId,
+ Currency: CurrencyT<AccountId>,
+ OnUnbalanced: OnUnbalancedT<Currency::NegativeImbalance>,
+ > Drop
+ for UsingOnlySelfCurrencyComponents<WeightToFee, AssetId, AccountId, Currency, OnUnbalanced>
+{
+ fn drop(&mut self) {
+ OnUnbalanced::on_unbalanced(Currency::issue(self.1));
+ }
+}
+
+pub type Trader<T> = UsingOnlySelfCurrencyComponents<
+ pallet_configuration::WeightToFee<T, Balance>,
+ RelayLocation,
+ AccountId,
+ Balances,
+ (),
+>;
+
+pub struct CurrencyIdConvert;
+impl Convert<AssetIds, Option<MultiLocation>> for CurrencyIdConvert {
+ fn convert(id: AssetIds) -> Option<MultiLocation> {
+ match id {
+ AssetIds::NativeAssetId(NativeCurrency::Here) => Some(MultiLocation::new(
+ 1,
+ X1(Parachain(ParachainInfo::get().into())),
+ )),
+ _ => None,
+ }
+ }
+}
runtime/common/construct_runtime/mod.rsdiffbeforeafterboth--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -42,7 +42,9 @@
Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
- // Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
+
+ XTokens: orml_xtokens = 38,
+ Tokens: orml_tokens = 39,
// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
// XCM helpers.
@@ -65,7 +67,7 @@
Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
Fungible: pallet_fungible::{Pallet, Storage} = 67,
- #[runtimes(opal)]
+ #[runtimes(opal, quartz)]
Refungible: pallet_refungible::{Pallet, Storage} = 68,
Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
@@ -80,6 +82,9 @@
#[runtimes(opal)]
AppPromotion: pallet_app_promotion::{Pallet, Call, Storage, Event<T>} = 73,
+ #[runtimes(opal)]
+ ForeignAssets: pallet_foreign_assets::{Pallet, Call, Storage, Event<T>} = 80,
+
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
runtime/common/mod.rsdiffbeforeafterboth--- a/runtime/common/mod.rs
+++ b/runtime/common/mod.rs
@@ -24,6 +24,9 @@
pub mod sponsoring;
pub mod weights;
+#[cfg(test)]
+pub mod tests;
+
use sp_core::H160;
use frame_support::traits::{Currency, OnUnbalanced, Imbalance};
use sp_runtime::{
@@ -79,7 +82,7 @@
pub type SignedExtra = (
frame_system::CheckSpecVersion<Runtime>,
- // system::CheckTxVersion<Runtime>,
+ frame_system::CheckTxVersion<Runtime>,
frame_system::CheckGenesis<Runtime>,
frame_system::CheckEra<Runtime>,
frame_system::CheckNonce<Runtime>,
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -688,6 +688,10 @@
#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);
+ #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
+ list_benchmark!(list, extra, pallet_foreign_assets, ForeignAssets);
+
+
// list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);
let storage_info = AllPalletsReversedWithSystemFirst::storage_info();
@@ -744,6 +748,9 @@
#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);
+ #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
+ add_benchmark!(params, batches, pallet_foreign_assets, ForeignAssets);
+
// add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
runtime/common/tests/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/tests/mod.rs
@@ -0,0 +1,46 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use sp_runtime::BuildStorage;
+use sp_core::{Public, Pair};
+use sp_std::vec;
+use up_common::types::AuraId;
+use crate::{GenesisConfig, ParachainInfoConfig, AuraConfig};
+
+pub mod xcm;
+
+fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
+ TPublic::Pair::from_string(&format!("//{}", seed), None)
+ .expect("static values are valid; qed")
+ .public()
+}
+
+fn new_test_ext(para_id: u32) -> sp_io::TestExternalities {
+ let cfg = GenesisConfig {
+ aura: AuraConfig {
+ authorities: vec![
+ get_from_seed::<AuraId>("Alice"),
+ get_from_seed::<AuraId>("Bob"),
+ ],
+ },
+ parachain_info: ParachainInfoConfig {
+ parachain_id: para_id.into(),
+ },
+ ..GenesisConfig::default()
+ };
+
+ cfg.build_storage().unwrap().into()
+}
runtime/common/tests/xcm.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/tests/xcm.rs
@@ -0,0 +1,162 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use xcm_executor::traits::ShouldExecute;
+use xcm::latest::prelude::*;
+use logtest::Logger;
+use crate::Call;
+use super::new_test_ext;
+
+fn catch_xcm_barrier_log(logger: &mut Logger, expected_msg: &str) -> Result<(), String> {
+ for record in logger {
+ if record.target() == "xcm::barrier" && record.args() == expected_msg {
+ return Ok(());
+ }
+ }
+
+ Err(format!(
+ "the expected XCM barrier log `{}` is not found",
+ expected_msg
+ ))
+}
+
+/// WARNING: Uses log capturing
+/// See https://docs.rs/logtest/latest/logtest/index.html#constraints
+pub fn barrier_denies_transact<B: ShouldExecute>(logger: &mut Logger) {
+ let location = MultiLocation {
+ parents: 0,
+ interior: Junctions::Here,
+ };
+
+ // We will never decode this "call",
+ // so it is irrelevant what we are passing to the `transact` cmd.
+ let fake_encoded_call = vec![0u8];
+
+ let transact_inst = Transact {
+ origin_type: OriginKind::Superuser,
+ require_weight_at_most: 0,
+ call: fake_encoded_call.into(),
+ };
+
+ let mut xcm_program = Xcm::<Call>(vec![transact_inst]);
+
+ let max_weight = 100_000;
+ let mut weight_credit = 100_000_000;
+
+ let result = B::should_execute(&location, &mut xcm_program, max_weight, &mut weight_credit);
+
+ assert!(
+ result.is_err(),
+ "the barrier should disallow the XCM transact cmd"
+ );
+
+ catch_xcm_barrier_log(logger, "transact XCM rejected").unwrap();
+}
+
+fn xcm_execute<B: ShouldExecute>(
+ self_para_id: u32,
+ location: &MultiLocation,
+ xcm: &mut Xcm<Call>,
+) -> Result<(), ()> {
+ new_test_ext(self_para_id).execute_with(|| {
+ let max_weight = 100_000;
+ let mut weight_credit = 100_000_000;
+
+ B::should_execute(&location, xcm, max_weight, &mut weight_credit)
+ })
+}
+
+fn make_multiassets(location: &MultiLocation) -> MultiAssets {
+ let id = AssetId::Concrete(location.clone());
+ let fun = Fungibility::Fungible(42);
+ let multiasset = MultiAsset { id, fun };
+
+ multiasset.into()
+}
+
+fn make_transfer_reserve_asset(location: &MultiLocation) -> Xcm<Call> {
+ let assets = make_multiassets(location);
+ let inst = TransferReserveAsset {
+ assets,
+ dest: location.clone(),
+ xcm: Xcm(vec![]),
+ };
+
+ Xcm::<Call>(vec![inst])
+}
+
+fn make_deposit_reserve_asset(location: &MultiLocation) -> Xcm<Call> {
+ let assets = make_multiassets(location);
+ let inst = DepositReserveAsset {
+ assets: assets.into(),
+ max_assets: 42,
+ dest: location.clone(),
+ xcm: Xcm(vec![]),
+ };
+
+ Xcm::<Call>(vec![inst])
+}
+
+fn expect_transfer_location_denied<B: ShouldExecute>(
+ logger: &mut Logger,
+ self_para_id: u32,
+ location: &MultiLocation,
+ xcm: &mut Xcm<Call>,
+) -> Result<(), String> {
+ let result = xcm_execute::<B>(self_para_id, location, xcm);
+
+ if result.is_ok() {
+ return Err("the barrier should deny the unknown location".into());
+ }
+
+ catch_xcm_barrier_log(logger, "Unexpected deposit or transfer location")
+}
+
+/// WARNING: Uses log capturing
+/// See https://docs.rs/logtest/latest/logtest/index.html#constraints
+pub fn barrier_denies_transfer_from_unknown_location<B>(
+ logger: &mut Logger,
+ self_para_id: u32,
+) -> Result<(), String>
+where
+ B: ShouldExecute,
+{
+ const UNKNOWN_PARACHAIN_ID: u32 = 4057;
+
+ let unknown_location = MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(UNKNOWN_PARACHAIN_ID)),
+ };
+
+ let mut transfer_reserve_asset = make_transfer_reserve_asset(&unknown_location);
+ let mut deposit_reserve_asset = make_deposit_reserve_asset(&unknown_location);
+
+ expect_transfer_location_denied::<B>(
+ logger,
+ self_para_id,
+ &unknown_location,
+ &mut transfer_reserve_asset,
+ )?;
+
+ expect_transfer_location_denied::<B>(
+ logger,
+ self_para_id,
+ &unknown_location,
+ &mut deposit_reserve_asset,
+ )?;
+
+ Ok(())
+}
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -35,6 +35,7 @@
'pallet-nonfungible/runtime-benchmarks',
'pallet-proxy-rmrk-core/runtime-benchmarks',
'pallet-proxy-rmrk-equip/runtime-benchmarks',
+ 'pallet-foreign-assets/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
'pallet-app-promotion/runtime-benchmarks',
@@ -123,13 +124,18 @@
'up-sponsorship/std',
"orml-vesting/std",
+ "orml-tokens/std",
+ "orml-xtokens/std",
+ "orml-traits/std",
+ "pallet-foreign-assets/std"
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion']
+opal-runtime = ['refungible', 'scheduler', 'rmrk', 'app-promotion', 'foreign-assets']
refungible = []
scheduler = []
rmrk = []
+foreign-assets = []
app-promotion = []
################################################################################
@@ -403,6 +409,24 @@
version = "0.4.1-dev"
default-features = false
+[dependencies.orml-xtokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-tokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-traits]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
################################################################################
# local dependencies
@@ -442,7 +466,19 @@
fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
+
+################################################################################
+# Other Dependencies
+
+impl-trait-for-tuples = "0.2.2"
+
+################################################################################
+# Dev Dependencies
+
+[dev-dependencies.logtest]
+version = "2.0.0"
################################################################################
# Build Dependencies
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -35,6 +35,11 @@
#[path = "../../common/mod.rs"]
mod runtime_common;
+pub mod xcm_barrier;
+
+#[cfg(test)]
+mod tests;
+
pub use runtime_common::*;
pub const RUNTIME_NAME: &str = "opal";
@@ -45,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927020,
+ spec_version: 927030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
runtime/opal/src/tests/logcapture.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/opal/src/tests/logcapture.rs
@@ -0,0 +1,25 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use logtest::Logger;
+use super::xcm::opal_xcm_tests;
+
+#[test]
+fn opal_log_capture_tests() {
+ let mut logger = Logger::start();
+
+ opal_xcm_tests(&mut logger);
+}
runtime/opal/src/tests/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/opal/src/tests/mod.rs
@@ -0,0 +1,18 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+mod logcapture;
+mod xcm;
runtime/opal/src/tests/xcm.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/opal/src/tests/xcm.rs
@@ -0,0 +1,27 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use logtest::Logger;
+use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier};
+
+const OPAL_PARA_ID: u32 = 2095; // Same as Quartz
+
+pub fn opal_xcm_tests(logger: &mut Logger) {
+ barrier_denies_transact::<Barrier>(logger);
+
+ barrier_denies_transfer_from_unknown_location::<Barrier>(logger, OPAL_PARA_ID)
+ .expect_err("opal runtime allows any location");
+}
runtime/opal/src/xcm_barrier.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/opal/src/xcm_barrier.rs
@@ -0,0 +1,48 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use frame_support::{weights::Weight, traits::Everything};
+use xcm::{latest::Xcm, v1::MultiLocation};
+use xcm_builder::{AllowTopLevelPaidExecutionFrom, TakeWeightCredit};
+use xcm_executor::traits::ShouldExecute;
+
+use crate::runtime_common::config::xcm::{DenyThenTry, DenyTransact};
+
+/// Execution barrier that just takes `max_weight` from `weight_credit`.
+///
+/// Useful to allow XCM execution by local chain users via extrinsics.
+/// E.g. `pallet_xcm::reserve_asset_transfer` to transfer a reserve asset
+/// out of the local chain to another one.
+pub struct AllowAllDebug;
+impl ShouldExecute for AllowAllDebug {
+ fn should_execute<Call>(
+ _origin: &MultiLocation,
+ _message: &mut Xcm<Call>,
+ _max_weight: Weight,
+ _weight_credit: &mut Weight,
+ ) -> Result<(), ()> {
+ Ok(())
+ }
+}
+
+pub type Barrier = DenyThenTry<
+ DenyTransact,
+ (
+ TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom<Everything>,
+ AllowAllDebug,
+ ),
+>;
runtime/quartz/Cargo.tomldiffbeforeafterboth--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -36,6 +36,7 @@
'pallet-proxy-rmrk-core/runtime-benchmarks',
'pallet-proxy-rmrk-equip/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
+ 'pallet-foreign-assets/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
'pallet-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
@@ -116,15 +117,23 @@
'xcm-builder/std',
'xcm-executor/std',
'up-common/std',
+ 'rmrk-rpc/std',
+ 'evm-coder/std',
+ 'up-sponsorship/std',
"orml-vesting/std",
+ "orml-tokens/std",
+ "orml-xtokens/std",
+ "orml-traits/std",
+ "pallet-foreign-assets/std"
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-quartz-runtime = []
+quartz-runtime = ['refungible']
refungible = []
scheduler = []
rmrk = []
+foreign-assets = []
################################################################################
# Substrate Dependencies
@@ -397,6 +406,25 @@
version = "0.4.1-dev"
default-features = false
+[dependencies.orml-xtokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-tokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-traits]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+
################################################################################
# RMRK dependencies
@@ -443,7 +471,19 @@
fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
+
+################################################################################
+# Other Dependencies
+
+impl-trait-for-tuples = "0.2.2"
+
+################################################################################
+# Dev Dependencies
+
+[dev-dependencies.logtest]
+version = "2.0.0"
################################################################################
# Build Dependencies
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -35,6 +35,11 @@
#[path = "../../common/mod.rs"]
mod runtime_common;
+pub mod xcm_barrier;
+
+#[cfg(test)]
+mod tests;
+
pub use runtime_common::*;
pub const RUNTIME_NAME: &str = "quartz";
@@ -45,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927020,
+ spec_version: 927030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
runtime/quartz/src/tests/logcapture.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/quartz/src/tests/logcapture.rs
@@ -0,0 +1,25 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use logtest::Logger;
+use super::xcm::quartz_xcm_tests;
+
+#[test]
+fn quartz_log_capture_tests() {
+ let mut logger = Logger::start();
+
+ quartz_xcm_tests(&mut logger);
+}
runtime/quartz/src/tests/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/quartz/src/tests/mod.rs
@@ -0,0 +1,18 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+mod logcapture;
+mod xcm;
runtime/quartz/src/tests/xcm.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/quartz/src/tests/xcm.rs
@@ -0,0 +1,27 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use logtest::Logger;
+use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier};
+
+const QUARTZ_PARA_ID: u32 = 2095;
+
+pub fn quartz_xcm_tests(logger: &mut Logger) {
+ barrier_denies_transact::<Barrier>(logger);
+
+ barrier_denies_transfer_from_unknown_location::<Barrier>(logger, QUARTZ_PARA_ID)
+ .expect("quartz runtime denies an unknown location");
+}
runtime/quartz/src/xcm_barrier.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/quartz/src/xcm_barrier.rs
@@ -0,0 +1,83 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use frame_support::{
+ match_types, parameter_types,
+ traits::{Get, Everything},
+};
+use sp_std::{vec, vec::Vec};
+use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
+use xcm_builder::{
+ AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom,
+};
+
+use crate::{
+ ParachainInfo, PolkadotXcm,
+ runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation},
+};
+
+match_types! {
+ pub type ParentOrSiblings: impl Contains<MultiLocation> = {
+ MultiLocation { parents: 1, interior: Here } |
+ MultiLocation { parents: 1, interior: X1(_) }
+ };
+}
+
+parameter_types! {
+ pub QuartzAllowedLocations: Vec<MultiLocation> = vec![
+ // Self location
+ MultiLocation {
+ parents: 0,
+ interior: Here,
+ },
+ // Parent location
+ MultiLocation {
+ parents: 1,
+ interior: Here,
+ },
+ // Karura/Acala location
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(2000)),
+ },
+ // Moonriver location
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(2023)),
+ },
+ // Self parachain address
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(ParachainInfo::get().into())),
+ },
+ ];
+}
+
+pub type Barrier = DenyThenTry<
+ (
+ DenyTransact,
+ DenyExchangeWithUnknownLocation<QuartzAllowedLocations>,
+ ),
+ (
+ TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom<Everything>,
+ // Expected responses are OK.
+ AllowKnownQueryResponses<PolkadotXcm>,
+ // Subscriptions for version tracking are OK.
+ AllowSubscriptionsFrom<ParentOrSiblings>,
+ ),
+>;
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -36,6 +36,7 @@
'pallet-proxy-rmrk-core/runtime-benchmarks',
'pallet-proxy-rmrk-equip/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
+ 'pallet-foreign-assets/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
'pallet-unique-scheduler/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
@@ -117,8 +118,15 @@
'xcm-builder/std',
'xcm-executor/std',
'up-common/std',
+ 'rmrk-rpc/std',
+ 'evm-coder/std',
+ 'up-sponsorship/std',
"orml-vesting/std",
+ "orml-tokens/std",
+ "orml-xtokens/std",
+ "orml-traits/std",
+ "pallet-foreign-assets/std"
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
unique-runtime = []
@@ -126,6 +134,7 @@
refungible = []
scheduler = []
rmrk = []
+foreign-assets = []
################################################################################
# Substrate Dependencies
@@ -398,6 +407,23 @@
version = "0.4.1-dev"
default-features = false
+[dependencies.orml-xtokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-tokens]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
+
+[dependencies.orml-traits]
+git = "https://github.com/open-web3-stack/open-runtime-module-library"
+branch = "polkadot-v0.9.27"
+version = "0.4.1-dev"
+default-features = false
################################################################################
# local dependencies
@@ -437,7 +463,19 @@
fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.27-fee-limit" }
evm-coder = { default-features = false, path = '../../crates/evm-coder' }
-up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.27" }
+up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.27' }
+pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }
+
+################################################################################
+# Other Dependencies
+
+impl-trait-for-tuples = "0.2.2"
+
+################################################################################
+# Dev Dependencies
+
+[dev-dependencies.logtest]
+version = "2.0.0"
################################################################################
# Build Dependencies
runtime/unique/src/lib.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -35,6 +35,11 @@
#[path = "../../common/mod.rs"]
mod runtime_common;
+pub mod xcm_barrier;
+
+#[cfg(test)]
+mod tests;
+
pub use runtime_common::*;
pub const RUNTIME_NAME: &str = "unique";
@@ -45,7 +50,7 @@
spec_name: create_runtime_str!(RUNTIME_NAME),
impl_name: create_runtime_str!(RUNTIME_NAME),
authoring_version: 1,
- spec_version: 927020,
+ spec_version: 927030,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
runtime/unique/src/tests/logcapture.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/unique/src/tests/logcapture.rs
@@ -0,0 +1,25 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use logtest::Logger;
+use super::xcm::unique_xcm_tests;
+
+#[test]
+fn unique_log_capture_tests() {
+ let mut logger = Logger::start();
+
+ unique_xcm_tests(&mut logger);
+}
runtime/unique/src/tests/mod.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/unique/src/tests/mod.rs
@@ -0,0 +1,18 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+mod logcapture;
+mod xcm;
runtime/unique/src/tests/xcm.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/unique/src/tests/xcm.rs
@@ -0,0 +1,27 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use logtest::Logger;
+use crate::{runtime_common::tests::xcm::*, xcm_barrier::Barrier};
+
+const UNIQUE_PARA_ID: u32 = 2037;
+
+pub fn unique_xcm_tests(logger: &mut Logger) {
+ barrier_denies_transact::<Barrier>(logger);
+
+ barrier_denies_transfer_from_unknown_location::<Barrier>(logger, UNIQUE_PARA_ID)
+ .expect("unique runtime denies an unknown location");
+}
runtime/unique/src/xcm_barrier.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/unique/src/xcm_barrier.rs
@@ -0,0 +1,83 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use frame_support::{
+ match_types, parameter_types,
+ traits::{Get, Everything},
+};
+use sp_std::{vec, vec::Vec};
+use xcm::v1::{Junction::*, Junctions::*, MultiLocation};
+use xcm_builder::{
+ AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom,
+};
+
+use crate::{
+ ParachainInfo, PolkadotXcm,
+ runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation},
+};
+
+match_types! {
+ pub type ParentOrSiblings: impl Contains<MultiLocation> = {
+ MultiLocation { parents: 1, interior: Here } |
+ MultiLocation { parents: 1, interior: X1(_) }
+ };
+}
+
+parameter_types! {
+ pub UniqueAllowedLocations: Vec<MultiLocation> = vec![
+ // Self location
+ MultiLocation {
+ parents: 0,
+ interior: Here,
+ },
+ // Parent location
+ MultiLocation {
+ parents: 1,
+ interior: Here,
+ },
+ // Karura/Acala location
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(2000)),
+ },
+ // Moonbeam location
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(2004)),
+ },
+ // Self parachain address
+ MultiLocation {
+ parents: 1,
+ interior: X1(Parachain(ParachainInfo::get().into())),
+ },
+ ];
+}
+
+pub type Barrier = DenyThenTry<
+ (
+ DenyTransact,
+ DenyExchangeWithUnknownLocation<UniqueAllowedLocations>,
+ ),
+ (
+ TakeWeightCredit,
+ AllowTopLevelPaidExecutionFrom<Everything>,
+ // Expected responses are OK.
+ AllowKnownQueryResponses<PolkadotXcm>,
+ // Subscriptions for version tracking are OK.
+ AllowSubscriptionsFrom<ParentOrSiblings>,
+ ),
+>;
tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -49,7 +49,6 @@
"testConfirmSponsorship": "mocha --timeout 9999999 -r ts-node/register ./**/confirmSponsorship.test.ts",
"testRemoveCollectionAdmin": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionAdmin.test.ts",
"testRemoveCollectionSponsor": "mocha --timeout 9999999 -r ts-node/register ./**/removeCollectionSponsor.test.ts",
- "testRemoveFromAllowList": "mocha --timeout 9999999 -r ts-node/register ./**/removeFromAllowList.test.ts",
"testAllowLists": "mocha --timeout 9999999 -r ts-node/register ./**/allowLists.test.ts",
"testConnection": "mocha --timeout 9999999 -r ts-node/register ./**/connection.test.ts",
"testContracts": "mocha --timeout 9999999 -r ts-node/register ./**/contracts.test.ts",
@@ -65,8 +64,7 @@
"testTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/transfer.test.ts",
"testBurnItem": "mocha --timeout 9999999 -r ts-node/register ./**/burnItem.test.ts",
"testAdminTransferAndBurn": "mocha --timeout 9999999 -r ts-node/register ./**/adminTransferAndBurn.test.ts",
- "testSetMintPermission": "mocha --timeout 9999999 -r ts-node/register ./**/setMintPermission.test.ts",
- "testSetPublicAccessMode": "mocha --timeout 9999999 -r ts-node/register ./**/setPublicAccessMode.test.ts",
+ "testSetPermissions": "mocha --timeout 9999999 -r ts-node/register ./**/setPermissions.test.ts",
"testCreditFeesToTreasury": "mocha --timeout 9999999 -r ts-node/register ./**/creditFeesToTreasury.test.ts",
"testContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/contractSponsoring.test.ts",
"testEnableContractSponsoring": "mocha --timeout 9999999 -r ts-node/register ./**/enableContractSponsoring.test.ts",
@@ -78,7 +76,12 @@
"testInflation": "mocha --timeout 9999999 -r ts-node/register ./**/inflation.test.ts",
"testScheduler": "mocha --timeout 9999999 -r ts-node/register ./**/scheduler.test.ts",
"testSchedulingEVM": "mocha --timeout 9999999 -r ts-node/register ./**/eth/scheduling.test.ts",
- "testXcmTransfer": "mocha --timeout 9999999 -r ts-node/register ./**/xcmTransfer.test.ts",
+ "testXcmUnique": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmUnique.test.ts",
+ "testXcmQuartz": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmQuartz.test.ts",
+ "testXcmOpal": "RUN_XCM_TESTS=1 mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmOpal.test.ts",
+ "testXcmTransferAcala": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferAcala.test.ts acalaId=2000 uniqueId=5000",
+ "testXcmTransferStatemine": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferStatemine.test.ts statemineId=1000 uniqueId=5000",
+ "testXcmTransferMoonbeam": "mocha --timeout 9999999 -r ts-node/register ./**/xcm/xcmTransferMoonbeam.test.ts",
"testPalletPresence": "mocha --timeout 9999999 -r ts-node/register ./**/pallet-presence.test.ts",
"testBlockProduction": "mocha --timeout 9999999 -r ts-node/register ./**/block-production.test.ts",
"testEnableDisableTransfers": "mocha --timeout 9999999 -r ts-node/register ./**/enableDisableTransfer.test.ts",
tests/scripts/readyness.jsdiffbeforeafterboth--- a/tests/scripts/readyness.js
+++ b/tests/scripts/readyness.js
@@ -1,7 +1,7 @@
const { ApiPromise, WsProvider } = require('@polkadot/api');
const connect = async () => {
- const wsEndpoint = 'ws://127.0.0.1:9944'
+ const wsEndpoint = 'ws://127.0.0.1:9944';
const api = new ApiPromise({provider: new WsProvider(wsEndpoint)});
await api.isReadyOrError;
@@ -12,10 +12,10 @@
}
const sleep = time => {
- return new Promise(resolve => {
- setTimeout(() => resolve(), time);
- });
-}
+ return new Promise(resolve => {
+ setTimeout(() => resolve(), time);
+ });
+};
const main = async () => {
while(true) {
tests/src/addToAllowList.test.tsdiffbeforeafterboth--- a/tests/src/addToAllowList.test.ts
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-import {IKeyringPair} from '@polkadot/types/types';
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import usingApi, {submitTransactionExpectFailAsync} from './substrate/substrate-api';
-import {
- addToAllowListExpectSuccess,
- createCollectionExpectSuccess,
- createItemExpectSuccess,
- destroyCollectionExpectSuccess,
- enablePublicMintingExpectSuccess,
- enableAllowListExpectSuccess,
- normalizeAccountId,
- addCollectionAdminExpectSuccess,
- addToAllowListExpectFail,
- getCreatedCollectionCount,
-} from './util/helpers';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
-
-let alice: IKeyringPair;
-let bob: IKeyringPair;
-let charlie: IKeyringPair;
-
-describe('Integration Test ext. addToAllowList()', () => {
-
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- alice = privateKeyWrapper('//Alice');
- bob = privateKeyWrapper('//Bob');
- });
- });
-
- it('Execute the extrinsic with parameters: Collection ID and address to add to the allow list', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addToAllowListExpectSuccess(alice, collectionId, bob.address);
- });
-
- it('Allowlisted minting: list restrictions', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addToAllowListExpectSuccess(alice, collectionId, bob.address);
- await enableAllowListExpectSuccess(alice, collectionId);
- await enablePublicMintingExpectSuccess(alice, collectionId);
- await createItemExpectSuccess(bob, collectionId, 'NFT', bob.address);
- });
-});
-
-describe('Negative Integration Test ext. addToAllowList()', () => {
-
- it('Allow list an address in the collection that does not exist', async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- // tslint:disable-next-line: no-bitwise
- const collectionId = await getCreatedCollectionCount(api) + 1;
- const bob = privateKeyWrapper('//Bob');
-
- const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(bob.address));
- await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected;
- });
- });
-
- it('Allow list an address in the collection that was destroyed', async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- const alice = privateKeyWrapper('//Alice');
- const bob = privateKeyWrapper('//Bob');
- // tslint:disable-next-line: no-bitwise
- const collectionId = await createCollectionExpectSuccess();
- await destroyCollectionExpectSuccess(collectionId);
- const tx = api.tx.unique.addToAllowList(collectionId, normalizeAccountId(bob.address));
- await expect(submitTransactionExpectFailAsync(alice, tx)).to.be.rejected;
- });
- });
-
- it('Allow list an address in the collection that does not have allow list access enabled', async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- const alice = privateKeyWrapper('//Alice');
- const ferdie = privateKeyWrapper('//Ferdie');
- const collectionId = await createCollectionExpectSuccess();
- await enableAllowListExpectSuccess(alice, collectionId);
- await enablePublicMintingExpectSuccess(alice, collectionId);
- const tx = api.tx.unique.createItem(collectionId, normalizeAccountId(ferdie.address), 'NFT');
- await expect(submitTransactionExpectFailAsync(ferdie, tx)).to.be.rejected;
- });
- });
-
-});
-
-describe('Integration Test ext. addToAllowList() with collection admin permissions:', () => {
-
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- alice = privateKeyWrapper('//Alice');
- bob = privateKeyWrapper('//Bob');
- charlie = privateKeyWrapper('//Charlie');
- });
- });
-
- it('Negative. Add to the allow list by regular user', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addToAllowListExpectFail(bob, collectionId, charlie.address);
- });
-
- it('Execute the extrinsic with parameters: Collection ID and address to add to the allow list', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await addToAllowListExpectSuccess(bob, collectionId, charlie.address);
- });
-
- it('Allowlisted minting: list restrictions', async () => {
- const collectionId = await createCollectionExpectSuccess();
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await addToAllowListExpectSuccess(bob, collectionId, charlie.address);
-
- // allowed only for collection owner
- await enableAllowListExpectSuccess(alice, collectionId);
- await enablePublicMintingExpectSuccess(alice, collectionId);
-
- await createItemExpectSuccess(charlie, collectionId, 'NFT', charlie.address);
- });
-});
tests/src/addToContractAllowList.test.tsdiffbeforeafterboth--- a/tests/src/addToContractAllowList.test.ts
+++ b/tests/src/addToContractAllowList.test.ts
@@ -27,6 +27,7 @@
chai.use(chaiAsPromised);
const expect = chai.expect;
+// todo:playgrounds skipped ~ postponed
describe.skip('Integration Test addToContractAllowList', () => {
it('Add an address to a contract allow list', async () => {
tests/src/allowLists.test.tsdiffbeforeafterboth--- a/tests/src/allowLists.test.ts
+++ b/tests/src/allowLists.test.ts
@@ -16,6 +16,7 @@
import {IKeyringPair} from '@polkadot/types/types';
import {usingPlaygrounds, expect, itSub} from './util/playgrounds';
+import {ICollectionPermissions} from './util/playgrounds/types';
describe('Integration Test ext. Allow list tests', () => {
let alice: IKeyringPair;
@@ -25,287 +26,335 @@
before(async () => {
await usingPlaygrounds(async (helper, privateKey) => {
const donor = privateKey('//Alice');
- [alice, bob, charlie] = await helper.arrange.createAccounts([100n, 100n, 100n], donor);
+ [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor);
});
});
- itSub('Owner can add address to allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- const allowList = await helper.nft.getAllowList(collectionId);
- expect(allowList).to.be.deep.contains({Substrate: bob.address});
- });
+ describe('Positive', async () => {
+ itSub('Owner can add address to allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ // allow list does not need to be enabled to add someone in advance
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.deep.contain({Substrate: bob.address});
+ });
- itSub('Admin can add address to allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address});
+ itSub('Admin can add address to allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address});
- await helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address});
- const allowList = await helper.nft.getAllowList(collectionId);
- expect(allowList).to.be.deep.contains({Substrate: charlie.address});
- });
+ // allow list does not need to be enabled to add someone in advance
+ await helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address});
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.deep.contain({Substrate: charlie.address});
+ });
- itSub('Non-privileged user cannot add address to allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address});
- await expect(addToAllowListTx()).to.be.rejectedWith(/common\.NoPermission/);
+ itSub('If address is already added to allow list, nothing happens', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.deep.contain({Substrate: bob.address});
+ });
});
- itSub('Nobody can add address to allow list of non-existing collection', async ({helper}) => {
- const collectionId = (1<<32) - 1;
- const addToAllowListTx = async () => helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address});
- await expect(addToAllowListTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
- });
+ describe('Negative', async () => {
+ itSub('Nobody can add address to allow list of non-existing collection', async ({helper}) => {
+ const collectionId = (1<<32) - 1;
+ await expect(helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
- itSub('Nobody can add address to allow list of destroyed collection', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.collection.burn(alice, collectionId);
- const addToAllowListTx = async () => helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await expect(addToAllowListTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
+ itSub('Nobody can add address to allow list of destroyed collection', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.collection.burn(alice, collectionId);
+ await expect(helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
+
+ itSub('Non-privileged user cannot add address to allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await expect(helper.nft.addToAllowList(bob, collectionId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.NoPermission/);
+ });
});
+});
- itSub('If address is already added to allow list, nothing happens', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- const allowList = await helper.nft.getAllowList(collectionId);
- expect(allowList).to.be.deep.contains({Substrate: bob.address});
+describe('Integration Test ext. Remove from Allow List', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+ let charlie: IKeyringPair;
+
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor);
+ });
});
- itSub('Owner can remove address from allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ describe('Positive', async () => {
+ itSub('Owner can remove address from allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
- const allowList = await helper.nft.getAllowList(collectionId);
+ const allowList = await helper.nft.getAllowList(collectionId);
- expect(allowList).to.be.not.deep.contains({Substrate: bob.address});
- });
+ expect(allowList).to.not.deep.contain({Substrate: bob.address});
+ });
- itSub('Admin can remove address from allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address});
+ itSub('Admin can remove address from allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addAdmin(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: bob.address});
- const allowList = await helper.nft.getAllowList(collectionId);
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.not.deep.contain({Substrate: bob.address});
+ });
- expect(allowList).to.be.not.deep.contains({Substrate: bob.address});
- });
+ itSub('If address is already removed from allow list, nothing happens', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
+ const allowListBefore = await helper.nft.getAllowList(collectionId);
+ expect(allowListBefore).to.not.deep.contain({Substrate: bob.address});
- itSub('Non-privileged user cannot remove address from allow list', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address});
- await expect(removeTx()).to.be.rejectedWith(/common\.NoPermission/);
- const allowList = await helper.nft.getAllowList(collectionId);
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
- expect(allowList).to.be.deep.contains({Substrate: charlie.address});
+ const allowListAfter = await helper.nft.getAllowList(collectionId);
+ expect(allowListAfter).to.not.deep.contain({Substrate: bob.address});
+ });
});
- itSub('Nobody can remove address from allow list of non-existing collection', async ({helper}) => {
- const collectionId = (1<<32) - 1;
- const removeTx = async () => helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address});
- await expect(removeTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
+ describe('Negative', async () => {
+ itSub('Non-privileged user cannot remove address from allow list', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await expect(helper.collection.removeFromAllowList(charlie, collectionId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.NoPermission/);
+
+ const allowList = await helper.nft.getAllowList(collectionId);
+ expect(allowList).to.deep.contain({Substrate: charlie.address});
+ });
+
+ itSub('Nobody can remove address from allow list of non-existing collection', async ({helper}) => {
+ const collectionId = (1<<32) - 1;
+ await expect(helper.collection.removeFromAllowList(bob, collectionId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
+
+ itSub('Nobody can remove address from allow list of deleted collection', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
+ await helper.collection.burn(alice, collectionId);
+
+ await expect(helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
});
+});
- itSub('Nobody can remove address from allow list of deleted collection', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.collection.burn(alice, collectionId);
- const removeTx = async () => helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
+describe('Integration Test ext. Transfer if included in Allow List', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+ let charlie: IKeyringPair;
- await expect(removeTx()).to.be.rejectedWith(/common\.CollectionNotFound/);
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob, charlie] = await helper.arrange.createAccounts([30n, 10n, 10n], donor);
+ });
});
- itSub('If address is already removed from allow list, nothing happens', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
- const allowListBefore = await helper.nft.getAllowList(collectionId);
- expect(allowListBefore).to.be.not.deep.contains({Substrate: bob.address});
+ describe('Positive', async () => {
+ itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
+ expect(owner.Substrate).to.be.equal(charlie.address);
+ });
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: bob.address});
+ itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- const allowListAfter = await helper.nft.getAllowList(collectionId);
- expect(allowListAfter).to.be.not.deep.contains({Substrate: bob.address});
- });
+ await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
+ const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
+ expect(owner.Substrate).to.be.equal(charlie.address);
+ });
- itSub('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
+ expect(owner.Substrate).to.be.equal(charlie.address);
+ });
- itSub('If Public Access mode is set to AllowList, tokens can’t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address});
+ itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
+ const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
+ expect(owner.Substrate).to.be.equal(charlie.address);
+ });
});
- itSub('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ describe('Negative', async () => {
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred from a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+
+ await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
+
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred from a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address});
+
+ await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
- const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred to a non-allowlisted address with transfer or transferFrom. Test1', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- itSub('If Public Access mode is set to AllowList, tokens can’t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address});
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be transferred to a non-allowlisted address with transfer or transferFrom. Test2', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
+ await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- const transferResult = async () => helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- await expect(transferResult()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ await helper.collection.removeFromAllowList(alice, collectionId, {Substrate: alice.address});
- itSub('If Public Access mode is set to AllowList, tokens can’t be destroyed by a non-allowlisted address (even if itSub owned them before enabling AllowList mode)', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- const burnTx = async () => helper.nft.burnToken(bob, collectionId, tokenId);
- await expect(burnTx()).to.be.rejectedWith(/common\.NoPermission/);
- });
+ await expect(helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
- itSub('If Public Access mode is set to AllowList, token transfers can’t be Approved by a non-allowlisted address (see Approve method)', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- const approveTx = async () => helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address});
- await expect(approveTx()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ itSub('If Public Access mode is set to AllowList, tokens can\'t be destroyed by a non-allowlisted address (even if it owned them before enabling AllowList mode)', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await expect(helper.nft.burnToken(bob, collectionId, tokenId))
+ .to.be.rejectedWith(/common\.NoPermission/);
+ });
- itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transfer.', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(charlie.address);
+ itSub('If Public Access mode is set to AllowList, token transfers can\'t be Approved by a non-allowlisted address (see Approve method)', async ({helper}) => {
+ const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
+ await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
+ await expect(helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: bob.address}))
+ .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
+ });
});
+});
- itSub('If Public Access mode is set to AllowList, tokens can be transferred to a allowlisted address with transferFrom.', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+describe('Integration Test ext. Mint if included in Allow List', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
- await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(charlie.address);
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([100n, 100n], donor);
+ });
});
- itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transfer', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
+ const permissionSet: ICollectionPermissions[] = [
+ {access: 'Normal', mintMode: false},
+ {access: 'Normal', mintMode: true},
+ {access: 'AllowList', mintMode: false},
+ {access: 'AllowList', mintMode: true},
+ ];
- await helper.nft.transferToken(alice, collectionId, tokenId, {Substrate: charlie.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(charlie.address);
- });
+ const testPermissionSuite = async (permissions: ICollectionPermissions) => {
+ const allowlistedMintingShouldFail = !permissions.mintMode!;
- itSub('If Public Access mode is set to AllowList, tokens can be transferred from a allowlisted address with transferFrom', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList'});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: alice.address});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: charlie.address});
- await helper.nft.approveToken(alice, collectionId, tokenId, {Substrate: charlie.address});
+ const appropriateRejectionMessage = permissions.mintMode! ? /common\.AddressNotInAllowlist/ : /common\.PublicMintingNotAllowed/;
- await helper.nft.transferTokenFrom(alice, collectionId, tokenId, {Substrate: alice.address}, {Substrate: charlie.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(charlie.address);
- });
+ const allowlistedMintingTest = () => itSub(
+ `With the condtions above, tokens can${allowlistedMintingShouldFail ? '\'t' : ''} be created by allow-listed addresses`,
+ async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {});
+ await collection.setPermissions(alice, permissions);
+ await collection.addToAllowList(alice, {Substrate: bob.address});
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by owner', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- const token = await helper.nft.getToken(collectionId, tokenId);
- expect(token).to.be.not.null;
- });
+ if (allowlistedMintingShouldFail)
+ await expect(collection.mintToken(bob, {Substrate: bob.address})).to.be.rejectedWith(appropriateRejectionMessage);
+ else
+ await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected;
+ },
+ );
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens can be created by admin', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false});
- await helper.collection.addAdmin(alice, collectionId, {Substrate: bob.address});
- const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- const token = await helper.nft.getToken(collectionId, tokenId);
- expect(token).to.be.not.null;
- });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and allow-listed address', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false});
- await helper.collection.addToAllowList(alice, collectionId, {Substrate: bob.address});
- const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- await expect(mintTokenTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/);
- });
+ describe(`Public Access Mode = ${permissions.access}, Mint Mode = ${permissions.mintMode}`, async () => {
+ describe('Positive', async () => {
+ itSub('With the condtions above, tokens can be created by owner', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {});
+ await collection.setPermissions(alice, permissions);
+ await expect(collection.mintToken(alice, {Substrate: alice.address})).to.not.be.rejected;
+ });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to false, tokens cannot be created by non-privileged and non-allow listed address', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: false});
- const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- await expect(mintTokenTx()).to.be.rejectedWith(/common\.PublicMintingNotAllowed/);
- });
+ itSub('With the condtions above, tokens can be created by admin', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {});
+ await collection.setPermissions(alice, permissions);
+ await collection.addAdmin(alice, {Substrate: bob.address});
+ await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected;
+ });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by owner', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true});
- const {tokenId} = await helper.nft.mintToken(alice, {collectionId: collectionId, owner: alice.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(alice.address);
- });
+ if (!allowlistedMintingShouldFail) allowlistedMintingTest();
+ });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by admin', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true});
- await helper.nft.addAdmin(alice, collectionId, {Substrate: bob.address});
- const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(bob.address);
- });
+ describe('Negative', async () => {
+ itSub('With the condtions above, tokens can\'t be created by non-priviliged non-allow-listed address', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
+ await collection.setPermissions(alice, permissions);
+ await expect(collection.mintToken(bob, {Substrate: bob.address}))
+ .to.be.rejectedWith(appropriateRejectionMessage);
+ });
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens cannot be created by non-privileged and non-allow listed address', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true});
- const mintTokenTx = async () => helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- await expect(mintTokenTx()).to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
+ if (allowlistedMintingShouldFail) allowlistedMintingTest();
+ });
+ });
+ };
- itSub('If Public Access mode is set to AllowList, and Mint Permission is set to true, tokens can be created by non-privileged and allow listed address', async ({helper}) => {
- const {collectionId} = await helper.nft.mintCollection(alice, {name: 'col', description: 'descr', tokenPrefix: 'COL'});
- await helper.nft.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true});
- await helper.nft.addToAllowList(alice, collectionId, {Substrate: bob.address});
- const {tokenId} = await helper.nft.mintToken(bob, {collectionId: collectionId, owner: bob.address});
- const owner = await helper.nft.getTokenOwner(collectionId, tokenId);
- expect(owner.Substrate).to.be.equal(bob.address);
- });
+ for (const permissions of permissionSet) {
+ testPermissionSuite(permissions);
+ }
});
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -20,17 +20,12 @@
getModuleNames,
Pallets,
} from './util/helpers';
-
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import {usingPlaygrounds} from './util/playgrounds';
-
+import {itSub, usingPlaygrounds} from './util/playgrounds';
import {encodeAddress} from '@polkadot/util-crypto';
import {stringToU8a} from '@polkadot/util';
-import {SponsoringMode, contractHelpers, createEthAccountWithBalance, deployFlipper, itWeb3, transferBalanceToEth} from './eth/util/helpers';
+import {SponsoringMode} from './eth/util/helpers';
import {DevUniqueHelper} from './util/playgrounds/unique.dev';
-chai.use(chaiAsPromised);
-const expect = chai.expect;
+import {itEth, expect} from './eth/util/playgrounds';
let alice: IKeyringPair;
let palletAdmin: IKeyringPair;
@@ -38,723 +33,651 @@
const palletAddress = calculatePalleteAddress('appstake');
let accounts: IKeyringPair[] = [];
const LOCKING_PERIOD = 20n; // 20 blocks of relay
-const UNLOCKING_PERIOD = 10n; // 20 blocks of parachain
+const UNLOCKING_PERIOD = 10n; // 10 blocks of parachain
const rewardAvailableInBlock = (stakedInBlock: bigint) => (stakedInBlock - stakedInBlock % LOCKING_PERIOD) + (LOCKING_PERIOD * 2n);
-const beforeEach = async (context: Mocha.Context) => {
- await usingPlaygrounds(async (helper, privateKey) => {
- if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) context.skip();
- alice = privateKey('//Alice');
- palletAdmin = privateKey('//Charlie'); // TODO use custom address
- await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})));
- nominal = helper.balance.getOneTokenNominal();
- await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal);
- await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal);
- accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests
- });
-};
-
-describe('app-promotions.stake extrinsic', () => {
+describe('App promotion', () => {
before(async function () {
- await beforeEach(this);
+ await usingPlaygrounds(async (helper, privateKey) => {
+ if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip();
+ alice = privateKey('//Alice');
+ palletAdmin = privateKey('//Charlie'); // TODO use custom address
+ await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})));
+ nominal = helper.balance.getOneTokenNominal();
+ await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal);
+ await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal);
+ accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests
+ });
});
- it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => {
- await usingPlaygrounds(async (helper) => {
+ describe('stake extrinsic', () => {
+ itSub('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async ({helper}) => {
const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
const totalStakedBefore = await helper.staking.getTotalStaked();
-
+
// Minimum stake amount is 100:
- await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.eventually.rejected;
+ await expect(helper.staking.stake(staker, 100n * nominal - 1n)).to.be.rejected;
await helper.staking.stake(staker, 100n * nominal);
-
+
// Staker balance is: miscFrozen: 100, feeFrozen: 100, reserved: 0n...
// ...so he can not transfer 900
expect (await helper.balance.getSubstrateFull(staker.address)).to.contain({miscFrozen: 100n * nominal, feeFrozen: 100n * nominal, reserved: 0n});
- await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejected;
+ await expect(helper.balance.transferToSubstrate(staker, recepient.address, 900n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
// it is potentially flaky test. Promotion can credited some tokens. Maybe we need to use closeTo?
expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore + 100n * nominal); // total tokens amount staked in app-promotion increased
-
+
await helper.staking.stake(staker, 200n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(300n * nominal);
- expect((await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map((x) => x[1])).to.be.deep.equal([100n * nominal, 200n * nominal]);
+ const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(totalStakedPerBlock[0].amount).to.equal(100n * nominal);
+ expect(totalStakedPerBlock[1].amount).to.equal(200n * nominal);
});
- });
-
- it('should allow to create maximum 10 stakes for account', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should allow to create maximum 10 stakes for account', async ({helper}) => {
const [staker] = await helper.arrange.createAccounts([2000n], alice);
for (let i = 0; i < 10; i++) {
await helper.staking.stake(staker, 100n * nominal);
}
-
+
// can have 10 stakes
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(1000n * nominal);
expect(await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).to.have.length(10);
-
- await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejected;
-
+
+ await expect(helper.staking.stake(staker, 100n * nominal)).to.be.rejectedWith('appPromotion.NoPermission');
+
// After unstake can stake again
await helper.staking.unstake(staker);
await helper.staking.stake(staker, 100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.equal(100n * nominal);
});
- });
+
+ itSub('should reject transaction if stake amount is more than total free balance minus frozen', async ({helper}) => {
+ const staker = accounts.pop()!;
- it('should reject transaction if stake amount is more than total free balance minus frozen', async () => {
- await usingPlaygrounds(async helper => {
- const staker = accounts.pop()!;
-
// Can't stake full balance because Alice needs to pay some fee
- await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.eventually.rejected;
+ await expect(helper.staking.stake(staker, 1000n * nominal)).to.be.rejected;
await helper.staking.stake(staker, 500n * nominal);
-
+
// Can't stake 500 tkn because Alice has Less than 500 transferable;
- await expect(helper.staking.stake(staker, 500n * nominal)).to.be.eventually.rejected;
+ await expect(helper.staking.stake(staker, 500n * nominal)).to.be.rejectedWith('balances.LiquidityRestrictions');
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(500n * nominal);
});
- });
-
- it('for different accounts in one block is possible', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('for different accounts in one block is possible', async ({helper}) => {
const crowd = [accounts.pop()!, accounts.pop()!, accounts.pop()!, accounts.pop()!];
-
+
const crowdStartsToStake = crowd.map(user => helper.staking.stake(user, 100n * nominal));
- await expect(Promise.all(crowdStartsToStake)).to.be.eventually.fulfilled;
-
+ await expect(Promise.all(crowdStartsToStake)).to.be.fulfilled;
+
const crowdStakes = await Promise.all(crowd.map(address => helper.staking.getTotalStaked({Substrate: address.address})));
expect(crowdStakes).to.deep.equal([100n * nominal, 100n * nominal, 100n * nominal, 100n * nominal]);
});
});
-});
-
-describe('unstake balance extrinsic', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- it('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async () => {
- await usingPlaygrounds(async helper => {
+
+ describe('unstake extrinsic', () => {
+ itSub('should change balance state from "frozen" to "reserved", add it to "pendingUnstake" map, and subtract it from totalStaked', async ({helper}) => {
const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
const totalStakedBefore = await helper.staking.getTotalStaked();
await helper.staking.stake(staker, 900n * nominal);
await helper.staking.unstake(staker);
-
+
// Right after unstake balance is reserved
// Staker can not transfer
expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 900n * nominal, miscFrozen: 0n, feeFrozen: 0n});
- await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejected;
+ await expect(helper.balance.transferToSubstrate(staker, recepient.address, 100n * nominal)).to.be.rejectedWith('balances.InsufficientBalance');
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(900n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedBefore);
});
- });
-
- it('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should unlock balance after unlocking period ends and remove it from "pendingUnstake"', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
- const unstakedInBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0];
-
+ const [pendingUnstake] = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
+
// Wait for unstaking period. Balance now free ~1000; reserved, frozen, miscFrozeb: 0n
- await helper.wait.forParachainBlockNumber(unstakedInBlock);
+ await helper.wait.forParachainBlockNumber(pendingUnstake.block);
expect(await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, miscFrozen: 0n, feeFrozen: 0n});
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
-
+
// staker can transfer:
await helper.balance.transferToSubstrate(staker, alice.address, 998n * nominal);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(1n);
});
- });
-
- it('should successfully unstake multiple stakes', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('should successfully unstake multiple stakes', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.stake(staker, 200n * nominal);
await helper.staking.stake(staker, 300n * nominal);
-
+
// staked: [100, 200, 300]; unstaked: 0
- let pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
- let unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]);
- let stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]);
- expect(pendingUnstake).to.be.deep.equal(0n);
- expect(unstakedPerBlock).to.be.deep.equal([]);
- expect(stakedPerBlock).to.be.deep.equal([100n * nominal, 200n * nominal, 300n * nominal]);
-
+ let totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
+ let pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
+ let stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(totalPendingUnstake).to.be.deep.equal(0n);
+ expect(pendingUnstake).to.be.deep.equal([]);
+ expect(stakes[0].amount).to.equal(100n * nominal);
+ expect(stakes[1].amount).to.equal(200n * nominal);
+ expect(stakes[2].amount).to.equal(300n * nominal);
+
// Can unstake multiple stakes
await helper.staking.unstake(staker);
- const unstakingBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address}))[0][0];
- pendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
- unstakedPerBlock = (await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address})).map(stake => stake[1]);
- stakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(stake => stake[1]);
- expect(pendingUnstake).to.be.equal(600n * nominal);
- expect(stakedPerBlock).to.be.deep.equal([]);
- expect(unstakedPerBlock).to.be.deep.equal([600n * nominal]);
-
+ pendingUnstake = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
+ totalPendingUnstake = await helper.staking.getPendingUnstake({Substrate: staker.address});
+ stakes = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(totalPendingUnstake).to.be.equal(600n * nominal);
+ expect(stakes).to.be.deep.equal([]);
+ expect(pendingUnstake[0].amount).to.equal(600n * nominal);
+
expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 600n * nominal, feeFrozen: 0n, miscFrozen: 0n});
- await helper.wait.forParachainBlockNumber(unstakingBlock);
+ await helper.wait.forParachainBlockNumber(pendingUnstake[0].block);
expect (await helper.balance.getSubstrateFull(staker.address)).to.deep.contain({reserved: 0n, feeFrozen: 0n, miscFrozen: 0n});
expect (await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n);
});
- });
-
- it('should not have any effects if no active stakes', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should not have any effects if no active stakes', async ({helper}) => {
const staker = accounts.pop()!;
-
+
// unstake has no effect if no stakes at all
await helper.staking.unstake(staker);
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(0n);
expect(await helper.balance.getSubstrate(staker.address) / nominal).to.be.equal(999n); // TODO bigint closeTo helper
-
+
// TODO stake() unstake() waitUnstaked() unstake();
-
+
// can't unstake if there are only pendingUnstakes
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
await helper.staking.unstake(staker);
-
+
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
});
- });
-
- it('should keep different unlocking block for each unlocking stake', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should keep different unlocking block for each unlocking stake', async ({helper}) => {
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.unstake(staker);
await helper.staking.stake(staker, 120n * nominal);
await helper.staking.unstake(staker);
-
+
const unstakingPerBlock = await helper.staking.getPendingUnstakePerBlock({Substrate: staker.address});
expect(unstakingPerBlock).has.length(2);
- expect(unstakingPerBlock[0][1]).to.equal(100n * nominal);
- expect(unstakingPerBlock[1][1]).to.equal(120n * nominal);
+ expect(unstakingPerBlock[0].amount).to.equal(100n * nominal);
+ expect(unstakingPerBlock[1].amount).to.equal(120n * nominal);
});
- });
-
- it('should be possible for different accounts in one block', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should be possible for different accounts in one block', async ({helper}) => {
const stakers = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
-
+
await Promise.all(stakers.map(staker => helper.staking.stake(staker, 100n * nominal)));
await Promise.all(stakers.map(staker => helper.staking.unstake(staker)));
-
+
await Promise.all(stakers.map(async (staker) => {
expect(await helper.staking.getPendingUnstake({Substrate: staker.address})).to.be.equal(100n * nominal);
expect(await helper.staking.getTotalStaked({Substrate: staker.address})).to.be.equal(0n);
}));
});
});
-});
-
-describe('Admin adress', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- it('can be set by sudo only', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ describe('admin adress', () => {
+ itSub('can be set by sudo only', async ({helper}) => {
const nonAdmin = accounts.pop()!;
// nonAdmin can not set admin not from himself nor as a sudo
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected;
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected;
-
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.rejected;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.rejected;
+
// Alice can
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled;
});
- });
-
- it('can be any valid CrossAccountId', async () => {
- // We are not going to set an eth address as a sponsor,
- // but we do want to check, it doesn't break anything;
- await usingPlaygrounds(async (helper) => {
+
+ itSub('can be any valid CrossAccountId', async ({helper}) => {
+ // We are not going to set an eth address as a sponsor,
+ // but we do want to check, it doesn't break anything;
const account = accounts.pop()!;
const ethAccount = helper.address.substrateToEth(account.address);
// Alice sets Ethereum address as a sudo. Then Substrate address back...
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
-
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.fulfilled;
+
// ...It doesn't break anything;
const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
});
- });
-
- it('can be reassigned', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('can be reassigned', async ({helper}) => {
const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
-
- await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
+
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.fulfilled;
+ await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
+
+ await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled;
});
});
-});
-
-describe('App-promotion collection sponsoring', () => {
- before(async function () {
- await beforeEach(this);
- await usingPlaygrounds(async (helper) => {
- const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}));
- await helper.signTransaction(alice, tx);
+
+ describe('collection sponsoring', () => {
+ before(async function () {
+ await usingPlaygrounds(async (helper) => {
+ const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}));
+ await helper.signTransaction(alice, tx);
+ });
});
- });
-
- it('should actually sponsor transactions', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should actually sponsor transactions', async ({helper}) => {
const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}});
const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address});
await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId));
const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress);
-
+
await token.transfer(tokenSender, {Substrate: receiver.address});
expect (await token.getOwner()).to.be.deep.equal({Substrate: receiver.address});
const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress);
-
+
// senders balance the same, transaction has sponsored
expect (await helper.balance.getSubstrate(tokenSender.address)).to.be.equal(1000n * nominal);
expect (palletBalanceBefore > palletBalanceAfter).to.be.true;
});
- });
-
- it('can not be set by non admin', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('can not be set by non admin', async ({helper}) => {
const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
-
+
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled');
});
- });
-
- it('should set pallet address as confirmed admin', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should set pallet address as confirmed admin', async ({helper}) => {
const [collectionOwner, oldSponsor] = [accounts.pop()!, accounts.pop()!];
-
+
// Can set sponsoring for collection without sponsor
const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Can set sponsoring for collection with unconfirmed sponsor
const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address});
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Can set sponsoring for collection with confirmed sponsor
const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor);
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.fulfilled;
expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
});
- });
-
- it('can be overwritten by collection owner', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('can be overwritten by collection owner', async ({helper}) => {
const [collectionOwner, newSponsor] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
const collectionId = collection.collectionId;
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled;
-
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.fulfilled;
+
// Collection limits still can be changed by the owner
expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true;
expect((await collection.getData())?.raw.limits.sponsorTransferTimeout).to.be.equal(0);
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
-
+
// Collection sponsor can be changed too
expect((await collection.setSponsor(collectionOwner, newSponsor.address))).to.be.true;
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: newSponsor.address});
});
- });
-
- it('should not overwrite collection limits set by the owner earlier', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should not overwrite collection limits set by the owner earlier', async ({helper}) => {
const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0};
const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits});
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled;
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.fulfilled;
expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits);
});
- });
-
- it('should reject transaction if collection doesn\'t exist', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should reject transaction if collection doesn\'t exist', async ({helper}) => {
const collectionOwner = accounts.pop()!;
-
+
// collection has never existed
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.rejected;
// collection has been burned
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
await collection.burn(collectionOwner);
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.rejected;
});
});
-});
-
-describe('app-promotion stopSponsoringCollection', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- it('can not be called by non-admin', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ describe('stopSponsoringCollection', () => {
+ itSub('can not be called by non-admin', async ({helper}) => {
const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
-
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.fulfilled;
+
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
});
- });
-
- it('should set sponsoring as disabled', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should set sponsoring as disabled', async ({helper}) => {
const [collectionOwner, recepient] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}});
const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address});
-
+
await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId));
await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId));
-
+
expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled');
-
+
// Transactions are not sponsored anymore:
const ownerBalanceBefore = await helper.balance.getSubstrate(collectionOwner.address);
await token.transfer(collectionOwner, {Substrate: recepient.address});
const ownerBalanceAfter = await helper.balance.getSubstrate(collectionOwner.address);
expect(ownerBalanceAfter < ownerBalanceBefore).to.be.equal(true);
});
- });
-
- it('should not affect collection which is not sponsored by pallete', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should not affect collection which is not sponsored by pallete', async ({helper}) => {
const collectionOwner = accounts.pop()!;
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address});
await collection.confirmSponsorship(collectionOwner);
-
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
-
+
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.rejected;
+
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address});
});
- });
-
- it('should reject transaction if collection does not exist', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('should reject transaction if collection does not exist', async ({helper}) => {
const collectionOwner = accounts.pop()!;
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
-
+
await collection.burn(collectionOwner);
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected;
+ await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [collection.collectionId], true)).to.be.rejectedWith('common.CollectionNotFound');
+ await expect(helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringCollection', [999_999_999], true)).to.be.rejectedWith('common.CollectionNotFound');
});
});
-});
-
-describe('app-promotion contract sponsoring', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- itWeb3('should set palletes address as a sponsor', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractMethods = contractHelpers(web3, contractOwner);
-
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+
+ describe('contract sponsoring', () => {
+ itEth('should set palletes address as a sponsor', async ({helper}) => {
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]);
- expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
confirmed: {
substrate: palletAddress,
},
});
});
- });
-
- itWeb3('should overwrite sponsoring mode and existed sponsor', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractMethods = contractHelpers(web3, contractOwner);
-
- await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
+
+ itEth('should overwrite sponsoring mode and existed sponsor', async ({helper}) => {
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
+
// Contract is self sponsored
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.be.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
-
+
// set promotion sponsoring
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
-
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
+
// new sponsor is pallet address
- expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.callRpc('api.query.evmContractHelpers.owner', [flipper.options.address])).toJSON()).to.be.equal(contractOwner);
+ expect((await helper.callRpc('api.query.evmContractHelpers.sponsoring', [flipper.options.address])).toJSON()).to.deep.equal({
confirmed: {
substrate: palletAddress,
},
});
});
- });
-
- itWeb3('can be overwritten by contract owner', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractMethods = contractHelpers(web3, contractOwner);
-
+
+ itEth('can be overwritten by contract owner', async ({helper}) => {
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
// contract sponsored by pallet
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
-
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
+
// owner sets self sponsoring
- await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
- expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
- expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
+
+ expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.true;
+ expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
});
- });
-
- itWeb3('can not be set by non admin', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
+
+ itEth('can not be set by non admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractMethods = contractHelpers(web3, contractOwner);
-
- await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
+
// nonAdmin calls sponsorContract
- await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address))).to.be.rejected;
-
+ await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission');
+
// contract still self-sponsored
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
confirmed: {
ethereum: flipper.options.address.toLowerCase(),
},
});
});
-
- itWeb3('should be rejected for non-contract address', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
-
- });
- });
- });
-
- itWeb3('should actually sponsor transactions', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractHelper = contractHelpers(web3, contractOwner);
+
+ itEth('should actually sponsor transactions', async ({helper}) => {
+ // Contract caller
+ const caller = await helper.eth.createAccountWithBalance(alice, 1000n);
+ const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress);
+
+ // Deploy flipper
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner); // await deployFlipper(web3, contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
+ // Owner sets to sponsor every tx
await contractHelper.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: contractOwner});
await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
- await transferBalanceToEth(api, alice, flipper.options.address, 1000n);
-
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
+ await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address, 1000n); // transferBalanceToEth(api, alice, flipper.options.address, 1000n);
+
+ // Set promotion to the Flipper
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorContract(flipper.options.address));
+
+ // Caller calls Flipper
await flipper.methods.flip().send({from: caller});
expect(await flipper.methods.getValue().call()).to.be.true;
-
+
+ // The contracts and caller balances have not changed
const callerBalance = await helper.balance.getEthereum(caller);
const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address);
-
expect(callerBalance).to.be.equal(1000n * nominal);
- expect(1000n * nominal > contractBalanceAfter).to.be.true;
+ expect(1000n * nominal === contractBalanceAfter).to.be.true;
+
+ // The pallet balance has decreased
+ const palletBalanceAfter = await helper.balance.getSubstrate(palletAddress);
+ expect(palletBalanceAfter < palletBalanceBefore).to.be.true;
});
});
-});
-
-describe('app-promotion stopSponsoringContract', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- itWeb3('should remove pallet address from contract sponsors', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
- const caller = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- await transferBalanceToEth(api, alice, flipper.options.address);
- const contractHelper = contractHelpers(web3, contractOwner);
+
+ describe('stopSponsoringContract', () => {
+ itEth('should remove pallet address from contract sponsors', async ({helper}) => {
+ const caller = await helper.eth.createAccountWithBalance(alice, 1000n);
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner);
+ await helper.eth.transferBalanceFromSubstrate(alice, flipper.options.address);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+
await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address));
-
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address], true);
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true);
+
expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false;
- expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
- expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
+ expect((await helper.api!.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
+ expect((await helper.api!.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
disabled: null,
});
-
+
await flipper.methods.flip().send({from: caller});
expect(await flipper.methods.getValue().call()).to.be.true;
-
+
const callerBalance = await helper.balance.getEthereum(caller);
const contractBalanceAfter = await helper.balance.getEthereum(flipper.options.address);
-
+
// caller payed for call
expect(1000n * nominal > callerBalance).to.be.true;
expect(contractBalanceAfter).to.be.equal(1000n * nominal);
});
- });
-
- itWeb3('can not be called by non-admin', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
+
+ itEth('can not be called by non-admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
-
- await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorContract(flipper.options.address));
- await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner);
+
+ await helper.executeExtrinsic(palletAdmin, 'api.tx.appPromotion.sponsorContract', [flipper.options.address]);
+ await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address]))
+ .to.be.rejectedWith(/appPromotion\.NoPermission/);
});
- });
-
- itWeb3('should not affect a contract which is not sponsored by pallete', async ({api, web3, privateKeyWrapper}) => {
- await usingPlaygrounds(async (helper) => {
+
+ itEth('should not affect a contract which is not sponsored by pallete', async ({helper}) => {
const nonAdmin = accounts.pop()!;
- const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
- const flipper = await deployFlipper(web3, contractOwner);
- const contractHelper = contractHelpers(web3, contractOwner);
- await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
-
- await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
+ const contractOwner = (await helper.eth.createAccountWithBalance(alice, 1000n)).toLowerCase();
+ const flipper = await helper.eth.deployFlipper(contractOwner);
+ const contractHelper = helper.ethNativeContract.contractHelpers(contractOwner);
+ await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.fulfilled;
+
+ await expect(helper.executeExtrinsic(nonAdmin, 'api.tx.appPromotion.stopSponsoringContract', [flipper.options.address], true)).to.be.rejectedWith('appPromotion.NoPermission');
});
});
-});
-
-describe('app-promotion rewards', () => {
- before(async function () {
- await beforeEach(this);
- });
-
- it('can not be called by non admin', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ describe('rewards', () => {
+ itSub('can not be called by non admin', async ({helper}) => {
const nonAdmin = accounts.pop()!;
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.payoutStakers(100))).to.be.rejected;
+ await expect(helper.admin.payoutStakers(nonAdmin, 100)).to.be.rejectedWith('appPromotion.NoPermission');
});
- });
-
- it('should credit 0.05% for staking period', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('should increase total staked', async ({helper}) => {
const staker = accounts.pop()!;
-
+ const totalStakedBefore = await helper.staking.getTotalStaked();
+ await helper.staking.stake(staker, 100n * nominal);
+
+ // Wait for rewards and pay
+ const [stakedInBlock] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock.block));
+ const totalPayout = (await helper.admin.payoutStakers(palletAdmin, 100)).reduce((prev, payout) => prev + payout.payout, 0n);
+
+ const totalStakedAfter = await helper.staking.getTotalStaked();
+ expect(totalStakedAfter).to.equal(totalStakedBefore + (100n * nominal) + totalPayout);
+ // staker can unstake
+ await helper.staking.unstake(staker);
+ expect(await helper.staking.getTotalStaked()).to.be.equal(totalStakedAfter - calculateIncome(100n * nominal, 10n));
+ });
+
+ itSub('should credit 0.05% for staking period', async ({helper}) => {
+ const staker = accounts.pop()!;
+
await waitPromotionPeriodDoesntEnd(helper);
-
+
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.stake(staker, 200n * nominal);
-
+
// wait rewards are available:
- const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[1][0];
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock));
-
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
-
- const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
- expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]);
+ const [_, stake2] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake2.block));
+
+ const payoutToStaker = (await helper.admin.payoutStakers(palletAdmin, 100)).find((payout) => payout.staker === staker.address)?.payout;
+ expect(payoutToStaker + 300n * nominal).to.equal(calculateIncome(300n * nominal, 10n));
+
+ const totalStakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(totalStakedPerBlock[0].amount).to.equal(calculateIncome(100n * nominal, 10n));
+ expect(totalStakedPerBlock[1].amount).to.equal(calculateIncome(200n * nominal, 10n));
});
- });
-
- it('shoud be paid for more than one period if payments was missed', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub('shoud be paid for more than one period if payments was missed', async ({helper}) => {
const staker = accounts.pop()!;
-
+
await helper.staking.stake(staker, 100n * nominal);
// wait for two rewards are available:
- const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
-
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
- const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
+
+ await helper.admin.payoutStakers(palletAdmin, 100);
+ [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
const frozenBalanceShouldBe = calculateIncome(100n * nominal, 10n, 2);
- expect(stakedPerBlock[0][1]).to.be.equal(frozenBalanceShouldBe);
-
+ expect(stake.amount).to.be.equal(frozenBalanceShouldBe);
+
const stakerFullBalance = await helper.balance.getSubstrateFull(staker.address);
-
+
expect(stakerFullBalance).to.contain({reserved: 0n, feeFrozen: frozenBalanceShouldBe, miscFrozen: frozenBalanceShouldBe});
});
- });
-
- it('should not be credited for unstaked (reserved) balance', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('should not be credited for unstaked (reserved) balance', async ({helper}) => {
// staker unstakes before rewards has been payed
const staker = accounts.pop()!;
await helper.staking.stake(staker, 100n * nominal);
- const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
+ const [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
await helper.staking.unstake(staker);
-
+
// so he did not receive any rewards
const totalBalanceBefore = await helper.balance.getSubstrate(staker.address);
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ await helper.admin.payoutStakers(palletAdmin, 100);
const totalBalanceAfter = await helper.balance.getSubstrate(staker.address);
-
+
expect(totalBalanceBefore).to.be.equal(totalBalanceAfter);
});
- });
-
- it('should bring compound interest', async () => {
- await usingPlaygrounds(async helper => {
+
+ itSub('should bring compound interest', async ({helper}) => {
const staker = accounts.pop()!;
-
+
await helper.staking.stake(staker, 100n * nominal);
-
- const stakedInBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address}))[0][0];
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock));
-
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
- let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
- expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n)]);
-
- await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stakedInBlock) + LOCKING_PERIOD);
- await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
- totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
- expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2)]);
+
+ let [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block));
+
+ await helper.admin.payoutStakers(palletAdmin, 100);
+ [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n));
+
+ await helper.wait.forRelayBlockNumber(rewardAvailableInBlock(stake.block) + LOCKING_PERIOD);
+ await helper.admin.payoutStakers(palletAdmin, 100);
+ [stake] = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
+ expect(stake.amount).to.equal(calculateIncome(100n * nominal, 10n, 2));
});
- });
-
- it.skip('can be paid 1000 rewards in a time', async () => {
- // all other stakes should be unstaked
- await usingPlaygrounds(async (helper) => {
+
+ itSub.skip('can be paid 1000 rewards in a time', async ({helper}) => {
+ // all other stakes should be unstaked
const oneHundredStakers = await helper.arrange.createCrowd(100, 1050n, alice);
-
+
// stakers stakes 10 times each
for (let i = 0; i < 10; i++) {
await Promise.all(oneHundredStakers.map(staker => helper.staking.stake(staker, 100n * nominal)));
}
await helper.wait.newBlocks(40);
- const result = await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
+ await helper.admin.payoutStakers(palletAdmin, 100);
});
- });
-
- it.skip('can handle 40.000 rewards', async () => {
- await usingPlaygrounds(async (helper) => {
+
+ itSub.skip('can handle 40.000 rewards', async ({helper}) => {
const [donor] = await helper.arrange.createAccounts([7_000_000n], alice);
const crowdStakes = async () => {
// each account in the crowd stakes 2 times
@@ -763,11 +686,11 @@
await Promise.all(crowd.map(account => helper.staking.stake(account, 100n * nominal)));
//
};
-
+
for (let i = 0; i < 40; i++) {
await crowdStakes();
}
-
+
// TODO pay rewards for some period
});
});
tests/src/block-production.test.tsdiffbeforeafterboth--- a/tests/src/block-production.test.ts
+++ b/tests/src/block-production.test.ts
@@ -14,9 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-import usingApi from './substrate/substrate-api';
-import {expect} from 'chai';
import {ApiPromise} from '@polkadot/api';
+import {expect, itSub} from './util/playgrounds';
const BLOCK_TIME_MS = 12000;
const TOLERANCE_MS = 3000;
@@ -37,10 +36,8 @@
}
describe('Block Production smoke test', () => {
- it('Node produces new blocks', async () => {
- await usingApi(async (api) => {
- const blocks: number[] | undefined = await getBlocks(api);
- expect(blocks[0]).to.be.lessThan(blocks[1]);
- });
+ itSub('Node produces new blocks', async ({helper}) => {
+ const blocks: number[] | undefined = await getBlocks(helper.api!);
+ expect(blocks[0]).to.be.lessThan(blocks[1]);
});
});
tests/src/connection.test.tsdiffbeforeafterboth--- a/tests/src/connection.test.ts
+++ b/tests/src/connection.test.ts
@@ -14,29 +14,19 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-import usingApi from './substrate/substrate-api';
-import {WsProvider} from '@polkadot/api';
-import * as chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-
-chai.use(chaiAsPromised);
-
-const expect = chai.expect;
+import {itSub, expect, usingPlaygrounds} from './util/playgrounds';
describe('Connection smoke test', () => {
- it('Connection can be established', async () => {
- await usingApi(async api => {
- const health = await api.rpc.system.health();
- expect(health).to.be.not.empty;
- });
+ itSub('Connection can be established', async ({helper}) => {
+ const health = (await helper.callRpc('api.rpc.system.health')).toJSON();
+ expect(health).to.be.not.empty;
});
it('Cannot connect to 255.255.255.255', async () => {
- const neverConnectProvider = new WsProvider('ws://255.255.255.255:9944');
await expect((async () => {
- await usingApi(async api => {
- await api.rpc.system.health();
- }, {provider: neverConnectProvider});
+ await usingPlaygrounds(async helper => {
+ await helper.callRpc('api.rpc.system.health');
+ }, 'ws://255.255.255.255:9944');
})()).to.be.eventually.rejected;
});
});
tests/src/contracts.test.tsdiffbeforeafterboth--- a/tests/src/contracts.test.ts
+++ b/tests/src/contracts.test.ts
@@ -47,6 +47,7 @@
const gasLimit = 9000n * 1000000n;
const marketContractAddress = '5CYN9j3YvRkqxewoxeSvRbhAym4465C57uMmX5j4yz99L5H6';
+// todo:playgrounds skipped ~ postponed
describe.skip('Contracts', () => {
it('Can deploy smart contract Flipper, instantiate it and call it\'s get and flip messages.', async () => {
await usingApi(async (api, privateKeyWrapper) => {
tests/src/enableContractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/enableContractSponsoring.test.ts
+++ b/tests/src/enableContractSponsoring.test.ts
@@ -29,6 +29,7 @@
chai.use(chaiAsPromised);
const expect = chai.expect;
+// todo:playgrounds skipped ~ postponed
describe.skip('Integration Test enableContractSponsoring', () => {
it('ensure tx fee is paid from endowment', async () => {
await usingApi(async (api, privateKeyWrapper) => {
tests/src/eth/api/ContractHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -15,15 +15,12 @@
/// @dev inlined interface
interface ContractHelpersEvents {
event ContractSponsorSet(address indexed contractAddress, address sponsor);
- event ContractSponsorshipConfirmed(
- address indexed contractAddress,
- address sponsor
- );
+ event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);
event ContractSponsorRemoved(address indexed contractAddress);
}
/// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
@@ -34,10 +31,7 @@
/// @return address Owner of contract
/// @dev EVM selector for this function is: 0x5152b14c,
/// or in textual repr: contractOwner(address)
- function contractOwner(address contractAddress)
- external
- view
- returns (address);
+ function contractOwner(address contractAddress) external view returns (address);
/// Set sponsor.
/// @param contractAddress Contract for which a sponsor is being established.
@@ -73,12 +67,9 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0x743fc745,
- /// or in textual repr: getSponsor(address)
- function getSponsor(address contractAddress)
- external
- view
- returns (Tuple0 memory);
+ /// @dev EVM selector for this function is: 0x766c4f37,
+ /// or in textual repr: sponsor(address)
+ function sponsor(address contractAddress) external view returns (Tuple0 memory);
/// Check tat contract has confirmed sponsor.
///
@@ -94,17 +85,11 @@
/// @return **true** if contract has pending sponsor.
/// @dev EVM selector for this function is: 0x39b9b242,
/// or in textual repr: hasPendingSponsor(address)
- function hasPendingSponsor(address contractAddress)
- external
- view
- returns (bool);
+ function hasPendingSponsor(address contractAddress) external view returns (bool);
/// @dev EVM selector for this function is: 0x6027dc61,
/// or in textual repr: sponsoringEnabled(address)
- function sponsoringEnabled(address contractAddress)
- external
- view
- returns (bool);
+ function sponsoringEnabled(address contractAddress) external view returns (bool);
/// @dev EVM selector for this function is: 0xfde8a560,
/// or in textual repr: setSponsoringMode(address,uint8)
@@ -113,12 +98,9 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- /// @dev EVM selector for this function is: 0x610cfabd,
- /// or in textual repr: getSponsoringRateLimit(address)
- function getSponsoringRateLimit(address contractAddress)
- external
- view
- returns (uint32);
+ /// @dev EVM selector for this function is: 0xf29694d8,
+ /// or in textual repr: sponsoringRateLimit(address)
+ function sponsoringRateLimit(address contractAddress) external view returns (uint32);
/// Set contract sponsoring rate limit
/// @dev Sponsoring rate limit - is a minimum amount of blocks that should
@@ -128,8 +110,7 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x77b6c908,
/// or in textual repr: setSponsoringRateLimit(address,uint32)
- function setSponsoringRateLimit(address contractAddress, uint32 rateLimit)
- external;
+ function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) external;
/// Set contract sponsoring fee limit
/// @dev Sponsoring fee limit - is maximum fee that could be spent by
@@ -139,19 +120,15 @@
/// @dev Only contract owner can change this setting
/// @dev EVM selector for this function is: 0x03aed665,
/// or in textual repr: setSponsoringFeeLimit(address,uint256)
- function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit)
- external;
+ function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) external;
/// Get current contract sponsoring fee limit
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- /// @dev EVM selector for this function is: 0xc3fdc9ee,
- /// or in textual repr: getSponsoringFeeLimit(address)
- function getSponsoringFeeLimit(address contractAddress)
- external
- view
- returns (uint256);
+ /// @dev EVM selector for this function is: 0x75b73606,
+ /// or in textual repr: sponsoringFeeLimit(address)
+ function sponsoringFeeLimit(address contractAddress) external view returns (uint256);
/// Is specified user present in contract allow list
/// @dev Contract owner always implicitly included
@@ -160,10 +137,7 @@
/// @return bool Is specified users exists in contract allowlist
/// @dev EVM selector for this function is: 0x5c658165,
/// or in textual repr: allowed(address,address)
- function allowed(address contractAddress, address user)
- external
- view
- returns (bool);
+ function allowed(address contractAddress, address user) external view returns (bool);
/// Toggle user presence in contract allowlist
/// @param contractAddress Contract to change allowlist of
@@ -187,10 +161,7 @@
/// @return bool Is specified contract has allowlist access enabled
/// @dev EVM selector for this function is: 0xc772ef6c,
/// or in textual repr: allowlistEnabled(address)
- function allowlistEnabled(address contractAddress)
- external
- view
- returns (bool);
+ function allowlistEnabled(address contractAddress) external view returns (bool);
/// Toggle contract allowlist access
/// @param contractAddress Contract to change allowlist access of
tests/src/eth/api/UniqueFungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueFungible.sol
+++ b/tests/src/eth/api/UniqueFungible.sol
@@ -13,7 +13,7 @@
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -21,8 +21,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -39,10 +38,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -62,6 +58,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -81,9 +78,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple6 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple6 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -153,8 +150,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -227,7 +223,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -291,11 +287,7 @@
/// @dev inlined interface
interface ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @dev the ERC-165 identifier for this interface is 0x942e8b22
@@ -338,17 +330,7 @@
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- external
- view
- returns (uint256);
+ function allowance(address owner, address spender) external view returns (uint256);
}
-interface UniqueFungible is
- Dummy,
- ERC165,
- ERC20,
- ERC20Mintable,
- ERC20UniqueExtensions,
- Collection
-{}
+interface UniqueFungible is Dummy, ERC165, ERC20, ERC20Mintable, ERC20UniqueExtensions, Collection {}
tests/src/eth/api/UniqueNFT.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueNFT.sol
+++ b/tests/src/eth/api/UniqueNFT.sol
@@ -58,14 +58,11 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- external
- view
- returns (bytes memory);
+ function property(uint256 tokenId, string memory key) external view returns (bytes memory);
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -73,8 +70,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -91,10 +87,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -114,6 +107,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -133,9 +127,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple17 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple17 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -205,8 +199,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -279,7 +272,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -399,9 +392,7 @@
/// @param tokenIds IDs of the minted NFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- external
- returns (bool);
+ function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
@@ -410,9 +401,7 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- external
- returns (bool);
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool);
}
/// @dev anonymous struct
@@ -436,10 +425,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- external
- view
- returns (uint256);
+ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/// @notice Count NFTs tracked by this contract
/// @return A count of valid NFTs tracked by this contract, where each one of
@@ -479,21 +465,9 @@
/// @dev inlined interface
interface ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -577,10 +551,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- external
- view
- returns (address);
+ function isApprovedForAll(address owner, address operator) external view returns (address);
}
interface UniqueNFT is
tests/src/eth/api/UniqueRefungible.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungible.sol
+++ b/tests/src/eth/api/UniqueRefungible.sol
@@ -58,14 +58,11 @@
/// @return Property value bytes
/// @dev EVM selector for this function is: 0x7228c327,
/// or in textual repr: property(uint256,string)
- function property(uint256 tokenId, string memory key)
- external
- view
- returns (bytes memory);
+ function property(uint256 tokenId, string memory key) external view returns (bytes memory);
}
/// @title A contract that allows you to work with collections.
-/// @dev the ERC-165 identifier for this interface is 0x9f70d4e0
+/// @dev the ERC-165 identifier for this interface is 0x47dbc105
interface Collection is Dummy, ERC165 {
/// Set collection property.
///
@@ -73,8 +70,7 @@
/// @param value Propery value.
/// @dev EVM selector for this function is: 0x2f073f66,
/// or in textual repr: setCollectionProperty(string,bytes)
- function setCollectionProperty(string memory key, bytes memory value)
- external;
+ function setCollectionProperty(string memory key, bytes memory value) external;
/// Delete collection property.
///
@@ -91,10 +87,7 @@
/// @return bytes The property corresponding to the key.
/// @dev EVM selector for this function is: 0xcf24fd6d,
/// or in textual repr: collectionProperty(string)
- function collectionProperty(string memory key)
- external
- view
- returns (bytes memory);
+ function collectionProperty(string memory key) external view returns (bytes memory);
/// Set the sponsor of the collection.
///
@@ -114,6 +107,7 @@
/// or in textual repr: setCollectionSponsorSubstrate(uint256)
function setCollectionSponsorSubstrate(uint256 sponsor) external;
+ /// Whether there is a pending sponsor.
/// @dev EVM selector for this function is: 0x058ac185,
/// or in textual repr: hasCollectionPendingSponsor()
function hasCollectionPendingSponsor() external view returns (bool);
@@ -133,9 +127,9 @@
/// Get current sponsor.
///
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0xb66bbc14,
- /// or in textual repr: getCollectionSponsor()
- function getCollectionSponsor() external view returns (Tuple17 memory);
+ /// @dev EVM selector for this function is: 0x6ec0a9f1,
+ /// or in textual repr: collectionSponsor()
+ function collectionSponsor() external view returns (Tuple17 memory);
/// Set limits for the collection.
/// @dev Throws error if limit not found.
@@ -205,8 +199,7 @@
/// @param collections Addresses of collections that will be available for nesting.
/// @dev EVM selector for this function is: 0x64872396,
/// or in textual repr: setCollectionNesting(bool,address[])
- function setCollectionNesting(bool enable, address[] memory collections)
- external;
+ function setCollectionNesting(bool enable, address[] memory collections) external;
/// Set the collection access method.
/// @param mode Access mode
@@ -279,7 +272,7 @@
/// @return `Fungible` or `NFT` or `ReFungible`
/// @dev EVM selector for this function is: 0xd34b55b8,
/// or in textual repr: uniqueCollectionType()
- function uniqueCollectionType() external returns (string memory);
+ function uniqueCollectionType() external view returns (string memory);
/// Get collection owner.
///
@@ -401,9 +394,7 @@
/// @param tokenIds IDs of the minted RFTs
/// @dev EVM selector for this function is: 0x44a9945e,
/// or in textual repr: mintBulk(address,uint256[])
- function mintBulk(address to, uint256[] memory tokenIds)
- external
- returns (bool);
+ function mintBulk(address to, uint256[] memory tokenIds) external returns (bool);
/// @notice Function to mint multiple tokens with the given tokenUris.
/// @dev `tokenIds` is array of pairs of token ID and token URI. Token IDs should be consecutive
@@ -412,19 +403,14 @@
/// @param tokens array of pairs of token ID and token URI for minted tokens
/// @dev EVM selector for this function is: 0x36543006,
/// or in textual repr: mintBulkWithTokenURI(address,(uint256,string)[])
- function mintBulkWithTokenURI(address to, Tuple8[] memory tokens)
- external
- returns (bool);
+ function mintBulkWithTokenURI(address to, Tuple8[] memory tokens) external returns (bool);
/// Returns EVM address for refungible token
///
/// @param token ID of the token
/// @dev EVM selector for this function is: 0xab76fac6,
/// or in textual repr: tokenContractAddress(uint256)
- function tokenContractAddress(uint256 token)
- external
- view
- returns (address);
+ function tokenContractAddress(uint256 token) external view returns (address);
}
/// @dev anonymous struct
@@ -448,10 +434,7 @@
/// Not implemented
/// @dev EVM selector for this function is: 0x2f745c59,
/// or in textual repr: tokenOfOwnerByIndex(address,uint256)
- function tokenOfOwnerByIndex(address owner, uint256 index)
- external
- view
- returns (uint256);
+ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/// @notice Count RFTs tracked by this contract
/// @return A count of valid RFTs tracked by this contract, where each one of
@@ -489,21 +472,9 @@
/// @dev inlined interface
interface ERC721Events {
- event Transfer(
- address indexed from,
- address indexed to,
- uint256 indexed tokenId
- );
- event Approval(
- address indexed owner,
- address indexed approved,
- uint256 indexed tokenId
- );
- event ApprovalForAll(
- address indexed owner,
- address indexed operator,
- bool approved
- );
+ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
+ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
+ event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
}
/// @title ERC-721 Non-Fungible Token Standard
@@ -585,10 +556,7 @@
/// @dev Not implemented
/// @dev EVM selector for this function is: 0xe985e9c5,
/// or in textual repr: isApprovedForAll(address,address)
- function isApprovedForAll(address owner, address operator)
- external
- view
- returns (address);
+ function isApprovedForAll(address owner, address operator) external view returns (address);
}
interface UniqueRefungible is
tests/src/eth/api/UniqueRefungibleToken.soldiffbeforeafterboth--- a/tests/src/eth/api/UniqueRefungibleToken.sol
+++ b/tests/src/eth/api/UniqueRefungibleToken.sol
@@ -44,11 +44,7 @@
/// @dev inlined interface
interface ERC20Events {
event Transfer(address indexed from, address indexed to, uint256 value);
- event Approval(
- address indexed owner,
- address indexed spender,
- uint256 value
- );
+ event Approval(address indexed owner, address indexed spender, uint256 value);
}
/// @title Standard ERC20 token
@@ -120,16 +116,7 @@
/// @return A uint256 specifying the amount of tokens still available for the spender.
/// @dev EVM selector for this function is: 0xdd62ed3e,
/// or in textual repr: allowance(address,address)
- function allowance(address owner, address spender)
- external
- view
- returns (uint256);
+ function allowance(address owner, address spender) external view returns (uint256);
}
-interface UniqueRefungibleToken is
- Dummy,
- ERC165,
- ERC20,
- ERC20UniqueExtensions,
- ERC1633
-{}
+interface UniqueRefungibleToken is Dummy, ERC165, ERC20, ERC20UniqueExtensions, ERC1633 {}
tests/src/eth/collectionSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/collectionSponsoring.test.ts
+++ b/tests/src/eth/collectionSponsoring.test.ts
@@ -56,7 +56,7 @@
await submitTransactionAsync(sponsor, confirmTx);
expect(await collectionEvm.methods.hasCollectionPendingSponsor().call({from: owner})).to.be.false;
- const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner});
+ const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});
expect(bigIntToSub(api, BigInt(sponsorTuple[1]))).to.be.eq(sponsor.address);
});
@@ -77,7 +77,7 @@
await collectionEvm.methods.removeCollectionSponsor().send({from: owner});
- const sponsorTuple = await collectionEvm.methods.getCollectionSponsor().call({from: owner});
+ const sponsorTuple = await collectionEvm.methods.collectionSponsor().call({from: owner});
expect(sponsorTuple.field_0).to.be.eq('0x0000000000000000000000000000000000000000');
});
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -223,7 +223,7 @@
const helpers = contractHelpers(web3, owner);
await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
- const result = await helpers.methods.getSponsor(flipper.options.address).call();
+ const result = await helpers.methods.sponsor(flipper.options.address).call();
expect(result[0]).to.be.eq(flipper.options.address);
expect(result[1]).to.be.eq('0');
@@ -237,7 +237,7 @@
await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
- const result = await helpers.methods.getSponsor(flipper.options.address).call();
+ const result = await helpers.methods.sponsor(flipper.options.address).call();
expect(result[0]).to.be.eq(sponsor);
expect(result[1]).to.be.eq('0');
@@ -482,7 +482,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
- expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
+ expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
});
});
@@ -551,7 +551,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
- expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
+ expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
});
itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => {
@@ -559,7 +559,7 @@
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send();
- expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
+ expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
});
itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => {
tests/src/eth/fungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/fungibleAbi.json
+++ b/tests/src/eth/fungibleAbi.json
@@ -159,6 +159,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple6",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -183,23 +200,6 @@
"name": "deleteCollectionProperty",
"outputs": [],
"stateMutability": "nonpayable",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple6",
- "name": "",
- "type": "tuple"
- }
- ],
- "stateMutability": "view",
"type": "function"
},
{
@@ -453,7 +453,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/nonFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/nonFungibleAbi.json
+++ b/tests/src/eth/nonFungibleAbi.json
@@ -189,6 +189,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple17",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -231,23 +248,6 @@
],
"name": "getApproved",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple17",
- "name": "",
- "type": "tuple"
- }
- ],
"stateMutability": "view",
"type": "function"
},
@@ -651,7 +651,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/reFungibleAbi.jsondiffbeforeafterboth--- a/tests/src/eth/reFungibleAbi.json
+++ b/tests/src/eth/reFungibleAbi.json
@@ -189,6 +189,23 @@
},
{
"inputs": [],
+ "name": "collectionSponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple17",
+ "name": "",
+ "type": "tuple"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
"name": "confirmCollectionSponsorship",
"outputs": [],
"stateMutability": "nonpayable",
@@ -231,23 +248,6 @@
],
"name": "getApproved",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
- "stateMutability": "view",
- "type": "function"
- },
- {
- "inputs": [],
- "name": "getCollectionSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple17",
- "name": "",
- "type": "tuple"
- }
- ],
"stateMutability": "view",
"type": "function"
},
@@ -660,7 +660,7 @@
"inputs": [],
"name": "uniqueCollectionType",
"outputs": [{ "internalType": "string", "name": "", "type": "string" }],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
}
]
tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -111,18 +111,8 @@
"type": "address"
}
],
- "name": "getSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple0",
- "name": "",
- "type": "tuple"
- }
- ],
+ "name": "hasPendingSponsor",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
@@ -134,8 +124,8 @@
"type": "address"
}
],
- "name": "getSponsoringFeeLimit",
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "name": "hasSponsor",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
@@ -147,9 +137,9 @@
"type": "address"
}
],
- "name": "getSponsoringRateLimit",
- "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
- "stateMutability": "view",
+ "name": "removeSponsor",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -160,9 +150,9 @@
"type": "address"
}
],
- "name": "hasPendingSponsor",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
- "stateMutability": "view",
+ "name": "selfSponsoredEnable",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -171,11 +161,12 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "address", "name": "sponsor", "type": "address" }
],
- "name": "hasSponsor",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
- "stateMutability": "view",
+ "name": "setSponsor",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -184,9 +175,10 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }
],
- "name": "removeSponsor",
+ "name": "setSponsoringFeeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -197,9 +189,10 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "uint8", "name": "mode", "type": "uint8" }
],
- "name": "selfSponsoredEnable",
+ "name": "setSponsoringMode",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -211,9 +204,9 @@
"name": "contractAddress",
"type": "address"
},
- { "internalType": "address", "name": "sponsor", "type": "address" }
+ { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
],
- "name": "setSponsor",
+ "name": "setSponsoringRateLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -224,12 +217,21 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }
+ }
+ ],
+ "name": "sponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple0",
+ "name": "",
+ "type": "tuple"
+ }
],
- "name": "setSponsoringFeeLimit",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
},
{
@@ -238,12 +240,11 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint8", "name": "mode", "type": "uint8" }
+ }
],
- "name": "setSponsoringMode",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "name": "sponsoringEnabled",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
"type": "function"
},
{
@@ -252,12 +253,11 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
+ }
],
- "name": "setSponsoringRateLimit",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "name": "sponsoringFeeLimit",
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "stateMutability": "view",
"type": "function"
},
{
@@ -268,8 +268,8 @@
"type": "address"
}
],
- "name": "sponsoringEnabled",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "name": "sponsoringRateLimit",
+ "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
"stateMutability": "view",
"type": "function"
},
tests/src/eth/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/eth/util/playgrounds/unique.dev.ts
+++ b/tests/src/eth/util/playgrounds/unique.dev.ts
@@ -198,8 +198,24 @@
}
`);
}
-}
-
+
+ async deployFlipper(signer: string): Promise<Contract> {
+ return await this.helper.ethContract.deployByCode(signer, 'Flipper', `
+ // SPDX-License-Identifier: UNLICENSED
+ pragma solidity ^0.8.6;
+
+ contract Flipper {
+ bool value = false;
+ function flip() public {
+ value = !value;
+ }
+ function getValue() public view returns (bool) {
+ return value;
+ }
+ }
+ `);
+ }
+}
class EthAddressGroup extends EthGroupBase {
extractCollectionId(address: string): number {
tests/src/evmCoder.test.tsdiffbeforeafterboth--- a/tests/src/evmCoder.test.ts
+++ b/tests/src/evmCoder.test.ts
@@ -14,13 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+import {IKeyringPair} from '@polkadot/types/types';
import Web3 from 'web3';
-import {createEthAccountWithBalance, createNonfungibleCollection, GAS_ARGS, itWeb3} from './eth/util/helpers';
+import {itEth, expect, usingEthPlaygrounds} from './eth/util/playgrounds';
import * as solc from 'solc';
-import chai from 'chai';
-const expect = chai.expect;
-
async function compileTestContract(collectionAddress: string, contractAddress: string) {
const input = {
language: 'Solidity',
@@ -79,22 +77,30 @@
};
}
-async function deployTestContract(web3: Web3, owner: string, collectionAddress: string, contractAddress: string) {
+async function deployTestContract(web3: Web3, owner: string, collectionAddress: string, contractAddress: string, gas: number) {
const compiled = await compileTestContract(collectionAddress, contractAddress);
const fractionalizerContract = new web3.eth.Contract(compiled.abi, undefined, {
data: compiled.object,
from: owner,
- ...GAS_ARGS,
+ gas,
});
return await fractionalizerContract.deploy({data: compiled.object}).send({from: owner});
}
describe('Evm Coder tests', () => {
- itWeb3('Call non-existing function', async ({api, web3, privateKeyWrapper}) => {
- const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
- const {collectionIdAddress} = await createNonfungibleCollection(api, web3, owner);
- const contract = await deployTestContract(web3, owner, collectionIdAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c');
- const testContract = await deployTestContract(web3, owner, collectionIdAddress, contract.options.address);
+ let donor: IKeyringPair;
+
+ before(async function() {
+ await usingEthPlaygrounds(async (_helper, privateKey) => {
+ donor = privateKey('//Alice');
+ });
+ });
+
+ itEth('Call non-existing function', async ({helper}) => {
+ const owner = await helper.eth.createAccountWithBalance(donor);
+ const collection = await helper.eth.createNonfungibleCollection(owner, 'EVMCODER', '', 'TEST');
+ const contract = await deployTestContract(helper.getWeb3(), owner, collection.collectionAddress, '0x1bfed5D614b886b9Ab2eA4CBAc22A96B7EC29c9c', helper.eth.DEFAULT_GAS);
+ const testContract = await deployTestContract(helper.getWeb3(), owner, collection.collectionAddress, contract.options.address, helper.eth.DEFAULT_GAS);
{
const result = await testContract.methods.test1().send();
expect(result.events.Result.returnValues).to.deep.equal({
tests/src/fungible.test.tsdiffbeforeafterboth--- a/tests/src/fungible.test.ts
+++ b/tests/src/fungible.test.ts
@@ -15,18 +15,18 @@
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
import {IKeyringPair} from '@polkadot/types/types';
-import {U128_MAX} from './util/helpers';
import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
-// todo:playgrounds get rid of globals
-let alice: IKeyringPair;
-let bob: IKeyringPair;
+const U128_MAX = (1n << 128n) - 1n;
describe('integration test: Fungible functionality:', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
before(async () => {
await usingPlaygrounds(async (helper, privateKey) => {
- alice = privateKey('//Alice');
- bob = privateKey('//Bob');
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor);
});
});
@@ -82,7 +82,7 @@
expect(await collection.getBalance({Substrate: bob.address})).to.be.equal(60n);
expect(await collection.getBalance(ethAcc)).to.be.equal(140n);
- await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejected;
+ await expect(collection.transfer(alice, {Substrate: bob.address}, 350n)).to.eventually.be.rejectedWith(/common\.TokenValueTooLow/);
});
itSub('Tokens multiple creation', async ({helper}) => {
tests/src/inflation.test.tsdiffbeforeafterboth--- a/tests/src/inflation.test.ts
+++ b/tests/src/inflation.test.ts
@@ -14,42 +14,45 @@
// You should have received a copy of the GNU General Public License
// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-import chai from 'chai';
-import chaiAsPromised from 'chai-as-promised';
-import {default as usingApi, submitTransactionAsync, submitTransactionExpectFailAsync} from './substrate/substrate-api';
-
-chai.use(chaiAsPromised);
-const expect = chai.expect;
+import {IKeyringPair} from '@polkadot/types/types';
+import {expect, itSub, usingPlaygrounds} from './util/playgrounds';
+// todo:playgrounds requires sudo, look into on the later stage
describe('integration test: Inflation', () => {
- it('First year inflation is 10%', async () => {
- await usingApi(async (api, privateKeyWrapper) => {
+ let superuser: IKeyringPair;
- // Make sure non-sudo can't start inflation
- const tx = api.tx.inflation.startInflation(1);
- const bob = privateKeyWrapper('//Bob');
- await expect(submitTransactionExpectFailAsync(bob, tx)).to.be.rejected;
+ before(async () => {
+ await usingPlaygrounds(async (_, privateKey) => {
+ superuser = privateKey('//Alice');
+ });
+ });
+
+ itSub('First year inflation is 10%', async ({helper}) => {
+ // Make sure non-sudo can't start inflation
+ const [bob] = await helper.arrange.createAccounts([10n], superuser);
- // Start inflation on relay block 1 (Alice is sudo)
- const alice = privateKeyWrapper('//Alice');
- const sudoTx = api.tx.sudo.sudo(tx as any);
- await submitTransactionAsync(alice, sudoTx);
+ await expect(helper.executeExtrinsic(bob, 'api.tx.inflation.startInflation', [1])).to.be.rejectedWith(/BadOrigin/);
- const blockInterval = (api.consts.inflation.inflationBlockInterval).toBigInt();
- const totalIssuanceStart = (await api.query.inflation.startingYearTotalIssuance()).toBigInt();
- const blockInflation = (await api.query.inflation.blockInflation()).toBigInt();
+ // Make sure superuser can't start inflation without explicit sudo
+ await expect(helper.executeExtrinsic(superuser, 'api.tx.inflation.startInflation', [1])).to.be.rejectedWith(/BadOrigin/);
- const YEAR = 5259600n; // 6-second block. Blocks in one year
- // const YEAR = 2629800n; // 12-second block. Blocks in one year
+ // Start inflation on relay block 1 (Alice is sudo)
+ const tx = helper.constructApiCall('api.tx.inflation.startInflation', [1]);
+ await expect(helper.executeExtrinsic(superuser, 'api.tx.sudo.sudo', [tx])).to.not.be.rejected;
- const totalExpectedInflation = totalIssuanceStart / 10n;
- const totalActualInflation = blockInflation * YEAR / blockInterval;
+ const blockInterval = (helper.api!.consts.inflation.inflationBlockInterval as any).toBigInt();
+ const totalIssuanceStart = ((await helper.api!.query.inflation.startingYearTotalIssuance()) as any).toBigInt();
+ const blockInflation = (await helper.api!.query.inflation.blockInflation() as any).toBigInt();
- const tolerance = 0.00001; // Relative difference per year between theoretical and actual inflation
- const expectedInflation = totalExpectedInflation / totalActualInflation - 1n;
+ const YEAR = 5259600n; // 6-second block. Blocks in one year
+ // const YEAR = 2629800n; // 12-second block. Blocks in one year
+
+ const totalExpectedInflation = totalIssuanceStart / 10n;
+ const totalActualInflation = blockInflation * YEAR / blockInterval;
+
+ const tolerance = 0.00001; // Relative difference per year between theoretical and actual inflation
+ const expectedInflation = totalExpectedInflation / totalActualInflation - 1n;
- expect(Math.abs(Number(expectedInflation))).to.be.lessThanOrEqual(tolerance);
- });
+ expect(Math.abs(Number(expectedInflation))).to.be.lessThanOrEqual(tolerance);
});
-
});
tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-consts.ts
+++ b/tests/src/interfaces/augment-api-consts.ts
@@ -9,7 +9,7 @@
import type { Option, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime';
-import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
+import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, XcmV1MultiLocation } from '@polkadot/types/lookup';
export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
@@ -25,7 +25,7 @@
**/
nominal: u128 & AugmentedConst<ApiType>;
/**
- * The app's pallet id, used for deriving its sovereign account ID.
+ * The app's pallet id, used for deriving its sovereign account address.
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
@@ -155,6 +155,17 @@
**/
[key: string]: Codec;
};
+ tokens: {
+ maxLocks: u32 & AugmentedConst<ApiType>;
+ /**
+ * The maximum number of named reserves that can exist on an account.
+ **/
+ maxReserves: u32 & AugmentedConst<ApiType>;
+ /**
+ * Generic const
+ **/
+ [key: string]: Codec;
+ };
transactionPayment: {
/**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
@@ -232,5 +243,22 @@
**/
[key: string]: Codec;
};
+ xTokens: {
+ /**
+ * Base XCM weight.
+ *
+ * The actually weight for an XCM message is `T::BaseXcmWeight +
+ * T::Weigher::weight(&msg)`.
+ **/
+ baseXcmWeight: u64 & AugmentedConst<ApiType>;
+ /**
+ * Self chain location.
+ **/
+ selfLocation: XcmV1MultiLocation & AugmentedConst<ApiType>;
+ /**
+ * Generic const
+ **/
+ [key: string]: Codec;
+ };
} // AugmentedConsts
} // declare module
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -303,6 +303,10 @@
**/
NoPermission: AugmentedError<ApiType>;
/**
+ * Number of methods that sponsored limit is defined for exceeds maximum.
+ **/
+ TooManyMethodsHaveSponsoredLimit: AugmentedError<ApiType>;
+ /**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
@@ -321,6 +325,29 @@
**/
[key: string]: AugmentedError<ApiType>;
};
+ foreignAssets: {
+ /**
+ * AssetId exists
+ **/
+ AssetIdExisted: AugmentedError<ApiType>;
+ /**
+ * AssetId not exists
+ **/
+ AssetIdNotExists: AugmentedError<ApiType>;
+ /**
+ * The given location could not be used (e.g. because it cannot be expressed in the
+ * desired version of XCM).
+ **/
+ BadLocation: AugmentedError<ApiType>;
+ /**
+ * MultiLocation existed
+ **/
+ MultiLocationExisted: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
fungible: {
/**
* Fungible token does not support nesting.
@@ -697,6 +724,41 @@
**/
[key: string]: AugmentedError<ApiType>;
};
+ tokens: {
+ /**
+ * Cannot convert Amount into Balance type
+ **/
+ AmountIntoBalanceFailed: AugmentedError<ApiType>;
+ /**
+ * The balance is too low
+ **/
+ BalanceTooLow: AugmentedError<ApiType>;
+ /**
+ * Beneficiary account must pre-exist
+ **/
+ DeadAccount: AugmentedError<ApiType>;
+ /**
+ * Value too low to create account due to existential deposit
+ **/
+ ExistentialDeposit: AugmentedError<ApiType>;
+ /**
+ * Transfer/payment would kill account
+ **/
+ KeepAlive: AugmentedError<ApiType>;
+ /**
+ * Failed because liquidity restrictions due to locking
+ **/
+ LiquidityRestrictions: AugmentedError<ApiType>;
+ /**
+ * Failed because the maximum locks was exceeded
+ **/
+ MaxLocksExceeded: AugmentedError<ApiType>;
+ TooManyReserves: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
treasury: {
/**
* The spend origin is valid but the amount it is allowed to spend is lower than the
@@ -802,5 +864,90 @@
**/
[key: string]: AugmentedError<ApiType>;
};
+ xTokens: {
+ /**
+ * Asset has no reserve location.
+ **/
+ AssetHasNoReserve: AugmentedError<ApiType>;
+ /**
+ * The specified index does not exist in a MultiAssets struct.
+ **/
+ AssetIndexNonExistent: AugmentedError<ApiType>;
+ /**
+ * The version of the `Versioned` value used is not able to be
+ * interpreted.
+ **/
+ BadVersion: AugmentedError<ApiType>;
+ /**
+ * Could not re-anchor the assets to declare the fees for the
+ * destination chain.
+ **/
+ CannotReanchor: AugmentedError<ApiType>;
+ /**
+ * The destination `MultiLocation` provided cannot be inverted.
+ **/
+ DestinationNotInvertible: AugmentedError<ApiType>;
+ /**
+ * We tried sending distinct asset and fee but they have different
+ * reserve chains.
+ **/
+ DistinctReserveForAssetAndFee: AugmentedError<ApiType>;
+ /**
+ * Fee is not enough.
+ **/
+ FeeNotEnough: AugmentedError<ApiType>;
+ /**
+ * Could not get ancestry of asset reserve location.
+ **/
+ InvalidAncestry: AugmentedError<ApiType>;
+ /**
+ * The MultiAsset is invalid.
+ **/
+ InvalidAsset: AugmentedError<ApiType>;
+ /**
+ * Invalid transfer destination.
+ **/
+ InvalidDest: AugmentedError<ApiType>;
+ /**
+ * MinXcmFee not registered for certain reserve location
+ **/
+ MinXcmFeeNotDefined: AugmentedError<ApiType>;
+ /**
+ * Not cross-chain transfer.
+ **/
+ NotCrossChainTransfer: AugmentedError<ApiType>;
+ /**
+ * Currency is not cross-chain transferable.
+ **/
+ NotCrossChainTransferableCurrency: AugmentedError<ApiType>;
+ /**
+ * Not supported MultiLocation
+ **/
+ NotSupportedMultiLocation: AugmentedError<ApiType>;
+ /**
+ * The number of assets to be sent is over the maximum.
+ **/
+ TooManyAssetsBeingSent: AugmentedError<ApiType>;
+ /**
+ * The message's weight could not be determined.
+ **/
+ UnweighableMessage: AugmentedError<ApiType>;
+ /**
+ * XCM execution failed.
+ **/
+ XcmExecutionFailed: AugmentedError<ApiType>;
+ /**
+ * The transfering asset amount is zero.
+ **/
+ ZeroAmount: AugmentedError<ApiType>;
+ /**
+ * The fee is zero.
+ **/
+ ZeroFee: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
} // AugmentedErrors
} // declare module
tests/src/interfaces/augment-api-events.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-events.ts
+++ b/tests/src/interfaces/augment-api-events.ts
@@ -9,7 +9,7 @@
import type { Bytes, Null, Option, Result, U256, U8aFixed, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
-import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
+import type { EthereumLog, EvmCoreErrorExitReason, FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;
@@ -20,14 +20,14 @@
* The admin was set
*
* # Arguments
- * * AccountId: ID of the admin
+ * * AccountId: account address of the admin
**/
SetAdmin: AugmentedEvent<ApiType, [AccountId32]>;
/**
* Staking was performed
*
* # Arguments
- * * AccountId: ID of the staker
+ * * AccountId: account of the staker
* * Balance : staking amount
**/
Stake: AugmentedEvent<ApiType, [AccountId32, u128]>;
@@ -35,7 +35,7 @@
* Staking recalculation was performed
*
* # Arguments
- * * AccountId: ID of the staker.
+ * * AccountId: account of the staker.
* * Balance : recalculation base
* * Balance : total income
**/
@@ -44,7 +44,7 @@
* Unstaking was performed
*
* # Arguments
- * * AccountId: ID of the staker
+ * * AccountId: account of the staker
* * Balance : unstaking amount
**/
Unstake: AugmentedEvent<ApiType, [AccountId32, u128]>;
@@ -264,6 +264,28 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
+ foreignAssets: {
+ /**
+ * The asset registered.
+ **/
+ AssetRegistered: AugmentedEvent<ApiType, [assetId: PalletForeignAssetsAssetIds, metadata: PalletForeignAssetsModuleAssetMetadata], { assetId: PalletForeignAssetsAssetIds, metadata: PalletForeignAssetsModuleAssetMetadata }>;
+ /**
+ * The asset updated.
+ **/
+ AssetUpdated: AugmentedEvent<ApiType, [assetId: PalletForeignAssetsAssetIds, metadata: PalletForeignAssetsModuleAssetMetadata], { assetId: PalletForeignAssetsAssetIds, metadata: PalletForeignAssetsModuleAssetMetadata }>;
+ /**
+ * The foreign asset registered.
+ **/
+ ForeignAssetRegistered: AugmentedEvent<ApiType, [assetId: u32, assetAddress: XcmV1MultiLocation, metadata: PalletForeignAssetsModuleAssetMetadata], { assetId: u32, assetAddress: XcmV1MultiLocation, metadata: PalletForeignAssetsModuleAssetMetadata }>;
+ /**
+ * The foreign asset updated.
+ **/
+ ForeignAssetUpdated: AugmentedEvent<ApiType, [assetId: u32, assetAddress: XcmV1MultiLocation, metadata: PalletForeignAssetsModuleAssetMetadata], { assetId: u32, assetAddress: XcmV1MultiLocation, metadata: PalletForeignAssetsModuleAssetMetadata }>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
parachainSystem: {
/**
* Downward messages were processed using the given weight.
@@ -525,6 +547,66 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
+ tokens: {
+ /**
+ * A balance was set by root.
+ **/
+ BalanceSet: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, free: u128, reserved: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, free: u128, reserved: u128 }>;
+ /**
+ * Deposited some balance into an account
+ **/
+ Deposited: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * An account was removed whose balance was non-zero but below
+ * ExistentialDeposit, resulting in an outright loss.
+ **/
+ DustLost: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * An account was created with some free balance.
+ **/
+ Endowed: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Some locked funds were unlocked
+ **/
+ LockRemoved: AugmentedEvent<ApiType, [lockId: U8aFixed, currencyId: PalletForeignAssetsAssetIds, who: AccountId32], { lockId: U8aFixed, currencyId: PalletForeignAssetsAssetIds, who: AccountId32 }>;
+ /**
+ * Some funds are locked
+ **/
+ LockSet: AugmentedEvent<ApiType, [lockId: U8aFixed, currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { lockId: U8aFixed, currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Some balance was reserved (moved from free to reserved).
+ **/
+ Reserved: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Some reserved balance was repatriated (moved from reserved to
+ * another account).
+ **/
+ ReserveRepatriated: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, from: AccountId32, to: AccountId32, amount: u128, status: FrameSupportTokensMiscBalanceStatus], { currencyId: PalletForeignAssetsAssetIds, from: AccountId32, to: AccountId32, amount: u128, status: FrameSupportTokensMiscBalanceStatus }>;
+ /**
+ * Some balances were slashed (e.g. due to mis-behavior)
+ **/
+ Slashed: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, freeAmount: u128, reservedAmount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, freeAmount: u128, reservedAmount: u128 }>;
+ /**
+ * The total issuance of an currency has been set
+ **/
+ TotalIssuanceSet: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, amount: u128], { currencyId: PalletForeignAssetsAssetIds, amount: u128 }>;
+ /**
+ * Transfer succeeded.
+ **/
+ Transfer: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, from: AccountId32, to: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, from: AccountId32, to: AccountId32, amount: u128 }>;
+ /**
+ * Some balance was unreserved (moved from reserved to free).
+ **/
+ Unreserved: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Some balances were withdrawn (e.g. pay for transaction fee)
+ **/
+ Withdrawn: AugmentedEvent<ApiType, [currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128], { currencyId: PalletForeignAssetsAssetIds, who: AccountId32, amount: u128 }>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
transactionPayment: {
/**
* A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
@@ -713,5 +795,15 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
+ xTokens: {
+ /**
+ * Transferred `MultiAsset` with fee.
+ **/
+ TransferredMultiAssets: AugmentedEvent<ApiType, [sender: AccountId32, assets: XcmV1MultiassetMultiAssets, fee: XcmV1MultiAsset, dest: XcmV1MultiLocation], { sender: AccountId32, assets: XcmV1MultiassetMultiAssets, fee: XcmV1MultiAsset, dest: XcmV1MultiLocation }>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
} // AugmentedEvents
} // declare module
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -9,7 +9,7 @@
import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
-import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild } from '@polkadot/types/lookup';
+import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueQueueConfigData, EthereumBlock, EthereumLog, EthereumReceiptReceiptV3, EthereumTransactionTransactionV2, FpRpcTransactionStatus, FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlVestingVestingSchedule, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmContractHelpersSponsoringModeT, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletNonfungibleItemData, PalletRefungibleItemData, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletUniqueSchedulerScheduledV3, PhantomTypeUpDataStructs, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, SpRuntimeDigest, SpTrieStorageProof, UpDataStructsCollection, UpDataStructsCollectionStats, UpDataStructsProperties, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, XcmV1MultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -18,21 +18,41 @@
declare module '@polkadot/api-base/types/storage' {
interface AugmentedQueries<ApiType extends ApiTypes> {
appPromotion: {
+ /**
+ * Stores the `admin` account. Some extrinsics can only be executed if they were signed by `admin`.
+ **/
admin: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Stores a key for record for which the next revenue recalculation would be performed.
* If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers.
**/
nextCalculatedRecord: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[AccountId32, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Stores amount of stakes for an `Account`.
+ *
+ * * **Key** - Staker account.
+ * * **Value** - Amount of stakes.
+ **/
pendingUnstake: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[AccountId32, u128]>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
- * Amount of tokens staked by account in the blocknumber.
+ * Stores the amount of tokens staked by account in the blocknumber.
+ *
+ * * **Key1** - Staker account.
+ * * **Key2** - Relay block number when the stake was made.
+ * * **(Balance, BlockNumber)** - Balance of the stake.
+ * The number of the relay block in which we must perform the interest recalculation
**/
staked: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[u128, u32]>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
/**
- * Amount of stakes for an Account
+ * Stores amount of stakes for an `Account`.
+ *
+ * * **Key** - Staker account.
+ * * **Value** - Amount of stakes.
**/
stakesPerAccount: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u8>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
+ /**
+ * Stores the total staked amount.
+ **/
totalStaked: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
@@ -245,13 +265,6 @@
**/
owner: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<H160>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
selfSponsoring: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<bool>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
- /**
- * Storage for last sponsored block.
- *
- * * **Key1** - contract address.
- * * **Key2** - sponsored user address.
- * * **Value** - last sponsored block number.
- **/
sponsorBasket: AugmentedQuery<ApiType, (arg1: H160 | string | Uint8Array, arg2: H160 | string | Uint8Array) => Observable<Option<u32>>, [H160, H160]> & QueryableStorageEntry<ApiType, [H160, H160]>;
/**
* Store for contract sponsorship state.
@@ -261,6 +274,14 @@
**/
sponsoring: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<UpDataStructsSponsorshipStateBasicCrossAccountIdRepr>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
/**
+ * Storage for last sponsored block.
+ *
+ * * **Key1** - contract address.
+ * * **Key2** - sponsored user address.
+ * * **Value** - last sponsored block number.
+ **/
+ sponsoringFeeLimit: AugmentedQuery<ApiType, (arg: H160 | string | Uint8Array) => Observable<BTreeMap<u32, U256>>, [H160]> & QueryableStorageEntry<ApiType, [H160]>;
+ /**
* Store for sponsoring mode.
*
* ### Usage
@@ -289,6 +310,41 @@
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
+ foreignAssets: {
+ /**
+ * The storages for assets to fungible collection binding
+ *
+ **/
+ assetBinding: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+ /**
+ * The storages for AssetMetadatas.
+ *
+ * AssetMetadatas: map AssetIds => Option<AssetMetadata>
+ **/
+ assetMetadatas: AugmentedQuery<ApiType, (arg: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<Option<PalletForeignAssetsModuleAssetMetadata>>, [PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [PalletForeignAssetsAssetIds]>;
+ /**
+ * The storages for MultiLocations.
+ *
+ * ForeignAssetLocations: map ForeignAssetId => Option<MultiLocation>
+ **/
+ foreignAssetLocations: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<XcmV1MultiLocation>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+ /**
+ * The storages for CurrencyIds.
+ *
+ * LocationToCurrencyIds: map MultiLocation => Option<ForeignAssetId>
+ **/
+ locationToCurrencyIds: AugmentedQuery<ApiType, (arg: XcmV1MultiLocation | { parents?: any; interior?: any } | string | Uint8Array) => Observable<Option<u32>>, [XcmV1MultiLocation]> & QueryableStorageEntry<ApiType, [XcmV1MultiLocation]>;
+ /**
+ * Next available Foreign AssetId ID.
+ *
+ * NextForeignAssetId: ForeignAssetId
+ **/
+ nextForeignAssetId: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Generic query
+ **/
+ [key: string]: QueryableStorageEntry<ApiType>;
+ };
fungible: {
/**
* Storage for assets delegated to a limited extent to other users.
@@ -744,6 +800,34 @@
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
+ tokens: {
+ /**
+ * The balance of a token type under an account.
+ *
+ * NOTE: If the total is ever zero, decrease account ref account.
+ *
+ * NOTE: This is only used in the case that this module is used to store
+ * balances.
+ **/
+ accounts: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<OrmlTokensAccountData>, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [AccountId32, PalletForeignAssetsAssetIds]>;
+ /**
+ * Any liquidity locks of a token type under an account.
+ * NOTE: Should only be accessed when setting, changing and freeing a lock.
+ **/
+ locks: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<Vec<OrmlTokensBalanceLock>>, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [AccountId32, PalletForeignAssetsAssetIds]>;
+ /**
+ * Named reserves on some account balances.
+ **/
+ reserves: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<Vec<OrmlTokensReserveData>>, [AccountId32, PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [AccountId32, PalletForeignAssetsAssetIds]>;
+ /**
+ * The total issuance of a token type.
+ **/
+ totalIssuance: AugmentedQuery<ApiType, (arg: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array) => Observable<u128>, [PalletForeignAssetsAssetIds]> & QueryableStorageEntry<ApiType, [PalletForeignAssetsAssetIds]>;
+ /**
+ * Generic query
+ **/
+ [key: string]: QueryableStorageEntry<ApiType>;
+ };
transactionPayment: {
nextFeeMultiplier: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletTransactionPaymentReleases>, []> & QueryableStorageEntry<ApiType, []>;
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -9,7 +9,7 @@
import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';
-import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { CumulusPrimitivesParachainInherentParachainInherentData, EthereumTransactionTransactionV2, FrameSupportScheduleMaybeHashed, OrmlVestingVestingSchedule, PalletEvmAccountBasicCrossAccountIdRepr, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsPartEquippableList, RmrkTraitsPartPartType, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCreateCollectionData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
export type __AugmentedSubmittable = AugmentedSubmittable<() => unknown>;
export type __SubmittableExtrinsic<ApiType extends ApiTypes> = SubmittableExtrinsic<ApiType>;
@@ -18,13 +18,101 @@
declare module '@polkadot/api-base/types/submittable' {
interface AugmentedSubmittables<ApiType extends ApiTypes> {
appPromotion: {
+ /**
+ * Recalculates interest for the specified number of stakers.
+ * If all stakers are not recalculated, the next call of the extrinsic
+ * will continue the recalculation, from those stakers for whom this
+ * was not perform in last call.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `stakers_number`: the number of stakers for which recalculation will be performed
+ **/
payoutStakers: AugmentedSubmittable<(stakersNumber: Option<u8> | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u8>]>;
+ /**
+ * Sets an address as the the admin.
+ *
+ * # Permissions
+ *
+ * * Sudo
+ *
+ * # Arguments
+ *
+ * * `admin`: account of the new admin.
+ **/
setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr]>;
+ /**
+ * Sets the pallet to be the sponsor for the collection.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `collection_id`: ID of the collection that will be sponsored by `pallet_id`
+ **/
sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ /**
+ * Sets the pallet to be the sponsor for the contract.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `contract_id`: the contract address that will be sponsored by `pallet_id`
+ **/
sponsorContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ /**
+ * Stakes the amount of native tokens.
+ * Sets `amount` to the locked state.
+ * The maximum number of stakes for a staker is 10.
+ *
+ * # Arguments
+ *
+ * * `amount`: in native tokens.
+ **/
stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
+ /**
+ * Removes the pallet as the sponsor for the collection.
+ * Returns [`NoPermission`][`Error::NoPermission`]
+ * if the pallet wasn't the sponsor.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `collection_id`: ID of the collection that is sponsored by `pallet_id`
+ **/
stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ /**
+ * Removes the pallet as the sponsor for the contract.
+ * Returns [`NoPermission`][`Error::NoPermission`]
+ * if the pallet wasn't the sponsor.
+ *
+ * # Permissions
+ *
+ * * Pallet admin
+ *
+ * # Arguments
+ *
+ * * `contract_id`: the contract address that is sponsored by `pallet_id`
+ **/
stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ /**
+ * Unstakes all stakes.
+ * Moves the sum of all stakes to the `reserved` state.
+ * After the end of `PendingInterval` this sum becomes completely
+ * free for further use.
+ **/
unstake: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Generic tx
@@ -216,6 +304,14 @@
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
+ foreignAssets: {
+ registerForeignAsset: AugmentedSubmittable<(owner: AccountId32 | string | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeignAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, XcmVersionedMultiLocation, PalletForeignAssetsModuleAssetMetadata]>;
+ updateForeignAsset: AugmentedSubmittable<(foreignAssetId: u32 | AnyNumber | Uint8Array, location: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, metadata: PalletForeignAssetsModuleAssetMetadata | { name?: any; symbol?: any; decimals?: any; minimalBalance?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, XcmVersionedMultiLocation, PalletForeignAssetsModuleAssetMetadata]>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
inflation: {
/**
* This method sets the inflation start date. Can be only called once.
@@ -905,6 +1001,87 @@
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
+ tokens: {
+ /**
+ * Exactly as `transfer`, except the origin must be root and the source
+ * account may be specified.
+ *
+ * The dispatch origin for this call must be _Root_.
+ *
+ * - `source`: The sender of the transfer.
+ * - `dest`: The recipient of the transfer.
+ * - `currency_id`: currency type.
+ * - `amount`: free balance amount to tranfer.
+ **/
+ forceTransfer: AugmentedSubmittable<(source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, MultiAddress, PalletForeignAssetsAssetIds, Compact<u128>]>;
+ /**
+ * Set the balances of a given account.
+ *
+ * This will alter `FreeBalance` and `ReservedBalance` in storage. it
+ * will also decrease the total issuance of the system
+ * (`TotalIssuance`). If the new free or reserved balance is below the
+ * existential deposit, it will reap the `AccountInfo`.
+ *
+ * The dispatch origin for this call is `root`.
+ **/
+ setBalance: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, newFree: Compact<u128> | AnyNumber | Uint8Array, newReserved: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletForeignAssetsAssetIds, Compact<u128>, Compact<u128>]>;
+ /**
+ * Transfer some liquid free balance to another account.
+ *
+ * `transfer` will set the `FreeBalance` of the sender and receiver.
+ * It will decrease the total issuance of the system by the
+ * `TransferFee`. If the sender's account is below the existential
+ * deposit as a result of the transfer, the account will be reaped.
+ *
+ * The dispatch origin for this call must be `Signed` by the
+ * transactor.
+ *
+ * - `dest`: The recipient of the transfer.
+ * - `currency_id`: currency type.
+ * - `amount`: free balance amount to tranfer.
+ **/
+ transfer: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletForeignAssetsAssetIds, Compact<u128>]>;
+ /**
+ * Transfer all remaining balance to the given account.
+ *
+ * NOTE: This function only attempts to transfer _transferable_
+ * balances. This means that any locked, reserved, or existential
+ * deposits (when `keep_alive` is `true`), will not be transferred by
+ * this function. To ensure that this function results in a killed
+ * account, you might need to prepare the account by removing any
+ * reference counters, storage deposits, etc...
+ *
+ * The dispatch origin for this call must be `Signed` by the
+ * transactor.
+ *
+ * - `dest`: The recipient of the transfer.
+ * - `currency_id`: currency type.
+ * - `keep_alive`: A boolean to determine if the `transfer_all`
+ * operation should send all of the funds the account has, causing
+ * the sender account to be killed (false), or transfer everything
+ * except at least the existential deposit, which will guarantee to
+ * keep the sender account alive (true).
+ **/
+ transferAll: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletForeignAssetsAssetIds, bool]>;
+ /**
+ * Same as the [`transfer`] call, but with a check that the transfer
+ * will not kill the origin account.
+ *
+ * 99% of the time you want [`transfer`] instead.
+ *
+ * The dispatch origin for this call must be `Signed` by the
+ * transactor.
+ *
+ * - `dest`: The recipient of the transfer.
+ * - `currency_id`: currency type.
+ * - `amount`: free balance amount to tranfer.
+ **/
+ transferKeepAlive: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, PalletForeignAssetsAssetIds, Compact<u128>]>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
treasury: {
/**
* Approve a proposal. At a later time, the proposal will be allocated to the beneficiary
@@ -1565,5 +1742,125 @@
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
+ xTokens: {
+ /**
+ * Transfer native currencies.
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transfer: AugmentedSubmittable<(currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletForeignAssetsAssetIds, u128, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer `MultiAsset`.
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferMultiasset: AugmentedSubmittable<(asset: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiAsset, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer several `MultiAsset` specifying the item to be used as fee
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * `fee_item` is index of the MultiAssets that we want to use for
+ * payment
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferMultiassets: AugmentedSubmittable<(assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiAssets, u32, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer `MultiAsset` specifying the fee and amount as separate.
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * `fee` is the multiasset to be spent to pay for execution in
+ * destination chain. Both fee and amount will be subtracted form the
+ * callers balance For now we only accept fee and asset having the same
+ * `MultiLocation` id.
+ *
+ * If `fee` is not high enough to cover for the execution costs in the
+ * destination chain, then the assets will be trapped in the
+ * destination chain
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferMultiassetWithFee: AugmentedSubmittable<(asset: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, fee: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiAsset, XcmVersionedMultiAsset, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer several currencies specifying the item to be used as fee
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * `fee_item` is index of the currencies tuple that we want to use for
+ * payment
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferMulticurrencies: AugmentedSubmittable<(currencies: Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>> | ([PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, u128 | AnyNumber | Uint8Array])[], feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>>, u32, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Transfer native currencies specifying the fee and amount as
+ * separate.
+ *
+ * `dest_weight` is the weight for XCM execution on the dest chain, and
+ * it would be charged from the transferred assets. If set below
+ * requirements, the execution may fail and assets wouldn't be
+ * received.
+ *
+ * `fee` is the amount to be spent to pay for execution in destination
+ * chain. Both fee and amount will be subtracted form the callers
+ * balance.
+ *
+ * If `fee` is not high enough to cover for the execution costs in the
+ * destination chain, then the assets will be trapped in the
+ * destination chain
+ *
+ * It's a no-op if any error on local XCM execution or message sending.
+ * Note sending assets out per se doesn't guarantee they would be
+ * received. Receiving depends on if the XCM message could be delivered
+ * by the network, and if the receiving chain would handle
+ * messages correctly.
+ **/
+ transferWithFee: AugmentedSubmittable<(currencyId: PalletForeignAssetsAssetIds | { ForeignAssetId: any } | { NativeAssetId: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, fee: u128 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletForeignAssetsAssetIds, u128, u128, XcmVersionedMultiLocation, u64]>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
} // AugmentedSubmittables
} // declare module
tests/src/interfaces/augment-types.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-types.ts
+++ b/tests/src/interfaces/augment-types.ts
@@ -5,7 +5,7 @@
// this is required to allow for ambient/previous definitions
import '@polkadot/types/types/registry';
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from './default';
import type { Data, StorageKey } from '@polkadot/types';
import type { BitVec, Bool, Bytes, F32, F64, I128, I16, I256, I32, I64, I8, Json, Null, OptionBool, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, f32, f64, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec';
import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets';
@@ -790,10 +790,19 @@
OriginKindV0: OriginKindV0;
OriginKindV1: OriginKindV1;
OriginKindV2: OriginKindV2;
+ OrmlTokensAccountData: OrmlTokensAccountData;
+ OrmlTokensBalanceLock: OrmlTokensBalanceLock;
+ OrmlTokensModuleCall: OrmlTokensModuleCall;
+ OrmlTokensModuleError: OrmlTokensModuleError;
+ OrmlTokensModuleEvent: OrmlTokensModuleEvent;
+ OrmlTokensReserveData: OrmlTokensReserveData;
OrmlVestingModuleCall: OrmlVestingModuleCall;
OrmlVestingModuleError: OrmlVestingModuleError;
OrmlVestingModuleEvent: OrmlVestingModuleEvent;
OrmlVestingVestingSchedule: OrmlVestingVestingSchedule;
+ OrmlXtokensModuleCall: OrmlXtokensModuleCall;
+ OrmlXtokensModuleError: OrmlXtokensModuleError;
+ OrmlXtokensModuleEvent: OrmlXtokensModuleEvent;
OutboundHrmpMessage: OutboundHrmpMessage;
OutboundLaneData: OutboundLaneData;
OutboundMessageFee: OutboundMessageFee;
@@ -841,6 +850,12 @@
PalletEvmEvent: PalletEvmEvent;
PalletEvmMigrationCall: PalletEvmMigrationCall;
PalletEvmMigrationError: PalletEvmMigrationError;
+ PalletForeignAssetsAssetIds: PalletForeignAssetsAssetIds;
+ PalletForeignAssetsModuleAssetMetadata: PalletForeignAssetsModuleAssetMetadata;
+ PalletForeignAssetsModuleCall: PalletForeignAssetsModuleCall;
+ PalletForeignAssetsModuleError: PalletForeignAssetsModuleError;
+ PalletForeignAssetsModuleEvent: PalletForeignAssetsModuleEvent;
+ PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency;
PalletFungibleError: PalletFungibleError;
PalletId: PalletId;
PalletInflationCall: PalletInflationCall;
@@ -1422,6 +1437,7 @@
XcmV2WeightLimit: XcmV2WeightLimit;
XcmV2Xcm: XcmV2Xcm;
XcmVersion: XcmVersion;
+ XcmVersionedMultiAsset: XcmVersionedMultiAsset;
XcmVersionedMultiAssets: XcmVersionedMultiAssets;
XcmVersionedMultiLocation: XcmVersionedMultiLocation;
XcmVersionedXcm: XcmVersionedXcm;
tests/src/interfaces/default/types.tsdiffbeforeafterboth1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit2/* eslint-disable */34import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';5import type { ITuple } from '@polkadot/types-codec/types';6import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';7import type { Event } from '@polkadot/types/interfaces/system';89/** @name CumulusPalletDmpQueueCall */10export interface CumulusPalletDmpQueueCall extends Enum {11 readonly isServiceOverweight: boolean;12 readonly asServiceOverweight: {13 readonly index: u64;14 readonly weightLimit: u64;15 } & Struct;16 readonly type: 'ServiceOverweight';17}1819/** @name CumulusPalletDmpQueueConfigData */20export interface CumulusPalletDmpQueueConfigData extends Struct {21 readonly maxIndividual: u64;22}2324/** @name CumulusPalletDmpQueueError */25export interface CumulusPalletDmpQueueError extends Enum {26 readonly isUnknown: boolean;27 readonly isOverLimit: boolean;28 readonly type: 'Unknown' | 'OverLimit';29}3031/** @name CumulusPalletDmpQueueEvent */32export interface CumulusPalletDmpQueueEvent extends Enum {33 readonly isInvalidFormat: boolean;34 readonly asInvalidFormat: {35 readonly messageId: U8aFixed;36 } & Struct;37 readonly isUnsupportedVersion: boolean;38 readonly asUnsupportedVersion: {39 readonly messageId: U8aFixed;40 } & Struct;41 readonly isExecutedDownward: boolean;42 readonly asExecutedDownward: {43 readonly messageId: U8aFixed;44 readonly outcome: XcmV2TraitsOutcome;45 } & Struct;46 readonly isWeightExhausted: boolean;47 readonly asWeightExhausted: {48 readonly messageId: U8aFixed;49 readonly remainingWeight: u64;50 readonly requiredWeight: u64;51 } & Struct;52 readonly isOverweightEnqueued: boolean;53 readonly asOverweightEnqueued: {54 readonly messageId: U8aFixed;55 readonly overweightIndex: u64;56 readonly requiredWeight: u64;57 } & Struct;58 readonly isOverweightServiced: boolean;59 readonly asOverweightServiced: {60 readonly overweightIndex: u64;61 readonly weightUsed: u64;62 } & Struct;63 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';64}6566/** @name CumulusPalletDmpQueuePageIndexData */67export interface CumulusPalletDmpQueuePageIndexData extends Struct {68 readonly beginUsed: u32;69 readonly endUsed: u32;70 readonly overweightCount: u64;71}7273/** @name CumulusPalletParachainSystemCall */74export interface CumulusPalletParachainSystemCall extends Enum {75 readonly isSetValidationData: boolean;76 readonly asSetValidationData: {77 readonly data: CumulusPrimitivesParachainInherentParachainInherentData;78 } & Struct;79 readonly isSudoSendUpwardMessage: boolean;80 readonly asSudoSendUpwardMessage: {81 readonly message: Bytes;82 } & Struct;83 readonly isAuthorizeUpgrade: boolean;84 readonly asAuthorizeUpgrade: {85 readonly codeHash: H256;86 } & Struct;87 readonly isEnactAuthorizedUpgrade: boolean;88 readonly asEnactAuthorizedUpgrade: {89 readonly code: Bytes;90 } & Struct;91 readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade';92}9394/** @name CumulusPalletParachainSystemError */95export interface CumulusPalletParachainSystemError extends Enum {96 readonly isOverlappingUpgrades: boolean;97 readonly isProhibitedByPolkadot: boolean;98 readonly isTooBig: boolean;99 readonly isValidationDataNotAvailable: boolean;100 readonly isHostConfigurationNotAvailable: boolean;101 readonly isNotScheduled: boolean;102 readonly isNothingAuthorized: boolean;103 readonly isUnauthorized: boolean;104 readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized';105}106107/** @name CumulusPalletParachainSystemEvent */108export interface CumulusPalletParachainSystemEvent extends Enum {109 readonly isValidationFunctionStored: boolean;110 readonly isValidationFunctionApplied: boolean;111 readonly asValidationFunctionApplied: {112 readonly relayChainBlockNum: u32;113 } & Struct;114 readonly isValidationFunctionDiscarded: boolean;115 readonly isUpgradeAuthorized: boolean;116 readonly asUpgradeAuthorized: {117 readonly codeHash: H256;118 } & Struct;119 readonly isDownwardMessagesReceived: boolean;120 readonly asDownwardMessagesReceived: {121 readonly count: u32;122 } & Struct;123 readonly isDownwardMessagesProcessed: boolean;124 readonly asDownwardMessagesProcessed: {125 readonly weightUsed: u64;126 readonly dmqHead: H256;127 } & Struct;128 readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed';129}130131/** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot */132export interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct {133 readonly dmqMqcHead: H256;134 readonly relayDispatchQueueSize: ITuple<[u32, u32]>;135 readonly ingressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;136 readonly egressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;137}138139/** @name CumulusPalletXcmCall */140export interface CumulusPalletXcmCall extends Null {}141142/** @name CumulusPalletXcmError */143export interface CumulusPalletXcmError extends Null {}144145/** @name CumulusPalletXcmEvent */146export interface CumulusPalletXcmEvent extends Enum {147 readonly isInvalidFormat: boolean;148 readonly asInvalidFormat: U8aFixed;149 readonly isUnsupportedVersion: boolean;150 readonly asUnsupportedVersion: U8aFixed;151 readonly isExecutedDownward: boolean;152 readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>;153 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';154}155156/** @name CumulusPalletXcmOrigin */157export interface CumulusPalletXcmOrigin extends Enum {158 readonly isRelay: boolean;159 readonly isSiblingParachain: boolean;160 readonly asSiblingParachain: u32;161 readonly type: 'Relay' | 'SiblingParachain';162}163164/** @name CumulusPalletXcmpQueueCall */165export interface CumulusPalletXcmpQueueCall extends Enum {166 readonly isServiceOverweight: boolean;167 readonly asServiceOverweight: {168 readonly index: u64;169 readonly weightLimit: u64;170 } & Struct;171 readonly isSuspendXcmExecution: boolean;172 readonly isResumeXcmExecution: boolean;173 readonly isUpdateSuspendThreshold: boolean;174 readonly asUpdateSuspendThreshold: {175 readonly new_: u32;176 } & Struct;177 readonly isUpdateDropThreshold: boolean;178 readonly asUpdateDropThreshold: {179 readonly new_: u32;180 } & Struct;181 readonly isUpdateResumeThreshold: boolean;182 readonly asUpdateResumeThreshold: {183 readonly new_: u32;184 } & Struct;185 readonly isUpdateThresholdWeight: boolean;186 readonly asUpdateThresholdWeight: {187 readonly new_: u64;188 } & Struct;189 readonly isUpdateWeightRestrictDecay: boolean;190 readonly asUpdateWeightRestrictDecay: {191 readonly new_: u64;192 } & Struct;193 readonly isUpdateXcmpMaxIndividualWeight: boolean;194 readonly asUpdateXcmpMaxIndividualWeight: {195 readonly new_: u64;196 } & Struct;197 readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight';198}199200/** @name CumulusPalletXcmpQueueError */201export interface CumulusPalletXcmpQueueError extends Enum {202 readonly isFailedToSend: boolean;203 readonly isBadXcmOrigin: boolean;204 readonly isBadXcm: boolean;205 readonly isBadOverweightIndex: boolean;206 readonly isWeightOverLimit: boolean;207 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';208}209210/** @name CumulusPalletXcmpQueueEvent */211export interface CumulusPalletXcmpQueueEvent extends Enum {212 readonly isSuccess: boolean;213 readonly asSuccess: {214 readonly messageHash: Option<H256>;215 readonly weight: u64;216 } & Struct;217 readonly isFail: boolean;218 readonly asFail: {219 readonly messageHash: Option<H256>;220 readonly error: XcmV2TraitsError;221 readonly weight: u64;222 } & Struct;223 readonly isBadVersion: boolean;224 readonly asBadVersion: {225 readonly messageHash: Option<H256>;226 } & Struct;227 readonly isBadFormat: boolean;228 readonly asBadFormat: {229 readonly messageHash: Option<H256>;230 } & Struct;231 readonly isUpwardMessageSent: boolean;232 readonly asUpwardMessageSent: {233 readonly messageHash: Option<H256>;234 } & Struct;235 readonly isXcmpMessageSent: boolean;236 readonly asXcmpMessageSent: {237 readonly messageHash: Option<H256>;238 } & Struct;239 readonly isOverweightEnqueued: boolean;240 readonly asOverweightEnqueued: {241 readonly sender: u32;242 readonly sentAt: u32;243 readonly index: u64;244 readonly required: u64;245 } & Struct;246 readonly isOverweightServiced: boolean;247 readonly asOverweightServiced: {248 readonly index: u64;249 readonly used: u64;250 } & Struct;251 readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';252}253254/** @name CumulusPalletXcmpQueueInboundChannelDetails */255export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {256 readonly sender: u32;257 readonly state: CumulusPalletXcmpQueueInboundState;258 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;259}260261/** @name CumulusPalletXcmpQueueInboundState */262export interface CumulusPalletXcmpQueueInboundState extends Enum {263 readonly isOk: boolean;264 readonly isSuspended: boolean;265 readonly type: 'Ok' | 'Suspended';266}267268/** @name CumulusPalletXcmpQueueOutboundChannelDetails */269export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {270 readonly recipient: u32;271 readonly state: CumulusPalletXcmpQueueOutboundState;272 readonly signalsExist: bool;273 readonly firstIndex: u16;274 readonly lastIndex: u16;275}276277/** @name CumulusPalletXcmpQueueOutboundState */278export interface CumulusPalletXcmpQueueOutboundState extends Enum {279 readonly isOk: boolean;280 readonly isSuspended: boolean;281 readonly type: 'Ok' | 'Suspended';282}283284/** @name CumulusPalletXcmpQueueQueueConfigData */285export interface CumulusPalletXcmpQueueQueueConfigData extends Struct {286 readonly suspendThreshold: u32;287 readonly dropThreshold: u32;288 readonly resumeThreshold: u32;289 readonly thresholdWeight: u64;290 readonly weightRestrictDecay: u64;291 readonly xcmpMaxIndividualWeight: u64;292}293294/** @name CumulusPrimitivesParachainInherentParachainInherentData */295export interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct {296 readonly validationData: PolkadotPrimitivesV2PersistedValidationData;297 readonly relayChainState: SpTrieStorageProof;298 readonly downwardMessages: Vec<PolkadotCorePrimitivesInboundDownwardMessage>;299 readonly horizontalMessages: BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>;300}301302/** @name EthbloomBloom */303export interface EthbloomBloom extends U8aFixed {}304305/** @name EthereumBlock */306export interface EthereumBlock extends Struct {307 readonly header: EthereumHeader;308 readonly transactions: Vec<EthereumTransactionTransactionV2>;309 readonly ommers: Vec<EthereumHeader>;310}311312/** @name EthereumHeader */313export interface EthereumHeader extends Struct {314 readonly parentHash: H256;315 readonly ommersHash: H256;316 readonly beneficiary: H160;317 readonly stateRoot: H256;318 readonly transactionsRoot: H256;319 readonly receiptsRoot: H256;320 readonly logsBloom: EthbloomBloom;321 readonly difficulty: U256;322 readonly number: U256;323 readonly gasLimit: U256;324 readonly gasUsed: U256;325 readonly timestamp: u64;326 readonly extraData: Bytes;327 readonly mixHash: H256;328 readonly nonce: EthereumTypesHashH64;329}330331/** @name EthereumLog */332export interface EthereumLog extends Struct {333 readonly address: H160;334 readonly topics: Vec<H256>;335 readonly data: Bytes;336}337338/** @name EthereumReceiptEip658ReceiptData */339export interface EthereumReceiptEip658ReceiptData extends Struct {340 readonly statusCode: u8;341 readonly usedGas: U256;342 readonly logsBloom: EthbloomBloom;343 readonly logs: Vec<EthereumLog>;344}345346/** @name EthereumReceiptReceiptV3 */347export interface EthereumReceiptReceiptV3 extends Enum {348 readonly isLegacy: boolean;349 readonly asLegacy: EthereumReceiptEip658ReceiptData;350 readonly isEip2930: boolean;351 readonly asEip2930: EthereumReceiptEip658ReceiptData;352 readonly isEip1559: boolean;353 readonly asEip1559: EthereumReceiptEip658ReceiptData;354 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';355}356357/** @name EthereumTransactionAccessListItem */358export interface EthereumTransactionAccessListItem extends Struct {359 readonly address: H160;360 readonly storageKeys: Vec<H256>;361}362363/** @name EthereumTransactionEip1559Transaction */364export interface EthereumTransactionEip1559Transaction extends Struct {365 readonly chainId: u64;366 readonly nonce: U256;367 readonly maxPriorityFeePerGas: U256;368 readonly maxFeePerGas: U256;369 readonly gasLimit: U256;370 readonly action: EthereumTransactionTransactionAction;371 readonly value: U256;372 readonly input: Bytes;373 readonly accessList: Vec<EthereumTransactionAccessListItem>;374 readonly oddYParity: bool;375 readonly r: H256;376 readonly s: H256;377}378379/** @name EthereumTransactionEip2930Transaction */380export interface EthereumTransactionEip2930Transaction extends Struct {381 readonly chainId: u64;382 readonly nonce: U256;383 readonly gasPrice: U256;384 readonly gasLimit: U256;385 readonly action: EthereumTransactionTransactionAction;386 readonly value: U256;387 readonly input: Bytes;388 readonly accessList: Vec<EthereumTransactionAccessListItem>;389 readonly oddYParity: bool;390 readonly r: H256;391 readonly s: H256;392}393394/** @name EthereumTransactionLegacyTransaction */395export interface EthereumTransactionLegacyTransaction extends Struct {396 readonly nonce: U256;397 readonly gasPrice: U256;398 readonly gasLimit: U256;399 readonly action: EthereumTransactionTransactionAction;400 readonly value: U256;401 readonly input: Bytes;402 readonly signature: EthereumTransactionTransactionSignature;403}404405/** @name EthereumTransactionTransactionAction */406export interface EthereumTransactionTransactionAction extends Enum {407 readonly isCall: boolean;408 readonly asCall: H160;409 readonly isCreate: boolean;410 readonly type: 'Call' | 'Create';411}412413/** @name EthereumTransactionTransactionSignature */414export interface EthereumTransactionTransactionSignature extends Struct {415 readonly v: u64;416 readonly r: H256;417 readonly s: H256;418}419420/** @name EthereumTransactionTransactionV2 */421export interface EthereumTransactionTransactionV2 extends Enum {422 readonly isLegacy: boolean;423 readonly asLegacy: EthereumTransactionLegacyTransaction;424 readonly isEip2930: boolean;425 readonly asEip2930: EthereumTransactionEip2930Transaction;426 readonly isEip1559: boolean;427 readonly asEip1559: EthereumTransactionEip1559Transaction;428 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';429}430431/** @name EthereumTypesHashH64 */432export interface EthereumTypesHashH64 extends U8aFixed {}433434/** @name EvmCoreErrorExitError */435export interface EvmCoreErrorExitError extends Enum {436 readonly isStackUnderflow: boolean;437 readonly isStackOverflow: boolean;438 readonly isInvalidJump: boolean;439 readonly isInvalidRange: boolean;440 readonly isDesignatedInvalid: boolean;441 readonly isCallTooDeep: boolean;442 readonly isCreateCollision: boolean;443 readonly isCreateContractLimit: boolean;444 readonly isOutOfOffset: boolean;445 readonly isOutOfGas: boolean;446 readonly isOutOfFund: boolean;447 readonly isPcUnderflow: boolean;448 readonly isCreateEmpty: boolean;449 readonly isOther: boolean;450 readonly asOther: Text;451 readonly isInvalidCode: boolean;452 readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';453}454455/** @name EvmCoreErrorExitFatal */456export interface EvmCoreErrorExitFatal extends Enum {457 readonly isNotSupported: boolean;458 readonly isUnhandledInterrupt: boolean;459 readonly isCallErrorAsFatal: boolean;460 readonly asCallErrorAsFatal: EvmCoreErrorExitError;461 readonly isOther: boolean;462 readonly asOther: Text;463 readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';464}465466/** @name EvmCoreErrorExitReason */467export interface EvmCoreErrorExitReason extends Enum {468 readonly isSucceed: boolean;469 readonly asSucceed: EvmCoreErrorExitSucceed;470 readonly isError: boolean;471 readonly asError: EvmCoreErrorExitError;472 readonly isRevert: boolean;473 readonly asRevert: EvmCoreErrorExitRevert;474 readonly isFatal: boolean;475 readonly asFatal: EvmCoreErrorExitFatal;476 readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';477}478479/** @name EvmCoreErrorExitRevert */480export interface EvmCoreErrorExitRevert extends Enum {481 readonly isReverted: boolean;482 readonly type: 'Reverted';483}484485/** @name EvmCoreErrorExitSucceed */486export interface EvmCoreErrorExitSucceed extends Enum {487 readonly isStopped: boolean;488 readonly isReturned: boolean;489 readonly isSuicided: boolean;490 readonly type: 'Stopped' | 'Returned' | 'Suicided';491}492493/** @name FpRpcTransactionStatus */494export interface FpRpcTransactionStatus extends Struct {495 readonly transactionHash: H256;496 readonly transactionIndex: u32;497 readonly from: H160;498 readonly to: Option<H160>;499 readonly contractAddress: Option<H160>;500 readonly logs: Vec<EthereumLog>;501 readonly logsBloom: EthbloomBloom;502}503504/** @name FrameSupportDispatchRawOrigin */505export interface FrameSupportDispatchRawOrigin extends Enum {506 readonly isRoot: boolean;507 readonly isSigned: boolean;508 readonly asSigned: AccountId32;509 readonly isNone: boolean;510 readonly type: 'Root' | 'Signed' | 'None';511}512513/** @name FrameSupportPalletId */514export interface FrameSupportPalletId extends U8aFixed {}515516/** @name FrameSupportScheduleLookupError */517export interface FrameSupportScheduleLookupError extends Enum {518 readonly isUnknown: boolean;519 readonly isBadFormat: boolean;520 readonly type: 'Unknown' | 'BadFormat';521}522523/** @name FrameSupportScheduleMaybeHashed */524export interface FrameSupportScheduleMaybeHashed extends Enum {525 readonly isValue: boolean;526 readonly asValue: Call;527 readonly isHash: boolean;528 readonly asHash: H256;529 readonly type: 'Value' | 'Hash';530}531532/** @name FrameSupportTokensMiscBalanceStatus */533export interface FrameSupportTokensMiscBalanceStatus extends Enum {534 readonly isFree: boolean;535 readonly isReserved: boolean;536 readonly type: 'Free' | 'Reserved';537}538539/** @name FrameSupportWeightsDispatchClass */540export interface FrameSupportWeightsDispatchClass extends Enum {541 readonly isNormal: boolean;542 readonly isOperational: boolean;543 readonly isMandatory: boolean;544 readonly type: 'Normal' | 'Operational' | 'Mandatory';545}546547/** @name FrameSupportWeightsDispatchInfo */548export interface FrameSupportWeightsDispatchInfo extends Struct {549 readonly weight: u64;550 readonly class: FrameSupportWeightsDispatchClass;551 readonly paysFee: FrameSupportWeightsPays;552}553554/** @name FrameSupportWeightsPays */555export interface FrameSupportWeightsPays extends Enum {556 readonly isYes: boolean;557 readonly isNo: boolean;558 readonly type: 'Yes' | 'No';559}560561/** @name FrameSupportWeightsPerDispatchClassU32 */562export interface FrameSupportWeightsPerDispatchClassU32 extends Struct {563 readonly normal: u32;564 readonly operational: u32;565 readonly mandatory: u32;566}567568/** @name FrameSupportWeightsPerDispatchClassU64 */569export interface FrameSupportWeightsPerDispatchClassU64 extends Struct {570 readonly normal: u64;571 readonly operational: u64;572 readonly mandatory: u64;573}574575/** @name FrameSupportWeightsPerDispatchClassWeightsPerClass */576export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {577 readonly normal: FrameSystemLimitsWeightsPerClass;578 readonly operational: FrameSystemLimitsWeightsPerClass;579 readonly mandatory: FrameSystemLimitsWeightsPerClass;580}581582/** @name FrameSupportWeightsRuntimeDbWeight */583export interface FrameSupportWeightsRuntimeDbWeight extends Struct {584 readonly read: u64;585 readonly write: u64;586}587588/** @name FrameSystemAccountInfo */589export interface FrameSystemAccountInfo extends Struct {590 readonly nonce: u32;591 readonly consumers: u32;592 readonly providers: u32;593 readonly sufficients: u32;594 readonly data: PalletBalancesAccountData;595}596597/** @name FrameSystemCall */598export interface FrameSystemCall extends Enum {599 readonly isFillBlock: boolean;600 readonly asFillBlock: {601 readonly ratio: Perbill;602 } & Struct;603 readonly isRemark: boolean;604 readonly asRemark: {605 readonly remark: Bytes;606 } & Struct;607 readonly isSetHeapPages: boolean;608 readonly asSetHeapPages: {609 readonly pages: u64;610 } & Struct;611 readonly isSetCode: boolean;612 readonly asSetCode: {613 readonly code: Bytes;614 } & Struct;615 readonly isSetCodeWithoutChecks: boolean;616 readonly asSetCodeWithoutChecks: {617 readonly code: Bytes;618 } & Struct;619 readonly isSetStorage: boolean;620 readonly asSetStorage: {621 readonly items: Vec<ITuple<[Bytes, Bytes]>>;622 } & Struct;623 readonly isKillStorage: boolean;624 readonly asKillStorage: {625 readonly keys_: Vec<Bytes>;626 } & Struct;627 readonly isKillPrefix: boolean;628 readonly asKillPrefix: {629 readonly prefix: Bytes;630 readonly subkeys: u32;631 } & Struct;632 readonly isRemarkWithEvent: boolean;633 readonly asRemarkWithEvent: {634 readonly remark: Bytes;635 } & Struct;636 readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';637}638639/** @name FrameSystemError */640export interface FrameSystemError extends Enum {641 readonly isInvalidSpecName: boolean;642 readonly isSpecVersionNeedsToIncrease: boolean;643 readonly isFailedToExtractRuntimeVersion: boolean;644 readonly isNonDefaultComposite: boolean;645 readonly isNonZeroRefCount: boolean;646 readonly isCallFiltered: boolean;647 readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';648}649650/** @name FrameSystemEvent */651export interface FrameSystemEvent extends Enum {652 readonly isExtrinsicSuccess: boolean;653 readonly asExtrinsicSuccess: {654 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;655 } & Struct;656 readonly isExtrinsicFailed: boolean;657 readonly asExtrinsicFailed: {658 readonly dispatchError: SpRuntimeDispatchError;659 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;660 } & Struct;661 readonly isCodeUpdated: boolean;662 readonly isNewAccount: boolean;663 readonly asNewAccount: {664 readonly account: AccountId32;665 } & Struct;666 readonly isKilledAccount: boolean;667 readonly asKilledAccount: {668 readonly account: AccountId32;669 } & Struct;670 readonly isRemarked: boolean;671 readonly asRemarked: {672 readonly sender: AccountId32;673 readonly hash_: H256;674 } & Struct;675 readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';676}677678/** @name FrameSystemEventRecord */679export interface FrameSystemEventRecord extends Struct {680 readonly phase: FrameSystemPhase;681 readonly event: Event;682 readonly topics: Vec<H256>;683}684685/** @name FrameSystemExtensionsCheckGenesis */686export interface FrameSystemExtensionsCheckGenesis extends Null {}687688/** @name FrameSystemExtensionsCheckNonce */689export interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}690691/** @name FrameSystemExtensionsCheckSpecVersion */692export interface FrameSystemExtensionsCheckSpecVersion extends Null {}693694/** @name FrameSystemExtensionsCheckWeight */695export interface FrameSystemExtensionsCheckWeight extends Null {}696697/** @name FrameSystemLastRuntimeUpgradeInfo */698export interface FrameSystemLastRuntimeUpgradeInfo extends Struct {699 readonly specVersion: Compact<u32>;700 readonly specName: Text;701}702703/** @name FrameSystemLimitsBlockLength */704export interface FrameSystemLimitsBlockLength extends Struct {705 readonly max: FrameSupportWeightsPerDispatchClassU32;706}707708/** @name FrameSystemLimitsBlockWeights */709export interface FrameSystemLimitsBlockWeights extends Struct {710 readonly baseBlock: u64;711 readonly maxBlock: u64;712 readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;713}714715/** @name FrameSystemLimitsWeightsPerClass */716export interface FrameSystemLimitsWeightsPerClass extends Struct {717 readonly baseExtrinsic: u64;718 readonly maxExtrinsic: Option<u64>;719 readonly maxTotal: Option<u64>;720 readonly reserved: Option<u64>;721}722723/** @name FrameSystemPhase */724export interface FrameSystemPhase extends Enum {725 readonly isApplyExtrinsic: boolean;726 readonly asApplyExtrinsic: u32;727 readonly isFinalization: boolean;728 readonly isInitialization: boolean;729 readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';730}731732/** @name OpalRuntimeOriginCaller */733export interface OpalRuntimeOriginCaller extends Enum {734 readonly isSystem: boolean;735 readonly asSystem: FrameSupportDispatchRawOrigin;736 readonly isVoid: boolean;737 readonly asVoid: SpCoreVoid;738 readonly isPolkadotXcm: boolean;739 readonly asPolkadotXcm: PalletXcmOrigin;740 readonly isCumulusXcm: boolean;741 readonly asCumulusXcm: CumulusPalletXcmOrigin;742 readonly isEthereum: boolean;743 readonly asEthereum: PalletEthereumRawOrigin;744 readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';745}746747/** @name OpalRuntimeRuntime */748export interface OpalRuntimeRuntime extends Null {}749750/** @name OrmlVestingModuleCall */751export interface OrmlVestingModuleCall extends Enum {752 readonly isClaim: boolean;753 readonly isVestedTransfer: boolean;754 readonly asVestedTransfer: {755 readonly dest: MultiAddress;756 readonly schedule: OrmlVestingVestingSchedule;757 } & Struct;758 readonly isUpdateVestingSchedules: boolean;759 readonly asUpdateVestingSchedules: {760 readonly who: MultiAddress;761 readonly vestingSchedules: Vec<OrmlVestingVestingSchedule>;762 } & Struct;763 readonly isClaimFor: boolean;764 readonly asClaimFor: {765 readonly dest: MultiAddress;766 } & Struct;767 readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor';768}769770/** @name OrmlVestingModuleError */771export interface OrmlVestingModuleError extends Enum {772 readonly isZeroVestingPeriod: boolean;773 readonly isZeroVestingPeriodCount: boolean;774 readonly isInsufficientBalanceToLock: boolean;775 readonly isTooManyVestingSchedules: boolean;776 readonly isAmountLow: boolean;777 readonly isMaxVestingSchedulesExceeded: boolean;778 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';779}780781/** @name OrmlVestingModuleEvent */782export interface OrmlVestingModuleEvent extends Enum {783 readonly isVestingScheduleAdded: boolean;784 readonly asVestingScheduleAdded: {785 readonly from: AccountId32;786 readonly to: AccountId32;787 readonly vestingSchedule: OrmlVestingVestingSchedule;788 } & Struct;789 readonly isClaimed: boolean;790 readonly asClaimed: {791 readonly who: AccountId32;792 readonly amount: u128;793 } & Struct;794 readonly isVestingSchedulesUpdated: boolean;795 readonly asVestingSchedulesUpdated: {796 readonly who: AccountId32;797 } & Struct;798 readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';799}800801/** @name OrmlVestingVestingSchedule */802export interface OrmlVestingVestingSchedule extends Struct {803 readonly start: u32;804 readonly period: u32;805 readonly periodCount: u32;806 readonly perPeriod: Compact<u128>;807}808809/** @name PalletAppPromotionCall */810export interface PalletAppPromotionCall extends Enum {811 readonly isSetAdminAddress: boolean;812 readonly asSetAdminAddress: {813 readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;814 } & Struct;815 readonly isStake: boolean;816 readonly asStake: {817 readonly amount: u128;818 } & Struct;819 readonly isUnstake: boolean;820 readonly isSponsorCollection: boolean;821 readonly asSponsorCollection: {822 readonly collectionId: u32;823 } & Struct;824 readonly isStopSponsoringCollection: boolean;825 readonly asStopSponsoringCollection: {826 readonly collectionId: u32;827 } & Struct;828 readonly isSponsorContract: boolean;829 readonly asSponsorContract: {830 readonly contractId: H160;831 } & Struct;832 readonly isStopSponsoringContract: boolean;833 readonly asStopSponsoringContract: {834 readonly contractId: H160;835 } & Struct;836 readonly isPayoutStakers: boolean;837 readonly asPayoutStakers: {838 readonly stakersNumber: Option<u8>;839 } & Struct;840 readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers';841}842843/** @name PalletAppPromotionError */844export interface PalletAppPromotionError extends Enum {845 readonly isAdminNotSet: boolean;846 readonly isNoPermission: boolean;847 readonly isNotSufficientFunds: boolean;848 readonly isPendingForBlockOverflow: boolean;849 readonly isSponsorNotSet: boolean;850 readonly isIncorrectLockedBalanceOperation: boolean;851 readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation';852}853854/** @name PalletAppPromotionEvent */855export interface PalletAppPromotionEvent extends Enum {856 readonly isStakingRecalculation: boolean;857 readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>;858 readonly isStake: boolean;859 readonly asStake: ITuple<[AccountId32, u128]>;860 readonly isUnstake: boolean;861 readonly asUnstake: ITuple<[AccountId32, u128]>;862 readonly isSetAdmin: boolean;863 readonly asSetAdmin: AccountId32;864 readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin';865}866867/** @name PalletBalancesAccountData */868export interface PalletBalancesAccountData extends Struct {869 readonly free: u128;870 readonly reserved: u128;871 readonly miscFrozen: u128;872 readonly feeFrozen: u128;873}874875/** @name PalletBalancesBalanceLock */876export interface PalletBalancesBalanceLock extends Struct {877 readonly id: U8aFixed;878 readonly amount: u128;879 readonly reasons: PalletBalancesReasons;880}881882/** @name PalletBalancesCall */883export interface PalletBalancesCall extends Enum {884 readonly isTransfer: boolean;885 readonly asTransfer: {886 readonly dest: MultiAddress;887 readonly value: Compact<u128>;888 } & Struct;889 readonly isSetBalance: boolean;890 readonly asSetBalance: {891 readonly who: MultiAddress;892 readonly newFree: Compact<u128>;893 readonly newReserved: Compact<u128>;894 } & Struct;895 readonly isForceTransfer: boolean;896 readonly asForceTransfer: {897 readonly source: MultiAddress;898 readonly dest: MultiAddress;899 readonly value: Compact<u128>;900 } & Struct;901 readonly isTransferKeepAlive: boolean;902 readonly asTransferKeepAlive: {903 readonly dest: MultiAddress;904 readonly value: Compact<u128>;905 } & Struct;906 readonly isTransferAll: boolean;907 readonly asTransferAll: {908 readonly dest: MultiAddress;909 readonly keepAlive: bool;910 } & Struct;911 readonly isForceUnreserve: boolean;912 readonly asForceUnreserve: {913 readonly who: MultiAddress;914 readonly amount: u128;915 } & Struct;916 readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve';917}918919/** @name PalletBalancesError */920export interface PalletBalancesError extends Enum {921 readonly isVestingBalance: boolean;922 readonly isLiquidityRestrictions: boolean;923 readonly isInsufficientBalance: boolean;924 readonly isExistentialDeposit: boolean;925 readonly isKeepAlive: boolean;926 readonly isExistingVestingSchedule: boolean;927 readonly isDeadAccount: boolean;928 readonly isTooManyReserves: boolean;929 readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves';930}931932/** @name PalletBalancesEvent */933export interface PalletBalancesEvent extends Enum {934 readonly isEndowed: boolean;935 readonly asEndowed: {936 readonly account: AccountId32;937 readonly freeBalance: u128;938 } & Struct;939 readonly isDustLost: boolean;940 readonly asDustLost: {941 readonly account: AccountId32;942 readonly amount: u128;943 } & Struct;944 readonly isTransfer: boolean;945 readonly asTransfer: {946 readonly from: AccountId32;947 readonly to: AccountId32;948 readonly amount: u128;949 } & Struct;950 readonly isBalanceSet: boolean;951 readonly asBalanceSet: {952 readonly who: AccountId32;953 readonly free: u128;954 readonly reserved: u128;955 } & Struct;956 readonly isReserved: boolean;957 readonly asReserved: {958 readonly who: AccountId32;959 readonly amount: u128;960 } & Struct;961 readonly isUnreserved: boolean;962 readonly asUnreserved: {963 readonly who: AccountId32;964 readonly amount: u128;965 } & Struct;966 readonly isReserveRepatriated: boolean;967 readonly asReserveRepatriated: {968 readonly from: AccountId32;969 readonly to: AccountId32;970 readonly amount: u128;971 readonly destinationStatus: FrameSupportTokensMiscBalanceStatus;972 } & Struct;973 readonly isDeposit: boolean;974 readonly asDeposit: {975 readonly who: AccountId32;976 readonly amount: u128;977 } & Struct;978 readonly isWithdraw: boolean;979 readonly asWithdraw: {980 readonly who: AccountId32;981 readonly amount: u128;982 } & Struct;983 readonly isSlashed: boolean;984 readonly asSlashed: {985 readonly who: AccountId32;986 readonly amount: u128;987 } & Struct;988 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed';989}990991/** @name PalletBalancesReasons */992export interface PalletBalancesReasons extends Enum {993 readonly isFee: boolean;994 readonly isMisc: boolean;995 readonly isAll: boolean;996 readonly type: 'Fee' | 'Misc' | 'All';997}998999/** @name PalletBalancesReleases */1000export interface PalletBalancesReleases extends Enum {1001 readonly isV100: boolean;1002 readonly isV200: boolean;1003 readonly type: 'V100' | 'V200';1004}10051006/** @name PalletBalancesReserveData */1007export interface PalletBalancesReserveData extends Struct {1008 readonly id: U8aFixed;1009 readonly amount: u128;1010}10111012/** @name PalletCommonError */1013export interface PalletCommonError extends Enum {1014 readonly isCollectionNotFound: boolean;1015 readonly isMustBeTokenOwner: boolean;1016 readonly isNoPermission: boolean;1017 readonly isCantDestroyNotEmptyCollection: boolean;1018 readonly isPublicMintingNotAllowed: boolean;1019 readonly isAddressNotInAllowlist: boolean;1020 readonly isCollectionNameLimitExceeded: boolean;1021 readonly isCollectionDescriptionLimitExceeded: boolean;1022 readonly isCollectionTokenPrefixLimitExceeded: boolean;1023 readonly isTotalCollectionsLimitExceeded: boolean;1024 readonly isCollectionAdminCountExceeded: boolean;1025 readonly isCollectionLimitBoundsExceeded: boolean;1026 readonly isOwnerPermissionsCantBeReverted: boolean;1027 readonly isTransferNotAllowed: boolean;1028 readonly isAccountTokenLimitExceeded: boolean;1029 readonly isCollectionTokenLimitExceeded: boolean;1030 readonly isMetadataFlagFrozen: boolean;1031 readonly isTokenNotFound: boolean;1032 readonly isTokenValueTooLow: boolean;1033 readonly isApprovedValueTooLow: boolean;1034 readonly isCantApproveMoreThanOwned: boolean;1035 readonly isAddressIsZero: boolean;1036 readonly isUnsupportedOperation: boolean;1037 readonly isNotSufficientFounds: boolean;1038 readonly isUserIsNotAllowedToNest: boolean;1039 readonly isSourceCollectionIsNotAllowedToNest: boolean;1040 readonly isCollectionFieldSizeExceeded: boolean;1041 readonly isNoSpaceForProperty: boolean;1042 readonly isPropertyLimitReached: boolean;1043 readonly isPropertyKeyIsTooLong: boolean;1044 readonly isInvalidCharacterInPropertyKey: boolean;1045 readonly isEmptyPropertyKey: boolean;1046 readonly isCollectionIsExternal: boolean;1047 readonly isCollectionIsInternal: boolean;1048 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal';1049}10501051/** @name PalletCommonEvent */1052export interface PalletCommonEvent extends Enum {1053 readonly isCollectionCreated: boolean;1054 readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;1055 readonly isCollectionDestroyed: boolean;1056 readonly asCollectionDestroyed: u32;1057 readonly isItemCreated: boolean;1058 readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1059 readonly isItemDestroyed: boolean;1060 readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1061 readonly isTransfer: boolean;1062 readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1063 readonly isApproved: boolean;1064 readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1065 readonly isCollectionPropertySet: boolean;1066 readonly asCollectionPropertySet: ITuple<[u32, Bytes]>;1067 readonly isCollectionPropertyDeleted: boolean;1068 readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>;1069 readonly isTokenPropertySet: boolean;1070 readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>;1071 readonly isTokenPropertyDeleted: boolean;1072 readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>;1073 readonly isPropertyPermissionSet: boolean;1074 readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>;1075 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';1076}10771078/** @name PalletConfigurationCall */1079export interface PalletConfigurationCall extends Enum {1080 readonly isSetWeightToFeeCoefficientOverride: boolean;1081 readonly asSetWeightToFeeCoefficientOverride: {1082 readonly coeff: Option<u32>;1083 } & Struct;1084 readonly isSetMinGasPriceOverride: boolean;1085 readonly asSetMinGasPriceOverride: {1086 readonly coeff: Option<u64>;1087 } & Struct;1088 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride';1089}10901091/** @name PalletEthereumCall */1092export interface PalletEthereumCall extends Enum {1093 readonly isTransact: boolean;1094 readonly asTransact: {1095 readonly transaction: EthereumTransactionTransactionV2;1096 } & Struct;1097 readonly type: 'Transact';1098}10991100/** @name PalletEthereumError */1101export interface PalletEthereumError extends Enum {1102 readonly isInvalidSignature: boolean;1103 readonly isPreLogExists: boolean;1104 readonly type: 'InvalidSignature' | 'PreLogExists';1105}11061107/** @name PalletEthereumEvent */1108export interface PalletEthereumEvent extends Enum {1109 readonly isExecuted: boolean;1110 readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;1111 readonly type: 'Executed';1112}11131114/** @name PalletEthereumFakeTransactionFinalizer */1115export interface PalletEthereumFakeTransactionFinalizer extends Null {}11161117/** @name PalletEthereumRawOrigin */1118export interface PalletEthereumRawOrigin extends Enum {1119 readonly isEthereumTransaction: boolean;1120 readonly asEthereumTransaction: H160;1121 readonly type: 'EthereumTransaction';1122}11231124/** @name PalletEvmAccountBasicCrossAccountIdRepr */1125export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {1126 readonly isSubstrate: boolean;1127 readonly asSubstrate: AccountId32;1128 readonly isEthereum: boolean;1129 readonly asEthereum: H160;1130 readonly type: 'Substrate' | 'Ethereum';1131}11321133/** @name PalletEvmCall */1134export interface PalletEvmCall extends Enum {1135 readonly isWithdraw: boolean;1136 readonly asWithdraw: {1137 readonly address: H160;1138 readonly value: u128;1139 } & Struct;1140 readonly isCall: boolean;1141 readonly asCall: {1142 readonly source: H160;1143 readonly target: H160;1144 readonly input: Bytes;1145 readonly value: U256;1146 readonly gasLimit: u64;1147 readonly maxFeePerGas: U256;1148 readonly maxPriorityFeePerGas: Option<U256>;1149 readonly nonce: Option<U256>;1150 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1151 } & Struct;1152 readonly isCreate: boolean;1153 readonly asCreate: {1154 readonly source: H160;1155 readonly init: Bytes;1156 readonly value: U256;1157 readonly gasLimit: u64;1158 readonly maxFeePerGas: U256;1159 readonly maxPriorityFeePerGas: Option<U256>;1160 readonly nonce: Option<U256>;1161 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1162 } & Struct;1163 readonly isCreate2: boolean;1164 readonly asCreate2: {1165 readonly source: H160;1166 readonly init: Bytes;1167 readonly salt: H256;1168 readonly value: U256;1169 readonly gasLimit: u64;1170 readonly maxFeePerGas: U256;1171 readonly maxPriorityFeePerGas: Option<U256>;1172 readonly nonce: Option<U256>;1173 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1174 } & Struct;1175 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';1176}11771178/** @name PalletEvmCoderSubstrateError */1179export interface PalletEvmCoderSubstrateError extends Enum {1180 readonly isOutOfGas: boolean;1181 readonly isOutOfFund: boolean;1182 readonly type: 'OutOfGas' | 'OutOfFund';1183}11841185/** @name PalletEvmContractHelpersError */1186export interface PalletEvmContractHelpersError extends Enum {1187 readonly isNoPermission: boolean;1188 readonly isNoPendingSponsor: boolean;1189 readonly type: 'NoPermission' | 'NoPendingSponsor';1190}11911192/** @name PalletEvmContractHelpersEvent */1193export interface PalletEvmContractHelpersEvent extends Enum {1194 readonly isContractSponsorSet: boolean;1195 readonly asContractSponsorSet: ITuple<[H160, AccountId32]>;1196 readonly isContractSponsorshipConfirmed: boolean;1197 readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>;1198 readonly isContractSponsorRemoved: boolean;1199 readonly asContractSponsorRemoved: H160;1200 readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved';1201}12021203/** @name PalletEvmContractHelpersSponsoringModeT */1204export interface PalletEvmContractHelpersSponsoringModeT extends Enum {1205 readonly isDisabled: boolean;1206 readonly isAllowlisted: boolean;1207 readonly isGenerous: boolean;1208 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';1209}12101211/** @name PalletEvmError */1212export interface PalletEvmError extends Enum {1213 readonly isBalanceLow: boolean;1214 readonly isFeeOverflow: boolean;1215 readonly isPaymentOverflow: boolean;1216 readonly isWithdrawFailed: boolean;1217 readonly isGasPriceTooLow: boolean;1218 readonly isInvalidNonce: boolean;1219 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';1220}12211222/** @name PalletEvmEvent */1223export interface PalletEvmEvent extends Enum {1224 readonly isLog: boolean;1225 readonly asLog: EthereumLog;1226 readonly isCreated: boolean;1227 readonly asCreated: H160;1228 readonly isCreatedFailed: boolean;1229 readonly asCreatedFailed: H160;1230 readonly isExecuted: boolean;1231 readonly asExecuted: H160;1232 readonly isExecutedFailed: boolean;1233 readonly asExecutedFailed: H160;1234 readonly isBalanceDeposit: boolean;1235 readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>;1236 readonly isBalanceWithdraw: boolean;1237 readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>;1238 readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';1239}12401241/** @name PalletEvmMigrationCall */1242export interface PalletEvmMigrationCall extends Enum {1243 readonly isBegin: boolean;1244 readonly asBegin: {1245 readonly address: H160;1246 } & Struct;1247 readonly isSetData: boolean;1248 readonly asSetData: {1249 readonly address: H160;1250 readonly data: Vec<ITuple<[H256, H256]>>;1251 } & Struct;1252 readonly isFinish: boolean;1253 readonly asFinish: {1254 readonly address: H160;1255 readonly code: Bytes;1256 } & Struct;1257 readonly type: 'Begin' | 'SetData' | 'Finish';1258}12591260/** @name PalletEvmMigrationError */1261export interface PalletEvmMigrationError extends Enum {1262 readonly isAccountNotEmpty: boolean;1263 readonly isAccountIsNotMigrating: boolean;1264 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';1265}12661267/** @name PalletFungibleError */1268export interface PalletFungibleError extends Enum {1269 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;1270 readonly isFungibleItemsHaveNoId: boolean;1271 readonly isFungibleItemsDontHaveData: boolean;1272 readonly isFungibleDisallowsNesting: boolean;1273 readonly isSettingPropertiesNotAllowed: boolean;1274 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';1275}12761277/** @name PalletInflationCall */1278export interface PalletInflationCall extends Enum {1279 readonly isStartInflation: boolean;1280 readonly asStartInflation: {1281 readonly inflationStartRelayBlock: u32;1282 } & Struct;1283 readonly type: 'StartInflation';1284}12851286/** @name PalletNonfungibleError */1287export interface PalletNonfungibleError extends Enum {1288 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;1289 readonly isNonfungibleItemsHaveNoAmount: boolean;1290 readonly isCantBurnNftWithChildren: boolean;1291 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';1292}12931294/** @name PalletNonfungibleItemData */1295export interface PalletNonfungibleItemData extends Struct {1296 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;1297}12981299/** @name PalletRefungibleError */1300export interface PalletRefungibleError extends Enum {1301 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;1302 readonly isWrongRefungiblePieces: boolean;1303 readonly isRepartitionWhileNotOwningAllPieces: boolean;1304 readonly isRefungibleDisallowsNesting: boolean;1305 readonly isSettingPropertiesNotAllowed: boolean;1306 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';1307}13081309/** @name PalletRefungibleItemData */1310export interface PalletRefungibleItemData extends Struct {1311 readonly constData: Bytes;1312}13131314/** @name PalletRmrkCoreCall */1315export interface PalletRmrkCoreCall extends Enum {1316 readonly isCreateCollection: boolean;1317 readonly asCreateCollection: {1318 readonly metadata: Bytes;1319 readonly max: Option<u32>;1320 readonly symbol: Bytes;1321 } & Struct;1322 readonly isDestroyCollection: boolean;1323 readonly asDestroyCollection: {1324 readonly collectionId: u32;1325 } & Struct;1326 readonly isChangeCollectionIssuer: boolean;1327 readonly asChangeCollectionIssuer: {1328 readonly collectionId: u32;1329 readonly newIssuer: MultiAddress;1330 } & Struct;1331 readonly isLockCollection: boolean;1332 readonly asLockCollection: {1333 readonly collectionId: u32;1334 } & Struct;1335 readonly isMintNft: boolean;1336 readonly asMintNft: {1337 readonly owner: Option<AccountId32>;1338 readonly collectionId: u32;1339 readonly recipient: Option<AccountId32>;1340 readonly royaltyAmount: Option<Permill>;1341 readonly metadata: Bytes;1342 readonly transferable: bool;1343 readonly resources: Option<Vec<RmrkTraitsResourceResourceTypes>>;1344 } & Struct;1345 readonly isBurnNft: boolean;1346 readonly asBurnNft: {1347 readonly collectionId: u32;1348 readonly nftId: u32;1349 readonly maxBurns: u32;1350 } & Struct;1351 readonly isSend: boolean;1352 readonly asSend: {1353 readonly rmrkCollectionId: u32;1354 readonly rmrkNftId: u32;1355 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;1356 } & Struct;1357 readonly isAcceptNft: boolean;1358 readonly asAcceptNft: {1359 readonly rmrkCollectionId: u32;1360 readonly rmrkNftId: u32;1361 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;1362 } & Struct;1363 readonly isRejectNft: boolean;1364 readonly asRejectNft: {1365 readonly rmrkCollectionId: u32;1366 readonly rmrkNftId: u32;1367 } & Struct;1368 readonly isAcceptResource: boolean;1369 readonly asAcceptResource: {1370 readonly rmrkCollectionId: u32;1371 readonly rmrkNftId: u32;1372 readonly resourceId: u32;1373 } & Struct;1374 readonly isAcceptResourceRemoval: boolean;1375 readonly asAcceptResourceRemoval: {1376 readonly rmrkCollectionId: u32;1377 readonly rmrkNftId: u32;1378 readonly resourceId: u32;1379 } & Struct;1380 readonly isSetProperty: boolean;1381 readonly asSetProperty: {1382 readonly rmrkCollectionId: Compact<u32>;1383 readonly maybeNftId: Option<u32>;1384 readonly key: Bytes;1385 readonly value: Bytes;1386 } & Struct;1387 readonly isSetPriority: boolean;1388 readonly asSetPriority: {1389 readonly rmrkCollectionId: u32;1390 readonly rmrkNftId: u32;1391 readonly priorities: Vec<u32>;1392 } & Struct;1393 readonly isAddBasicResource: boolean;1394 readonly asAddBasicResource: {1395 readonly rmrkCollectionId: u32;1396 readonly nftId: u32;1397 readonly resource: RmrkTraitsResourceBasicResource;1398 } & Struct;1399 readonly isAddComposableResource: boolean;1400 readonly asAddComposableResource: {1401 readonly rmrkCollectionId: u32;1402 readonly nftId: u32;1403 readonly resource: RmrkTraitsResourceComposableResource;1404 } & Struct;1405 readonly isAddSlotResource: boolean;1406 readonly asAddSlotResource: {1407 readonly rmrkCollectionId: u32;1408 readonly nftId: u32;1409 readonly resource: RmrkTraitsResourceSlotResource;1410 } & Struct;1411 readonly isRemoveResource: boolean;1412 readonly asRemoveResource: {1413 readonly rmrkCollectionId: u32;1414 readonly nftId: u32;1415 readonly resourceId: u32;1416 } & Struct;1417 readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';1418}14191420/** @name PalletRmrkCoreError */1421export interface PalletRmrkCoreError extends Enum {1422 readonly isCorruptedCollectionType: boolean;1423 readonly isRmrkPropertyKeyIsTooLong: boolean;1424 readonly isRmrkPropertyValueIsTooLong: boolean;1425 readonly isRmrkPropertyIsNotFound: boolean;1426 readonly isUnableToDecodeRmrkData: boolean;1427 readonly isCollectionNotEmpty: boolean;1428 readonly isNoAvailableCollectionId: boolean;1429 readonly isNoAvailableNftId: boolean;1430 readonly isCollectionUnknown: boolean;1431 readonly isNoPermission: boolean;1432 readonly isNonTransferable: boolean;1433 readonly isCollectionFullOrLocked: boolean;1434 readonly isResourceDoesntExist: boolean;1435 readonly isCannotSendToDescendentOrSelf: boolean;1436 readonly isCannotAcceptNonOwnedNft: boolean;1437 readonly isCannotRejectNonOwnedNft: boolean;1438 readonly isCannotRejectNonPendingNft: boolean;1439 readonly isResourceNotPending: boolean;1440 readonly isNoAvailableResourceId: boolean;1441 readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';1442}14431444/** @name PalletRmrkCoreEvent */1445export interface PalletRmrkCoreEvent extends Enum {1446 readonly isCollectionCreated: boolean;1447 readonly asCollectionCreated: {1448 readonly issuer: AccountId32;1449 readonly collectionId: u32;1450 } & Struct;1451 readonly isCollectionDestroyed: boolean;1452 readonly asCollectionDestroyed: {1453 readonly issuer: AccountId32;1454 readonly collectionId: u32;1455 } & Struct;1456 readonly isIssuerChanged: boolean;1457 readonly asIssuerChanged: {1458 readonly oldIssuer: AccountId32;1459 readonly newIssuer: AccountId32;1460 readonly collectionId: u32;1461 } & Struct;1462 readonly isCollectionLocked: boolean;1463 readonly asCollectionLocked: {1464 readonly issuer: AccountId32;1465 readonly collectionId: u32;1466 } & Struct;1467 readonly isNftMinted: boolean;1468 readonly asNftMinted: {1469 readonly owner: AccountId32;1470 readonly collectionId: u32;1471 readonly nftId: u32;1472 } & Struct;1473 readonly isNftBurned: boolean;1474 readonly asNftBurned: {1475 readonly owner: AccountId32;1476 readonly nftId: u32;1477 } & Struct;1478 readonly isNftSent: boolean;1479 readonly asNftSent: {1480 readonly sender: AccountId32;1481 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1482 readonly collectionId: u32;1483 readonly nftId: u32;1484 readonly approvalRequired: bool;1485 } & Struct;1486 readonly isNftAccepted: boolean;1487 readonly asNftAccepted: {1488 readonly sender: AccountId32;1489 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1490 readonly collectionId: u32;1491 readonly nftId: u32;1492 } & Struct;1493 readonly isNftRejected: boolean;1494 readonly asNftRejected: {1495 readonly sender: AccountId32;1496 readonly collectionId: u32;1497 readonly nftId: u32;1498 } & Struct;1499 readonly isPropertySet: boolean;1500 readonly asPropertySet: {1501 readonly collectionId: u32;1502 readonly maybeNftId: Option<u32>;1503 readonly key: Bytes;1504 readonly value: Bytes;1505 } & Struct;1506 readonly isResourceAdded: boolean;1507 readonly asResourceAdded: {1508 readonly nftId: u32;1509 readonly resourceId: u32;1510 } & Struct;1511 readonly isResourceRemoval: boolean;1512 readonly asResourceRemoval: {1513 readonly nftId: u32;1514 readonly resourceId: u32;1515 } & Struct;1516 readonly isResourceAccepted: boolean;1517 readonly asResourceAccepted: {1518 readonly nftId: u32;1519 readonly resourceId: u32;1520 } & Struct;1521 readonly isResourceRemovalAccepted: boolean;1522 readonly asResourceRemovalAccepted: {1523 readonly nftId: u32;1524 readonly resourceId: u32;1525 } & Struct;1526 readonly isPrioritySet: boolean;1527 readonly asPrioritySet: {1528 readonly collectionId: u32;1529 readonly nftId: u32;1530 } & Struct;1531 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';1532}15331534/** @name PalletRmrkEquipCall */1535export interface PalletRmrkEquipCall extends Enum {1536 readonly isCreateBase: boolean;1537 readonly asCreateBase: {1538 readonly baseType: Bytes;1539 readonly symbol: Bytes;1540 readonly parts: Vec<RmrkTraitsPartPartType>;1541 } & Struct;1542 readonly isThemeAdd: boolean;1543 readonly asThemeAdd: {1544 readonly baseId: u32;1545 readonly theme: RmrkTraitsTheme;1546 } & Struct;1547 readonly isEquippable: boolean;1548 readonly asEquippable: {1549 readonly baseId: u32;1550 readonly slotId: u32;1551 readonly equippables: RmrkTraitsPartEquippableList;1552 } & Struct;1553 readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';1554}15551556/** @name PalletRmrkEquipError */1557export interface PalletRmrkEquipError extends Enum {1558 readonly isPermissionError: boolean;1559 readonly isNoAvailableBaseId: boolean;1560 readonly isNoAvailablePartId: boolean;1561 readonly isBaseDoesntExist: boolean;1562 readonly isNeedsDefaultThemeFirst: boolean;1563 readonly isPartDoesntExist: boolean;1564 readonly isNoEquippableOnFixedPart: boolean;1565 readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';1566}15671568/** @name PalletRmrkEquipEvent */1569export interface PalletRmrkEquipEvent extends Enum {1570 readonly isBaseCreated: boolean;1571 readonly asBaseCreated: {1572 readonly issuer: AccountId32;1573 readonly baseId: u32;1574 } & Struct;1575 readonly isEquippablesUpdated: boolean;1576 readonly asEquippablesUpdated: {1577 readonly baseId: u32;1578 readonly slotId: u32;1579 } & Struct;1580 readonly type: 'BaseCreated' | 'EquippablesUpdated';1581}15821583/** @name PalletStructureCall */1584export interface PalletStructureCall extends Null {}15851586/** @name PalletStructureError */1587export interface PalletStructureError extends Enum {1588 readonly isOuroborosDetected: boolean;1589 readonly isDepthLimit: boolean;1590 readonly isBreadthLimit: boolean;1591 readonly isTokenNotFound: boolean;1592 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';1593}15941595/** @name PalletStructureEvent */1596export interface PalletStructureEvent extends Enum {1597 readonly isExecuted: boolean;1598 readonly asExecuted: Result<Null, SpRuntimeDispatchError>;1599 readonly type: 'Executed';1600}16011602/** @name PalletSudoCall */1603export interface PalletSudoCall extends Enum {1604 readonly isSudo: boolean;1605 readonly asSudo: {1606 readonly call: Call;1607 } & Struct;1608 readonly isSudoUncheckedWeight: boolean;1609 readonly asSudoUncheckedWeight: {1610 readonly call: Call;1611 readonly weight: u64;1612 } & Struct;1613 readonly isSetKey: boolean;1614 readonly asSetKey: {1615 readonly new_: MultiAddress;1616 } & Struct;1617 readonly isSudoAs: boolean;1618 readonly asSudoAs: {1619 readonly who: MultiAddress;1620 readonly call: Call;1621 } & Struct;1622 readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs';1623}16241625/** @name PalletSudoError */1626export interface PalletSudoError extends Enum {1627 readonly isRequireSudo: boolean;1628 readonly type: 'RequireSudo';1629}16301631/** @name PalletSudoEvent */1632export interface PalletSudoEvent extends Enum {1633 readonly isSudid: boolean;1634 readonly asSudid: {1635 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;1636 } & Struct;1637 readonly isKeyChanged: boolean;1638 readonly asKeyChanged: {1639 readonly oldSudoer: Option<AccountId32>;1640 } & Struct;1641 readonly isSudoAsDone: boolean;1642 readonly asSudoAsDone: {1643 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;1644 } & Struct;1645 readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';1646}16471648/** @name PalletTemplateTransactionPaymentCall */1649export interface PalletTemplateTransactionPaymentCall extends Null {}16501651/** @name PalletTemplateTransactionPaymentChargeTransactionPayment */1652export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}16531654/** @name PalletTimestampCall */1655export interface PalletTimestampCall extends Enum {1656 readonly isSet: boolean;1657 readonly asSet: {1658 readonly now: Compact<u64>;1659 } & Struct;1660 readonly type: 'Set';1661}16621663/** @name PalletTransactionPaymentEvent */1664export interface PalletTransactionPaymentEvent extends Enum {1665 readonly isTransactionFeePaid: boolean;1666 readonly asTransactionFeePaid: {1667 readonly who: AccountId32;1668 readonly actualFee: u128;1669 readonly tip: u128;1670 } & Struct;1671 readonly type: 'TransactionFeePaid';1672}16731674/** @name PalletTransactionPaymentReleases */1675export interface PalletTransactionPaymentReleases extends Enum {1676 readonly isV1Ancient: boolean;1677 readonly isV2: boolean;1678 readonly type: 'V1Ancient' | 'V2';1679}16801681/** @name PalletTreasuryCall */1682export interface PalletTreasuryCall extends Enum {1683 readonly isProposeSpend: boolean;1684 readonly asProposeSpend: {1685 readonly value: Compact<u128>;1686 readonly beneficiary: MultiAddress;1687 } & Struct;1688 readonly isRejectProposal: boolean;1689 readonly asRejectProposal: {1690 readonly proposalId: Compact<u32>;1691 } & Struct;1692 readonly isApproveProposal: boolean;1693 readonly asApproveProposal: {1694 readonly proposalId: Compact<u32>;1695 } & Struct;1696 readonly isSpend: boolean;1697 readonly asSpend: {1698 readonly amount: Compact<u128>;1699 readonly beneficiary: MultiAddress;1700 } & Struct;1701 readonly isRemoveApproval: boolean;1702 readonly asRemoveApproval: {1703 readonly proposalId: Compact<u32>;1704 } & Struct;1705 readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval';1706}17071708/** @name PalletTreasuryError */1709export interface PalletTreasuryError extends Enum {1710 readonly isInsufficientProposersBalance: boolean;1711 readonly isInvalidIndex: boolean;1712 readonly isTooManyApprovals: boolean;1713 readonly isInsufficientPermission: boolean;1714 readonly isProposalNotApproved: boolean;1715 readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved';1716}17171718/** @name PalletTreasuryEvent */1719export interface PalletTreasuryEvent extends Enum {1720 readonly isProposed: boolean;1721 readonly asProposed: {1722 readonly proposalIndex: u32;1723 } & Struct;1724 readonly isSpending: boolean;1725 readonly asSpending: {1726 readonly budgetRemaining: u128;1727 } & Struct;1728 readonly isAwarded: boolean;1729 readonly asAwarded: {1730 readonly proposalIndex: u32;1731 readonly award: u128;1732 readonly account: AccountId32;1733 } & Struct;1734 readonly isRejected: boolean;1735 readonly asRejected: {1736 readonly proposalIndex: u32;1737 readonly slashed: u128;1738 } & Struct;1739 readonly isBurnt: boolean;1740 readonly asBurnt: {1741 readonly burntFunds: u128;1742 } & Struct;1743 readonly isRollover: boolean;1744 readonly asRollover: {1745 readonly rolloverBalance: u128;1746 } & Struct;1747 readonly isDeposit: boolean;1748 readonly asDeposit: {1749 readonly value: u128;1750 } & Struct;1751 readonly isSpendApproved: boolean;1752 readonly asSpendApproved: {1753 readonly proposalIndex: u32;1754 readonly amount: u128;1755 readonly beneficiary: AccountId32;1756 } & Struct;1757 readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved';1758}17591760/** @name PalletTreasuryProposal */1761export interface PalletTreasuryProposal extends Struct {1762 readonly proposer: AccountId32;1763 readonly value: u128;1764 readonly beneficiary: AccountId32;1765 readonly bond: u128;1766}17671768/** @name PalletUniqueCall */1769export interface PalletUniqueCall extends Enum {1770 readonly isCreateCollection: boolean;1771 readonly asCreateCollection: {1772 readonly collectionName: Vec<u16>;1773 readonly collectionDescription: Vec<u16>;1774 readonly tokenPrefix: Bytes;1775 readonly mode: UpDataStructsCollectionMode;1776 } & Struct;1777 readonly isCreateCollectionEx: boolean;1778 readonly asCreateCollectionEx: {1779 readonly data: UpDataStructsCreateCollectionData;1780 } & Struct;1781 readonly isDestroyCollection: boolean;1782 readonly asDestroyCollection: {1783 readonly collectionId: u32;1784 } & Struct;1785 readonly isAddToAllowList: boolean;1786 readonly asAddToAllowList: {1787 readonly collectionId: u32;1788 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;1789 } & Struct;1790 readonly isRemoveFromAllowList: boolean;1791 readonly asRemoveFromAllowList: {1792 readonly collectionId: u32;1793 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;1794 } & Struct;1795 readonly isChangeCollectionOwner: boolean;1796 readonly asChangeCollectionOwner: {1797 readonly collectionId: u32;1798 readonly newOwner: AccountId32;1799 } & Struct;1800 readonly isAddCollectionAdmin: boolean;1801 readonly asAddCollectionAdmin: {1802 readonly collectionId: u32;1803 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;1804 } & Struct;1805 readonly isRemoveCollectionAdmin: boolean;1806 readonly asRemoveCollectionAdmin: {1807 readonly collectionId: u32;1808 readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr;1809 } & Struct;1810 readonly isSetCollectionSponsor: boolean;1811 readonly asSetCollectionSponsor: {1812 readonly collectionId: u32;1813 readonly newSponsor: AccountId32;1814 } & Struct;1815 readonly isConfirmSponsorship: boolean;1816 readonly asConfirmSponsorship: {1817 readonly collectionId: u32;1818 } & Struct;1819 readonly isRemoveCollectionSponsor: boolean;1820 readonly asRemoveCollectionSponsor: {1821 readonly collectionId: u32;1822 } & Struct;1823 readonly isCreateItem: boolean;1824 readonly asCreateItem: {1825 readonly collectionId: u32;1826 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;1827 readonly data: UpDataStructsCreateItemData;1828 } & Struct;1829 readonly isCreateMultipleItems: boolean;1830 readonly asCreateMultipleItems: {1831 readonly collectionId: u32;1832 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;1833 readonly itemsData: Vec<UpDataStructsCreateItemData>;1834 } & Struct;1835 readonly isSetCollectionProperties: boolean;1836 readonly asSetCollectionProperties: {1837 readonly collectionId: u32;1838 readonly properties: Vec<UpDataStructsProperty>;1839 } & Struct;1840 readonly isDeleteCollectionProperties: boolean;1841 readonly asDeleteCollectionProperties: {1842 readonly collectionId: u32;1843 readonly propertyKeys: Vec<Bytes>;1844 } & Struct;1845 readonly isSetTokenProperties: boolean;1846 readonly asSetTokenProperties: {1847 readonly collectionId: u32;1848 readonly tokenId: u32;1849 readonly properties: Vec<UpDataStructsProperty>;1850 } & Struct;1851 readonly isDeleteTokenProperties: boolean;1852 readonly asDeleteTokenProperties: {1853 readonly collectionId: u32;1854 readonly tokenId: u32;1855 readonly propertyKeys: Vec<Bytes>;1856 } & Struct;1857 readonly isSetTokenPropertyPermissions: boolean;1858 readonly asSetTokenPropertyPermissions: {1859 readonly collectionId: u32;1860 readonly propertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;1861 } & Struct;1862 readonly isCreateMultipleItemsEx: boolean;1863 readonly asCreateMultipleItemsEx: {1864 readonly collectionId: u32;1865 readonly data: UpDataStructsCreateItemExData;1866 } & Struct;1867 readonly isSetTransfersEnabledFlag: boolean;1868 readonly asSetTransfersEnabledFlag: {1869 readonly collectionId: u32;1870 readonly value: bool;1871 } & Struct;1872 readonly isBurnItem: boolean;1873 readonly asBurnItem: {1874 readonly collectionId: u32;1875 readonly itemId: u32;1876 readonly value: u128;1877 } & Struct;1878 readonly isBurnFrom: boolean;1879 readonly asBurnFrom: {1880 readonly collectionId: u32;1881 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;1882 readonly itemId: u32;1883 readonly value: u128;1884 } & Struct;1885 readonly isTransfer: boolean;1886 readonly asTransfer: {1887 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;1888 readonly collectionId: u32;1889 readonly itemId: u32;1890 readonly value: u128;1891 } & Struct;1892 readonly isApprove: boolean;1893 readonly asApprove: {1894 readonly spender: PalletEvmAccountBasicCrossAccountIdRepr;1895 readonly collectionId: u32;1896 readonly itemId: u32;1897 readonly amount: u128;1898 } & Struct;1899 readonly isTransferFrom: boolean;1900 readonly asTransferFrom: {1901 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;1902 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;1903 readonly collectionId: u32;1904 readonly itemId: u32;1905 readonly value: u128;1906 } & Struct;1907 readonly isSetCollectionLimits: boolean;1908 readonly asSetCollectionLimits: {1909 readonly collectionId: u32;1910 readonly newLimit: UpDataStructsCollectionLimits;1911 } & Struct;1912 readonly isSetCollectionPermissions: boolean;1913 readonly asSetCollectionPermissions: {1914 readonly collectionId: u32;1915 readonly newPermission: UpDataStructsCollectionPermissions;1916 } & Struct;1917 readonly isRepartition: boolean;1918 readonly asRepartition: {1919 readonly collectionId: u32;1920 readonly tokenId: u32;1921 readonly amount: u128;1922 } & Struct;1923 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';1924}19251926/** @name PalletUniqueError */1927export interface PalletUniqueError extends Enum {1928 readonly isCollectionDecimalPointLimitExceeded: boolean;1929 readonly isConfirmUnsetSponsorFail: boolean;1930 readonly isEmptyArgument: boolean;1931 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;1932 readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';1933}19341935/** @name PalletUniqueRawEvent */1936export interface PalletUniqueRawEvent extends Enum {1937 readonly isCollectionSponsorRemoved: boolean;1938 readonly asCollectionSponsorRemoved: u32;1939 readonly isCollectionAdminAdded: boolean;1940 readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1941 readonly isCollectionOwnedChanged: boolean;1942 readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>;1943 readonly isCollectionSponsorSet: boolean;1944 readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>;1945 readonly isSponsorshipConfirmed: boolean;1946 readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>;1947 readonly isCollectionAdminRemoved: boolean;1948 readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1949 readonly isAllowListAddressRemoved: boolean;1950 readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1951 readonly isAllowListAddressAdded: boolean;1952 readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;1953 readonly isCollectionLimitSet: boolean;1954 readonly asCollectionLimitSet: u32;1955 readonly isCollectionPermissionSet: boolean;1956 readonly asCollectionPermissionSet: u32;1957 readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';1958}19591960/** @name PalletUniqueSchedulerCall */1961export interface PalletUniqueSchedulerCall extends Enum {1962 readonly isScheduleNamed: boolean;1963 readonly asScheduleNamed: {1964 readonly id: U8aFixed;1965 readonly when: u32;1966 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;1967 readonly priority: u8;1968 readonly call: FrameSupportScheduleMaybeHashed;1969 } & Struct;1970 readonly isCancelNamed: boolean;1971 readonly asCancelNamed: {1972 readonly id: U8aFixed;1973 } & Struct;1974 readonly isScheduleNamedAfter: boolean;1975 readonly asScheduleNamedAfter: {1976 readonly id: U8aFixed;1977 readonly after: u32;1978 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;1979 readonly priority: u8;1980 readonly call: FrameSupportScheduleMaybeHashed;1981 } & Struct;1982 readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';1983}19841985/** @name PalletUniqueSchedulerError */1986export interface PalletUniqueSchedulerError extends Enum {1987 readonly isFailedToSchedule: boolean;1988 readonly isNotFound: boolean;1989 readonly isTargetBlockNumberInPast: boolean;1990 readonly isRescheduleNoChange: boolean;1991 readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';1992}19931994/** @name PalletUniqueSchedulerEvent */1995export interface PalletUniqueSchedulerEvent extends Enum {1996 readonly isScheduled: boolean;1997 readonly asScheduled: {1998 readonly when: u32;1999 readonly index: u32;2000 } & Struct;2001 readonly isCanceled: boolean;2002 readonly asCanceled: {2003 readonly when: u32;2004 readonly index: u32;2005 } & Struct;2006 readonly isDispatched: boolean;2007 readonly asDispatched: {2008 readonly task: ITuple<[u32, u32]>;2009 readonly id: Option<U8aFixed>;2010 readonly result: Result<Null, SpRuntimeDispatchError>;2011 } & Struct;2012 readonly isCallLookupFailed: boolean;2013 readonly asCallLookupFailed: {2014 readonly task: ITuple<[u32, u32]>;2015 readonly id: Option<U8aFixed>;2016 readonly error: FrameSupportScheduleLookupError;2017 } & Struct;2018 readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed';2019}20202021/** @name PalletUniqueSchedulerScheduledV3 */2022export interface PalletUniqueSchedulerScheduledV3 extends Struct {2023 readonly maybeId: Option<U8aFixed>;2024 readonly priority: u8;2025 readonly call: FrameSupportScheduleMaybeHashed;2026 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2027 readonly origin: OpalRuntimeOriginCaller;2028}20292030/** @name PalletXcmCall */2031export interface PalletXcmCall extends Enum {2032 readonly isSend: boolean;2033 readonly asSend: {2034 readonly dest: XcmVersionedMultiLocation;2035 readonly message: XcmVersionedXcm;2036 } & Struct;2037 readonly isTeleportAssets: boolean;2038 readonly asTeleportAssets: {2039 readonly dest: XcmVersionedMultiLocation;2040 readonly beneficiary: XcmVersionedMultiLocation;2041 readonly assets: XcmVersionedMultiAssets;2042 readonly feeAssetItem: u32;2043 } & Struct;2044 readonly isReserveTransferAssets: boolean;2045 readonly asReserveTransferAssets: {2046 readonly dest: XcmVersionedMultiLocation;2047 readonly beneficiary: XcmVersionedMultiLocation;2048 readonly assets: XcmVersionedMultiAssets;2049 readonly feeAssetItem: u32;2050 } & Struct;2051 readonly isExecute: boolean;2052 readonly asExecute: {2053 readonly message: XcmVersionedXcm;2054 readonly maxWeight: u64;2055 } & Struct;2056 readonly isForceXcmVersion: boolean;2057 readonly asForceXcmVersion: {2058 readonly location: XcmV1MultiLocation;2059 readonly xcmVersion: u32;2060 } & Struct;2061 readonly isForceDefaultXcmVersion: boolean;2062 readonly asForceDefaultXcmVersion: {2063 readonly maybeXcmVersion: Option<u32>;2064 } & Struct;2065 readonly isForceSubscribeVersionNotify: boolean;2066 readonly asForceSubscribeVersionNotify: {2067 readonly location: XcmVersionedMultiLocation;2068 } & Struct;2069 readonly isForceUnsubscribeVersionNotify: boolean;2070 readonly asForceUnsubscribeVersionNotify: {2071 readonly location: XcmVersionedMultiLocation;2072 } & Struct;2073 readonly isLimitedReserveTransferAssets: boolean;2074 readonly asLimitedReserveTransferAssets: {2075 readonly dest: XcmVersionedMultiLocation;2076 readonly beneficiary: XcmVersionedMultiLocation;2077 readonly assets: XcmVersionedMultiAssets;2078 readonly feeAssetItem: u32;2079 readonly weightLimit: XcmV2WeightLimit;2080 } & Struct;2081 readonly isLimitedTeleportAssets: boolean;2082 readonly asLimitedTeleportAssets: {2083 readonly dest: XcmVersionedMultiLocation;2084 readonly beneficiary: XcmVersionedMultiLocation;2085 readonly assets: XcmVersionedMultiAssets;2086 readonly feeAssetItem: u32;2087 readonly weightLimit: XcmV2WeightLimit;2088 } & Struct;2089 readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';2090}20912092/** @name PalletXcmError */2093export interface PalletXcmError extends Enum {2094 readonly isUnreachable: boolean;2095 readonly isSendFailure: boolean;2096 readonly isFiltered: boolean;2097 readonly isUnweighableMessage: boolean;2098 readonly isDestinationNotInvertible: boolean;2099 readonly isEmpty: boolean;2100 readonly isCannotReanchor: boolean;2101 readonly isTooManyAssets: boolean;2102 readonly isInvalidOrigin: boolean;2103 readonly isBadVersion: boolean;2104 readonly isBadLocation: boolean;2105 readonly isNoSubscription: boolean;2106 readonly isAlreadySubscribed: boolean;2107 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';2108}21092110/** @name PalletXcmEvent */2111export interface PalletXcmEvent extends Enum {2112 readonly isAttempted: boolean;2113 readonly asAttempted: XcmV2TraitsOutcome;2114 readonly isSent: boolean;2115 readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>;2116 readonly isUnexpectedResponse: boolean;2117 readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>;2118 readonly isResponseReady: boolean;2119 readonly asResponseReady: ITuple<[u64, XcmV2Response]>;2120 readonly isNotified: boolean;2121 readonly asNotified: ITuple<[u64, u8, u8]>;2122 readonly isNotifyOverweight: boolean;2123 readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>;2124 readonly isNotifyDispatchError: boolean;2125 readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>;2126 readonly isNotifyDecodeFailed: boolean;2127 readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>;2128 readonly isInvalidResponder: boolean;2129 readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option<XcmV1MultiLocation>]>;2130 readonly isInvalidResponderVersion: boolean;2131 readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>;2132 readonly isResponseTaken: boolean;2133 readonly asResponseTaken: u64;2134 readonly isAssetsTrapped: boolean;2135 readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>;2136 readonly isVersionChangeNotified: boolean;2137 readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>;2138 readonly isSupportedVersionChanged: boolean;2139 readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>;2140 readonly isNotifyTargetSendFail: boolean;2141 readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>;2142 readonly isNotifyTargetMigrationFail: boolean;2143 readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>;2144 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';2145}21462147/** @name PalletXcmOrigin */2148export interface PalletXcmOrigin extends Enum {2149 readonly isXcm: boolean;2150 readonly asXcm: XcmV1MultiLocation;2151 readonly isResponse: boolean;2152 readonly asResponse: XcmV1MultiLocation;2153 readonly type: 'Xcm' | 'Response';2154}21552156/** @name PhantomTypeUpDataStructs */2157export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}21582159/** @name PolkadotCorePrimitivesInboundDownwardMessage */2160export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {2161 readonly sentAt: u32;2162 readonly msg: Bytes;2163}21642165/** @name PolkadotCorePrimitivesInboundHrmpMessage */2166export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {2167 readonly sentAt: u32;2168 readonly data: Bytes;2169}21702171/** @name PolkadotCorePrimitivesOutboundHrmpMessage */2172export interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {2173 readonly recipient: u32;2174 readonly data: Bytes;2175}21762177/** @name PolkadotParachainPrimitivesXcmpMessageFormat */2178export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {2179 readonly isConcatenatedVersionedXcm: boolean;2180 readonly isConcatenatedEncodedBlob: boolean;2181 readonly isSignals: boolean;2182 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';2183}21842185/** @name PolkadotPrimitivesV2AbridgedHostConfiguration */2186export interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct {2187 readonly maxCodeSize: u32;2188 readonly maxHeadDataSize: u32;2189 readonly maxUpwardQueueCount: u32;2190 readonly maxUpwardQueueSize: u32;2191 readonly maxUpwardMessageSize: u32;2192 readonly maxUpwardMessageNumPerCandidate: u32;2193 readonly hrmpMaxMessageNumPerCandidate: u32;2194 readonly validationUpgradeCooldown: u32;2195 readonly validationUpgradeDelay: u32;2196}21972198/** @name PolkadotPrimitivesV2AbridgedHrmpChannel */2199export interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct {2200 readonly maxCapacity: u32;2201 readonly maxTotalSize: u32;2202 readonly maxMessageSize: u32;2203 readonly msgCount: u32;2204 readonly totalSize: u32;2205 readonly mqcHead: Option<H256>;2206}22072208/** @name PolkadotPrimitivesV2PersistedValidationData */2209export interface PolkadotPrimitivesV2PersistedValidationData extends Struct {2210 readonly parentHead: Bytes;2211 readonly relayParentNumber: u32;2212 readonly relayParentStorageRoot: H256;2213 readonly maxPovSize: u32;2214}22152216/** @name PolkadotPrimitivesV2UpgradeRestriction */2217export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {2218 readonly isPresent: boolean;2219 readonly type: 'Present';2220}22212222/** @name RmrkTraitsBaseBaseInfo */2223export interface RmrkTraitsBaseBaseInfo extends Struct {2224 readonly issuer: AccountId32;2225 readonly baseType: Bytes;2226 readonly symbol: Bytes;2227}22282229/** @name RmrkTraitsCollectionCollectionInfo */2230export interface RmrkTraitsCollectionCollectionInfo extends Struct {2231 readonly issuer: AccountId32;2232 readonly metadata: Bytes;2233 readonly max: Option<u32>;2234 readonly symbol: Bytes;2235 readonly nftsCount: u32;2236}22372238/** @name RmrkTraitsNftAccountIdOrCollectionNftTuple */2239export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {2240 readonly isAccountId: boolean;2241 readonly asAccountId: AccountId32;2242 readonly isCollectionAndNftTuple: boolean;2243 readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;2244 readonly type: 'AccountId' | 'CollectionAndNftTuple';2245}22462247/** @name RmrkTraitsNftNftChild */2248export interface RmrkTraitsNftNftChild extends Struct {2249 readonly collectionId: u32;2250 readonly nftId: u32;2251}22522253/** @name RmrkTraitsNftNftInfo */2254export interface RmrkTraitsNftNftInfo extends Struct {2255 readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2256 readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;2257 readonly metadata: Bytes;2258 readonly equipped: bool;2259 readonly pending: bool;2260}22612262/** @name RmrkTraitsNftRoyaltyInfo */2263export interface RmrkTraitsNftRoyaltyInfo extends Struct {2264 readonly recipient: AccountId32;2265 readonly amount: Permill;2266}22672268/** @name RmrkTraitsPartEquippableList */2269export interface RmrkTraitsPartEquippableList extends Enum {2270 readonly isAll: boolean;2271 readonly isEmpty: boolean;2272 readonly isCustom: boolean;2273 readonly asCustom: Vec<u32>;2274 readonly type: 'All' | 'Empty' | 'Custom';2275}22762277/** @name RmrkTraitsPartFixedPart */2278export interface RmrkTraitsPartFixedPart extends Struct {2279 readonly id: u32;2280 readonly z: u32;2281 readonly src: Bytes;2282}22832284/** @name RmrkTraitsPartPartType */2285export interface RmrkTraitsPartPartType extends Enum {2286 readonly isFixedPart: boolean;2287 readonly asFixedPart: RmrkTraitsPartFixedPart;2288 readonly isSlotPart: boolean;2289 readonly asSlotPart: RmrkTraitsPartSlotPart;2290 readonly type: 'FixedPart' | 'SlotPart';2291}22922293/** @name RmrkTraitsPartSlotPart */2294export interface RmrkTraitsPartSlotPart extends Struct {2295 readonly id: u32;2296 readonly equippable: RmrkTraitsPartEquippableList;2297 readonly src: Bytes;2298 readonly z: u32;2299}23002301/** @name RmrkTraitsPropertyPropertyInfo */2302export interface RmrkTraitsPropertyPropertyInfo extends Struct {2303 readonly key: Bytes;2304 readonly value: Bytes;2305}23062307/** @name RmrkTraitsResourceBasicResource */2308export interface RmrkTraitsResourceBasicResource extends Struct {2309 readonly src: Option<Bytes>;2310 readonly metadata: Option<Bytes>;2311 readonly license: Option<Bytes>;2312 readonly thumb: Option<Bytes>;2313}23142315/** @name RmrkTraitsResourceComposableResource */2316export interface RmrkTraitsResourceComposableResource extends Struct {2317 readonly parts: Vec<u32>;2318 readonly base: u32;2319 readonly src: Option<Bytes>;2320 readonly metadata: Option<Bytes>;2321 readonly license: Option<Bytes>;2322 readonly thumb: Option<Bytes>;2323}23242325/** @name RmrkTraitsResourceResourceInfo */2326export interface RmrkTraitsResourceResourceInfo extends Struct {2327 readonly id: u32;2328 readonly resource: RmrkTraitsResourceResourceTypes;2329 readonly pending: bool;2330 readonly pendingRemoval: bool;2331}23322333/** @name RmrkTraitsResourceResourceTypes */2334export interface RmrkTraitsResourceResourceTypes extends Enum {2335 readonly isBasic: boolean;2336 readonly asBasic: RmrkTraitsResourceBasicResource;2337 readonly isComposable: boolean;2338 readonly asComposable: RmrkTraitsResourceComposableResource;2339 readonly isSlot: boolean;2340 readonly asSlot: RmrkTraitsResourceSlotResource;2341 readonly type: 'Basic' | 'Composable' | 'Slot';2342}23432344/** @name RmrkTraitsResourceSlotResource */2345export interface RmrkTraitsResourceSlotResource extends Struct {2346 readonly base: u32;2347 readonly src: Option<Bytes>;2348 readonly metadata: Option<Bytes>;2349 readonly slot: u32;2350 readonly license: Option<Bytes>;2351 readonly thumb: Option<Bytes>;2352}23532354/** @name RmrkTraitsTheme */2355export interface RmrkTraitsTheme extends Struct {2356 readonly name: Bytes;2357 readonly properties: Vec<RmrkTraitsThemeThemeProperty>;2358 readonly inherit: bool;2359}23602361/** @name RmrkTraitsThemeThemeProperty */2362export interface RmrkTraitsThemeThemeProperty extends Struct {2363 readonly key: Bytes;2364 readonly value: Bytes;2365}23662367/** @name SpCoreEcdsaSignature */2368export interface SpCoreEcdsaSignature extends U8aFixed {}23692370/** @name SpCoreEd25519Signature */2371export interface SpCoreEd25519Signature extends U8aFixed {}23722373/** @name SpCoreSr25519Signature */2374export interface SpCoreSr25519Signature extends U8aFixed {}23752376/** @name SpCoreVoid */2377export interface SpCoreVoid extends Null {}23782379/** @name SpRuntimeArithmeticError */2380export interface SpRuntimeArithmeticError extends Enum {2381 readonly isUnderflow: boolean;2382 readonly isOverflow: boolean;2383 readonly isDivisionByZero: boolean;2384 readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';2385}23862387/** @name SpRuntimeDigest */2388export interface SpRuntimeDigest extends Struct {2389 readonly logs: Vec<SpRuntimeDigestDigestItem>;2390}23912392/** @name SpRuntimeDigestDigestItem */2393export interface SpRuntimeDigestDigestItem extends Enum {2394 readonly isOther: boolean;2395 readonly asOther: Bytes;2396 readonly isConsensus: boolean;2397 readonly asConsensus: ITuple<[U8aFixed, Bytes]>;2398 readonly isSeal: boolean;2399 readonly asSeal: ITuple<[U8aFixed, Bytes]>;2400 readonly isPreRuntime: boolean;2401 readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>;2402 readonly isRuntimeEnvironmentUpdated: boolean;2403 readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';2404}24052406/** @name SpRuntimeDispatchError */2407export interface SpRuntimeDispatchError extends Enum {2408 readonly isOther: boolean;2409 readonly isCannotLookup: boolean;2410 readonly isBadOrigin: boolean;2411 readonly isModule: boolean;2412 readonly asModule: SpRuntimeModuleError;2413 readonly isConsumerRemaining: boolean;2414 readonly isNoProviders: boolean;2415 readonly isTooManyConsumers: boolean;2416 readonly isToken: boolean;2417 readonly asToken: SpRuntimeTokenError;2418 readonly isArithmetic: boolean;2419 readonly asArithmetic: SpRuntimeArithmeticError;2420 readonly isTransactional: boolean;2421 readonly asTransactional: SpRuntimeTransactionalError;2422 readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';2423}24242425/** @name SpRuntimeModuleError */2426export interface SpRuntimeModuleError extends Struct {2427 readonly index: u8;2428 readonly error: U8aFixed;2429}24302431/** @name SpRuntimeMultiSignature */2432export interface SpRuntimeMultiSignature extends Enum {2433 readonly isEd25519: boolean;2434 readonly asEd25519: SpCoreEd25519Signature;2435 readonly isSr25519: boolean;2436 readonly asSr25519: SpCoreSr25519Signature;2437 readonly isEcdsa: boolean;2438 readonly asEcdsa: SpCoreEcdsaSignature;2439 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';2440}24412442/** @name SpRuntimeTokenError */2443export interface SpRuntimeTokenError extends Enum {2444 readonly isNoFunds: boolean;2445 readonly isWouldDie: boolean;2446 readonly isBelowMinimum: boolean;2447 readonly isCannotCreate: boolean;2448 readonly isUnknownAsset: boolean;2449 readonly isFrozen: boolean;2450 readonly isUnsupported: boolean;2451 readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported';2452}24532454/** @name SpRuntimeTransactionalError */2455export interface SpRuntimeTransactionalError extends Enum {2456 readonly isLimitReached: boolean;2457 readonly isNoLayer: boolean;2458 readonly type: 'LimitReached' | 'NoLayer';2459}24602461/** @name SpTrieStorageProof */2462export interface SpTrieStorageProof extends Struct {2463 readonly trieNodes: BTreeSet<Bytes>;2464}24652466/** @name SpVersionRuntimeVersion */2467export interface SpVersionRuntimeVersion extends Struct {2468 readonly specName: Text;2469 readonly implName: Text;2470 readonly authoringVersion: u32;2471 readonly specVersion: u32;2472 readonly implVersion: u32;2473 readonly apis: Vec<ITuple<[U8aFixed, u32]>>;2474 readonly transactionVersion: u32;2475 readonly stateVersion: u8;2476}24772478/** @name UpDataStructsAccessMode */2479export interface UpDataStructsAccessMode extends Enum {2480 readonly isNormal: boolean;2481 readonly isAllowList: boolean;2482 readonly type: 'Normal' | 'AllowList';2483}24842485/** @name UpDataStructsCollection */2486export interface UpDataStructsCollection extends Struct {2487 readonly owner: AccountId32;2488 readonly mode: UpDataStructsCollectionMode;2489 readonly name: Vec<u16>;2490 readonly description: Vec<u16>;2491 readonly tokenPrefix: Bytes;2492 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;2493 readonly limits: UpDataStructsCollectionLimits;2494 readonly permissions: UpDataStructsCollectionPermissions;2495 readonly externalCollection: bool;2496}24972498/** @name UpDataStructsCollectionLimits */2499export interface UpDataStructsCollectionLimits extends Struct {2500 readonly accountTokenOwnershipLimit: Option<u32>;2501 readonly sponsoredDataSize: Option<u32>;2502 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;2503 readonly tokenLimit: Option<u32>;2504 readonly sponsorTransferTimeout: Option<u32>;2505 readonly sponsorApproveTimeout: Option<u32>;2506 readonly ownerCanTransfer: Option<bool>;2507 readonly ownerCanDestroy: Option<bool>;2508 readonly transfersEnabled: Option<bool>;2509}25102511/** @name UpDataStructsCollectionMode */2512export interface UpDataStructsCollectionMode extends Enum {2513 readonly isNft: boolean;2514 readonly isFungible: boolean;2515 readonly asFungible: u8;2516 readonly isReFungible: boolean;2517 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2518}25192520/** @name UpDataStructsCollectionPermissions */2521export interface UpDataStructsCollectionPermissions extends Struct {2522 readonly access: Option<UpDataStructsAccessMode>;2523 readonly mintMode: Option<bool>;2524 readonly nesting: Option<UpDataStructsNestingPermissions>;2525}25262527/** @name UpDataStructsCollectionStats */2528export interface UpDataStructsCollectionStats extends Struct {2529 readonly created: u32;2530 readonly destroyed: u32;2531 readonly alive: u32;2532}25332534/** @name UpDataStructsCreateCollectionData */2535export interface UpDataStructsCreateCollectionData extends Struct {2536 readonly mode: UpDataStructsCollectionMode;2537 readonly access: Option<UpDataStructsAccessMode>;2538 readonly name: Vec<u16>;2539 readonly description: Vec<u16>;2540 readonly tokenPrefix: Bytes;2541 readonly pendingSponsor: Option<AccountId32>;2542 readonly limits: Option<UpDataStructsCollectionLimits>;2543 readonly permissions: Option<UpDataStructsCollectionPermissions>;2544 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2545 readonly properties: Vec<UpDataStructsProperty>;2546}25472548/** @name UpDataStructsCreateFungibleData */2549export interface UpDataStructsCreateFungibleData extends Struct {2550 readonly value: u128;2551}25522553/** @name UpDataStructsCreateItemData */2554export interface UpDataStructsCreateItemData extends Enum {2555 readonly isNft: boolean;2556 readonly asNft: UpDataStructsCreateNftData;2557 readonly isFungible: boolean;2558 readonly asFungible: UpDataStructsCreateFungibleData;2559 readonly isReFungible: boolean;2560 readonly asReFungible: UpDataStructsCreateReFungibleData;2561 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2562}25632564/** @name UpDataStructsCreateItemExData */2565export interface UpDataStructsCreateItemExData extends Enum {2566 readonly isNft: boolean;2567 readonly asNft: Vec<UpDataStructsCreateNftExData>;2568 readonly isFungible: boolean;2569 readonly asFungible: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr,u128>;2570 readonly isRefungibleMultipleItems: boolean;2571 readonly asRefungibleMultipleItems: Vec<UpDataStructsCreateRefungibleExSingleOwner>;2572 readonly isRefungibleMultipleOwners: boolean;2573 readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners;2574 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';2575}25762577/** @name UpDataStructsCreateNftData */2578export interface UpDataStructsCreateNftData extends Struct {2579 readonly properties: Vec<UpDataStructsProperty>;2580}25812582/** @name UpDataStructsCreateNftExData */2583export interface UpDataStructsCreateNftExData extends Struct {2584 readonly properties: Vec<UpDataStructsProperty>;2585 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2586}25872588/** @name UpDataStructsCreateReFungibleData */2589export interface UpDataStructsCreateReFungibleData extends Struct {2590 readonly pieces: u128;2591 readonly properties: Vec<UpDataStructsProperty>;2592}25932594/** @name UpDataStructsCreateRefungibleExMultipleOwners */2595export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {2596 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2597 readonly properties: Vec<UpDataStructsProperty>;2598}25992600/** @name UpDataStructsCreateRefungibleExSingleOwner */2601export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {2602 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;2603 readonly pieces: u128;2604 readonly properties: Vec<UpDataStructsProperty>;2605}26062607/** @name UpDataStructsNestingPermissions */2608export interface UpDataStructsNestingPermissions extends Struct {2609 readonly tokenOwner: bool;2610 readonly collectionAdmin: bool;2611 readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;2612}26132614/** @name UpDataStructsOwnerRestrictedSet */2615export interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}26162617/** @name UpDataStructsProperties */2618export interface UpDataStructsProperties extends Struct {2619 readonly map: UpDataStructsPropertiesMapBoundedVec;2620 readonly consumedSpace: u32;2621 readonly spaceLimit: u32;2622}26232624/** @name UpDataStructsPropertiesMapBoundedVec */2625export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}26262627/** @name UpDataStructsPropertiesMapPropertyPermission */2628export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}26292630/** @name UpDataStructsProperty */2631export interface UpDataStructsProperty extends Struct {2632 readonly key: Bytes;2633 readonly value: Bytes;2634}26352636/** @name UpDataStructsPropertyKeyPermission */2637export interface UpDataStructsPropertyKeyPermission extends Struct {2638 readonly key: Bytes;2639 readonly permission: UpDataStructsPropertyPermission;2640}26412642/** @name UpDataStructsPropertyPermission */2643export interface UpDataStructsPropertyPermission extends Struct {2644 readonly mutable: bool;2645 readonly collectionAdmin: bool;2646 readonly tokenOwner: bool;2647}26482649/** @name UpDataStructsPropertyScope */2650export interface UpDataStructsPropertyScope extends Enum {2651 readonly isNone: boolean;2652 readonly isRmrk: boolean;2653 readonly type: 'None' | 'Rmrk';2654}26552656/** @name UpDataStructsRpcCollection */2657export interface UpDataStructsRpcCollection extends Struct {2658 readonly owner: AccountId32;2659 readonly mode: UpDataStructsCollectionMode;2660 readonly name: Vec<u16>;2661 readonly description: Vec<u16>;2662 readonly tokenPrefix: Bytes;2663 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;2664 readonly limits: UpDataStructsCollectionLimits;2665 readonly permissions: UpDataStructsCollectionPermissions;2666 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2667 readonly properties: Vec<UpDataStructsProperty>;2668 readonly readOnly: bool;2669}26702671/** @name UpDataStructsSponsoringRateLimit */2672export interface UpDataStructsSponsoringRateLimit extends Enum {2673 readonly isSponsoringDisabled: boolean;2674 readonly isBlocks: boolean;2675 readonly asBlocks: u32;2676 readonly type: 'SponsoringDisabled' | 'Blocks';2677}26782679/** @name UpDataStructsSponsorshipStateAccountId32 */2680export interface UpDataStructsSponsorshipStateAccountId32 extends Enum {2681 readonly isDisabled: boolean;2682 readonly isUnconfirmed: boolean;2683 readonly asUnconfirmed: AccountId32;2684 readonly isConfirmed: boolean;2685 readonly asConfirmed: AccountId32;2686 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';2687}26882689/** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr */2690export interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {2691 readonly isDisabled: boolean;2692 readonly isUnconfirmed: boolean;2693 readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr;2694 readonly isConfirmed: boolean;2695 readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr;2696 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';2697}26982699/** @name UpDataStructsTokenChild */2700export interface UpDataStructsTokenChild extends Struct {2701 readonly token: u32;2702 readonly collection: u32;2703}27042705/** @name UpDataStructsTokenData */2706export interface UpDataStructsTokenData extends Struct {2707 readonly properties: Vec<UpDataStructsProperty>;2708 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;2709 readonly pieces: u128;2710}27112712/** @name XcmDoubleEncoded */2713export interface XcmDoubleEncoded extends Struct {2714 readonly encoded: Bytes;2715}27162717/** @name XcmV0Junction */2718export interface XcmV0Junction extends Enum {2719 readonly isParent: boolean;2720 readonly isParachain: boolean;2721 readonly asParachain: Compact<u32>;2722 readonly isAccountId32: boolean;2723 readonly asAccountId32: {2724 readonly network: XcmV0JunctionNetworkId;2725 readonly id: U8aFixed;2726 } & Struct;2727 readonly isAccountIndex64: boolean;2728 readonly asAccountIndex64: {2729 readonly network: XcmV0JunctionNetworkId;2730 readonly index: Compact<u64>;2731 } & Struct;2732 readonly isAccountKey20: boolean;2733 readonly asAccountKey20: {2734 readonly network: XcmV0JunctionNetworkId;2735 readonly key: U8aFixed;2736 } & Struct;2737 readonly isPalletInstance: boolean;2738 readonly asPalletInstance: u8;2739 readonly isGeneralIndex: boolean;2740 readonly asGeneralIndex: Compact<u128>;2741 readonly isGeneralKey: boolean;2742 readonly asGeneralKey: Bytes;2743 readonly isOnlyChild: boolean;2744 readonly isPlurality: boolean;2745 readonly asPlurality: {2746 readonly id: XcmV0JunctionBodyId;2747 readonly part: XcmV0JunctionBodyPart;2748 } & Struct;2749 readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';2750}27512752/** @name XcmV0JunctionBodyId */2753export interface XcmV0JunctionBodyId extends Enum {2754 readonly isUnit: boolean;2755 readonly isNamed: boolean;2756 readonly asNamed: Bytes;2757 readonly isIndex: boolean;2758 readonly asIndex: Compact<u32>;2759 readonly isExecutive: boolean;2760 readonly isTechnical: boolean;2761 readonly isLegislative: boolean;2762 readonly isJudicial: boolean;2763 readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial';2764}27652766/** @name XcmV0JunctionBodyPart */2767export interface XcmV0JunctionBodyPart extends Enum {2768 readonly isVoice: boolean;2769 readonly isMembers: boolean;2770 readonly asMembers: {2771 readonly count: Compact<u32>;2772 } & Struct;2773 readonly isFraction: boolean;2774 readonly asFraction: {2775 readonly nom: Compact<u32>;2776 readonly denom: Compact<u32>;2777 } & Struct;2778 readonly isAtLeastProportion: boolean;2779 readonly asAtLeastProportion: {2780 readonly nom: Compact<u32>;2781 readonly denom: Compact<u32>;2782 } & Struct;2783 readonly isMoreThanProportion: boolean;2784 readonly asMoreThanProportion: {2785 readonly nom: Compact<u32>;2786 readonly denom: Compact<u32>;2787 } & Struct;2788 readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';2789}27902791/** @name XcmV0JunctionNetworkId */2792export interface XcmV0JunctionNetworkId extends Enum {2793 readonly isAny: boolean;2794 readonly isNamed: boolean;2795 readonly asNamed: Bytes;2796 readonly isPolkadot: boolean;2797 readonly isKusama: boolean;2798 readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';2799}28002801/** @name XcmV0MultiAsset */2802export interface XcmV0MultiAsset extends Enum {2803 readonly isNone: boolean;2804 readonly isAll: boolean;2805 readonly isAllFungible: boolean;2806 readonly isAllNonFungible: boolean;2807 readonly isAllAbstractFungible: boolean;2808 readonly asAllAbstractFungible: {2809 readonly id: Bytes;2810 } & Struct;2811 readonly isAllAbstractNonFungible: boolean;2812 readonly asAllAbstractNonFungible: {2813 readonly class: Bytes;2814 } & Struct;2815 readonly isAllConcreteFungible: boolean;2816 readonly asAllConcreteFungible: {2817 readonly id: XcmV0MultiLocation;2818 } & Struct;2819 readonly isAllConcreteNonFungible: boolean;2820 readonly asAllConcreteNonFungible: {2821 readonly class: XcmV0MultiLocation;2822 } & Struct;2823 readonly isAbstractFungible: boolean;2824 readonly asAbstractFungible: {2825 readonly id: Bytes;2826 readonly amount: Compact<u128>;2827 } & Struct;2828 readonly isAbstractNonFungible: boolean;2829 readonly asAbstractNonFungible: {2830 readonly class: Bytes;2831 readonly instance: XcmV1MultiassetAssetInstance;2832 } & Struct;2833 readonly isConcreteFungible: boolean;2834 readonly asConcreteFungible: {2835 readonly id: XcmV0MultiLocation;2836 readonly amount: Compact<u128>;2837 } & Struct;2838 readonly isConcreteNonFungible: boolean;2839 readonly asConcreteNonFungible: {2840 readonly class: XcmV0MultiLocation;2841 readonly instance: XcmV1MultiassetAssetInstance;2842 } & Struct;2843 readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible';2844}28452846/** @name XcmV0MultiLocation */2847export interface XcmV0MultiLocation extends Enum {2848 readonly isNull: boolean;2849 readonly isX1: boolean;2850 readonly asX1: XcmV0Junction;2851 readonly isX2: boolean;2852 readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>;2853 readonly isX3: boolean;2854 readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>;2855 readonly isX4: boolean;2856 readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;2857 readonly isX5: boolean;2858 readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;2859 readonly isX6: boolean;2860 readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;2861 readonly isX7: boolean;2862 readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;2863 readonly isX8: boolean;2864 readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;2865 readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';2866}28672868/** @name XcmV0Order */2869export interface XcmV0Order extends Enum {2870 readonly isNull: boolean;2871 readonly isDepositAsset: boolean;2872 readonly asDepositAsset: {2873 readonly assets: Vec<XcmV0MultiAsset>;2874 readonly dest: XcmV0MultiLocation;2875 } & Struct;2876 readonly isDepositReserveAsset: boolean;2877 readonly asDepositReserveAsset: {2878 readonly assets: Vec<XcmV0MultiAsset>;2879 readonly dest: XcmV0MultiLocation;2880 readonly effects: Vec<XcmV0Order>;2881 } & Struct;2882 readonly isExchangeAsset: boolean;2883 readonly asExchangeAsset: {2884 readonly give: Vec<XcmV0MultiAsset>;2885 readonly receive: Vec<XcmV0MultiAsset>;2886 } & Struct;2887 readonly isInitiateReserveWithdraw: boolean;2888 readonly asInitiateReserveWithdraw: {2889 readonly assets: Vec<XcmV0MultiAsset>;2890 readonly reserve: XcmV0MultiLocation;2891 readonly effects: Vec<XcmV0Order>;2892 } & Struct;2893 readonly isInitiateTeleport: boolean;2894 readonly asInitiateTeleport: {2895 readonly assets: Vec<XcmV0MultiAsset>;2896 readonly dest: XcmV0MultiLocation;2897 readonly effects: Vec<XcmV0Order>;2898 } & Struct;2899 readonly isQueryHolding: boolean;2900 readonly asQueryHolding: {2901 readonly queryId: Compact<u64>;2902 readonly dest: XcmV0MultiLocation;2903 readonly assets: Vec<XcmV0MultiAsset>;2904 } & Struct;2905 readonly isBuyExecution: boolean;2906 readonly asBuyExecution: {2907 readonly fees: XcmV0MultiAsset;2908 readonly weight: u64;2909 readonly debt: u64;2910 readonly haltOnError: bool;2911 readonly xcm: Vec<XcmV0Xcm>;2912 } & Struct;2913 readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';2914}29152916/** @name XcmV0OriginKind */2917export interface XcmV0OriginKind extends Enum {2918 readonly isNative: boolean;2919 readonly isSovereignAccount: boolean;2920 readonly isSuperuser: boolean;2921 readonly isXcm: boolean;2922 readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';2923}29242925/** @name XcmV0Response */2926export interface XcmV0Response extends Enum {2927 readonly isAssets: boolean;2928 readonly asAssets: Vec<XcmV0MultiAsset>;2929 readonly type: 'Assets';2930}29312932/** @name XcmV0Xcm */2933export interface XcmV0Xcm extends Enum {2934 readonly isWithdrawAsset: boolean;2935 readonly asWithdrawAsset: {2936 readonly assets: Vec<XcmV0MultiAsset>;2937 readonly effects: Vec<XcmV0Order>;2938 } & Struct;2939 readonly isReserveAssetDeposit: boolean;2940 readonly asReserveAssetDeposit: {2941 readonly assets: Vec<XcmV0MultiAsset>;2942 readonly effects: Vec<XcmV0Order>;2943 } & Struct;2944 readonly isTeleportAsset: boolean;2945 readonly asTeleportAsset: {2946 readonly assets: Vec<XcmV0MultiAsset>;2947 readonly effects: Vec<XcmV0Order>;2948 } & Struct;2949 readonly isQueryResponse: boolean;2950 readonly asQueryResponse: {2951 readonly queryId: Compact<u64>;2952 readonly response: XcmV0Response;2953 } & Struct;2954 readonly isTransferAsset: boolean;2955 readonly asTransferAsset: {2956 readonly assets: Vec<XcmV0MultiAsset>;2957 readonly dest: XcmV0MultiLocation;2958 } & Struct;2959 readonly isTransferReserveAsset: boolean;2960 readonly asTransferReserveAsset: {2961 readonly assets: Vec<XcmV0MultiAsset>;2962 readonly dest: XcmV0MultiLocation;2963 readonly effects: Vec<XcmV0Order>;2964 } & Struct;2965 readonly isTransact: boolean;2966 readonly asTransact: {2967 readonly originType: XcmV0OriginKind;2968 readonly requireWeightAtMost: u64;2969 readonly call: XcmDoubleEncoded;2970 } & Struct;2971 readonly isHrmpNewChannelOpenRequest: boolean;2972 readonly asHrmpNewChannelOpenRequest: {2973 readonly sender: Compact<u32>;2974 readonly maxMessageSize: Compact<u32>;2975 readonly maxCapacity: Compact<u32>;2976 } & Struct;2977 readonly isHrmpChannelAccepted: boolean;2978 readonly asHrmpChannelAccepted: {2979 readonly recipient: Compact<u32>;2980 } & Struct;2981 readonly isHrmpChannelClosing: boolean;2982 readonly asHrmpChannelClosing: {2983 readonly initiator: Compact<u32>;2984 readonly sender: Compact<u32>;2985 readonly recipient: Compact<u32>;2986 } & Struct;2987 readonly isRelayedFrom: boolean;2988 readonly asRelayedFrom: {2989 readonly who: XcmV0MultiLocation;2990 readonly message: XcmV0Xcm;2991 } & Struct;2992 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom';2993}29942995/** @name XcmV1Junction */2996export interface XcmV1Junction extends Enum {2997 readonly isParachain: boolean;2998 readonly asParachain: Compact<u32>;2999 readonly isAccountId32: boolean;3000 readonly asAccountId32: {3001 readonly network: XcmV0JunctionNetworkId;3002 readonly id: U8aFixed;3003 } & Struct;3004 readonly isAccountIndex64: boolean;3005 readonly asAccountIndex64: {3006 readonly network: XcmV0JunctionNetworkId;3007 readonly index: Compact<u64>;3008 } & Struct;3009 readonly isAccountKey20: boolean;3010 readonly asAccountKey20: {3011 readonly network: XcmV0JunctionNetworkId;3012 readonly key: U8aFixed;3013 } & Struct;3014 readonly isPalletInstance: boolean;3015 readonly asPalletInstance: u8;3016 readonly isGeneralIndex: boolean;3017 readonly asGeneralIndex: Compact<u128>;3018 readonly isGeneralKey: boolean;3019 readonly asGeneralKey: Bytes;3020 readonly isOnlyChild: boolean;3021 readonly isPlurality: boolean;3022 readonly asPlurality: {3023 readonly id: XcmV0JunctionBodyId;3024 readonly part: XcmV0JunctionBodyPart;3025 } & Struct;3026 readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';3027}30283029/** @name XcmV1MultiAsset */3030export interface XcmV1MultiAsset extends Struct {3031 readonly id: XcmV1MultiassetAssetId;3032 readonly fun: XcmV1MultiassetFungibility;3033}30343035/** @name XcmV1MultiassetAssetId */3036export interface XcmV1MultiassetAssetId extends Enum {3037 readonly isConcrete: boolean;3038 readonly asConcrete: XcmV1MultiLocation;3039 readonly isAbstract: boolean;3040 readonly asAbstract: Bytes;3041 readonly type: 'Concrete' | 'Abstract';3042}30433044/** @name XcmV1MultiassetAssetInstance */3045export interface XcmV1MultiassetAssetInstance extends Enum {3046 readonly isUndefined: boolean;3047 readonly isIndex: boolean;3048 readonly asIndex: Compact<u128>;3049 readonly isArray4: boolean;3050 readonly asArray4: U8aFixed;3051 readonly isArray8: boolean;3052 readonly asArray8: U8aFixed;3053 readonly isArray16: boolean;3054 readonly asArray16: U8aFixed;3055 readonly isArray32: boolean;3056 readonly asArray32: U8aFixed;3057 readonly isBlob: boolean;3058 readonly asBlob: Bytes;3059 readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';3060}30613062/** @name XcmV1MultiassetFungibility */3063export interface XcmV1MultiassetFungibility extends Enum {3064 readonly isFungible: boolean;3065 readonly asFungible: Compact<u128>;3066 readonly isNonFungible: boolean;3067 readonly asNonFungible: XcmV1MultiassetAssetInstance;3068 readonly type: 'Fungible' | 'NonFungible';3069}30703071/** @name XcmV1MultiassetMultiAssetFilter */3072export interface XcmV1MultiassetMultiAssetFilter extends Enum {3073 readonly isDefinite: boolean;3074 readonly asDefinite: XcmV1MultiassetMultiAssets;3075 readonly isWild: boolean;3076 readonly asWild: XcmV1MultiassetWildMultiAsset;3077 readonly type: 'Definite' | 'Wild';3078}30793080/** @name XcmV1MultiassetMultiAssets */3081export interface XcmV1MultiassetMultiAssets extends Vec<XcmV1MultiAsset> {}30823083/** @name XcmV1MultiassetWildFungibility */3084export interface XcmV1MultiassetWildFungibility extends Enum {3085 readonly isFungible: boolean;3086 readonly isNonFungible: boolean;3087 readonly type: 'Fungible' | 'NonFungible';3088}30893090/** @name XcmV1MultiassetWildMultiAsset */3091export interface XcmV1MultiassetWildMultiAsset extends Enum {3092 readonly isAll: boolean;3093 readonly isAllOf: boolean;3094 readonly asAllOf: {3095 readonly id: XcmV1MultiassetAssetId;3096 readonly fun: XcmV1MultiassetWildFungibility;3097 } & Struct;3098 readonly type: 'All' | 'AllOf';3099}31003101/** @name XcmV1MultiLocation */3102export interface XcmV1MultiLocation extends Struct {3103 readonly parents: u8;3104 readonly interior: XcmV1MultilocationJunctions;3105}31063107/** @name XcmV1MultilocationJunctions */3108export interface XcmV1MultilocationJunctions extends Enum {3109 readonly isHere: boolean;3110 readonly isX1: boolean;3111 readonly asX1: XcmV1Junction;3112 readonly isX2: boolean;3113 readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>;3114 readonly isX3: boolean;3115 readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3116 readonly isX4: boolean;3117 readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3118 readonly isX5: boolean;3119 readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3120 readonly isX6: boolean;3121 readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3122 readonly isX7: boolean;3123 readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3124 readonly isX8: boolean;3125 readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3126 readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';3127}31283129/** @name XcmV1Order */3130export interface XcmV1Order extends Enum {3131 readonly isNoop: boolean;3132 readonly isDepositAsset: boolean;3133 readonly asDepositAsset: {3134 readonly assets: XcmV1MultiassetMultiAssetFilter;3135 readonly maxAssets: u32;3136 readonly beneficiary: XcmV1MultiLocation;3137 } & Struct;3138 readonly isDepositReserveAsset: boolean;3139 readonly asDepositReserveAsset: {3140 readonly assets: XcmV1MultiassetMultiAssetFilter;3141 readonly maxAssets: u32;3142 readonly dest: XcmV1MultiLocation;3143 readonly effects: Vec<XcmV1Order>;3144 } & Struct;3145 readonly isExchangeAsset: boolean;3146 readonly asExchangeAsset: {3147 readonly give: XcmV1MultiassetMultiAssetFilter;3148 readonly receive: XcmV1MultiassetMultiAssets;3149 } & Struct;3150 readonly isInitiateReserveWithdraw: boolean;3151 readonly asInitiateReserveWithdraw: {3152 readonly assets: XcmV1MultiassetMultiAssetFilter;3153 readonly reserve: XcmV1MultiLocation;3154 readonly effects: Vec<XcmV1Order>;3155 } & Struct;3156 readonly isInitiateTeleport: boolean;3157 readonly asInitiateTeleport: {3158 readonly assets: XcmV1MultiassetMultiAssetFilter;3159 readonly dest: XcmV1MultiLocation;3160 readonly effects: Vec<XcmV1Order>;3161 } & Struct;3162 readonly isQueryHolding: boolean;3163 readonly asQueryHolding: {3164 readonly queryId: Compact<u64>;3165 readonly dest: XcmV1MultiLocation;3166 readonly assets: XcmV1MultiassetMultiAssetFilter;3167 } & Struct;3168 readonly isBuyExecution: boolean;3169 readonly asBuyExecution: {3170 readonly fees: XcmV1MultiAsset;3171 readonly weight: u64;3172 readonly debt: u64;3173 readonly haltOnError: bool;3174 readonly instructions: Vec<XcmV1Xcm>;3175 } & Struct;3176 readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';3177}31783179/** @name XcmV1Response */3180export interface XcmV1Response extends Enum {3181 readonly isAssets: boolean;3182 readonly asAssets: XcmV1MultiassetMultiAssets;3183 readonly isVersion: boolean;3184 readonly asVersion: u32;3185 readonly type: 'Assets' | 'Version';3186}31873188/** @name XcmV1Xcm */3189export interface XcmV1Xcm extends Enum {3190 readonly isWithdrawAsset: boolean;3191 readonly asWithdrawAsset: {3192 readonly assets: XcmV1MultiassetMultiAssets;3193 readonly effects: Vec<XcmV1Order>;3194 } & Struct;3195 readonly isReserveAssetDeposited: boolean;3196 readonly asReserveAssetDeposited: {3197 readonly assets: XcmV1MultiassetMultiAssets;3198 readonly effects: Vec<XcmV1Order>;3199 } & Struct;3200 readonly isReceiveTeleportedAsset: boolean;3201 readonly asReceiveTeleportedAsset: {3202 readonly assets: XcmV1MultiassetMultiAssets;3203 readonly effects: Vec<XcmV1Order>;3204 } & Struct;3205 readonly isQueryResponse: boolean;3206 readonly asQueryResponse: {3207 readonly queryId: Compact<u64>;3208 readonly response: XcmV1Response;3209 } & Struct;3210 readonly isTransferAsset: boolean;3211 readonly asTransferAsset: {3212 readonly assets: XcmV1MultiassetMultiAssets;3213 readonly beneficiary: XcmV1MultiLocation;3214 } & Struct;3215 readonly isTransferReserveAsset: boolean;3216 readonly asTransferReserveAsset: {3217 readonly assets: XcmV1MultiassetMultiAssets;3218 readonly dest: XcmV1MultiLocation;3219 readonly effects: Vec<XcmV1Order>;3220 } & Struct;3221 readonly isTransact: boolean;3222 readonly asTransact: {3223 readonly originType: XcmV0OriginKind;3224 readonly requireWeightAtMost: u64;3225 readonly call: XcmDoubleEncoded;3226 } & Struct;3227 readonly isHrmpNewChannelOpenRequest: boolean;3228 readonly asHrmpNewChannelOpenRequest: {3229 readonly sender: Compact<u32>;3230 readonly maxMessageSize: Compact<u32>;3231 readonly maxCapacity: Compact<u32>;3232 } & Struct;3233 readonly isHrmpChannelAccepted: boolean;3234 readonly asHrmpChannelAccepted: {3235 readonly recipient: Compact<u32>;3236 } & Struct;3237 readonly isHrmpChannelClosing: boolean;3238 readonly asHrmpChannelClosing: {3239 readonly initiator: Compact<u32>;3240 readonly sender: Compact<u32>;3241 readonly recipient: Compact<u32>;3242 } & Struct;3243 readonly isRelayedFrom: boolean;3244 readonly asRelayedFrom: {3245 readonly who: XcmV1MultilocationJunctions;3246 readonly message: XcmV1Xcm;3247 } & Struct;3248 readonly isSubscribeVersion: boolean;3249 readonly asSubscribeVersion: {3250 readonly queryId: Compact<u64>;3251 readonly maxResponseWeight: Compact<u64>;3252 } & Struct;3253 readonly isUnsubscribeVersion: boolean;3254 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion';3255}32563257/** @name XcmV2Instruction */3258export interface XcmV2Instruction extends Enum {3259 readonly isWithdrawAsset: boolean;3260 readonly asWithdrawAsset: XcmV1MultiassetMultiAssets;3261 readonly isReserveAssetDeposited: boolean;3262 readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets;3263 readonly isReceiveTeleportedAsset: boolean;3264 readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets;3265 readonly isQueryResponse: boolean;3266 readonly asQueryResponse: {3267 readonly queryId: Compact<u64>;3268 readonly response: XcmV2Response;3269 readonly maxWeight: Compact<u64>;3270 } & Struct;3271 readonly isTransferAsset: boolean;3272 readonly asTransferAsset: {3273 readonly assets: XcmV1MultiassetMultiAssets;3274 readonly beneficiary: XcmV1MultiLocation;3275 } & Struct;3276 readonly isTransferReserveAsset: boolean;3277 readonly asTransferReserveAsset: {3278 readonly assets: XcmV1MultiassetMultiAssets;3279 readonly dest: XcmV1MultiLocation;3280 readonly xcm: XcmV2Xcm;3281 } & Struct;3282 readonly isTransact: boolean;3283 readonly asTransact: {3284 readonly originType: XcmV0OriginKind;3285 readonly requireWeightAtMost: Compact<u64>;3286 readonly call: XcmDoubleEncoded;3287 } & Struct;3288 readonly isHrmpNewChannelOpenRequest: boolean;3289 readonly asHrmpNewChannelOpenRequest: {3290 readonly sender: Compact<u32>;3291 readonly maxMessageSize: Compact<u32>;3292 readonly maxCapacity: Compact<u32>;3293 } & Struct;3294 readonly isHrmpChannelAccepted: boolean;3295 readonly asHrmpChannelAccepted: {3296 readonly recipient: Compact<u32>;3297 } & Struct;3298 readonly isHrmpChannelClosing: boolean;3299 readonly asHrmpChannelClosing: {3300 readonly initiator: Compact<u32>;3301 readonly sender: Compact<u32>;3302 readonly recipient: Compact<u32>;3303 } & Struct;3304 readonly isClearOrigin: boolean;3305 readonly isDescendOrigin: boolean;3306 readonly asDescendOrigin: XcmV1MultilocationJunctions;3307 readonly isReportError: boolean;3308 readonly asReportError: {3309 readonly queryId: Compact<u64>;3310 readonly dest: XcmV1MultiLocation;3311 readonly maxResponseWeight: Compact<u64>;3312 } & Struct;3313 readonly isDepositAsset: boolean;3314 readonly asDepositAsset: {3315 readonly assets: XcmV1MultiassetMultiAssetFilter;3316 readonly maxAssets: Compact<u32>;3317 readonly beneficiary: XcmV1MultiLocation;3318 } & Struct;3319 readonly isDepositReserveAsset: boolean;3320 readonly asDepositReserveAsset: {3321 readonly assets: XcmV1MultiassetMultiAssetFilter;3322 readonly maxAssets: Compact<u32>;3323 readonly dest: XcmV1MultiLocation;3324 readonly xcm: XcmV2Xcm;3325 } & Struct;3326 readonly isExchangeAsset: boolean;3327 readonly asExchangeAsset: {3328 readonly give: XcmV1MultiassetMultiAssetFilter;3329 readonly receive: XcmV1MultiassetMultiAssets;3330 } & Struct;3331 readonly isInitiateReserveWithdraw: boolean;3332 readonly asInitiateReserveWithdraw: {3333 readonly assets: XcmV1MultiassetMultiAssetFilter;3334 readonly reserve: XcmV1MultiLocation;3335 readonly xcm: XcmV2Xcm;3336 } & Struct;3337 readonly isInitiateTeleport: boolean;3338 readonly asInitiateTeleport: {3339 readonly assets: XcmV1MultiassetMultiAssetFilter;3340 readonly dest: XcmV1MultiLocation;3341 readonly xcm: XcmV2Xcm;3342 } & Struct;3343 readonly isQueryHolding: boolean;3344 readonly asQueryHolding: {3345 readonly queryId: Compact<u64>;3346 readonly dest: XcmV1MultiLocation;3347 readonly assets: XcmV1MultiassetMultiAssetFilter;3348 readonly maxResponseWeight: Compact<u64>;3349 } & Struct;3350 readonly isBuyExecution: boolean;3351 readonly asBuyExecution: {3352 readonly fees: XcmV1MultiAsset;3353 readonly weightLimit: XcmV2WeightLimit;3354 } & Struct;3355 readonly isRefundSurplus: boolean;3356 readonly isSetErrorHandler: boolean;3357 readonly asSetErrorHandler: XcmV2Xcm;3358 readonly isSetAppendix: boolean;3359 readonly asSetAppendix: XcmV2Xcm;3360 readonly isClearError: boolean;3361 readonly isClaimAsset: boolean;3362 readonly asClaimAsset: {3363 readonly assets: XcmV1MultiassetMultiAssets;3364 readonly ticket: XcmV1MultiLocation;3365 } & Struct;3366 readonly isTrap: boolean;3367 readonly asTrap: Compact<u64>;3368 readonly isSubscribeVersion: boolean;3369 readonly asSubscribeVersion: {3370 readonly queryId: Compact<u64>;3371 readonly maxResponseWeight: Compact<u64>;3372 } & Struct;3373 readonly isUnsubscribeVersion: boolean;3374 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';3375}33763377/** @name XcmV2Response */3378export interface XcmV2Response extends Enum {3379 readonly isNull: boolean;3380 readonly isAssets: boolean;3381 readonly asAssets: XcmV1MultiassetMultiAssets;3382 readonly isExecutionResult: boolean;3383 readonly asExecutionResult: Option<ITuple<[u32, XcmV2TraitsError]>>;3384 readonly isVersion: boolean;3385 readonly asVersion: u32;3386 readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';3387}33883389/** @name XcmV2TraitsError */3390export interface XcmV2TraitsError extends Enum {3391 readonly isOverflow: boolean;3392 readonly isUnimplemented: boolean;3393 readonly isUntrustedReserveLocation: boolean;3394 readonly isUntrustedTeleportLocation: boolean;3395 readonly isMultiLocationFull: boolean;3396 readonly isMultiLocationNotInvertible: boolean;3397 readonly isBadOrigin: boolean;3398 readonly isInvalidLocation: boolean;3399 readonly isAssetNotFound: boolean;3400 readonly isFailedToTransactAsset: boolean;3401 readonly isNotWithdrawable: boolean;3402 readonly isLocationCannotHold: boolean;3403 readonly isExceedsMaxMessageSize: boolean;3404 readonly isDestinationUnsupported: boolean;3405 readonly isTransport: boolean;3406 readonly isUnroutable: boolean;3407 readonly isUnknownClaim: boolean;3408 readonly isFailedToDecode: boolean;3409 readonly isMaxWeightInvalid: boolean;3410 readonly isNotHoldingFees: boolean;3411 readonly isTooExpensive: boolean;3412 readonly isTrap: boolean;3413 readonly asTrap: u64;3414 readonly isUnhandledXcmVersion: boolean;3415 readonly isWeightLimitReached: boolean;3416 readonly asWeightLimitReached: u64;3417 readonly isBarrier: boolean;3418 readonly isWeightNotComputable: boolean;3419 readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';3420}34213422/** @name XcmV2TraitsOutcome */3423export interface XcmV2TraitsOutcome extends Enum {3424 readonly isComplete: boolean;3425 readonly asComplete: u64;3426 readonly isIncomplete: boolean;3427 readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>;3428 readonly isError: boolean;3429 readonly asError: XcmV2TraitsError;3430 readonly type: 'Complete' | 'Incomplete' | 'Error';3431}34323433/** @name XcmV2WeightLimit */3434export interface XcmV2WeightLimit extends Enum {3435 readonly isUnlimited: boolean;3436 readonly isLimited: boolean;3437 readonly asLimited: Compact<u64>;3438 readonly type: 'Unlimited' | 'Limited';3439}34403441/** @name XcmV2Xcm */3442export interface XcmV2Xcm extends Vec<XcmV2Instruction> {}34433444/** @name XcmVersionedMultiAssets */3445export interface XcmVersionedMultiAssets extends Enum {3446 readonly isV0: boolean;3447 readonly asV0: Vec<XcmV0MultiAsset>;3448 readonly isV1: boolean;3449 readonly asV1: XcmV1MultiassetMultiAssets;3450 readonly type: 'V0' | 'V1';3451}34523453/** @name XcmVersionedMultiLocation */3454export interface XcmVersionedMultiLocation extends Enum {3455 readonly isV0: boolean;3456 readonly asV0: XcmV0MultiLocation;3457 readonly isV1: boolean;3458 readonly asV1: XcmV1MultiLocation;3459 readonly type: 'V0' | 'V1';3460}34613462/** @name XcmVersionedXcm */3463export interface XcmVersionedXcm extends Enum {3464 readonly isV0: boolean;3465 readonly asV0: XcmV0Xcm;3466 readonly isV1: boolean;3467 readonly asV1: XcmV1Xcm;3468 readonly isV2: boolean;3469 readonly asV2: XcmV2Xcm;3470 readonly type: 'V0' | 'V1' | 'V2';3471}34723473export type PHANTOM_DEFAULT = 'default';1// Auto-generated via `yarn polkadot-types-from-defs`, do not edit2/* eslint-disable */34import type { BTreeMap, BTreeSet, Bytes, Compact, Enum, Null, Option, Result, Struct, Text, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';5import type { ITuple } from '@polkadot/types-codec/types';6import type { AccountId32, Call, H160, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';7import type { Event } from '@polkadot/types/interfaces/system';89/** @name CumulusPalletDmpQueueCall */10export interface CumulusPalletDmpQueueCall extends Enum {11 readonly isServiceOverweight: boolean;12 readonly asServiceOverweight: {13 readonly index: u64;14 readonly weightLimit: u64;15 } & Struct;16 readonly type: 'ServiceOverweight';17}1819/** @name CumulusPalletDmpQueueConfigData */20export interface CumulusPalletDmpQueueConfigData extends Struct {21 readonly maxIndividual: u64;22}2324/** @name CumulusPalletDmpQueueError */25export interface CumulusPalletDmpQueueError extends Enum {26 readonly isUnknown: boolean;27 readonly isOverLimit: boolean;28 readonly type: 'Unknown' | 'OverLimit';29}3031/** @name CumulusPalletDmpQueueEvent */32export interface CumulusPalletDmpQueueEvent extends Enum {33 readonly isInvalidFormat: boolean;34 readonly asInvalidFormat: {35 readonly messageId: U8aFixed;36 } & Struct;37 readonly isUnsupportedVersion: boolean;38 readonly asUnsupportedVersion: {39 readonly messageId: U8aFixed;40 } & Struct;41 readonly isExecutedDownward: boolean;42 readonly asExecutedDownward: {43 readonly messageId: U8aFixed;44 readonly outcome: XcmV2TraitsOutcome;45 } & Struct;46 readonly isWeightExhausted: boolean;47 readonly asWeightExhausted: {48 readonly messageId: U8aFixed;49 readonly remainingWeight: u64;50 readonly requiredWeight: u64;51 } & Struct;52 readonly isOverweightEnqueued: boolean;53 readonly asOverweightEnqueued: {54 readonly messageId: U8aFixed;55 readonly overweightIndex: u64;56 readonly requiredWeight: u64;57 } & Struct;58 readonly isOverweightServiced: boolean;59 readonly asOverweightServiced: {60 readonly overweightIndex: u64;61 readonly weightUsed: u64;62 } & Struct;63 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';64}6566/** @name CumulusPalletDmpQueuePageIndexData */67export interface CumulusPalletDmpQueuePageIndexData extends Struct {68 readonly beginUsed: u32;69 readonly endUsed: u32;70 readonly overweightCount: u64;71}7273/** @name CumulusPalletParachainSystemCall */74export interface CumulusPalletParachainSystemCall extends Enum {75 readonly isSetValidationData: boolean;76 readonly asSetValidationData: {77 readonly data: CumulusPrimitivesParachainInherentParachainInherentData;78 } & Struct;79 readonly isSudoSendUpwardMessage: boolean;80 readonly asSudoSendUpwardMessage: {81 readonly message: Bytes;82 } & Struct;83 readonly isAuthorizeUpgrade: boolean;84 readonly asAuthorizeUpgrade: {85 readonly codeHash: H256;86 } & Struct;87 readonly isEnactAuthorizedUpgrade: boolean;88 readonly asEnactAuthorizedUpgrade: {89 readonly code: Bytes;90 } & Struct;91 readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade';92}9394/** @name CumulusPalletParachainSystemError */95export interface CumulusPalletParachainSystemError extends Enum {96 readonly isOverlappingUpgrades: boolean;97 readonly isProhibitedByPolkadot: boolean;98 readonly isTooBig: boolean;99 readonly isValidationDataNotAvailable: boolean;100 readonly isHostConfigurationNotAvailable: boolean;101 readonly isNotScheduled: boolean;102 readonly isNothingAuthorized: boolean;103 readonly isUnauthorized: boolean;104 readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized';105}106107/** @name CumulusPalletParachainSystemEvent */108export interface CumulusPalletParachainSystemEvent extends Enum {109 readonly isValidationFunctionStored: boolean;110 readonly isValidationFunctionApplied: boolean;111 readonly asValidationFunctionApplied: {112 readonly relayChainBlockNum: u32;113 } & Struct;114 readonly isValidationFunctionDiscarded: boolean;115 readonly isUpgradeAuthorized: boolean;116 readonly asUpgradeAuthorized: {117 readonly codeHash: H256;118 } & Struct;119 readonly isDownwardMessagesReceived: boolean;120 readonly asDownwardMessagesReceived: {121 readonly count: u32;122 } & Struct;123 readonly isDownwardMessagesProcessed: boolean;124 readonly asDownwardMessagesProcessed: {125 readonly weightUsed: u64;126 readonly dmqHead: H256;127 } & Struct;128 readonly type: 'ValidationFunctionStored' | 'ValidationFunctionApplied' | 'ValidationFunctionDiscarded' | 'UpgradeAuthorized' | 'DownwardMessagesReceived' | 'DownwardMessagesProcessed';129}130131/** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot */132export interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct {133 readonly dmqMqcHead: H256;134 readonly relayDispatchQueueSize: ITuple<[u32, u32]>;135 readonly ingressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;136 readonly egressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;137}138139/** @name CumulusPalletXcmCall */140export interface CumulusPalletXcmCall extends Null {}141142/** @name CumulusPalletXcmError */143export interface CumulusPalletXcmError extends Null {}144145/** @name CumulusPalletXcmEvent */146export interface CumulusPalletXcmEvent extends Enum {147 readonly isInvalidFormat: boolean;148 readonly asInvalidFormat: U8aFixed;149 readonly isUnsupportedVersion: boolean;150 readonly asUnsupportedVersion: U8aFixed;151 readonly isExecutedDownward: boolean;152 readonly asExecutedDownward: ITuple<[U8aFixed, XcmV2TraitsOutcome]>;153 readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';154}155156/** @name CumulusPalletXcmOrigin */157export interface CumulusPalletXcmOrigin extends Enum {158 readonly isRelay: boolean;159 readonly isSiblingParachain: boolean;160 readonly asSiblingParachain: u32;161 readonly type: 'Relay' | 'SiblingParachain';162}163164/** @name CumulusPalletXcmpQueueCall */165export interface CumulusPalletXcmpQueueCall extends Enum {166 readonly isServiceOverweight: boolean;167 readonly asServiceOverweight: {168 readonly index: u64;169 readonly weightLimit: u64;170 } & Struct;171 readonly isSuspendXcmExecution: boolean;172 readonly isResumeXcmExecution: boolean;173 readonly isUpdateSuspendThreshold: boolean;174 readonly asUpdateSuspendThreshold: {175 readonly new_: u32;176 } & Struct;177 readonly isUpdateDropThreshold: boolean;178 readonly asUpdateDropThreshold: {179 readonly new_: u32;180 } & Struct;181 readonly isUpdateResumeThreshold: boolean;182 readonly asUpdateResumeThreshold: {183 readonly new_: u32;184 } & Struct;185 readonly isUpdateThresholdWeight: boolean;186 readonly asUpdateThresholdWeight: {187 readonly new_: u64;188 } & Struct;189 readonly isUpdateWeightRestrictDecay: boolean;190 readonly asUpdateWeightRestrictDecay: {191 readonly new_: u64;192 } & Struct;193 readonly isUpdateXcmpMaxIndividualWeight: boolean;194 readonly asUpdateXcmpMaxIndividualWeight: {195 readonly new_: u64;196 } & Struct;197 readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight';198}199200/** @name CumulusPalletXcmpQueueError */201export interface CumulusPalletXcmpQueueError extends Enum {202 readonly isFailedToSend: boolean;203 readonly isBadXcmOrigin: boolean;204 readonly isBadXcm: boolean;205 readonly isBadOverweightIndex: boolean;206 readonly isWeightOverLimit: boolean;207 readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';208}209210/** @name CumulusPalletXcmpQueueEvent */211export interface CumulusPalletXcmpQueueEvent extends Enum {212 readonly isSuccess: boolean;213 readonly asSuccess: {214 readonly messageHash: Option<H256>;215 readonly weight: u64;216 } & Struct;217 readonly isFail: boolean;218 readonly asFail: {219 readonly messageHash: Option<H256>;220 readonly error: XcmV2TraitsError;221 readonly weight: u64;222 } & Struct;223 readonly isBadVersion: boolean;224 readonly asBadVersion: {225 readonly messageHash: Option<H256>;226 } & Struct;227 readonly isBadFormat: boolean;228 readonly asBadFormat: {229 readonly messageHash: Option<H256>;230 } & Struct;231 readonly isUpwardMessageSent: boolean;232 readonly asUpwardMessageSent: {233 readonly messageHash: Option<H256>;234 } & Struct;235 readonly isXcmpMessageSent: boolean;236 readonly asXcmpMessageSent: {237 readonly messageHash: Option<H256>;238 } & Struct;239 readonly isOverweightEnqueued: boolean;240 readonly asOverweightEnqueued: {241 readonly sender: u32;242 readonly sentAt: u32;243 readonly index: u64;244 readonly required: u64;245 } & Struct;246 readonly isOverweightServiced: boolean;247 readonly asOverweightServiced: {248 readonly index: u64;249 readonly used: u64;250 } & Struct;251 readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';252}253254/** @name CumulusPalletXcmpQueueInboundChannelDetails */255export interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {256 readonly sender: u32;257 readonly state: CumulusPalletXcmpQueueInboundState;258 readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;259}260261/** @name CumulusPalletXcmpQueueInboundState */262export interface CumulusPalletXcmpQueueInboundState extends Enum {263 readonly isOk: boolean;264 readonly isSuspended: boolean;265 readonly type: 'Ok' | 'Suspended';266}267268/** @name CumulusPalletXcmpQueueOutboundChannelDetails */269export interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {270 readonly recipient: u32;271 readonly state: CumulusPalletXcmpQueueOutboundState;272 readonly signalsExist: bool;273 readonly firstIndex: u16;274 readonly lastIndex: u16;275}276277/** @name CumulusPalletXcmpQueueOutboundState */278export interface CumulusPalletXcmpQueueOutboundState extends Enum {279 readonly isOk: boolean;280 readonly isSuspended: boolean;281 readonly type: 'Ok' | 'Suspended';282}283284/** @name CumulusPalletXcmpQueueQueueConfigData */285export interface CumulusPalletXcmpQueueQueueConfigData extends Struct {286 readonly suspendThreshold: u32;287 readonly dropThreshold: u32;288 readonly resumeThreshold: u32;289 readonly thresholdWeight: u64;290 readonly weightRestrictDecay: u64;291 readonly xcmpMaxIndividualWeight: u64;292}293294/** @name CumulusPrimitivesParachainInherentParachainInherentData */295export interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct {296 readonly validationData: PolkadotPrimitivesV2PersistedValidationData;297 readonly relayChainState: SpTrieStorageProof;298 readonly downwardMessages: Vec<PolkadotCorePrimitivesInboundDownwardMessage>;299 readonly horizontalMessages: BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>;300}301302/** @name EthbloomBloom */303export interface EthbloomBloom extends U8aFixed {}304305/** @name EthereumBlock */306export interface EthereumBlock extends Struct {307 readonly header: EthereumHeader;308 readonly transactions: Vec<EthereumTransactionTransactionV2>;309 readonly ommers: Vec<EthereumHeader>;310}311312/** @name EthereumHeader */313export interface EthereumHeader extends Struct {314 readonly parentHash: H256;315 readonly ommersHash: H256;316 readonly beneficiary: H160;317 readonly stateRoot: H256;318 readonly transactionsRoot: H256;319 readonly receiptsRoot: H256;320 readonly logsBloom: EthbloomBloom;321 readonly difficulty: U256;322 readonly number: U256;323 readonly gasLimit: U256;324 readonly gasUsed: U256;325 readonly timestamp: u64;326 readonly extraData: Bytes;327 readonly mixHash: H256;328 readonly nonce: EthereumTypesHashH64;329}330331/** @name EthereumLog */332export interface EthereumLog extends Struct {333 readonly address: H160;334 readonly topics: Vec<H256>;335 readonly data: Bytes;336}337338/** @name EthereumReceiptEip658ReceiptData */339export interface EthereumReceiptEip658ReceiptData extends Struct {340 readonly statusCode: u8;341 readonly usedGas: U256;342 readonly logsBloom: EthbloomBloom;343 readonly logs: Vec<EthereumLog>;344}345346/** @name EthereumReceiptReceiptV3 */347export interface EthereumReceiptReceiptV3 extends Enum {348 readonly isLegacy: boolean;349 readonly asLegacy: EthereumReceiptEip658ReceiptData;350 readonly isEip2930: boolean;351 readonly asEip2930: EthereumReceiptEip658ReceiptData;352 readonly isEip1559: boolean;353 readonly asEip1559: EthereumReceiptEip658ReceiptData;354 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';355}356357/** @name EthereumTransactionAccessListItem */358export interface EthereumTransactionAccessListItem extends Struct {359 readonly address: H160;360 readonly storageKeys: Vec<H256>;361}362363/** @name EthereumTransactionEip1559Transaction */364export interface EthereumTransactionEip1559Transaction extends Struct {365 readonly chainId: u64;366 readonly nonce: U256;367 readonly maxPriorityFeePerGas: U256;368 readonly maxFeePerGas: U256;369 readonly gasLimit: U256;370 readonly action: EthereumTransactionTransactionAction;371 readonly value: U256;372 readonly input: Bytes;373 readonly accessList: Vec<EthereumTransactionAccessListItem>;374 readonly oddYParity: bool;375 readonly r: H256;376 readonly s: H256;377}378379/** @name EthereumTransactionEip2930Transaction */380export interface EthereumTransactionEip2930Transaction extends Struct {381 readonly chainId: u64;382 readonly nonce: U256;383 readonly gasPrice: U256;384 readonly gasLimit: U256;385 readonly action: EthereumTransactionTransactionAction;386 readonly value: U256;387 readonly input: Bytes;388 readonly accessList: Vec<EthereumTransactionAccessListItem>;389 readonly oddYParity: bool;390 readonly r: H256;391 readonly s: H256;392}393394/** @name EthereumTransactionLegacyTransaction */395export interface EthereumTransactionLegacyTransaction extends Struct {396 readonly nonce: U256;397 readonly gasPrice: U256;398 readonly gasLimit: U256;399 readonly action: EthereumTransactionTransactionAction;400 readonly value: U256;401 readonly input: Bytes;402 readonly signature: EthereumTransactionTransactionSignature;403}404405/** @name EthereumTransactionTransactionAction */406export interface EthereumTransactionTransactionAction extends Enum {407 readonly isCall: boolean;408 readonly asCall: H160;409 readonly isCreate: boolean;410 readonly type: 'Call' | 'Create';411}412413/** @name EthereumTransactionTransactionSignature */414export interface EthereumTransactionTransactionSignature extends Struct {415 readonly v: u64;416 readonly r: H256;417 readonly s: H256;418}419420/** @name EthereumTransactionTransactionV2 */421export interface EthereumTransactionTransactionV2 extends Enum {422 readonly isLegacy: boolean;423 readonly asLegacy: EthereumTransactionLegacyTransaction;424 readonly isEip2930: boolean;425 readonly asEip2930: EthereumTransactionEip2930Transaction;426 readonly isEip1559: boolean;427 readonly asEip1559: EthereumTransactionEip1559Transaction;428 readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';429}430431/** @name EthereumTypesHashH64 */432export interface EthereumTypesHashH64 extends U8aFixed {}433434/** @name EvmCoreErrorExitError */435export interface EvmCoreErrorExitError extends Enum {436 readonly isStackUnderflow: boolean;437 readonly isStackOverflow: boolean;438 readonly isInvalidJump: boolean;439 readonly isInvalidRange: boolean;440 readonly isDesignatedInvalid: boolean;441 readonly isCallTooDeep: boolean;442 readonly isCreateCollision: boolean;443 readonly isCreateContractLimit: boolean;444 readonly isOutOfOffset: boolean;445 readonly isOutOfGas: boolean;446 readonly isOutOfFund: boolean;447 readonly isPcUnderflow: boolean;448 readonly isCreateEmpty: boolean;449 readonly isOther: boolean;450 readonly asOther: Text;451 readonly isInvalidCode: boolean;452 readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';453}454455/** @name EvmCoreErrorExitFatal */456export interface EvmCoreErrorExitFatal extends Enum {457 readonly isNotSupported: boolean;458 readonly isUnhandledInterrupt: boolean;459 readonly isCallErrorAsFatal: boolean;460 readonly asCallErrorAsFatal: EvmCoreErrorExitError;461 readonly isOther: boolean;462 readonly asOther: Text;463 readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';464}465466/** @name EvmCoreErrorExitReason */467export interface EvmCoreErrorExitReason extends Enum {468 readonly isSucceed: boolean;469 readonly asSucceed: EvmCoreErrorExitSucceed;470 readonly isError: boolean;471 readonly asError: EvmCoreErrorExitError;472 readonly isRevert: boolean;473 readonly asRevert: EvmCoreErrorExitRevert;474 readonly isFatal: boolean;475 readonly asFatal: EvmCoreErrorExitFatal;476 readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';477}478479/** @name EvmCoreErrorExitRevert */480export interface EvmCoreErrorExitRevert extends Enum {481 readonly isReverted: boolean;482 readonly type: 'Reverted';483}484485/** @name EvmCoreErrorExitSucceed */486export interface EvmCoreErrorExitSucceed extends Enum {487 readonly isStopped: boolean;488 readonly isReturned: boolean;489 readonly isSuicided: boolean;490 readonly type: 'Stopped' | 'Returned' | 'Suicided';491}492493/** @name FpRpcTransactionStatus */494export interface FpRpcTransactionStatus extends Struct {495 readonly transactionHash: H256;496 readonly transactionIndex: u32;497 readonly from: H160;498 readonly to: Option<H160>;499 readonly contractAddress: Option<H160>;500 readonly logs: Vec<EthereumLog>;501 readonly logsBloom: EthbloomBloom;502}503504/** @name FrameSupportDispatchRawOrigin */505export interface FrameSupportDispatchRawOrigin extends Enum {506 readonly isRoot: boolean;507 readonly isSigned: boolean;508 readonly asSigned: AccountId32;509 readonly isNone: boolean;510 readonly type: 'Root' | 'Signed' | 'None';511}512513/** @name FrameSupportPalletId */514export interface FrameSupportPalletId extends U8aFixed {}515516/** @name FrameSupportScheduleLookupError */517export interface FrameSupportScheduleLookupError extends Enum {518 readonly isUnknown: boolean;519 readonly isBadFormat: boolean;520 readonly type: 'Unknown' | 'BadFormat';521}522523/** @name FrameSupportScheduleMaybeHashed */524export interface FrameSupportScheduleMaybeHashed extends Enum {525 readonly isValue: boolean;526 readonly asValue: Call;527 readonly isHash: boolean;528 readonly asHash: H256;529 readonly type: 'Value' | 'Hash';530}531532/** @name FrameSupportTokensMiscBalanceStatus */533export interface FrameSupportTokensMiscBalanceStatus extends Enum {534 readonly isFree: boolean;535 readonly isReserved: boolean;536 readonly type: 'Free' | 'Reserved';537}538539/** @name FrameSupportWeightsDispatchClass */540export interface FrameSupportWeightsDispatchClass extends Enum {541 readonly isNormal: boolean;542 readonly isOperational: boolean;543 readonly isMandatory: boolean;544 readonly type: 'Normal' | 'Operational' | 'Mandatory';545}546547/** @name FrameSupportWeightsDispatchInfo */548export interface FrameSupportWeightsDispatchInfo extends Struct {549 readonly weight: u64;550 readonly class: FrameSupportWeightsDispatchClass;551 readonly paysFee: FrameSupportWeightsPays;552}553554/** @name FrameSupportWeightsPays */555export interface FrameSupportWeightsPays extends Enum {556 readonly isYes: boolean;557 readonly isNo: boolean;558 readonly type: 'Yes' | 'No';559}560561/** @name FrameSupportWeightsPerDispatchClassU32 */562export interface FrameSupportWeightsPerDispatchClassU32 extends Struct {563 readonly normal: u32;564 readonly operational: u32;565 readonly mandatory: u32;566}567568/** @name FrameSupportWeightsPerDispatchClassU64 */569export interface FrameSupportWeightsPerDispatchClassU64 extends Struct {570 readonly normal: u64;571 readonly operational: u64;572 readonly mandatory: u64;573}574575/** @name FrameSupportWeightsPerDispatchClassWeightsPerClass */576export interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {577 readonly normal: FrameSystemLimitsWeightsPerClass;578 readonly operational: FrameSystemLimitsWeightsPerClass;579 readonly mandatory: FrameSystemLimitsWeightsPerClass;580}581582/** @name FrameSupportWeightsRuntimeDbWeight */583export interface FrameSupportWeightsRuntimeDbWeight extends Struct {584 readonly read: u64;585 readonly write: u64;586}587588/** @name FrameSystemAccountInfo */589export interface FrameSystemAccountInfo extends Struct {590 readonly nonce: u32;591 readonly consumers: u32;592 readonly providers: u32;593 readonly sufficients: u32;594 readonly data: PalletBalancesAccountData;595}596597/** @name FrameSystemCall */598export interface FrameSystemCall extends Enum {599 readonly isFillBlock: boolean;600 readonly asFillBlock: {601 readonly ratio: Perbill;602 } & Struct;603 readonly isRemark: boolean;604 readonly asRemark: {605 readonly remark: Bytes;606 } & Struct;607 readonly isSetHeapPages: boolean;608 readonly asSetHeapPages: {609 readonly pages: u64;610 } & Struct;611 readonly isSetCode: boolean;612 readonly asSetCode: {613 readonly code: Bytes;614 } & Struct;615 readonly isSetCodeWithoutChecks: boolean;616 readonly asSetCodeWithoutChecks: {617 readonly code: Bytes;618 } & Struct;619 readonly isSetStorage: boolean;620 readonly asSetStorage: {621 readonly items: Vec<ITuple<[Bytes, Bytes]>>;622 } & Struct;623 readonly isKillStorage: boolean;624 readonly asKillStorage: {625 readonly keys_: Vec<Bytes>;626 } & Struct;627 readonly isKillPrefix: boolean;628 readonly asKillPrefix: {629 readonly prefix: Bytes;630 readonly subkeys: u32;631 } & Struct;632 readonly isRemarkWithEvent: boolean;633 readonly asRemarkWithEvent: {634 readonly remark: Bytes;635 } & Struct;636 readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';637}638639/** @name FrameSystemError */640export interface FrameSystemError extends Enum {641 readonly isInvalidSpecName: boolean;642 readonly isSpecVersionNeedsToIncrease: boolean;643 readonly isFailedToExtractRuntimeVersion: boolean;644 readonly isNonDefaultComposite: boolean;645 readonly isNonZeroRefCount: boolean;646 readonly isCallFiltered: boolean;647 readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';648}649650/** @name FrameSystemEvent */651export interface FrameSystemEvent extends Enum {652 readonly isExtrinsicSuccess: boolean;653 readonly asExtrinsicSuccess: {654 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;655 } & Struct;656 readonly isExtrinsicFailed: boolean;657 readonly asExtrinsicFailed: {658 readonly dispatchError: SpRuntimeDispatchError;659 readonly dispatchInfo: FrameSupportWeightsDispatchInfo;660 } & Struct;661 readonly isCodeUpdated: boolean;662 readonly isNewAccount: boolean;663 readonly asNewAccount: {664 readonly account: AccountId32;665 } & Struct;666 readonly isKilledAccount: boolean;667 readonly asKilledAccount: {668 readonly account: AccountId32;669 } & Struct;670 readonly isRemarked: boolean;671 readonly asRemarked: {672 readonly sender: AccountId32;673 readonly hash_: H256;674 } & Struct;675 readonly type: 'ExtrinsicSuccess' | 'ExtrinsicFailed' | 'CodeUpdated' | 'NewAccount' | 'KilledAccount' | 'Remarked';676}677678/** @name FrameSystemEventRecord */679export interface FrameSystemEventRecord extends Struct {680 readonly phase: FrameSystemPhase;681 readonly event: Event;682 readonly topics: Vec<H256>;683}684685/** @name FrameSystemExtensionsCheckGenesis */686export interface FrameSystemExtensionsCheckGenesis extends Null {}687688/** @name FrameSystemExtensionsCheckNonce */689export interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}690691/** @name FrameSystemExtensionsCheckSpecVersion */692export interface FrameSystemExtensionsCheckSpecVersion extends Null {}693694/** @name FrameSystemExtensionsCheckWeight */695export interface FrameSystemExtensionsCheckWeight extends Null {}696697/** @name FrameSystemLastRuntimeUpgradeInfo */698export interface FrameSystemLastRuntimeUpgradeInfo extends Struct {699 readonly specVersion: Compact<u32>;700 readonly specName: Text;701}702703/** @name FrameSystemLimitsBlockLength */704export interface FrameSystemLimitsBlockLength extends Struct {705 readonly max: FrameSupportWeightsPerDispatchClassU32;706}707708/** @name FrameSystemLimitsBlockWeights */709export interface FrameSystemLimitsBlockWeights extends Struct {710 readonly baseBlock: u64;711 readonly maxBlock: u64;712 readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;713}714715/** @name FrameSystemLimitsWeightsPerClass */716export interface FrameSystemLimitsWeightsPerClass extends Struct {717 readonly baseExtrinsic: u64;718 readonly maxExtrinsic: Option<u64>;719 readonly maxTotal: Option<u64>;720 readonly reserved: Option<u64>;721}722723/** @name FrameSystemPhase */724export interface FrameSystemPhase extends Enum {725 readonly isApplyExtrinsic: boolean;726 readonly asApplyExtrinsic: u32;727 readonly isFinalization: boolean;728 readonly isInitialization: boolean;729 readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';730}731732/** @name OpalRuntimeOriginCaller */733export interface OpalRuntimeOriginCaller extends Enum {734 readonly isSystem: boolean;735 readonly asSystem: FrameSupportDispatchRawOrigin;736 readonly isVoid: boolean;737 readonly asVoid: SpCoreVoid;738 readonly isPolkadotXcm: boolean;739 readonly asPolkadotXcm: PalletXcmOrigin;740 readonly isCumulusXcm: boolean;741 readonly asCumulusXcm: CumulusPalletXcmOrigin;742 readonly isEthereum: boolean;743 readonly asEthereum: PalletEthereumRawOrigin;744 readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';745}746747/** @name OpalRuntimeRuntime */748export interface OpalRuntimeRuntime extends Null {}749750/** @name OrmlTokensAccountData */751export interface OrmlTokensAccountData extends Struct {752 readonly free: u128;753 readonly reserved: u128;754 readonly frozen: u128;755}756757/** @name OrmlTokensBalanceLock */758export interface OrmlTokensBalanceLock extends Struct {759 readonly id: U8aFixed;760 readonly amount: u128;761}762763/** @name OrmlTokensModuleCall */764export interface OrmlTokensModuleCall extends Enum {765 readonly isTransfer: boolean;766 readonly asTransfer: {767 readonly dest: MultiAddress;768 readonly currencyId: PalletForeignAssetsAssetIds;769 readonly amount: Compact<u128>;770 } & Struct;771 readonly isTransferAll: boolean;772 readonly asTransferAll: {773 readonly dest: MultiAddress;774 readonly currencyId: PalletForeignAssetsAssetIds;775 readonly keepAlive: bool;776 } & Struct;777 readonly isTransferKeepAlive: boolean;778 readonly asTransferKeepAlive: {779 readonly dest: MultiAddress;780 readonly currencyId: PalletForeignAssetsAssetIds;781 readonly amount: Compact<u128>;782 } & Struct;783 readonly isForceTransfer: boolean;784 readonly asForceTransfer: {785 readonly source: MultiAddress;786 readonly dest: MultiAddress;787 readonly currencyId: PalletForeignAssetsAssetIds;788 readonly amount: Compact<u128>;789 } & Struct;790 readonly isSetBalance: boolean;791 readonly asSetBalance: {792 readonly who: MultiAddress;793 readonly currencyId: PalletForeignAssetsAssetIds;794 readonly newFree: Compact<u128>;795 readonly newReserved: Compact<u128>;796 } & Struct;797 readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance';798}799800/** @name OrmlTokensModuleError */801export interface OrmlTokensModuleError extends Enum {802 readonly isBalanceTooLow: boolean;803 readonly isAmountIntoBalanceFailed: boolean;804 readonly isLiquidityRestrictions: boolean;805 readonly isMaxLocksExceeded: boolean;806 readonly isKeepAlive: boolean;807 readonly isExistentialDeposit: boolean;808 readonly isDeadAccount: boolean;809 readonly isTooManyReserves: boolean;810 readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves';811}812813/** @name OrmlTokensModuleEvent */814export interface OrmlTokensModuleEvent extends Enum {815 readonly isEndowed: boolean;816 readonly asEndowed: {817 readonly currencyId: PalletForeignAssetsAssetIds;818 readonly who: AccountId32;819 readonly amount: u128;820 } & Struct;821 readonly isDustLost: boolean;822 readonly asDustLost: {823 readonly currencyId: PalletForeignAssetsAssetIds;824 readonly who: AccountId32;825 readonly amount: u128;826 } & Struct;827 readonly isTransfer: boolean;828 readonly asTransfer: {829 readonly currencyId: PalletForeignAssetsAssetIds;830 readonly from: AccountId32;831 readonly to: AccountId32;832 readonly amount: u128;833 } & Struct;834 readonly isReserved: boolean;835 readonly asReserved: {836 readonly currencyId: PalletForeignAssetsAssetIds;837 readonly who: AccountId32;838 readonly amount: u128;839 } & Struct;840 readonly isUnreserved: boolean;841 readonly asUnreserved: {842 readonly currencyId: PalletForeignAssetsAssetIds;843 readonly who: AccountId32;844 readonly amount: u128;845 } & Struct;846 readonly isReserveRepatriated: boolean;847 readonly asReserveRepatriated: {848 readonly currencyId: PalletForeignAssetsAssetIds;849 readonly from: AccountId32;850 readonly to: AccountId32;851 readonly amount: u128;852 readonly status: FrameSupportTokensMiscBalanceStatus;853 } & Struct;854 readonly isBalanceSet: boolean;855 readonly asBalanceSet: {856 readonly currencyId: PalletForeignAssetsAssetIds;857 readonly who: AccountId32;858 readonly free: u128;859 readonly reserved: u128;860 } & Struct;861 readonly isTotalIssuanceSet: boolean;862 readonly asTotalIssuanceSet: {863 readonly currencyId: PalletForeignAssetsAssetIds;864 readonly amount: u128;865 } & Struct;866 readonly isWithdrawn: boolean;867 readonly asWithdrawn: {868 readonly currencyId: PalletForeignAssetsAssetIds;869 readonly who: AccountId32;870 readonly amount: u128;871 } & Struct;872 readonly isSlashed: boolean;873 readonly asSlashed: {874 readonly currencyId: PalletForeignAssetsAssetIds;875 readonly who: AccountId32;876 readonly freeAmount: u128;877 readonly reservedAmount: u128;878 } & Struct;879 readonly isDeposited: boolean;880 readonly asDeposited: {881 readonly currencyId: PalletForeignAssetsAssetIds;882 readonly who: AccountId32;883 readonly amount: u128;884 } & Struct;885 readonly isLockSet: boolean;886 readonly asLockSet: {887 readonly lockId: U8aFixed;888 readonly currencyId: PalletForeignAssetsAssetIds;889 readonly who: AccountId32;890 readonly amount: u128;891 } & Struct;892 readonly isLockRemoved: boolean;893 readonly asLockRemoved: {894 readonly lockId: U8aFixed;895 readonly currencyId: PalletForeignAssetsAssetIds;896 readonly who: AccountId32;897 } & Struct;898 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved';899}900901/** @name OrmlTokensReserveData */902export interface OrmlTokensReserveData extends Struct {903 readonly id: Null;904 readonly amount: u128;905}906907/** @name OrmlVestingModuleCall */908export interface OrmlVestingModuleCall extends Enum {909 readonly isClaim: boolean;910 readonly isVestedTransfer: boolean;911 readonly asVestedTransfer: {912 readonly dest: MultiAddress;913 readonly schedule: OrmlVestingVestingSchedule;914 } & Struct;915 readonly isUpdateVestingSchedules: boolean;916 readonly asUpdateVestingSchedules: {917 readonly who: MultiAddress;918 readonly vestingSchedules: Vec<OrmlVestingVestingSchedule>;919 } & Struct;920 readonly isClaimFor: boolean;921 readonly asClaimFor: {922 readonly dest: MultiAddress;923 } & Struct;924 readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor';925}926927/** @name OrmlVestingModuleError */928export interface OrmlVestingModuleError extends Enum {929 readonly isZeroVestingPeriod: boolean;930 readonly isZeroVestingPeriodCount: boolean;931 readonly isInsufficientBalanceToLock: boolean;932 readonly isTooManyVestingSchedules: boolean;933 readonly isAmountLow: boolean;934 readonly isMaxVestingSchedulesExceeded: boolean;935 readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';936}937938/** @name OrmlVestingModuleEvent */939export interface OrmlVestingModuleEvent extends Enum {940 readonly isVestingScheduleAdded: boolean;941 readonly asVestingScheduleAdded: {942 readonly from: AccountId32;943 readonly to: AccountId32;944 readonly vestingSchedule: OrmlVestingVestingSchedule;945 } & Struct;946 readonly isClaimed: boolean;947 readonly asClaimed: {948 readonly who: AccountId32;949 readonly amount: u128;950 } & Struct;951 readonly isVestingSchedulesUpdated: boolean;952 readonly asVestingSchedulesUpdated: {953 readonly who: AccountId32;954 } & Struct;955 readonly type: 'VestingScheduleAdded' | 'Claimed' | 'VestingSchedulesUpdated';956}957958/** @name OrmlVestingVestingSchedule */959export interface OrmlVestingVestingSchedule extends Struct {960 readonly start: u32;961 readonly period: u32;962 readonly periodCount: u32;963 readonly perPeriod: Compact<u128>;964}965966/** @name OrmlXtokensModuleCall */967export interface OrmlXtokensModuleCall extends Enum {968 readonly isTransfer: boolean;969 readonly asTransfer: {970 readonly currencyId: PalletForeignAssetsAssetIds;971 readonly amount: u128;972 readonly dest: XcmVersionedMultiLocation;973 readonly destWeight: u64;974 } & Struct;975 readonly isTransferMultiasset: boolean;976 readonly asTransferMultiasset: {977 readonly asset: XcmVersionedMultiAsset;978 readonly dest: XcmVersionedMultiLocation;979 readonly destWeight: u64;980 } & Struct;981 readonly isTransferWithFee: boolean;982 readonly asTransferWithFee: {983 readonly currencyId: PalletForeignAssetsAssetIds;984 readonly amount: u128;985 readonly fee: u128;986 readonly dest: XcmVersionedMultiLocation;987 readonly destWeight: u64;988 } & Struct;989 readonly isTransferMultiassetWithFee: boolean;990 readonly asTransferMultiassetWithFee: {991 readonly asset: XcmVersionedMultiAsset;992 readonly fee: XcmVersionedMultiAsset;993 readonly dest: XcmVersionedMultiLocation;994 readonly destWeight: u64;995 } & Struct;996 readonly isTransferMulticurrencies: boolean;997 readonly asTransferMulticurrencies: {998 readonly currencies: Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>>;999 readonly feeItem: u32;1000 readonly dest: XcmVersionedMultiLocation;1001 readonly destWeight: u64;1002 } & Struct;1003 readonly isTransferMultiassets: boolean;1004 readonly asTransferMultiassets: {1005 readonly assets: XcmVersionedMultiAssets;1006 readonly feeItem: u32;1007 readonly dest: XcmVersionedMultiLocation;1008 readonly destWeight: u64;1009 } & Struct;1010 readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets';1011}10121013/** @name OrmlXtokensModuleError */1014export interface OrmlXtokensModuleError extends Enum {1015 readonly isAssetHasNoReserve: boolean;1016 readonly isNotCrossChainTransfer: boolean;1017 readonly isInvalidDest: boolean;1018 readonly isNotCrossChainTransferableCurrency: boolean;1019 readonly isUnweighableMessage: boolean;1020 readonly isXcmExecutionFailed: boolean;1021 readonly isCannotReanchor: boolean;1022 readonly isInvalidAncestry: boolean;1023 readonly isInvalidAsset: boolean;1024 readonly isDestinationNotInvertible: boolean;1025 readonly isBadVersion: boolean;1026 readonly isDistinctReserveForAssetAndFee: boolean;1027 readonly isZeroFee: boolean;1028 readonly isZeroAmount: boolean;1029 readonly isTooManyAssetsBeingSent: boolean;1030 readonly isAssetIndexNonExistent: boolean;1031 readonly isFeeNotEnough: boolean;1032 readonly isNotSupportedMultiLocation: boolean;1033 readonly isMinXcmFeeNotDefined: boolean;1034 readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined';1035}10361037/** @name OrmlXtokensModuleEvent */1038export interface OrmlXtokensModuleEvent extends Enum {1039 readonly isTransferredMultiAssets: boolean;1040 readonly asTransferredMultiAssets: {1041 readonly sender: AccountId32;1042 readonly assets: XcmV1MultiassetMultiAssets;1043 readonly fee: XcmV1MultiAsset;1044 readonly dest: XcmV1MultiLocation;1045 } & Struct;1046 readonly type: 'TransferredMultiAssets';1047}10481049/** @name PalletAppPromotionCall */1050export interface PalletAppPromotionCall extends Enum {1051 readonly isSetAdminAddress: boolean;1052 readonly asSetAdminAddress: {1053 readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;1054 } & Struct;1055 readonly isStake: boolean;1056 readonly asStake: {1057 readonly amount: u128;1058 } & Struct;1059 readonly isUnstake: boolean;1060 readonly isSponsorCollection: boolean;1061 readonly asSponsorCollection: {1062 readonly collectionId: u32;1063 } & Struct;1064 readonly isStopSponsoringCollection: boolean;1065 readonly asStopSponsoringCollection: {1066 readonly collectionId: u32;1067 } & Struct;1068 readonly isSponsorContract: boolean;1069 readonly asSponsorContract: {1070 readonly contractId: H160;1071 } & Struct;1072 readonly isStopSponsoringContract: boolean;1073 readonly asStopSponsoringContract: {1074 readonly contractId: H160;1075 } & Struct;1076 readonly isPayoutStakers: boolean;1077 readonly asPayoutStakers: {1078 readonly stakersNumber: Option<u8>;1079 } & Struct;1080 readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers';1081}10821083/** @name PalletAppPromotionError */1084export interface PalletAppPromotionError extends Enum {1085 readonly isAdminNotSet: boolean;1086 readonly isNoPermission: boolean;1087 readonly isNotSufficientFunds: boolean;1088 readonly isPendingForBlockOverflow: boolean;1089 readonly isSponsorNotSet: boolean;1090 readonly isIncorrectLockedBalanceOperation: boolean;1091 readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation';1092}10931094/** @name PalletAppPromotionEvent */1095export interface PalletAppPromotionEvent extends Enum {1096 readonly isStakingRecalculation: boolean;1097 readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>;1098 readonly isStake: boolean;1099 readonly asStake: ITuple<[AccountId32, u128]>;1100 readonly isUnstake: boolean;1101 readonly asUnstake: ITuple<[AccountId32, u128]>;1102 readonly isSetAdmin: boolean;1103 readonly asSetAdmin: AccountId32;1104 readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin';1105}11061107/** @name PalletBalancesAccountData */1108export interface PalletBalancesAccountData extends Struct {1109 readonly free: u128;1110 readonly reserved: u128;1111 readonly miscFrozen: u128;1112 readonly feeFrozen: u128;1113}11141115/** @name PalletBalancesBalanceLock */1116export interface PalletBalancesBalanceLock extends Struct {1117 readonly id: U8aFixed;1118 readonly amount: u128;1119 readonly reasons: PalletBalancesReasons;1120}11211122/** @name PalletBalancesCall */1123export interface PalletBalancesCall extends Enum {1124 readonly isTransfer: boolean;1125 readonly asTransfer: {1126 readonly dest: MultiAddress;1127 readonly value: Compact<u128>;1128 } & Struct;1129 readonly isSetBalance: boolean;1130 readonly asSetBalance: {1131 readonly who: MultiAddress;1132 readonly newFree: Compact<u128>;1133 readonly newReserved: Compact<u128>;1134 } & Struct;1135 readonly isForceTransfer: boolean;1136 readonly asForceTransfer: {1137 readonly source: MultiAddress;1138 readonly dest: MultiAddress;1139 readonly value: Compact<u128>;1140 } & Struct;1141 readonly isTransferKeepAlive: boolean;1142 readonly asTransferKeepAlive: {1143 readonly dest: MultiAddress;1144 readonly value: Compact<u128>;1145 } & Struct;1146 readonly isTransferAll: boolean;1147 readonly asTransferAll: {1148 readonly dest: MultiAddress;1149 readonly keepAlive: bool;1150 } & Struct;1151 readonly isForceUnreserve: boolean;1152 readonly asForceUnreserve: {1153 readonly who: MultiAddress;1154 readonly amount: u128;1155 } & Struct;1156 readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve';1157}11581159/** @name PalletBalancesError */1160export interface PalletBalancesError extends Enum {1161 readonly isVestingBalance: boolean;1162 readonly isLiquidityRestrictions: boolean;1163 readonly isInsufficientBalance: boolean;1164 readonly isExistentialDeposit: boolean;1165 readonly isKeepAlive: boolean;1166 readonly isExistingVestingSchedule: boolean;1167 readonly isDeadAccount: boolean;1168 readonly isTooManyReserves: boolean;1169 readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves';1170}11711172/** @name PalletBalancesEvent */1173export interface PalletBalancesEvent extends Enum {1174 readonly isEndowed: boolean;1175 readonly asEndowed: {1176 readonly account: AccountId32;1177 readonly freeBalance: u128;1178 } & Struct;1179 readonly isDustLost: boolean;1180 readonly asDustLost: {1181 readonly account: AccountId32;1182 readonly amount: u128;1183 } & Struct;1184 readonly isTransfer: boolean;1185 readonly asTransfer: {1186 readonly from: AccountId32;1187 readonly to: AccountId32;1188 readonly amount: u128;1189 } & Struct;1190 readonly isBalanceSet: boolean;1191 readonly asBalanceSet: {1192 readonly who: AccountId32;1193 readonly free: u128;1194 readonly reserved: u128;1195 } & Struct;1196 readonly isReserved: boolean;1197 readonly asReserved: {1198 readonly who: AccountId32;1199 readonly amount: u128;1200 } & Struct;1201 readonly isUnreserved: boolean;1202 readonly asUnreserved: {1203 readonly who: AccountId32;1204 readonly amount: u128;1205 } & Struct;1206 readonly isReserveRepatriated: boolean;1207 readonly asReserveRepatriated: {1208 readonly from: AccountId32;1209 readonly to: AccountId32;1210 readonly amount: u128;1211 readonly destinationStatus: FrameSupportTokensMiscBalanceStatus;1212 } & Struct;1213 readonly isDeposit: boolean;1214 readonly asDeposit: {1215 readonly who: AccountId32;1216 readonly amount: u128;1217 } & Struct;1218 readonly isWithdraw: boolean;1219 readonly asWithdraw: {1220 readonly who: AccountId32;1221 readonly amount: u128;1222 } & Struct;1223 readonly isSlashed: boolean;1224 readonly asSlashed: {1225 readonly who: AccountId32;1226 readonly amount: u128;1227 } & Struct;1228 readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'BalanceSet' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'Deposit' | 'Withdraw' | 'Slashed';1229}12301231/** @name PalletBalancesReasons */1232export interface PalletBalancesReasons extends Enum {1233 readonly isFee: boolean;1234 readonly isMisc: boolean;1235 readonly isAll: boolean;1236 readonly type: 'Fee' | 'Misc' | 'All';1237}12381239/** @name PalletBalancesReleases */1240export interface PalletBalancesReleases extends Enum {1241 readonly isV100: boolean;1242 readonly isV200: boolean;1243 readonly type: 'V100' | 'V200';1244}12451246/** @name PalletBalancesReserveData */1247export interface PalletBalancesReserveData extends Struct {1248 readonly id: U8aFixed;1249 readonly amount: u128;1250}12511252/** @name PalletCommonError */1253export interface PalletCommonError extends Enum {1254 readonly isCollectionNotFound: boolean;1255 readonly isMustBeTokenOwner: boolean;1256 readonly isNoPermission: boolean;1257 readonly isCantDestroyNotEmptyCollection: boolean;1258 readonly isPublicMintingNotAllowed: boolean;1259 readonly isAddressNotInAllowlist: boolean;1260 readonly isCollectionNameLimitExceeded: boolean;1261 readonly isCollectionDescriptionLimitExceeded: boolean;1262 readonly isCollectionTokenPrefixLimitExceeded: boolean;1263 readonly isTotalCollectionsLimitExceeded: boolean;1264 readonly isCollectionAdminCountExceeded: boolean;1265 readonly isCollectionLimitBoundsExceeded: boolean;1266 readonly isOwnerPermissionsCantBeReverted: boolean;1267 readonly isTransferNotAllowed: boolean;1268 readonly isAccountTokenLimitExceeded: boolean;1269 readonly isCollectionTokenLimitExceeded: boolean;1270 readonly isMetadataFlagFrozen: boolean;1271 readonly isTokenNotFound: boolean;1272 readonly isTokenValueTooLow: boolean;1273 readonly isApprovedValueTooLow: boolean;1274 readonly isCantApproveMoreThanOwned: boolean;1275 readonly isAddressIsZero: boolean;1276 readonly isUnsupportedOperation: boolean;1277 readonly isNotSufficientFounds: boolean;1278 readonly isUserIsNotAllowedToNest: boolean;1279 readonly isSourceCollectionIsNotAllowedToNest: boolean;1280 readonly isCollectionFieldSizeExceeded: boolean;1281 readonly isNoSpaceForProperty: boolean;1282 readonly isPropertyLimitReached: boolean;1283 readonly isPropertyKeyIsTooLong: boolean;1284 readonly isInvalidCharacterInPropertyKey: boolean;1285 readonly isEmptyPropertyKey: boolean;1286 readonly isCollectionIsExternal: boolean;1287 readonly isCollectionIsInternal: boolean;1288 readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal';1289}12901291/** @name PalletCommonEvent */1292export interface PalletCommonEvent extends Enum {1293 readonly isCollectionCreated: boolean;1294 readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;1295 readonly isCollectionDestroyed: boolean;1296 readonly asCollectionDestroyed: u32;1297 readonly isItemCreated: boolean;1298 readonly asItemCreated: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1299 readonly isItemDestroyed: boolean;1300 readonly asItemDestroyed: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1301 readonly isTransfer: boolean;1302 readonly asTransfer: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1303 readonly isApproved: boolean;1304 readonly asApproved: ITuple<[u32, u32, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmAccountBasicCrossAccountIdRepr, u128]>;1305 readonly isCollectionPropertySet: boolean;1306 readonly asCollectionPropertySet: ITuple<[u32, Bytes]>;1307 readonly isCollectionPropertyDeleted: boolean;1308 readonly asCollectionPropertyDeleted: ITuple<[u32, Bytes]>;1309 readonly isTokenPropertySet: boolean;1310 readonly asTokenPropertySet: ITuple<[u32, u32, Bytes]>;1311 readonly isTokenPropertyDeleted: boolean;1312 readonly asTokenPropertyDeleted: ITuple<[u32, u32, Bytes]>;1313 readonly isPropertyPermissionSet: boolean;1314 readonly asPropertyPermissionSet: ITuple<[u32, Bytes]>;1315 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';1316}13171318/** @name PalletConfigurationCall */1319export interface PalletConfigurationCall extends Enum {1320 readonly isSetWeightToFeeCoefficientOverride: boolean;1321 readonly asSetWeightToFeeCoefficientOverride: {1322 readonly coeff: Option<u32>;1323 } & Struct;1324 readonly isSetMinGasPriceOverride: boolean;1325 readonly asSetMinGasPriceOverride: {1326 readonly coeff: Option<u64>;1327 } & Struct;1328 readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride';1329}13301331/** @name PalletEthereumCall */1332export interface PalletEthereumCall extends Enum {1333 readonly isTransact: boolean;1334 readonly asTransact: {1335 readonly transaction: EthereumTransactionTransactionV2;1336 } & Struct;1337 readonly type: 'Transact';1338}13391340/** @name PalletEthereumError */1341export interface PalletEthereumError extends Enum {1342 readonly isInvalidSignature: boolean;1343 readonly isPreLogExists: boolean;1344 readonly type: 'InvalidSignature' | 'PreLogExists';1345}13461347/** @name PalletEthereumEvent */1348export interface PalletEthereumEvent extends Enum {1349 readonly isExecuted: boolean;1350 readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;1351 readonly type: 'Executed';1352}13531354/** @name PalletEthereumFakeTransactionFinalizer */1355export interface PalletEthereumFakeTransactionFinalizer extends Null {}13561357/** @name PalletEthereumRawOrigin */1358export interface PalletEthereumRawOrigin extends Enum {1359 readonly isEthereumTransaction: boolean;1360 readonly asEthereumTransaction: H160;1361 readonly type: 'EthereumTransaction';1362}13631364/** @name PalletEvmAccountBasicCrossAccountIdRepr */1365export interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {1366 readonly isSubstrate: boolean;1367 readonly asSubstrate: AccountId32;1368 readonly isEthereum: boolean;1369 readonly asEthereum: H160;1370 readonly type: 'Substrate' | 'Ethereum';1371}13721373/** @name PalletEvmCall */1374export interface PalletEvmCall extends Enum {1375 readonly isWithdraw: boolean;1376 readonly asWithdraw: {1377 readonly address: H160;1378 readonly value: u128;1379 } & Struct;1380 readonly isCall: boolean;1381 readonly asCall: {1382 readonly source: H160;1383 readonly target: H160;1384 readonly input: Bytes;1385 readonly value: U256;1386 readonly gasLimit: u64;1387 readonly maxFeePerGas: U256;1388 readonly maxPriorityFeePerGas: Option<U256>;1389 readonly nonce: Option<U256>;1390 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1391 } & Struct;1392 readonly isCreate: boolean;1393 readonly asCreate: {1394 readonly source: H160;1395 readonly init: Bytes;1396 readonly value: U256;1397 readonly gasLimit: u64;1398 readonly maxFeePerGas: U256;1399 readonly maxPriorityFeePerGas: Option<U256>;1400 readonly nonce: Option<U256>;1401 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1402 } & Struct;1403 readonly isCreate2: boolean;1404 readonly asCreate2: {1405 readonly source: H160;1406 readonly init: Bytes;1407 readonly salt: H256;1408 readonly value: U256;1409 readonly gasLimit: u64;1410 readonly maxFeePerGas: U256;1411 readonly maxPriorityFeePerGas: Option<U256>;1412 readonly nonce: Option<U256>;1413 readonly accessList: Vec<ITuple<[H160, Vec<H256>]>>;1414 } & Struct;1415 readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';1416}14171418/** @name PalletEvmCoderSubstrateError */1419export interface PalletEvmCoderSubstrateError extends Enum {1420 readonly isOutOfGas: boolean;1421 readonly isOutOfFund: boolean;1422 readonly type: 'OutOfGas' | 'OutOfFund';1423}14241425/** @name PalletEvmContractHelpersError */1426export interface PalletEvmContractHelpersError extends Enum {1427 readonly isNoPermission: boolean;1428 readonly isNoPendingSponsor: boolean;1429 readonly isTooManyMethodsHaveSponsoredLimit: boolean;1430 readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit';1431}14321433/** @name PalletEvmContractHelpersEvent */1434export interface PalletEvmContractHelpersEvent extends Enum {1435 readonly isContractSponsorSet: boolean;1436 readonly asContractSponsorSet: ITuple<[H160, AccountId32]>;1437 readonly isContractSponsorshipConfirmed: boolean;1438 readonly asContractSponsorshipConfirmed: ITuple<[H160, AccountId32]>;1439 readonly isContractSponsorRemoved: boolean;1440 readonly asContractSponsorRemoved: H160;1441 readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved';1442}14431444/** @name PalletEvmContractHelpersSponsoringModeT */1445export interface PalletEvmContractHelpersSponsoringModeT extends Enum {1446 readonly isDisabled: boolean;1447 readonly isAllowlisted: boolean;1448 readonly isGenerous: boolean;1449 readonly type: 'Disabled' | 'Allowlisted' | 'Generous';1450}14511452/** @name PalletEvmError */1453export interface PalletEvmError extends Enum {1454 readonly isBalanceLow: boolean;1455 readonly isFeeOverflow: boolean;1456 readonly isPaymentOverflow: boolean;1457 readonly isWithdrawFailed: boolean;1458 readonly isGasPriceTooLow: boolean;1459 readonly isInvalidNonce: boolean;1460 readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';1461}14621463/** @name PalletEvmEvent */1464export interface PalletEvmEvent extends Enum {1465 readonly isLog: boolean;1466 readonly asLog: EthereumLog;1467 readonly isCreated: boolean;1468 readonly asCreated: H160;1469 readonly isCreatedFailed: boolean;1470 readonly asCreatedFailed: H160;1471 readonly isExecuted: boolean;1472 readonly asExecuted: H160;1473 readonly isExecutedFailed: boolean;1474 readonly asExecutedFailed: H160;1475 readonly isBalanceDeposit: boolean;1476 readonly asBalanceDeposit: ITuple<[AccountId32, H160, U256]>;1477 readonly isBalanceWithdraw: boolean;1478 readonly asBalanceWithdraw: ITuple<[AccountId32, H160, U256]>;1479 readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';1480}14811482/** @name PalletEvmMigrationCall */1483export interface PalletEvmMigrationCall extends Enum {1484 readonly isBegin: boolean;1485 readonly asBegin: {1486 readonly address: H160;1487 } & Struct;1488 readonly isSetData: boolean;1489 readonly asSetData: {1490 readonly address: H160;1491 readonly data: Vec<ITuple<[H256, H256]>>;1492 } & Struct;1493 readonly isFinish: boolean;1494 readonly asFinish: {1495 readonly address: H160;1496 readonly code: Bytes;1497 } & Struct;1498 readonly type: 'Begin' | 'SetData' | 'Finish';1499}15001501/** @name PalletEvmMigrationError */1502export interface PalletEvmMigrationError extends Enum {1503 readonly isAccountNotEmpty: boolean;1504 readonly isAccountIsNotMigrating: boolean;1505 readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';1506}15071508/** @name PalletForeignAssetsAssetIds */1509export interface PalletForeignAssetsAssetIds extends Enum {1510 readonly isForeignAssetId: boolean;1511 readonly asForeignAssetId: u32;1512 readonly isNativeAssetId: boolean;1513 readonly asNativeAssetId: PalletForeignAssetsNativeCurrency;1514 readonly type: 'ForeignAssetId' | 'NativeAssetId';1515}15161517/** @name PalletForeignAssetsModuleAssetMetadata */1518export interface PalletForeignAssetsModuleAssetMetadata extends Struct {1519 readonly name: Bytes;1520 readonly symbol: Bytes;1521 readonly decimals: u8;1522 readonly minimalBalance: u128;1523}15241525/** @name PalletForeignAssetsModuleCall */1526export interface PalletForeignAssetsModuleCall extends Enum {1527 readonly isRegisterForeignAsset: boolean;1528 readonly asRegisterForeignAsset: {1529 readonly owner: AccountId32;1530 readonly location: XcmVersionedMultiLocation;1531 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1532 } & Struct;1533 readonly isUpdateForeignAsset: boolean;1534 readonly asUpdateForeignAsset: {1535 readonly foreignAssetId: u32;1536 readonly location: XcmVersionedMultiLocation;1537 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1538 } & Struct;1539 readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset';1540}15411542/** @name PalletForeignAssetsModuleError */1543export interface PalletForeignAssetsModuleError extends Enum {1544 readonly isBadLocation: boolean;1545 readonly isMultiLocationExisted: boolean;1546 readonly isAssetIdNotExists: boolean;1547 readonly isAssetIdExisted: boolean;1548 readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted';1549}15501551/** @name PalletForeignAssetsModuleEvent */1552export interface PalletForeignAssetsModuleEvent extends Enum {1553 readonly isForeignAssetRegistered: boolean;1554 readonly asForeignAssetRegistered: {1555 readonly assetId: u32;1556 readonly assetAddress: XcmV1MultiLocation;1557 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1558 } & Struct;1559 readonly isForeignAssetUpdated: boolean;1560 readonly asForeignAssetUpdated: {1561 readonly assetId: u32;1562 readonly assetAddress: XcmV1MultiLocation;1563 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1564 } & Struct;1565 readonly isAssetRegistered: boolean;1566 readonly asAssetRegistered: {1567 readonly assetId: PalletForeignAssetsAssetIds;1568 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1569 } & Struct;1570 readonly isAssetUpdated: boolean;1571 readonly asAssetUpdated: {1572 readonly assetId: PalletForeignAssetsAssetIds;1573 readonly metadata: PalletForeignAssetsModuleAssetMetadata;1574 } & Struct;1575 readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated';1576}15771578/** @name PalletForeignAssetsNativeCurrency */1579export interface PalletForeignAssetsNativeCurrency extends Enum {1580 readonly isHere: boolean;1581 readonly isParent: boolean;1582 readonly type: 'Here' | 'Parent';1583}15841585/** @name PalletFungibleError */1586export interface PalletFungibleError extends Enum {1587 readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;1588 readonly isFungibleItemsHaveNoId: boolean;1589 readonly isFungibleItemsDontHaveData: boolean;1590 readonly isFungibleDisallowsNesting: boolean;1591 readonly isSettingPropertiesNotAllowed: boolean;1592 readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';1593}15941595/** @name PalletInflationCall */1596export interface PalletInflationCall extends Enum {1597 readonly isStartInflation: boolean;1598 readonly asStartInflation: {1599 readonly inflationStartRelayBlock: u32;1600 } & Struct;1601 readonly type: 'StartInflation';1602}16031604/** @name PalletNonfungibleError */1605export interface PalletNonfungibleError extends Enum {1606 readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;1607 readonly isNonfungibleItemsHaveNoAmount: boolean;1608 readonly isCantBurnNftWithChildren: boolean;1609 readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';1610}16111612/** @name PalletNonfungibleItemData */1613export interface PalletNonfungibleItemData extends Struct {1614 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;1615}16161617/** @name PalletRefungibleError */1618export interface PalletRefungibleError extends Enum {1619 readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;1620 readonly isWrongRefungiblePieces: boolean;1621 readonly isRepartitionWhileNotOwningAllPieces: boolean;1622 readonly isRefungibleDisallowsNesting: boolean;1623 readonly isSettingPropertiesNotAllowed: boolean;1624 readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';1625}16261627/** @name PalletRefungibleItemData */1628export interface PalletRefungibleItemData extends Struct {1629 readonly constData: Bytes;1630}16311632/** @name PalletRmrkCoreCall */1633export interface PalletRmrkCoreCall extends Enum {1634 readonly isCreateCollection: boolean;1635 readonly asCreateCollection: {1636 readonly metadata: Bytes;1637 readonly max: Option<u32>;1638 readonly symbol: Bytes;1639 } & Struct;1640 readonly isDestroyCollection: boolean;1641 readonly asDestroyCollection: {1642 readonly collectionId: u32;1643 } & Struct;1644 readonly isChangeCollectionIssuer: boolean;1645 readonly asChangeCollectionIssuer: {1646 readonly collectionId: u32;1647 readonly newIssuer: MultiAddress;1648 } & Struct;1649 readonly isLockCollection: boolean;1650 readonly asLockCollection: {1651 readonly collectionId: u32;1652 } & Struct;1653 readonly isMintNft: boolean;1654 readonly asMintNft: {1655 readonly owner: Option<AccountId32>;1656 readonly collectionId: u32;1657 readonly recipient: Option<AccountId32>;1658 readonly royaltyAmount: Option<Permill>;1659 readonly metadata: Bytes;1660 readonly transferable: bool;1661 readonly resources: Option<Vec<RmrkTraitsResourceResourceTypes>>;1662 } & Struct;1663 readonly isBurnNft: boolean;1664 readonly asBurnNft: {1665 readonly collectionId: u32;1666 readonly nftId: u32;1667 readonly maxBurns: u32;1668 } & Struct;1669 readonly isSend: boolean;1670 readonly asSend: {1671 readonly rmrkCollectionId: u32;1672 readonly rmrkNftId: u32;1673 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;1674 } & Struct;1675 readonly isAcceptNft: boolean;1676 readonly asAcceptNft: {1677 readonly rmrkCollectionId: u32;1678 readonly rmrkNftId: u32;1679 readonly newOwner: RmrkTraitsNftAccountIdOrCollectionNftTuple;1680 } & Struct;1681 readonly isRejectNft: boolean;1682 readonly asRejectNft: {1683 readonly rmrkCollectionId: u32;1684 readonly rmrkNftId: u32;1685 } & Struct;1686 readonly isAcceptResource: boolean;1687 readonly asAcceptResource: {1688 readonly rmrkCollectionId: u32;1689 readonly rmrkNftId: u32;1690 readonly resourceId: u32;1691 } & Struct;1692 readonly isAcceptResourceRemoval: boolean;1693 readonly asAcceptResourceRemoval: {1694 readonly rmrkCollectionId: u32;1695 readonly rmrkNftId: u32;1696 readonly resourceId: u32;1697 } & Struct;1698 readonly isSetProperty: boolean;1699 readonly asSetProperty: {1700 readonly rmrkCollectionId: Compact<u32>;1701 readonly maybeNftId: Option<u32>;1702 readonly key: Bytes;1703 readonly value: Bytes;1704 } & Struct;1705 readonly isSetPriority: boolean;1706 readonly asSetPriority: {1707 readonly rmrkCollectionId: u32;1708 readonly rmrkNftId: u32;1709 readonly priorities: Vec<u32>;1710 } & Struct;1711 readonly isAddBasicResource: boolean;1712 readonly asAddBasicResource: {1713 readonly rmrkCollectionId: u32;1714 readonly nftId: u32;1715 readonly resource: RmrkTraitsResourceBasicResource;1716 } & Struct;1717 readonly isAddComposableResource: boolean;1718 readonly asAddComposableResource: {1719 readonly rmrkCollectionId: u32;1720 readonly nftId: u32;1721 readonly resource: RmrkTraitsResourceComposableResource;1722 } & Struct;1723 readonly isAddSlotResource: boolean;1724 readonly asAddSlotResource: {1725 readonly rmrkCollectionId: u32;1726 readonly nftId: u32;1727 readonly resource: RmrkTraitsResourceSlotResource;1728 } & Struct;1729 readonly isRemoveResource: boolean;1730 readonly asRemoveResource: {1731 readonly rmrkCollectionId: u32;1732 readonly nftId: u32;1733 readonly resourceId: u32;1734 } & Struct;1735 readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';1736}17371738/** @name PalletRmrkCoreError */1739export interface PalletRmrkCoreError extends Enum {1740 readonly isCorruptedCollectionType: boolean;1741 readonly isRmrkPropertyKeyIsTooLong: boolean;1742 readonly isRmrkPropertyValueIsTooLong: boolean;1743 readonly isRmrkPropertyIsNotFound: boolean;1744 readonly isUnableToDecodeRmrkData: boolean;1745 readonly isCollectionNotEmpty: boolean;1746 readonly isNoAvailableCollectionId: boolean;1747 readonly isNoAvailableNftId: boolean;1748 readonly isCollectionUnknown: boolean;1749 readonly isNoPermission: boolean;1750 readonly isNonTransferable: boolean;1751 readonly isCollectionFullOrLocked: boolean;1752 readonly isResourceDoesntExist: boolean;1753 readonly isCannotSendToDescendentOrSelf: boolean;1754 readonly isCannotAcceptNonOwnedNft: boolean;1755 readonly isCannotRejectNonOwnedNft: boolean;1756 readonly isCannotRejectNonPendingNft: boolean;1757 readonly isResourceNotPending: boolean;1758 readonly isNoAvailableResourceId: boolean;1759 readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';1760}17611762/** @name PalletRmrkCoreEvent */1763export interface PalletRmrkCoreEvent extends Enum {1764 readonly isCollectionCreated: boolean;1765 readonly asCollectionCreated: {1766 readonly issuer: AccountId32;1767 readonly collectionId: u32;1768 } & Struct;1769 readonly isCollectionDestroyed: boolean;1770 readonly asCollectionDestroyed: {1771 readonly issuer: AccountId32;1772 readonly collectionId: u32;1773 } & Struct;1774 readonly isIssuerChanged: boolean;1775 readonly asIssuerChanged: {1776 readonly oldIssuer: AccountId32;1777 readonly newIssuer: AccountId32;1778 readonly collectionId: u32;1779 } & Struct;1780 readonly isCollectionLocked: boolean;1781 readonly asCollectionLocked: {1782 readonly issuer: AccountId32;1783 readonly collectionId: u32;1784 } & Struct;1785 readonly isNftMinted: boolean;1786 readonly asNftMinted: {1787 readonly owner: AccountId32;1788 readonly collectionId: u32;1789 readonly nftId: u32;1790 } & Struct;1791 readonly isNftBurned: boolean;1792 readonly asNftBurned: {1793 readonly owner: AccountId32;1794 readonly nftId: u32;1795 } & Struct;1796 readonly isNftSent: boolean;1797 readonly asNftSent: {1798 readonly sender: AccountId32;1799 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1800 readonly collectionId: u32;1801 readonly nftId: u32;1802 readonly approvalRequired: bool;1803 } & Struct;1804 readonly isNftAccepted: boolean;1805 readonly asNftAccepted: {1806 readonly sender: AccountId32;1807 readonly recipient: RmrkTraitsNftAccountIdOrCollectionNftTuple;1808 readonly collectionId: u32;1809 readonly nftId: u32;1810 } & Struct;1811 readonly isNftRejected: boolean;1812 readonly asNftRejected: {1813 readonly sender: AccountId32;1814 readonly collectionId: u32;1815 readonly nftId: u32;1816 } & Struct;1817 readonly isPropertySet: boolean;1818 readonly asPropertySet: {1819 readonly collectionId: u32;1820 readonly maybeNftId: Option<u32>;1821 readonly key: Bytes;1822 readonly value: Bytes;1823 } & Struct;1824 readonly isResourceAdded: boolean;1825 readonly asResourceAdded: {1826 readonly nftId: u32;1827 readonly resourceId: u32;1828 } & Struct;1829 readonly isResourceRemoval: boolean;1830 readonly asResourceRemoval: {1831 readonly nftId: u32;1832 readonly resourceId: u32;1833 } & Struct;1834 readonly isResourceAccepted: boolean;1835 readonly asResourceAccepted: {1836 readonly nftId: u32;1837 readonly resourceId: u32;1838 } & Struct;1839 readonly isResourceRemovalAccepted: boolean;1840 readonly asResourceRemovalAccepted: {1841 readonly nftId: u32;1842 readonly resourceId: u32;1843 } & Struct;1844 readonly isPrioritySet: boolean;1845 readonly asPrioritySet: {1846 readonly collectionId: u32;1847 readonly nftId: u32;1848 } & Struct;1849 readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';1850}18511852/** @name PalletRmrkEquipCall */1853export interface PalletRmrkEquipCall extends Enum {1854 readonly isCreateBase: boolean;1855 readonly asCreateBase: {1856 readonly baseType: Bytes;1857 readonly symbol: Bytes;1858 readonly parts: Vec<RmrkTraitsPartPartType>;1859 } & Struct;1860 readonly isThemeAdd: boolean;1861 readonly asThemeAdd: {1862 readonly baseId: u32;1863 readonly theme: RmrkTraitsTheme;1864 } & Struct;1865 readonly isEquippable: boolean;1866 readonly asEquippable: {1867 readonly baseId: u32;1868 readonly slotId: u32;1869 readonly equippables: RmrkTraitsPartEquippableList;1870 } & Struct;1871 readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';1872}18731874/** @name PalletRmrkEquipError */1875export interface PalletRmrkEquipError extends Enum {1876 readonly isPermissionError: boolean;1877 readonly isNoAvailableBaseId: boolean;1878 readonly isNoAvailablePartId: boolean;1879 readonly isBaseDoesntExist: boolean;1880 readonly isNeedsDefaultThemeFirst: boolean;1881 readonly isPartDoesntExist: boolean;1882 readonly isNoEquippableOnFixedPart: boolean;1883 readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';1884}18851886/** @name PalletRmrkEquipEvent */1887export interface PalletRmrkEquipEvent extends Enum {1888 readonly isBaseCreated: boolean;1889 readonly asBaseCreated: {1890 readonly issuer: AccountId32;1891 readonly baseId: u32;1892 } & Struct;1893 readonly isEquippablesUpdated: boolean;1894 readonly asEquippablesUpdated: {1895 readonly baseId: u32;1896 readonly slotId: u32;1897 } & Struct;1898 readonly type: 'BaseCreated' | 'EquippablesUpdated';1899}19001901/** @name PalletStructureCall */1902export interface PalletStructureCall extends Null {}19031904/** @name PalletStructureError */1905export interface PalletStructureError extends Enum {1906 readonly isOuroborosDetected: boolean;1907 readonly isDepthLimit: boolean;1908 readonly isBreadthLimit: boolean;1909 readonly isTokenNotFound: boolean;1910 readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';1911}19121913/** @name PalletStructureEvent */1914export interface PalletStructureEvent extends Enum {1915 readonly isExecuted: boolean;1916 readonly asExecuted: Result<Null, SpRuntimeDispatchError>;1917 readonly type: 'Executed';1918}19191920/** @name PalletSudoCall */1921export interface PalletSudoCall extends Enum {1922 readonly isSudo: boolean;1923 readonly asSudo: {1924 readonly call: Call;1925 } & Struct;1926 readonly isSudoUncheckedWeight: boolean;1927 readonly asSudoUncheckedWeight: {1928 readonly call: Call;1929 readonly weight: u64;1930 } & Struct;1931 readonly isSetKey: boolean;1932 readonly asSetKey: {1933 readonly new_: MultiAddress;1934 } & Struct;1935 readonly isSudoAs: boolean;1936 readonly asSudoAs: {1937 readonly who: MultiAddress;1938 readonly call: Call;1939 } & Struct;1940 readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs';1941}19421943/** @name PalletSudoError */1944export interface PalletSudoError extends Enum {1945 readonly isRequireSudo: boolean;1946 readonly type: 'RequireSudo';1947}19481949/** @name PalletSudoEvent */1950export interface PalletSudoEvent extends Enum {1951 readonly isSudid: boolean;1952 readonly asSudid: {1953 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;1954 } & Struct;1955 readonly isKeyChanged: boolean;1956 readonly asKeyChanged: {1957 readonly oldSudoer: Option<AccountId32>;1958 } & Struct;1959 readonly isSudoAsDone: boolean;1960 readonly asSudoAsDone: {1961 readonly sudoResult: Result<Null, SpRuntimeDispatchError>;1962 } & Struct;1963 readonly type: 'Sudid' | 'KeyChanged' | 'SudoAsDone';1964}19651966/** @name PalletTemplateTransactionPaymentCall */1967export interface PalletTemplateTransactionPaymentCall extends Null {}19681969/** @name PalletTemplateTransactionPaymentChargeTransactionPayment */1970export interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}19711972/** @name PalletTimestampCall */1973export interface PalletTimestampCall extends Enum {1974 readonly isSet: boolean;1975 readonly asSet: {1976 readonly now: Compact<u64>;1977 } & Struct;1978 readonly type: 'Set';1979}19801981/** @name PalletTransactionPaymentEvent */1982export interface PalletTransactionPaymentEvent extends Enum {1983 readonly isTransactionFeePaid: boolean;1984 readonly asTransactionFeePaid: {1985 readonly who: AccountId32;1986 readonly actualFee: u128;1987 readonly tip: u128;1988 } & Struct;1989 readonly type: 'TransactionFeePaid';1990}19911992/** @name PalletTransactionPaymentReleases */1993export interface PalletTransactionPaymentReleases extends Enum {1994 readonly isV1Ancient: boolean;1995 readonly isV2: boolean;1996 readonly type: 'V1Ancient' | 'V2';1997}19981999/** @name PalletTreasuryCall */2000export interface PalletTreasuryCall extends Enum {2001 readonly isProposeSpend: boolean;2002 readonly asProposeSpend: {2003 readonly value: Compact<u128>;2004 readonly beneficiary: MultiAddress;2005 } & Struct;2006 readonly isRejectProposal: boolean;2007 readonly asRejectProposal: {2008 readonly proposalId: Compact<u32>;2009 } & Struct;2010 readonly isApproveProposal: boolean;2011 readonly asApproveProposal: {2012 readonly proposalId: Compact<u32>;2013 } & Struct;2014 readonly isSpend: boolean;2015 readonly asSpend: {2016 readonly amount: Compact<u128>;2017 readonly beneficiary: MultiAddress;2018 } & Struct;2019 readonly isRemoveApproval: boolean;2020 readonly asRemoveApproval: {2021 readonly proposalId: Compact<u32>;2022 } & Struct;2023 readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval';2024}20252026/** @name PalletTreasuryError */2027export interface PalletTreasuryError extends Enum {2028 readonly isInsufficientProposersBalance: boolean;2029 readonly isInvalidIndex: boolean;2030 readonly isTooManyApprovals: boolean;2031 readonly isInsufficientPermission: boolean;2032 readonly isProposalNotApproved: boolean;2033 readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved';2034}20352036/** @name PalletTreasuryEvent */2037export interface PalletTreasuryEvent extends Enum {2038 readonly isProposed: boolean;2039 readonly asProposed: {2040 readonly proposalIndex: u32;2041 } & Struct;2042 readonly isSpending: boolean;2043 readonly asSpending: {2044 readonly budgetRemaining: u128;2045 } & Struct;2046 readonly isAwarded: boolean;2047 readonly asAwarded: {2048 readonly proposalIndex: u32;2049 readonly award: u128;2050 readonly account: AccountId32;2051 } & Struct;2052 readonly isRejected: boolean;2053 readonly asRejected: {2054 readonly proposalIndex: u32;2055 readonly slashed: u128;2056 } & Struct;2057 readonly isBurnt: boolean;2058 readonly asBurnt: {2059 readonly burntFunds: u128;2060 } & Struct;2061 readonly isRollover: boolean;2062 readonly asRollover: {2063 readonly rolloverBalance: u128;2064 } & Struct;2065 readonly isDeposit: boolean;2066 readonly asDeposit: {2067 readonly value: u128;2068 } & Struct;2069 readonly isSpendApproved: boolean;2070 readonly asSpendApproved: {2071 readonly proposalIndex: u32;2072 readonly amount: u128;2073 readonly beneficiary: AccountId32;2074 } & Struct;2075 readonly type: 'Proposed' | 'Spending' | 'Awarded' | 'Rejected' | 'Burnt' | 'Rollover' | 'Deposit' | 'SpendApproved';2076}20772078/** @name PalletTreasuryProposal */2079export interface PalletTreasuryProposal extends Struct {2080 readonly proposer: AccountId32;2081 readonly value: u128;2082 readonly beneficiary: AccountId32;2083 readonly bond: u128;2084}20852086/** @name PalletUniqueCall */2087export interface PalletUniqueCall extends Enum {2088 readonly isCreateCollection: boolean;2089 readonly asCreateCollection: {2090 readonly collectionName: Vec<u16>;2091 readonly collectionDescription: Vec<u16>;2092 readonly tokenPrefix: Bytes;2093 readonly mode: UpDataStructsCollectionMode;2094 } & Struct;2095 readonly isCreateCollectionEx: boolean;2096 readonly asCreateCollectionEx: {2097 readonly data: UpDataStructsCreateCollectionData;2098 } & Struct;2099 readonly isDestroyCollection: boolean;2100 readonly asDestroyCollection: {2101 readonly collectionId: u32;2102 } & Struct;2103 readonly isAddToAllowList: boolean;2104 readonly asAddToAllowList: {2105 readonly collectionId: u32;2106 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2107 } & Struct;2108 readonly isRemoveFromAllowList: boolean;2109 readonly asRemoveFromAllowList: {2110 readonly collectionId: u32;2111 readonly address: PalletEvmAccountBasicCrossAccountIdRepr;2112 } & Struct;2113 readonly isChangeCollectionOwner: boolean;2114 readonly asChangeCollectionOwner: {2115 readonly collectionId: u32;2116 readonly newOwner: AccountId32;2117 } & Struct;2118 readonly isAddCollectionAdmin: boolean;2119 readonly asAddCollectionAdmin: {2120 readonly collectionId: u32;2121 readonly newAdminId: PalletEvmAccountBasicCrossAccountIdRepr;2122 } & Struct;2123 readonly isRemoveCollectionAdmin: boolean;2124 readonly asRemoveCollectionAdmin: {2125 readonly collectionId: u32;2126 readonly accountId: PalletEvmAccountBasicCrossAccountIdRepr;2127 } & Struct;2128 readonly isSetCollectionSponsor: boolean;2129 readonly asSetCollectionSponsor: {2130 readonly collectionId: u32;2131 readonly newSponsor: AccountId32;2132 } & Struct;2133 readonly isConfirmSponsorship: boolean;2134 readonly asConfirmSponsorship: {2135 readonly collectionId: u32;2136 } & Struct;2137 readonly isRemoveCollectionSponsor: boolean;2138 readonly asRemoveCollectionSponsor: {2139 readonly collectionId: u32;2140 } & Struct;2141 readonly isCreateItem: boolean;2142 readonly asCreateItem: {2143 readonly collectionId: u32;2144 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2145 readonly data: UpDataStructsCreateItemData;2146 } & Struct;2147 readonly isCreateMultipleItems: boolean;2148 readonly asCreateMultipleItems: {2149 readonly collectionId: u32;2150 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2151 readonly itemsData: Vec<UpDataStructsCreateItemData>;2152 } & Struct;2153 readonly isSetCollectionProperties: boolean;2154 readonly asSetCollectionProperties: {2155 readonly collectionId: u32;2156 readonly properties: Vec<UpDataStructsProperty>;2157 } & Struct;2158 readonly isDeleteCollectionProperties: boolean;2159 readonly asDeleteCollectionProperties: {2160 readonly collectionId: u32;2161 readonly propertyKeys: Vec<Bytes>;2162 } & Struct;2163 readonly isSetTokenProperties: boolean;2164 readonly asSetTokenProperties: {2165 readonly collectionId: u32;2166 readonly tokenId: u32;2167 readonly properties: Vec<UpDataStructsProperty>;2168 } & Struct;2169 readonly isDeleteTokenProperties: boolean;2170 readonly asDeleteTokenProperties: {2171 readonly collectionId: u32;2172 readonly tokenId: u32;2173 readonly propertyKeys: Vec<Bytes>;2174 } & Struct;2175 readonly isSetTokenPropertyPermissions: boolean;2176 readonly asSetTokenPropertyPermissions: {2177 readonly collectionId: u32;2178 readonly propertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2179 } & Struct;2180 readonly isCreateMultipleItemsEx: boolean;2181 readonly asCreateMultipleItemsEx: {2182 readonly collectionId: u32;2183 readonly data: UpDataStructsCreateItemExData;2184 } & Struct;2185 readonly isSetTransfersEnabledFlag: boolean;2186 readonly asSetTransfersEnabledFlag: {2187 readonly collectionId: u32;2188 readonly value: bool;2189 } & Struct;2190 readonly isBurnItem: boolean;2191 readonly asBurnItem: {2192 readonly collectionId: u32;2193 readonly itemId: u32;2194 readonly value: u128;2195 } & Struct;2196 readonly isBurnFrom: boolean;2197 readonly asBurnFrom: {2198 readonly collectionId: u32;2199 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2200 readonly itemId: u32;2201 readonly value: u128;2202 } & Struct;2203 readonly isTransfer: boolean;2204 readonly asTransfer: {2205 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2206 readonly collectionId: u32;2207 readonly itemId: u32;2208 readonly value: u128;2209 } & Struct;2210 readonly isApprove: boolean;2211 readonly asApprove: {2212 readonly spender: PalletEvmAccountBasicCrossAccountIdRepr;2213 readonly collectionId: u32;2214 readonly itemId: u32;2215 readonly amount: u128;2216 } & Struct;2217 readonly isTransferFrom: boolean;2218 readonly asTransferFrom: {2219 readonly from: PalletEvmAccountBasicCrossAccountIdRepr;2220 readonly recipient: PalletEvmAccountBasicCrossAccountIdRepr;2221 readonly collectionId: u32;2222 readonly itemId: u32;2223 readonly value: u128;2224 } & Struct;2225 readonly isSetCollectionLimits: boolean;2226 readonly asSetCollectionLimits: {2227 readonly collectionId: u32;2228 readonly newLimit: UpDataStructsCollectionLimits;2229 } & Struct;2230 readonly isSetCollectionPermissions: boolean;2231 readonly asSetCollectionPermissions: {2232 readonly collectionId: u32;2233 readonly newPermission: UpDataStructsCollectionPermissions;2234 } & Struct;2235 readonly isRepartition: boolean;2236 readonly asRepartition: {2237 readonly collectionId: u32;2238 readonly tokenId: u32;2239 readonly amount: u128;2240 } & Struct;2241 readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';2242}22432244/** @name PalletUniqueError */2245export interface PalletUniqueError extends Enum {2246 readonly isCollectionDecimalPointLimitExceeded: boolean;2247 readonly isConfirmUnsetSponsorFail: boolean;2248 readonly isEmptyArgument: boolean;2249 readonly isRepartitionCalledOnNonRefungibleCollection: boolean;2250 readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';2251}22522253/** @name PalletUniqueRawEvent */2254export interface PalletUniqueRawEvent extends Enum {2255 readonly isCollectionSponsorRemoved: boolean;2256 readonly asCollectionSponsorRemoved: u32;2257 readonly isCollectionAdminAdded: boolean;2258 readonly asCollectionAdminAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;2259 readonly isCollectionOwnedChanged: boolean;2260 readonly asCollectionOwnedChanged: ITuple<[u32, AccountId32]>;2261 readonly isCollectionSponsorSet: boolean;2262 readonly asCollectionSponsorSet: ITuple<[u32, AccountId32]>;2263 readonly isSponsorshipConfirmed: boolean;2264 readonly asSponsorshipConfirmed: ITuple<[u32, AccountId32]>;2265 readonly isCollectionAdminRemoved: boolean;2266 readonly asCollectionAdminRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;2267 readonly isAllowListAddressRemoved: boolean;2268 readonly asAllowListAddressRemoved: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;2269 readonly isAllowListAddressAdded: boolean;2270 readonly asAllowListAddressAdded: ITuple<[u32, PalletEvmAccountBasicCrossAccountIdRepr]>;2271 readonly isCollectionLimitSet: boolean;2272 readonly asCollectionLimitSet: u32;2273 readonly isCollectionPermissionSet: boolean;2274 readonly asCollectionPermissionSet: u32;2275 readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';2276}22772278/** @name PalletUniqueSchedulerCall */2279export interface PalletUniqueSchedulerCall extends Enum {2280 readonly isScheduleNamed: boolean;2281 readonly asScheduleNamed: {2282 readonly id: U8aFixed;2283 readonly when: u32;2284 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2285 readonly priority: u8;2286 readonly call: FrameSupportScheduleMaybeHashed;2287 } & Struct;2288 readonly isCancelNamed: boolean;2289 readonly asCancelNamed: {2290 readonly id: U8aFixed;2291 } & Struct;2292 readonly isScheduleNamedAfter: boolean;2293 readonly asScheduleNamedAfter: {2294 readonly id: U8aFixed;2295 readonly after: u32;2296 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2297 readonly priority: u8;2298 readonly call: FrameSupportScheduleMaybeHashed;2299 } & Struct;2300 readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';2301}23022303/** @name PalletUniqueSchedulerError */2304export interface PalletUniqueSchedulerError extends Enum {2305 readonly isFailedToSchedule: boolean;2306 readonly isNotFound: boolean;2307 readonly isTargetBlockNumberInPast: boolean;2308 readonly isRescheduleNoChange: boolean;2309 readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';2310}23112312/** @name PalletUniqueSchedulerEvent */2313export interface PalletUniqueSchedulerEvent extends Enum {2314 readonly isScheduled: boolean;2315 readonly asScheduled: {2316 readonly when: u32;2317 readonly index: u32;2318 } & Struct;2319 readonly isCanceled: boolean;2320 readonly asCanceled: {2321 readonly when: u32;2322 readonly index: u32;2323 } & Struct;2324 readonly isDispatched: boolean;2325 readonly asDispatched: {2326 readonly task: ITuple<[u32, u32]>;2327 readonly id: Option<U8aFixed>;2328 readonly result: Result<Null, SpRuntimeDispatchError>;2329 } & Struct;2330 readonly isCallLookupFailed: boolean;2331 readonly asCallLookupFailed: {2332 readonly task: ITuple<[u32, u32]>;2333 readonly id: Option<U8aFixed>;2334 readonly error: FrameSupportScheduleLookupError;2335 } & Struct;2336 readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed';2337}23382339/** @name PalletUniqueSchedulerScheduledV3 */2340export interface PalletUniqueSchedulerScheduledV3 extends Struct {2341 readonly maybeId: Option<U8aFixed>;2342 readonly priority: u8;2343 readonly call: FrameSupportScheduleMaybeHashed;2344 readonly maybePeriodic: Option<ITuple<[u32, u32]>>;2345 readonly origin: OpalRuntimeOriginCaller;2346}23472348/** @name PalletXcmCall */2349export interface PalletXcmCall extends Enum {2350 readonly isSend: boolean;2351 readonly asSend: {2352 readonly dest: XcmVersionedMultiLocation;2353 readonly message: XcmVersionedXcm;2354 } & Struct;2355 readonly isTeleportAssets: boolean;2356 readonly asTeleportAssets: {2357 readonly dest: XcmVersionedMultiLocation;2358 readonly beneficiary: XcmVersionedMultiLocation;2359 readonly assets: XcmVersionedMultiAssets;2360 readonly feeAssetItem: u32;2361 } & Struct;2362 readonly isReserveTransferAssets: boolean;2363 readonly asReserveTransferAssets: {2364 readonly dest: XcmVersionedMultiLocation;2365 readonly beneficiary: XcmVersionedMultiLocation;2366 readonly assets: XcmVersionedMultiAssets;2367 readonly feeAssetItem: u32;2368 } & Struct;2369 readonly isExecute: boolean;2370 readonly asExecute: {2371 readonly message: XcmVersionedXcm;2372 readonly maxWeight: u64;2373 } & Struct;2374 readonly isForceXcmVersion: boolean;2375 readonly asForceXcmVersion: {2376 readonly location: XcmV1MultiLocation;2377 readonly xcmVersion: u32;2378 } & Struct;2379 readonly isForceDefaultXcmVersion: boolean;2380 readonly asForceDefaultXcmVersion: {2381 readonly maybeXcmVersion: Option<u32>;2382 } & Struct;2383 readonly isForceSubscribeVersionNotify: boolean;2384 readonly asForceSubscribeVersionNotify: {2385 readonly location: XcmVersionedMultiLocation;2386 } & Struct;2387 readonly isForceUnsubscribeVersionNotify: boolean;2388 readonly asForceUnsubscribeVersionNotify: {2389 readonly location: XcmVersionedMultiLocation;2390 } & Struct;2391 readonly isLimitedReserveTransferAssets: boolean;2392 readonly asLimitedReserveTransferAssets: {2393 readonly dest: XcmVersionedMultiLocation;2394 readonly beneficiary: XcmVersionedMultiLocation;2395 readonly assets: XcmVersionedMultiAssets;2396 readonly feeAssetItem: u32;2397 readonly weightLimit: XcmV2WeightLimit;2398 } & Struct;2399 readonly isLimitedTeleportAssets: boolean;2400 readonly asLimitedTeleportAssets: {2401 readonly dest: XcmVersionedMultiLocation;2402 readonly beneficiary: XcmVersionedMultiLocation;2403 readonly assets: XcmVersionedMultiAssets;2404 readonly feeAssetItem: u32;2405 readonly weightLimit: XcmV2WeightLimit;2406 } & Struct;2407 readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';2408}24092410/** @name PalletXcmError */2411export interface PalletXcmError extends Enum {2412 readonly isUnreachable: boolean;2413 readonly isSendFailure: boolean;2414 readonly isFiltered: boolean;2415 readonly isUnweighableMessage: boolean;2416 readonly isDestinationNotInvertible: boolean;2417 readonly isEmpty: boolean;2418 readonly isCannotReanchor: boolean;2419 readonly isTooManyAssets: boolean;2420 readonly isInvalidOrigin: boolean;2421 readonly isBadVersion: boolean;2422 readonly isBadLocation: boolean;2423 readonly isNoSubscription: boolean;2424 readonly isAlreadySubscribed: boolean;2425 readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';2426}24272428/** @name PalletXcmEvent */2429export interface PalletXcmEvent extends Enum {2430 readonly isAttempted: boolean;2431 readonly asAttempted: XcmV2TraitsOutcome;2432 readonly isSent: boolean;2433 readonly asSent: ITuple<[XcmV1MultiLocation, XcmV1MultiLocation, XcmV2Xcm]>;2434 readonly isUnexpectedResponse: boolean;2435 readonly asUnexpectedResponse: ITuple<[XcmV1MultiLocation, u64]>;2436 readonly isResponseReady: boolean;2437 readonly asResponseReady: ITuple<[u64, XcmV2Response]>;2438 readonly isNotified: boolean;2439 readonly asNotified: ITuple<[u64, u8, u8]>;2440 readonly isNotifyOverweight: boolean;2441 readonly asNotifyOverweight: ITuple<[u64, u8, u8, u64, u64]>;2442 readonly isNotifyDispatchError: boolean;2443 readonly asNotifyDispatchError: ITuple<[u64, u8, u8]>;2444 readonly isNotifyDecodeFailed: boolean;2445 readonly asNotifyDecodeFailed: ITuple<[u64, u8, u8]>;2446 readonly isInvalidResponder: boolean;2447 readonly asInvalidResponder: ITuple<[XcmV1MultiLocation, u64, Option<XcmV1MultiLocation>]>;2448 readonly isInvalidResponderVersion: boolean;2449 readonly asInvalidResponderVersion: ITuple<[XcmV1MultiLocation, u64]>;2450 readonly isResponseTaken: boolean;2451 readonly asResponseTaken: u64;2452 readonly isAssetsTrapped: boolean;2453 readonly asAssetsTrapped: ITuple<[H256, XcmV1MultiLocation, XcmVersionedMultiAssets]>;2454 readonly isVersionChangeNotified: boolean;2455 readonly asVersionChangeNotified: ITuple<[XcmV1MultiLocation, u32]>;2456 readonly isSupportedVersionChanged: boolean;2457 readonly asSupportedVersionChanged: ITuple<[XcmV1MultiLocation, u32]>;2458 readonly isNotifyTargetSendFail: boolean;2459 readonly asNotifyTargetSendFail: ITuple<[XcmV1MultiLocation, u64, XcmV2TraitsError]>;2460 readonly isNotifyTargetMigrationFail: boolean;2461 readonly asNotifyTargetMigrationFail: ITuple<[XcmVersionedMultiLocation, u64]>;2462 readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';2463}24642465/** @name PalletXcmOrigin */2466export interface PalletXcmOrigin extends Enum {2467 readonly isXcm: boolean;2468 readonly asXcm: XcmV1MultiLocation;2469 readonly isResponse: boolean;2470 readonly asResponse: XcmV1MultiLocation;2471 readonly type: 'Xcm' | 'Response';2472}24732474/** @name PhantomTypeUpDataStructs */2475export interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}24762477/** @name PolkadotCorePrimitivesInboundDownwardMessage */2478export interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {2479 readonly sentAt: u32;2480 readonly msg: Bytes;2481}24822483/** @name PolkadotCorePrimitivesInboundHrmpMessage */2484export interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {2485 readonly sentAt: u32;2486 readonly data: Bytes;2487}24882489/** @name PolkadotCorePrimitivesOutboundHrmpMessage */2490export interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {2491 readonly recipient: u32;2492 readonly data: Bytes;2493}24942495/** @name PolkadotParachainPrimitivesXcmpMessageFormat */2496export interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {2497 readonly isConcatenatedVersionedXcm: boolean;2498 readonly isConcatenatedEncodedBlob: boolean;2499 readonly isSignals: boolean;2500 readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';2501}25022503/** @name PolkadotPrimitivesV2AbridgedHostConfiguration */2504export interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct {2505 readonly maxCodeSize: u32;2506 readonly maxHeadDataSize: u32;2507 readonly maxUpwardQueueCount: u32;2508 readonly maxUpwardQueueSize: u32;2509 readonly maxUpwardMessageSize: u32;2510 readonly maxUpwardMessageNumPerCandidate: u32;2511 readonly hrmpMaxMessageNumPerCandidate: u32;2512 readonly validationUpgradeCooldown: u32;2513 readonly validationUpgradeDelay: u32;2514}25152516/** @name PolkadotPrimitivesV2AbridgedHrmpChannel */2517export interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct {2518 readonly maxCapacity: u32;2519 readonly maxTotalSize: u32;2520 readonly maxMessageSize: u32;2521 readonly msgCount: u32;2522 readonly totalSize: u32;2523 readonly mqcHead: Option<H256>;2524}25252526/** @name PolkadotPrimitivesV2PersistedValidationData */2527export interface PolkadotPrimitivesV2PersistedValidationData extends Struct {2528 readonly parentHead: Bytes;2529 readonly relayParentNumber: u32;2530 readonly relayParentStorageRoot: H256;2531 readonly maxPovSize: u32;2532}25332534/** @name PolkadotPrimitivesV2UpgradeRestriction */2535export interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {2536 readonly isPresent: boolean;2537 readonly type: 'Present';2538}25392540/** @name RmrkTraitsBaseBaseInfo */2541export interface RmrkTraitsBaseBaseInfo extends Struct {2542 readonly issuer: AccountId32;2543 readonly baseType: Bytes;2544 readonly symbol: Bytes;2545}25462547/** @name RmrkTraitsCollectionCollectionInfo */2548export interface RmrkTraitsCollectionCollectionInfo extends Struct {2549 readonly issuer: AccountId32;2550 readonly metadata: Bytes;2551 readonly max: Option<u32>;2552 readonly symbol: Bytes;2553 readonly nftsCount: u32;2554}25552556/** @name RmrkTraitsNftAccountIdOrCollectionNftTuple */2557export interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {2558 readonly isAccountId: boolean;2559 readonly asAccountId: AccountId32;2560 readonly isCollectionAndNftTuple: boolean;2561 readonly asCollectionAndNftTuple: ITuple<[u32, u32]>;2562 readonly type: 'AccountId' | 'CollectionAndNftTuple';2563}25642565/** @name RmrkTraitsNftNftChild */2566export interface RmrkTraitsNftNftChild extends Struct {2567 readonly collectionId: u32;2568 readonly nftId: u32;2569}25702571/** @name RmrkTraitsNftNftInfo */2572export interface RmrkTraitsNftNftInfo extends Struct {2573 readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;2574 readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;2575 readonly metadata: Bytes;2576 readonly equipped: bool;2577 readonly pending: bool;2578}25792580/** @name RmrkTraitsNftRoyaltyInfo */2581export interface RmrkTraitsNftRoyaltyInfo extends Struct {2582 readonly recipient: AccountId32;2583 readonly amount: Permill;2584}25852586/** @name RmrkTraitsPartEquippableList */2587export interface RmrkTraitsPartEquippableList extends Enum {2588 readonly isAll: boolean;2589 readonly isEmpty: boolean;2590 readonly isCustom: boolean;2591 readonly asCustom: Vec<u32>;2592 readonly type: 'All' | 'Empty' | 'Custom';2593}25942595/** @name RmrkTraitsPartFixedPart */2596export interface RmrkTraitsPartFixedPart extends Struct {2597 readonly id: u32;2598 readonly z: u32;2599 readonly src: Bytes;2600}26012602/** @name RmrkTraitsPartPartType */2603export interface RmrkTraitsPartPartType extends Enum {2604 readonly isFixedPart: boolean;2605 readonly asFixedPart: RmrkTraitsPartFixedPart;2606 readonly isSlotPart: boolean;2607 readonly asSlotPart: RmrkTraitsPartSlotPart;2608 readonly type: 'FixedPart' | 'SlotPart';2609}26102611/** @name RmrkTraitsPartSlotPart */2612export interface RmrkTraitsPartSlotPart extends Struct {2613 readonly id: u32;2614 readonly equippable: RmrkTraitsPartEquippableList;2615 readonly src: Bytes;2616 readonly z: u32;2617}26182619/** @name RmrkTraitsPropertyPropertyInfo */2620export interface RmrkTraitsPropertyPropertyInfo extends Struct {2621 readonly key: Bytes;2622 readonly value: Bytes;2623}26242625/** @name RmrkTraitsResourceBasicResource */2626export interface RmrkTraitsResourceBasicResource extends Struct {2627 readonly src: Option<Bytes>;2628 readonly metadata: Option<Bytes>;2629 readonly license: Option<Bytes>;2630 readonly thumb: Option<Bytes>;2631}26322633/** @name RmrkTraitsResourceComposableResource */2634export interface RmrkTraitsResourceComposableResource extends Struct {2635 readonly parts: Vec<u32>;2636 readonly base: u32;2637 readonly src: Option<Bytes>;2638 readonly metadata: Option<Bytes>;2639 readonly license: Option<Bytes>;2640 readonly thumb: Option<Bytes>;2641}26422643/** @name RmrkTraitsResourceResourceInfo */2644export interface RmrkTraitsResourceResourceInfo extends Struct {2645 readonly id: u32;2646 readonly resource: RmrkTraitsResourceResourceTypes;2647 readonly pending: bool;2648 readonly pendingRemoval: bool;2649}26502651/** @name RmrkTraitsResourceResourceTypes */2652export interface RmrkTraitsResourceResourceTypes extends Enum {2653 readonly isBasic: boolean;2654 readonly asBasic: RmrkTraitsResourceBasicResource;2655 readonly isComposable: boolean;2656 readonly asComposable: RmrkTraitsResourceComposableResource;2657 readonly isSlot: boolean;2658 readonly asSlot: RmrkTraitsResourceSlotResource;2659 readonly type: 'Basic' | 'Composable' | 'Slot';2660}26612662/** @name RmrkTraitsResourceSlotResource */2663export interface RmrkTraitsResourceSlotResource extends Struct {2664 readonly base: u32;2665 readonly src: Option<Bytes>;2666 readonly metadata: Option<Bytes>;2667 readonly slot: u32;2668 readonly license: Option<Bytes>;2669 readonly thumb: Option<Bytes>;2670}26712672/** @name RmrkTraitsTheme */2673export interface RmrkTraitsTheme extends Struct {2674 readonly name: Bytes;2675 readonly properties: Vec<RmrkTraitsThemeThemeProperty>;2676 readonly inherit: bool;2677}26782679/** @name RmrkTraitsThemeThemeProperty */2680export interface RmrkTraitsThemeThemeProperty extends Struct {2681 readonly key: Bytes;2682 readonly value: Bytes;2683}26842685/** @name SpCoreEcdsaSignature */2686export interface SpCoreEcdsaSignature extends U8aFixed {}26872688/** @name SpCoreEd25519Signature */2689export interface SpCoreEd25519Signature extends U8aFixed {}26902691/** @name SpCoreSr25519Signature */2692export interface SpCoreSr25519Signature extends U8aFixed {}26932694/** @name SpCoreVoid */2695export interface SpCoreVoid extends Null {}26962697/** @name SpRuntimeArithmeticError */2698export interface SpRuntimeArithmeticError extends Enum {2699 readonly isUnderflow: boolean;2700 readonly isOverflow: boolean;2701 readonly isDivisionByZero: boolean;2702 readonly type: 'Underflow' | 'Overflow' | 'DivisionByZero';2703}27042705/** @name SpRuntimeDigest */2706export interface SpRuntimeDigest extends Struct {2707 readonly logs: Vec<SpRuntimeDigestDigestItem>;2708}27092710/** @name SpRuntimeDigestDigestItem */2711export interface SpRuntimeDigestDigestItem extends Enum {2712 readonly isOther: boolean;2713 readonly asOther: Bytes;2714 readonly isConsensus: boolean;2715 readonly asConsensus: ITuple<[U8aFixed, Bytes]>;2716 readonly isSeal: boolean;2717 readonly asSeal: ITuple<[U8aFixed, Bytes]>;2718 readonly isPreRuntime: boolean;2719 readonly asPreRuntime: ITuple<[U8aFixed, Bytes]>;2720 readonly isRuntimeEnvironmentUpdated: boolean;2721 readonly type: 'Other' | 'Consensus' | 'Seal' | 'PreRuntime' | 'RuntimeEnvironmentUpdated';2722}27232724/** @name SpRuntimeDispatchError */2725export interface SpRuntimeDispatchError extends Enum {2726 readonly isOther: boolean;2727 readonly isCannotLookup: boolean;2728 readonly isBadOrigin: boolean;2729 readonly isModule: boolean;2730 readonly asModule: SpRuntimeModuleError;2731 readonly isConsumerRemaining: boolean;2732 readonly isNoProviders: boolean;2733 readonly isTooManyConsumers: boolean;2734 readonly isToken: boolean;2735 readonly asToken: SpRuntimeTokenError;2736 readonly isArithmetic: boolean;2737 readonly asArithmetic: SpRuntimeArithmeticError;2738 readonly isTransactional: boolean;2739 readonly asTransactional: SpRuntimeTransactionalError;2740 readonly type: 'Other' | 'CannotLookup' | 'BadOrigin' | 'Module' | 'ConsumerRemaining' | 'NoProviders' | 'TooManyConsumers' | 'Token' | 'Arithmetic' | 'Transactional';2741}27422743/** @name SpRuntimeModuleError */2744export interface SpRuntimeModuleError extends Struct {2745 readonly index: u8;2746 readonly error: U8aFixed;2747}27482749/** @name SpRuntimeMultiSignature */2750export interface SpRuntimeMultiSignature extends Enum {2751 readonly isEd25519: boolean;2752 readonly asEd25519: SpCoreEd25519Signature;2753 readonly isSr25519: boolean;2754 readonly asSr25519: SpCoreSr25519Signature;2755 readonly isEcdsa: boolean;2756 readonly asEcdsa: SpCoreEcdsaSignature;2757 readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';2758}27592760/** @name SpRuntimeTokenError */2761export interface SpRuntimeTokenError extends Enum {2762 readonly isNoFunds: boolean;2763 readonly isWouldDie: boolean;2764 readonly isBelowMinimum: boolean;2765 readonly isCannotCreate: boolean;2766 readonly isUnknownAsset: boolean;2767 readonly isFrozen: boolean;2768 readonly isUnsupported: boolean;2769 readonly type: 'NoFunds' | 'WouldDie' | 'BelowMinimum' | 'CannotCreate' | 'UnknownAsset' | 'Frozen' | 'Unsupported';2770}27712772/** @name SpRuntimeTransactionalError */2773export interface SpRuntimeTransactionalError extends Enum {2774 readonly isLimitReached: boolean;2775 readonly isNoLayer: boolean;2776 readonly type: 'LimitReached' | 'NoLayer';2777}27782779/** @name SpTrieStorageProof */2780export interface SpTrieStorageProof extends Struct {2781 readonly trieNodes: BTreeSet<Bytes>;2782}27832784/** @name SpVersionRuntimeVersion */2785export interface SpVersionRuntimeVersion extends Struct {2786 readonly specName: Text;2787 readonly implName: Text;2788 readonly authoringVersion: u32;2789 readonly specVersion: u32;2790 readonly implVersion: u32;2791 readonly apis: Vec<ITuple<[U8aFixed, u32]>>;2792 readonly transactionVersion: u32;2793 readonly stateVersion: u8;2794}27952796/** @name UpDataStructsAccessMode */2797export interface UpDataStructsAccessMode extends Enum {2798 readonly isNormal: boolean;2799 readonly isAllowList: boolean;2800 readonly type: 'Normal' | 'AllowList';2801}28022803/** @name UpDataStructsCollection */2804export interface UpDataStructsCollection extends Struct {2805 readonly owner: AccountId32;2806 readonly mode: UpDataStructsCollectionMode;2807 readonly name: Vec<u16>;2808 readonly description: Vec<u16>;2809 readonly tokenPrefix: Bytes;2810 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;2811 readonly limits: UpDataStructsCollectionLimits;2812 readonly permissions: UpDataStructsCollectionPermissions;2813 readonly flags: U8aFixed;2814}28152816/** @name UpDataStructsCollectionLimits */2817export interface UpDataStructsCollectionLimits extends Struct {2818 readonly accountTokenOwnershipLimit: Option<u32>;2819 readonly sponsoredDataSize: Option<u32>;2820 readonly sponsoredDataRateLimit: Option<UpDataStructsSponsoringRateLimit>;2821 readonly tokenLimit: Option<u32>;2822 readonly sponsorTransferTimeout: Option<u32>;2823 readonly sponsorApproveTimeout: Option<u32>;2824 readonly ownerCanTransfer: Option<bool>;2825 readonly ownerCanDestroy: Option<bool>;2826 readonly transfersEnabled: Option<bool>;2827}28282829/** @name UpDataStructsCollectionMode */2830export interface UpDataStructsCollectionMode extends Enum {2831 readonly isNft: boolean;2832 readonly isFungible: boolean;2833 readonly asFungible: u8;2834 readonly isReFungible: boolean;2835 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2836}28372838/** @name UpDataStructsCollectionPermissions */2839export interface UpDataStructsCollectionPermissions extends Struct {2840 readonly access: Option<UpDataStructsAccessMode>;2841 readonly mintMode: Option<bool>;2842 readonly nesting: Option<UpDataStructsNestingPermissions>;2843}28442845/** @name UpDataStructsCollectionStats */2846export interface UpDataStructsCollectionStats extends Struct {2847 readonly created: u32;2848 readonly destroyed: u32;2849 readonly alive: u32;2850}28512852/** @name UpDataStructsCreateCollectionData */2853export interface UpDataStructsCreateCollectionData extends Struct {2854 readonly mode: UpDataStructsCollectionMode;2855 readonly access: Option<UpDataStructsAccessMode>;2856 readonly name: Vec<u16>;2857 readonly description: Vec<u16>;2858 readonly tokenPrefix: Bytes;2859 readonly pendingSponsor: Option<AccountId32>;2860 readonly limits: Option<UpDataStructsCollectionLimits>;2861 readonly permissions: Option<UpDataStructsCollectionPermissions>;2862 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2863 readonly properties: Vec<UpDataStructsProperty>;2864}28652866/** @name UpDataStructsCreateFungibleData */2867export interface UpDataStructsCreateFungibleData extends Struct {2868 readonly value: u128;2869}28702871/** @name UpDataStructsCreateItemData */2872export interface UpDataStructsCreateItemData extends Enum {2873 readonly isNft: boolean;2874 readonly asNft: UpDataStructsCreateNftData;2875 readonly isFungible: boolean;2876 readonly asFungible: UpDataStructsCreateFungibleData;2877 readonly isReFungible: boolean;2878 readonly asReFungible: UpDataStructsCreateReFungibleData;2879 readonly type: 'Nft' | 'Fungible' | 'ReFungible';2880}28812882/** @name UpDataStructsCreateItemExData */2883export interface UpDataStructsCreateItemExData extends Enum {2884 readonly isNft: boolean;2885 readonly asNft: Vec<UpDataStructsCreateNftExData>;2886 readonly isFungible: boolean;2887 readonly asFungible: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr,u128>;2888 readonly isRefungibleMultipleItems: boolean;2889 readonly asRefungibleMultipleItems: Vec<UpDataStructsCreateRefungibleExSingleOwner>;2890 readonly isRefungibleMultipleOwners: boolean;2891 readonly asRefungibleMultipleOwners: UpDataStructsCreateRefungibleExMultipleOwners;2892 readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';2893}28942895/** @name UpDataStructsCreateNftData */2896export interface UpDataStructsCreateNftData extends Struct {2897 readonly properties: Vec<UpDataStructsProperty>;2898}28992900/** @name UpDataStructsCreateNftExData */2901export interface UpDataStructsCreateNftExData extends Struct {2902 readonly properties: Vec<UpDataStructsProperty>;2903 readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;2904}29052906/** @name UpDataStructsCreateReFungibleData */2907export interface UpDataStructsCreateReFungibleData extends Struct {2908 readonly pieces: u128;2909 readonly properties: Vec<UpDataStructsProperty>;2910}29112912/** @name UpDataStructsCreateRefungibleExMultipleOwners */2913export interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {2914 readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;2915 readonly properties: Vec<UpDataStructsProperty>;2916}29172918/** @name UpDataStructsCreateRefungibleExSingleOwner */2919export interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {2920 readonly user: PalletEvmAccountBasicCrossAccountIdRepr;2921 readonly pieces: u128;2922 readonly properties: Vec<UpDataStructsProperty>;2923}29242925/** @name UpDataStructsNestingPermissions */2926export interface UpDataStructsNestingPermissions extends Struct {2927 readonly tokenOwner: bool;2928 readonly collectionAdmin: bool;2929 readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;2930}29312932/** @name UpDataStructsOwnerRestrictedSet */2933export interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}29342935/** @name UpDataStructsProperties */2936export interface UpDataStructsProperties extends Struct {2937 readonly map: UpDataStructsPropertiesMapBoundedVec;2938 readonly consumedSpace: u32;2939 readonly spaceLimit: u32;2940}29412942/** @name UpDataStructsPropertiesMapBoundedVec */2943export interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}29442945/** @name UpDataStructsPropertiesMapPropertyPermission */2946export interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}29472948/** @name UpDataStructsProperty */2949export interface UpDataStructsProperty extends Struct {2950 readonly key: Bytes;2951 readonly value: Bytes;2952}29532954/** @name UpDataStructsPropertyKeyPermission */2955export interface UpDataStructsPropertyKeyPermission extends Struct {2956 readonly key: Bytes;2957 readonly permission: UpDataStructsPropertyPermission;2958}29592960/** @name UpDataStructsPropertyPermission */2961export interface UpDataStructsPropertyPermission extends Struct {2962 readonly mutable: bool;2963 readonly collectionAdmin: bool;2964 readonly tokenOwner: bool;2965}29662967/** @name UpDataStructsPropertyScope */2968export interface UpDataStructsPropertyScope extends Enum {2969 readonly isNone: boolean;2970 readonly isRmrk: boolean;2971 readonly type: 'None' | 'Rmrk';2972}29732974/** @name UpDataStructsRpcCollection */2975export interface UpDataStructsRpcCollection extends Struct {2976 readonly owner: AccountId32;2977 readonly mode: UpDataStructsCollectionMode;2978 readonly name: Vec<u16>;2979 readonly description: Vec<u16>;2980 readonly tokenPrefix: Bytes;2981 readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;2982 readonly limits: UpDataStructsCollectionLimits;2983 readonly permissions: UpDataStructsCollectionPermissions;2984 readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;2985 readonly properties: Vec<UpDataStructsProperty>;2986 readonly readOnly: bool;2987 readonly foreign: bool;2988}29892990/** @name UpDataStructsSponsoringRateLimit */2991export interface UpDataStructsSponsoringRateLimit extends Enum {2992 readonly isSponsoringDisabled: boolean;2993 readonly isBlocks: boolean;2994 readonly asBlocks: u32;2995 readonly type: 'SponsoringDisabled' | 'Blocks';2996}29972998/** @name UpDataStructsSponsorshipStateAccountId32 */2999export interface UpDataStructsSponsorshipStateAccountId32 extends Enum {3000 readonly isDisabled: boolean;3001 readonly isUnconfirmed: boolean;3002 readonly asUnconfirmed: AccountId32;3003 readonly isConfirmed: boolean;3004 readonly asConfirmed: AccountId32;3005 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3006}30073008/** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr */3009export interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {3010 readonly isDisabled: boolean;3011 readonly isUnconfirmed: boolean;3012 readonly asUnconfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3013 readonly isConfirmed: boolean;3014 readonly asConfirmed: PalletEvmAccountBasicCrossAccountIdRepr;3015 readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';3016}30173018/** @name UpDataStructsTokenChild */3019export interface UpDataStructsTokenChild extends Struct {3020 readonly token: u32;3021 readonly collection: u32;3022}30233024/** @name UpDataStructsTokenData */3025export interface UpDataStructsTokenData extends Struct {3026 readonly properties: Vec<UpDataStructsProperty>;3027 readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;3028 readonly pieces: u128;3029}30303031/** @name XcmDoubleEncoded */3032export interface XcmDoubleEncoded extends Struct {3033 readonly encoded: Bytes;3034}30353036/** @name XcmV0Junction */3037export interface XcmV0Junction extends Enum {3038 readonly isParent: boolean;3039 readonly isParachain: boolean;3040 readonly asParachain: Compact<u32>;3041 readonly isAccountId32: boolean;3042 readonly asAccountId32: {3043 readonly network: XcmV0JunctionNetworkId;3044 readonly id: U8aFixed;3045 } & Struct;3046 readonly isAccountIndex64: boolean;3047 readonly asAccountIndex64: {3048 readonly network: XcmV0JunctionNetworkId;3049 readonly index: Compact<u64>;3050 } & Struct;3051 readonly isAccountKey20: boolean;3052 readonly asAccountKey20: {3053 readonly network: XcmV0JunctionNetworkId;3054 readonly key: U8aFixed;3055 } & Struct;3056 readonly isPalletInstance: boolean;3057 readonly asPalletInstance: u8;3058 readonly isGeneralIndex: boolean;3059 readonly asGeneralIndex: Compact<u128>;3060 readonly isGeneralKey: boolean;3061 readonly asGeneralKey: Bytes;3062 readonly isOnlyChild: boolean;3063 readonly isPlurality: boolean;3064 readonly asPlurality: {3065 readonly id: XcmV0JunctionBodyId;3066 readonly part: XcmV0JunctionBodyPart;3067 } & Struct;3068 readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';3069}30703071/** @name XcmV0JunctionBodyId */3072export interface XcmV0JunctionBodyId extends Enum {3073 readonly isUnit: boolean;3074 readonly isNamed: boolean;3075 readonly asNamed: Bytes;3076 readonly isIndex: boolean;3077 readonly asIndex: Compact<u32>;3078 readonly isExecutive: boolean;3079 readonly isTechnical: boolean;3080 readonly isLegislative: boolean;3081 readonly isJudicial: boolean;3082 readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial';3083}30843085/** @name XcmV0JunctionBodyPart */3086export interface XcmV0JunctionBodyPart extends Enum {3087 readonly isVoice: boolean;3088 readonly isMembers: boolean;3089 readonly asMembers: {3090 readonly count: Compact<u32>;3091 } & Struct;3092 readonly isFraction: boolean;3093 readonly asFraction: {3094 readonly nom: Compact<u32>;3095 readonly denom: Compact<u32>;3096 } & Struct;3097 readonly isAtLeastProportion: boolean;3098 readonly asAtLeastProportion: {3099 readonly nom: Compact<u32>;3100 readonly denom: Compact<u32>;3101 } & Struct;3102 readonly isMoreThanProportion: boolean;3103 readonly asMoreThanProportion: {3104 readonly nom: Compact<u32>;3105 readonly denom: Compact<u32>;3106 } & Struct;3107 readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';3108}31093110/** @name XcmV0JunctionNetworkId */3111export interface XcmV0JunctionNetworkId extends Enum {3112 readonly isAny: boolean;3113 readonly isNamed: boolean;3114 readonly asNamed: Bytes;3115 readonly isPolkadot: boolean;3116 readonly isKusama: boolean;3117 readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';3118}31193120/** @name XcmV0MultiAsset */3121export interface XcmV0MultiAsset extends Enum {3122 readonly isNone: boolean;3123 readonly isAll: boolean;3124 readonly isAllFungible: boolean;3125 readonly isAllNonFungible: boolean;3126 readonly isAllAbstractFungible: boolean;3127 readonly asAllAbstractFungible: {3128 readonly id: Bytes;3129 } & Struct;3130 readonly isAllAbstractNonFungible: boolean;3131 readonly asAllAbstractNonFungible: {3132 readonly class: Bytes;3133 } & Struct;3134 readonly isAllConcreteFungible: boolean;3135 readonly asAllConcreteFungible: {3136 readonly id: XcmV0MultiLocation;3137 } & Struct;3138 readonly isAllConcreteNonFungible: boolean;3139 readonly asAllConcreteNonFungible: {3140 readonly class: XcmV0MultiLocation;3141 } & Struct;3142 readonly isAbstractFungible: boolean;3143 readonly asAbstractFungible: {3144 readonly id: Bytes;3145 readonly amount: Compact<u128>;3146 } & Struct;3147 readonly isAbstractNonFungible: boolean;3148 readonly asAbstractNonFungible: {3149 readonly class: Bytes;3150 readonly instance: XcmV1MultiassetAssetInstance;3151 } & Struct;3152 readonly isConcreteFungible: boolean;3153 readonly asConcreteFungible: {3154 readonly id: XcmV0MultiLocation;3155 readonly amount: Compact<u128>;3156 } & Struct;3157 readonly isConcreteNonFungible: boolean;3158 readonly asConcreteNonFungible: {3159 readonly class: XcmV0MultiLocation;3160 readonly instance: XcmV1MultiassetAssetInstance;3161 } & Struct;3162 readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible';3163}31643165/** @name XcmV0MultiLocation */3166export interface XcmV0MultiLocation extends Enum {3167 readonly isNull: boolean;3168 readonly isX1: boolean;3169 readonly asX1: XcmV0Junction;3170 readonly isX2: boolean;3171 readonly asX2: ITuple<[XcmV0Junction, XcmV0Junction]>;3172 readonly isX3: boolean;3173 readonly asX3: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction]>;3174 readonly isX4: boolean;3175 readonly asX4: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;3176 readonly isX5: boolean;3177 readonly asX5: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;3178 readonly isX6: boolean;3179 readonly asX6: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;3180 readonly isX7: boolean;3181 readonly asX7: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;3182 readonly isX8: boolean;3183 readonly asX8: ITuple<[XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction, XcmV0Junction]>;3184 readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';3185}31863187/** @name XcmV0Order */3188export interface XcmV0Order extends Enum {3189 readonly isNull: boolean;3190 readonly isDepositAsset: boolean;3191 readonly asDepositAsset: {3192 readonly assets: Vec<XcmV0MultiAsset>;3193 readonly dest: XcmV0MultiLocation;3194 } & Struct;3195 readonly isDepositReserveAsset: boolean;3196 readonly asDepositReserveAsset: {3197 readonly assets: Vec<XcmV0MultiAsset>;3198 readonly dest: XcmV0MultiLocation;3199 readonly effects: Vec<XcmV0Order>;3200 } & Struct;3201 readonly isExchangeAsset: boolean;3202 readonly asExchangeAsset: {3203 readonly give: Vec<XcmV0MultiAsset>;3204 readonly receive: Vec<XcmV0MultiAsset>;3205 } & Struct;3206 readonly isInitiateReserveWithdraw: boolean;3207 readonly asInitiateReserveWithdraw: {3208 readonly assets: Vec<XcmV0MultiAsset>;3209 readonly reserve: XcmV0MultiLocation;3210 readonly effects: Vec<XcmV0Order>;3211 } & Struct;3212 readonly isInitiateTeleport: boolean;3213 readonly asInitiateTeleport: {3214 readonly assets: Vec<XcmV0MultiAsset>;3215 readonly dest: XcmV0MultiLocation;3216 readonly effects: Vec<XcmV0Order>;3217 } & Struct;3218 readonly isQueryHolding: boolean;3219 readonly asQueryHolding: {3220 readonly queryId: Compact<u64>;3221 readonly dest: XcmV0MultiLocation;3222 readonly assets: Vec<XcmV0MultiAsset>;3223 } & Struct;3224 readonly isBuyExecution: boolean;3225 readonly asBuyExecution: {3226 readonly fees: XcmV0MultiAsset;3227 readonly weight: u64;3228 readonly debt: u64;3229 readonly haltOnError: bool;3230 readonly xcm: Vec<XcmV0Xcm>;3231 } & Struct;3232 readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';3233}32343235/** @name XcmV0OriginKind */3236export interface XcmV0OriginKind extends Enum {3237 readonly isNative: boolean;3238 readonly isSovereignAccount: boolean;3239 readonly isSuperuser: boolean;3240 readonly isXcm: boolean;3241 readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';3242}32433244/** @name XcmV0Response */3245export interface XcmV0Response extends Enum {3246 readonly isAssets: boolean;3247 readonly asAssets: Vec<XcmV0MultiAsset>;3248 readonly type: 'Assets';3249}32503251/** @name XcmV0Xcm */3252export interface XcmV0Xcm extends Enum {3253 readonly isWithdrawAsset: boolean;3254 readonly asWithdrawAsset: {3255 readonly assets: Vec<XcmV0MultiAsset>;3256 readonly effects: Vec<XcmV0Order>;3257 } & Struct;3258 readonly isReserveAssetDeposit: boolean;3259 readonly asReserveAssetDeposit: {3260 readonly assets: Vec<XcmV0MultiAsset>;3261 readonly effects: Vec<XcmV0Order>;3262 } & Struct;3263 readonly isTeleportAsset: boolean;3264 readonly asTeleportAsset: {3265 readonly assets: Vec<XcmV0MultiAsset>;3266 readonly effects: Vec<XcmV0Order>;3267 } & Struct;3268 readonly isQueryResponse: boolean;3269 readonly asQueryResponse: {3270 readonly queryId: Compact<u64>;3271 readonly response: XcmV0Response;3272 } & Struct;3273 readonly isTransferAsset: boolean;3274 readonly asTransferAsset: {3275 readonly assets: Vec<XcmV0MultiAsset>;3276 readonly dest: XcmV0MultiLocation;3277 } & Struct;3278 readonly isTransferReserveAsset: boolean;3279 readonly asTransferReserveAsset: {3280 readonly assets: Vec<XcmV0MultiAsset>;3281 readonly dest: XcmV0MultiLocation;3282 readonly effects: Vec<XcmV0Order>;3283 } & Struct;3284 readonly isTransact: boolean;3285 readonly asTransact: {3286 readonly originType: XcmV0OriginKind;3287 readonly requireWeightAtMost: u64;3288 readonly call: XcmDoubleEncoded;3289 } & Struct;3290 readonly isHrmpNewChannelOpenRequest: boolean;3291 readonly asHrmpNewChannelOpenRequest: {3292 readonly sender: Compact<u32>;3293 readonly maxMessageSize: Compact<u32>;3294 readonly maxCapacity: Compact<u32>;3295 } & Struct;3296 readonly isHrmpChannelAccepted: boolean;3297 readonly asHrmpChannelAccepted: {3298 readonly recipient: Compact<u32>;3299 } & Struct;3300 readonly isHrmpChannelClosing: boolean;3301 readonly asHrmpChannelClosing: {3302 readonly initiator: Compact<u32>;3303 readonly sender: Compact<u32>;3304 readonly recipient: Compact<u32>;3305 } & Struct;3306 readonly isRelayedFrom: boolean;3307 readonly asRelayedFrom: {3308 readonly who: XcmV0MultiLocation;3309 readonly message: XcmV0Xcm;3310 } & Struct;3311 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom';3312}33133314/** @name XcmV1Junction */3315export interface XcmV1Junction extends Enum {3316 readonly isParachain: boolean;3317 readonly asParachain: Compact<u32>;3318 readonly isAccountId32: boolean;3319 readonly asAccountId32: {3320 readonly network: XcmV0JunctionNetworkId;3321 readonly id: U8aFixed;3322 } & Struct;3323 readonly isAccountIndex64: boolean;3324 readonly asAccountIndex64: {3325 readonly network: XcmV0JunctionNetworkId;3326 readonly index: Compact<u64>;3327 } & Struct;3328 readonly isAccountKey20: boolean;3329 readonly asAccountKey20: {3330 readonly network: XcmV0JunctionNetworkId;3331 readonly key: U8aFixed;3332 } & Struct;3333 readonly isPalletInstance: boolean;3334 readonly asPalletInstance: u8;3335 readonly isGeneralIndex: boolean;3336 readonly asGeneralIndex: Compact<u128>;3337 readonly isGeneralKey: boolean;3338 readonly asGeneralKey: Bytes;3339 readonly isOnlyChild: boolean;3340 readonly isPlurality: boolean;3341 readonly asPlurality: {3342 readonly id: XcmV0JunctionBodyId;3343 readonly part: XcmV0JunctionBodyPart;3344 } & Struct;3345 readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';3346}33473348/** @name XcmV1MultiAsset */3349export interface XcmV1MultiAsset extends Struct {3350 readonly id: XcmV1MultiassetAssetId;3351 readonly fun: XcmV1MultiassetFungibility;3352}33533354/** @name XcmV1MultiassetAssetId */3355export interface XcmV1MultiassetAssetId extends Enum {3356 readonly isConcrete: boolean;3357 readonly asConcrete: XcmV1MultiLocation;3358 readonly isAbstract: boolean;3359 readonly asAbstract: Bytes;3360 readonly type: 'Concrete' | 'Abstract';3361}33623363/** @name XcmV1MultiassetAssetInstance */3364export interface XcmV1MultiassetAssetInstance extends Enum {3365 readonly isUndefined: boolean;3366 readonly isIndex: boolean;3367 readonly asIndex: Compact<u128>;3368 readonly isArray4: boolean;3369 readonly asArray4: U8aFixed;3370 readonly isArray8: boolean;3371 readonly asArray8: U8aFixed;3372 readonly isArray16: boolean;3373 readonly asArray16: U8aFixed;3374 readonly isArray32: boolean;3375 readonly asArray32: U8aFixed;3376 readonly isBlob: boolean;3377 readonly asBlob: Bytes;3378 readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';3379}33803381/** @name XcmV1MultiassetFungibility */3382export interface XcmV1MultiassetFungibility extends Enum {3383 readonly isFungible: boolean;3384 readonly asFungible: Compact<u128>;3385 readonly isNonFungible: boolean;3386 readonly asNonFungible: XcmV1MultiassetAssetInstance;3387 readonly type: 'Fungible' | 'NonFungible';3388}33893390/** @name XcmV1MultiassetMultiAssetFilter */3391export interface XcmV1MultiassetMultiAssetFilter extends Enum {3392 readonly isDefinite: boolean;3393 readonly asDefinite: XcmV1MultiassetMultiAssets;3394 readonly isWild: boolean;3395 readonly asWild: XcmV1MultiassetWildMultiAsset;3396 readonly type: 'Definite' | 'Wild';3397}33983399/** @name XcmV1MultiassetMultiAssets */3400export interface XcmV1MultiassetMultiAssets extends Vec<XcmV1MultiAsset> {}34013402/** @name XcmV1MultiassetWildFungibility */3403export interface XcmV1MultiassetWildFungibility extends Enum {3404 readonly isFungible: boolean;3405 readonly isNonFungible: boolean;3406 readonly type: 'Fungible' | 'NonFungible';3407}34083409/** @name XcmV1MultiassetWildMultiAsset */3410export interface XcmV1MultiassetWildMultiAsset extends Enum {3411 readonly isAll: boolean;3412 readonly isAllOf: boolean;3413 readonly asAllOf: {3414 readonly id: XcmV1MultiassetAssetId;3415 readonly fun: XcmV1MultiassetWildFungibility;3416 } & Struct;3417 readonly type: 'All' | 'AllOf';3418}34193420/** @name XcmV1MultiLocation */3421export interface XcmV1MultiLocation extends Struct {3422 readonly parents: u8;3423 readonly interior: XcmV1MultilocationJunctions;3424}34253426/** @name XcmV1MultilocationJunctions */3427export interface XcmV1MultilocationJunctions extends Enum {3428 readonly isHere: boolean;3429 readonly isX1: boolean;3430 readonly asX1: XcmV1Junction;3431 readonly isX2: boolean;3432 readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>;3433 readonly isX3: boolean;3434 readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3435 readonly isX4: boolean;3436 readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3437 readonly isX5: boolean;3438 readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3439 readonly isX6: boolean;3440 readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3441 readonly isX7: boolean;3442 readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3443 readonly isX8: boolean;3444 readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;3445 readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';3446}34473448/** @name XcmV1Order */3449export interface XcmV1Order extends Enum {3450 readonly isNoop: boolean;3451 readonly isDepositAsset: boolean;3452 readonly asDepositAsset: {3453 readonly assets: XcmV1MultiassetMultiAssetFilter;3454 readonly maxAssets: u32;3455 readonly beneficiary: XcmV1MultiLocation;3456 } & Struct;3457 readonly isDepositReserveAsset: boolean;3458 readonly asDepositReserveAsset: {3459 readonly assets: XcmV1MultiassetMultiAssetFilter;3460 readonly maxAssets: u32;3461 readonly dest: XcmV1MultiLocation;3462 readonly effects: Vec<XcmV1Order>;3463 } & Struct;3464 readonly isExchangeAsset: boolean;3465 readonly asExchangeAsset: {3466 readonly give: XcmV1MultiassetMultiAssetFilter;3467 readonly receive: XcmV1MultiassetMultiAssets;3468 } & Struct;3469 readonly isInitiateReserveWithdraw: boolean;3470 readonly asInitiateReserveWithdraw: {3471 readonly assets: XcmV1MultiassetMultiAssetFilter;3472 readonly reserve: XcmV1MultiLocation;3473 readonly effects: Vec<XcmV1Order>;3474 } & Struct;3475 readonly isInitiateTeleport: boolean;3476 readonly asInitiateTeleport: {3477 readonly assets: XcmV1MultiassetMultiAssetFilter;3478 readonly dest: XcmV1MultiLocation;3479 readonly effects: Vec<XcmV1Order>;3480 } & Struct;3481 readonly isQueryHolding: boolean;3482 readonly asQueryHolding: {3483 readonly queryId: Compact<u64>;3484 readonly dest: XcmV1MultiLocation;3485 readonly assets: XcmV1MultiassetMultiAssetFilter;3486 } & Struct;3487 readonly isBuyExecution: boolean;3488 readonly asBuyExecution: {3489 readonly fees: XcmV1MultiAsset;3490 readonly weight: u64;3491 readonly debt: u64;3492 readonly haltOnError: bool;3493 readonly instructions: Vec<XcmV1Xcm>;3494 } & Struct;3495 readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';3496}34973498/** @name XcmV1Response */3499export interface XcmV1Response extends Enum {3500 readonly isAssets: boolean;3501 readonly asAssets: XcmV1MultiassetMultiAssets;3502 readonly isVersion: boolean;3503 readonly asVersion: u32;3504 readonly type: 'Assets' | 'Version';3505}35063507/** @name XcmV1Xcm */3508export interface XcmV1Xcm extends Enum {3509 readonly isWithdrawAsset: boolean;3510 readonly asWithdrawAsset: {3511 readonly assets: XcmV1MultiassetMultiAssets;3512 readonly effects: Vec<XcmV1Order>;3513 } & Struct;3514 readonly isReserveAssetDeposited: boolean;3515 readonly asReserveAssetDeposited: {3516 readonly assets: XcmV1MultiassetMultiAssets;3517 readonly effects: Vec<XcmV1Order>;3518 } & Struct;3519 readonly isReceiveTeleportedAsset: boolean;3520 readonly asReceiveTeleportedAsset: {3521 readonly assets: XcmV1MultiassetMultiAssets;3522 readonly effects: Vec<XcmV1Order>;3523 } & Struct;3524 readonly isQueryResponse: boolean;3525 readonly asQueryResponse: {3526 readonly queryId: Compact<u64>;3527 readonly response: XcmV1Response;3528 } & Struct;3529 readonly isTransferAsset: boolean;3530 readonly asTransferAsset: {3531 readonly assets: XcmV1MultiassetMultiAssets;3532 readonly beneficiary: XcmV1MultiLocation;3533 } & Struct;3534 readonly isTransferReserveAsset: boolean;3535 readonly asTransferReserveAsset: {3536 readonly assets: XcmV1MultiassetMultiAssets;3537 readonly dest: XcmV1MultiLocation;3538 readonly effects: Vec<XcmV1Order>;3539 } & Struct;3540 readonly isTransact: boolean;3541 readonly asTransact: {3542 readonly originType: XcmV0OriginKind;3543 readonly requireWeightAtMost: u64;3544 readonly call: XcmDoubleEncoded;3545 } & Struct;3546 readonly isHrmpNewChannelOpenRequest: boolean;3547 readonly asHrmpNewChannelOpenRequest: {3548 readonly sender: Compact<u32>;3549 readonly maxMessageSize: Compact<u32>;3550 readonly maxCapacity: Compact<u32>;3551 } & Struct;3552 readonly isHrmpChannelAccepted: boolean;3553 readonly asHrmpChannelAccepted: {3554 readonly recipient: Compact<u32>;3555 } & Struct;3556 readonly isHrmpChannelClosing: boolean;3557 readonly asHrmpChannelClosing: {3558 readonly initiator: Compact<u32>;3559 readonly sender: Compact<u32>;3560 readonly recipient: Compact<u32>;3561 } & Struct;3562 readonly isRelayedFrom: boolean;3563 readonly asRelayedFrom: {3564 readonly who: XcmV1MultilocationJunctions;3565 readonly message: XcmV1Xcm;3566 } & Struct;3567 readonly isSubscribeVersion: boolean;3568 readonly asSubscribeVersion: {3569 readonly queryId: Compact<u64>;3570 readonly maxResponseWeight: Compact<u64>;3571 } & Struct;3572 readonly isUnsubscribeVersion: boolean;3573 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion';3574}35753576/** @name XcmV2Instruction */3577export interface XcmV2Instruction extends Enum {3578 readonly isWithdrawAsset: boolean;3579 readonly asWithdrawAsset: XcmV1MultiassetMultiAssets;3580 readonly isReserveAssetDeposited: boolean;3581 readonly asReserveAssetDeposited: XcmV1MultiassetMultiAssets;3582 readonly isReceiveTeleportedAsset: boolean;3583 readonly asReceiveTeleportedAsset: XcmV1MultiassetMultiAssets;3584 readonly isQueryResponse: boolean;3585 readonly asQueryResponse: {3586 readonly queryId: Compact<u64>;3587 readonly response: XcmV2Response;3588 readonly maxWeight: Compact<u64>;3589 } & Struct;3590 readonly isTransferAsset: boolean;3591 readonly asTransferAsset: {3592 readonly assets: XcmV1MultiassetMultiAssets;3593 readonly beneficiary: XcmV1MultiLocation;3594 } & Struct;3595 readonly isTransferReserveAsset: boolean;3596 readonly asTransferReserveAsset: {3597 readonly assets: XcmV1MultiassetMultiAssets;3598 readonly dest: XcmV1MultiLocation;3599 readonly xcm: XcmV2Xcm;3600 } & Struct;3601 readonly isTransact: boolean;3602 readonly asTransact: {3603 readonly originType: XcmV0OriginKind;3604 readonly requireWeightAtMost: Compact<u64>;3605 readonly call: XcmDoubleEncoded;3606 } & Struct;3607 readonly isHrmpNewChannelOpenRequest: boolean;3608 readonly asHrmpNewChannelOpenRequest: {3609 readonly sender: Compact<u32>;3610 readonly maxMessageSize: Compact<u32>;3611 readonly maxCapacity: Compact<u32>;3612 } & Struct;3613 readonly isHrmpChannelAccepted: boolean;3614 readonly asHrmpChannelAccepted: {3615 readonly recipient: Compact<u32>;3616 } & Struct;3617 readonly isHrmpChannelClosing: boolean;3618 readonly asHrmpChannelClosing: {3619 readonly initiator: Compact<u32>;3620 readonly sender: Compact<u32>;3621 readonly recipient: Compact<u32>;3622 } & Struct;3623 readonly isClearOrigin: boolean;3624 readonly isDescendOrigin: boolean;3625 readonly asDescendOrigin: XcmV1MultilocationJunctions;3626 readonly isReportError: boolean;3627 readonly asReportError: {3628 readonly queryId: Compact<u64>;3629 readonly dest: XcmV1MultiLocation;3630 readonly maxResponseWeight: Compact<u64>;3631 } & Struct;3632 readonly isDepositAsset: boolean;3633 readonly asDepositAsset: {3634 readonly assets: XcmV1MultiassetMultiAssetFilter;3635 readonly maxAssets: Compact<u32>;3636 readonly beneficiary: XcmV1MultiLocation;3637 } & Struct;3638 readonly isDepositReserveAsset: boolean;3639 readonly asDepositReserveAsset: {3640 readonly assets: XcmV1MultiassetMultiAssetFilter;3641 readonly maxAssets: Compact<u32>;3642 readonly dest: XcmV1MultiLocation;3643 readonly xcm: XcmV2Xcm;3644 } & Struct;3645 readonly isExchangeAsset: boolean;3646 readonly asExchangeAsset: {3647 readonly give: XcmV1MultiassetMultiAssetFilter;3648 readonly receive: XcmV1MultiassetMultiAssets;3649 } & Struct;3650 readonly isInitiateReserveWithdraw: boolean;3651 readonly asInitiateReserveWithdraw: {3652 readonly assets: XcmV1MultiassetMultiAssetFilter;3653 readonly reserve: XcmV1MultiLocation;3654 readonly xcm: XcmV2Xcm;3655 } & Struct;3656 readonly isInitiateTeleport: boolean;3657 readonly asInitiateTeleport: {3658 readonly assets: XcmV1MultiassetMultiAssetFilter;3659 readonly dest: XcmV1MultiLocation;3660 readonly xcm: XcmV2Xcm;3661 } & Struct;3662 readonly isQueryHolding: boolean;3663 readonly asQueryHolding: {3664 readonly queryId: Compact<u64>;3665 readonly dest: XcmV1MultiLocation;3666 readonly assets: XcmV1MultiassetMultiAssetFilter;3667 readonly maxResponseWeight: Compact<u64>;3668 } & Struct;3669 readonly isBuyExecution: boolean;3670 readonly asBuyExecution: {3671 readonly fees: XcmV1MultiAsset;3672 readonly weightLimit: XcmV2WeightLimit;3673 } & Struct;3674 readonly isRefundSurplus: boolean;3675 readonly isSetErrorHandler: boolean;3676 readonly asSetErrorHandler: XcmV2Xcm;3677 readonly isSetAppendix: boolean;3678 readonly asSetAppendix: XcmV2Xcm;3679 readonly isClearError: boolean;3680 readonly isClaimAsset: boolean;3681 readonly asClaimAsset: {3682 readonly assets: XcmV1MultiassetMultiAssets;3683 readonly ticket: XcmV1MultiLocation;3684 } & Struct;3685 readonly isTrap: boolean;3686 readonly asTrap: Compact<u64>;3687 readonly isSubscribeVersion: boolean;3688 readonly asSubscribeVersion: {3689 readonly queryId: Compact<u64>;3690 readonly maxResponseWeight: Compact<u64>;3691 } & Struct;3692 readonly isUnsubscribeVersion: boolean;3693 readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';3694}36953696/** @name XcmV2Response */3697export interface XcmV2Response extends Enum {3698 readonly isNull: boolean;3699 readonly isAssets: boolean;3700 readonly asAssets: XcmV1MultiassetMultiAssets;3701 readonly isExecutionResult: boolean;3702 readonly asExecutionResult: Option<ITuple<[u32, XcmV2TraitsError]>>;3703 readonly isVersion: boolean;3704 readonly asVersion: u32;3705 readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';3706}37073708/** @name XcmV2TraitsError */3709export interface XcmV2TraitsError extends Enum {3710 readonly isOverflow: boolean;3711 readonly isUnimplemented: boolean;3712 readonly isUntrustedReserveLocation: boolean;3713 readonly isUntrustedTeleportLocation: boolean;3714 readonly isMultiLocationFull: boolean;3715 readonly isMultiLocationNotInvertible: boolean;3716 readonly isBadOrigin: boolean;3717 readonly isInvalidLocation: boolean;3718 readonly isAssetNotFound: boolean;3719 readonly isFailedToTransactAsset: boolean;3720 readonly isNotWithdrawable: boolean;3721 readonly isLocationCannotHold: boolean;3722 readonly isExceedsMaxMessageSize: boolean;3723 readonly isDestinationUnsupported: boolean;3724 readonly isTransport: boolean;3725 readonly isUnroutable: boolean;3726 readonly isUnknownClaim: boolean;3727 readonly isFailedToDecode: boolean;3728 readonly isMaxWeightInvalid: boolean;3729 readonly isNotHoldingFees: boolean;3730 readonly isTooExpensive: boolean;3731 readonly isTrap: boolean;3732 readonly asTrap: u64;3733 readonly isUnhandledXcmVersion: boolean;3734 readonly isWeightLimitReached: boolean;3735 readonly asWeightLimitReached: u64;3736 readonly isBarrier: boolean;3737 readonly isWeightNotComputable: boolean;3738 readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';3739}37403741/** @name XcmV2TraitsOutcome */3742export interface XcmV2TraitsOutcome extends Enum {3743 readonly isComplete: boolean;3744 readonly asComplete: u64;3745 readonly isIncomplete: boolean;3746 readonly asIncomplete: ITuple<[u64, XcmV2TraitsError]>;3747 readonly isError: boolean;3748 readonly asError: XcmV2TraitsError;3749 readonly type: 'Complete' | 'Incomplete' | 'Error';3750}37513752/** @name XcmV2WeightLimit */3753export interface XcmV2WeightLimit extends Enum {3754 readonly isUnlimited: boolean;3755 readonly isLimited: boolean;3756 readonly asLimited: Compact<u64>;3757 readonly type: 'Unlimited' | 'Limited';3758}37593760/** @name XcmV2Xcm */3761export interface XcmV2Xcm extends Vec<XcmV2Instruction> {}37623763/** @name XcmVersionedMultiAsset */3764export interface XcmVersionedMultiAsset extends Enum {3765 readonly isV0: boolean;3766 readonly asV0: XcmV0MultiAsset;3767 readonly isV1: boolean;3768 readonly asV1: XcmV1MultiAsset;3769 readonly type: 'V0' | 'V1';3770}37713772/** @name XcmVersionedMultiAssets */3773export interface XcmVersionedMultiAssets extends Enum {3774 readonly isV0: boolean;3775 readonly asV0: Vec<XcmV0MultiAsset>;3776 readonly isV1: boolean;3777 readonly asV1: XcmV1MultiassetMultiAssets;3778 readonly type: 'V0' | 'V1';3779}37803781/** @name XcmVersionedMultiLocation */3782export interface XcmVersionedMultiLocation extends Enum {3783 readonly isV0: boolean;3784 readonly asV0: XcmV0MultiLocation;3785 readonly isV1: boolean;3786 readonly asV1: XcmV1MultiLocation;3787 readonly type: 'V0' | 'V1';3788}37893790/** @name XcmVersionedXcm */3791export interface XcmVersionedXcm extends Enum {3792 readonly isV0: boolean;3793 readonly asV0: XcmV0Xcm;3794 readonly isV1: boolean;3795 readonly asV1: XcmV1Xcm;3796 readonly isV2: boolean;3797 readonly asV2: XcmV2Xcm;3798 readonly type: 'V0' | 'V1' | 'V2';3799}38003801export type PHANTOM_DEFAULT = 'default';tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -323,118 +323,47 @@
perPeriod: 'Compact<u128>'
},
/**
- * Lookup39: cumulus_pallet_xcmp_queue::pallet::Event<T>
+ * Lookup39: orml_xtokens::module::Event<T>
**/
- CumulusPalletXcmpQueueEvent: {
+ OrmlXtokensModuleEvent: {
_enum: {
- Success: {
- messageHash: 'Option<H256>',
- weight: 'u64',
- },
- Fail: {
- messageHash: 'Option<H256>',
- error: 'XcmV2TraitsError',
- weight: 'u64',
- },
- BadVersion: {
- messageHash: 'Option<H256>',
- },
- BadFormat: {
- messageHash: 'Option<H256>',
- },
- UpwardMessageSent: {
- messageHash: 'Option<H256>',
- },
- XcmpMessageSent: {
- messageHash: 'Option<H256>',
- },
- OverweightEnqueued: {
- sender: 'u32',
- sentAt: 'u32',
- index: 'u64',
- required: 'u64',
- },
- OverweightServiced: {
- index: 'u64',
- used: 'u64'
+ TransferredMultiAssets: {
+ sender: 'AccountId32',
+ assets: 'XcmV1MultiassetMultiAssets',
+ fee: 'XcmV1MultiAsset',
+ dest: 'XcmV1MultiLocation'
}
}
},
/**
- * Lookup41: xcm::v2::traits::Error
+ * Lookup40: xcm::v1::multiasset::MultiAssets
**/
- XcmV2TraitsError: {
- _enum: {
- Overflow: 'Null',
- Unimplemented: 'Null',
- UntrustedReserveLocation: 'Null',
- UntrustedTeleportLocation: 'Null',
- MultiLocationFull: 'Null',
- MultiLocationNotInvertible: 'Null',
- BadOrigin: 'Null',
- InvalidLocation: 'Null',
- AssetNotFound: 'Null',
- FailedToTransactAsset: 'Null',
- NotWithdrawable: 'Null',
- LocationCannotHold: 'Null',
- ExceedsMaxMessageSize: 'Null',
- DestinationUnsupported: 'Null',
- Transport: 'Null',
- Unroutable: 'Null',
- UnknownClaim: 'Null',
- FailedToDecode: 'Null',
- MaxWeightInvalid: 'Null',
- NotHoldingFees: 'Null',
- TooExpensive: 'Null',
- Trap: 'u64',
- UnhandledXcmVersion: 'Null',
- WeightLimitReached: 'u64',
- Barrier: 'Null',
- WeightNotComputable: 'Null'
- }
- },
+ XcmV1MultiassetMultiAssets: 'Vec<XcmV1MultiAsset>',
/**
- * Lookup43: pallet_xcm::pallet::Event<T>
+ * Lookup42: xcm::v1::multiasset::MultiAsset
**/
- PalletXcmEvent: {
- _enum: {
- Attempted: 'XcmV2TraitsOutcome',
- Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)',
- UnexpectedResponse: '(XcmV1MultiLocation,u64)',
- ResponseReady: '(u64,XcmV2Response)',
- Notified: '(u64,u8,u8)',
- NotifyOverweight: '(u64,u8,u8,u64,u64)',
- NotifyDispatchError: '(u64,u8,u8)',
- NotifyDecodeFailed: '(u64,u8,u8)',
- InvalidResponder: '(XcmV1MultiLocation,u64,Option<XcmV1MultiLocation>)',
- InvalidResponderVersion: '(XcmV1MultiLocation,u64)',
- ResponseTaken: 'u64',
- AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)',
- VersionChangeNotified: '(XcmV1MultiLocation,u32)',
- SupportedVersionChanged: '(XcmV1MultiLocation,u32)',
- NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)',
- NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)'
- }
+ XcmV1MultiAsset: {
+ id: 'XcmV1MultiassetAssetId',
+ fun: 'XcmV1MultiassetFungibility'
},
/**
- * Lookup44: xcm::v2::traits::Outcome
+ * Lookup43: xcm::v1::multiasset::AssetId
**/
- XcmV2TraitsOutcome: {
+ XcmV1MultiassetAssetId: {
_enum: {
- Complete: 'u64',
- Incomplete: '(u64,XcmV2TraitsError)',
- Error: 'XcmV2TraitsError'
+ Concrete: 'XcmV1MultiLocation',
+ Abstract: 'Bytes'
}
},
/**
- * Lookup45: xcm::v1::multilocation::MultiLocation
+ * Lookup44: xcm::v1::multilocation::MultiLocation
**/
XcmV1MultiLocation: {
parents: 'u8',
interior: 'XcmV1MultilocationJunctions'
},
/**
- * Lookup46: xcm::v1::multilocation::Junctions
+ * Lookup45: xcm::v1::multilocation::Junctions
**/
XcmV1MultilocationJunctions: {
_enum: {
@@ -450,7 +379,7 @@
}
},
/**
- * Lookup47: xcm::v1::junction::Junction
+ * Lookup46: xcm::v1::junction::Junction
**/
XcmV1Junction: {
_enum: {
@@ -478,7 +407,7 @@
}
},
/**
- * Lookup49: xcm::v0::junction::NetworkId
+ * Lookup48: xcm::v0::junction::NetworkId
**/
XcmV0JunctionNetworkId: {
_enum: {
@@ -489,7 +418,7 @@
}
},
/**
- * Lookup53: xcm::v0::junction::BodyId
+ * Lookup52: xcm::v0::junction::BodyId
**/
XcmV0JunctionBodyId: {
_enum: {
@@ -503,7 +432,7 @@
}
},
/**
- * Lookup54: xcm::v0::junction::BodyPart
+ * Lookup53: xcm::v0::junction::BodyPart
**/
XcmV0JunctionBodyPart: {
_enum: {
@@ -526,11 +455,230 @@
}
},
/**
- * Lookup55: xcm::v2::Xcm<Call>
+ * Lookup54: xcm::v1::multiasset::Fungibility
+ **/
+ XcmV1MultiassetFungibility: {
+ _enum: {
+ Fungible: 'Compact<u128>',
+ NonFungible: 'XcmV1MultiassetAssetInstance'
+ }
+ },
+ /**
+ * Lookup55: xcm::v1::multiasset::AssetInstance
+ **/
+ XcmV1MultiassetAssetInstance: {
+ _enum: {
+ Undefined: 'Null',
+ Index: 'Compact<u128>',
+ Array4: '[u8;4]',
+ Array8: '[u8;8]',
+ Array16: '[u8;16]',
+ Array32: '[u8;32]',
+ Blob: 'Bytes'
+ }
+ },
+ /**
+ * Lookup58: orml_tokens::module::Event<T>
+ **/
+ OrmlTokensModuleEvent: {
+ _enum: {
+ Endowed: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ DustLost: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ Transfer: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ from: 'AccountId32',
+ to: 'AccountId32',
+ amount: 'u128',
+ },
+ Reserved: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ Unreserved: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ ReserveRepatriated: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ from: 'AccountId32',
+ to: 'AccountId32',
+ amount: 'u128',
+ status: 'FrameSupportTokensMiscBalanceStatus',
+ },
+ BalanceSet: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ free: 'u128',
+ reserved: 'u128',
+ },
+ TotalIssuanceSet: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'u128',
+ },
+ Withdrawn: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ Slashed: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ freeAmount: 'u128',
+ reservedAmount: 'u128',
+ },
+ Deposited: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ LockSet: {
+ lockId: '[u8;8]',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32',
+ amount: 'u128',
+ },
+ LockRemoved: {
+ lockId: '[u8;8]',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ who: 'AccountId32'
+ }
+ }
+ },
+ /**
+ * Lookup59: pallet_foreign_assets::AssetIds
+ **/
+ PalletForeignAssetsAssetIds: {
+ _enum: {
+ ForeignAssetId: 'u32',
+ NativeAssetId: 'PalletForeignAssetsNativeCurrency'
+ }
+ },
+ /**
+ * Lookup60: pallet_foreign_assets::NativeCurrency
+ **/
+ PalletForeignAssetsNativeCurrency: {
+ _enum: ['Here', 'Parent']
+ },
+ /**
+ * Lookup61: cumulus_pallet_xcmp_queue::pallet::Event<T>
+ **/
+ CumulusPalletXcmpQueueEvent: {
+ _enum: {
+ Success: {
+ messageHash: 'Option<H256>',
+ weight: 'u64',
+ },
+ Fail: {
+ messageHash: 'Option<H256>',
+ error: 'XcmV2TraitsError',
+ weight: 'u64',
+ },
+ BadVersion: {
+ messageHash: 'Option<H256>',
+ },
+ BadFormat: {
+ messageHash: 'Option<H256>',
+ },
+ UpwardMessageSent: {
+ messageHash: 'Option<H256>',
+ },
+ XcmpMessageSent: {
+ messageHash: 'Option<H256>',
+ },
+ OverweightEnqueued: {
+ sender: 'u32',
+ sentAt: 'u32',
+ index: 'u64',
+ required: 'u64',
+ },
+ OverweightServiced: {
+ index: 'u64',
+ used: 'u64'
+ }
+ }
+ },
+ /**
+ * Lookup63: xcm::v2::traits::Error
+ **/
+ XcmV2TraitsError: {
+ _enum: {
+ Overflow: 'Null',
+ Unimplemented: 'Null',
+ UntrustedReserveLocation: 'Null',
+ UntrustedTeleportLocation: 'Null',
+ MultiLocationFull: 'Null',
+ MultiLocationNotInvertible: 'Null',
+ BadOrigin: 'Null',
+ InvalidLocation: 'Null',
+ AssetNotFound: 'Null',
+ FailedToTransactAsset: 'Null',
+ NotWithdrawable: 'Null',
+ LocationCannotHold: 'Null',
+ ExceedsMaxMessageSize: 'Null',
+ DestinationUnsupported: 'Null',
+ Transport: 'Null',
+ Unroutable: 'Null',
+ UnknownClaim: 'Null',
+ FailedToDecode: 'Null',
+ MaxWeightInvalid: 'Null',
+ NotHoldingFees: 'Null',
+ TooExpensive: 'Null',
+ Trap: 'u64',
+ UnhandledXcmVersion: 'Null',
+ WeightLimitReached: 'u64',
+ Barrier: 'Null',
+ WeightNotComputable: 'Null'
+ }
+ },
+ /**
+ * Lookup65: pallet_xcm::pallet::Event<T>
**/
+ PalletXcmEvent: {
+ _enum: {
+ Attempted: 'XcmV2TraitsOutcome',
+ Sent: '(XcmV1MultiLocation,XcmV1MultiLocation,XcmV2Xcm)',
+ UnexpectedResponse: '(XcmV1MultiLocation,u64)',
+ ResponseReady: '(u64,XcmV2Response)',
+ Notified: '(u64,u8,u8)',
+ NotifyOverweight: '(u64,u8,u8,u64,u64)',
+ NotifyDispatchError: '(u64,u8,u8)',
+ NotifyDecodeFailed: '(u64,u8,u8)',
+ InvalidResponder: '(XcmV1MultiLocation,u64,Option<XcmV1MultiLocation>)',
+ InvalidResponderVersion: '(XcmV1MultiLocation,u64)',
+ ResponseTaken: 'u64',
+ AssetsTrapped: '(H256,XcmV1MultiLocation,XcmVersionedMultiAssets)',
+ VersionChangeNotified: '(XcmV1MultiLocation,u32)',
+ SupportedVersionChanged: '(XcmV1MultiLocation,u32)',
+ NotifyTargetSendFail: '(XcmV1MultiLocation,u64,XcmV2TraitsError)',
+ NotifyTargetMigrationFail: '(XcmVersionedMultiLocation,u64)'
+ }
+ },
+ /**
+ * Lookup66: xcm::v2::traits::Outcome
+ **/
+ XcmV2TraitsOutcome: {
+ _enum: {
+ Complete: 'u64',
+ Incomplete: '(u64,XcmV2TraitsError)',
+ Error: 'XcmV2TraitsError'
+ }
+ },
+ /**
+ * Lookup67: xcm::v2::Xcm<Call>
+ **/
XcmV2Xcm: 'Vec<XcmV2Instruction>',
/**
- * Lookup57: xcm::v2::Instruction<Call>
+ * Lookup69: xcm::v2::Instruction<Call>
**/
XcmV2Instruction: {
_enum: {
@@ -625,53 +773,10 @@
maxResponseWeight: 'Compact<u64>',
},
UnsubscribeVersion: 'Null'
- }
- },
- /**
- * Lookup58: xcm::v1::multiasset::MultiAssets
- **/
- XcmV1MultiassetMultiAssets: 'Vec<XcmV1MultiAsset>',
- /**
- * Lookup60: xcm::v1::multiasset::MultiAsset
- **/
- XcmV1MultiAsset: {
- id: 'XcmV1MultiassetAssetId',
- fun: 'XcmV1MultiassetFungibility'
- },
- /**
- * Lookup61: xcm::v1::multiasset::AssetId
- **/
- XcmV1MultiassetAssetId: {
- _enum: {
- Concrete: 'XcmV1MultiLocation',
- Abstract: 'Bytes'
}
},
/**
- * Lookup62: xcm::v1::multiasset::Fungibility
- **/
- XcmV1MultiassetFungibility: {
- _enum: {
- Fungible: 'Compact<u128>',
- NonFungible: 'XcmV1MultiassetAssetInstance'
- }
- },
- /**
- * Lookup63: xcm::v1::multiasset::AssetInstance
- **/
- XcmV1MultiassetAssetInstance: {
- _enum: {
- Undefined: 'Null',
- Index: 'Compact<u128>',
- Array4: '[u8;4]',
- Array8: '[u8;8]',
- Array16: '[u8;16]',
- Array32: '[u8;32]',
- Blob: 'Bytes'
- }
- },
- /**
- * Lookup66: xcm::v2::Response
+ * Lookup70: xcm::v2::Response
**/
XcmV2Response: {
_enum: {
@@ -682,19 +787,19 @@
}
},
/**
- * Lookup69: xcm::v0::OriginKind
+ * Lookup73: xcm::v0::OriginKind
**/
XcmV0OriginKind: {
_enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm']
},
/**
- * Lookup70: xcm::double_encoded::DoubleEncoded<T>
+ * Lookup74: xcm::double_encoded::DoubleEncoded<T>
**/
XcmDoubleEncoded: {
encoded: 'Bytes'
},
/**
- * Lookup71: xcm::v1::multiasset::MultiAssetFilter
+ * Lookup75: xcm::v1::multiasset::MultiAssetFilter
**/
XcmV1MultiassetMultiAssetFilter: {
_enum: {
@@ -703,7 +808,7 @@
}
},
/**
- * Lookup72: xcm::v1::multiasset::WildMultiAsset
+ * Lookup76: xcm::v1::multiasset::WildMultiAsset
**/
XcmV1MultiassetWildMultiAsset: {
_enum: {
@@ -715,13 +820,13 @@
}
},
/**
- * Lookup73: xcm::v1::multiasset::WildFungibility
+ * Lookup77: xcm::v1::multiasset::WildFungibility
**/
XcmV1MultiassetWildFungibility: {
_enum: ['Fungible', 'NonFungible']
},
/**
- * Lookup74: xcm::v2::WeightLimit
+ * Lookup78: xcm::v2::WeightLimit
**/
XcmV2WeightLimit: {
_enum: {
@@ -730,7 +835,7 @@
}
},
/**
- * Lookup76: xcm::VersionedMultiAssets
+ * Lookup80: xcm::VersionedMultiAssets
**/
XcmVersionedMultiAssets: {
_enum: {
@@ -739,7 +844,7 @@
}
},
/**
- * Lookup78: xcm::v0::multi_asset::MultiAsset
+ * Lookup82: xcm::v0::multi_asset::MultiAsset
**/
XcmV0MultiAsset: {
_enum: {
@@ -778,7 +883,7 @@
}
},
/**
- * Lookup79: xcm::v0::multi_location::MultiLocation
+ * Lookup83: xcm::v0::multi_location::MultiLocation
**/
XcmV0MultiLocation: {
_enum: {
@@ -794,7 +899,7 @@
}
},
/**
- * Lookup80: xcm::v0::junction::Junction
+ * Lookup84: xcm::v0::junction::Junction
**/
XcmV0Junction: {
_enum: {
@@ -823,7 +928,7 @@
}
},
/**
- * Lookup81: xcm::VersionedMultiLocation
+ * Lookup85: xcm::VersionedMultiLocation
**/
XcmVersionedMultiLocation: {
_enum: {
@@ -832,7 +937,7 @@
}
},
/**
- * Lookup82: cumulus_pallet_xcm::pallet::Event<T>
+ * Lookup86: cumulus_pallet_xcm::pallet::Event<T>
**/
CumulusPalletXcmEvent: {
_enum: {
@@ -842,7 +947,7 @@
}
},
/**
- * Lookup83: cumulus_pallet_dmp_queue::pallet::Event<T>
+ * Lookup87: cumulus_pallet_dmp_queue::pallet::Event<T>
**/
CumulusPalletDmpQueueEvent: {
_enum: {
@@ -873,7 +978,7 @@
}
},
/**
- * Lookup84: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup88: pallet_unique::RawEvent<sp_core::crypto::AccountId32, pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletUniqueRawEvent: {
_enum: {
@@ -890,7 +995,7 @@
}
},
/**
- * Lookup85: pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>
+ * Lookup89: pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>
**/
PalletEvmAccountBasicCrossAccountIdRepr: {
_enum: {
@@ -899,7 +1004,7 @@
}
},
/**
- * Lookup88: pallet_unique_scheduler::pallet::Event<T>
+ * Lookup92: pallet_unique_scheduler::pallet::Event<T>
**/
PalletUniqueSchedulerEvent: {
_enum: {
@@ -924,13 +1029,13 @@
}
},
/**
- * Lookup91: frame_support::traits::schedule::LookupError
+ * Lookup95: frame_support::traits::schedule::LookupError
**/
FrameSupportScheduleLookupError: {
_enum: ['Unknown', 'BadFormat']
},
/**
- * Lookup92: pallet_common::pallet::Event<T>
+ * Lookup96: pallet_common::pallet::Event<T>
**/
PalletCommonEvent: {
_enum: {
@@ -948,7 +1053,7 @@
}
},
/**
- * Lookup95: pallet_structure::pallet::Event<T>
+ * Lookup99: pallet_structure::pallet::Event<T>
**/
PalletStructureEvent: {
_enum: {
@@ -956,7 +1061,7 @@
}
},
/**
- * Lookup96: pallet_rmrk_core::pallet::Event<T>
+ * Lookup100: pallet_rmrk_core::pallet::Event<T>
**/
PalletRmrkCoreEvent: {
_enum: {
@@ -1033,7 +1138,7 @@
}
},
/**
- * Lookup97: rmrk_traits::nft::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
+ * Lookup101: rmrk_traits::nft::AccountIdOrCollectionNftTuple<sp_core::crypto::AccountId32>
**/
RmrkTraitsNftAccountIdOrCollectionNftTuple: {
_enum: {
@@ -1042,7 +1147,7 @@
}
},
/**
- * Lookup102: pallet_rmrk_equip::pallet::Event<T>
+ * Lookup106: pallet_rmrk_equip::pallet::Event<T>
**/
PalletRmrkEquipEvent: {
_enum: {
@@ -1057,7 +1162,7 @@
}
},
/**
- * Lookup103: pallet_app_promotion::pallet::Event<T>
+ * Lookup107: pallet_app_promotion::pallet::Event<T>
**/
PalletAppPromotionEvent: {
_enum: {
@@ -1068,8 +1173,42 @@
}
},
/**
- * Lookup104: pallet_evm::pallet::Event<T>
+ * Lookup108: pallet_foreign_assets::module::Event<T>
**/
+ PalletForeignAssetsModuleEvent: {
+ _enum: {
+ ForeignAssetRegistered: {
+ assetId: 'u32',
+ assetAddress: 'XcmV1MultiLocation',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata',
+ },
+ ForeignAssetUpdated: {
+ assetId: 'u32',
+ assetAddress: 'XcmV1MultiLocation',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata',
+ },
+ AssetRegistered: {
+ assetId: 'PalletForeignAssetsAssetIds',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata',
+ },
+ AssetUpdated: {
+ assetId: 'PalletForeignAssetsAssetIds',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata'
+ }
+ }
+ },
+ /**
+ * Lookup109: pallet_foreign_assets::module::AssetMetadata<Balance>
+ **/
+ PalletForeignAssetsModuleAssetMetadata: {
+ name: 'Bytes',
+ symbol: 'Bytes',
+ decimals: 'u8',
+ minimalBalance: 'u128'
+ },
+ /**
+ * Lookup110: pallet_evm::pallet::Event<T>
+ **/
PalletEvmEvent: {
_enum: {
Log: 'EthereumLog',
@@ -1082,7 +1221,7 @@
}
},
/**
- * Lookup105: ethereum::log::Log
+ * Lookup111: ethereum::log::Log
**/
EthereumLog: {
address: 'H160',
@@ -1090,7 +1229,7 @@
data: 'Bytes'
},
/**
- * Lookup109: pallet_ethereum::pallet::Event
+ * Lookup115: pallet_ethereum::pallet::Event
**/
PalletEthereumEvent: {
_enum: {
@@ -1098,7 +1237,7 @@
}
},
/**
- * Lookup110: evm_core::error::ExitReason
+ * Lookup116: evm_core::error::ExitReason
**/
EvmCoreErrorExitReason: {
_enum: {
@@ -1109,13 +1248,13 @@
}
},
/**
- * Lookup111: evm_core::error::ExitSucceed
+ * Lookup117: evm_core::error::ExitSucceed
**/
EvmCoreErrorExitSucceed: {
_enum: ['Stopped', 'Returned', 'Suicided']
},
/**
- * Lookup112: evm_core::error::ExitError
+ * Lookup118: evm_core::error::ExitError
**/
EvmCoreErrorExitError: {
_enum: {
@@ -1137,13 +1276,13 @@
}
},
/**
- * Lookup115: evm_core::error::ExitRevert
+ * Lookup121: evm_core::error::ExitRevert
**/
EvmCoreErrorExitRevert: {
_enum: ['Reverted']
},
/**
- * Lookup116: evm_core::error::ExitFatal
+ * Lookup122: evm_core::error::ExitFatal
**/
EvmCoreErrorExitFatal: {
_enum: {
@@ -1154,7 +1293,7 @@
}
},
/**
- * Lookup117: pallet_evm_contract_helpers::pallet::Event<T>
+ * Lookup123: pallet_evm_contract_helpers::pallet::Event<T>
**/
PalletEvmContractHelpersEvent: {
_enum: {
@@ -1164,7 +1303,7 @@
}
},
/**
- * Lookup118: frame_system::Phase
+ * Lookup124: frame_system::Phase
**/
FrameSystemPhase: {
_enum: {
@@ -1174,14 +1313,14 @@
}
},
/**
- * Lookup120: frame_system::LastRuntimeUpgradeInfo
+ * Lookup126: frame_system::LastRuntimeUpgradeInfo
**/
FrameSystemLastRuntimeUpgradeInfo: {
specVersion: 'Compact<u32>',
specName: 'Text'
},
/**
- * Lookup121: frame_system::pallet::Call<T>
+ * Lookup127: frame_system::pallet::Call<T>
**/
FrameSystemCall: {
_enum: {
@@ -1219,7 +1358,7 @@
}
},
/**
- * Lookup126: frame_system::limits::BlockWeights
+ * Lookup132: frame_system::limits::BlockWeights
**/
FrameSystemLimitsBlockWeights: {
baseBlock: 'u64',
@@ -1227,7 +1366,7 @@
perClass: 'FrameSupportWeightsPerDispatchClassWeightsPerClass'
},
/**
- * Lookup127: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
+ * Lookup133: frame_support::weights::PerDispatchClass<frame_system::limits::WeightsPerClass>
**/
FrameSupportWeightsPerDispatchClassWeightsPerClass: {
normal: 'FrameSystemLimitsWeightsPerClass',
@@ -1235,7 +1374,7 @@
mandatory: 'FrameSystemLimitsWeightsPerClass'
},
/**
- * Lookup128: frame_system::limits::WeightsPerClass
+ * Lookup134: frame_system::limits::WeightsPerClass
**/
FrameSystemLimitsWeightsPerClass: {
baseExtrinsic: 'u64',
@@ -1244,13 +1383,13 @@
reserved: 'Option<u64>'
},
/**
- * Lookup130: frame_system::limits::BlockLength
+ * Lookup136: frame_system::limits::BlockLength
**/
FrameSystemLimitsBlockLength: {
max: 'FrameSupportWeightsPerDispatchClassU32'
},
/**
- * Lookup131: frame_support::weights::PerDispatchClass<T>
+ * Lookup137: frame_support::weights::PerDispatchClass<T>
**/
FrameSupportWeightsPerDispatchClassU32: {
normal: 'u32',
@@ -1258,14 +1397,14 @@
mandatory: 'u32'
},
/**
- * Lookup132: frame_support::weights::RuntimeDbWeight
+ * Lookup138: frame_support::weights::RuntimeDbWeight
**/
FrameSupportWeightsRuntimeDbWeight: {
read: 'u64',
write: 'u64'
},
/**
- * Lookup133: sp_version::RuntimeVersion
+ * Lookup139: sp_version::RuntimeVersion
**/
SpVersionRuntimeVersion: {
specName: 'Text',
@@ -1278,13 +1417,13 @@
stateVersion: 'u8'
},
/**
- * Lookup138: frame_system::pallet::Error<T>
+ * Lookup144: frame_system::pallet::Error<T>
**/
FrameSystemError: {
_enum: ['InvalidSpecName', 'SpecVersionNeedsToIncrease', 'FailedToExtractRuntimeVersion', 'NonDefaultComposite', 'NonZeroRefCount', 'CallFiltered']
},
/**
- * Lookup139: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
+ * Lookup145: polkadot_primitives::v2::PersistedValidationData<primitive_types::H256, N>
**/
PolkadotPrimitivesV2PersistedValidationData: {
parentHead: 'Bytes',
@@ -1293,19 +1432,19 @@
maxPovSize: 'u32'
},
/**
- * Lookup142: polkadot_primitives::v2::UpgradeRestriction
+ * Lookup148: polkadot_primitives::v2::UpgradeRestriction
**/
PolkadotPrimitivesV2UpgradeRestriction: {
_enum: ['Present']
},
/**
- * Lookup143: sp_trie::storage_proof::StorageProof
+ * Lookup149: sp_trie::storage_proof::StorageProof
**/
SpTrieStorageProof: {
trieNodes: 'BTreeSet<Bytes>'
},
/**
- * Lookup145: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
+ * Lookup151: cumulus_pallet_parachain_system::relay_state_snapshot::MessagingStateSnapshot
**/
CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: {
dmqMqcHead: 'H256',
@@ -1314,7 +1453,7 @@
egressChannels: 'Vec<(u32,PolkadotPrimitivesV2AbridgedHrmpChannel)>'
},
/**
- * Lookup148: polkadot_primitives::v2::AbridgedHrmpChannel
+ * Lookup154: polkadot_primitives::v2::AbridgedHrmpChannel
**/
PolkadotPrimitivesV2AbridgedHrmpChannel: {
maxCapacity: 'u32',
@@ -1325,7 +1464,7 @@
mqcHead: 'Option<H256>'
},
/**
- * Lookup149: polkadot_primitives::v2::AbridgedHostConfiguration
+ * Lookup155: polkadot_primitives::v2::AbridgedHostConfiguration
**/
PolkadotPrimitivesV2AbridgedHostConfiguration: {
maxCodeSize: 'u32',
@@ -1339,14 +1478,14 @@
validationUpgradeDelay: 'u32'
},
/**
- * Lookup155: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
+ * Lookup161: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
**/
PolkadotCorePrimitivesOutboundHrmpMessage: {
recipient: 'u32',
data: 'Bytes'
},
/**
- * Lookup156: cumulus_pallet_parachain_system::pallet::Call<T>
+ * Lookup162: cumulus_pallet_parachain_system::pallet::Call<T>
**/
CumulusPalletParachainSystemCall: {
_enum: {
@@ -1365,7 +1504,7 @@
}
},
/**
- * Lookup157: cumulus_primitives_parachain_inherent::ParachainInherentData
+ * Lookup163: cumulus_primitives_parachain_inherent::ParachainInherentData
**/
CumulusPrimitivesParachainInherentParachainInherentData: {
validationData: 'PolkadotPrimitivesV2PersistedValidationData',
@@ -1374,27 +1513,27 @@
horizontalMessages: 'BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>'
},
/**
- * Lookup159: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
+ * Lookup165: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundDownwardMessage: {
sentAt: 'u32',
msg: 'Bytes'
},
/**
- * Lookup162: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
+ * Lookup168: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundHrmpMessage: {
sentAt: 'u32',
data: 'Bytes'
},
/**
- * Lookup165: cumulus_pallet_parachain_system::pallet::Error<T>
+ * Lookup171: cumulus_pallet_parachain_system::pallet::Error<T>
**/
CumulusPalletParachainSystemError: {
_enum: ['OverlappingUpgrades', 'ProhibitedByPolkadot', 'TooBig', 'ValidationDataNotAvailable', 'HostConfigurationNotAvailable', 'NotScheduled', 'NothingAuthorized', 'Unauthorized']
},
/**
- * Lookup167: pallet_balances::BalanceLock<Balance>
+ * Lookup173: pallet_balances::BalanceLock<Balance>
**/
PalletBalancesBalanceLock: {
id: '[u8;8]',
@@ -1402,26 +1541,26 @@
reasons: 'PalletBalancesReasons'
},
/**
- * Lookup168: pallet_balances::Reasons
+ * Lookup174: pallet_balances::Reasons
**/
PalletBalancesReasons: {
_enum: ['Fee', 'Misc', 'All']
},
/**
- * Lookup171: pallet_balances::ReserveData<ReserveIdentifier, Balance>
+ * Lookup177: pallet_balances::ReserveData<ReserveIdentifier, Balance>
**/
PalletBalancesReserveData: {
id: '[u8;16]',
amount: 'u128'
},
/**
- * Lookup173: pallet_balances::Releases
+ * Lookup179: pallet_balances::Releases
**/
PalletBalancesReleases: {
_enum: ['V1_0_0', 'V2_0_0']
},
/**
- * Lookup174: pallet_balances::pallet::Call<T, I>
+ * Lookup180: pallet_balances::pallet::Call<T, I>
**/
PalletBalancesCall: {
_enum: {
@@ -1454,13 +1593,13 @@
}
},
/**
- * Lookup177: pallet_balances::pallet::Error<T, I>
+ * Lookup183: pallet_balances::pallet::Error<T, I>
**/
PalletBalancesError: {
_enum: ['VestingBalance', 'LiquidityRestrictions', 'InsufficientBalance', 'ExistentialDeposit', 'KeepAlive', 'ExistingVestingSchedule', 'DeadAccount', 'TooManyReserves']
},
/**
- * Lookup179: pallet_timestamp::pallet::Call<T>
+ * Lookup185: pallet_timestamp::pallet::Call<T>
**/
PalletTimestampCall: {
_enum: {
@@ -1470,13 +1609,13 @@
}
},
/**
- * Lookup181: pallet_transaction_payment::Releases
+ * Lookup187: pallet_transaction_payment::Releases
**/
PalletTransactionPaymentReleases: {
_enum: ['V1Ancient', 'V2']
},
/**
- * Lookup182: pallet_treasury::Proposal<sp_core::crypto::AccountId32, Balance>
+ * Lookup188: pallet_treasury::Proposal<sp_core::crypto::AccountId32, Balance>
**/
PalletTreasuryProposal: {
proposer: 'AccountId32',
@@ -1485,7 +1624,7 @@
bond: 'u128'
},
/**
- * Lookup185: pallet_treasury::pallet::Call<T, I>
+ * Lookup191: pallet_treasury::pallet::Call<T, I>
**/
PalletTreasuryCall: {
_enum: {
@@ -1509,17 +1648,17 @@
}
},
/**
- * Lookup188: frame_support::PalletId
+ * Lookup194: frame_support::PalletId
**/
FrameSupportPalletId: '[u8;8]',
/**
- * Lookup189: pallet_treasury::pallet::Error<T, I>
+ * Lookup195: pallet_treasury::pallet::Error<T, I>
**/
PalletTreasuryError: {
_enum: ['InsufficientProposersBalance', 'InvalidIndex', 'TooManyApprovals', 'InsufficientPermission', 'ProposalNotApproved']
},
/**
- * Lookup190: pallet_sudo::pallet::Call<T>
+ * Lookup196: pallet_sudo::pallet::Call<T>
**/
PalletSudoCall: {
_enum: {
@@ -1543,7 +1682,7 @@
}
},
/**
- * Lookup192: orml_vesting::module::Call<T>
+ * Lookup198: orml_vesting::module::Call<T>
**/
OrmlVestingModuleCall: {
_enum: {
@@ -1562,8 +1701,94 @@
}
},
/**
- * Lookup194: cumulus_pallet_xcmp_queue::pallet::Call<T>
+ * Lookup200: orml_xtokens::module::Call<T>
**/
+ OrmlXtokensModuleCall: {
+ _enum: {
+ transfer: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'u128',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_multiasset: {
+ asset: 'XcmVersionedMultiAsset',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_with_fee: {
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'u128',
+ fee: 'u128',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_multiasset_with_fee: {
+ asset: 'XcmVersionedMultiAsset',
+ fee: 'XcmVersionedMultiAsset',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_multicurrencies: {
+ currencies: 'Vec<(PalletForeignAssetsAssetIds,u128)>',
+ feeItem: 'u32',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64',
+ },
+ transfer_multiassets: {
+ assets: 'XcmVersionedMultiAssets',
+ feeItem: 'u32',
+ dest: 'XcmVersionedMultiLocation',
+ destWeight: 'u64'
+ }
+ }
+ },
+ /**
+ * Lookup201: xcm::VersionedMultiAsset
+ **/
+ XcmVersionedMultiAsset: {
+ _enum: {
+ V0: 'XcmV0MultiAsset',
+ V1: 'XcmV1MultiAsset'
+ }
+ },
+ /**
+ * Lookup204: orml_tokens::module::Call<T>
+ **/
+ OrmlTokensModuleCall: {
+ _enum: {
+ transfer: {
+ dest: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'Compact<u128>',
+ },
+ transfer_all: {
+ dest: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ keepAlive: 'bool',
+ },
+ transfer_keep_alive: {
+ dest: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'Compact<u128>',
+ },
+ force_transfer: {
+ source: 'MultiAddress',
+ dest: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ amount: 'Compact<u128>',
+ },
+ set_balance: {
+ who: 'MultiAddress',
+ currencyId: 'PalletForeignAssetsAssetIds',
+ newFree: 'Compact<u128>',
+ newReserved: 'Compact<u128>'
+ }
+ }
+ },
+ /**
+ * Lookup205: cumulus_pallet_xcmp_queue::pallet::Call<T>
+ **/
CumulusPalletXcmpQueueCall: {
_enum: {
service_overweight: {
@@ -1611,7 +1836,7 @@
}
},
/**
- * Lookup195: pallet_xcm::pallet::Call<T>
+ * Lookup206: pallet_xcm::pallet::Call<T>
**/
PalletXcmCall: {
_enum: {
@@ -1665,7 +1890,7 @@
}
},
/**
- * Lookup196: xcm::VersionedXcm<Call>
+ * Lookup207: xcm::VersionedXcm<Call>
**/
XcmVersionedXcm: {
_enum: {
@@ -1675,7 +1900,7 @@
}
},
/**
- * Lookup197: xcm::v0::Xcm<Call>
+ * Lookup208: xcm::v0::Xcm<Call>
**/
XcmV0Xcm: {
_enum: {
@@ -1729,7 +1954,7 @@
}
},
/**
- * Lookup199: xcm::v0::order::Order<Call>
+ * Lookup210: xcm::v0::order::Order<Call>
**/
XcmV0Order: {
_enum: {
@@ -1772,7 +1997,7 @@
}
},
/**
- * Lookup201: xcm::v0::Response
+ * Lookup212: xcm::v0::Response
**/
XcmV0Response: {
_enum: {
@@ -1780,7 +2005,7 @@
}
},
/**
- * Lookup202: xcm::v1::Xcm<Call>
+ * Lookup213: xcm::v1::Xcm<Call>
**/
XcmV1Xcm: {
_enum: {
@@ -1839,7 +2064,7 @@
}
},
/**
- * Lookup204: xcm::v1::order::Order<Call>
+ * Lookup215: xcm::v1::order::Order<Call>
**/
XcmV1Order: {
_enum: {
@@ -1884,7 +2109,7 @@
}
},
/**
- * Lookup206: xcm::v1::Response
+ * Lookup217: xcm::v1::Response
**/
XcmV1Response: {
_enum: {
@@ -1893,11 +2118,11 @@
}
},
/**
- * Lookup220: cumulus_pallet_xcm::pallet::Call<T>
+ * Lookup231: cumulus_pallet_xcm::pallet::Call<T>
**/
CumulusPalletXcmCall: 'Null',
/**
- * Lookup221: cumulus_pallet_dmp_queue::pallet::Call<T>
+ * Lookup232: cumulus_pallet_dmp_queue::pallet::Call<T>
**/
CumulusPalletDmpQueueCall: {
_enum: {
@@ -1908,7 +2133,7 @@
}
},
/**
- * Lookup222: pallet_inflation::pallet::Call<T>
+ * Lookup233: pallet_inflation::pallet::Call<T>
**/
PalletInflationCall: {
_enum: {
@@ -1918,7 +2143,7 @@
}
},
/**
- * Lookup223: pallet_unique::Call<T>
+ * Lookup234: pallet_unique::Call<T>
**/
PalletUniqueCall: {
_enum: {
@@ -2050,7 +2275,7 @@
}
},
/**
- * Lookup228: up_data_structs::CollectionMode
+ * Lookup239: up_data_structs::CollectionMode
**/
UpDataStructsCollectionMode: {
_enum: {
@@ -2060,7 +2285,7 @@
}
},
/**
- * Lookup229: up_data_structs::CreateCollectionData<sp_core::crypto::AccountId32>
+ * Lookup240: up_data_structs::CreateCollectionData<sp_core::crypto::AccountId32>
**/
UpDataStructsCreateCollectionData: {
mode: 'UpDataStructsCollectionMode',
@@ -2075,13 +2300,13 @@
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup231: up_data_structs::AccessMode
+ * Lookup242: up_data_structs::AccessMode
**/
UpDataStructsAccessMode: {
_enum: ['Normal', 'AllowList']
},
/**
- * Lookup233: up_data_structs::CollectionLimits
+ * Lookup244: up_data_structs::CollectionLimits
**/
UpDataStructsCollectionLimits: {
accountTokenOwnershipLimit: 'Option<u32>',
@@ -2095,7 +2320,7 @@
transfersEnabled: 'Option<bool>'
},
/**
- * Lookup235: up_data_structs::SponsoringRateLimit
+ * Lookup246: up_data_structs::SponsoringRateLimit
**/
UpDataStructsSponsoringRateLimit: {
_enum: {
@@ -2104,7 +2329,7 @@
}
},
/**
- * Lookup238: up_data_structs::CollectionPermissions
+ * Lookup249: up_data_structs::CollectionPermissions
**/
UpDataStructsCollectionPermissions: {
access: 'Option<UpDataStructsAccessMode>',
@@ -2112,7 +2337,7 @@
nesting: 'Option<UpDataStructsNestingPermissions>'
},
/**
- * Lookup240: up_data_structs::NestingPermissions
+ * Lookup251: up_data_structs::NestingPermissions
**/
UpDataStructsNestingPermissions: {
tokenOwner: 'bool',
@@ -2120,18 +2345,18 @@
restricted: 'Option<UpDataStructsOwnerRestrictedSet>'
},
/**
- * Lookup242: up_data_structs::OwnerRestrictedSet
+ * Lookup253: up_data_structs::OwnerRestrictedSet
**/
UpDataStructsOwnerRestrictedSet: 'BTreeSet<u32>',
/**
- * Lookup247: up_data_structs::PropertyKeyPermission
+ * Lookup258: up_data_structs::PropertyKeyPermission
**/
UpDataStructsPropertyKeyPermission: {
key: 'Bytes',
permission: 'UpDataStructsPropertyPermission'
},
/**
- * Lookup248: up_data_structs::PropertyPermission
+ * Lookup259: up_data_structs::PropertyPermission
**/
UpDataStructsPropertyPermission: {
mutable: 'bool',
@@ -2139,14 +2364,14 @@
tokenOwner: 'bool'
},
/**
- * Lookup251: up_data_structs::Property
+ * Lookup262: up_data_structs::Property
**/
UpDataStructsProperty: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup254: up_data_structs::CreateItemData
+ * Lookup265: up_data_structs::CreateItemData
**/
UpDataStructsCreateItemData: {
_enum: {
@@ -2156,26 +2381,26 @@
}
},
/**
- * Lookup255: up_data_structs::CreateNftData
+ * Lookup266: up_data_structs::CreateNftData
**/
UpDataStructsCreateNftData: {
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup256: up_data_structs::CreateFungibleData
+ * Lookup267: up_data_structs::CreateFungibleData
**/
UpDataStructsCreateFungibleData: {
value: 'u128'
},
/**
- * Lookup257: up_data_structs::CreateReFungibleData
+ * Lookup268: up_data_structs::CreateReFungibleData
**/
UpDataStructsCreateReFungibleData: {
pieces: 'u128',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup260: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup271: up_data_structs::CreateItemExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateItemExData: {
_enum: {
@@ -2186,14 +2411,14 @@
}
},
/**
- * Lookup262: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup273: up_data_structs::CreateNftExData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateNftExData: {
properties: 'Vec<UpDataStructsProperty>',
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup269: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup280: up_data_structs::CreateRefungibleExSingleOwner<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateRefungibleExSingleOwner: {
user: 'PalletEvmAccountBasicCrossAccountIdRepr',
@@ -2201,14 +2426,14 @@
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup271: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup282: up_data_structs::CreateRefungibleExMultipleOwners<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsCreateRefungibleExMultipleOwners: {
users: 'BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>',
properties: 'Vec<UpDataStructsProperty>'
},
/**
- * Lookup272: pallet_unique_scheduler::pallet::Call<T>
+ * Lookup283: pallet_unique_scheduler::pallet::Call<T>
**/
PalletUniqueSchedulerCall: {
_enum: {
@@ -2232,7 +2457,7 @@
}
},
/**
- * Lookup274: frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>
+ * Lookup285: frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>
**/
FrameSupportScheduleMaybeHashed: {
_enum: {
@@ -2241,7 +2466,7 @@
}
},
/**
- * Lookup275: pallet_configuration::pallet::Call<T>
+ * Lookup286: pallet_configuration::pallet::Call<T>
**/
PalletConfigurationCall: {
_enum: {
@@ -2254,15 +2479,15 @@
}
},
/**
- * Lookup276: pallet_template_transaction_payment::Call<T>
+ * Lookup287: pallet_template_transaction_payment::Call<T>
**/
PalletTemplateTransactionPaymentCall: 'Null',
/**
- * Lookup277: pallet_structure::pallet::Call<T>
+ * Lookup288: pallet_structure::pallet::Call<T>
**/
PalletStructureCall: 'Null',
/**
- * Lookup278: pallet_rmrk_core::pallet::Call<T>
+ * Lookup289: pallet_rmrk_core::pallet::Call<T>
**/
PalletRmrkCoreCall: {
_enum: {
@@ -2353,7 +2578,7 @@
}
},
/**
- * Lookup284: rmrk_traits::resource::ResourceTypes<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup295: rmrk_traits::resource::ResourceTypes<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceResourceTypes: {
_enum: {
@@ -2363,7 +2588,7 @@
}
},
/**
- * Lookup286: rmrk_traits::resource::BasicResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup297: rmrk_traits::resource::BasicResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceBasicResource: {
src: 'Option<Bytes>',
@@ -2372,7 +2597,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup288: rmrk_traits::resource::ComposableResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup299: rmrk_traits::resource::ComposableResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceComposableResource: {
parts: 'Vec<u32>',
@@ -2383,7 +2608,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup289: rmrk_traits::resource::SlotResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup300: rmrk_traits::resource::SlotResource<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceSlotResource: {
base: 'u32',
@@ -2394,7 +2619,7 @@
thumb: 'Option<Bytes>'
},
/**
- * Lookup292: pallet_rmrk_equip::pallet::Call<T>
+ * Lookup303: pallet_rmrk_equip::pallet::Call<T>
**/
PalletRmrkEquipCall: {
_enum: {
@@ -2415,7 +2640,7 @@
}
},
/**
- * Lookup295: rmrk_traits::part::PartType<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup306: rmrk_traits::part::PartType<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartPartType: {
_enum: {
@@ -2424,7 +2649,7 @@
}
},
/**
- * Lookup297: rmrk_traits::part::FixedPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup308: rmrk_traits::part::FixedPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartFixedPart: {
id: 'u32',
@@ -2432,7 +2657,7 @@
src: 'Bytes'
},
/**
- * Lookup298: rmrk_traits::part::SlotPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup309: rmrk_traits::part::SlotPart<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartSlotPart: {
id: 'u32',
@@ -2441,7 +2666,7 @@
z: 'u32'
},
/**
- * Lookup299: rmrk_traits::part::EquippableList<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup310: rmrk_traits::part::EquippableList<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPartEquippableList: {
_enum: {
@@ -2451,7 +2676,7 @@
}
},
/**
- * Lookup301: rmrk_traits::theme::Theme<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>, S>>
+ * Lookup312: rmrk_traits::theme::Theme<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>, S>>
**/
RmrkTraitsTheme: {
name: 'Bytes',
@@ -2459,14 +2684,14 @@
inherit: 'bool'
},
/**
- * Lookup303: rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup314: rmrk_traits::theme::ThemeProperty<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsThemeThemeProperty: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup305: pallet_app_promotion::pallet::Call<T>
+ * Lookup316: pallet_app_promotion::pallet::Call<T>
**/
PalletAppPromotionCall: {
_enum: {
@@ -2495,8 +2720,25 @@
}
},
/**
- * Lookup307: pallet_evm::pallet::Call<T>
+ * Lookup318: pallet_foreign_assets::module::Call<T>
**/
+ PalletForeignAssetsModuleCall: {
+ _enum: {
+ register_foreign_asset: {
+ owner: 'AccountId32',
+ location: 'XcmVersionedMultiLocation',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata',
+ },
+ update_foreign_asset: {
+ foreignAssetId: 'u32',
+ location: 'XcmVersionedMultiLocation',
+ metadata: 'PalletForeignAssetsModuleAssetMetadata'
+ }
+ }
+ },
+ /**
+ * Lookup319: pallet_evm::pallet::Call<T>
+ **/
PalletEvmCall: {
_enum: {
withdraw: {
@@ -2538,7 +2780,7 @@
}
},
/**
- * Lookup311: pallet_ethereum::pallet::Call<T>
+ * Lookup323: pallet_ethereum::pallet::Call<T>
**/
PalletEthereumCall: {
_enum: {
@@ -2548,7 +2790,7 @@
}
},
/**
- * Lookup312: ethereum::transaction::TransactionV2
+ * Lookup324: ethereum::transaction::TransactionV2
**/
EthereumTransactionTransactionV2: {
_enum: {
@@ -2558,7 +2800,7 @@
}
},
/**
- * Lookup313: ethereum::transaction::LegacyTransaction
+ * Lookup325: ethereum::transaction::LegacyTransaction
**/
EthereumTransactionLegacyTransaction: {
nonce: 'U256',
@@ -2570,7 +2812,7 @@
signature: 'EthereumTransactionTransactionSignature'
},
/**
- * Lookup314: ethereum::transaction::TransactionAction
+ * Lookup326: ethereum::transaction::TransactionAction
**/
EthereumTransactionTransactionAction: {
_enum: {
@@ -2579,7 +2821,7 @@
}
},
/**
- * Lookup315: ethereum::transaction::TransactionSignature
+ * Lookup327: ethereum::transaction::TransactionSignature
**/
EthereumTransactionTransactionSignature: {
v: 'u64',
@@ -2587,7 +2829,7 @@
s: 'H256'
},
/**
- * Lookup317: ethereum::transaction::EIP2930Transaction
+ * Lookup329: ethereum::transaction::EIP2930Transaction
**/
EthereumTransactionEip2930Transaction: {
chainId: 'u64',
@@ -2603,14 +2845,14 @@
s: 'H256'
},
/**
- * Lookup319: ethereum::transaction::AccessListItem
+ * Lookup331: ethereum::transaction::AccessListItem
**/
EthereumTransactionAccessListItem: {
address: 'H160',
storageKeys: 'Vec<H256>'
},
/**
- * Lookup320: ethereum::transaction::EIP1559Transaction
+ * Lookup332: ethereum::transaction::EIP1559Transaction
**/
EthereumTransactionEip1559Transaction: {
chainId: 'u64',
@@ -2627,7 +2869,7 @@
s: 'H256'
},
/**
- * Lookup321: pallet_evm_migration::pallet::Call<T>
+ * Lookup333: pallet_evm_migration::pallet::Call<T>
**/
PalletEvmMigrationCall: {
_enum: {
@@ -2645,39 +2887,73 @@
}
},
/**
- * Lookup324: pallet_sudo::pallet::Error<T>
+ * Lookup336: pallet_sudo::pallet::Error<T>
**/
PalletSudoError: {
_enum: ['RequireSudo']
},
/**
- * Lookup326: orml_vesting::module::Error<T>
+ * Lookup338: orml_vesting::module::Error<T>
**/
OrmlVestingModuleError: {
_enum: ['ZeroVestingPeriod', 'ZeroVestingPeriodCount', 'InsufficientBalanceToLock', 'TooManyVestingSchedules', 'AmountLow', 'MaxVestingSchedulesExceeded']
},
/**
- * Lookup328: cumulus_pallet_xcmp_queue::InboundChannelDetails
+ * Lookup339: orml_xtokens::module::Error<T>
+ **/
+ OrmlXtokensModuleError: {
+ _enum: ['AssetHasNoReserve', 'NotCrossChainTransfer', 'InvalidDest', 'NotCrossChainTransferableCurrency', 'UnweighableMessage', 'XcmExecutionFailed', 'CannotReanchor', 'InvalidAncestry', 'InvalidAsset', 'DestinationNotInvertible', 'BadVersion', 'DistinctReserveForAssetAndFee', 'ZeroFee', 'ZeroAmount', 'TooManyAssetsBeingSent', 'AssetIndexNonExistent', 'FeeNotEnough', 'NotSupportedMultiLocation', 'MinXcmFeeNotDefined']
+ },
+ /**
+ * Lookup342: orml_tokens::BalanceLock<Balance>
+ **/
+ OrmlTokensBalanceLock: {
+ id: '[u8;8]',
+ amount: 'u128'
+ },
+ /**
+ * Lookup344: orml_tokens::AccountData<Balance>
+ **/
+ OrmlTokensAccountData: {
+ free: 'u128',
+ reserved: 'u128',
+ frozen: 'u128'
+ },
+ /**
+ * Lookup346: orml_tokens::ReserveData<ReserveIdentifier, Balance>
**/
+ OrmlTokensReserveData: {
+ id: 'Null',
+ amount: 'u128'
+ },
+ /**
+ * Lookup348: orml_tokens::module::Error<T>
+ **/
+ OrmlTokensModuleError: {
+ _enum: ['BalanceTooLow', 'AmountIntoBalanceFailed', 'LiquidityRestrictions', 'MaxLocksExceeded', 'KeepAlive', 'ExistentialDeposit', 'DeadAccount', 'TooManyReserves']
+ },
+ /**
+ * Lookup350: cumulus_pallet_xcmp_queue::InboundChannelDetails
+ **/
CumulusPalletXcmpQueueInboundChannelDetails: {
sender: 'u32',
state: 'CumulusPalletXcmpQueueInboundState',
messageMetadata: 'Vec<(u32,PolkadotParachainPrimitivesXcmpMessageFormat)>'
},
/**
- * Lookup329: cumulus_pallet_xcmp_queue::InboundState
+ * Lookup351: cumulus_pallet_xcmp_queue::InboundState
**/
CumulusPalletXcmpQueueInboundState: {
_enum: ['Ok', 'Suspended']
},
/**
- * Lookup332: polkadot_parachain::primitives::XcmpMessageFormat
+ * Lookup354: polkadot_parachain::primitives::XcmpMessageFormat
**/
PolkadotParachainPrimitivesXcmpMessageFormat: {
_enum: ['ConcatenatedVersionedXcm', 'ConcatenatedEncodedBlob', 'Signals']
},
/**
- * Lookup335: cumulus_pallet_xcmp_queue::OutboundChannelDetails
+ * Lookup357: cumulus_pallet_xcmp_queue::OutboundChannelDetails
**/
CumulusPalletXcmpQueueOutboundChannelDetails: {
recipient: 'u32',
@@ -2687,13 +2963,13 @@
lastIndex: 'u16'
},
/**
- * Lookup336: cumulus_pallet_xcmp_queue::OutboundState
+ * Lookup358: cumulus_pallet_xcmp_queue::OutboundState
**/
CumulusPalletXcmpQueueOutboundState: {
_enum: ['Ok', 'Suspended']
},
/**
- * Lookup338: cumulus_pallet_xcmp_queue::QueueConfigData
+ * Lookup360: cumulus_pallet_xcmp_queue::QueueConfigData
**/
CumulusPalletXcmpQueueQueueConfigData: {
suspendThreshold: 'u32',
@@ -2704,29 +2980,29 @@
xcmpMaxIndividualWeight: 'u64'
},
/**
- * Lookup340: cumulus_pallet_xcmp_queue::pallet::Error<T>
+ * Lookup362: cumulus_pallet_xcmp_queue::pallet::Error<T>
**/
CumulusPalletXcmpQueueError: {
_enum: ['FailedToSend', 'BadXcmOrigin', 'BadXcm', 'BadOverweightIndex', 'WeightOverLimit']
},
/**
- * Lookup341: pallet_xcm::pallet::Error<T>
+ * Lookup363: pallet_xcm::pallet::Error<T>
**/
PalletXcmError: {
_enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed']
},
/**
- * Lookup342: cumulus_pallet_xcm::pallet::Error<T>
+ * Lookup364: cumulus_pallet_xcm::pallet::Error<T>
**/
CumulusPalletXcmError: 'Null',
/**
- * Lookup343: cumulus_pallet_dmp_queue::ConfigData
+ * Lookup365: cumulus_pallet_dmp_queue::ConfigData
**/
CumulusPalletDmpQueueConfigData: {
maxIndividual: 'u64'
},
/**
- * Lookup344: cumulus_pallet_dmp_queue::PageIndexData
+ * Lookup366: cumulus_pallet_dmp_queue::PageIndexData
**/
CumulusPalletDmpQueuePageIndexData: {
beginUsed: 'u32',
@@ -2734,19 +3010,19 @@
overweightCount: 'u64'
},
/**
- * Lookup347: cumulus_pallet_dmp_queue::pallet::Error<T>
+ * Lookup369: cumulus_pallet_dmp_queue::pallet::Error<T>
**/
CumulusPalletDmpQueueError: {
_enum: ['Unknown', 'OverLimit']
},
/**
- * Lookup351: pallet_unique::Error<T>
+ * Lookup373: pallet_unique::Error<T>
**/
PalletUniqueError: {
_enum: ['CollectionDecimalPointLimitExceeded', 'ConfirmUnsetSponsorFail', 'EmptyArgument', 'RepartitionCalledOnNonRefungibleCollection']
},
/**
- * Lookup354: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
+ * Lookup376: pallet_unique_scheduler::ScheduledV3<frame_support::traits::schedule::MaybeHashed<opal_runtime::Call, primitive_types::H256>, BlockNumber, opal_runtime::OriginCaller, sp_core::crypto::AccountId32>
**/
PalletUniqueSchedulerScheduledV3: {
maybeId: 'Option<[u8;16]>',
@@ -2756,7 +3032,7 @@
origin: 'OpalRuntimeOriginCaller'
},
/**
- * Lookup355: opal_runtime::OriginCaller
+ * Lookup377: opal_runtime::OriginCaller
**/
OpalRuntimeOriginCaller: {
_enum: {
@@ -2865,7 +3141,7 @@
}
},
/**
- * Lookup356: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
+ * Lookup378: frame_support::dispatch::RawOrigin<sp_core::crypto::AccountId32>
**/
FrameSupportDispatchRawOrigin: {
_enum: {
@@ -2875,7 +3151,7 @@
}
},
/**
- * Lookup357: pallet_xcm::pallet::Origin
+ * Lookup379: pallet_xcm::pallet::Origin
**/
PalletXcmOrigin: {
_enum: {
@@ -2884,7 +3160,7 @@
}
},
/**
- * Lookup358: cumulus_pallet_xcm::pallet::Origin
+ * Lookup380: cumulus_pallet_xcm::pallet::Origin
**/
CumulusPalletXcmOrigin: {
_enum: {
@@ -2893,7 +3169,7 @@
}
},
/**
- * Lookup359: pallet_ethereum::RawOrigin
+ * Lookup381: pallet_ethereum::RawOrigin
**/
PalletEthereumRawOrigin: {
_enum: {
@@ -2901,17 +3177,17 @@
}
},
/**
- * Lookup360: sp_core::Void
+ * Lookup382: sp_core::Void
**/
SpCoreVoid: 'Null',
/**
- * Lookup361: pallet_unique_scheduler::pallet::Error<T>
+ * Lookup383: pallet_unique_scheduler::pallet::Error<T>
**/
PalletUniqueSchedulerError: {
_enum: ['FailedToSchedule', 'NotFound', 'TargetBlockNumberInPast', 'RescheduleNoChange']
},
/**
- * Lookup362: up_data_structs::Collection<sp_core::crypto::AccountId32>
+ * Lookup384: up_data_structs::Collection<sp_core::crypto::AccountId32>
**/
UpDataStructsCollection: {
owner: 'AccountId32',
@@ -2922,10 +3198,10 @@
sponsorship: 'UpDataStructsSponsorshipStateAccountId32',
limits: 'UpDataStructsCollectionLimits',
permissions: 'UpDataStructsCollectionPermissions',
- externalCollection: 'bool'
+ flags: '[u8;1]'
},
/**
- * Lookup363: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
+ * Lookup385: up_data_structs::SponsorshipState<sp_core::crypto::AccountId32>
**/
UpDataStructsSponsorshipStateAccountId32: {
_enum: {
@@ -2935,7 +3211,7 @@
}
},
/**
- * Lookup364: up_data_structs::Properties
+ * Lookup387: up_data_structs::Properties
**/
UpDataStructsProperties: {
map: 'UpDataStructsPropertiesMapBoundedVec',
@@ -2943,15 +3219,15 @@
spaceLimit: 'u32'
},
/**
- * Lookup365: up_data_structs::PropertiesMap<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup388: up_data_structs::PropertiesMap<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
UpDataStructsPropertiesMapBoundedVec: 'BTreeMap<Bytes, Bytes>',
/**
- * Lookup370: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
+ * Lookup393: up_data_structs::PropertiesMap<up_data_structs::PropertyPermission>
**/
UpDataStructsPropertiesMapPropertyPermission: 'BTreeMap<Bytes, UpDataStructsPropertyPermission>',
/**
- * Lookup377: up_data_structs::CollectionStats
+ * Lookup400: up_data_structs::CollectionStats
**/
UpDataStructsCollectionStats: {
created: 'u32',
@@ -2959,18 +3235,18 @@
alive: 'u32'
},
/**
- * Lookup378: up_data_structs::TokenChild
+ * Lookup401: up_data_structs::TokenChild
**/
UpDataStructsTokenChild: {
token: 'u32',
collection: 'u32'
},
/**
- * Lookup379: PhantomType::up_data_structs<T>
+ * Lookup402: PhantomType::up_data_structs<T>
**/
PhantomTypeUpDataStructs: '[(UpDataStructsTokenData,UpDataStructsRpcCollection,RmrkTraitsCollectionCollectionInfo,RmrkTraitsNftNftInfo,RmrkTraitsResourceResourceInfo,RmrkTraitsPropertyPropertyInfo,RmrkTraitsBaseBaseInfo,RmrkTraitsPartPartType,RmrkTraitsTheme,RmrkTraitsNftNftChild);0]',
/**
- * Lookup381: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup404: up_data_structs::TokenData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsTokenData: {
properties: 'Vec<UpDataStructsProperty>',
@@ -2978,7 +3254,7 @@
pieces: 'u128'
},
/**
- * Lookup383: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
+ * Lookup406: up_data_structs::RpcCollection<sp_core::crypto::AccountId32>
**/
UpDataStructsRpcCollection: {
owner: 'AccountId32',
@@ -2991,10 +3267,11 @@
permissions: 'UpDataStructsCollectionPermissions',
tokenPropertyPermissions: 'Vec<UpDataStructsPropertyKeyPermission>',
properties: 'Vec<UpDataStructsProperty>',
- readOnly: 'bool'
+ readOnly: 'bool',
+ foreign: 'bool'
},
/**
- * Lookup384: rmrk_traits::collection::CollectionInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
+ * Lookup407: rmrk_traits::collection::CollectionInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_core::crypto::AccountId32>
**/
RmrkTraitsCollectionCollectionInfo: {
issuer: 'AccountId32',
@@ -3004,7 +3281,7 @@
nftsCount: 'u32'
},
/**
- * Lookup385: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup408: rmrk_traits::nft::NftInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsNftNftInfo: {
owner: 'RmrkTraitsNftAccountIdOrCollectionNftTuple',
@@ -3014,14 +3291,14 @@
pending: 'bool'
},
/**
- * Lookup387: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
+ * Lookup410: rmrk_traits::nft::RoyaltyInfo<sp_core::crypto::AccountId32, sp_arithmetic::per_things::Permill>
**/
RmrkTraitsNftRoyaltyInfo: {
recipient: 'AccountId32',
amount: 'Permill'
},
/**
- * Lookup388: rmrk_traits::resource::ResourceInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup411: rmrk_traits::resource::ResourceInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsResourceResourceInfo: {
id: 'u32',
@@ -3030,14 +3307,14 @@
pendingRemoval: 'bool'
},
/**
- * Lookup389: rmrk_traits::property::PropertyInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup412: rmrk_traits::property::PropertyInfo<sp_runtime::bounded::bounded_vec::BoundedVec<T, S>, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsPropertyPropertyInfo: {
key: 'Bytes',
value: 'Bytes'
},
/**
- * Lookup390: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
+ * Lookup413: rmrk_traits::base::BaseInfo<sp_core::crypto::AccountId32, sp_runtime::bounded::bounded_vec::BoundedVec<T, S>>
**/
RmrkTraitsBaseBaseInfo: {
issuer: 'AccountId32',
@@ -3045,86 +3322,92 @@
symbol: 'Bytes'
},
/**
- * Lookup391: rmrk_traits::nft::NftChild
+ * Lookup414: rmrk_traits::nft::NftChild
**/
RmrkTraitsNftNftChild: {
collectionId: 'u32',
nftId: 'u32'
},
/**
- * Lookup393: pallet_common::pallet::Error<T>
+ * Lookup416: pallet_common::pallet::Error<T>
**/
PalletCommonError: {
_enum: ['CollectionNotFound', 'MustBeTokenOwner', 'NoPermission', 'CantDestroyNotEmptyCollection', 'PublicMintingNotAllowed', 'AddressNotInAllowlist', 'CollectionNameLimitExceeded', 'CollectionDescriptionLimitExceeded', 'CollectionTokenPrefixLimitExceeded', 'TotalCollectionsLimitExceeded', 'CollectionAdminCountExceeded', 'CollectionLimitBoundsExceeded', 'OwnerPermissionsCantBeReverted', 'TransferNotAllowed', 'AccountTokenLimitExceeded', 'CollectionTokenLimitExceeded', 'MetadataFlagFrozen', 'TokenNotFound', 'TokenValueTooLow', 'ApprovedValueTooLow', 'CantApproveMoreThanOwned', 'AddressIsZero', 'UnsupportedOperation', 'NotSufficientFounds', 'UserIsNotAllowedToNest', 'SourceCollectionIsNotAllowedToNest', 'CollectionFieldSizeExceeded', 'NoSpaceForProperty', 'PropertyLimitReached', 'PropertyKeyIsTooLong', 'InvalidCharacterInPropertyKey', 'EmptyPropertyKey', 'CollectionIsExternal', 'CollectionIsInternal']
},
/**
- * Lookup395: pallet_fungible::pallet::Error<T>
+ * Lookup418: pallet_fungible::pallet::Error<T>
**/
PalletFungibleError: {
_enum: ['NotFungibleDataUsedToMintFungibleCollectionToken', 'FungibleItemsHaveNoId', 'FungibleItemsDontHaveData', 'FungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup396: pallet_refungible::ItemData
+ * Lookup419: pallet_refungible::ItemData
**/
PalletRefungibleItemData: {
constData: 'Bytes'
},
/**
- * Lookup401: pallet_refungible::pallet::Error<T>
+ * Lookup424: pallet_refungible::pallet::Error<T>
**/
PalletRefungibleError: {
_enum: ['NotRefungibleDataUsedToMintFungibleCollectionToken', 'WrongRefungiblePieces', 'RepartitionWhileNotOwningAllPieces', 'RefungibleDisallowsNesting', 'SettingPropertiesNotAllowed']
},
/**
- * Lookup402: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup425: pallet_nonfungible::ItemData<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
PalletNonfungibleItemData: {
owner: 'PalletEvmAccountBasicCrossAccountIdRepr'
},
/**
- * Lookup404: up_data_structs::PropertyScope
+ * Lookup427: up_data_structs::PropertyScope
**/
UpDataStructsPropertyScope: {
_enum: ['None', 'Rmrk']
},
/**
- * Lookup406: pallet_nonfungible::pallet::Error<T>
+ * Lookup429: pallet_nonfungible::pallet::Error<T>
**/
PalletNonfungibleError: {
_enum: ['NotNonfungibleDataUsedToMintFungibleCollectionToken', 'NonfungibleItemsHaveNoAmount', 'CantBurnNftWithChildren']
},
/**
- * Lookup407: pallet_structure::pallet::Error<T>
+ * Lookup430: pallet_structure::pallet::Error<T>
**/
PalletStructureError: {
_enum: ['OuroborosDetected', 'DepthLimit', 'BreadthLimit', 'TokenNotFound']
},
/**
- * Lookup408: pallet_rmrk_core::pallet::Error<T>
+ * Lookup431: pallet_rmrk_core::pallet::Error<T>
**/
PalletRmrkCoreError: {
_enum: ['CorruptedCollectionType', 'RmrkPropertyKeyIsTooLong', 'RmrkPropertyValueIsTooLong', 'RmrkPropertyIsNotFound', 'UnableToDecodeRmrkData', 'CollectionNotEmpty', 'NoAvailableCollectionId', 'NoAvailableNftId', 'CollectionUnknown', 'NoPermission', 'NonTransferable', 'CollectionFullOrLocked', 'ResourceDoesntExist', 'CannotSendToDescendentOrSelf', 'CannotAcceptNonOwnedNft', 'CannotRejectNonOwnedNft', 'CannotRejectNonPendingNft', 'ResourceNotPending', 'NoAvailableResourceId']
},
/**
- * Lookup410: pallet_rmrk_equip::pallet::Error<T>
+ * Lookup433: pallet_rmrk_equip::pallet::Error<T>
**/
PalletRmrkEquipError: {
_enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart']
},
/**
- * Lookup416: pallet_app_promotion::pallet::Error<T>
+ * Lookup439: pallet_app_promotion::pallet::Error<T>
**/
PalletAppPromotionError: {
_enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFunds', 'PendingForBlockOverflow', 'SponsorNotSet', 'IncorrectLockedBalanceOperation']
},
/**
- * Lookup419: pallet_evm::pallet::Error<T>
+ * Lookup440: pallet_foreign_assets::module::Error<T>
+ **/
+ PalletForeignAssetsModuleError: {
+ _enum: ['BadLocation', 'MultiLocationExisted', 'AssetIdNotExists', 'AssetIdExisted']
+ },
+ /**
+ * Lookup443: pallet_evm::pallet::Error<T>
**/
PalletEvmError: {
_enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']
},
/**
- * Lookup422: fp_rpc::TransactionStatus
+ * Lookup446: fp_rpc::TransactionStatus
**/
FpRpcTransactionStatus: {
transactionHash: 'H256',
@@ -3136,11 +3419,11 @@
logsBloom: 'EthbloomBloom'
},
/**
- * Lookup424: ethbloom::Bloom
+ * Lookup448: ethbloom::Bloom
**/
EthbloomBloom: '[u8;256]',
/**
- * Lookup426: ethereum::receipt::ReceiptV3
+ * Lookup450: ethereum::receipt::ReceiptV3
**/
EthereumReceiptReceiptV3: {
_enum: {
@@ -3150,7 +3433,7 @@
}
},
/**
- * Lookup427: ethereum::receipt::EIP658ReceiptData
+ * Lookup451: ethereum::receipt::EIP658ReceiptData
**/
EthereumReceiptEip658ReceiptData: {
statusCode: 'u8',
@@ -3159,7 +3442,7 @@
logs: 'Vec<EthereumLog>'
},
/**
- * Lookup428: ethereum::block::Block<ethereum::transaction::TransactionV2>
+ * Lookup452: ethereum::block::Block<ethereum::transaction::TransactionV2>
**/
EthereumBlock: {
header: 'EthereumHeader',
@@ -3167,7 +3450,7 @@
ommers: 'Vec<EthereumHeader>'
},
/**
- * Lookup429: ethereum::header::Header
+ * Lookup453: ethereum::header::Header
**/
EthereumHeader: {
parentHash: 'H256',
@@ -3187,23 +3470,23 @@
nonce: 'EthereumTypesHashH64'
},
/**
- * Lookup430: ethereum_types::hash::H64
+ * Lookup454: ethereum_types::hash::H64
**/
EthereumTypesHashH64: '[u8;8]',
/**
- * Lookup435: pallet_ethereum::pallet::Error<T>
+ * Lookup459: pallet_ethereum::pallet::Error<T>
**/
PalletEthereumError: {
_enum: ['InvalidSignature', 'PreLogExists']
},
/**
- * Lookup436: pallet_evm_coder_substrate::pallet::Error<T>
+ * Lookup460: pallet_evm_coder_substrate::pallet::Error<T>
**/
PalletEvmCoderSubstrateError: {
_enum: ['OutOfGas', 'OutOfFund']
},
/**
- * Lookup437: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup461: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {
_enum: {
@@ -3213,25 +3496,25 @@
}
},
/**
- * Lookup438: pallet_evm_contract_helpers::SponsoringModeT
+ * Lookup462: pallet_evm_contract_helpers::SponsoringModeT
**/
PalletEvmContractHelpersSponsoringModeT: {
_enum: ['Disabled', 'Allowlisted', 'Generous']
},
/**
- * Lookup440: pallet_evm_contract_helpers::pallet::Error<T>
+ * Lookup468: pallet_evm_contract_helpers::pallet::Error<T>
**/
PalletEvmContractHelpersError: {
- _enum: ['NoPermission', 'NoPendingSponsor']
+ _enum: ['NoPermission', 'NoPendingSponsor', 'TooManyMethodsHaveSponsoredLimit']
},
/**
- * Lookup441: pallet_evm_migration::pallet::Error<T>
+ * Lookup469: pallet_evm_migration::pallet::Error<T>
**/
PalletEvmMigrationError: {
_enum: ['AccountNotEmpty', 'AccountIsNotMigrating']
},
/**
- * Lookup443: sp_runtime::MultiSignature
+ * Lookup471: sp_runtime::MultiSignature
**/
SpRuntimeMultiSignature: {
_enum: {
@@ -3241,43 +3524,43 @@
}
},
/**
- * Lookup444: sp_core::ed25519::Signature
+ * Lookup472: sp_core::ed25519::Signature
**/
SpCoreEd25519Signature: '[u8;64]',
/**
- * Lookup446: sp_core::sr25519::Signature
+ * Lookup474: sp_core::sr25519::Signature
**/
SpCoreSr25519Signature: '[u8;64]',
/**
- * Lookup447: sp_core::ecdsa::Signature
+ * Lookup475: sp_core::ecdsa::Signature
**/
SpCoreEcdsaSignature: '[u8;65]',
/**
- * Lookup450: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+ * Lookup478: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
**/
FrameSystemExtensionsCheckSpecVersion: 'Null',
/**
- * Lookup451: frame_system::extensions::check_genesis::CheckGenesis<T>
+ * Lookup479: frame_system::extensions::check_genesis::CheckGenesis<T>
**/
FrameSystemExtensionsCheckGenesis: 'Null',
/**
- * Lookup454: frame_system::extensions::check_nonce::CheckNonce<T>
+ * Lookup482: frame_system::extensions::check_nonce::CheckNonce<T>
**/
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
/**
- * Lookup455: frame_system::extensions::check_weight::CheckWeight<T>
+ * Lookup483: frame_system::extensions::check_weight::CheckWeight<T>
**/
FrameSystemExtensionsCheckWeight: 'Null',
/**
- * Lookup456: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+ * Lookup484: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
**/
PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
- * Lookup457: opal_runtime::Runtime
+ * Lookup485: opal_runtime::Runtime
**/
OpalRuntimeRuntime: 'Null',
/**
- * Lookup458: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+ * Lookup486: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
**/
PalletEthereumFakeTransactionFinalizer: 'Null'
};
tests/src/interfaces/registry.tsdiffbeforeafterboth--- a/tests/src/interfaces/registry.ts
+++ b/tests/src/interfaces/registry.ts
@@ -5,7 +5,7 @@
// this is required to allow for ambient/previous definitions
import '@polkadot/types/types/registry';
-import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { CumulusPalletDmpQueueCall, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueueError, CumulusPalletDmpQueueEvent, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemCall, CumulusPalletParachainSystemError, CumulusPalletParachainSystemEvent, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmCall, CumulusPalletXcmError, CumulusPalletXcmEvent, CumulusPalletXcmOrigin, CumulusPalletXcmpQueueCall, CumulusPalletXcmpQueueError, CumulusPalletXcmpQueueEvent, CumulusPalletXcmpQueueInboundChannelDetails, CumulusPalletXcmpQueueInboundState, CumulusPalletXcmpQueueOutboundChannelDetails, CumulusPalletXcmpQueueOutboundState, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, EthbloomBloom, EthereumBlock, EthereumHeader, EthereumLog, EthereumReceiptEip658ReceiptData, EthereumReceiptReceiptV3, EthereumTransactionAccessListItem, EthereumTransactionEip1559Transaction, EthereumTransactionEip2930Transaction, EthereumTransactionLegacyTransaction, EthereumTransactionTransactionAction, EthereumTransactionTransactionSignature, EthereumTransactionTransactionV2, EthereumTypesHashH64, EvmCoreErrorExitError, EvmCoreErrorExitFatal, EvmCoreErrorExitReason, EvmCoreErrorExitRevert, EvmCoreErrorExitSucceed, FpRpcTransactionStatus, FrameSupportDispatchRawOrigin, FrameSupportPalletId, FrameSupportScheduleLookupError, FrameSupportScheduleMaybeHashed, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchClass, FrameSupportWeightsDispatchInfo, FrameSupportWeightsPays, FrameSupportWeightsPerDispatchClassU32, FrameSupportWeightsPerDispatchClassU64, FrameSupportWeightsPerDispatchClassWeightsPerClass, FrameSupportWeightsRuntimeDbWeight, FrameSystemAccountInfo, FrameSystemCall, FrameSystemError, FrameSystemEvent, FrameSystemEventRecord, FrameSystemExtensionsCheckGenesis, FrameSystemExtensionsCheckNonce, FrameSystemExtensionsCheckSpecVersion, FrameSystemExtensionsCheckWeight, FrameSystemLastRuntimeUpgradeInfo, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, FrameSystemLimitsWeightsPerClass, FrameSystemPhase, OpalRuntimeOriginCaller, OpalRuntimeRuntime, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensModuleCall, OrmlTokensModuleError, OrmlTokensModuleEvent, OrmlTokensReserveData, OrmlVestingModuleCall, OrmlVestingModuleError, OrmlVestingModuleEvent, OrmlVestingVestingSchedule, OrmlXtokensModuleCall, OrmlXtokensModuleError, OrmlXtokensModuleEvent, PalletAppPromotionCall, PalletAppPromotionError, PalletAppPromotionEvent, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesCall, PalletBalancesError, PalletBalancesEvent, PalletBalancesReasons, PalletBalancesReleases, PalletBalancesReserveData, PalletCommonError, PalletCommonEvent, PalletConfigurationCall, PalletEthereumCall, PalletEthereumError, PalletEthereumEvent, PalletEthereumFakeTransactionFinalizer, PalletEthereumRawOrigin, PalletEvmAccountBasicCrossAccountIdRepr, PalletEvmCall, PalletEvmCoderSubstrateError, PalletEvmContractHelpersError, PalletEvmContractHelpersEvent, PalletEvmContractHelpersSponsoringModeT, PalletEvmError, PalletEvmEvent, PalletEvmMigrationCall, PalletEvmMigrationError, PalletForeignAssetsAssetIds, PalletForeignAssetsModuleAssetMetadata, PalletForeignAssetsModuleCall, PalletForeignAssetsModuleError, PalletForeignAssetsModuleEvent, PalletForeignAssetsNativeCurrency, PalletFungibleError, PalletInflationCall, PalletNonfungibleError, PalletNonfungibleItemData, PalletRefungibleError, PalletRefungibleItemData, PalletRmrkCoreCall, PalletRmrkCoreError, PalletRmrkCoreEvent, PalletRmrkEquipCall, PalletRmrkEquipError, PalletRmrkEquipEvent, PalletStructureCall, PalletStructureError, PalletStructureEvent, PalletSudoCall, PalletSudoError, PalletSudoEvent, PalletTemplateTransactionPaymentCall, PalletTemplateTransactionPaymentChargeTransactionPayment, PalletTimestampCall, PalletTransactionPaymentEvent, PalletTransactionPaymentReleases, PalletTreasuryCall, PalletTreasuryError, PalletTreasuryEvent, PalletTreasuryProposal, PalletUniqueCall, PalletUniqueError, PalletUniqueRawEvent, PalletUniqueSchedulerCall, PalletUniqueSchedulerError, PalletUniqueSchedulerEvent, PalletUniqueSchedulerScheduledV3, PalletXcmCall, PalletXcmError, PalletXcmEvent, PalletXcmOrigin, PhantomTypeUpDataStructs, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotCorePrimitivesOutboundHrmpMessage, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV2AbridgedHostConfiguration, PolkadotPrimitivesV2AbridgedHrmpChannel, PolkadotPrimitivesV2PersistedValidationData, PolkadotPrimitivesV2UpgradeRestriction, RmrkTraitsBaseBaseInfo, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftAccountIdOrCollectionNftTuple, RmrkTraitsNftNftChild, RmrkTraitsNftNftInfo, RmrkTraitsNftRoyaltyInfo, RmrkTraitsPartEquippableList, RmrkTraitsPartFixedPart, RmrkTraitsPartPartType, RmrkTraitsPartSlotPart, RmrkTraitsPropertyPropertyInfo, RmrkTraitsResourceBasicResource, RmrkTraitsResourceComposableResource, RmrkTraitsResourceResourceInfo, RmrkTraitsResourceResourceTypes, RmrkTraitsResourceSlotResource, RmrkTraitsTheme, RmrkTraitsThemeThemeProperty, SpCoreEcdsaSignature, SpCoreEd25519Signature, SpCoreSr25519Signature, SpCoreVoid, SpRuntimeArithmeticError, SpRuntimeDigest, SpRuntimeDigestDigestItem, SpRuntimeDispatchError, SpRuntimeModuleError, SpRuntimeMultiSignature, SpRuntimeTokenError, SpRuntimeTransactionalError, SpTrieStorageProof, SpVersionRuntimeVersion, UpDataStructsAccessMode, UpDataStructsCollection, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCollectionPermissions, UpDataStructsCollectionStats, UpDataStructsCreateCollectionData, UpDataStructsCreateFungibleData, UpDataStructsCreateItemData, UpDataStructsCreateItemExData, UpDataStructsCreateNftData, UpDataStructsCreateNftExData, UpDataStructsCreateReFungibleData, UpDataStructsCreateRefungibleExMultipleOwners, UpDataStructsCreateRefungibleExSingleOwner, UpDataStructsNestingPermissions, UpDataStructsOwnerRestrictedSet, UpDataStructsProperties, UpDataStructsPropertiesMapBoundedVec, UpDataStructsPropertiesMapPropertyPermission, UpDataStructsProperty, UpDataStructsPropertyKeyPermission, UpDataStructsPropertyPermission, UpDataStructsPropertyScope, UpDataStructsRpcCollection, UpDataStructsSponsoringRateLimit, UpDataStructsSponsorshipStateAccountId32, UpDataStructsSponsorshipStateBasicCrossAccountIdRepr, UpDataStructsTokenChild, UpDataStructsTokenData, XcmDoubleEncoded, XcmV0Junction, XcmV0JunctionBodyId, XcmV0JunctionBodyPart, XcmV0JunctionNetworkId, XcmV0MultiAsset, XcmV0MultiLocation, XcmV0Order, XcmV0OriginKind, XcmV0Response, XcmV0Xcm, XcmV1Junction, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetAssetId, XcmV1MultiassetAssetInstance, XcmV1MultiassetFungibility, XcmV1MultiassetMultiAssetFilter, XcmV1MultiassetMultiAssets, XcmV1MultiassetWildFungibility, XcmV1MultiassetWildMultiAsset, XcmV1MultilocationJunctions, XcmV1Order, XcmV1Response, XcmV1Xcm, XcmV2Instruction, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2WeightLimit, XcmV2Xcm, XcmVersionedMultiAsset, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
declare module '@polkadot/types/types/registry' {
interface InterfaceTypes {
@@ -79,10 +79,19 @@
FrameSystemPhase: FrameSystemPhase;
OpalRuntimeOriginCaller: OpalRuntimeOriginCaller;
OpalRuntimeRuntime: OpalRuntimeRuntime;
+ OrmlTokensAccountData: OrmlTokensAccountData;
+ OrmlTokensBalanceLock: OrmlTokensBalanceLock;
+ OrmlTokensModuleCall: OrmlTokensModuleCall;
+ OrmlTokensModuleError: OrmlTokensModuleError;
+ OrmlTokensModuleEvent: OrmlTokensModuleEvent;
+ OrmlTokensReserveData: OrmlTokensReserveData;
OrmlVestingModuleCall: OrmlVestingModuleCall;
OrmlVestingModuleError: OrmlVestingModuleError;
OrmlVestingModuleEvent: OrmlVestingModuleEvent;
OrmlVestingVestingSchedule: OrmlVestingVestingSchedule;
+ OrmlXtokensModuleCall: OrmlXtokensModuleCall;
+ OrmlXtokensModuleError: OrmlXtokensModuleError;
+ OrmlXtokensModuleEvent: OrmlXtokensModuleEvent;
PalletAppPromotionCall: PalletAppPromotionCall;
PalletAppPromotionError: PalletAppPromotionError;
PalletAppPromotionEvent: PalletAppPromotionEvent;
@@ -112,6 +121,12 @@
PalletEvmEvent: PalletEvmEvent;
PalletEvmMigrationCall: PalletEvmMigrationCall;
PalletEvmMigrationError: PalletEvmMigrationError;
+ PalletForeignAssetsAssetIds: PalletForeignAssetsAssetIds;
+ PalletForeignAssetsModuleAssetMetadata: PalletForeignAssetsModuleAssetMetadata;
+ PalletForeignAssetsModuleCall: PalletForeignAssetsModuleCall;
+ PalletForeignAssetsModuleError: PalletForeignAssetsModuleError;
+ PalletForeignAssetsModuleEvent: PalletForeignAssetsModuleEvent;
+ PalletForeignAssetsNativeCurrency: PalletForeignAssetsNativeCurrency;
PalletFungibleError: PalletFungibleError;
PalletInflationCall: PalletInflationCall;
PalletNonfungibleError: PalletNonfungibleError;
@@ -252,6 +267,7 @@
XcmV2TraitsOutcome: XcmV2TraitsOutcome;
XcmV2WeightLimit: XcmV2WeightLimit;
XcmV2Xcm: XcmV2Xcm;
+ XcmVersionedMultiAsset: XcmVersionedMultiAsset;
XcmVersionedMultiAssets: XcmVersionedMultiAssets;
XcmVersionedMultiLocation: XcmVersionedMultiLocation;
XcmVersionedXcm: XcmVersionedXcm;
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -351,7 +351,279 @@
readonly perPeriod: Compact<u128>;
}
- /** @name CumulusPalletXcmpQueueEvent (39) */
+ /** @name OrmlXtokensModuleEvent (39) */
+ interface OrmlXtokensModuleEvent extends Enum {
+ readonly isTransferredMultiAssets: boolean;
+ readonly asTransferredMultiAssets: {
+ readonly sender: AccountId32;
+ readonly assets: XcmV1MultiassetMultiAssets;
+ readonly fee: XcmV1MultiAsset;
+ readonly dest: XcmV1MultiLocation;
+ } & Struct;
+ readonly type: 'TransferredMultiAssets';
+ }
+
+ /** @name XcmV1MultiassetMultiAssets (40) */
+ interface XcmV1MultiassetMultiAssets extends Vec<XcmV1MultiAsset> {}
+
+ /** @name XcmV1MultiAsset (42) */
+ interface XcmV1MultiAsset extends Struct {
+ readonly id: XcmV1MultiassetAssetId;
+ readonly fun: XcmV1MultiassetFungibility;
+ }
+
+ /** @name XcmV1MultiassetAssetId (43) */
+ interface XcmV1MultiassetAssetId extends Enum {
+ readonly isConcrete: boolean;
+ readonly asConcrete: XcmV1MultiLocation;
+ readonly isAbstract: boolean;
+ readonly asAbstract: Bytes;
+ readonly type: 'Concrete' | 'Abstract';
+ }
+
+ /** @name XcmV1MultiLocation (44) */
+ interface XcmV1MultiLocation extends Struct {
+ readonly parents: u8;
+ readonly interior: XcmV1MultilocationJunctions;
+ }
+
+ /** @name XcmV1MultilocationJunctions (45) */
+ interface XcmV1MultilocationJunctions extends Enum {
+ readonly isHere: boolean;
+ readonly isX1: boolean;
+ readonly asX1: XcmV1Junction;
+ readonly isX2: boolean;
+ readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>;
+ readonly isX3: boolean;
+ readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
+ readonly isX4: boolean;
+ readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
+ readonly isX5: boolean;
+ readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
+ readonly isX6: boolean;
+ readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
+ readonly isX7: boolean;
+ readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
+ readonly isX8: boolean;
+ readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
+ readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';
+ }
+
+ /** @name XcmV1Junction (46) */
+ interface XcmV1Junction extends Enum {
+ readonly isParachain: boolean;
+ readonly asParachain: Compact<u32>;
+ readonly isAccountId32: boolean;
+ readonly asAccountId32: {
+ readonly network: XcmV0JunctionNetworkId;
+ readonly id: U8aFixed;
+ } & Struct;
+ readonly isAccountIndex64: boolean;
+ readonly asAccountIndex64: {
+ readonly network: XcmV0JunctionNetworkId;
+ readonly index: Compact<u64>;
+ } & Struct;
+ readonly isAccountKey20: boolean;
+ readonly asAccountKey20: {
+ readonly network: XcmV0JunctionNetworkId;
+ readonly key: U8aFixed;
+ } & Struct;
+ readonly isPalletInstance: boolean;
+ readonly asPalletInstance: u8;
+ readonly isGeneralIndex: boolean;
+ readonly asGeneralIndex: Compact<u128>;
+ readonly isGeneralKey: boolean;
+ readonly asGeneralKey: Bytes;
+ readonly isOnlyChild: boolean;
+ readonly isPlurality: boolean;
+ readonly asPlurality: {
+ readonly id: XcmV0JunctionBodyId;
+ readonly part: XcmV0JunctionBodyPart;
+ } & Struct;
+ readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';
+ }
+
+ /** @name XcmV0JunctionNetworkId (48) */
+ interface XcmV0JunctionNetworkId extends Enum {
+ readonly isAny: boolean;
+ readonly isNamed: boolean;
+ readonly asNamed: Bytes;
+ readonly isPolkadot: boolean;
+ readonly isKusama: boolean;
+ readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';
+ }
+
+ /** @name XcmV0JunctionBodyId (52) */
+ interface XcmV0JunctionBodyId extends Enum {
+ readonly isUnit: boolean;
+ readonly isNamed: boolean;
+ readonly asNamed: Bytes;
+ readonly isIndex: boolean;
+ readonly asIndex: Compact<u32>;
+ readonly isExecutive: boolean;
+ readonly isTechnical: boolean;
+ readonly isLegislative: boolean;
+ readonly isJudicial: boolean;
+ readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial';
+ }
+
+ /** @name XcmV0JunctionBodyPart (53) */
+ interface XcmV0JunctionBodyPart extends Enum {
+ readonly isVoice: boolean;
+ readonly isMembers: boolean;
+ readonly asMembers: {
+ readonly count: Compact<u32>;
+ } & Struct;
+ readonly isFraction: boolean;
+ readonly asFraction: {
+ readonly nom: Compact<u32>;
+ readonly denom: Compact<u32>;
+ } & Struct;
+ readonly isAtLeastProportion: boolean;
+ readonly asAtLeastProportion: {
+ readonly nom: Compact<u32>;
+ readonly denom: Compact<u32>;
+ } & Struct;
+ readonly isMoreThanProportion: boolean;
+ readonly asMoreThanProportion: {
+ readonly nom: Compact<u32>;
+ readonly denom: Compact<u32>;
+ } & Struct;
+ readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';
+ }
+
+ /** @name XcmV1MultiassetFungibility (54) */
+ interface XcmV1MultiassetFungibility extends Enum {
+ readonly isFungible: boolean;
+ readonly asFungible: Compact<u128>;
+ readonly isNonFungible: boolean;
+ readonly asNonFungible: XcmV1MultiassetAssetInstance;
+ readonly type: 'Fungible' | 'NonFungible';
+ }
+
+ /** @name XcmV1MultiassetAssetInstance (55) */
+ interface XcmV1MultiassetAssetInstance extends Enum {
+ readonly isUndefined: boolean;
+ readonly isIndex: boolean;
+ readonly asIndex: Compact<u128>;
+ readonly isArray4: boolean;
+ readonly asArray4: U8aFixed;
+ readonly isArray8: boolean;
+ readonly asArray8: U8aFixed;
+ readonly isArray16: boolean;
+ readonly asArray16: U8aFixed;
+ readonly isArray32: boolean;
+ readonly asArray32: U8aFixed;
+ readonly isBlob: boolean;
+ readonly asBlob: Bytes;
+ readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';
+ }
+
+ /** @name OrmlTokensModuleEvent (58) */
+ interface OrmlTokensModuleEvent extends Enum {
+ readonly isEndowed: boolean;
+ readonly asEndowed: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isDustLost: boolean;
+ readonly asDustLost: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isTransfer: boolean;
+ readonly asTransfer: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly from: AccountId32;
+ readonly to: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isReserved: boolean;
+ readonly asReserved: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isUnreserved: boolean;
+ readonly asUnreserved: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isReserveRepatriated: boolean;
+ readonly asReserveRepatriated: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly from: AccountId32;
+ readonly to: AccountId32;
+ readonly amount: u128;
+ readonly status: FrameSupportTokensMiscBalanceStatus;
+ } & Struct;
+ readonly isBalanceSet: boolean;
+ readonly asBalanceSet: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly free: u128;
+ readonly reserved: u128;
+ } & Struct;
+ readonly isTotalIssuanceSet: boolean;
+ readonly asTotalIssuanceSet: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: u128;
+ } & Struct;
+ readonly isWithdrawn: boolean;
+ readonly asWithdrawn: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isSlashed: boolean;
+ readonly asSlashed: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly freeAmount: u128;
+ readonly reservedAmount: u128;
+ } & Struct;
+ readonly isDeposited: boolean;
+ readonly asDeposited: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isLockSet: boolean;
+ readonly asLockSet: {
+ readonly lockId: U8aFixed;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ readonly amount: u128;
+ } & Struct;
+ readonly isLockRemoved: boolean;
+ readonly asLockRemoved: {
+ readonly lockId: U8aFixed;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly who: AccountId32;
+ } & Struct;
+ readonly type: 'Endowed' | 'DustLost' | 'Transfer' | 'Reserved' | 'Unreserved' | 'ReserveRepatriated' | 'BalanceSet' | 'TotalIssuanceSet' | 'Withdrawn' | 'Slashed' | 'Deposited' | 'LockSet' | 'LockRemoved';
+ }
+
+ /** @name PalletForeignAssetsAssetIds (59) */
+ interface PalletForeignAssetsAssetIds extends Enum {
+ readonly isForeignAssetId: boolean;
+ readonly asForeignAssetId: u32;
+ readonly isNativeAssetId: boolean;
+ readonly asNativeAssetId: PalletForeignAssetsNativeCurrency;
+ readonly type: 'ForeignAssetId' | 'NativeAssetId';
+ }
+
+ /** @name PalletForeignAssetsNativeCurrency (60) */
+ interface PalletForeignAssetsNativeCurrency extends Enum {
+ readonly isHere: boolean;
+ readonly isParent: boolean;
+ readonly type: 'Here' | 'Parent';
+ }
+
+ /** @name CumulusPalletXcmpQueueEvent (61) */
interface CumulusPalletXcmpQueueEvent extends Enum {
readonly isSuccess: boolean;
readonly asSuccess: {
@@ -395,7 +667,7 @@
readonly type: 'Success' | 'Fail' | 'BadVersion' | 'BadFormat' | 'UpwardMessageSent' | 'XcmpMessageSent' | 'OverweightEnqueued' | 'OverweightServiced';
}
- /** @name XcmV2TraitsError (41) */
+ /** @name XcmV2TraitsError (63) */
interface XcmV2TraitsError extends Enum {
readonly isOverflow: boolean;
readonly isUnimplemented: boolean;
@@ -428,7 +700,7 @@
readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';
}
- /** @name PalletXcmEvent (43) */
+ /** @name PalletXcmEvent (65) */
interface PalletXcmEvent extends Enum {
readonly isAttempted: boolean;
readonly asAttempted: XcmV2TraitsOutcome;
@@ -465,7 +737,7 @@
readonly type: 'Attempted' | 'Sent' | 'UnexpectedResponse' | 'ResponseReady' | 'Notified' | 'NotifyOverweight' | 'NotifyDispatchError' | 'NotifyDecodeFailed' | 'InvalidResponder' | 'InvalidResponderVersion' | 'ResponseTaken' | 'AssetsTrapped' | 'VersionChangeNotified' | 'SupportedVersionChanged' | 'NotifyTargetSendFail' | 'NotifyTargetMigrationFail';
}
- /** @name XcmV2TraitsOutcome (44) */
+ /** @name XcmV2TraitsOutcome (66) */
interface XcmV2TraitsOutcome extends Enum {
readonly isComplete: boolean;
readonly asComplete: u64;
@@ -474,123 +746,12 @@
readonly isError: boolean;
readonly asError: XcmV2TraitsError;
readonly type: 'Complete' | 'Incomplete' | 'Error';
- }
-
- /** @name XcmV1MultiLocation (45) */
- interface XcmV1MultiLocation extends Struct {
- readonly parents: u8;
- readonly interior: XcmV1MultilocationJunctions;
}
- /** @name XcmV1MultilocationJunctions (46) */
- interface XcmV1MultilocationJunctions extends Enum {
- readonly isHere: boolean;
- readonly isX1: boolean;
- readonly asX1: XcmV1Junction;
- readonly isX2: boolean;
- readonly asX2: ITuple<[XcmV1Junction, XcmV1Junction]>;
- readonly isX3: boolean;
- readonly asX3: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
- readonly isX4: boolean;
- readonly asX4: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
- readonly isX5: boolean;
- readonly asX5: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
- readonly isX6: boolean;
- readonly asX6: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
- readonly isX7: boolean;
- readonly asX7: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
- readonly isX8: boolean;
- readonly asX8: ITuple<[XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction, XcmV1Junction]>;
- readonly type: 'Here' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';
- }
-
- /** @name XcmV1Junction (47) */
- interface XcmV1Junction extends Enum {
- readonly isParachain: boolean;
- readonly asParachain: Compact<u32>;
- readonly isAccountId32: boolean;
- readonly asAccountId32: {
- readonly network: XcmV0JunctionNetworkId;
- readonly id: U8aFixed;
- } & Struct;
- readonly isAccountIndex64: boolean;
- readonly asAccountIndex64: {
- readonly network: XcmV0JunctionNetworkId;
- readonly index: Compact<u64>;
- } & Struct;
- readonly isAccountKey20: boolean;
- readonly asAccountKey20: {
- readonly network: XcmV0JunctionNetworkId;
- readonly key: U8aFixed;
- } & Struct;
- readonly isPalletInstance: boolean;
- readonly asPalletInstance: u8;
- readonly isGeneralIndex: boolean;
- readonly asGeneralIndex: Compact<u128>;
- readonly isGeneralKey: boolean;
- readonly asGeneralKey: Bytes;
- readonly isOnlyChild: boolean;
- readonly isPlurality: boolean;
- readonly asPlurality: {
- readonly id: XcmV0JunctionBodyId;
- readonly part: XcmV0JunctionBodyPart;
- } & Struct;
- readonly type: 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';
- }
-
- /** @name XcmV0JunctionNetworkId (49) */
- interface XcmV0JunctionNetworkId extends Enum {
- readonly isAny: boolean;
- readonly isNamed: boolean;
- readonly asNamed: Bytes;
- readonly isPolkadot: boolean;
- readonly isKusama: boolean;
- readonly type: 'Any' | 'Named' | 'Polkadot' | 'Kusama';
- }
-
- /** @name XcmV0JunctionBodyId (53) */
- interface XcmV0JunctionBodyId extends Enum {
- readonly isUnit: boolean;
- readonly isNamed: boolean;
- readonly asNamed: Bytes;
- readonly isIndex: boolean;
- readonly asIndex: Compact<u32>;
- readonly isExecutive: boolean;
- readonly isTechnical: boolean;
- readonly isLegislative: boolean;
- readonly isJudicial: boolean;
- readonly type: 'Unit' | 'Named' | 'Index' | 'Executive' | 'Technical' | 'Legislative' | 'Judicial';
- }
-
- /** @name XcmV0JunctionBodyPart (54) */
- interface XcmV0JunctionBodyPart extends Enum {
- readonly isVoice: boolean;
- readonly isMembers: boolean;
- readonly asMembers: {
- readonly count: Compact<u32>;
- } & Struct;
- readonly isFraction: boolean;
- readonly asFraction: {
- readonly nom: Compact<u32>;
- readonly denom: Compact<u32>;
- } & Struct;
- readonly isAtLeastProportion: boolean;
- readonly asAtLeastProportion: {
- readonly nom: Compact<u32>;
- readonly denom: Compact<u32>;
- } & Struct;
- readonly isMoreThanProportion: boolean;
- readonly asMoreThanProportion: {
- readonly nom: Compact<u32>;
- readonly denom: Compact<u32>;
- } & Struct;
- readonly type: 'Voice' | 'Members' | 'Fraction' | 'AtLeastProportion' | 'MoreThanProportion';
- }
-
- /** @name XcmV2Xcm (55) */
+ /** @name XcmV2Xcm (67) */
interface XcmV2Xcm extends Vec<XcmV2Instruction> {}
- /** @name XcmV2Instruction (57) */
+ /** @name XcmV2Instruction (69) */
interface XcmV2Instruction extends Enum {
readonly isWithdrawAsset: boolean;
readonly asWithdrawAsset: XcmV1MultiassetMultiAssets;
@@ -709,53 +870,8 @@
readonly isUnsubscribeVersion: boolean;
readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';
}
-
- /** @name XcmV1MultiassetMultiAssets (58) */
- interface XcmV1MultiassetMultiAssets extends Vec<XcmV1MultiAsset> {}
- /** @name XcmV1MultiAsset (60) */
- interface XcmV1MultiAsset extends Struct {
- readonly id: XcmV1MultiassetAssetId;
- readonly fun: XcmV1MultiassetFungibility;
- }
-
- /** @name XcmV1MultiassetAssetId (61) */
- interface XcmV1MultiassetAssetId extends Enum {
- readonly isConcrete: boolean;
- readonly asConcrete: XcmV1MultiLocation;
- readonly isAbstract: boolean;
- readonly asAbstract: Bytes;
- readonly type: 'Concrete' | 'Abstract';
- }
-
- /** @name XcmV1MultiassetFungibility (62) */
- interface XcmV1MultiassetFungibility extends Enum {
- readonly isFungible: boolean;
- readonly asFungible: Compact<u128>;
- readonly isNonFungible: boolean;
- readonly asNonFungible: XcmV1MultiassetAssetInstance;
- readonly type: 'Fungible' | 'NonFungible';
- }
-
- /** @name XcmV1MultiassetAssetInstance (63) */
- interface XcmV1MultiassetAssetInstance extends Enum {
- readonly isUndefined: boolean;
- readonly isIndex: boolean;
- readonly asIndex: Compact<u128>;
- readonly isArray4: boolean;
- readonly asArray4: U8aFixed;
- readonly isArray8: boolean;
- readonly asArray8: U8aFixed;
- readonly isArray16: boolean;
- readonly asArray16: U8aFixed;
- readonly isArray32: boolean;
- readonly asArray32: U8aFixed;
- readonly isBlob: boolean;
- readonly asBlob: Bytes;
- readonly type: 'Undefined' | 'Index' | 'Array4' | 'Array8' | 'Array16' | 'Array32' | 'Blob';
- }
-
- /** @name XcmV2Response (66) */
+ /** @name XcmV2Response (70) */
interface XcmV2Response extends Enum {
readonly isNull: boolean;
readonly isAssets: boolean;
@@ -767,7 +883,7 @@
readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';
}
- /** @name XcmV0OriginKind (69) */
+ /** @name XcmV0OriginKind (73) */
interface XcmV0OriginKind extends Enum {
readonly isNative: boolean;
readonly isSovereignAccount: boolean;
@@ -776,12 +892,12 @@
readonly type: 'Native' | 'SovereignAccount' | 'Superuser' | 'Xcm';
}
- /** @name XcmDoubleEncoded (70) */
+ /** @name XcmDoubleEncoded (74) */
interface XcmDoubleEncoded extends Struct {
readonly encoded: Bytes;
}
- /** @name XcmV1MultiassetMultiAssetFilter (71) */
+ /** @name XcmV1MultiassetMultiAssetFilter (75) */
interface XcmV1MultiassetMultiAssetFilter extends Enum {
readonly isDefinite: boolean;
readonly asDefinite: XcmV1MultiassetMultiAssets;
@@ -790,7 +906,7 @@
readonly type: 'Definite' | 'Wild';
}
- /** @name XcmV1MultiassetWildMultiAsset (72) */
+ /** @name XcmV1MultiassetWildMultiAsset (76) */
interface XcmV1MultiassetWildMultiAsset extends Enum {
readonly isAll: boolean;
readonly isAllOf: boolean;
@@ -801,14 +917,14 @@
readonly type: 'All' | 'AllOf';
}
- /** @name XcmV1MultiassetWildFungibility (73) */
+ /** @name XcmV1MultiassetWildFungibility (77) */
interface XcmV1MultiassetWildFungibility extends Enum {
readonly isFungible: boolean;
readonly isNonFungible: boolean;
readonly type: 'Fungible' | 'NonFungible';
}
- /** @name XcmV2WeightLimit (74) */
+ /** @name XcmV2WeightLimit (78) */
interface XcmV2WeightLimit extends Enum {
readonly isUnlimited: boolean;
readonly isLimited: boolean;
@@ -816,7 +932,7 @@
readonly type: 'Unlimited' | 'Limited';
}
- /** @name XcmVersionedMultiAssets (76) */
+ /** @name XcmVersionedMultiAssets (80) */
interface XcmVersionedMultiAssets extends Enum {
readonly isV0: boolean;
readonly asV0: Vec<XcmV0MultiAsset>;
@@ -825,7 +941,7 @@
readonly type: 'V0' | 'V1';
}
- /** @name XcmV0MultiAsset (78) */
+ /** @name XcmV0MultiAsset (82) */
interface XcmV0MultiAsset extends Enum {
readonly isNone: boolean;
readonly isAll: boolean;
@@ -870,7 +986,7 @@
readonly type: 'None' | 'All' | 'AllFungible' | 'AllNonFungible' | 'AllAbstractFungible' | 'AllAbstractNonFungible' | 'AllConcreteFungible' | 'AllConcreteNonFungible' | 'AbstractFungible' | 'AbstractNonFungible' | 'ConcreteFungible' | 'ConcreteNonFungible';
}
- /** @name XcmV0MultiLocation (79) */
+ /** @name XcmV0MultiLocation (83) */
interface XcmV0MultiLocation extends Enum {
readonly isNull: boolean;
readonly isX1: boolean;
@@ -892,7 +1008,7 @@
readonly type: 'Null' | 'X1' | 'X2' | 'X3' | 'X4' | 'X5' | 'X6' | 'X7' | 'X8';
}
- /** @name XcmV0Junction (80) */
+ /** @name XcmV0Junction (84) */
interface XcmV0Junction extends Enum {
readonly isParent: boolean;
readonly isParachain: boolean;
@@ -927,7 +1043,7 @@
readonly type: 'Parent' | 'Parachain' | 'AccountId32' | 'AccountIndex64' | 'AccountKey20' | 'PalletInstance' | 'GeneralIndex' | 'GeneralKey' | 'OnlyChild' | 'Plurality';
}
- /** @name XcmVersionedMultiLocation (81) */
+ /** @name XcmVersionedMultiLocation (85) */
interface XcmVersionedMultiLocation extends Enum {
readonly isV0: boolean;
readonly asV0: XcmV0MultiLocation;
@@ -936,7 +1052,7 @@
readonly type: 'V0' | 'V1';
}
- /** @name CumulusPalletXcmEvent (82) */
+ /** @name CumulusPalletXcmEvent (86) */
interface CumulusPalletXcmEvent extends Enum {
readonly isInvalidFormat: boolean;
readonly asInvalidFormat: U8aFixed;
@@ -947,7 +1063,7 @@
readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward';
}
- /** @name CumulusPalletDmpQueueEvent (83) */
+ /** @name CumulusPalletDmpQueueEvent (87) */
interface CumulusPalletDmpQueueEvent extends Enum {
readonly isInvalidFormat: boolean;
readonly asInvalidFormat: {
@@ -982,7 +1098,7 @@
readonly type: 'InvalidFormat' | 'UnsupportedVersion' | 'ExecutedDownward' | 'WeightExhausted' | 'OverweightEnqueued' | 'OverweightServiced';
}
- /** @name PalletUniqueRawEvent (84) */
+ /** @name PalletUniqueRawEvent (88) */
interface PalletUniqueRawEvent extends Enum {
readonly isCollectionSponsorRemoved: boolean;
readonly asCollectionSponsorRemoved: u32;
@@ -1007,7 +1123,7 @@
readonly type: 'CollectionSponsorRemoved' | 'CollectionAdminAdded' | 'CollectionOwnedChanged' | 'CollectionSponsorSet' | 'SponsorshipConfirmed' | 'CollectionAdminRemoved' | 'AllowListAddressRemoved' | 'AllowListAddressAdded' | 'CollectionLimitSet' | 'CollectionPermissionSet';
}
- /** @name PalletEvmAccountBasicCrossAccountIdRepr (85) */
+ /** @name PalletEvmAccountBasicCrossAccountIdRepr (89) */
interface PalletEvmAccountBasicCrossAccountIdRepr extends Enum {
readonly isSubstrate: boolean;
readonly asSubstrate: AccountId32;
@@ -1016,7 +1132,7 @@
readonly type: 'Substrate' | 'Ethereum';
}
- /** @name PalletUniqueSchedulerEvent (88) */
+ /** @name PalletUniqueSchedulerEvent (92) */
interface PalletUniqueSchedulerEvent extends Enum {
readonly isScheduled: boolean;
readonly asScheduled: {
@@ -1043,14 +1159,14 @@
readonly type: 'Scheduled' | 'Canceled' | 'Dispatched' | 'CallLookupFailed';
}
- /** @name FrameSupportScheduleLookupError (91) */
+ /** @name FrameSupportScheduleLookupError (95) */
interface FrameSupportScheduleLookupError extends Enum {
readonly isUnknown: boolean;
readonly isBadFormat: boolean;
readonly type: 'Unknown' | 'BadFormat';
}
- /** @name PalletCommonEvent (92) */
+ /** @name PalletCommonEvent (96) */
interface PalletCommonEvent extends Enum {
readonly isCollectionCreated: boolean;
readonly asCollectionCreated: ITuple<[u32, u8, AccountId32]>;
@@ -1077,14 +1193,14 @@
readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'ItemCreated' | 'ItemDestroyed' | 'Transfer' | 'Approved' | 'CollectionPropertySet' | 'CollectionPropertyDeleted' | 'TokenPropertySet' | 'TokenPropertyDeleted' | 'PropertyPermissionSet';
}
- /** @name PalletStructureEvent (95) */
+ /** @name PalletStructureEvent (99) */
interface PalletStructureEvent extends Enum {
readonly isExecuted: boolean;
readonly asExecuted: Result<Null, SpRuntimeDispatchError>;
readonly type: 'Executed';
}
- /** @name PalletRmrkCoreEvent (96) */
+ /** @name PalletRmrkCoreEvent (100) */
interface PalletRmrkCoreEvent extends Enum {
readonly isCollectionCreated: boolean;
readonly asCollectionCreated: {
@@ -1174,7 +1290,7 @@
readonly type: 'CollectionCreated' | 'CollectionDestroyed' | 'IssuerChanged' | 'CollectionLocked' | 'NftMinted' | 'NftBurned' | 'NftSent' | 'NftAccepted' | 'NftRejected' | 'PropertySet' | 'ResourceAdded' | 'ResourceRemoval' | 'ResourceAccepted' | 'ResourceRemovalAccepted' | 'PrioritySet';
}
- /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (97) */
+ /** @name RmrkTraitsNftAccountIdOrCollectionNftTuple (101) */
interface RmrkTraitsNftAccountIdOrCollectionNftTuple extends Enum {
readonly isAccountId: boolean;
readonly asAccountId: AccountId32;
@@ -1183,7 +1299,7 @@
readonly type: 'AccountId' | 'CollectionAndNftTuple';
}
- /** @name PalletRmrkEquipEvent (102) */
+ /** @name PalletRmrkEquipEvent (106) */
interface PalletRmrkEquipEvent extends Enum {
readonly isBaseCreated: boolean;
readonly asBaseCreated: {
@@ -1198,7 +1314,7 @@
readonly type: 'BaseCreated' | 'EquippablesUpdated';
}
- /** @name PalletAppPromotionEvent (103) */
+ /** @name PalletAppPromotionEvent (107) */
interface PalletAppPromotionEvent extends Enum {
readonly isStakingRecalculation: boolean;
readonly asStakingRecalculation: ITuple<[AccountId32, u128, u128]>;
@@ -1211,7 +1327,42 @@
readonly type: 'StakingRecalculation' | 'Stake' | 'Unstake' | 'SetAdmin';
}
- /** @name PalletEvmEvent (104) */
+ /** @name PalletForeignAssetsModuleEvent (108) */
+ interface PalletForeignAssetsModuleEvent extends Enum {
+ readonly isForeignAssetRegistered: boolean;
+ readonly asForeignAssetRegistered: {
+ readonly assetId: u32;
+ readonly assetAddress: XcmV1MultiLocation;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly isForeignAssetUpdated: boolean;
+ readonly asForeignAssetUpdated: {
+ readonly assetId: u32;
+ readonly assetAddress: XcmV1MultiLocation;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly isAssetRegistered: boolean;
+ readonly asAssetRegistered: {
+ readonly assetId: PalletForeignAssetsAssetIds;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly isAssetUpdated: boolean;
+ readonly asAssetUpdated: {
+ readonly assetId: PalletForeignAssetsAssetIds;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly type: 'ForeignAssetRegistered' | 'ForeignAssetUpdated' | 'AssetRegistered' | 'AssetUpdated';
+ }
+
+ /** @name PalletForeignAssetsModuleAssetMetadata (109) */
+ interface PalletForeignAssetsModuleAssetMetadata extends Struct {
+ readonly name: Bytes;
+ readonly symbol: Bytes;
+ readonly decimals: u8;
+ readonly minimalBalance: u128;
+ }
+
+ /** @name PalletEvmEvent (110) */
interface PalletEvmEvent extends Enum {
readonly isLog: boolean;
readonly asLog: EthereumLog;
@@ -1230,21 +1381,21 @@
readonly type: 'Log' | 'Created' | 'CreatedFailed' | 'Executed' | 'ExecutedFailed' | 'BalanceDeposit' | 'BalanceWithdraw';
}
- /** @name EthereumLog (105) */
+ /** @name EthereumLog (111) */
interface EthereumLog extends Struct {
readonly address: H160;
readonly topics: Vec<H256>;
readonly data: Bytes;
}
- /** @name PalletEthereumEvent (109) */
+ /** @name PalletEthereumEvent (115) */
interface PalletEthereumEvent extends Enum {
readonly isExecuted: boolean;
readonly asExecuted: ITuple<[H160, H160, H256, EvmCoreErrorExitReason]>;
readonly type: 'Executed';
}
- /** @name EvmCoreErrorExitReason (110) */
+ /** @name EvmCoreErrorExitReason (116) */
interface EvmCoreErrorExitReason extends Enum {
readonly isSucceed: boolean;
readonly asSucceed: EvmCoreErrorExitSucceed;
@@ -1257,7 +1408,7 @@
readonly type: 'Succeed' | 'Error' | 'Revert' | 'Fatal';
}
- /** @name EvmCoreErrorExitSucceed (111) */
+ /** @name EvmCoreErrorExitSucceed (117) */
interface EvmCoreErrorExitSucceed extends Enum {
readonly isStopped: boolean;
readonly isReturned: boolean;
@@ -1265,7 +1416,7 @@
readonly type: 'Stopped' | 'Returned' | 'Suicided';
}
- /** @name EvmCoreErrorExitError (112) */
+ /** @name EvmCoreErrorExitError (118) */
interface EvmCoreErrorExitError extends Enum {
readonly isStackUnderflow: boolean;
readonly isStackOverflow: boolean;
@@ -1286,13 +1437,13 @@
readonly type: 'StackUnderflow' | 'StackOverflow' | 'InvalidJump' | 'InvalidRange' | 'DesignatedInvalid' | 'CallTooDeep' | 'CreateCollision' | 'CreateContractLimit' | 'OutOfOffset' | 'OutOfGas' | 'OutOfFund' | 'PcUnderflow' | 'CreateEmpty' | 'Other' | 'InvalidCode';
}
- /** @name EvmCoreErrorExitRevert (115) */
+ /** @name EvmCoreErrorExitRevert (121) */
interface EvmCoreErrorExitRevert extends Enum {
readonly isReverted: boolean;
readonly type: 'Reverted';
}
- /** @name EvmCoreErrorExitFatal (116) */
+ /** @name EvmCoreErrorExitFatal (122) */
interface EvmCoreErrorExitFatal extends Enum {
readonly isNotSupported: boolean;
readonly isUnhandledInterrupt: boolean;
@@ -1303,7 +1454,7 @@
readonly type: 'NotSupported' | 'UnhandledInterrupt' | 'CallErrorAsFatal' | 'Other';
}
- /** @name PalletEvmContractHelpersEvent (117) */
+ /** @name PalletEvmContractHelpersEvent (123) */
interface PalletEvmContractHelpersEvent extends Enum {
readonly isContractSponsorSet: boolean;
readonly asContractSponsorSet: ITuple<[H160, AccountId32]>;
@@ -1314,7 +1465,7 @@
readonly type: 'ContractSponsorSet' | 'ContractSponsorshipConfirmed' | 'ContractSponsorRemoved';
}
- /** @name FrameSystemPhase (118) */
+ /** @name FrameSystemPhase (124) */
interface FrameSystemPhase extends Enum {
readonly isApplyExtrinsic: boolean;
readonly asApplyExtrinsic: u32;
@@ -1323,13 +1474,13 @@
readonly type: 'ApplyExtrinsic' | 'Finalization' | 'Initialization';
}
- /** @name FrameSystemLastRuntimeUpgradeInfo (120) */
+ /** @name FrameSystemLastRuntimeUpgradeInfo (126) */
interface FrameSystemLastRuntimeUpgradeInfo extends Struct {
readonly specVersion: Compact<u32>;
readonly specName: Text;
}
- /** @name FrameSystemCall (121) */
+ /** @name FrameSystemCall (127) */
interface FrameSystemCall extends Enum {
readonly isFillBlock: boolean;
readonly asFillBlock: {
@@ -1371,21 +1522,21 @@
readonly type: 'FillBlock' | 'Remark' | 'SetHeapPages' | 'SetCode' | 'SetCodeWithoutChecks' | 'SetStorage' | 'KillStorage' | 'KillPrefix' | 'RemarkWithEvent';
}
- /** @name FrameSystemLimitsBlockWeights (126) */
+ /** @name FrameSystemLimitsBlockWeights (132) */
interface FrameSystemLimitsBlockWeights extends Struct {
readonly baseBlock: u64;
readonly maxBlock: u64;
readonly perClass: FrameSupportWeightsPerDispatchClassWeightsPerClass;
}
- /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (127) */
+ /** @name FrameSupportWeightsPerDispatchClassWeightsPerClass (133) */
interface FrameSupportWeightsPerDispatchClassWeightsPerClass extends Struct {
readonly normal: FrameSystemLimitsWeightsPerClass;
readonly operational: FrameSystemLimitsWeightsPerClass;
readonly mandatory: FrameSystemLimitsWeightsPerClass;
}
- /** @name FrameSystemLimitsWeightsPerClass (128) */
+ /** @name FrameSystemLimitsWeightsPerClass (134) */
interface FrameSystemLimitsWeightsPerClass extends Struct {
readonly baseExtrinsic: u64;
readonly maxExtrinsic: Option<u64>;
@@ -1393,25 +1544,25 @@
readonly reserved: Option<u64>;
}
- /** @name FrameSystemLimitsBlockLength (130) */
+ /** @name FrameSystemLimitsBlockLength (136) */
interface FrameSystemLimitsBlockLength extends Struct {
readonly max: FrameSupportWeightsPerDispatchClassU32;
}
- /** @name FrameSupportWeightsPerDispatchClassU32 (131) */
+ /** @name FrameSupportWeightsPerDispatchClassU32 (137) */
interface FrameSupportWeightsPerDispatchClassU32 extends Struct {
readonly normal: u32;
readonly operational: u32;
readonly mandatory: u32;
}
- /** @name FrameSupportWeightsRuntimeDbWeight (132) */
+ /** @name FrameSupportWeightsRuntimeDbWeight (138) */
interface FrameSupportWeightsRuntimeDbWeight extends Struct {
readonly read: u64;
readonly write: u64;
}
- /** @name SpVersionRuntimeVersion (133) */
+ /** @name SpVersionRuntimeVersion (139) */
interface SpVersionRuntimeVersion extends Struct {
readonly specName: Text;
readonly implName: Text;
@@ -1423,7 +1574,7 @@
readonly stateVersion: u8;
}
- /** @name FrameSystemError (138) */
+ /** @name FrameSystemError (144) */
interface FrameSystemError extends Enum {
readonly isInvalidSpecName: boolean;
readonly isSpecVersionNeedsToIncrease: boolean;
@@ -1434,7 +1585,7 @@
readonly type: 'InvalidSpecName' | 'SpecVersionNeedsToIncrease' | 'FailedToExtractRuntimeVersion' | 'NonDefaultComposite' | 'NonZeroRefCount' | 'CallFiltered';
}
- /** @name PolkadotPrimitivesV2PersistedValidationData (139) */
+ /** @name PolkadotPrimitivesV2PersistedValidationData (145) */
interface PolkadotPrimitivesV2PersistedValidationData extends Struct {
readonly parentHead: Bytes;
readonly relayParentNumber: u32;
@@ -1442,18 +1593,18 @@
readonly maxPovSize: u32;
}
- /** @name PolkadotPrimitivesV2UpgradeRestriction (142) */
+ /** @name PolkadotPrimitivesV2UpgradeRestriction (148) */
interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {
readonly isPresent: boolean;
readonly type: 'Present';
}
- /** @name SpTrieStorageProof (143) */
+ /** @name SpTrieStorageProof (149) */
interface SpTrieStorageProof extends Struct {
readonly trieNodes: BTreeSet<Bytes>;
}
- /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (145) */
+ /** @name CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot (151) */
interface CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot extends Struct {
readonly dmqMqcHead: H256;
readonly relayDispatchQueueSize: ITuple<[u32, u32]>;
@@ -1461,7 +1612,7 @@
readonly egressChannels: Vec<ITuple<[u32, PolkadotPrimitivesV2AbridgedHrmpChannel]>>;
}
- /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (148) */
+ /** @name PolkadotPrimitivesV2AbridgedHrmpChannel (154) */
interface PolkadotPrimitivesV2AbridgedHrmpChannel extends Struct {
readonly maxCapacity: u32;
readonly maxTotalSize: u32;
@@ -1471,7 +1622,7 @@
readonly mqcHead: Option<H256>;
}
- /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (149) */
+ /** @name PolkadotPrimitivesV2AbridgedHostConfiguration (155) */
interface PolkadotPrimitivesV2AbridgedHostConfiguration extends Struct {
readonly maxCodeSize: u32;
readonly maxHeadDataSize: u32;
@@ -1484,13 +1635,13 @@
readonly validationUpgradeDelay: u32;
}
- /** @name PolkadotCorePrimitivesOutboundHrmpMessage (155) */
+ /** @name PolkadotCorePrimitivesOutboundHrmpMessage (161) */
interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {
readonly recipient: u32;
readonly data: Bytes;
}
- /** @name CumulusPalletParachainSystemCall (156) */
+ /** @name CumulusPalletParachainSystemCall (162) */
interface CumulusPalletParachainSystemCall extends Enum {
readonly isSetValidationData: boolean;
readonly asSetValidationData: {
@@ -1511,7 +1662,7 @@
readonly type: 'SetValidationData' | 'SudoSendUpwardMessage' | 'AuthorizeUpgrade' | 'EnactAuthorizedUpgrade';
}
- /** @name CumulusPrimitivesParachainInherentParachainInherentData (157) */
+ /** @name CumulusPrimitivesParachainInherentParachainInherentData (163) */
interface CumulusPrimitivesParachainInherentParachainInherentData extends Struct {
readonly validationData: PolkadotPrimitivesV2PersistedValidationData;
readonly relayChainState: SpTrieStorageProof;
@@ -1519,19 +1670,19 @@
readonly horizontalMessages: BTreeMap<u32, Vec<PolkadotCorePrimitivesInboundHrmpMessage>>;
}
- /** @name PolkadotCorePrimitivesInboundDownwardMessage (159) */
+ /** @name PolkadotCorePrimitivesInboundDownwardMessage (165) */
interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {
readonly sentAt: u32;
readonly msg: Bytes;
}
- /** @name PolkadotCorePrimitivesInboundHrmpMessage (162) */
+ /** @name PolkadotCorePrimitivesInboundHrmpMessage (168) */
interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {
readonly sentAt: u32;
readonly data: Bytes;
}
- /** @name CumulusPalletParachainSystemError (165) */
+ /** @name CumulusPalletParachainSystemError (171) */
interface CumulusPalletParachainSystemError extends Enum {
readonly isOverlappingUpgrades: boolean;
readonly isProhibitedByPolkadot: boolean;
@@ -1544,14 +1695,14 @@
readonly type: 'OverlappingUpgrades' | 'ProhibitedByPolkadot' | 'TooBig' | 'ValidationDataNotAvailable' | 'HostConfigurationNotAvailable' | 'NotScheduled' | 'NothingAuthorized' | 'Unauthorized';
}
- /** @name PalletBalancesBalanceLock (167) */
+ /** @name PalletBalancesBalanceLock (173) */
interface PalletBalancesBalanceLock extends Struct {
readonly id: U8aFixed;
readonly amount: u128;
readonly reasons: PalletBalancesReasons;
}
- /** @name PalletBalancesReasons (168) */
+ /** @name PalletBalancesReasons (174) */
interface PalletBalancesReasons extends Enum {
readonly isFee: boolean;
readonly isMisc: boolean;
@@ -1559,20 +1710,20 @@
readonly type: 'Fee' | 'Misc' | 'All';
}
- /** @name PalletBalancesReserveData (171) */
+ /** @name PalletBalancesReserveData (177) */
interface PalletBalancesReserveData extends Struct {
readonly id: U8aFixed;
readonly amount: u128;
}
- /** @name PalletBalancesReleases (173) */
+ /** @name PalletBalancesReleases (179) */
interface PalletBalancesReleases extends Enum {
readonly isV100: boolean;
readonly isV200: boolean;
readonly type: 'V100' | 'V200';
}
- /** @name PalletBalancesCall (174) */
+ /** @name PalletBalancesCall (180) */
interface PalletBalancesCall extends Enum {
readonly isTransfer: boolean;
readonly asTransfer: {
@@ -1609,7 +1760,7 @@
readonly type: 'Transfer' | 'SetBalance' | 'ForceTransfer' | 'TransferKeepAlive' | 'TransferAll' | 'ForceUnreserve';
}
- /** @name PalletBalancesError (177) */
+ /** @name PalletBalancesError (183) */
interface PalletBalancesError extends Enum {
readonly isVestingBalance: boolean;
readonly isLiquidityRestrictions: boolean;
@@ -1622,7 +1773,7 @@
readonly type: 'VestingBalance' | 'LiquidityRestrictions' | 'InsufficientBalance' | 'ExistentialDeposit' | 'KeepAlive' | 'ExistingVestingSchedule' | 'DeadAccount' | 'TooManyReserves';
}
- /** @name PalletTimestampCall (179) */
+ /** @name PalletTimestampCall (185) */
interface PalletTimestampCall extends Enum {
readonly isSet: boolean;
readonly asSet: {
@@ -1631,14 +1782,14 @@
readonly type: 'Set';
}
- /** @name PalletTransactionPaymentReleases (181) */
+ /** @name PalletTransactionPaymentReleases (187) */
interface PalletTransactionPaymentReleases extends Enum {
readonly isV1Ancient: boolean;
readonly isV2: boolean;
readonly type: 'V1Ancient' | 'V2';
}
- /** @name PalletTreasuryProposal (182) */
+ /** @name PalletTreasuryProposal (188) */
interface PalletTreasuryProposal extends Struct {
readonly proposer: AccountId32;
readonly value: u128;
@@ -1646,7 +1797,7 @@
readonly bond: u128;
}
- /** @name PalletTreasuryCall (185) */
+ /** @name PalletTreasuryCall (191) */
interface PalletTreasuryCall extends Enum {
readonly isProposeSpend: boolean;
readonly asProposeSpend: {
@@ -1673,10 +1824,10 @@
readonly type: 'ProposeSpend' | 'RejectProposal' | 'ApproveProposal' | 'Spend' | 'RemoveApproval';
}
- /** @name FrameSupportPalletId (188) */
+ /** @name FrameSupportPalletId (194) */
interface FrameSupportPalletId extends U8aFixed {}
- /** @name PalletTreasuryError (189) */
+ /** @name PalletTreasuryError (195) */
interface PalletTreasuryError extends Enum {
readonly isInsufficientProposersBalance: boolean;
readonly isInvalidIndex: boolean;
@@ -1686,7 +1837,7 @@
readonly type: 'InsufficientProposersBalance' | 'InvalidIndex' | 'TooManyApprovals' | 'InsufficientPermission' | 'ProposalNotApproved';
}
- /** @name PalletSudoCall (190) */
+ /** @name PalletSudoCall (196) */
interface PalletSudoCall extends Enum {
readonly isSudo: boolean;
readonly asSudo: {
@@ -1709,7 +1860,7 @@
readonly type: 'Sudo' | 'SudoUncheckedWeight' | 'SetKey' | 'SudoAs';
}
- /** @name OrmlVestingModuleCall (192) */
+ /** @name OrmlVestingModuleCall (198) */
interface OrmlVestingModuleCall extends Enum {
readonly isClaim: boolean;
readonly isVestedTransfer: boolean;
@@ -1729,7 +1880,100 @@
readonly type: 'Claim' | 'VestedTransfer' | 'UpdateVestingSchedules' | 'ClaimFor';
}
- /** @name CumulusPalletXcmpQueueCall (194) */
+ /** @name OrmlXtokensModuleCall (200) */
+ interface OrmlXtokensModuleCall extends Enum {
+ readonly isTransfer: boolean;
+ readonly asTransfer: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: u128;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferMultiasset: boolean;
+ readonly asTransferMultiasset: {
+ readonly asset: XcmVersionedMultiAsset;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferWithFee: boolean;
+ readonly asTransferWithFee: {
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: u128;
+ readonly fee: u128;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferMultiassetWithFee: boolean;
+ readonly asTransferMultiassetWithFee: {
+ readonly asset: XcmVersionedMultiAsset;
+ readonly fee: XcmVersionedMultiAsset;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferMulticurrencies: boolean;
+ readonly asTransferMulticurrencies: {
+ readonly currencies: Vec<ITuple<[PalletForeignAssetsAssetIds, u128]>>;
+ readonly feeItem: u32;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly isTransferMultiassets: boolean;
+ readonly asTransferMultiassets: {
+ readonly assets: XcmVersionedMultiAssets;
+ readonly feeItem: u32;
+ readonly dest: XcmVersionedMultiLocation;
+ readonly destWeight: u64;
+ } & Struct;
+ readonly type: 'Transfer' | 'TransferMultiasset' | 'TransferWithFee' | 'TransferMultiassetWithFee' | 'TransferMulticurrencies' | 'TransferMultiassets';
+ }
+
+ /** @name XcmVersionedMultiAsset (201) */
+ interface XcmVersionedMultiAsset extends Enum {
+ readonly isV0: boolean;
+ readonly asV0: XcmV0MultiAsset;
+ readonly isV1: boolean;
+ readonly asV1: XcmV1MultiAsset;
+ readonly type: 'V0' | 'V1';
+ }
+
+ /** @name OrmlTokensModuleCall (204) */
+ interface OrmlTokensModuleCall extends Enum {
+ readonly isTransfer: boolean;
+ readonly asTransfer: {
+ readonly dest: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: Compact<u128>;
+ } & Struct;
+ readonly isTransferAll: boolean;
+ readonly asTransferAll: {
+ readonly dest: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly keepAlive: bool;
+ } & Struct;
+ readonly isTransferKeepAlive: boolean;
+ readonly asTransferKeepAlive: {
+ readonly dest: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: Compact<u128>;
+ } & Struct;
+ readonly isForceTransfer: boolean;
+ readonly asForceTransfer: {
+ readonly source: MultiAddress;
+ readonly dest: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly amount: Compact<u128>;
+ } & Struct;
+ readonly isSetBalance: boolean;
+ readonly asSetBalance: {
+ readonly who: MultiAddress;
+ readonly currencyId: PalletForeignAssetsAssetIds;
+ readonly newFree: Compact<u128>;
+ readonly newReserved: Compact<u128>;
+ } & Struct;
+ readonly type: 'Transfer' | 'TransferAll' | 'TransferKeepAlive' | 'ForceTransfer' | 'SetBalance';
+ }
+
+ /** @name CumulusPalletXcmpQueueCall (205) */
interface CumulusPalletXcmpQueueCall extends Enum {
readonly isServiceOverweight: boolean;
readonly asServiceOverweight: {
@@ -1765,7 +2009,7 @@
readonly type: 'ServiceOverweight' | 'SuspendXcmExecution' | 'ResumeXcmExecution' | 'UpdateSuspendThreshold' | 'UpdateDropThreshold' | 'UpdateResumeThreshold' | 'UpdateThresholdWeight' | 'UpdateWeightRestrictDecay' | 'UpdateXcmpMaxIndividualWeight';
}
- /** @name PalletXcmCall (195) */
+ /** @name PalletXcmCall (206) */
interface PalletXcmCall extends Enum {
readonly isSend: boolean;
readonly asSend: {
@@ -1827,7 +2071,7 @@
readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';
}
- /** @name XcmVersionedXcm (196) */
+ /** @name XcmVersionedXcm (207) */
interface XcmVersionedXcm extends Enum {
readonly isV0: boolean;
readonly asV0: XcmV0Xcm;
@@ -1838,7 +2082,7 @@
readonly type: 'V0' | 'V1' | 'V2';
}
- /** @name XcmV0Xcm (197) */
+ /** @name XcmV0Xcm (208) */
interface XcmV0Xcm extends Enum {
readonly isWithdrawAsset: boolean;
readonly asWithdrawAsset: {
@@ -1901,7 +2145,7 @@
readonly type: 'WithdrawAsset' | 'ReserveAssetDeposit' | 'TeleportAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom';
}
- /** @name XcmV0Order (199) */
+ /** @name XcmV0Order (210) */
interface XcmV0Order extends Enum {
readonly isNull: boolean;
readonly isDepositAsset: boolean;
@@ -1949,14 +2193,14 @@
readonly type: 'Null' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';
}
- /** @name XcmV0Response (201) */
+ /** @name XcmV0Response (212) */
interface XcmV0Response extends Enum {
readonly isAssets: boolean;
readonly asAssets: Vec<XcmV0MultiAsset>;
readonly type: 'Assets';
}
- /** @name XcmV1Xcm (202) */
+ /** @name XcmV1Xcm (213) */
interface XcmV1Xcm extends Enum {
readonly isWithdrawAsset: boolean;
readonly asWithdrawAsset: {
@@ -2025,7 +2269,7 @@
readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'RelayedFrom' | 'SubscribeVersion' | 'UnsubscribeVersion';
}
- /** @name XcmV1Order (204) */
+ /** @name XcmV1Order (215) */
interface XcmV1Order extends Enum {
readonly isNoop: boolean;
readonly isDepositAsset: boolean;
@@ -2075,7 +2319,7 @@
readonly type: 'Noop' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution';
}
- /** @name XcmV1Response (206) */
+ /** @name XcmV1Response (217) */
interface XcmV1Response extends Enum {
readonly isAssets: boolean;
readonly asAssets: XcmV1MultiassetMultiAssets;
@@ -2084,10 +2328,10 @@
readonly type: 'Assets' | 'Version';
}
- /** @name CumulusPalletXcmCall (220) */
+ /** @name CumulusPalletXcmCall (231) */
type CumulusPalletXcmCall = Null;
- /** @name CumulusPalletDmpQueueCall (221) */
+ /** @name CumulusPalletDmpQueueCall (232) */
interface CumulusPalletDmpQueueCall extends Enum {
readonly isServiceOverweight: boolean;
readonly asServiceOverweight: {
@@ -2097,7 +2341,7 @@
readonly type: 'ServiceOverweight';
}
- /** @name PalletInflationCall (222) */
+ /** @name PalletInflationCall (233) */
interface PalletInflationCall extends Enum {
readonly isStartInflation: boolean;
readonly asStartInflation: {
@@ -2106,7 +2350,7 @@
readonly type: 'StartInflation';
}
- /** @name PalletUniqueCall (223) */
+ /** @name PalletUniqueCall (234) */
interface PalletUniqueCall extends Enum {
readonly isCreateCollection: boolean;
readonly asCreateCollection: {
@@ -2264,7 +2508,7 @@
readonly type: 'CreateCollection' | 'CreateCollectionEx' | 'DestroyCollection' | 'AddToAllowList' | 'RemoveFromAllowList' | 'ChangeCollectionOwner' | 'AddCollectionAdmin' | 'RemoveCollectionAdmin' | 'SetCollectionSponsor' | 'ConfirmSponsorship' | 'RemoveCollectionSponsor' | 'CreateItem' | 'CreateMultipleItems' | 'SetCollectionProperties' | 'DeleteCollectionProperties' | 'SetTokenProperties' | 'DeleteTokenProperties' | 'SetTokenPropertyPermissions' | 'CreateMultipleItemsEx' | 'SetTransfersEnabledFlag' | 'BurnItem' | 'BurnFrom' | 'Transfer' | 'Approve' | 'TransferFrom' | 'SetCollectionLimits' | 'SetCollectionPermissions' | 'Repartition';
}
- /** @name UpDataStructsCollectionMode (228) */
+ /** @name UpDataStructsCollectionMode (239) */
interface UpDataStructsCollectionMode extends Enum {
readonly isNft: boolean;
readonly isFungible: boolean;
@@ -2273,7 +2517,7 @@
readonly type: 'Nft' | 'Fungible' | 'ReFungible';
}
- /** @name UpDataStructsCreateCollectionData (229) */
+ /** @name UpDataStructsCreateCollectionData (240) */
interface UpDataStructsCreateCollectionData extends Struct {
readonly mode: UpDataStructsCollectionMode;
readonly access: Option<UpDataStructsAccessMode>;
@@ -2287,14 +2531,14 @@
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsAccessMode (231) */
+ /** @name UpDataStructsAccessMode (242) */
interface UpDataStructsAccessMode extends Enum {
readonly isNormal: boolean;
readonly isAllowList: boolean;
readonly type: 'Normal' | 'AllowList';
}
- /** @name UpDataStructsCollectionLimits (233) */
+ /** @name UpDataStructsCollectionLimits (244) */
interface UpDataStructsCollectionLimits extends Struct {
readonly accountTokenOwnershipLimit: Option<u32>;
readonly sponsoredDataSize: Option<u32>;
@@ -2307,7 +2551,7 @@
readonly transfersEnabled: Option<bool>;
}
- /** @name UpDataStructsSponsoringRateLimit (235) */
+ /** @name UpDataStructsSponsoringRateLimit (246) */
interface UpDataStructsSponsoringRateLimit extends Enum {
readonly isSponsoringDisabled: boolean;
readonly isBlocks: boolean;
@@ -2315,43 +2559,43 @@
readonly type: 'SponsoringDisabled' | 'Blocks';
}
- /** @name UpDataStructsCollectionPermissions (238) */
+ /** @name UpDataStructsCollectionPermissions (249) */
interface UpDataStructsCollectionPermissions extends Struct {
readonly access: Option<UpDataStructsAccessMode>;
readonly mintMode: Option<bool>;
readonly nesting: Option<UpDataStructsNestingPermissions>;
}
- /** @name UpDataStructsNestingPermissions (240) */
+ /** @name UpDataStructsNestingPermissions (251) */
interface UpDataStructsNestingPermissions extends Struct {
readonly tokenOwner: bool;
readonly collectionAdmin: bool;
readonly restricted: Option<UpDataStructsOwnerRestrictedSet>;
}
- /** @name UpDataStructsOwnerRestrictedSet (242) */
+ /** @name UpDataStructsOwnerRestrictedSet (253) */
interface UpDataStructsOwnerRestrictedSet extends BTreeSet<u32> {}
- /** @name UpDataStructsPropertyKeyPermission (247) */
+ /** @name UpDataStructsPropertyKeyPermission (258) */
interface UpDataStructsPropertyKeyPermission extends Struct {
readonly key: Bytes;
readonly permission: UpDataStructsPropertyPermission;
}
- /** @name UpDataStructsPropertyPermission (248) */
+ /** @name UpDataStructsPropertyPermission (259) */
interface UpDataStructsPropertyPermission extends Struct {
readonly mutable: bool;
readonly collectionAdmin: bool;
readonly tokenOwner: bool;
}
- /** @name UpDataStructsProperty (251) */
+ /** @name UpDataStructsProperty (262) */
interface UpDataStructsProperty extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name UpDataStructsCreateItemData (254) */
+ /** @name UpDataStructsCreateItemData (265) */
interface UpDataStructsCreateItemData extends Enum {
readonly isNft: boolean;
readonly asNft: UpDataStructsCreateNftData;
@@ -2362,23 +2606,23 @@
readonly type: 'Nft' | 'Fungible' | 'ReFungible';
}
- /** @name UpDataStructsCreateNftData (255) */
+ /** @name UpDataStructsCreateNftData (266) */
interface UpDataStructsCreateNftData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsCreateFungibleData (256) */
+ /** @name UpDataStructsCreateFungibleData (267) */
interface UpDataStructsCreateFungibleData extends Struct {
readonly value: u128;
}
- /** @name UpDataStructsCreateReFungibleData (257) */
+ /** @name UpDataStructsCreateReFungibleData (268) */
interface UpDataStructsCreateReFungibleData extends Struct {
readonly pieces: u128;
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsCreateItemExData (260) */
+ /** @name UpDataStructsCreateItemExData (271) */
interface UpDataStructsCreateItemExData extends Enum {
readonly isNft: boolean;
readonly asNft: Vec<UpDataStructsCreateNftExData>;
@@ -2391,26 +2635,26 @@
readonly type: 'Nft' | 'Fungible' | 'RefungibleMultipleItems' | 'RefungibleMultipleOwners';
}
- /** @name UpDataStructsCreateNftExData (262) */
+ /** @name UpDataStructsCreateNftExData (273) */
interface UpDataStructsCreateNftExData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
}
- /** @name UpDataStructsCreateRefungibleExSingleOwner (269) */
+ /** @name UpDataStructsCreateRefungibleExSingleOwner (280) */
interface UpDataStructsCreateRefungibleExSingleOwner extends Struct {
readonly user: PalletEvmAccountBasicCrossAccountIdRepr;
readonly pieces: u128;
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name UpDataStructsCreateRefungibleExMultipleOwners (271) */
+ /** @name UpDataStructsCreateRefungibleExMultipleOwners (282) */
interface UpDataStructsCreateRefungibleExMultipleOwners extends Struct {
readonly users: BTreeMap<PalletEvmAccountBasicCrossAccountIdRepr, u128>;
readonly properties: Vec<UpDataStructsProperty>;
}
- /** @name PalletUniqueSchedulerCall (272) */
+ /** @name PalletUniqueSchedulerCall (283) */
interface PalletUniqueSchedulerCall extends Enum {
readonly isScheduleNamed: boolean;
readonly asScheduleNamed: {
@@ -2435,7 +2679,7 @@
readonly type: 'ScheduleNamed' | 'CancelNamed' | 'ScheduleNamedAfter';
}
- /** @name FrameSupportScheduleMaybeHashed (274) */
+ /** @name FrameSupportScheduleMaybeHashed (285) */
interface FrameSupportScheduleMaybeHashed extends Enum {
readonly isValue: boolean;
readonly asValue: Call;
@@ -2444,7 +2688,7 @@
readonly type: 'Value' | 'Hash';
}
- /** @name PalletConfigurationCall (275) */
+ /** @name PalletConfigurationCall (286) */
interface PalletConfigurationCall extends Enum {
readonly isSetWeightToFeeCoefficientOverride: boolean;
readonly asSetWeightToFeeCoefficientOverride: {
@@ -2457,13 +2701,13 @@
readonly type: 'SetWeightToFeeCoefficientOverride' | 'SetMinGasPriceOverride';
}
- /** @name PalletTemplateTransactionPaymentCall (276) */
+ /** @name PalletTemplateTransactionPaymentCall (287) */
type PalletTemplateTransactionPaymentCall = Null;
- /** @name PalletStructureCall (277) */
+ /** @name PalletStructureCall (288) */
type PalletStructureCall = Null;
- /** @name PalletRmrkCoreCall (278) */
+ /** @name PalletRmrkCoreCall (289) */
interface PalletRmrkCoreCall extends Enum {
readonly isCreateCollection: boolean;
readonly asCreateCollection: {
@@ -2569,7 +2813,7 @@
readonly type: 'CreateCollection' | 'DestroyCollection' | 'ChangeCollectionIssuer' | 'LockCollection' | 'MintNft' | 'BurnNft' | 'Send' | 'AcceptNft' | 'RejectNft' | 'AcceptResource' | 'AcceptResourceRemoval' | 'SetProperty' | 'SetPriority' | 'AddBasicResource' | 'AddComposableResource' | 'AddSlotResource' | 'RemoveResource';
}
- /** @name RmrkTraitsResourceResourceTypes (284) */
+ /** @name RmrkTraitsResourceResourceTypes (295) */
interface RmrkTraitsResourceResourceTypes extends Enum {
readonly isBasic: boolean;
readonly asBasic: RmrkTraitsResourceBasicResource;
@@ -2580,7 +2824,7 @@
readonly type: 'Basic' | 'Composable' | 'Slot';
}
- /** @name RmrkTraitsResourceBasicResource (286) */
+ /** @name RmrkTraitsResourceBasicResource (297) */
interface RmrkTraitsResourceBasicResource extends Struct {
readonly src: Option<Bytes>;
readonly metadata: Option<Bytes>;
@@ -2588,7 +2832,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name RmrkTraitsResourceComposableResource (288) */
+ /** @name RmrkTraitsResourceComposableResource (299) */
interface RmrkTraitsResourceComposableResource extends Struct {
readonly parts: Vec<u32>;
readonly base: u32;
@@ -2598,7 +2842,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name RmrkTraitsResourceSlotResource (289) */
+ /** @name RmrkTraitsResourceSlotResource (300) */
interface RmrkTraitsResourceSlotResource extends Struct {
readonly base: u32;
readonly src: Option<Bytes>;
@@ -2608,7 +2852,7 @@
readonly thumb: Option<Bytes>;
}
- /** @name PalletRmrkEquipCall (292) */
+ /** @name PalletRmrkEquipCall (303) */
interface PalletRmrkEquipCall extends Enum {
readonly isCreateBase: boolean;
readonly asCreateBase: {
@@ -2630,7 +2874,7 @@
readonly type: 'CreateBase' | 'ThemeAdd' | 'Equippable';
}
- /** @name RmrkTraitsPartPartType (295) */
+ /** @name RmrkTraitsPartPartType (306) */
interface RmrkTraitsPartPartType extends Enum {
readonly isFixedPart: boolean;
readonly asFixedPart: RmrkTraitsPartFixedPart;
@@ -2639,14 +2883,14 @@
readonly type: 'FixedPart' | 'SlotPart';
}
- /** @name RmrkTraitsPartFixedPart (297) */
+ /** @name RmrkTraitsPartFixedPart (308) */
interface RmrkTraitsPartFixedPart extends Struct {
readonly id: u32;
readonly z: u32;
readonly src: Bytes;
}
- /** @name RmrkTraitsPartSlotPart (298) */
+ /** @name RmrkTraitsPartSlotPart (309) */
interface RmrkTraitsPartSlotPart extends Struct {
readonly id: u32;
readonly equippable: RmrkTraitsPartEquippableList;
@@ -2654,7 +2898,7 @@
readonly z: u32;
}
- /** @name RmrkTraitsPartEquippableList (299) */
+ /** @name RmrkTraitsPartEquippableList (310) */
interface RmrkTraitsPartEquippableList extends Enum {
readonly isAll: boolean;
readonly isEmpty: boolean;
@@ -2663,20 +2907,20 @@
readonly type: 'All' | 'Empty' | 'Custom';
}
- /** @name RmrkTraitsTheme (301) */
+ /** @name RmrkTraitsTheme (312) */
interface RmrkTraitsTheme extends Struct {
readonly name: Bytes;
readonly properties: Vec<RmrkTraitsThemeThemeProperty>;
readonly inherit: bool;
}
- /** @name RmrkTraitsThemeThemeProperty (303) */
+ /** @name RmrkTraitsThemeThemeProperty (314) */
interface RmrkTraitsThemeThemeProperty extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name PalletAppPromotionCall (305) */
+ /** @name PalletAppPromotionCall (316) */
interface PalletAppPromotionCall extends Enum {
readonly isSetAdminAddress: boolean;
readonly asSetAdminAddress: {
@@ -2710,7 +2954,24 @@
readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorContract' | 'StopSponsoringContract' | 'PayoutStakers';
}
- /** @name PalletEvmCall (307) */
+ /** @name PalletForeignAssetsModuleCall (318) */
+ interface PalletForeignAssetsModuleCall extends Enum {
+ readonly isRegisterForeignAsset: boolean;
+ readonly asRegisterForeignAsset: {
+ readonly owner: AccountId32;
+ readonly location: XcmVersionedMultiLocation;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly isUpdateForeignAsset: boolean;
+ readonly asUpdateForeignAsset: {
+ readonly foreignAssetId: u32;
+ readonly location: XcmVersionedMultiLocation;
+ readonly metadata: PalletForeignAssetsModuleAssetMetadata;
+ } & Struct;
+ readonly type: 'RegisterForeignAsset' | 'UpdateForeignAsset';
+ }
+
+ /** @name PalletEvmCall (319) */
interface PalletEvmCall extends Enum {
readonly isWithdraw: boolean;
readonly asWithdraw: {
@@ -2755,7 +3016,7 @@
readonly type: 'Withdraw' | 'Call' | 'Create' | 'Create2';
}
- /** @name PalletEthereumCall (311) */
+ /** @name PalletEthereumCall (323) */
interface PalletEthereumCall extends Enum {
readonly isTransact: boolean;
readonly asTransact: {
@@ -2764,7 +3025,7 @@
readonly type: 'Transact';
}
- /** @name EthereumTransactionTransactionV2 (312) */
+ /** @name EthereumTransactionTransactionV2 (324) */
interface EthereumTransactionTransactionV2 extends Enum {
readonly isLegacy: boolean;
readonly asLegacy: EthereumTransactionLegacyTransaction;
@@ -2775,7 +3036,7 @@
readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
}
- /** @name EthereumTransactionLegacyTransaction (313) */
+ /** @name EthereumTransactionLegacyTransaction (325) */
interface EthereumTransactionLegacyTransaction extends Struct {
readonly nonce: U256;
readonly gasPrice: U256;
@@ -2786,7 +3047,7 @@
readonly signature: EthereumTransactionTransactionSignature;
}
- /** @name EthereumTransactionTransactionAction (314) */
+ /** @name EthereumTransactionTransactionAction (326) */
interface EthereumTransactionTransactionAction extends Enum {
readonly isCall: boolean;
readonly asCall: H160;
@@ -2794,14 +3055,14 @@
readonly type: 'Call' | 'Create';
}
- /** @name EthereumTransactionTransactionSignature (315) */
+ /** @name EthereumTransactionTransactionSignature (327) */
interface EthereumTransactionTransactionSignature extends Struct {
readonly v: u64;
readonly r: H256;
readonly s: H256;
}
- /** @name EthereumTransactionEip2930Transaction (317) */
+ /** @name EthereumTransactionEip2930Transaction (329) */
interface EthereumTransactionEip2930Transaction extends Struct {
readonly chainId: u64;
readonly nonce: U256;
@@ -2816,13 +3077,13 @@
readonly s: H256;
}
- /** @name EthereumTransactionAccessListItem (319) */
+ /** @name EthereumTransactionAccessListItem (331) */
interface EthereumTransactionAccessListItem extends Struct {
readonly address: H160;
readonly storageKeys: Vec<H256>;
}
- /** @name EthereumTransactionEip1559Transaction (320) */
+ /** @name EthereumTransactionEip1559Transaction (332) */
interface EthereumTransactionEip1559Transaction extends Struct {
readonly chainId: u64;
readonly nonce: U256;
@@ -2838,7 +3099,7 @@
readonly s: H256;
}
- /** @name PalletEvmMigrationCall (321) */
+ /** @name PalletEvmMigrationCall (333) */
interface PalletEvmMigrationCall extends Enum {
readonly isBegin: boolean;
readonly asBegin: {
@@ -2857,13 +3118,13 @@
readonly type: 'Begin' | 'SetData' | 'Finish';
}
- /** @name PalletSudoError (324) */
+ /** @name PalletSudoError (336) */
interface PalletSudoError extends Enum {
readonly isRequireSudo: boolean;
readonly type: 'RequireSudo';
}
- /** @name OrmlVestingModuleError (326) */
+ /** @name OrmlVestingModuleError (338) */
interface OrmlVestingModuleError extends Enum {
readonly isZeroVestingPeriod: boolean;
readonly isZeroVestingPeriodCount: boolean;
@@ -2874,21 +3135,77 @@
readonly type: 'ZeroVestingPeriod' | 'ZeroVestingPeriodCount' | 'InsufficientBalanceToLock' | 'TooManyVestingSchedules' | 'AmountLow' | 'MaxVestingSchedulesExceeded';
}
- /** @name CumulusPalletXcmpQueueInboundChannelDetails (328) */
+ /** @name OrmlXtokensModuleError (339) */
+ interface OrmlXtokensModuleError extends Enum {
+ readonly isAssetHasNoReserve: boolean;
+ readonly isNotCrossChainTransfer: boolean;
+ readonly isInvalidDest: boolean;
+ readonly isNotCrossChainTransferableCurrency: boolean;
+ readonly isUnweighableMessage: boolean;
+ readonly isXcmExecutionFailed: boolean;
+ readonly isCannotReanchor: boolean;
+ readonly isInvalidAncestry: boolean;
+ readonly isInvalidAsset: boolean;
+ readonly isDestinationNotInvertible: boolean;
+ readonly isBadVersion: boolean;
+ readonly isDistinctReserveForAssetAndFee: boolean;
+ readonly isZeroFee: boolean;
+ readonly isZeroAmount: boolean;
+ readonly isTooManyAssetsBeingSent: boolean;
+ readonly isAssetIndexNonExistent: boolean;
+ readonly isFeeNotEnough: boolean;
+ readonly isNotSupportedMultiLocation: boolean;
+ readonly isMinXcmFeeNotDefined: boolean;
+ readonly type: 'AssetHasNoReserve' | 'NotCrossChainTransfer' | 'InvalidDest' | 'NotCrossChainTransferableCurrency' | 'UnweighableMessage' | 'XcmExecutionFailed' | 'CannotReanchor' | 'InvalidAncestry' | 'InvalidAsset' | 'DestinationNotInvertible' | 'BadVersion' | 'DistinctReserveForAssetAndFee' | 'ZeroFee' | 'ZeroAmount' | 'TooManyAssetsBeingSent' | 'AssetIndexNonExistent' | 'FeeNotEnough' | 'NotSupportedMultiLocation' | 'MinXcmFeeNotDefined';
+ }
+
+ /** @name OrmlTokensBalanceLock (342) */
+ interface OrmlTokensBalanceLock extends Struct {
+ readonly id: U8aFixed;
+ readonly amount: u128;
+ }
+
+ /** @name OrmlTokensAccountData (344) */
+ interface OrmlTokensAccountData extends Struct {
+ readonly free: u128;
+ readonly reserved: u128;
+ readonly frozen: u128;
+ }
+
+ /** @name OrmlTokensReserveData (346) */
+ interface OrmlTokensReserveData extends Struct {
+ readonly id: Null;
+ readonly amount: u128;
+ }
+
+ /** @name OrmlTokensModuleError (348) */
+ interface OrmlTokensModuleError extends Enum {
+ readonly isBalanceTooLow: boolean;
+ readonly isAmountIntoBalanceFailed: boolean;
+ readonly isLiquidityRestrictions: boolean;
+ readonly isMaxLocksExceeded: boolean;
+ readonly isKeepAlive: boolean;
+ readonly isExistentialDeposit: boolean;
+ readonly isDeadAccount: boolean;
+ readonly isTooManyReserves: boolean;
+ readonly type: 'BalanceTooLow' | 'AmountIntoBalanceFailed' | 'LiquidityRestrictions' | 'MaxLocksExceeded' | 'KeepAlive' | 'ExistentialDeposit' | 'DeadAccount' | 'TooManyReserves';
+ }
+
+ /** @name CumulusPalletXcmpQueueInboundChannelDetails (350) */
interface CumulusPalletXcmpQueueInboundChannelDetails extends Struct {
readonly sender: u32;
readonly state: CumulusPalletXcmpQueueInboundState;
readonly messageMetadata: Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>;
}
- /** @name CumulusPalletXcmpQueueInboundState (329) */
+ /** @name CumulusPalletXcmpQueueInboundState (351) */
interface CumulusPalletXcmpQueueInboundState extends Enum {
readonly isOk: boolean;
readonly isSuspended: boolean;
readonly type: 'Ok' | 'Suspended';
}
- /** @name PolkadotParachainPrimitivesXcmpMessageFormat (332) */
+ /** @name PolkadotParachainPrimitivesXcmpMessageFormat (354) */
interface PolkadotParachainPrimitivesXcmpMessageFormat extends Enum {
readonly isConcatenatedVersionedXcm: boolean;
readonly isConcatenatedEncodedBlob: boolean;
@@ -2896,7 +3213,7 @@
readonly type: 'ConcatenatedVersionedXcm' | 'ConcatenatedEncodedBlob' | 'Signals';
}
- /** @name CumulusPalletXcmpQueueOutboundChannelDetails (335) */
+ /** @name CumulusPalletXcmpQueueOutboundChannelDetails (357) */
interface CumulusPalletXcmpQueueOutboundChannelDetails extends Struct {
readonly recipient: u32;
readonly state: CumulusPalletXcmpQueueOutboundState;
@@ -2905,14 +3222,14 @@
readonly lastIndex: u16;
}
- /** @name CumulusPalletXcmpQueueOutboundState (336) */
+ /** @name CumulusPalletXcmpQueueOutboundState (358) */
interface CumulusPalletXcmpQueueOutboundState extends Enum {
readonly isOk: boolean;
readonly isSuspended: boolean;
readonly type: 'Ok' | 'Suspended';
}
- /** @name CumulusPalletXcmpQueueQueueConfigData (338) */
+ /** @name CumulusPalletXcmpQueueQueueConfigData (360) */
interface CumulusPalletXcmpQueueQueueConfigData extends Struct {
readonly suspendThreshold: u32;
readonly dropThreshold: u32;
@@ -2922,7 +3239,7 @@
readonly xcmpMaxIndividualWeight: u64;
}
- /** @name CumulusPalletXcmpQueueError (340) */
+ /** @name CumulusPalletXcmpQueueError (362) */
interface CumulusPalletXcmpQueueError extends Enum {
readonly isFailedToSend: boolean;
readonly isBadXcmOrigin: boolean;
@@ -2932,7 +3249,7 @@
readonly type: 'FailedToSend' | 'BadXcmOrigin' | 'BadXcm' | 'BadOverweightIndex' | 'WeightOverLimit';
}
- /** @name PalletXcmError (341) */
+ /** @name PalletXcmError (363) */
interface PalletXcmError extends Enum {
readonly isUnreachable: boolean;
readonly isSendFailure: boolean;
@@ -2950,29 +3267,29 @@
readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed';
}
- /** @name CumulusPalletXcmError (342) */
+ /** @name CumulusPalletXcmError (364) */
type CumulusPalletXcmError = Null;
- /** @name CumulusPalletDmpQueueConfigData (343) */
+ /** @name CumulusPalletDmpQueueConfigData (365) */
interface CumulusPalletDmpQueueConfigData extends Struct {
readonly maxIndividual: u64;
}
- /** @name CumulusPalletDmpQueuePageIndexData (344) */
+ /** @name CumulusPalletDmpQueuePageIndexData (366) */
interface CumulusPalletDmpQueuePageIndexData extends Struct {
readonly beginUsed: u32;
readonly endUsed: u32;
readonly overweightCount: u64;
}
- /** @name CumulusPalletDmpQueueError (347) */
+ /** @name CumulusPalletDmpQueueError (369) */
interface CumulusPalletDmpQueueError extends Enum {
readonly isUnknown: boolean;
readonly isOverLimit: boolean;
readonly type: 'Unknown' | 'OverLimit';
}
- /** @name PalletUniqueError (351) */
+ /** @name PalletUniqueError (373) */
interface PalletUniqueError extends Enum {
readonly isCollectionDecimalPointLimitExceeded: boolean;
readonly isConfirmUnsetSponsorFail: boolean;
@@ -2981,7 +3298,7 @@
readonly type: 'CollectionDecimalPointLimitExceeded' | 'ConfirmUnsetSponsorFail' | 'EmptyArgument' | 'RepartitionCalledOnNonRefungibleCollection';
}
- /** @name PalletUniqueSchedulerScheduledV3 (354) */
+ /** @name PalletUniqueSchedulerScheduledV3 (376) */
interface PalletUniqueSchedulerScheduledV3 extends Struct {
readonly maybeId: Option<U8aFixed>;
readonly priority: u8;
@@ -2990,7 +3307,7 @@
readonly origin: OpalRuntimeOriginCaller;
}
- /** @name OpalRuntimeOriginCaller (355) */
+ /** @name OpalRuntimeOriginCaller (377) */
interface OpalRuntimeOriginCaller extends Enum {
readonly isSystem: boolean;
readonly asSystem: FrameSupportDispatchRawOrigin;
@@ -3004,7 +3321,7 @@
readonly type: 'System' | 'Void' | 'PolkadotXcm' | 'CumulusXcm' | 'Ethereum';
}
- /** @name FrameSupportDispatchRawOrigin (356) */
+ /** @name FrameSupportDispatchRawOrigin (378) */
interface FrameSupportDispatchRawOrigin extends Enum {
readonly isRoot: boolean;
readonly isSigned: boolean;
@@ -3013,7 +3330,7 @@
readonly type: 'Root' | 'Signed' | 'None';
}
- /** @name PalletXcmOrigin (357) */
+ /** @name PalletXcmOrigin (379) */
interface PalletXcmOrigin extends Enum {
readonly isXcm: boolean;
readonly asXcm: XcmV1MultiLocation;
@@ -3022,7 +3339,7 @@
readonly type: 'Xcm' | 'Response';
}
- /** @name CumulusPalletXcmOrigin (358) */
+ /** @name CumulusPalletXcmOrigin (380) */
interface CumulusPalletXcmOrigin extends Enum {
readonly isRelay: boolean;
readonly isSiblingParachain: boolean;
@@ -3030,17 +3347,17 @@
readonly type: 'Relay' | 'SiblingParachain';
}
- /** @name PalletEthereumRawOrigin (359) */
+ /** @name PalletEthereumRawOrigin (381) */
interface PalletEthereumRawOrigin extends Enum {
readonly isEthereumTransaction: boolean;
readonly asEthereumTransaction: H160;
readonly type: 'EthereumTransaction';
}
- /** @name SpCoreVoid (360) */
+ /** @name SpCoreVoid (382) */
type SpCoreVoid = Null;
- /** @name PalletUniqueSchedulerError (361) */
+ /** @name PalletUniqueSchedulerError (383) */
interface PalletUniqueSchedulerError extends Enum {
readonly isFailedToSchedule: boolean;
readonly isNotFound: boolean;
@@ -3049,7 +3366,7 @@
readonly type: 'FailedToSchedule' | 'NotFound' | 'TargetBlockNumberInPast' | 'RescheduleNoChange';
}
- /** @name UpDataStructsCollection (362) */
+ /** @name UpDataStructsCollection (384) */
interface UpDataStructsCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -3059,10 +3376,10 @@
readonly sponsorship: UpDataStructsSponsorshipStateAccountId32;
readonly limits: UpDataStructsCollectionLimits;
readonly permissions: UpDataStructsCollectionPermissions;
- readonly externalCollection: bool;
+ readonly flags: U8aFixed;
}
- /** @name UpDataStructsSponsorshipStateAccountId32 (363) */
+ /** @name UpDataStructsSponsorshipStateAccountId32 (385) */
interface UpDataStructsSponsorshipStateAccountId32 extends Enum {
readonly isDisabled: boolean;
readonly isUnconfirmed: boolean;
@@ -3072,43 +3389,43 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
- /** @name UpDataStructsProperties (364) */
+ /** @name UpDataStructsProperties (387) */
interface UpDataStructsProperties extends Struct {
readonly map: UpDataStructsPropertiesMapBoundedVec;
readonly consumedSpace: u32;
readonly spaceLimit: u32;
}
- /** @name UpDataStructsPropertiesMapBoundedVec (365) */
+ /** @name UpDataStructsPropertiesMapBoundedVec (388) */
interface UpDataStructsPropertiesMapBoundedVec extends BTreeMap<Bytes, Bytes> {}
- /** @name UpDataStructsPropertiesMapPropertyPermission (370) */
+ /** @name UpDataStructsPropertiesMapPropertyPermission (393) */
interface UpDataStructsPropertiesMapPropertyPermission extends BTreeMap<Bytes, UpDataStructsPropertyPermission> {}
- /** @name UpDataStructsCollectionStats (377) */
+ /** @name UpDataStructsCollectionStats (400) */
interface UpDataStructsCollectionStats extends Struct {
readonly created: u32;
readonly destroyed: u32;
readonly alive: u32;
}
- /** @name UpDataStructsTokenChild (378) */
+ /** @name UpDataStructsTokenChild (401) */
interface UpDataStructsTokenChild extends Struct {
readonly token: u32;
readonly collection: u32;
}
- /** @name PhantomTypeUpDataStructs (379) */
+ /** @name PhantomTypeUpDataStructs (402) */
interface PhantomTypeUpDataStructs extends Vec<ITuple<[UpDataStructsTokenData, UpDataStructsRpcCollection, RmrkTraitsCollectionCollectionInfo, RmrkTraitsNftNftInfo, RmrkTraitsResourceResourceInfo, RmrkTraitsPropertyPropertyInfo, RmrkTraitsBaseBaseInfo, RmrkTraitsPartPartType, RmrkTraitsTheme, RmrkTraitsNftNftChild]>> {}
- /** @name UpDataStructsTokenData (381) */
+ /** @name UpDataStructsTokenData (404) */
interface UpDataStructsTokenData extends Struct {
readonly properties: Vec<UpDataStructsProperty>;
readonly owner: Option<PalletEvmAccountBasicCrossAccountIdRepr>;
readonly pieces: u128;
}
- /** @name UpDataStructsRpcCollection (383) */
+ /** @name UpDataStructsRpcCollection (406) */
interface UpDataStructsRpcCollection extends Struct {
readonly owner: AccountId32;
readonly mode: UpDataStructsCollectionMode;
@@ -3121,9 +3438,10 @@
readonly tokenPropertyPermissions: Vec<UpDataStructsPropertyKeyPermission>;
readonly properties: Vec<UpDataStructsProperty>;
readonly readOnly: bool;
+ readonly foreign: bool;
}
- /** @name RmrkTraitsCollectionCollectionInfo (384) */
+ /** @name RmrkTraitsCollectionCollectionInfo (407) */
interface RmrkTraitsCollectionCollectionInfo extends Struct {
readonly issuer: AccountId32;
readonly metadata: Bytes;
@@ -3132,7 +3450,7 @@
readonly nftsCount: u32;
}
- /** @name RmrkTraitsNftNftInfo (385) */
+ /** @name RmrkTraitsNftNftInfo (408) */
interface RmrkTraitsNftNftInfo extends Struct {
readonly owner: RmrkTraitsNftAccountIdOrCollectionNftTuple;
readonly royalty: Option<RmrkTraitsNftRoyaltyInfo>;
@@ -3141,13 +3459,13 @@
readonly pending: bool;
}
- /** @name RmrkTraitsNftRoyaltyInfo (387) */
+ /** @name RmrkTraitsNftRoyaltyInfo (410) */
interface RmrkTraitsNftRoyaltyInfo extends Struct {
readonly recipient: AccountId32;
readonly amount: Permill;
}
- /** @name RmrkTraitsResourceResourceInfo (388) */
+ /** @name RmrkTraitsResourceResourceInfo (411) */
interface RmrkTraitsResourceResourceInfo extends Struct {
readonly id: u32;
readonly resource: RmrkTraitsResourceResourceTypes;
@@ -3155,26 +3473,26 @@
readonly pendingRemoval: bool;
}
- /** @name RmrkTraitsPropertyPropertyInfo (389) */
+ /** @name RmrkTraitsPropertyPropertyInfo (412) */
interface RmrkTraitsPropertyPropertyInfo extends Struct {
readonly key: Bytes;
readonly value: Bytes;
}
- /** @name RmrkTraitsBaseBaseInfo (390) */
+ /** @name RmrkTraitsBaseBaseInfo (413) */
interface RmrkTraitsBaseBaseInfo extends Struct {
readonly issuer: AccountId32;
readonly baseType: Bytes;
readonly symbol: Bytes;
}
- /** @name RmrkTraitsNftNftChild (391) */
+ /** @name RmrkTraitsNftNftChild (414) */
interface RmrkTraitsNftNftChild extends Struct {
readonly collectionId: u32;
readonly nftId: u32;
}
- /** @name PalletCommonError (393) */
+ /** @name PalletCommonError (416) */
interface PalletCommonError extends Enum {
readonly isCollectionNotFound: boolean;
readonly isMustBeTokenOwner: boolean;
@@ -3213,7 +3531,7 @@
readonly type: 'CollectionNotFound' | 'MustBeTokenOwner' | 'NoPermission' | 'CantDestroyNotEmptyCollection' | 'PublicMintingNotAllowed' | 'AddressNotInAllowlist' | 'CollectionNameLimitExceeded' | 'CollectionDescriptionLimitExceeded' | 'CollectionTokenPrefixLimitExceeded' | 'TotalCollectionsLimitExceeded' | 'CollectionAdminCountExceeded' | 'CollectionLimitBoundsExceeded' | 'OwnerPermissionsCantBeReverted' | 'TransferNotAllowed' | 'AccountTokenLimitExceeded' | 'CollectionTokenLimitExceeded' | 'MetadataFlagFrozen' | 'TokenNotFound' | 'TokenValueTooLow' | 'ApprovedValueTooLow' | 'CantApproveMoreThanOwned' | 'AddressIsZero' | 'UnsupportedOperation' | 'NotSufficientFounds' | 'UserIsNotAllowedToNest' | 'SourceCollectionIsNotAllowedToNest' | 'CollectionFieldSizeExceeded' | 'NoSpaceForProperty' | 'PropertyLimitReached' | 'PropertyKeyIsTooLong' | 'InvalidCharacterInPropertyKey' | 'EmptyPropertyKey' | 'CollectionIsExternal' | 'CollectionIsInternal';
}
- /** @name PalletFungibleError (395) */
+ /** @name PalletFungibleError (418) */
interface PalletFungibleError extends Enum {
readonly isNotFungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isFungibleItemsHaveNoId: boolean;
@@ -3223,12 +3541,12 @@
readonly type: 'NotFungibleDataUsedToMintFungibleCollectionToken' | 'FungibleItemsHaveNoId' | 'FungibleItemsDontHaveData' | 'FungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletRefungibleItemData (396) */
+ /** @name PalletRefungibleItemData (419) */
interface PalletRefungibleItemData extends Struct {
readonly constData: Bytes;
}
- /** @name PalletRefungibleError (401) */
+ /** @name PalletRefungibleError (424) */
interface PalletRefungibleError extends Enum {
readonly isNotRefungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isWrongRefungiblePieces: boolean;
@@ -3238,19 +3556,19 @@
readonly type: 'NotRefungibleDataUsedToMintFungibleCollectionToken' | 'WrongRefungiblePieces' | 'RepartitionWhileNotOwningAllPieces' | 'RefungibleDisallowsNesting' | 'SettingPropertiesNotAllowed';
}
- /** @name PalletNonfungibleItemData (402) */
+ /** @name PalletNonfungibleItemData (425) */
interface PalletNonfungibleItemData extends Struct {
readonly owner: PalletEvmAccountBasicCrossAccountIdRepr;
}
- /** @name UpDataStructsPropertyScope (404) */
+ /** @name UpDataStructsPropertyScope (427) */
interface UpDataStructsPropertyScope extends Enum {
readonly isNone: boolean;
readonly isRmrk: boolean;
readonly type: 'None' | 'Rmrk';
}
- /** @name PalletNonfungibleError (406) */
+ /** @name PalletNonfungibleError (429) */
interface PalletNonfungibleError extends Enum {
readonly isNotNonfungibleDataUsedToMintFungibleCollectionToken: boolean;
readonly isNonfungibleItemsHaveNoAmount: boolean;
@@ -3258,7 +3576,7 @@
readonly type: 'NotNonfungibleDataUsedToMintFungibleCollectionToken' | 'NonfungibleItemsHaveNoAmount' | 'CantBurnNftWithChildren';
}
- /** @name PalletStructureError (407) */
+ /** @name PalletStructureError (430) */
interface PalletStructureError extends Enum {
readonly isOuroborosDetected: boolean;
readonly isDepthLimit: boolean;
@@ -3267,7 +3585,7 @@
readonly type: 'OuroborosDetected' | 'DepthLimit' | 'BreadthLimit' | 'TokenNotFound';
}
- /** @name PalletRmrkCoreError (408) */
+ /** @name PalletRmrkCoreError (431) */
interface PalletRmrkCoreError extends Enum {
readonly isCorruptedCollectionType: boolean;
readonly isRmrkPropertyKeyIsTooLong: boolean;
@@ -3291,7 +3609,7 @@
readonly type: 'CorruptedCollectionType' | 'RmrkPropertyKeyIsTooLong' | 'RmrkPropertyValueIsTooLong' | 'RmrkPropertyIsNotFound' | 'UnableToDecodeRmrkData' | 'CollectionNotEmpty' | 'NoAvailableCollectionId' | 'NoAvailableNftId' | 'CollectionUnknown' | 'NoPermission' | 'NonTransferable' | 'CollectionFullOrLocked' | 'ResourceDoesntExist' | 'CannotSendToDescendentOrSelf' | 'CannotAcceptNonOwnedNft' | 'CannotRejectNonOwnedNft' | 'CannotRejectNonPendingNft' | 'ResourceNotPending' | 'NoAvailableResourceId';
}
- /** @name PalletRmrkEquipError (410) */
+ /** @name PalletRmrkEquipError (433) */
interface PalletRmrkEquipError extends Enum {
readonly isPermissionError: boolean;
readonly isNoAvailableBaseId: boolean;
@@ -3303,7 +3621,7 @@
readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';
}
- /** @name PalletAppPromotionError (416) */
+ /** @name PalletAppPromotionError (439) */
interface PalletAppPromotionError extends Enum {
readonly isAdminNotSet: boolean;
readonly isNoPermission: boolean;
@@ -3314,7 +3632,16 @@
readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFunds' | 'PendingForBlockOverflow' | 'SponsorNotSet' | 'IncorrectLockedBalanceOperation';
}
- /** @name PalletEvmError (419) */
+ /** @name PalletForeignAssetsModuleError (440) */
+ interface PalletForeignAssetsModuleError extends Enum {
+ readonly isBadLocation: boolean;
+ readonly isMultiLocationExisted: boolean;
+ readonly isAssetIdNotExists: boolean;
+ readonly isAssetIdExisted: boolean;
+ readonly type: 'BadLocation' | 'MultiLocationExisted' | 'AssetIdNotExists' | 'AssetIdExisted';
+ }
+
+ /** @name PalletEvmError (443) */
interface PalletEvmError extends Enum {
readonly isBalanceLow: boolean;
readonly isFeeOverflow: boolean;
@@ -3325,7 +3652,7 @@
readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';
}
- /** @name FpRpcTransactionStatus (422) */
+ /** @name FpRpcTransactionStatus (446) */
interface FpRpcTransactionStatus extends Struct {
readonly transactionHash: H256;
readonly transactionIndex: u32;
@@ -3336,10 +3663,10 @@
readonly logsBloom: EthbloomBloom;
}
- /** @name EthbloomBloom (424) */
+ /** @name EthbloomBloom (448) */
interface EthbloomBloom extends U8aFixed {}
- /** @name EthereumReceiptReceiptV3 (426) */
+ /** @name EthereumReceiptReceiptV3 (450) */
interface EthereumReceiptReceiptV3 extends Enum {
readonly isLegacy: boolean;
readonly asLegacy: EthereumReceiptEip658ReceiptData;
@@ -3350,7 +3677,7 @@
readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
}
- /** @name EthereumReceiptEip658ReceiptData (427) */
+ /** @name EthereumReceiptEip658ReceiptData (451) */
interface EthereumReceiptEip658ReceiptData extends Struct {
readonly statusCode: u8;
readonly usedGas: U256;
@@ -3358,14 +3685,14 @@
readonly logs: Vec<EthereumLog>;
}
- /** @name EthereumBlock (428) */
+ /** @name EthereumBlock (452) */
interface EthereumBlock extends Struct {
readonly header: EthereumHeader;
readonly transactions: Vec<EthereumTransactionTransactionV2>;
readonly ommers: Vec<EthereumHeader>;
}
- /** @name EthereumHeader (429) */
+ /** @name EthereumHeader (453) */
interface EthereumHeader extends Struct {
readonly parentHash: H256;
readonly ommersHash: H256;
@@ -3384,24 +3711,24 @@
readonly nonce: EthereumTypesHashH64;
}
- /** @name EthereumTypesHashH64 (430) */
+ /** @name EthereumTypesHashH64 (454) */
interface EthereumTypesHashH64 extends U8aFixed {}
- /** @name PalletEthereumError (435) */
+ /** @name PalletEthereumError (459) */
interface PalletEthereumError extends Enum {
readonly isInvalidSignature: boolean;
readonly isPreLogExists: boolean;
readonly type: 'InvalidSignature' | 'PreLogExists';
}
- /** @name PalletEvmCoderSubstrateError (436) */
+ /** @name PalletEvmCoderSubstrateError (460) */
interface PalletEvmCoderSubstrateError extends Enum {
readonly isOutOfGas: boolean;
readonly isOutOfFund: boolean;
readonly type: 'OutOfGas' | 'OutOfFund';
}
- /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (437) */
+ /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (461) */
interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {
readonly isDisabled: boolean;
readonly isUnconfirmed: boolean;
@@ -3411,7 +3738,7 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
- /** @name PalletEvmContractHelpersSponsoringModeT (438) */
+ /** @name PalletEvmContractHelpersSponsoringModeT (462) */
interface PalletEvmContractHelpersSponsoringModeT extends Enum {
readonly isDisabled: boolean;
readonly isAllowlisted: boolean;
@@ -3419,21 +3746,22 @@
readonly type: 'Disabled' | 'Allowlisted' | 'Generous';
}
- /** @name PalletEvmContractHelpersError (440) */
+ /** @name PalletEvmContractHelpersError (468) */
interface PalletEvmContractHelpersError extends Enum {
readonly isNoPermission: boolean;
readonly isNoPendingSponsor: boolean;
- readonly type: 'NoPermission' | 'NoPendingSponsor';
+ readonly isTooManyMethodsHaveSponsoredLimit: boolean;
+ readonly type: 'NoPermission' | 'NoPendingSponsor' | 'TooManyMethodsHaveSponsoredLimit';
}
- /** @name PalletEvmMigrationError (441) */
+ /** @name PalletEvmMigrationError (469) */
interface PalletEvmMigrationError extends Enum {
readonly isAccountNotEmpty: boolean;
readonly isAccountIsNotMigrating: boolean;
readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';
}
- /** @name SpRuntimeMultiSignature (443) */
+ /** @name SpRuntimeMultiSignature (471) */
interface SpRuntimeMultiSignature extends Enum {
readonly isEd25519: boolean;
readonly asEd25519: SpCoreEd25519Signature;
@@ -3444,34 +3772,34 @@
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
}
- /** @name SpCoreEd25519Signature (444) */
+ /** @name SpCoreEd25519Signature (472) */
interface SpCoreEd25519Signature extends U8aFixed {}
- /** @name SpCoreSr25519Signature (446) */
+ /** @name SpCoreSr25519Signature (474) */
interface SpCoreSr25519Signature extends U8aFixed {}
- /** @name SpCoreEcdsaSignature (447) */
+ /** @name SpCoreEcdsaSignature (475) */
interface SpCoreEcdsaSignature extends U8aFixed {}
- /** @name FrameSystemExtensionsCheckSpecVersion (450) */
+ /** @name FrameSystemExtensionsCheckSpecVersion (478) */
type FrameSystemExtensionsCheckSpecVersion = Null;
- /** @name FrameSystemExtensionsCheckGenesis (451) */
+ /** @name FrameSystemExtensionsCheckGenesis (479) */
type FrameSystemExtensionsCheckGenesis = Null;
- /** @name FrameSystemExtensionsCheckNonce (454) */
+ /** @name FrameSystemExtensionsCheckNonce (482) */
interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
- /** @name FrameSystemExtensionsCheckWeight (455) */
+ /** @name FrameSystemExtensionsCheckWeight (483) */
type FrameSystemExtensionsCheckWeight = Null;
- /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (456) */
+ /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (484) */
interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
- /** @name OpalRuntimeRuntime (457) */
+ /** @name OpalRuntimeRuntime (485) */
type OpalRuntimeRuntime = Null;
- /** @name PalletEthereumFakeTransactionFinalizer (458) */
+ /** @name PalletEthereumFakeTransactionFinalizer (486) */
type PalletEthereumFakeTransactionFinalizer = Null;
} // declare module
tests/src/mintModes.test.tsdiffbeforeafterboth--- a/tests/src/mintModes.test.ts
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-import {IKeyringPair} from '@polkadot/types/types';
-import usingApi from './substrate/substrate-api';
-import {
- addToAllowListExpectSuccess,
- createCollectionExpectSuccess,
- createItemExpectFailure,
- createItemExpectSuccess,
- enableAllowListExpectSuccess,
- setMintPermissionExpectSuccess,
- addCollectionAdminExpectSuccess,
- disableAllowListExpectSuccess,
-} from './util/helpers';
-
-describe('Integration Test public minting', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- alice = privateKeyWrapper('//Alice');
- bob = privateKeyWrapper('//Bob');
- });
- });
-
- it('If the AllowList mode is enabled, then the address added to the allowlist and not the owner or administrator can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await addToAllowListExpectSuccess(alice, collectionId, bob.address);
-
- await createItemExpectSuccess(bob, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is enabled, address not included in allowlist that is regular user cannot create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await createItemExpectFailure(bob, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is enabled, address not included in allowlist that is admin can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await createItemExpectSuccess(bob, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is enabled, address not included in allowlist that is owner can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await createItemExpectSuccess(alice, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is disabled, owner can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await createItemExpectSuccess(alice, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is disabled, collection admin can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await createItemExpectSuccess(bob, collectionId, 'NFT');
- });
- });
-
- it('If the AllowList mode is disabled, regular user can`t create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, true);
- await createItemExpectFailure(bob, collectionId, 'NFT');
- });
- });
-});
-
-describe('Integration Test private minting', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingApi(async (api, privateKeyWrapper) => {
- alice = privateKeyWrapper('//Alice');
- bob = privateKeyWrapper('//Bob');
- });
- });
-
- it('Address that is the not owner or not admin cannot create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await enableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, false);
- await addToAllowListExpectSuccess(alice, collectionId, bob.address);
- await createItemExpectFailure(bob, collectionId, 'NFT');
- });
- });
-
- it('Address that is collection owner can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, false);
- await createItemExpectSuccess(alice, collectionId, 'NFT');
- });
- });
-
- it('Address that is admin can create tokens', async () => {
- await usingApi(async () => {
- const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});
- await disableAllowListExpectSuccess(alice, collectionId);
- await setMintPermissionExpectSuccess(alice, collectionId, false);
- await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);
- await createItemExpectSuccess(bob, collectionId, 'NFT');
- });
- });
-});
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -45,6 +45,8 @@
'nonfungible',
'charging',
'configuration',
+ 'tokens',
+ 'xtokens',
];
// Pallets that depend on consensus and governance configuration
@@ -61,13 +63,20 @@
const refungible = 'refungible';
const scheduler = 'scheduler';
+ const foreignAssets = 'foreignassets';
const rmrkPallets = ['rmrkcore', 'rmrkequip'];
const appPromotion = 'apppromotion';
if (chain.eq('OPAL by UNIQUE')) {
- requiredPallets.push(refungible, scheduler, appPromotion, ...rmrkPallets);
+ requiredPallets.push(
+ refungible,
+ scheduler,
+ foreignAssets,
+ appPromotion,
+ ...rmrkPallets,
+ );
} else if (chain.eq('QUARTZ by UNIQUE')) {
- // Insert Quartz additional pallets here
+ requiredPallets.push(refungible);
} else if (chain.eq('UNIQUE')) {
// Insert Unique additional pallets here
}
tests/src/refungible.test.tsdiffbeforeafterboth--- a/tests/src/refungible.test.ts
+++ b/tests/src/refungible.test.ts
@@ -17,17 +17,18 @@
import {IKeyringPair} from '@polkadot/types/types';
import {itSub, Pallets, requirePalletsOrSkip, usingPlaygrounds, expect} from './util/playgrounds';
-let alice: IKeyringPair;
-let bob: IKeyringPair;
const MAX_REFUNGIBLE_PIECES = 1_000_000_000_000_000_000_000n;
describe('integration test: Refungible functionality:', async () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
before(async function() {
await usingPlaygrounds(async (helper, privateKey) => {
requirePalletsOrSkip(this, helper, [Pallets.ReFungible]);
- alice = privateKey('//Alice');
- bob = privateKey('//Bob');
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([100n, 10n], donor);
});
});
@@ -209,36 +210,38 @@
const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'});
const token = await collection.mintToken(alice, 100n);
await token.repartition(alice, 200n);
- const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event);
- expect(chainEvents).to.include.deep.members([{
- method: 'ItemCreated',
+ const chainEvents = helper.chainLog.slice(-1)[0].events;
+ expect(chainEvents).to.deep.include({
section: 'common',
- index: '0x4202',
- data: [
- helper.api!.createType('u32', collection.collectionId).toHuman(),
- helper.api!.createType('u32', token.tokenId).toHuman(),
- {Substrate: alice.address},
- '100',
+ method: 'ItemCreated',
+ index: [66, 2],
+ data: [
+ collection.collectionId,
+ token.tokenId,
+ {substrate: alice.address},
+ 100n,
],
- }]);
+ phase: {applyExtrinsic: 2},
+ });
});
itSub('Repartition with decreased amount', async ({helper}) => {
const collection = await helper.rft.mintCollection(alice, {name: 'test', description: 'test', tokenPrefix: 'test'});
const token = await collection.mintToken(alice, 100n);
await token.repartition(alice, 50n);
- const chainEvents = helper.chainLog.slice(-1)[0].events.map((x: any) => x.event);
- expect(chainEvents).to.include.deep.members([{
+ const chainEvents = helper.chainLog.slice(-1)[0].events;
+ expect(chainEvents).to.deep.include({
method: 'ItemDestroyed',
section: 'common',
- index: '0x4203',
- data: [
- helper.api!.createType('u32', collection.collectionId).toHuman(),
- helper.api!.createType('u32', token.tokenId).toHuman(),
- {Substrate: alice.address},
- '50',
+ index: [66, 3],
+ data: [
+ collection.collectionId,
+ token.tokenId,
+ {substrate: alice.address},
+ 50n,
],
- }]);
+ phase: {applyExtrinsic: 2},
+ });
});
itSub('Create new collection with properties', async ({helper}) => {
tests/src/removeFromAllowList.test.tsdiffbeforeafterboth--- a/tests/src/removeFromAllowList.test.ts
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-import {IKeyringPair} from '@polkadot/types/types';
-import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
-
-describe('Integration Test removeFromAllowList', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('ensure bob is not in allowlist after removal', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-1', tokenPrefix: 'RFAL'});
-
- const collectionInfo = await collection.getData();
- expect(collectionInfo!.raw.permissions.access).to.not.equal('AllowList');
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
- expect(await collection.getAllowList()).to.deep.contains({Substrate: bob.address});
-
- await collection.removeFromAllowList(alice, {Substrate: bob.address});
- expect(await collection.getAllowList()).to.be.empty;
- });
-
- itSub('allows removal from collection with unset allowlist status', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-2', tokenPrefix: 'RFAL'});
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
- expect(await collection.getAllowList()).to.deep.contains({Substrate: bob.address});
-
- await collection.setPermissions(alice, {access: 'Normal'});
-
- await collection.removeFromAllowList(alice, {Substrate: bob.address});
- expect(await collection.getAllowList()).to.be.empty;
- });
-});
-
-describe('Negative Integration Test removeFromAllowList', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('fails on removal from not existing collection', async ({helper}) => {
- const nonExistentCollectionId = (1 << 32) - 1;
- await expect(helper.collection.removeFromAllowList(alice, nonExistentCollectionId, {Substrate: alice.address}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('fails on removal from removed collection', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-3', tokenPrefix: 'RFAL'});
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
-
- await collection.burn(alice);
- await expect(collection.removeFromAllowList(alice, {Substrate: bob.address}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-});
-
-describe('Integration Test removeFromAllowList with collection admin permissions', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
- let charlie: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob, charlie] = await helper.arrange.createAccounts([10n, 10n, 10n], donor);
- });
- });
-
- itSub('ensure address is not in allowlist after removal', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-4', tokenPrefix: 'RFAL'});
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addAdmin(alice, {Substrate: bob.address});
-
- await collection.addToAllowList(bob, {Substrate: charlie.address});
- await collection.removeFromAllowList(bob, {Substrate: charlie.address});
-
- expect(await collection.getAllowList()).to.be.empty;
- });
-
- itSub('Collection admin allowed to remove from allowlist with unset allowlist status', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-5', tokenPrefix: 'RFAL'});
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addAdmin(alice, {Substrate: bob.address});
- await collection.addToAllowList(alice, {Substrate: charlie.address});
-
- await collection.setPermissions(bob, {access: 'Normal'});
- await collection.removeFromAllowList(bob, {Substrate: charlie.address});
-
- expect(await collection.getAllowList()).to.be.empty;
- });
-
- itSub('Regular user can`t remove from allowlist', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'RemoveFromAllowList-6', tokenPrefix: 'RFAL'});
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: charlie.address});
-
- await expect(collection.removeFromAllowList(bob, {Substrate: charlie.address}))
- .to.be.rejectedWith(/common\.NoPermission/);
- expect(await collection.getAllowList()).to.deep.contain({Substrate: charlie.address});
- });
-});
tests/src/setContractSponsoringRateLimit.test.tsdiffbeforeafterboth--- a/tests/src/setContractSponsoringRateLimit.test.ts
+++ b/tests/src/setContractSponsoringRateLimit.test.ts
@@ -25,7 +25,7 @@
setContractSponsoringRateLimitExpectSuccess,
} from './util/helpers';
-// todo:playgrounds postponed skipped test
+// todo:playgrounds skipped~postponed test
describe.skip('Integration Test setContractSponsoringRateLimit', () => {
it('ensure sponsored contract can\'t be called twice without pause for free', async () => {
await usingApi(async (api, privateKeyWrapper) => {
tests/src/setMintPermission.test.tsdiffbeforeafterboth--- a/tests/src/setMintPermission.test.ts
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-import {IKeyringPair} from '@polkadot/types/types';
-import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
-
-describe('Integration Test setMintPermission', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('ensure allow-listed non-privileged address can mint tokens', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-1', description: '', tokenPrefix: 'SMP'});
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
-
- await expect(collection.mintToken(bob, {Substrate: bob.address})).to.not.be.rejected;
- });
-
- itSub('can be enabled twice', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-2', description: '', tokenPrefix: 'SMP'});
- expect((await collection.getData())?.raw.permissions.access).to.not.equal('AllowList');
-
- await collection.setPermissions(alice, {mintMode: true});
- await collection.setPermissions(alice, {mintMode: true});
- expect((await collection.getData())?.raw.permissions.mintMode).to.be.true;
- });
-
- itSub('can be disabled twice', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-3', description: '', tokenPrefix: 'SMP'});
- expect((await collection.getData())?.raw.permissions.access).to.equal('Normal');
-
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList');
- expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true);
-
- await collection.setPermissions(alice, {access: 'Normal', mintMode: false});
- await collection.setPermissions(alice, {access: 'Normal', mintMode: false});
- expect((await collection.getData())?.raw.permissions.access).to.equal('Normal');
- expect((await collection.getData())?.raw.permissions.mintMode).to.equal(false);
- });
-
- itSub('Collection admin success on set', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-4', description: '', tokenPrefix: 'SMP'});
- await collection.addAdmin(alice, {Substrate: bob.address});
- await collection.setPermissions(bob, {access: 'AllowList', mintMode: true});
-
- expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList');
- expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true);
- });
-});
-
-describe('Negative Integration Test setMintPermission', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('fails on not existing collection', async ({helper}) => {
- const collectionId = (1 << 32) - 1;
- await expect(helper.collection.setPermissions(alice, collectionId, {mintMode: true}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('fails on removed collection', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-1', tokenPrefix: 'SMP'});
- await collection.burn(alice);
-
- await expect(collection.setPermissions(alice, {mintMode: true}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('fails when non-owner tries to set mint status', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-2', tokenPrefix: 'SMP'});
-
- await expect(collection.setPermissions(bob, {mintMode: true}))
- .to.be.rejectedWith(/common\.NoPermission/);
- });
-
- itSub('ensure non-allow-listed non-privileged address can\'t mint tokens', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'SetMintPermission-Neg-3', tokenPrefix: 'SMP'});
- await collection.setPermissions(alice, {mintMode: true});
-
- await expect(collection.mintToken(bob, {Substrate: bob.address}))
- .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
-});
tests/src/setPermissions.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/setPermissions.test.ts
@@ -0,0 +1,107 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import {IKeyringPair} from '@polkadot/types/types';
+import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
+
+describe('Integration Test: Set Permissions', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
+ });
+ });
+
+ itSub('can all be enabled twice', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-1', tokenPrefix: 'SP'});
+ expect((await collection.getData())?.raw.permissions.access).to.not.equal('AllowList');
+
+ await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]}});
+ await collection.setPermissions(alice, {access: 'AllowList', mintMode: true, nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]}});
+
+ const permissions = (await collection.getData())?.raw.permissions;
+ expect(permissions).to.be.deep.equal({
+ access: 'AllowList',
+ mintMode: true,
+ nesting: {collectionAdmin: true, tokenOwner: true, restricted: [1, 2]},
+ });
+ });
+
+ itSub('can all be disabled twice', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-2', tokenPrefix: 'SP'});
+ expect((await collection.getData())?.raw.permissions.access).to.equal('Normal');
+
+ await collection.setPermissions(alice, {access: 'AllowList', nesting: {collectionAdmin: false, tokenOwner: true, restricted: [1, 2]}});
+ expect((await collection.getData())?.raw.permissions).to.be.deep.equal({
+ access: 'AllowList',
+ mintMode: false,
+ nesting: {collectionAdmin: false, tokenOwner: true, restricted: [1, 2]},
+ });
+
+ await collection.setPermissions(alice, {access: 'Normal', mintMode: false, nesting: {}});
+ await collection.setPermissions(alice, {access: 'Normal', mintMode: false, nesting: {}});
+ expect((await collection.getData())?.raw.permissions).to.be.deep.equal({
+ access: 'Normal',
+ mintMode: false,
+ nesting: {collectionAdmin: false, tokenOwner: false, restricted: null},
+ });
+ });
+
+ itSub('collection admin can set permissions', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-2', tokenPrefix: 'SP'});
+ await collection.addAdmin(alice, {Substrate: bob.address});
+ await collection.setPermissions(bob, {access: 'AllowList', mintMode: true});
+
+ expect((await collection.getData())?.raw.permissions.access).to.equal('AllowList');
+ expect((await collection.getData())?.raw.permissions.mintMode).to.equal(true);
+ });
+});
+
+describe('Negative Integration Test: Set Permissions', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
+ before(async () => {
+ await usingPlaygrounds(async (helper, privateKey) => {
+ const donor = privateKey('//Alice');
+ [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
+ });
+ });
+
+ itSub('fails on not existing collection', async ({helper}) => {
+ const collectionId = (1 << 32) - 1;
+ await expect(helper.collection.setPermissions(alice, collectionId, {access: 'AllowList', mintMode: true}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
+
+ itSub('fails on removed collection', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-Neg-1', tokenPrefix: 'SP'});
+ await collection.burn(alice);
+
+ await expect(collection.setPermissions(alice, {access: 'AllowList', mintMode: true}))
+ .to.be.rejectedWith(/common\.CollectionNotFound/);
+ });
+
+ itSub('fails when non-owner tries to set permissions', async ({helper}) => {
+ const collection = await helper.nft.mintCollection(alice, {name: 'SetPermissions-Neg-2', tokenPrefix: 'SP'});
+
+ await expect(collection.setPermissions(bob, {access: 'AllowList', mintMode: true}))
+ .to.be.rejectedWith(/common\.NoPermission/);
+ });
+});
\ No newline at end of file
tests/src/setPublicAccessMode.test.tsdiffbeforeafterboth--- a/tests/src/setPublicAccessMode.test.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-// https://unique-network.readthedocs.io/en/latest/jsapi.html#setschemaversion
-import {IKeyringPair} from '@polkadot/types/types';
-import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
-
-describe('Integration Test setPublicAccessMode(): ', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('Runs extrinsic with collection id parameters, sets the allowlist mode for the collection', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-1', tokenPrefix: 'TF'});
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
- await collection.addToAllowList(alice, {Substrate: bob.address});
-
- await expect(collection.mintToken(bob, {Substrate: bob.address})).to.be.not.rejected;
- });
-
- itSub('Allowlisted collection limits', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-2', tokenPrefix: 'TF'});
- await collection.setPermissions(alice, {access: 'AllowList', mintMode: true});
-
- await expect(collection.mintToken(bob, {Substrate: bob.address}))
- .to.be.rejectedWith(/common\.AddressNotInAllowlist/);
- });
-
- itSub('setPublicAccessMode by collection admin', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-4', tokenPrefix: 'TF'});
- await collection.addAdmin(alice, {Substrate: bob.address});
-
- await expect(collection.setPermissions(bob, {access: 'AllowList'})).to.be.not.rejected;
- });
-});
-
-describe('Negative Integration Test ext. setPublicAccessMode(): ', () => {
- let alice: IKeyringPair;
- let bob: IKeyringPair;
-
- before(async () => {
- await usingPlaygrounds(async (helper, privateKey) => {
- const donor = privateKey('//Alice');
- [alice, bob] = await helper.arrange.createAccounts([10n, 10n], donor);
- });
- });
-
- itSub('Sets a non-existent collection', async ({helper}) => {
- const collectionId = (1 << 32) - 1;
- await expect(helper.collection.setPermissions(alice, collectionId, {access: 'AllowList'}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('Sets the collection that has been deleted', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-1', tokenPrefix: 'TF'});
- await collection.burn(alice);
-
- await expect(collection.setPermissions(alice, {access: 'AllowList'}))
- .to.be.rejectedWith(/common\.CollectionNotFound/);
- });
-
- itSub('Re-sets the list mode already set in quantity', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-2', tokenPrefix: 'TF'});
- await collection.setPermissions(alice, {access: 'AllowList'});
- await collection.setPermissions(alice, {access: 'AllowList'});
- });
-
- itSub('Executes method as a malefactor', async ({helper}) => {
- const collection = await helper.nft.mintCollection(alice, {name: 'PublicAccess-Neg-3', tokenPrefix: 'TF'});
-
- await expect(collection.setPermissions(bob, {access: 'AllowList'}))
- .to.be.rejectedWith(/common\.NoPermission/);
- });
-});
tests/src/substrate/substrate-api.tsdiffbeforeafterboth--- a/tests/src/substrate/substrate-api.ts
+++ b/tests/src/substrate/substrate-api.ts
@@ -110,6 +110,9 @@
if (status.isBroadcast) {
return TransactionStatus.NotReady;
}
+ if (status.isRetracted) {
+ return TransactionStatus.NotReady;
+ }
if (status.isInBlock || status.isFinalized) {
if(events.filter(e => e.event.data.method === 'ExtrinsicFailed').length > 0) {
return TransactionStatus.Fail;
@@ -148,18 +151,32 @@
});
}
+/**
+ * @deprecated use `executeTransaction` instead
+ */
export function
submitTransactionAsync(sender: IKeyringPair, transaction: SubmittableExtrinsic<ApiTypes>): Promise<EventRecord[]> {
/* eslint no-async-promise-executor: "off" */
return new Promise(async (resolve, reject) => {
try {
- await transaction.signAndSend(sender, ({events = [], status}) => {
+ await transaction.signAndSend(sender, ({events = [], status, dispatchError}) => {
const transactionStatus = getTransactionStatus(events, status);
if (transactionStatus === TransactionStatus.Success) {
resolve(events);
} else if (transactionStatus === TransactionStatus.Fail) {
- console.log(`Something went wrong with transaction. Status: ${status}`);
+ let moduleError = null;
+
+ if (dispatchError) {
+ if (dispatchError.isModule) {
+ const modErr = dispatchError.asModule;
+ const errorMeta = dispatchError.registry.findMetaError(modErr);
+
+ moduleError = JSON.stringify(errorMeta, null, 4);
+ }
+ }
+
+ console.log(`Something went wrong with transaction. Status: ${status}\nModule error: ${moduleError}`);
reject(events);
}
});
tests/src/tx-version-presence.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/tx-version-presence.test.ts
@@ -0,0 +1,32 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import {Metadata} from '@polkadot/types';
+import {itSub, usingPlaygrounds, expect} from './util/playgrounds';
+
+let metadata: Metadata;
+
+describe('TxVersion is present', () => {
+ before(async () => {
+ await usingPlaygrounds(async helper => {
+ metadata = await helper.api!.rpc.state.getMetadata();
+ });
+ });
+
+ itSub('Signed extension CheckTxVersion is present', async () => {
+ expect(metadata.asLatest.extrinsic.signedExtensions.map(se => se.identifier.toString())).to.include('CheckTxVersion');
+ });
+});
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -16,7 +16,7 @@
import '../interfaces/augment-api-rpc';
import '../interfaces/augment-api-query';
-import {ApiPromise} from '@polkadot/api';
+import {ApiPromise, Keyring} from '@polkadot/api';
import type {AccountId, EventRecord, Event, BlockNumber} from '@polkadot/types/interfaces';
import type {GenericEventData} from '@polkadot/types';
import {AnyTuple, IEvent, IKeyringPair} from '@polkadot/types/types';
@@ -63,14 +63,14 @@
export async function isQuartz(): Promise<boolean> {
return usingApi(async api => {
const chain = await api.rpc.system.chain();
-
+
return chain.eq('QUARTZ');
});
}
let modulesNames: any;
export function getModuleNames(api: ApiPromise): string[] {
- if (typeof modulesNames === 'undefined')
+ if (typeof modulesNames === 'undefined')
modulesNames = api.runtimeMetadata.asLatest.pallets.map(m => m.name.toString().toLowerCase());
return modulesNames;
}
@@ -105,6 +105,19 @@
return api.registry.createType('AccountId', '0x' + number.toString(16).padStart(64, '0')).toJSON();
}
+export function bigIntToDecimals(number: bigint, decimals = 18): string {
+ const numberStr = number.toString();
+ const dotPos = numberStr.length - decimals;
+
+ if (dotPos <= 0) {
+ return '0.' + '0'.repeat(Math.abs(dotPos)) + numberStr;
+ } else {
+ const intPart = numberStr.substring(0, dotPos);
+ const fractPart = numberStr.substring(dotPos);
+ return intPart + '.' + fractPart;
+ }
+}
+
export function normalizeAccountId(input: string | AccountId | CrossAccountId | IKeyringPair): CrossAccountId {
if (typeof input === 'string') {
if (input.length >= 47) {
@@ -291,7 +304,7 @@
export function getCreateItemsResult(events: EventRecord[]): CreateItemResult[] {
const results: CreateItemResult[] = [];
-
+
const genericResult = getGenericResult<CreateItemResult[]>(events, 'common', 'ItemCreated', (data) => {
const collectionId = parseInt(data[0].toString(), 10);
const itemId = parseInt(data[1].toString(), 10);
@@ -316,15 +329,15 @@
export function getCreateItemResult(events: EventRecord[]): CreateItemResult {
const genericResult = getGenericResult(events, 'common', 'ItemCreated', (data) => data.map(function(value) { return value.toJSON(); }));
-
- if (genericResult.data == null)
+
+ if (genericResult.data == null)
return {
success: genericResult.success,
collectionId: 0,
itemId: 0,
amount: 0,
};
- else
+ else
return {
success: genericResult.success,
collectionId: genericResult.data[0] as number,
@@ -336,7 +349,7 @@
export function getDestroyItemsResult(events: EventRecord[]): DestroyItemResult[] {
const results: DestroyItemResult[] = [];
-
+
const genericResult = getGenericResult<DestroyItemResult[]>(events, 'common', 'ItemDestroyed', (data) => {
const collectionId = parseInt(data[0].toString(), 10);
const itemId = parseInt(data[1].toString(), 10);
@@ -1102,6 +1115,19 @@
return balance;
}
+export async function paraSiblingSovereignAccount(paraid: number): Promise<string> {
+ return usingApi(async api => {
+ // We are getting a *sibling* parachain sovereign account,
+ // so we need a sibling prefix: encoded(b"sibl") == 0x7369626c
+ const siblingPrefix = '0x7369626c';
+
+ const encodedParaId = api.createType('u32', paraid).toHex(true).substring(2);
+ const suffix = '000000000000000000000000000000000000000000000000';
+
+ return siblingPrefix + encodedParaId + suffix;
+ });
+}
+
export async function transferBalanceTo(api: ApiPromise, source: IKeyringPair, target: string, amount = 1000n * UNIQUE) {
const tx = api.tx.balances.transfer(target, amount);
const events = await submitTransactionAsync(source, tx);
@@ -1125,9 +1151,9 @@
expect(blockNumber).to.be.greaterThan(0);
const scheduleTx = api.tx.scheduler.scheduleNamed( // schedule
scheduledId,
- expectedBlockNumber,
- repetitions > 1 ? [period, repetitions] : null,
- 0,
+ expectedBlockNumber,
+ repetitions > 1 ? [period, repetitions] : null,
+ 0,
{Value: operationTx as any},
);
@@ -1152,13 +1178,13 @@
expect(blockNumber).to.be.greaterThan(0);
const scheduleTx = api.tx.scheduler.scheduleNamed( // schedule
scheduledId,
- expectedBlockNumber,
- repetitions <= 1 ? null : [period, repetitions],
- 0,
+ expectedBlockNumber,
+ repetitions <= 1 ? null : [period, repetitions],
+ 0,
{Value: operationTx as any},
);
- //const events =
+ //const events =
await expect(submitTransactionExpectFailAsync(sender, scheduleTx)).to.be.rejected;
//expect(getGenericResult(events).success).to.be.false;
});
@@ -1222,7 +1248,7 @@
const transferTx = api.tx.balances.transfer(recipient.address, amount);
const balanceBefore = await getFreeBalance(recipient);
-
+
await scheduleExpectSuccess(transferTx, sender, blockSchedule, scheduledId, period, repetitions);
expect(await getFreeBalance(recipient)).to.be.equal(balanceBefore);
@@ -1738,6 +1764,12 @@
return (await api.rpc.unique.collectionById(collectionId)).unwrap();
}
+export const describe_xcm = (
+ process.env.RUN_XCM_TESTS
+ ? describe
+ : describe.skip
+);
+
export async function waitNewBlocks(blocksCount = 1): Promise<void> {
await usingApi(async (api) => {
const promise = new Promise<void>(async (resolve) => {
@@ -1754,6 +1786,45 @@
});
}
+export async function waitEvent(
+ api: ApiPromise,
+ maxBlocksToWait: number,
+ eventSection: string,
+ eventMethod: string,
+): Promise<EventRecord | null> {
+
+ const promise = new Promise<EventRecord | null>(async (resolve) => {
+ const unsubscribe = await api.rpc.chain.subscribeNewHeads(async header => {
+ const blockNumber = header.number.toHuman();
+ const blockHash = header.hash;
+ const eventIdStr = `${eventSection}.${eventMethod}`;
+ const waitLimitStr = `wait blocks remaining: ${maxBlocksToWait}`;
+
+ console.log(`[Block #${blockNumber}] Waiting for event \`${eventIdStr}\` (${waitLimitStr})`);
+
+ const apiAt = await api.at(blockHash);
+ const eventRecords = await apiAt.query.system.events();
+
+ const neededEvent = eventRecords.find(r => {
+ return r.event.section == eventSection && r.event.method == eventMethod;
+ });
+
+ if (neededEvent) {
+ unsubscribe();
+ resolve(neededEvent);
+ } else if (maxBlocksToWait > 0) {
+ maxBlocksToWait--;
+ } else {
+ console.log(`Event \`${eventIdStr}\` is NOT found`);
+
+ unsubscribe();
+ resolve(null);
+ }
+ });
+ });
+ return promise;
+}
+
export async function repartitionRFT(
api: ApiPromise,
collectionId: number,
@@ -1782,6 +1853,11 @@
itApi.only = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {only: true});
itApi.skip = (name: string, cb: (apis: { api: ApiPromise, privateKeyWrapper: (account: string) => IKeyringPair }) => any) => itApi(name, cb, {skip: true});
+let accountSeed = 10000;
+export function generateKeyringPair(keyring: Keyring) {
+ const privateKey = `0xDEADBEEF${(Date.now() + (accountSeed++)).toString(16).padStart(64 - 8, '0')}`;
+ return keyring.addFromUri(privateKey);
+}
export async function expectSubstrateEventsAtBlock(api: ApiPromise, blockNumber: AnyNumber | BlockNumber, section: string, methods: string[], dryRun = false) {
const blockHash = await api.rpc.chain.getBlockHash(blockNumber);
@@ -1800,4 +1876,4 @@
expect(subEvents).to.be.like(events);
}
return subEvents;
-}
\ No newline at end of file
+}
tests/src/util/playgrounds/index.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/index.ts
+++ b/tests/src/util/playgrounds/index.ts
@@ -13,14 +13,14 @@
chai.use(chaiAsPromised);
export const expect = chai.expect;
-export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>) => {
+export const usingPlaygrounds = async (code: (helper: DevUniqueHelper, privateKey: (seed: string) => IKeyringPair) => Promise<void>, url: string = config.substrateUrl) => {
const silentConsole = new SilentConsole();
silentConsole.enable();
const helper = new DevUniqueHelper(new SilentLogger());
try {
- await helper.connect(config.substrateUrl);
+ await helper.connect(url);
const ss58Format = helper.chain.getChainProperties().ss58Format;
const privateKey = (seed: string) => helper.util.fromSeed(seed, ss58Format);
await code(helper, privateKey);
tests/src/util/playgrounds/types.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/types.ts
+++ b/tests/src/util/playgrounds/types.ts
@@ -3,22 +3,32 @@
import {IKeyringPair} from '@polkadot/types/types';
-export interface IChainEvent {
- data: any;
- method: string;
+export interface IEvent {
section: string;
+ method: string;
+ index: [number, number] | string;
+ data: any[];
+ phase: {applyExtrinsic: number} | 'Initialization',
}
export interface ITransactionResult {
- status: 'Fail' | 'Success';
- result: {
- events: {
- event: IChainEvent
- }[];
- },
- moduleError?: string;
+ status: 'Fail' | 'Success';
+ result: {
+ events: {
+ phase: any, // {ApplyExtrinsic: number} | 'Initialization',
+ event: IEvent;
+ }[];
+ },
+ moduleError?: string;
}
+export interface ISubscribeBlockEventsData {
+ number: number;
+ hash: string;
+ timestamp: number;
+ events: IEvent[];
+}
+
export interface ILogger {
log: (msg: any, level?: string) => void;
level: {
@@ -147,6 +157,11 @@
feeFrozen: bigint
}
+export interface IStakingInfo {
+ block: bigint,
+ amount: bigint,
+}
+
export type TSubstrateAccount = string;
export type TEthereumAccount = string;
export type TApiAllowedListeners = 'connected' | 'disconnected' | 'error' | 'ready' | 'decorated';
tests/src/util/playgrounds/unique.dev.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.dev.ts
+++ b/tests/src/util/playgrounds/unique.dev.ts
@@ -60,11 +60,13 @@
*/
arrange: ArrangeGroup;
wait: WaitGroup;
+ admin: AdminGroup;
constructor(logger: { log: (msg: any, level: any) => void, level: any }) {
super(logger);
this.arrange = new ArrangeGroup(this);
this.wait = new WaitGroup(this);
+ this.admin = new AdminGroup(this);
}
async connect(wsEndpoint: string, _listeners?: any): Promise<void> {
@@ -120,6 +122,7 @@
*/
createAccounts = async (balances: bigint[], donor: IKeyringPair): Promise<IKeyringPair[]> => {
let nonce = await this.helper.chain.getNonce(donor.address);
+ const wait = new WaitGroup(this.helper);
const ss58Format = this.helper.chain.getChainProperties().ss58Format;
const tokenNominal = this.helper.balance.getOneTokenNominal();
const transactions = [];
@@ -129,7 +132,7 @@
accounts.push(recipient);
if (balance !== 0n) {
const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recipient.address}, balance * tokenNominal]);
- transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce}));
+ transactions.push(this.helper.signTransaction(donor, tx, {nonce}, 'account generation'));
nonce++;
}
}
@@ -154,7 +157,7 @@
for (let index = 0; index < 5; index++) {
accountsCreated = await checkBalances();
if(accountsCreated) break;
-
+ await wait.newBlocks(1);
}
if (!accountsCreated) throw Error('Accounts generation failed');
@@ -180,7 +183,7 @@
accounts.push(recepient);
if (withBalance !== 0n) {
const tx = this.helper.constructApiCall('api.tx.balances.transfer', [{Id: recepient.address}, withBalance * tokenNominal]);
- transactions.push(this.helper.signTransaction(donor, tx, 'account generation', {nonce}));
+ transactions.push(this.helper.signTransaction(donor, tx, {nonce}, 'account generation'));
nonce++;
}
}
@@ -281,3 +284,22 @@
});
}
}
+
+class AdminGroup {
+ helper: UniqueHelper;
+
+ constructor(helper: UniqueHelper) {
+ this.helper = helper;
+ }
+
+ async payoutStakers(signer: IKeyringPair, stakersToPayout: number) {
+ const payoutResult = await this.helper.executeExtrinsic(signer, 'api.tx.appPromotion.payoutStakers', [stakersToPayout], true);
+ return payoutResult.result.events.filter(e => e.event.method === 'StakingRecalculation').map(e => {
+ return {
+ staker: e.event.data[0].toString(),
+ stake: e.event.data[1].toBigInt(),
+ payout: e.event.data[2].toBigInt(),
+ };
+ });
+ }
+}
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -6,10 +6,10 @@
/* eslint-disable no-prototype-builtins */
import {ApiPromise, WsProvider, Keyring} from '@polkadot/api';
-import {ApiInterfaceEvents} from '@polkadot/api/types';
+import {ApiInterfaceEvents, SignerOptions} from '@polkadot/api/types';
import {encodeAddress, decodeAddress, keccakAsHex, evmToAddress, addressToEvm} from '@polkadot/util-crypto';
import {IKeyringPair} from '@polkadot/types/types';
-import {IApiListeners, IBlock, IChainEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types';
+import {IApiListeners, IBlock, IEvent, IChainProperties, ICollectionCreationOptions, ICollectionLimits, ICollectionPermissions, ICrossAccountId, ICrossAccountIdLower, ILogger, INestingPermissions, IProperty, IStakingInfo, ISubstrateBalance, IToken, ITokenPropertyPermission, ITransactionResult, IUniqueHelperLog, TApiAllowedListeners, TEthereumAccount, TSigner, TSubstrateAccount, TUniqueNetworks} from './types';
export const crossAccountIdFromLower = (lowerAddress: ICrossAccountIdLower): ICrossAccountId => {
const address = {} as ICrossAccountId;
@@ -149,7 +149,7 @@
return {success, tokens};
}
- static findCollectionInEvents(events: {event: IChainEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) {
+ static findCollectionInEvents(events: {event: IEvent}[], collectionId: number, expectedSection: string, expectedMethod: string) {
let eventId = null;
events.forEach(({event: {data, method, section}}) => {
if ((section === expectedSection) && (method === expectedMethod)) {
@@ -163,7 +163,7 @@
return eventId === collectionId;
}
- static isTokenTransferSuccess(events: {event: IChainEvent}[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) {
+ static isTokenTransferSuccess(events: {event: IEvent}[], collectionId: number, tokenId: number, fromAddressObj: ICrossAccountId, toAddressObj: ICrossAccountId, amount=1n) {
const normalizeAddress = (address: string | ICrossAccountId) => {
if(typeof address === 'string') return address;
const obj = {} as any;
@@ -195,11 +195,64 @@
}
}
+class UniqueEventHelper {
+ private static extractIndex(index: any): [number, number] | string {
+ if(index.toRawType() === '[u8;2]') return [index[0], index[1]];
+ return index.toJSON();
+ }
+
+ private static extractSub(data: any, subTypes: any): {[key: string]: any} {
+ let obj: any = {};
+ let index = 0;
+
+ if (data.entries) {
+ for(const [key, value] of data.entries()) {
+ obj[key] = this.extractData(value, subTypes[index]);
+ index++;
+ }
+ } else obj = data.toJSON();
+
+ return obj;
+ }
+
+ private static extractData(data: any, type: any): any {
+ if (['u16', 'u32'].indexOf(type.type) > -1) return data.toNumber();
+ if (['u64', 'u128', 'u256'].indexOf(type.type) > -1) return data.toBigInt();
+ if(type.hasOwnProperty('sub')) return this.extractSub(data, type.sub);
+ return data.toHuman();
+ }
+ public static extractEvents(records: ITransactionResult): IEvent[] {
+ const parsedEvents: IEvent[] = [];
+
+ records.result.events.forEach((record) => {
+ const {event, phase} = record;
+ const types = (event as any).typeDef;
+
+ const eventData: IEvent = {
+ section: event.section.toString(),
+ method: event.method.toString(),
+ index: this.extractIndex(event.index),
+ data: [],
+ phase: phase.toJSON(),
+ };
+
+ event.data.forEach((val: any, index: number) => {
+ eventData.data.push(this.extractData(val, types[index]));
+ });
+
+ parsedEvents.push(eventData);
+ });
+
+ return parsedEvents;
+ }
+}
+
class ChainHelperBase {
transactionStatus = UniqueUtil.transactionStatus;
chainLogType = UniqueUtil.chainLogType;
util: typeof UniqueUtil;
+ eventHelper: typeof UniqueEventHelper;
logger: ILogger;
api: ApiPromise | null;
forcedNetwork: TUniqueNetworks | null;
@@ -208,6 +261,7 @@
constructor(logger?: ILogger) {
this.util = UniqueUtil;
+ this.eventHelper = UniqueEventHelper;
if (typeof logger == 'undefined') logger = this.util.getDefaultLogger();
this.logger = logger;
this.api = null;
@@ -290,7 +344,7 @@
return {api, network};
}
- getTransactionStatus(data: {events: {event: IChainEvent}[], status: any}) {
+ getTransactionStatus(data: {events: {event: IEvent}[], status: any}) {
const {events, status} = data;
if (status.isReady) {
return this.transactionStatus.NOT_READY;
@@ -299,11 +353,11 @@
return this.transactionStatus.NOT_READY;
}
if (status.isInBlock || status.isFinalized) {
- const errors = events.filter(e => e.event.data.method === 'ExtrinsicFailed');
+ const errors = events.filter(e => e.event.method === 'ExtrinsicFailed');
if (errors.length > 0) {
return this.transactionStatus.FAIL;
}
- if (events.filter(e => e.event.data.method === 'ExtrinsicSuccess').length > 0) {
+ if (events.filter(e => e.event.method === 'ExtrinsicSuccess').length > 0) {
return this.transactionStatus.SUCCESS;
}
}
@@ -311,7 +365,7 @@
return this.transactionStatus.FAIL;
}
- signTransaction(sender: TSigner, transaction: any, label = 'transaction', options: any = null) {
+ signTransaction(sender: TSigner, transaction: any, options: Partial<SignerOptions> | null = null, label = 'transaction') {
const sign = (callback: any) => {
if(options !== null) return transaction.signAndSend(sender, options, callback);
return transaction.signAndSend(sender, callback);
@@ -332,13 +386,16 @@
if (result.hasOwnProperty('dispatchError')) {
const dispatchError = result['dispatchError'];
- if (dispatchError && dispatchError.isModule) {
- const modErr = dispatchError.asModule;
- const errorMeta = dispatchError.registry.findMetaError(modErr);
+ if (dispatchError) {
+ if (dispatchError.isModule) {
+ const modErr = dispatchError.asModule;
+ const errorMeta = dispatchError.registry.findMetaError(modErr);
- moduleError = `${errorMeta.section}.${errorMeta.name}`;
- }
- else {
+ moduleError = `${errorMeta.section}.${errorMeta.name}`;
+ } else {
+ moduleError = dispatchError.toHuman();
+ }
+ } else {
this.logger.log(result, this.logger.level.ERROR);
}
}
@@ -364,16 +421,16 @@
return call(...params);
}
- async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=false/*, failureMessage='expected success'*/) {
+ async executeExtrinsic(sender: TSigner, extrinsic: string, params: any[], expectSuccess=true, options: Partial<SignerOptions>|null = null/*, failureMessage='expected success'*/) {
if(this.api === null) throw Error('API not initialized');
if(!extrinsic.startsWith('api.tx.')) throw Error(`${extrinsic} is not transaction`);
const startTime = (new Date()).getTime();
let result: ITransactionResult;
- let events = [];
+ let events: IEvent[] = [];
try {
- result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), extrinsic) as ITransactionResult;
- events = result.result.events.map((x: any) => x.toHuman());
+ result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), options, extrinsic) as ITransactionResult;
+ events = this.eventHelper.extractEvents(result);
}
catch(e) {
if(!(e as object).hasOwnProperty('status')) throw e;
@@ -2029,21 +2086,54 @@
return 1;
}
+ /**
+ * Get total staked amount for address
+ * @param address substrate or ethereum address
+ * @returns total staked amount
+ */
async getTotalStaked(address?: ICrossAccountId): Promise<bigint> {
if (address) return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked', [address])).toBigInt();
return (await this.helper.callRpc('api.rpc.appPromotion.totalStaked')).toBigInt();
}
- async getTotalStakedPerBlock(address: ICrossAccountId): Promise<bigint[][]> {
- return (await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
+ /**
+ * Get total staked per block
+ * @param address substrate or ethereum address
+ * @returns array of stakes. `block` – the number of the block in which the stake was made. `amount` - the number of tokens staked in the block
+ */
+ async getTotalStakedPerBlock(address: ICrossAccountId): Promise<IStakingInfo[]> {
+ const rawTotalStakerdPerBlock = await this.helper.callRpc('api.rpc.appPromotion.totalStakedPerBlock', [address]);
+ return rawTotalStakerdPerBlock.map(([block, amount]: any[]) => {
+ return {
+ block: block.toBigInt(),
+ amount: amount.toBigInt(),
+ };
+ });
}
+ /**
+ * Get total pending unstake amount for address
+ * @param address substrate or ethereum address
+ * @returns total pending unstake amount
+ */
async getPendingUnstake(address: ICrossAccountId): Promise<bigint> {
return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstake', [address])).toBigInt();
}
- async getPendingUnstakePerBlock(address: ICrossAccountId): Promise<bigint[][]> {
- return (await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address])).map(([block, amount]: any[]) => [block.toBigInt(), amount.toBigInt()]);
+ /**
+ * Get pending unstake amount per block for address
+ * @param address substrate or ethereum address
+ * @returns array of pending stakes. `block` – the number of the block in which the unstake was made. `amount` - the number of tokens unstaked in the block
+ */
+ async getPendingUnstakePerBlock(address: ICrossAccountId): Promise<IStakingInfo[]> {
+ const rawUnstakedPerBlock = await this.helper.callRpc('api.rpc.appPromotion.pendingUnstakePerBlock', [address]);
+ const result = rawUnstakedPerBlock.map(([block, amount]: any[]) => {
+ return {
+ block: block.toBigInt(),
+ amount: amount.toBigInt(),
+ };
+ });
+ return result;
}
}
tests/src/xcm/xcmOpal.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/xcm/xcmOpal.test.ts
@@ -0,0 +1,527 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+
+import {WsProvider} from '@polkadot/api';
+import {ApiOptions} from '@polkadot/api/types';
+import {IKeyringPair} from '@polkadot/types/types';
+import usingApi, {executeTransaction} from './../substrate/substrate-api';
+import {bigIntToDecimals, describe_xcm, getGenericResult, paraSiblingSovereignAccount} from './../util/helpers';
+import waitNewBlocks from './../substrate/wait-new-blocks';
+import {normalizeAccountId} from './../util/helpers';
+import getBalance from './../substrate/get-balance';
+
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+const STATEMINE_CHAIN = 1000;
+const UNIQUE_CHAIN = 2095;
+
+const RELAY_PORT = '9844';
+const UNIQUE_PORT = '9944';
+const STATEMINE_PORT = '9948';
+const STATEMINE_PALLET_INSTANCE = 50;
+const ASSET_ID = 100;
+const ASSET_METADATA_DECIMALS = 18;
+const ASSET_METADATA_NAME = 'USDT';
+const ASSET_METADATA_DESCRIPTION = 'USDT';
+const ASSET_METADATA_MINIMAL_BALANCE = 1;
+
+const WESTMINT_DECIMALS = 12;
+
+const TRANSFER_AMOUNT = 1_000_000_000_000_000_000n;
+
+// 10,000.00 (ten thousands) USDT
+const ASSET_AMOUNT = 1_000_000_000_000_000_000_000n;
+
+describe_xcm('[XCM] Integration test: Exchanging USDT with Westmint', () => {
+ let alice: IKeyringPair;
+ let bob: IKeyringPair;
+
+ let balanceStmnBefore: bigint;
+ let balanceStmnAfter: bigint;
+
+ let balanceOpalBefore: bigint;
+ let balanceOpalAfter: bigint;
+ let balanceOpalFinal: bigint;
+
+ let balanceBobBefore: bigint;
+ let balanceBobAfter: bigint;
+ let balanceBobFinal: bigint;
+
+ let balanceBobRelayTokenBefore: bigint;
+ let balanceBobRelayTokenAfter: bigint;
+
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ alice = privateKeyWrapper('//Alice');
+ bob = privateKeyWrapper('//Bob'); // funds donor
+ });
+
+ const statemineApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT),
+ };
+
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ const relayApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT),
+ };
+
+ await usingApi(async (api) => {
+
+ // 350.00 (three hundred fifty) DOT
+ const fundingAmount = 3_500_000_000_000;
+
+ const tx = api.tx.assets.create(ASSET_ID, alice.addressRaw, ASSET_METADATA_MINIMAL_BALANCE);
+ const events = await executeTransaction(api, alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ // set metadata
+ const tx2 = api.tx.assets.setMetadata(ASSET_ID, ASSET_METADATA_NAME, ASSET_METADATA_DESCRIPTION, ASSET_METADATA_DECIMALS);
+ const events2 = await executeTransaction(api, alice, tx2);
+ const result2 = getGenericResult(events2);
+ expect(result2.success).to.be.true;
+
+ // mint some amount of asset
+ const tx3 = api.tx.assets.mint(ASSET_ID, alice.addressRaw, ASSET_AMOUNT);
+ const events3 = await executeTransaction(api, alice, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+
+ // funding parachain sovereing account (Parachain: 2095)
+ const parachainSovereingAccount = await paraSiblingSovereignAccount(UNIQUE_CHAIN);
+ const tx4 = api.tx.balances.transfer(parachainSovereingAccount, fundingAmount);
+ const events4 = await executeTransaction(api, bob, tx4);
+ const result4 = getGenericResult(events4);
+ expect(result4.success).to.be.true;
+
+ }, statemineApiOptions);
+
+
+ await usingApi(async (api) => {
+
+ const location = {
+ V1: {
+ parents: 1,
+ interior: {X3: [
+ {
+ Parachain: STATEMINE_CHAIN,
+ },
+ {
+ PalletInstance: STATEMINE_PALLET_INSTANCE,
+ },
+ {
+ GeneralIndex: ASSET_ID,
+ },
+ ]},
+ },
+ };
+
+ const metadata =
+ {
+ name: ASSET_ID,
+ symbol: ASSET_METADATA_NAME,
+ decimals: ASSET_METADATA_DECIMALS,
+ minimalBalance: ASSET_METADATA_MINIMAL_BALANCE,
+ };
+ //registerForeignAsset(owner, location, metadata)
+ const tx = api.tx.foreignAssets.registerForeignAsset(alice.addressRaw, location, metadata);
+ const sudoTx = api.tx.sudo.sudo(tx as any);
+ const events = await executeTransaction(api, alice, sudoTx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceOpalBefore] = await getBalance(api, [alice.address]);
+
+ }, uniqueApiOptions);
+
+
+ // Providing the relay currency to the unique sender account
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ Parachain: UNIQUE_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: 50_000_000_000_000_000n,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5_000_000_000,
+ };
+
+ const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await executeTransaction(api, alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, relayApiOptions);
+
+ });
+
+ it('Should connect and send USDT from Westmint to Opal', async () => {
+
+ const statemineApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT),
+ };
+
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ await usingApi(async (api) => {
+
+ const dest = {
+ V1: {
+ parents: 1,
+ interior: {X1: {
+ Parachain: UNIQUE_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: {
+ X2: [
+ {
+ PalletInstance: STATEMINE_PALLET_INSTANCE,
+ },
+ {
+ GeneralIndex: ASSET_ID,
+ },
+ ]},
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5000000000,
+ };
+
+ [balanceStmnBefore] = await getBalance(api, [alice.address]);
+
+ const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(dest, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await executeTransaction(api, alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceStmnAfter] = await getBalance(api, [alice.address]);
+
+ // common good parachain take commission in it native token
+ console.log(
+ 'Opal to Westmint transaction fees on Westmint: %s WND',
+ bigIntToDecimals(balanceStmnBefore - balanceStmnAfter, WESTMINT_DECIMALS),
+ );
+ expect(balanceStmnBefore > balanceStmnAfter).to.be.true;
+
+ }, statemineApiOptions);
+
+
+ // ensure that asset has been delivered
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+ // expext collection id will be with id 1
+ const free = (await api.query.fungible.balance(1, normalizeAccountId(alice.address))).toBigInt();
+
+ [balanceOpalAfter] = await getBalance(api, [alice.address]);
+
+ // commission has not paid in USDT token
+ expect(free == TRANSFER_AMOUNT).to.be.true;
+ console.log(
+ 'Opal to Westmint transaction fees on Opal: %s USDT',
+ bigIntToDecimals(TRANSFER_AMOUNT - free),
+ );
+ // ... and parachain native token
+ expect(balanceOpalAfter == balanceOpalBefore).to.be.true;
+ console.log(
+ 'Opal to Westmint transaction fees on Opal: %s WND',
+ bigIntToDecimals(balanceOpalAfter - balanceOpalBefore, WESTMINT_DECIMALS),
+ );
+
+ }, uniqueApiOptions);
+
+ });
+
+ it('Should connect and send USDT from Unique to Statemine back', async () => {
+
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ const statemineApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + STATEMINE_PORT),
+ };
+
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {X2: [
+ {
+ Parachain: STATEMINE_CHAIN,
+ },
+ {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ },
+ ]},
+ },
+ };
+
+ const currencies: [any, bigint][] = [
+ [
+ {
+ ForeignAssetId: 0,
+ },
+ //10_000_000_000_000_000n,
+ TRANSFER_AMOUNT,
+ ],
+ [
+ {
+ NativeAssetId: 'Parent',
+ },
+ 400_000_000_000_000n,
+ ],
+ ];
+
+ const feeItem = 1;
+ const destWeight = 500000000000;
+
+ const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight);
+ const events = await executeTransaction(api, alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ // the commission has been paid in parachain native token
+ [balanceOpalFinal] = await getBalance(api, [alice.address]);
+ expect(balanceOpalAfter > balanceOpalFinal).to.be.true;
+ }, uniqueApiOptions);
+
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ // The USDT token never paid fees. Its amount not changed from begin value.
+ // Also check that xcm transfer has been succeeded
+ const free = ((await api.query.assets.account(100, alice.address)).toHuman()) as any;
+ expect(BigInt(free.balance.replace(/,/g, '')) == ASSET_AMOUNT).to.be.true;
+ }, statemineApiOptions);
+ });
+
+ it('Should connect and send Relay token to Unique', async () => {
+
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ const uniqueApiOptions2: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ const relayApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + RELAY_PORT),
+ };
+
+ const TRANSFER_AMOUNT_RELAY = 50_000_000_000_000_000n;
+
+ await usingApi(async (api) => {
+ [balanceBobBefore] = await getBalance(api, [bob.address]);
+ balanceBobRelayTokenBefore = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free);
+
+ }, uniqueApiOptions);
+
+ // Providing the relay currency to the unique sender account
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ Parachain: UNIQUE_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: bob.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT_RELAY,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5_000_000_000,
+ };
+
+ const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await executeTransaction(api, bob, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, relayApiOptions);
+
+
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceBobAfter] = await getBalance(api, [bob.address]);
+ balanceBobRelayTokenAfter = BigInt(((await api.query.tokens.accounts(bob.addressRaw, {NativeAssetId: 'Parent'})).toJSON() as any).free);
+ const wndFee = balanceBobRelayTokenAfter - TRANSFER_AMOUNT_RELAY - balanceBobRelayTokenBefore;
+ console.log(
+ 'Relay (Westend) to Opal transaction fees: %s OPL',
+ bigIntToDecimals(balanceBobAfter - balanceBobBefore),
+ );
+ console.log(
+ 'Relay (Westend) to Opal transaction fees: %s WND',
+ bigIntToDecimals(wndFee, WESTMINT_DECIMALS),
+ );
+ expect(balanceBobBefore == balanceBobAfter).to.be.true;
+ expect(balanceBobRelayTokenBefore < balanceBobRelayTokenAfter).to.be.true;
+ }, uniqueApiOptions2);
+
+ });
+
+ it('Should connect and send Relay token back', async () => {
+ const uniqueApiOptions: ApiOptions = {
+ provider: new WsProvider('ws://127.0.0.1:' + UNIQUE_PORT),
+ };
+
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {X2: [
+ {
+ Parachain: STATEMINE_CHAIN,
+ },
+ {
+ AccountId32: {
+ network: 'Any',
+ id: bob.addressRaw,
+ },
+ },
+ ]},
+ },
+ };
+
+ const currencies: any = [
+ [
+ {
+ NativeAssetId: 'Parent',
+ },
+ 50_000_000_000_000_000n,
+ ],
+ ];
+
+ const feeItem = 0;
+ const destWeight = 500000000000;
+
+ const tx = api.tx.xTokens.transferMulticurrencies(currencies, feeItem, destination, destWeight);
+ const events = await executeTransaction(api, bob, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceBobFinal] = await getBalance(api, [bob.address]);
+ console.log('Relay (Westend) to Opal transaction fees: %s OPL', balanceBobAfter - balanceBobFinal);
+
+ }, uniqueApiOptions);
+ });
+
+});
tests/src/xcm/xcmQuartz.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/xcm/xcmQuartz.test.ts
@@ -0,0 +1,799 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+
+import {WsProvider, Keyring} from '@polkadot/api';
+import {ApiOptions} from '@polkadot/api/types';
+import {IKeyringPair} from '@polkadot/types/types';
+import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
+import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers';
+import {MultiLocation} from '@polkadot/types/interfaces';
+import {blake2AsHex} from '@polkadot/util-crypto';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import getBalance from '../substrate/get-balance';
+import {XcmV2TraitsOutcome, XcmV2TraitsError} from '../interfaces';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+const QUARTZ_CHAIN = 2095;
+const KARURA_CHAIN = 2000;
+const MOONRIVER_CHAIN = 2023;
+
+const RELAY_PORT = 9844;
+const KARURA_PORT = 9946;
+const MOONRIVER_PORT = 9947;
+
+const KARURA_DECIMALS = 12;
+
+const TRANSFER_AMOUNT = 2000000000000000000000000n;
+
+function parachainApiOptions(port: number): ApiOptions {
+ return {
+ provider: new WsProvider('ws://127.0.0.1:' + port.toString()),
+ };
+}
+
+function karuraOptions(): ApiOptions {
+ return parachainApiOptions(KARURA_PORT);
+}
+
+function moonriverOptions(): ApiOptions {
+ return parachainApiOptions(MOONRIVER_PORT);
+}
+
+function relayOptions(): ApiOptions {
+ return parachainApiOptions(RELAY_PORT);
+}
+
+describe_xcm('[XCM] Integration test: Exchanging tokens with Karura', () => {
+ let alice: IKeyringPair;
+ let randomAccount: IKeyringPair;
+
+ let balanceQuartzTokenInit: bigint;
+ let balanceQuartzTokenMiddle: bigint;
+ let balanceQuartzTokenFinal: bigint;
+ let balanceKaruraTokenInit: bigint;
+ let balanceKaruraTokenMiddle: bigint;
+ let balanceKaruraTokenFinal: bigint;
+ let balanceQuartzForeignTokenInit: bigint;
+ let balanceQuartzForeignTokenMiddle: bigint;
+ let balanceQuartzForeignTokenFinal: bigint;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ const keyringSr25519 = new Keyring({type: 'sr25519'});
+
+ alice = privateKeyWrapper('//Alice');
+ randomAccount = generateKeyringPair(keyringSr25519);
+ });
+
+ // Karura side
+ await usingApi(
+ async (api) => {
+ const destination = {
+ V0: {
+ X2: [
+ 'Parent',
+ {
+ Parachain: QUARTZ_CHAIN,
+ },
+ ],
+ },
+ };
+
+ const metadata = {
+ name: 'QTZ',
+ symbol: 'QTZ',
+ decimals: 18,
+ minimalBalance: 1,
+ };
+
+ const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata);
+ const sudoTx = api.tx.sudo.sudo(tx as any);
+ const events = await submitTransactionAsync(alice, sudoTx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n);
+ const events1 = await submitTransactionAsync(alice, tx1);
+ const result1 = getGenericResult(events1);
+ expect(result1.success).to.be.true;
+
+ [balanceKaruraTokenInit] = await getBalance(api, [randomAccount.address]);
+ {
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ balanceQuartzForeignTokenInit = BigInt(free);
+ }
+ },
+ karuraOptions(),
+ );
+
+ // Quartz side
+ await usingApi(async (api) => {
+ const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT);
+ const events0 = await submitTransactionAsync(alice, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+
+ [balanceQuartzTokenInit] = await getBalance(api, [randomAccount.address]);
+ });
+ });
+
+ it('Should connect and send QTZ to Karura', async () => {
+
+ // Quartz side
+ await usingApi(async (api) => {
+
+ const destination = {
+ V0: {
+ X2: [
+ 'Parent',
+ {
+ Parachain: KARURA_CHAIN,
+ },
+ ],
+ },
+ };
+
+ const beneficiary = {
+ V0: {
+ X1: {
+ AccountId32: {
+ network: 'Any',
+ id: randomAccount.addressRaw,
+ },
+ },
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5000000000,
+ };
+
+ const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await submitTransactionAsync(randomAccount, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccount.address]);
+
+ const qtzFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT;
+ console.log('[Quartz -> Karura] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
+ expect(qtzFees > 0n).to.be.true;
+ });
+
+ // Karura side
+ await usingApi(
+ async (api) => {
+ await waitNewBlocks(api, 3);
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ balanceQuartzForeignTokenMiddle = BigInt(free);
+
+ [balanceKaruraTokenMiddle] = await getBalance(api, [randomAccount.address]);
+
+ const karFees = balanceKaruraTokenInit - balanceKaruraTokenMiddle;
+ const qtzIncomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenInit;
+
+ console.log(
+ '[Quartz -> Karura] transaction fees on Karura: %s KAR',
+ bigIntToDecimals(karFees, KARURA_DECIMALS),
+ );
+ console.log('[Quartz -> Karura] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer));
+ expect(karFees == 0n).to.be.true;
+ expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ karuraOptions(),
+ );
+ });
+
+ it('Should connect to Karura and send QTZ back', async () => {
+
+ // Karura side
+ await usingApi(
+ async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: QUARTZ_CHAIN},
+ {
+ AccountId32: {
+ network: 'Any',
+ id: randomAccount.addressRaw,
+ },
+ },
+ ],
+ },
+ },
+ };
+
+ const id = {
+ ForeignAsset: 0,
+ };
+
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight);
+ const events = await submitTransactionAsync(randomAccount, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceKaruraTokenFinal] = await getBalance(api, [randomAccount.address]);
+ {
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any;
+ balanceQuartzForeignTokenFinal = BigInt(free);
+ }
+
+ const karFees = balanceKaruraTokenMiddle - balanceKaruraTokenFinal;
+ const qtzOutcomeTransfer = balanceQuartzForeignTokenMiddle - balanceQuartzForeignTokenFinal;
+
+ console.log(
+ '[Karura -> Quartz] transaction fees on Karura: %s KAR',
+ bigIntToDecimals(karFees, KARURA_DECIMALS),
+ );
+ console.log('[Karura -> Quartz] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer));
+
+ expect(karFees > 0).to.be.true;
+ expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ karuraOptions(),
+ );
+
+ // Quartz side
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceQuartzTokenFinal] = await getBalance(api, [randomAccount.address]);
+ const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle;
+ expect(actuallyDelivered > 0).to.be.true;
+
+ console.log('[Karura -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered));
+
+ const qtzFees = TRANSFER_AMOUNT - actuallyDelivered;
+ console.log('[Karura -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
+ expect(qtzFees == 0n).to.be.true;
+ });
+ });
+});
+
+// These tests are relevant only when the foreign asset pallet is disabled
+describe_xcm('[XCM] Integration test: Quartz rejects non-native tokens', () => {
+ let alice: IKeyringPair;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ alice = privateKeyWrapper('//Alice');
+ });
+ });
+
+ it('Quartz rejects tokens from the Relay', async () => {
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ Parachain: QUARTZ_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: 50_000_000_000_000_000n,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5_000_000_000,
+ };
+
+ const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await submitTransactionAsync(alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, relayOptions());
+
+ await usingApi(async api => {
+ const maxWaitBlocks = 3;
+ const dmpQueueExecutedDownward = await waitEvent(
+ api,
+ maxWaitBlocks,
+ 'dmpQueue',
+ 'ExecutedDownward',
+ );
+
+ expect(
+ dmpQueueExecutedDownward != null,
+ '[Relay] dmpQueue.ExecutedDownward event is expected',
+ ).to.be.true;
+
+ const event = dmpQueueExecutedDownward!.event;
+ const outcome = event.data[1] as XcmV2TraitsOutcome;
+
+ expect(
+ outcome.isIncomplete,
+ '[Relay] The outcome of the XCM should be `Incomplete`',
+ ).to.be.true;
+
+ const incomplete = outcome.asIncomplete;
+ expect(
+ incomplete[1].toString() == 'AssetNotFound',
+ '[Relay] The XCM error should be `AssetNotFound`',
+ ).to.be.true;
+ });
+ });
+
+ it('Quartz rejects KAR tokens from Karura', async () => {
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: QUARTZ_CHAIN},
+ {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ },
+ ],
+ },
+ },
+ };
+
+ const id = {
+ Token: 'KAR',
+ };
+
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight);
+ const events = await submitTransactionAsync(alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, karuraOptions());
+
+ await usingApi(async api => {
+ const maxWaitBlocks = 3;
+ const xcmpQueueFailEvent = await waitEvent(api, maxWaitBlocks, 'xcmpQueue', 'Fail');
+
+ expect(
+ xcmpQueueFailEvent != null,
+ '[Karura] xcmpQueue.FailEvent event is expected',
+ ).to.be.true;
+
+ const event = xcmpQueueFailEvent!.event;
+ const outcome = event.data[1] as XcmV2TraitsError;
+
+ expect(
+ outcome.isUntrustedReserveLocation,
+ '[Karura] The XCM error should be `UntrustedReserveLocation`',
+ ).to.be.true;
+ });
+ });
+});
+
+describe_xcm('[XCM] Integration test: Exchanging QTZ with Moonriver', () => {
+
+ // Quartz constants
+ let quartzAlice: IKeyringPair;
+ let quartzAssetLocation;
+
+ let randomAccountQuartz: IKeyringPair;
+ let randomAccountMoonriver: IKeyringPair;
+
+ // Moonriver constants
+ let assetId: string;
+
+ const moonriverKeyring = new Keyring({type: 'ethereum'});
+ const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133';
+ const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b';
+ const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68';
+
+ const alithAccount = moonriverKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum');
+ const baltatharAccount = moonriverKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum');
+ const dorothyAccount = moonriverKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum');
+
+ const councilVotingThreshold = 2;
+ const technicalCommitteeThreshold = 2;
+ const votingPeriod = 3;
+ const delayPeriod = 0;
+
+ const quartzAssetMetadata = {
+ name: 'xcQuartz',
+ symbol: 'xcQTZ',
+ decimals: 18,
+ isFrozen: false,
+ minimalBalance: 1,
+ };
+
+ let balanceQuartzTokenInit: bigint;
+ let balanceQuartzTokenMiddle: bigint;
+ let balanceQuartzTokenFinal: bigint;
+ let balanceForeignQtzTokenInit: bigint;
+ let balanceForeignQtzTokenMiddle: bigint;
+ let balanceForeignQtzTokenFinal: bigint;
+ let balanceMovrTokenInit: bigint;
+ let balanceMovrTokenMiddle: bigint;
+ let balanceMovrTokenFinal: bigint;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ const keyringEth = new Keyring({type: 'ethereum'});
+ const keyringSr25519 = new Keyring({type: 'sr25519'});
+
+ quartzAlice = privateKeyWrapper('//Alice');
+ randomAccountQuartz = generateKeyringPair(keyringSr25519);
+ randomAccountMoonriver = generateKeyringPair(keyringEth);
+
+ balanceForeignQtzTokenInit = 0n;
+ });
+
+ await usingApi(
+ async (api) => {
+
+ // >>> Sponsoring Dorothy >>>
+ console.log('Sponsoring Dorothy.......');
+ const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n);
+ const events0 = await submitTransactionAsync(alithAccount, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+ console.log('Sponsoring Dorothy.......DONE');
+ // <<< Sponsoring Dorothy <<<
+
+ const sourceLocation: MultiLocation = api.createType(
+ 'MultiLocation',
+ {
+ parents: 1,
+ interior: {X1: {Parachain: QUARTZ_CHAIN}},
+ },
+ );
+
+ quartzAssetLocation = {XCM: sourceLocation};
+ const existentialDeposit = 1;
+ const isSufficient = true;
+ const unitsPerSecond = '1';
+ const numAssetsWeightHint = 0;
+
+ const registerTx = api.tx.assetManager.registerForeignAsset(
+ quartzAssetLocation,
+ quartzAssetMetadata,
+ existentialDeposit,
+ isSufficient,
+ );
+ console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || '');
+
+ const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond(
+ quartzAssetLocation,
+ unitsPerSecond,
+ numAssetsWeightHint,
+ );
+ console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || '');
+
+ const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]);
+ console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || '');
+
+ // >>> Note motion preimage >>>
+ console.log('Note motion preimage.......');
+ const encodedProposal = batchCall?.method.toHex() || '';
+ const proposalHash = blake2AsHex(encodedProposal);
+ console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal);
+ console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash);
+ console.log('Encoded length %d', encodedProposal.length);
+
+ const tx1 = api.tx.democracy.notePreimage(encodedProposal);
+ const events1 = await submitTransactionAsync(baltatharAccount, tx1);
+ const result1 = getGenericResult(events1);
+ expect(result1.success).to.be.true;
+ console.log('Note motion preimage.......DONE');
+ // <<< Note motion preimage <<<
+
+ // >>> Propose external motion through council >>>
+ console.log('Propose external motion through council.......');
+ const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash);
+ const tx2 = api.tx.councilCollective.propose(
+ councilVotingThreshold,
+ externalMotion,
+ externalMotion.encodedLength,
+ );
+ const events2 = await submitTransactionAsync(baltatharAccount, tx2);
+ const result2 = getGenericResult(events2);
+ expect(result2.success).to.be.true;
+
+ const encodedMotion = externalMotion?.method.toHex() || '';
+ const motionHash = blake2AsHex(encodedMotion);
+ console.log('Motion hash is %s', motionHash);
+
+ const tx3 = api.tx.councilCollective.vote(motionHash, 0, true);
+ {
+ const events3 = await submitTransactionAsync(dorothyAccount, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+ }
+ {
+ const events3 = await submitTransactionAsync(baltatharAccount, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+ }
+
+ const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength);
+ const events4 = await submitTransactionAsync(dorothyAccount, tx4);
+ const result4 = getGenericResult(events4);
+ expect(result4.success).to.be.true;
+ console.log('Propose external motion through council.......DONE');
+ // <<< Propose external motion through council <<<
+
+ // >>> Fast track proposal through technical committee >>>
+ console.log('Fast track proposal through technical committee.......');
+ const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod);
+ const tx5 = api.tx.techCommitteeCollective.propose(
+ technicalCommitteeThreshold,
+ fastTrack,
+ fastTrack.encodedLength,
+ );
+ const events5 = await submitTransactionAsync(alithAccount, tx5);
+ const result5 = getGenericResult(events5);
+ expect(result5.success).to.be.true;
+
+ const encodedFastTrack = fastTrack?.method.toHex() || '';
+ const fastTrackHash = blake2AsHex(encodedFastTrack);
+ console.log('FastTrack hash is %s', fastTrackHash);
+
+ const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1;
+ const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true);
+ {
+ const events6 = await submitTransactionAsync(baltatharAccount, tx6);
+ const result6 = getGenericResult(events6);
+ expect(result6.success).to.be.true;
+ }
+ {
+ const events6 = await submitTransactionAsync(alithAccount, tx6);
+ const result6 = getGenericResult(events6);
+ expect(result6.success).to.be.true;
+ }
+
+ const tx7 = api.tx.techCommitteeCollective
+ .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength);
+ const events7 = await submitTransactionAsync(baltatharAccount, tx7);
+ const result7 = getGenericResult(events7);
+ expect(result7.success).to.be.true;
+ console.log('Fast track proposal through technical committee.......DONE');
+ // <<< Fast track proposal through technical committee <<<
+
+ // >>> Referendum voting >>>
+ console.log('Referendum voting.......');
+ const tx8 = api.tx.democracy.vote(
+ 0,
+ {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}},
+ );
+ const events8 = await submitTransactionAsync(dorothyAccount, tx8);
+ const result8 = getGenericResult(events8);
+ expect(result8.success).to.be.true;
+ console.log('Referendum voting.......DONE');
+ // <<< Referendum voting <<<
+
+ // >>> Acquire Quartz AssetId Info on Moonriver >>>
+ console.log('Acquire Quartz AssetId Info on Moonriver.......');
+
+ // Wait for the democracy execute
+ await waitNewBlocks(api, 5);
+
+ assetId = (await api.query.assetManager.assetTypeId({
+ XCM: sourceLocation,
+ })).toString();
+
+ console.log('QTZ asset ID is %s', assetId);
+ console.log('Acquire Quartz AssetId Info on Moonriver.......DONE');
+ // >>> Acquire Quartz AssetId Info on Moonriver >>>
+
+ // >>> Sponsoring random Account >>>
+ console.log('Sponsoring random Account.......');
+ const tx10 = api.tx.balances.transfer(randomAccountMoonriver.address, 11_000_000_000_000_000_000n);
+ const events10 = await submitTransactionAsync(baltatharAccount, tx10);
+ const result10 = getGenericResult(events10);
+ expect(result10.success).to.be.true;
+ console.log('Sponsoring random Account.......DONE');
+ // <<< Sponsoring random Account <<<
+
+ [balanceMovrTokenInit] = await getBalance(api, [randomAccountMoonriver.address]);
+ },
+ moonriverOptions(),
+ );
+
+ await usingApi(async (api) => {
+ const tx0 = api.tx.balances.transfer(randomAccountQuartz.address, 10n * TRANSFER_AMOUNT);
+ const events0 = await submitTransactionAsync(quartzAlice, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+
+ [balanceQuartzTokenInit] = await getBalance(api, [randomAccountQuartz.address]);
+ });
+ });
+
+ it('Should connect and send QTZ to Moonriver', async () => {
+ await usingApi(async (api) => {
+ const currencyId = {
+ NativeAssetId: 'Here',
+ };
+ const dest = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: MOONRIVER_CHAIN},
+ {AccountKey20: {network: 'Any', key: randomAccountMoonriver.address}},
+ ],
+ },
+ },
+ };
+ const amount = TRANSFER_AMOUNT;
+ const destWeight = 850000000;
+
+ const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight);
+ const events = await submitTransactionAsync(randomAccountQuartz, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceQuartzTokenMiddle] = await getBalance(api, [randomAccountQuartz.address]);
+ expect(balanceQuartzTokenMiddle < balanceQuartzTokenInit).to.be.true;
+
+ const transactionFees = balanceQuartzTokenInit - balanceQuartzTokenMiddle - TRANSFER_AMOUNT;
+ console.log('[Quartz -> Moonriver] transaction fees on Quartz: %s QTZ', bigIntToDecimals(transactionFees));
+ expect(transactionFees > 0).to.be.true;
+ });
+
+ await usingApi(
+ async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceMovrTokenMiddle] = await getBalance(api, [randomAccountMoonriver.address]);
+
+ const movrFees = balanceMovrTokenInit - balanceMovrTokenMiddle;
+ console.log('[Quartz -> Moonriver] transaction fees on Moonriver: %s MOVR',bigIntToDecimals(movrFees));
+ expect(movrFees == 0n).to.be.true;
+
+ const qtzRandomAccountAsset = (
+ await api.query.assets.account(assetId, randomAccountMoonriver.address)
+ ).toJSON()! as any;
+
+ balanceForeignQtzTokenMiddle = BigInt(qtzRandomAccountAsset['balance']);
+ const qtzIncomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenInit;
+ console.log('[Quartz -> Moonriver] income %s QTZ', bigIntToDecimals(qtzIncomeTransfer));
+ expect(qtzIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ moonriverOptions(),
+ );
+ });
+
+ it('Should connect to Moonriver and send QTZ back', async () => {
+ await usingApi(
+ async (api) => {
+ const asset = {
+ V1: {
+ id: {
+ Concrete: {
+ parents: 1,
+ interior: {
+ X1: {Parachain: QUARTZ_CHAIN},
+ },
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ };
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: QUARTZ_CHAIN},
+ {AccountId32: {network: 'Any', id: randomAccountQuartz.addressRaw}},
+ ],
+ },
+ },
+ };
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight);
+ const events = await submitTransactionAsync(randomAccountMoonriver, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceMovrTokenFinal] = await getBalance(api, [randomAccountMoonriver.address]);
+
+ const movrFees = balanceMovrTokenMiddle - balanceMovrTokenFinal;
+ console.log('[Moonriver -> Quartz] transaction fees on Moonriver: %s MOVR', bigIntToDecimals(movrFees));
+ expect(movrFees > 0).to.be.true;
+
+ const qtzRandomAccountAsset = (
+ await api.query.assets.account(assetId, randomAccountMoonriver.address)
+ ).toJSON()! as any;
+
+ expect(qtzRandomAccountAsset).to.be.null;
+
+ balanceForeignQtzTokenFinal = 0n;
+
+ const qtzOutcomeTransfer = balanceForeignQtzTokenMiddle - balanceForeignQtzTokenFinal;
+ console.log('[Quartz -> Moonriver] outcome %s QTZ', bigIntToDecimals(qtzOutcomeTransfer));
+ expect(qtzOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ moonriverOptions(),
+ );
+
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceQuartzTokenFinal] = await getBalance(api, [randomAccountQuartz.address]);
+ const actuallyDelivered = balanceQuartzTokenFinal - balanceQuartzTokenMiddle;
+ expect(actuallyDelivered > 0).to.be.true;
+
+ console.log('[Moonriver -> Quartz] actually delivered %s QTZ', bigIntToDecimals(actuallyDelivered));
+
+ const qtzFees = TRANSFER_AMOUNT - actuallyDelivered;
+ console.log('[Moonriver -> Quartz] transaction fees on Quartz: %s QTZ', bigIntToDecimals(qtzFees));
+ expect(qtzFees == 0n).to.be.true;
+ });
+ });
+});
tests/src/xcm/xcmUnique.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/xcm/xcmUnique.test.ts
@@ -0,0 +1,799 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+import chai from 'chai';
+import chaiAsPromised from 'chai-as-promised';
+
+import {WsProvider, Keyring} from '@polkadot/api';
+import {ApiOptions} from '@polkadot/api/types';
+import {IKeyringPair} from '@polkadot/types/types';
+import usingApi, {submitTransactionAsync} from '../substrate/substrate-api';
+import {getGenericResult, generateKeyringPair, waitEvent, describe_xcm, bigIntToDecimals} from '../util/helpers';
+import {MultiLocation} from '@polkadot/types/interfaces';
+import {blake2AsHex} from '@polkadot/util-crypto';
+import waitNewBlocks from '../substrate/wait-new-blocks';
+import getBalance from '../substrate/get-balance';
+import {XcmV2TraitsError, XcmV2TraitsOutcome} from '../interfaces';
+
+chai.use(chaiAsPromised);
+const expect = chai.expect;
+
+const UNIQUE_CHAIN = 2037;
+const ACALA_CHAIN = 2000;
+const MOONBEAM_CHAIN = 2004;
+
+const RELAY_PORT = 9844;
+const ACALA_PORT = 9946;
+const MOONBEAM_PORT = 9947;
+
+const ACALA_DECIMALS = 12;
+
+const TRANSFER_AMOUNT = 2000000000000000000000000n;
+
+function parachainApiOptions(port: number): ApiOptions {
+ return {
+ provider: new WsProvider('ws://127.0.0.1:' + port.toString()),
+ };
+}
+
+function acalaOptions(): ApiOptions {
+ return parachainApiOptions(ACALA_PORT);
+}
+
+function moonbeamOptions(): ApiOptions {
+ return parachainApiOptions(MOONBEAM_PORT);
+}
+
+function relayOptions(): ApiOptions {
+ return parachainApiOptions(RELAY_PORT);
+}
+
+describe_xcm('[XCM] Integration test: Exchanging tokens with Acala', () => {
+ let alice: IKeyringPair;
+ let randomAccount: IKeyringPair;
+
+ let balanceUniqueTokenInit: bigint;
+ let balanceUniqueTokenMiddle: bigint;
+ let balanceUniqueTokenFinal: bigint;
+ let balanceAcalaTokenInit: bigint;
+ let balanceAcalaTokenMiddle: bigint;
+ let balanceAcalaTokenFinal: bigint;
+ let balanceUniqueForeignTokenInit: bigint;
+ let balanceUniqueForeignTokenMiddle: bigint;
+ let balanceUniqueForeignTokenFinal: bigint;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ const keyringSr25519 = new Keyring({type: 'sr25519'});
+
+ alice = privateKeyWrapper('//Alice');
+ randomAccount = generateKeyringPair(keyringSr25519);
+ });
+
+ // Acala side
+ await usingApi(
+ async (api) => {
+ const destination = {
+ V0: {
+ X2: [
+ 'Parent',
+ {
+ Parachain: UNIQUE_CHAIN,
+ },
+ ],
+ },
+ };
+
+ const metadata = {
+ name: 'UNQ',
+ symbol: 'UNQ',
+ decimals: 18,
+ minimalBalance: 1,
+ };
+
+ const tx = api.tx.assetRegistry.registerForeignAsset(destination, metadata);
+ const sudoTx = api.tx.sudo.sudo(tx as any);
+ const events = await submitTransactionAsync(alice, sudoTx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ const tx1 = api.tx.balances.transfer(randomAccount.address, 10000000000000n);
+ const events1 = await submitTransactionAsync(alice, tx1);
+ const result1 = getGenericResult(events1);
+ expect(result1.success).to.be.true;
+
+ [balanceAcalaTokenInit] = await getBalance(api, [randomAccount.address]);
+ {
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ balanceUniqueForeignTokenInit = BigInt(free);
+ }
+ },
+ acalaOptions(),
+ );
+
+ // Unique side
+ await usingApi(async (api) => {
+ const tx0 = api.tx.balances.transfer(randomAccount.address, 10n * TRANSFER_AMOUNT);
+ const events0 = await submitTransactionAsync(alice, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+
+ [balanceUniqueTokenInit] = await getBalance(api, [randomAccount.address]);
+ });
+ });
+
+ it('Should connect and send UNQ to Acala', async () => {
+
+ // Unique side
+ await usingApi(async (api) => {
+
+ const destination = {
+ V0: {
+ X2: [
+ 'Parent',
+ {
+ Parachain: ACALA_CHAIN,
+ },
+ ],
+ },
+ };
+
+ const beneficiary = {
+ V0: {
+ X1: {
+ AccountId32: {
+ network: 'Any',
+ id: randomAccount.addressRaw,
+ },
+ },
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5000000000,
+ };
+
+ const tx = api.tx.polkadotXcm.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await submitTransactionAsync(randomAccount, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccount.address]);
+
+ const unqFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT;
+ console.log('[Unique -> Acala] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
+ expect(unqFees > 0n).to.be.true;
+ });
+
+ // Acala side
+ await usingApi(
+ async (api) => {
+ await waitNewBlocks(api, 3);
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ balanceUniqueForeignTokenMiddle = BigInt(free);
+
+ [balanceAcalaTokenMiddle] = await getBalance(api, [randomAccount.address]);
+
+ const acaFees = balanceAcalaTokenInit - balanceAcalaTokenMiddle;
+ const unqIncomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenInit;
+
+ console.log(
+ '[Unique -> Acala] transaction fees on Acala: %s ACA',
+ bigIntToDecimals(acaFees, ACALA_DECIMALS),
+ );
+ console.log('[Unique -> Acala] income %s UNQ', bigIntToDecimals(unqIncomeTransfer));
+ expect(acaFees == 0n).to.be.true;
+ expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ acalaOptions(),
+ );
+ });
+
+ it('Should connect to Acala and send UNQ back', async () => {
+
+ // Acala side
+ await usingApi(
+ async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: UNIQUE_CHAIN},
+ {
+ AccountId32: {
+ network: 'Any',
+ id: randomAccount.addressRaw,
+ },
+ },
+ ],
+ },
+ },
+ };
+
+ const id = {
+ ForeignAsset: 0,
+ };
+
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transfer(id as any, TRANSFER_AMOUNT, destination, destWeight);
+ const events = await submitTransactionAsync(randomAccount, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceAcalaTokenFinal] = await getBalance(api, [randomAccount.address]);
+ {
+ const {free} = (await api.query.tokens.accounts(randomAccount.addressRaw, id)).toJSON() as any;
+ balanceUniqueForeignTokenFinal = BigInt(free);
+ }
+
+ const acaFees = balanceAcalaTokenMiddle - balanceAcalaTokenFinal;
+ const unqOutcomeTransfer = balanceUniqueForeignTokenMiddle - balanceUniqueForeignTokenFinal;
+
+ console.log(
+ '[Acala -> Unique] transaction fees on Acala: %s ACA',
+ bigIntToDecimals(acaFees, ACALA_DECIMALS),
+ );
+ console.log('[Acala -> Unique] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer));
+
+ expect(acaFees > 0).to.be.true;
+ expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ acalaOptions(),
+ );
+
+ // Unique side
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceUniqueTokenFinal] = await getBalance(api, [randomAccount.address]);
+ const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle;
+ expect(actuallyDelivered > 0).to.be.true;
+
+ console.log('[Acala -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered));
+
+ const unqFees = TRANSFER_AMOUNT - actuallyDelivered;
+ console.log('[Acala -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
+ expect(unqFees == 0n).to.be.true;
+ });
+ });
+});
+
+// These tests are relevant only when the foreign asset pallet is disabled
+describe_xcm('[XCM] Integration test: Unique rejects non-native tokens', () => {
+ let alice: IKeyringPair;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ alice = privateKeyWrapper('//Alice');
+ });
+ });
+
+ it('Unique rejects tokens from the Relay', async () => {
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ Parachain: UNIQUE_CHAIN,
+ },
+ },
+ }};
+
+ const beneficiary = {
+ V1: {
+ parents: 0,
+ interior: {X1: {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ }},
+ },
+ };
+
+ const assets = {
+ V1: [
+ {
+ id: {
+ Concrete: {
+ parents: 0,
+ interior: 'Here',
+ },
+ },
+ fun: {
+ Fungible: 50_000_000_000_000_000n,
+ },
+ },
+ ],
+ };
+
+ const feeAssetItem = 0;
+
+ const weightLimit = {
+ Limited: 5_000_000_000,
+ };
+
+ const tx = api.tx.xcmPallet.limitedReserveTransferAssets(destination, beneficiary, assets, feeAssetItem, weightLimit);
+ const events = await submitTransactionAsync(alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, relayOptions());
+
+ await usingApi(async api => {
+ const maxWaitBlocks = 3;
+ const dmpQueueExecutedDownward = await waitEvent(
+ api,
+ maxWaitBlocks,
+ 'dmpQueue',
+ 'ExecutedDownward',
+ );
+
+ expect(
+ dmpQueueExecutedDownward != null,
+ '[Relay] dmpQueue.ExecutedDownward event is expected',
+ ).to.be.true;
+
+ const event = dmpQueueExecutedDownward!.event;
+ const outcome = event.data[1] as XcmV2TraitsOutcome;
+
+ expect(
+ outcome.isIncomplete,
+ '[Relay] The outcome of the XCM should be `Incomplete`',
+ ).to.be.true;
+
+ const incomplete = outcome.asIncomplete;
+ expect(
+ incomplete[1].toString() == 'AssetNotFound',
+ '[Relay] The XCM error should be `AssetNotFound`',
+ ).to.be.true;
+ });
+ });
+
+ it('Unique rejects ACA tokens from Acala', async () => {
+ await usingApi(async (api) => {
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: UNIQUE_CHAIN},
+ {
+ AccountId32: {
+ network: 'Any',
+ id: alice.addressRaw,
+ },
+ },
+ ],
+ },
+ },
+ };
+
+ const id = {
+ Token: 'ACA',
+ };
+
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transfer(id as any, 100_000_000_000, destination, destWeight);
+ const events = await submitTransactionAsync(alice, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+ }, acalaOptions());
+
+ await usingApi(async api => {
+ const maxWaitBlocks = 3;
+ const xcmpQueueFailEvent = await waitEvent(api, maxWaitBlocks, 'xcmpQueue', 'Fail');
+
+ expect(
+ xcmpQueueFailEvent != null,
+ '[Acala] xcmpQueue.FailEvent event is expected',
+ ).to.be.true;
+
+ const event = xcmpQueueFailEvent!.event;
+ const outcome = event.data[1] as XcmV2TraitsError;
+
+ expect(
+ outcome.isUntrustedReserveLocation,
+ '[Acala] The XCM error should be `UntrustedReserveLocation`',
+ ).to.be.true;
+ });
+ });
+});
+
+describe_xcm('[XCM] Integration test: Exchanging UNQ with Moonbeam', () => {
+
+ // Unique constants
+ let uniqueAlice: IKeyringPair;
+ let uniqueAssetLocation;
+
+ let randomAccountUnique: IKeyringPair;
+ let randomAccountMoonbeam: IKeyringPair;
+
+ // Moonbeam constants
+ let assetId: string;
+
+ const moonbeamKeyring = new Keyring({type: 'ethereum'});
+ const alithPrivateKey = '0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133';
+ const baltatharPrivateKey = '0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b';
+ const dorothyPrivateKey = '0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68';
+
+ const alithAccount = moonbeamKeyring.addFromUri(alithPrivateKey, undefined, 'ethereum');
+ const baltatharAccount = moonbeamKeyring.addFromUri(baltatharPrivateKey, undefined, 'ethereum');
+ const dorothyAccount = moonbeamKeyring.addFromUri(dorothyPrivateKey, undefined, 'ethereum');
+
+ const councilVotingThreshold = 2;
+ const technicalCommitteeThreshold = 2;
+ const votingPeriod = 3;
+ const delayPeriod = 0;
+
+ const uniqueAssetMetadata = {
+ name: 'xcUnique',
+ symbol: 'xcUNQ',
+ decimals: 18,
+ isFrozen: false,
+ minimalBalance: 1,
+ };
+
+ let balanceUniqueTokenInit: bigint;
+ let balanceUniqueTokenMiddle: bigint;
+ let balanceUniqueTokenFinal: bigint;
+ let balanceForeignUnqTokenInit: bigint;
+ let balanceForeignUnqTokenMiddle: bigint;
+ let balanceForeignUnqTokenFinal: bigint;
+ let balanceGlmrTokenInit: bigint;
+ let balanceGlmrTokenMiddle: bigint;
+ let balanceGlmrTokenFinal: bigint;
+
+ before(async () => {
+ await usingApi(async (api, privateKeyWrapper) => {
+ const keyringEth = new Keyring({type: 'ethereum'});
+ const keyringSr25519 = new Keyring({type: 'sr25519'});
+
+ uniqueAlice = privateKeyWrapper('//Alice');
+ randomAccountUnique = generateKeyringPair(keyringSr25519);
+ randomAccountMoonbeam = generateKeyringPair(keyringEth);
+
+ balanceForeignUnqTokenInit = 0n;
+ });
+
+ await usingApi(
+ async (api) => {
+
+ // >>> Sponsoring Dorothy >>>
+ console.log('Sponsoring Dorothy.......');
+ const tx0 = api.tx.balances.transfer(dorothyAccount.address, 11_000_000_000_000_000_000n);
+ const events0 = await submitTransactionAsync(alithAccount, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+ console.log('Sponsoring Dorothy.......DONE');
+ // <<< Sponsoring Dorothy <<<
+
+ const sourceLocation: MultiLocation = api.createType(
+ 'MultiLocation',
+ {
+ parents: 1,
+ interior: {X1: {Parachain: UNIQUE_CHAIN}},
+ },
+ );
+
+ uniqueAssetLocation = {XCM: sourceLocation};
+ const existentialDeposit = 1;
+ const isSufficient = true;
+ const unitsPerSecond = '1';
+ const numAssetsWeightHint = 0;
+
+ const registerTx = api.tx.assetManager.registerForeignAsset(
+ uniqueAssetLocation,
+ uniqueAssetMetadata,
+ existentialDeposit,
+ isSufficient,
+ );
+ console.log('Encoded proposal for registerAsset is %s', registerTx.method.toHex() || '');
+
+ const setUnitsTx = api.tx.assetManager.setAssetUnitsPerSecond(
+ uniqueAssetLocation,
+ unitsPerSecond,
+ numAssetsWeightHint,
+ );
+ console.log('Encoded proposal for setAssetUnitsPerSecond is %s', setUnitsTx.method.toHex() || '');
+
+ const batchCall = api.tx.utility.batchAll([registerTx, setUnitsTx]);
+ console.log('Encoded proposal for batchCall is %s', batchCall.method.toHex() || '');
+
+ // >>> Note motion preimage >>>
+ console.log('Note motion preimage.......');
+ const encodedProposal = batchCall?.method.toHex() || '';
+ const proposalHash = blake2AsHex(encodedProposal);
+ console.log('Encoded proposal for batch utility after schedule is %s', encodedProposal);
+ console.log('Encoded proposal hash for batch utility after schedule is %s', proposalHash);
+ console.log('Encoded length %d', encodedProposal.length);
+
+ const tx1 = api.tx.democracy.notePreimage(encodedProposal);
+ const events1 = await submitTransactionAsync(baltatharAccount, tx1);
+ const result1 = getGenericResult(events1);
+ expect(result1.success).to.be.true;
+ console.log('Note motion preimage.......DONE');
+ // <<< Note motion preimage <<<
+
+ // >>> Propose external motion through council >>>
+ console.log('Propose external motion through council.......');
+ const externalMotion = api.tx.democracy.externalProposeMajority(proposalHash);
+ const tx2 = api.tx.councilCollective.propose(
+ councilVotingThreshold,
+ externalMotion,
+ externalMotion.encodedLength,
+ );
+ const events2 = await submitTransactionAsync(baltatharAccount, tx2);
+ const result2 = getGenericResult(events2);
+ expect(result2.success).to.be.true;
+
+ const encodedMotion = externalMotion?.method.toHex() || '';
+ const motionHash = blake2AsHex(encodedMotion);
+ console.log('Motion hash is %s', motionHash);
+
+ const tx3 = api.tx.councilCollective.vote(motionHash, 0, true);
+ {
+ const events3 = await submitTransactionAsync(dorothyAccount, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+ }
+ {
+ const events3 = await submitTransactionAsync(baltatharAccount, tx3);
+ const result3 = getGenericResult(events3);
+ expect(result3.success).to.be.true;
+ }
+
+ const tx4 = api.tx.councilCollective.close(motionHash, 0, 1_000_000_000, externalMotion.encodedLength);
+ const events4 = await submitTransactionAsync(dorothyAccount, tx4);
+ const result4 = getGenericResult(events4);
+ expect(result4.success).to.be.true;
+ console.log('Propose external motion through council.......DONE');
+ // <<< Propose external motion through council <<<
+
+ // >>> Fast track proposal through technical committee >>>
+ console.log('Fast track proposal through technical committee.......');
+ const fastTrack = api.tx.democracy.fastTrack(proposalHash, votingPeriod, delayPeriod);
+ const tx5 = api.tx.techCommitteeCollective.propose(
+ technicalCommitteeThreshold,
+ fastTrack,
+ fastTrack.encodedLength,
+ );
+ const events5 = await submitTransactionAsync(alithAccount, tx5);
+ const result5 = getGenericResult(events5);
+ expect(result5.success).to.be.true;
+
+ const encodedFastTrack = fastTrack?.method.toHex() || '';
+ const fastTrackHash = blake2AsHex(encodedFastTrack);
+ console.log('FastTrack hash is %s', fastTrackHash);
+
+ const proposalIdx = Number(await api.query.techCommitteeCollective.proposalCount()) - 1;
+ const tx6 = api.tx.techCommitteeCollective.vote(fastTrackHash, proposalIdx, true);
+ {
+ const events6 = await submitTransactionAsync(baltatharAccount, tx6);
+ const result6 = getGenericResult(events6);
+ expect(result6.success).to.be.true;
+ }
+ {
+ const events6 = await submitTransactionAsync(alithAccount, tx6);
+ const result6 = getGenericResult(events6);
+ expect(result6.success).to.be.true;
+ }
+
+ const tx7 = api.tx.techCommitteeCollective
+ .close(fastTrackHash, proposalIdx, 1_000_000_000, fastTrack.encodedLength);
+ const events7 = await submitTransactionAsync(baltatharAccount, tx7);
+ const result7 = getGenericResult(events7);
+ expect(result7.success).to.be.true;
+ console.log('Fast track proposal through technical committee.......DONE');
+ // <<< Fast track proposal through technical committee <<<
+
+ // >>> Referendum voting >>>
+ console.log('Referendum voting.......');
+ const tx8 = api.tx.democracy.vote(
+ 0,
+ {Standard: {balance: 10_000_000_000_000_000_000n, vote: {aye: true, conviction: 1}}},
+ );
+ const events8 = await submitTransactionAsync(dorothyAccount, tx8);
+ const result8 = getGenericResult(events8);
+ expect(result8.success).to.be.true;
+ console.log('Referendum voting.......DONE');
+ // <<< Referendum voting <<<
+
+ // >>> Acquire Unique AssetId Info on Moonbeam >>>
+ console.log('Acquire Unique AssetId Info on Moonbeam.......');
+
+ // Wait for the democracy execute
+ await waitNewBlocks(api, 5);
+
+ assetId = (await api.query.assetManager.assetTypeId({
+ XCM: sourceLocation,
+ })).toString();
+
+ console.log('UNQ asset ID is %s', assetId);
+ console.log('Acquire Unique AssetId Info on Moonbeam.......DONE');
+ // >>> Acquire Unique AssetId Info on Moonbeam >>>
+
+ // >>> Sponsoring random Account >>>
+ console.log('Sponsoring random Account.......');
+ const tx10 = api.tx.balances.transfer(randomAccountMoonbeam.address, 11_000_000_000_000_000_000n);
+ const events10 = await submitTransactionAsync(baltatharAccount, tx10);
+ const result10 = getGenericResult(events10);
+ expect(result10.success).to.be.true;
+ console.log('Sponsoring random Account.......DONE');
+ // <<< Sponsoring random Account <<<
+
+ [balanceGlmrTokenInit] = await getBalance(api, [randomAccountMoonbeam.address]);
+ },
+ moonbeamOptions(),
+ );
+
+ await usingApi(async (api) => {
+ const tx0 = api.tx.balances.transfer(randomAccountUnique.address, 10n * TRANSFER_AMOUNT);
+ const events0 = await submitTransactionAsync(uniqueAlice, tx0);
+ const result0 = getGenericResult(events0);
+ expect(result0.success).to.be.true;
+
+ [balanceUniqueTokenInit] = await getBalance(api, [randomAccountUnique.address]);
+ });
+ });
+
+ it('Should connect and send UNQ to Moonbeam', async () => {
+ await usingApi(async (api) => {
+ const currencyId = {
+ NativeAssetId: 'Here',
+ };
+ const dest = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: MOONBEAM_CHAIN},
+ {AccountKey20: {network: 'Any', key: randomAccountMoonbeam.address}},
+ ],
+ },
+ },
+ };
+ const amount = TRANSFER_AMOUNT;
+ const destWeight = 850000000;
+
+ const tx = api.tx.xTokens.transfer(currencyId, amount, dest, destWeight);
+ const events = await submitTransactionAsync(randomAccountUnique, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceUniqueTokenMiddle] = await getBalance(api, [randomAccountUnique.address]);
+ expect(balanceUniqueTokenMiddle < balanceUniqueTokenInit).to.be.true;
+
+ const transactionFees = balanceUniqueTokenInit - balanceUniqueTokenMiddle - TRANSFER_AMOUNT;
+ console.log('[Unique -> Moonbeam] transaction fees on Unique: %s UNQ', bigIntToDecimals(transactionFees));
+ expect(transactionFees > 0).to.be.true;
+ });
+
+ await usingApi(
+ async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceGlmrTokenMiddle] = await getBalance(api, [randomAccountMoonbeam.address]);
+
+ const glmrFees = balanceGlmrTokenInit - balanceGlmrTokenMiddle;
+ console.log('[Unique -> Moonbeam] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees));
+ expect(glmrFees == 0n).to.be.true;
+
+ const unqRandomAccountAsset = (
+ await api.query.assets.account(assetId, randomAccountMoonbeam.address)
+ ).toJSON()! as any;
+
+ balanceForeignUnqTokenMiddle = BigInt(unqRandomAccountAsset['balance']);
+ const unqIncomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenInit;
+ console.log('[Unique -> Moonbeam] income %s UNQ', bigIntToDecimals(unqIncomeTransfer));
+ expect(unqIncomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ moonbeamOptions(),
+ );
+ });
+
+ it('Should connect to Moonbeam and send UNQ back', async () => {
+ await usingApi(
+ async (api) => {
+ const asset = {
+ V1: {
+ id: {
+ Concrete: {
+ parents: 1,
+ interior: {
+ X1: {Parachain: UNIQUE_CHAIN},
+ },
+ },
+ },
+ fun: {
+ Fungible: TRANSFER_AMOUNT,
+ },
+ },
+ };
+ const destination = {
+ V1: {
+ parents: 1,
+ interior: {
+ X2: [
+ {Parachain: UNIQUE_CHAIN},
+ {AccountId32: {network: 'Any', id: randomAccountUnique.addressRaw}},
+ ],
+ },
+ },
+ };
+ const destWeight = 50000000;
+
+ const tx = api.tx.xTokens.transferMultiasset(asset, destination, destWeight);
+ const events = await submitTransactionAsync(randomAccountMoonbeam, tx);
+ const result = getGenericResult(events);
+ expect(result.success).to.be.true;
+
+ [balanceGlmrTokenFinal] = await getBalance(api, [randomAccountMoonbeam.address]);
+
+ const glmrFees = balanceGlmrTokenMiddle - balanceGlmrTokenFinal;
+ console.log('[Moonbeam -> Unique] transaction fees on Moonbeam: %s GLMR', bigIntToDecimals(glmrFees));
+ expect(glmrFees > 0).to.be.true;
+
+ const unqRandomAccountAsset = (
+ await api.query.assets.account(assetId, randomAccountMoonbeam.address)
+ ).toJSON()! as any;
+
+ expect(unqRandomAccountAsset).to.be.null;
+
+ balanceForeignUnqTokenFinal = 0n;
+
+ const unqOutcomeTransfer = balanceForeignUnqTokenMiddle - balanceForeignUnqTokenFinal;
+ console.log('[Unique -> Moonbeam] outcome %s UNQ', bigIntToDecimals(unqOutcomeTransfer));
+ expect(unqOutcomeTransfer == TRANSFER_AMOUNT).to.be.true;
+ },
+ moonbeamOptions(),
+ );
+
+ await usingApi(async (api) => {
+ await waitNewBlocks(api, 3);
+
+ [balanceUniqueTokenFinal] = await getBalance(api, [randomAccountUnique.address]);
+ const actuallyDelivered = balanceUniqueTokenFinal - balanceUniqueTokenMiddle;
+ expect(actuallyDelivered > 0).to.be.true;
+
+ console.log('[Moonbeam -> Unique] actually delivered %s UNQ', bigIntToDecimals(actuallyDelivered));
+
+ const unqFees = TRANSFER_AMOUNT - actuallyDelivered;
+ console.log('[Moonbeam -> Unique] transaction fees on Unique: %s UNQ', bigIntToDecimals(unqFees));
+ expect(unqFees == 0n).to.be.true;
+ });
+ });
+});
tests/src/xcmTransfer.test.tsdiffbeforeafterboth--- a/tests/src/xcmTransfer.test.ts
+++ b/tests/src/xcmTransfer.test.ts
@@ -78,7 +78,7 @@
let balanceOnKaruraBefore: bigint;
await usingApi(async (api) => {
- const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAssetId: 0})).toJSON() as any;
balanceOnKaruraBefore = free;
}, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});
@@ -136,7 +136,7 @@
await usingApi(async (api) => {
// todo do something about instant sealing, where there might not be any new blocks
await waitNewBlocks(api, 3);
- const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAsset: 0})).toJSON() as any;
+ const {free} = (await api.query.tokens.accounts(alice.addressRaw, {ForeignAssetId: 0})).toJSON() as any;
expect(free > balanceOnKaruraBefore).to.be.true;
}, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});
});
@@ -165,7 +165,7 @@
};
const id = {
- ForeignAsset: 0,
+ ForeignAssetId: 0,
};
const amount = TRANSFER_AMOUNT;