diff --git a/.github/workflows/exercise.yml b/.github/workflows/exercise.yml new file mode 100644 index 0000000..d8c172e --- /dev/null +++ b/.github/workflows/exercise.yml @@ -0,0 +1,113 @@ +--- +name: Chain Exercise Suite + +# Runs `quantus exercise` against a freshly built fast-governance dev node. +# Nightly + manual for now: building the node from the chain repo dominates +# the runtime, and QPoW block times make a full run take tens of minutes. +on: + schedule: + - cron: "0 2 * * *" # nightly at 02:00 UTC + workflow_dispatch: + inputs: + chain_ref: + description: "Git ref of Quantus-Network/chain to build the node from" + required: false + default: "main" + fuzz_iterations: + description: "Number of seeded fuzz iterations" + required: false + default: "25" + +permissions: + contents: read + +env: + CARGO_INCREMENTAL: 0 + CARGO_TERM_COLOR: always + CARGO_NET_RETRY: 10 + CARGO_NET_TIMEOUT: 60 + +jobs: + exercise: + name: πŸ‹οΈ Exercise Suite (fast-governance dev node) + runs-on: ubuntu-latest + timeout-minutes: 180 + steps: + - name: Checkout quantus-cli + uses: actions/checkout@v5 + + - name: Checkout chain + uses: actions/checkout@v5 + with: + repository: Quantus-Network/chain + ref: ${{ github.event.inputs.chain_ref || 'main' }} + path: chain + + - uses: ./.github/actions/ubuntu + + - name: Cache cargo registry & CLI target + uses: actions/cache@v5 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-exercise-cli-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }} + restore-keys: | + ${{ runner.os }}-cargo-exercise-cli- + + - name: Cache chain target + uses: actions/cache@v5 + with: + path: chain/target + key: ${{ runner.os }}-cargo-exercise-node-${{ hashFiles('chain/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-exercise-node- + + - name: Build quantus-node (fast-governance) + working-directory: chain + run: cargo build --release -p quantus-node --features quantus-runtime/fast-governance + + - name: Build quantus-cli + run: SKIP_CIRCUIT_BUILD=1 cargo build --release --locked + + - name: Start dev node + run: | + nohup chain/target/release/quantus-node --dev \ + --base-path /tmp/quantus-exercise-dev \ + > /tmp/quantus-node.log 2>&1 & + echo "NODE_PID=$!" >> "$GITHUB_ENV" + # Wait for RPC to answer (mining warm-up can take a while). + for i in $(seq 1 60); do + if curl -sf -H 'Content-Type: application/json' \ + -d '{"jsonrpc":"2.0","id":1,"method":"system_health","params":[]}' \ + http://127.0.0.1:9944 > /dev/null; then + echo "RPC up after ${i}s" + exit 0 + fi + sleep 1 + done + echo "node RPC never came up" >&2 + tail -50 /tmp/quantus-node.log >&2 + exit 1 + + - name: Run exercise suite + run: | + ./target/release/quantus exercise \ + --json \ + --fuzz-iterations "${{ github.event.inputs.fuzz_iterations || '25' }}" \ + | tee exercise-report.txt + + - name: Upload report and node log + if: always() + uses: actions/upload-artifact@v4 + with: + name: exercise-report + path: | + exercise-report.txt + /tmp/quantus-node.log + if-no-files-found: ignore + + - name: Stop dev node + if: always() + run: kill "$NODE_PID" 2>/dev/null || true diff --git a/src/chain/quantus_subxt.rs b/src/chain/quantus_subxt.rs index e8c44fe..b07e4cc 100644 --- a/src/chain/quantus_subxt.rs +++ b/src/chain/quantus_subxt.rs @@ -6,7 +6,7 @@ pub mod api { mod root_mod { pub use super::*; } - pub static PALLETS: [&str; 21usize] = [ + pub static PALLETS: [&str; 19usize] = [ "System", "Timestamp", "Balances", @@ -16,9 +16,7 @@ pub mod api { "Preimage", "Scheduler", "Utility", - "Referenda", "ReversibleTransfers", - "ConvictionVoting", "TechCollective", "TechReferenda", "TreasuryPallet", @@ -1567,9 +1565,10 @@ pub mod api { "query_call_info", types::QueryCallInfo { call, len }, [ - 90u8, 202u8, 9u8, 88u8, 111u8, 175u8, 220u8, 96u8, 150u8, 13u8, 71u8, - 123u8, 120u8, 157u8, 193u8, 172u8, 169u8, 180u8, 196u8, 6u8, 184u8, - 18u8, 24u8, 97u8, 141u8, 50u8, 253u8, 167u8, 244u8, 99u8, 102u8, 235u8, + 32u8, 234u8, 47u8, 160u8, 157u8, 142u8, 236u8, 40u8, 222u8, 22u8, 75u8, + 92u8, 244u8, 90u8, 235u8, 228u8, 137u8, 249u8, 207u8, 89u8, 87u8, + 244u8, 41u8, 20u8, 102u8, 145u8, 48u8, 54u8, 164u8, 114u8, 122u8, + 182u8, ], ) } @@ -1587,10 +1586,10 @@ pub mod api { "query_call_fee_details", types::QueryCallFeeDetails { call, len }, [ - 248u8, 32u8, 253u8, 238u8, 202u8, 178u8, 245u8, 211u8, 219u8, 2u8, - 220u8, 116u8, 141u8, 73u8, 22u8, 47u8, 212u8, 17u8, 197u8, 149u8, - 250u8, 160u8, 205u8, 101u8, 50u8, 121u8, 214u8, 31u8, 8u8, 161u8, 32u8, - 91u8, + 135u8, 197u8, 88u8, 132u8, 222u8, 66u8, 219u8, 154u8, 162u8, 155u8, + 161u8, 58u8, 176u8, 115u8, 33u8, 214u8, 171u8, 221u8, 230u8, 21u8, + 60u8, 15u8, 36u8, 117u8, 182u8, 70u8, 181u8, 108u8, 125u8, 72u8, 252u8, + 40u8, ], ) } @@ -1936,15 +1935,9 @@ pub mod api { pub fn utility(&self) -> utility::constants::ConstantsApi { utility::constants::ConstantsApi } - pub fn referenda(&self) -> referenda::constants::ConstantsApi { - referenda::constants::ConstantsApi - } pub fn reversible_transfers(&self) -> reversible_transfers::constants::ConstantsApi { reversible_transfers::constants::ConstantsApi } - pub fn conviction_voting(&self) -> conviction_voting::constants::ConstantsApi { - conviction_voting::constants::ConstantsApi - } pub fn tech_referenda(&self) -> tech_referenda::constants::ConstantsApi { tech_referenda::constants::ConstantsApi } @@ -1987,15 +1980,9 @@ pub mod api { pub fn scheduler(&self) -> scheduler::storage::StorageApi { scheduler::storage::StorageApi } - pub fn referenda(&self) -> referenda::storage::StorageApi { - referenda::storage::StorageApi - } pub fn reversible_transfers(&self) -> reversible_transfers::storage::StorageApi { reversible_transfers::storage::StorageApi } - pub fn conviction_voting(&self) -> conviction_voting::storage::StorageApi { - conviction_voting::storage::StorageApi - } pub fn tech_collective(&self) -> tech_collective::storage::StorageApi { tech_collective::storage::StorageApi } @@ -2038,21 +2025,12 @@ pub mod api { pub fn preimage(&self) -> preimage::calls::TransactionApi { preimage::calls::TransactionApi } - pub fn scheduler(&self) -> scheduler::calls::TransactionApi { - scheduler::calls::TransactionApi - } pub fn utility(&self) -> utility::calls::TransactionApi { utility::calls::TransactionApi } - pub fn referenda(&self) -> referenda::calls::TransactionApi { - referenda::calls::TransactionApi - } pub fn reversible_transfers(&self) -> reversible_transfers::calls::TransactionApi { reversible_transfers::calls::TransactionApi } - pub fn conviction_voting(&self) -> conviction_voting::calls::TransactionApi { - conviction_voting::calls::TransactionApi - } pub fn tech_collective(&self) -> tech_collective::calls::TransactionApi { tech_collective::calls::TransactionApi } @@ -2090,9 +2068,9 @@ pub mod api { .hash(); runtime_metadata_hash == [ - 149u8, 22u8, 88u8, 66u8, 145u8, 121u8, 144u8, 45u8, 72u8, 226u8, 219u8, 201u8, - 209u8, 125u8, 170u8, 239u8, 25u8, 38u8, 157u8, 229u8, 236u8, 69u8, 54u8, 143u8, - 96u8, 123u8, 187u8, 158u8, 58u8, 229u8, 165u8, 193u8, + 0u8, 140u8, 5u8, 40u8, 237u8, 46u8, 42u8, 0u8, 228u8, 200u8, 1u8, 226u8, 132u8, + 185u8, 140u8, 253u8, 54u8, 127u8, 56u8, 200u8, 164u8, 237u8, 198u8, 151u8, 133u8, + 33u8, 239u8, 56u8, 190u8, 69u8, 228u8, 26u8, ] } pub mod system { @@ -3220,10 +3198,9 @@ pub mod api { "Events", (), [ - 179u8, 170u8, 58u8, 106u8, 146u8, 26u8, 131u8, 123u8, 63u8, 145u8, - 96u8, 92u8, 102u8, 119u8, 0u8, 98u8, 192u8, 165u8, 99u8, 111u8, 86u8, - 243u8, 34u8, 246u8, 108u8, 240u8, 233u8, 199u8, 71u8, 214u8, 238u8, - 209u8, + 12u8, 200u8, 85u8, 114u8, 205u8, 35u8, 13u8, 101u8, 195u8, 51u8, 123u8, + 145u8, 74u8, 61u8, 217u8, 71u8, 184u8, 61u8, 132u8, 83u8, 214u8, 117u8, + 222u8, 18u8, 13u8, 229u8, 195u8, 147u8, 223u8, 19u8, 66u8, 105u8, ], ) } @@ -6443,562 +6420,149 @@ pub mod api { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] pub type Error = runtime_types::pallet_scheduler::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_scheduler::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + #[doc = "Events type."] + pub type Event = runtime_types::pallet_scheduler::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Scheduled some task."] + pub struct Scheduled { + pub when: scheduled::When, + pub index: scheduled::Index, + } + pub mod scheduled { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Schedule { - pub when: schedule::When, - pub priority: schedule::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule { - use super::runtime_types; - pub type When = ::core::primitive::u32; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Schedule { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an anonymously scheduled task."] - pub struct Cancel { - pub when: cancel::When, - pub index: cancel::Index, - } - pub mod cancel { - use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Scheduled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Scheduled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Canceled some task."] + pub struct Canceled { + pub when: canceled::When, + pub index: canceled::Index, + } + pub mod canceled { + use super::runtime_types; + pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Canceled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Canceled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Dispatched some task."] + pub struct Dispatched { + pub task: dispatched::Task, + pub id: dispatched::Id, + pub result: dispatched::Result, + } + pub mod dispatched { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, - >; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ScheduleNamed { - pub id: schedule_named::Id, - pub when: schedule_named::When, - pub priority: schedule_named::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type When = ::core::primitive::u32; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_named"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a named scheduled task."] - pub struct CancelNamed { - pub id: cancel_named::Id, - } - pub mod cancel_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_named"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ScheduleAfter { - pub after: schedule_after::After, - pub priority: schedule_after::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule_after { - use super::runtime_types; - pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Set a retry configuration for some task."] + pub struct RetrySet { + pub task: retry_set::Task, + pub id: retry_set::Id, + pub period: retry_set::Period, + pub retries: retry_set::Retries, + } + pub mod retry_set { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, - >; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_after"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct ScheduleNamedAfter { - pub id: schedule_named_after::Id, - pub after: schedule_named_after::After, - pub priority: schedule_named_after::Priority, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule_named_after { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Retries = ::core::primitive::u8; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for RetrySet { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "RetrySet"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Cancel a retry configuration for some task."] + pub struct RetryCancelled { + pub task: retry_cancelled::Task, + pub id: retry_cancelled::Id, + } + pub mod retry_cancelled { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, - >; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamedAfter { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_named_after"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] - #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] - #[doc = "succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry are unnamed"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "The `period` type must match the task's scheduling type: block-scheduled tasks"] - #[doc = "require a block-number period, and timestamp-scheduled tasks require a timestamp"] - #[doc = "period. Mismatched types will return [`Error::RetryPeriodMismatch`]."] - pub struct SetRetry { - pub task: set_retry::Task, - pub retries: set_retry::Retries, - pub period: set_retry::Period, - } - pub mod set_retry { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Retries = ::core::primitive::u8; - pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry are unnamed"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "The `period` type must match the task's scheduling type: block-scheduled tasks"] - #[doc = "require a block-number period, and timestamp-scheduled tasks require a timestamp"] - #[doc = "period. Mismatched types will return [`Error::RetryPeriodMismatch`]."] - pub struct SetRetryNamed { - pub id: set_retry_named::Id, - pub retries: set_retry_named::Retries, - pub period: set_retry_named::Period, - } - pub mod set_retry_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type Retries = ::core::primitive::u8; - pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry_named"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Removes the retry configuration of a task."] - pub struct CancelRetry { - pub task: cancel_retry::Task, - } - pub mod cancel_retry { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel the retry configuration of a named task."] - pub struct CancelRetryNamed { - pub id: cancel_retry_named::Id, - } - pub mod cancel_retry_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry_named"; - } + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; } - pub struct TransactionApi; - impl TransactionApi { - pub fn schedule( - &self, - when: types::schedule::When, - priority: types::schedule::Priority, - call: types::schedule::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule", - types::Schedule { - when, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 111u8, 246u8, 131u8, 153u8, 188u8, 35u8, 82u8, 23u8, 214u8, 245u8, - 97u8, 204u8, 130u8, 160u8, 102u8, 24u8, 208u8, 65u8, 222u8, 33u8, 61u8, - 120u8, 183u8, 187u8, 133u8, 232u8, 75u8, 78u8, 207u8, 123u8, 219u8, - 114u8, - ], - ) - } - #[doc = "Cancel an anonymously scheduled task."] - pub fn cancel( - &self, - when: types::cancel::When, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel", - types::Cancel { when, index }, - [ - 134u8, 77u8, 15u8, 56u8, 137u8, 12u8, 58u8, 147u8, 164u8, 204u8, 221u8, - 150u8, 103u8, 42u8, 36u8, 79u8, 146u8, 115u8, 13u8, 194u8, 39u8, 73u8, - 109u8, 10u8, 168u8, 164u8, 190u8, 173u8, 30u8, 17u8, 35u8, 17u8, - ], - ) - } - pub fn schedule_named( - &self, - id: types::schedule_named::Id, - when: types::schedule_named::When, - priority: types::schedule_named::Priority, - call: types::schedule_named::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule_named", - types::ScheduleNamed { - id, - when, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 226u8, 121u8, 55u8, 244u8, 180u8, 161u8, 195u8, 247u8, 4u8, 191u8, - 152u8, 109u8, 162u8, 105u8, 232u8, 241u8, 102u8, 3u8, 254u8, 58u8, - 224u8, 63u8, 127u8, 155u8, 66u8, 214u8, 20u8, 84u8, 200u8, 83u8, 252u8, - 190u8, - ], - ) - } - #[doc = "Cancel a named scheduled task."] - pub fn cancel_named( - &self, - id: types::cancel_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_named", - types::CancelNamed { id }, - [ - 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, 93u8, - 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, 147u8, 122u8, - 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, 129u8, 193u8, - ], - ) - } - pub fn schedule_after( - &self, - after: types::schedule_after::After, - priority: types::schedule_after::Priority, - call: types::schedule_after::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule_after", - types::ScheduleAfter { - after, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 223u8, 138u8, 95u8, 57u8, 29u8, 157u8, 241u8, 124u8, 62u8, 169u8, - 220u8, 166u8, 67u8, 105u8, 102u8, 78u8, 138u8, 29u8, 181u8, 87u8, - 236u8, 124u8, 237u8, 245u8, 85u8, 132u8, 168u8, 95u8, 130u8, 64u8, 9u8, - 200u8, - ], - ) - } - pub fn schedule_named_after( - &self, - id: types::schedule_named_after::Id, - after: types::schedule_named_after::After, - priority: types::schedule_named_after::Priority, - call: types::schedule_named_after::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule_named_after", - types::ScheduleNamedAfter { - id, - after, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 15u8, 107u8, 235u8, 231u8, 115u8, 180u8, 199u8, 243u8, 222u8, 191u8, - 192u8, 130u8, 107u8, 253u8, 77u8, 228u8, 151u8, 60u8, 176u8, 69u8, - 140u8, 120u8, 110u8, 242u8, 63u8, 35u8, 46u8, 210u8, 21u8, 83u8, 8u8, - 123u8, - ], - ) - } - #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] - #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] - #[doc = "succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry are unnamed"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "The `period` type must match the task's scheduling type: block-scheduled tasks"] - #[doc = "require a block-number period, and timestamp-scheduled tasks require a timestamp"] - #[doc = "period. Mismatched types will return [`Error::RetryPeriodMismatch`]."] - pub fn set_retry( - &self, - task: types::set_retry::Task, - retries: types::set_retry::Retries, - period: types::set_retry::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "set_retry", - types::SetRetry { task, retries, period }, - [ - 31u8, 128u8, 255u8, 13u8, 13u8, 252u8, 74u8, 151u8, 60u8, 242u8, 152u8, - 58u8, 190u8, 155u8, 132u8, 65u8, 139u8, 208u8, 222u8, 175u8, 89u8, - 222u8, 186u8, 98u8, 53u8, 125u8, 71u8, 55u8, 95u8, 2u8, 76u8, 248u8, - ], - ) - } - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry are unnamed"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "The `period` type must match the task's scheduling type: block-scheduled tasks"] - #[doc = "require a block-number period, and timestamp-scheduled tasks require a timestamp"] - #[doc = "period. Mismatched types will return [`Error::RetryPeriodMismatch`]."] - pub fn set_retry_named( - &self, - id: types::set_retry_named::Id, - retries: types::set_retry_named::Retries, - period: types::set_retry_named::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "set_retry_named", - types::SetRetryNamed { id, retries, period }, - [ - 102u8, 70u8, 114u8, 48u8, 180u8, 194u8, 107u8, 81u8, 104u8, 117u8, - 33u8, 169u8, 43u8, 172u8, 61u8, 129u8, 143u8, 221u8, 44u8, 101u8, - 235u8, 228u8, 224u8, 71u8, 65u8, 223u8, 180u8, 130u8, 83u8, 89u8, - 157u8, 75u8, - ], - ) - } - #[doc = "Removes the retry configuration of a task."] - pub fn cancel_retry( - &self, - task: types::cancel_retry::Task, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_retry", - types::CancelRetry { task }, - [ - 153u8, 252u8, 168u8, 142u8, 100u8, 114u8, 25u8, 46u8, 225u8, 95u8, - 243u8, 78u8, 160u8, 175u8, 17u8, 33u8, 27u8, 241u8, 149u8, 187u8, - 228u8, 182u8, 233u8, 74u8, 10u8, 228u8, 117u8, 218u8, 210u8, 127u8, - 245u8, 105u8, - ], - ) - } - #[doc = "Cancel the retry configuration of a named task."] - pub fn cancel_retry_named( - &self, - id: types::cancel_retry_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_retry_named", - types::CancelRetryNamed { id }, - [ - 76u8, 157u8, 253u8, 113u8, 162u8, 54u8, 98u8, 21u8, 62u8, 44u8, 155u8, - 202u8, 2u8, 28u8, 153u8, 219u8, 67u8, 166u8, 206u8, 79u8, 139u8, 3u8, - 119u8, 182u8, 254u8, 134u8, 143u8, 121u8, 155u8, 220u8, 192u8, 209u8, - ], - ) - } + impl ::subxt::ext::subxt_core::events::StaticEvent for RetryCancelled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "RetryCancelled"; } - } - #[doc = "Events type."] - pub type Event = runtime_types::pallet_scheduler::pallet::Event; - pub mod events { - use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -7006,22 +6570,25 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Scheduled some task."] - pub struct Scheduled { - pub when: scheduled::When, - pub index: scheduled::Index, + #[doc = "The call for the provided hash was not found so the task has been aborted."] + pub struct CallUnavailable { + pub task: call_unavailable::Task, + pub id: call_unavailable::Id, } - pub mod scheduled { + pub mod call_unavailable { use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Index = ::core::primitive::u32; + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Scheduled { + impl ::subxt::ext::subxt_core::events::StaticEvent for CallUnavailable { const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Scheduled"; + const EVENT: &'static str = "CallUnavailable"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7030,22 +6597,26 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Canceled some task."] - pub struct Canceled { - pub when: canceled::When, - pub index: canceled::Index, + #[doc = "The given task was unable to be retried since the agenda is full at that block or there"] + #[doc = "was not enough weight to reschedule it."] + pub struct RetryFailed { + pub task: retry_failed::Task, + pub id: retry_failed::Id, } - pub mod canceled { + pub mod retry_failed { use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Index = ::core::primitive::u32; + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Canceled { + impl ::subxt::ext::subxt_core::events::StaticEvent for RetryFailed { const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Canceled"; + const EVENT: &'static str = "RetryFailed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7054,13 +6625,12 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Dispatched some task."] - pub struct Dispatched { - pub task: dispatched::Task, - pub id: dispatched::Id, - pub result: dispatched::Result, + #[doc = "The given task can never be executed since it is overweight."] + pub struct PermanentlyOverweight { + pub task: permanently_overweight::Task, + pub id: permanently_overweight::Id, } - pub mod dispatched { + pub mod permanently_overweight { use super::runtime_types; pub type Task = ( runtime_types::qp_scheduler::BlockNumberOrTimestamp< @@ -7070,155 +6640,10 @@ pub mod api { ::core::primitive::u32, ); pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - pub type Result = - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Dispatched { + impl ::subxt::ext::subxt_core::events::StaticEvent for PermanentlyOverweight { const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Dispatched"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Set a retry configuration for some task."] - pub struct RetrySet { - pub task: retry_set::Task, - pub id: retry_set::Id, - pub period: retry_set::Period, - pub retries: retry_set::Retries, - } - pub mod retry_set { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Retries = ::core::primitive::u8; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetrySet { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetrySet"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Cancel a retry configuration for some task."] - pub struct RetryCancelled { - pub task: retry_cancelled::Task, - pub id: retry_cancelled::Id, - } - pub mod retry_cancelled { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryCancelled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryCancelled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The call for the provided hash was not found so the task has been aborted."] - pub struct CallUnavailable { - pub task: call_unavailable::Task, - pub id: call_unavailable::Id, - } - pub mod call_unavailable { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for CallUnavailable { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "CallUnavailable"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The given task was unable to be retried since the agenda is full at that block or there"] - #[doc = "was not enough weight to reschedule it."] - pub struct RetryFailed { - pub task: retry_failed::Task, - pub id: retry_failed::Id, - } - pub mod retry_failed { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryFailed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The given task can never be executed since it is overweight."] - pub struct PermanentlyOverweight { - pub task: permanently_overweight::Task, - pub id: permanently_overweight::Id, - } - pub mod permanently_overweight { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for PermanentlyOverweight { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "PermanentlyOverweight"; + const EVENT: &'static str = "PermanentlyOverweight"; } } pub mod storage { @@ -7892,9 +7317,9 @@ pub mod api { "batch", types::Batch { calls }, [ - 168u8, 153u8, 140u8, 127u8, 49u8, 58u8, 84u8, 232u8, 97u8, 32u8, 62u8, - 214u8, 148u8, 56u8, 117u8, 185u8, 158u8, 13u8, 116u8, 44u8, 227u8, - 64u8, 247u8, 216u8, 184u8, 41u8, 4u8, 163u8, 162u8, 77u8, 134u8, 234u8, + 91u8, 52u8, 14u8, 228u8, 168u8, 75u8, 218u8, 19u8, 121u8, 112u8, 126u8, + 236u8, 87u8, 77u8, 194u8, 140u8, 196u8, 15u8, 84u8, 117u8, 80u8, 101u8, + 217u8, 62u8, 28u8, 83u8, 226u8, 233u8, 176u8, 2u8, 158u8, 79u8, ], ) } @@ -7924,10 +7349,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 221u8, 169u8, 48u8, 6u8, 24u8, 30u8, 152u8, 227u8, 141u8, 56u8, 160u8, - 66u8, 148u8, 225u8, 88u8, 225u8, 102u8, 31u8, 140u8, 98u8, 159u8, - 240u8, 185u8, 45u8, 110u8, 180u8, 70u8, 228u8, 109u8, 205u8, 73u8, - 42u8, + 78u8, 239u8, 51u8, 124u8, 113u8, 201u8, 252u8, 171u8, 182u8, 113u8, + 155u8, 193u8, 125u8, 113u8, 241u8, 199u8, 215u8, 237u8, 55u8, 121u8, + 247u8, 255u8, 41u8, 35u8, 206u8, 143u8, 157u8, 90u8, 203u8, 106u8, + 252u8, 91u8, ], ) } @@ -7953,10 +7378,9 @@ pub mod api { "batch_all", types::BatchAll { calls }, [ - 61u8, 221u8, 247u8, 197u8, 198u8, 93u8, 227u8, 27u8, 130u8, 66u8, - 147u8, 239u8, 234u8, 219u8, 242u8, 109u8, 220u8, 4u8, 251u8, 147u8, - 86u8, 37u8, 232u8, 40u8, 208u8, 222u8, 123u8, 72u8, 1u8, 48u8, 39u8, - 252u8, + 9u8, 111u8, 191u8, 88u8, 100u8, 224u8, 185u8, 197u8, 208u8, 26u8, + 198u8, 42u8, 215u8, 246u8, 54u8, 120u8, 3u8, 148u8, 182u8, 44u8, 233u8, + 60u8, 26u8, 128u8, 101u8, 87u8, 141u8, 143u8, 9u8, 197u8, 184u8, 64u8, ], ) } @@ -7979,10 +7403,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 211u8, 86u8, 167u8, 189u8, 24u8, 103u8, 83u8, 11u8, 102u8, 251u8, - 156u8, 78u8, 99u8, 174u8, 1u8, 90u8, 37u8, 195u8, 61u8, 102u8, 77u8, - 216u8, 136u8, 168u8, 76u8, 234u8, 228u8, 234u8, 98u8, 146u8, 246u8, - 3u8, + 252u8, 234u8, 74u8, 189u8, 195u8, 91u8, 133u8, 238u8, 206u8, 171u8, + 160u8, 141u8, 58u8, 250u8, 221u8, 113u8, 192u8, 201u8, 95u8, 103u8, + 209u8, 0u8, 110u8, 235u8, 38u8, 225u8, 79u8, 73u8, 19u8, 75u8, 138u8, + 146u8, ], ) } @@ -8008,9 +7432,9 @@ pub mod api { "force_batch", types::ForceBatch { calls }, [ - 146u8, 12u8, 37u8, 67u8, 116u8, 89u8, 65u8, 39u8, 146u8, 69u8, 186u8, - 21u8, 192u8, 211u8, 148u8, 137u8, 201u8, 3u8, 195u8, 90u8, 80u8, 57u8, - 116u8, 148u8, 29u8, 225u8, 149u8, 117u8, 185u8, 193u8, 159u8, 219u8, + 130u8, 189u8, 219u8, 64u8, 240u8, 89u8, 49u8, 86u8, 163u8, 42u8, 52u8, + 8u8, 152u8, 154u8, 147u8, 236u8, 209u8, 30u8, 243u8, 194u8, 123u8, + 97u8, 97u8, 239u8, 97u8, 57u8, 104u8, 191u8, 235u8, 221u8, 1u8, 227u8, ], ) } @@ -8033,9 +7457,9 @@ pub mod api { weight, }, [ - 108u8, 240u8, 32u8, 97u8, 18u8, 61u8, 34u8, 62u8, 149u8, 244u8, 16u8, - 87u8, 60u8, 116u8, 221u8, 156u8, 68u8, 51u8, 60u8, 233u8, 15u8, 160u8, - 180u8, 31u8, 197u8, 161u8, 165u8, 93u8, 238u8, 184u8, 50u8, 36u8, + 22u8, 169u8, 85u8, 171u8, 100u8, 38u8, 252u8, 11u8, 198u8, 55u8, 150u8, + 190u8, 59u8, 5u8, 143u8, 123u8, 107u8, 23u8, 202u8, 0u8, 237u8, 255u8, + 77u8, 19u8, 113u8, 77u8, 133u8, 52u8, 176u8, 110u8, 214u8, 221u8, ], ) } @@ -8075,9 +7499,9 @@ pub mod api { fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), }, [ - 160u8, 250u8, 232u8, 179u8, 142u8, 199u8, 97u8, 214u8, 128u8, 114u8, - 165u8, 161u8, 57u8, 210u8, 171u8, 46u8, 89u8, 202u8, 250u8, 19u8, 45u8, - 144u8, 223u8, 4u8, 145u8, 157u8, 184u8, 228u8, 250u8, 221u8, 6u8, 5u8, + 210u8, 174u8, 69u8, 89u8, 81u8, 251u8, 211u8, 77u8, 44u8, 88u8, 137u8, + 153u8, 221u8, 116u8, 10u8, 183u8, 158u8, 145u8, 229u8, 108u8, 168u8, + 123u8, 100u8, 162u8, 121u8, 201u8, 158u8, 103u8, 96u8, 96u8, 89u8, 4u8, ], ) } @@ -8100,9 +7524,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 138u8, 211u8, 58u8, 120u8, 90u8, 178u8, 167u8, 166u8, 163u8, 135u8, - 34u8, 41u8, 124u8, 179u8, 160u8, 200u8, 137u8, 21u8, 36u8, 100u8, - 126u8, 66u8, 89u8, 124u8, 51u8, 155u8, 197u8, 173u8, 126u8, 1u8, 10u8, + 68u8, 190u8, 238u8, 69u8, 88u8, 148u8, 111u8, 242u8, 200u8, 228u8, + 47u8, 232u8, 101u8, 173u8, 104u8, 140u8, 30u8, 113u8, 236u8, 193u8, + 48u8, 47u8, 116u8, 169u8, 97u8, 77u8, 17u8, 82u8, 37u8, 190u8, 158u8, 66u8, ], ) @@ -8270,12 +7694,12 @@ pub mod api { } } } - pub mod referenda { + pub mod reversible_transfers { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_referenda::pallet::Error; + pub type Error = runtime_types::pallet_reversible_transfers::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_referenda::pallet::Call; + pub type Call = runtime_types::pallet_reversible_transfers::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -8292,36 +7716,59 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Propose a referendum on a privileged action."] + #[doc = "Enable high-security for the calling account with a specified"] + #[doc = "reversibility delay."] #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = "Once an account is set as high security it can only make reversible"] + #[doc = "transfers. It is not allowed any other calls."] #[doc = ""] - #[doc = "Emits `Submitted`."] - pub struct Submit { - pub proposal_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub proposal: submit::Proposal, - pub enactment_moment: submit::EnactmentMoment, + #[doc = "# Warning: Permanent and Irreversible"] + #[doc = ""] + #[doc = "**Enabling high security mode is a one-way operation that cannot be undone.**"] + #[doc = ""] + #[doc = "Once this function is called successfully, the account is permanently restricted"] + #[doc = "to only the following operations:"] + #[doc = "- [`schedule_transfer`](Self::schedule_transfer) - Schedule delayed native token"] + #[doc = " transfers"] + #[doc = "- [`schedule_asset_transfer`](Self::schedule_asset_transfer) - Schedule delayed asset"] + #[doc = " transfers"] + #[doc = "- [`cancel`](Self::cancel) - Cancel pending transfers"] + #[doc = "- [`recover_funds`](Self::recover_funds) - Guardian-initiated emergency fund recovery"] + #[doc = ""] + #[doc = "There is no mechanism to disable high security mode or restore normal account"] + #[doc = "functionality. This design is intentional to provide maximum security guarantees:"] + #[doc = "an attacker who gains access to the account cannot simply disable the protections."] + #[doc = ""] + #[doc = "This permanence also ensures that any funds subsequently sent to a compromised"] + #[doc = "account (e.g., from pending payments, contracts, or accidental deposits) remain"] + #[doc = "protected and can be recovered by the guardian via"] + #[doc = "[`recover_funds`](Self::recover_funds). The guardian can call `recover_funds`"] + #[doc = "repeatedly as needed."] + #[doc = ""] + #[doc = "Users who no longer wish to use high-security features can simply transfer their"] + #[doc = "funds to a different account using [`schedule_transfer`](Self::schedule_transfer)"] + #[doc = "or [`schedule_asset_transfer`](Self::schedule_asset_transfer)."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "- `delay`: The reversibility time for any transfer made by the high-security account."] + #[doc = "- `guardian`: The guardian account that can cancel pending transfers and recover funds"] + #[doc = " from this high-security account."] + pub struct SetHighSecurity { + pub delay: set_high_security::Delay, + pub guardian: set_high_security::Guardian, } - pub mod submit { + pub mod set_high_security { use super::runtime_types; - pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, >; - pub type EnactmentMoment = - runtime_types::frame_support::traits::schedule::DispatchTime< - ::core::primitive::u32, - >; + pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "submit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHighSecurity { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "set_high_security"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8334,24 +7781,19 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] + #[doc = "Cancel a pending reversible transaction scheduled by the caller."] #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub struct PlaceDecisionDeposit { - pub index: place_decision_deposit::Index, + #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] + pub struct Cancel { + pub tx_id: cancel::TxId, } - pub mod place_decision_deposit { + pub mod cancel { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "place_decision_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "cancel"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8364,51 +7806,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = "Executes a previously scheduled transfer after the delay period has elapsed."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "This extrinsic is called automatically by the Scheduler pallet when the"] + #[doc = "delay period expires. It must be signed by this pallet's account (not a user)."] + #[doc = "The pallet account is set as the origin when scheduling via"] + #[doc = "[`do_schedule_transfer_inner`](Self::do_schedule_transfer_inner)."] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub struct RefundDecisionDeposit { - pub index: refund_decision_deposit::Index, - } - pub mod refund_decision_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "refund_decision_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an ongoing referendum."] + #[doc = "# Parameters"] #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "- `tx_id`: The unique identifier of the pending transfer to execute."] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub struct Cancel { - pub index: cancel::Index, + #[doc = "# Errors"] + #[doc = ""] + #[doc = "- [`InvalidSchedulerOrigin`](Error::InvalidSchedulerOrigin): Called by an account other"] + #[doc = " than this pallet's account."] + #[doc = "- [`PendingTxNotFound`](Error::PendingTxNotFound): No pending transfer with this ID."] + pub struct ExecuteTransfer { + pub tx_id: execute_transfer::TxId, } - pub mod cancel { + pub mod execute_transfer { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "cancel"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExecuteTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "execute_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8421,22 +7844,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub struct Kill { - pub index: kill::Index, + #[doc = "Schedule a transaction for delayed execution."] + pub struct ScheduleTransfer { + pub dest: schedule_transfer::Dest, + pub amount: schedule_transfer::Amount, } - pub mod kill { + pub mod schedule_transfer { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "kill"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8449,20 +7872,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub struct NudgeReferendum { - pub index: nudge_referendum::Index, + #[doc = "This can only be used by accounts that have *not* set up a persistent"] + #[doc = "reversibility configuration with `set_high_security`."] + #[doc = ""] + #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] + pub struct ScheduleTransferWithDelay { + pub dest: schedule_transfer_with_delay::Dest, + pub amount: schedule_transfer_with_delay::Amount, + pub delay: schedule_transfer_with_delay::Delay, } - pub mod nudge_referendum { + pub mod schedule_transfer_with_delay { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "nudge_referendum"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransferWithDelay { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_transfer_with_delay"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8475,25 +7910,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] - #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub struct OneFewerDeciding { - pub track: one_fewer_deciding::Track, + #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] + #[doc = "delay."] + pub struct ScheduleAssetTransfer { + pub asset_id: schedule_asset_transfer::AssetId, + pub dest: schedule_asset_transfer::Dest, + pub amount: schedule_asset_transfer::Amount, } - pub mod one_fewer_deciding { + pub mod schedule_asset_transfer { use super::runtime_types; - pub type Track = ::core::primitive::u16; + pub type AssetId = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "one_fewer_deciding"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_asset_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8506,23 +7941,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub struct RefundSubmissionDeposit { - pub index: refund_submission_deposit::Index, + #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] + pub struct ScheduleAssetTransferWithDelay { + pub asset_id: schedule_asset_transfer_with_delay::AssetId, + pub dest: schedule_asset_transfer_with_delay::Dest, + pub amount: schedule_asset_transfer_with_delay::Amount, + pub delay: schedule_asset_transfer_with_delay::Delay, } - pub mod refund_submission_deposit { + pub mod schedule_asset_transfer_with_delay { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type AssetId = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "refund_submission_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransferWithDelay { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_asset_transfer_with_delay"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8535,281 +7976,274 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Set or clear metadata of a referendum."] + #[doc = "Allows the guardian to recover all funds from a high-security account"] + #[doc = "by transferring the entire balance to themselves."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub struct SetMetadata { - pub index: set_metadata::Index, - pub maybe_hash: set_metadata::MaybeHash, + #[doc = "This is an emergency function for when the high-security account may be compromised."] + #[doc = "It cancels all pending transfers first (applying volume fees), then transfers"] + #[doc = "the remaining free balance to the guardian."] + #[doc = ""] + #[doc = "# Repeated Recovery"] + #[doc = ""] + #[doc = "This function can be called multiple times on the same account. The high-security"] + #[doc = "status and guardian relationship are intentionally preserved after recovery, ensuring"] + #[doc = "that any funds subsequently deposited to the account (e.g., from pending payments,"] + #[doc = "contracts, or accidental deposits) remain protected and recoverable."] + #[doc = ""] + #[doc = "# Error Handling"] + #[doc = ""] + #[doc = "If releasing held funds fails for any transfer, that transfer is skipped (metadata"] + #[doc = "preserved for manual retry via `cancel`) and a `TransferRecoveryFailed` event is"] + #[doc = "emitted. Other transfers continue to be processed."] + pub struct RecoverFunds { + pub account: recover_funds::Account, } - pub mod set_metadata { + pub mod recover_funds { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeHash = - ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "set_metadata"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RecoverFunds { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "recover_funds"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = "Enable high-security for the calling account with a specified"] + #[doc = "reversibility delay."] #[doc = ""] - #[doc = "Emits `Submitted`."] - pub fn submit( - &self, - proposal_origin: types::submit::ProposalOrigin, - proposal: types::submit::Proposal, - enactment_moment: types::submit::EnactmentMoment, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "submit", - types::Submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - proposal_origin, - ), - proposal, - enactment_moment, - }, - [ - 0u8, 18u8, 14u8, 253u8, 33u8, 212u8, 33u8, 173u8, 241u8, 29u8, 88u8, - 160u8, 111u8, 21u8, 6u8, 234u8, 249u8, 230u8, 222u8, 119u8, 161u8, - 114u8, 43u8, 126u8, 164u8, 140u8, 199u8, 39u8, 2u8, 64u8, 132u8, 34u8, - ], - ) - } - #[doc = "Post the Decision Deposit for a referendum."] + #[doc = "Once an account is set as high security it can only make reversible"] + #[doc = "transfers. It is not allowed any other calls."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] + #[doc = "# Warning: Permanent and Irreversible"] #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub fn place_decision_deposit( - &self, - index: types::place_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "place_decision_deposit", - types::PlaceDecisionDeposit { index }, - [ - 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, - 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, - 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, - ], - ) - } - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = "**Enabling high security mode is a one-way operation that cannot be undone.**"] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "Once this function is called successfully, the account is permanently restricted"] + #[doc = "to only the following operations:"] + #[doc = "- [`schedule_transfer`](Self::schedule_transfer) - Schedule delayed native token"] + #[doc = " transfers"] + #[doc = "- [`schedule_asset_transfer`](Self::schedule_asset_transfer) - Schedule delayed asset"] + #[doc = " transfers"] + #[doc = "- [`cancel`](Self::cancel) - Cancel pending transfers"] + #[doc = "- [`recover_funds`](Self::recover_funds) - Guardian-initiated emergency fund recovery"] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub fn refund_decision_deposit( + #[doc = "There is no mechanism to disable high security mode or restore normal account"] + #[doc = "functionality. This design is intentional to provide maximum security guarantees:"] + #[doc = "an attacker who gains access to the account cannot simply disable the protections."] + #[doc = ""] + #[doc = "This permanence also ensures that any funds subsequently sent to a compromised"] + #[doc = "account (e.g., from pending payments, contracts, or accidental deposits) remain"] + #[doc = "protected and can be recovered by the guardian via"] + #[doc = "[`recover_funds`](Self::recover_funds). The guardian can call `recover_funds`"] + #[doc = "repeatedly as needed."] + #[doc = ""] + #[doc = "Users who no longer wish to use high-security features can simply transfer their"] + #[doc = "funds to a different account using [`schedule_transfer`](Self::schedule_transfer)"] + #[doc = "or [`schedule_asset_transfer`](Self::schedule_asset_transfer)."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "- `delay`: The reversibility time for any transfer made by the high-security account."] + #[doc = "- `guardian`: The guardian account that can cancel pending transfers and recover funds"] + #[doc = " from this high-security account."] + pub fn set_high_security( &self, - index: types::refund_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundDecisionDeposit, - > { + delay: types::set_high_security::Delay, + guardian: types::set_high_security::Guardian, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "refund_decision_deposit", - types::RefundDecisionDeposit { index }, + "ReversibleTransfers", + "set_high_security", + types::SetHighSecurity { delay, guardian }, [ - 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, - 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, - 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, + 103u8, 202u8, 28u8, 11u8, 249u8, 80u8, 142u8, 200u8, 55u8, 4u8, 141u8, + 72u8, 94u8, 199u8, 229u8, 102u8, 246u8, 113u8, 190u8, 84u8, 95u8, + 193u8, 96u8, 171u8, 144u8, 120u8, 235u8, 208u8, 65u8, 183u8, 4u8, 44u8, ], ) } - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "Cancel a pending reversible transaction scheduled by the caller."] #[doc = ""] - #[doc = "Emits `Cancelled`."] + #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] pub fn cancel( &self, - index: types::cancel::Index, + tx_id: types::cancel::TxId, ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", + "ReversibleTransfers", "cancel", - types::Cancel { index }, + types::Cancel { tx_id }, [ - 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, - 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, - 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, - 122u8, + 228u8, 150u8, 194u8, 119u8, 243u8, 126u8, 112u8, 227u8, 70u8, 160u8, + 132u8, 82u8, 146u8, 162u8, 195u8, 149u8, 236u8, 98u8, 18u8, 44u8, + 151u8, 249u8, 193u8, 176u8, 186u8, 98u8, 224u8, 103u8, 191u8, 165u8, + 37u8, 47u8, ], ) } - #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = "Executes a previously scheduled transfer after the delay period has elapsed."] #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "This extrinsic is called automatically by the Scheduler pallet when the"] + #[doc = "delay period expires. It must be signed by this pallet's account (not a user)."] + #[doc = "The pallet account is set as the origin when scheduling via"] + #[doc = "[`do_schedule_transfer_inner`](Self::do_schedule_transfer_inner)."] #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub fn kill( + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "- `tx_id`: The unique identifier of the pending transfer to execute."] + #[doc = ""] + #[doc = "# Errors"] + #[doc = ""] + #[doc = "- [`InvalidSchedulerOrigin`](Error::InvalidSchedulerOrigin): Called by an account other"] + #[doc = " than this pallet's account."] + #[doc = "- [`PendingTxNotFound`](Error::PendingTxNotFound): No pending transfer with this ID."] + pub fn execute_transfer( &self, - index: types::kill::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + tx_id: types::execute_transfer::TxId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "kill", - types::Kill { index }, + "ReversibleTransfers", + "execute_transfer", + types::ExecuteTransfer { tx_id }, [ - 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, - 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, - 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, - 48u8, + 164u8, 38u8, 166u8, 81u8, 63u8, 235u8, 167u8, 178u8, 97u8, 80u8, 62u8, + 147u8, 3u8, 163u8, 129u8, 25u8, 98u8, 59u8, 17u8, 137u8, 6u8, 183u8, + 189u8, 51u8, 24u8, 211u8, 157u8, 108u8, 229u8, 253u8, 37u8, 78u8, ], ) } - #[doc = "Advance a referendum onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub fn nudge_referendum( + #[doc = "Schedule a transaction for delayed execution."] + pub fn schedule_transfer( &self, - index: types::nudge_referendum::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + dest: types::schedule_transfer::Dest, + amount: types::schedule_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "nudge_referendum", - types::NudgeReferendum { index }, + "ReversibleTransfers", + "schedule_transfer", + types::ScheduleTransfer { dest, amount }, [ - 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, - 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, - 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, - 213u8, + 38u8, 219u8, 206u8, 56u8, 252u8, 195u8, 52u8, 74u8, 113u8, 125u8, + 107u8, 35u8, 236u8, 39u8, 31u8, 18u8, 250u8, 177u8, 174u8, 154u8, + 149u8, 122u8, 183u8, 50u8, 45u8, 111u8, 100u8, 249u8, 102u8, 82u8, + 72u8, 130u8, ], ) } - #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] + #[doc = "This can only be used by accounts that have *not* set up a persistent"] + #[doc = "reversibility configuration with `set_high_security`."] #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub fn one_fewer_deciding( + #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] + pub fn schedule_transfer_with_delay( &self, - track: types::one_fewer_deciding::Track, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + dest: types::schedule_transfer_with_delay::Dest, + amount: types::schedule_transfer_with_delay::Amount, + delay: types::schedule_transfer_with_delay::Delay, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::ScheduleTransferWithDelay, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "one_fewer_deciding", - types::OneFewerDeciding { track }, + "ReversibleTransfers", + "schedule_transfer_with_delay", + types::ScheduleTransferWithDelay { dest, amount, delay }, [ - 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, - 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, - 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, - 131u8, 167u8, + 254u8, 158u8, 173u8, 217u8, 107u8, 80u8, 229u8, 252u8, 123u8, 46u8, + 177u8, 40u8, 25u8, 15u8, 32u8, 22u8, 224u8, 52u8, 242u8, 48u8, 242u8, + 84u8, 242u8, 143u8, 111u8, 12u8, 82u8, 161u8, 129u8, 86u8, 161u8, + 216u8, ], ) } - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub fn refund_submission_deposit( + #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] + #[doc = "delay."] + pub fn schedule_asset_transfer( &self, - index: types::refund_submission_deposit::Index, + asset_id: types::schedule_asset_transfer::AssetId, + dest: types::schedule_asset_transfer::Dest, + amount: types::schedule_asset_transfer::Amount, ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundSubmissionDeposit, + types::ScheduleAssetTransfer, > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "refund_submission_deposit", - types::RefundSubmissionDeposit { index }, + "ReversibleTransfers", + "schedule_asset_transfer", + types::ScheduleAssetTransfer { asset_id, dest, amount }, [ - 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, - 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, - 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, + 125u8, 51u8, 89u8, 31u8, 247u8, 200u8, 156u8, 209u8, 28u8, 170u8, + 203u8, 254u8, 40u8, 131u8, 155u8, 166u8, 65u8, 152u8, 101u8, 198u8, + 70u8, 129u8, 5u8, 89u8, 220u8, 189u8, 255u8, 87u8, 58u8, 24u8, 234u8, + 42u8, ], ) } - #[doc = "Set or clear metadata of a referendum."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub fn set_metadata( + #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] + pub fn schedule_asset_transfer_with_delay( &self, - index: types::set_metadata::Index, - maybe_hash: types::set_metadata::MaybeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + asset_id: types::schedule_asset_transfer_with_delay::AssetId, + dest: types::schedule_asset_transfer_with_delay::Dest, + amount: types::schedule_asset_transfer_with_delay::Amount, + delay: types::schedule_asset_transfer_with_delay::Delay, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::ScheduleAssetTransferWithDelay, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Referenda", - "set_metadata", - types::SetMetadata { index, maybe_hash }, + "ReversibleTransfers", + "schedule_asset_transfer_with_delay", + types::ScheduleAssetTransferWithDelay { asset_id, dest, amount, delay }, [ - 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, - 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, - 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, - 88u8, + 249u8, 59u8, 121u8, 27u8, 78u8, 202u8, 252u8, 120u8, 76u8, 102u8, 33u8, + 232u8, 185u8, 78u8, 8u8, 157u8, 139u8, 72u8, 110u8, 91u8, 170u8, 179u8, + 89u8, 250u8, 77u8, 26u8, 160u8, 252u8, 62u8, 179u8, 128u8, 216u8, + ], + ) + } + #[doc = "Allows the guardian to recover all funds from a high-security account"] + #[doc = "by transferring the entire balance to themselves."] + #[doc = ""] + #[doc = "This is an emergency function for when the high-security account may be compromised."] + #[doc = "It cancels all pending transfers first (applying volume fees), then transfers"] + #[doc = "the remaining free balance to the guardian."] + #[doc = ""] + #[doc = "# Repeated Recovery"] + #[doc = ""] + #[doc = "This function can be called multiple times on the same account. The high-security"] + #[doc = "status and guardian relationship are intentionally preserved after recovery, ensuring"] + #[doc = "that any funds subsequently deposited to the account (e.g., from pending payments,"] + #[doc = "contracts, or accidental deposits) remain protected and recoverable."] + #[doc = ""] + #[doc = "# Error Handling"] + #[doc = ""] + #[doc = "If releasing held funds fails for any transfer, that transfer is skipped (metadata"] + #[doc = "preserved for manual retry via `cancel`) and a `TransferRecoveryFailed` event is"] + #[doc = "emitted. Other transfers continue to be processed."] + pub fn recover_funds( + &self, + account: types::recover_funds::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "recover_funds", + types::RecoverFunds { account }, + [ + 94u8, 241u8, 255u8, 110u8, 4u8, 169u8, 1u8, 45u8, 236u8, 88u8, 167u8, + 180u8, 240u8, 70u8, 111u8, 99u8, 185u8, 143u8, 153u8, 33u8, 101u8, + 30u8, 203u8, 103u8, 229u8, 39u8, 162u8, 76u8, 49u8, 125u8, 247u8, + 220u8, ], ) } } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_referenda::pallet::Event1; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been submitted."] - pub struct Submitted { - pub index: submitted::Index, - pub track: submitted::Track, - pub proposal: submitted::Proposal, - } - pub mod submitted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Submitted"; - } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_reversible_transfers::pallet::Event; + pub mod events { + use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -8817,21 +8251,24 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been placed."] - pub struct DecisionDepositPlaced { - pub index: decision_deposit_placed::Index, - pub who: decision_deposit_placed::Who, - pub amount: decision_deposit_placed::Amount, + #[doc = "A user has enabled their high-security settings."] + pub struct HighSecuritySet { + pub who: high_security_set::Who, + pub guardian: high_security_set::Guardian, + pub delay: high_security_set::Delay, } - pub mod decision_deposit_placed { + pub mod high_security_set { use super::runtime_types; - pub type Index = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionDepositPlaced"; + impl ::subxt::ext::subxt_core::events::StaticEvent for HighSecuritySet { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "HighSecuritySet"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8840,21 +8277,32 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been refunded."] - pub struct DecisionDepositRefunded { - pub index: decision_deposit_refunded::Index, - pub who: decision_deposit_refunded::Who, - pub amount: decision_deposit_refunded::Amount, + #[doc = "A transaction has been scheduled for delayed execution."] + pub struct TransactionScheduled { + pub from: transaction_scheduled::From, + pub to: transaction_scheduled::To, + pub guardian: transaction_scheduled::Guardian, + pub asset_id: transaction_scheduled::AssetId, + pub amount: transaction_scheduled::Amount, + pub tx_id: transaction_scheduled::TxId, + pub execute_at: transaction_scheduled::ExecuteAt, } - pub mod decision_deposit_refunded { + pub mod transaction_scheduled { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type From = ::subxt::ext::subxt_core::utils::AccountId32; + pub type To = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; + pub type AssetId = ::core::option::Option<::core::primitive::u32>; pub type Amount = ::core::primitive::u128; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type ExecuteAt = runtime_types::qp_scheduler::DispatchTime< + ::core::primitive::u32, + ::core::primitive::u64, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionDepositRefunded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionScheduled { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionScheduled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8863,19 +8311,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A deposit has been slashed."] - pub struct DepositSlashed { - pub who: deposit_slashed::Who, - pub amount: deposit_slashed::Amount, + #[doc = "A scheduled transaction has been successfully cancelled."] + pub struct TransactionCancelled { + pub who: transaction_cancelled::Who, + pub tx_id: transaction_cancelled::TxId, } - pub mod deposit_slashed { + pub mod transaction_cancelled { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DepositSlashed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionCancelled { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionCancelled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8884,45 +8332,24 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has moved into the deciding phase."] - pub struct DecisionStarted { - pub index: decision_started::Index, - pub track: decision_started::Track, - pub proposal: decision_started::Proposal, - pub tally: decision_started::Tally, + #[doc = "A scheduled transaction was executed by the scheduler."] + pub struct TransactionExecuted { + pub tx_id: transaction_executed::TxId, + pub result: transaction_executed::Result, } - pub mod decision_started { + pub mod transaction_executed { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type Result = ::core::result::Result< + runtime_types::frame_support::dispatch::PostDispatchInfo, + runtime_types::sp_runtime::DispatchErrorWithPostInfo< + runtime_types::frame_support::dispatch::PostDispatchInfo, + >, >; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmStarted { - pub index: confirm_started::Index, - } - pub mod confirm_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "ConfirmStarted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionExecuted { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionExecuted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8931,16 +8358,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmAborted { - pub index: confirm_aborted::Index, + #[doc = "All funds were recovered from a high-security account by its guardian."] + pub struct FundsRecovered { + pub account: funds_recovered::Account, + pub guardian: funds_recovered::Guardian, } - pub mod confirm_aborted { + pub mod funds_recovered { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "ConfirmAborted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for FundsRecovered { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "FundsRecovered"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8949,471 +8379,284 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has ended its confirmation phase and is ready for approval."] - pub struct Confirmed { - pub index: confirmed::Index, - pub tally: confirmed::Tally, + #[doc = "Failed to release held funds during recovery. The transfer metadata is preserved"] + #[doc = "for manual retry via `cancel`."] + pub struct TransferRecoveryFailed { + pub tx_id: transfer_recovery_failed::TxId, } - pub mod confirmed { + pub mod transfer_recovery_failed { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Confirmed"; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been approved and its proposal has been scheduled."] - pub struct Approved { - pub index: approved::Index, + impl ::subxt::ext::subxt_core::events::StaticEvent for TransferRecoveryFailed { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransferRecoveryFailed"; } - pub mod approved { + } + pub mod storage { + use super::runtime_types; + pub mod types { use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Approved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A proposal has been rejected by referendum."] - pub struct Rejected { - pub index: rejected::Index, - pub tally: rejected::Tally, - } - pub mod rejected { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Rejected"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been timed out without being decided."] - pub struct TimedOut { - pub index: timed_out::Index, - pub tally: timed_out::Tally, - } - pub mod timed_out { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "TimedOut"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been cancelled."] - pub struct Cancelled { - pub index: cancelled::Index, - pub tally: cancelled::Tally, - } - pub mod cancelled { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Cancelled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been killed."] - pub struct Killed { - pub index: killed::Index, - pub tally: killed::Tally, - } - pub mod killed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Killed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The submission deposit has been refunded."] - pub struct SubmissionDepositRefunded { - pub index: submission_deposit_refunded::Index, - pub who: submission_deposit_refunded::Who, - pub amount: submission_deposit_refunded::Amount, - } - pub mod submission_deposit_refunded { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "SubmissionDepositRefunded"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been set."] - pub struct MetadataSet { - pub index: metadata_set::Index, - pub hash: metadata_set::Hash, - } - pub mod metadata_set { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "MetadataSet"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been cleared."] - pub struct MetadataCleared { - pub index: metadata_cleared::Index, - pub hash: metadata_cleared::Hash, - } - pub mod metadata_cleared { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "MetadataCleared"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod referendum_count { - use super::runtime_types; - pub type ReferendumCount = ::core::primitive::u32; - } - pub mod referendum_info_for { - use super::runtime_types; - pub type ReferendumInfoFor = - runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::quantus_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - ::core::primitive::u128, - runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - ::subxt::ext::subxt_core::utils::AccountId32, - ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ), - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod track_queue { - use super::runtime_types; - pub type TrackQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u128, - )>; - pub type Param0 = ::core::primitive::u16; - } - pub mod deciding_count { - use super::runtime_types; - pub type DecidingCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - } - pub mod metadata_of { - use super::runtime_types; - pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = ::core::primitive::u32; - } + pub mod high_security_accounts { + use super::runtime_types; + pub type HighSecurityAccounts = + runtime_types::pallet_reversible_transfers::HighSecurityAccountData< + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod pending_transfers { + use super::runtime_types; + pub type PendingTransfers = + runtime_types::pallet_reversible_transfers::PendingTransfer< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + } + pub mod pending_transfers_by_sender { + use super::runtime_types; + pub type PendingTransfersBySender = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::H256, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod guardian_index { + use super::runtime_types; + pub type GuardianIndex = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod next_transaction_id { + use super::runtime_types; + pub type NextTransactionId = ::core::primitive::u64; + } } pub struct StorageApi; impl StorageApi { - #[doc = " The next free referendum index, aka the number of referenda started so far."] - pub fn referendum_count( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::referendum_count::ReferendumCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumCount", - (), - [ - 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, - 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, - 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, - 67u8, - ], - ) - } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for_iter( + #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] + #[doc = " Accounts present in this map have reversibility enabled."] + pub fn high_security_accounts_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::referendum_info_for::ReferendumInfoFor, + types::high_security_accounts::HighSecurityAccounts, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumInfoFor", + "ReversibleTransfers", + "HighSecurityAccounts", (), [ - 6u8, 83u8, 1u8, 153u8, 41u8, 128u8, 169u8, 32u8, 101u8, 55u8, 230u8, - 219u8, 157u8, 37u8, 148u8, 156u8, 183u8, 164u8, 133u8, 238u8, 54u8, - 243u8, 158u8, 246u8, 58u8, 235u8, 6u8, 127u8, 29u8, 163u8, 255u8, - 157u8, + 110u8, 63u8, 150u8, 254u8, 213u8, 163u8, 141u8, 156u8, 66u8, 201u8, + 162u8, 30u8, 141u8, 204u8, 209u8, 159u8, 120u8, 240u8, 230u8, 239u8, + 228u8, 129u8, 130u8, 181u8, 6u8, 193u8, 157u8, 239u8, 131u8, 35u8, + 29u8, 79u8, ], ) } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for( + #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] + #[doc = " Accounts present in this map have reversibility enabled."] + pub fn high_security_accounts( &self, - _0: types::referendum_info_for::Param0, + _0: types::high_security_accounts::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::referendum_info_for::Param0, + types::high_security_accounts::Param0, >, - types::referendum_info_for::ReferendumInfoFor, + types::high_security_accounts::HighSecurityAccounts, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumInfoFor", + "ReversibleTransfers", + "HighSecurityAccounts", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 6u8, 83u8, 1u8, 153u8, 41u8, 128u8, 169u8, 32u8, 101u8, 55u8, 230u8, - 219u8, 157u8, 37u8, 148u8, 156u8, 183u8, 164u8, 133u8, 238u8, 54u8, - 243u8, 158u8, 246u8, 58u8, 235u8, 6u8, 127u8, 29u8, 163u8, 255u8, - 157u8, + 110u8, 63u8, 150u8, 254u8, 213u8, 163u8, 141u8, 156u8, 66u8, 201u8, + 162u8, 30u8, 141u8, 204u8, 209u8, 159u8, 120u8, 240u8, 230u8, 239u8, + 228u8, 129u8, 130u8, 181u8, 6u8, 193u8, 157u8, 239u8, 131u8, 35u8, + 29u8, 79u8, ], ) } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue_iter( + #[doc = " Stores the details of pending transactions scheduled for delayed execution."] + #[doc = " Keyed by the unique transaction ID."] + pub fn pending_transfers_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::track_queue::TrackQueue, + types::pending_transfers::PendingTransfers, + (), (), - ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "TrackQueue", + "ReversibleTransfers", + "PendingTransfers", (), [ - 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, - 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, - 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, + 138u8, 155u8, 227u8, 133u8, 16u8, 122u8, 128u8, 60u8, 245u8, 159u8, + 244u8, 82u8, 244u8, 113u8, 189u8, 149u8, 179u8, 30u8, 48u8, 31u8, + 174u8, 124u8, 28u8, 33u8, 190u8, 217u8, 193u8, 129u8, 39u8, 122u8, + 141u8, 188u8, ], ) } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue( + #[doc = " Stores the details of pending transactions scheduled for delayed execution."] + #[doc = " Keyed by the unique transaction ID."] + pub fn pending_transfers( &self, - _0: types::track_queue::Param0, + _0: types::pending_transfers::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::track_queue::Param0, + types::pending_transfers::Param0, >, - types::track_queue::TrackQueue, - ::subxt::ext::subxt_core::utils::Yes, + types::pending_transfers::PendingTransfers, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "TrackQueue", + "ReversibleTransfers", + "PendingTransfers", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, - 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, - 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, + 138u8, 155u8, 227u8, 133u8, 16u8, 122u8, 128u8, 60u8, 245u8, 159u8, + 244u8, 82u8, 244u8, 113u8, 189u8, 149u8, 179u8, 30u8, 48u8, 31u8, + 174u8, 124u8, 28u8, 33u8, 190u8, 217u8, 193u8, 129u8, 39u8, 122u8, + 141u8, 188u8, ], ) } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count_iter( + #[doc = " Maps sender accounts to their list of pending transaction IDs."] + pub fn pending_transfers_by_sender_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::deciding_count::DecidingCount, + types::pending_transfers_by_sender::PendingTransfersBySender, (), ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "DecidingCount", + "ReversibleTransfers", + "PendingTransfersBySender", (), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, + 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, + 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, ], ) } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count( + #[doc = " Maps sender accounts to their list of pending transaction IDs."] + pub fn pending_transfers_by_sender( &self, - _0: types::deciding_count::Param0, + _0: types::pending_transfers_by_sender::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::deciding_count::Param0, + types::pending_transfers_by_sender::Param0, >, - types::deciding_count::DecidingCount, + types::pending_transfers_by_sender::PendingTransfersBySender, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "DecidingCount", + "ReversibleTransfers", + "PendingTransfersBySender", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, + 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, + 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, ], ) } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of_iter( + #[doc = " Maps guardian accounts to the list of accounts they protect."] + #[doc = " This allows the UI to efficiently query all accounts for which a given account is a"] + #[doc = " guardian."] + pub fn guardian_index_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::metadata_of::MetadataOf, - (), + types::guardian_index::GuardianIndex, (), ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "MetadataOf", + "ReversibleTransfers", + "GuardianIndex", (), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 112u8, 32u8, 227u8, 175u8, 221u8, 116u8, 83u8, 105u8, 108u8, 132u8, + 254u8, 61u8, 178u8, 251u8, 179u8, 127u8, 14u8, 12u8, 144u8, 204u8, + 38u8, 98u8, 154u8, 10u8, 202u8, 254u8, 230u8, 126u8, 149u8, 161u8, + 13u8, 110u8, ], ) } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of( + #[doc = " Maps guardian accounts to the list of accounts they protect."] + #[doc = " This allows the UI to efficiently query all accounts for which a given account is a"] + #[doc = " guardian."] + pub fn guardian_index( &self, - _0: types::metadata_of::Param0, + _0: types::guardian_index::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata_of::Param0, + types::guardian_index::Param0, >, - types::metadata_of::MetadataOf, + types::guardian_index::GuardianIndex, + ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, - (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "MetadataOf", + "ReversibleTransfers", + "GuardianIndex", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 112u8, 32u8, 227u8, 175u8, 221u8, 116u8, 83u8, 105u8, 108u8, 132u8, + 254u8, 61u8, 178u8, 251u8, 179u8, 127u8, 14u8, 12u8, 144u8, 204u8, + 38u8, 98u8, 154u8, 10u8, 202u8, 254u8, 230u8, 126u8, 149u8, 161u8, + 13u8, 110u8, + ], + ) + } + #[doc = " Monotonically increasing counter used to generate unique transaction IDs."] + #[doc = " Each scheduled transfer increments this value to ensure no two transfers"] + #[doc = " produce the same `tx_id`, even if they have identical parameters."] + pub fn next_transaction_id( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::next_transaction_id::NextTransactionId, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "NextTransactionId", + (), + [ + 42u8, 56u8, 195u8, 140u8, 101u8, 56u8, 175u8, 152u8, 210u8, 167u8, + 61u8, 134u8, 152u8, 191u8, 216u8, 58u8, 73u8, 109u8, 130u8, 125u8, + 189u8, 186u8, 142u8, 68u8, 222u8, 141u8, 16u8, 250u8, 85u8, 8u8, 196u8, + 188u8, ], ) } @@ -9423,31 +8666,32 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] - pub fn submission_deposit( + #[doc = " Maximum number of accounts a single guardian can protect. Used for BoundedVec."] + pub fn max_guardian_accounts( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "SubmissionDeposit", + "ReversibleTransfers", + "MaxGuardianAccounts", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = " Maximum size of the referendum queue for a single track."] - pub fn max_queued( + #[doc = " Maximum pending reversible transactions allowed per account."] + pub fn max_pending_per_account( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "MaxQueued", + "ReversibleTransfers", + "MaxPendingPerAccount", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -9456,35 +8700,36 @@ pub mod api { ], ) } - #[doc = " The number of blocks after submission that a referendum must begin being decided by."] - #[doc = " Once this passes, then anyone may cancel the referendum."] - pub fn undeciding_timeout( + #[doc = " The default delay period for reversible transactions if none is specified."] + #[doc = ""] + #[doc = " NOTE: default delay is always in blocks."] + pub fn default_delay( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "UndecidingTimeout", + "ReversibleTransfers", + "DefaultDelay", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 245u8, 29u8, 3u8, 65u8, 154u8, 12u8, 172u8, 71u8, 67u8, 134u8, 71u8, + 180u8, 4u8, 9u8, 54u8, 89u8, 6u8, 19u8, 3u8, 168u8, 67u8, 122u8, 197u8, + 109u8, 1u8, 228u8, 44u8, 243u8, 228u8, 194u8, 241u8, 227u8, ], ) } - #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] - #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] - #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] - pub fn alarm_interval( + #[doc = " The minimum delay period allowed for reversible transactions, in blocks."] + pub fn min_delay_period_blocks( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "AlarmInterval", + "ReversibleTransfers", + "MinDelayPeriodBlocks", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -9493,41 +8738,50 @@ pub mod api { ], ) } - #[doc = " A list of tracks."] - #[doc = ""] - #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] - pub fn tracks( + #[doc = " The minimum delay period allowed for reversible transactions, in milliseconds."] + pub fn min_delay_period_moment( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u16, - runtime_types::pallet_referenda::types::TrackDetails< - ::core::primitive::u128, - ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::string::String, - >, - )>, + ::core::primitive::u64, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "Tracks", + "ReversibleTransfers", + "MinDelayPeriodMoment", [ - 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, - 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, - 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, - 159u8, + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) + } + #[doc = " Volume fee taken from reversed transactions for high-security accounts only,"] + #[doc = " expressed as a Permill (e.g., Permill::from_percent(1) = 1%). Regular accounts incur no"] + #[doc = " fees. The fee is burned (removed from total issuance)."] + pub fn volume_fee( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "VolumeFee", + [ + 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, + 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, + 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, ], ) } } } } - pub mod reversible_transfers { + pub mod tech_collective { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_reversible_transfers::pallet::Error; + pub type Error = runtime_types::pallet_ranked_collective::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_reversible_transfers::pallet::Call; + pub type Call = runtime_types::pallet_ranked_collective::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -9544,59 +8798,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Enable high-security for the calling account with a specified"] - #[doc = "reversibility delay."] - #[doc = ""] - #[doc = "Once an account is set as high security it can only make reversible"] - #[doc = "transfers. It is not allowed any other calls."] + #[doc = "Introduce a new member."] #[doc = ""] - #[doc = "# Warning: Permanent and Irreversible"] - #[doc = ""] - #[doc = "**Enabling high security mode is a one-way operation that cannot be undone.**"] - #[doc = ""] - #[doc = "Once this function is called successfully, the account is permanently restricted"] - #[doc = "to only the following operations:"] - #[doc = "- [`schedule_transfer`](Self::schedule_transfer) - Schedule delayed native token"] - #[doc = " transfers"] - #[doc = "- [`schedule_asset_transfer`](Self::schedule_asset_transfer) - Schedule delayed asset"] - #[doc = " transfers"] - #[doc = "- [`cancel`](Self::cancel) - Cancel pending transfers"] - #[doc = "- [`recover_funds`](Self::recover_funds) - Guardian-initiated emergency fund recovery"] - #[doc = ""] - #[doc = "There is no mechanism to disable high security mode or restore normal account"] - #[doc = "functionality. This design is intentional to provide maximum security guarantees:"] - #[doc = "an attacker who gains access to the account cannot simply disable the protections."] - #[doc = ""] - #[doc = "This permanence also ensures that any funds subsequently sent to a compromised"] - #[doc = "account (e.g., from pending payments, contracts, or accidental deposits) remain"] - #[doc = "protected and can be recovered by the guardian via"] - #[doc = "[`recover_funds`](Self::recover_funds). The guardian can call `recover_funds`"] - #[doc = "repeatedly as needed."] - #[doc = ""] - #[doc = "Users who no longer wish to use high-security features can simply transfer their"] - #[doc = "funds to a different account using [`schedule_transfer`](Self::schedule_transfer)"] - #[doc = "or [`schedule_asset_transfer`](Self::schedule_asset_transfer)."] - #[doc = ""] - #[doc = "# Parameters"] + #[doc = "- `origin`: Must be the `AddOrigin`."] + #[doc = "- `who`: Account of non-member which will become a member."] #[doc = ""] - #[doc = "- `delay`: The reversibility time for any transfer made by the high-security account."] - #[doc = "- `guardian`: The guardian account that can cancel pending transfers and recover funds"] - #[doc = " from this high-security account."] - pub struct SetHighSecurity { - pub delay: set_high_security::Delay, - pub guardian: set_high_security::Guardian, + #[doc = "Weight: `O(1)`"] + pub struct AddMember { + pub who: add_member::Who, } - pub mod set_high_security { + pub mod add_member { use super::runtime_types; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), >; - pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHighSecurity { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "set_high_security"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "add_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9609,19 +8829,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel a pending reversible transaction scheduled by the caller."] + #[doc = "Increment the rank of an existing member by one."] #[doc = ""] - #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] - pub struct Cancel { - pub tx_id: cancel::TxId, + #[doc = "- `origin`: Must be the `PromoteOrigin`."] + #[doc = "- `who`: Account of existing member."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct PromoteMember { + pub who: promote_member::Who, } - pub mod cancel { + pub mod promote_member { use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "cancel"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PromoteMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "promote_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9634,32 +8860,26 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Executes a previously scheduled transfer after the delay period has elapsed."] - #[doc = ""] - #[doc = "This extrinsic is called automatically by the Scheduler pallet when the"] - #[doc = "delay period expires. It must be signed by this pallet's account (not a user)."] - #[doc = "The pallet account is set as the origin when scheduling via"] - #[doc = "[`do_schedule_transfer_inner`](Self::do_schedule_transfer_inner)."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "- `tx_id`: The unique identifier of the pending transfer to execute."] + #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] + #[doc = "then they are removed entirely."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "- `origin`: Must be the `DemoteOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] #[doc = ""] - #[doc = "- [`InvalidSchedulerOrigin`](Error::InvalidSchedulerOrigin): Called by an account other"] - #[doc = " than this pallet's account."] - #[doc = "- [`PendingTxNotFound`](Error::PendingTxNotFound): No pending transfer with this ID."] - pub struct ExecuteTransfer { - pub tx_id: execute_transfer::TxId, + #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] + pub struct DemoteMember { + pub who: demote_member::Who, } - pub mod execute_transfer { + pub mod demote_member { use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExecuteTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "execute_transfer"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DemoteMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "demote_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9672,22 +8892,28 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule a transaction for delayed execution."] - pub struct ScheduleTransfer { - pub dest: schedule_transfer::Dest, - pub amount: schedule_transfer::Amount, + #[doc = "Remove the member entirely."] + #[doc = ""] + #[doc = "- `origin`: Must be the `RemoveOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `min_rank`: The rank of the member or greater."] + #[doc = ""] + #[doc = "Weight: `O(min_rank)`."] + pub struct RemoveMember { + pub who: remove_member::Who, + pub min_rank: remove_member::MinRank, } - pub mod schedule_transfer { + pub mod remove_member { use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; + pub type MinRank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_transfer"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "remove_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9700,32 +8926,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] + #[doc = "Add an aye or nay vote for the sender to the given proposal."] #[doc = ""] - #[doc = "This can only be used by accounts that have *not* set up a persistent"] - #[doc = "reversibility configuration with `set_high_security`."] + #[doc = "- `origin`: Must be `Signed` by a member account."] + #[doc = "- `poll`: Index of a poll which is ongoing."] + #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] #[doc = ""] - #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] - pub struct ScheduleTransferWithDelay { - pub dest: schedule_transfer_with_delay::Dest, - pub amount: schedule_transfer_with_delay::Amount, - pub delay: schedule_transfer_with_delay::Delay, + #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = ""] + #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] + pub struct Vote { + pub poll: vote::Poll, + pub aye: vote::Aye, } - pub mod schedule_transfer_with_delay { + pub mod vote { use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; + pub type Poll = ::core::primitive::u32; + pub type Aye = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransferWithDelay { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_transfer_with_delay"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "vote"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9738,25 +8961,28 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] - #[doc = "delay."] - pub struct ScheduleAssetTransfer { - pub asset_id: schedule_asset_transfer::AssetId, - pub dest: schedule_asset_transfer::Dest, - pub amount: schedule_asset_transfer::Amount, + #[doc = "Remove votes from the given poll. It must have ended."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed` by any account."] + #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] + #[doc = " exist."] + #[doc = "- `max`: Maximum number of vote items from remove in this call."] + #[doc = ""] + #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = ""] + #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] + pub struct CleanupPoll { + pub poll_index: cleanup_poll::PollIndex, + pub max: cleanup_poll::Max, } - pub mod schedule_asset_transfer { + pub mod cleanup_poll { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; + pub type PollIndex = ::core::primitive::u32; + pub type Max = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_asset_transfer"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupPoll { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "cleanup_poll"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9769,307 +8995,205 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] - pub struct ScheduleAssetTransferWithDelay { - pub asset_id: schedule_asset_transfer_with_delay::AssetId, - pub dest: schedule_asset_transfer_with_delay::Dest, - pub amount: schedule_asset_transfer_with_delay::Amount, - pub delay: schedule_asset_transfer_with_delay::Delay, + #[doc = "Exchanges a member with a new account and the same existing rank."] + #[doc = ""] + #[doc = "- `origin`: Must be the `ExchangeOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] + #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] + pub struct ExchangeMember { + pub who: exchange_member::Who, + pub new_who: exchange_member::NewWho, } - pub mod schedule_asset_transfer_with_delay { + pub mod exchange_member { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, + pub type NewWho = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransferWithDelay { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_asset_transfer_with_delay"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allows the guardian to recover all funds from a high-security account"] - #[doc = "by transferring the entire balance to themselves."] - #[doc = ""] - #[doc = "This is an emergency function for when the high-security account may be compromised."] - #[doc = "It cancels all pending transfers first (applying volume fees), then transfers"] - #[doc = "the remaining free balance to the guardian."] - #[doc = ""] - #[doc = "# Repeated Recovery"] - #[doc = ""] - #[doc = "This function can be called multiple times on the same account. The high-security"] - #[doc = "status and guardian relationship are intentionally preserved after recovery, ensuring"] - #[doc = "that any funds subsequently deposited to the account (e.g., from pending payments,"] - #[doc = "contracts, or accidental deposits) remain protected and recoverable."] - #[doc = ""] - #[doc = "# Error Handling"] - #[doc = ""] - #[doc = "If releasing held funds fails for any transfer, that transfer is skipped (metadata"] - #[doc = "preserved for manual retry via `cancel`) and a `TransferRecoveryFailed` event is"] - #[doc = "emitted. Other transfers continue to be processed."] - pub struct RecoverFunds { - pub account: recover_funds::Account, - } - pub mod recover_funds { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RecoverFunds { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "recover_funds"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExchangeMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "exchange_member"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Enable high-security for the calling account with a specified"] - #[doc = "reversibility delay."] - #[doc = ""] - #[doc = "Once an account is set as high security it can only make reversible"] - #[doc = "transfers. It is not allowed any other calls."] - #[doc = ""] - #[doc = "# Warning: Permanent and Irreversible"] - #[doc = ""] - #[doc = "**Enabling high security mode is a one-way operation that cannot be undone.**"] - #[doc = ""] - #[doc = "Once this function is called successfully, the account is permanently restricted"] - #[doc = "to only the following operations:"] - #[doc = "- [`schedule_transfer`](Self::schedule_transfer) - Schedule delayed native token"] - #[doc = " transfers"] - #[doc = "- [`schedule_asset_transfer`](Self::schedule_asset_transfer) - Schedule delayed asset"] - #[doc = " transfers"] - #[doc = "- [`cancel`](Self::cancel) - Cancel pending transfers"] - #[doc = "- [`recover_funds`](Self::recover_funds) - Guardian-initiated emergency fund recovery"] - #[doc = ""] - #[doc = "There is no mechanism to disable high security mode or restore normal account"] - #[doc = "functionality. This design is intentional to provide maximum security guarantees:"] - #[doc = "an attacker who gains access to the account cannot simply disable the protections."] + #[doc = "Introduce a new member."] #[doc = ""] - #[doc = "This permanence also ensures that any funds subsequently sent to a compromised"] - #[doc = "account (e.g., from pending payments, contracts, or accidental deposits) remain"] - #[doc = "protected and can be recovered by the guardian via"] - #[doc = "[`recover_funds`](Self::recover_funds). The guardian can call `recover_funds`"] - #[doc = "repeatedly as needed."] + #[doc = "- `origin`: Must be the `AddOrigin`."] + #[doc = "- `who`: Account of non-member which will become a member."] #[doc = ""] - #[doc = "Users who no longer wish to use high-security features can simply transfer their"] - #[doc = "funds to a different account using [`schedule_transfer`](Self::schedule_transfer)"] - #[doc = "or [`schedule_asset_transfer`](Self::schedule_asset_transfer)."] + #[doc = "Weight: `O(1)`"] + pub fn add_member( + &self, + who: types::add_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechCollective", + "add_member", + types::AddMember { who }, + [ + 2u8, 131u8, 37u8, 217u8, 112u8, 46u8, 86u8, 165u8, 248u8, 244u8, 33u8, + 236u8, 155u8, 28u8, 163u8, 169u8, 213u8, 32u8, 70u8, 217u8, 97u8, + 194u8, 138u8, 77u8, 133u8, 97u8, 188u8, 49u8, 49u8, 31u8, 177u8, 206u8, + ], + ) + } + #[doc = "Increment the rank of an existing member by one."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "- `origin`: Must be the `PromoteOrigin`."] + #[doc = "- `who`: Account of existing member."] #[doc = ""] - #[doc = "- `delay`: The reversibility time for any transfer made by the high-security account."] - #[doc = "- `guardian`: The guardian account that can cancel pending transfers and recover funds"] - #[doc = " from this high-security account."] - pub fn set_high_security( + #[doc = "Weight: `O(1)`"] + pub fn promote_member( &self, - delay: types::set_high_security::Delay, - guardian: types::set_high_security::Guardian, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + who: types::promote_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "set_high_security", - types::SetHighSecurity { delay, guardian }, + "TechCollective", + "promote_member", + types::PromoteMember { who }, [ - 103u8, 202u8, 28u8, 11u8, 249u8, 80u8, 142u8, 200u8, 55u8, 4u8, 141u8, - 72u8, 94u8, 199u8, 229u8, 102u8, 246u8, 113u8, 190u8, 84u8, 95u8, - 193u8, 96u8, 171u8, 144u8, 120u8, 235u8, 208u8, 65u8, 183u8, 4u8, 44u8, + 169u8, 155u8, 9u8, 50u8, 144u8, 133u8, 230u8, 60u8, 216u8, 147u8, 3u8, + 236u8, 94u8, 185u8, 106u8, 139u8, 235u8, 143u8, 189u8, 135u8, 208u8, + 176u8, 126u8, 124u8, 85u8, 140u8, 189u8, 125u8, 87u8, 56u8, 57u8, + 246u8, ], ) } - #[doc = "Cancel a pending reversible transaction scheduled by the caller."] + #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] + #[doc = "then they are removed entirely."] #[doc = ""] - #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] - pub fn cancel( + #[doc = "- `origin`: Must be the `DemoteOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] + pub fn demote_member( &self, - tx_id: types::cancel::TxId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + who: types::demote_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "cancel", - types::Cancel { tx_id }, + "TechCollective", + "demote_member", + types::DemoteMember { who }, [ - 228u8, 150u8, 194u8, 119u8, 243u8, 126u8, 112u8, 227u8, 70u8, 160u8, - 132u8, 82u8, 146u8, 162u8, 195u8, 149u8, 236u8, 98u8, 18u8, 44u8, - 151u8, 249u8, 193u8, 176u8, 186u8, 98u8, 224u8, 103u8, 191u8, 165u8, - 37u8, 47u8, + 21u8, 185u8, 71u8, 166u8, 106u8, 88u8, 74u8, 251u8, 78u8, 28u8, 205u8, + 171u8, 199u8, 195u8, 97u8, 149u8, 175u8, 229u8, 25u8, 113u8, 96u8, + 25u8, 240u8, 64u8, 109u8, 246u8, 203u8, 45u8, 110u8, 205u8, 115u8, + 178u8, ], ) } - #[doc = "Executes a previously scheduled transfer after the delay period has elapsed."] - #[doc = ""] - #[doc = "This extrinsic is called automatically by the Scheduler pallet when the"] - #[doc = "delay period expires. It must be signed by this pallet's account (not a user)."] - #[doc = "The pallet account is set as the origin when scheduling via"] - #[doc = "[`do_schedule_transfer_inner`](Self::do_schedule_transfer_inner)."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "- `tx_id`: The unique identifier of the pending transfer to execute."] + #[doc = "Remove the member entirely."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "- `origin`: Must be the `RemoveOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `min_rank`: The rank of the member or greater."] #[doc = ""] - #[doc = "- [`InvalidSchedulerOrigin`](Error::InvalidSchedulerOrigin): Called by an account other"] - #[doc = " than this pallet's account."] - #[doc = "- [`PendingTxNotFound`](Error::PendingTxNotFound): No pending transfer with this ID."] - pub fn execute_transfer( + #[doc = "Weight: `O(min_rank)`."] + pub fn remove_member( &self, - tx_id: types::execute_transfer::TxId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + who: types::remove_member::Who, + min_rank: types::remove_member::MinRank, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "execute_transfer", - types::ExecuteTransfer { tx_id }, + "TechCollective", + "remove_member", + types::RemoveMember { who, min_rank }, [ - 164u8, 38u8, 166u8, 81u8, 63u8, 235u8, 167u8, 178u8, 97u8, 80u8, 62u8, - 147u8, 3u8, 163u8, 129u8, 25u8, 98u8, 59u8, 17u8, 137u8, 6u8, 183u8, - 189u8, 51u8, 24u8, 211u8, 157u8, 108u8, 229u8, 253u8, 37u8, 78u8, + 23u8, 156u8, 32u8, 64u8, 158u8, 50u8, 64u8, 199u8, 108u8, 67u8, 133u8, + 128u8, 138u8, 241u8, 14u8, 238u8, 192u8, 173u8, 250u8, 11u8, 124u8, + 119u8, 177u8, 190u8, 152u8, 116u8, 134u8, 42u8, 216u8, 49u8, 113u8, + 49u8, ], ) } - #[doc = "Schedule a transaction for delayed execution."] - pub fn schedule_transfer( + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed` by a member account."] + #[doc = "- `poll`: Index of a poll which is ongoing."] + #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] + #[doc = ""] + #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = ""] + #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] + pub fn vote( &self, - dest: types::schedule_transfer::Dest, - amount: types::schedule_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + poll: types::vote::Poll, + aye: types::vote::Aye, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_transfer", - types::ScheduleTransfer { dest, amount }, + "TechCollective", + "vote", + types::Vote { poll, aye }, [ - 38u8, 219u8, 206u8, 56u8, 252u8, 195u8, 52u8, 74u8, 113u8, 125u8, - 107u8, 35u8, 236u8, 39u8, 31u8, 18u8, 250u8, 177u8, 174u8, 154u8, - 149u8, 122u8, 183u8, 50u8, 45u8, 111u8, 100u8, 249u8, 102u8, 82u8, - 72u8, 130u8, + 54u8, 116u8, 81u8, 239u8, 223u8, 35u8, 11u8, 244u8, 245u8, 94u8, 23u8, + 241u8, 125u8, 231u8, 56u8, 150u8, 105u8, 125u8, 100u8, 171u8, 182u8, + 186u8, 134u8, 40u8, 4u8, 121u8, 119u8, 11u8, 93u8, 158u8, 59u8, 209u8, ], ) } - #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] + #[doc = "Remove votes from the given poll. It must have ended."] #[doc = ""] - #[doc = "This can only be used by accounts that have *not* set up a persistent"] - #[doc = "reversibility configuration with `set_high_security`."] + #[doc = "- `origin`: Must be `Signed` by any account."] + #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] + #[doc = " exist."] + #[doc = "- `max`: Maximum number of vote items from remove in this call."] #[doc = ""] - #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] - pub fn schedule_transfer_with_delay( + #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = ""] + #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] + pub fn cleanup_poll( &self, - dest: types::schedule_transfer_with_delay::Dest, - amount: types::schedule_transfer_with_delay::Amount, - delay: types::schedule_transfer_with_delay::Delay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleTransferWithDelay, - > { + poll_index: types::cleanup_poll::PollIndex, + max: types::cleanup_poll::Max, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_transfer_with_delay", - types::ScheduleTransferWithDelay { dest, amount, delay }, + "TechCollective", + "cleanup_poll", + types::CleanupPoll { poll_index, max }, [ - 254u8, 158u8, 173u8, 217u8, 107u8, 80u8, 229u8, 252u8, 123u8, 46u8, - 177u8, 40u8, 25u8, 15u8, 32u8, 22u8, 224u8, 52u8, 242u8, 48u8, 242u8, - 84u8, 242u8, 143u8, 111u8, 12u8, 82u8, 161u8, 129u8, 86u8, 161u8, - 216u8, + 157u8, 109u8, 86u8, 253u8, 62u8, 107u8, 235u8, 255u8, 171u8, 68u8, + 103u8, 92u8, 245u8, 25u8, 252u8, 158u8, 174u8, 137u8, 77u8, 251u8, + 105u8, 113u8, 165u8, 46u8, 39u8, 55u8, 166u8, 79u8, 103u8, 81u8, 121u8, + 37u8, ], ) } - #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] - #[doc = "delay."] - pub fn schedule_asset_transfer( + #[doc = "Exchanges a member with a new account and the same existing rank."] + #[doc = ""] + #[doc = "- `origin`: Must be the `ExchangeOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] + #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] + pub fn exchange_member( &self, - asset_id: types::schedule_asset_transfer::AssetId, - dest: types::schedule_asset_transfer::Dest, - amount: types::schedule_asset_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleAssetTransfer, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_asset_transfer", - types::ScheduleAssetTransfer { asset_id, dest, amount }, - [ - 125u8, 51u8, 89u8, 31u8, 247u8, 200u8, 156u8, 209u8, 28u8, 170u8, - 203u8, 254u8, 40u8, 131u8, 155u8, 166u8, 65u8, 152u8, 101u8, 198u8, - 70u8, 129u8, 5u8, 89u8, 220u8, 189u8, 255u8, 87u8, 58u8, 24u8, 234u8, - 42u8, - ], - ) - } - #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] - pub fn schedule_asset_transfer_with_delay( - &self, - asset_id: types::schedule_asset_transfer_with_delay::AssetId, - dest: types::schedule_asset_transfer_with_delay::Dest, - amount: types::schedule_asset_transfer_with_delay::Amount, - delay: types::schedule_asset_transfer_with_delay::Delay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleAssetTransferWithDelay, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_asset_transfer_with_delay", - types::ScheduleAssetTransferWithDelay { asset_id, dest, amount, delay }, - [ - 249u8, 59u8, 121u8, 27u8, 78u8, 202u8, 252u8, 120u8, 76u8, 102u8, 33u8, - 232u8, 185u8, 78u8, 8u8, 157u8, 139u8, 72u8, 110u8, 91u8, 170u8, 179u8, - 89u8, 250u8, 77u8, 26u8, 160u8, 252u8, 62u8, 179u8, 128u8, 216u8, - ], - ) - } - #[doc = "Allows the guardian to recover all funds from a high-security account"] - #[doc = "by transferring the entire balance to themselves."] - #[doc = ""] - #[doc = "This is an emergency function for when the high-security account may be compromised."] - #[doc = "It cancels all pending transfers first (applying volume fees), then transfers"] - #[doc = "the remaining free balance to the guardian."] - #[doc = ""] - #[doc = "# Repeated Recovery"] - #[doc = ""] - #[doc = "This function can be called multiple times on the same account. The high-security"] - #[doc = "status and guardian relationship are intentionally preserved after recovery, ensuring"] - #[doc = "that any funds subsequently deposited to the account (e.g., from pending payments,"] - #[doc = "contracts, or accidental deposits) remain protected and recoverable."] - #[doc = ""] - #[doc = "# Error Handling"] - #[doc = ""] - #[doc = "If releasing held funds fails for any transfer, that transfer is skipped (metadata"] - #[doc = "preserved for manual retry via `cancel`) and a `TransferRecoveryFailed` event is"] - #[doc = "emitted. Other transfers continue to be processed."] - pub fn recover_funds( - &self, - account: types::recover_funds::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + who: types::exchange_member::Who, + new_who: types::exchange_member::NewWho, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "recover_funds", - types::RecoverFunds { account }, + "TechCollective", + "exchange_member", + types::ExchangeMember { who, new_who }, [ - 94u8, 241u8, 255u8, 110u8, 4u8, 169u8, 1u8, 45u8, 236u8, 88u8, 167u8, - 180u8, 240u8, 70u8, 111u8, 99u8, 185u8, 143u8, 153u8, 33u8, 101u8, - 30u8, 203u8, 103u8, 229u8, 39u8, 162u8, 76u8, 49u8, 125u8, 247u8, - 220u8, + 240u8, 208u8, 76u8, 147u8, 117u8, 23u8, 91u8, 37u8, 22u8, 101u8, 53u8, + 247u8, 161u8, 94u8, 109u8, 233u8, 104u8, 129u8, 67u8, 31u8, 223u8, + 182u8, 50u8, 233u8, 120u8, 129u8, 224u8, 135u8, 52u8, 162u8, 26u8, + 189u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_reversible_transfers::pallet::Event; + pub type Event = runtime_types::pallet_ranked_collective::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -10079,58 +9203,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A user has enabled their high-security settings."] - pub struct HighSecuritySet { - pub who: high_security_set::Who, - pub guardian: high_security_set::Guardian, - pub delay: high_security_set::Delay, + #[doc = "A member `who` has been added."] + pub struct MemberAdded { + pub who: member_added::Who, } - pub mod high_security_set { + pub mod member_added { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for HighSecuritySet { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "HighSecuritySet"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A transaction has been scheduled for delayed execution."] - pub struct TransactionScheduled { - pub from: transaction_scheduled::From, - pub to: transaction_scheduled::To, - pub guardian: transaction_scheduled::Guardian, - pub asset_id: transaction_scheduled::AssetId, - pub amount: transaction_scheduled::Amount, - pub tx_id: transaction_scheduled::TxId, - pub execute_at: transaction_scheduled::ExecuteAt, - } - pub mod transaction_scheduled { - use super::runtime_types; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; - pub type AssetId = ::core::option::Option<::core::primitive::u32>; - pub type Amount = ::core::primitive::u128; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - pub type ExecuteAt = runtime_types::qp_scheduler::DispatchTime< - ::core::primitive::u32, - ::core::primitive::u64, - >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionScheduled { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionScheduled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberAdded { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberAdded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10139,19 +9222,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A scheduled transaction has been successfully cancelled."] - pub struct TransactionCancelled { - pub who: transaction_cancelled::Who, - pub tx_id: transaction_cancelled::TxId, + #[doc = "The member `who`se rank has been changed to the given `rank`."] + pub struct RankChanged { + pub who: rank_changed::Who, + pub rank: rank_changed::Rank, } - pub mod transaction_cancelled { + pub mod rank_changed { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type Rank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionCancelled { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionCancelled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RankChanged { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "RankChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10160,24 +9243,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A scheduled transaction was executed by the scheduler."] - pub struct TransactionExecuted { - pub tx_id: transaction_executed::TxId, - pub result: transaction_executed::Result, + #[doc = "The member `who` of given `rank` has been removed from the collective."] + pub struct MemberRemoved { + pub who: member_removed::Who, + pub rank: member_removed::Rank, } - pub mod transaction_executed { + pub mod member_removed { use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - pub type Result = ::core::result::Result< - runtime_types::frame_support::dispatch::PostDispatchInfo, - runtime_types::sp_runtime::DispatchErrorWithPostInfo< - runtime_types::frame_support::dispatch::PostDispatchInfo, - >, - >; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Rank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionExecuted { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionExecuted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberRemoved { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberRemoved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10186,19 +9264,24 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "All funds were recovered from a high-security account by its guardian."] - pub struct FundsRecovered { - pub account: funds_recovered::Account, - pub guardian: funds_recovered::Guardian, + #[doc = "The member `who` has voted for the `poll` with the given `vote` leading to an updated"] + #[doc = "`tally`."] + pub struct Voted { + pub who: voted::Who, + pub poll: voted::Poll, + pub vote: voted::Vote, + pub tally: voted::Tally, } - pub mod funds_recovered { + pub mod voted { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Poll = ::core::primitive::u32; + pub type Vote = runtime_types::pallet_ranked_collective::VoteRecord; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for FundsRecovered { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "FundsRecovered"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "Voted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10207,409 +9290,453 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Failed to release held funds during recovery. The transfer metadata is preserved"] - #[doc = "for manual retry via `cancel`."] - pub struct TransferRecoveryFailed { - pub tx_id: transfer_recovery_failed::TxId, + #[doc = "The member `who` had their `AccountId` changed to `new_who`."] + pub struct MemberExchanged { + pub who: member_exchanged::Who, + pub new_who: member_exchanged::NewWho, } - pub mod transfer_recovery_failed { + pub mod member_exchanged { use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type NewWho = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransferRecoveryFailed { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransferRecoveryFailed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberExchanged { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberExchanged"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod high_security_accounts { - use super::runtime_types; - pub type HighSecurityAccounts = - runtime_types::pallet_reversible_transfers::HighSecurityAccountData< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod pending_transfers { + pub mod member_count { use super::runtime_types; - pub type PendingTransfers = - runtime_types::pallet_reversible_transfers::PendingTransfer< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub type MemberCount = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } - pub mod pending_transfers_by_sender { + pub mod members { use super::runtime_types; - pub type PendingTransfersBySender = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::H256, - >; + pub type Members = runtime_types::pallet_ranked_collective::MemberRecord; pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod guardian_index { + pub mod id_to_index { use super::runtime_types; - pub type GuardianIndex = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type IdToIndex = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod next_transaction_id { + pub mod index_to_id { use super::runtime_types; - pub type NextTransactionId = ::core::primitive::u64; + pub type IndexToId = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::core::primitive::u32; + } + pub mod voting { + use super::runtime_types; + pub type Voting = runtime_types::pallet_ranked_collective::VoteRecord; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod voting_cleanup { + use super::runtime_types; + pub type VotingCleanup = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub type Param0 = ::core::primitive::u32; } } pub struct StorageApi; impl StorageApi { - #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] - #[doc = " Accounts present in this map have reversibility enabled."] - pub fn high_security_accounts_iter( + #[doc = " The number of members in the collective who have at least the rank according to the index"] + #[doc = " of the vec."] + pub fn member_count_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::high_security_accounts::HighSecurityAccounts, - (), + types::member_count::MemberCount, (), ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "HighSecurityAccounts", + "TechCollective", + "MemberCount", (), [ - 110u8, 63u8, 150u8, 254u8, 213u8, 163u8, 141u8, 156u8, 66u8, 201u8, - 162u8, 30u8, 141u8, 204u8, 209u8, 159u8, 120u8, 240u8, 230u8, 239u8, - 228u8, 129u8, 130u8, 181u8, 6u8, 193u8, 157u8, 239u8, 131u8, 35u8, - 29u8, 79u8, + 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, + 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, + 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, ], ) } - #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] - #[doc = " Accounts present in this map have reversibility enabled."] - pub fn high_security_accounts( + #[doc = " The number of members in the collective who have at least the rank according to the index"] + #[doc = " of the vec."] + pub fn member_count( &self, - _0: types::high_security_accounts::Param0, + _0: types::member_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::high_security_accounts::Param0, + types::member_count::Param0, >, - types::high_security_accounts::HighSecurityAccounts, + types::member_count::MemberCount, + ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, - (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "HighSecurityAccounts", + "TechCollective", + "MemberCount", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 110u8, 63u8, 150u8, 254u8, 213u8, 163u8, 141u8, 156u8, 66u8, 201u8, - 162u8, 30u8, 141u8, 204u8, 209u8, 159u8, 120u8, 240u8, 230u8, 239u8, - 228u8, 129u8, 130u8, 181u8, 6u8, 193u8, 157u8, 239u8, 131u8, 35u8, - 29u8, 79u8, + 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, + 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, + 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, ], ) } - #[doc = " Stores the details of pending transactions scheduled for delayed execution."] - #[doc = " Keyed by the unique transaction ID."] - pub fn pending_transfers_iter( + #[doc = " The current members of the collective."] + pub fn members_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::pending_transfers::PendingTransfers, + types::members::Members, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfers", + "TechCollective", + "Members", (), [ - 138u8, 155u8, 227u8, 133u8, 16u8, 122u8, 128u8, 60u8, 245u8, 159u8, - 244u8, 82u8, 244u8, 113u8, 189u8, 149u8, 179u8, 30u8, 48u8, 31u8, - 174u8, 124u8, 28u8, 33u8, 190u8, 217u8, 193u8, 129u8, 39u8, 122u8, - 141u8, 188u8, + 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, + 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, + 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, + 247u8, 133u8, ], ) } - #[doc = " Stores the details of pending transactions scheduled for delayed execution."] - #[doc = " Keyed by the unique transaction ID."] - pub fn pending_transfers( + #[doc = " The current members of the collective."] + pub fn members( &self, - _0: types::pending_transfers::Param0, + _0: types::members::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_transfers::Param0, + types::members::Param0, >, - types::pending_transfers::PendingTransfers, + types::members::Members, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfers", + "TechCollective", + "Members", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 138u8, 155u8, 227u8, 133u8, 16u8, 122u8, 128u8, 60u8, 245u8, 159u8, - 244u8, 82u8, 244u8, 113u8, 189u8, 149u8, 179u8, 30u8, 48u8, 31u8, - 174u8, 124u8, 28u8, 33u8, 190u8, 217u8, 193u8, 129u8, 39u8, 122u8, - 141u8, 188u8, + 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, + 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, + 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, + 247u8, 133u8, ], ) } - #[doc = " Maps sender accounts to their list of pending transaction IDs."] - pub fn pending_transfers_by_sender_iter( + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::pending_transfers_by_sender::PendingTransfersBySender, + types::id_to_index::IdToIndex, + (), (), - ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersBySender", + "TechCollective", + "IdToIndex", (), [ - 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, - 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, - 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, ], ) } - #[doc = " Maps sender accounts to their list of pending transaction IDs."] - pub fn pending_transfers_by_sender( + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index_iter1( &self, - _0: types::pending_transfers_by_sender::Param0, + _0: types::id_to_index::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_transfers_by_sender::Param0, + types::id_to_index::Param0, >, - types::pending_transfers_by_sender::PendingTransfersBySender, + types::id_to_index::IdToIndex, + (), + (), ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "IdToIndex", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + ], + ) + } + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index( + &self, + _0: types::id_to_index::Param0, + _1: types::id_to_index::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::id_to_index::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::id_to_index::Param1, + >, + ), + types::id_to_index::IdToIndex, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersBySender", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "TechCollective", + "IdToIndex", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, - 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, - 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, ], ) } - #[doc = " Maps guardian accounts to the list of accounts they protect."] - #[doc = " This allows the UI to efficiently query all accounts for which a given account is a"] - #[doc = " guardian."] - pub fn guardian_index_iter( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::guardian_index::GuardianIndex, + types::index_to_id::IndexToId, + (), (), - ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "GuardianIndex", + "TechCollective", + "IndexToId", (), [ - 112u8, 32u8, 227u8, 175u8, 221u8, 116u8, 83u8, 105u8, 108u8, 132u8, - 254u8, 61u8, 178u8, 251u8, 179u8, 127u8, 14u8, 12u8, 144u8, 204u8, - 38u8, 98u8, 154u8, 10u8, 202u8, 254u8, 230u8, 126u8, 149u8, 161u8, - 13u8, 110u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - #[doc = " Maps guardian accounts to the list of accounts they protect."] - #[doc = " This allows the UI to efficiently query all accounts for which a given account is a"] - #[doc = " guardian."] - pub fn guardian_index( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id_iter1( &self, - _0: types::guardian_index::Param0, + _0: types::index_to_id::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::guardian_index::Param0, + types::index_to_id::Param0, >, - types::guardian_index::GuardianIndex, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, + types::index_to_id::IndexToId, + (), (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "GuardianIndex", + "TechCollective", + "IndexToId", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 112u8, 32u8, 227u8, 175u8, 221u8, 116u8, 83u8, 105u8, 108u8, 132u8, - 254u8, 61u8, 178u8, 251u8, 179u8, 127u8, 14u8, 12u8, 144u8, 204u8, - 38u8, 98u8, 154u8, 10u8, 202u8, 254u8, 230u8, 126u8, 149u8, 161u8, - 13u8, 110u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - #[doc = " Monotonically increasing counter used to generate unique transaction IDs."] - #[doc = " Each scheduled transfer increments this value to ensure no two transfers"] - #[doc = " produce the same `tx_id`, even if they have identical parameters."] - pub fn next_transaction_id( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id( &self, + _0: types::index_to_id::Param0, + _1: types::index_to_id::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_transaction_id::NextTransactionId, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "NextTransactionId", - (), - [ - 42u8, 56u8, 195u8, 140u8, 101u8, 56u8, 175u8, 152u8, 210u8, 167u8, - 61u8, 134u8, 152u8, 191u8, 216u8, 58u8, 73u8, 109u8, 130u8, 125u8, - 189u8, 186u8, 142u8, 68u8, 222u8, 141u8, 16u8, 250u8, 85u8, 8u8, 196u8, - 188u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " Maximum number of accounts a single guardian can protect. Used for BoundedVec."] - pub fn max_guardian_accounts( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::index_to_id::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::index_to_id::Param1, + >, + ), + types::index_to_id::IndexToId, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MaxGuardianAccounts", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "IndexToId", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - #[doc = " Maximum pending reversible transactions allowed per account."] - pub fn max_pending_per_account( + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting_iter( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::voting::Voting, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MaxPendingPerAccount", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Voting", + (), [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, ], ) } - #[doc = " The default delay period for reversible transactions if none is specified."] - #[doc = ""] - #[doc = " NOTE: default delay is always in blocks."] - pub fn default_delay( + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting_iter1( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, + _0: types::voting::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting::Param0, >, + types::voting::Voting, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "DefaultDelay", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Voting", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 245u8, 29u8, 3u8, 65u8, 154u8, 12u8, 172u8, 71u8, 67u8, 134u8, 71u8, - 180u8, 4u8, 9u8, 54u8, 89u8, 6u8, 19u8, 3u8, 168u8, 67u8, 122u8, 197u8, - 109u8, 1u8, 228u8, 44u8, 243u8, 228u8, 194u8, 241u8, 227u8, + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, ], ) } - #[doc = " The minimum delay period allowed for reversible transactions, in blocks."] - pub fn min_delay_period_blocks( + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + _0: types::voting::Param0, + _1: types::voting::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting::Param1, + >, + ), + types::voting::Voting, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MinDelayPeriodBlocks", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Voting", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, ], ) } - #[doc = " The minimum delay period allowed for reversible transactions, in milliseconds."] - pub fn min_delay_period_moment( + pub fn voting_cleanup_iter( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::voting_cleanup::VotingCleanup, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MinDelayPeriodMoment", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "VotingCleanup", + (), [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, - 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, - 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, - 246u8, + 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, + 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, + 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, ], ) } - #[doc = " Volume fee taken from reversed transactions for high-security accounts only,"] - #[doc = " expressed as a Permill (e.g., Permill::from_percent(1) = 1%). Regular accounts incur no"] - #[doc = " fees. The fee is burned (removed from total issuance)."] - pub fn volume_fee( + pub fn voting_cleanup( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_arithmetic::per_things::Permill, + _0: types::voting_cleanup::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting_cleanup::Param0, + >, + types::voting_cleanup::VotingCleanup, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "VolumeFee", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "VotingCleanup", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, - 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, - 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, + 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, + 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, + 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, ], ) } } } } - pub mod conviction_voting { + pub mod tech_referenda { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_conviction_voting::pallet::Error; + pub type Error = runtime_types::pallet_referenda::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_conviction_voting::pallet::Call; + pub type Call = runtime_types::pallet_referenda::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -10626,30 +9753,36 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Propose a referendum on a privileged action."] #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - pub struct Vote { - #[codec(compact)] - pub poll_index: vote::PollIndex, - pub vote: vote::Vote, + #[doc = "Emits `Submitted`."] + pub struct Submit { + pub proposal_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub proposal: submit::Proposal, + pub enactment_moment: submit::EnactmentMoment, } - pub mod vote { + pub mod submit { use super::runtime_types; - pub type PollIndex = ::core::primitive::u32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, + pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, >; + pub type EnactmentMoment = + runtime_types::frame_support::traits::schedule::DispatchTime< + ::core::primitive::u32, + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "submit"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10662,49 +9795,24 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] + #[doc = "Post the Decision Deposit for a referendum."] #[doc = ""] - #[doc = "Emits `Delegated`."] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub struct Delegate { - pub class: delegate::Class, - pub to: delegate::To, - pub conviction: delegate::Conviction, - pub balance: delegate::Balance, + #[doc = "Emits `DecisionDepositPlaced`."] + pub struct PlaceDecisionDeposit { + pub index: place_decision_deposit::Index, } - pub mod delegate { + pub mod place_decision_deposit { use super::runtime_types; - pub type Class = ::core::primitive::u16; - pub type To = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Conviction = - runtime_types::pallet_conviction_voting::conviction::Conviction; - pub type Balance = ::core::primitive::u128; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Delegate { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "delegate"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "place_decision_deposit"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10717,30 +9825,51 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = "Emits `DecisionDepositRefunded`."] + pub struct RefundDecisionDeposit { + pub index: refund_decision_deposit::Index, + } + pub mod refund_decision_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "refund_decision_deposit"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel an ongoing referendum."] #[doc = ""] - #[doc = "Emits `Undelegated`."] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub struct Undelegate { - pub class: undelegate::Class, + #[doc = "Emits `Cancelled`."] + pub struct Cancel { + pub index: cancel::Index, } - pub mod undelegate { + pub mod cancel { use super::runtime_types; - pub type Class = ::core::primitive::u16; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Undelegate { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "undelegate"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "cancel"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10753,30 +9882,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Cancel an ongoing referendum and slash the deposits."] #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub struct Unlock { - pub class: unlock::Class, - pub target: unlock::Target, + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub struct Kill { + pub index: kill::Index, } - pub mod unlock { + pub mod kill { use super::runtime_types; - pub type Class = ::core::primitive::u16; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Unlock { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "unlock"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "kill"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10789,47 +9910,20 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] - #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub struct RemoveVote { - pub class: remove_vote::Class, - pub index: remove_vote::Index, - } - pub mod remove_vote { + #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub struct NudgeReferendum { + pub index: nudge_referendum::Index, + } + pub mod nudge_referendum { use super::runtime_types; - pub type Class = ::core::option::Option<::core::primitive::u16>; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveVote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "remove_vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "nudge_referendum"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10842,274 +9936,340 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove a vote for a poll."] + #[doc = "Advance a track onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub struct OneFewerDeciding { + pub track: one_fewer_deciding::Track, + } + pub mod one_fewer_deciding { + use super::runtime_types; + pub type Track = ::core::primitive::u16; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "one_fewer_deciding"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub struct RemoveOtherVote { - pub target: remove_other_vote::Target, - pub class: remove_other_vote::Class, - pub index: remove_other_vote::Index, + #[doc = "Emits `SubmissionDepositRefunded`."] + pub struct RefundSubmissionDeposit { + pub index: refund_submission_deposit::Index, } - pub mod remove_other_vote { + pub mod refund_submission_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "refund_submission_deposit"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set or clear metadata of a referendum."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub struct SetMetadata { + pub index: set_metadata::Index, + pub maybe_hash: set_metadata::MaybeHash, + } + pub mod set_metadata { use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Class = ::core::primitive::u16; pub type Index = ::core::primitive::u32; + pub type MaybeHash = + ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveOtherVote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "remove_other_vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "set_metadata"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Propose a referendum on a privileged action."] #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - pub fn vote( + #[doc = "Emits `Submitted`."] + pub fn submit( &self, - poll_index: types::vote::PollIndex, - vote: types::vote::Vote, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + proposal_origin: types::submit::ProposalOrigin, + proposal: types::submit::Proposal, + enactment_moment: types::submit::EnactmentMoment, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "vote", - types::Vote { poll_index, vote }, + "TechReferenda", + "submit", + types::Submit { + proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + proposal_origin, + ), + proposal, + enactment_moment, + }, [ - 57u8, 170u8, 177u8, 168u8, 158u8, 43u8, 87u8, 242u8, 176u8, 85u8, - 230u8, 64u8, 103u8, 239u8, 190u8, 6u8, 228u8, 165u8, 248u8, 77u8, - 231u8, 221u8, 186u8, 107u8, 249u8, 201u8, 226u8, 52u8, 129u8, 90u8, - 142u8, 159u8, + 0u8, 18u8, 14u8, 253u8, 33u8, 212u8, 33u8, 173u8, 241u8, 29u8, 88u8, + 160u8, 111u8, 21u8, 6u8, 234u8, 249u8, 230u8, 222u8, 119u8, 161u8, + 114u8, 43u8, 126u8, 164u8, 140u8, 199u8, 39u8, 2u8, 64u8, 132u8, 34u8, ], ) } - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] + #[doc = "Post the Decision Deposit for a referendum."] #[doc = ""] - #[doc = "Emits `Delegated`."] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub fn delegate( + #[doc = "Emits `DecisionDepositPlaced`."] + pub fn place_decision_deposit( &self, - class: types::delegate::Class, - to: types::delegate::To, - conviction: types::delegate::Conviction, - balance: types::delegate::Balance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::place_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "delegate", - types::Delegate { class, to, conviction, balance }, + "TechReferenda", + "place_decision_deposit", + types::PlaceDecisionDeposit { index }, [ - 223u8, 143u8, 33u8, 94u8, 32u8, 156u8, 43u8, 40u8, 142u8, 134u8, 209u8, - 134u8, 255u8, 179u8, 97u8, 46u8, 8u8, 140u8, 5u8, 29u8, 76u8, 22u8, - 36u8, 7u8, 108u8, 190u8, 220u8, 151u8, 10u8, 47u8, 89u8, 55u8, + 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, + 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, + 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, ], ) } - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] - #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "Emits `Undelegated`."] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub fn undelegate( + #[doc = "Emits `DecisionDepositRefunded`."] + pub fn refund_decision_deposit( &self, - class: types::undelegate::Class, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::refund_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundDecisionDeposit, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "undelegate", - types::Undelegate { class }, + "TechReferenda", + "refund_decision_deposit", + types::RefundDecisionDeposit { index }, [ - 140u8, 232u8, 6u8, 53u8, 228u8, 8u8, 131u8, 144u8, 65u8, 66u8, 245u8, - 247u8, 147u8, 135u8, 198u8, 57u8, 82u8, 212u8, 89u8, 46u8, 236u8, - 168u8, 200u8, 220u8, 93u8, 168u8, 101u8, 29u8, 110u8, 76u8, 67u8, - 181u8, + 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, + 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, + 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, ], ) } - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Cancel an ongoing referendum."] #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub fn unlock( + #[doc = "Emits `Cancelled`."] + pub fn cancel( &self, - class: types::unlock::Class, - target: types::unlock::Target, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "unlock", - types::Unlock { class, target }, - [ - 79u8, 5u8, 252u8, 237u8, 109u8, 238u8, 157u8, 237u8, 125u8, 171u8, - 65u8, 160u8, 102u8, 192u8, 5u8, 141u8, 179u8, 249u8, 253u8, 213u8, - 105u8, 251u8, 241u8, 145u8, 186u8, 177u8, 244u8, 139u8, 71u8, 140u8, - 173u8, 108u8, - ], - ) - } - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] - #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_vote( - &self, - class: types::remove_vote::Class, - index: types::remove_vote::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::cancel::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "remove_vote", - types::RemoveVote { class, index }, + "TechReferenda", + "cancel", + types::Cancel { index }, [ - 255u8, 108u8, 211u8, 146u8, 168u8, 231u8, 207u8, 44u8, 76u8, 24u8, - 235u8, 60u8, 23u8, 79u8, 192u8, 192u8, 46u8, 40u8, 134u8, 27u8, 125u8, - 114u8, 125u8, 247u8, 85u8, 102u8, 76u8, 159u8, 34u8, 167u8, 152u8, - 148u8, + 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, + 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, + 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, + 122u8, ], ) } - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Cancel an ongoing referendum and slash the deposits."] #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_other_vote( + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub fn kill( &self, - target: types::remove_other_vote::Target, - class: types::remove_other_vote::Class, - index: types::remove_other_vote::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + index: types::kill::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "remove_other_vote", - types::RemoveOtherVote { target, class, index }, + "TechReferenda", + "kill", + types::Kill { index }, [ - 165u8, 26u8, 166u8, 37u8, 10u8, 174u8, 243u8, 10u8, 73u8, 93u8, 213u8, - 69u8, 200u8, 16u8, 48u8, 146u8, 160u8, 92u8, 28u8, 26u8, 158u8, 55u8, - 6u8, 251u8, 36u8, 132u8, 46u8, 195u8, 107u8, 34u8, 0u8, 100u8, + 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, + 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, + 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, + 48u8, ], ) } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_conviction_voting::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub fn nudge_referendum( + &self, + index: types::nudge_referendum::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "nudge_referendum", + types::NudgeReferendum { index }, + [ + 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, + 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, + 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, + 213u8, + ], + ) + } + #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = ""] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] + #[doc = ""] + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub fn one_fewer_deciding( + &self, + track: types::one_fewer_deciding::Track, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "one_fewer_deciding", + types::OneFewerDeciding { track }, + [ + 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, + 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, + 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, + 131u8, 167u8, + ], + ) + } + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `SubmissionDepositRefunded`."] + pub fn refund_submission_deposit( + &self, + index: types::refund_submission_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundSubmissionDeposit, + > { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "refund_submission_deposit", + types::RefundSubmissionDeposit { index }, + [ + 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, + 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, + 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, + ], + ) + } + #[doc = "Set or clear metadata of a referendum."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub fn set_metadata( + &self, + index: types::set_metadata::Index, + maybe_hash: types::set_metadata::MaybeHash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "set_metadata", + types::SetMetadata { index, maybe_hash }, + [ + 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, + 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, + 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, + 88u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_referenda::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An account has delegated their vote to another account. \\[who, target\\]"] - pub struct Delegated( - pub delegated::Field0, - pub delegated::Field1, - pub delegated::Field2, - ); - pub mod delegated { + #[doc = "A referendum has been submitted."] + pub struct Submitted { + pub index: submitted::Index, + pub track: submitted::Track, + pub proposal: submitted::Proposal, + } + pub mod submitted { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Field1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Field2 = ::core::primitive::u16; + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Delegated { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Delegated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Submitted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11118,16 +10278,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An \\[account\\] has cancelled a previous delegation operation."] - pub struct Undelegated(pub undelegated::Field0, pub undelegated::Field1); - pub mod undelegated { + #[doc = "The decision deposit has been placed."] + pub struct DecisionDepositPlaced { + pub index: decision_deposit_placed::Index, + pub who: decision_deposit_placed::Who, + pub amount: decision_deposit_placed::Amount, + } + pub mod decision_deposit_placed { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Field1 = ::core::primitive::u16; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Undelegated { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Undelegated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionDepositPlaced"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11136,23 +10301,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An account has voted"] - pub struct Voted { - pub who: voted::Who, - pub vote: voted::Vote, - pub poll_index: voted::PollIndex, + #[doc = "The decision deposit has been refunded."] + pub struct DecisionDepositRefunded { + pub index: decision_deposit_refunded::Index, + pub who: decision_deposit_refunded::Who, + pub amount: decision_deposit_refunded::Amount, } - pub mod voted { + pub mod decision_deposit_refunded { use super::runtime_types; + pub type Index = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, - >; - pub type PollIndex = ::core::primitive::u32; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Voted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionDepositRefunded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11161,23 +10324,47 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A vote has been removed"] - pub struct VoteRemoved { - pub who: vote_removed::Who, - pub vote: vote_removed::Vote, - pub poll_index: vote_removed::PollIndex, + #[doc = "A deposit has been slashed."] + pub struct DepositSlashed { + pub who: deposit_slashed::Who, + pub amount: deposit_slashed::Amount, } - pub mod vote_removed { + pub mod deposit_slashed { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DepositSlashed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has moved into the deciding phase."] + pub struct DecisionStarted { + pub index: decision_started::Index, + pub track: decision_started::Track, + pub proposal: decision_started::Proposal, + pub tally: decision_started::Tally, + } + pub mod decision_started { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, >; - pub type PollIndex = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VoteRemoved { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "VoteRemoved"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionStarted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11186,1188 +10373,833 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The lockup period of a conviction vote expired, and the funds have been unlocked."] - pub struct VoteUnlocked { - pub who: vote_unlocked::Who, - pub class: vote_unlocked::Class, + pub struct ConfirmStarted { + pub index: confirm_started::Index, } - pub mod vote_unlocked { + pub mod confirm_started { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Class = ::core::primitive::u16; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VoteUnlocked { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "VoteUnlocked"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "ConfirmStarted"; } - } - pub mod storage { - use super::runtime_types; - pub mod types { + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct ConfirmAborted { + pub index: confirm_aborted::Index, + } + pub mod confirm_aborted { use super::runtime_types; - pub mod voting_for { - use super::runtime_types; - pub type VotingFor = runtime_types::pallet_conviction_voting::vote::Voting< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::core::primitive::u16; - } - pub mod class_locks_for { - use super::runtime_types; - pub type ClassLocksFor = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u16, - ::core::primitive::u128, - )>; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } + pub type Index = ::core::primitive::u32; } - pub struct StorageApi; - impl StorageApi { - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::voting_for::VotingFor, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", - (), - [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, - ], - ) - } - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for_iter1( - &self, - _0: types::voting_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param0, - >, - types::voting_for::VotingFor, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, - ], - ) - } - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for( - &self, - _0: types::voting_for::Param0, - _1: types::voting_for::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param1, - >, - ), - types::voting_for::VotingFor, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, - ], - ) - } - #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] - #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] - #[doc = " this list."] - pub fn class_locks_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::class_locks_for::ClassLocksFor, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "ClassLocksFor", - (), - [ - 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, - 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, - 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, - ], - ) - } - #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] - #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] - #[doc = " this list."] - pub fn class_locks_for( - &self, - _0: types::class_locks_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::class_locks_for::Param0, - >, - types::class_locks_for::ClassLocksFor, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "ClassLocksFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, - 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, - 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, - ], - ) - } + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "ConfirmAborted"; } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The maximum number of concurrent votes an account may have."] - #[doc = ""] - #[doc = " Also used to compute weight, an overly large value can lead to extrinsics with large"] - #[doc = " weight estimation: see `delegate` for instance."] - pub fn max_votes( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ConvictionVoting", - "MaxVotes", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The minimum period of vote locking."] - #[doc = ""] - #[doc = " It should be no shorter than enactment period to ensure that in the case of an approval,"] - #[doc = " those successful voters are locked into the consequences that their votes entail."] - pub fn vote_locking_period( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ConvictionVoting", - "VoteLockingPeriod", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has ended its confirmation phase and is ready for approval."] + pub struct Confirmed { + pub index: confirmed::Index, + pub tally: confirmed::Tally, } - } - } - pub mod tech_collective { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_ranked_collective::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_ranked_collective::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + pub mod confirmed { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Introduce a new member."] - #[doc = ""] - #[doc = "- `origin`: Must be the `AddOrigin`."] - #[doc = "- `who`: Account of non-member which will become a member."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct AddMember { - pub who: add_member::Who, - } - pub mod add_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "add_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Increment the rank of an existing member by one."] - #[doc = ""] - #[doc = "- `origin`: Must be the `PromoteOrigin`."] - #[doc = "- `who`: Account of existing member."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct PromoteMember { - pub who: promote_member::Who, - } - pub mod promote_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PromoteMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "promote_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] - #[doc = "then they are removed entirely."] - #[doc = ""] - #[doc = "- `origin`: Must be the `DemoteOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] - pub struct DemoteMember { - pub who: demote_member::Who, - } - pub mod demote_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DemoteMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "demote_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove the member entirely."] - #[doc = ""] - #[doc = "- `origin`: Must be the `RemoveOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = "- `min_rank`: The rank of the member or greater."] - #[doc = ""] - #[doc = "Weight: `O(min_rank)`."] - pub struct RemoveMember { - pub who: remove_member::Who, - pub min_rank: remove_member::MinRank, - } - pub mod remove_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MinRank = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "remove_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by a member account."] - #[doc = "- `poll`: Index of a poll which is ongoing."] - #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] - #[doc = ""] - #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] - #[doc = ""] - #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] - pub struct Vote { - pub poll: vote::Poll, - pub aye: vote::Aye, - } - pub mod vote { + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Confirmed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been approved and its proposal has been scheduled."] + pub struct Approved { + pub index: approved::Index, + } + pub mod approved { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Approved"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A proposal has been rejected by referendum."] + pub struct Rejected { + pub index: rejected::Index, + pub tally: rejected::Tally, + } + pub mod rejected { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Rejected"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been timed out without being decided."] + pub struct TimedOut { + pub index: timed_out::Index, + pub tally: timed_out::Tally, + } + pub mod timed_out { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "TimedOut"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been cancelled."] + pub struct Cancelled { + pub index: cancelled::Index, + pub tally: cancelled::Tally, + } + pub mod cancelled { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Cancelled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been killed."] + pub struct Killed { + pub index: killed::Index, + pub tally: killed::Tally, + } + pub mod killed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Killed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The submission deposit has been refunded."] + pub struct SubmissionDepositRefunded { + pub index: submission_deposit_refunded::Index, + pub who: submission_deposit_refunded::Who, + pub amount: submission_deposit_refunded::Amount, + } + pub mod submission_deposit_refunded { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "SubmissionDepositRefunded"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata for a referendum has been set."] + pub struct MetadataSet { + pub index: metadata_set::Index, + pub hash: metadata_set::Hash, + } + pub mod metadata_set { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata for a referendum has been cleared."] + pub struct MetadataCleared { + pub index: metadata_cleared::Index, + pub hash: metadata_cleared::Hash, + } + pub mod metadata_cleared { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "MetadataCleared"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod referendum_count { use super::runtime_types; - pub type Poll = ::core::primitive::u32; - pub type Aye = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "vote"; + pub type ReferendumCount = ::core::primitive::u32; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Remove votes from the given poll. It must have ended."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by any account."] - #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] - #[doc = " exist."] - #[doc = "- `max`: Maximum number of vote items from remove in this call."] - #[doc = ""] - #[doc = "Transaction fees are waived if the operation is successful."] - #[doc = ""] - #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] - pub struct CleanupPoll { - pub poll_index: cleanup_poll::PollIndex, - pub max: cleanup_poll::Max, + pub mod referendum_info_for { + use super::runtime_types; + pub type ReferendumInfoFor = + runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::quantus_runtime::OriginCaller, + ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + ::core::primitive::u128, + runtime_types::pallet_ranked_collective::Tally, + ::subxt::ext::subxt_core::utils::AccountId32, + ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ), + >; + pub type Param0 = ::core::primitive::u32; } - pub mod cleanup_poll { + pub mod track_queue { use super::runtime_types; - pub type PollIndex = ::core::primitive::u32; - pub type Max = ::core::primitive::u32; + pub type TrackQueue = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u32, + )>; + pub type Param0 = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupPoll { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "cleanup_poll"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Exchanges a member with a new account and the same existing rank."] - #[doc = ""] - #[doc = "- `origin`: Must be the `ExchangeOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] - #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] - pub struct ExchangeMember { - pub who: exchange_member::Who, - pub new_who: exchange_member::NewWho, - } - pub mod exchange_member { + pub mod deciding_count { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type NewWho = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type DecidingCount = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExchangeMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "exchange_member"; + pub mod metadata_of { + use super::runtime_types; + pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Introduce a new member."] - #[doc = ""] - #[doc = "- `origin`: Must be the `AddOrigin`."] - #[doc = "- `who`: Account of non-member which will become a member."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn add_member( + pub struct StorageApi; + impl StorageApi { + #[doc = " The next free referendum index, aka the number of referenda started so far."] + pub fn referendum_count( &self, - who: types::add_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "add_member", - types::AddMember { who }, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::referendum_count::ReferendumCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "ReferendumCount", + (), [ - 2u8, 131u8, 37u8, 217u8, 112u8, 46u8, 86u8, 165u8, 248u8, 244u8, 33u8, - 236u8, 155u8, 28u8, 163u8, 169u8, 213u8, 32u8, 70u8, 217u8, 97u8, - 194u8, 138u8, 77u8, 133u8, 97u8, 188u8, 49u8, 49u8, 31u8, 177u8, 206u8, + 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, + 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, + 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, + 67u8, ], ) } - #[doc = "Increment the rank of an existing member by one."] - #[doc = ""] - #[doc = "- `origin`: Must be the `PromoteOrigin`."] - #[doc = "- `who`: Account of existing member."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn promote_member( + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for_iter( &self, - who: types::promote_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "promote_member", - types::PromoteMember { who }, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::referendum_info_for::ReferendumInfoFor, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "ReferendumInfoFor", + (), [ - 169u8, 155u8, 9u8, 50u8, 144u8, 133u8, 230u8, 60u8, 216u8, 147u8, 3u8, - 236u8, 94u8, 185u8, 106u8, 139u8, 235u8, 143u8, 189u8, 135u8, 208u8, - 176u8, 126u8, 124u8, 85u8, 140u8, 189u8, 125u8, 87u8, 56u8, 57u8, - 246u8, + 242u8, 125u8, 226u8, 99u8, 67u8, 226u8, 43u8, 159u8, 222u8, 238u8, + 72u8, 38u8, 45u8, 26u8, 95u8, 64u8, 141u8, 140u8, 37u8, 44u8, 101u8, + 67u8, 46u8, 66u8, 45u8, 93u8, 41u8, 156u8, 63u8, 59u8, 9u8, 29u8, ], ) } - #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] - #[doc = "then they are removed entirely."] - #[doc = ""] - #[doc = "- `origin`: Must be the `DemoteOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] - pub fn demote_member( + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for( &self, - who: types::demote_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "demote_member", - types::DemoteMember { who }, + _0: types::referendum_info_for::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::referendum_info_for::Param0, + >, + types::referendum_info_for::ReferendumInfoFor, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "ReferendumInfoFor", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 21u8, 185u8, 71u8, 166u8, 106u8, 88u8, 74u8, 251u8, 78u8, 28u8, 205u8, - 171u8, 199u8, 195u8, 97u8, 149u8, 175u8, 229u8, 25u8, 113u8, 96u8, - 25u8, 240u8, 64u8, 109u8, 246u8, 203u8, 45u8, 110u8, 205u8, 115u8, - 178u8, + 242u8, 125u8, 226u8, 99u8, 67u8, 226u8, 43u8, 159u8, 222u8, 238u8, + 72u8, 38u8, 45u8, 26u8, 95u8, 64u8, 141u8, 140u8, 37u8, 44u8, 101u8, + 67u8, 46u8, 66u8, 45u8, 93u8, 41u8, 156u8, 63u8, 59u8, 9u8, 29u8, ], ) } - #[doc = "Remove the member entirely."] - #[doc = ""] - #[doc = "- `origin`: Must be the `RemoveOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = "- `min_rank`: The rank of the member or greater."] + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] #[doc = ""] - #[doc = "Weight: `O(min_rank)`."] - pub fn remove_member( + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue_iter( &self, - who: types::remove_member::Who, - min_rank: types::remove_member::MinRank, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "remove_member", - types::RemoveMember { who, min_rank }, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::track_queue::TrackQueue, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "TrackQueue", + (), [ - 23u8, 156u8, 32u8, 64u8, 158u8, 50u8, 64u8, 199u8, 108u8, 67u8, 133u8, - 128u8, 138u8, 241u8, 14u8, 238u8, 192u8, 173u8, 250u8, 11u8, 124u8, - 119u8, 177u8, 190u8, 152u8, 116u8, 134u8, 42u8, 216u8, 49u8, 113u8, - 49u8, + 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, + 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, + 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, + 186u8, 65u8, ], ) } - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by a member account."] - #[doc = "- `poll`: Index of a poll which is ongoing."] - #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] - #[doc = ""] - #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] - pub fn vote( + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue( &self, - poll: types::vote::Poll, - aye: types::vote::Aye, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "vote", - types::Vote { poll, aye }, + _0: types::track_queue::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::track_queue::Param0, + >, + types::track_queue::TrackQueue, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "TrackQueue", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 54u8, 116u8, 81u8, 239u8, 223u8, 35u8, 11u8, 244u8, 245u8, 94u8, 23u8, - 241u8, 125u8, 231u8, 56u8, 150u8, 105u8, 125u8, 100u8, 171u8, 182u8, - 186u8, 134u8, 40u8, 4u8, 121u8, 119u8, 11u8, 93u8, 158u8, 59u8, 209u8, + 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, + 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, + 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, + 186u8, 65u8, ], ) } - #[doc = "Remove votes from the given poll. It must have ended."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by any account."] - #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] - #[doc = " exist."] - #[doc = "- `max`: Maximum number of vote items from remove in this call."] - #[doc = ""] - #[doc = "Transaction fees are waived if the operation is successful."] - #[doc = ""] - #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] - pub fn cleanup_poll( - &self, - poll_index: types::cleanup_poll::PollIndex, - max: types::cleanup_poll::Max, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "cleanup_poll", - types::CleanupPoll { poll_index, max }, - [ - 157u8, 109u8, 86u8, 253u8, 62u8, 107u8, 235u8, 255u8, 171u8, 68u8, - 103u8, 92u8, 245u8, 25u8, 252u8, 158u8, 174u8, 137u8, 77u8, 251u8, - 105u8, 113u8, 165u8, 46u8, 39u8, 55u8, 166u8, 79u8, 103u8, 81u8, 121u8, - 37u8, - ], - ) - } - #[doc = "Exchanges a member with a new account and the same existing rank."] - #[doc = ""] - #[doc = "- `origin`: Must be the `ExchangeOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] - #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] - pub fn exchange_member( - &self, - who: types::exchange_member::Who, - new_who: types::exchange_member::NewWho, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "exchange_member", - types::ExchangeMember { who, new_who }, - [ - 240u8, 208u8, 76u8, 147u8, 117u8, 23u8, 91u8, 37u8, 22u8, 101u8, 53u8, - 247u8, 161u8, 94u8, 109u8, 233u8, 104u8, 129u8, 67u8, 31u8, 223u8, - 182u8, 50u8, 233u8, 120u8, 129u8, 224u8, 135u8, 52u8, 162u8, 26u8, - 189u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_ranked_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A member `who` has been added."] - pub struct MemberAdded { - pub who: member_added::Who, - } - pub mod member_added { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberAdded { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberAdded"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who`se rank has been changed to the given `rank`."] - pub struct RankChanged { - pub who: rank_changed::Who, - pub rank: rank_changed::Rank, - } - pub mod rank_changed { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Rank = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RankChanged { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "RankChanged"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who` of given `rank` has been removed from the collective."] - pub struct MemberRemoved { - pub who: member_removed::Who, - pub rank: member_removed::Rank, - } - pub mod member_removed { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Rank = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberRemoved { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberRemoved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who` has voted for the `poll` with the given `vote` leading to an updated"] - #[doc = "`tally`."] - pub struct Voted { - pub who: voted::Who, - pub poll: voted::Poll, - pub vote: voted::Vote, - pub tally: voted::Tally, - } - pub mod voted { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Poll = ::core::primitive::u32; - pub type Vote = runtime_types::pallet_ranked_collective::VoteRecord; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "Voted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who` had their `AccountId` changed to `new_who`."] - pub struct MemberExchanged { - pub who: member_exchanged::Who, - pub new_who: member_exchanged::NewWho, - } - pub mod member_exchanged { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type NewWho = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberExchanged { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberExchanged"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod member_count { - use super::runtime_types; - pub type MemberCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - } - pub mod members { - use super::runtime_types; - pub type Members = runtime_types::pallet_ranked_collective::MemberRecord; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod id_to_index { - use super::runtime_types; - pub type IdToIndex = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod index_to_id { - use super::runtime_types; - pub type IndexToId = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::core::primitive::u32; - } - pub mod voting { - use super::runtime_types; - pub type Voting = runtime_types::pallet_ranked_collective::VoteRecord; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod voting_cleanup { - use super::runtime_types; - pub type VotingCleanup = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = ::core::primitive::u32; - } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " The number of members in the collective who have at least the rank according to the index"] - #[doc = " of the vec."] - pub fn member_count_iter( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::member_count::MemberCount, + types::deciding_count::DecidingCount, (), ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "MemberCount", + "TechReferenda", + "DecidingCount", (), [ - 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, - 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, - 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, ], ) } - #[doc = " The number of members in the collective who have at least the rank according to the index"] - #[doc = " of the vec."] - pub fn member_count( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count( &self, - _0: types::member_count::Param0, + _0: types::deciding_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::member_count::Param0, + types::deciding_count::Param0, >, - types::member_count::MemberCount, + types::deciding_count::DecidingCount, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "MemberCount", + "TechReferenda", + "DecidingCount", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, - 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, - 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, ], ) } - #[doc = " The current members of the collective."] - pub fn members_iter( + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] + #[doc = ""] + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::members::Members, + types::metadata_of::MetadataOf, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Members", + "TechReferenda", + "MetadataOf", (), [ - 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, - 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, - 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, - 247u8, 133u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } - #[doc = " The current members of the collective."] - pub fn members( + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] + #[doc = ""] + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of( &self, - _0: types::members::Param0, + _0: types::metadata_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::members::Param0, + types::metadata_of::Param0, >, - types::members::Members, + types::metadata_of::MetadataOf, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Members", + "TechReferenda", + "MetadataOf", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, - 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, - 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, - 247u8, 133u8, - ], - ) - } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::id_to_index::IdToIndex, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", - (), - [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index_iter1( + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] + pub fn submission_deposit( &self, - _0: types::id_to_index::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param0, - >, - types::id_to_index::IdToIndex, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "SubmissionDeposit", [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index( + #[doc = " Maximum size of the referendum queue for a single track."] + pub fn max_queued( &self, - _0: types::id_to_index::Param0, - _1: types::id_to_index::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param1, - >, - ), - types::id_to_index::IdToIndex, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "MaxQueued", [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id_iter( + #[doc = " The number of blocks after submission that a referendum must begin being decided by."] + #[doc = " Once this passes, then anyone may cancel the referendum."] + pub fn undeciding_timeout( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::index_to_id::IndexToId, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "UndecidingTimeout", [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id_iter1( + #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] + #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] + #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] + pub fn alarm_interval( &self, - _0: types::index_to_id::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param0, - >, - types::index_to_id::IndexToId, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "AlarmInterval", [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id( + #[doc = " A list of tracks."] + #[doc = ""] + #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] + pub fn tracks( &self, - _0: types::index_to_id::Param0, - _1: types::index_to_id::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param1, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u16, + runtime_types::pallet_referenda::types::TrackDetails< + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::subxt_core::alloc::string::String, >, - ), - types::index_to_id::IndexToId, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, - ], - ) - } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::voting::Voting, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + )>, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "Tracks", [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, + 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, + 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, + 159u8, ], ) } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter1( - &self, - _0: types::voting::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param0, - >, - types::voting::Voting, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + } + } + } + pub mod treasury_pallet { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_treasury::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_treasury::pallet::Call; + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set the treasury account. Root only. Zero address is rejected (funds would be locked)."] + #[doc = ""] + #[doc = "**Important**: This only changes where *future* mining rewards are sent. Any balance"] + #[doc = "that has already accumulated in the current treasury account is NOT automatically"] + #[doc = "migrated to the new account. If you need to move existing funds, perform a separate"] + #[doc = "balance transfer (e.g., via governance proposal) after updating the account."] + pub struct SetTreasuryAccount { + pub account: set_treasury_account::Account, + } + pub mod set_treasury_account { + use super::runtime_types; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTreasuryAccount { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "set_treasury_account"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set the treasury portion (Permill, 0–100%). Root only."] + pub struct SetTreasuryPortion { + pub portion: set_treasury_portion::Portion, + } + pub mod set_treasury_portion { + use super::runtime_types; + pub type Portion = runtime_types::sp_arithmetic::per_things::Permill; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTreasuryPortion { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "set_treasury_portion"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the treasury account. Root only. Zero address is rejected (funds would be locked)."] + #[doc = ""] + #[doc = "**Important**: This only changes where *future* mining rewards are sent. Any balance"] + #[doc = "that has already accumulated in the current treasury account is NOT automatically"] + #[doc = "migrated to the new account. If you need to move existing funds, perform a separate"] + #[doc = "balance transfer (e.g., via governance proposal) after updating the account."] + pub fn set_treasury_account( + &self, + account: types::set_treasury_account::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TreasuryPallet", + "set_treasury_account", + types::SetTreasuryAccount { account }, [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 221u8, 22u8, 186u8, 39u8, 76u8, 65u8, 143u8, 149u8, 126u8, 244u8, + 227u8, 129u8, 16u8, 183u8, 56u8, 248u8, 82u8, 131u8, 255u8, 246u8, + 243u8, 145u8, 255u8, 5u8, 125u8, 142u8, 201u8, 38u8, 185u8, 124u8, + 76u8, 167u8, ], ) } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting( + #[doc = "Set the treasury portion (Permill, 0–100%). Root only."] + pub fn set_treasury_portion( &self, - _0: types::voting::Param0, - _1: types::voting::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param1, - >, - ), - types::voting::Voting, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + portion: types::set_treasury_portion::Portion, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TreasuryPallet", + "set_treasury_portion", + types::SetTreasuryPortion { portion }, [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 226u8, 74u8, 96u8, 96u8, 120u8, 14u8, 29u8, 33u8, 85u8, 192u8, 26u8, + 67u8, 86u8, 203u8, 21u8, 96u8, 127u8, 87u8, 217u8, 185u8, 8u8, 68u8, + 126u8, 227u8, 38u8, 172u8, 9u8, 97u8, 172u8, 27u8, 17u8, 199u8, ], ) } - pub fn voting_cleanup_iter( + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_treasury::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The treasury account was updated."] + #[doc = ""] + #[doc = "Note: This only redirects where future mining rewards are sent. Any balance"] + #[doc = "accumulated in the old account remains there and is NOT automatically migrated."] + #[doc = "Use a separate balance transfer if funds need to be moved."] + pub struct TreasuryAccountUpdated { + pub old_account: treasury_account_updated::OldAccount, + pub new_account: treasury_account_updated::NewAccount, + } + pub mod treasury_account_updated { + use super::runtime_types; + pub type OldAccount = + ::core::option::Option<::subxt::ext::subxt_core::utils::AccountId32>; + pub type NewAccount = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TreasuryAccountUpdated { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "TreasuryAccountUpdated"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The treasury portion (share of mining rewards) was updated."] + pub struct TreasuryPortionUpdated { + pub new_portion: treasury_portion_updated::NewPortion, + } + pub mod treasury_portion_updated { + use super::runtime_types; + pub type NewPortion = runtime_types::sp_arithmetic::per_things::Permill; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TreasuryPortionUpdated { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "TreasuryPortionUpdated"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod treasury_account { + use super::runtime_types; + pub type TreasuryAccount = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod treasury_portion { + use super::runtime_types; + pub type TreasuryPortion = runtime_types::sp_arithmetic::per_things::Permill; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The treasury account that receives mining rewards."] + pub fn treasury_account( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::voting_cleanup::VotingCleanup, + types::treasury_account::TreasuryAccount, + ::subxt::ext::subxt_core::utils::Yes, (), (), - ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "VotingCleanup", + "TreasuryPallet", + "TreasuryAccount", (), [ - 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, - 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, - 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + 25u8, 40u8, 39u8, 114u8, 80u8, 247u8, 49u8, 5u8, 9u8, 118u8, 249u8, + 36u8, 77u8, 73u8, 229u8, 167u8, 107u8, 254u8, 175u8, 199u8, 203u8, + 238u8, 166u8, 158u8, 155u8, 209u8, 155u8, 219u8, 191u8, 204u8, 237u8, + 227u8, ], ) } - pub fn voting_cleanup( + #[doc = " The portion of mining rewards that goes to treasury (Permill, 0–100%)."] + #[doc = " Uses OptionQuery so genesis is required. Permill allows fine granularity (e.g. 33.3%)."] + pub fn treasury_portion( &self, - _0: types::voting_cleanup::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_cleanup::Param0, - >, - types::voting_cleanup::VotingCleanup, + (), + types::treasury_portion::TreasuryPortion, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "VotingCleanup", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "TreasuryPallet", + "TreasuryPortion", + (), [ - 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, - 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, - 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + 27u8, 148u8, 61u8, 76u8, 110u8, 174u8, 202u8, 184u8, 62u8, 134u8, + 238u8, 169u8, 40u8, 112u8, 83u8, 192u8, 156u8, 67u8, 1u8, 145u8, 11u8, + 88u8, 249u8, 1u8, 37u8, 163u8, 238u8, 131u8, 242u8, 232u8, 20u8, 195u8, ], ) } } } } - pub mod tech_referenda { + pub mod recovery { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_referenda::pallet::Error; + pub type Error = runtime_types::pallet_recovery::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_referenda::pallet::Call; + pub type Call = runtime_types::pallet_recovery::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -12384,36 +11216,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = "Send a call through a recovered account."] #[doc = ""] - #[doc = "Emits `Submitted`."] - pub struct Submit { - pub proposal_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub proposal: submit::Proposal, - pub enactment_moment: submit::EnactmentMoment, + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] + #[doc = "- `call`: The call you want to make with the recovered account."] + pub struct AsRecovered { + pub account: as_recovered::Account, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod submit { + pub mod as_recovered { use super::runtime_types; - pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), >; - pub type EnactmentMoment = - runtime_types::frame_support::traits::schedule::DispatchTime< - ::core::primitive::u32, - >; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "submit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "as_recovered"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12426,24 +11251,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Post the Decision Deposit for a referendum."] + #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] + #[doc = "The dispatch origin for this call must be _ROOT_."] #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub struct PlaceDecisionDeposit { - pub index: place_decision_deposit::Index, + #[doc = "Parameters:"] + #[doc = "- `lost`: The \"lost account\" to be recovered."] + #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] + pub struct SetRecovered { + pub lost: set_recovered::Lost, + pub rescuer: set_recovered::Rescuer, } - pub mod place_decision_deposit { + pub mod set_recovered { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "place_decision_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "set_recovered"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12456,23 +11289,38 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] + #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] + #[doc = "in full when the user calls `remove_recovery`."] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub struct RefundDecisionDeposit { - pub index: refund_decision_deposit::Index, + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] + #[doc = " ordered and contain no duplicate values."] + #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] + #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] + #[doc = " friends."] + #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] + #[doc = " needs to pass before the account can be recovered."] + pub struct CreateRecovery { + pub friends: create_recovery::Friends, + pub threshold: create_recovery::Threshold, + pub delay_period: create_recovery::DelayPeriod, } - pub mod refund_decision_deposit { + pub mod create_recovery { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Friends = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Threshold = ::core::primitive::u16; + pub type DelayPeriod = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "refund_decision_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "create_recovery"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12485,22 +11333,30 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel an ongoing referendum."] + #[doc = "Initiate the process for recovering a recoverable account."] #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] + #[doc = "recovery process. This deposit will always be repatriated to the account"] + #[doc = "trying to be recovered. See `close_recovery`."] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub struct Cancel { - pub index: cancel::Index, + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] + #[doc = " recoverable (i.e. have a recovery configuration)."] + pub struct InitiateRecovery { + pub account: initiate_recovery::Account, } - pub mod cancel { + pub mod initiate_recovery { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "cancel"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for InitiateRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "initiate_recovery"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12513,22 +11369,36 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] + #[doc = "process for that account."] #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable account."] #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub struct Kill { - pub index: kill::Index, + #[doc = "Parameters:"] + #[doc = "- `lost`: The lost account that you want to recover."] + #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = ""] + #[doc = "The combination of these two parameters must point to an active recovery"] + #[doc = "process."] + pub struct VouchRecovery { + pub lost: vouch_recovery::Lost, + pub rescuer: vouch_recovery::Rescuer, } - pub mod kill { + pub mod vouch_recovery { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "kill"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VouchRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "vouch_recovery"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12541,20 +11411,28 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = "Allow a successful rescuer to claim their recovered account."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub struct NudgeReferendum { - pub index: nudge_referendum::Index, + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] + #[doc = "who has successfully completed the account recovery process: collected"] + #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] + #[doc = " you."] + pub struct ClaimRecovery { + pub account: claim_recovery::Account, } - pub mod nudge_referendum { + pub mod claim_recovery { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "nudge_referendum"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "claim_recovery"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12567,25 +11445,30 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = "As the controller of a recoverable account, close an active recovery"] + #[doc = "process for your account."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] + #[doc = "Payment: By calling this function, the recoverable account will receive"] + #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub struct OneFewerDeciding { - pub track: one_fewer_deciding::Track, + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account with an active recovery process for it."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] + pub struct CloseRecovery { + pub rescuer: close_recovery::Rescuer, } - pub mod one_fewer_deciding { + pub mod close_recovery { use super::runtime_types; - pub type Track = ::core::primitive::u16; + pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "one_fewer_deciding"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CloseRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "close_recovery"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12598,23 +11481,53 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] + #[doc = "recovery attempts before calling this function else it will fail."] #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub struct RefundSubmissionDeposit { - pub index: refund_submission_deposit::Index, + #[doc = "Payment: By calling this function the recoverable account will unreserve"] + #[doc = "their recovery configuration deposit."] + #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account (i.e. has a recovery configuration)."] + pub struct RemoveRecovery; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "remove_recovery"; } - pub mod refund_submission_deposit { + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] + pub struct CancelRecovered { + pub account: cancel_recovered::Account, + } + pub mod cancel_recovered { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "refund_submission_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "cancel_recovered"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12627,253 +11540,336 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Set or clear metadata of a referendum."] + #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + #[doc = ""] + #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] #[doc = ""] #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub struct SetMetadata { - pub index: set_metadata::Index, - pub maybe_hash: set_metadata::MaybeHash, + #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] + #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = ""] + #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] + #[doc = "of the caller:"] + #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] + #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] + #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = ""] + #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] + #[doc = "account."] + #[doc = ""] + #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if any deposit is updated."] + #[doc = "Multiple events may be emitted in case both types of deposits are updated."] + pub struct PokeDeposit { + pub maybe_account: poke_deposit::MaybeAccount, } - pub mod set_metadata { + pub mod poke_deposit { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeHash = - ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; + pub type MaybeAccount = ::core::option::Option< + ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "set_metadata"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "poke_deposit"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Propose a referendum on a privileged action."] + #[doc = "Send a call through a recovered account."] #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] #[doc = ""] - #[doc = "Emits `Submitted`."] - pub fn submit( + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] + #[doc = "- `call`: The call you want to make with the recovered account."] + pub fn as_recovered( &self, - proposal_origin: types::submit::ProposalOrigin, - proposal: types::submit::Proposal, - enactment_moment: types::submit::EnactmentMoment, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + account: types::as_recovered::Account, + call: types::as_recovered::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "submit", - types::Submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - proposal_origin, - ), - proposal, - enactment_moment, + "Recovery", + "as_recovered", + types::AsRecovered { + account, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 0u8, 18u8, 14u8, 253u8, 33u8, 212u8, 33u8, 173u8, 241u8, 29u8, 88u8, - 160u8, 111u8, 21u8, 6u8, 234u8, 249u8, 230u8, 222u8, 119u8, 161u8, - 114u8, 43u8, 126u8, 164u8, 140u8, 199u8, 39u8, 2u8, 64u8, 132u8, 34u8, + 83u8, 241u8, 200u8, 95u8, 176u8, 73u8, 86u8, 254u8, 102u8, 49u8, 113u8, + 102u8, 55u8, 250u8, 115u8, 98u8, 254u8, 96u8, 27u8, 19u8, 132u8, 79u8, + 207u8, 104u8, 114u8, 167u8, 142u8, 208u8, 170u8, 125u8, 198u8, 136u8, ], ) } - #[doc = "Post the Decision Deposit for a referendum."] + #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] + #[doc = "The dispatch origin for this call must be _ROOT_."] #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub fn place_decision_deposit( + #[doc = "Parameters:"] + #[doc = "- `lost`: The \"lost account\" to be recovered."] + #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] + pub fn set_recovered( &self, - index: types::place_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + lost: types::set_recovered::Lost, + rescuer: types::set_recovered::Rescuer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "place_decision_deposit", - types::PlaceDecisionDeposit { index }, + "Recovery", + "set_recovered", + types::SetRecovered { lost, rescuer }, [ - 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, - 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, - 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, + 194u8, 147u8, 14u8, 197u8, 132u8, 185u8, 122u8, 81u8, 61u8, 14u8, 10u8, + 177u8, 74u8, 184u8, 150u8, 217u8, 246u8, 149u8, 26u8, 165u8, 196u8, + 83u8, 230u8, 195u8, 213u8, 40u8, 51u8, 180u8, 23u8, 90u8, 3u8, 14u8, ], ) } - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] + #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] + #[doc = "in full when the user calls `remove_recovery`."] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub fn refund_decision_deposit( + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] + #[doc = " ordered and contain no duplicate values."] + #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] + #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] + #[doc = " friends."] + #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] + #[doc = " needs to pass before the account can be recovered."] + pub fn create_recovery( &self, - index: types::refund_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundDecisionDeposit, - > { + friends: types::create_recovery::Friends, + threshold: types::create_recovery::Threshold, + delay_period: types::create_recovery::DelayPeriod, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "refund_decision_deposit", - types::RefundDecisionDeposit { index }, + "Recovery", + "create_recovery", + types::CreateRecovery { friends, threshold, delay_period }, [ - 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, - 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, - 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, + 36u8, 175u8, 11u8, 85u8, 95u8, 170u8, 58u8, 193u8, 102u8, 18u8, 117u8, + 27u8, 199u8, 214u8, 70u8, 47u8, 129u8, 130u8, 109u8, 242u8, 240u8, + 255u8, 120u8, 176u8, 40u8, 243u8, 175u8, 71u8, 3u8, 91u8, 186u8, 220u8, ], ) } - #[doc = "Cancel an ongoing referendum."] + #[doc = "Initiate the process for recovering a recoverable account."] #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] + #[doc = "recovery process. This deposit will always be repatriated to the account"] + #[doc = "trying to be recovered. See `close_recovery`."] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub fn cancel( + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] + #[doc = " recoverable (i.e. have a recovery configuration)."] + pub fn initiate_recovery( &self, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + account: types::initiate_recovery::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "cancel", - types::Cancel { index }, + "Recovery", + "initiate_recovery", + types::InitiateRecovery { account }, [ - 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, - 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, - 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, - 122u8, + 60u8, 243u8, 229u8, 176u8, 221u8, 52u8, 44u8, 224u8, 233u8, 14u8, 89u8, + 100u8, 174u8, 74u8, 38u8, 32u8, 97u8, 48u8, 53u8, 74u8, 30u8, 242u8, + 19u8, 114u8, 145u8, 74u8, 69u8, 125u8, 227u8, 214u8, 144u8, 58u8, ], ) } - #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] + #[doc = "process for that account."] #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable account."] #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub fn kill( + #[doc = "Parameters:"] + #[doc = "- `lost`: The lost account that you want to recover."] + #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = ""] + #[doc = "The combination of these two parameters must point to an active recovery"] + #[doc = "process."] + pub fn vouch_recovery( &self, - index: types::kill::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + lost: types::vouch_recovery::Lost, + rescuer: types::vouch_recovery::Rescuer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "kill", - types::Kill { index }, + "Recovery", + "vouch_recovery", + types::VouchRecovery { lost, rescuer }, [ - 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, - 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, - 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, - 48u8, + 97u8, 190u8, 60u8, 15u8, 191u8, 117u8, 1u8, 217u8, 62u8, 40u8, 210u8, + 1u8, 237u8, 111u8, 48u8, 196u8, 180u8, 154u8, 198u8, 12u8, 108u8, 42u8, + 6u8, 234u8, 2u8, 113u8, 163u8, 111u8, 80u8, 146u8, 6u8, 73u8, ], ) } - #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = "Allow a successful rescuer to claim their recovered account."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub fn nudge_referendum( + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] + #[doc = "who has successfully completed the account recovery process: collected"] + #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] + #[doc = " you."] + pub fn claim_recovery( &self, - index: types::nudge_referendum::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + account: types::claim_recovery::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "nudge_referendum", - types::NudgeReferendum { index }, + "Recovery", + "claim_recovery", + types::ClaimRecovery { account }, [ - 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, - 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, - 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, - 213u8, + 41u8, 47u8, 162u8, 88u8, 13u8, 166u8, 130u8, 146u8, 218u8, 162u8, + 166u8, 33u8, 89u8, 129u8, 177u8, 178u8, 68u8, 128u8, 161u8, 229u8, + 207u8, 3u8, 57u8, 35u8, 211u8, 208u8, 74u8, 155u8, 183u8, 173u8, 74u8, + 56u8, ], ) } - #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = "As the controller of a recoverable account, close an active recovery"] + #[doc = "process for your account."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] + #[doc = "Payment: By calling this function, the recoverable account will receive"] + #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub fn one_fewer_deciding( + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account with an active recovery process for it."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] + pub fn close_recovery( &self, - track: types::one_fewer_deciding::Track, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + rescuer: types::close_recovery::Rescuer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "one_fewer_deciding", - types::OneFewerDeciding { track }, + "Recovery", + "close_recovery", + types::CloseRecovery { rescuer }, [ - 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, - 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, - 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, - 131u8, 167u8, + 161u8, 178u8, 117u8, 209u8, 119u8, 164u8, 135u8, 41u8, 25u8, 108u8, + 194u8, 175u8, 221u8, 65u8, 184u8, 137u8, 171u8, 97u8, 204u8, 61u8, + 159u8, 39u8, 192u8, 53u8, 246u8, 69u8, 113u8, 16u8, 170u8, 232u8, + 163u8, 10u8, ], ) } - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] + #[doc = "recovery attempts before calling this function else it will fail."] #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub fn refund_submission_deposit( + #[doc = "Payment: By calling this function the recoverable account will unreserve"] + #[doc = "their recovery configuration deposit."] + #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account (i.e. has a recovery configuration)."] + pub fn remove_recovery( &self, - index: types::refund_submission_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundSubmissionDeposit, - > { + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "refund_submission_deposit", - types::RefundSubmissionDeposit { index }, + "Recovery", + "remove_recovery", + types::RemoveRecovery {}, [ - 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, - 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, - 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, + 11u8, 38u8, 133u8, 172u8, 212u8, 252u8, 57u8, 216u8, 42u8, 202u8, + 206u8, 91u8, 115u8, 91u8, 242u8, 123u8, 95u8, 196u8, 172u8, 243u8, + 164u8, 1u8, 69u8, 180u8, 40u8, 68u8, 208u8, 221u8, 161u8, 250u8, 8u8, + 72u8, ], ) } - #[doc = "Set or clear metadata of a referendum."] + #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] #[doc = ""] #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub fn set_metadata( + #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] + pub fn cancel_recovered( &self, - index: types::set_metadata::Index, - maybe_hash: types::set_metadata::MaybeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + account: types::cancel_recovered::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "set_metadata", - types::SetMetadata { index, maybe_hash }, + "Recovery", + "cancel_recovered", + types::CancelRecovered { account }, [ - 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, - 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, - 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, - 88u8, + 100u8, 222u8, 80u8, 226u8, 187u8, 188u8, 111u8, 58u8, 190u8, 5u8, + 178u8, 144u8, 37u8, 98u8, 71u8, 145u8, 28u8, 248u8, 222u8, 188u8, 53u8, + 21u8, 127u8, 176u8, 249u8, 166u8, 250u8, 59u8, 170u8, 33u8, 251u8, + 239u8, + ], + ) + } + #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + #[doc = ""] + #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] + #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = ""] + #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] + #[doc = "of the caller:"] + #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] + #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] + #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = ""] + #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] + #[doc = "account."] + #[doc = ""] + #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if any deposit is updated."] + #[doc = "Multiple events may be emitted in case both types of deposits are updated."] + pub fn poke_deposit( + &self, + maybe_account: types::poke_deposit::MaybeAccount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "poke_deposit", + types::PokeDeposit { maybe_account }, + [ + 177u8, 98u8, 53u8, 15u8, 228u8, 36u8, 173u8, 55u8, 125u8, 3u8, 234u8, + 70u8, 147u8, 147u8, 124u8, 86u8, 31u8, 101u8, 171u8, 56u8, 148u8, + 180u8, 87u8, 149u8, 11u8, 113u8, 195u8, 35u8, 56u8, 32u8, 251u8, 56u8, ], ) } } } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_referenda::pallet::Event2; + #[doc = "Events type."] + pub type Event = runtime_types::pallet_recovery::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -12883,24 +11879,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been submitted."] - pub struct Submitted { - pub index: submitted::Index, - pub track: submitted::Track, - pub proposal: submitted::Proposal, + #[doc = "A recovery process has been set up for an account."] + pub struct RecoveryCreated { + pub account: recovery_created::Account, } - pub mod submitted { + pub mod recovery_created { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Submitted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryCreated { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryCreated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12909,21 +11898,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been placed."] - pub struct DecisionDepositPlaced { - pub index: decision_deposit_placed::Index, - pub who: decision_deposit_placed::Who, - pub amount: decision_deposit_placed::Amount, + #[doc = "A recovery process has been initiated for lost account by rescuer account."] + pub struct RecoveryInitiated { + pub lost_account: recovery_initiated::LostAccount, + pub rescuer_account: recovery_initiated::RescuerAccount, } - pub mod decision_deposit_placed { + pub mod recovery_initiated { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionDepositPlaced"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryInitiated { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryInitiated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12932,21 +11919,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been refunded."] - pub struct DecisionDepositRefunded { - pub index: decision_deposit_refunded::Index, - pub who: decision_deposit_refunded::Who, - pub amount: decision_deposit_refunded::Amount, + #[doc = "A recovery process for lost account by rescuer account has been vouched for by sender."] + pub struct RecoveryVouched { + pub lost_account: recovery_vouched::LostAccount, + pub rescuer_account: recovery_vouched::RescuerAccount, + pub sender: recovery_vouched::Sender, } - pub mod decision_deposit_refunded { + pub mod recovery_vouched { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Sender = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionDepositRefunded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryVouched { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryVouched"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12955,165 +11942,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A deposit has been slashed."] - pub struct DepositSlashed { - pub who: deposit_slashed::Who, - pub amount: deposit_slashed::Amount, - } - pub mod deposit_slashed { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DepositSlashed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has moved into the deciding phase."] - pub struct DecisionStarted { - pub index: decision_started::Index, - pub track: decision_started::Track, - pub proposal: decision_started::Proposal, - pub tally: decision_started::Tally, - } - pub mod decision_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmStarted { - pub index: confirm_started::Index, - } - pub mod confirm_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "ConfirmStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmAborted { - pub index: confirm_aborted::Index, - } - pub mod confirm_aborted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "ConfirmAborted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has ended its confirmation phase and is ready for approval."] - pub struct Confirmed { - pub index: confirmed::Index, - pub tally: confirmed::Tally, - } - pub mod confirmed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Confirmed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been approved and its proposal has been scheduled."] - pub struct Approved { - pub index: approved::Index, - } - pub mod approved { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Approved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A proposal has been rejected by referendum."] - pub struct Rejected { - pub index: rejected::Index, - pub tally: rejected::Tally, - } - pub mod rejected { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Rejected"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been timed out without being decided."] - pub struct TimedOut { - pub index: timed_out::Index, - pub tally: timed_out::Tally, + #[doc = "A recovery process for lost account by rescuer account has been closed."] + pub struct RecoveryClosed { + pub lost_account: recovery_closed::LostAccount, + pub rescuer_account: recovery_closed::RescuerAccount, } - pub mod timed_out { + pub mod recovery_closed { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "TimedOut"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryClosed { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryClosed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13122,19 +11963,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been cancelled."] - pub struct Cancelled { - pub index: cancelled::Index, - pub tally: cancelled::Tally, + #[doc = "Lost account has been successfully recovered by rescuer account."] + pub struct AccountRecovered { + pub lost_account: account_recovered::LostAccount, + pub rescuer_account: account_recovered::RescuerAccount, } - pub mod cancelled { + pub mod account_recovered { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Cancelled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for AccountRecovered { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "AccountRecovered"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13143,19 +11984,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been killed."] - pub struct Killed { - pub index: killed::Index, - pub tally: killed::Tally, + #[doc = "A recovery process has been removed for an account."] + pub struct RecoveryRemoved { + pub lost_account: recovery_removed::LostAccount, } - pub mod killed { + pub mod recovery_removed { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Killed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryRemoved { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryRemoved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13164,340 +12003,243 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The submission deposit has been refunded."] - pub struct SubmissionDepositRefunded { - pub index: submission_deposit_refunded::Index, - pub who: submission_deposit_refunded::Who, - pub amount: submission_deposit_refunded::Amount, + #[doc = "A deposit has been updated."] + pub struct DepositPoked { + pub who: deposit_poked::Who, + pub kind: deposit_poked::Kind, + pub old_deposit: deposit_poked::OldDeposit, + pub new_deposit: deposit_poked::NewDeposit, } - pub mod submission_deposit_refunded { + pub mod deposit_poked { use super::runtime_types; - pub type Index = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "SubmissionDepositRefunded"; + pub type Kind = runtime_types::pallet_recovery::DepositKind< + runtime_types::quantus_runtime::Runtime, + >; + pub type OldDeposit = ::core::primitive::u128; + pub type NewDeposit = ::core::primitive::u128; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been set."] - pub struct MetadataSet { - pub index: metadata_set::Index, - pub hash: metadata_set::Hash, + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "DepositPoked"; } - pub mod metadata_set { + } + pub mod storage { + use super::runtime_types; + pub mod types { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "MetadataSet"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been cleared."] - pub struct MetadataCleared { - pub index: metadata_cleared::Index, - pub hash: metadata_cleared::Hash, - } - pub mod metadata_cleared { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "MetadataCleared"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod referendum_count { - use super::runtime_types; - pub type ReferendumCount = ::core::primitive::u32; - } - pub mod referendum_info_for { + pub mod recoverable { use super::runtime_types; - pub type ReferendumInfoFor = - runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::quantus_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - ::core::primitive::u128, - runtime_types::pallet_ranked_collective::Tally, + pub type Recoverable = runtime_types::pallet_recovery::RecoveryConfig< + ::core::primitive::u32, + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< ::subxt::ext::subxt_core::utils::AccountId32, - ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ), - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod track_queue { - use super::runtime_types; - pub type TrackQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u32, - )>; - pub type Param0 = ::core::primitive::u16; + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod deciding_count { + pub mod active_recoveries { use super::runtime_types; - pub type DecidingCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; + pub type ActiveRecoveries = runtime_types::pallet_recovery::ActiveRecovery< + ::core::primitive::u32, + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod metadata_of { + pub mod proxy { use super::runtime_types; - pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = ::core::primitive::u32; + pub type Proxy = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } } pub struct StorageApi; impl StorageApi { - #[doc = " The next free referendum index, aka the number of referenda started so far."] - pub fn referendum_count( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::referendum_count::ReferendumCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "ReferendumCount", - (), - [ - 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, - 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, - 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, - 67u8, - ], - ) - } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for_iter( + #[doc = " The set of recoverable accounts and their recovery configuration."] + pub fn recoverable_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::referendum_info_for::ReferendumInfoFor, + types::recoverable::Recoverable, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "ReferendumInfoFor", + "Recovery", + "Recoverable", (), [ - 242u8, 125u8, 226u8, 99u8, 67u8, 226u8, 43u8, 159u8, 222u8, 238u8, - 72u8, 38u8, 45u8, 26u8, 95u8, 64u8, 141u8, 140u8, 37u8, 44u8, 101u8, - 67u8, 46u8, 66u8, 45u8, 93u8, 41u8, 156u8, 63u8, 59u8, 9u8, 29u8, + 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, + 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, + 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, ], ) } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for( + #[doc = " The set of recoverable accounts and their recovery configuration."] + pub fn recoverable( &self, - _0: types::referendum_info_for::Param0, + _0: types::recoverable::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::referendum_info_for::Param0, + types::recoverable::Param0, >, - types::referendum_info_for::ReferendumInfoFor, + types::recoverable::Recoverable, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "ReferendumInfoFor", + "Recovery", + "Recoverable", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 242u8, 125u8, 226u8, 99u8, 67u8, 226u8, 43u8, 159u8, 222u8, 238u8, - 72u8, 38u8, 45u8, 26u8, 95u8, 64u8, 141u8, 140u8, 37u8, 44u8, 101u8, - 67u8, 46u8, 66u8, 45u8, 93u8, 41u8, 156u8, 63u8, 59u8, 9u8, 29u8, + 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, + 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, + 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, ], ) } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] + #[doc = " Active recovery attempts."] #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue_iter( + #[doc = " First account is the account to be recovered, and the second account"] + #[doc = " is the user trying to recover the account."] + pub fn active_recoveries_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::track_queue::TrackQueue, + types::active_recoveries::ActiveRecoveries, + (), (), - ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "TrackQueue", + "Recovery", + "ActiveRecoveries", (), [ - 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, - 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, - 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, - 186u8, 65u8, + 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, + 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, + 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, + 91u8, 123u8, ], ) } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] + #[doc = " Active recovery attempts."] #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue( + #[doc = " First account is the account to be recovered, and the second account"] + #[doc = " is the user trying to recover the account."] + pub fn active_recoveries_iter1( &self, - _0: types::track_queue::Param0, + _0: types::active_recoveries::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::track_queue::Param0, + types::active_recoveries::Param0, >, - types::track_queue::TrackQueue, + types::active_recoveries::ActiveRecoveries, + (), + (), ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Recovery", + "ActiveRecoveries", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, + 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, + 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, + 91u8, 123u8, + ], + ) + } + #[doc = " Active recovery attempts."] + #[doc = ""] + #[doc = " First account is the account to be recovered, and the second account"] + #[doc = " is the user trying to recover the account."] + pub fn active_recoveries( + &self, + _0: types::active_recoveries::Param0, + _1: types::active_recoveries::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::active_recoveries::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::active_recoveries::Param1, + >, + ), + types::active_recoveries::ActiveRecoveries, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "TrackQueue", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "Recovery", + "ActiveRecoveries", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, - 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, - 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, - 186u8, 65u8, + 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, + 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, + 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, + 91u8, 123u8, ], ) } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count_iter( + #[doc = " The list of allowed proxy accounts."] + #[doc = ""] + #[doc = " Map from the user who can access it to the recovered account."] + pub fn proxy_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::deciding_count::DecidingCount, + types::proxy::Proxy, + (), (), - ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "DecidingCount", + "Recovery", + "Proxy", (), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, + 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, + 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, ], ) } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count( + #[doc = " The list of allowed proxy accounts."] + #[doc = ""] + #[doc = " Map from the user who can access it to the recovered account."] + pub fn proxy( &self, - _0: types::deciding_count::Param0, + _0: types::proxy::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::deciding_count::Param0, + types::proxy::Param0, >, - types::deciding_count::DecidingCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "DecidingCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, - ], - ) - } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::metadata_of::MetadataOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "MetadataOf", - (), - [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, - ], - ) - } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of( - &self, - _0: types::metadata_of::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata_of::Param0, - >, - types::metadata_of::MetadataOf, + types::proxy::Proxy, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "MetadataOf", + "Recovery", + "Proxy", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, + 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, + 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, ], ) } @@ -13507,15 +12249,18 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] - pub fn submission_deposit( + #[doc = " The base amount of currency needed to reserve for creating a recovery configuration."] + #[doc = ""] + #[doc = " This is held for an additional storage item whose value size is"] + #[doc = " `2 + sizeof(BlockNumber, Balance)` bytes."] + pub fn config_deposit_base( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "SubmissionDeposit", + "Recovery", + "ConfigDepositBase", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -13523,52 +12268,40 @@ pub mod api { ], ) } - #[doc = " Maximum size of the referendum queue for a single track."] - pub fn max_queued( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "MaxQueued", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The number of blocks after submission that a referendum must begin being decided by."] - #[doc = " Once this passes, then anyone may cancel the referendum."] - pub fn undeciding_timeout( + #[doc = " The amount of currency needed per additional user when creating a recovery"] + #[doc = " configuration."] + #[doc = ""] + #[doc = " This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage"] + #[doc = " value."] + pub fn friend_deposit_factor( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "UndecidingTimeout", + "Recovery", + "FriendDepositFactor", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } - #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] - #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] - #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] - pub fn alarm_interval( + #[doc = " The maximum amount of friends allowed in a recovery configuration."] + #[doc = ""] + #[doc = " NOTE: The threshold programmed in this Pallet uses u16, so it does"] + #[doc = " not really make sense to have a limit here greater than u16::MAX."] + #[doc = " But also, that is a lot more than you should probably set this value"] + #[doc = " to anyway..."] + pub fn max_friends( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "AlarmInterval", + "Recovery", + "MaxFriends", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -13577,41 +12310,37 @@ pub mod api { ], ) } - #[doc = " A list of tracks."] + #[doc = " The base amount of currency needed to reserve for starting a recovery."] #[doc = ""] - #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] - pub fn tracks( + #[doc = " This is primarily held for deterring malicious recovery attempts, and should"] + #[doc = " have a value large enough that a bad actor would choose not to place this"] + #[doc = " deposit. It also acts to fund additional storage item whose value size is"] + #[doc = " `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable"] + #[doc = " threshold."] + pub fn recovery_deposit( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u16, - runtime_types::pallet_referenda::types::TrackDetails< - ::core::primitive::u128, - ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::string::String, - >, - )>, + ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "Tracks", + "Recovery", + "RecoveryDeposit", [ - 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, - 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, - 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, - 159u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } } } } - pub mod treasury_pallet { + pub mod assets { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_treasury::pallet::Error; + pub type Error = runtime_types::pallet_assets::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_treasury::pallet::Call; + pub type Call = runtime_types::pallet_assets::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -13628,22 +12357,43 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Set the treasury account. Root only. Zero address is rejected (funds would be locked)."] + #[doc = "Issue a new class of fungible assets from a public origin."] #[doc = ""] - #[doc = "**Important**: This only changes where *future* mining rewards are sent. Any balance"] - #[doc = "that has already accumulated in the current treasury account is NOT automatically"] - #[doc = "migrated to the new account. If you need to move existing funds, perform a separate"] - #[doc = "balance transfer (e.g., via governance proposal) after updating the account."] - pub struct SetTreasuryAccount { - pub account: set_treasury_account::Account, + #[doc = "This new asset class has no assets initially and its owner is the origin."] + #[doc = ""] + #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] + #[doc = ""] + #[doc = "Funds of sender are reserved by `AssetDeposit`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] + #[doc = "member of the asset class's admin team."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `Created` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct Create { + #[codec(compact)] + pub id: create::Id, + pub admin: create::Admin, + pub min_balance: create::MinBalance, } - pub mod set_treasury_account { + pub mod create { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Id = ::core::primitive::u32; + pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type MinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTreasuryAccount { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "set_treasury_account"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Create { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "create"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13656,186 +12406,47 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Set the treasury portion (Permill, 0–100%). Root only."] - pub struct SetTreasuryPortion { - pub portion: set_treasury_portion::Portion, + #[doc = "Issue a new class of fungible assets from a privileged origin."] + #[doc = ""] + #[doc = "This new asset class has no assets initially."] + #[doc = ""] + #[doc = "The origin must conform to `ForceOrigin`."] + #[doc = ""] + #[doc = "Unlike `create`, no funds are reserved."] + #[doc = ""] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] + #[doc = "over this asset, but may later change and configure the permissions using"] + #[doc = "`transfer_ownership` and `set_team`."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `ForceCreated` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceCreate { + #[codec(compact)] + pub id: force_create::Id, + pub owner: force_create::Owner, + pub is_sufficient: force_create::IsSufficient, + #[codec(compact)] + pub min_balance: force_create::MinBalance, } - pub mod set_treasury_portion { + pub mod force_create { use super::runtime_types; - pub type Portion = runtime_types::sp_arithmetic::per_things::Permill; + pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type IsSufficient = ::core::primitive::bool; + pub type MinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTreasuryPortion { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "set_treasury_portion"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Set the treasury account. Root only. Zero address is rejected (funds would be locked)."] - #[doc = ""] - #[doc = "**Important**: This only changes where *future* mining rewards are sent. Any balance"] - #[doc = "that has already accumulated in the current treasury account is NOT automatically"] - #[doc = "migrated to the new account. If you need to move existing funds, perform a separate"] - #[doc = "balance transfer (e.g., via governance proposal) after updating the account."] - pub fn set_treasury_account( - &self, - account: types::set_treasury_account::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "set_treasury_account", - types::SetTreasuryAccount { account }, - [ - 221u8, 22u8, 186u8, 39u8, 76u8, 65u8, 143u8, 149u8, 126u8, 244u8, - 227u8, 129u8, 16u8, 183u8, 56u8, 248u8, 82u8, 131u8, 255u8, 246u8, - 243u8, 145u8, 255u8, 5u8, 125u8, 142u8, 201u8, 38u8, 185u8, 124u8, - 76u8, 167u8, - ], - ) - } - #[doc = "Set the treasury portion (Permill, 0–100%). Root only."] - pub fn set_treasury_portion( - &self, - portion: types::set_treasury_portion::Portion, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "set_treasury_portion", - types::SetTreasuryPortion { portion }, - [ - 226u8, 74u8, 96u8, 96u8, 120u8, 14u8, 29u8, 33u8, 85u8, 192u8, 26u8, - 67u8, 86u8, 203u8, 21u8, 96u8, 127u8, 87u8, 217u8, 185u8, 8u8, 68u8, - 126u8, 227u8, 38u8, 172u8, 9u8, 97u8, 172u8, 27u8, 17u8, 199u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_treasury::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The treasury account was updated."] - #[doc = ""] - #[doc = "Note: This only redirects where future mining rewards are sent. Any balance"] - #[doc = "accumulated in the old account remains there and is NOT automatically migrated."] - #[doc = "Use a separate balance transfer if funds need to be moved."] - pub struct TreasuryAccountUpdated { - pub old_account: treasury_account_updated::OldAccount, - pub new_account: treasury_account_updated::NewAccount, - } - pub mod treasury_account_updated { - use super::runtime_types; - pub type OldAccount = - ::core::option::Option<::subxt::ext::subxt_core::utils::AccountId32>; - pub type NewAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TreasuryAccountUpdated { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "TreasuryAccountUpdated"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The treasury portion (share of mining rewards) was updated."] - pub struct TreasuryPortionUpdated { - pub new_portion: treasury_portion_updated::NewPortion, - } - pub mod treasury_portion_updated { - use super::runtime_types; - pub type NewPortion = runtime_types::sp_arithmetic::per_things::Permill; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TreasuryPortionUpdated { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "TreasuryPortionUpdated"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod treasury_account { - use super::runtime_types; - pub type TreasuryAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod treasury_portion { - use super::runtime_types; - pub type TreasuryPortion = runtime_types::sp_arithmetic::per_things::Permill; - } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " The treasury account that receives mining rewards."] - pub fn treasury_account( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::treasury_account::TreasuryAccount, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "TreasuryAccount", - (), - [ - 25u8, 40u8, 39u8, 114u8, 80u8, 247u8, 49u8, 5u8, 9u8, 118u8, 249u8, - 36u8, 77u8, 73u8, 229u8, 167u8, 107u8, 254u8, 175u8, 199u8, 203u8, - 238u8, 166u8, 158u8, 155u8, 209u8, 155u8, 219u8, 191u8, 204u8, 237u8, - 227u8, - ], - ) - } - #[doc = " The portion of mining rewards that goes to treasury (Permill, 0–100%)."] - #[doc = " Uses OptionQuery so genesis is required. Permill allows fine granularity (e.g. 33.3%)."] - pub fn treasury_portion( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::treasury_portion::TreasuryPortion, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "TreasuryPortion", - (), - [ - 27u8, 148u8, 61u8, 76u8, 110u8, 174u8, 202u8, 184u8, 62u8, 134u8, - 238u8, 169u8, 40u8, 112u8, 83u8, 192u8, 156u8, 67u8, 1u8, 145u8, 11u8, - 88u8, 249u8, 1u8, 37u8, 163u8, 238u8, 131u8, 242u8, 232u8, 20u8, 195u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCreate { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_create"; } - } - } - } - pub mod recovery { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_recovery::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_recovery::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -13847,29 +12458,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a call through a recovered account."] + #[doc = "Start the process of destroying a fungible asset class."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] + #[doc = "destruction of an asset class."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] - #[doc = "- `call`: The call you want to make with the recovered account."] - pub struct AsRecovered { - pub account: as_recovered::Account, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "an account contains holds or freezes in place."] + pub struct StartDestroy { + #[codec(compact)] + pub id: start_destroy::Id, } - pub mod as_recovered { + pub mod start_destroy { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "as_recovered"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for StartDestroy { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "start_destroy"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13882,32 +12493,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] - #[doc = "for a lost account directly."] + #[doc = "Destroy all accounts associated with a given asset."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _ROOT_."] + #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The \"lost account\" to be recovered."] - #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] - pub struct SetRecovered { - pub lost: set_recovered::Lost, - pub rescuer: set_recovered::Rescuer, + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each call emits the `Event::DestroyedAccounts` event."] + pub struct DestroyAccounts { + #[codec(compact)] + pub id: destroy_accounts::Id, } - pub mod set_recovered { + pub mod destroy_accounts { use super::runtime_types; - pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "set_recovered"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyAccounts { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "destroy_accounts"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13920,38 +12528,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] + #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] #[doc = ""] - #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] - #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] - #[doc = "in full when the user calls `remove_recovery`."] + #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] - #[doc = " ordered and contain no duplicate values."] - #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] - #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] - #[doc = " friends."] - #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] - #[doc = " needs to pass before the account can be recovered."] - pub struct CreateRecovery { - pub friends: create_recovery::Friends, - pub threshold: create_recovery::Threshold, - pub delay_period: create_recovery::DelayPeriod, + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each call emits the `Event::DestroyedApprovals` event."] + pub struct DestroyApprovals { + #[codec(compact)] + pub id: destroy_approvals::Id, } - pub mod create_recovery { + pub mod destroy_approvals { use super::runtime_types; - pub type Friends = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Threshold = ::core::primitive::u16; - pub type DelayPeriod = ::core::primitive::u32; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "create_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyApprovals { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "destroy_approvals"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13964,30 +12563,27 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Initiate the process for recovering a recoverable account."] + #[doc = "Complete destroying asset and unreserve currency."] #[doc = ""] - #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] - #[doc = "recovery process. This deposit will always be repatriated to the account"] - #[doc = "trying to be recovered. See `close_recovery`."] + #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] + #[doc = "hand."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] - #[doc = " recoverable (i.e. have a recovery configuration)."] - pub struct InitiateRecovery { - pub account: initiate_recovery::Account, + #[doc = "Each successful call emits the `Event::Destroyed` event."] + pub struct FinishDestroy { + #[codec(compact)] + pub id: finish_destroy::Id, } - pub mod initiate_recovery { + pub mod finish_destroy { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for InitiateRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "initiate_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FinishDestroy { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "finish_destroy"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14000,36 +12596,37 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] - #[doc = "process for that account."] + #[doc = "Mint assets of a particular class."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] - #[doc = "for the recoverable account."] + #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The lost account that you want to recover."] - #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = "- `id`: The identifier of the asset to have some amount minted."] + #[doc = "- `beneficiary`: The account to be credited with the minted assets."] + #[doc = "- `amount`: The amount of the asset to be minted."] #[doc = ""] - #[doc = "The combination of these two parameters must point to an active recovery"] - #[doc = "process."] - pub struct VouchRecovery { - pub lost: vouch_recovery::Lost, - pub rescuer: vouch_recovery::Rescuer, + #[doc = "Emits `Issued` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] + pub struct Mint { + #[codec(compact)] + pub id: mint::Id, + pub beneficiary: mint::Beneficiary, + #[codec(compact)] + pub amount: mint::Amount, } - pub mod vouch_recovery { + pub mod mint { use super::runtime_types; - pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VouchRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "vouch_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Mint { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "mint"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14042,28 +12639,40 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Allow a successful rescuer to claim their recovered account."] + #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] - #[doc = "who has successfully completed the account recovery process: collected"] - #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] + #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] - #[doc = " you."] - pub struct ClaimRecovery { - pub account: claim_recovery::Account, + #[doc = "Bails with `NoAccount` if the `who` is already dead."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount burned."] + #[doc = "- `who`: The account to be debited from."] + #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = ""] + #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] + #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] + pub struct Burn { + #[codec(compact)] + pub id: burn::Id, + pub who: burn::Who, + #[codec(compact)] + pub amount: burn::Amount, } - pub mod claim_recovery { + pub mod burn { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "claim_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Burn { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "burn"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14076,30 +12685,43 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "As the controller of a recoverable account, close an active recovery"] - #[doc = "process for your account."] + #[doc = "Move some assets from the sender account to another."] #[doc = ""] - #[doc = "Payment: By calling this function, the recoverable account will receive"] - #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account with an active recovery process for it."] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] - pub struct CloseRecovery { - pub rescuer: close_recovery::Rescuer, + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub struct Transfer { + #[codec(compact)] + pub id: transfer::Id, + pub target: transfer::Target, + #[codec(compact)] + pub amount: transfer::Amount, } - pub mod close_recovery { + pub mod transfer { use super::runtime_types; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CloseRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "close_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Transfer { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14112,21 +12734,43 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] #[doc = ""] - #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] - #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "Payment: By calling this function the recoverable account will unreserve"] - #[doc = "their recovery configuration deposit."] - #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account (i.e. has a recovery configuration)."] - pub struct RemoveRecovery; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "remove_recovery"; + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub struct TransferKeepAlive { + #[codec(compact)] + pub id: transfer_keep_alive::Id, + pub target: transfer_keep_alive::Target, + #[codec(compact)] + pub amount: transfer_keep_alive::Amount, + } + pub mod transfer_keep_alive { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer_keep_alive"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14139,26 +12783,49 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = "Move some assets from one account to another."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] - pub struct CancelRecovered { - pub account: cancel_recovered::Account, - } - pub mod cancel_recovered { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `source`: The account to be debited."] + #[doc = "- `dest`: The account to be credited."] + #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] + #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] + #[doc = "below the minimum balance. Must be greater than zero."] + #[doc = ""] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] + #[doc = "`dest`."] + pub struct ForceTransfer { + #[codec(compact)] + pub id: force_transfer::Id, + pub source: force_transfer::Source, + pub dest: force_transfer::Dest, + #[codec(compact)] + pub amount: force_transfer::Amount, } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "cancel_recovered"; + pub mod force_transfer { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceTransfer { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14171,812 +12838,387 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Poke deposits for recovery configurations and / or active recoveries."] - #[doc = ""] - #[doc = "This can be used by accounts to possibly lower their locked amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] - #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] + #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] + #[doc = "account that does not have an entry, use `touch_other` first."] #[doc = ""] - #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] - #[doc = "of the caller:"] - #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] - #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] - #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] - #[doc = "account."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be frozen."] #[doc = ""] - #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = "Emits `Frozen`."] #[doc = ""] - #[doc = "Emits `DepositPoked` if any deposit is updated."] - #[doc = "Multiple events may be emitted in case both types of deposits are updated."] - pub struct PokeDeposit { - pub maybe_account: poke_deposit::MaybeAccount, + #[doc = "Weight: `O(1)`"] + pub struct Freeze { + #[codec(compact)] + pub id: freeze::Id, + pub who: freeze::Who, } - pub mod poke_deposit { + pub mod freeze { use super::runtime_types; - pub type MaybeAccount = ::core::option::Option< - ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "poke_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Freeze { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "freeze"; } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Send a call through a recovered account."] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Allow unprivileged transfers to and from an account again."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] - #[doc = "- `call`: The call you want to make with the recovered account."] - pub fn as_recovered( - &self, - account: types::as_recovered::Account, - call: types::as_recovered::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "as_recovered", - types::AsRecovered { - account, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 71u8, 178u8, 63u8, 91u8, 78u8, 140u8, 29u8, 153u8, 6u8, 45u8, 75u8, - 246u8, 87u8, 173u8, 86u8, 162u8, 22u8, 132u8, 34u8, 59u8, 39u8, 235u8, - 150u8, 74u8, 227u8, 47u8, 217u8, 153u8, 37u8, 164u8, 173u8, 239u8, - ], - ) - } - #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] - #[doc = "for a lost account directly."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be unfrozen."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _ROOT_."] + #[doc = "Emits `Thawed`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The \"lost account\" to be recovered."] - #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] - pub fn set_recovered( - &self, - lost: types::set_recovered::Lost, - rescuer: types::set_recovered::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "set_recovered", - types::SetRecovered { lost, rescuer }, - [ - 194u8, 147u8, 14u8, 197u8, 132u8, 185u8, 122u8, 81u8, 61u8, 14u8, 10u8, - 177u8, 74u8, 184u8, 150u8, 217u8, 246u8, 149u8, 26u8, 165u8, 196u8, - 83u8, 230u8, 195u8, 213u8, 40u8, 51u8, 180u8, 23u8, 90u8, 3u8, 14u8, - ], - ) + #[doc = "Weight: `O(1)`"] + pub struct Thaw { + #[codec(compact)] + pub id: thaw::Id, + pub who: thaw::Who, } - #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] + pub mod thaw { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Thaw { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "thaw"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Disallow further unprivileged transfers for the asset class."] #[doc = ""] - #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] - #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] - #[doc = "in full when the user calls `remove_recovery`."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "- `id`: The identifier of the asset to be frozen."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] - #[doc = " ordered and contain no duplicate values."] - #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] - #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] - #[doc = " friends."] - #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] - #[doc = " needs to pass before the account can be recovered."] - pub fn create_recovery( - &self, - friends: types::create_recovery::Friends, - threshold: types::create_recovery::Threshold, - delay_period: types::create_recovery::DelayPeriod, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "create_recovery", - types::CreateRecovery { friends, threshold, delay_period }, - [ - 36u8, 175u8, 11u8, 85u8, 95u8, 170u8, 58u8, 193u8, 102u8, 18u8, 117u8, - 27u8, 199u8, 214u8, 70u8, 47u8, 129u8, 130u8, 109u8, 242u8, 240u8, - 255u8, 120u8, 176u8, 40u8, 243u8, 175u8, 71u8, 3u8, 91u8, 186u8, 220u8, - ], - ) + #[doc = "Emits `Frozen`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct FreezeAsset { + #[codec(compact)] + pub id: freeze_asset::Id, } - #[doc = "Initiate the process for recovering a recoverable account."] + pub mod freeze_asset { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FreezeAsset { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "freeze_asset"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Allow unprivileged transfers for the asset again."] #[doc = ""] - #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] - #[doc = "recovery process. This deposit will always be repatriated to the account"] - #[doc = "trying to be recovered. See `close_recovery`."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "- `id`: The identifier of the asset to be thawed."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] - #[doc = " recoverable (i.e. have a recovery configuration)."] - pub fn initiate_recovery( - &self, - account: types::initiate_recovery::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "initiate_recovery", - types::InitiateRecovery { account }, - [ - 60u8, 243u8, 229u8, 176u8, 221u8, 52u8, 44u8, 224u8, 233u8, 14u8, 89u8, - 100u8, 174u8, 74u8, 38u8, 32u8, 97u8, 48u8, 53u8, 74u8, 30u8, 242u8, - 19u8, 114u8, 145u8, 74u8, 69u8, 125u8, 227u8, 214u8, 144u8, 58u8, - ], - ) - } - #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] - #[doc = "process for that account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] - #[doc = "for the recoverable account."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The lost account that you want to recover."] - #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = "Emits `Thawed`."] #[doc = ""] - #[doc = "The combination of these two parameters must point to an active recovery"] - #[doc = "process."] - pub fn vouch_recovery( - &self, - lost: types::vouch_recovery::Lost, - rescuer: types::vouch_recovery::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "vouch_recovery", - types::VouchRecovery { lost, rescuer }, - [ - 97u8, 190u8, 60u8, 15u8, 191u8, 117u8, 1u8, 217u8, 62u8, 40u8, 210u8, - 1u8, 237u8, 111u8, 48u8, 196u8, 180u8, 154u8, 198u8, 12u8, 108u8, 42u8, - 6u8, 234u8, 2u8, 113u8, 163u8, 111u8, 80u8, 146u8, 6u8, 73u8, - ], - ) + #[doc = "Weight: `O(1)`"] + pub struct ThawAsset { + #[codec(compact)] + pub id: thaw_asset::Id, } - #[doc = "Allow a successful rescuer to claim their recovered account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] - #[doc = "who has successfully completed the account recovery process: collected"] - #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] - #[doc = " you."] - pub fn claim_recovery( - &self, - account: types::claim_recovery::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "claim_recovery", - types::ClaimRecovery { account }, - [ - 41u8, 47u8, 162u8, 88u8, 13u8, 166u8, 130u8, 146u8, 218u8, 162u8, - 166u8, 33u8, 89u8, 129u8, 177u8, 178u8, 68u8, 128u8, 161u8, 229u8, - 207u8, 3u8, 57u8, 35u8, 211u8, 208u8, 74u8, 155u8, 183u8, 173u8, 74u8, - 56u8, - ], - ) + pub mod thaw_asset { + use super::runtime_types; + pub type Id = ::core::primitive::u32; } - #[doc = "As the controller of a recoverable account, close an active recovery"] - #[doc = "process for your account."] + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ThawAsset { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "thaw_asset"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Change the Owner of an asset."] #[doc = ""] - #[doc = "Payment: By calling this function, the recoverable account will receive"] - #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account with an active recovery process for it."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] - pub fn close_recovery( - &self, - rescuer: types::close_recovery::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "close_recovery", - types::CloseRecovery { rescuer }, - [ - 161u8, 178u8, 117u8, 209u8, 119u8, 164u8, 135u8, 41u8, 25u8, 108u8, - 194u8, 175u8, 221u8, 65u8, 184u8, 137u8, 171u8, 97u8, 204u8, 61u8, - 159u8, 39u8, 192u8, 53u8, 246u8, 69u8, 113u8, 16u8, 170u8, 232u8, - 163u8, 10u8, - ], - ) - } - #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = "Emits `OwnerChanged`."] #[doc = ""] - #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] - #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = "Weight: `O(1)`"] + pub struct TransferOwnership { + #[codec(compact)] + pub id: transfer_ownership::Id, + pub owner: transfer_ownership::Owner, + } + pub mod transfer_ownership { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferOwnership { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer_ownership"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Change the Issuer, Admin and Freezer of an asset."] #[doc = ""] - #[doc = "Payment: By calling this function the recoverable account will unreserve"] - #[doc = "their recovery configuration deposit."] - #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account (i.e. has a recovery configuration)."] - pub fn remove_recovery( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "remove_recovery", - types::RemoveRecovery {}, - [ - 11u8, 38u8, 133u8, 172u8, 212u8, 252u8, 57u8, 216u8, 42u8, 202u8, - 206u8, 91u8, 115u8, 91u8, 242u8, 123u8, 95u8, 196u8, 172u8, 243u8, - 164u8, 1u8, 69u8, 180u8, 40u8, 68u8, 208u8, 221u8, 161u8, 250u8, 8u8, - 72u8, - ], - ) - } - #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "Emits `TeamChanged`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] - pub fn cancel_recovered( - &self, - account: types::cancel_recovered::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "cancel_recovered", - types::CancelRecovered { account }, - [ - 100u8, 222u8, 80u8, 226u8, 187u8, 188u8, 111u8, 58u8, 190u8, 5u8, - 178u8, 144u8, 37u8, 98u8, 71u8, 145u8, 28u8, 248u8, 222u8, 188u8, 53u8, - 21u8, 127u8, 176u8, 249u8, 166u8, 250u8, 59u8, 170u8, 33u8, 251u8, - 239u8, - ], - ) + #[doc = "Weight: `O(1)`"] + pub struct SetTeam { + #[codec(compact)] + pub id: set_team::Id, + pub issuer: set_team::Issuer, + pub admin: set_team::Admin, + pub freezer: set_team::Freezer, } - #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + pub mod set_team { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTeam { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "set_team"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set the metadata for an asset."] #[doc = ""] - #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "Funds of sender are reserved according to the formula:"] + #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] + #[doc = "account any already reserved funds."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] - #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] #[doc = ""] - #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] - #[doc = "of the caller:"] - #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] - #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] - #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = "Emits `MetadataSet`."] #[doc = ""] - #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] - #[doc = "account."] - #[doc = ""] - #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] - #[doc = ""] - #[doc = "Emits `DepositPoked` if any deposit is updated."] - #[doc = "Multiple events may be emitted in case both types of deposits are updated."] - pub fn poke_deposit( - &self, - maybe_account: types::poke_deposit::MaybeAccount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "poke_deposit", - types::PokeDeposit { maybe_account }, - [ - 177u8, 98u8, 53u8, 15u8, 228u8, 36u8, 173u8, 55u8, 125u8, 3u8, 234u8, - 70u8, 147u8, 147u8, 124u8, 86u8, 31u8, 101u8, 171u8, 56u8, 148u8, - 180u8, 87u8, 149u8, 11u8, 113u8, 195u8, 35u8, 56u8, 32u8, 251u8, 56u8, - ], - ) + #[doc = "Weight: `O(1)`"] + pub struct SetMetadata { + #[codec(compact)] + pub id: set_metadata::Id, + pub name: set_metadata::Name, + pub symbol: set_metadata::Symbol, + pub decimals: set_metadata::Decimals, } - } - } - #[doc = "Events type."] - pub type Event = runtime_types::pallet_recovery::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been set up for an account."] - pub struct RecoveryCreated { - pub account: recovery_created::Account, - } - pub mod recovery_created { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryCreated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryCreated"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been initiated for lost account by rescuer account."] - pub struct RecoveryInitiated { - pub lost_account: recovery_initiated::LostAccount, - pub rescuer_account: recovery_initiated::RescuerAccount, - } - pub mod recovery_initiated { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryInitiated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryInitiated"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process for lost account by rescuer account has been vouched for by sender."] - pub struct RecoveryVouched { - pub lost_account: recovery_vouched::LostAccount, - pub rescuer_account: recovery_vouched::RescuerAccount, - pub sender: recovery_vouched::Sender, - } - pub mod recovery_vouched { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Sender = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryVouched { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryVouched"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process for lost account by rescuer account has been closed."] - pub struct RecoveryClosed { - pub lost_account: recovery_closed::LostAccount, - pub rescuer_account: recovery_closed::RescuerAccount, - } - pub mod recovery_closed { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryClosed { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryClosed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Lost account has been successfully recovered by rescuer account."] - pub struct AccountRecovered { - pub lost_account: account_recovered::LostAccount, - pub rescuer_account: account_recovered::RescuerAccount, - } - pub mod account_recovered { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for AccountRecovered { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "AccountRecovered"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been removed for an account."] - pub struct RecoveryRemoved { - pub lost_account: recovery_removed::LostAccount, - } - pub mod recovery_removed { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryRemoved { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryRemoved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A deposit has been updated."] - pub struct DepositPoked { - pub who: deposit_poked::Who, - pub kind: deposit_poked::Kind, - pub old_deposit: deposit_poked::OldDeposit, - pub new_deposit: deposit_poked::NewDeposit, - } - pub mod deposit_poked { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Kind = runtime_types::pallet_recovery::DepositKind< - runtime_types::quantus_runtime::Runtime, - >; - pub type OldDeposit = ::core::primitive::u128; - pub type NewDeposit = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "DepositPoked"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod recoverable { + pub mod set_metadata { use super::runtime_types; - pub type Recoverable = runtime_types::pallet_recovery::RecoveryConfig< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Id = ::core::primitive::u32; + pub type Name = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Symbol = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Decimals = ::core::primitive::u8; } - pub mod active_recoveries { - use super::runtime_types; - pub type ActiveRecoveries = runtime_types::pallet_recovery::ActiveRecovery< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "set_metadata"; } - pub mod proxy { + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Clear the metadata for an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = ""] + #[doc = "Any deposit is freed for the asset owner."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ClearMetadata { + #[codec(compact)] + pub id: clear_metadata::Id, + } + pub mod clear_metadata { use super::runtime_types; - pub type Proxy = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Id = ::core::primitive::u32; } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " The set of recoverable accounts and their recovery configuration."] - pub fn recoverable_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::recoverable::Recoverable, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Recoverable", - (), - [ - 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, - 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, - 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, - ], - ) - } - #[doc = " The set of recoverable accounts and their recovery configuration."] - pub fn recoverable( - &self, - _0: types::recoverable::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::recoverable::Param0, - >, - types::recoverable::Recoverable, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Recoverable", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, - 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, - 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "clear_metadata"; } - #[doc = " Active recovery attempts."] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Force the metadata for an asset to some value."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::active_recoveries::ActiveRecoveries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - (), - [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, - ], - ) - } - #[doc = " Active recovery attempts."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries_iter1( - &self, - _0: types::active_recoveries::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param0, - >, - types::active_recoveries::ActiveRecoveries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, - ], - ) - } - #[doc = " Active recovery attempts."] + #[doc = "Any deposit is left alone."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries( - &self, - _0: types::active_recoveries::Param0, - _1: types::active_recoveries::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param1, - >, - ), - types::active_recoveries::ActiveRecoveries, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, - ], - ) - } - #[doc = " The list of allowed proxy accounts."] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] #[doc = ""] - #[doc = " Map from the user who can access it to the recovered account."] - pub fn proxy_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proxy::Proxy, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Proxy", - (), - [ - 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, - 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, - 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, - ], - ) - } - #[doc = " The list of allowed proxy accounts."] + #[doc = "Emits `MetadataSet`."] #[doc = ""] - #[doc = " Map from the user who can access it to the recovered account."] - pub fn proxy( - &self, - _0: types::proxy::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proxy::Param0, - >, - types::proxy::Proxy, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Proxy", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, - 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, - 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, - ], - ) + #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] + pub struct ForceSetMetadata { + #[codec(compact)] + pub id: force_set_metadata::Id, + pub name: force_set_metadata::Name, + pub symbol: force_set_metadata::Symbol, + pub decimals: force_set_metadata::Decimals, + pub is_frozen: force_set_metadata::IsFrozen, } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The base amount of currency needed to reserve for creating a recovery configuration."] - #[doc = ""] - #[doc = " This is held for an additional storage item whose value size is"] - #[doc = " `2 + sizeof(BlockNumber, Balance)` bytes."] - pub fn config_deposit_base( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "ConfigDepositBase", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) + pub mod force_set_metadata { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Name = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Symbol = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Decimals = ::core::primitive::u8; + pub type IsFrozen = ::core::primitive::bool; } - #[doc = " The amount of currency needed per additional user when creating a recovery"] - #[doc = " configuration."] + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_set_metadata"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = " This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage"] - #[doc = " value."] - pub fn friend_deposit_factor( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "FriendDepositFactor", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) - } - #[doc = " The maximum amount of friends allowed in a recovery configuration."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = " NOTE: The threshold programmed in this Pallet uses u16, so it does"] - #[doc = " not really make sense to have a limit here greater than u16::MAX."] - #[doc = " But also, that is a lot more than you should probably set this value"] - #[doc = " to anyway..."] - pub fn max_friends( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "MaxFriends", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The base amount of currency needed to reserve for starting a recovery."] + #[doc = "Any deposit is returned."] #[doc = ""] - #[doc = " This is primarily held for deterring malicious recovery attempts, and should"] - #[doc = " have a value large enough that a bad actor would choose not to place this"] - #[doc = " deposit. It also acts to fund additional storage item whose value size is"] - #[doc = " `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable"] - #[doc = " threshold."] - pub fn recovery_deposit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "RecoveryDeposit", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) + #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceClearMetadata { + #[codec(compact)] + pub id: force_clear_metadata::Id, + } + pub mod force_clear_metadata { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceClearMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_clear_metadata"; } - } - } - } - pub mod assets { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_assets::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_assets::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -14988,43 +13230,66 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Issue a new class of fungible assets from a public origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially and its owner is the origin."] - #[doc = ""] - #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] + #[doc = "Alter the attributes of a given asset."] #[doc = ""] - #[doc = "Funds of sender are reserved by `AssetDeposit`."] + #[doc = "Origin must be `ForceOrigin`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] - #[doc = "member of the asset class's admin team."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] + #[doc = "value to account for the state bloat associated with its balance storage. If set to"] + #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] + #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] + #[doc = "growth)."] + #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] + #[doc = "instructions."] #[doc = ""] - #[doc = "Emits `Created` event when successful."] + #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct Create { + pub struct ForceAssetStatus { #[codec(compact)] - pub id: create::Id, - pub admin: create::Admin, - pub min_balance: create::MinBalance, + pub id: force_asset_status::Id, + pub owner: force_asset_status::Owner, + pub issuer: force_asset_status::Issuer, + pub admin: force_asset_status::Admin, + pub freezer: force_asset_status::Freezer, + #[codec(compact)] + pub min_balance: force_asset_status::MinBalance, + pub is_sufficient: force_asset_status::IsSufficient, + pub is_frozen: force_asset_status::IsFrozen, } - pub mod create { + pub mod force_asset_status { use super::runtime_types; pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; pub type MinBalance = ::core::primitive::u128; + pub type IsSufficient = ::core::primitive::bool; + pub type IsFrozen = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Create { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceAssetStatus { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "create"; + const CALL: &'static str = "force_asset_status"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15037,46 +13302,45 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Issue a new class of fungible assets from a privileged origin."] + #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] #[doc = ""] - #[doc = "This new asset class has no assets initially."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin`."] + #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] + #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] + #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] + #[doc = "meet the right value."] #[doc = ""] - #[doc = "Unlike `create`, no funds are reserved."] + #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] + #[doc = "making this call."] #[doc = ""] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] - #[doc = "over this asset, but may later change and configure the permissions using"] - #[doc = "`transfer_ownership` and `set_team`."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account to delegate permission to transfer asset."] + #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] + #[doc = "already an approval in place, then this acts additively."] #[doc = ""] - #[doc = "Emits `ForceCreated` event when successful."] + #[doc = "Emits `ApprovedTransfer` on success."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceCreate { + pub struct ApproveTransfer { #[codec(compact)] - pub id: force_create::Id, - pub owner: force_create::Owner, - pub is_sufficient: force_create::IsSufficient, + pub id: approve_transfer::Id, + pub delegate: approve_transfer::Delegate, #[codec(compact)] - pub min_balance: force_create::MinBalance, + pub amount: approve_transfer::Amount, } - pub mod force_create { + pub mod approve_transfer { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type IsSufficient = ::core::primitive::bool; - pub type MinBalance = ::core::primitive::u128; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCreate { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveTransfer { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_create"; + const CALL: &'static str = "approve_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15089,29 +13353,35 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Start the process of destroying a fungible asset class."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] - #[doc = "destruction of an asset class."] + #[doc = "Origin must be Signed and there must be an approval in place between signer and"] + #[doc = "`delegate`."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "an account contains holds or freezes in place."] - pub struct StartDestroy { + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct CancelApproval { #[codec(compact)] - pub id: start_destroy::Id, + pub id: cancel_approval::Id, + pub delegate: cancel_approval::Delegate, } - pub mod start_destroy { + pub mod cancel_approval { use super::runtime_types; pub type Id = ::core::primitive::u32; + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for StartDestroy { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelApproval { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "start_destroy"; + const CALL: &'static str = "cancel_approval"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15124,30 +13394,41 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Destroy all accounts associated with a given asset."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] + #[doc = "account of the asset `id`."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedAccounts` event."] - pub struct DestroyAccounts { + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceCancelApproval { #[codec(compact)] - pub id: destroy_accounts::Id, + pub id: force_cancel_approval::Id, + pub owner: force_cancel_approval::Owner, + pub delegate: force_cancel_approval::Delegate, } - pub mod destroy_accounts { + pub mod force_cancel_approval { use super::runtime_types; pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCancelApproval { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_cancel_approval"; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyAccounts { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "destroy_accounts"; - } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -15159,29 +13440,48 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] + #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] + #[doc = "account."] #[doc = ""] - #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] + #[doc = "signer."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] + #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] + #[doc = "reserved by `approve_transfer` is unreserved."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] + #[doc = "from which the asset balance will be withdrawn."] + #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] + #[doc = "- `amount`: The amount of assets to transfer."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedApprovals` event."] - pub struct DestroyApprovals { + #[doc = "Emits `TransferredApproved` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct TransferApproved { #[codec(compact)] - pub id: destroy_approvals::Id, + pub id: transfer_approved::Id, + pub owner: transfer_approved::Owner, + pub destination: transfer_approved::Destination, + #[codec(compact)] + pub amount: transfer_approved::Amount, } - pub mod destroy_approvals { + pub mod transfer_approved { use super::runtime_types; pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Destination = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyApprovals { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferApproved { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "destroy_approvals"; + const CALL: &'static str = "transfer_approved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15194,27 +13494,26 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Complete destroying asset and unreserve currency."] + #[doc = "Create an asset account for non-provider assets."] #[doc = ""] - #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] - #[doc = "hand."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] #[doc = ""] - #[doc = "Each successful call emits the `Event::Destroyed` event."] - pub struct FinishDestroy { + #[doc = "Emits `Touched` event when successful."] + pub struct Touch { #[codec(compact)] - pub id: finish_destroy::Id, + pub id: touch::Id, } - pub mod finish_destroy { + pub mod touch { use super::runtime_types; pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FinishDestroy { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Touch { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "finish_destroy"; + const CALL: &'static str = "touch"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15227,37 +13526,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Mint assets of a particular class."] + #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] + #[doc = "account."] #[doc = ""] - #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = "The origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount minted."] - #[doc = "- `beneficiary`: The account to be credited with the minted assets."] - #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] + #[doc = " refunded."] + #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] #[doc = ""] - #[doc = "Emits `Issued` event when successful."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] - pub struct Mint { - #[codec(compact)] - pub id: mint::Id, - pub beneficiary: mint::Beneficiary, + #[doc = "Emits `Refunded` event when successful."] + pub struct Refund { #[codec(compact)] - pub amount: mint::Amount, + pub id: refund::Id, + pub allow_burn: refund::AllowBurn, } - pub mod mint { + pub mod refund { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; + pub type AllowBurn = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Mint { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Refund { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "mint"; + const CALL: &'static str = "refund"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15270,40 +13564,31 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] + #[doc = "Sets the minimum balance of an asset."] #[doc = ""] - #[doc = "Bails with `NoAccount` if the `who` is already dead."] + #[doc = "Only works if there aren't any accounts that are holding the asset or if"] + #[doc = "the new value of `min_balance` is less than the old one."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount burned."] - #[doc = "- `who`: The account to be debited from."] - #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = "Origin must be Signed and the sender has to be the Owner of the"] + #[doc = "asset `id`."] #[doc = ""] - #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] - #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `min_balance`: The new value of `min_balance`."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] - pub struct Burn { - #[codec(compact)] - pub id: burn::Id, - pub who: burn::Who, + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + pub struct SetMinBalance { #[codec(compact)] - pub amount: burn::Amount, + pub id: set_min_balance::Id, + pub min_balance: set_min_balance::MinBalance, } - pub mod burn { + pub mod set_min_balance { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; + pub type MinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Burn { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMinBalance { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "burn"; + const CALL: &'static str = "set_min_balance"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15316,43 +13601,33 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Move some assets from the sender account to another."] - #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "Create an asset account for `who`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created, the asset status must"] + #[doc = " be live."] + #[doc = "- `who`: The account to be created."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub struct Transfer { - #[codec(compact)] - pub id: transfer::Id, - pub target: transfer::Target, + #[doc = "Emits `Touched` event when successful."] + pub struct TouchOther { #[codec(compact)] - pub amount: transfer::Amount, + pub id: touch_other::Id, + pub who: touch_other::Who, } - pub mod transfer { + pub mod touch_other { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Transfer { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TouchOther { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer"; + const CALL: &'static str = "touch_other"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15365,43 +13640,35 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] + #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] + #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] + #[doc = "use `refund`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `who`: The account to refund."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub struct TransferKeepAlive { - #[codec(compact)] - pub id: transfer_keep_alive::Id, - pub target: transfer_keep_alive::Target, + #[doc = "Emits `Refunded` event when successful."] + pub struct RefundOther { #[codec(compact)] - pub amount: transfer_keep_alive::Amount, + pub id: refund_other::Id, + pub who: refund_other::Who, } - pub mod transfer_keep_alive { + pub mod refund_other { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundOther { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_keep_alive"; + const CALL: &'static str = "refund_other"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15414,49 +13681,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Move some assets from one account to another."] + #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `source`: The account to be debited."] - #[doc = "- `dest`: The account to be credited."] - #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] - #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] - #[doc = "below the minimum balance. Must be greater than zero."] + #[doc = "- `id`: The identifier of the account's asset."] + #[doc = "- `who`: The account to be unblocked."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "Emits `Blocked`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] - #[doc = "`dest`."] - pub struct ForceTransfer { - #[codec(compact)] - pub id: force_transfer::Id, - pub source: force_transfer::Source, - pub dest: force_transfer::Dest, + pub struct Block { #[codec(compact)] - pub amount: force_transfer::Amount, + pub id: block::Id, + pub who: block::Who, } - pub mod force_transfer { + pub mod block { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceTransfer { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Block { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_transfer"; + const CALL: &'static str = "block"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15469,34 +13719,40 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] - #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] - #[doc = "account that does not have an entry, use `touch_other` first."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = "Transfer the entire transferable balance from the caller asset account."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be frozen."] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] #[doc = ""] - #[doc = "Emits `Frozen`."] + #[doc = "The dispatch origin of this call must be Signed."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct Freeze { + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] + #[doc = " (false), or transfer everything except at least the minimum balance, which will"] + #[doc = " guarantee to keep the sender asset account alive (true)."] + pub struct TransferAll { #[codec(compact)] - pub id: freeze::Id, - pub who: freeze::Who, + pub id: transfer_all::Id, + pub dest: transfer_all::Dest, + pub keep_alive: transfer_all::KeepAlive, } - pub mod freeze { + pub mod transfer_all { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type KeepAlive = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Freeze { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAll { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "freeze"; + const CALL: &'static str = "transfer_all"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15509,2176 +13765,1289 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Allow unprivileged transfers to and from an account again."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "Sets the trusted reserve information of an asset."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be unfrozen."] + #[doc = "Origin must be the Owner of the asset `id`. The origin must conform to the configured"] + #[doc = "`CreateOrigin` or be the signed `owner` configured during asset creation."] #[doc = ""] - #[doc = "Emits `Thawed`."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `reserves`: The full list of trusted reserves information."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct Thaw { + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + pub struct SetReserves { #[codec(compact)] - pub id: thaw::Id, - pub who: thaw::Who, + pub id: set_reserves::Id, + pub reserves: set_reserves::Reserves, } - pub mod thaw { + pub mod set_reserves { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Reserves = + runtime_types::bounded_collections::bounded_vec::BoundedVec<()>; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Thaw { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetReserves { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "thaw"; + const CALL: &'static str = "set_reserves"; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Disallow further unprivileged transfers for the asset class."] + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Issue a new class of fungible assets from a public origin."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = "This new asset class has no assets initially and its owner is the origin."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] #[doc = ""] - #[doc = "Emits `Frozen`."] + #[doc = "Funds of sender are reserved by `AssetDeposit`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] + #[doc = "member of the asset class's admin team."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `Created` event when successful."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct FreezeAsset { - #[codec(compact)] - pub id: freeze_asset::Id, - } - pub mod freeze_asset { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FreezeAsset { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "freeze_asset"; + pub fn create( + &self, + id: types::create::Id, + admin: types::create::Admin, + min_balance: types::create::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "create", + types::Create { id, admin, min_balance }, + [ + 120u8, 25u8, 99u8, 39u8, 102u8, 201u8, 14u8, 2u8, 32u8, 139u8, 206u8, + 218u8, 223u8, 161u8, 25u8, 98u8, 159u8, 133u8, 65u8, 105u8, 45u8, 4u8, + 28u8, 49u8, 248u8, 147u8, 2u8, 179u8, 11u8, 195u8, 177u8, 250u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allow unprivileged transfers for the asset again."] + #[doc = "Issue a new class of fungible assets from a privileged origin."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "This new asset class has no assets initially."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be thawed."] + #[doc = "The origin must conform to `ForceOrigin`."] #[doc = ""] - #[doc = "Emits `Thawed`."] + #[doc = "Unlike `create`, no funds are reserved."] + #[doc = ""] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] + #[doc = "over this asset, but may later change and configure the permissions using"] + #[doc = "`transfer_ownership` and `set_team`."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `ForceCreated` event when successful."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ThawAsset { - #[codec(compact)] - pub id: thaw_asset::Id, - } - pub mod thaw_asset { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ThawAsset { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "thaw_asset"; + pub fn force_create( + &self, + id: types::force_create::Id, + owner: types::force_create::Owner, + is_sufficient: types::force_create::IsSufficient, + min_balance: types::force_create::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_create", + types::ForceCreate { id, owner, is_sufficient, min_balance }, + [ + 149u8, 41u8, 54u8, 146u8, 18u8, 248u8, 84u8, 52u8, 202u8, 88u8, 192u8, + 208u8, 247u8, 227u8, 254u8, 98u8, 92u8, 46u8, 164u8, 152u8, 143u8, + 20u8, 179u8, 227u8, 197u8, 247u8, 242u8, 153u8, 142u8, 148u8, 40u8, + 184u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Change the Owner of an asset."] + #[doc = "Start the process of destroying a fungible asset class."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] + #[doc = "destruction of an asset class."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] #[doc = ""] - #[doc = "Emits `OwnerChanged`."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct TransferOwnership { - #[codec(compact)] - pub id: transfer_ownership::Id, - pub owner: transfer_ownership::Owner, + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "an account contains holds or freezes in place."] + pub fn start_destroy( + &self, + id: types::start_destroy::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "start_destroy", + types::StartDestroy { id }, + [ + 125u8, 82u8, 151u8, 106u8, 25u8, 49u8, 68u8, 203u8, 247u8, 175u8, + 117u8, 230u8, 84u8, 98u8, 172u8, 73u8, 233u8, 218u8, 212u8, 198u8, + 69u8, 35u8, 15u8, 179u8, 161u8, 205u8, 190u8, 109u8, 198u8, 214u8, + 65u8, 164u8, + ], + ) } - pub mod transfer_ownership { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferOwnership { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_ownership"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Change the Issuer, Admin and Freezer of an asset."] + #[doc = "Destroy all accounts associated with a given asset."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] #[doc = ""] - #[doc = "Emits `TeamChanged`."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct SetTeam { - #[codec(compact)] - pub id: set_team::Id, - pub issuer: set_team::Issuer, - pub admin: set_team::Admin, - pub freezer: set_team::Freezer, - } - pub mod set_team { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTeam { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_team"; + #[doc = "Each call emits the `Event::DestroyedAccounts` event."] + pub fn destroy_accounts( + &self, + id: types::destroy_accounts::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "destroy_accounts", + types::DestroyAccounts { id }, + [ + 236u8, 102u8, 233u8, 170u8, 179u8, 46u8, 42u8, 29u8, 200u8, 116u8, + 62u8, 114u8, 233u8, 59u8, 217u8, 215u8, 109u8, 232u8, 147u8, 95u8, + 255u8, 248u8, 119u8, 222u8, 216u8, 165u8, 138u8, 47u8, 28u8, 56u8, + 204u8, 93u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] #[doc = ""] - #[doc = "Funds of sender are reserved according to the formula:"] - #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] - #[doc = "account any already reserved funds."] + #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] #[doc = ""] - #[doc = "Emits `MetadataSet`."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct SetMetadata { - #[codec(compact)] - pub id: set_metadata::Id, - pub name: set_metadata::Name, - pub symbol: set_metadata::Symbol, - pub decimals: set_metadata::Decimals, - } - pub mod set_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Name = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Symbol = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Decimals = ::core::primitive::u8; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_metadata"; + #[doc = "Each call emits the `Event::DestroyedApprovals` event."] + pub fn destroy_approvals( + &self, + id: types::destroy_approvals::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "destroy_approvals", + types::DestroyApprovals { id }, + [ + 34u8, 35u8, 15u8, 44u8, 239u8, 232u8, 88u8, 130u8, 130u8, 87u8, 171u8, + 255u8, 247u8, 179u8, 14u8, 35u8, 47u8, 223u8, 32u8, 232u8, 41u8, 105u8, + 207u8, 199u8, 90u8, 136u8, 144u8, 139u8, 252u8, 76u8, 177u8, 106u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear the metadata for an asset."] + #[doc = "Complete destroying asset and unreserve currency."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] + #[doc = "hand."] #[doc = ""] - #[doc = "Any deposit is freed for the asset owner."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = "Each successful call emits the `Event::Destroyed` event."] + pub fn finish_destroy( + &self, + id: types::finish_destroy::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "finish_destroy", + types::FinishDestroy { id }, + [ + 132u8, 67u8, 78u8, 84u8, 240u8, 51u8, 176u8, 119u8, 48u8, 34u8, 153u8, + 37u8, 25u8, 171u8, 21u8, 164u8, 53u8, 214u8, 36u8, 149u8, 20u8, 240u8, + 123u8, 195u8, 170u8, 162u8, 118u8, 81u8, 176u8, 218u8, 114u8, 113u8, + ], + ) + } + #[doc = "Mint assets of a particular class."] #[doc = ""] - #[doc = "Emits `MetadataCleared`."] + #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount minted."] + #[doc = "- `beneficiary`: The account to be credited with the minted assets."] + #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = ""] + #[doc = "Emits `Issued` event when successful."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ClearMetadata { - #[codec(compact)] - pub id: clear_metadata::Id, - } - pub mod clear_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "clear_metadata"; + #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] + pub fn mint( + &self, + id: types::mint::Id, + beneficiary: types::mint::Beneficiary, + amount: types::mint::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "mint", + types::Mint { id, beneficiary, amount }, + [ + 172u8, 131u8, 103u8, 81u8, 206u8, 2u8, 143u8, 114u8, 137u8, 60u8, + 147u8, 67u8, 226u8, 64u8, 71u8, 11u8, 36u8, 145u8, 51u8, 8u8, 0u8, + 110u8, 8u8, 195u8, 103u8, 205u8, 156u8, 43u8, 215u8, 12u8, 150u8, + 135u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force the metadata for an asset to some value."] + #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] #[doc = ""] - #[doc = "Origin must be ForceOrigin."] + #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] #[doc = ""] - #[doc = "Any deposit is left alone."] + #[doc = "Bails with `NoAccount` if the `who` is already dead."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = "- `id`: The identifier of the asset to have some amount burned."] + #[doc = "- `who`: The account to be debited from."] + #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] #[doc = ""] - #[doc = "Emits `MetadataSet`."] + #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] + #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] #[doc = ""] - #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] - pub struct ForceSetMetadata { - #[codec(compact)] - pub id: force_set_metadata::Id, - pub name: force_set_metadata::Name, - pub symbol: force_set_metadata::Symbol, - pub decimals: force_set_metadata::Decimals, - pub is_frozen: force_set_metadata::IsFrozen, - } - pub mod force_set_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Name = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Symbol = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Decimals = ::core::primitive::u8; - pub type IsFrozen = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_set_metadata"; + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] + pub fn burn( + &self, + id: types::burn::Id, + who: types::burn::Who, + amount: types::burn::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "burn", + types::Burn { id, who, amount }, + [ + 105u8, 133u8, 82u8, 100u8, 124u8, 65u8, 174u8, 31u8, 152u8, 45u8, 23u8, + 200u8, 23u8, 199u8, 239u8, 8u8, 187u8, 142u8, 21u8, 192u8, 35u8, 211u8, + 172u8, 130u8, 169u8, 74u8, 167u8, 36u8, 149u8, 7u8, 19u8, 37u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] + #[doc = "Move some assets from the sender account to another."] #[doc = ""] - #[doc = "Any deposit is returned."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "Emits `MetadataCleared`."] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceClearMetadata { - #[codec(compact)] - pub id: force_clear_metadata::Id, - } - pub mod force_clear_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceClearMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_clear_metadata"; + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub fn transfer( + &self, + id: types::transfer::Id, + target: types::transfer::Target, + amount: types::transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer", + types::Transfer { id, target, amount }, + [ + 126u8, 31u8, 70u8, 179u8, 222u8, 190u8, 12u8, 19u8, 94u8, 225u8, 217u8, + 109u8, 54u8, 69u8, 124u8, 61u8, 97u8, 199u8, 193u8, 166u8, 39u8, 143u8, + 125u8, 251u8, 87u8, 173u8, 149u8, 91u8, 182u8, 18u8, 184u8, 65u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Alter the attributes of a given asset."] + #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] #[doc = ""] - #[doc = "Origin must be `ForceOrigin`."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] - #[doc = "value to account for the state bloat associated with its balance storage. If set to"] - #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] - #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] - #[doc = "growth)."] - #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] - #[doc = "instructions."] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceAssetStatus { - #[codec(compact)] - pub id: force_asset_status::Id, - pub owner: force_asset_status::Owner, - pub issuer: force_asset_status::Issuer, - pub admin: force_asset_status::Admin, - pub freezer: force_asset_status::Freezer, - #[codec(compact)] - pub min_balance: force_asset_status::MinBalance, - pub is_sufficient: force_asset_status::IsSufficient, - pub is_frozen: force_asset_status::IsFrozen, - } - pub mod force_asset_status { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MinBalance = ::core::primitive::u128; - pub type IsSufficient = ::core::primitive::bool; - pub type IsFrozen = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceAssetStatus { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_asset_status"; + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub fn transfer_keep_alive( + &self, + id: types::transfer_keep_alive::Id, + target: types::transfer_keep_alive::Target, + amount: types::transfer_keep_alive::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer_keep_alive", + types::TransferKeepAlive { id, target, amount }, + [ + 99u8, 101u8, 219u8, 188u8, 238u8, 230u8, 141u8, 43u8, 38u8, 175u8, + 46u8, 89u8, 33u8, 23u8, 223u8, 115u8, 108u8, 18u8, 190u8, 213u8, 157u8, + 12u8, 139u8, 97u8, 7u8, 75u8, 196u8, 159u8, 122u8, 32u8, 164u8, 154u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] + #[doc = "Move some assets from one account to another."] #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] - #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] - #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] - #[doc = "meet the right value."] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `source`: The account to be debited."] + #[doc = "- `dest`: The account to be credited."] + #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] + #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] + #[doc = "below the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] - #[doc = "making this call."] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account to delegate permission to transfer asset."] - #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] - #[doc = "already an approval in place, then this acts additively."] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] + #[doc = "`dest`."] + pub fn force_transfer( + &self, + id: types::force_transfer::Id, + source: types::force_transfer::Source, + dest: types::force_transfer::Dest, + amount: types::force_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_transfer", + types::ForceTransfer { id, source, dest, amount }, + [ + 10u8, 210u8, 8u8, 209u8, 8u8, 78u8, 40u8, 213u8, 235u8, 176u8, 144u8, + 145u8, 70u8, 13u8, 75u8, 72u8, 166u8, 137u8, 22u8, 191u8, 226u8, 244u8, + 92u8, 183u8, 129u8, 212u8, 158u8, 179u8, 169u8, 232u8, 177u8, 225u8, + ], + ) + } + #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] + #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] + #[doc = "account that does not have an entry, use `touch_other` first."] #[doc = ""] - #[doc = "Emits `ApprovedTransfer` on success."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be frozen."] + #[doc = ""] + #[doc = "Emits `Frozen`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ApproveTransfer { - #[codec(compact)] - pub id: approve_transfer::Id, - pub delegate: approve_transfer::Delegate, - #[codec(compact)] - pub amount: approve_transfer::Amount, - } - pub mod approve_transfer { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveTransfer { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "approve_transfer"; + pub fn freeze( + &self, + id: types::freeze::Id, + who: types::freeze::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "freeze", + types::Freeze { id, who }, + [ + 180u8, 124u8, 252u8, 66u8, 205u8, 23u8, 32u8, 217u8, 173u8, 10u8, 91u8, + 57u8, 44u8, 215u8, 234u8, 152u8, 115u8, 38u8, 141u8, 212u8, 57u8, + 217u8, 169u8, 61u8, 215u8, 130u8, 172u8, 58u8, 90u8, 193u8, 25u8, + 249u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place between signer and"] - #[doc = "`delegate`."] + #[doc = "Allow unprivileged transfers to and from an account again."] #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be unfrozen."] #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = "Emits `Thawed`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct CancelApproval { - #[codec(compact)] - pub id: cancel_approval::Id, - pub delegate: cancel_approval::Delegate, - } - pub mod cancel_approval { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelApproval { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "cancel_approval"; + pub fn thaw( + &self, + id: types::thaw::Id, + who: types::thaw::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "thaw", + types::Thaw { id, who }, + [ + 187u8, 130u8, 9u8, 152u8, 231u8, 9u8, 245u8, 162u8, 115u8, 19u8, 73u8, + 176u8, 16u8, 230u8, 30u8, 60u8, 180u8, 183u8, 154u8, 160u8, 72u8, + 219u8, 116u8, 57u8, 140u8, 6u8, 105u8, 38u8, 98u8, 90u8, 250u8, 135u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] - #[doc = "account of the asset `id`."] + #[doc = "Disallow further unprivileged transfers for the asset class."] #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = "- `id`: The identifier of the asset to be frozen."] #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = "Emits `Frozen`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceCancelApproval { - #[codec(compact)] - pub id: force_cancel_approval::Id, - pub owner: force_cancel_approval::Owner, - pub delegate: force_cancel_approval::Delegate, - } - pub mod force_cancel_approval { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCancelApproval { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_cancel_approval"; + pub fn freeze_asset( + &self, + id: types::freeze_asset::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "freeze_asset", + types::FreezeAsset { id }, + [ + 75u8, 237u8, 183u8, 112u8, 112u8, 123u8, 250u8, 203u8, 169u8, 51u8, + 218u8, 35u8, 159u8, 23u8, 21u8, 10u8, 167u8, 84u8, 161u8, 212u8, 124u8, + 236u8, 88u8, 175u8, 48u8, 195u8, 33u8, 145u8, 141u8, 156u8, 31u8, + 250u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] - #[doc = "account."] + #[doc = "Allow unprivileged transfers for the asset again."] #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] - #[doc = "signer."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] - #[doc = "reserved by `approve_transfer` is unreserved."] + #[doc = "- `id`: The identifier of the asset to be thawed."] + #[doc = ""] + #[doc = "Emits `Thawed`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn thaw_asset( + &self, + id: types::thaw_asset::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "thaw_asset", + types::ThawAsset { id }, + [ + 151u8, 6u8, 170u8, 114u8, 55u8, 8u8, 5u8, 194u8, 251u8, 78u8, 232u8, + 181u8, 157u8, 62u8, 16u8, 39u8, 79u8, 119u8, 205u8, 198u8, 199u8, 26u8, + 92u8, 162u8, 169u8, 173u8, 93u8, 51u8, 7u8, 79u8, 198u8, 77u8, + ], + ) + } + #[doc = "Change the Owner of an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] - #[doc = "from which the asset balance will be withdrawn."] - #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] - #[doc = "- `amount`: The amount of assets to transfer."] + #[doc = "- `owner`: The new Owner of this asset."] #[doc = ""] - #[doc = "Emits `TransferredApproved` on success."] + #[doc = "Emits `OwnerChanged`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct TransferApproved { - #[codec(compact)] - pub id: transfer_approved::Id, - pub owner: transfer_approved::Owner, - pub destination: transfer_approved::Destination, - #[codec(compact)] - pub amount: transfer_approved::Amount, - } - pub mod transfer_approved { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Destination = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferApproved { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_approved"; + pub fn transfer_ownership( + &self, + id: types::transfer_ownership::Id, + owner: types::transfer_ownership::Owner, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer_ownership", + types::TransferOwnership { id, owner }, + [ + 65u8, 85u8, 40u8, 202u8, 212u8, 170u8, 130u8, 132u8, 140u8, 90u8, 68u8, + 28u8, 101u8, 154u8, 222u8, 150u8, 244u8, 165u8, 44u8, 22u8, 225u8, + 152u8, 7u8, 162u8, 110u8, 54u8, 173u8, 181u8, 54u8, 215u8, 105u8, + 239u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create an asset account for non-provider assets."] + #[doc = "Change the Issuer, Admin and Freezer of an asset."] #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub struct Touch { - #[codec(compact)] - pub id: touch::Id, - } - pub mod touch { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Touch { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "touch"; + #[doc = "Emits `TeamChanged`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn set_team( + &self, + id: types::set_team::Id, + issuer: types::set_team::Issuer, + admin: types::set_team::Admin, + freezer: types::set_team::Freezer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "set_team", + types::SetTeam { id, issuer, admin, freezer }, + [ + 52u8, 75u8, 50u8, 30u8, 164u8, 161u8, 121u8, 25u8, 135u8, 83u8, 115u8, + 25u8, 103u8, 1u8, 124u8, 206u8, 83u8, 182u8, 41u8, 116u8, 44u8, 37u8, + 75u8, 70u8, 252u8, 225u8, 240u8, 144u8, 96u8, 160u8, 151u8, 4u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] - #[doc = "account."] + #[doc = "Set the metadata for an asset."] #[doc = ""] - #[doc = "The origin must be Signed."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] - #[doc = " refunded."] - #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] + #[doc = "Funds of sender are reserved according to the formula:"] + #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] + #[doc = "account any already reserved funds."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub struct Refund { - #[codec(compact)] - pub id: refund::Id, - pub allow_burn: refund::AllowBurn, - } - pub mod refund { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type AllowBurn = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Refund { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "refund"; + #[doc = "Emits `MetadataSet`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn set_metadata( + &self, + id: types::set_metadata::Id, + name: types::set_metadata::Name, + symbol: types::set_metadata::Symbol, + decimals: types::set_metadata::Decimals, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "set_metadata", + types::SetMetadata { id, name, symbol, decimals }, + [ + 215u8, 66u8, 15u8, 17u8, 88u8, 174u8, 77u8, 75u8, 229u8, 155u8, 160u8, + 34u8, 108u8, 194u8, 88u8, 238u8, 131u8, 97u8, 234u8, 102u8, 71u8, 56u8, + 70u8, 248u8, 211u8, 85u8, 72u8, 92u8, 71u8, 222u8, 190u8, 91u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the minimum balance of an asset."] + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = "Only works if there aren't any accounts that are holding the asset or if"] - #[doc = "the new value of `min_balance` is less than the old one."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "Origin must be Signed and the sender has to be the Owner of the"] - #[doc = "asset `id`."] + #[doc = "Any deposit is freed for the asset owner."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `min_balance`: The new value of `min_balance`."] + #[doc = "- `id`: The identifier of the asset to clear."] #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - pub struct SetMinBalance { - #[codec(compact)] - pub id: set_min_balance::Id, - pub min_balance: set_min_balance::MinBalance, - } - pub mod set_min_balance { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type MinBalance = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMinBalance { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_min_balance"; + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn clear_metadata( + &self, + id: types::clear_metadata::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "clear_metadata", + types::ClearMetadata { id }, + [ + 68u8, 172u8, 6u8, 158u8, 237u8, 254u8, 22u8, 4u8, 254u8, 157u8, 179u8, + 168u8, 105u8, 114u8, 56u8, 166u8, 213u8, 38u8, 188u8, 195u8, 99u8, + 43u8, 142u8, 220u8, 94u8, 248u8, 51u8, 226u8, 233u8, 114u8, 86u8, 93u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create an asset account for `who`."] + #[doc = "Force the metadata for an asset to some value."] #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created, the asset status must"] - #[doc = " be live."] - #[doc = "- `who`: The account to be created."] + #[doc = "Any deposit is left alone."] #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub struct TouchOther { - #[codec(compact)] - pub id: touch_other::Id, - pub who: touch_other::Who, - } - pub mod touch_other { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TouchOther { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "touch_other"; + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = ""] + #[doc = "Emits `MetadataSet`."] + #[doc = ""] + #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] + pub fn force_set_metadata( + &self, + id: types::force_set_metadata::Id, + name: types::force_set_metadata::Name, + symbol: types::force_set_metadata::Symbol, + decimals: types::force_set_metadata::Decimals, + is_frozen: types::force_set_metadata::IsFrozen, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_set_metadata", + types::ForceSetMetadata { id, name, symbol, decimals, is_frozen }, + [ + 76u8, 90u8, 182u8, 13u8, 133u8, 248u8, 94u8, 136u8, 169u8, 114u8, + 151u8, 20u8, 106u8, 89u8, 78u8, 228u8, 22u8, 29u8, 68u8, 8u8, 54u8, + 47u8, 1u8, 186u8, 45u8, 167u8, 14u8, 112u8, 34u8, 43u8, 91u8, 140u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] - #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] - #[doc = "use `refund`."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `who`: The account to refund."] + #[doc = "Any deposit is returned."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] + #[doc = "- `id`: The identifier of the asset to clear."] #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub struct RefundOther { - #[codec(compact)] - pub id: refund_other::Id, - pub who: refund_other::Who, + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn force_clear_metadata( + &self, + id: types::force_clear_metadata::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_clear_metadata", + types::ForceClearMetadata { id }, + [ + 2u8, 224u8, 84u8, 48u8, 130u8, 132u8, 79u8, 38u8, 217u8, 17u8, 165u8, + 139u8, 89u8, 53u8, 116u8, 184u8, 32u8, 91u8, 122u8, 39u8, 85u8, 40u8, + 213u8, 216u8, 135u8, 171u8, 50u8, 69u8, 202u8, 28u8, 166u8, 147u8, + ], + ) } - pub mod refund_other { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundOther { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "refund_other"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the account's asset."] - #[doc = "- `who`: The account to be unblocked."] - #[doc = ""] - #[doc = "Emits `Blocked`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct Block { - #[codec(compact)] - pub id: block::Id, - pub who: block::Who, - } - pub mod block { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Block { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "block"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer the entire transferable balance from the caller asset account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] - #[doc = " (false), or transfer everything except at least the minimum balance, which will"] - #[doc = " guarantee to keep the sender asset account alive (true)."] - pub struct TransferAll { - #[codec(compact)] - pub id: transfer_all::Id, - pub dest: transfer_all::Dest, - pub keep_alive: transfer_all::KeepAlive, - } - pub mod transfer_all { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type KeepAlive = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAll { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_all"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the trusted reserve information of an asset."] + #[doc = "Alter the attributes of a given asset."] #[doc = ""] - #[doc = "Origin must be the Owner of the asset `id`. The origin must conform to the configured"] - #[doc = "`CreateOrigin` or be the signed `owner` configured during asset creation."] + #[doc = "Origin must be `ForceOrigin`."] #[doc = ""] #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `reserves`: The full list of trusted reserves information."] - #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - pub struct SetReserves { - #[codec(compact)] - pub id: set_reserves::Id, - pub reserves: set_reserves::Reserves, - } - pub mod set_reserves { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Reserves = - runtime_types::bounded_collections::bounded_vec::BoundedVec<()>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetReserves { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_reserves"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Issue a new class of fungible assets from a public origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially and its owner is the origin."] - #[doc = ""] - #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] - #[doc = ""] - #[doc = "Funds of sender are reserved by `AssetDeposit`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] - #[doc = "member of the asset class's admin team."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] + #[doc = "value to account for the state bloat associated with its balance storage. If set to"] + #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] + #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] + #[doc = "growth)."] + #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] + #[doc = "instructions."] #[doc = ""] - #[doc = "Emits `Created` event when successful."] + #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub fn create( + pub fn force_asset_status( &self, - id: types::create::Id, - admin: types::create::Admin, - min_balance: types::create::MinBalance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::force_asset_status::Id, + owner: types::force_asset_status::Owner, + issuer: types::force_asset_status::Issuer, + admin: types::force_asset_status::Admin, + freezer: types::force_asset_status::Freezer, + min_balance: types::force_asset_status::MinBalance, + is_sufficient: types::force_asset_status::IsSufficient, + is_frozen: types::force_asset_status::IsFrozen, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "create", - types::Create { id, admin, min_balance }, + "force_asset_status", + types::ForceAssetStatus { + id, + owner, + issuer, + admin, + freezer, + min_balance, + is_sufficient, + is_frozen, + }, [ - 120u8, 25u8, 99u8, 39u8, 102u8, 201u8, 14u8, 2u8, 32u8, 139u8, 206u8, - 218u8, 223u8, 161u8, 25u8, 98u8, 159u8, 133u8, 65u8, 105u8, 45u8, 4u8, - 28u8, 49u8, 248u8, 147u8, 2u8, 179u8, 11u8, 195u8, 177u8, 250u8, + 149u8, 136u8, 250u8, 33u8, 53u8, 220u8, 207u8, 187u8, 42u8, 118u8, + 93u8, 173u8, 100u8, 243u8, 234u8, 207u8, 88u8, 45u8, 79u8, 221u8, + 113u8, 166u8, 229u8, 171u8, 223u8, 126u8, 20u8, 67u8, 19u8, 77u8, 44u8, + 19u8, ], ) } - #[doc = "Issue a new class of fungible assets from a privileged origin."] + #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] #[doc = ""] - #[doc = "This new asset class has no assets initially."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin`."] + #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] + #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] + #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] + #[doc = "meet the right value."] #[doc = ""] - #[doc = "Unlike `create`, no funds are reserved."] + #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] + #[doc = "making this call."] #[doc = ""] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] - #[doc = "over this asset, but may later change and configure the permissions using"] - #[doc = "`transfer_ownership` and `set_team`."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account to delegate permission to transfer asset."] + #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] + #[doc = "already an approval in place, then this acts additively."] #[doc = ""] - #[doc = "Emits `ForceCreated` event when successful."] + #[doc = "Emits `ApprovedTransfer` on success."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub fn force_create( + pub fn approve_transfer( &self, - id: types::force_create::Id, - owner: types::force_create::Owner, - is_sufficient: types::force_create::IsSufficient, - min_balance: types::force_create::MinBalance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::approve_transfer::Id, + delegate: types::approve_transfer::Delegate, + amount: types::approve_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "force_create", - types::ForceCreate { id, owner, is_sufficient, min_balance }, + "approve_transfer", + types::ApproveTransfer { id, delegate, amount }, [ - 149u8, 41u8, 54u8, 146u8, 18u8, 248u8, 84u8, 52u8, 202u8, 88u8, 192u8, - 208u8, 247u8, 227u8, 254u8, 98u8, 92u8, 46u8, 164u8, 152u8, 143u8, - 20u8, 179u8, 227u8, 197u8, 247u8, 242u8, 153u8, 142u8, 148u8, 40u8, - 184u8, + 39u8, 227u8, 23u8, 143u8, 10u8, 120u8, 227u8, 1u8, 223u8, 78u8, 40u8, + 213u8, 249u8, 175u8, 170u8, 183u8, 10u8, 244u8, 117u8, 111u8, 140u8, + 157u8, 153u8, 212u8, 94u8, 119u8, 213u8, 44u8, 41u8, 8u8, 114u8, 200u8, ], ) } - #[doc = "Start the process of destroying a fungible asset class."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] - #[doc = "destruction of an asset class."] + #[doc = "Origin must be Signed and there must be an approval in place between signer and"] + #[doc = "`delegate`."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "an account contains holds or freezes in place."] - pub fn start_destroy( + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn cancel_approval( &self, - id: types::start_destroy::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::cancel_approval::Id, + delegate: types::cancel_approval::Delegate, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "start_destroy", - types::StartDestroy { id }, + "cancel_approval", + types::CancelApproval { id, delegate }, [ - 125u8, 82u8, 151u8, 106u8, 25u8, 49u8, 68u8, 203u8, 247u8, 175u8, - 117u8, 230u8, 84u8, 98u8, 172u8, 73u8, 233u8, 218u8, 212u8, 198u8, - 69u8, 35u8, 15u8, 179u8, 161u8, 205u8, 190u8, 109u8, 198u8, 214u8, - 65u8, 164u8, + 74u8, 117u8, 101u8, 78u8, 152u8, 208u8, 16u8, 102u8, 34u8, 195u8, 61u8, + 36u8, 85u8, 91u8, 253u8, 182u8, 61u8, 199u8, 12u8, 102u8, 149u8, 20u8, + 238u8, 207u8, 236u8, 50u8, 63u8, 249u8, 34u8, 85u8, 88u8, 229u8, ], ) } - #[doc = "Destroy all accounts associated with a given asset."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] + #[doc = "account of the asset `id`."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedAccounts` event."] - pub fn destroy_accounts( + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn force_cancel_approval( &self, - id: types::destroy_accounts::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + id: types::force_cancel_approval::Id, + owner: types::force_cancel_approval::Owner, + delegate: types::force_cancel_approval::Delegate, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "destroy_accounts", - types::DestroyAccounts { id }, + "force_cancel_approval", + types::ForceCancelApproval { id, owner, delegate }, [ - 236u8, 102u8, 233u8, 170u8, 179u8, 46u8, 42u8, 29u8, 200u8, 116u8, - 62u8, 114u8, 233u8, 59u8, 217u8, 215u8, 109u8, 232u8, 147u8, 95u8, - 255u8, 248u8, 119u8, 222u8, 216u8, 165u8, 138u8, 47u8, 28u8, 56u8, - 204u8, 93u8, + 27u8, 231u8, 85u8, 241u8, 18u8, 151u8, 64u8, 234u8, 11u8, 84u8, 252u8, + 128u8, 44u8, 247u8, 132u8, 82u8, 34u8, 210u8, 202u8, 50u8, 158u8, 45u8, + 239u8, 192u8, 7u8, 24u8, 39u8, 95u8, 57u8, 21u8, 178u8, 113u8, ], ) } - #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] + #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] + #[doc = "account."] #[doc = ""] - #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] + #[doc = "signer."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] + #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] + #[doc = "reserved by `approve_transfer` is unreserved."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] + #[doc = "from which the asset balance will be withdrawn."] + #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] + #[doc = "- `amount`: The amount of assets to transfer."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedApprovals` event."] - pub fn destroy_approvals( + #[doc = "Emits `TransferredApproved` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn transfer_approved( &self, - id: types::destroy_approvals::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + id: types::transfer_approved::Id, + owner: types::transfer_approved::Owner, + destination: types::transfer_approved::Destination, + amount: types::transfer_approved::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "destroy_approvals", - types::DestroyApprovals { id }, + "transfer_approved", + types::TransferApproved { id, owner, destination, amount }, [ - 34u8, 35u8, 15u8, 44u8, 239u8, 232u8, 88u8, 130u8, 130u8, 87u8, 171u8, - 255u8, 247u8, 179u8, 14u8, 35u8, 47u8, 223u8, 32u8, 232u8, 41u8, 105u8, - 207u8, 199u8, 90u8, 136u8, 144u8, 139u8, 252u8, 76u8, 177u8, 106u8, + 214u8, 51u8, 243u8, 129u8, 116u8, 233u8, 199u8, 183u8, 25u8, 5u8, + 109u8, 85u8, 255u8, 68u8, 36u8, 99u8, 99u8, 179u8, 34u8, 66u8, 65u8, + 82u8, 189u8, 174u8, 22u8, 100u8, 211u8, 13u8, 178u8, 19u8, 128u8, + 177u8, ], ) } - #[doc = "Complete destroying asset and unreserve currency."] + #[doc = "Create an asset account for non-provider assets."] #[doc = ""] - #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] - #[doc = "hand."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] #[doc = ""] - #[doc = "Each successful call emits the `Event::Destroyed` event."] - pub fn finish_destroy( + #[doc = "Emits `Touched` event when successful."] + pub fn touch( &self, - id: types::finish_destroy::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + id: types::touch::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "finish_destroy", - types::FinishDestroy { id }, + "touch", + types::Touch { id }, [ - 132u8, 67u8, 78u8, 84u8, 240u8, 51u8, 176u8, 119u8, 48u8, 34u8, 153u8, - 37u8, 25u8, 171u8, 21u8, 164u8, 53u8, 214u8, 36u8, 149u8, 20u8, 240u8, - 123u8, 195u8, 170u8, 162u8, 118u8, 81u8, 176u8, 218u8, 114u8, 113u8, + 50u8, 185u8, 46u8, 134u8, 136u8, 31u8, 191u8, 34u8, 215u8, 150u8, 73u8, + 103u8, 140u8, 36u8, 95u8, 156u8, 201u8, 152u8, 32u8, 165u8, 47u8, 86u8, + 163u8, 255u8, 8u8, 251u8, 176u8, 138u8, 165u8, 48u8, 12u8, 27u8, ], ) } - #[doc = "Mint assets of a particular class."] + #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] + #[doc = "account."] #[doc = ""] - #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = "The origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount minted."] - #[doc = "- `beneficiary`: The account to be credited with the minted assets."] - #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] + #[doc = " refunded."] + #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] #[doc = ""] - #[doc = "Emits `Issued` event when successful."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] - pub fn mint( + #[doc = "Emits `Refunded` event when successful."] + pub fn refund( &self, - id: types::mint::Id, - beneficiary: types::mint::Beneficiary, - amount: types::mint::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::refund::Id, + allow_burn: types::refund::AllowBurn, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "mint", - types::Mint { id, beneficiary, amount }, + "refund", + types::Refund { id, allow_burn }, [ - 172u8, 131u8, 103u8, 81u8, 206u8, 2u8, 143u8, 114u8, 137u8, 60u8, - 147u8, 67u8, 226u8, 64u8, 71u8, 11u8, 36u8, 145u8, 51u8, 8u8, 0u8, - 110u8, 8u8, 195u8, 103u8, 205u8, 156u8, 43u8, 215u8, 12u8, 150u8, - 135u8, + 218u8, 207u8, 8u8, 41u8, 154u8, 250u8, 117u8, 174u8, 143u8, 133u8, + 34u8, 113u8, 171u8, 18u8, 177u8, 227u8, 146u8, 92u8, 12u8, 226u8, + 101u8, 230u8, 246u8, 162u8, 32u8, 73u8, 138u8, 158u8, 95u8, 226u8, + 75u8, 95u8, ], ) } - #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] + #[doc = "Sets the minimum balance of an asset."] #[doc = ""] - #[doc = "Bails with `NoAccount` if the `who` is already dead."] + #[doc = "Only works if there aren't any accounts that are holding the asset or if"] + #[doc = "the new value of `min_balance` is less than the old one."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount burned."] - #[doc = "- `who`: The account to be debited from."] - #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = "Origin must be Signed and the sender has to be the Owner of the"] + #[doc = "asset `id`."] #[doc = ""] - #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] - #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `min_balance`: The new value of `min_balance`."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] - pub fn burn( + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + pub fn set_min_balance( &self, - id: types::burn::Id, - who: types::burn::Who, - amount: types::burn::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::set_min_balance::Id, + min_balance: types::set_min_balance::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "burn", - types::Burn { id, who, amount }, + "set_min_balance", + types::SetMinBalance { id, min_balance }, [ - 105u8, 133u8, 82u8, 100u8, 124u8, 65u8, 174u8, 31u8, 152u8, 45u8, 23u8, - 200u8, 23u8, 199u8, 239u8, 8u8, 187u8, 142u8, 21u8, 192u8, 35u8, 211u8, - 172u8, 130u8, 169u8, 74u8, 167u8, 36u8, 149u8, 7u8, 19u8, 37u8, + 141u8, 241u8, 137u8, 50u8, 232u8, 122u8, 252u8, 104u8, 185u8, 170u8, + 246u8, 0u8, 20u8, 128u8, 136u8, 155u8, 62u8, 243u8, 4u8, 221u8, 42u8, + 225u8, 16u8, 245u8, 58u8, 127u8, 84u8, 193u8, 175u8, 165u8, 35u8, 49u8, ], ) } - #[doc = "Move some assets from the sender account to another."] - #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "Create an asset account for `who`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created, the asset status must"] + #[doc = " be live."] + #[doc = "- `who`: The account to be created."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub fn transfer( + #[doc = "Emits `Touched` event when successful."] + pub fn touch_other( &self, - id: types::transfer::Id, - target: types::transfer::Target, - amount: types::transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::touch_other::Id, + who: types::touch_other::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "transfer", - types::Transfer { id, target, amount }, + "touch_other", + types::TouchOther { id, who }, [ - 126u8, 31u8, 70u8, 179u8, 222u8, 190u8, 12u8, 19u8, 94u8, 225u8, 217u8, - 109u8, 54u8, 69u8, 124u8, 61u8, 97u8, 199u8, 193u8, 166u8, 39u8, 143u8, - 125u8, 251u8, 87u8, 173u8, 149u8, 91u8, 182u8, 18u8, 184u8, 65u8, + 104u8, 85u8, 80u8, 68u8, 135u8, 149u8, 102u8, 104u8, 188u8, 79u8, 42u8, + 34u8, 241u8, 84u8, 183u8, 176u8, 215u8, 172u8, 78u8, 196u8, 206u8, + 214u8, 138u8, 240u8, 92u8, 65u8, 117u8, 170u8, 140u8, 120u8, 50u8, + 166u8, ], ) } - #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] - #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] + #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] + #[doc = "use `refund`."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `who`: The account to refund."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub fn transfer_keep_alive( + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] + #[doc = ""] + #[doc = "Emits `Refunded` event when successful."] + pub fn refund_other( &self, - id: types::transfer_keep_alive::Id, - target: types::transfer_keep_alive::Target, - amount: types::transfer_keep_alive::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + id: types::refund_other::Id, + who: types::refund_other::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "transfer_keep_alive", - types::TransferKeepAlive { id, target, amount }, + "refund_other", + types::RefundOther { id, who }, [ - 99u8, 101u8, 219u8, 188u8, 238u8, 230u8, 141u8, 43u8, 38u8, 175u8, - 46u8, 89u8, 33u8, 23u8, 223u8, 115u8, 108u8, 18u8, 190u8, 213u8, 157u8, - 12u8, 139u8, 97u8, 7u8, 75u8, 196u8, 159u8, 122u8, 32u8, 164u8, 154u8, + 113u8, 58u8, 33u8, 109u8, 233u8, 229u8, 210u8, 40u8, 176u8, 252u8, + 131u8, 80u8, 33u8, 132u8, 19u8, 170u8, 145u8, 146u8, 246u8, 31u8, + 222u8, 120u8, 167u8, 187u8, 8u8, 144u8, 164u8, 251u8, 52u8, 249u8, + 91u8, 136u8, ], ) } - #[doc = "Move some assets from one account to another."] + #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `source`: The account to be debited."] - #[doc = "- `dest`: The account to be credited."] - #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] - #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] - #[doc = "below the minimum balance. Must be greater than zero."] + #[doc = "- `id`: The identifier of the account's asset."] + #[doc = "- `who`: The account to be unblocked."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "Emits `Blocked`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] - #[doc = "`dest`."] - pub fn force_transfer( + pub fn block( &self, - id: types::force_transfer::Id, - source: types::force_transfer::Source, - dest: types::force_transfer::Dest, - amount: types::force_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + id: types::block::Id, + who: types::block::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "force_transfer", - types::ForceTransfer { id, source, dest, amount }, + "block", + types::Block { id, who }, [ - 10u8, 210u8, 8u8, 209u8, 8u8, 78u8, 40u8, 213u8, 235u8, 176u8, 144u8, - 145u8, 70u8, 13u8, 75u8, 72u8, 166u8, 137u8, 22u8, 191u8, 226u8, 244u8, - 92u8, 183u8, 129u8, 212u8, 158u8, 179u8, 169u8, 232u8, 177u8, 225u8, + 224u8, 63u8, 26u8, 229u8, 23u8, 164u8, 212u8, 170u8, 156u8, 104u8, + 63u8, 158u8, 53u8, 162u8, 157u8, 127u8, 183u8, 94u8, 211u8, 123u8, + 228u8, 198u8, 47u8, 80u8, 53u8, 122u8, 46u8, 69u8, 67u8, 170u8, 193u8, + 33u8, ], ) } - #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] - #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] - #[doc = "account that does not have an entry, use `touch_other` first."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = "Transfer the entire transferable balance from the caller asset account."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be frozen."] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] #[doc = ""] - #[doc = "Emits `Frozen`."] + #[doc = "The dispatch origin of this call must be Signed."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn freeze( + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] + #[doc = " (false), or transfer everything except at least the minimum balance, which will"] + #[doc = " guarantee to keep the sender asset account alive (true)."] + pub fn transfer_all( &self, - id: types::freeze::Id, - who: types::freeze::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::transfer_all::Id, + dest: types::transfer_all::Dest, + keep_alive: types::transfer_all::KeepAlive, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "freeze", - types::Freeze { id, who }, + "transfer_all", + types::TransferAll { id, dest, keep_alive }, [ - 180u8, 124u8, 252u8, 66u8, 205u8, 23u8, 32u8, 217u8, 173u8, 10u8, 91u8, - 57u8, 44u8, 215u8, 234u8, 152u8, 115u8, 38u8, 141u8, 212u8, 57u8, - 217u8, 169u8, 61u8, 215u8, 130u8, 172u8, 58u8, 90u8, 193u8, 25u8, - 249u8, + 180u8, 161u8, 252u8, 127u8, 200u8, 117u8, 245u8, 213u8, 170u8, 169u8, + 178u8, 115u8, 156u8, 8u8, 79u8, 50u8, 168u8, 229u8, 87u8, 33u8, 238u8, + 124u8, 13u8, 210u8, 81u8, 132u8, 236u8, 46u8, 101u8, 18u8, 22u8, 61u8, ], ) } - #[doc = "Allow unprivileged transfers to and from an account again."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "Sets the trusted reserve information of an asset."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be unfrozen."] + #[doc = "Origin must be the Owner of the asset `id`. The origin must conform to the configured"] + #[doc = "`CreateOrigin` or be the signed `owner` configured during asset creation."] #[doc = ""] - #[doc = "Emits `Thawed`."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `reserves`: The full list of trusted reserves information."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn thaw( + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + pub fn set_reserves( &self, - id: types::thaw::Id, - who: types::thaw::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::set_reserves::Id, + reserves: types::set_reserves::Reserves, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "thaw", - types::Thaw { id, who }, + "set_reserves", + types::SetReserves { id, reserves }, [ - 187u8, 130u8, 9u8, 152u8, 231u8, 9u8, 245u8, 162u8, 115u8, 19u8, 73u8, - 176u8, 16u8, 230u8, 30u8, 60u8, 180u8, 183u8, 154u8, 160u8, 72u8, - 219u8, 116u8, 57u8, 140u8, 6u8, 105u8, 38u8, 98u8, 90u8, 250u8, 135u8, + 170u8, 210u8, 175u8, 235u8, 220u8, 223u8, 164u8, 253u8, 189u8, 4u8, + 100u8, 160u8, 181u8, 44u8, 79u8, 187u8, 37u8, 102u8, 0u8, 187u8, 48u8, + 82u8, 247u8, 200u8, 2u8, 141u8, 57u8, 55u8, 224u8, 32u8, 176u8, 231u8, ], ) } - #[doc = "Disallow further unprivileged transfers for the asset class."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = ""] - #[doc = "Emits `Frozen`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn freeze_asset( + } + } + pub mod view_functions { + use super::{root_mod, runtime_types}; + pub struct ViewFunctionsApi; + impl ViewFunctionsApi { + #[doc = " Provide the asset details for asset `id`."] + pub fn asset_details( &self, - id: types::freeze_asset::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "freeze_asset", - types::FreezeAsset { id }, + id: asset_details::Id, + ) -> ::subxt::ext::subxt_core::view_functions::payload::StaticPayload< + asset_details::Input, + asset_details::output::Output, + > { + ::subxt::ext::subxt_core::view_functions::payload::StaticPayload::new_static( [ - 75u8, 237u8, 183u8, 112u8, 112u8, 123u8, 250u8, 203u8, 169u8, 51u8, - 218u8, 35u8, 159u8, 23u8, 21u8, 10u8, 167u8, 84u8, 161u8, 212u8, 124u8, - 236u8, 88u8, 175u8, 48u8, 195u8, 33u8, 145u8, 141u8, 156u8, 31u8, - 250u8, + 104u8, 42u8, 89u8, 213u8, 26u8, 185u8, 228u8, 138u8, 140u8, 140u8, + 196u8, 24u8, 255u8, 151u8, 8u8, 210u8, 167u8, 2u8, 151u8, 173u8, 11u8, + 75u8, 221u8, 61u8, 164u8, 183u8, 70u8, 41u8, 166u8, 90u8, 110u8, 92u8, + ], + asset_details::Input { id }, + [ + 211u8, 90u8, 10u8, 200u8, 75u8, 44u8, 223u8, 16u8, 230u8, 165u8, 250u8, + 228u8, 154u8, 9u8, 130u8, 112u8, 113u8, 184u8, 170u8, 127u8, 188u8, + 95u8, 63u8, 51u8, 78u8, 130u8, 147u8, 123u8, 190u8, 170u8, 16u8, 65u8, ], ) } - #[doc = "Allow unprivileged transfers for the asset again."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be thawed."] - #[doc = ""] - #[doc = "Emits `Thawed`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn thaw_asset( + #[doc = " Provide the balance of `who` for asset `id`."] + pub fn balance_of( &self, - id: types::thaw_asset::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "thaw_asset", - types::ThawAsset { id }, + who: balance_of::Who, + id: balance_of::Id, + ) -> ::subxt::ext::subxt_core::view_functions::payload::StaticPayload< + balance_of::Input, + balance_of::output::Output, + > { + ::subxt::ext::subxt_core::view_functions::payload::StaticPayload::new_static( [ - 151u8, 6u8, 170u8, 114u8, 55u8, 8u8, 5u8, 194u8, 251u8, 78u8, 232u8, - 181u8, 157u8, 62u8, 16u8, 39u8, 79u8, 119u8, 205u8, 198u8, 199u8, 26u8, - 92u8, 162u8, 169u8, 173u8, 93u8, 51u8, 7u8, 79u8, 198u8, 77u8, + 104u8, 42u8, 89u8, 213u8, 26u8, 185u8, 228u8, 138u8, 140u8, 140u8, + 196u8, 24u8, 255u8, 151u8, 8u8, 210u8, 83u8, 26u8, 199u8, 226u8, 27u8, + 118u8, 177u8, 33u8, 231u8, 97u8, 228u8, 115u8, 65u8, 154u8, 27u8, 2u8, + ], + balance_of::Input { who, id }, + [ + 111u8, 166u8, 174u8, 198u8, 50u8, 246u8, 223u8, 192u8, 195u8, 6u8, + 218u8, 113u8, 85u8, 251u8, 79u8, 59u8, 196u8, 83u8, 39u8, 141u8, 200u8, + 113u8, 92u8, 67u8, 110u8, 112u8, 255u8, 77u8, 94u8, 232u8, 148u8, + 189u8, ], ) } - #[doc = "Change the Owner of an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = ""] - #[doc = "Emits `OwnerChanged`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn transfer_ownership( + #[doc = " Provide the configured metadata for asset `id`."] + pub fn get_metadata( &self, - id: types::transfer_ownership::Id, - owner: types::transfer_ownership::Owner, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "transfer_ownership", - types::TransferOwnership { id, owner }, - [ - 65u8, 85u8, 40u8, 202u8, 212u8, 170u8, 130u8, 132u8, 140u8, 90u8, 68u8, - 28u8, 101u8, 154u8, 222u8, 150u8, 244u8, 165u8, 44u8, 22u8, 225u8, - 152u8, 7u8, 162u8, 110u8, 54u8, 173u8, 181u8, 54u8, 215u8, 105u8, - 239u8, - ], - ) - } - #[doc = "Change the Issuer, Admin and Freezer of an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = ""] - #[doc = "Emits `TeamChanged`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn set_team( - &self, - id: types::set_team::Id, - issuer: types::set_team::Issuer, - admin: types::set_team::Admin, - freezer: types::set_team::Freezer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "set_team", - types::SetTeam { id, issuer, admin, freezer }, + id: get_metadata::Id, + ) -> ::subxt::ext::subxt_core::view_functions::payload::StaticPayload< + get_metadata::Input, + get_metadata::output::Output, + > { + ::subxt::ext::subxt_core::view_functions::payload::StaticPayload::new_static( [ - 52u8, 75u8, 50u8, 30u8, 164u8, 161u8, 121u8, 25u8, 135u8, 83u8, 115u8, - 25u8, 103u8, 1u8, 124u8, 206u8, 83u8, 182u8, 41u8, 116u8, 44u8, 37u8, - 75u8, 70u8, 252u8, 225u8, 240u8, 144u8, 96u8, 160u8, 151u8, 4u8, + 104u8, 42u8, 89u8, 213u8, 26u8, 185u8, 228u8, 138u8, 140u8, 140u8, + 196u8, 24u8, 255u8, 151u8, 8u8, 210u8, 46u8, 135u8, 102u8, 164u8, 13u8, + 27u8, 105u8, 214u8, 21u8, 27u8, 216u8, 1u8, 229u8, 117u8, 80u8, 94u8, ], - ) - } - #[doc = "Set the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "Funds of sender are reserved according to the formula:"] - #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] - #[doc = "account any already reserved funds."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] - #[doc = ""] - #[doc = "Emits `MetadataSet`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn set_metadata( - &self, - id: types::set_metadata::Id, - name: types::set_metadata::Name, - symbol: types::set_metadata::Symbol, - decimals: types::set_metadata::Decimals, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "set_metadata", - types::SetMetadata { id, name, symbol, decimals }, + get_metadata::Input { id }, [ - 215u8, 66u8, 15u8, 17u8, 88u8, 174u8, 77u8, 75u8, 229u8, 155u8, 160u8, - 34u8, 108u8, 194u8, 88u8, 238u8, 131u8, 97u8, 234u8, 102u8, 71u8, 56u8, - 70u8, 248u8, 211u8, 85u8, 72u8, 92u8, 71u8, 222u8, 190u8, 91u8, + 194u8, 126u8, 37u8, 51u8, 199u8, 8u8, 17u8, 77u8, 127u8, 118u8, 9u8, + 196u8, 248u8, 40u8, 136u8, 175u8, 243u8, 35u8, 137u8, 159u8, 137u8, + 162u8, 58u8, 4u8, 206u8, 51u8, 222u8, 234u8, 218u8, 8u8, 23u8, 195u8, ], ) } - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "Any deposit is freed for the asset owner."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] - #[doc = ""] - #[doc = "Emits `MetadataCleared`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn clear_metadata( + #[doc = " Provide the configured reserves data for asset `id`."] + pub fn get_reserves_data( &self, - id: types::clear_metadata::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "clear_metadata", - types::ClearMetadata { id }, + id: get_reserves_data::Id, + ) -> ::subxt::ext::subxt_core::view_functions::payload::StaticPayload< + get_reserves_data::Input, + get_reserves_data::output::Output, + > { + ::subxt::ext::subxt_core::view_functions::payload::StaticPayload::new_static( [ - 68u8, 172u8, 6u8, 158u8, 237u8, 254u8, 22u8, 4u8, 254u8, 157u8, 179u8, - 168u8, 105u8, 114u8, 56u8, 166u8, 213u8, 38u8, 188u8, 195u8, 99u8, - 43u8, 142u8, 220u8, 94u8, 248u8, 51u8, 226u8, 233u8, 114u8, 86u8, 93u8, + 104u8, 42u8, 89u8, 213u8, 26u8, 185u8, 228u8, 138u8, 140u8, 140u8, + 196u8, 24u8, 255u8, 151u8, 8u8, 210u8, 100u8, 246u8, 63u8, 41u8, 35u8, + 227u8, 152u8, 40u8, 36u8, 49u8, 99u8, 129u8, 174u8, 30u8, 105u8, 134u8, ], - ) - } - #[doc = "Force the metadata for an asset to some value."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] - #[doc = ""] - #[doc = "Any deposit is left alone."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] - #[doc = ""] - #[doc = "Emits `MetadataSet`."] - #[doc = ""] - #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] - pub fn force_set_metadata( - &self, - id: types::force_set_metadata::Id, - name: types::force_set_metadata::Name, - symbol: types::force_set_metadata::Symbol, - decimals: types::force_set_metadata::Decimals, - is_frozen: types::force_set_metadata::IsFrozen, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_set_metadata", - types::ForceSetMetadata { id, name, symbol, decimals, is_frozen }, + get_reserves_data::Input { id }, [ - 76u8, 90u8, 182u8, 13u8, 133u8, 248u8, 94u8, 136u8, 169u8, 114u8, - 151u8, 20u8, 106u8, 89u8, 78u8, 228u8, 22u8, 29u8, 68u8, 8u8, 54u8, - 47u8, 1u8, 186u8, 45u8, 167u8, 14u8, 112u8, 34u8, 43u8, 91u8, 140u8, + 209u8, 99u8, 108u8, 142u8, 202u8, 226u8, 194u8, 23u8, 99u8, 165u8, + 72u8, 212u8, 158u8, 187u8, 5u8, 201u8, 58u8, 51u8, 161u8, 119u8, 0u8, + 58u8, 15u8, 109u8, 255u8, 0u8, 192u8, 222u8, 51u8, 241u8, 34u8, 116u8, ], ) } - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] - #[doc = ""] - #[doc = "Any deposit is returned."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] - #[doc = ""] - #[doc = "Emits `MetadataCleared`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn force_clear_metadata( - &self, - id: types::force_clear_metadata::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_clear_metadata", - types::ForceClearMetadata { id }, - [ - 2u8, 224u8, 84u8, 48u8, 130u8, 132u8, 79u8, 38u8, 217u8, 17u8, 165u8, - 139u8, 89u8, 53u8, 116u8, 184u8, 32u8, 91u8, 122u8, 39u8, 85u8, 40u8, - 213u8, 216u8, 135u8, 171u8, 50u8, 69u8, 202u8, 28u8, 166u8, 147u8, - ], - ) + } + pub mod asset_details { + use super::{root_mod, runtime_types}; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct Input { + pub id: Id, } - #[doc = "Alter the attributes of a given asset."] - #[doc = ""] - #[doc = "Origin must be `ForceOrigin`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] - #[doc = "value to account for the state bloat associated with its balance storage. If set to"] - #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] - #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] - #[doc = "growth)."] - #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] - #[doc = "instructions."] - #[doc = ""] - #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn force_asset_status( - &self, - id: types::force_asset_status::Id, - owner: types::force_asset_status::Owner, - issuer: types::force_asset_status::Issuer, - admin: types::force_asset_status::Admin, - freezer: types::force_asset_status::Freezer, - min_balance: types::force_asset_status::MinBalance, - is_sufficient: types::force_asset_status::IsSufficient, - is_frozen: types::force_asset_status::IsFrozen, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_asset_status", - types::ForceAssetStatus { - id, - owner, - issuer, - admin, - freezer, - min_balance, - is_sufficient, - is_frozen, - }, - [ - 149u8, 136u8, 250u8, 33u8, 53u8, 220u8, 207u8, 187u8, 42u8, 118u8, - 93u8, 173u8, 100u8, 243u8, 234u8, 207u8, 88u8, 45u8, 79u8, 221u8, - 113u8, 166u8, 229u8, 171u8, 223u8, 126u8, 20u8, 67u8, 19u8, 77u8, 44u8, - 19u8, - ], - ) + pub type Id = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::pallet_assets::types::AssetDetails< + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >, + >; } - #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed."] - #[doc = ""] - #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] - #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] - #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] - #[doc = "meet the right value."] - #[doc = ""] - #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] - #[doc = "making this call."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account to delegate permission to transfer asset."] - #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] - #[doc = "already an approval in place, then this acts additively."] - #[doc = ""] - #[doc = "Emits `ApprovedTransfer` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn approve_transfer( - &self, - id: types::approve_transfer::Id, - delegate: types::approve_transfer::Delegate, - amount: types::approve_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "approve_transfer", - types::ApproveTransfer { id, delegate, amount }, - [ - 39u8, 227u8, 23u8, 143u8, 10u8, 120u8, 227u8, 1u8, 223u8, 78u8, 40u8, - 213u8, 249u8, 175u8, 170u8, 183u8, 10u8, 244u8, 117u8, 111u8, 140u8, - 157u8, 153u8, 212u8, 94u8, 119u8, 213u8, 44u8, 41u8, 8u8, 114u8, 200u8, - ], - ) + } + pub mod balance_of { + use super::{root_mod, runtime_types}; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct Input { + pub who: Who, + pub id: Id, } - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place between signer and"] - #[doc = "`delegate`."] - #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] - #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn cancel_approval( - &self, - id: types::cancel_approval::Id, - delegate: types::cancel_approval::Delegate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "cancel_approval", - types::CancelApproval { id, delegate }, - [ - 74u8, 117u8, 101u8, 78u8, 152u8, 208u8, 16u8, 102u8, 34u8, 195u8, 61u8, - 36u8, 85u8, 91u8, 253u8, 182u8, 61u8, 199u8, 12u8, 102u8, 149u8, 20u8, - 238u8, 207u8, 236u8, 50u8, 63u8, 249u8, 34u8, 85u8, 88u8, 229u8, - ], - ) + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Id = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option<::core::primitive::u128>; } - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] - #[doc = "account of the asset `id`."] - #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] - #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn force_cancel_approval( - &self, - id: types::force_cancel_approval::Id, - owner: types::force_cancel_approval::Owner, - delegate: types::force_cancel_approval::Delegate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_cancel_approval", - types::ForceCancelApproval { id, owner, delegate }, - [ - 27u8, 231u8, 85u8, 241u8, 18u8, 151u8, 64u8, 234u8, 11u8, 84u8, 252u8, - 128u8, 44u8, 247u8, 132u8, 82u8, 34u8, 210u8, 202u8, 50u8, 158u8, 45u8, - 239u8, 192u8, 7u8, 24u8, 39u8, 95u8, 57u8, 21u8, 178u8, 113u8, - ], - ) + } + pub mod get_metadata { + use super::{root_mod, runtime_types}; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct Input { + pub id: Id, } - #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] - #[doc = "account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] - #[doc = "signer."] - #[doc = ""] - #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] - #[doc = "reserved by `approve_transfer` is unreserved."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] - #[doc = "from which the asset balance will be withdrawn."] - #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] - #[doc = "- `amount`: The amount of assets to transfer."] - #[doc = ""] - #[doc = "Emits `TransferredApproved` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn transfer_approved( - &self, - id: types::transfer_approved::Id, - owner: types::transfer_approved::Owner, - destination: types::transfer_approved::Destination, - amount: types::transfer_approved::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "transfer_approved", - types::TransferApproved { id, owner, destination, amount }, - [ - 214u8, 51u8, 243u8, 129u8, 116u8, 233u8, 199u8, 183u8, 25u8, 5u8, - 109u8, 85u8, 255u8, 68u8, 36u8, 99u8, 99u8, 179u8, 34u8, 66u8, 65u8, - 82u8, 189u8, 174u8, 22u8, 100u8, 211u8, 13u8, 178u8, 19u8, 128u8, - 177u8, - ], - ) + pub type Id = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::pallet_assets::types::AssetMetadata< + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + >; } - #[doc = "Create an asset account for non-provider assets."] - #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created."] - #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub fn touch( - &self, - id: types::touch::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "touch", - types::Touch { id }, - [ - 50u8, 185u8, 46u8, 134u8, 136u8, 31u8, 191u8, 34u8, 215u8, 150u8, 73u8, - 103u8, 140u8, 36u8, 95u8, 156u8, 201u8, 152u8, 32u8, 165u8, 47u8, 86u8, - 163u8, 255u8, 8u8, 251u8, 176u8, 138u8, 165u8, 48u8, 12u8, 27u8, - ], - ) + } + pub mod get_reserves_data { + use super::{root_mod, runtime_types}; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct Input { + pub id: Id, } - #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] - #[doc = "account."] - #[doc = ""] - #[doc = "The origin must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] - #[doc = " refunded."] - #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] - #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub fn refund( - &self, - id: types::refund::Id, - allow_burn: types::refund::AllowBurn, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "refund", - types::Refund { id, allow_burn }, - [ - 218u8, 207u8, 8u8, 41u8, 154u8, 250u8, 117u8, 174u8, 143u8, 133u8, - 34u8, 113u8, 171u8, 18u8, 177u8, 227u8, 146u8, 92u8, 12u8, 226u8, - 101u8, 230u8, 246u8, 162u8, 32u8, 73u8, 138u8, 158u8, 95u8, 226u8, - 75u8, 95u8, - ], - ) - } - #[doc = "Sets the minimum balance of an asset."] - #[doc = ""] - #[doc = "Only works if there aren't any accounts that are holding the asset or if"] - #[doc = "the new value of `min_balance` is less than the old one."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender has to be the Owner of the"] - #[doc = "asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `min_balance`: The new value of `min_balance`."] - #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - pub fn set_min_balance( - &self, - id: types::set_min_balance::Id, - min_balance: types::set_min_balance::MinBalance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "set_min_balance", - types::SetMinBalance { id, min_balance }, - [ - 141u8, 241u8, 137u8, 50u8, 232u8, 122u8, 252u8, 104u8, 185u8, 170u8, - 246u8, 0u8, 20u8, 128u8, 136u8, 155u8, 62u8, 243u8, 4u8, 221u8, 42u8, - 225u8, 16u8, 245u8, 58u8, 127u8, 84u8, 193u8, 175u8, 165u8, 35u8, 49u8, - ], - ) - } - #[doc = "Create an asset account for `who`."] - #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created, the asset status must"] - #[doc = " be live."] - #[doc = "- `who`: The account to be created."] - #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub fn touch_other( - &self, - id: types::touch_other::Id, - who: types::touch_other::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "touch_other", - types::TouchOther { id, who }, - [ - 104u8, 85u8, 80u8, 68u8, 135u8, 149u8, 102u8, 104u8, 188u8, 79u8, 42u8, - 34u8, 241u8, 84u8, 183u8, 176u8, 215u8, 172u8, 78u8, 196u8, 206u8, - 214u8, 138u8, 240u8, 92u8, 65u8, 117u8, 170u8, 140u8, 120u8, 50u8, - 166u8, - ], - ) - } - #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] - #[doc = ""] - #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] - #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] - #[doc = "use `refund`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `who`: The account to refund."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] - #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub fn refund_other( - &self, - id: types::refund_other::Id, - who: types::refund_other::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "refund_other", - types::RefundOther { id, who }, - [ - 113u8, 58u8, 33u8, 109u8, 233u8, 229u8, 210u8, 40u8, 176u8, 252u8, - 131u8, 80u8, 33u8, 132u8, 19u8, 170u8, 145u8, 146u8, 246u8, 31u8, - 222u8, 120u8, 167u8, 187u8, 8u8, 144u8, 164u8, 251u8, 52u8, 249u8, - 91u8, 136u8, - ], - ) - } - #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the account's asset."] - #[doc = "- `who`: The account to be unblocked."] - #[doc = ""] - #[doc = "Emits `Blocked`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn block( - &self, - id: types::block::Id, - who: types::block::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "block", - types::Block { id, who }, - [ - 224u8, 63u8, 26u8, 229u8, 23u8, 164u8, 212u8, 170u8, 156u8, 104u8, - 63u8, 158u8, 53u8, 162u8, 157u8, 127u8, 183u8, 94u8, 211u8, 123u8, - 228u8, 198u8, 47u8, 80u8, 53u8, 122u8, 46u8, 69u8, 67u8, 170u8, 193u8, - 33u8, - ], - ) - } - #[doc = "Transfer the entire transferable balance from the caller asset account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] - #[doc = " (false), or transfer everything except at least the minimum balance, which will"] - #[doc = " guarantee to keep the sender asset account alive (true)."] - pub fn transfer_all( - &self, - id: types::transfer_all::Id, - dest: types::transfer_all::Dest, - keep_alive: types::transfer_all::KeepAlive, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "transfer_all", - types::TransferAll { id, dest, keep_alive }, - [ - 180u8, 161u8, 252u8, 127u8, 200u8, 117u8, 245u8, 213u8, 170u8, 169u8, - 178u8, 115u8, 156u8, 8u8, 79u8, 50u8, 168u8, 229u8, 87u8, 33u8, 238u8, - 124u8, 13u8, 210u8, 81u8, 132u8, 236u8, 46u8, 101u8, 18u8, 22u8, 61u8, - ], - ) - } - #[doc = "Sets the trusted reserve information of an asset."] - #[doc = ""] - #[doc = "Origin must be the Owner of the asset `id`. The origin must conform to the configured"] - #[doc = "`CreateOrigin` or be the signed `owner` configured during asset creation."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `reserves`: The full list of trusted reserves information."] - #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - pub fn set_reserves( - &self, - id: types::set_reserves::Id, - reserves: types::set_reserves::Reserves, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "set_reserves", - types::SetReserves { id, reserves }, - [ - 170u8, 210u8, 175u8, 235u8, 220u8, 223u8, 164u8, 253u8, 189u8, 4u8, - 100u8, 160u8, 181u8, 44u8, 79u8, 187u8, 37u8, 102u8, 0u8, 187u8, 48u8, - 82u8, 247u8, 200u8, 2u8, 141u8, 57u8, 55u8, 224u8, 32u8, 176u8, 231u8, - ], - ) - } - } - } - pub mod view_functions { - use super::{root_mod, runtime_types}; - pub struct ViewFunctionsApi; - impl ViewFunctionsApi { - #[doc = " Provide the asset details for asset `id`."] - pub fn asset_details( - &self, - id: asset_details::Id, - ) -> ::subxt::ext::subxt_core::view_functions::payload::StaticPayload< - asset_details::Input, - asset_details::output::Output, - > { - ::subxt::ext::subxt_core::view_functions::payload::StaticPayload::new_static( - [ - 104u8, 42u8, 89u8, 213u8, 26u8, 185u8, 228u8, 138u8, 140u8, 140u8, - 196u8, 24u8, 255u8, 151u8, 8u8, 210u8, 167u8, 2u8, 151u8, 173u8, 11u8, - 75u8, 221u8, 61u8, 164u8, 183u8, 70u8, 41u8, 166u8, 90u8, 110u8, 92u8, - ], - asset_details::Input { id }, - [ - 211u8, 90u8, 10u8, 200u8, 75u8, 44u8, 223u8, 16u8, 230u8, 165u8, 250u8, - 228u8, 154u8, 9u8, 130u8, 112u8, 113u8, 184u8, 170u8, 127u8, 188u8, - 95u8, 63u8, 51u8, 78u8, 130u8, 147u8, 123u8, 190u8, 170u8, 16u8, 65u8, - ], - ) - } - #[doc = " Provide the balance of `who` for asset `id`."] - pub fn balance_of( - &self, - who: balance_of::Who, - id: balance_of::Id, - ) -> ::subxt::ext::subxt_core::view_functions::payload::StaticPayload< - balance_of::Input, - balance_of::output::Output, - > { - ::subxt::ext::subxt_core::view_functions::payload::StaticPayload::new_static( - [ - 104u8, 42u8, 89u8, 213u8, 26u8, 185u8, 228u8, 138u8, 140u8, 140u8, - 196u8, 24u8, 255u8, 151u8, 8u8, 210u8, 83u8, 26u8, 199u8, 226u8, 27u8, - 118u8, 177u8, 33u8, 231u8, 97u8, 228u8, 115u8, 65u8, 154u8, 27u8, 2u8, - ], - balance_of::Input { who, id }, - [ - 111u8, 166u8, 174u8, 198u8, 50u8, 246u8, 223u8, 192u8, 195u8, 6u8, - 218u8, 113u8, 85u8, 251u8, 79u8, 59u8, 196u8, 83u8, 39u8, 141u8, 200u8, - 113u8, 92u8, 67u8, 110u8, 112u8, 255u8, 77u8, 94u8, 232u8, 148u8, - 189u8, - ], - ) - } - #[doc = " Provide the configured metadata for asset `id`."] - pub fn get_metadata( - &self, - id: get_metadata::Id, - ) -> ::subxt::ext::subxt_core::view_functions::payload::StaticPayload< - get_metadata::Input, - get_metadata::output::Output, - > { - ::subxt::ext::subxt_core::view_functions::payload::StaticPayload::new_static( - [ - 104u8, 42u8, 89u8, 213u8, 26u8, 185u8, 228u8, 138u8, 140u8, 140u8, - 196u8, 24u8, 255u8, 151u8, 8u8, 210u8, 46u8, 135u8, 102u8, 164u8, 13u8, - 27u8, 105u8, 214u8, 21u8, 27u8, 216u8, 1u8, 229u8, 117u8, 80u8, 94u8, - ], - get_metadata::Input { id }, - [ - 194u8, 126u8, 37u8, 51u8, 199u8, 8u8, 17u8, 77u8, 127u8, 118u8, 9u8, - 196u8, 248u8, 40u8, 136u8, 175u8, 243u8, 35u8, 137u8, 159u8, 137u8, - 162u8, 58u8, 4u8, 206u8, 51u8, 222u8, 234u8, 218u8, 8u8, 23u8, 195u8, - ], - ) - } - #[doc = " Provide the configured reserves data for asset `id`."] - pub fn get_reserves_data( - &self, - id: get_reserves_data::Id, - ) -> ::subxt::ext::subxt_core::view_functions::payload::StaticPayload< - get_reserves_data::Input, - get_reserves_data::output::Output, - > { - ::subxt::ext::subxt_core::view_functions::payload::StaticPayload::new_static( - [ - 104u8, 42u8, 89u8, 213u8, 26u8, 185u8, 228u8, 138u8, 140u8, 140u8, - 196u8, 24u8, 255u8, 151u8, 8u8, 210u8, 100u8, 246u8, 63u8, 41u8, 35u8, - 227u8, 152u8, 40u8, 36u8, 49u8, 99u8, 129u8, 174u8, 30u8, 105u8, 134u8, - ], - get_reserves_data::Input { id }, - [ - 209u8, 99u8, 108u8, 142u8, 202u8, 226u8, 194u8, 23u8, 99u8, 165u8, - 72u8, 212u8, 158u8, 187u8, 5u8, 201u8, 58u8, 51u8, 161u8, 119u8, 0u8, - 58u8, 15u8, 109u8, 255u8, 0u8, 192u8, 222u8, 51u8, 241u8, 34u8, 116u8, - ], - ) - } - } - pub mod asset_details { - use super::{root_mod, runtime_types}; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Input { - pub id: Id, - } - pub type Id = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::pallet_assets::types::AssetDetails< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >, - >; - } - } - pub mod balance_of { - use super::{root_mod, runtime_types}; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Input { - pub who: Who, - pub id: Id, - } - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Id = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option<::core::primitive::u128>; - } - } - pub mod get_metadata { - use super::{root_mod, runtime_types}; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Input { - pub id: Id, - } - pub type Id = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::core::option::Option< - runtime_types::pallet_assets::types::AssetMetadata< - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - >, - >; - } - } - pub mod get_reserves_data { - use super::{root_mod, runtime_types}; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Input { - pub id: Id, - } - pub type Id = ::core::primitive::u32; - pub mod output { - use super::runtime_types; - pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<()>; + pub type Id = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt::ext::subxt_core::alloc::vec::Vec<()>; } } } @@ -19202,8 +16571,11 @@ pub mod api { #[doc = "**For threshold=1:** The proposal is created with `Approved` status immediately"] #[doc = "and can be executed via `execute()` without additional approvals."] #[doc = ""] - #[doc = "**Weight:** Charged upfront for worst-case (high-security path with decode)."] - #[doc = "Refunded to actual cost on success based on whether HS path was taken."] + #[doc = "**Weight:** Charged upfront includes bookkeeping + MaxInnerCallWeight to cover"] + #[doc = "the cost of decoding arbitrary RuntimeCall structures and calling get_dispatch_info()."] + #[doc = "On success, refunds based on actual inner call weight. On rejection after decode"] + #[doc = "(e.g., CallWeightExceedsLimit, CallNotAllowedForHighSecurityMultisig), the full"] + #[doc = "reserved weight is burned to prevent griefing with complex calls that get rejected."] pub struct Propose { pub multisig_address: propose::MultisigAddress, pub call: propose::Call, @@ -19442,8 +16814,11 @@ pub mod api { #[doc = "**For threshold=1:** The proposal is created with `Approved` status immediately"] #[doc = "and can be executed via `execute()` without additional approvals."] #[doc = ""] - #[doc = "**Weight:** Charged upfront for worst-case (high-security path with decode)."] - #[doc = "Refunded to actual cost on success based on whether HS path was taken."] + #[doc = "**Weight:** Charged upfront includes bookkeeping + MaxInnerCallWeight to cover"] + #[doc = "the cost of decoding arbitrary RuntimeCall structures and calling get_dispatch_info()."] + #[doc = "On success, refunds based on actual inner call weight. On rejection after decode"] + #[doc = "(e.g., CallWeightExceedsLimit, CallNotAllowedForHighSecurityMultisig), the full"] + #[doc = "reserved weight is burned to prevent griefing with complex calls that get rejected."] pub fn propose( &self, multisig_address: types::propose::MultisigAddress, @@ -20337,6 +17712,14 @@ pub mod api { (::subxt::ext::subxt_core::utils::AccountId32, ::core::primitive::u128), >; } + pub mod potential_wormhole_balance { + use super::runtime_types; + pub type PotentialWormholeBalance = ::core::primitive::u128; + } + pub mod total_wormhole_exits { + use super::runtime_types; + pub type TotalWormholeExits = ::core::primitive::u128; + } } pub struct StorageApi; impl StorageApi { @@ -20458,6 +17841,60 @@ pub mod api { ], ) } + #[doc = " Sum of balances held by \"ambiguous\" addresses (accounts that have never signed a"] + #[doc = " dilithium transaction, i.e. `nonce == 0`). These addresses are indistinguishable from"] + #[doc = " wormhole deposit addresses, so this is the maximum value that could legitimately be"] + #[doc = " exited via the wormhole."] + #[doc = ""] + #[doc = " Maintained incrementally: transfers to ambiguous addresses add to it (see"] + #[doc = " `record_transfer`), and an address revealing itself by signing its first transaction"] + #[doc = " subtracts its balance (see `WormholeProofRecorderExtension::validate` in the runtime)."] + pub fn potential_wormhole_balance( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::potential_wormhole_balance::PotentialWormholeBalance, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Wormhole", + "PotentialWormholeBalance", + (), + [ + 224u8, 198u8, 10u8, 180u8, 226u8, 172u8, 234u8, 95u8, 228u8, 158u8, + 211u8, 149u8, 44u8, 85u8, 157u8, 195u8, 246u8, 54u8, 25u8, 16u8, 146u8, + 156u8, 145u8, 52u8, 144u8, 95u8, 225u8, 6u8, 120u8, 80u8, 210u8, 180u8, + ], + ) + } + #[doc = " Total value of all successful wormhole exits (tokens minted to exit accounts)."] + #[doc = ""] + #[doc = " The core soundness invariant enforced on every exit is"] + #[doc = " `TotalWormholeExits <= PotentialWormholeBalance`. A violation indicates that more value"] + #[doc = " is being exited than could possibly have been deposited β€” i.e. a ZK soundness bug."] + pub fn total_wormhole_exits( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::total_wormhole_exits::TotalWormholeExits, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Wormhole", + "TotalWormholeExits", + (), + [ + 94u8, 69u8, 80u8, 151u8, 48u8, 6u8, 147u8, 6u8, 34u8, 219u8, 205u8, + 47u8, 250u8, 193u8, 185u8, 14u8, 198u8, 141u8, 22u8, 206u8, 36u8, + 127u8, 94u8, 166u8, 185u8, 254u8, 244u8, 180u8, 137u8, 50u8, 55u8, + 52u8, + ], + ) + } } } pub mod constants { @@ -21075,1253 +18512,286 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct IdAmount<_0, _1> { - pub id: _0, - pub amount: _1, - } - } - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct PalletId(pub [::core::primitive::u8; 8usize]); - } - pub mod frame_system { - use super::runtime_types; - pub mod extensions { - use super::runtime_types; - pub mod check_genesis { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckGenesis; - } - pub mod check_mortality { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckMortality(pub runtime_types::sp_runtime::generic::era::Era); - } - pub mod check_non_zero_sender { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckNonZeroSender; - } - pub mod check_nonce { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); - } - pub mod check_spec_version { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckSpecVersion; - } - pub mod check_tx_version { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckTxVersion; - } - pub mod check_weight { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct CheckWeight; - } - } - pub mod limits { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct BlockLength { - pub max: runtime_types::frame_support::dispatch::PerDispatchClass< - ::core::primitive::u32, - >, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct BlockWeights { - pub base_block: runtime_types::sp_weights::weight_v2::Weight, - pub max_block: runtime_types::sp_weights::weight_v2::Weight, - pub per_class: runtime_types::frame_support::dispatch::PerDispatchClass< - runtime_types::frame_system::limits::WeightsPerClass, - >, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct WeightsPerClass { - pub base_extrinsic: runtime_types::sp_weights::weight_v2::Weight, - pub max_extrinsic: - ::core::option::Option, - pub max_total: - ::core::option::Option, - pub reserved: - ::core::option::Option, - } - } - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub enum Call { - #[codec(index = 0)] - #[doc = "Make some on-chain remark."] - #[doc = ""] - #[doc = "Can be executed by every `origin`."] - remark { - remark: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 1)] - #[doc = "Set the number of pages in the WebAssembly environment's heap."] - set_heap_pages { pages: ::core::primitive::u64 }, - #[codec(index = 2)] - #[doc = "Set the new runtime code."] - set_code { - code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 3)] - #[doc = "Set the new runtime code without doing any checks of the given `code`."] - #[doc = ""] - #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] - #[doc = "version!"] - set_code_without_checks { - code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 4)] - #[doc = "Set some items of storage."] - set_storage { - items: ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - )>, - }, - #[codec(index = 5)] - #[doc = "Kill some items from storage."] - kill_storage { - keys: ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - >, - }, - #[codec(index = 6)] - #[doc = "Kill all storage items with a key that starts with the given prefix."] - #[doc = ""] - #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] - #[doc = "the prefix we are removing to accurately calculate the weight of this function."] - kill_prefix { - prefix: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - subkeys: ::core::primitive::u32, - }, - #[codec(index = 7)] - #[doc = "Make some on-chain remark and emit event."] - remark_with_event { - remark: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 9)] - #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] - #[doc = "later."] - #[doc = ""] - #[doc = "This call requires Root origin."] - authorize_upgrade { code_hash: ::subxt::ext::subxt_core::utils::H256 }, - #[codec(index = 10)] - #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] - #[doc = "later."] - #[doc = ""] - #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] - #[doc = "example that the spec name remains the same and that the version number increases. Not"] - #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] - #[doc = ""] - #[doc = "This call requires Root origin."] - authorize_upgrade_without_checks { - code_hash: ::subxt::ext::subxt_core::utils::H256, - }, - #[codec(index = 11)] - #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] - #[doc = ""] - #[doc = "If the authorization required a version check, this call will ensure the spec name"] - #[doc = "remains unchanged and that the spec version has increased."] - #[doc = ""] - #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] - #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] - #[doc = ""] - #[doc = "All origins are allowed."] - apply_authorized_upgrade { - code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - }, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Error for the System pallet"] - pub enum Error { - #[codec(index = 0)] - #[doc = "The name of specification does not match between the current runtime"] - #[doc = "and the new runtime."] - InvalidSpecName, - #[codec(index = 1)] - #[doc = "The specification version is not allowed to decrease between the current runtime"] - #[doc = "and the new runtime."] - SpecVersionNeedsToIncrease, - #[codec(index = 2)] - #[doc = "Failed to extract the runtime version from the new runtime."] - #[doc = ""] - #[doc = "Either calling `Core_version` or decoding `RuntimeVersion` failed."] - FailedToExtractRuntimeVersion, - #[codec(index = 3)] - #[doc = "Suicide called when the account has non-default composite data."] - NonDefaultComposite, - #[codec(index = 4)] - #[doc = "There is a non-zero reference count preventing the account from being purged."] - NonZeroRefCount, - #[codec(index = 5)] - #[doc = "The origin filter prevent the call to be dispatched."] - CallFiltered, - #[codec(index = 6)] - #[doc = "A multi-block migration is ongoing and prevents the current code from being replaced."] - MultiBlockMigrationsOngoing, - #[codec(index = 7)] - #[doc = "No upgrade authorized."] - NothingAuthorized, - #[codec(index = 8)] - #[doc = "The submitted code is not authorized."] - Unauthorized, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Event for the System pallet."] - pub enum Event { - #[codec(index = 0)] - #[doc = "An extrinsic completed successfully."] - ExtrinsicSuccess { - dispatch_info: runtime_types::frame_system::DispatchEventInfo, - }, - #[codec(index = 1)] - #[doc = "An extrinsic failed."] - ExtrinsicFailed { - dispatch_error: runtime_types::sp_runtime::DispatchError, - dispatch_info: runtime_types::frame_system::DispatchEventInfo, - }, - #[codec(index = 2)] - #[doc = "`:code` was updated."] - CodeUpdated, - #[codec(index = 3)] - #[doc = "A new account was created."] - NewAccount { account: ::subxt::ext::subxt_core::utils::AccountId32 }, - #[codec(index = 4)] - #[doc = "An account was reaped."] - KilledAccount { account: ::subxt::ext::subxt_core::utils::AccountId32 }, - #[codec(index = 5)] - #[doc = "On on-chain remark happened."] - Remarked { - sender: ::subxt::ext::subxt_core::utils::AccountId32, - hash: ::subxt::ext::subxt_core::utils::H256, - }, - #[codec(index = 6)] - #[doc = "An upgrade was authorized."] - UpgradeAuthorized { - code_hash: ::subxt::ext::subxt_core::utils::H256, - check_version: ::core::primitive::bool, - }, - #[codec(index = 7)] - #[doc = "An invalid authorized upgrade was rejected while trying to apply it."] - RejectedInvalidAuthorizedUpgrade { - code_hash: ::subxt::ext::subxt_core::utils::H256, - error: runtime_types::sp_runtime::DispatchError, - }, - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct AccountInfo<_0, _1> { - pub nonce: _0, - pub consumers: ::core::primitive::u32, - pub providers: ::core::primitive::u32, - pub sufficients: ::core::primitive::u32, - pub data: _1, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct CodeUpgradeAuthorization { - pub code_hash: ::subxt::ext::subxt_core::utils::H256, - pub check_version: ::core::primitive::bool, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct DispatchEventInfo { - pub weight: runtime_types::sp_weights::weight_v2::Weight, - pub class: runtime_types::frame_support::dispatch::DispatchClass, - pub pays_fee: runtime_types::frame_support::dispatch::Pays, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct EventRecord<_0, _1> { - pub phase: runtime_types::frame_system::Phase, - pub event: _0, - pub topics: ::subxt::ext::subxt_core::alloc::vec::Vec<_1>, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct LastRuntimeUpgradeInfo { - #[codec(compact)] - pub spec_version: ::core::primitive::u32, - pub spec_name: ::subxt::ext::subxt_core::alloc::string::String, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub enum Phase { - #[codec(index = 0)] - ApplyExtrinsic(::core::primitive::u32), - #[codec(index = 1)] - Finalization, - #[codec(index = 2)] - Initialization, - } - } - pub mod pallet_assets { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub enum Call { - #[codec(index = 0)] - #[doc = "Issue a new class of fungible assets from a public origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially and its owner is the origin."] - #[doc = ""] - #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] - #[doc = ""] - #[doc = "Funds of sender are reserved by `AssetDeposit`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] - #[doc = "member of the asset class's admin team."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = ""] - #[doc = "Emits `Created` event when successful."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - create { - #[codec(compact)] - id: ::core::primitive::u32, - admin: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - min_balance: ::core::primitive::u128, - }, - #[codec(index = 1)] - #[doc = "Issue a new class of fungible assets from a privileged origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially."] - #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin`."] - #[doc = ""] - #[doc = "Unlike `create`, no funds are reserved."] - #[doc = ""] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] - #[doc = "over this asset, but may later change and configure the permissions using"] - #[doc = "`transfer_ownership` and `set_team`."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = ""] - #[doc = "Emits `ForceCreated` event when successful."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - force_create { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - is_sufficient: ::core::primitive::bool, - #[codec(compact)] - min_balance: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Start the process of destroying a fungible asset class."] - #[doc = ""] - #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] - #[doc = "destruction of an asset class."] - #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "an account contains holds or freezes in place."] - start_destroy { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 3)] - #[doc = "Destroy all accounts associated with a given asset."] - #[doc = ""] - #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] - #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] - #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedAccounts` event."] - destroy_accounts { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 4)] - #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] - #[doc = ""] - #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] - #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] - #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedApprovals` event."] - destroy_approvals { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Complete destroying asset and unreserve currency."] - #[doc = ""] - #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] - #[doc = "hand."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] - #[doc = ""] - #[doc = "Each successful call emits the `Event::Destroyed` event."] - finish_destroy { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 6)] - #[doc = "Mint assets of a particular class."] - #[doc = ""] - #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount minted."] - #[doc = "- `beneficiary`: The account to be credited with the minted assets."] - #[doc = "- `amount`: The amount of the asset to be minted."] - #[doc = ""] - #[doc = "Emits `Issued` event when successful."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] - mint { - #[codec(compact)] - id: ::core::primitive::u32, - beneficiary: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 7)] - #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] - #[doc = ""] - #[doc = "Bails with `NoAccount` if the `who` is already dead."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount burned."] - #[doc = "- `who`: The account to be debited from."] - #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] - #[doc = ""] - #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] - #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] - burn { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 8)] - #[doc = "Move some assets from the sender account to another."] - #[doc = ""] - #[doc = "Origin must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] - #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - transfer { - #[codec(compact)] - id: ::core::primitive::u32, - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 9)] - #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] - #[doc = ""] - #[doc = "Origin must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] - #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - transfer_keep_alive { - #[codec(compact)] - id: ::core::primitive::u32, - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 10)] - #[doc = "Move some assets from one account to another."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `source`: The account to be debited."] - #[doc = "- `dest`: The account to be credited."] - #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] - #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] - #[doc = "below the minimum balance. Must be greater than zero."] - #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] - #[doc = "`dest`."] - force_transfer { - #[codec(compact)] - id: ::core::primitive::u32, - source: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - dest: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 11)] - #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] - #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] - #[doc = "account that does not have an entry, use `touch_other` first."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be frozen."] - #[doc = ""] - #[doc = "Emits `Frozen`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - freeze { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - }, - #[codec(index = 12)] - #[doc = "Allow unprivileged transfers to and from an account again."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be unfrozen."] - #[doc = ""] - #[doc = "Emits `Thawed`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - thaw { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - }, - #[codec(index = 13)] - #[doc = "Disallow further unprivileged transfers for the asset class."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = ""] - #[doc = "Emits `Frozen`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - freeze_asset { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 14)] - #[doc = "Allow unprivileged transfers for the asset again."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be thawed."] - #[doc = ""] - #[doc = "Emits `Thawed`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - thaw_asset { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 15)] - #[doc = "Change the Owner of an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = ""] - #[doc = "Emits `OwnerChanged`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - transfer_ownership { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - }, - #[codec(index = 16)] - #[doc = "Change the Issuer, Admin and Freezer of an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = ""] - #[doc = "Emits `TeamChanged`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - set_team { - #[codec(compact)] - id: ::core::primitive::u32, - issuer: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - admin: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - freezer: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - }, - #[codec(index = 17)] - #[doc = "Set the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "Funds of sender are reserved according to the formula:"] - #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] - #[doc = "account any already reserved funds."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] - #[doc = ""] - #[doc = "Emits `MetadataSet`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - set_metadata { - #[codec(compact)] - id: ::core::primitive::u32, - name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - symbol: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - decimals: ::core::primitive::u8, - }, - #[codec(index = 18)] - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "Any deposit is freed for the asset owner."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] - #[doc = ""] - #[doc = "Emits `MetadataCleared`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - clear_metadata { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 19)] - #[doc = "Force the metadata for an asset to some value."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] - #[doc = ""] - #[doc = "Any deposit is left alone."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] - #[doc = ""] - #[doc = "Emits `MetadataSet`."] - #[doc = ""] - #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] - force_set_metadata { - #[codec(compact)] - id: ::core::primitive::u32, - name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - symbol: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - decimals: ::core::primitive::u8, - is_frozen: ::core::primitive::bool, - }, - #[codec(index = 20)] - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] - #[doc = ""] - #[doc = "Any deposit is returned."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] - #[doc = ""] - #[doc = "Emits `MetadataCleared`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - force_clear_metadata { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 21)] - #[doc = "Alter the attributes of a given asset."] - #[doc = ""] - #[doc = "Origin must be `ForceOrigin`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] - #[doc = "value to account for the state bloat associated with its balance storage. If set to"] - #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] - #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] - #[doc = "growth)."] - #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] - #[doc = "instructions."] - #[doc = ""] - #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - force_asset_status { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - issuer: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - admin: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - freezer: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - #[codec(compact)] - min_balance: ::core::primitive::u128, - is_sufficient: ::core::primitive::bool, - is_frozen: ::core::primitive::bool, - }, - #[codec(index = 22)] - #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed."] - #[doc = ""] - #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] - #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] - #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] - #[doc = "meet the right value."] - #[doc = ""] - #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] - #[doc = "making this call."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account to delegate permission to transfer asset."] - #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] - #[doc = "already an approval in place, then this acts additively."] - #[doc = ""] - #[doc = "Emits `ApprovedTransfer` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - approve_transfer { - #[codec(compact)] - id: ::core::primitive::u32, - delegate: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 23)] - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place between signer and"] - #[doc = "`delegate`."] - #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] - #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - cancel_approval { - #[codec(compact)] - id: ::core::primitive::u32, - delegate: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - }, - #[codec(index = 24)] - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] - #[doc = "account of the asset `id`."] - #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] - #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - force_cancel_approval { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - delegate: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - }, - #[codec(index = 25)] - #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] - #[doc = "account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] - #[doc = "signer."] - #[doc = ""] - #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] - #[doc = "reserved by `approve_transfer` is unreserved."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] - #[doc = "from which the asset balance will be withdrawn."] - #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] - #[doc = "- `amount`: The amount of assets to transfer."] - #[doc = ""] - #[doc = "Emits `TransferredApproved` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - transfer_approved { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - destination: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - #[codec(compact)] - amount: ::core::primitive::u128, - }, - #[codec(index = 26)] - #[doc = "Create an asset account for non-provider assets."] - #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created."] - #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - touch { - #[codec(compact)] - id: ::core::primitive::u32, - }, - #[codec(index = 27)] - #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] - #[doc = "account."] - #[doc = ""] - #[doc = "The origin must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] - #[doc = " refunded."] - #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] - #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - refund { - #[codec(compact)] - id: ::core::primitive::u32, - allow_burn: ::core::primitive::bool, - }, - #[codec(index = 28)] - #[doc = "Sets the minimum balance of an asset."] - #[doc = ""] - #[doc = "Only works if there aren't any accounts that are holding the asset or if"] - #[doc = "the new value of `min_balance` is less than the old one."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender has to be the Owner of the"] - #[doc = "asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `min_balance`: The new value of `min_balance`."] + pub struct IdAmount<_0, _1> { + pub id: _0, + pub amount: _1, + } + } + } + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct PalletId(pub [::core::primitive::u8; 8usize]); + } + pub mod frame_system { + use super::runtime_types; + pub mod extensions { + use super::runtime_types; + pub mod check_genesis { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct CheckGenesis; + } + pub mod check_mortality { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct CheckMortality(pub runtime_types::sp_runtime::generic::era::Era); + } + pub mod check_non_zero_sender { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct CheckNonZeroSender; + } + pub mod check_nonce { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); + } + pub mod check_spec_version { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct CheckSpecVersion; + } + pub mod check_tx_version { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct CheckTxVersion; + } + pub mod check_weight { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct CheckWeight; + } + } + pub mod limits { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct BlockLength { + pub max: runtime_types::frame_support::dispatch::PerDispatchClass< + ::core::primitive::u32, + >, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct BlockWeights { + pub base_block: runtime_types::sp_weights::weight_v2::Weight, + pub max_block: runtime_types::sp_weights::weight_v2::Weight, + pub per_class: runtime_types::frame_support::dispatch::PerDispatchClass< + runtime_types::frame_system::limits::WeightsPerClass, + >, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct WeightsPerClass { + pub base_extrinsic: runtime_types::sp_weights::weight_v2::Weight, + pub max_extrinsic: + ::core::option::Option, + pub max_total: + ::core::option::Option, + pub reserved: + ::core::option::Option, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Make some on-chain remark."] #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - set_min_balance { - #[codec(compact)] - id: ::core::primitive::u32, - min_balance: ::core::primitive::u128, + #[doc = "Can be executed by every `origin`."] + remark { + remark: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, }, - #[codec(index = 29)] - #[doc = "Create an asset account for `who`."] - #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created, the asset status must"] - #[doc = " be live."] - #[doc = "- `who`: The account to be created."] - #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - touch_other { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + #[codec(index = 1)] + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + set_heap_pages { pages: ::core::primitive::u64 }, + #[codec(index = 2)] + #[doc = "Set the new runtime code."] + set_code { + code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, }, - #[codec(index = 30)] - #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] - #[doc = ""] - #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] - #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] - #[doc = "use `refund`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `who`: The account to refund."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] + #[codec(index = 3)] + #[doc = "Set the new runtime code without doing any checks of the given `code`."] #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - refund_other { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), + #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] + #[doc = "version!"] + set_code_without_checks { + code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Set some items of storage."] + set_storage { + items: ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + )>, + }, + #[codec(index = 5)] + #[doc = "Kill some items from storage."] + kill_storage { + keys: ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, >, }, - #[codec(index = 31)] - #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the account's asset."] - #[doc = "- `who`: The account to be unblocked."] - #[doc = ""] - #[doc = "Emits `Blocked`."] + #[codec(index = 6)] + #[doc = "Kill all storage items with a key that starts with the given prefix."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - block { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + kill_prefix { + prefix: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + subkeys: ::core::primitive::u32, }, - #[codec(index = 32)] - #[doc = "Transfer the entire transferable balance from the caller asset account."] + #[codec(index = 7)] + #[doc = "Make some on-chain remark and emit event."] + remark_with_event { + remark: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 9)] + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] + #[doc = "This call requires Root origin."] + authorize_upgrade { code_hash: ::subxt::ext::subxt_core::utils::H256 }, + #[codec(index = 10)] + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] + #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] + #[doc = "example that the spec name remains the same and that the version number increases. Not"] + #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] - #[doc = " (false), or transfer everything except at least the minimum balance, which will"] - #[doc = " guarantee to keep the sender asset account alive (true)."] - transfer_all { - #[codec(compact)] - id: ::core::primitive::u32, - dest: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - keep_alive: ::core::primitive::bool, + #[doc = "This call requires Root origin."] + authorize_upgrade_without_checks { + code_hash: ::subxt::ext::subxt_core::utils::H256, }, - #[codec(index = 33)] - #[doc = "Sets the trusted reserve information of an asset."] + #[codec(index = 11)] + #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] #[doc = ""] - #[doc = "Origin must be the Owner of the asset `id`. The origin must conform to the configured"] - #[doc = "`CreateOrigin` or be the signed `owner` configured during asset creation."] + #[doc = "If the authorization required a version check, this call will ensure the spec name"] + #[doc = "remains unchanged and that the spec version has increased."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `reserves`: The full list of trusted reserves information."] + #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] + #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - set_reserves { - #[codec(compact)] - id: ::core::primitive::u32, - reserves: runtime_types::bounded_collections::bounded_vec::BoundedVec<()>, + #[doc = "All origins are allowed."] + apply_authorized_upgrade { + code: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, }, } #[derive( @@ -22335,83 +18805,39 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "The `Error` enum of this pallet."] + #[doc = "Error for the System pallet"] pub enum Error { #[codec(index = 0)] - #[doc = "Account balance must be greater than or equal to the transfer amount."] - BalanceLow, + #[doc = "The name of specification does not match between the current runtime"] + #[doc = "and the new runtime."] + InvalidSpecName, #[codec(index = 1)] - #[doc = "The account to alter does not exist."] - NoAccount, + #[doc = "The specification version is not allowed to decrease between the current runtime"] + #[doc = "and the new runtime."] + SpecVersionNeedsToIncrease, #[codec(index = 2)] - #[doc = "The signing account has no permission to do the operation."] - NoPermission, + #[doc = "Failed to extract the runtime version from the new runtime."] + #[doc = ""] + #[doc = "Either calling `Core_version` or decoding `RuntimeVersion` failed."] + FailedToExtractRuntimeVersion, #[codec(index = 3)] - #[doc = "The given asset ID is unknown."] - Unknown, + #[doc = "Suicide called when the account has non-default composite data."] + NonDefaultComposite, #[codec(index = 4)] - #[doc = "The origin account is frozen."] - Frozen, + #[doc = "There is a non-zero reference count preventing the account from being purged."] + NonZeroRefCount, #[codec(index = 5)] - #[doc = "The asset ID is already taken."] - InUse, + #[doc = "The origin filter prevent the call to be dispatched."] + CallFiltered, #[codec(index = 6)] - #[doc = "Invalid witness data given."] - BadWitness, + #[doc = "A multi-block migration is ongoing and prevents the current code from being replaced."] + MultiBlockMigrationsOngoing, #[codec(index = 7)] - #[doc = "Minimum balance should be non-zero."] - MinBalanceZero, + #[doc = "No upgrade authorized."] + NothingAuthorized, #[codec(index = 8)] - #[doc = "Unable to increment the consumer reference counters on the account. Either no provider"] - #[doc = "reference exists to allow a non-zero balance of a non-self-sufficient asset, or one"] - #[doc = "fewer then the maximum number of consumers has been reached."] - UnavailableConsumer, - #[codec(index = 9)] - #[doc = "Invalid metadata given."] - BadMetadata, - #[codec(index = 10)] - #[doc = "No approval exists that would allow the transfer."] - Unapproved, - #[codec(index = 11)] - #[doc = "The source account would not survive the transfer and it needs to stay alive."] - WouldDie, - #[codec(index = 12)] - #[doc = "The asset-account already exists."] - AlreadyExists, - #[codec(index = 13)] - #[doc = "The asset-account doesn't have an associated deposit."] - NoDeposit, - #[codec(index = 14)] - #[doc = "The operation would result in funds being burned."] - WouldBurn, - #[codec(index = 15)] - #[doc = "The asset is a live asset and is actively being used. Usually emit for operations such"] - #[doc = "as `start_destroy` which require the asset to be in a destroying state."] - LiveAsset, - #[codec(index = 16)] - #[doc = "The asset is not live, and likely being destroyed."] - AssetNotLive, - #[codec(index = 17)] - #[doc = "The asset status is not the expected status."] - IncorrectStatus, - #[codec(index = 18)] - #[doc = "The asset should be frozen before the given operation."] - NotFrozen, - #[codec(index = 19)] - #[doc = "Callback action resulted in error"] - CallbackFailed, - #[codec(index = 20)] - #[doc = "The asset ID must be equal to the [`NextAssetId`]."] - BadAssetId, - #[codec(index = 21)] - #[doc = "The asset cannot be destroyed because some accounts for this asset contain freezes."] - ContainsFreezes, - #[codec(index = 22)] - #[doc = "The asset cannot be destroyed because some accounts for this asset contain holds."] - ContainsHolds, - #[codec(index = 23)] - #[doc = "Tried setting too many reserves."] - TooManyReserves, + #[doc = "The submitted code is not authorized."] + Unauthorized, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -22424,528 +18850,915 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "The `Event` enum of this pallet"] - pub enum Event { + #[doc = "Event for the System pallet."] + pub enum Event { + #[codec(index = 0)] + #[doc = "An extrinsic completed successfully."] + ExtrinsicSuccess { + dispatch_info: runtime_types::frame_system::DispatchEventInfo, + }, + #[codec(index = 1)] + #[doc = "An extrinsic failed."] + ExtrinsicFailed { + dispatch_error: runtime_types::sp_runtime::DispatchError, + dispatch_info: runtime_types::frame_system::DispatchEventInfo, + }, + #[codec(index = 2)] + #[doc = "`:code` was updated."] + CodeUpdated, + #[codec(index = 3)] + #[doc = "A new account was created."] + NewAccount { account: ::subxt::ext::subxt_core::utils::AccountId32 }, + #[codec(index = 4)] + #[doc = "An account was reaped."] + KilledAccount { account: ::subxt::ext::subxt_core::utils::AccountId32 }, + #[codec(index = 5)] + #[doc = "On on-chain remark happened."] + Remarked { + sender: ::subxt::ext::subxt_core::utils::AccountId32, + hash: ::subxt::ext::subxt_core::utils::H256, + }, + #[codec(index = 6)] + #[doc = "An upgrade was authorized."] + UpgradeAuthorized { + code_hash: ::subxt::ext::subxt_core::utils::H256, + check_version: ::core::primitive::bool, + }, + #[codec(index = 7)] + #[doc = "An invalid authorized upgrade was rejected while trying to apply it."] + RejectedInvalidAuthorizedUpgrade { + code_hash: ::subxt::ext::subxt_core::utils::H256, + error: runtime_types::sp_runtime::DispatchError, + }, + } + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct AccountInfo<_0, _1> { + pub nonce: _0, + pub consumers: ::core::primitive::u32, + pub providers: ::core::primitive::u32, + pub sufficients: ::core::primitive::u32, + pub data: _1, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct CodeUpgradeAuthorization { + pub code_hash: ::subxt::ext::subxt_core::utils::H256, + pub check_version: ::core::primitive::bool, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct DispatchEventInfo { + pub weight: runtime_types::sp_weights::weight_v2::Weight, + pub class: runtime_types::frame_support::dispatch::DispatchClass, + pub pays_fee: runtime_types::frame_support::dispatch::Pays, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct EventRecord<_0, _1> { + pub phase: runtime_types::frame_system::Phase, + pub event: _0, + pub topics: ::subxt::ext::subxt_core::alloc::vec::Vec<_1>, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct LastRuntimeUpgradeInfo { + #[codec(compact)] + pub spec_version: ::core::primitive::u32, + pub spec_name: ::subxt::ext::subxt_core::alloc::string::String, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub enum Phase { + #[codec(index = 0)] + ApplyExtrinsic(::core::primitive::u32), + #[codec(index = 1)] + Finalization, + #[codec(index = 2)] + Initialization, + } + } + pub mod pallet_assets { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { #[codec(index = 0)] - #[doc = "Some asset class was created."] - Created { - asset_id: ::core::primitive::u32, - creator: ::subxt::ext::subxt_core::utils::AccountId32, - owner: ::subxt::ext::subxt_core::utils::AccountId32, + #[doc = "Issue a new class of fungible assets from a public origin."] + #[doc = ""] + #[doc = "This new asset class has no assets initially and its owner is the origin."] + #[doc = ""] + #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] + #[doc = ""] + #[doc = "Funds of sender are reserved by `AssetDeposit`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] + #[doc = "member of the asset class's admin team."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `Created` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + create { + #[codec(compact)] + id: ::core::primitive::u32, + admin: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + min_balance: ::core::primitive::u128, }, #[codec(index = 1)] - #[doc = "Some assets were issued."] - Issued { - asset_id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "Issue a new class of fungible assets from a privileged origin."] + #[doc = ""] + #[doc = "This new asset class has no assets initially."] + #[doc = ""] + #[doc = "The origin must conform to `ForceOrigin`."] + #[doc = ""] + #[doc = "Unlike `create`, no funds are reserved."] + #[doc = ""] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] + #[doc = "over this asset, but may later change and configure the permissions using"] + #[doc = "`transfer_ownership` and `set_team`."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `ForceCreated` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + force_create { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + is_sufficient: ::core::primitive::bool, + #[codec(compact)] + min_balance: ::core::primitive::u128, }, #[codec(index = 2)] - #[doc = "Some assets were transferred."] - Transferred { - asset_id: ::core::primitive::u32, - from: ::subxt::ext::subxt_core::utils::AccountId32, - to: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "Start the process of destroying a fungible asset class."] + #[doc = ""] + #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] + #[doc = "destruction of an asset class."] + #[doc = ""] + #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "an account contains holds or freezes in place."] + start_destroy { + #[codec(compact)] + id: ::core::primitive::u32, }, #[codec(index = 3)] - #[doc = "Some assets were destroyed."] - Burned { - asset_id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::AccountId32, - balance: ::core::primitive::u128, + #[doc = "Destroy all accounts associated with a given asset."] + #[doc = ""] + #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] + #[doc = ""] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each call emits the `Event::DestroyedAccounts` event."] + destroy_accounts { + #[codec(compact)] + id: ::core::primitive::u32, }, #[codec(index = 4)] - #[doc = "The management team changed."] - TeamChanged { - asset_id: ::core::primitive::u32, - issuer: ::subxt::ext::subxt_core::utils::AccountId32, - admin: ::subxt::ext::subxt_core::utils::AccountId32, - freezer: ::subxt::ext::subxt_core::utils::AccountId32, - }, - #[codec(index = 5)] - #[doc = "The owner changed."] - OwnerChanged { - asset_id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::AccountId32, - }, - #[codec(index = 6)] - #[doc = "Some account `who` was frozen."] - Frozen { - asset_id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, - }, - #[codec(index = 7)] - #[doc = "Some account `who` was thawed."] - Thawed { - asset_id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, - }, - #[codec(index = 8)] - #[doc = "Some asset `asset_id` was frozen."] - AssetFrozen { asset_id: ::core::primitive::u32 }, - #[codec(index = 9)] - #[doc = "Some asset `asset_id` was thawed."] - AssetThawed { asset_id: ::core::primitive::u32 }, - #[codec(index = 10)] - #[doc = "Accounts were destroyed for given asset."] - AccountsDestroyed { - asset_id: ::core::primitive::u32, - accounts_destroyed: ::core::primitive::u32, - accounts_remaining: ::core::primitive::u32, - }, - #[codec(index = 11)] - #[doc = "Approvals were destroyed for given asset."] - ApprovalsDestroyed { - asset_id: ::core::primitive::u32, - approvals_destroyed: ::core::primitive::u32, - approvals_remaining: ::core::primitive::u32, - }, - #[codec(index = 12)] - #[doc = "An asset class is in the process of being destroyed."] - DestructionStarted { asset_id: ::core::primitive::u32 }, - #[codec(index = 13)] - #[doc = "An asset class was destroyed."] - Destroyed { asset_id: ::core::primitive::u32 }, - #[codec(index = 14)] - #[doc = "Some asset class was force-created."] - ForceCreated { - asset_id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::AccountId32, - }, - #[codec(index = 15)] - #[doc = "New metadata has been set for an asset."] - MetadataSet { - asset_id: ::core::primitive::u32, - name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - symbol: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, - decimals: ::core::primitive::u8, - is_frozen: ::core::primitive::bool, + #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] + #[doc = ""] + #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] + #[doc = ""] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each call emits the `Event::DestroyedApprovals` event."] + destroy_approvals { + #[codec(compact)] + id: ::core::primitive::u32, }, - #[codec(index = 16)] - #[doc = "Metadata has been cleared for an asset."] - MetadataCleared { asset_id: ::core::primitive::u32 }, - #[codec(index = 17)] - #[doc = "(Additional) funds have been approved for transfer to a destination account."] - ApprovedTransfer { - asset_id: ::core::primitive::u32, - source: ::subxt::ext::subxt_core::utils::AccountId32, - delegate: ::subxt::ext::subxt_core::utils::AccountId32, + #[codec(index = 5)] + #[doc = "Complete destroying asset and unreserve currency."] + #[doc = ""] + #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] + #[doc = "hand."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each successful call emits the `Event::Destroyed` event."] + finish_destroy { + #[codec(compact)] + id: ::core::primitive::u32, + }, + #[codec(index = 6)] + #[doc = "Mint assets of a particular class."] + #[doc = ""] + #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount minted."] + #[doc = "- `beneficiary`: The account to be credited with the minted assets."] + #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = ""] + #[doc = "Emits `Issued` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] + mint { + #[codec(compact)] + id: ::core::primitive::u32, + beneficiary: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] amount: ::core::primitive::u128, }, - #[codec(index = 18)] - #[doc = "An approval for account `delegate` was cancelled by `owner`."] - ApprovalCancelled { - asset_id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::AccountId32, - delegate: ::subxt::ext::subxt_core::utils::AccountId32, + #[codec(index = 7)] + #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] + #[doc = ""] + #[doc = "Bails with `NoAccount` if the `who` is already dead."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount burned."] + #[doc = "- `who`: The account to be debited from."] + #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = ""] + #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] + #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] + burn { + #[codec(compact)] + id: ::core::primitive::u32, + who: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] + amount: ::core::primitive::u128, }, - #[codec(index = 19)] - #[doc = "An `amount` was transferred in its entirety from `owner` to `destination` by"] - #[doc = "the approved `delegate`."] - TransferredApproved { - asset_id: ::core::primitive::u32, - owner: ::subxt::ext::subxt_core::utils::AccountId32, - delegate: ::subxt::ext::subxt_core::utils::AccountId32, - destination: ::subxt::ext::subxt_core::utils::AccountId32, + #[codec(index = 8)] + #[doc = "Move some assets from the sender account to another."] + #[doc = ""] + #[doc = "Origin must be Signed."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] + #[doc = ""] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + transfer { + #[codec(compact)] + id: ::core::primitive::u32, + target: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] amount: ::core::primitive::u128, }, - #[codec(index = 20)] - #[doc = "An asset has had its attributes changed by the `Force` origin."] - AssetStatusChanged { asset_id: ::core::primitive::u32 }, - #[codec(index = 21)] - #[doc = "The min_balance of an asset has been updated by the asset owner."] - AssetMinBalanceChanged { - asset_id: ::core::primitive::u32, - new_min_balance: ::core::primitive::u128, + #[codec(index = 9)] + #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] + #[doc = ""] + #[doc = "Origin must be Signed."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] + #[doc = ""] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + transfer_keep_alive { + #[codec(compact)] + id: ::core::primitive::u32, + target: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] + amount: ::core::primitive::u128, }, - #[codec(index = 22)] - #[doc = "Some account `who` was created with a deposit from `depositor`."] - Touched { - asset_id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, - depositor: ::subxt::ext::subxt_core::utils::AccountId32, + #[codec(index = 10)] + #[doc = "Move some assets from one account to another."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `source`: The account to be debited."] + #[doc = "- `dest`: The account to be credited."] + #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] + #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] + #[doc = "below the minimum balance. Must be greater than zero."] + #[doc = ""] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] + #[doc = "`dest`."] + force_transfer { + #[codec(compact)] + id: ::core::primitive::u32, + source: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + dest: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] + amount: ::core::primitive::u128, }, - #[codec(index = 23)] - #[doc = "Some account `who` was blocked."] - Blocked { - asset_id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, + #[codec(index = 11)] + #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] + #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] + #[doc = "account that does not have an entry, use `touch_other` first."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be frozen."] + #[doc = ""] + #[doc = "Emits `Frozen`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + freeze { + #[codec(compact)] + id: ::core::primitive::u32, + who: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, }, - #[codec(index = 24)] - #[doc = "Some assets were deposited (e.g. for transaction fees)."] - Deposited { - asset_id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[codec(index = 12)] + #[doc = "Allow unprivileged transfers to and from an account again."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be unfrozen."] + #[doc = ""] + #[doc = "Emits `Thawed`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + thaw { + #[codec(compact)] + id: ::core::primitive::u32, + who: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, }, - #[codec(index = 25)] - #[doc = "Some assets were withdrawn from the account (e.g. for transaction fees)."] - Withdrawn { - asset_id: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[codec(index = 13)] + #[doc = "Disallow further unprivileged transfers for the asset class."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = ""] + #[doc = "Emits `Frozen`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + freeze_asset { + #[codec(compact)] + id: ::core::primitive::u32, }, - #[codec(index = 26)] - #[doc = "Reserve information was set or updated for `asset_id`."] - ReservesUpdated { - asset_id: ::core::primitive::u32, - reserves: ::subxt::ext::subxt_core::alloc::vec::Vec<()>, + #[codec(index = 14)] + #[doc = "Allow unprivileged transfers for the asset again."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be thawed."] + #[doc = ""] + #[doc = "Emits `Thawed`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + thaw_asset { + #[codec(compact)] + id: ::core::primitive::u32, }, - #[codec(index = 27)] - #[doc = "Reserve information was removed for `asset_id`."] - ReservesRemoved { asset_id: ::core::primitive::u32 }, - } - } - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub enum AccountStatus { - #[codec(index = 0)] - Liquid, - #[codec(index = 1)] - Frozen, - #[codec(index = 2)] - Blocked, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Approval<_0, _1> { - pub amount: _0, - pub deposit: _1, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct AssetAccount<_0, _1, _2, _3> { - pub balance: _0, - pub status: runtime_types::pallet_assets::types::AccountStatus, - pub reason: runtime_types::pallet_assets::types::ExistenceReason<_0, _3>, - pub extra: _2, - #[codec(skip)] - pub __ignore: ::core::marker::PhantomData<_1>, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct AssetDetails<_0, _1, _2> { - pub owner: _1, - pub issuer: _1, - pub admin: _1, - pub freezer: _1, - pub supply: _0, - pub deposit: _2, - pub min_balance: _0, - pub is_sufficient: ::core::primitive::bool, - pub accounts: ::core::primitive::u32, - pub sufficients: ::core::primitive::u32, - pub approvals: ::core::primitive::u32, - pub status: runtime_types::pallet_assets::types::AssetStatus, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct AssetMetadata<_0, _1> { - pub deposit: _0, - pub name: _1, - pub symbol: _1, - pub decimals: ::core::primitive::u8, - pub is_frozen: ::core::primitive::bool, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub enum AssetStatus { - #[codec(index = 0)] - Live, - #[codec(index = 1)] - Frozen, - #[codec(index = 2)] - Destroying, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub enum ExistenceReason<_0, _1> { - #[codec(index = 0)] - Consumer, - #[codec(index = 1)] - Sufficient, - #[codec(index = 2)] - DepositHeld(_0), - #[codec(index = 3)] - DepositRefunded, - #[codec(index = 4)] - DepositFrom(_1, _0), - } - } - } - pub mod pallet_assets_holder { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "The `Error` enum of this pallet."] - pub enum Error { - #[codec(index = 0)] - #[doc = "Number of holds on an account would exceed the count of `RuntimeHoldReason`."] - TooManyHolds, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "The `Event` enum of this pallet"] - pub enum Event { - #[codec(index = 0)] - #[doc = "`who`s balance on hold was increased by `amount`."] - Held { - who: ::subxt::ext::subxt_core::utils::AccountId32, - asset_id: ::core::primitive::u32, - reason: runtime_types::quantus_runtime::RuntimeHoldReason, - amount: ::core::primitive::u128, + #[codec(index = 15)] + #[doc = "Change the Owner of an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = ""] + #[doc = "Emits `OwnerChanged`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + transfer_ownership { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + }, + #[codec(index = 16)] + #[doc = "Change the Issuer, Admin and Freezer of an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] + #[doc = ""] + #[doc = "Emits `TeamChanged`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + set_team { + #[codec(compact)] + id: ::core::primitive::u32, + issuer: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + admin: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + freezer: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, }, - #[codec(index = 1)] - #[doc = "`who`s balance on hold was decreased by `amount`."] - Released { - who: ::subxt::ext::subxt_core::utils::AccountId32, - asset_id: ::core::primitive::u32, - reason: runtime_types::quantus_runtime::RuntimeHoldReason, - amount: ::core::primitive::u128, + #[codec(index = 17)] + #[doc = "Set the metadata for an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = ""] + #[doc = "Funds of sender are reserved according to the formula:"] + #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] + #[doc = "account any already reserved funds."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = ""] + #[doc = "Emits `MetadataSet`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + set_metadata { + #[codec(compact)] + id: ::core::primitive::u32, + name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + symbol: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + decimals: ::core::primitive::u8, }, - #[codec(index = 2)] - #[doc = "`who`s balance on hold was burned by `amount`."] - Burned { - who: ::subxt::ext::subxt_core::utils::AccountId32, - asset_id: ::core::primitive::u32, - reason: runtime_types::quantus_runtime::RuntimeHoldReason, + #[codec(index = 18)] + #[doc = "Clear the metadata for an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = ""] + #[doc = "Any deposit is freed for the asset owner."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + clear_metadata { + #[codec(compact)] + id: ::core::primitive::u32, + }, + #[codec(index = 19)] + #[doc = "Force the metadata for an asset to some value."] + #[doc = ""] + #[doc = "Origin must be ForceOrigin."] + #[doc = ""] + #[doc = "Any deposit is left alone."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = ""] + #[doc = "Emits `MetadataSet`."] + #[doc = ""] + #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] + force_set_metadata { + #[codec(compact)] + id: ::core::primitive::u32, + name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + symbol: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + decimals: ::core::primitive::u8, + is_frozen: ::core::primitive::bool, + }, + #[codec(index = 20)] + #[doc = "Clear the metadata for an asset."] + #[doc = ""] + #[doc = "Origin must be ForceOrigin."] + #[doc = ""] + #[doc = "Any deposit is returned."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + force_clear_metadata { + #[codec(compact)] + id: ::core::primitive::u32, + }, + #[codec(index = 21)] + #[doc = "Alter the attributes of a given asset."] + #[doc = ""] + #[doc = "Origin must be `ForceOrigin`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] + #[doc = "value to account for the state bloat associated with its balance storage. If set to"] + #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] + #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] + #[doc = "growth)."] + #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] + #[doc = "instructions."] + #[doc = ""] + #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + force_asset_status { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + issuer: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + admin: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + freezer: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] + min_balance: ::core::primitive::u128, + is_sufficient: ::core::primitive::bool, + is_frozen: ::core::primitive::bool, + }, + #[codec(index = 22)] + #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] + #[doc = ""] + #[doc = "Origin must be Signed."] + #[doc = ""] + #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] + #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] + #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] + #[doc = "meet the right value."] + #[doc = ""] + #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] + #[doc = "making this call."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account to delegate permission to transfer asset."] + #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] + #[doc = "already an approval in place, then this acts additively."] + #[doc = ""] + #[doc = "Emits `ApprovedTransfer` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + approve_transfer { + #[codec(compact)] + id: ::core::primitive::u32, + delegate: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] amount: ::core::primitive::u128, }, - } - } - } - pub mod pallet_balances { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub enum Call { - #[codec(index = 0)] - #[doc = "Transfer some liquid free balance to another account."] + #[codec(index = 23)] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] - #[doc = "If the sender's account is below the existential deposit as a result"] - #[doc = "of the transfer, the account will be reaped."] + #[doc = "Origin must be Signed and there must be an approval in place between signer and"] + #[doc = "`delegate`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] - transfer_allow_death { - dest: ::subxt::ext::subxt_core::utils::MultiAddress< + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = ""] + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + cancel_approval { + #[codec(compact)] + id: ::core::primitive::u32, + delegate: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + }, + #[codec(index = 24)] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] + #[doc = ""] + #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] + #[doc = "account of the asset `id`."] + #[doc = ""] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = ""] + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + force_cancel_approval { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + delegate: ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >, + }, + #[codec(index = 25)] + #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] + #[doc = "account."] + #[doc = ""] + #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] + #[doc = "signer."] + #[doc = ""] + #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] + #[doc = "reserved by `approve_transfer` is unreserved."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] + #[doc = "from which the asset balance will be withdrawn."] + #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] + #[doc = "- `amount`: The amount of assets to transfer."] + #[doc = ""] + #[doc = "Emits `TransferredApproved` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + transfer_approved { #[codec(compact)] - value: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] - #[doc = "may be specified."] - force_transfer { - source: ::subxt::ext::subxt_core::utils::MultiAddress< + id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >, - dest: ::subxt::ext::subxt_core::utils::MultiAddress< + destination: ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >, #[codec(compact)] - value: ::core::primitive::u128, + amount: ::core::primitive::u128, }, - #[codec(index = 3)] - #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] - #[doc = "kill the origin account."] + #[codec(index = 26)] + #[doc = "Create an asset account for non-provider assets."] #[doc = ""] - #[doc = "99% of the time you want [`transfer_allow_death`] instead."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] - transfer_keep_alive { - dest: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] + #[doc = ""] + #[doc = "Emits `Touched` event when successful."] + touch { #[codec(compact)] - value: ::core::primitive::u128, + id: ::core::primitive::u32, }, - #[codec(index = 4)] - #[doc = "Transfer the entire transferable balance from the caller account."] + #[codec(index = 27)] + #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] + #[doc = "account."] #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] + #[doc = "The origin must be Signed."] #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] + #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] + #[doc = " refunded."] + #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] #[doc = ""] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] - #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] - #[doc = " keep the sender account alive (true)."] - transfer_all { - dest: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - keep_alive: ::core::primitive::bool, + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] + #[doc = ""] + #[doc = "Emits `Refunded` event when successful."] + refund { + #[codec(compact)] + id: ::core::primitive::u32, + allow_burn: ::core::primitive::bool, }, - #[codec(index = 5)] - #[doc = "Unreserve some balance from a user by force."] + #[codec(index = 28)] + #[doc = "Sets the minimum balance of an asset."] #[doc = ""] - #[doc = "Can only be called by ROOT."] - force_unreserve { + #[doc = "Only works if there aren't any accounts that are holding the asset or if"] + #[doc = "the new value of `min_balance` is less than the old one."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender has to be the Owner of the"] + #[doc = "asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `min_balance`: The new value of `min_balance`."] + #[doc = ""] + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + set_min_balance { + #[codec(compact)] + id: ::core::primitive::u32, + min_balance: ::core::primitive::u128, + }, + #[codec(index = 29)] + #[doc = "Create an asset account for `who`."] + #[doc = ""] + #[doc = "A deposit will be taken from the signer account."] + #[doc = ""] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created, the asset status must"] + #[doc = " be live."] + #[doc = "- `who`: The account to be created."] + #[doc = ""] + #[doc = "Emits `Touched` event when successful."] + touch_other { + #[codec(compact)] + id: ::core::primitive::u32, who: ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >, - amount: ::core::primitive::u128, }, - #[codec(index = 6)] - #[doc = "Upgrade a specified account."] + #[codec(index = 30)] + #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] #[doc = ""] - #[doc = "- `origin`: Must be `Signed`."] - #[doc = "- `who`: The account to be upgraded."] + #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] + #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] + #[doc = "use `refund`."] #[doc = ""] - #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] - #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] - #[doc = "possibility of churn)."] - upgrade_accounts { - who: ::subxt::ext::subxt_core::alloc::vec::Vec< + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `who`: The account to refund."] + #[doc = ""] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] + #[doc = ""] + #[doc = "Emits `Refunded` event when successful."] + refund_other { + #[codec(compact)] + id: ::core::primitive::u32, + who: ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, + (), >, }, - #[codec(index = 8)] - #[doc = "Set the regular balance of a given account."] + #[codec(index = 31)] + #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] #[doc = ""] - #[doc = "The dispatch origin for this call is `root`."] - force_set_balance { + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the account's asset."] + #[doc = "- `who`: The account to be unblocked."] + #[doc = ""] + #[doc = "Emits `Blocked`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + block { + #[codec(compact)] + id: ::core::primitive::u32, who: ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >, - #[codec(compact)] - new_free: ::core::primitive::u128, }, - #[codec(index = 9)] - #[doc = "Adjust the total issuance in a saturating way."] + #[codec(index = 32)] + #[doc = "Transfer the entire transferable balance from the caller asset account."] #[doc = ""] - #[doc = "Can only be called by root and always needs a positive `delta`."] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] #[doc = ""] - #[doc = "# Example"] - force_adjust_total_issuance { - direction: runtime_types::pallet_balances::types::AdjustmentDirection, + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] + #[doc = " (false), or transfer everything except at least the minimum balance, which will"] + #[doc = " guarantee to keep the sender asset account alive (true)."] + transfer_all { #[codec(compact)] - delta: ::core::primitive::u128, + id: ::core::primitive::u32, + dest: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + keep_alive: ::core::primitive::bool, }, - #[codec(index = 10)] - #[doc = "Burn the specified liquid free balance from the origin account."] + #[codec(index = 33)] + #[doc = "Sets the trusted reserve information of an asset."] #[doc = ""] - #[doc = "If the origin's account ends up below the existential deposit as a result"] - #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] + #[doc = "Origin must be the Owner of the asset `id`. The origin must conform to the configured"] + #[doc = "`CreateOrigin` or be the signed `owner` configured during asset creation."] #[doc = ""] - #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] - #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] - burn { + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `reserves`: The full list of trusted reserves information."] + #[doc = ""] + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + set_reserves { #[codec(compact)] - value: ::core::primitive::u128, - keep_alive: ::core::primitive::bool, + id: ::core::primitive::u32, + reserves: runtime_types::bounded_collections::bounded_vec::BoundedVec<()>, }, } #[derive( @@ -22962,41 +19775,80 @@ pub mod api { #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] - #[doc = "Vesting balance too high to send value."] - VestingBalance, + #[doc = "Account balance must be greater than or equal to the transfer amount."] + BalanceLow, #[codec(index = 1)] - #[doc = "Account liquidity restrictions prevent withdrawal."] - LiquidityRestrictions, + #[doc = "The account to alter does not exist."] + NoAccount, #[codec(index = 2)] - #[doc = "Balance too low to send value."] - InsufficientBalance, + #[doc = "The signing account has no permission to do the operation."] + NoPermission, #[codec(index = 3)] - #[doc = "Value too low to create account due to existential deposit."] - ExistentialDeposit, + #[doc = "The given asset ID is unknown."] + Unknown, #[codec(index = 4)] - #[doc = "Transfer/payment would kill account."] - Expendability, + #[doc = "The origin account is frozen."] + Frozen, #[codec(index = 5)] - #[doc = "A vesting schedule already exists for this account."] - ExistingVestingSchedule, + #[doc = "The asset ID is already taken."] + InUse, #[codec(index = 6)] - #[doc = "Beneficiary account must pre-exist."] - DeadAccount, + #[doc = "Invalid witness data given."] + BadWitness, #[codec(index = 7)] - #[doc = "Number of named reserves exceed `MaxReserves`."] + #[doc = "Minimum balance should be non-zero."] + MinBalanceZero, + #[codec(index = 8)] + #[doc = "Unable to increment the consumer reference counters on the account. Either no provider"] + #[doc = "reference exists to allow a non-zero balance of a non-self-sufficient asset, or one"] + #[doc = "fewer then the maximum number of consumers has been reached."] + UnavailableConsumer, + #[codec(index = 9)] + #[doc = "Invalid metadata given."] + BadMetadata, + #[codec(index = 10)] + #[doc = "No approval exists that would allow the transfer."] + Unapproved, + #[codec(index = 11)] + #[doc = "The source account would not survive the transfer and it needs to stay alive."] + WouldDie, + #[codec(index = 12)] + #[doc = "The asset-account already exists."] + AlreadyExists, + #[codec(index = 13)] + #[doc = "The asset-account doesn't have an associated deposit."] + NoDeposit, + #[codec(index = 14)] + #[doc = "The operation would result in funds being burned."] + WouldBurn, + #[codec(index = 15)] + #[doc = "The asset is a live asset and is actively being used. Usually emit for operations such"] + #[doc = "as `start_destroy` which require the asset to be in a destroying state."] + LiveAsset, + #[codec(index = 16)] + #[doc = "The asset is not live, and likely being destroyed."] + AssetNotLive, + #[codec(index = 17)] + #[doc = "The asset status is not the expected status."] + IncorrectStatus, + #[codec(index = 18)] + #[doc = "The asset should be frozen before the given operation."] + NotFrozen, + #[codec(index = 19)] + #[doc = "Callback action resulted in error"] + CallbackFailed, + #[codec(index = 20)] + #[doc = "The asset ID must be equal to the [`NextAssetId`]."] + BadAssetId, + #[codec(index = 21)] + #[doc = "The asset cannot be destroyed because some accounts for this asset contain freezes."] + ContainsFreezes, + #[codec(index = 22)] + #[doc = "The asset cannot be destroyed because some accounts for this asset contain holds."] + ContainsHolds, + #[codec(index = 23)] + #[doc = "Tried setting too many reserves."] TooManyReserves, - #[codec(index = 8)] - #[doc = "Number of holds exceed `VariantCountOf`."] - TooManyHolds, - #[codec(index = 9)] - #[doc = "Number of freezes exceed `MaxFreezes`."] - TooManyFreezes, - #[codec(index = 10)] - #[doc = "The issuance cannot be modified since it is already deactivated."] - IssuanceDeactivated, - #[codec(index = 11)] - #[doc = "The delta cannot be zero."] - DeltaZero, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23012,181 +19864,178 @@ pub mod api { #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] - #[doc = "An account was created with some free balance."] - Endowed { - account: ::subxt::ext::subxt_core::utils::AccountId32, - free_balance: ::core::primitive::u128, + #[doc = "Some asset class was created."] + Created { + asset_id: ::core::primitive::u32, + creator: ::subxt::ext::subxt_core::utils::AccountId32, + owner: ::subxt::ext::subxt_core::utils::AccountId32, }, #[codec(index = 1)] - #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] - #[doc = "resulting in an outright loss."] - DustLost { - account: ::subxt::ext::subxt_core::utils::AccountId32, + #[doc = "Some assets were issued."] + Issued { + asset_id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 2)] - #[doc = "Transfer succeeded."] - Transfer { + #[doc = "Some assets were transferred."] + Transferred { + asset_id: ::core::primitive::u32, from: ::subxt::ext::subxt_core::utils::AccountId32, to: ::subxt::ext::subxt_core::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 3)] - #[doc = "A balance was set by root."] - BalanceSet { - who: ::subxt::ext::subxt_core::utils::AccountId32, - free: ::core::primitive::u128, + #[doc = "Some assets were destroyed."] + Burned { + asset_id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::AccountId32, + balance: ::core::primitive::u128, }, #[codec(index = 4)] - #[doc = "Some balance was reserved (moved from free to reserved)."] - Reserved { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "The management team changed."] + TeamChanged { + asset_id: ::core::primitive::u32, + issuer: ::subxt::ext::subxt_core::utils::AccountId32, + admin: ::subxt::ext::subxt_core::utils::AccountId32, + freezer: ::subxt::ext::subxt_core::utils::AccountId32, }, #[codec(index = 5)] - #[doc = "Some balance was unreserved (moved from reserved to free)."] - Unreserved { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "The owner changed."] + OwnerChanged { + asset_id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::AccountId32, }, #[codec(index = 6)] - #[doc = "Some balance was moved from the reserve of the first account to the second account."] - #[doc = "Final argument indicates the destination balance type."] - ReserveRepatriated { - from: ::subxt::ext::subxt_core::utils::AccountId32, - to: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - destination_status: - runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + #[doc = "Some account `who` was frozen."] + Frozen { + asset_id: ::core::primitive::u32, + who: ::subxt::ext::subxt_core::utils::AccountId32, }, #[codec(index = 7)] - #[doc = "Some amount was deposited (e.g. for transaction fees)."] - Deposit { + #[doc = "Some account `who` was thawed."] + Thawed { + asset_id: ::core::primitive::u32, who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, }, #[codec(index = 8)] - #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] - Withdraw { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, + #[doc = "Some asset `asset_id` was frozen."] + AssetFrozen { asset_id: ::core::primitive::u32 }, #[codec(index = 9)] - #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] - Slashed { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, + #[doc = "Some asset `asset_id` was thawed."] + AssetThawed { asset_id: ::core::primitive::u32 }, #[codec(index = 10)] - #[doc = "Some amount was minted into an account."] - Minted { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "Accounts were destroyed for given asset."] + AccountsDestroyed { + asset_id: ::core::primitive::u32, + accounts_destroyed: ::core::primitive::u32, + accounts_remaining: ::core::primitive::u32, }, #[codec(index = 11)] - #[doc = "Some credit was balanced and added to the TotalIssuance."] - MintedCredit { amount: ::core::primitive::u128 }, - #[codec(index = 12)] - #[doc = "Some amount was burned from an account."] - Burned { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "Approvals were destroyed for given asset."] + ApprovalsDestroyed { + asset_id: ::core::primitive::u32, + approvals_destroyed: ::core::primitive::u32, + approvals_remaining: ::core::primitive::u32, }, + #[codec(index = 12)] + #[doc = "An asset class is in the process of being destroyed."] + DestructionStarted { asset_id: ::core::primitive::u32 }, #[codec(index = 13)] - #[doc = "Some debt has been dropped from the Total Issuance."] - BurnedDebt { amount: ::core::primitive::u128 }, + #[doc = "An asset class was destroyed."] + Destroyed { asset_id: ::core::primitive::u32 }, #[codec(index = 14)] - #[doc = "Some amount was suspended from an account (it can be restored later)."] - Suspended { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "Some asset class was force-created."] + ForceCreated { + asset_id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::AccountId32, }, #[codec(index = 15)] - #[doc = "Some amount was restored into an account."] - Restored { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "New metadata has been set for an asset."] + MetadataSet { + asset_id: ::core::primitive::u32, + name: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + symbol: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + decimals: ::core::primitive::u8, + is_frozen: ::core::primitive::bool, }, #[codec(index = 16)] - #[doc = "An account was upgraded."] - Upgraded { who: ::subxt::ext::subxt_core::utils::AccountId32 }, + #[doc = "Metadata has been cleared for an asset."] + MetadataCleared { asset_id: ::core::primitive::u32 }, #[codec(index = 17)] - #[doc = "Total issuance was increased by `amount`, creating a credit to be balanced."] - Issued { amount: ::core::primitive::u128 }, + #[doc = "(Additional) funds have been approved for transfer to a destination account."] + ApprovedTransfer { + asset_id: ::core::primitive::u32, + source: ::subxt::ext::subxt_core::utils::AccountId32, + delegate: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 18)] - #[doc = "Total issuance was decreased by `amount`, creating a debt to be balanced."] - Rescinded { amount: ::core::primitive::u128 }, + #[doc = "An approval for account `delegate` was cancelled by `owner`."] + ApprovalCancelled { + asset_id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::AccountId32, + delegate: ::subxt::ext::subxt_core::utils::AccountId32, + }, #[codec(index = 19)] - #[doc = "Some balance was locked."] - Locked { - who: ::subxt::ext::subxt_core::utils::AccountId32, + #[doc = "An `amount` was transferred in its entirety from `owner` to `destination` by"] + #[doc = "the approved `delegate`."] + TransferredApproved { + asset_id: ::core::primitive::u32, + owner: ::subxt::ext::subxt_core::utils::AccountId32, + delegate: ::subxt::ext::subxt_core::utils::AccountId32, + destination: ::subxt::ext::subxt_core::utils::AccountId32, amount: ::core::primitive::u128, }, #[codec(index = 20)] - #[doc = "Some balance was unlocked."] - Unlocked { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, + #[doc = "An asset has had its attributes changed by the `Force` origin."] + AssetStatusChanged { asset_id: ::core::primitive::u32 }, #[codec(index = 21)] - #[doc = "Some balance was frozen."] - Frozen { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "The min_balance of an asset has been updated by the asset owner."] + AssetMinBalanceChanged { + asset_id: ::core::primitive::u32, + new_min_balance: ::core::primitive::u128, }, #[codec(index = 22)] - #[doc = "Some balance was thawed."] - Thawed { + #[doc = "Some account `who` was created with a deposit from `depositor`."] + Touched { + asset_id: ::core::primitive::u32, who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + depositor: ::subxt::ext::subxt_core::utils::AccountId32, }, #[codec(index = 23)] - #[doc = "The `TotalIssuance` was forcefully changed."] - TotalIssuanceForced { - old: ::core::primitive::u128, - new: ::core::primitive::u128, - }, - #[codec(index = 24)] - #[doc = "Some balance was placed on hold."] - Held { - reason: runtime_types::quantus_runtime::RuntimeHoldReason, + #[doc = "Some account `who` was blocked."] + Blocked { + asset_id: ::core::primitive::u32, who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, }, - #[codec(index = 25)] - #[doc = "Held balance was burned from an account."] - BurnedHeld { - reason: runtime_types::quantus_runtime::RuntimeHoldReason, + #[codec(index = 24)] + #[doc = "Some assets were deposited (e.g. for transaction fees)."] + Deposited { + asset_id: ::core::primitive::u32, who: ::subxt::ext::subxt_core::utils::AccountId32, amount: ::core::primitive::u128, }, - #[codec(index = 26)] - #[doc = "A transfer of `amount` on hold from `source` to `dest` was initiated."] - TransferOnHold { - reason: runtime_types::quantus_runtime::RuntimeHoldReason, - source: ::subxt::ext::subxt_core::utils::AccountId32, - dest: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 27)] - #[doc = "The `transferred` balance is placed on hold at the `dest` account."] - TransferAndHold { - reason: runtime_types::quantus_runtime::RuntimeHoldReason, - source: ::subxt::ext::subxt_core::utils::AccountId32, - dest: ::subxt::ext::subxt_core::utils::AccountId32, - transferred: ::core::primitive::u128, - }, - #[codec(index = 28)] - #[doc = "Some balance was released from hold."] - Released { - reason: runtime_types::quantus_runtime::RuntimeHoldReason, + #[codec(index = 25)] + #[doc = "Some assets were withdrawn from the account (e.g. for transaction fees)."] + Withdrawn { + asset_id: ::core::primitive::u32, who: ::subxt::ext::subxt_core::utils::AccountId32, amount: ::core::primitive::u128, }, - #[codec(index = 29)] - #[doc = "An unexpected/defensive event was triggered."] - Unexpected(runtime_types::pallet_balances::pallet::UnexpectedKind), + #[codec(index = 26)] + #[doc = "Reserve information was set or updated for `asset_id`."] + ReservesUpdated { + asset_id: ::core::primitive::u32, + reserves: ::subxt::ext::subxt_core::alloc::vec::Vec<()>, + }, + #[codec(index = 27)] + #[doc = "Reserve information was removed for `asset_id`."] + ReservesRemoved { asset_id: ::core::primitive::u32 }, } + } + pub mod types { + use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -23198,15 +20047,14 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub enum UnexpectedKind { + pub enum AccountStatus { #[codec(index = 0)] - BalanceUpdated, + Liquid, #[codec(index = 1)] - FailedToMutateAccount, + Frozen, + #[codec(index = 2)] + Blocked, } - } - pub mod types { - use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -23218,11 +20066,9 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct AccountData<_0> { - pub free: _0, - pub reserved: _0, - pub frozen: _0, - pub flags: runtime_types::pallet_balances::types::ExtraFlags, + pub struct Approval<_0, _1> { + pub amount: _0, + pub deposit: _1, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23235,11 +20081,13 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub enum AdjustmentDirection { - #[codec(index = 0)] - Increase, - #[codec(index = 1)] - Decrease, + pub struct AssetAccount<_0, _1, _2, _3> { + pub balance: _0, + pub status: runtime_types::pallet_assets::types::AccountStatus, + pub reason: runtime_types::pallet_assets::types::ExistenceReason<_0, _3>, + pub extra: _2, + #[codec(skip)] + pub __ignore: ::core::marker::PhantomData<_1>, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23252,10 +20100,19 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct BalanceLock<_0> { - pub id: [::core::primitive::u8; 8usize], - pub amount: _0, - pub reasons: runtime_types::pallet_balances::types::Reasons, + pub struct AssetDetails<_0, _1, _2> { + pub owner: _1, + pub issuer: _1, + pub admin: _1, + pub freezer: _1, + pub supply: _0, + pub deposit: _2, + pub min_balance: _0, + pub is_sufficient: ::core::primitive::bool, + pub accounts: ::core::primitive::u32, + pub sufficients: ::core::primitive::u32, + pub approvals: ::core::primitive::u32, + pub status: runtime_types::pallet_assets::types::AssetStatus, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23268,7 +20125,13 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct ExtraFlags(pub ::core::primitive::u128); + pub struct AssetMetadata<_0, _1> { + pub deposit: _0, + pub name: _1, + pub symbol: _1, + pub decimals: ::core::primitive::u8, + pub is_frozen: ::core::primitive::bool, + } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -23280,13 +20143,13 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub enum Reasons { + pub enum AssetStatus { #[codec(index = 0)] - Fee, + Live, #[codec(index = 1)] - Misc, + Frozen, #[codec(index = 2)] - All, + Destroying, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23299,15 +20162,23 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct ReserveData<_0, _1> { - pub id: _0, - pub amount: _1, + pub enum ExistenceReason<_0, _1> { + #[codec(index = 0)] + Consumer, + #[codec(index = 1)] + Sufficient, + #[codec(index = 2)] + DepositHeld(_0), + #[codec(index = 3)] + DepositRefunded, + #[codec(index = 4)] + DepositFrom(_1, _0), } } } - pub mod pallet_conviction_voting { + pub mod pallet_assets_holder { use super::runtime_types; - pub mod conviction { + pub mod pallet { use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23320,23 +20191,54 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub enum Conviction { + #[doc = "The `Error` enum of this pallet."] + pub enum Error { #[codec(index = 0)] - None, + #[doc = "Number of holds on an account would exceed the count of `RuntimeHoldReason`."] + TooManyHolds, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "`who`s balance on hold was increased by `amount`."] + Held { + who: ::subxt::ext::subxt_core::utils::AccountId32, + asset_id: ::core::primitive::u32, + reason: runtime_types::quantus_runtime::RuntimeHoldReason, + amount: ::core::primitive::u128, + }, #[codec(index = 1)] - Locked1x, + #[doc = "`who`s balance on hold was decreased by `amount`."] + Released { + who: ::subxt::ext::subxt_core::utils::AccountId32, + asset_id: ::core::primitive::u32, + reason: runtime_types::quantus_runtime::RuntimeHoldReason, + amount: ::core::primitive::u128, + }, #[codec(index = 2)] - Locked2x, - #[codec(index = 3)] - Locked3x, - #[codec(index = 4)] - Locked4x, - #[codec(index = 5)] - Locked5x, - #[codec(index = 6)] - Locked6x, + #[doc = "`who`s balance on hold was burned by `amount`."] + Burned { + who: ::subxt::ext::subxt_core::utils::AccountId32, + asset_id: ::core::primitive::u32, + reason: runtime_types::quantus_runtime::RuntimeHoldReason, + amount: ::core::primitive::u128, + }, } } + } + pub mod pallet_balances { + use super::runtime_types; pub mod pallet { use super::runtime_types; #[derive( @@ -23353,146 +20255,134 @@ pub mod api { #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Transfer some liquid free balance to another account."] #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] + #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - vote { - #[codec(compact)] - poll_index: ::core::primitive::u32, - vote: runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + transfer_allow_death { + dest: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), >, + #[codec(compact)] + value: ::core::primitive::u128, }, - #[codec(index = 1)] - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] - #[doc = ""] - #[doc = "Emits `Delegated`."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - delegate { - class: ::core::primitive::u16, - to: ::subxt::ext::subxt_core::utils::MultiAddress< + #[codec(index = 2)] + #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] + #[doc = "may be specified."] + force_transfer { + source: ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >, - conviction: runtime_types::pallet_conviction_voting::conviction::Conviction, - balance: ::core::primitive::u128, + dest: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, }, - #[codec(index = 2)] - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] + #[codec(index = 3)] + #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] + #[doc = "kill the origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer_allow_death`] instead."] #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] + #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] + transfer_keep_alive { + dest: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Transfer the entire transferable balance from the caller account."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = "The dispatch origin of this call must be Signed."] #[doc = ""] - #[doc = "Emits `Undelegated`."] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true)."] + transfer_all { + dest: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + keep_alive: ::core::primitive::bool, + }, + #[codec(index = 5)] + #[doc = "Unreserve some balance from a user by force."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - undelegate { class: ::core::primitive::u16 }, - #[codec(index = 3)] - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] + #[doc = "Can only be called by ROOT."] + force_unreserve { + who: ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + amount: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "Upgrade a specified account."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `who`: The account to be upgraded."] #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] + #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] + #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] + #[doc = "possibility of churn)."] + upgrade_accounts { + who: ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + }, + #[codec(index = 8)] + #[doc = "Set the regular balance of a given account."] #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - unlock { - class: ::core::primitive::u16, - target: ::subxt::ext::subxt_core::utils::MultiAddress< + #[doc = "The dispatch origin for this call is `root`."] + force_set_balance { + who: ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >, + #[codec(compact)] + new_free: ::core::primitive::u128, }, - #[codec(index = 4)] - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] - #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - remove_vote { - class: ::core::option::Option<::core::primitive::u16>, - index: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Remove a vote for a poll."] + #[codec(index = 9)] + #[doc = "Adjust the total issuance in a saturating way."] #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] + #[doc = "Can only be called by root and always needs a positive `delta`."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "# Example"] + force_adjust_total_issuance { + direction: runtime_types::pallet_balances::types::AdjustmentDirection, + #[codec(compact)] + delta: ::core::primitive::u128, + }, + #[codec(index = 10)] + #[doc = "Burn the specified liquid free balance from the origin account."] #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] + #[doc = "If the origin's account ends up below the existential deposit as a result"] + #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - remove_other_vote { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - class: ::core::primitive::u16, - index: ::core::primitive::u32, + #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] + #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] + burn { + #[codec(compact)] + value: ::core::primitive::u128, + keep_alive: ::core::primitive::bool, }, } #[derive( @@ -23509,42 +20399,41 @@ pub mod api { #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] - #[doc = "Poll is not ongoing."] - NotOngoing, + #[doc = "Vesting balance too high to send value."] + VestingBalance, #[codec(index = 1)] - #[doc = "The given account did not vote on the poll."] - NotVoter, + #[doc = "Account liquidity restrictions prevent withdrawal."] + LiquidityRestrictions, #[codec(index = 2)] - #[doc = "The actor has no permission to conduct the action."] - NoPermission, + #[doc = "Balance too low to send value."] + InsufficientBalance, #[codec(index = 3)] - #[doc = "The actor has no permission to conduct the action right now but will do in the future."] - NoPermissionYet, + #[doc = "Value too low to create account due to existential deposit."] + ExistentialDeposit, #[codec(index = 4)] - #[doc = "The account is already delegating."] - AlreadyDelegating, + #[doc = "Transfer/payment would kill account."] + Expendability, #[codec(index = 5)] - #[doc = "The account currently has votes attached to it and the operation cannot succeed until"] - #[doc = "these are removed through `remove_vote`."] - AlreadyVoting, + #[doc = "A vesting schedule already exists for this account."] + ExistingVestingSchedule, #[codec(index = 6)] - #[doc = "Too high a balance was provided that the account cannot afford."] - InsufficientFunds, + #[doc = "Beneficiary account must pre-exist."] + DeadAccount, #[codec(index = 7)] - #[doc = "The account is not currently delegating."] - NotDelegating, + #[doc = "Number of named reserves exceed `MaxReserves`."] + TooManyReserves, #[codec(index = 8)] - #[doc = "Delegation to oneself makes no sense."] - Nonsense, + #[doc = "Number of holds exceed `VariantCountOf`."] + TooManyHolds, #[codec(index = 9)] - #[doc = "Maximum number of votes reached."] - MaxVotesReached, + #[doc = "Number of freezes exceed `MaxFreezes`."] + TooManyFreezes, #[codec(index = 10)] - #[doc = "The class must be supplied since it is not easily determinable from the state."] - ClassNeeded, + #[doc = "The issuance cannot be modified since it is already deactivated."] + IssuanceDeactivated, #[codec(index = 11)] - #[doc = "The class ID supplied is invalid."] - BadClass, + #[doc = "The delta cannot be zero."] + DeltaZero, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23560,60 +20449,180 @@ pub mod api { #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] - #[doc = "An account has delegated their vote to another account. \\[who, target\\]"] - Delegated( - ::subxt::ext::subxt_core::utils::AccountId32, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u16, - ), + #[doc = "An account was created with some free balance."] + Endowed { + account: ::subxt::ext::subxt_core::utils::AccountId32, + free_balance: ::core::primitive::u128, + }, #[codec(index = 1)] - #[doc = "An \\[account\\] has cancelled a previous delegation operation."] - Undelegated( - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u16, - ), + #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] + #[doc = "resulting in an outright loss."] + DustLost { + account: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 2)] - #[doc = "An account has voted"] - Voted { - who: ::subxt::ext::subxt_core::utils::AccountId32, - vote: runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, - >, - poll_index: ::core::primitive::u32, + #[doc = "Transfer succeeded."] + Transfer { + from: ::subxt::ext::subxt_core::utils::AccountId32, + to: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, }, #[codec(index = 3)] - #[doc = "A vote has been removed"] - VoteRemoved { + #[doc = "A balance was set by root."] + BalanceSet { who: ::subxt::ext::subxt_core::utils::AccountId32, - vote: runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, - >, - poll_index: ::core::primitive::u32, + free: ::core::primitive::u128, }, #[codec(index = 4)] - #[doc = "The lockup period of a conviction vote expired, and the funds have been unlocked."] - VoteUnlocked { + #[doc = "Some balance was reserved (moved from free to reserved)."] + Reserved { who: ::subxt::ext::subxt_core::utils::AccountId32, - class: ::core::primitive::u16, + amount: ::core::primitive::u128, }, - } - } - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Delegations<_0> { - pub votes: _0, - pub capital: _0, + #[codec(index = 5)] + #[doc = "Some balance was unreserved (moved from reserved to free)."] + Unreserved { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "Some balance was moved from the reserve of the first account to the second account."] + #[doc = "Final argument indicates the destination balance type."] + ReserveRepatriated { + from: ::subxt::ext::subxt_core::utils::AccountId32, + to: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + destination_status: + runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + }, + #[codec(index = 7)] + #[doc = "Some amount was deposited (e.g. for transaction fees)."] + Deposit { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 8)] + #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] + Withdraw { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 9)] + #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] + Slashed { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 10)] + #[doc = "Some amount was minted into an account."] + Minted { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 11)] + #[doc = "Some credit was balanced and added to the TotalIssuance."] + MintedCredit { amount: ::core::primitive::u128 }, + #[codec(index = 12)] + #[doc = "Some amount was burned from an account."] + Burned { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 13)] + #[doc = "Some debt has been dropped from the Total Issuance."] + BurnedDebt { amount: ::core::primitive::u128 }, + #[codec(index = 14)] + #[doc = "Some amount was suspended from an account (it can be restored later)."] + Suspended { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 15)] + #[doc = "Some amount was restored into an account."] + Restored { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 16)] + #[doc = "An account was upgraded."] + Upgraded { who: ::subxt::ext::subxt_core::utils::AccountId32 }, + #[codec(index = 17)] + #[doc = "Total issuance was increased by `amount`, creating a credit to be balanced."] + Issued { amount: ::core::primitive::u128 }, + #[codec(index = 18)] + #[doc = "Total issuance was decreased by `amount`, creating a debt to be balanced."] + Rescinded { amount: ::core::primitive::u128 }, + #[codec(index = 19)] + #[doc = "Some balance was locked."] + Locked { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 20)] + #[doc = "Some balance was unlocked."] + Unlocked { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 21)] + #[doc = "Some balance was frozen."] + Frozen { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 22)] + #[doc = "Some balance was thawed."] + Thawed { + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 23)] + #[doc = "The `TotalIssuance` was forcefully changed."] + TotalIssuanceForced { + old: ::core::primitive::u128, + new: ::core::primitive::u128, + }, + #[codec(index = 24)] + #[doc = "Some balance was placed on hold."] + Held { + reason: runtime_types::quantus_runtime::RuntimeHoldReason, + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 25)] + #[doc = "Held balance was burned from an account."] + BurnedHeld { + reason: runtime_types::quantus_runtime::RuntimeHoldReason, + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 26)] + #[doc = "A transfer of `amount` on hold from `source` to `dest` was initiated."] + TransferOnHold { + reason: runtime_types::quantus_runtime::RuntimeHoldReason, + source: ::subxt::ext::subxt_core::utils::AccountId32, + dest: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 27)] + #[doc = "The `transferred` balance is placed on hold at the `dest` account."] + TransferAndHold { + reason: runtime_types::quantus_runtime::RuntimeHoldReason, + source: ::subxt::ext::subxt_core::utils::AccountId32, + dest: ::subxt::ext::subxt_core::utils::AccountId32, + transferred: ::core::primitive::u128, + }, + #[codec(index = 28)] + #[doc = "Some balance was released from hold."] + Released { + reason: runtime_types::quantus_runtime::RuntimeHoldReason, + who: ::subxt::ext::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 29)] + #[doc = "An unexpected/defensive event was triggered."] + Unexpected(runtime_types::pallet_balances::pallet::UnexpectedKind), } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23626,13 +20635,14 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct Tally<_0> { - pub ayes: _0, - pub nays: _0, - pub support: _0, + pub enum UnexpectedKind { + #[codec(index = 0)] + BalanceUpdated, + #[codec(index = 1)] + FailedToMutateAccount, } } - pub mod vote { + pub mod types { use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23645,16 +20655,11 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub enum AccountVote<_0> { - #[codec(index = 0)] - Standard { - vote: runtime_types::pallet_conviction_voting::vote::Vote, - balance: _0, - }, - #[codec(index = 1)] - Split { aye: _0, nay: _0 }, - #[codec(index = 2)] - SplitAbstain { aye: _0, nay: _0, abstain: _0 }, + pub struct AccountData<_0> { + pub free: _0, + pub reserved: _0, + pub frozen: _0, + pub flags: runtime_types::pallet_balances::types::ExtraFlags, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23667,16 +20672,11 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct Casting<_0, _1, _2> { - pub votes: runtime_types::bounded_collections::bounded_vec::BoundedVec<( - _1, - runtime_types::pallet_conviction_voting::vote::AccountVote<_0>, - )>, - pub delegations: - runtime_types::pallet_conviction_voting::types::Delegations<_0>, - pub prior: runtime_types::pallet_conviction_voting::vote::PriorLock<_1, _0>, - #[codec(skip)] - pub __ignore: ::core::marker::PhantomData<_2>, + pub enum AdjustmentDirection { + #[codec(index = 0)] + Increase, + #[codec(index = 1)] + Decrease, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23689,13 +20689,10 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct Delegating<_0, _1, _2> { - pub balance: _0, - pub target: _1, - pub conviction: runtime_types::pallet_conviction_voting::conviction::Conviction, - pub delegations: - runtime_types::pallet_conviction_voting::types::Delegations<_0>, - pub prior: runtime_types::pallet_conviction_voting::vote::PriorLock<_2, _0>, + pub struct BalanceLock<_0> { + pub id: [::core::primitive::u8; 8usize], + pub amount: _0, + pub reasons: runtime_types::pallet_balances::types::Reasons, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -23708,7 +20705,7 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct PriorLock<_0, _1>(pub _0, pub _1); + pub struct ExtraFlags(pub ::core::primitive::u128); #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -23720,7 +20717,14 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub struct Vote(pub ::core::primitive::u8); + pub enum Reasons { + #[codec(index = 0)] + Fee, + #[codec(index = 1)] + Misc, + #[codec(index = 2)] + All, + } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -23732,14 +20736,9 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - pub enum Voting<_0, _1, _2, _3> { - #[codec(index = 0)] - Casting(runtime_types::pallet_conviction_voting::vote::Casting<_0, _2, _2>), - #[codec(index = 1)] - Delegating( - runtime_types::pallet_conviction_voting::vote::Delegating<_0, _1, _2>, - ), - __Ignore(::core::marker::PhantomData<_3>), + pub struct ReserveData<_0, _1> { + pub id: _0, + pub amount: _1, } } } @@ -23845,8 +20844,11 @@ pub mod api { #[doc = "**For threshold=1:** The proposal is created with `Approved` status immediately"] #[doc = "and can be executed via `execute()` without additional approvals."] #[doc = ""] - #[doc = "**Weight:** Charged upfront for worst-case (high-security path with decode)."] - #[doc = "Refunded to actual cost on success based on whether HS path was taken."] + #[doc = "**Weight:** Charged upfront includes bookkeeping + MaxInnerCallWeight to cover"] + #[doc = "the cost of decoding arbitrary RuntimeCall structures and calling get_dispatch_info()."] + #[doc = "On success, refunds based on actual inner call weight. On rejection after decode"] + #[doc = "(e.g., CallWeightExceedsLimit, CallNotAllowedForHighSecurityMultisig), the full"] + #[doc = "reserved weight is burned to prevent griefing with complex calls that get rejected."] propose { multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, call: runtime_types::bounded_collections::bounded_vec::BoundedVec< @@ -24821,48 +21823,51 @@ pub mod api { #[doc = "User is not allowed to make a call on behalf of this account"] NotAllowed, #[codec(index = 1)] + #[doc = "Call is not allowed for a high-security account"] + CallNotAllowedForHighSecurity, + #[codec(index = 2)] #[doc = "Threshold must be greater than zero"] ZeroThreshold, - #[codec(index = 2)] + #[codec(index = 3)] #[doc = "Friends list must be greater than zero and threshold"] NotEnoughFriends, - #[codec(index = 3)] + #[codec(index = 4)] #[doc = "Friends list must be less than max friends"] MaxFriends, - #[codec(index = 4)] + #[codec(index = 5)] #[doc = "Friends list must be sorted and free of duplicates"] NotSorted, - #[codec(index = 5)] + #[codec(index = 6)] #[doc = "This account is not set up for recovery"] NotRecoverable, - #[codec(index = 6)] + #[codec(index = 7)] #[doc = "This account is already set up for recovery"] AlreadyRecoverable, - #[codec(index = 7)] + #[codec(index = 8)] #[doc = "A recovery process has already started for this account"] AlreadyStarted, - #[codec(index = 8)] + #[codec(index = 9)] #[doc = "A recovery process has not started for this rescuer"] NotStarted, - #[codec(index = 9)] + #[codec(index = 10)] #[doc = "This account is not a friend who can vouch"] NotFriend, - #[codec(index = 10)] + #[codec(index = 11)] #[doc = "The friend must wait until the delay period to vouch for this recovery"] DelayPeriod, - #[codec(index = 11)] + #[codec(index = 12)] #[doc = "This user has already vouched for this recovery"] AlreadyVouched, - #[codec(index = 12)] + #[codec(index = 13)] #[doc = "The threshold for recovering this account has not been met"] Threshold, - #[codec(index = 13)] + #[codec(index = 14)] #[doc = "There are still active recovery attempts that need to be closed"] StillActive, - #[codec(index = 14)] + #[codec(index = 15)] #[doc = "This account is already set up for recovery"] AlreadyProxy, - #[codec(index = 15)] + #[codec(index = 16)] #[doc = "Some internal state is broken."] BadState, } @@ -25144,130 +22149,7 @@ pub mod api { crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] #[doc = "The `Event` enum of this pallet"] - pub enum Event1 { - #[codec(index = 0)] - #[doc = "A referendum has been submitted."] - Submitted { - index: ::core::primitive::u32, - track: ::core::primitive::u16, - proposal: runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - }, - #[codec(index = 1)] - #[doc = "The decision deposit has been placed."] - DecisionDepositPlaced { - index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "The decision deposit has been refunded."] - DecisionDepositRefunded { - index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 3)] - #[doc = "A deposit has been slashed."] - DepositSlashed { - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 4)] - #[doc = "A referendum has moved into the deciding phase."] - DecisionStarted { - index: ::core::primitive::u32, - track: ::core::primitive::u16, - proposal: runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - tally: runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - }, - #[codec(index = 5)] - ConfirmStarted { index: ::core::primitive::u32 }, - #[codec(index = 6)] - ConfirmAborted { index: ::core::primitive::u32 }, - #[codec(index = 7)] - #[doc = "A referendum has ended its confirmation phase and is ready for approval."] - Confirmed { - index: ::core::primitive::u32, - tally: runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - }, - #[codec(index = 8)] - #[doc = "A referendum has been approved and its proposal has been scheduled."] - Approved { index: ::core::primitive::u32 }, - #[codec(index = 9)] - #[doc = "A proposal has been rejected by referendum."] - Rejected { - index: ::core::primitive::u32, - tally: runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - }, - #[codec(index = 10)] - #[doc = "A referendum has been timed out without being decided."] - TimedOut { - index: ::core::primitive::u32, - tally: runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - }, - #[codec(index = 11)] - #[doc = "A referendum has been cancelled."] - Cancelled { - index: ::core::primitive::u32, - tally: runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - }, - #[codec(index = 12)] - #[doc = "A referendum has been killed."] - Killed { - index: ::core::primitive::u32, - tally: runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - }, - #[codec(index = 13)] - #[doc = "The submission deposit has been refunded."] - SubmissionDepositRefunded { - index: ::core::primitive::u32, - who: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, - #[codec(index = 14)] - #[doc = "Metadata for a referendum has been set."] - MetadataSet { - index: ::core::primitive::u32, - hash: ::subxt::ext::subxt_core::utils::H256, - }, - #[codec(index = 15)] - #[doc = "Metadata for a referendum has been cleared."] - MetadataCleared { - index: ::core::primitive::u32, - hash: ::subxt::ext::subxt_core::utils::H256, - }, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "The `Event` enum of this pallet"] - pub enum Event2 { + pub enum Event { #[codec(index = 0)] #[doc = "A referendum has been submitted."] Submitted { @@ -25890,140 +22772,6 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub enum Call { - #[codec(index = 0)] - schedule { - when: ::core::primitive::u32, - priority: ::core::primitive::u8, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::quantus_runtime::RuntimeCall, - >, - }, - #[codec(index = 1)] - #[doc = "Cancel an anonymously scheduled task."] - cancel { - when: runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - index: ::core::primitive::u32, - }, - #[codec(index = 2)] - schedule_named { - id: [::core::primitive::u8; 32usize], - when: ::core::primitive::u32, - priority: ::core::primitive::u8, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::quantus_runtime::RuntimeCall, - >, - }, - #[codec(index = 3)] - #[doc = "Cancel a named scheduled task."] - cancel_named { id: [::core::primitive::u8; 32usize] }, - #[codec(index = 4)] - schedule_after { - after: runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - priority: ::core::primitive::u8, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::quantus_runtime::RuntimeCall, - >, - }, - #[codec(index = 5)] - schedule_named_after { - id: [::core::primitive::u8; 32usize], - after: runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - priority: ::core::primitive::u8, - call: ::subxt::ext::subxt_core::alloc::boxed::Box< - runtime_types::quantus_runtime::RuntimeCall, - >, - }, - #[codec(index = 6)] - #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] - #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] - #[doc = "succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry are unnamed"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "The `period` type must match the task's scheduling type: block-scheduled tasks"] - #[doc = "require a block-number period, and timestamp-scheduled tasks require a timestamp"] - #[doc = "period. Mismatched types will return [`Error::RetryPeriodMismatch`]."] - set_retry { - task: ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ), - retries: ::core::primitive::u8, - period: runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - }, - #[codec(index = 7)] - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry are unnamed"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - #[doc = ""] - #[doc = "The `period` type must match the task's scheduling type: block-scheduled tasks"] - #[doc = "require a block-number period, and timestamp-scheduled tasks require a timestamp"] - #[doc = "period. Mismatched types will return [`Error::RetryPeriodMismatch`]."] - set_retry_named { - id: [::core::primitive::u8; 32usize], - retries: ::core::primitive::u8, - period: runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - }, - #[codec(index = 8)] - #[doc = "Removes the retry configuration of a task."] - cancel_retry { - task: ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ), - }, - #[codec(index = 9)] - #[doc = "Cancel the retry configuration of a named task."] - cancel_retry_named { id: [::core::primitive::u8; 32usize] }, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] @@ -26612,6 +23360,9 @@ pub mod api { #[codec(index = 0)] #[doc = "Too many calls batched."] TooManyCalls, + #[codec(index = 1)] + #[doc = "Call is not allowed for a high-security account."] + CallNotAllowedForHighSecurity, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -26724,6 +23475,11 @@ pub mod api { #[codec(index = 9)] #[doc = "Only native asset (asset_id = 0) is supported in this version"] NonNativeAssetNotSupported, + #[codec(index = 10)] + #[doc = "Soundness invariant violated: total wormhole exits would exceed the value that could"] + #[doc = "possibly have been deposited into wormhole addresses. This indicates a potential"] + #[doc = "soundness bug in the ZK proof system, so the exit is rejected."] + SoundnessInvariantViolation, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -27036,16 +23792,10 @@ pub mod api { Balances(runtime_types::pallet_balances::pallet::Call), #[codec(index = 7)] Preimage(runtime_types::pallet_preimage::pallet::Call), - #[codec(index = 8)] - Scheduler(runtime_types::pallet_scheduler::pallet::Call), #[codec(index = 9)] Utility(runtime_types::pallet_utility::pallet::Call), - #[codec(index = 10)] - Referenda(runtime_types::pallet_referenda::pallet::Call), #[codec(index = 11)] ReversibleTransfers(runtime_types::pallet_reversible_transfers::pallet::Call), - #[codec(index = 12)] - ConvictionVoting(runtime_types::pallet_conviction_voting::pallet::Call), #[codec(index = 13)] TechCollective(runtime_types::pallet_ranked_collective::pallet::Call), #[codec(index = 14)] @@ -27079,12 +23829,8 @@ pub mod api { Scheduler(runtime_types::pallet_scheduler::pallet::Error), #[codec(index = 9)] Utility(runtime_types::pallet_utility::pallet::Error), - #[codec(index = 10)] - Referenda(runtime_types::pallet_referenda::pallet::Error), #[codec(index = 11)] ReversibleTransfers(runtime_types::pallet_reversible_transfers::pallet::Error), - #[codec(index = 12)] - ConvictionVoting(runtime_types::pallet_conviction_voting::pallet::Error), #[codec(index = 13)] TechCollective(runtime_types::pallet_ranked_collective::pallet::Error), #[codec(index = 14)] @@ -27128,16 +23874,12 @@ pub mod api { Scheduler(runtime_types::pallet_scheduler::pallet::Event), #[codec(index = 9)] Utility(runtime_types::pallet_utility::pallet::Event), - #[codec(index = 10)] - Referenda(runtime_types::pallet_referenda::pallet::Event1), #[codec(index = 11)] ReversibleTransfers(runtime_types::pallet_reversible_transfers::pallet::Event), - #[codec(index = 12)] - ConvictionVoting(runtime_types::pallet_conviction_voting::pallet::Event), #[codec(index = 13)] TechCollective(runtime_types::pallet_ranked_collective::pallet::Event), #[codec(index = 14)] - TechReferenda(runtime_types::pallet_referenda::pallet::Event2), + TechReferenda(runtime_types::pallet_referenda::pallet::Event), #[codec(index = 15)] TreasuryPallet(runtime_types::pallet_treasury::pallet::Event), #[codec(index = 16)] diff --git a/src/cli/common.rs b/src/cli/common.rs index 3f34ce9..8095144 100644 --- a/src/cli/common.rs +++ b/src/cli/common.rs @@ -629,7 +629,7 @@ async fn wait_tx_inclusion( let start_time = std::time::Instant::now(); let mut execution_success_checked_for = None; - let spinner = if !crate::log::is_verbose() { + let spinner = if !crate::log::is_verbose() && !crate::log::is_quiet() { let pb = ProgressBar::new_spinner(); pb.set_style( ProgressStyle::default_spinner() @@ -800,7 +800,7 @@ pub async fn submit_preimage( Ok(()) } -async fn check_execution_success( +pub(crate) async fn check_execution_success( client: &OnlineClient, block_hash: &subxt::utils::H256, tx_hash: &subxt::utils::H256, diff --git a/src/cli/exercise/mod.rs b/src/cli/exercise/mod.rs new file mode 100644 index 0000000..9331e1e --- /dev/null +++ b/src/cli/exercise/mod.rs @@ -0,0 +1,341 @@ +//! `quantus exercise` β€” scenario-based smoke/fuzz suite that drives every +//! call path the CLI wraps against a live node. Designed for CI: exits +//! nonzero when any non-skipped scenario fails, and supports an optional +//! governance-driven runtime-upgrade phase on fast-governance nodes. + +pub mod report; +pub mod runner; +pub mod scenarios; + +use crate::{ + chain::{client::QuantusClient, quantus_subxt}, + error::{QuantusError, Result}, + wallet::QuantumKeyPair, +}; +use clap::Args; +use rand::SeedableRng; +use report::Report; +use runner::ExerciseCtx; +use std::path::PathBuf; + +/// Arguments for `quantus exercise`. +#[derive(Args, Debug)] +pub struct ExerciseArgs { + /// Comma-separated phases to run (default: all except `upgrade`, which + /// is enabled by passing --upgrade-wasm). Use --skip to exclude phases, + /// e.g. --skip wormhole on debug builds where proving is slow. + #[arg(long, value_delimiter = ',')] + pub phases: Option>, + + /// Comma-separated phases to skip. + #[arg(long, value_delimiter = ',')] + pub skip: Option>, + + /// Number of seeded fuzz iterations. + #[arg(long, default_value_t = 25)] + pub fuzz_iterations: u32, + + /// RNG seed for reproducible fuzzing (default: random). + #[arg(long)] + pub seed: Option, + + /// Path to a runtime WASM with a higher spec_version; enables the + /// governance runtime-upgrade phase (requires a fast-governance node). + #[arg(long)] + pub upgrade_wasm: Option, + + /// Seconds to wait for the runtime upgrade to enact before failing. + #[arg(long, default_value_t = 900)] + pub upgrade_timeout_secs: u64, + + /// Number of ephemeral funded test accounts to derive. + #[arg(long, default_value_t = 4)] + pub ephemeral_accounts: usize, + + /// Abort on the first failed scenario. + #[arg(long)] + pub fail_fast: bool, + + /// Print the final report as JSON (machine readable, for CI). + #[arg(long)] + pub json: bool, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)] +pub enum Phase { + Reads, + Balances, + Reversible, + Multisig, + Recovery, + Preimage, + Governance, + Negative, + Fuzz, + Wormhole, + Upgrade, +} + +impl Phase { + fn default_set() -> Vec { + vec![ + Phase::Reads, + Phase::Balances, + Phase::Reversible, + Phase::Multisig, + Phase::Recovery, + Phase::Preimage, + Phase::Governance, + Phase::Negative, + Phase::Fuzz, + Phase::Wormhole, + ] + } + + fn label(self) -> &'static str { + match self { + Phase::Reads => "reads", + Phase::Balances => "balances", + Phase::Reversible => "reversible", + Phase::Multisig => "multisig", + Phase::Recovery => "recovery", + Phase::Preimage => "preimage", + Phase::Governance => "governance", + Phase::Negative => "negative", + Phase::Fuzz => "fuzz", + Phase::Wormhole => "wormhole", + Phase::Upgrade => "upgrade", + } + } +} + +/// Entry point for `quantus exercise`. +pub async fn handle_exercise_command(args: ExerciseArgs, node_url: &str) -> Result<()> { + let seed = args.seed.unwrap_or_else(rand::random); + let mut selected = args.phases.clone().unwrap_or_else(Phase::default_set); + if args.upgrade_wasm.is_some() && !selected.contains(&Phase::Upgrade) { + selected.push(Phase::Upgrade); + } + if let Some(skip) = &args.skip { + selected.retain(|p| !skip.contains(p)); + } + if selected.contains(&Phase::Upgrade) && args.upgrade_wasm.is_none() { + return Err(QuantusError::Generic( + "the upgrade phase requires --upgrade-wasm ".to_string(), + )); + } + + // Scenarios reuse regular CLI handlers whose per-transaction output + // (spinners, expected-failure banners) would drown the step results, so + // silence it; the report is the single source of truth. `--verbose` + // re-enables everything. The guard restores normal logging on every exit + // path so the final error banner from main is never swallowed. + struct QuietGuard; + impl Drop for QuietGuard { + fn drop(&mut self) { + crate::log::set_quiet(false); + } + } + crate::log::set_quiet(true); + let _quiet_guard = QuietGuard; + + crate::log_status!("πŸ‹οΈ Quantus chain exercise suite"); + crate::log_status!(" Node: {node_url}"); + crate::log_status!(" Seed: {seed}"); + crate::log_status!( + " Phases: {}", + selected.iter().map(|p| p.label()).collect::>().join(", ") + ); + + // ---- Setup (always runs) ---- + let client = QuantusClient::new(node_url).await?; + let (spec_version, _) = client.get_runtime_version().await?; + let mut report = Report::new(node_url, seed, spec_version, args.fail_fast); + + let mut ctx = match setup(client, node_url, seed, &args, &mut report).await { + Ok(ctx) => ctx, + Err(e) => { + report.record("setup", "setup", std::time::Duration::ZERO, Err(e)); + finish(&report, &args)?; + return Err(QuantusError::Generic("setup failed".to_string())); + }, + }; + + // ---- Standard phases ---- + run_phases(&mut ctx, &mut report, &selected, "").await?; + + // ---- Optional upgrade phase + post-upgrade re-run ---- + if selected.contains(&Phase::Upgrade) && !report.should_abort() { + let wasm = args.upgrade_wasm.clone().expect("checked above"); + scenarios::upgrade::run(&mut ctx, &mut report, "upgrade", &wasm, args.upgrade_timeout_secs) + .await?; + + let upgrade_ok = report + .steps + .iter() + .filter(|s| s.phase == "upgrade") + .all(|s| s.status == report::StepStatus::Passed); + if upgrade_ok { + // Reconnect so subxt picks up the new metadata/runtime version. + crate::log_status!("πŸ” Re-running phases against the upgraded runtime…"); + ctx.client = QuantusClient::new(node_url).await?; + let rerun: Vec = + selected.iter().copied().filter(|p| *p != Phase::Upgrade).collect(); + run_phases(&mut ctx, &mut report, &rerun, "post-upgrade:").await?; + } else { + report.record_skip("post-upgrade", "rerun", "skipped because the upgrade phase failed"); + } + } + + finish(&report, &args)?; + if report.has_failures() { + return Err(QuantusError::Generic(format!( + "{} exercise scenario(s) failed", + report.count(report::StepStatus::Failed) + ))); + } + Ok(()) +} + +async fn run_phases( + ctx: &mut ExerciseCtx, + report: &mut Report, + phases: &[Phase], + prefix: &str, +) -> Result<()> { + for phase in phases { + if report.should_abort() { + break; + } + let label = format!("{prefix}{}", phase.label()); + match phase { + Phase::Reads => scenarios::reads::run(ctx, report, &label).await?, + Phase::Balances => scenarios::balances::run(ctx, report, &label).await?, + Phase::Reversible => scenarios::reversible::run(ctx, report, &label).await?, + Phase::Multisig => scenarios::multisig::run(ctx, report, &label).await?, + Phase::Recovery => scenarios::recovery::run(ctx, report, &label).await?, + Phase::Preimage => scenarios::preimage::run(ctx, report, &label).await?, + Phase::Governance => scenarios::governance::run(ctx, report, &label).await?, + Phase::Negative => scenarios::negative::run(ctx, report, &label).await?, + Phase::Fuzz => scenarios::fuzz::run(ctx, report, &label).await?, + Phase::Wormhole => scenarios::wormhole::run(ctx, report, &label).await?, + // Handled by the caller so the post-upgrade re-run can be sequenced. + Phase::Upgrade => {}, + } + } + Ok(()) +} + +fn finish(report: &Report, args: &ExerciseArgs) -> Result<()> { + report.render_summary(); + if args.json { + println!("{}", report.render_json()?); + } + Ok(()) +} + +// --------------------------------------------------------------------------- +// Setup phase +// --------------------------------------------------------------------------- + +async fn setup( + client: QuantusClient, + node_url: &str, + seed: u64, + args: &ExerciseArgs, + report: &mut Report, +) -> Result { + let started = std::time::Instant::now(); + + // Chain properties. + let (symbol, decimals) = crate::cli::send::get_chain_properties(&client).await?; + let unit = 10u128.pow(decimals as u32); + let ed_addr = quantus_subxt::api::constants().balances().existential_deposit(); + let existential_deposit = client.client().constants().at(&ed_addr)?; + + // Dev keypairs (well-known dev accounts, held in memory). + let alice = QuantumKeyPair::from_resonance_pair(&qp_dilithium_crypto::crystal_alice()); + let bob = QuantumKeyPair::from_resonance_pair(&qp_dilithium_crypto::dilithium_bob()); + let charlie = QuantumKeyPair::from_resonance_pair(&qp_dilithium_crypto::crystal_charlie()); + + // Ensure the standard dev wallets also exist on disk: some reused flows + // (e.g. wormhole multiround) load wallets by name. + ensure_dev_wallets_on_disk().await?; + + report.record( + "setup", + "connect_and_wallets", + started.elapsed(), + Ok(format!( + "connected to {node_url}; token {symbol} ({decimals} decimals), ED {existential_deposit}" + )), + ); + + // Derive and fund ephemeral accounts. + let started = std::time::Instant::now(); + let rng = rand::rngs::StdRng::seed_from_u64(seed); + let mut ctx = ExerciseCtx { + client, + node_url: node_url.to_string(), + alice, + bob, + charlie, + eph: Vec::new(), + unit, + existential_deposit, + rng, + seed, + fuzz_iterations: args.fuzz_iterations, + }; + + let count = args.ephemeral_accounts.max(4); + let funding_result = fund_ephemeral_accounts(&mut ctx, count).await; + report.record("setup", "fund_ephemeral_accounts", started.elapsed(), funding_result); + if report.has_failures() { + return Err(QuantusError::Generic("setup failed while funding accounts".to_string())); + } + Ok(ctx) +} + +async fn ensure_dev_wallets_on_disk() -> Result<()> { + let manager = crate::wallet::WalletManager::new()?; + for name in ["crystal_alice", "crystal_bob", "crystal_charlie"] { + match manager.create_developer_wallet(name).await { + Ok(_) => {}, + Err(crate::error::QuantusError::Wallet(crate::error::WalletError::AlreadyExists)) => {}, + Err(e) => return Err(e), + } + } + Ok(()) +} + +async fn fund_ephemeral_accounts(ctx: &mut ExerciseCtx, count: usize) -> Result { + let funding_per_account = 1_000 * ctx.unit; + let mut addresses = Vec::with_capacity(count); + for _ in 0..count { + let keypair = ctx.fresh_keypair()?; + addresses.push(keypair.to_account_id_ss58check()); + ctx.eph.push(keypair); + } + + let transfers: Vec<(String, u128)> = + addresses.iter().map(|a| (a.clone(), funding_per_account)).collect(); + crate::cli::send::batch_transfer( + &ctx.client, + &ctx.alice.clone(), + transfers, + None, + ctx.wait_mode(), + ) + .await?; + + for address in &addresses { + let balance = ctx.free_balance(address).await?; + if balance != funding_per_account { + return Err(QuantusError::Generic(format!( + "ephemeral account {address} has balance {balance}, expected {funding_per_account}" + ))); + } + } + Ok(format!("derived and funded {count} ephemeral accounts with 1000 tokens each")) +} diff --git a/src/cli/exercise/report.rs b/src/cli/exercise/report.rs new file mode 100644 index 0000000..6334d7f --- /dev/null +++ b/src/cli/exercise/report.rs @@ -0,0 +1,136 @@ +//! Result collection and rendering for the exercise suite. + +use colored::Colorize; +use serde::Serialize; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] +#[serde(rename_all = "lowercase")] +pub enum StepStatus { + Passed, + Failed, + Skipped, +} + +#[derive(Debug, Clone, Serialize)] +pub struct StepResult { + pub phase: String, + pub name: String, + pub status: StepStatus, + pub detail: String, + pub duration_ms: u128, +} + +#[derive(Debug, Serialize)] +pub struct Report { + pub node_url: String, + pub seed: u64, + pub spec_version: u32, + pub steps: Vec, + #[serde(skip)] + pub fail_fast: bool, +} + +impl Report { + pub fn new(node_url: &str, seed: u64, spec_version: u32, fail_fast: bool) -> Self { + Self { node_url: node_url.to_string(), seed, spec_version, steps: Vec::new(), fail_fast } + } + + /// Record the outcome of a step. `Ok(detail)` marks it passed, `Err` failed. + pub fn record( + &mut self, + phase: &str, + name: &str, + elapsed: std::time::Duration, + result: crate::error::Result, + ) { + let (status, detail) = match result { + Ok(detail) => (StepStatus::Passed, detail), + Err(e) => (StepStatus::Failed, e.to_string()), + }; + self.push(phase, name, status, detail, elapsed.as_millis()); + } + + pub fn record_skip(&mut self, phase: &str, name: &str, reason: &str) { + self.push(phase, name, StepStatus::Skipped, reason.to_string(), 0); + } + + fn push(&mut self, phase: &str, name: &str, status: StepStatus, detail: String, ms: u128) { + let icon = match status { + StepStatus::Passed => "βœ…", + StepStatus::Failed => "❌", + StepStatus::Skipped => "⏭️ ", + }; + crate::log_status!( + "{} [{}] {} β€” {} ({}ms)", + icon, + phase.bright_blue(), + name.bold(), + truncate(&detail, 160), + ms + ); + self.steps.push(StepResult { + phase: phase.to_string(), + name: name.to_string(), + status, + detail, + duration_ms: ms, + }); + } + + pub fn count(&self, status: StepStatus) -> usize { + self.steps.iter().filter(|s| s.status == status).count() + } + + pub fn has_failures(&self) -> bool { + self.count(StepStatus::Failed) > 0 + } + + /// True when fail-fast is enabled and something already failed. + pub fn should_abort(&self) -> bool { + self.fail_fast && self.has_failures() + } + + pub fn render_summary(&self) { + let passed = self.count(StepStatus::Passed); + let failed = self.count(StepStatus::Failed); + let skipped = self.count(StepStatus::Skipped); + + crate::log_status!(""); + crate::log_status!("{}", "================ Exercise Summary ================".bold()); + crate::log_status!(" Node: {} Seed: {}", self.node_url.bright_cyan(), self.seed); + crate::log_status!( + " {} passed, {} failed, {} skipped ({} total)", + passed.to_string().bright_green(), + failed.to_string().bright_red(), + skipped.to_string().bright_yellow(), + self.steps.len() + ); + if failed > 0 { + crate::log_status!(""); + crate::log_status!("{}", "Failed steps:".bright_red().bold()); + for step in self.steps.iter().filter(|s| s.status == StepStatus::Failed) { + crate::log_status!( + " ❌ [{}] {} β€” {}", + step.phase.bright_blue(), + step.name.bold(), + truncate(&step.detail, 300) + ); + } + } + crate::log_status!("{}", "==================================================".bold()); + } + + pub fn render_json(&self) -> crate::error::Result { + serde_json::to_string_pretty(self).map_err(Into::into) + } +} + +fn truncate(s: &str, max: usize) -> String { + let single_line = s.replace('\n', " "); + if single_line.chars().count() <= max { + single_line + } else { + let cut: String = single_line.chars().take(max).collect(); + format!("{cut}…") + } +} diff --git a/src/cli/exercise/runner.rs b/src/cli/exercise/runner.rs new file mode 100644 index 0000000..e915706 --- /dev/null +++ b/src/cli/exercise/runner.rs @@ -0,0 +1,117 @@ +//! Shared context and submission helpers for exercise scenarios. + +use crate::{ + chain::client::QuantusClient, + cli::common::{ExecutionMode, SubxtAccountId32}, + error::{QuantusError, Result}, + wallet::QuantumKeyPair, +}; +use rand::{rngs::StdRng, Rng}; + +/// Shared state for all exercise scenarios. +pub struct ExerciseCtx { + pub client: QuantusClient, + pub node_url: String, + pub alice: QuantumKeyPair, + pub bob: QuantumKeyPair, + pub charlie: QuantumKeyPair, + /// Ephemeral, pre-funded throwaway accounts used by scenarios. + pub eph: Vec, + pub unit: u128, + pub existential_deposit: u128, + pub rng: StdRng, + pub seed: u64, + pub fuzz_iterations: u32, +} + +impl ExerciseCtx { + /// Execution mode used for all happy-path submissions: wait for best-block + /// inclusion so we can assert on execution success and read post-state. + pub fn wait_mode(&self) -> ExecutionMode { + ExecutionMode { finalized: false, wait_for_transaction: true } + } + + /// Generate a brand new random keypair (not funded, not saved to disk). + pub fn fresh_keypair(&mut self) -> Result { + let seed: [u8; 32] = self.rng.random(); + let pair = qp_dilithium_crypto::types::DilithiumPair::from_seed(&seed) + .map_err(|e| QuantusError::Generic(format!("Failed to derive keypair: {e:?}")))?; + Ok(QuantumKeyPair::from_resonance_pair(&pair)) + } + + /// Free balance of an account. + pub async fn free_balance(&self, ss58: &str) -> Result { + crate::cli::send::get_balance(&self.client, ss58).await + } +} + +pub fn account_id_of(keypair: &QuantumKeyPair) -> SubxtAccountId32 { + let account = keypair.to_account_id_32(); + let bytes: [u8; 32] = *account.as_ref(); + SubxtAccountId32::from(bytes) +} + +/// Submit a transaction expected to succeed; waits for best-block inclusion and +/// fails if the extrinsic is rejected or emits `ExtrinsicFailed`. +pub async fn submit_ok( + ctx: &ExerciseCtx, + from: &QuantumKeyPair, + call: Call, +) -> Result +where + Call: subxt::tx::Payload, +{ + crate::cli::common::submit_transaction(&ctx.client, from, call, None, ctx.wait_mode()).await +} + +/// Submit a transaction expected to be rejected (either at the pool or during +/// block execution). Passes when the error message matches one of +/// `expected_fragments` (or any error when the list is empty); fails if the +/// transaction unexpectedly succeeds or fails with an unrelated error. +pub async fn submit_expect_failure( + ctx: &ExerciseCtx, + from: &QuantumKeyPair, + call: Call, + expected_fragments: &[&str], +) -> Result +where + Call: subxt::tx::Payload, +{ + match crate::cli::common::submit_transaction(&ctx.client, from, call, None, ctx.wait_mode()) + .await + { + Ok(hash) => Err(QuantusError::Generic(format!( + "expected rejection but transaction succeeded ({hash:?})" + ))), + Err(e) => { + let msg = e.to_string(); + if expected_fragments.is_empty() || + expected_fragments.iter().any(|frag| msg.contains(frag)) + { + Ok(format!("rejected as expected: {}", first_line(&msg))) + } else { + Err(QuantusError::Generic(format!( + "rejected with unexpected error (wanted one of {expected_fragments:?}): {msg}" + ))) + } + }, + } +} + +fn first_line(msg: &str) -> &str { + msg.lines().next().unwrap_or(msg) +} + +/// Run a future as a named step and record its outcome. Returns `true` when the +/// phase should abort (fail-fast triggered). +#[macro_export] +macro_rules! exercise_step { + ($report:expr, $phase:expr, $name:expr, $fut:expr) => {{ + let __started = std::time::Instant::now(); + let __result = $fut.await; + $report.record($phase, $name, __started.elapsed(), __result); + if $report.should_abort() { + return Ok(()); + } + }}; +} diff --git a/src/cli/exercise/scenarios/balances.rs b/src/cli/exercise/scenarios/balances.rs new file mode 100644 index 0000000..b60654e --- /dev/null +++ b/src/cli/exercise/scenarios/balances.rs @@ -0,0 +1,121 @@ +//! Balances happy-path scenarios: single transfer, batch transfer, +//! transfer with tip, and manual-nonce transfer. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{account_id_of, submit_ok, ExerciseCtx}, + }, + error::{QuantusError, Result}, + exercise_step, +}; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "single_transfer", single_transfer(ctx)); + exercise_step!(report, phase, "batch_transfer", batch_transfer(ctx)); + exercise_step!(report, phase, "transfer_with_tip", transfer_with_tip(ctx)); + exercise_step!(report, phase, "transfer_manual_nonce", transfer_manual_nonce(ctx)); + exercise_step!(report, phase, "remark_with_event", remark_with_event(ctx)); + Ok(()) +} + +async fn single_transfer(ctx: &mut ExerciseCtx) -> Result { + let recipient = ctx.fresh_keypair()?; + let recipient_ss58 = recipient.to_account_id_ss58check(); + let amount = ctx.unit; // 1 token + + let sender = ctx.eph[0].clone(); + let before = ctx.free_balance(&recipient_ss58).await?; + crate::cli::send::transfer( + &ctx.client, + &sender, + &recipient_ss58, + amount, + None, + ctx.wait_mode(), + ) + .await?; + let after = ctx.free_balance(&recipient_ss58).await?; + if after != before + amount { + return Err(QuantusError::Generic(format!( + "recipient balance mismatch: before {before}, after {after}, expected +{amount}" + ))); + } + Ok(format!("transferred {amount} raw units to fresh account, balance verified")) +} + +async fn batch_transfer(ctx: &mut ExerciseCtx) -> Result { + let n = 3usize; + let mut recipients = Vec::with_capacity(n); + for _ in 0..n { + recipients.push(ctx.fresh_keypair()?.to_account_id_ss58check()); + } + let amount = ctx.unit / 2; + let transfers: Vec<(String, u128)> = recipients.iter().map(|r| (r.clone(), amount)).collect(); + + let sender = ctx.eph[0].clone(); + crate::cli::send::batch_transfer(&ctx.client, &sender, transfers, None, ctx.wait_mode()) + .await?; + + for recipient in &recipients { + let balance = ctx.free_balance(recipient).await?; + if balance != amount { + return Err(QuantusError::Generic(format!( + "batch recipient {recipient} has balance {balance}, expected {amount}" + ))); + } + } + Ok(format!("Utility::batch of {n} transfers included, all balances verified")) +} + +async fn transfer_with_tip(ctx: &mut ExerciseCtx) -> Result { + let recipient = ctx.fresh_keypair()?.to_account_id_ss58check(); + let amount = ctx.unit; + let tip = ctx.unit / 10; + let sender = ctx.eph[1].clone(); + crate::cli::send::transfer( + &ctx.client, + &sender, + &recipient, + amount, + Some(tip), + ctx.wait_mode(), + ) + .await?; + let balance = ctx.free_balance(&recipient).await?; + if balance != amount { + return Err(QuantusError::Generic(format!( + "tipped transfer recipient balance {balance}, expected {amount}" + ))); + } + Ok(format!("transfer with tip {tip} included and verified")) +} + +async fn transfer_manual_nonce(ctx: &mut ExerciseCtx) -> Result { + let sender = ctx.eph[1].clone(); + let account = sender.to_account_id_32(); + let nonce = ctx.client.get_account_nonce_from_best_block(&account).await?; + let recipient = ctx.fresh_keypair()?.to_account_id_ss58check(); + crate::cli::send::transfer_with_nonce( + &ctx.client, + &sender, + &recipient, + ctx.unit, + None, + Some(nonce as u32), + ctx.wait_mode(), + ) + .await?; + Ok(format!("transfer with explicit nonce {nonce} included")) +} + +async fn remark_with_event(ctx: &mut ExerciseCtx) -> Result { + let payload: [u8; 16] = rand::Rng::random(&mut ctx.rng); + let call = quantus_subxt::api::tx().system().remark_with_event(payload.to_vec()); + let sender = ctx.eph[0].clone(); + let hash = submit_ok(ctx, &sender, call).await?; + // Sanity: sender account id resolves. + let _ = account_id_of(&sender); + Ok(format!("System::remark_with_event included ({hash:?})")) +} diff --git a/src/cli/exercise/scenarios/fuzz.rs b/src/cli/exercise/scenarios/fuzz.rs new file mode 100644 index 0000000..497d76c --- /dev/null +++ b/src/cli/exercise/scenarios/fuzz.rs @@ -0,0 +1,164 @@ +//! Seeded fuzz loop. Each iteration draws a random action (transfers with +//! boundary amounts, random-size remarks, random batches, random reversible +//! delays) from the shared RNG. The invariant asserted for every iteration is +//! that the node responds and the transaction either executes successfully or +//! is rejected with a cleanly decoded error β€” anything else (hang, stream +//! ending, undecodable failure) fails the step. The seed is logged so any +//! failure is reproducible with `--seed`. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{account_id_of, ExerciseCtx}, + }, + error::{QuantusError, Result}, + exercise_step, +}; +use rand::Rng; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + let iterations = ctx.fuzz_iterations; + crate::log_status!("🎲 Fuzzing with seed {} ({} iterations)", ctx.seed, iterations); + for i in 0..iterations { + let name = format!("iteration_{i:03}"); + exercise_step!(report, phase, &name, fuzz_once(ctx)); + } + Ok(()) +} + +/// Outcome classifier: clean success or clean rejection both pass. +fn classify(result: crate::error::Result, what: &str) -> Result { + match result { + Ok(hash) => Ok(format!("{what}: included ({hash:?})")), + Err(e) => { + let msg = e.to_string(); + let clean = msg.contains("Transaction execution failed") || + msg.contains("Transaction invalid") || + msg.contains("Transaction error") || + msg.contains("Transaction dropped") || + msg.contains("Failed to submit transaction"); + if clean { + let first = msg.lines().next().unwrap_or(&msg).to_string(); + Ok(format!("{what}: cleanly rejected ({first})")) + } else { + Err(QuantusError::Generic(format!("{what}: unclean failure: {msg}"))) + } + }, + } +} + +async fn fuzz_once(ctx: &mut ExerciseCtx) -> Result { + match ctx.rng.random_range(0..4u8) { + 0 => fuzz_transfer(ctx).await, + 1 => fuzz_remark(ctx).await, + 2 => fuzz_batch(ctx).await, + _ => fuzz_reversible(ctx).await, + } +} + +fn random_amount(ctx: &mut ExerciseCtx) -> u128 { + let ed = ctx.existential_deposit; + match ctx.rng.random_range(0..7u8) { + 0 => 0, + 1 => 1, + 2 => ed.saturating_sub(1), + 3 => ed, + 4 => ed.saturating_add(1), + 5 => ctx.rng.random_range(1..=100) * ctx.unit, + _ => u128::MAX, + } +} + +fn random_recipient(ctx: &mut ExerciseCtx) -> Result { + let choice = ctx.rng.random_range(0..3u8); + Ok(match choice { + // Existing funded account. + 0 => { + let idx = ctx.rng.random_range(0..ctx.eph.len()); + account_id_of(&ctx.eph[idx]) + }, + // Brand new account. + 1 => account_id_of(&ctx.fresh_keypair()?), + // Self-transfer. + _ => account_id_of(&ctx.eph[0]), + }) +} + +fn random_sender(ctx: &mut ExerciseCtx) -> crate::wallet::QuantumKeyPair { + let idx = ctx.rng.random_range(0..ctx.eph.len()); + ctx.eph[idx].clone() +} + +async fn fuzz_transfer(ctx: &mut ExerciseCtx) -> Result { + let sender = random_sender(ctx); + let to = random_recipient(ctx)?; + let amount = random_amount(ctx); + let call = quantus_subxt::api::tx() + .balances() + .transfer_allow_death(subxt::ext::subxt_core::utils::MultiAddress::Id(to), amount); + let result = + crate::cli::common::submit_transaction(&ctx.client, &sender, call, None, ctx.wait_mode()) + .await; + classify(result, &format!("transfer of {amount}")) +} + +async fn fuzz_remark(ctx: &mut ExerciseCtx) -> Result { + let sender = random_sender(ctx); + let len = ctx.rng.random_range(0..8192usize); + let mut payload = vec![0u8; len]; + ctx.rng.fill(payload.as_mut_slice()); + let call = quantus_subxt::api::tx().system().remark(payload); + let result = + crate::cli::common::submit_transaction(&ctx.client, &sender, call, None, ctx.wait_mode()) + .await; + classify(result, &format!("remark of {len} bytes")) +} + +async fn fuzz_batch(ctx: &mut ExerciseCtx) -> Result { + use quantus_subxt::api::runtime_types::{ + pallet_balances::pallet::Call as BalancesCall, quantus_runtime::RuntimeCall, + }; + let sender = random_sender(ctx); + let n = ctx.rng.random_range(1..=20usize); + let mut calls = Vec::with_capacity(n); + for _ in 0..n { + let to = random_recipient(ctx)?; + let amount = random_amount(ctx); + calls.push(RuntimeCall::Balances(BalancesCall::transfer_allow_death { + dest: subxt::ext::subxt_core::utils::MultiAddress::Id(to), + value: amount, + })); + } + let call = quantus_subxt::api::tx().utility().batch(calls); + let result = + crate::cli::common::submit_transaction(&ctx.client, &sender, call, None, ctx.wait_mode()) + .await; + // Utility::batch itself succeeds even when inner calls fail (it emits + // BatchInterrupted), so both outcomes are legitimate here. + classify(result, &format!("batch of {n} transfers")) +} + +async fn fuzz_reversible(ctx: &mut ExerciseCtx) -> Result { + let sender = random_sender(ctx); + let to = random_recipient(ctx)?; + let amount = random_amount(ctx); + use quantus_subxt::api::reversible_transfers::calls::types::schedule_transfer_with_delay::Delay; + // Mix of too-short, sane, and absurd delays in both units. + let delay = match ctx.rng.random_range(0..5u8) { + 0 => Delay::BlockNumber(0), + 1 => Delay::BlockNumber(1), + 2 => Delay::BlockNumber(ctx.rng.random_range(2..1000)), + 3 => Delay::Timestamp(ctx.rng.random_range(0..100_000)), + _ => Delay::BlockNumber(u32::MAX), + }; + let call = quantus_subxt::api::tx().reversible_transfers().schedule_transfer_with_delay( + subxt::ext::subxt_core::utils::MultiAddress::Id(to), + amount, + delay, + ); + let result = + crate::cli::common::submit_transaction(&ctx.client, &sender, call, None, ctx.wait_mode()) + .await; + classify(result, &format!("reversible transfer of {amount}")) +} diff --git a/src/cli/exercise/scenarios/governance.rs b/src/cli/exercise/scenarios/governance.rs new file mode 100644 index 0000000..1d27b2b --- /dev/null +++ b/src/cli/exercise/scenarios/governance.rs @@ -0,0 +1,150 @@ +//! Tech-collective / tech-referenda scenarios: membership reads, a harmless +//! referendum (re-proposing the current treasury portion) through submit β†’ +//! decision deposit β†’ votes, and origin-gating canaries. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{account_id_of, submit_expect_failure, submit_ok, ExerciseCtx}, + }, + error::{QuantusError, Result}, + exercise_step, +}; +use sp_runtime::traits::{BlakeTwo256, Hash}; +use subxt::tx::Payload; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "membership_reads", membership_reads(ctx)); + exercise_step!(report, phase, "referendum_flow", referendum_flow(ctx)); + exercise_step!(report, phase, "add_member_requires_root", add_member_requires_root(ctx)); + Ok(()) +} + +async fn membership_reads(ctx: &mut ExerciseCtx) -> Result { + let alice_ss58 = ctx.alice.to_account_id_ss58check(); + let is_member = crate::cli::tech_collective::is_member(&ctx.client, &alice_ss58).await?; + if !is_member { + return Err(QuantusError::Generic( + "alice is not a tech-collective member; expected dev genesis membership".to_string(), + )); + } + let count = crate::cli::tech_collective::get_member_count(&ctx.client).await?.unwrap_or(0); + let members = crate::cli::tech_collective::get_member_list(&ctx.client).await?; + if members.len() != count as usize { + return Err(QuantusError::Generic(format!( + "member list length {} does not match MemberCount {count}", + members.len() + ))); + } + Ok(format!("alice is a member; collective has {count} rank-0 members")) +} + +/// Submit a referendum that re-proposes the *current* treasury portion, so it +/// is harmless even if it completes and enacts (e.g. on a fast-governance node). +async fn referendum_flow(ctx: &mut ExerciseCtx) -> Result { + let latest = ctx.client.get_latest_block().await?; + let storage_at = ctx.client.client().storage().at(latest); + + // Current portion (default 0 if unset). + let portion_addr = quantus_subxt::api::storage().treasury_pallet().treasury_portion(); + let current_portion = storage_at.fetch(&portion_addr).await?.map(|p| p.0).unwrap_or(0); + + // Encode TreasuryPallet::set_treasury_portion(current_portion) as preimage. + let portion = + quantus_subxt::api::runtime_types::sp_arithmetic::per_things::Permill(current_portion); + let inner = quantus_subxt::api::tx().treasury_pallet().set_treasury_portion(portion); + let encoded = inner + .encode_call_data(&ctx.client.client().metadata()) + .map_err(|e| QuantusError::Generic(format!("failed to encode call: {e:?}")))?; + let preimage_hash: sp_core::H256 = BlakeTwo256::hash(&encoded); + let call_len = encoded.len() as u32; + + crate::cli::common::submit_preimage(&ctx.client, &ctx.alice, encoded, ctx.wait_mode()).await?; + + // Referendum index = ReferendumCount before submission. + let count_addr = quantus_subxt::api::storage().tech_referenda().referendum_count(); + let index = storage_at.fetch(&count_addr).await?.unwrap_or(0); + + let submit_call = build_submit_call(preimage_hash, call_len); + let alice = ctx.alice.clone(); + submit_ok(ctx, &alice, submit_call).await?; + + // Place the decision deposit and vote aye with all three genesis members. + let deposit_call = quantus_subxt::api::tx().tech_referenda().place_decision_deposit(index); + submit_ok(ctx, &alice, deposit_call).await?; + + for voter in [ctx.alice.clone(), ctx.bob.clone(), ctx.charlie.clone()] { + crate::cli::tech_collective::vote_on_referendum( + &ctx.client, + &voter, + index, + true, + ctx.wait_mode(), + ) + .await?; + } + + // Verify the tally recorded our votes while the referendum is ongoing. + use quantus_subxt::api::runtime_types::pallet_referenda::types::ReferendumInfo; + let info_addr = quantus_subxt::api::storage().tech_referenda().referendum_info_for(index); + let latest = ctx.client.get_latest_block().await?; + let info = ctx + .client + .client() + .storage() + .at(latest) + .fetch(&info_addr) + .await? + .ok_or_else(|| QuantusError::Generic(format!("referendum #{index} not found")))?; + + match info { + ReferendumInfo::Ongoing(status) => { + if status.tally.ayes < 3 { + return Err(QuantusError::Generic(format!( + "expected 3 aye votes on referendum #{index}, tally shows {}", + status.tally.ayes + ))); + } + Ok(format!( + "referendum #{index} submitted, deposit placed, 3 aye votes tallied (ongoing)" + )) + }, + // On a fast-governance node the referendum may already have confirmed. + ReferendumInfo::Approved(..) => Ok(format!( + "referendum #{index} submitted, voted, and already approved (fast-governance node)" + )), + other => Err(QuantusError::Generic(format!( + "referendum #{index} in unexpected state: {other:?}" + ))), + } +} + +pub fn build_submit_call(preimage_hash: sp_core::H256, call_len: u32) -> impl subxt::tx::Payload { + type ProposalBounded = + quantus_subxt::api::runtime_types::frame_support::traits::preimages::Bounded< + quantus_subxt::api::runtime_types::quantus_runtime::RuntimeCall, + quantus_subxt::api::runtime_types::sp_runtime::traits::BlakeTwo256, + >; + let proposal: ProposalBounded = ProposalBounded::Lookup { hash: preimage_hash, len: call_len }; + let origin_caller = quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::system( + quantus_subxt::api::runtime_types::frame_support::dispatch::RawOrigin::Root, + ); + let enactment = + quantus_subxt::api::runtime_types::frame_support::traits::schedule::DispatchTime::After( + 0u32, + ); + quantus_subxt::api::tx() + .tech_referenda() + .submit(origin_caller, proposal, enactment) +} + +async fn add_member_requires_root(ctx: &mut ExerciseCtx) -> Result { + // TechCollective::AddOrigin is Root; a signed add_member must be rejected. + let intruder = ctx.fresh_keypair()?; + let call = quantus_subxt::api::tx() + .tech_collective() + .add_member(subxt::ext::subxt_core::utils::MultiAddress::Id(account_id_of(&intruder))); + let alice = ctx.alice.clone(); + submit_expect_failure(ctx, &alice, call, &["BadOrigin"]).await +} diff --git a/src/cli/exercise/scenarios/mod.rs b/src/cli/exercise/scenarios/mod.rs new file mode 100644 index 0000000..13f8d27 --- /dev/null +++ b/src/cli/exercise/scenarios/mod.rs @@ -0,0 +1,13 @@ +//! Exercise scenarios, one module per pallet/domain. + +pub mod balances; +pub mod fuzz; +pub mod governance; +pub mod multisig; +pub mod negative; +pub mod preimage; +pub mod reads; +pub mod recovery; +pub mod reversible; +pub mod upgrade; +pub mod wormhole; diff --git a/src/cli/exercise/scenarios/multisig.rs b/src/cli/exercise/scenarios/multisig.rs new file mode 100644 index 0000000..1e3de0b --- /dev/null +++ b/src/cli/exercise/scenarios/multisig.rs @@ -0,0 +1,147 @@ +//! Multisig lifecycle: create a 2-of-3, fund it, propose a transfer, approve, +//! execute, verify the recipient balance, then propose + cancel a second one. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{account_id_of, submit_ok, ExerciseCtx}, + }, + error::{QuantusError, Result}, + exercise_step, +}; +use subxt::tx::Payload; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "lifecycle", lifecycle(ctx)); + Ok(()) +} + +async fn lifecycle(ctx: &mut ExerciseCtx) -> Result { + let signer_a = ctx.eph[0].clone(); + let signer_b = ctx.eph[1].clone(); + let signer_c = ctx.eph[2].clone(); + let signers = + vec![account_id_of(&signer_a), account_id_of(&signer_b), account_id_of(&signer_c)]; + let threshold = 2u32; + // Random nonce so repeated runs against the same chain produce fresh multisigs. + let nonce: u64 = rand::Rng::random(&mut ctx.rng); + + // Create the multisig and derive its address deterministically. + let create_call = + quantus_subxt::api::tx() + .multisig() + .create_multisig(signers.clone(), threshold, nonce); + submit_ok(ctx, &signer_a, create_call).await?; + let multisig_ss58 = + crate::cli::multisig::predict_multisig_address(signers.clone(), threshold, nonce); + + // Verify it exists on-chain. + let multisig_id = crate::cli::common::resolve_to_subxt_account_id(&multisig_ss58)?; + let info = crate::cli::multisig::get_multisig_info(&ctx.client, multisig_id.clone()) + .await? + .ok_or_else(|| { + QuantusError::Generic(format!("multisig {multisig_ss58} not found after creation")) + })?; + if info.threshold != threshold || info.signers.len() != 3 { + return Err(QuantusError::Generic(format!( + "multisig config mismatch: threshold {}, {} signers", + info.threshold, + info.signers.len() + ))); + } + + // Fund the multisig so it can pay out the proposed transfer. + crate::cli::send::transfer( + &ctx.client, + &signer_a, + &multisig_ss58, + 20 * ctx.unit, + None, + ctx.wait_mode(), + ) + .await?; + + // Propose a transfer to a fresh recipient (inner call encoded via metadata, + // so pallet/call indices always match the connected runtime). + let recipient = ctx.fresh_keypair()?; + let recipient_ss58 = recipient.to_account_id_ss58check(); + let amount = 2 * ctx.unit; + let inner = quantus_subxt::api::tx().balances().transfer_allow_death( + subxt::ext::subxt_core::utils::MultiAddress::Id(account_id_of(&recipient)), + amount, + ); + let call_data = inner + .encode_call_data(&ctx.client.client().metadata()) + .map_err(|e| QuantusError::Generic(format!("failed to encode inner call: {e:?}")))?; + + let expiry = current_block(ctx).await? + 100; + let propose_call = quantus_subxt::api::tx().multisig().propose( + multisig_id.clone(), + quantus_subxt::api::runtime_types::bounded_collections::bounded_vec::BoundedVec( + call_data.clone(), + ), + expiry, + ); + submit_ok(ctx, &signer_a, propose_call).await?; + let proposal_id = latest_proposal_id(ctx, &multisig_id).await?; + + // Second approval reaches the 2-of-3 threshold. + let approve_call = + quantus_subxt::api::tx().multisig().approve(multisig_id.clone(), proposal_id); + submit_ok(ctx, &signer_b, approve_call).await?; + + // Execute and verify the recipient got paid. + let execute_call = + quantus_subxt::api::tx().multisig().execute(multisig_id.clone(), proposal_id); + submit_ok(ctx, &signer_c, execute_call).await?; + + let recipient_balance = ctx.free_balance(&recipient_ss58).await?; + if recipient_balance != amount { + return Err(QuantusError::Generic(format!( + "multisig payout mismatch: recipient has {recipient_balance}, expected {amount}" + ))); + } + + // Propose a second transfer and cancel it. + let propose_again = quantus_subxt::api::tx().multisig().propose( + multisig_id.clone(), + quantus_subxt::api::runtime_types::bounded_collections::bounded_vec::BoundedVec(call_data), + expiry, + ); + submit_ok(ctx, &signer_a, propose_again).await?; + let second_id = latest_proposal_id(ctx, &multisig_id).await?; + let cancel_call = quantus_subxt::api::tx().multisig().cancel(multisig_id.clone(), second_id); + submit_ok(ctx, &signer_a, cancel_call).await?; + + let remaining = crate::cli::multisig::list_proposals(&ctx.client, multisig_id).await?; + if remaining.iter().any(|p| p.id == second_id) { + return Err(QuantusError::Generic(format!( + "cancelled proposal #{second_id} still present in storage" + ))); + } + + Ok(format!( + "2-of-3 multisig {multisig_ss58}: created, funded, proposal #{proposal_id} \ + approved+executed (payout verified), proposal #{second_id} cancelled" + )) +} + +async fn current_block(ctx: &ExerciseCtx) -> Result { + let latest = ctx.client.get_latest_block().await?; + Ok(ctx.client.client().blocks().at(latest).await?.number()) +} + +/// Highest proposal id currently in storage for the multisig; assumes the most +/// recent `propose` we submitted created it. +async fn latest_proposal_id( + ctx: &ExerciseCtx, + multisig_id: &crate::cli::common::SubxtAccountId32, +) -> Result { + let proposals = crate::cli::multisig::list_proposals(&ctx.client, multisig_id.clone()).await?; + proposals + .iter() + .map(|p| p.id) + .max() + .ok_or_else(|| QuantusError::Generic("no proposals found after propose".to_string())) +} diff --git a/src/cli/exercise/scenarios/negative.rs b/src/cli/exercise/scenarios/negative.rs new file mode 100644 index 0000000..6ec15e7 --- /dev/null +++ b/src/cli/exercise/scenarios/negative.rs @@ -0,0 +1,186 @@ +//! Negative scenarios: every case asserts a specific, expected rejection so a +//! runtime upgrade that accidentally loosens validation is caught. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{account_id_of, submit_expect_failure, ExerciseCtx}, + }, + error::{QuantusError, Result}, + exercise_step, +}; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "transfer_over_balance", transfer_over_balance(ctx)); + exercise_step!(report, phase, "transfer_below_ed", transfer_below_ed(ctx)); + exercise_step!(report, phase, "transfer_overflow_amount", transfer_overflow_amount(ctx)); + exercise_step!(report, phase, "malformed_address", malformed_address(ctx)); + exercise_step!(report, phase, "stale_nonce", stale_nonce(ctx)); + exercise_step!(report, phase, "reversible_delay_too_short", reversible_delay_too_short(ctx)); + exercise_step!( + report, + phase, + "reversible_default_delay_not_hs", + reversible_default_delay_not_hs(ctx) + ); + exercise_step!(report, phase, "high_security_self_guardian", high_security_self_guardian(ctx)); + exercise_step!(report, phase, "scheduler_calls_disabled", scheduler_calls_disabled(ctx)); + exercise_step!(report, phase, "removed_pallets_absent", removed_pallets_absent(ctx)); + Ok(()) +} + +fn transfer_call( + to: crate::cli::common::SubxtAccountId32, + amount: u128, +) -> impl subxt::tx::Payload { + quantus_subxt::api::tx() + .balances() + .transfer_allow_death(subxt::ext::subxt_core::utils::MultiAddress::Id(to), amount) +} + +async fn transfer_over_balance(ctx: &mut ExerciseCtx) -> Result { + let sender = ctx.eph[0].clone(); + let recipient = ctx.fresh_keypair()?; + let balance = ctx.free_balance(&sender.to_account_id_ss58check()).await?; + let call = transfer_call(account_id_of(&recipient), balance.saturating_mul(2)); + submit_expect_failure(ctx, &sender, call, &["FundsUnavailable", "InsufficientBalance"]).await +} + +async fn transfer_below_ed(ctx: &mut ExerciseCtx) -> Result { + // Sending less than the existential deposit to a fresh account must fail. + if ctx.existential_deposit <= 1 { + return Ok("existential deposit <= 1, below-ED case not applicable".to_string()); + } + let sender = ctx.eph[0].clone(); + let recipient = ctx.fresh_keypair()?; + let call = transfer_call(account_id_of(&recipient), ctx.existential_deposit - 1); + submit_expect_failure(ctx, &sender, call, &["BelowMinimum", "ExistentialDeposit"]).await +} + +async fn transfer_overflow_amount(ctx: &mut ExerciseCtx) -> Result { + let sender = ctx.eph[1].clone(); + let recipient = ctx.fresh_keypair()?; + let call = transfer_call(account_id_of(&recipient), u128::MAX); + submit_expect_failure( + ctx, + &sender, + call, + &["FundsUnavailable", "Arithmetic", "InsufficientBalance"], + ) + .await +} + +async fn malformed_address(_ctx: &mut ExerciseCtx) -> Result { + // Client-side validation: a garbage destination must be rejected before + // anything is signed or submitted. + match crate::cli::common::resolve_address("definitely-not-an-address-πŸ¦€") { + Err(e) => Ok(format!("rejected client-side as expected: {e}")), + Ok(resolved) => Err(QuantusError::Generic(format!( + "malformed address unexpectedly resolved to {resolved}" + ))), + } +} + +async fn stale_nonce(ctx: &mut ExerciseCtx) -> Result { + // eph[0] has already submitted transactions, so nonce 0 is stale. + let sender = ctx.eph[0].clone(); + let account = sender.to_account_id_32(); + let current_nonce = ctx.client.get_account_nonce_from_best_block(&account).await?; + if current_nonce == 0 { + return Err(QuantusError::Generic( + "expected eph[0] to have used nonces already".to_string(), + )); + } + let recipient = ctx.fresh_keypair()?; + let call = transfer_call(account_id_of(&recipient), ctx.unit); + match crate::cli::common::submit_transaction_with_nonce( + &ctx.client, + &sender, + call, + None, + 0, + ctx.wait_mode(), + ) + .await + { + Ok(hash) => Err(QuantusError::Generic(format!( + "stale-nonce transaction unexpectedly accepted ({hash:?})" + ))), + Err(e) => { + let msg = e.to_string(); + if msg.contains("Stale") || msg.contains("outdated") || msg.contains("Invalid") { + Ok("stale nonce rejected as expected".to_string()) + } else { + Err(QuantusError::Generic(format!("unexpected stale-nonce error: {msg}"))) + } + }, + } +} + +async fn reversible_delay_too_short(ctx: &mut ExerciseCtx) -> Result { + // MinDelayPeriodBlocks is 2 on this runtime; a 1-block delay must fail. + let sender = ctx.eph[2].clone(); + let recipient = ctx.fresh_keypair()?; + use quantus_subxt::api::reversible_transfers::calls::types::schedule_transfer_with_delay::Delay; + let call = quantus_subxt::api::tx().reversible_transfers().schedule_transfer_with_delay( + subxt::ext::subxt_core::utils::MultiAddress::Id(account_id_of(&recipient)), + ctx.unit, + Delay::BlockNumber(1), + ); + submit_expect_failure(ctx, &sender, call, &["DelayTooShort"]).await +} + +async fn reversible_default_delay_not_hs(ctx: &mut ExerciseCtx) -> Result { + // `schedule_transfer` (default delay) is exclusive to high-security + // accounts; a regular account must be rejected. + let sender = ctx.eph[2].clone(); + let recipient = ctx.fresh_keypair()?; + let call = quantus_subxt::api::tx().reversible_transfers().schedule_transfer( + subxt::ext::subxt_core::utils::MultiAddress::Id(account_id_of(&recipient)), + ctx.unit, + ); + submit_expect_failure(ctx, &sender, call, &["AccountNotHighSecurity"]).await +} + +async fn high_security_self_guardian(ctx: &mut ExerciseCtx) -> Result { + // Setting yourself as your own guardian must be rejected. + let sender = ctx.eph[3].clone(); + use quantus_subxt::api::reversible_transfers::calls::types::set_high_security::Delay; + let call = quantus_subxt::api::tx() + .reversible_transfers() + .set_high_security(Delay::BlockNumber(10), account_id_of(&sender)); + submit_expect_failure(ctx, &sender, call, &["GuardianCannotBeSelf"]).await +} + +async fn scheduler_calls_disabled(ctx: &mut ExerciseCtx) -> Result { + // The runtime disables Scheduler dispatchables (`#[runtime::disable_call]`), + // which removes them from metadata entirely. This canary fails if an + // upgrade ever re-enables them. + let metadata = ctx.client.client().metadata(); + let scheduler = metadata + .pallet_by_name("Scheduler") + .ok_or_else(|| QuantusError::Generic("Scheduler pallet missing entirely".to_string()))?; + let call_count = scheduler.call_variants().map(|v| v.len()).unwrap_or(0); + if call_count == 0 { + Ok("Scheduler exposes no dispatchable calls, as expected".to_string()) + } else { + Err(QuantusError::Generic(format!( + "Scheduler unexpectedly exposes {call_count} dispatchable calls" + ))) + } +} + +async fn removed_pallets_absent(ctx: &mut ExerciseCtx) -> Result { + // Community governance (Referenda / ConvictionVoting) and Sudo were removed + // from the runtime; assert they stay removed. + let metadata = ctx.client.client().metadata(); + for name in ["Referenda", "ConvictionVoting", "Sudo"] { + if metadata.pallet_by_name(name).is_some() { + return Err(QuantusError::Generic(format!( + "pallet {name} unexpectedly present in runtime metadata" + ))); + } + } + Ok("Referenda, ConvictionVoting and Sudo remain absent from the runtime".to_string()) +} diff --git a/src/cli/exercise/scenarios/preimage.rs b/src/cli/exercise/scenarios/preimage.rs new file mode 100644 index 0000000..a40794a --- /dev/null +++ b/src/cli/exercise/scenarios/preimage.rs @@ -0,0 +1,57 @@ +//! Preimage scenarios: note a preimage and verify its on-chain status, plus a +//! canary asserting `request_preimage` stays Root-gated. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{submit_expect_failure, ExerciseCtx}, + }, + error::{QuantusError, Result}, + exercise_step, +}; +use sp_runtime::traits::{BlakeTwo256, Hash}; +use subxt::tx::Payload; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "note_and_verify", note_and_verify(ctx)); + exercise_step!(report, phase, "request_requires_root", request_requires_root(ctx)); + Ok(()) +} + +/// Encode a unique-per-run remark call to use as preimage content. +fn unique_remark_call_data(ctx: &mut ExerciseCtx) -> Result> { + let marker: [u8; 24] = rand::Rng::random(&mut ctx.rng); + let remark = quantus_subxt::api::tx().system().remark(marker.to_vec()); + remark + .encode_call_data(&ctx.client.client().metadata()) + .map_err(|e| QuantusError::Generic(format!("failed to encode remark call: {e:?}"))) +} + +async fn note_and_verify(ctx: &mut ExerciseCtx) -> Result { + let encoded = unique_remark_call_data(ctx)?; + let expected_hash: sp_core::H256 = BlakeTwo256::hash(&encoded); + + let keypair = ctx.eph[3].clone(); + crate::cli::common::submit_preimage(&ctx.client, &keypair, encoded, ctx.wait_mode()).await?; + + let status_addr = quantus_subxt::api::storage().preimage().request_status_for(expected_hash); + let latest = ctx.client.get_latest_block().await?; + let status = ctx.client.client().storage().at(latest).fetch(&status_addr).await?; + match status { + Some(_) => Ok(format!("preimage {expected_hash:?} noted and visible in RequestStatusFor")), + None => Err(QuantusError::Generic(format!( + "preimage {expected_hash:?} not found in storage after note_preimage" + ))), + } +} + +async fn request_requires_root(ctx: &mut ExerciseCtx) -> Result { + // Preimage::request_preimage has ManagerOrigin = Root; a signed call must be + // rejected. If a runtime upgrade ever loosens this, the suite fails here. + let encoded = unique_remark_call_data(ctx)?; + let hash: sp_core::H256 = BlakeTwo256::hash(&encoded); + let call = quantus_subxt::api::tx().preimage().request_preimage(hash); + let keypair = ctx.eph[3].clone(); + submit_expect_failure(ctx, &keypair, call, &["BadOrigin"]).await +} diff --git a/src/cli/exercise/scenarios/reads.rs b/src/cli/exercise/scenarios/reads.rs new file mode 100644 index 0000000..d8ae886 --- /dev/null +++ b/src/cli/exercise/scenarios/reads.rs @@ -0,0 +1,119 @@ +//! Read-only sanity checks: runtime version, metadata, storage, blocks, +//! events, treasury and high-security status. These verify that all decode +//! paths still work β€” especially valuable after a runtime upgrade. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{report::Report, runner::ExerciseCtx}, + error::{QuantusError, Result}, + exercise_step, +}; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "runtime_version", runtime_version(ctx)); + exercise_step!(report, phase, "metadata_pallets", metadata_pallets(ctx)); + exercise_step!(report, phase, "chain_properties", chain_properties(ctx)); + exercise_step!(report, phase, "latest_block_and_events", latest_block_and_events(ctx)); + exercise_step!(report, phase, "treasury_info", treasury_info(ctx)); + exercise_step!(report, phase, "high_security_status", high_security_status(ctx)); + exercise_step!(report, phase, "scheduler_agenda", scheduler_agenda(ctx)); + exercise_step!(report, phase, "account_balances", account_balances(ctx)); + Ok(()) +} + +async fn runtime_version(ctx: &ExerciseCtx) -> Result { + let (spec, tx) = ctx.client.get_runtime_version().await?; + let compatible = crate::config::is_runtime_compatible(spec, tx); + if !compatible { + return Err(QuantusError::Generic(format!( + "runtime spec {spec} / tx {tx} is not in the CLI compatibility table" + ))); + } + Ok(format!("spec {spec} / tx {tx}, compatible with CLI bindings")) +} + +async fn metadata_pallets(ctx: &ExerciseCtx) -> Result { + let metadata = ctx.client.client().metadata(); + let pallets: Vec = metadata.pallets().map(|p| p.name().to_string()).collect(); + if pallets.is_empty() { + return Err(QuantusError::Generic("metadata contains no pallets".to_string())); + } + for required in ["System", "Balances", "ReversibleTransfers", "Multisig", "TechReferenda"] { + if !pallets.iter().any(|p| p == required) { + return Err(QuantusError::Generic(format!("pallet {required} missing from metadata"))); + } + } + Ok(format!("{} pallets exposed: {}", pallets.len(), pallets.join(", "))) +} + +async fn chain_properties(ctx: &ExerciseCtx) -> Result { + let (symbol, decimals) = crate::cli::send::get_chain_properties(&ctx.client).await?; + Ok(format!("token {symbol} with {decimals} decimals")) +} + +async fn latest_block_and_events(ctx: &ExerciseCtx) -> Result { + let latest_hash = ctx.client.get_latest_block().await?; + let block = ctx.client.client().blocks().at(latest_hash).await?; + let number = block.number(); + let extrinsics = block.extrinsics().await?; + let events = ctx.client.client().events().at(latest_hash).await?; + let mut decoded = 0usize; + for event in events.iter() { + event?; + decoded += 1; + } + Ok(format!("block #{number}: {} extrinsics, {decoded} events decoded", extrinsics.len())) +} + +async fn treasury_info(ctx: &ExerciseCtx) -> Result { + let latest = ctx.client.get_latest_block().await?; + let storage_at = ctx.client.client().storage().at(latest); + + let account_addr = quantus_subxt::api::storage().treasury_pallet().treasury_account(); + let account = storage_at + .fetch(&account_addr) + .await? + .ok_or_else(|| QuantusError::Generic("treasury account not set".to_string()))?; + + let portion_addr = quantus_subxt::api::storage().treasury_pallet().treasury_portion(); + let portion = storage_at.fetch(&portion_addr).await?.map(|p| p.0).unwrap_or(0); + + let balance_addr = quantus_subxt::api::storage().system().account(account); + let info = storage_at.fetch_or_default(&balance_addr).await?; + + Ok(format!( + "portion {:.2}%, free balance {} raw units", + portion as f64 / 10_000.0, + info.data.free + )) +} + +async fn high_security_status(ctx: &ExerciseCtx) -> Result { + let alice = crate::cli::exercise::runner::account_id_of(&ctx.alice); + let addr = quantus_subxt::api::storage() + .reversible_transfers() + .high_security_accounts(alice); + let latest = ctx.client.get_latest_block().await?; + let value = ctx.client.client().storage().at(latest).fetch(&addr).await?; + Ok(match value { + Some(_) => "alice has high-security enabled".to_string(), + None => "alice has high-security disabled (expected default)".to_string(), + }) +} + +async fn scheduler_agenda(ctx: &ExerciseCtx) -> Result { + // The scheduler pallet has no dispatchables, but its storage must decode. + let timestamp = crate::cli::scheduler::get_last_processed_timestamp(&ctx.client).await?; + Ok(format!("scheduler last processed timestamp: {timestamp:?}")) +} + +async fn account_balances(ctx: &ExerciseCtx) -> Result { + let alice_ss58 = ctx.alice.to_account_id_ss58check(); + let balance = ctx.free_balance(&alice_ss58).await?; + if balance == 0 { + return Err(QuantusError::Generic( + "alice has zero balance; is this a dev chain with the standard genesis?".to_string(), + )); + } + Ok(format!("alice free balance: {balance} raw units")) +} diff --git a/src/cli/exercise/scenarios/recovery.rs b/src/cli/exercise/scenarios/recovery.rs new file mode 100644 index 0000000..5a79f77 --- /dev/null +++ b/src/cli/exercise/scenarios/recovery.rs @@ -0,0 +1,47 @@ +//! Recovery scenarios. The CLI does not wrap `create_recovery`, so no account +//! has a recovery configuration on a fresh dev chain; the wrapped calls are +//! exercised as far as chain state allows, asserting the documented errors. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{account_id_of, submit_expect_failure, ExerciseCtx}, + }, + error::Result, + exercise_step, +}; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "config_reads", config_reads(ctx)); + exercise_step!(report, phase, "initiate_not_recoverable", initiate_not_recoverable(ctx)); + Ok(()) +} + +async fn config_reads(ctx: &mut ExerciseCtx) -> Result { + let alice = account_id_of(&ctx.alice); + let latest = ctx.client.get_latest_block().await?; + let storage_at = ctx.client.client().storage().at(latest); + + let recoverable = storage_at + .fetch(&quantus_subxt::api::storage().recovery().recoverable(alice.clone())) + .await?; + let proxy = storage_at.fetch(&quantus_subxt::api::storage().recovery().proxy(alice)).await?; + + Ok(format!( + "recovery storage decodes: alice recoverable={}, proxy={}", + recoverable.is_some(), + proxy.is_some() + )) +} + +async fn initiate_not_recoverable(ctx: &mut ExerciseCtx) -> Result { + // No account has called create_recovery on a fresh chain, so initiating + // recovery must fail with Recovery::NotRecoverable. + let lost = account_id_of(&ctx.bob); + let call = quantus_subxt::api::tx() + .recovery() + .initiate_recovery(subxt::ext::subxt_core::utils::MultiAddress::Id(lost)); + let rescuer = ctx.eph[0].clone(); + submit_expect_failure(ctx, &rescuer, call, &["NotRecoverable"]).await +} diff --git a/src/cli/exercise/scenarios/reversible.rs b/src/cli/exercise/scenarios/reversible.rs new file mode 100644 index 0000000..af29147 --- /dev/null +++ b/src/cli/exercise/scenarios/reversible.rs @@ -0,0 +1,179 @@ +//! Reversible-transfer scenarios: schedule with default and explicit delay, +//! cancel a pending transfer, and enable high-security on a throwaway account. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{account_id_of, submit_ok, ExerciseCtx}, + }, + error::{QuantusError, Result}, + exercise_step, +}; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "schedule_and_cancel", schedule_and_cancel(ctx)); + exercise_step!(report, phase, "schedule_with_delay", schedule_with_delay(ctx)); + exercise_step!(report, phase, "set_high_security", set_high_security(ctx)); + Ok(()) +} + +/// Fetch the pending transfer ids scheduled by `sender`. +async fn pending_ids( + ctx: &ExerciseCtx, + sender: &crate::wallet::QuantumKeyPair, +) -> Result> { + let account = account_id_of(sender); + let addr = quantus_subxt::api::storage() + .reversible_transfers() + .pending_transfers_by_sender(account); + let latest = ctx.client.get_latest_block().await?; + let value = ctx.client.client().storage().at(latest).fetch(&addr).await?; + Ok(value.map(|bounded| bounded.0).unwrap_or_default()) +} + +async fn schedule_and_cancel(ctx: &mut ExerciseCtx) -> Result { + // `schedule_transfer` (default-delay) is exclusive to high-security + // accounts, so a regular account must use the one-time-delay variant. + // The default-delay path is exercised in `set_high_security` below. + let sender = ctx.eph[2].clone(); + let recipient = ctx.fresh_keypair()?.to_account_id_ss58check(); + let amount = ctx.unit; + + crate::cli::reversible::schedule_transfer_with_delay( + &ctx.client, + &sender, + &recipient, + amount, + 50, // blocks; must exceed MinDelayPeriodBlocks (2) + true, + ctx.wait_mode(), + ) + .await?; + + let ids = pending_ids(ctx, &sender).await?; + if ids.is_empty() { + return Err(QuantusError::Generic( + "scheduled transfer not found in PendingTransfersBySender".to_string(), + )); + } + let tx_id = ids[ids.len() - 1]; + + let cancel_call = quantus_subxt::api::tx().reversible_transfers().cancel(tx_id); + submit_ok(ctx, &sender, cancel_call).await?; + + let ids_after = pending_ids(ctx, &sender).await?; + if ids_after.contains(&tx_id) { + return Err(QuantusError::Generic(format!( + "cancelled transfer {tx_id:?} still listed as pending" + ))); + } + Ok(format!("scheduled reversible transfer {tx_id:?} then cancelled it, storage verified")) +} + +async fn schedule_with_delay(ctx: &mut ExerciseCtx) -> Result { + let sender = ctx.eph[2].clone(); + let recipient = ctx.fresh_keypair()?.to_account_id_ss58check(); + let delay_blocks = 50u64; + + crate::cli::reversible::schedule_transfer_with_delay( + &ctx.client, + &sender, + &recipient, + ctx.unit, + delay_blocks, + true, // delay in blocks + ctx.wait_mode(), + ) + .await?; + + let ids = pending_ids(ctx, &sender).await?; + if ids.is_empty() { + return Err(QuantusError::Generic( + "delayed transfer not found in PendingTransfersBySender".to_string(), + )); + } + // Leave it pending: exercises the scheduler-driven execution path in the background. + Ok(format!( + "scheduled reversible transfer with {delay_blocks}-block delay ({} now pending)", + ids.len() + )) +} + +async fn set_high_security(ctx: &mut ExerciseCtx) -> Result { + // High-security is sticky, so enable it on a dedicated fresh account + // rather than a shared ephemeral one. + let account = ctx.fresh_keypair()?; + let account_ss58 = account.to_account_id_ss58check(); + + // Fund it so it can pay fees. + let funder = ctx.eph[3].clone(); + crate::cli::send::transfer( + &ctx.client, + &funder, + &account_ss58, + 10 * ctx.unit, + None, + ctx.wait_mode(), + ) + .await?; + + let guardian = account_id_of(&ctx.alice); + use quantus_subxt::api::reversible_transfers::calls::types::set_high_security::Delay; + let call = quantus_subxt::api::tx() + .reversible_transfers() + .set_high_security(Delay::BlockNumber(10), guardian); + submit_ok(ctx, &account, call).await?; + + let addr = quantus_subxt::api::storage() + .reversible_transfers() + .high_security_accounts(account_id_of(&account)); + let latest = ctx.client.get_latest_block().await?; + let value = ctx.client.client().storage().at(latest).fetch(&addr).await?; + match value { + Some(data) => + if data.guardian != account_id_of(&ctx.alice) { + return Err(QuantusError::Generic( + "high-security guardian in storage does not match alice".to_string(), + )); + }, + None => + return Err(QuantusError::Generic( + "high-security storage entry missing after set_high_security".to_string(), + )), + } + + // Exercise the HS-only default-delay path: `schedule_transfer` uses the + // account's configured delay and is rejected for non-HS accounts. + let recipient = ctx.fresh_keypair()?.to_account_id_ss58check(); + crate::cli::reversible::schedule_transfer( + &ctx.client, + &account, + &recipient, + ctx.unit, + ctx.wait_mode(), + ) + .await?; + + let ids = pending_ids(ctx, &account).await?; + let Some(&tx_id) = ids.last() else { + return Err(QuantusError::Generic( + "HS default-delay transfer not found in PendingTransfersBySender".to_string(), + )); + }; + + // For HS accounts only the guardian may cancel; funds go to the guardian. + let cancel_call = quantus_subxt::api::tx().reversible_transfers().cancel(tx_id); + submit_ok(ctx, &ctx.alice.clone(), cancel_call).await?; + + let ids_after = pending_ids(ctx, &account).await?; + if ids_after.contains(&tx_id) { + return Err(QuantusError::Generic(format!( + "guardian-cancelled transfer {tx_id:?} still listed as pending" + ))); + } + + Ok("high-security enabled (alice as guardian), default-delay transfer scheduled, \ + guardian cancelled it, storage verified" + .to_string()) +} diff --git a/src/cli/exercise/scenarios/upgrade.rs b/src/cli/exercise/scenarios/upgrade.rs new file mode 100644 index 0000000..00e519b --- /dev/null +++ b/src/cli/exercise/scenarios/upgrade.rs @@ -0,0 +1,123 @@ +//! Optional runtime-upgrade phase (enabled with `--upgrade-wasm`). Drives the +//! full governance path on a fast-governance node: note the WASM preimage, +//! submit a `System::set_code` referendum, place the decision deposit, vote +//! aye with the three genesis collective members, then poll until the spec +//! version bumps. + +use crate::{ + chain::quantus_subxt, + cli::exercise::{ + report::Report, + runner::{submit_ok, ExerciseCtx}, + }, + error::{QuantusError, Result}, + exercise_step, +}; +use sp_runtime::traits::{BlakeTwo256, Hash}; +use std::path::Path; +use subxt::tx::Payload; + +pub async fn run( + ctx: &mut ExerciseCtx, + report: &mut Report, + phase: &str, + wasm_path: &Path, + timeout_secs: u64, +) -> Result<()> { + exercise_step!( + report, + phase, + "governance_set_code", + governance_set_code(ctx, wasm_path, timeout_secs) + ); + Ok(()) +} + +async fn governance_set_code( + ctx: &mut ExerciseCtx, + wasm_path: &Path, + timeout_secs: u64, +) -> Result { + let (spec_before, _) = ctx.client.get_runtime_version().await?; + + let wasm = std::fs::read(wasm_path).map_err(|e| { + QuantusError::Generic(format!("failed to read WASM {}: {e}", wasm_path.display())) + })?; + crate::log_status!( + "⬆️ Upgrade phase: proposing set_code with {} ({} bytes), current spec {}", + wasm_path.display(), + wasm.len(), + spec_before + ); + + // Encode System::set_code(wasm) and note it as a preimage. + let set_code = quantus_subxt::api::tx().system().set_code(wasm); + let encoded = set_code + .encode_call_data(&ctx.client.client().metadata()) + .map_err(|e| QuantusError::Generic(format!("failed to encode set_code: {e:?}")))?; + let preimage_hash: sp_core::H256 = BlakeTwo256::hash(&encoded); + let call_len = encoded.len() as u32; + crate::cli::common::submit_preimage(&ctx.client, &ctx.alice, encoded, ctx.wait_mode()).await?; + + // Referendum index is the count before submission. + let latest = ctx.client.get_latest_block().await?; + let count_addr = quantus_subxt::api::storage().tech_referenda().referendum_count(); + let index = ctx.client.client().storage().at(latest).fetch(&count_addr).await?.unwrap_or(0); + + let submit_call = + crate::cli::exercise::scenarios::governance::build_submit_call(preimage_hash, call_len); + let alice = ctx.alice.clone(); + submit_ok(ctx, &alice, submit_call).await?; + crate::log_status!("⬆️ Referendum #{index} submitted"); + + let deposit_call = quantus_subxt::api::tx().tech_referenda().place_decision_deposit(index); + submit_ok(ctx, &alice, deposit_call).await?; + + for voter in [ctx.alice.clone(), ctx.bob.clone(), ctx.charlie.clone()] { + crate::cli::tech_collective::vote_on_referendum( + &ctx.client, + &voter, + index, + true, + ctx.wait_mode(), + ) + .await?; + } + crate::log_status!("⬆️ Decision deposit placed and 3 aye votes cast; waiting for enactment…"); + + // Poll for the spec bump. On a fast-governance node every window is 2 + // blocks, so this normally completes within ~10 blocks. + let deadline = std::time::Instant::now() + std::time::Duration::from_secs(timeout_secs); + loop { + tokio::time::sleep(std::time::Duration::from_secs(6)).await; + let (spec_now, _) = ctx.client.get_runtime_version().await?; + if spec_now > spec_before { + // Refund the deposits now that the referendum has completed. + let refund_decision = + quantus_subxt::api::tx().tech_referenda().refund_decision_deposit(index); + let refund_submission = + quantus_subxt::api::tx().tech_referenda().refund_submission_deposit(index); + let refund_result_a = submit_ok(ctx, &alice, refund_decision).await; + let refund_result_b = submit_ok(ctx, &alice, refund_submission).await; + let refunds = match (refund_result_a, refund_result_b) { + (Ok(_), Ok(_)) => "deposits refunded", + _ => "deposit refund not yet available (referendum bookkeeping pending)", + }; + return Ok(format!( + "runtime upgraded via referendum #{index}: spec {spec_before} β†’ {spec_now}; {refunds}" + )); + } + if std::time::Instant::now() > deadline { + // Include the referendum state in the failure for debugging. + let info_addr = + quantus_subxt::api::storage().tech_referenda().referendum_info_for(index); + let latest = ctx.client.get_latest_block().await?; + let info = ctx.client.client().storage().at(latest).fetch(&info_addr).await?; + return Err(QuantusError::Generic(format!( + "spec version still {spec_before} after {timeout_secs}s; referendum #{index} \ + state: {info:?}. Is the node built with the fast-governance feature and the \ + WASM spec_version higher than {spec_before}?" + ))); + } + } +} diff --git a/src/cli/exercise/scenarios/wormhole.rs b/src/cli/exercise/scenarios/wormhole.rs new file mode 100644 index 0000000..87df18c --- /dev/null +++ b/src/cli/exercise/scenarios/wormhole.rs @@ -0,0 +1,32 @@ +//! Wormhole phase: drives the existing multiround flow (fund β†’ prove β†’ +//! verify on-chain β†’ exit) with 5 rounds of 5 proofs. Proof generation is +//! CPU-heavy; on debug builds it can be very slow, so use `--skip wormhole`. + +use crate::{ + cli::exercise::{report::Report, runner::ExerciseCtx}, + error::Result, + exercise_step, +}; + +pub async fn run(ctx: &mut ExerciseCtx, report: &mut Report, phase: &str) -> Result<()> { + exercise_step!(report, phase, "multiround", multiround(ctx)); + Ok(()) +} + +async fn multiround(ctx: &mut ExerciseCtx) -> Result { + // Reuses the full CLI multiround implementation with the standard + // crystal_alice dev wallet (created during setup). + let command = crate::cli::wormhole::WormholeCommands::Multiround { + num_proofs: 5, + rounds: 5, + amount: 50.0, + wallet: "crystal_alice".to_string(), + password: Some(String::new()), + password_file: None, + keep_files: false, + output_dir: "/tmp/wormhole_exercise".to_string(), + dry_run: false, + }; + crate::cli::wormhole::handle_wormhole_command(command, &ctx.node_url).await?; + Ok("wormhole multiround (5 rounds, 5 proofs each) completed".to_string()) +} diff --git a/src/cli/generic_call.rs b/src/cli/generic_call.rs index bce083d..9d718a6 100644 --- a/src/cli/generic_call.rs +++ b/src/cli/generic_call.rs @@ -98,12 +98,6 @@ pub async fn execute_generic_call( ("ReversibleTransfers", "schedule_transfer") => submit_reversible_transfer(quantus_client, from_keypair, &args, execution_mode).await?, - // Scheduler pallet calls - ("Scheduler", "schedule") => - submit_scheduler_schedule(quantus_client, from_keypair, &args).await?, - ("Scheduler", "cancel") => - submit_scheduler_cancel(quantus_client, from_keypair, &args).await?, - // Generic fallback for unknown calls (_, _) => { log_error!( @@ -116,7 +110,6 @@ pub async fn execute_generic_call( log_print!(" β€’ System: remark"); log_print!(" β€’ TechCollective: add_member, remove_member, vote"); log_print!(" β€’ ReversibleTransfers: schedule_transfer"); - log_print!(" β€’ Scheduler: schedule, cancel"); log_print!("πŸ’‘ For other calls, use the original 'quantus call' command"); return Err(QuantusError::Generic(format!( "Unsupported pallet/call combination in SubXT: {pallet}.{call}" @@ -360,32 +353,6 @@ async fn submit_reversible_transfer( .await } -/// Submit scheduler schedule -async fn submit_scheduler_schedule( - _quantus_client: &crate::chain::client::QuantusClient, - _from_keypair: &QuantumKeyPair, - _args: &[Value], -) -> crate::error::Result { - log_error!("❌ Scheduler calls through generic call are complex"); - log_print!("πŸ’‘ Use dedicated scheduler commands for complex scheduling"); - Err(QuantusError::Generic( - "Scheduler calls not supported in generic call - use scheduler commands".to_string(), - )) -} - -/// Submit scheduler cancel -async fn submit_scheduler_cancel( - _quantus_client: &crate::chain::client::QuantusClient, - _from_keypair: &QuantumKeyPair, - _args: &[Value], -) -> crate::error::Result { - log_error!("❌ Scheduler calls through generic call are complex"); - log_print!("πŸ’‘ Use dedicated scheduler commands for scheduling operations"); - Err(QuantusError::Generic( - "Scheduler calls not supported in generic call - use scheduler commands".to_string(), - )) -} - /// Handle generic call command execution pub async fn handle_generic_call( pallet: &str, diff --git a/src/cli/mod.rs b/src/cli/mod.rs index a468e08..b96909e 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -7,6 +7,7 @@ pub mod batch; pub mod block; pub mod common; pub mod events; +pub mod exercise; pub mod generic_call; pub mod high_security; pub mod metadata; @@ -14,8 +15,6 @@ pub mod multisend; pub mod multisig; pub mod preimage; pub mod recovery; -pub mod referenda; -pub mod referenda_decode; pub mod reversible; pub mod runtime; pub mod scheduler; @@ -108,10 +107,6 @@ pub enum Commands { #[command(subcommand)] TechReferenda(tech_referenda::TechReferendaCommands), - /// Standard Referenda management commands (public governance) - #[command(subcommand)] - Referenda(referenda::ReferendaCommands), - /// Treasury account info #[command(subcommand)] Treasury(treasury::TreasuryCommands), @@ -175,6 +170,9 @@ pub enum Commands { #[command(subcommand)] Developer(DeveloperCommands), + /// Run the chain exercise suite against a live node (smoke + fuzz + optional upgrade) + Exercise(exercise::ExerciseArgs), + /// Query events from blocks Events { /// Block number to query events from (full support) @@ -368,8 +366,6 @@ pub async fn execute_command( execution_mode, ) .await, - Commands::Referenda(referenda_cmd) => - referenda::handle_referenda_command(referenda_cmd, node_url, execution_mode).await, Commands::Treasury(treasury_cmd) => treasury::handle_treasury_command(treasury_cmd, node_url, execution_mode).await, Commands::Transfers(transfers_cmd) => @@ -421,6 +417,8 @@ pub async fn execute_command( Ok(()) }, Commands::Developer(dev_cmd) => handle_developer_command(dev_cmd).await, + Commands::Exercise(exercise_args) => + exercise::handle_exercise_command(exercise_args, node_url).await, Commands::Events { block, block_hash, latest: _, finalized, pallet, raw, no_decode } => events::handle_events_command( block, block_hash, finalized, pallet, raw, !no_decode, node_url, diff --git a/src/cli/referenda.rs b/src/cli/referenda.rs deleted file mode 100644 index 5b67815..0000000 --- a/src/cli/referenda.rs +++ /dev/null @@ -1,840 +0,0 @@ -//! `quantus referenda` subcommand - manage standard Referenda proposals -use crate::{ - chain::quantus_subxt, - cli::{common::submit_transaction, tech_collective::VoteChoice}, - error::QuantusError, - log_error, log_print, log_success, log_verbose, -}; -use clap::Subcommand; -use colored::Colorize; -use std::str::FromStr; - -/// Standard Referenda management commands -#[derive(Subcommand, Debug)] -pub enum ReferendaCommands { - /// Submit a simple proposal (System::remark) to test Referenda - SubmitRemark { - /// Message to include in the remark - #[arg(long)] - message: String, - - /// Wallet name to sign with - #[arg(short, long)] - from: String, - - /// Password for the wallet - #[arg(short, long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - - /// Origin type: signed (default) or root - #[arg(long, default_value = "signed")] - origin: String, - }, - - /// Submit a proposal using existing preimage hash - Submit { - /// Preimage hash (must already exist on chain) - #[arg(long)] - preimage_hash: String, - - /// Wallet name to sign with - #[arg(short, long)] - from: String, - - /// Password for the wallet - #[arg(short, long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - - /// Origin type: signed (default) or root - #[arg(long, default_value = "signed")] - origin: String, - }, - - /// List all active Referenda proposals - List, - - /// Get details of a specific Referendum - Get { - /// Referendum index - #[arg(short, long)] - index: u32, - - /// Decode and display the proposal call in human-readable format - #[arg(long)] - decode: bool, - }, - - /// Check the status of a Referendum - Status { - /// Referendum index - #[arg(short, long)] - index: u32, - }, - - /// Place a decision deposit for a Referendum - PlaceDecisionDeposit { - /// Referendum index - #[arg(short, long)] - index: u32, - - /// Wallet name to sign with - #[arg(short, long)] - from: String, - - /// Password for the wallet - #[arg(short, long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - }, - - /// Vote on a Referendum (uses conviction voting) - Vote { - /// Referendum index - #[arg(short, long)] - index: u32, - - /// Vote: "aye" or "nay" - #[arg(long)] - vote: VoteChoice, - - /// Conviction (0=None, 1=Locked1x, 2=Locked2x, up to 6=Locked6x) - #[arg(long, default_value = "0")] - conviction: u8, - - /// Amount to vote with - #[arg(long)] - amount: String, - - /// Wallet name to sign with - #[arg(short, long)] - from: String, - - /// Password for the wallet - #[arg(short, long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - }, - - /// Refund submission deposit for a completed Referendum - RefundSubmissionDeposit { - /// Referendum index - #[arg(short, long)] - index: u32, - - /// Wallet name that submitted the referendum - #[arg(short, long)] - from: String, - - /// Password for the wallet - #[arg(short, long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - }, - - /// Refund decision deposit for a completed Referendum - RefundDecisionDeposit { - /// Referendum index - #[arg(short, long)] - index: u32, - - /// Wallet name that placed the decision deposit - #[arg(short, long)] - from: String, - - /// Password for the wallet - #[arg(short, long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - }, - - /// Get Referenda configuration - Config, -} - -/// Handle referenda commands -pub async fn handle_referenda_command( - command: ReferendaCommands, - node_url: &str, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; - - match command { - ReferendaCommands::SubmitRemark { message, from, password, password_file, origin } => - submit_remark_proposal( - &quantus_client, - &message, - &from, - password, - password_file, - &origin, - execution_mode, - ) - .await, - ReferendaCommands::Submit { preimage_hash, from, password, password_file, origin } => - submit_proposal( - &quantus_client, - &preimage_hash, - &from, - password, - password_file, - &origin, - execution_mode, - ) - .await, - ReferendaCommands::List => list_proposals(&quantus_client).await, - ReferendaCommands::Get { index, decode } => - get_proposal_details(&quantus_client, index, decode).await, - ReferendaCommands::Status { index } => get_proposal_status(&quantus_client, index).await, - ReferendaCommands::PlaceDecisionDeposit { index, from, password, password_file } => - place_decision_deposit( - &quantus_client, - index, - &from, - password, - password_file, - execution_mode, - ) - .await, - ReferendaCommands::Vote { - index, - vote, - conviction, - amount, - from, - password, - password_file, - } => - vote_on_referendum( - &quantus_client, - index, - matches!(vote, VoteChoice::Aye), - conviction, - &amount, - &from, - password, - password_file, - execution_mode, - ) - .await, - ReferendaCommands::RefundSubmissionDeposit { index, from, password, password_file } => - refund_submission_deposit( - &quantus_client, - index, - &from, - password, - password_file, - execution_mode, - ) - .await, - ReferendaCommands::RefundDecisionDeposit { index, from, password, password_file } => - refund_decision_deposit( - &quantus_client, - index, - &from, - password, - password_file, - execution_mode, - ) - .await, - ReferendaCommands::Config => get_config(&quantus_client).await, - } -} - -/// Submit a simple System::remark proposal -async fn submit_remark_proposal( - quantus_client: &crate::chain::client::QuantusClient, - message: &str, - from: &str, - password: Option, - password_file: Option, - origin_type: &str, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - use sp_runtime::traits::{BlakeTwo256, Hash}; - - log_print!("πŸ“ Submitting System::remark Proposal to Referenda"); - log_print!(" πŸ’¬ Message: {}", message.bright_cyan()); - log_print!(" πŸ”‘ Submitted by: {}", from.bright_yellow()); - log_print!(" 🎯 Origin type: {}", origin_type.bright_magenta()); - - // Load wallet keypair - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; - - // Build System::remark call and encode it - let remark_bytes = message.as_bytes().to_vec(); - let remark_payload = quantus_subxt::api::tx().system().remark(remark_bytes.clone()); - let metadata = quantus_client.client().metadata(); - let encoded_call = <_ as subxt::tx::Payload>::encode_call_data(&remark_payload, &metadata) - .map_err(|e| QuantusError::Generic(format!("Failed to encode call data: {:?}", e)))?; - - log_verbose!("πŸ“ Encoded call size: {} bytes", encoded_call.len()); - - // Must match `frame_system::Config::Hashing` (BlakeTwo256) β€” same key as `pallet_preimage`. - let preimage_hash: sp_core::H256 = BlakeTwo256::hash(&encoded_call); - - log_print!("πŸ”— Preimage hash: {:?}", preimage_hash); - - let call_len = encoded_call.len() as u32; - crate::cli::common::submit_preimage(quantus_client, &keypair, encoded_call, execution_mode) - .await?; - - // Build Referenda::submit call using Lookup preimage reference - type ProposalBounded = - quantus_subxt::api::runtime_types::frame_support::traits::preimages::Bounded< - quantus_subxt::api::runtime_types::quantus_runtime::RuntimeCall, - quantus_subxt::api::runtime_types::sp_runtime::traits::BlakeTwo256, - >; - - let preimage_hash_subxt: subxt::utils::H256 = preimage_hash; - let proposal: ProposalBounded = - ProposalBounded::Lookup { hash: preimage_hash_subxt, len: call_len }; - - // Create origin based on origin_type parameter - let account_id_sp = keypair.to_account_id_32(); - let account_id_subxt: subxt::ext::subxt_core::utils::AccountId32 = - subxt::ext::subxt_core::utils::AccountId32(*account_id_sp.as_ref()); - - let origin_caller = match origin_type.to_lowercase().as_str() { - "signed" => { - let raw_origin = - quantus_subxt::api::runtime_types::frame_support::dispatch::RawOrigin::Signed( - account_id_subxt, - ); - quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::system(raw_origin) - }, - "root" => { - let raw_origin = - quantus_subxt::api::runtime_types::frame_support::dispatch::RawOrigin::Root; - quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::system(raw_origin) - }, - "none" => - return Err(QuantusError::Generic( - "Invalid origin type: none. Use 'signed' or 'root'.".to_string(), - )), - _ => - return Err(QuantusError::Generic(format!( - "Invalid origin type: {}. Must be 'signed' or 'root'", - origin_type - ))), - }; - - let enactment = - quantus_subxt::api::runtime_types::frame_support::traits::schedule::DispatchTime::After( - 10u32, // Execute 10 blocks after approval - ); - - log_print!("πŸ”§ Creating Referenda::submit call..."); - let submit_call = - quantus_subxt::api::tx().referenda().submit(origin_caller, proposal, enactment); - - let tx_hash = - submit_transaction(quantus_client, &keypair, submit_call, None, execution_mode).await?; - log_print!( - "βœ… {} Referendum proposal submitted! Hash: {:?}", - "SUCCESS".bright_green().bold(), - tx_hash - ); - - log_print!("πŸ’‘ Use 'quantus referenda list' to see active proposals"); - Ok(()) -} - -/// Submit a proposal using existing preimage hash -async fn submit_proposal( - quantus_client: &crate::chain::client::QuantusClient, - preimage_hash: &str, - from: &str, - password: Option, - password_file: Option, - origin_type: &str, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - log_print!("πŸ“ Submitting Proposal to Referenda"); - log_print!(" πŸ”— Preimage hash: {}", preimage_hash.bright_cyan()); - log_print!(" πŸ”‘ Submitted by: {}", from.bright_yellow()); - log_print!(" 🎯 Origin type: {}", origin_type.bright_magenta()); - - // Parse preimage hash - let hash_str = preimage_hash.trim_start_matches("0x"); - let preimage_hash_parsed: sp_core::H256 = sp_core::H256::from_str(hash_str) - .map_err(|_| QuantusError::Generic("Invalid preimage hash format".to_string()))?; - - // Load wallet keypair - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; - - // Check if preimage exists and get its length - log_print!("πŸ” Checking preimage status..."); - let latest_block_hash = quantus_client.get_latest_block().await?; - let storage_at = quantus_client.client().storage().at(latest_block_hash); - - let preimage_status = storage_at - .fetch( - &quantus_subxt::api::storage() - .preimage() - .request_status_for(preimage_hash_parsed), - ) - .await - .map_err(|e| QuantusError::Generic(format!("Failed to fetch preimage status: {:?}", e)))? - .ok_or_else(|| QuantusError::Generic("Preimage not found on chain".to_string()))?; - - let preimage_len = match preimage_status { - quantus_subxt::api::runtime_types::pallet_preimage::RequestStatus::Unrequested { - ticket: _, - len, - } => len, - quantus_subxt::api::runtime_types::pallet_preimage::RequestStatus::Requested { - maybe_ticket: _, - count: _, - maybe_len, - } => match maybe_len { - Some(len) => len, - None => return Err(QuantusError::Generic("Preimage length not available".to_string())), - }, - }; - - log_print!("βœ… Preimage found! Length: {} bytes", preimage_len); - - // Build Referenda::submit call - type ProposalBounded = - quantus_subxt::api::runtime_types::frame_support::traits::preimages::Bounded< - quantus_subxt::api::runtime_types::quantus_runtime::RuntimeCall, - quantus_subxt::api::runtime_types::sp_runtime::traits::BlakeTwo256, - >; - - let preimage_hash_subxt: subxt::utils::H256 = preimage_hash_parsed; - let proposal: ProposalBounded = - ProposalBounded::Lookup { hash: preimage_hash_subxt, len: preimage_len }; - - // Create origin based on origin_type parameter - let account_id_sp = keypair.to_account_id_32(); - let account_id_subxt: subxt::ext::subxt_core::utils::AccountId32 = - subxt::ext::subxt_core::utils::AccountId32(*account_id_sp.as_ref()); - - let origin_caller = match origin_type.to_lowercase().as_str() { - "signed" => { - let raw_origin = - quantus_subxt::api::runtime_types::frame_support::dispatch::RawOrigin::Signed( - account_id_subxt, - ); - quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::system(raw_origin) - }, - "root" => { - let raw_origin = - quantus_subxt::api::runtime_types::frame_support::dispatch::RawOrigin::Root; - quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::system(raw_origin) - }, - "none" => - return Err(QuantusError::Generic( - "Invalid origin type: none. Use 'signed' or 'root'.".to_string(), - )), - _ => - return Err(QuantusError::Generic(format!( - "Invalid origin type: {}. Must be 'signed' or 'root'", - origin_type - ))), - }; - - let enactment = - quantus_subxt::api::runtime_types::frame_support::traits::schedule::DispatchTime::After( - 10u32, - ); - - log_print!("πŸ”§ Creating Referenda::submit call..."); - let submit_call = - quantus_subxt::api::tx().referenda().submit(origin_caller, proposal, enactment); - - let tx_hash = - submit_transaction(quantus_client, &keypair, submit_call, None, execution_mode).await?; - log_print!( - "βœ… {} Referendum proposal submitted! Hash: {:?}", - "SUCCESS".bright_green().bold(), - tx_hash - ); - - log_print!("πŸ’‘ Use 'quantus referenda list' to see active proposals"); - Ok(()) -} - -/// List recent Referenda proposals -async fn list_proposals( - quantus_client: &crate::chain::client::QuantusClient, -) -> crate::error::Result<()> { - log_print!("πŸ“œ Active Referenda Proposals"); - log_print!(""); - - let addr = quantus_subxt::api::storage().referenda().referendum_count(); - - let latest_block_hash = quantus_client.get_latest_block().await?; - let storage_at = quantus_client.client().storage().at(latest_block_hash); - - let count = storage_at.fetch(&addr).await?; - - if let Some(total) = count { - log_print!("πŸ“Š Total referenda created: {}", total); - if total == 0 { - log_print!("πŸ“­ No active proposals found"); - return Ok(()); - } - log_print!("πŸ” Fetching recent referenda..."); - for i in (0..total).rev().take(10) { - get_proposal_status(quantus_client, i).await?; - log_print!("----------------------------------------"); - } - } else { - log_print!("πŸ“­ No referenda found - Referenda may be empty"); - } - - Ok(()) -} - -/// Get details of a specific Referendum -async fn get_proposal_details( - quantus_client: &crate::chain::client::QuantusClient, - index: u32, - decode: bool, -) -> crate::error::Result<()> { - use quantus_subxt::api::runtime_types::pallet_referenda::types::ReferendumInfo; - - log_print!("πŸ“„ Referendum #{} Details", index); - log_print!(""); - - let addr = quantus_subxt::api::storage().referenda().referendum_info_for(index); - - let latest_block_hash = quantus_client.get_latest_block().await?; - let storage_at = quantus_client.client().storage().at(latest_block_hash); - - let info = storage_at.fetch(&addr).await?; - - if let Some(referendum_info) = info { - if decode { - // Try to decode the proposal - match &referendum_info { - ReferendumInfo::Ongoing(status) => { - log_print!("πŸ“Š {} Referendum #{}", "Ongoing".bright_green(), index); - log_print!(" πŸ›€οΈ Track: {}", status.track); - log_print!(" πŸ“… Submitted: Block #{}", status.submitted); - log_print!( - " πŸ—³οΈ Tally: Ayes: {}, Nays: {}, Support: {}", - status.tally.ayes, - status.tally.nays, - status.tally.support - ); - log_print!(""); - - // Extract preimage hash and length from proposal - if let quantus_subxt::api::runtime_types::frame_support::traits::preimages::Bounded::Lookup { - hash, - len, - } = &status.proposal - { - log_print!("πŸ“ Proposal Details:"); - log_print!(" πŸ”— Preimage Hash: {:?}", hash); - log_print!(" πŸ“ Length: {} bytes", len); - log_print!(""); - - // Fetch and decode the preimage - match crate::cli::referenda_decode::decode_preimage(quantus_client, hash, *len).await { - Ok(decoded) => { - log_print!("βœ… Decoded Proposal:"); - log_print!("{}", decoded); - }, - Err(e) => { - log_print!("⚠️ Could not decode proposal: {}", e); - log_print!(" Run 'quantus preimage get --hash {:?} --len {}' to see raw data", hash, len); - }, - } - } else { - log_print!("⚠️ Proposal is inline (not a preimage lookup)"); - } - }, - ReferendumInfo::Approved(..) => { - log_print!("πŸ“Š {} Referendum #{}", "Approved".green(), index); - log_print!( - " ℹ️ Proposal details no longer available (referendum finalized)" - ); - }, - ReferendumInfo::Rejected(..) => { - log_print!("πŸ“Š {} Referendum #{}", "Rejected".red(), index); - log_print!( - " ℹ️ Proposal details no longer available (referendum finalized)" - ); - }, - ReferendumInfo::Cancelled(..) => { - log_print!("πŸ“Š {} Referendum #{}", "Cancelled".yellow(), index); - log_print!( - " ℹ️ Proposal details no longer available (referendum finalized)" - ); - }, - ReferendumInfo::TimedOut(..) => { - log_print!("πŸ“Š {} Referendum #{}", "TimedOut".dimmed(), index); - log_print!( - " ℹ️ Proposal details no longer available (referendum finalized)" - ); - }, - ReferendumInfo::Killed(..) => { - log_print!("πŸ“Š {} Referendum #{}", "Killed".red().bold(), index); - log_print!(" ℹ️ Proposal details no longer available (referendum killed)"); - }, - } - } else { - // Raw output (original behavior) - log_print!("πŸ“‹ Referendum Information (raw):"); - log_print!("{:#?}", referendum_info); - } - } else { - log_print!("πŸ“­ Referendum #{} not found", index); - } - Ok(()) -} - -/// Get the status of a Referendum -async fn get_proposal_status( - quantus_client: &crate::chain::client::QuantusClient, - index: u32, -) -> crate::error::Result<()> { - use quantus_subxt::api::runtime_types::pallet_referenda::types::ReferendumInfo; - - log_verbose!("πŸ“Š Fetching status for Referendum #{}...", index); - - let addr = quantus_subxt::api::storage().referenda().referendum_info_for(index); - - let latest_block_hash = quantus_client.get_latest_block().await?; - let storage_at = quantus_client.client().storage().at(latest_block_hash); - - let info_res = storage_at.fetch(&addr).await; - - match info_res { - Ok(Some(info)) => { - log_print!("πŸ“Š Status for Referendum #{}", index.to_string().bright_yellow()); - match info { - ReferendumInfo::Ongoing(status) => { - log_print!(" - Status: {}", "Ongoing".bright_green()); - log_print!(" - Track: {}", status.track); - log_print!(" - Submitted at: block {}", status.submitted); - log_print!( - " - Tally: Ayes: {}, Nays: {}", - status.tally.ayes, - status.tally.nays - ); - log_verbose!(" - Full status: {:#?}", status); - }, - ReferendumInfo::Approved(submitted, ..) => { - log_print!(" - Status: {}", "Approved".green()); - log_print!(" - Submitted at block: {}", submitted); - }, - ReferendumInfo::Rejected(submitted, ..) => { - log_print!(" - Status: {}", "Rejected".red()); - log_print!(" - Submitted at block: {}", submitted); - }, - ReferendumInfo::Cancelled(submitted, ..) => { - log_print!(" - Status: {}", "Cancelled".yellow()); - log_print!(" - Submitted at block: {}", submitted); - }, - ReferendumInfo::TimedOut(submitted, ..) => { - log_print!(" - Status: {}", "TimedOut".dimmed()); - log_print!(" - Submitted at block: {}", submitted); - }, - ReferendumInfo::Killed(submitted) => { - log_print!(" - Status: {}", "Killed".red().bold()); - log_print!(" - Killed at block: {}", submitted); - }, - } - }, - Ok(None) => log_print!("πŸ“­ Referendum #{} not found", index), - Err(e) => log_error!("❌ Failed to fetch referendum #{}: {:?}", index, e), - } - - Ok(()) -} - -/// Place a decision deposit for a Referendum -async fn place_decision_deposit( - quantus_client: &crate::chain::client::QuantusClient, - index: u32, - from: &str, - password: Option, - password_file: Option, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - log_print!("πŸ“‹ Placing decision deposit for Referendum #{}", index); - log_print!(" πŸ”‘ Placed by: {}", from.bright_yellow()); - - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; - - let deposit_call = quantus_subxt::api::tx().referenda().place_decision_deposit(index); - let tx_hash = - submit_transaction(quantus_client, &keypair, deposit_call, None, execution_mode).await?; - log_success!("βœ… Decision deposit placed! Hash: {:?}", tx_hash.to_string().bright_yellow()); - Ok(()) -} - -/// Vote on a Referendum -async fn vote_on_referendum( - quantus_client: &crate::chain::client::QuantusClient, - index: u32, - aye: bool, - conviction: u8, - amount: &str, - from: &str, - password: Option, - password_file: Option, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - log_print!("πŸ—³οΈ Voting on Referendum #{}", index); - log_print!(" πŸ“Š Vote: {}", if aye { "AYE βœ…".bright_green() } else { "NAY ❌".bright_red() }); - log_print!(" πŸ’° Amount: {}", amount.bright_cyan()); - log_print!(" πŸ”’ Conviction: {}", conviction); - log_print!(" πŸ”‘ Signed by: {}", from.bright_yellow()); - - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; - - // Parse amount using chain decimals (12 for DEV) - let amount_value: u128 = crate::cli::send::parse_amount(quantus_client, amount).await?; - - // Validate conviction - if conviction > 6 { - return Err(QuantusError::Generic("Invalid conviction (must be 0-6)".to_string())); - } - - // Build vote - let vote = - quantus_subxt::api::runtime_types::pallet_conviction_voting::vote::AccountVote::Standard { - vote: quantus_subxt::api::runtime_types::pallet_conviction_voting::vote::Vote( - if aye { 128 } else { 0 } | conviction, - ), - balance: amount_value, - }; - - let vote_call = quantus_subxt::api::tx().conviction_voting().vote(index, vote); - let tx_hash = - submit_transaction(quantus_client, &keypair, vote_call, None, execution_mode).await?; - - log_print!( - "βœ… {} Vote transaction submitted! Hash: {:?}", - "SUCCESS".bright_green().bold(), - tx_hash - ); - - log_success!("πŸŽ‰ {} Vote submitted!", "FINISHED".bright_green().bold()); - Ok(()) -} - -/// Get Referenda configuration -async fn get_config( - quantus_client: &crate::chain::client::QuantusClient, -) -> crate::error::Result<()> { - log_print!("βš™οΈ Referenda Configuration"); - log_print!(""); - - let constants = quantus_client.client().constants(); - let tracks_addr = quantus_subxt::api::constants().referenda().tracks(); - - match constants.at(&tracks_addr) { - Ok(tracks) => { - log_print!("{}", "πŸ“Š Track Configuration:".bold()); - for (id, info) in tracks.iter() { - log_print!(" ------------------------------------"); - log_print!( - " β€’ {} #{}: {}", - "Track".bold(), - id, - info.name.to_string().bright_cyan() - ); - log_print!(" β€’ Max Deciding: {}", info.max_deciding); - log_print!(" β€’ Decision Deposit: {}", info.decision_deposit); - log_print!(" β€’ Prepare Period: {} blocks", info.prepare_period); - log_print!(" β€’ Decision Period: {} blocks", info.decision_period); - log_print!(" β€’ Confirm Period: {} blocks", info.confirm_period); - log_print!(" β€’ Min Enactment Period: {} blocks", info.min_enactment_period); - } - log_print!(" ------------------------------------"); - }, - Err(e) => { - log_error!("❌ Failed to decode Tracks constant: {:?}", e); - log_print!("πŸ’‘ It's possible the Tracks constant is not in the expected format."); - }, - } - - Ok(()) -} - -/// Refund submission deposit for a completed Referendum -async fn refund_submission_deposit( - quantus_client: &crate::chain::client::QuantusClient, - index: u32, - from: &str, - password: Option, - password_file: Option, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - log_print!("πŸ’° Refunding submission deposit for Referendum #{}", index); - log_print!(" πŸ”‘ Refund to: {}", from.bright_yellow()); - - // Load wallet keypair - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; - - // Create refund_submission_deposit call - let refund_call = quantus_subxt::api::tx().referenda().refund_submission_deposit(index); - - let tx_hash = - submit_transaction(quantus_client, &keypair, refund_call, None, execution_mode).await?; - log_print!( - "βœ… {} Refund transaction submitted! Hash: {:?}", - "SUCCESS".bright_green().bold(), - tx_hash - ); - - log_print!("πŸ’‘ Check your balance to confirm the refund"); - Ok(()) -} - -/// Refund decision deposit for a completed Referendum -async fn refund_decision_deposit( - quantus_client: &crate::chain::client::QuantusClient, - index: u32, - from: &str, - password: Option, - password_file: Option, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - log_print!("πŸ’° Refunding decision deposit for Referendum #{}", index); - log_print!(" πŸ”‘ Refund to: {}", from.bright_yellow()); - - // Load wallet keypair - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; - - // Create refund_decision_deposit call - let refund_call = quantus_subxt::api::tx().referenda().refund_decision_deposit(index); - - let tx_hash = - submit_transaction(quantus_client, &keypair, refund_call, None, execution_mode).await?; - log_print!( - "βœ… {} Refund transaction submitted! Hash: {:?}", - "SUCCESS".bright_green().bold(), - tx_hash - ); - - log_print!("πŸ’‘ Check your balance to confirm the refund"); - Ok(()) -} diff --git a/src/cli/referenda_decode.rs b/src/cli/referenda_decode.rs deleted file mode 100644 index 7140fa7..0000000 --- a/src/cli/referenda_decode.rs +++ /dev/null @@ -1,243 +0,0 @@ -//! Decoding utilities for referendum proposals - -use crate::error::QuantusError; -use codec::Decode; -use colored::Colorize; - -/// Decode preimage call data into human-readable format -pub async fn decode_preimage( - quantus_client: &crate::chain::client::QuantusClient, - hash: &subxt::utils::H256, - len: u32, -) -> crate::error::Result { - // Fetch preimage from storage - let latest_block_hash = quantus_client.get_latest_block().await?; - let storage_at = quantus_client.client().storage().at(latest_block_hash); - - let preimage_addr = crate::chain::quantus_subxt::api::storage() - .preimage() - .preimage_for((*hash, len)); - - let preimage_result = storage_at.fetch(&preimage_addr).await; - - let content = match preimage_result { - Ok(Some(bounded_vec)) => bounded_vec.0, - Ok(None) => - return Err(QuantusError::Generic(format!("Preimage not found for hash {:?}", hash))), - Err(e) => return Err(QuantusError::Generic(format!("Error fetching preimage: {:?}", e))), - }; - - // Decode using direct Decode trait (RuntimeCall implements it via DecodeAsType derive) - decode_runtime_call_direct(&content) -} - -/// Decode RuntimeCall directly using Decode trait -fn decode_runtime_call_direct(data: &[u8]) -> crate::error::Result { - // First, let's try to understand the call structure by reading indices - if data.len() < 3 { - return Err(QuantusError::Generic("Call data too short".to_string())); - } - - let pallet_index = data[0]; - let inner_index = data[1]; - let call_index = data[2]; - - match (pallet_index, inner_index, call_index) { - // System pallet (0, 0, X) - // Special case: if call_index looks like Compact (high value like 0xe8), - // it might be remark (call 0) where the call index byte is omitted - (0, 0, idx) if idx > 100 => { - // Likely remark (call 0) with Compact-encoded Vec starting at byte 2 - decode_system_remark_no_index(&data[2..]) - }, - (0, 0, _) => decode_system_call(&data[2..]), - - // TreasuryPallet (18, 5, X) where X is any spend variant (11, 15, 19, etc.) - // Different indices represent different value ranges/encodings - (18, 5, _) => decode_treasury_spend_call(&data[3..]), - - // Unknown - _ => Ok(format!( - " {} {} {} {}\n {} {} bytes\n {}:\n {}", - "Call Indices:".dimmed(), - pallet_index, - inner_index, - call_index, - "Args:".dimmed(), - data.len() - 3, - "Raw Hex".dimmed(), - hex::encode(&data[3..]).bright_green() - )), - } -} - -/// Decode System::remark when call index byte is omitted (call 0) -fn decode_system_remark_no_index(args: &[u8]) -> crate::error::Result { - // args starts directly with Compact-encoded Vec - let mut cursor = args; - let remark_bytes: Vec = Vec::decode(&mut cursor) - .map_err(|e| QuantusError::Generic(format!("Failed to decode remark: {:?}", e)))?; - let remark_str = String::from_utf8_lossy(&remark_bytes); - - Ok(format!( - " {} {}\n {} {}\n {}:\n {} \"{}\"", - "Pallet:".dimmed(), - "System".bright_cyan(), - "Call:".dimmed(), - "remark".bright_yellow(), - "Parameters".dimmed(), - "message:".dimmed(), - remark_str.bright_green() - )) -} - -/// Decode System pallet calls -fn decode_system_call(data_from_call: &[u8]) -> crate::error::Result { - if data_from_call.is_empty() { - return Err(QuantusError::Generic("Empty system call data".to_string())); - } - - let call_index = data_from_call[0]; - let args = &data_from_call[1..]; - - match call_index { - 0 => { - // remark - standard Vec - let mut cursor = args; - let remark_bytes: Vec = Vec::decode(&mut cursor) - .map_err(|e| QuantusError::Generic(format!("Failed to decode remark: {:?}", e)))?; - let remark_str = String::from_utf8_lossy(&remark_bytes); - - Ok(format!( - " {} {}\n {} {}\n {}:\n {} \"{}\"", - "Pallet:".dimmed(), - "System".bright_cyan(), - "Call:".dimmed(), - "remark".bright_yellow(), - "Parameters".dimmed(), - "message:".dimmed(), - remark_str.bright_green() - )) - }, - 1 => { - // remark_with_event - has different encoding, try decoding from byte 1 - let remark_str = if args.len() > 1 { - String::from_utf8_lossy(&args[1..]) - } else { - String::from_utf8_lossy(args) - }; - - Ok(format!( - " {} {}\n {} {}\n {}:\n {} \"{}\"", - "Pallet:".dimmed(), - "System".bright_cyan(), - "Call:".dimmed(), - "remark_with_event".bright_yellow(), - "Parameters".dimmed(), - "message:".dimmed(), - remark_str.bright_green() - )) - }, - 7 => { - // set_code - Ok(format!( - " {} {}\n {} {} {}\n {} {}", - "Pallet:".dimmed(), - "System".bright_cyan(), - "Call:".dimmed(), - "set_code".bright_yellow(), - "(Runtime Upgrade)".dimmed(), - "Parameters:".dimmed(), - "".bright_green() - )) - }, - _ => Ok(format!( - " {} {}\n {} {} (index {})", - "Pallet:".dimmed(), - "System".bright_cyan(), - "Call:".dimmed(), - "unknown".yellow(), - call_index - )), - } -} - -/// Decode TreasuryPallet::spend call arguments -/// The amount is stored as variable-length u128 in little-endian -fn decode_treasury_spend_call(args: &[u8]) -> crate::error::Result { - use sp_core::crypto::Ss58Codec; - - crate::log_verbose!("Decoding treasury spend, args length: {} bytes", args.len()); - crate::log_verbose!("Args hex: {}", hex::encode(args)); - - if args.len() < 34 { - return Err(QuantusError::Generic(format!( - "Args too short for treasury spend: {} bytes (expected 40-42)", - args.len() - ))); - } - - // Structure (discovered through empirical analysis): - // - asset_kind: Box<()> = 0 bytes (unit type has no encoding) - // - amount: u128 = variable bytes (7-8 bytes typically) as little-endian - // - beneficiary: Box = 32 bytes (no variant byte!) - // - valid_from: Option = 1 byte (0x00 for None) - - // The amount length varies based on the value: - // - Small values (< 256TB): 7 bytes - // - Larger values: 8+ bytes - // Total length is typically 40 bytes (7+32+1) or 42 bytes (8+32+1) or similar - - // Calculate amount bytes length: total - 32 (beneficiary) - 1 (valid_from) - let amount_bytes_len = args.len() - 32 - 1; - if !(1..=16).contains(&amount_bytes_len) { - return Err(QuantusError::Generic(format!( - "Invalid amount bytes length: {}", - amount_bytes_len - ))); - } - - // Decode amount: first N bytes as little-endian u128 - let mut amount_bytes_extended = [0u8; 16]; - amount_bytes_extended[..amount_bytes_len].copy_from_slice(&args[..amount_bytes_len]); - let amount = u128::from_le_bytes(amount_bytes_extended); - - // Decode beneficiary: starts after amount bytes, 32 bytes - let beneficiary_start = amount_bytes_len; - let account_bytes: [u8; 32] = args[beneficiary_start..beneficiary_start + 32] - .try_into() - .map_err(|_| QuantusError::Generic("Failed to extract beneficiary bytes".to_string()))?; - let sp_account = sp_core::crypto::AccountId32::from(account_bytes); - let ss58 = sp_account.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(42)); - let beneficiary_str = format!("{} ({}...{})", ss58, &ss58[..8], &ss58[ss58.len() - 6..]); - - // Decode valid_from: last byte - let valid_from_byte = args[args.len() - 1]; - let valid_from_str = if valid_from_byte == 0 { - "None (immediate)".to_string() - } else { - format!("Some (byte: 0x{:02x})", valid_from_byte) - }; - - // Format amount in QUAN (1 QUAN = 10^12) - let quan = amount as f64 / 1_000_000_000_000.0; - - Ok(format!( - " {} {}\n {} {}\n {}:\n {} {} {} ({} raw)\n {} {}\n {} {}\n\n {} {}", - "Pallet:".dimmed(), - "TreasuryPallet".bright_cyan(), - "Call:".dimmed(), - "spend".bright_yellow(), - "Parameters".dimmed(), - "amount:".dimmed(), - quan.to_string().bright_green().bold(), - "QUAN".bright_green(), - amount, - "beneficiary:".dimmed(), - beneficiary_str.bright_green(), - "valid_from:".dimmed(), - valid_from_str.bright_green(), - "πŸ’‘ Info:".cyan(), - "Vote YES if you approve this Treasury spend, NO to reject.".cyan() - )) -} diff --git a/src/cli/scheduler.rs b/src/cli/scheduler.rs index 89055f0..c128b4b 100644 --- a/src/cli/scheduler.rs +++ b/src/cli/scheduler.rs @@ -13,16 +13,6 @@ pub enum SchedulerCommands { #[arg(long)] range: String, }, - - /// Schedule a test System::remark after N blocks - ScheduleRemark { - /// Blocks after current to schedule - #[arg(long)] - after: u32, - /// Wallet name to sign with - #[arg(long)] - from: String, - }, } /// Get the last processed timestamp from the scheduler @@ -102,48 +92,14 @@ async fn list_agenda_range( Ok(()) } -async fn schedule_remark( - quantus_client: &crate::chain::client::QuantusClient, - after: u32, - from: &str, - execution_mode: crate::cli::common::ExecutionMode, -) -> Result<()> { - use quantus_subxt::api; - - log_print!("πŸ—“οΈ Scheduling System::remark after {} blocks", after); - - // Build call as RuntimeCall - let system_remark = quantus_subxt::api::runtime_types::frame_system::pallet::Call::remark { - remark: Vec::new(), - }; - let runtime_call = - quantus_subxt::api::runtime_types::quantus_runtime::RuntimeCall::System(system_remark); - - // When: after N blocks (u32) - let when_u32: u32 = after; - let priority: u8 = 0; - - // Submit schedule extrinsic - let keypair = crate::wallet::load_keypair_from_wallet(from, None, None)?; - let schedule_tx = api::tx().scheduler().schedule(when_u32, priority, runtime_call); - let tx_hash = crate::cli::common::submit_transaction( - quantus_client, - &keypair, - schedule_tx, - None, - execution_mode, - ) - .await?; - log_success!("πŸ“© Schedule extrinsic submitted: {:?}", tx_hash); - - Ok(()) -} +// NOTE: The runtime disables all Scheduler dispatchables (`#[runtime::disable_call]`), +// so this module only exposes read-only storage queries. /// Handle scheduler commands pub async fn handle_scheduler_command( command: SchedulerCommands, node_url: &str, - execution_mode: crate::cli::common::ExecutionMode, + _execution_mode: crate::cli::common::ExecutionMode, ) -> Result<()> { log_print!("πŸ—“οΈ Scheduler"); @@ -164,7 +120,5 @@ pub async fn handle_scheduler_command( Ok(()) }, SchedulerCommands::Agenda { range } => list_agenda_range(&quantus_client, &range).await, - SchedulerCommands::ScheduleRemark { after, from } => - schedule_remark(&quantus_client, after, &from, execution_mode).await, } } diff --git a/src/cli/wormhole.rs b/src/cli/wormhole.rs index b49bfb0..f1d8422 100644 --- a/src/cli/wormhole.rs +++ b/src/cli/wormhole.rs @@ -1617,7 +1617,6 @@ fn load_multiround_wallet( let m = generate_mnemonic(sensitive_entropy).map_err(|e| { crate::error::QuantusError::Generic(format!("Failed to generate mnemonic: {:?}", e)) })?; - log_verbose!("Generated mnemonic (not saved): {}", m); m }, }; @@ -2591,7 +2590,6 @@ fn run_multiround_dry_run( let address = sp_core::crypto::AccountId32::new(secret.address) .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); log_print!(" [{}] {}", i, address); - log_verbose!(" secret: 0x{}", hex::encode(secret.secret)); } log_print!(""); @@ -3338,9 +3336,8 @@ async fn run_check_nullifier( use colored::Colorize; // Get secret either directly or from wallet - let (secret, secret_hex_display) = if let Some(hex) = secret_hex { - let secret = parse_secret_hex(&hex).map_err(crate::error::QuantusError::Generic)?; - (secret, hex) + let secret = if let Some(hex) = secret_hex { + parse_secret_hex(&hex).map_err(crate::error::QuantusError::Generic)? } else if let Some(wallet) = wallet_name { // Load wallet and derive wormhole secret let wallet_manager = WalletManager::new()?; @@ -3362,9 +3359,8 @@ async fn run_check_nullifier( let secret: [u8; 32] = wormhole_pair.secret.as_ref().try_into().map_err(|_| { crate::error::QuantusError::Generic("Invalid secret length".to_string()) })?; - let hex = hex::encode(secret); log_print!("Derived wormhole secret from wallet '{}' (index {})", wallet, wormhole_index); - (secret, hex) + secret } else { return Err(crate::error::QuantusError::Generic( "Either --secret or --wallet must be provided".to_string(), @@ -3396,7 +3392,6 @@ async fn run_check_nullifier( }; log_print!("{}", "Checking Nullifiers".bright_cyan()); - log_print!(" Secret: 0x{}...", &secret_hex_display[..16.min(secret_hex_display.len())]); log_print!(" Transfer counts: {:?}", transfer_counts); log_print!(" Subsquid URL: {}", subsquid_url); log_print!(""); diff --git a/src/config/mod.rs b/src/config/mod.rs index 20b65a6..e8b2383 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -10,7 +10,7 @@ pub struct CompatibleRuntime { /// Supported runtime / transaction version pairs for the checked-in metadata snapshot. pub const COMPATIBLE_RUNTIMES: &[CompatibleRuntime] = - &[CompatibleRuntime { spec_version: 131, transaction_version: 2 }]; + &[CompatibleRuntime { spec_version: 134, transaction_version: 2 }]; /// Check if a runtime version pair is compatible with this CLI. pub fn is_runtime_compatible(spec_version: u32, transaction_version: u32) -> bool { diff --git a/src/log.rs b/src/log.rs index 2cccda6..976b32b 100644 --- a/src/log.rs +++ b/src/log.rs @@ -10,6 +10,11 @@ use std::sync::atomic::{AtomicBool, Ordering}; // Global verbose flag static VERBOSE: AtomicBool = AtomicBool::new(false); +// Global quiet flag: suppresses per-transaction chatter (progress prints, +// expected-failure error banners) while a higher-level reporter owns the +// output, e.g. `quantus exercise`. Verbose mode takes precedence over quiet. +static QUIET: AtomicBool = AtomicBool::new(false); + /// Set the verbose mode for the application pub fn set_verbose(verbose: bool) { VERBOSE.store(verbose, Ordering::Relaxed); @@ -20,6 +25,17 @@ pub fn is_verbose() -> bool { VERBOSE.load(Ordering::Relaxed) } +/// Set quiet mode: suppresses `log_print!`, `log_error!` and `log_success!` +/// output. `log_status!` and verbose logging are unaffected. +pub fn set_quiet(quiet: bool) { + QUIET.store(quiet, Ordering::Relaxed); +} + +/// Check if quiet mode is enabled +pub fn is_quiet() -> bool { + QUIET.load(Ordering::Relaxed) && !is_verbose() +} + /// Print formatted message only when verbose mode is enabled pub fn verboseln(args: std::fmt::Arguments) { if is_verbose() { @@ -29,17 +45,29 @@ pub fn verboseln(args: std::fmt::Arguments) { /// Print formatted message regardless of verbose mode (for important user output) pub fn println(args: std::fmt::Arguments) { + if !is_quiet() { + println!("{args}"); + } +} + +/// Print formatted message unconditionally, even in quiet mode. For +/// top-level status output owned by a reporter (e.g. exercise step results). +pub fn statusln(args: std::fmt::Arguments) { println!("{args}"); } /// Print formatted error message regardless of verbose mode pub fn errorln(args: std::fmt::Arguments) { - eprintln!("{} {}", "❌ Error:".red().bold(), args); + if !is_quiet() { + eprintln!("{} {}", "❌ Error:".red().bold(), args); + } } /// Print formatted success message regardless of verbose mode pub fn successln(args: std::fmt::Arguments) { - println!("{} {}", "βœ…".green(), args); + if !is_quiet() { + println!("{} {}", "βœ…".green(), args); + } } /// Print formatted info message in verbose mode @@ -74,6 +102,13 @@ macro_rules! log_error { }; } +#[macro_export] +macro_rules! log_status { + ($($arg:tt)*) => { + $crate::log::statusln(format_args!($($arg)*)) + }; +} + #[macro_export] macro_rules! log_success { ($($arg:tt)*) => { diff --git a/src/quantus_metadata.scale b/src/quantus_metadata.scale index 3a32112..2ab234b 100644 Binary files a/src/quantus_metadata.scale and b/src/quantus_metadata.scale differ