diff --git a/Cargo.lock b/Cargo.lock index e4635d9..c3a9f85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -880,9 +880,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] name = "cc" @@ -4001,6 +4001,7 @@ dependencies = [ "anyhow", "argon2", "blake3", + "bytes", "chrono", "clap", "colored", diff --git a/Cargo.toml b/Cargo.toml index e0c3842..7dfd9b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,6 +61,9 @@ qp-dilithium-crypto = { version = "0.2.0", features = ["serde"] } reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false } blake3 = "1.8" +# Force patched version of bytes (RUSTSEC-2026-0007) +bytes = "1.11.1" + # Blockchain and RPC client codec = { package = "parity-scale-codec", version = "3.7", features = [ "derive", diff --git a/src/chain/quantus_subxt.rs b/src/chain/quantus_subxt.rs index 05e2ec8..64fa891 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; 23usize] = [ + pub static PALLETS: [&str; 22usize] = [ "System", "Timestamp", "Balances", @@ -14,7 +14,6 @@ pub mod api { "Sudo", "QPoW", "MiningRewards", - "Vesting", "Preimage", "Scheduler", "Utility", @@ -23,12 +22,12 @@ pub mod api { "ConvictionVoting", "TechCollective", "TechReferenda", - "MerkleAirdrop", "TreasuryPallet", "Origins", "Recovery", "Assets", "AssetsHolder", + "Multisig", "Wormhole", ]; pub static RUNTIME_APIS: [&str; 11usize] = [ @@ -1471,9 +1470,10 @@ pub mod api { "query_call_info", types::QueryCallInfo { call, len }, [ - 144u8, 69u8, 76u8, 20u8, 225u8, 168u8, 95u8, 163u8, 136u8, 202u8, 72u8, - 27u8, 234u8, 2u8, 87u8, 1u8, 106u8, 223u8, 192u8, 30u8, 20u8, 233u8, - 167u8, 128u8, 112u8, 225u8, 153u8, 125u8, 248u8, 228u8, 53u8, 167u8, + 250u8, 181u8, 79u8, 69u8, 249u8, 197u8, 196u8, 8u8, 168u8, 127u8, + 210u8, 175u8, 103u8, 16u8, 174u8, 81u8, 30u8, 178u8, 138u8, 169u8, + 15u8, 210u8, 84u8, 187u8, 149u8, 1u8, 153u8, 79u8, 109u8, 176u8, 75u8, + 142u8, ], ) } @@ -1491,10 +1491,10 @@ pub mod api { "query_call_fee_details", types::QueryCallFeeDetails { call, len }, [ - 86u8, 238u8, 23u8, 213u8, 191u8, 145u8, 151u8, 110u8, 183u8, 238u8, - 148u8, 145u8, 134u8, 41u8, 240u8, 193u8, 187u8, 232u8, 19u8, 217u8, - 179u8, 188u8, 8u8, 191u8, 23u8, 18u8, 155u8, 52u8, 12u8, 169u8, 221u8, - 101u8, + 165u8, 10u8, 175u8, 229u8, 131u8, 61u8, 188u8, 169u8, 171u8, 236u8, + 15u8, 93u8, 33u8, 236u8, 188u8, 179u8, 84u8, 34u8, 34u8, 202u8, 173u8, + 166u8, 184u8, 72u8, 170u8, 64u8, 228u8, 233u8, 114u8, 200u8, 46u8, + 50u8, ], ) } @@ -1834,9 +1834,6 @@ pub mod api { pub fn mining_rewards(&self) -> mining_rewards::constants::ConstantsApi { mining_rewards::constants::ConstantsApi } - pub fn vesting(&self) -> vesting::constants::ConstantsApi { - vesting::constants::ConstantsApi - } pub fn scheduler(&self) -> scheduler::constants::ConstantsApi { scheduler::constants::ConstantsApi } @@ -1855,9 +1852,6 @@ pub mod api { pub fn tech_referenda(&self) -> tech_referenda::constants::ConstantsApi { tech_referenda::constants::ConstantsApi } - pub fn merkle_airdrop(&self) -> merkle_airdrop::constants::ConstantsApi { - merkle_airdrop::constants::ConstantsApi - } pub fn treasury_pallet(&self) -> treasury_pallet::constants::ConstantsApi { treasury_pallet::constants::ConstantsApi } @@ -1867,6 +1861,9 @@ pub mod api { pub fn assets(&self) -> assets::constants::ConstantsApi { assets::constants::ConstantsApi } + pub fn multisig(&self) -> multisig::constants::ConstantsApi { + multisig::constants::ConstantsApi + } pub fn wormhole(&self) -> wormhole::constants::ConstantsApi { wormhole::constants::ConstantsApi } @@ -1894,9 +1891,6 @@ pub mod api { pub fn mining_rewards(&self) -> mining_rewards::storage::StorageApi { mining_rewards::storage::StorageApi } - pub fn vesting(&self) -> vesting::storage::StorageApi { - vesting::storage::StorageApi - } pub fn preimage(&self) -> preimage::storage::StorageApi { preimage::storage::StorageApi } @@ -1918,9 +1912,6 @@ pub mod api { pub fn tech_referenda(&self) -> tech_referenda::storage::StorageApi { tech_referenda::storage::StorageApi } - pub fn merkle_airdrop(&self) -> merkle_airdrop::storage::StorageApi { - merkle_airdrop::storage::StorageApi - } pub fn treasury_pallet(&self) -> treasury_pallet::storage::StorageApi { treasury_pallet::storage::StorageApi } @@ -1933,6 +1924,9 @@ pub mod api { pub fn assets_holder(&self) -> assets_holder::storage::StorageApi { assets_holder::storage::StorageApi } + pub fn multisig(&self) -> multisig::storage::StorageApi { + multisig::storage::StorageApi + } pub fn wormhole(&self) -> wormhole::storage::StorageApi { wormhole::storage::StorageApi } @@ -1951,9 +1945,6 @@ pub mod api { pub fn sudo(&self) -> sudo::calls::TransactionApi { sudo::calls::TransactionApi } - pub fn vesting(&self) -> vesting::calls::TransactionApi { - vesting::calls::TransactionApi - } pub fn preimage(&self) -> preimage::calls::TransactionApi { preimage::calls::TransactionApi } @@ -1978,9 +1969,6 @@ pub mod api { pub fn tech_referenda(&self) -> tech_referenda::calls::TransactionApi { tech_referenda::calls::TransactionApi } - pub fn merkle_airdrop(&self) -> merkle_airdrop::calls::TransactionApi { - merkle_airdrop::calls::TransactionApi - } pub fn treasury_pallet(&self) -> treasury_pallet::calls::TransactionApi { treasury_pallet::calls::TransactionApi } @@ -1990,6 +1978,9 @@ pub mod api { pub fn assets(&self) -> assets::calls::TransactionApi { assets::calls::TransactionApi } + pub fn multisig(&self) -> multisig::calls::TransactionApi { + multisig::calls::TransactionApi + } pub fn wormhole(&self) -> wormhole::calls::TransactionApi { wormhole::calls::TransactionApi } @@ -2005,9 +1996,9 @@ pub mod api { .hash(); runtime_metadata_hash == [ - 188u8, 39u8, 127u8, 207u8, 32u8, 174u8, 40u8, 37u8, 8u8, 103u8, 134u8, 90u8, 25u8, - 13u8, 113u8, 231u8, 42u8, 35u8, 1u8, 219u8, 62u8, 142u8, 175u8, 90u8, 219u8, 204u8, - 82u8, 53u8, 187u8, 156u8, 226u8, 105u8, + 177u8, 66u8, 174u8, 27u8, 79u8, 228u8, 183u8, 89u8, 222u8, 162u8, 125u8, 17u8, + 90u8, 49u8, 152u8, 123u8, 131u8, 171u8, 166u8, 110u8, 79u8, 145u8, 199u8, 102u8, + 182u8, 33u8, 169u8, 66u8, 202u8, 150u8, 26u8, 128u8, ] } pub mod system { @@ -3106,10 +3097,9 @@ pub mod api { "Events", (), [ - 233u8, 203u8, 207u8, 158u8, 57u8, 161u8, 88u8, 160u8, 148u8, 0u8, - 176u8, 254u8, 251u8, 206u8, 46u8, 94u8, 178u8, 136u8, 154u8, 109u8, - 197u8, 147u8, 125u8, 17u8, 120u8, 246u8, 69u8, 50u8, 48u8, 172u8, 81u8, - 34u8, + 174u8, 35u8, 207u8, 216u8, 55u8, 49u8, 233u8, 105u8, 0u8, 227u8, 170u8, + 238u8, 94u8, 63u8, 33u8, 202u8, 193u8, 145u8, 123u8, 31u8, 174u8, 0u8, + 73u8, 157u8, 169u8, 193u8, 4u8, 38u8, 37u8, 73u8, 107u8, 227u8, ], ) } @@ -5389,10 +5379,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 168u8, 100u8, 48u8, 116u8, 163u8, 192u8, 242u8, 52u8, 119u8, 87u8, - 194u8, 233u8, 96u8, 99u8, 148u8, 199u8, 189u8, 152u8, 42u8, 69u8, - 195u8, 93u8, 2u8, 53u8, 139u8, 85u8, 19u8, 63u8, 251u8, 30u8, 244u8, - 30u8, + 13u8, 106u8, 188u8, 217u8, 128u8, 85u8, 178u8, 204u8, 154u8, 43u8, 7u8, + 229u8, 104u8, 115u8, 160u8, 200u8, 121u8, 209u8, 37u8, 2u8, 180u8, + 151u8, 26u8, 20u8, 35u8, 107u8, 3u8, 206u8, 218u8, 83u8, 42u8, 126u8, ], ) } @@ -5415,10 +5404,10 @@ pub mod api { weight, }, [ - 181u8, 252u8, 48u8, 252u8, 226u8, 4u8, 157u8, 205u8, 114u8, 223u8, - 86u8, 149u8, 228u8, 170u8, 164u8, 255u8, 152u8, 191u8, 239u8, 205u8, - 149u8, 126u8, 209u8, 188u8, 197u8, 250u8, 24u8, 208u8, 212u8, 168u8, - 66u8, 131u8, + 159u8, 52u8, 187u8, 160u8, 94u8, 11u8, 173u8, 224u8, 208u8, 187u8, + 69u8, 124u8, 172u8, 141u8, 23u8, 171u8, 156u8, 31u8, 62u8, 241u8, 41u8, + 143u8, 164u8, 88u8, 202u8, 14u8, 56u8, 203u8, 227u8, 146u8, 211u8, + 206u8, ], ) } @@ -5456,10 +5445,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 158u8, 186u8, 229u8, 16u8, 76u8, 224u8, 81u8, 198u8, 111u8, 234u8, - 112u8, 64u8, 248u8, 191u8, 138u8, 69u8, 111u8, 215u8, 204u8, 69u8, - 43u8, 60u8, 173u8, 141u8, 200u8, 113u8, 143u8, 75u8, 33u8, 84u8, 108u8, - 149u8, + 147u8, 92u8, 106u8, 226u8, 230u8, 190u8, 231u8, 120u8, 60u8, 7u8, 78u8, + 39u8, 18u8, 11u8, 73u8, 140u8, 77u8, 96u8, 34u8, 187u8, 66u8, 35u8, + 233u8, 191u8, 6u8, 238u8, 16u8, 8u8, 41u8, 74u8, 70u8, 20u8, ], ) } @@ -5987,15 +5975,31 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " The base block reward given to miners"] - pub fn miner_block_reward( + #[doc = " The maximum total supply of tokens"] + pub fn max_supply( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "MiningRewards", + "MaxSupply", + [ + 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 divisor used to calculate block rewards from remaining supply"] + pub fn emission_divisor( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "MiningRewards", - "MinerBlockReward", + "EmissionDivisor", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -6003,15 +6007,31 @@ pub mod api { ], ) } - #[doc = " The base block reward given to treasury"] - pub fn treasury_block_reward( + #[doc = " The portion of rewards that goes to treasury"] + pub fn treasury_portion( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "MiningRewards", + "TreasuryPortion", + [ + 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, + ], + ) + } + #[doc = " The base unit for token amounts (e.g., 1e12 for 12 decimals)"] + pub fn unit( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "MiningRewards", - "TreasuryBlockReward", + "Unit", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -6055,12 +6075,12 @@ pub mod api { } } } - pub mod vesting { + pub mod preimage { use super::{root_mod, runtime_types}; - #[doc = "Error for the vesting pallet."] - pub type Error = runtime_types::pallet_vesting::pallet::Error; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_preimage::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_vesting::pallet::Call; + pub type Call = runtime_types::pallet_preimage::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -6077,55 +6097,21 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Unlock any vested funds of the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct Vest; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vest { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "vest"; - } - #[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 = "Unlock any vested funds of a `target` account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = "Register a preimage on-chain."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct VestOther { - pub target: vest_other::Target, + #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] + #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] + pub struct NotePreimage { + pub bytes: note_preimage::Bytes, } - pub mod vest_other { + pub mod note_preimage { use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Bytes = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VestOther { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "vest_other"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NotePreimage { + const PALLET: &'static str = "Preimage"; + const CALL: &'static str = "note_preimage"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6138,37 +6124,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Create a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account receiving the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] + #[doc = "Clear an unrequested preimage from the runtime storage."] #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = "If `len` is provided, then it will be a much cheaper operation."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct VestedTransfer { - pub target: vested_transfer::Target, - pub schedule: vested_transfer::Schedule, + #[doc = "- `hash`: The hash of the preimage to be removed from the store."] + #[doc = "- `len`: The length of the preimage of `hash`."] + pub struct UnnotePreimage { + pub hash: unnote_preimage::Hash, } - pub mod vested_transfer { + pub mod unnote_preimage { use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Schedule = runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VestedTransfer { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "vested_transfer"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnnotePreimage { + const PALLET: &'static str = "Preimage"; + const CALL: &'static str = "unnote_preimage"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6181,43 +6152,20 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Force a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `source`: The account whose funds should be transferred."] - #[doc = "- `target`: The account that should be transferred the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub struct ForceVestedTransfer { - pub source: force_vested_transfer::Source, - pub target: force_vested_transfer::Target, - pub schedule: force_vested_transfer::Schedule, + #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] + #[doc = "a user may have paid, and take the control of the preimage out of their hands."] + pub struct RequestPreimage { + pub hash: request_preimage::Hash, } - pub mod force_vested_transfer { + pub mod request_preimage { use super::runtime_types; - pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Schedule = runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceVestedTransfer { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "force_vested_transfer"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestPreimage { + const PALLET: &'static str = "Preimage"; + const CALL: &'static str = "request_preimage"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6230,39 +6178,19 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] - #[doc = "the highest possible start and end blocks. If both schedules have already started the"] - #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] - #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] - #[doc = "unmodified."] - #[doc = ""] - #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] - #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] - #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] - #[doc = "and both will be removed."] - #[doc = ""] - #[doc = "Merged schedule attributes:"] - #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] - #[doc = " current_block)`."] - #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] - #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "Clear a previously made request for a preimage."] #[doc = ""] - #[doc = "- `schedule1_index`: index of the first schedule to merge."] - #[doc = "- `schedule2_index`: index of the second schedule to merge."] - pub struct MergeSchedules { - pub schedule1_index: merge_schedules::Schedule1Index, - pub schedule2_index: merge_schedules::Schedule2Index, + #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] + pub struct UnrequestPreimage { + pub hash: unrequest_preimage::Hash, } - pub mod merge_schedules { + pub mod unrequest_preimage { use super::runtime_types; - pub type Schedule1Index = ::core::primitive::u32; - pub type Schedule2Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for MergeSchedules { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "merge_schedules"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnrequestPreimage { + const PALLET: &'static str = "Preimage"; + const CALL: &'static str = "unrequest_preimage"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6275,210 +6203,131 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Force remove a vesting schedule"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "Ensure that the bulk of pre-images is upgraded."] #[doc = ""] - #[doc = "- `target`: An account that has a vesting schedule"] - #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] - pub struct ForceRemoveVestingSchedule { - pub target: force_remove_vesting_schedule::Target, - pub schedule_index: force_remove_vesting_schedule::ScheduleIndex, + #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] + pub struct EnsureUpdated { + pub hashes: ensure_updated::Hashes, } - pub mod force_remove_vesting_schedule { + pub mod ensure_updated { use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), + pub type Hashes = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::H256, >; - pub type ScheduleIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceRemoveVestingSchedule { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "force_remove_vesting_schedule"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for EnsureUpdated { + const PALLET: &'static str = "Preimage"; + const CALL: &'static str = "ensure_updated"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Unlock any vested funds of the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vest( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vest", - types::Vest {}, - [ - 149u8, 89u8, 178u8, 148u8, 127u8, 127u8, 155u8, 60u8, 114u8, 126u8, - 204u8, 123u8, 166u8, 70u8, 104u8, 208u8, 186u8, 69u8, 139u8, 181u8, - 151u8, 154u8, 235u8, 161u8, 191u8, 35u8, 111u8, 60u8, 21u8, 165u8, - 44u8, 122u8, - ], - ) - } - #[doc = "Unlock any vested funds of a `target` account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = "Register a preimage on-chain."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vest_other( + #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] + #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] + pub fn note_preimage( &self, - target: types::vest_other::Target, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + bytes: types::note_preimage::Bytes, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vest_other", - types::VestOther { target }, + "Preimage", + "note_preimage", + types::NotePreimage { bytes }, [ - 238u8, 92u8, 25u8, 149u8, 27u8, 211u8, 196u8, 31u8, 211u8, 28u8, 241u8, - 30u8, 128u8, 35u8, 0u8, 227u8, 202u8, 215u8, 186u8, 69u8, 216u8, 110u8, - 199u8, 120u8, 134u8, 141u8, 176u8, 224u8, 234u8, 42u8, 152u8, 128u8, + 121u8, 88u8, 18u8, 92u8, 176u8, 15u8, 192u8, 198u8, 146u8, 198u8, 38u8, + 242u8, 213u8, 83u8, 7u8, 230u8, 14u8, 110u8, 235u8, 32u8, 215u8, 26u8, + 192u8, 217u8, 113u8, 224u8, 206u8, 96u8, 177u8, 198u8, 246u8, 33u8, ], ) } - #[doc = "Create a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account receiving the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] + #[doc = "Clear an unrequested preimage from the runtime storage."] #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = "If `len` is provided, then it will be a much cheaper operation."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vested_transfer( + #[doc = "- `hash`: The hash of the preimage to be removed from the store."] + #[doc = "- `len`: The length of the preimage of `hash`."] + pub fn unnote_preimage( &self, - target: types::vested_transfer::Target, - schedule: types::vested_transfer::Schedule, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + hash: types::unnote_preimage::Hash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vested_transfer", - types::VestedTransfer { target, schedule }, + "Preimage", + "unnote_preimage", + types::UnnotePreimage { hash }, [ - 198u8, 133u8, 254u8, 5u8, 22u8, 170u8, 205u8, 79u8, 218u8, 30u8, 81u8, - 207u8, 227u8, 121u8, 132u8, 14u8, 217u8, 43u8, 66u8, 206u8, 15u8, 80u8, - 173u8, 208u8, 128u8, 72u8, 223u8, 175u8, 93u8, 69u8, 128u8, 88u8, + 188u8, 116u8, 222u8, 22u8, 127u8, 215u8, 2u8, 133u8, 96u8, 202u8, + 190u8, 123u8, 203u8, 43u8, 200u8, 161u8, 226u8, 24u8, 49u8, 36u8, + 221u8, 160u8, 130u8, 119u8, 30u8, 138u8, 144u8, 85u8, 5u8, 164u8, + 252u8, 222u8, ], ) } - #[doc = "Force a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `source`: The account whose funds should be transferred."] - #[doc = "- `target`: The account that should be transferred the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn force_vested_transfer( + #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] + #[doc = "a user may have paid, and take the control of the preimage out of their hands."] + pub fn request_preimage( &self, - source: types::force_vested_transfer::Source, - target: types::force_vested_transfer::Target, - schedule: types::force_vested_transfer::Schedule, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + hash: types::request_preimage::Hash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "force_vested_transfer", - types::ForceVestedTransfer { source, target, schedule }, + "Preimage", + "request_preimage", + types::RequestPreimage { hash }, [ - 112u8, 17u8, 176u8, 133u8, 169u8, 192u8, 155u8, 217u8, 153u8, 36u8, - 230u8, 45u8, 9u8, 192u8, 2u8, 201u8, 165u8, 60u8, 206u8, 226u8, 95u8, - 86u8, 239u8, 196u8, 109u8, 62u8, 224u8, 237u8, 88u8, 74u8, 209u8, - 251u8, + 87u8, 0u8, 204u8, 111u8, 43u8, 115u8, 64u8, 209u8, 133u8, 13u8, 83u8, + 45u8, 164u8, 166u8, 233u8, 105u8, 242u8, 238u8, 235u8, 208u8, 113u8, + 134u8, 93u8, 242u8, 86u8, 32u8, 7u8, 152u8, 107u8, 208u8, 79u8, 59u8, ], ) } - #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] - #[doc = "the highest possible start and end blocks. If both schedules have already started the"] - #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] - #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] - #[doc = "unmodified."] - #[doc = ""] - #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] - #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] - #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] - #[doc = "and both will be removed."] - #[doc = ""] - #[doc = "Merged schedule attributes:"] - #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] - #[doc = " current_block)`."] - #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] - #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "Clear a previously made request for a preimage."] #[doc = ""] - #[doc = "- `schedule1_index`: index of the first schedule to merge."] - #[doc = "- `schedule2_index`: index of the second schedule to merge."] - pub fn merge_schedules( + #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] + pub fn unrequest_preimage( &self, - schedule1_index: types::merge_schedules::Schedule1Index, - schedule2_index: types::merge_schedules::Schedule2Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + hash: types::unrequest_preimage::Hash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "merge_schedules", - types::MergeSchedules { schedule1_index, schedule2_index }, + "Preimage", + "unrequest_preimage", + types::UnrequestPreimage { hash }, [ - 45u8, 24u8, 13u8, 108u8, 26u8, 99u8, 61u8, 117u8, 195u8, 218u8, 182u8, - 23u8, 188u8, 157u8, 181u8, 81u8, 38u8, 136u8, 31u8, 226u8, 8u8, 190u8, - 33u8, 81u8, 86u8, 185u8, 156u8, 77u8, 157u8, 197u8, 41u8, 58u8, + 55u8, 37u8, 224u8, 149u8, 142u8, 120u8, 8u8, 68u8, 183u8, 225u8, 255u8, + 240u8, 254u8, 111u8, 58u8, 200u8, 113u8, 217u8, 177u8, 203u8, 107u8, + 104u8, 233u8, 87u8, 252u8, 53u8, 33u8, 112u8, 116u8, 254u8, 117u8, + 134u8, ], ) } - #[doc = "Force remove a vesting schedule"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "Ensure that the bulk of pre-images is upgraded."] #[doc = ""] - #[doc = "- `target`: An account that has a vesting schedule"] - #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] - pub fn force_remove_vesting_schedule( + #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] + pub fn ensure_updated( &self, - target: types::force_remove_vesting_schedule::Target, - schedule_index: types::force_remove_vesting_schedule::ScheduleIndex, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceRemoveVestingSchedule, - > { + hashes: types::ensure_updated::Hashes, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "force_remove_vesting_schedule", - types::ForceRemoveVestingSchedule { target, schedule_index }, + "Preimage", + "ensure_updated", + types::EnsureUpdated { hashes }, [ - 211u8, 253u8, 60u8, 15u8, 20u8, 53u8, 23u8, 13u8, 45u8, 223u8, 136u8, - 183u8, 162u8, 143u8, 196u8, 188u8, 35u8, 64u8, 174u8, 16u8, 47u8, 13u8, - 147u8, 173u8, 120u8, 143u8, 75u8, 89u8, 128u8, 187u8, 9u8, 18u8, + 254u8, 228u8, 88u8, 44u8, 126u8, 235u8, 188u8, 153u8, 61u8, 27u8, + 103u8, 253u8, 163u8, 161u8, 113u8, 243u8, 87u8, 136u8, 2u8, 231u8, + 209u8, 188u8, 215u8, 106u8, 192u8, 225u8, 75u8, 125u8, 224u8, 96u8, + 221u8, 90u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_vesting::pallet::Event; + pub type Event = runtime_types::pallet_preimage::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -6488,19 +6337,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 vesting schedule has been created."] - pub struct VestingCreated { - pub account: vesting_created::Account, - pub schedule_index: vesting_created::ScheduleIndex, + #[doc = "A preimage has been noted."] + pub struct Noted { + pub hash: noted::Hash, } - pub mod vesting_created { + pub mod noted { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type ScheduleIndex = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VestingCreated { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingCreated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Noted { + const PALLET: &'static str = "Preimage"; + const EVENT: &'static str = "Noted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6509,20 +6356,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 = "The amount vested has been updated. This could indicate a change in funds available."] - #[doc = "The balance given is the amount which is left unvested (and thus locked)."] - pub struct VestingUpdated { - pub account: vesting_updated::Account, - pub unvested: vesting_updated::Unvested, + #[doc = "A preimage has been requested."] + pub struct Requested { + pub hash: requested::Hash, } - pub mod vesting_updated { + pub mod requested { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Unvested = ::core::primitive::u128; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VestingUpdated { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingUpdated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Requested { + const PALLET: &'static str = "Preimage"; + const EVENT: &'static str = "Requested"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6531,157 +6375,199 @@ 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 become fully vested."] - pub struct VestingCompleted { - pub account: vesting_completed::Account, + #[doc = "A preimage has ben cleared."] + pub struct Cleared { + pub hash: cleared::Hash, } - pub mod vesting_completed { + pub mod cleared { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VestingCompleted { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingCompleted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Cleared { + const PALLET: &'static str = "Preimage"; + const EVENT: &'static str = "Cleared"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod vesting { + pub mod status_for { use super::runtime_types; - pub type Vesting = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, + pub type StatusFor = runtime_types::pallet_preimage::OldRequestStatus< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; } - pub mod storage_version { + pub mod request_status_for { + use super::runtime_types; + pub type RequestStatusFor = runtime_types::pallet_preimage::RequestStatus< + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::quantus_runtime::governance::definitions::PreimageDeposit, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + } + pub mod preimage_for { use super::runtime_types; - pub type StorageVersion = runtime_types::pallet_vesting::Releases; + pub type PreimageFor = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub type Param0 = + (::subxt::ext::subxt_core::utils::H256, ::core::primitive::u32); } } pub struct StorageApi; impl StorageApi { - #[doc = " Information regarding the vesting of a given account."] - pub fn vesting_iter( + #[doc = " The request status of a given hash."] + pub fn status_for_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::vesting::Vesting, + types::status_for::StatusFor, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Vesting", - "Vesting", + "Preimage", + "StatusFor", (), [ - 95u8, 168u8, 217u8, 248u8, 149u8, 86u8, 195u8, 93u8, 73u8, 206u8, - 105u8, 165u8, 33u8, 173u8, 232u8, 81u8, 147u8, 254u8, 50u8, 228u8, - 156u8, 92u8, 242u8, 149u8, 42u8, 91u8, 58u8, 209u8, 142u8, 221u8, - 230u8, 112u8, + 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, + 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, + 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, + 209u8, ], ) } - #[doc = " Information regarding the vesting of a given account."] - pub fn vesting( + #[doc = " The request status of a given hash."] + pub fn status_for( &self, - _0: types::vesting::Param0, + _0: types::status_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::vesting::Param0, + types::status_for::Param0, >, - types::vesting::Vesting, + types::status_for::StatusFor, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Vesting", - "Vesting", + "Preimage", + "StatusFor", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 95u8, 168u8, 217u8, 248u8, 149u8, 86u8, 195u8, 93u8, 73u8, 206u8, - 105u8, 165u8, 33u8, 173u8, 232u8, 81u8, 147u8, 254u8, 50u8, 228u8, - 156u8, 92u8, 242u8, 149u8, 42u8, 91u8, 58u8, 209u8, 142u8, 221u8, - 230u8, 112u8, + 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, + 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, + 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, + 209u8, ], ) } - #[doc = " Storage version of the pallet."] - #[doc = ""] - #[doc = " New networks start with latest version, as determined by the genesis build."] - pub fn storage_version( + #[doc = " The request status of a given hash."] + pub fn request_status_for_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::storage_version::StorageVersion, + types::request_status_for::RequestStatusFor, + (), + (), ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Preimage", + "RequestStatusFor", + (), + [ + 113u8, 195u8, 77u8, 23u8, 125u8, 170u8, 77u8, 145u8, 201u8, 168u8, + 39u8, 13u8, 143u8, 50u8, 100u8, 92u8, 25u8, 110u8, 125u8, 20u8, 96u8, + 156u8, 225u8, 200u8, 57u8, 199u8, 226u8, 242u8, 230u8, 126u8, 138u8, + 123u8, + ], + ) + } + #[doc = " The request status of a given hash."] + pub fn request_status_for( + &self, + _0: types::request_status_for::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::request_status_for::Param0, + >, + types::request_status_for::RequestStatusFor, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Vesting", - "StorageVersion", - (), + "Preimage", + "RequestStatusFor", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 230u8, 137u8, 180u8, 133u8, 142u8, 124u8, 231u8, 234u8, 223u8, 10u8, - 154u8, 98u8, 158u8, 253u8, 228u8, 80u8, 5u8, 9u8, 91u8, 210u8, 252u8, - 9u8, 13u8, 195u8, 193u8, 164u8, 129u8, 113u8, 128u8, 218u8, 8u8, 40u8, + 113u8, 195u8, 77u8, 23u8, 125u8, 170u8, 77u8, 145u8, 201u8, 168u8, + 39u8, 13u8, 143u8, 50u8, 100u8, 92u8, 25u8, 110u8, 125u8, 20u8, 96u8, + 156u8, 225u8, 200u8, 57u8, 199u8, 226u8, 242u8, 230u8, 126u8, 138u8, + 123u8, ], ) } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The minimum amount transferred to call `vested_transfer`."] - pub fn min_vested_transfer( + pub fn preimage_for_iter( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::preimage_for::PreimageFor, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Vesting", - "MinVestedTransfer", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Preimage", + "PreimageFor", + (), [ - 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, + 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, + 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, + 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, + 139u8, ], ) } - pub fn max_vesting_schedules( + pub fn preimage_for( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + _0: types::preimage_for::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::preimage_for::Param0, + >, + types::preimage_for::PreimageFor, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Vesting", - "MaxVestingSchedules", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Preimage", + "PreimageFor", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, + 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, + 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, + 139u8, ], ) } } } } - pub mod preimage { + pub mod scheduler { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_preimage::pallet::Error; + 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_preimage::pallet::Call; + 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; @@ -6698,21 +6584,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Register a preimage on-chain."] - #[doc = ""] - #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] - #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] - pub struct NotePreimage { - pub bytes: note_preimage::Bytes, + #[doc = "Anonymously schedule a task."] + pub struct Schedule { + pub when: schedule::When, + pub maybe_periodic: schedule::MaybePeriodic, + pub priority: schedule::Priority, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod note_preimage { + pub mod schedule { use super::runtime_types; - pub type Bytes = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type When = ::core::primitive::u32; + pub type MaybePeriodic = ::core::option::Option<( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::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 NotePreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "note_preimage"; + 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, @@ -6725,22 +6619,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Clear an unrequested preimage from the runtime storage."] - #[doc = ""] - #[doc = "If `len` is provided, then it will be a much cheaper operation."] - #[doc = ""] - #[doc = "- `hash`: The hash of the preimage to be removed from the store."] - #[doc = "- `len`: The length of the preimage of `hash`."] - pub struct UnnotePreimage { - pub hash: unnote_preimage::Hash, + #[doc = "Cancel an anonymously scheduled task."] + pub struct Cancel { + pub when: cancel::When, + pub index: cancel::Index, } - pub mod unnote_preimage { + pub mod cancel { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + 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::blocks::StaticExtrinsic for UnnotePreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "unnote_preimage"; + 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, @@ -6753,22 +6647,33 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub struct RequestPreimage { - pub hash: request_preimage::Hash, + #[doc = "Schedule a named task."] + pub struct ScheduleNamed { + pub id: schedule_named::Id, + pub when: schedule_named::When, + pub maybe_periodic: schedule_named::MaybePeriodic, + pub priority: schedule_named::Priority, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod request_preimage { + pub mod schedule_named { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestPreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "request_preimage"; + pub type Id = [::core::primitive::u8; 32usize]; + pub type When = ::core::primitive::u32; + pub type MaybePeriodic = ::core::option::Option<( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + )>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - #[derive( + 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, @@ -6779,19 +6684,17 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - pub struct UnrequestPreimage { - pub hash: unrequest_preimage::Hash, + #[doc = "Cancel a named scheduled task."] + pub struct CancelNamed { + pub id: cancel_named::Id, } - pub mod unrequest_preimage { + pub mod cancel_named { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Id = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnrequestPreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "unrequest_preimage"; + 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, @@ -6804,1562 +6707,1205 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Ensure that the bulk of pre-images is upgraded."] - #[doc = ""] - #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub struct EnsureUpdated { - pub hashes: ensure_updated::Hashes, + #[doc = "Anonymously schedule a task after a delay."] + pub struct ScheduleAfter { + pub after: schedule_after::After, + pub maybe_periodic: schedule_after::MaybePeriodic, + pub priority: schedule_after::Priority, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod ensure_updated { + pub mod schedule_after { use super::runtime_types; - pub type Hashes = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::H256, + pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, >; + pub type MaybePeriodic = ::core::option::Option<( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::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 EnsureUpdated { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "ensure_updated"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAfter { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "schedule_after"; } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Register a preimage on-chain."] - #[doc = ""] - #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] - #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] - pub fn note_preimage( - &self, - bytes: types::note_preimage::Bytes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "note_preimage", - types::NotePreimage { bytes }, - [ - 121u8, 88u8, 18u8, 92u8, 176u8, 15u8, 192u8, 198u8, 146u8, 198u8, 38u8, - 242u8, 213u8, 83u8, 7u8, 230u8, 14u8, 110u8, 235u8, 32u8, 215u8, 26u8, - 192u8, 217u8, 113u8, 224u8, 206u8, 96u8, 177u8, 198u8, 246u8, 33u8, - ], - ) + #[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 = "Schedule a named task after a delay."] + pub struct ScheduleNamedAfter { + pub id: schedule_named_after::Id, + pub after: schedule_named_after::After, + pub maybe_periodic: schedule_named_after::MaybePeriodic, + pub priority: schedule_named_after::Priority, + pub call: + ::subxt::ext::subxt_core::alloc::boxed::Box, } - #[doc = "Clear an unrequested preimage from the runtime storage."] + 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, + ::core::primitive::u64, + >; + pub type MaybePeriodic = ::core::option::Option<( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::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 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 = "If `len` is provided, then it will be a much cheaper operation."] + #[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. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] #[doc = ""] - #[doc = "- `hash`: The hash of the preimage to be removed from the store."] - #[doc = "- `len`: The length of the preimage of `hash`."] - pub fn unnote_preimage( - &self, - hash: types::unnote_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "unnote_preimage", - types::UnnotePreimage { hash }, - [ - 188u8, 116u8, 222u8, 22u8, 127u8, 215u8, 2u8, 133u8, 96u8, 202u8, - 190u8, 123u8, 203u8, 43u8, 200u8, 161u8, 226u8, 24u8, 49u8, 36u8, - 221u8, 160u8, 130u8, 119u8, 30u8, 138u8, 144u8, 85u8, 5u8, 164u8, - 252u8, 222u8, - ], - ) + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[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`."] + pub struct SetRetry { + pub task: set_retry::Task, + pub retries: set_retry::Retries, + pub period: set_retry::Period, } - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub fn request_preimage( - &self, - hash: types::request_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "request_preimage", - types::RequestPreimage { hash }, - [ - 87u8, 0u8, 204u8, 111u8, 43u8, 115u8, 64u8, 209u8, 133u8, 13u8, 83u8, - 45u8, 164u8, 166u8, 233u8, 105u8, 242u8, 238u8, 235u8, 208u8, 113u8, - 134u8, 93u8, 242u8, 86u8, 32u8, 7u8, 152u8, 107u8, 208u8, 79u8, 59u8, - ], - ) + 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, + >; } - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - pub fn unrequest_preimage( - &self, - hash: types::unrequest_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "unrequest_preimage", - types::UnrequestPreimage { hash }, - [ - 55u8, 37u8, 224u8, 149u8, 142u8, 120u8, 8u8, 68u8, 183u8, 225u8, 255u8, - 240u8, 254u8, 111u8, 58u8, 200u8, 113u8, 217u8, 177u8, 203u8, 107u8, - 104u8, 233u8, 87u8, 252u8, 53u8, 33u8, 112u8, 116u8, 254u8, 117u8, - 134u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "set_retry"; } - #[doc = "Ensure that the bulk of pre-images is upgraded."] + #[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 = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub fn ensure_updated( - &self, - hashes: types::ensure_updated::Hashes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "ensure_updated", - types::EnsureUpdated { hashes }, - [ - 254u8, 228u8, 88u8, 44u8, 126u8, 235u8, 188u8, 153u8, 61u8, 27u8, - 103u8, 253u8, 163u8, 161u8, 113u8, 243u8, 87u8, 136u8, 2u8, 231u8, - 209u8, 188u8, 215u8, 106u8, 192u8, 225u8, 75u8, 125u8, 224u8, 96u8, - 221u8, 90u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_preimage::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 preimage has been noted."] - pub struct Noted { - pub hash: noted::Hash, - } - pub mod noted { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Noted { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Noted"; - } - #[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 preimage has been requested."] - pub struct Requested { - pub hash: requested::Hash, - } - pub mod requested { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Requested { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Requested"; - } - #[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 preimage has ben cleared."] - pub struct Cleared { - pub hash: cleared::Hash, - } - pub mod cleared { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cleared { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Cleared"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod status_for { + #[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. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[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`."] + 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 StatusFor = runtime_types::pallet_preimage::OldRequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, + 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, >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; } - pub mod request_status_for { + 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 RequestStatusFor = runtime_types::pallet_preimage::RequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::quantus_runtime::governance::definitions::PreimageDeposit, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); } - pub mod preimage_for { + 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 PreimageFor = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = - (::subxt::ext::subxt_core::utils::H256, ::core::primitive::u32); + 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"; } } - pub struct StorageApi; - impl StorageApi { - #[doc = " The request status of a given hash."] - pub fn status_for_iter( + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Anonymously schedule a task."] + pub fn schedule( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::status_for::StatusFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "StatusFor", - (), + when: types::schedule::When, + maybe_periodic: types::schedule::MaybePeriodic, + 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, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, - 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, - 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, + 191u8, 229u8, 248u8, 28u8, 11u8, 18u8, 203u8, 70u8, 140u8, 195u8, + 148u8, 253u8, 106u8, 18u8, 75u8, 66u8, 59u8, 171u8, 5u8, 137u8, 253u8, + 245u8, 192u8, 92u8, 29u8, 127u8, 184u8, 162u8, 19u8, 85u8, 250u8, 209u8, ], ) } - #[doc = " The request status of a given hash."] - pub fn status_for( + #[doc = "Cancel an anonymously scheduled task."] + pub fn cancel( &self, - _0: types::status_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::status_for::Param0, - >, - types::status_for::StatusFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "StatusFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + 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 }, [ - 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, - 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, - 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, - 209u8, + 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, ], ) } - #[doc = " The request status of a given hash."] - pub fn request_status_for_iter( + #[doc = "Schedule a named task."] + pub fn schedule_named( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::request_status_for::RequestStatusFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", - (), + id: types::schedule_named::Id, + when: types::schedule_named::When, + maybe_periodic: types::schedule_named::MaybePeriodic, + 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, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 113u8, 195u8, 77u8, 23u8, 125u8, 170u8, 77u8, 145u8, 201u8, 168u8, - 39u8, 13u8, 143u8, 50u8, 100u8, 92u8, 25u8, 110u8, 125u8, 20u8, 96u8, - 156u8, 225u8, 200u8, 57u8, 199u8, 226u8, 242u8, 230u8, 126u8, 138u8, - 123u8, + 68u8, 70u8, 175u8, 198u8, 252u8, 36u8, 50u8, 142u8, 175u8, 122u8, + 246u8, 206u8, 72u8, 170u8, 126u8, 170u8, 61u8, 65u8, 90u8, 21u8, 109u8, + 162u8, 210u8, 92u8, 132u8, 83u8, 168u8, 35u8, 254u8, 206u8, 58u8, + 223u8, ], ) } - #[doc = " The request status of a given hash."] - pub fn request_status_for( + #[doc = "Cancel a named scheduled task."] + pub fn cancel_named( &self, - _0: types::request_status_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::request_status_for::Param0, - >, - types::request_status_for::RequestStatusFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + 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 }, [ - 113u8, 195u8, 77u8, 23u8, 125u8, 170u8, 77u8, 145u8, 201u8, 168u8, - 39u8, 13u8, 143u8, 50u8, 100u8, 92u8, 25u8, 110u8, 125u8, 20u8, 96u8, - 156u8, 225u8, 200u8, 57u8, 199u8, 226u8, 242u8, 230u8, 126u8, 138u8, - 123u8, + 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 preimage_for_iter( + #[doc = "Anonymously schedule a task after a delay."] + pub fn schedule_after( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::preimage_for::PreimageFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", - (), + after: types::schedule_after::After, + maybe_periodic: types::schedule_after::MaybePeriodic, + 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, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, - 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, - 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, - 139u8, + 47u8, 186u8, 65u8, 172u8, 93u8, 228u8, 73u8, 229u8, 119u8, 42u8, 132u8, + 251u8, 125u8, 177u8, 249u8, 193u8, 3u8, 197u8, 140u8, 107u8, 128u8, + 194u8, 194u8, 246u8, 85u8, 102u8, 219u8, 26u8, 218u8, 161u8, 254u8, + 50u8, ], ) } - pub fn preimage_for( + #[doc = "Schedule a named task after a delay."] + pub fn schedule_named_after( &self, - _0: types::preimage_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::preimage_for::Param0, - >, - types::preimage_for::PreimageFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + id: types::schedule_named_after::Id, + after: types::schedule_named_after::After, + maybe_periodic: types::schedule_named_after::MaybePeriodic, + 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, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, - 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, - 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, - 139u8, + 156u8, 38u8, 51u8, 6u8, 248u8, 180u8, 212u8, 22u8, 238u8, 52u8, 244u8, + 139u8, 49u8, 1u8, 30u8, 92u8, 218u8, 100u8, 104u8, 68u8, 159u8, 165u8, + 167u8, 252u8, 173u8, 213u8, 238u8, 145u8, 28u8, 205u8, 181u8, 114u8, ], ) } - } - } - } - pub mod scheduler { - 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 { - 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 = "Anonymously schedule a task."] - pub struct Schedule { - pub when: schedule::When, - pub maybe_periodic: schedule::MaybePeriodic, - pub priority: schedule::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[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. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[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`."] + 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, + ], + ) } - pub mod schedule { - use super::runtime_types; - pub type When = ::core::primitive::u32; - pub type MaybePeriodic = ::core::option::Option<( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - )>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + #[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. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[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`."] + 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, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Schedule { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule"; + #[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, + ], + ) } - #[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, + #[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, + ], + ) } - pub mod cancel { - use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, + } + } + #[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; + 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" - )] - #[doc = "Schedule a named task."] - pub struct ScheduleNamed { - pub id: schedule_named::Id, - pub when: schedule_named::When, - pub maybe_periodic: schedule_named::MaybePeriodic, - 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 MaybePeriodic = ::core::option::Option<( - 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 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, - )>; - 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" - )] - #[doc = "Anonymously schedule a task after a delay."] - pub struct ScheduleAfter { - pub after: schedule_after::After, - pub maybe_periodic: schedule_after::MaybePeriodic, - 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::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, - >; - pub type MaybePeriodic = ::core::option::Option<( - 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, - )>; - 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"; + ::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 renewed since the agenda is full at that block."] + pub struct PeriodicFailed { + pub task: periodic_failed::Task, + pub id: periodic_failed::Id, + } + pub mod periodic_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 PeriodicFailed { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "PeriodicFailed"; + } + #[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"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod incomplete_block_since { + use super::runtime_types; + pub type IncompleteBlockSince = ::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 = "Schedule a named task after a delay."] - pub struct ScheduleNamedAfter { - pub id: schedule_named_after::Id, - pub after: schedule_named_after::After, - pub maybe_periodic: schedule_named_after::MaybePeriodic, - pub priority: schedule_named_after::Priority, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, + pub mod incomplete_timestamp_since { + use super::runtime_types; + pub type IncompleteTimestampSince = ::core::primitive::u64; } - pub mod schedule_named_after { + pub mod last_processed_timestamp { use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + pub type LastProcessedTimestamp = ::core::primitive::u64; + } + pub mod agenda { + use super::runtime_types; + pub type Agenda = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_scheduler::Scheduled< + [::core::primitive::u8; 32usize], + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >, + ::core::primitive::u32, + runtime_types::quantus_runtime::OriginCaller, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u64, + >, + >, + >; + pub type Param0 = runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, >; - pub type MaybePeriodic = ::core::option::Option<( + } + pub mod retries { + use super::runtime_types; + pub type Retries = runtime_types::pallet_scheduler::RetryConfig< + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + >; + pub type Param0 = ( runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, >, ::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 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. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[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`."] - pub struct SetRetry { - pub task: set_retry::Task, - pub retries: set_retry::Retries, - pub period: set_retry::Period, + ); } - pub mod set_retry { + pub mod lookup { use super::runtime_types; - pub type Task = ( + pub type Lookup = ( 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, - >; + pub type Param0 = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry"; + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Tracks incomplete block-based agendas that need to be processed in a later block."] + pub fn incomplete_block_since( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::incomplete_block_since::IncompleteBlockSince, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Scheduler", + "IncompleteBlockSince", + (), + [ + 134u8, 34u8, 161u8, 236u8, 176u8, 35u8, 218u8, 109u8, 229u8, 93u8, + 29u8, 95u8, 81u8, 106u8, 98u8, 65u8, 132u8, 91u8, 237u8, 225u8, 75u8, + 125u8, 81u8, 218u8, 72u8, 215u8, 20u8, 66u8, 160u8, 196u8, 68u8, 34u8, + ], + ) } - #[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. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[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`."] - 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"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Anonymously schedule a task."] - pub fn schedule( + #[doc = " Tracks incomplete timestamp-based agendas that need to be processed in a later block."] + pub fn incomplete_timestamp_since( &self, - when: types::schedule::When, - maybe_periodic: types::schedule::MaybePeriodic, - priority: types::schedule::Priority, - call: types::schedule::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::incomplete_timestamp_since::IncompleteTimestampSince, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "schedule", - types::Schedule { - when, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "IncompleteTimestampSince", + (), [ - 98u8, 56u8, 162u8, 148u8, 112u8, 249u8, 195u8, 138u8, 14u8, 208u8, - 216u8, 29u8, 136u8, 77u8, 22u8, 170u8, 181u8, 92u8, 215u8, 105u8, - 123u8, 64u8, 0u8, 48u8, 135u8, 65u8, 103u8, 121u8, 222u8, 161u8, 220u8, - 252u8, + 223u8, 125u8, 99u8, 28u8, 81u8, 135u8, 125u8, 26u8, 3u8, 20u8, 32u8, + 125u8, 141u8, 114u8, 100u8, 38u8, 219u8, 191u8, 30u8, 88u8, 82u8, 33u8, + 140u8, 223u8, 168u8, 84u8, 144u8, 85u8, 57u8, 241u8, 97u8, 141u8, ], ) } - #[doc = "Cancel an anonymously scheduled task."] - pub fn cancel( + #[doc = " Tracks the last timestamp bucket that was fully processed."] + #[doc = " Used to avoid reprocessing all buckets from 0 on every run."] + pub fn last_processed_timestamp( &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( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::last_processed_timestamp::LastProcessedTimestamp, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "cancel", - types::Cancel { when, index }, + "LastProcessedTimestamp", + (), [ - 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, + 172u8, 193u8, 6u8, 47u8, 185u8, 134u8, 179u8, 132u8, 178u8, 0u8, 228u8, + 198u8, 232u8, 24u8, 85u8, 199u8, 102u8, 222u8, 246u8, 178u8, 8u8, + 221u8, 51u8, 188u8, 239u8, 218u8, 112u8, 245u8, 46u8, 146u8, 65u8, + 119u8, ], ) } - #[doc = "Schedule a named task."] - pub fn schedule_named( + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] + pub fn agenda_iter( &self, - id: types::schedule_named::Id, - when: types::schedule_named::When, - maybe_periodic: types::schedule_named::MaybePeriodic, - 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( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::agenda::Agenda, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "schedule_named", - types::ScheduleNamed { - id, - when, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Agenda", + (), [ - 199u8, 176u8, 11u8, 253u8, 206u8, 181u8, 22u8, 109u8, 121u8, 2u8, - 189u8, 149u8, 188u8, 210u8, 81u8, 219u8, 147u8, 140u8, 252u8, 149u8, - 128u8, 248u8, 171u8, 106u8, 7u8, 152u8, 32u8, 65u8, 61u8, 121u8, 175u8, - 153u8, + 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, + 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, + 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, ], ) } - #[doc = "Cancel a named scheduled task."] - pub fn cancel_named( + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] + pub fn agenda( &self, - id: types::cancel_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::agenda::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::agenda::Param0, + >, + types::agenda::Agenda, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "cancel_named", - types::CancelNamed { id }, + "Agenda", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, + 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, + 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, ], ) } - #[doc = "Anonymously schedule a task after a delay."] - pub fn schedule_after( + #[doc = " Retry configurations for items to be executed, indexed by task address."] + pub fn retries_iter( &self, - after: types::schedule_after::After, - maybe_periodic: types::schedule_after::MaybePeriodic, - 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( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::retries::Retries, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "schedule_after", - types::ScheduleAfter { - after, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Retries", + (), [ - 241u8, 149u8, 155u8, 185u8, 58u8, 107u8, 11u8, 188u8, 177u8, 36u8, - 106u8, 40u8, 178u8, 137u8, 85u8, 190u8, 46u8, 56u8, 244u8, 20u8, 150u8, - 238u8, 73u8, 111u8, 151u8, 150u8, 2u8, 133u8, 218u8, 189u8, 95u8, - 109u8, + 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, + 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, + 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, + 108u8, ], ) } - #[doc = "Schedule a named task after a delay."] - pub fn schedule_named_after( + #[doc = " Retry configurations for items to be executed, indexed by task address."] + pub fn retries( &self, - id: types::schedule_named_after::Id, - after: types::schedule_named_after::After, - maybe_periodic: types::schedule_named_after::MaybePeriodic, - 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( + _0: types::retries::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::retries::Param0, + >, + types::retries::Retries, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "schedule_named_after", - types::ScheduleNamedAfter { - id, - after, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Retries", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 130u8, 87u8, 248u8, 189u8, 84u8, 139u8, 26u8, 139u8, 35u8, 18u8, 102u8, - 95u8, 127u8, 218u8, 144u8, 149u8, 65u8, 134u8, 86u8, 98u8, 195u8, - 192u8, 79u8, 154u8, 7u8, 232u8, 76u8, 179u8, 255u8, 188u8, 29u8, 191u8, - ], - ) + 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, + 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, + 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, + 108u8, + ], + ) } - #[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. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] + #[doc = " Lookup from a name to the block number and index of the task."] #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[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`."] - pub fn set_retry( + #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] + #[doc = " identities."] + pub fn lookup_iter( &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( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::lookup::Lookup, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "set_retry", - types::SetRetry { task, retries, period }, + "Lookup", + (), [ - 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, + 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, + 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, + 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, ], ) } - #[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. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] + #[doc = " Lookup from a name to the block number and index of the task."] #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[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`."] - pub fn set_retry_named( + #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] + #[doc = " identities."] + pub fn lookup( &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( + _0: types::lookup::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::lookup::Param0, + >, + types::lookup::Lookup, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "set_retry_named", - types::SetRetryNamed { id, retries, period }, + "Lookup", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, + 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, + 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, ], ) } - #[doc = "Removes the retry configuration of a task."] - pub fn cancel_retry( + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The maximum weight that may be scheduled per block for any dispatchables."] + pub fn maximum_weight( &self, - task: types::cancel_retry::Task, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_weights::weight_v2::Weight, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "Scheduler", - "cancel_retry", - types::CancelRetry { task }, + "MaximumWeight", [ - 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, + 149u8, 252u8, 129u8, 80u8, 169u8, 36u8, 79u8, 127u8, 240u8, 156u8, + 56u8, 202u8, 219u8, 86u8, 5u8, 65u8, 245u8, 148u8, 138u8, 243u8, 210u8, + 128u8, 234u8, 216u8, 240u8, 219u8, 123u8, 235u8, 21u8, 158u8, 237u8, + 112u8, ], ) } - #[doc = "Cancel the retry configuration of a named task."] - pub fn cancel_retry_named( + #[doc = " The maximum number of scheduled calls in the queue for a single block."] + #[doc = ""] + #[doc = " NOTE:"] + #[doc = " + Dependent pallets' benchmarks might require a higher limit for the setting. Set a"] + #[doc = " higher limit under `runtime-benchmarks` feature."] + pub fn max_scheduled_per_block( &self, - id: types::cancel_retry_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "Scheduler", - "cancel_retry_named", - types::CancelRetryNamed { id }, + "MaxScheduledPerBlock", [ - 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, + 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 = "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; - 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, + #[doc = " Precision of the timestamp buckets."] + #[doc = ""] + #[doc = " Timestamp based dispatches are rounded to the nearest bucket of this precision."] + pub fn timestamp_bucket_size( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::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, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Scheduler", + "TimestampBucketSize", + [ + 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, + ], + ) + } } - pub mod dispatched { + } + } + pub mod utility { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_utility::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_utility::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; - 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 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, - >, - ::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 renewed since the agenda is full at that block."] - pub struct PeriodicFailed { - pub task: periodic_failed::Task, - pub id: periodic_failed::Id, - } - pub mod periodic_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 PeriodicFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "PeriodicFailed"; - } - #[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"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod incomplete_block_since { - use super::runtime_types; - pub type IncompleteBlockSince = ::core::primitive::u32; - } - pub mod incomplete_timestamp_since { - use super::runtime_types; - pub type IncompleteTimestampSince = ::core::primitive::u64; - } - pub mod last_processed_timestamp { - use super::runtime_types; - pub type LastProcessedTimestamp = ::core::primitive::u64; + #[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 = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub struct Batch { + pub calls: batch::Calls, } - pub mod agenda { + pub mod batch { use super::runtime_types; - pub type Agenda = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::option::Option< - runtime_types::pallet_scheduler::Scheduled< - [::core::primitive::u8; 32usize], - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >, - ::core::primitive::u32, - runtime_types::quantus_runtime::OriginCaller, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u64, - >, - >, - >; - pub type Param0 = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, + pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, >; } - pub mod retries { - use super::runtime_types; - pub type Retries = runtime_types::pallet_scheduler::RetryConfig< - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - >; - pub type Param0 = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch"; } - pub mod lookup { - use super::runtime_types; - pub type Lookup = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Param0 = [::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 = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct AsDerivative { + pub index: as_derivative::Index, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " Tracks incomplete block-based agendas that need to be processed in a later block."] - pub fn incomplete_block_since( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::incomplete_block_since::IncompleteBlockSince, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "IncompleteBlockSince", - (), - [ - 134u8, 34u8, 161u8, 236u8, 176u8, 35u8, 218u8, 109u8, 229u8, 93u8, - 29u8, 95u8, 81u8, 106u8, 98u8, 65u8, 132u8, 91u8, 237u8, 225u8, 75u8, - 125u8, 81u8, 218u8, 72u8, 215u8, 20u8, 66u8, 160u8, 196u8, 68u8, 34u8, - ], - ) + pub mod as_derivative { + use super::runtime_types; + pub type Index = ::core::primitive::u16; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - #[doc = " Tracks incomplete timestamp-based agendas that need to be processed in a later block."] - pub fn incomplete_timestamp_since( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::incomplete_timestamp_since::IncompleteTimestampSince, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "IncompleteTimestampSince", - (), - [ - 223u8, 125u8, 99u8, 28u8, 81u8, 135u8, 125u8, 26u8, 3u8, 20u8, 32u8, - 125u8, 141u8, 114u8, 100u8, 38u8, 219u8, 191u8, 30u8, 88u8, 82u8, 33u8, - 140u8, 223u8, 168u8, 84u8, 144u8, 85u8, 57u8, 241u8, 97u8, 141u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsDerivative { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "as_derivative"; } - #[doc = " Tracks the last timestamp bucket that was fully processed."] - #[doc = " Used to avoid reprocessing all buckets from 0 on every run."] - pub fn last_processed_timestamp( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::last_processed_timestamp::LastProcessedTimestamp, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "LastProcessedTimestamp", - (), - [ - 172u8, 193u8, 6u8, 47u8, 185u8, 134u8, 179u8, 132u8, 178u8, 0u8, 228u8, - 198u8, 232u8, 24u8, 85u8, 199u8, 102u8, 222u8, 246u8, 178u8, 8u8, - 221u8, 51u8, 188u8, 239u8, 218u8, 112u8, 245u8, 46u8, 146u8, 65u8, - 119u8, - ], - ) + #[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 = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub struct BatchAll { + pub calls: batch_all::Calls, } - #[doc = " Items to be executed, indexed by the block number that they should be executed on."] - pub fn agenda_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::agenda::Agenda, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Agenda", - (), - [ - 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, - 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, - 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, - ], - ) + pub mod batch_all { + use super::runtime_types; + pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, + >; } - #[doc = " Items to be executed, indexed by the block number that they should be executed on."] - pub fn agenda( - &self, - _0: types::agenda::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::agenda::Param0, - >, - types::agenda::Agenda, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Agenda", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, - 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, - 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BatchAll { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch_all"; } - #[doc = " Retry configurations for items to be executed, indexed by task address."] - pub fn retries_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::retries::Retries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Retries", - (), - [ - 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, - 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, - 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, - 108u8, - ], - ) + #[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 = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct DispatchAs { + pub as_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - #[doc = " Retry configurations for items to be executed, indexed by task address."] - pub fn retries( - &self, - _0: types::retries::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::retries::Param0, - >, - types::retries::Retries, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Retries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, - 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, - 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, - 108u8, - ], - ) + pub mod dispatch_as { + use super::runtime_types; + pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - #[doc = " Lookup from a name to the block number and index of the task."] - #[doc = ""] - #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] - #[doc = " identities."] - pub fn lookup_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::lookup::Lookup, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Lookup", - (), - [ - 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, - 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, - 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, - ], - ) - } - #[doc = " Lookup from a name to the block number and index of the task."] - #[doc = ""] - #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] - #[doc = " identities."] - pub fn lookup( - &self, - _0: types::lookup::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::lookup::Param0, - >, - types::lookup::Lookup, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Lookup", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, - 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, - 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The maximum weight that may be scheduled per block for any dispatchables."] - pub fn maximum_weight( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_weights::weight_v2::Weight, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "MaximumWeight", - [ - 149u8, 252u8, 129u8, 80u8, 169u8, 36u8, 79u8, 127u8, 240u8, 156u8, - 56u8, 202u8, 219u8, 86u8, 5u8, 65u8, 245u8, 148u8, 138u8, 243u8, 210u8, - 128u8, 234u8, 216u8, 240u8, 219u8, 123u8, 235u8, 21u8, 158u8, 237u8, - 112u8, - ], - ) - } - #[doc = " The maximum number of scheduled calls in the queue for a single block."] - #[doc = ""] - #[doc = " NOTE:"] - #[doc = " + Dependent pallets' benchmarks might require a higher limit for the setting. Set a"] - #[doc = " higher limit under `runtime-benchmarks` feature."] - pub fn max_scheduled_per_block( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "MaxScheduledPerBlock", - [ - 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 = " Precision of the timestamp buckets."] - #[doc = ""] - #[doc = " Timestamp based dispatches are rounded to the nearest bucket of this precision."] - pub fn timestamp_bucket_size( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "TimestampBucketSize", - [ - 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, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAs { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "dispatch_as"; } - } - } - } - pub mod utility { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_utility::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_utility::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, @@ -8372,35 +7918,30 @@ pub mod api { crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] #[doc = ""] #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "## Complexity"] #[doc = "- O(C) where C is the number of calls to be batched."] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - pub struct Batch { - pub calls: batch::Calls, + pub struct ForceBatch { + pub calls: force_batch::Calls, } - pub mod batch { + pub mod force_batch { use super::runtime_types; pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< runtime_types::quantus_runtime::RuntimeCall, >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceBatch { const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch"; + const CALL: &'static str = "force_batch"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8413,31 +7954,24 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a call through an indexed pseudonym of the sender."] - #[doc = ""] - #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] - #[doc = "use the same filter as the origin of this call."] - #[doc = ""] - #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] - #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] - #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] - #[doc = "in the Multisig pallet instead."] + #[doc = "Dispatch a function call with a specified weight."] #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub struct AsDerivative { - pub index: as_derivative::Index, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct WithWeight { + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + pub weight: with_weight::Weight, } - pub mod as_derivative { + pub mod with_weight { use super::runtime_types; - pub type Index = ::core::primitive::u16; pub type Call = runtime_types::quantus_runtime::RuntimeCall; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsDerivative { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for WithWeight { const PALLET: &'static str = "Utility"; - const CALL: &'static str = "as_derivative"; + const CALL: &'static str = "with_weight"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8450,31 +7984,41 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] + #[doc = "Dispatch a fallback call in the event the main call fails to execute."] #[doc = "May be called from any origin except `None`."] #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = "This function first attempts to dispatch the `main` call."] + #[doc = "If the `main` call fails, the `fallback` is attemted."] + #[doc = "if the fallback is successfully dispatched, the weights of both calls"] + #[doc = "are accumulated and an event containing the main call error is deposited."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "In the event of a fallback failure the whole call fails"] + #[doc = "with the weights returned."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub struct BatchAll { - pub calls: batch_all::Calls, + #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] + #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] + #[doc = ""] + #[doc = "## Dispatch Logic"] + #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] + #[doc = " applying any origin filters."] + #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] + #[doc = " `fallback` calls."] + #[doc = ""] + #[doc = "## Use Case"] + #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] + #[doc = " or both."] + pub struct IfElse { + pub main: ::subxt::ext::subxt_core::alloc::boxed::Box, + pub fallback: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod batch_all { + pub mod if_else { use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::quantus_runtime::RuntimeCall, - >; + pub type Main = runtime_types::quantus_runtime::RuntimeCall; + pub type Fallback = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BatchAll { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IfElse { const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch_all"; + const CALL: &'static str = "if_else"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8489,180 +8033,35 @@ pub mod api { )] #[doc = "Dispatches a function call with a provided origin."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct DispatchAs { + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct DispatchAsFallible { pub as_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub call: + ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod dispatch_as { + pub mod dispatch_as_fallible { use super::runtime_types; pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAs { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAsFallible { const PALLET: &'static str = "Utility"; - const CALL: &'static str = "dispatch_as"; + const CALL: &'static str = "dispatch_as_fallible"; } - #[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 TransactionApi; + impl TransactionApi { #[doc = "Send a batch of dispatch calls."] - #[doc = "Unlike `batch`, it allows errors and won't interrupt."] #[doc = ""] #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub struct ForceBatch { - pub calls: force_batch::Calls, - } - pub mod force_batch { - use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::quantus_runtime::RuntimeCall, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceBatch { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "force_batch"; - } - #[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 = "Dispatch a function call with a specified weight."] - #[doc = ""] - #[doc = "This function does not check the weight of the call, and instead allows the"] - #[doc = "Root origin to specify the weight of the call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub struct WithWeight { - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub weight: with_weight::Weight, - } - pub mod with_weight { - use super::runtime_types; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - pub type Weight = runtime_types::sp_weights::weight_v2::Weight; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for WithWeight { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "with_weight"; - } - #[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 = "Dispatch a fallback call in the event the main call fails to execute."] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "This function first attempts to dispatch the `main` call."] - #[doc = "If the `main` call fails, the `fallback` is attemted."] - #[doc = "if the fallback is successfully dispatched, the weights of both calls"] - #[doc = "are accumulated and an event containing the main call error is deposited."] - #[doc = ""] - #[doc = "In the event of a fallback failure the whole call fails"] - #[doc = "with the weights returned."] - #[doc = ""] - #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] - #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] - #[doc = ""] - #[doc = "## Dispatch Logic"] - #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] - #[doc = " applying any origin filters."] - #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] - #[doc = " `fallback` calls."] - #[doc = ""] - #[doc = "## Use Case"] - #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] - #[doc = " or both."] - pub struct IfElse { - pub main: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub fallback: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod if_else { - use super::runtime_types; - pub type Main = runtime_types::quantus_runtime::RuntimeCall; - pub type Fallback = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IfElse { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "if_else"; - } - #[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 = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub struct DispatchAsFallible { - pub as_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod dispatch_as_fallible { - use super::runtime_types; - pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAsFallible { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "dispatch_as_fallible"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "## Complexity"] @@ -8682,9 +8081,9 @@ pub mod api { "batch", types::Batch { calls }, [ - 143u8, 230u8, 160u8, 33u8, 51u8, 78u8, 98u8, 70u8, 24u8, 252u8, 53u8, - 95u8, 142u8, 254u8, 85u8, 220u8, 208u8, 135u8, 35u8, 223u8, 159u8, 9u8, - 252u8, 220u8, 43u8, 167u8, 49u8, 44u8, 89u8, 178u8, 227u8, 192u8, + 111u8, 39u8, 31u8, 82u8, 11u8, 56u8, 103u8, 165u8, 86u8, 35u8, 120u8, + 94u8, 247u8, 221u8, 146u8, 132u8, 251u8, 249u8, 233u8, 119u8, 137u8, + 221u8, 171u8, 224u8, 9u8, 250u8, 247u8, 73u8, 138u8, 20u8, 100u8, 95u8, ], ) } @@ -8714,10 +8113,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 214u8, 237u8, 32u8, 195u8, 191u8, 195u8, 55u8, 60u8, 99u8, 181u8, - 242u8, 109u8, 51u8, 83u8, 103u8, 100u8, 4u8, 196u8, 130u8, 130u8, - 190u8, 179u8, 224u8, 200u8, 67u8, 61u8, 214u8, 118u8, 5u8, 91u8, 104u8, - 72u8, + 249u8, 108u8, 205u8, 73u8, 199u8, 132u8, 64u8, 242u8, 220u8, 193u8, + 76u8, 246u8, 60u8, 28u8, 56u8, 16u8, 170u8, 136u8, 43u8, 176u8, 107u8, + 135u8, 188u8, 183u8, 32u8, 77u8, 139u8, 45u8, 255u8, 47u8, 108u8, + 177u8, ], ) } @@ -8743,9 +8142,10 @@ pub mod api { "batch_all", types::BatchAll { calls }, [ - 181u8, 57u8, 166u8, 110u8, 27u8, 199u8, 129u8, 206u8, 52u8, 238u8, - 32u8, 165u8, 37u8, 48u8, 103u8, 144u8, 138u8, 34u8, 41u8, 94u8, 246u8, - 41u8, 110u8, 214u8, 14u8, 114u8, 86u8, 44u8, 95u8, 14u8, 201u8, 175u8, + 78u8, 221u8, 198u8, 146u8, 146u8, 235u8, 29u8, 92u8, 217u8, 91u8, + 147u8, 60u8, 69u8, 132u8, 17u8, 222u8, 71u8, 96u8, 58u8, 161u8, 138u8, + 149u8, 156u8, 28u8, 203u8, 113u8, 194u8, 217u8, 223u8, 155u8, 106u8, + 71u8, ], ) } @@ -8768,9 +8168,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 10u8, 157u8, 57u8, 66u8, 109u8, 65u8, 72u8, 193u8, 5u8, 242u8, 129u8, - 169u8, 57u8, 0u8, 3u8, 210u8, 146u8, 49u8, 26u8, 109u8, 117u8, 2u8, - 189u8, 69u8, 186u8, 28u8, 163u8, 235u8, 225u8, 210u8, 111u8, 177u8, + 165u8, 231u8, 237u8, 221u8, 24u8, 29u8, 11u8, 140u8, 123u8, 34u8, 72u8, + 188u8, 90u8, 117u8, 151u8, 120u8, 117u8, 2u8, 191u8, 151u8, 130u8, + 93u8, 25u8, 173u8, 63u8, 52u8, 205u8, 87u8, 235u8, 226u8, 207u8, 222u8, ], ) } @@ -8796,9 +8196,10 @@ pub mod api { "force_batch", types::ForceBatch { calls }, [ - 236u8, 54u8, 180u8, 85u8, 81u8, 119u8, 70u8, 224u8, 73u8, 103u8, 169u8, - 41u8, 191u8, 56u8, 138u8, 114u8, 255u8, 207u8, 13u8, 219u8, 217u8, - 35u8, 131u8, 51u8, 220u8, 168u8, 191u8, 5u8, 98u8, 225u8, 50u8, 137u8, + 162u8, 23u8, 181u8, 133u8, 240u8, 173u8, 61u8, 116u8, 183u8, 60u8, + 132u8, 126u8, 255u8, 27u8, 43u8, 229u8, 251u8, 234u8, 17u8, 240u8, + 253u8, 193u8, 75u8, 9u8, 195u8, 104u8, 151u8, 203u8, 82u8, 128u8, + 151u8, 194u8, ], ) } @@ -8821,10 +8222,10 @@ pub mod api { weight, }, [ - 253u8, 207u8, 162u8, 133u8, 214u8, 66u8, 111u8, 171u8, 181u8, 86u8, - 82u8, 24u8, 121u8, 127u8, 80u8, 92u8, 21u8, 81u8, 255u8, 176u8, 61u8, - 95u8, 195u8, 109u8, 197u8, 42u8, 54u8, 204u8, 148u8, 107u8, 212u8, - 236u8, + 171u8, 121u8, 3u8, 182u8, 182u8, 104u8, 23u8, 118u8, 127u8, 89u8, + 108u8, 88u8, 24u8, 108u8, 99u8, 178u8, 183u8, 201u8, 110u8, 214u8, + 98u8, 78u8, 16u8, 149u8, 17u8, 130u8, 106u8, 68u8, 128u8, 255u8, 56u8, + 54u8, ], ) } @@ -8864,9 +8265,9 @@ pub mod api { fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), }, [ - 251u8, 49u8, 108u8, 91u8, 215u8, 66u8, 153u8, 50u8, 76u8, 22u8, 82u8, - 115u8, 88u8, 37u8, 50u8, 69u8, 92u8, 225u8, 34u8, 143u8, 59u8, 13u8, - 222u8, 29u8, 130u8, 66u8, 25u8, 162u8, 78u8, 5u8, 113u8, 244u8, + 232u8, 191u8, 10u8, 242u8, 23u8, 164u8, 0u8, 128u8, 50u8, 227u8, 113u8, + 190u8, 172u8, 153u8, 223u8, 24u8, 31u8, 107u8, 172u8, 175u8, 157u8, + 13u8, 81u8, 196u8, 117u8, 202u8, 249u8, 20u8, 187u8, 2u8, 145u8, 204u8, ], ) } @@ -8889,9 +8290,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 20u8, 7u8, 177u8, 85u8, 1u8, 244u8, 203u8, 254u8, 2u8, 41u8, 209u8, - 209u8, 100u8, 23u8, 237u8, 67u8, 162u8, 62u8, 226u8, 220u8, 77u8, - 112u8, 238u8, 124u8, 247u8, 247u8, 153u8, 8u8, 19u8, 82u8, 84u8, 163u8, + 21u8, 52u8, 11u8, 8u8, 36u8, 3u8, 245u8, 168u8, 231u8, 34u8, 214u8, + 36u8, 127u8, 82u8, 55u8, 53u8, 161u8, 38u8, 171u8, 208u8, 133u8, 239u8, + 183u8, 54u8, 207u8, 101u8, 244u8, 110u8, 150u8, 221u8, 86u8, 234u8, ], ) } @@ -10541,6 +9942,32 @@ pub mod api { 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 (interceptor) to recover all funds from a high security"] + #[doc = "account by transferring the entire balance to themselves."] + #[doc = ""] + #[doc = "This is an emergency function for when the high security account may be compromised."] + 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"; + } } pub struct TransactionApi; impl TransactionApi { @@ -10700,6 +10127,26 @@ pub mod api { ], ) } + #[doc = "Allows the guardian (interceptor) to recover all funds from a high security"] + #[doc = "account by transferring the entire balance to themselves."] + #[doc = ""] + #[doc = "This is an emergency function for when the high security account may be compromised."] + 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"] @@ -10776,7 +10223,6 @@ 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 by the owner."] - #[doc = "[who, tx_id]"] pub struct TransactionCancelled { pub who: transaction_cancelled::Who, pub tx_id: transaction_cancelled::TxId, @@ -10798,7 +10244,6 @@ 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."] - #[doc = "[tx_id, dispatch_result]"] pub struct TransactionExecuted { pub tx_id: transaction_executed::TxId, pub result: transaction_executed::Result, @@ -10817,6 +10262,27 @@ pub mod api { const PALLET: &'static str = "ReversibleTransfers"; const EVENT: &'static str = "TransactionExecuted"; } + #[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 = "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 funds_recovered { + use super::runtime_types; + 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 FundsRecovered { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "FundsRecovered"; + } } pub mod storage { use super::runtime_types; @@ -11293,7 +10759,7 @@ pub mod api { } #[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."] + #[doc = " fees. The fee is burned (removed from total issuance)."] pub fn volume_fee( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< @@ -14304,12 +13770,12 @@ pub mod api { } } } - pub mod merkle_airdrop { + pub mod treasury_pallet { use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_merkle_airdrop::pallet::Error; + #[doc = "Error for the treasury 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_merkle_airdrop::pallet::Call; + 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; @@ -14326,70 +13792,39 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Create a new airdrop with a Merkle root."] - #[doc = ""] - #[doc = "The Merkle root is a cryptographic hash that represents all valid claims"] - #[doc = "for this airdrop. Users will later provide Merkle proofs to verify their"] - #[doc = "eligibility to claim tokens."] - #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Propose and approve a spend of treasury funds."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `merkle_root` - The Merkle root hash representing all valid claims"] - #[doc = "* `vesting_period` - Optional vesting period for the airdrop"] - #[doc = "* `vesting_delay` - Optional delay before vesting starts"] - pub struct CreateAirdrop { - pub merkle_root: create_airdrop::MerkleRoot, - pub vesting_period: create_airdrop::VestingPeriod, - pub vesting_delay: create_airdrop::VestingDelay, - } - pub mod create_airdrop { - use super::runtime_types; - pub type MerkleRoot = [::core::primitive::u8; 32usize]; - pub type VestingPeriod = ::core::option::Option<::core::primitive::u32>; - pub type VestingDelay = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "create_airdrop"; - } - #[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 = "Fund an existing airdrop with tokens."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "### Details"] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to fund"] - #[doc = "* `amount` - The amount of tokens to add to the airdrop"] + #[doc = "### Parameters"] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "## Events"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - pub struct FundAirdrop { - pub airdrop_id: fund_airdrop::AirdropId, - pub amount: fund_airdrop::Amount, + #[doc = "Emits [`Event::SpendApproved`] if successful."] + pub struct SpendLocal { + #[codec(compact)] + pub amount: spend_local::Amount, + pub beneficiary: spend_local::Beneficiary, } - pub mod fund_airdrop { + pub mod spend_local { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; pub type Amount = ::core::primitive::u128; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FundAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "fund_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SpendLocal { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "spend_local"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14402,44 +13837,38 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] + #[doc = "Force a previously approved proposal to be removed from the approval queue."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] #[doc = ""] - #[doc = "Users can claim their tokens by providing a proof of their eligibility."] - #[doc = "The proof is verified against the airdrop's Merkle root."] - #[doc = "Anyone can trigger a claim for any eligible recipient."] + #[doc = "## Details"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "The original deposit will no longer be returned."] #[doc = ""] - #[doc = "* `origin` - The origin of the call"] - #[doc = "* `airdrop_id` - The ID of the airdrop to claim from"] - #[doc = "* `amount` - The amount of tokens to claim"] - #[doc = "* `merkle_proof` - The Merkle proof verifying eligibility"] + #[doc = "### Parameters"] + #[doc = "- `proposal_id`: The index of a proposal"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "### Complexity"] + #[doc = "- O(A) where `A` is the number of approvals"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `AlreadyClaimed` - If the recipient has already claimed from this airdrop"] - #[doc = "* `InvalidProof` - If the provided Merkle proof is invalid"] - #[doc = "* `InsufficientAirdropBalance` - If the airdrop doesn't have enough tokens"] - pub struct Claim { - pub airdrop_id: claim::AirdropId, - pub recipient: claim::Recipient, - pub amount: claim::Amount, - pub merkle_proof: claim::MerkleProof, + #[doc = "### Errors"] + #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] + #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] + #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] + #[doc = " in the first place."] + pub struct RemoveApproval { + #[codec(compact)] + pub proposal_id: remove_approval::ProposalId, } - pub mod claim { + pub mod remove_approval { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Recipient = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - pub type MerkleProof = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >; + pub type ProposalId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Claim { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "claim"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveApproval { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "remove_approval"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14452,165 +13881,404 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Delete an airdrop and reclaim any remaining funds."] - #[doc = ""] - #[doc = "This function allows the creator of an airdrop to delete it and reclaim"] - #[doc = "any remaining tokens that haven't been claimed."] + #[doc = "Propose and approve a spend of treasury funds."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] + #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] + #[doc = "for assertion using the [`Config::BalanceConverter`]."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "## Details"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `NotAirdropCreator` - If the caller is not the creator of the airdrop"] - pub struct DeleteAirdrop { - pub airdrop_id: delete_airdrop::AirdropId, + #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] + #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] + #[doc = "the [`Config::PayoutPeriod`]."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The beneficiary of the spend."] + #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] + #[doc = " the past if the resulting spend has not yet expired according to the"] + #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] + #[doc = " approval."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] + pub struct Spend { + pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[codec(compact)] + pub amount: spend::Amount, + pub beneficiary: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub valid_from: spend::ValidFrom, + } + pub mod spend { + use super::runtime_types; + pub type AssetKind = (); + pub type Amount = ::core::primitive::u128; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type ValidFrom = ::core::option::Option<::core::primitive::u32>; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Spend { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "spend"; + } + #[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 = "Claim a spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed"] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] + #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] + #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] + #[doc = "dispatchable before retrying with the current function."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::Paid`] if successful."] + pub struct Payout { + pub index: payout::Index, + } + pub mod payout { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Payout { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "payout"; + } + #[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 = "Check the status of the spend and remove it from the storage if processed."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "The status check is a prerequisite for retrying a failed payout."] + #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] + #[doc = "function. In such instances, transaction fees are refunded."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] + #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] + pub struct CheckStatus { + pub index: check_status::Index, + } + pub mod check_status { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CheckStatus { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "check_status"; + } + #[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 = "Void previously approved spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] + pub struct VoidSpend { + pub index: void_spend::Index, } - pub mod delete_airdrop { + pub mod void_spend { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DeleteAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "delete_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VoidSpend { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "void_spend"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Create a new airdrop with a Merkle root."] + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] + #[doc = ""] + #[doc = "### Details"] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] #[doc = ""] - #[doc = "The Merkle root is a cryptographic hash that represents all valid claims"] - #[doc = "for this airdrop. Users will later provide Merkle proofs to verify their"] - #[doc = "eligibility to claim tokens."] + #[doc = "### Parameters"] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "## Events"] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `merkle_root` - The Merkle root hash representing all valid claims"] - #[doc = "* `vesting_period` - Optional vesting period for the airdrop"] - #[doc = "* `vesting_delay` - Optional delay before vesting starts"] - pub fn create_airdrop( + #[doc = "Emits [`Event::SpendApproved`] if successful."] + pub fn spend_local( &self, - merkle_root: types::create_airdrop::MerkleRoot, - vesting_period: types::create_airdrop::VestingPeriod, - vesting_delay: types::create_airdrop::VestingDelay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + amount: types::spend_local::Amount, + beneficiary: types::spend_local::Beneficiary, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "create_airdrop", - types::CreateAirdrop { merkle_root, vesting_period, vesting_delay }, + "TreasuryPallet", + "spend_local", + types::SpendLocal { amount, beneficiary }, [ - 18u8, 201u8, 105u8, 56u8, 66u8, 207u8, 57u8, 177u8, 133u8, 38u8, 185u8, - 19u8, 205u8, 119u8, 177u8, 206u8, 188u8, 88u8, 138u8, 33u8, 246u8, - 179u8, 148u8, 0u8, 79u8, 201u8, 89u8, 229u8, 46u8, 77u8, 42u8, 117u8, + 137u8, 171u8, 83u8, 247u8, 245u8, 212u8, 152u8, 127u8, 210u8, 71u8, + 254u8, 134u8, 189u8, 26u8, 249u8, 41u8, 214u8, 175u8, 24u8, 64u8, 33u8, + 90u8, 23u8, 134u8, 44u8, 110u8, 63u8, 46u8, 46u8, 146u8, 222u8, 79u8, ], ) } - #[doc = "Fund an existing airdrop with tokens."] + #[doc = "Force a previously approved proposal to be removed from the approval queue."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] + #[doc = "## Details"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "The original deposit will no longer be returned."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to fund"] - #[doc = "* `amount` - The amount of tokens to add to the airdrop"] + #[doc = "### Parameters"] + #[doc = "- `proposal_id`: The index of a proposal"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "### Complexity"] + #[doc = "- O(A) where `A` is the number of approvals"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - pub fn fund_airdrop( + #[doc = "### Errors"] + #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] + #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] + #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] + #[doc = " in the first place."] + pub fn remove_approval( &self, - airdrop_id: types::fund_airdrop::AirdropId, - amount: types::fund_airdrop::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + proposal_id: types::remove_approval::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "fund_airdrop", - types::FundAirdrop { airdrop_id, amount }, + "TreasuryPallet", + "remove_approval", + types::RemoveApproval { proposal_id }, [ - 11u8, 155u8, 135u8, 152u8, 19u8, 196u8, 79u8, 68u8, 24u8, 46u8, 27u8, - 63u8, 202u8, 242u8, 166u8, 160u8, 81u8, 44u8, 115u8, 247u8, 110u8, - 49u8, 11u8, 204u8, 70u8, 39u8, 7u8, 43u8, 103u8, 78u8, 39u8, 131u8, + 180u8, 20u8, 39u8, 227u8, 29u8, 228u8, 234u8, 36u8, 155u8, 114u8, + 197u8, 135u8, 185u8, 31u8, 56u8, 247u8, 224u8, 168u8, 254u8, 233u8, + 250u8, 134u8, 186u8, 155u8, 108u8, 84u8, 94u8, 226u8, 207u8, 130u8, + 196u8, 100u8, ], ) } - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] + #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] + #[doc = "for assertion using the [`Config::BalanceConverter`]."] #[doc = ""] - #[doc = "Users can claim their tokens by providing a proof of their eligibility."] - #[doc = "The proof is verified against the airdrop's Merkle root."] - #[doc = "Anyone can trigger a claim for any eligible recipient."] + #[doc = "## Details"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] + #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] + #[doc = "the [`Config::PayoutPeriod`]."] #[doc = ""] - #[doc = "* `origin` - The origin of the call"] - #[doc = "* `airdrop_id` - The ID of the airdrop to claim from"] - #[doc = "* `amount` - The amount of tokens to claim"] - #[doc = "* `merkle_proof` - The Merkle proof verifying eligibility"] + #[doc = "### Parameters"] + #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The beneficiary of the spend."] + #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] + #[doc = " the past if the resulting spend has not yet expired according to the"] + #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] + #[doc = " approval."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "## Events"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `AlreadyClaimed` - If the recipient has already claimed from this airdrop"] - #[doc = "* `InvalidProof` - If the provided Merkle proof is invalid"] - #[doc = "* `InsufficientAirdropBalance` - If the airdrop doesn't have enough tokens"] - pub fn claim( + #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] + pub fn spend( &self, - airdrop_id: types::claim::AirdropId, - recipient: types::claim::Recipient, - amount: types::claim::Amount, - merkle_proof: types::claim::MerkleProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + asset_kind: types::spend::AssetKind, + amount: types::spend::Amount, + beneficiary: types::spend::Beneficiary, + valid_from: types::spend::ValidFrom, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "claim", - types::Claim { airdrop_id, recipient, amount, merkle_proof }, + "TreasuryPallet", + "spend", + types::Spend { + asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + asset_kind, + ), + amount, + beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + beneficiary, + ), + valid_from, + }, [ - 137u8, 9u8, 80u8, 195u8, 157u8, 215u8, 158u8, 30u8, 26u8, 104u8, 183u8, - 55u8, 102u8, 100u8, 41u8, 40u8, 26u8, 193u8, 255u8, 95u8, 201u8, 240u8, - 18u8, 253u8, 71u8, 117u8, 88u8, 250u8, 192u8, 67u8, 127u8, 159u8, + 64u8, 121u8, 249u8, 219u8, 22u8, 188u8, 167u8, 85u8, 45u8, 27u8, 200u8, + 219u8, 138u8, 17u8, 230u8, 106u8, 145u8, 39u8, 43u8, 161u8, 69u8, 10u8, + 202u8, 251u8, 127u8, 131u8, 0u8, 194u8, 25u8, 153u8, 169u8, 206u8, ], ) } - #[doc = "Delete an airdrop and reclaim any remaining funds."] + #[doc = "Claim a spend."] #[doc = ""] - #[doc = "This function allows the creator of an airdrop to delete it and reclaim"] - #[doc = "any remaining tokens that haven't been claimed."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Must be signed"] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] + #[doc = "## Details"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] + #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] + #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] + #[doc = "dispatchable before retrying with the current function."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `NotAirdropCreator` - If the caller is not the creator of the airdrop"] - pub fn delete_airdrop( + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::Paid`] if successful."] + pub fn payout( &self, - airdrop_id: types::delete_airdrop::AirdropId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + index: types::payout::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TreasuryPallet", + "payout", + types::Payout { index }, + [ + 179u8, 254u8, 82u8, 94u8, 248u8, 26u8, 6u8, 34u8, 93u8, 244u8, 186u8, + 199u8, 163u8, 32u8, 110u8, 220u8, 78u8, 11u8, 168u8, 182u8, 169u8, + 56u8, 53u8, 194u8, 168u8, 218u8, 131u8, 38u8, 46u8, 156u8, 93u8, 234u8, + ], + ) + } + #[doc = "Check the status of the spend and remove it from the storage if processed."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "The status check is a prerequisite for retrying a failed payout."] + #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] + #[doc = "function. In such instances, transaction fees are refunded."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] + #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] + pub fn check_status( + &self, + index: types::check_status::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TreasuryPallet", + "check_status", + types::CheckStatus { index }, + [ + 164u8, 111u8, 10u8, 11u8, 104u8, 237u8, 112u8, 240u8, 104u8, 130u8, + 179u8, 221u8, 54u8, 18u8, 8u8, 172u8, 148u8, 245u8, 110u8, 174u8, 75u8, + 38u8, 46u8, 143u8, 101u8, 232u8, 65u8, 252u8, 36u8, 152u8, 29u8, 209u8, + ], + ) + } + #[doc = "Void previously approved spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] + pub fn void_spend( + &self, + index: types::void_spend::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "delete_airdrop", - types::DeleteAirdrop { airdrop_id }, + "TreasuryPallet", + "void_spend", + types::VoidSpend { index }, [ - 34u8, 88u8, 199u8, 36u8, 214u8, 19u8, 124u8, 24u8, 29u8, 222u8, 138u8, - 174u8, 47u8, 199u8, 59u8, 155u8, 118u8, 157u8, 82u8, 96u8, 81u8, 186u8, - 27u8, 96u8, 116u8, 99u8, 185u8, 8u8, 100u8, 34u8, 179u8, 185u8, + 9u8, 212u8, 174u8, 92u8, 43u8, 102u8, 224u8, 124u8, 247u8, 239u8, + 196u8, 68u8, 132u8, 171u8, 116u8, 206u8, 52u8, 23u8, 92u8, 31u8, 156u8, + 160u8, 25u8, 16u8, 125u8, 60u8, 9u8, 109u8, 145u8, 139u8, 102u8, 224u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_merkle_airdrop::pallet::Event; + pub type Event = runtime_types::pallet_treasury::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -14620,25 +14288,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 new airdrop has been created."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, merkle_root]"] - pub struct AirdropCreated { - pub airdrop_id: airdrop_created::AirdropId, - pub airdrop_metadata: airdrop_created::AirdropMetadata, - } - pub mod airdrop_created { + #[doc = "We have ended a spend period and will now allocate funds."] + pub struct Spending { + pub budget_remaining: spending::BudgetRemaining, + } + pub mod spending { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type AirdropMetadata = runtime_types::pallet_merkle_airdrop::AirdropMetadata< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - >; + pub type BudgetRemaining = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropCreated { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropCreated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Spending { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Spending"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14647,21 +14307,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 airdrop has been funded with tokens."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, amount]"] - pub struct AirdropFunded { - pub airdrop_id: airdrop_funded::AirdropId, - pub amount: airdrop_funded::Amount, - } - pub mod airdrop_funded { + #[doc = "Some funds have been allocated."] + pub struct Awarded { + pub proposal_index: awarded::ProposalIndex, + pub award: awarded::Award, + pub account: awarded::Account, + } + pub mod awarded { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Amount = ::core::primitive::u128; + pub type ProposalIndex = ::core::primitive::u32; + pub type Award = ::core::primitive::u128; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropFunded { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropFunded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Awarded { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Awarded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14670,23 +14330,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 claimed tokens from an airdrop."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, account, amount]"] - pub struct Claimed { - pub airdrop_id: claimed::AirdropId, - pub account: claimed::Account, - pub amount: claimed::Amount, - } - pub mod claimed { + #[doc = "Some of our funds have been burnt."] + pub struct Burnt { + pub burnt_funds: burnt::BurntFunds, + } + pub mod burnt { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type BurntFunds = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Claimed { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "Claimed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Burnt { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Burnt"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14695,1410 +14349,736 @@ 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 airdrop has been deleted."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id]"] - pub struct AirdropDeleted { - pub airdrop_id: airdrop_deleted::AirdropId, + #[doc = "Spending has finished; this is the amount that rolls over until next spend."] + pub struct Rollover { + pub rollover_balance: rollover::RolloverBalance, } - pub mod airdrop_deleted { + pub mod rollover { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; + pub type RolloverBalance = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Rollover { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Rollover"; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropDeleted { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropDeleted"; + #[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 = "Some funds have been deposited."] + pub struct Deposit { + pub value: deposit::Value, } - } - pub mod storage { - use super::runtime_types; - pub mod types { + pub mod deposit { use super::runtime_types; - pub mod airdrop_info { - use super::runtime_types; - pub type AirdropInfo = runtime_types::pallet_merkle_airdrop::AirdropMetadata< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod claimed { - use super::runtime_types; - pub type Claimed = (); - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod next_airdrop_id { - use super::runtime_types; - pub type NextAirdropId = ::core::primitive::u32; - } + pub type Value = ::core::primitive::u128; } - pub struct StorageApi; - impl StorageApi { - #[doc = " Stores general info about an airdrop"] - pub fn airdrop_info_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::airdrop_info::AirdropInfo, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "AirdropInfo", - (), - [ - 38u8, 176u8, 25u8, 251u8, 80u8, 201u8, 118u8, 175u8, 89u8, 80u8, 227u8, - 241u8, 250u8, 0u8, 112u8, 71u8, 133u8, 50u8, 137u8, 13u8, 255u8, 24u8, - 253u8, 237u8, 195u8, 1u8, 192u8, 177u8, 167u8, 248u8, 11u8, 160u8, - ], - ) - } - #[doc = " Stores general info about an airdrop"] - pub fn airdrop_info( - &self, - _0: types::airdrop_info::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::airdrop_info::Param0, - >, - types::airdrop_info::AirdropInfo, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "AirdropInfo", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 38u8, 176u8, 25u8, 251u8, 80u8, 201u8, 118u8, 175u8, 89u8, 80u8, 227u8, - 241u8, 250u8, 0u8, 112u8, 71u8, 133u8, 50u8, 137u8, 13u8, 255u8, 24u8, - 253u8, 237u8, 195u8, 1u8, 192u8, 177u8, 167u8, 248u8, 11u8, 160u8, - ], - ) - } - #[doc = " Storage for claimed status"] - pub fn claimed_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::claimed::Claimed, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", - (), - [ - 214u8, 178u8, 109u8, 48u8, 230u8, 120u8, 107u8, 211u8, 179u8, 251u8, - 164u8, 29u8, 197u8, 154u8, 160u8, 230u8, 112u8, 212u8, 14u8, 157u8, - 248u8, 207u8, 101u8, 159u8, 203u8, 82u8, 199u8, 102u8, 99u8, 239u8, - 162u8, 10u8, - ], - ) - } - #[doc = " Storage for claimed status"] - pub fn claimed_iter1( - &self, - _0: types::claimed::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param0, - >, - types::claimed::Claimed, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 214u8, 178u8, 109u8, 48u8, 230u8, 120u8, 107u8, 211u8, 179u8, 251u8, - 164u8, 29u8, 197u8, 154u8, 160u8, 230u8, 112u8, 212u8, 14u8, 157u8, - 248u8, 207u8, 101u8, 159u8, 203u8, 82u8, 199u8, 102u8, 99u8, 239u8, - 162u8, 10u8, - ], - ) - } - #[doc = " Storage for claimed status"] - pub fn claimed( - &self, - _0: types::claimed::Param0, - _1: types::claimed::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param1, - >, - ), - types::claimed::Claimed, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 214u8, 178u8, 109u8, 48u8, 230u8, 120u8, 107u8, 211u8, 179u8, 251u8, - 164u8, 29u8, 197u8, 154u8, 160u8, 230u8, 112u8, 212u8, 14u8, 157u8, - 248u8, 207u8, 101u8, 159u8, 203u8, 82u8, 199u8, 102u8, 99u8, 239u8, - 162u8, 10u8, - ], - ) - } - #[doc = " Counter for airdrop IDs"] - pub fn next_airdrop_id( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_airdrop_id::NextAirdropId, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "NextAirdropId", - (), - [ - 79u8, 145u8, 145u8, 158u8, 86u8, 58u8, 102u8, 216u8, 133u8, 34u8, - 252u8, 224u8, 222u8, 51u8, 170u8, 3u8, 135u8, 29u8, 99u8, 143u8, 93u8, - 176u8, 69u8, 231u8, 74u8, 214u8, 94u8, 126u8, 227u8, 166u8, 242u8, - 98u8, - ], - ) - } + impl ::subxt::ext::subxt_core::events::StaticEvent for Deposit { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Deposit"; } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The maximum number of proof elements allowed in a Merkle proof."] - pub fn max_proofs( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "MaxProofs", - [ - 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 pallet id, used for deriving its sovereign account ID."] - pub fn pallet_id( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "PalletId", - [ - 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, - 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, - 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, - ], - ) - } - #[doc = " Priority for unsigned claim transactions."] - pub fn unsigned_claim_priority( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "UnsignedClaimPriority", - [ - 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, - ], - ) - } + #[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 new spend proposal has been approved."] + pub struct SpendApproved { + pub proposal_index: spend_approved::ProposalIndex, + pub amount: spend_approved::Amount, + pub beneficiary: spend_approved::Beneficiary, + } + pub mod spend_approved { + use super::runtime_types; + pub type ProposalIndex = ::core::primitive::u32; + pub type Amount = ::core::primitive::u128; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for SpendApproved { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "SpendApproved"; + } + #[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 inactive funds of the pallet have been updated."] + pub struct UpdatedInactive { + pub reactivated: updated_inactive::Reactivated, + pub deactivated: updated_inactive::Deactivated, + } + pub mod updated_inactive { + use super::runtime_types; + pub type Reactivated = ::core::primitive::u128; + pub type Deactivated = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for UpdatedInactive { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "UpdatedInactive"; + } + #[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 new asset spend proposal has been approved."] + pub struct AssetSpendApproved { + pub index: asset_spend_approved::Index, + pub asset_kind: asset_spend_approved::AssetKind, + pub amount: asset_spend_approved::Amount, + pub beneficiary: asset_spend_approved::Beneficiary, + pub valid_from: asset_spend_approved::ValidFrom, + pub expire_at: asset_spend_approved::ExpireAt, + } + pub mod asset_spend_approved { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type AssetKind = (); + pub type Amount = ::core::primitive::u128; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ValidFrom = ::core::primitive::u32; + pub type ExpireAt = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetSpendApproved { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "AssetSpendApproved"; + } + #[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 approved spend was voided."] + pub struct AssetSpendVoided { + pub index: asset_spend_voided::Index, + } + pub mod asset_spend_voided { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetSpendVoided { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "AssetSpendVoided"; + } + #[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 payment happened."] + pub struct Paid { + pub index: paid::Index, + pub payment_id: paid::PaymentId, + } + pub mod paid { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type PaymentId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Paid { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Paid"; + } + #[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 payment failed and can be retried."] + pub struct PaymentFailed { + pub index: payment_failed::Index, + pub payment_id: payment_failed::PaymentId, + } + pub mod payment_failed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type PaymentId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for PaymentFailed { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "PaymentFailed"; + } + #[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 spend was processed and removed from the storage. It might have been successfully"] + #[doc = "paid or it may have expired."] + pub struct SpendProcessed { + pub index: spend_processed::Index, + } + pub mod spend_processed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for SpendProcessed { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "SpendProcessed"; } } - } - pub mod treasury_pallet { - use super::{root_mod, runtime_types}; - #[doc = "Error for the treasury 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 storage { + use super::runtime_types; 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 = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] - #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub struct SpendLocal { - #[codec(compact)] - pub amount: spend_local::Amount, - pub beneficiary: spend_local::Beneficiary, + pub mod proposal_count { + use super::runtime_types; + pub type ProposalCount = ::core::primitive::u32; } - pub mod spend_local { + pub mod proposals { use super::runtime_types; - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Proposals = runtime_types::pallet_treasury::Proposal< ::subxt::ext::subxt_core::utils::AccountId32, - (), + ::core::primitive::u128, >; + pub type Param0 = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SpendLocal { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "spend_local"; + pub mod deactivated { + use super::runtime_types; + pub type Deactivated = ::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 = "Force a previously approved proposal to be removed from the approval queue."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The original deposit will no longer be returned."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] - #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] - #[doc = ""] - #[doc = "### Errors"] - #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] - #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] - #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] - #[doc = " in the first place."] - pub struct RemoveApproval { - #[codec(compact)] - pub proposal_id: remove_approval::ProposalId, - } - pub mod remove_approval { + pub mod approvals { use super::runtime_types; - pub type ProposalId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveApproval { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "remove_approval"; + pub type Approvals = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::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 = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] - #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] - #[doc = "for assertion using the [`Config::BalanceConverter`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] - #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] - #[doc = "the [`Config::PayoutPeriod`]."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The beneficiary of the spend."] - #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] - #[doc = " the past if the resulting spend has not yet expired according to the"] - #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] - #[doc = " approval."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub struct Spend { - pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, - #[codec(compact)] - pub amount: spend::Amount, - pub beneficiary: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub valid_from: spend::ValidFrom, + pub mod spend_count { + use super::runtime_types; + pub type SpendCount = ::core::primitive::u32; } - pub mod spend { + pub mod spends { use super::runtime_types; - pub type AssetKind = (); - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, + pub type Spends = runtime_types::pallet_treasury::SpendStatus< (), + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, + ::core::primitive::u32, >; - pub type ValidFrom = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Spend { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "spend"; - } - #[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 = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] - #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] - #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] - #[doc = "dispatchable before retrying with the current function."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub struct Payout { - pub index: payout::Index, + pub type Param0 = ::core::primitive::u32; } - pub mod payout { + pub mod last_spend_period { use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Payout { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "payout"; + pub type LastSpendPeriod = ::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 = "Check the status of the spend and remove it from the storage if processed."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The status check is a prerequisite for retrying a failed payout."] - #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] - #[doc = "function. In such instances, transaction fees are refunded."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] + } + pub struct StorageApi; + impl StorageApi { + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] #[doc = ""] - #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] - #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] - pub struct CheckStatus { - pub index: check_status::Index, - } - pub mod check_status { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CheckStatus { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "check_status"; + #[doc = " Number of proposals that have been made."] + pub fn proposal_count( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::proposal_count::ProposalCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "ProposalCount", + (), + [ + 91u8, 238u8, 246u8, 106u8, 95u8, 66u8, 83u8, 134u8, 1u8, 225u8, 164u8, + 216u8, 113u8, 101u8, 203u8, 200u8, 113u8, 97u8, 246u8, 228u8, 140u8, + 29u8, 29u8, 48u8, 176u8, 137u8, 93u8, 230u8, 56u8, 75u8, 51u8, 149u8, + ], + ) } - #[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 = "Void previously approved spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = " Proposals that have been made."] + pub fn proposals_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::proposals::Proposals, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "Proposals", + (), + [ + 207u8, 135u8, 145u8, 146u8, 48u8, 10u8, 252u8, 40u8, 20u8, 115u8, + 205u8, 41u8, 173u8, 83u8, 115u8, 46u8, 106u8, 40u8, 130u8, 157u8, + 213u8, 87u8, 45u8, 23u8, 14u8, 167u8, 99u8, 208u8, 153u8, 163u8, 141u8, + 55u8, + ], + ) + } + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - pub struct VoidSpend { - pub index: void_spend::Index, - } - pub mod void_spend { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VoidSpend { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "void_spend"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] - #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub fn spend_local( + #[doc = " Proposals that have been made."] + pub fn proposals( &self, - amount: types::spend_local::Amount, - beneficiary: types::spend_local::Beneficiary, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::proposals::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::proposals::Param0, + >, + types::proposals::Proposals, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TreasuryPallet", - "spend_local", - types::SpendLocal { amount, beneficiary }, + "Proposals", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 137u8, 171u8, 83u8, 247u8, 245u8, 212u8, 152u8, 127u8, 210u8, 71u8, - 254u8, 134u8, 189u8, 26u8, 249u8, 41u8, 214u8, 175u8, 24u8, 64u8, 33u8, - 90u8, 23u8, 134u8, 44u8, 110u8, 63u8, 46u8, 46u8, 146u8, 222u8, 79u8, + 207u8, 135u8, 145u8, 146u8, 48u8, 10u8, 252u8, 40u8, 20u8, 115u8, + 205u8, 41u8, 173u8, 83u8, 115u8, 46u8, 106u8, 40u8, 130u8, 157u8, + 213u8, 87u8, 45u8, 23u8, 14u8, 167u8, 99u8, 208u8, 153u8, 163u8, 141u8, + 55u8, ], ) } - #[doc = "Force a previously approved proposal to be removed from the approval queue."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The original deposit will no longer be returned."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] - #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] - #[doc = ""] - #[doc = "### Errors"] - #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] - #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] - #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] - #[doc = " in the first place."] - pub fn remove_approval( + #[doc = " The amount which has been reported as inactive to Currency."] + pub fn deactivated( &self, - proposal_id: types::remove_approval::ProposalId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::deactivated::Deactivated, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TreasuryPallet", - "remove_approval", - types::RemoveApproval { proposal_id }, + "Deactivated", + (), [ - 180u8, 20u8, 39u8, 227u8, 29u8, 228u8, 234u8, 36u8, 155u8, 114u8, - 197u8, 135u8, 185u8, 31u8, 56u8, 247u8, 224u8, 168u8, 254u8, 233u8, - 250u8, 134u8, 186u8, 155u8, 108u8, 84u8, 94u8, 226u8, 207u8, 130u8, - 196u8, 100u8, + 120u8, 221u8, 159u8, 56u8, 161u8, 44u8, 54u8, 233u8, 47u8, 114u8, + 170u8, 150u8, 52u8, 24u8, 137u8, 212u8, 122u8, 247u8, 40u8, 17u8, + 208u8, 130u8, 42u8, 154u8, 33u8, 222u8, 59u8, 116u8, 0u8, 15u8, 79u8, + 123u8, ], ) } - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] - #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] - #[doc = "for assertion using the [`Config::BalanceConverter`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] - #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] - #[doc = "the [`Config::PayoutPeriod`]."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The beneficiary of the spend."] - #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] - #[doc = " the past if the resulting spend has not yet expired according to the"] - #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] - #[doc = " approval."] - #[doc = ""] - #[doc = "## Events"] + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub fn spend( + #[doc = " Proposal indices that have been approved but not yet awarded."] + pub fn approvals( &self, - asset_kind: types::spend::AssetKind, - amount: types::spend::Amount, - beneficiary: types::spend::Beneficiary, - valid_from: types::spend::ValidFrom, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::approvals::Approvals, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TreasuryPallet", - "spend", - types::Spend { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - asset_kind, - ), - amount, - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - beneficiary, - ), - valid_from, - }, + "Approvals", + (), [ - 64u8, 121u8, 249u8, 219u8, 22u8, 188u8, 167u8, 85u8, 45u8, 27u8, 200u8, - 219u8, 138u8, 17u8, 230u8, 106u8, 145u8, 39u8, 43u8, 161u8, 69u8, 10u8, - 202u8, 251u8, 127u8, 131u8, 0u8, 194u8, 25u8, 153u8, 169u8, 206u8, + 78u8, 147u8, 186u8, 235u8, 17u8, 40u8, 247u8, 235u8, 67u8, 222u8, 3u8, + 14u8, 248u8, 17u8, 67u8, 180u8, 93u8, 161u8, 64u8, 35u8, 119u8, 194u8, + 187u8, 226u8, 135u8, 162u8, 147u8, 174u8, 139u8, 72u8, 99u8, 212u8, ], ) } - #[doc = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] - #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] - #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] - #[doc = "dispatchable before retrying with the current function."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub fn payout( + #[doc = " The count of spends that have been made."] + pub fn spend_count( &self, - index: types::payout::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::spend_count::SpendCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TreasuryPallet", - "payout", - types::Payout { index }, + "SpendCount", + (), [ - 179u8, 254u8, 82u8, 94u8, 248u8, 26u8, 6u8, 34u8, 93u8, 244u8, 186u8, - 199u8, 163u8, 32u8, 110u8, 220u8, 78u8, 11u8, 168u8, 182u8, 169u8, - 56u8, 53u8, 194u8, 168u8, 218u8, 131u8, 38u8, 46u8, 156u8, 93u8, 234u8, + 220u8, 74u8, 248u8, 52u8, 243u8, 209u8, 42u8, 236u8, 27u8, 98u8, 76u8, + 153u8, 129u8, 176u8, 34u8, 177u8, 33u8, 132u8, 21u8, 71u8, 206u8, + 146u8, 222u8, 44u8, 232u8, 246u8, 205u8, 92u8, 240u8, 136u8, 182u8, + 30u8, ], ) } - #[doc = "Check the status of the spend and remove it from the storage if processed."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The status check is a prerequisite for retrying a failed payout."] - #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] - #[doc = "function. In such instances, transaction fees are refunded."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] - #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] - pub fn check_status( + #[doc = " Spends that have been approved and being processed."] + pub fn spends_iter( &self, - index: types::check_status::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "check_status", - types::CheckStatus { index }, - [ - 164u8, 111u8, 10u8, 11u8, 104u8, 237u8, 112u8, 240u8, 104u8, 130u8, - 179u8, 221u8, 54u8, 18u8, 8u8, 172u8, 148u8, 245u8, 110u8, 174u8, 75u8, - 38u8, 46u8, 143u8, 101u8, 232u8, 65u8, 252u8, 36u8, 152u8, 29u8, 209u8, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::spends::Spends, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "Spends", + (), + [ + 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, + 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, + 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, + 168u8, ], ) } - #[doc = "Void previously approved spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - pub fn void_spend( + #[doc = " Spends that have been approved and being processed."] + pub fn spends( &self, - index: types::void_spend::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::spends::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::spends::Param0, + >, + types::spends::Spends, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TreasuryPallet", - "void_spend", - types::VoidSpend { index }, + "Spends", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 9u8, 212u8, 174u8, 92u8, 43u8, 102u8, 224u8, 124u8, 247u8, 239u8, - 196u8, 68u8, 132u8, 171u8, 116u8, 206u8, 52u8, 23u8, 92u8, 31u8, 156u8, - 160u8, 25u8, 16u8, 125u8, 60u8, 9u8, 109u8, 145u8, 139u8, 102u8, 224u8, + 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, + 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, + 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, + 168u8, + ], + ) + } + #[doc = " The blocknumber for the last triggered spend period."] + pub fn last_spend_period( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::last_spend_period::LastSpendPeriod, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "LastSpendPeriod", + (), + [ + 6u8, 200u8, 107u8, 132u8, 60u8, 31u8, 24u8, 196u8, 108u8, 227u8, 5u8, + 63u8, 249u8, 139u8, 82u8, 140u8, 169u8, 242u8, 118u8, 93u8, 83u8, + 155u8, 120u8, 175u8, 224u8, 227u8, 39u8, 39u8, 255u8, 247u8, 79u8, + 30u8, ], ) } } } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_treasury::pallet::Event; - pub mod events { + pub mod constants { 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 = "We have ended a spend period and will now allocate funds."] - pub struct Spending { - pub budget_remaining: spending::BudgetRemaining, - } - pub mod spending { - use super::runtime_types; - pub type BudgetRemaining = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Spending { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Spending"; - } - #[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 = "Some funds have been allocated."] - pub struct Awarded { - pub proposal_index: awarded::ProposalIndex, - pub award: awarded::Award, - pub account: awarded::Account, + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Period between successive spends."] + pub fn spend_period( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "SpendPeriod", + [ + 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 = " Percentage of spare funds (if any) that are burnt per spend period."] + pub fn burn( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "Burn", + [ + 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, + ], + ) + } + #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] + pub fn pallet_id( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::frame_support::PalletId, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "PalletId", + [ + 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, + 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, + 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, + ], + ) + } + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] + #[doc = ""] + #[doc = " The maximum number of approvals that can wait in the spending queue."] + #[doc = ""] + #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] + pub fn max_approvals( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "MaxApprovals", + [ + 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 period during which an approved treasury spend has to be claimed."] + pub fn payout_period( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "PayoutPeriod", + [ + 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 = " Gets this pallet's derived pot account."] + pub fn pot_account( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "pot_account", + [ + 115u8, 233u8, 13u8, 223u8, 88u8, 20u8, 202u8, 139u8, 153u8, 28u8, + 155u8, 157u8, 224u8, 66u8, 3u8, 250u8, 23u8, 53u8, 88u8, 168u8, 211u8, + 204u8, 122u8, 166u8, 248u8, 23u8, 174u8, 225u8, 99u8, 108u8, 89u8, + 135u8, + ], + ) + } } - pub mod awarded { + } + } + pub mod origins { + use super::{root_mod, runtime_types}; + } + 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; - pub type ProposalIndex = ::core::primitive::u32; - pub type Award = ::core::primitive::u128; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Awarded { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Awarded"; - } - #[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 = "Some of our funds have been burnt."] - pub struct Burnt { - pub burnt_funds: burnt::BurntFunds, - } - pub mod burnt { - use super::runtime_types; - pub type BurntFunds = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burnt { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Burnt"; - } - #[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 = "Spending has finished; this is the amount that rolls over until next spend."] - pub struct Rollover { - pub rollover_balance: rollover::RolloverBalance, - } - pub mod rollover { - use super::runtime_types; - pub type RolloverBalance = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rollover { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Rollover"; - } - #[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 = "Some funds have been deposited."] - pub struct Deposit { - pub value: deposit::Value, - } - pub mod deposit { - use super::runtime_types; - pub type Value = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deposit { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "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 = "A new spend proposal has been approved."] - pub struct SpendApproved { - pub proposal_index: spend_approved::ProposalIndex, - pub amount: spend_approved::Amount, - pub beneficiary: spend_approved::Beneficiary, - } - pub mod spend_approved { - use super::runtime_types; - pub type ProposalIndex = ::core::primitive::u32; - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for SpendApproved { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "SpendApproved"; - } - #[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 inactive funds of the pallet have been updated."] - pub struct UpdatedInactive { - pub reactivated: updated_inactive::Reactivated, - pub deactivated: updated_inactive::Deactivated, - } - pub mod updated_inactive { - use super::runtime_types; - pub type Reactivated = ::core::primitive::u128; - pub type Deactivated = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for UpdatedInactive { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "UpdatedInactive"; - } - #[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 new asset spend proposal has been approved."] - pub struct AssetSpendApproved { - pub index: asset_spend_approved::Index, - pub asset_kind: asset_spend_approved::AssetKind, - pub amount: asset_spend_approved::Amount, - pub beneficiary: asset_spend_approved::Beneficiary, - pub valid_from: asset_spend_approved::ValidFrom, - pub expire_at: asset_spend_approved::ExpireAt, - } - pub mod asset_spend_approved { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type AssetKind = (); - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; - pub type ValidFrom = ::core::primitive::u32; - pub type ExpireAt = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetSpendApproved { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "AssetSpendApproved"; - } - #[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 approved spend was voided."] - pub struct AssetSpendVoided { - pub index: asset_spend_voided::Index, - } - pub mod asset_spend_voided { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetSpendVoided { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "AssetSpendVoided"; - } - #[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 payment happened."] - pub struct Paid { - pub index: paid::Index, - pub payment_id: paid::PaymentId, - } - pub mod paid { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type PaymentId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Paid { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Paid"; - } - #[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 payment failed and can be retried."] - pub struct PaymentFailed { - pub index: payment_failed::Index, - pub payment_id: payment_failed::PaymentId, - } - pub mod payment_failed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type PaymentId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for PaymentFailed { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "PaymentFailed"; - } - #[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 spend was processed and removed from the storage. It might have been successfully"] - #[doc = "paid or it may have expired."] - pub struct SpendProcessed { - pub index: spend_processed::Index, - } - pub mod spend_processed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for SpendProcessed { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "SpendProcessed"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod proposal_count { - use super::runtime_types; - pub type ProposalCount = ::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 = "Send a call through a recovered 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 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 proposals { + pub mod as_recovered { use super::runtime_types; - pub type Proposals = runtime_types::pallet_treasury::Proposal< + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, + (), >; - pub type Param0 = ::core::primitive::u32; - } - pub mod deactivated { - use super::runtime_types; - pub type Deactivated = ::core::primitive::u128; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - pub mod approvals { - use super::runtime_types; - pub type Approvals = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "as_recovered"; } - pub mod spend_count { - use super::runtime_types; - pub type SpendCount = ::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 = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _ROOT_."] + #[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, } - pub mod spends { + pub mod set_recovered { use super::runtime_types; - pub type Spends = runtime_types::pallet_treasury::SpendStatus< + pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, (), - ::core::primitive::u128, + >; + pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, + (), >; - pub type Param0 = ::core::primitive::u32; } - pub mod last_spend_period { - use super::runtime_types; - pub type LastSpendPeriod = ::core::primitive::u32; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "set_recovered"; } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] + #[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 a recovery configuration for your account. This makes your account recoverable."] #[doc = ""] - #[doc = " Number of proposals that have been made."] - pub fn proposal_count( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proposal_count::ProposalCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "ProposalCount", - (), - [ - 91u8, 238u8, 246u8, 106u8, 95u8, 66u8, 83u8, 134u8, 1u8, 225u8, 164u8, - 216u8, 113u8, 101u8, 203u8, 200u8, 113u8, 97u8, 246u8, 228u8, 140u8, - 29u8, 29u8, 48u8, 176u8, 137u8, 93u8, 230u8, 56u8, 75u8, 51u8, 149u8, - ], - ) - } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] + #[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 = " Proposals that have been made."] - pub fn proposals_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proposals::Proposals, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Proposals", - (), - [ - 207u8, 135u8, 145u8, 146u8, 48u8, 10u8, 252u8, 40u8, 20u8, 115u8, - 205u8, 41u8, 173u8, 83u8, 115u8, 46u8, 106u8, 40u8, 130u8, 157u8, - 213u8, 87u8, 45u8, 23u8, 14u8, 167u8, 99u8, 208u8, 153u8, 163u8, 141u8, - 55u8, - ], - ) - } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] + #[doc = "The dispatch origin for this call must be _Signed_."] #[doc = ""] - #[doc = " Proposals that have been made."] - pub fn proposals( - &self, - _0: types::proposals::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proposals::Param0, - >, - types::proposals::Proposals, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Proposals", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 207u8, 135u8, 145u8, 146u8, 48u8, 10u8, 252u8, 40u8, 20u8, 115u8, - 205u8, 41u8, 173u8, 83u8, 115u8, 46u8, 106u8, 40u8, 130u8, 157u8, - 213u8, 87u8, 45u8, 23u8, 14u8, 167u8, 99u8, 208u8, 153u8, 163u8, 141u8, - 55u8, - ], - ) + #[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 = " The amount which has been reported as inactive to Currency."] - pub fn deactivated( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::deactivated::Deactivated, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Deactivated", - (), - [ - 120u8, 221u8, 159u8, 56u8, 161u8, 44u8, 54u8, 233u8, 47u8, 114u8, - 170u8, 150u8, 52u8, 24u8, 137u8, 212u8, 122u8, 247u8, 40u8, 17u8, - 208u8, 130u8, 42u8, 154u8, 33u8, 222u8, 59u8, 116u8, 0u8, 15u8, 79u8, - 123u8, - ], - ) + pub mod create_recovery { + 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; } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] + 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, + :: 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 = "Initiate the process for recovering a recoverable account."] #[doc = ""] - #[doc = " Proposal indices that have been approved but not yet awarded."] - pub fn approvals( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::approvals::Approvals, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Approvals", - (), - [ - 78u8, 147u8, 186u8, 235u8, 17u8, 40u8, 247u8, 235u8, 67u8, 222u8, 3u8, - 14u8, 248u8, 17u8, 67u8, 180u8, 93u8, 161u8, 64u8, 35u8, 119u8, 194u8, - 187u8, 226u8, 135u8, 162u8, 147u8, 174u8, 139u8, 72u8, 99u8, 212u8, - ], - ) + #[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 = "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, } - #[doc = " The count of spends that have been made."] - pub fn spend_count( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::spend_count::SpendCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "SpendCount", + pub mod initiate_recovery { + use super::runtime_types; + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, (), - [ - 220u8, 74u8, 248u8, 52u8, 243u8, 209u8, 42u8, 236u8, 27u8, 98u8, 76u8, - 153u8, 129u8, 176u8, 34u8, 177u8, 33u8, 132u8, 21u8, 71u8, 206u8, - 146u8, 222u8, 44u8, 232u8, 246u8, 205u8, 92u8, 240u8, 136u8, 182u8, - 30u8, - ], - ) + >; } - #[doc = " Spends that have been approved and being processed."] - pub fn spends_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::spends::Spends, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Spends", - (), - [ - 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, - 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, - 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, - 168u8, - ], - ) - } - #[doc = " Spends that have been approved and being processed."] - pub fn spends( - &self, - _0: types::spends::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::spends::Param0, - >, - types::spends::Spends, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Spends", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, - 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, - 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, - 168u8, - ], - ) - } - #[doc = " The blocknumber for the last triggered spend period."] - pub fn last_spend_period( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::last_spend_period::LastSpendPeriod, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "LastSpendPeriod", - (), - [ - 6u8, 200u8, 107u8, 132u8, 60u8, 31u8, 24u8, 196u8, 108u8, 227u8, 5u8, - 63u8, 249u8, 139u8, 82u8, 140u8, 169u8, 242u8, 118u8, 93u8, 83u8, - 155u8, 120u8, 175u8, 224u8, 227u8, 39u8, 39u8, 255u8, 247u8, 79u8, - 30u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " Period between successive spends."] - pub fn spend_period( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "SpendPeriod", - [ - 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 = " Percentage of spare funds (if any) that are burnt per spend period."] - pub fn burn( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_arithmetic::per_things::Permill, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "Burn", - [ - 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, - ], - ) - } - #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] - pub fn pallet_id( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "PalletId", - [ - 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, - 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, - 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, - ], - ) - } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] - #[doc = ""] - #[doc = " The maximum number of approvals that can wait in the spending queue."] - #[doc = ""] - #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] - pub fn max_approvals( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "MaxApprovals", - [ - 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 period during which an approved treasury spend has to be claimed."] - pub fn payout_period( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "PayoutPeriod", - [ - 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 = " Gets this pallet's derived pot account."] - pub fn pot_account( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "pot_account", - [ - 115u8, 233u8, 13u8, 223u8, 88u8, 20u8, 202u8, 139u8, 153u8, 28u8, - 155u8, 157u8, 224u8, 66u8, 3u8, 250u8, 23u8, 53u8, 88u8, 168u8, 211u8, - 204u8, 122u8, 166u8, 248u8, 23u8, 174u8, 225u8, 99u8, 108u8, 89u8, - 135u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for InitiateRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "initiate_recovery"; } - } - } - } - pub mod origins { - use super::{root_mod, runtime_types}; - } - 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, @@ -16110,29 +15090,36 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a call through a recovered account."] + #[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 registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable 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, + #[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 as_recovered { + pub mod vouch_recovery { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + 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 Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsRecovered { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VouchRecovery { const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "as_recovered"; + const CALL: &'static str = "vouch_recovery"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16145,32 +15132,28 @@ 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 = "Allow a successful rescuer to claim their recovered account."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _ROOT_."] + #[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 = "- `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 = "- `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 set_recovered { + pub mod claim_recovery { 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 Account = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRecovered { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimRecovery { const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "set_recovered"; + const CALL: &'static str = "claim_recovery"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16183,164 +15166,8 @@ 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 = ""] - #[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 = "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 create_recovery { - 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; - } - 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, - :: 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 = "Initiate the process for recovering a recoverable account."] - #[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 = ""] - #[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 initiate_recovery { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - 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, - :: 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 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 = ""] - #[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 vouch_recovery { - 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, - (), - >; - } - 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, - :: 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 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 struct ClaimRecovery { - pub account: claim_recovery::Account, - } - pub mod claim_recovery { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - 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, - :: 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 = "As the controller of a recoverable account, close an active recovery"] - #[doc = "process for your account."] + #[doc = "As the controller of a recoverable account, close an active recovery"] + #[doc = "process for your account."] #[doc = ""] #[doc = "Payment: By calling this function, the recoverable account will receive"] #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] @@ -16497,9 +15324,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 62u8, 111u8, 80u8, 232u8, 188u8, 15u8, 202u8, 50u8, 77u8, 223u8, 96u8, - 15u8, 232u8, 213u8, 143u8, 185u8, 200u8, 40u8, 119u8, 120u8, 195u8, - 183u8, 193u8, 129u8, 198u8, 43u8, 220u8, 26u8, 149u8, 14u8, 92u8, 42u8, + 126u8, 156u8, 236u8, 234u8, 175u8, 29u8, 163u8, 235u8, 36u8, 69u8, + 66u8, 210u8, 103u8, 127u8, 94u8, 104u8, 170u8, 113u8, 150u8, 151u8, + 236u8, 43u8, 243u8, 172u8, 194u8, 209u8, 6u8, 137u8, 147u8, 128u8, + 113u8, 236u8, ], ) } @@ -20182,42 +19010,621 @@ 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 = "Some account `who` was created with a deposit from `depositor`."] - pub struct Touched { - pub asset_id: touched::AssetId, - pub who: touched::Who, - pub depositor: touched::Depositor, + #[doc = "Some account `who` was created with a deposit from `depositor`."] + pub struct Touched { + pub asset_id: touched::AssetId, + pub who: touched::Who, + pub depositor: touched::Depositor, + } + pub mod touched { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Depositor = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Touched { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Touched"; + } + #[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 = "Some account `who` was blocked."] + pub struct Blocked { + pub asset_id: blocked::AssetId, + pub who: blocked::Who, + } + pub mod blocked { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Blocked { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "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")] + #[doc = "Some assets were deposited (e.g. for transaction fees)."] + pub struct Deposited { + pub asset_id: deposited::AssetId, + pub who: deposited::Who, + pub amount: deposited::Amount, + } + pub mod deposited { + use super::runtime_types; + pub type AssetId = ::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 Deposited { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Deposited"; + } + #[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 = "Some assets were withdrawn from the account (e.g. for transaction fees)."] + pub struct Withdrawn { + pub asset_id: withdrawn::AssetId, + pub who: withdrawn::Who, + pub amount: withdrawn::Amount, + } + pub mod withdrawn { + use super::runtime_types; + pub type AssetId = ::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 Withdrawn { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Withdrawn"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod asset { + use super::runtime_types; + pub type Asset = runtime_types::pallet_assets::types::AssetDetails< + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; + pub type Param0 = ::core::primitive::u32; + } + pub mod account { + use super::runtime_types; + pub type Account = runtime_types::pallet_assets::types::AssetAccount< + ::core::primitive::u128, + ::core::primitive::u128, + (), + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod approvals { + use super::runtime_types; + pub type Approvals = runtime_types::pallet_assets::types::Approval< + ::core::primitive::u128, + ::core::primitive::u128, + >; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param2 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod metadata { + use super::runtime_types; + pub type Metadata = runtime_types::pallet_assets::types::AssetMetadata< + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >; + pub type Param0 = ::core::primitive::u32; + } + pub mod next_asset_id { + use super::runtime_types; + pub type NextAssetId = ::core::primitive::u32; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Details of an asset."] + pub fn asset_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::asset::Asset, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Asset", + (), + [ + 159u8, 234u8, 177u8, 31u8, 58u8, 51u8, 173u8, 184u8, 250u8, 169u8, + 246u8, 122u8, 54u8, 19u8, 232u8, 60u8, 0u8, 165u8, 12u8, 101u8, 93u8, + 169u8, 23u8, 34u8, 154u8, 44u8, 134u8, 128u8, 97u8, 71u8, 167u8, 224u8, + ], + ) + } + #[doc = " Details of an asset."] + pub fn asset( + &self, + _0: types::asset::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::asset::Param0, + >, + types::asset::Asset, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Asset", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 159u8, 234u8, 177u8, 31u8, 58u8, 51u8, 173u8, 184u8, 250u8, 169u8, + 246u8, 122u8, 54u8, 19u8, 232u8, 60u8, 0u8, 165u8, 12u8, 101u8, 93u8, + 169u8, 23u8, 34u8, 154u8, 44u8, 134u8, 128u8, 97u8, 71u8, 167u8, 224u8, + ], + ) + } + #[doc = " The holdings of a specific account for a specific asset."] + pub fn account_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::account::Account, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Account", + (), + [ + 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, + 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, + 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + ], + ) + } + #[doc = " The holdings of a specific account for a specific asset."] + pub fn account_iter1( + &self, + _0: types::account::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::account::Param0, + >, + types::account::Account, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Account", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, + 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, + 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + ], + ) + } + #[doc = " The holdings of a specific account for a specific asset."] + pub fn account( + &self, + _0: types::account::Param0, + _1: types::account::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::account::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::account::Param1, + >, + ), + types::account::Account, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Account", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, + 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, + 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + ], + ) + } + #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] + #[doc = " is the amount of `T::Currency` reserved for storing this."] + #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] + pub fn approvals_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::approvals::Approvals, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Approvals", + (), + [ + 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, + 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, + 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + ], + ) + } + #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] + #[doc = " is the amount of `T::Currency` reserved for storing this."] + #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] + pub fn approvals_iter1( + &self, + _0: types::approvals::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param0, + >, + types::approvals::Approvals, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Approvals", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, + 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, + 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + ], + ) + } + #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] + #[doc = " is the amount of `T::Currency` reserved for storing this."] + #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] + pub fn approvals_iter2( + &self, + _0: types::approvals::Param0, + _1: types::approvals::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param1, + >, + ), + types::approvals::Approvals, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Approvals", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, + 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, + 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + ], + ) + } + #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] + #[doc = " is the amount of `T::Currency` reserved for storing this."] + #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] + pub fn approvals( + &self, + _0: types::approvals::Param0, + _1: types::approvals::Param1, + _2: types::approvals::Param2, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param1, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param2, + >, + ), + types::approvals::Approvals, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Approvals", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_2), + ), + [ + 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, + 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, + 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + ], + ) + } + #[doc = " Metadata of an asset."] + pub fn metadata_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::metadata::Metadata, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Metadata", + (), + [ + 129u8, 202u8, 244u8, 77u8, 55u8, 81u8, 86u8, 106u8, 20u8, 153u8, 209u8, + 69u8, 199u8, 107u8, 111u8, 49u8, 88u8, 157u8, 84u8, 41u8, 198u8, 190u8, + 234u8, 218u8, 68u8, 207u8, 87u8, 217u8, 73u8, 66u8, 211u8, 163u8, + ], + ) + } + #[doc = " Metadata of an asset."] + pub fn metadata( + &self, + _0: types::metadata::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::metadata::Param0, + >, + types::metadata::Metadata, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Metadata", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 129u8, 202u8, 244u8, 77u8, 55u8, 81u8, 86u8, 106u8, 20u8, 153u8, 209u8, + 69u8, 199u8, 107u8, 111u8, 49u8, 88u8, 157u8, 84u8, 41u8, 198u8, 190u8, + 234u8, 218u8, 68u8, 207u8, 87u8, 217u8, 73u8, 66u8, 211u8, 163u8, + ], + ) + } + #[doc = " The asset ID enforced for the next asset creation, if any present. Otherwise, this storage"] + #[doc = " item has no effect."] + #[doc = ""] + #[doc = " This can be useful for setting up constraints for IDs of the new assets. For example, by"] + #[doc = " providing an initial [`NextAssetId`] and using the [`crate::AutoIncAssetId`] callback, an"] + #[doc = " auto-increment model can be applied to all new asset IDs."] + #[doc = ""] + #[doc = " The initial next asset ID can be set using the [`GenesisConfig`] or the"] + #[doc = " [SetNextAssetId](`migration::next_asset_id::SetNextAssetId`) migration."] + pub fn next_asset_id( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::next_asset_id::NextAssetId, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "NextAssetId", + (), + [ + 15u8, 61u8, 40u8, 217u8, 236u8, 34u8, 95u8, 53u8, 159u8, 182u8, 70u8, + 251u8, 234u8, 188u8, 115u8, 23u8, 199u8, 118u8, 220u8, 40u8, 147u8, + 174u8, 247u8, 129u8, 246u8, 107u8, 178u8, 43u8, 8u8, 19u8, 74u8, 116u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Max number of items to destroy per `destroy_accounts` and `destroy_approvals` call."] + #[doc = ""] + #[doc = " Must be configured to result in a weight that makes each call fit in a block."] + pub fn remove_items_limit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "RemoveItemsLimit", + [ + 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 basic amount of funds that must be reserved for an asset."] + pub fn asset_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "AssetDeposit", + [ + 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 amount of funds that must be reserved for a non-provider asset account to be"] + #[doc = " maintained."] + pub fn asset_account_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "AssetAccountDeposit", + [ + 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 basic amount of funds that must be reserved when adding metadata to your asset."] + pub fn metadata_deposit_base( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "MetadataDepositBase", + [ + 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 additional funds that must be reserved for the number of bytes you store in your"] + #[doc = " metadata."] + pub fn metadata_deposit_per_byte( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "MetadataDepositPerByte", + [ + 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 amount of funds that must be reserved when creating a new approval."] + pub fn approval_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "ApprovalDeposit", + [ + 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 length of a name or symbol stored on-chain."] + pub fn string_limit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "StringLimit", + [ + 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, + ], + ) + } + } + } + } + pub mod assets_holder { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_assets_holder::pallet::Error; + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_assets_holder::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 = "`who`s balance on hold was increased by `amount`."] + pub struct Held { + pub who: held::Who, + pub asset_id: held::AssetId, + pub reason: held::Reason, + pub amount: held::Amount, } - pub mod touched { + pub mod held { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Depositor = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Touched { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Touched"; - } - #[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 = "Some account `who` was blocked."] - pub struct Blocked { - pub asset_id: blocked::AssetId, - pub who: blocked::Who, - } - pub mod blocked { - use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Blocked { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Blocked"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Held { + const PALLET: &'static str = "AssetsHolder"; + const EVENT: &'static str = "Held"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20226,21 +19633,23 @@ 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 = "Some assets were deposited (e.g. for transaction fees)."] - pub struct Deposited { - pub asset_id: deposited::AssetId, - pub who: deposited::Who, - pub amount: deposited::Amount, + #[doc = "`who`s balance on hold was decreased by `amount`."] + pub struct Released { + pub who: released::Who, + pub asset_id: released::AssetId, + pub reason: released::Reason, + pub amount: released::Amount, } - pub mod deposited { + pub mod released { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type AssetId = ::core::primitive::u32; + pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deposited { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Deposited"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Released { + const PALLET: &'static str = "AssetsHolder"; + const EVENT: &'static str = "Released"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20249,528 +19658,661 @@ 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 = "Some assets were withdrawn from the account (e.g. for transaction fees)."] - pub struct Withdrawn { - pub asset_id: withdrawn::AssetId, - pub who: withdrawn::Who, - pub amount: withdrawn::Amount, + #[doc = "`who`s balance on hold was burned by `amount`."] + pub struct Burned { + pub who: burned::Who, + pub asset_id: burned::AssetId, + pub reason: burned::Reason, + pub amount: burned::Amount, } - pub mod withdrawn { + pub mod burned { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type AssetId = ::core::primitive::u32; + pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Withdrawn { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Withdrawn"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { + const PALLET: &'static str = "AssetsHolder"; + const EVENT: &'static str = "Burned"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod asset { - use super::runtime_types; - pub type Asset = runtime_types::pallet_assets::types::AssetDetails< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod account { + pub mod holds { use super::runtime_types; - pub type Account = runtime_types::pallet_assets::types::AssetAccount< - ::core::primitive::u128, - ::core::primitive::u128, - (), - ::subxt::ext::subxt_core::utils::AccountId32, + pub type Holds = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + runtime_types::quantus_runtime::RuntimeHoldReason, + ::core::primitive::u128, + >, >; pub type Param0 = ::core::primitive::u32; pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod approvals { + pub mod balances_on_hold { use super::runtime_types; - pub type Approvals = runtime_types::pallet_assets::types::Approval< - ::core::primitive::u128, - ::core::primitive::u128, - >; + pub type BalancesOnHold = ::core::primitive::u128; pub type Param0 = ::core::primitive::u32; pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param2 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod metadata { - use super::runtime_types; - pub type Metadata = runtime_types::pallet_assets::types::AssetMetadata< - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod next_asset_id { - use super::runtime_types; - pub type NextAssetId = ::core::primitive::u32; } } pub struct StorageApi; impl StorageApi { - #[doc = " Details of an asset."] - pub fn asset_iter( + #[doc = " A map that stores holds applied on an account for a given AssetId."] + pub fn holds_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::asset::Asset, - (), + types::holds::Holds, (), ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Asset", - (), - [ - 159u8, 234u8, 177u8, 31u8, 58u8, 51u8, 173u8, 184u8, 250u8, 169u8, - 246u8, 122u8, 54u8, 19u8, 232u8, 60u8, 0u8, 165u8, 12u8, 101u8, 93u8, - 169u8, 23u8, 34u8, 154u8, 44u8, 134u8, 128u8, 97u8, 71u8, 167u8, 224u8, - ], - ) - } - #[doc = " Details of an asset."] - pub fn asset( - &self, - _0: types::asset::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::asset::Param0, - >, - types::asset::Asset, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Asset", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 159u8, 234u8, 177u8, 31u8, 58u8, 51u8, 173u8, 184u8, 250u8, 169u8, - 246u8, 122u8, 54u8, 19u8, 232u8, 60u8, 0u8, 165u8, 12u8, 101u8, 93u8, - 169u8, 23u8, 34u8, 154u8, 44u8, 134u8, 128u8, 97u8, 71u8, 167u8, 224u8, - ], - ) - } - #[doc = " The holdings of a specific account for a specific asset."] - pub fn account_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::account::Account, - (), - (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Account", + "AssetsHolder", + "Holds", (), [ - 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, - 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, - 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, + 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, + 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, + 41u8, ], ) } - #[doc = " The holdings of a specific account for a specific asset."] - pub fn account_iter1( + #[doc = " A map that stores holds applied on an account for a given AssetId."] + pub fn holds_iter1( &self, - _0: types::account::Param0, + _0: types::holds::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param0, + types::holds::Param0, >, - types::account::Account, - (), + types::holds::Holds, (), ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Account", + "AssetsHolder", + "Holds", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, - 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, - 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, + 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, + 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, + 41u8, ], ) } - #[doc = " The holdings of a specific account for a specific asset."] - pub fn account( + #[doc = " A map that stores holds applied on an account for a given AssetId."] + pub fn holds( &self, - _0: types::account::Param0, - _1: types::account::Param1, + _0: types::holds::Param0, + _1: types::holds::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param0, + types::holds::Param0, >, ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param1, + types::holds::Param1, >, ), - types::account::Account, + types::holds::Holds, + ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, - (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Account", + "AssetsHolder", + "Holds", ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), ), [ - 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, - 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, - 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, + 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, + 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, + 41u8, ], ) } - #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] - #[doc = " is the amount of `T::Currency` reserved for storing this."] - #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] - pub fn approvals_iter( + #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] + pub fn balances_on_hold_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::approvals::Approvals, + types::balances_on_hold::BalancesOnHold, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Approvals", + "AssetsHolder", + "BalancesOnHold", (), [ - 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, - 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, - 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, + 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, + 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, ], ) } - #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] - #[doc = " is the amount of `T::Currency` reserved for storing this."] - #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] - pub fn approvals_iter1( + #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] + pub fn balances_on_hold_iter1( &self, - _0: types::approvals::Param0, + _0: types::balances_on_hold::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::approvals::Param0, + types::balances_on_hold::Param0, >, - types::approvals::Approvals, + types::balances_on_hold::BalancesOnHold, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Approvals", + "AssetsHolder", + "BalancesOnHold", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, - 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, - 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, - ], - ) - } - #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] - #[doc = " is the amount of `T::Currency` reserved for storing this."] - #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] - pub fn approvals_iter2( - &self, - _0: types::approvals::Param0, - _1: types::approvals::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::approvals::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::approvals::Param1, - >, - ), - types::approvals::Approvals, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Approvals", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, - 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, - 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, + 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, + 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, ], ) } - #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] - #[doc = " is the amount of `T::Currency` reserved for storing this."] - #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] - pub fn approvals( + #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] + pub fn balances_on_hold( &self, - _0: types::approvals::Param0, - _1: types::approvals::Param1, - _2: types::approvals::Param2, + _0: types::balances_on_hold::Param0, + _1: types::balances_on_hold::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::approvals::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::approvals::Param1, + types::balances_on_hold::Param0, >, ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::approvals::Param2, + types::balances_on_hold::Param1, >, ), - types::approvals::Approvals, + types::balances_on_hold::BalancesOnHold, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Approvals", + "AssetsHolder", + "BalancesOnHold", ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_2), ), [ - 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, - 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, - 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, + 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, + 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, ], ) } - #[doc = " Metadata of an asset."] - pub fn metadata_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::metadata::Metadata, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Metadata", - (), - [ - 129u8, 202u8, 244u8, 77u8, 55u8, 81u8, 86u8, 106u8, 20u8, 153u8, 209u8, - 69u8, 199u8, 107u8, 111u8, 49u8, 88u8, 157u8, 84u8, 41u8, 198u8, 190u8, - 234u8, 218u8, 68u8, 207u8, 87u8, 217u8, 73u8, 66u8, 211u8, 163u8, - ], - ) + } + } + } + pub mod multisig { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_multisig::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_multisig::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 = "Create a new multisig account"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = ""] + #[doc = "The multisig address is derived from a hash of all signers + global nonce."] + #[doc = "The creator must pay a non-refundable fee (burned)."] + pub struct CreateMultisig { + pub signers: create_multisig::Signers, + pub threshold: create_multisig::Threshold, + } + pub mod create_multisig { + use super::runtime_types; + pub type Signers = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Threshold = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateMultisig { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "create_multisig"; + } + #[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 = "Propose a transaction to be executed by the multisig"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] + #[doc = ""] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (refundable - returned immediately on execution/cancellation)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before creating a new proposal, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers. This is the primary"] + #[doc = "cleanup mechanism."] + #[doc = ""] + #[doc = "**For threshold=1:** If the multisig threshold is 1, the proposal executes immediately."] + pub struct Propose { + pub multisig_address: propose::MultisigAddress, + pub call: propose::Call, + pub expiry: propose::Expiry, + } + pub mod propose { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Call = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Expiry = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Propose { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "propose"; + } + #[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 a proposed transaction"] + #[doc = ""] + #[doc = "If this approval brings the total approvals to or above the threshold,"] + #[doc = "the transaction will be automatically executed."] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before processing the approval, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size and MAX expired proposals, refunds based on actual"] + pub struct Approve { + pub multisig_address: approve::MultisigAddress, + pub proposal_id: approve::ProposalId, + } + pub mod approve { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Approve { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "approve"; + } + #[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 proposed transaction (only by proposer)"] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before processing the cancellation, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size and MAX expired proposals, refunds based on actual"] + pub struct Cancel { + pub multisig_address: cancel::MultisigAddress, + pub proposal_id: cancel::ProposalId, + } + pub mod cancel { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "Multisig"; + 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" + )] + #[doc = "Remove expired proposals and return deposits to proposers"] + #[doc = ""] + #[doc = "Can only be called by signers of the multisig."] + #[doc = "Only removes Active proposals that have expired (past expiry block)."] + #[doc = "Executed and Cancelled proposals are automatically cleaned up immediately."] + #[doc = ""] + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows any signer to help clean up storage even if proposer is inactive."] + pub struct RemoveExpired { + pub multisig_address: remove_expired::MultisigAddress, + pub proposal_id: remove_expired::ProposalId, + } + pub mod remove_expired { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveExpired { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "remove_expired"; + } + #[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 = "Claim all deposits from expired proposals"] + #[doc = ""] + #[doc = "This is a batch operation that removes all expired proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Active and past expiry block"] + #[doc = ""] + #[doc = "Note: Executed and Cancelled proposals are automatically cleaned up immediately,"] + #[doc = "so only Active+Expired proposals need manual cleanup."] + #[doc = ""] + #[doc = "Returns all proposal deposits to the proposer in a single transaction."] + pub struct ClaimDeposits { + pub multisig_address: claim_deposits::MultisigAddress, } - #[doc = " Metadata of an asset."] - pub fn metadata( - &self, - _0: types::metadata::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata::Param0, - >, - types::metadata::Metadata, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Metadata", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 129u8, 202u8, 244u8, 77u8, 55u8, 81u8, 86u8, 106u8, 20u8, 153u8, 209u8, - 69u8, 199u8, 107u8, 111u8, 49u8, 88u8, 157u8, 84u8, 41u8, 198u8, 190u8, - 234u8, 218u8, 68u8, 207u8, 87u8, 217u8, 73u8, 66u8, 211u8, 163u8, - ], - ) + pub mod claim_deposits { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; } - #[doc = " The asset ID enforced for the next asset creation, if any present. Otherwise, this storage"] - #[doc = " item has no effect."] + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimDeposits { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "claim_deposits"; + } + #[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 = "Dissolve (remove) a multisig and recover the creation deposit."] #[doc = ""] - #[doc = " This can be useful for setting up constraints for IDs of the new assets. For example, by"] - #[doc = " providing an initial [`NextAssetId`] and using the [`crate::AutoIncAssetId`] callback, an"] - #[doc = " auto-increment model can be applied to all new asset IDs."] + #[doc = "Requirements:"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up."] + #[doc = "- Multisig account balance must be zero."] + #[doc = "- Can be called by the creator OR any signer."] #[doc = ""] - #[doc = " The initial next asset ID can be set using the [`GenesisConfig`] or the"] - #[doc = " [SetNextAssetId](`migration::next_asset_id::SetNextAssetId`) migration."] - pub fn next_asset_id( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_asset_id::NextAssetId, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "NextAssetId", - (), - [ - 15u8, 61u8, 40u8, 217u8, 236u8, 34u8, 95u8, 53u8, 159u8, 182u8, 70u8, - 251u8, 234u8, 188u8, 115u8, 23u8, 199u8, 118u8, 220u8, 40u8, 147u8, - 174u8, 247u8, 129u8, 246u8, 107u8, 178u8, 43u8, 8u8, 19u8, 74u8, 116u8, - ], - ) + #[doc = "The deposit is ALWAYS returned to the original `creator` stored in `MultisigData`."] + pub struct DissolveMultisig { + pub multisig_address: dissolve_multisig::MultisigAddress, + } + pub mod dissolve_multisig { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DissolveMultisig { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "dissolve_multisig"; } } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " Max number of items to destroy per `destroy_accounts` and `destroy_approvals` call."] + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Create a new multisig account"] #[doc = ""] - #[doc = " Must be configured to result in a weight that makes each call fit in a block."] - pub fn remove_items_limit( + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = ""] + #[doc = "The multisig address is derived from a hash of all signers + global nonce."] + #[doc = "The creator must pay a non-refundable fee (burned)."] + pub fn create_multisig( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "RemoveItemsLimit", + signers: types::create_multisig::Signers, + threshold: types::create_multisig::Threshold, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "create_multisig", + types::CreateMultisig { signers, threshold }, [ - 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, 16u8, 24u8, 202u8, 226u8, 192u8, 244u8, 3u8, 112u8, 49u8, 179u8, + 60u8, 108u8, 206u8, 77u8, 130u8, 112u8, 243u8, 163u8, 11u8, 239u8, + 153u8, 232u8, 78u8, 27u8, 44u8, 88u8, 181u8, 65u8, 151u8, 98u8, 130u8, ], ) } - #[doc = " The basic amount of funds that must be reserved for an asset."] - pub fn asset_deposit( + #[doc = "Propose a transaction to be executed by the multisig"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] + #[doc = ""] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (refundable - returned immediately on execution/cancellation)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before creating a new proposal, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers. This is the primary"] + #[doc = "cleanup mechanism."] + #[doc = ""] + #[doc = "**For threshold=1:** If the multisig threshold is 1, the proposal executes immediately."] + pub fn propose( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "AssetDeposit", + multisig_address: types::propose::MultisigAddress, + call: types::propose::Call, + expiry: types::propose::Expiry, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "propose", + types::Propose { multisig_address, call, expiry }, [ - 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, + 131u8, 107u8, 67u8, 245u8, 123u8, 74u8, 248u8, 60u8, 181u8, 88u8, + 135u8, 198u8, 188u8, 160u8, 34u8, 137u8, 7u8, 126u8, 45u8, 169u8, + 212u8, 30u8, 251u8, 147u8, 167u8, 166u8, 76u8, 70u8, 155u8, 222u8, + 70u8, 143u8, ], ) } - #[doc = " The amount of funds that must be reserved for a non-provider asset account to be"] - #[doc = " maintained."] - pub fn asset_account_deposit( + #[doc = "Approve a proposed transaction"] + #[doc = ""] + #[doc = "If this approval brings the total approvals to or above the threshold,"] + #[doc = "the transaction will be automatically executed."] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before processing the approval, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size and MAX expired proposals, refunds based on actual"] + pub fn approve( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "AssetAccountDeposit", + multisig_address: types::approve::MultisigAddress, + proposal_id: types::approve::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "approve", + types::Approve { multisig_address, proposal_id }, [ - 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, + 9u8, 56u8, 186u8, 135u8, 222u8, 23u8, 37u8, 64u8, 123u8, 199u8, 205u8, + 29u8, 216u8, 128u8, 37u8, 185u8, 170u8, 121u8, 75u8, 100u8, 198u8, + 80u8, 16u8, 249u8, 170u8, 91u8, 162u8, 201u8, 215u8, 81u8, 87u8, 190u8, ], ) } - #[doc = " The basic amount of funds that must be reserved when adding metadata to your asset."] - pub fn metadata_deposit_base( + #[doc = "Cancel a proposed transaction (only by proposer)"] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before processing the cancellation, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size and MAX expired proposals, refunds based on actual"] + pub fn cancel( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "MetadataDepositBase", + multisig_address: types::cancel::MultisigAddress, + proposal_id: types::cancel::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "cancel", + types::Cancel { multisig_address, proposal_id }, [ - 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, + 83u8, 189u8, 89u8, 213u8, 70u8, 183u8, 216u8, 57u8, 226u8, 67u8, 212u8, + 60u8, 59u8, 44u8, 49u8, 165u8, 181u8, 189u8, 26u8, 92u8, 49u8, 185u8, + 224u8, 47u8, 81u8, 111u8, 51u8, 142u8, 165u8, 219u8, 103u8, 82u8, ], ) } - #[doc = " The additional funds that must be reserved for the number of bytes you store in your"] - #[doc = " metadata."] - pub fn metadata_deposit_per_byte( + #[doc = "Remove expired proposals and return deposits to proposers"] + #[doc = ""] + #[doc = "Can only be called by signers of the multisig."] + #[doc = "Only removes Active proposals that have expired (past expiry block)."] + #[doc = "Executed and Cancelled proposals are automatically cleaned up immediately."] + #[doc = ""] + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows any signer to help clean up storage even if proposer is inactive."] + pub fn remove_expired( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "MetadataDepositPerByte", + multisig_address: types::remove_expired::MultisigAddress, + proposal_id: types::remove_expired::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "remove_expired", + types::RemoveExpired { multisig_address, proposal_id }, [ - 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, + 94u8, 78u8, 117u8, 103u8, 202u8, 220u8, 114u8, 15u8, 215u8, 2u8, 39u8, + 23u8, 128u8, 151u8, 103u8, 78u8, 66u8, 116u8, 182u8, 1u8, 28u8, 44u8, + 111u8, 170u8, 201u8, 171u8, 248u8, 36u8, 71u8, 228u8, 85u8, 82u8, ], ) } - #[doc = " The amount of funds that must be reserved when creating a new approval."] - pub fn approval_deposit( + #[doc = "Claim all deposits from expired proposals"] + #[doc = ""] + #[doc = "This is a batch operation that removes all expired proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Active and past expiry block"] + #[doc = ""] + #[doc = "Note: Executed and Cancelled proposals are automatically cleaned up immediately,"] + #[doc = "so only Active+Expired proposals need manual cleanup."] + #[doc = ""] + #[doc = "Returns all proposal deposits to the proposer in a single transaction."] + pub fn claim_deposits( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "ApprovalDeposit", + multisig_address: types::claim_deposits::MultisigAddress, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "claim_deposits", + types::ClaimDeposits { multisig_address }, [ - 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, + 59u8, 70u8, 208u8, 192u8, 13u8, 245u8, 227u8, 53u8, 105u8, 236u8, 5u8, + 102u8, 28u8, 173u8, 134u8, 39u8, 125u8, 165u8, 106u8, 119u8, 150u8, + 100u8, 57u8, 209u8, 37u8, 154u8, 51u8, 66u8, 66u8, 110u8, 57u8, 199u8, ], ) } - #[doc = " The maximum length of a name or symbol stored on-chain."] - pub fn string_limit( + #[doc = "Dissolve (remove) a multisig and recover the creation deposit."] + #[doc = ""] + #[doc = "Requirements:"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up."] + #[doc = "- Multisig account balance must be zero."] + #[doc = "- Can be called by the creator OR any signer."] + #[doc = ""] + #[doc = "The deposit is ALWAYS returned to the original `creator` stored in `MultisigData`."] + pub fn dissolve_multisig( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "StringLimit", + multisig_address: types::dissolve_multisig::MultisigAddress, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "dissolve_multisig", + types::DissolveMultisig { multisig_address }, [ - 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, + 2u8, 71u8, 80u8, 125u8, 58u8, 244u8, 234u8, 154u8, 158u8, 71u8, 21u8, + 125u8, 188u8, 116u8, 1u8, 232u8, 43u8, 105u8, 162u8, 156u8, 132u8, + 57u8, 252u8, 187u8, 139u8, 106u8, 160u8, 157u8, 159u8, 64u8, 140u8, + 239u8, ], ) } } } - } - pub mod assets_holder { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_assets_holder::pallet::Error; #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_assets_holder::pallet::Event; + pub type Event = runtime_types::pallet_multisig::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -20780,23 +20322,157 @@ 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 = "`who`s balance on hold was increased by `amount`."] - pub struct Held { - pub who: held::Who, - pub asset_id: held::AssetId, - pub reason: held::Reason, - pub amount: held::Amount, - } - pub mod held { + #[doc = "A new multisig account was created"] + #[doc = "[creator, multisig_address, signers, threshold, nonce]"] + pub struct MultisigCreated { + pub creator: multisig_created::Creator, + pub multisig_address: multisig_created::MultisigAddress, + pub signers: multisig_created::Signers, + pub threshold: multisig_created::Threshold, + pub nonce: multisig_created::Nonce, + } + pub mod multisig_created { + use super::runtime_types; + pub type Creator = ::subxt::ext::subxt_core::utils::AccountId32; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Signers = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Threshold = ::core::primitive::u32; + pub type Nonce = ::core::primitive::u64; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MultisigCreated { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigCreated"; + } + #[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 created"] + pub struct ProposalCreated { + pub multisig_address: proposal_created::MultisigAddress, + pub proposer: proposal_created::Proposer, + pub proposal_id: proposal_created::ProposalId, + } + pub mod proposal_created { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalCreated { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalCreated"; + } + #[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 approved by a signer"] + pub struct ProposalApproved { + pub multisig_address: proposal_approved::MultisigAddress, + pub approver: proposal_approved::Approver, + pub proposal_id: proposal_approved::ProposalId, + pub approvals_count: proposal_approved::ApprovalsCount, + } + pub mod proposal_approved { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Approver = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + pub type ApprovalsCount = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalApproved { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalApproved"; + } + #[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 executed"] + #[doc = "Contains all data needed for indexing by SubSquid"] + pub struct ProposalExecuted { + pub multisig_address: proposal_executed::MultisigAddress, + pub proposal_id: proposal_executed::ProposalId, + pub proposer: proposal_executed::Proposer, + pub call: proposal_executed::Call, + pub approvers: proposal_executed::Approvers, + pub result: proposal_executed::Result, + } + pub mod proposal_executed { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Call = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Approvers = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalExecuted { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalExecuted"; + } + #[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 cancelled by the proposer"] + pub struct ProposalCancelled { + pub multisig_address: proposal_cancelled::MultisigAddress, + pub proposer: proposal_cancelled::Proposer, + pub proposal_id: proposal_cancelled::ProposalId, + } + pub mod proposal_cancelled { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalCancelled { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalCancelled"; + } + #[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 = "Expired proposal was removed from storage"] + pub struct ProposalRemoved { + pub multisig_address: proposal_removed::MultisigAddress, + pub proposal_id: proposal_removed::ProposalId, + pub proposer: proposal_removed::Proposer, + pub removed_by: proposal_removed::RemovedBy, + } + pub mod proposal_removed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type AssetId = ::core::primitive::u32; - pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; - pub type Amount = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RemovedBy = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Held { - const PALLET: &'static str = "AssetsHolder"; - const EVENT: &'static str = "Held"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalRemoved { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalRemoved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20805,23 +20481,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 = "`who`s balance on hold was decreased by `amount`."] - pub struct Released { - pub who: released::Who, - pub asset_id: released::AssetId, - pub reason: released::Reason, - pub amount: released::Amount, - } - pub mod released { + #[doc = "Batch deposits claimed"] + pub struct DepositsClaimed { + pub multisig_address: deposits_claimed::MultisigAddress, + pub claimer: deposits_claimed::Claimer, + pub total_returned: deposits_claimed::TotalReturned, + pub proposals_removed: deposits_claimed::ProposalsRemoved, + pub multisig_removed: deposits_claimed::MultisigRemoved, + } + pub mod deposits_claimed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type AssetId = ::core::primitive::u32; - pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; - pub type Amount = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Claimer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type TotalReturned = ::core::primitive::u128; + pub type ProposalsRemoved = ::core::primitive::u32; + pub type MultisigRemoved = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Released { - const PALLET: &'static str = "AssetsHolder"; - const EVENT: &'static str = "Released"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositsClaimed { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "DepositsClaimed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20830,205 +20508,387 @@ 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 = "`who`s balance on hold was burned by `amount`."] - pub struct Burned { - pub who: burned::Who, - pub asset_id: burned::AssetId, - pub reason: burned::Reason, - pub amount: burned::Amount, + #[doc = "A multisig account was dissolved and deposit returned"] + pub struct MultisigDissolved { + pub multisig_address: multisig_dissolved::MultisigAddress, + pub caller: multisig_dissolved::Caller, + pub deposit_returned: multisig_dissolved::DepositReturned, } - pub mod burned { + pub mod multisig_dissolved { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type AssetId = ::core::primitive::u32; - pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; - pub type Amount = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Caller = ::subxt::ext::subxt_core::utils::AccountId32; + pub type DepositReturned = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { - const PALLET: &'static str = "AssetsHolder"; - const EVENT: &'static str = "Burned"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MultisigDissolved { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigDissolved"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod holds { + pub mod global_nonce { use super::runtime_types; - pub type Holds = runtime_types::bounded_collections::bounded_vec::BoundedVec< - runtime_types::frame_support::traits::tokens::misc::IdAmount< - runtime_types::quantus_runtime::RuntimeHoldReason, - ::core::primitive::u128, + pub type GlobalNonce = ::core::primitive::u64; + } + pub mod multisigs { + use super::runtime_types; + pub type Multisigs = runtime_types::pallet_multisig::MultisigData< + ::core::primitive::u32, + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_btree_map::BoundedBTreeMap< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, >, >; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod balances_on_hold { + pub mod proposals { use super::runtime_types; - pub type BalancesOnHold = ::core::primitive::u128; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Proposals = runtime_types::pallet_multisig::ProposalData< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + 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 = ::core::primitive::u32; } } pub struct StorageApi; impl StorageApi { - #[doc = " A map that stores holds applied on an account for a given AssetId."] - pub fn holds_iter( + #[doc = " Global nonce for generating unique multisig addresses"] + pub fn global_nonce( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::holds::Holds, - (), + types::global_nonce::GlobalNonce, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "Holds", + "Multisig", + "GlobalNonce", (), [ - 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, - 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, - 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, - 41u8, + 119u8, 119u8, 84u8, 141u8, 83u8, 67u8, 42u8, 83u8, 51u8, 196u8, 185u8, + 39u8, 227u8, 125u8, 142u8, 154u8, 107u8, 62u8, 127u8, 13u8, 54u8, + 114u8, 201u8, 6u8, 100u8, 28u8, 202u8, 152u8, 246u8, 202u8, 9u8, 29u8, ], ) } - #[doc = " A map that stores holds applied on an account for a given AssetId."] - pub fn holds_iter1( + #[doc = " Multisigs stored by their generated address"] + pub fn multisigs_iter( &self, - _0: types::holds::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::multisigs::Multisigs, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Multisig", + "Multisigs", + (), + [ + 95u8, 91u8, 215u8, 222u8, 132u8, 122u8, 22u8, 101u8, 197u8, 243u8, + 217u8, 12u8, 255u8, 230u8, 38u8, 200u8, 69u8, 179u8, 47u8, 227u8, 70u8, + 230u8, 25u8, 50u8, 224u8, 85u8, 127u8, 189u8, 241u8, 183u8, 21u8, 32u8, + ], + ) + } + #[doc = " Multisigs stored by their generated address"] + pub fn multisigs( + &self, + _0: types::multisigs::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param0, + types::multisigs::Param0, >, - types::holds::Holds, + types::multisigs::Multisigs, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Multisig", + "Multisigs", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 95u8, 91u8, 215u8, 222u8, 132u8, 122u8, 22u8, 101u8, 197u8, 243u8, + 217u8, 12u8, 255u8, 230u8, 38u8, 200u8, 69u8, 179u8, 47u8, 227u8, 70u8, + 230u8, 25u8, 50u8, 224u8, 85u8, 127u8, 189u8, 241u8, 183u8, 21u8, 32u8, + ], + ) + } + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::proposals::Proposals, + (), (), ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Multisig", + "Proposals", + (), + [ + 91u8, 232u8, 160u8, 102u8, 108u8, 104u8, 162u8, 6u8, 45u8, 30u8, 146u8, + 207u8, 18u8, 43u8, 197u8, 37u8, 166u8, 99u8, 30u8, 17u8, 46u8, 210u8, + 56u8, 209u8, 9u8, 35u8, 221u8, 140u8, 178u8, 248u8, 249u8, 214u8, + ], + ) + } + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals_iter1( + &self, + _0: types::proposals::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::proposals::Param0, + >, + types::proposals::Proposals, + (), + (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "Holds", + "Multisig", + "Proposals", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, - 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, - 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, - 41u8, + 91u8, 232u8, 160u8, 102u8, 108u8, 104u8, 162u8, 6u8, 45u8, 30u8, 146u8, + 207u8, 18u8, 43u8, 197u8, 37u8, 166u8, 99u8, 30u8, 17u8, 46u8, 210u8, + 56u8, 209u8, 9u8, 35u8, 221u8, 140u8, 178u8, 248u8, 249u8, 214u8, ], ) } - #[doc = " A map that stores holds applied on an account for a given AssetId."] - pub fn holds( + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals( &self, - _0: types::holds::Param0, - _1: types::holds::Param1, + _0: types::proposals::Param0, + _1: types::proposals::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param0, + types::proposals::Param0, >, ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param1, + types::proposals::Param1, >, ), - types::holds::Holds, - ::subxt::ext::subxt_core::utils::Yes, + types::proposals::Proposals, ::subxt::ext::subxt_core::utils::Yes, (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Multisig", + "Proposals", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 91u8, 232u8, 160u8, 102u8, 108u8, 104u8, 162u8, 6u8, 45u8, 30u8, 146u8, + 207u8, 18u8, 43u8, 197u8, 37u8, 166u8, 99u8, 30u8, 17u8, 46u8, 210u8, + 56u8, 209u8, 9u8, 35u8, 221u8, 140u8, 178u8, 248u8, 249u8, 214u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Maximum number of signers allowed in a multisig"] + pub fn max_signers( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "MaxSigners", + [ + 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 total number of proposals in storage per multisig (Active + Executed +"] + #[doc = " Cancelled) This prevents unbounded storage growth and incentivizes cleanup"] + pub fn max_total_proposals_in_storage( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "MaxTotalProposalsInStorage", + [ + 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 an encoded call"] + pub fn max_call_size( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "MaxCallSize", + [ + 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 = " Fee charged for creating a multisig (non-refundable, burned)"] + pub fn multisig_fee( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "MultisigFee", + [ + 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 = " Deposit reserved for creating a multisig (returned when dissolved)."] + #[doc = " Keeps the state clean by incentivizing removal of unused multisigs."] + pub fn multisig_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "MultisigDeposit", + [ + 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 = " Deposit required per proposal (returned on execute or cancel)"] + pub fn proposal_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "ProposalDeposit", + [ + 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 = " Fee charged for creating a proposal (non-refundable, paid always)"] + pub fn proposal_fee( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "Holds", - ( - ::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( + "Multisig", + "ProposalFee", [ - 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, - 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, - 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, - 41u8, + 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 = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold_iter( + #[doc = " Percentage increase in ProposalFee for each signer in the multisig."] + #[doc = ""] + #[doc = " Formula: `FinalFee = ProposalFee + (ProposalFee * SignerCount * SignerStepFactor)`"] + #[doc = " Example: If Fee=100, Signers=5, Factor=1%, then Extra = 100 * 5 * 0.01 = 5. Total = 105."] + pub fn signer_step_factor( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::balances_on_hold::BalancesOnHold, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "BalancesOnHold", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "SignerStepFactor", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 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, ], ) } - #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold_iter1( + #[doc = " Pallet ID for generating multisig addresses"] + pub fn pallet_id( &self, - _0: types::balances_on_hold::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param0, - >, - types::balances_on_hold::BalancesOnHold, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::frame_support::PalletId, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "BalancesOnHold", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "PalletId", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, + 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, + 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, ], ) } - #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold( + #[doc = " Maximum duration (in blocks) that a proposal can be set to expire in the future."] + #[doc = " This prevents proposals from being created with extremely far expiry dates"] + #[doc = " that would lock deposits and bloat storage for extended periods."] + #[doc = ""] + #[doc = " Example: If set to 100_000 blocks (~2 weeks at 12s blocks),"] + #[doc = " a proposal created at block 1000 cannot have expiry > 101_000."] + pub fn max_expiry_duration( &self, - _0: types::balances_on_hold::Param0, - _1: types::balances_on_hold::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param1, - >, - ), - types::balances_on_hold::BalancesOnHold, - ::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( - "AssetsHolder", - "BalancesOnHold", - ( - ::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( + "Multisig", + "MaxExpiryDuration", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 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, ], ) } @@ -21327,6 +21187,7 @@ pub mod api { pub mod transfer_count { use super::runtime_types; pub type TransferCount = ::core::primitive::u64; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } } pub struct StorageApi; @@ -21424,24 +21285,49 @@ pub mod api { ) } #[doc = " Transfer count for all wormhole transfers"] - pub fn transfer_count( + pub fn transfer_count_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), types::transfer_count::TransferCount, + (), ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Wormhole", "TransferCount", (), [ - 105u8, 10u8, 160u8, 118u8, 193u8, 131u8, 207u8, 188u8, 78u8, 238u8, - 252u8, 99u8, 31u8, 72u8, 159u8, 128u8, 159u8, 215u8, 110u8, 101u8, - 27u8, 132u8, 12u8, 59u8, 182u8, 107u8, 98u8, 77u8, 189u8, 100u8, 51u8, - 209u8, + 155u8, 203u8, 134u8, 227u8, 130u8, 247u8, 25u8, 140u8, 222u8, 140u8, + 171u8, 84u8, 194u8, 43u8, 94u8, 219u8, 28u8, 230u8, 224u8, 180u8, + 153u8, 223u8, 95u8, 3u8, 28u8, 119u8, 58u8, 220u8, 6u8, 146u8, 145u8, + 4u8, + ], + ) + } + #[doc = " Transfer count for all wormhole transfers"] + pub fn transfer_count( + &self, + _0: types::transfer_count::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::transfer_count::Param0, + >, + types::transfer_count::TransferCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Wormhole", + "TransferCount", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 155u8, 203u8, 134u8, 227u8, 130u8, 247u8, 25u8, 140u8, 222u8, 140u8, + 171u8, 84u8, 194u8, 43u8, 94u8, 219u8, 28u8, 230u8, 224u8, 180u8, + 153u8, 223u8, 95u8, 3u8, 28u8, 119u8, 58u8, 220u8, 6u8, 146u8, 145u8, + 4u8, ], ) } @@ -21468,6 +21354,57 @@ pub mod api { ], ) } + #[doc = " Minimum transfer amount required for proof verification"] + pub fn minimum_transfer_amount( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Wormhole", + "MinimumTransferAmount", + [ + 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 = " Volume fee rate in basis points (1 basis point = 0.01%)."] + #[doc = " This must match the fee rate used in proof generation."] + pub fn volume_fee_rate_bps( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Wormhole", + "VolumeFeeRateBps", + [ + 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 = " Proportion of volume fees to burn (not mint). The remainder goes to the block author."] + #[doc = " Example: Permill::from_percent(50) means 50% burned, 50% to miner."] + pub fn volume_fees_burn_rate( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Wormhole", + "VolumeFeesBurnRate", + [ + 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, + ], + ) + } } } } @@ -21475,6 +21412,23 @@ pub mod api { use super::runtime_types; pub mod bounded_collections { use super::runtime_types; + pub mod bounded_btree_map { + 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 BoundedBTreeMap<_0, _1>( + pub ::subxt::ext::subxt_core::utils::KeyedVec<_0, _1>, + ); + } pub mod bounded_vec { use super::runtime_types; #[derive( @@ -24283,7 +24237,42 @@ pub mod api { } } } - pub mod pallet_merkle_airdrop { + pub mod pallet_mining_rewards { + 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 `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A miner has been identified for a block"] + MinerRewarded { + miner: ::subxt::ext::subxt_core::utils::AccountId32, + reward: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Transaction fees were collected for later distribution"] + FeesCollected { + amount: ::core::primitive::u128, + total: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Rewards were sent to Treasury when no miner was specified"] + TreasuryRewarded { reward: ::core::primitive::u128 }, + } + } + } + pub mod pallet_multisig { use super::runtime_types; pub mod pallet { use super::runtime_types; @@ -24301,86 +24290,114 @@ pub mod api { #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] - #[doc = "Create a new airdrop with a Merkle root."] - #[doc = ""] - #[doc = "The Merkle root is a cryptographic hash that represents all valid claims"] - #[doc = "for this airdrop. Users will later provide Merkle proofs to verify their"] - #[doc = "eligibility to claim tokens."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `merkle_root` - The Merkle root hash representing all valid claims"] - #[doc = "* `vesting_period` - Optional vesting period for the airdrop"] - #[doc = "* `vesting_delay` - Optional delay before vesting starts"] - create_airdrop { - merkle_root: [::core::primitive::u8; 32usize], - vesting_period: ::core::option::Option<::core::primitive::u32>, - vesting_delay: ::core::option::Option<::core::primitive::u32>, + #[doc = "Create a new multisig account"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = ""] + #[doc = "The multisig address is derived from a hash of all signers + global nonce."] + #[doc = "The creator must pay a non-refundable fee (burned)."] + create_multisig { + signers: ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + threshold: ::core::primitive::u32, }, #[codec(index = 1)] - #[doc = "Fund an existing airdrop with tokens."] + #[doc = "Propose a transaction to be executed by the multisig"] #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] + #[doc = ""] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (refundable - returned immediately on execution/cancellation)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before creating a new proposal, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers. This is the primary"] + #[doc = "cleanup mechanism."] + #[doc = ""] + #[doc = "**For threshold=1:** If the multisig threshold is 1, the proposal executes immediately."] + propose { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + call: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + expiry: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Approve a proposed transaction"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "If this approval brings the total approvals to or above the threshold,"] + #[doc = "the transaction will be automatically executed."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to fund"] - #[doc = "* `amount` - The amount of tokens to add to the airdrop"] + #[doc = "**Auto-cleanup:** Before processing the approval, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - fund_airdrop { - airdrop_id: ::core::primitive::u32, - amount: ::core::primitive::u128, + #[doc = "Weight: Charges for MAX call size and MAX expired proposals, refunds based on actual"] + approve { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, }, - #[codec(index = 2)] - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] + #[codec(index = 3)] + #[doc = "Cancel a proposed transaction (only by proposer)"] #[doc = ""] - #[doc = "Users can claim their tokens by providing a proof of their eligibility."] - #[doc = "The proof is verified against the airdrop's Merkle root."] - #[doc = "Anyone can trigger a claim for any eligible recipient."] + #[doc = "**Auto-cleanup:** Before processing the cancellation, ALL expired proposals are"] + #[doc = "automatically removed and deposits returned to original proposers."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] #[doc = ""] - #[doc = "* `origin` - The origin of the call"] - #[doc = "* `airdrop_id` - The ID of the airdrop to claim from"] - #[doc = "* `amount` - The amount of tokens to claim"] - #[doc = "* `merkle_proof` - The Merkle proof verifying eligibility"] + #[doc = "Weight: Charges for MAX call size and MAX expired proposals, refunds based on actual"] + cancel { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "Remove expired proposals and return deposits to proposers"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Can only be called by signers of the multisig."] + #[doc = "Only removes Active proposals that have expired (past expiry block)."] + #[doc = "Executed and Cancelled proposals are automatically cleaned up immediately."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `AlreadyClaimed` - If the recipient has already claimed from this airdrop"] - #[doc = "* `InvalidProof` - If the provided Merkle proof is invalid"] - #[doc = "* `InsufficientAirdropBalance` - If the airdrop doesn't have enough tokens"] - claim { - airdrop_id: ::core::primitive::u32, - recipient: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - merkle_proof: runtime_types::bounded_collections::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >, + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows any signer to help clean up storage even if proposer is inactive."] + remove_expired { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, }, - #[codec(index = 3)] - #[doc = "Delete an airdrop and reclaim any remaining funds."] + #[codec(index = 5)] + #[doc = "Claim all deposits from expired proposals"] #[doc = ""] - #[doc = "This function allows the creator of an airdrop to delete it and reclaim"] - #[doc = "any remaining tokens that haven't been claimed."] + #[doc = "This is a batch operation that removes all expired proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Active and past expiry block"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Note: Executed and Cancelled proposals are automatically cleaned up immediately,"] + #[doc = "so only Active+Expired proposals need manual cleanup."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] + #[doc = "Returns all proposal deposits to the proposer in a single transaction."] + claim_deposits { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + }, + #[codec(index = 6)] + #[doc = "Dissolve (remove) a multisig and recover the creation deposit."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Requirements:"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up."] + #[doc = "- Multisig account balance must be zero."] + #[doc = "- Can be called by the creator OR any signer."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `NotAirdropCreator` - If the caller is not the creator of the airdrop"] - delete_airdrop { airdrop_id: ::core::primitive::u32 }, + #[doc = "The deposit is ALWAYS returned to the original `creator` stored in `MultisigData`."] + dissolve_multisig { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + }, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -24396,20 +24413,80 @@ pub mod api { #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] - #[doc = "The specified airdrop does not exist."] - AirdropNotFound, + #[doc = "Not enough signers provided"] + NotEnoughSigners, #[codec(index = 1)] - #[doc = "The airdrop does not have sufficient balance for this operation."] - InsufficientAirdropBalance, + #[doc = "Threshold must be greater than zero"] + ThresholdZero, #[codec(index = 2)] - #[doc = "The user has already claimed from this airdrop."] - AlreadyClaimed, + #[doc = "Threshold exceeds number of signers"] + ThresholdTooHigh, #[codec(index = 3)] - #[doc = "The provided Merkle proof is invalid."] - InvalidProof, + #[doc = "Too many signers"] + TooManySigners, #[codec(index = 4)] - #[doc = "Only the creator of an airdrop can delete it."] - NotAirdropCreator, + #[doc = "Duplicate signer in list"] + DuplicateSigner, + #[codec(index = 5)] + #[doc = "Multisig already exists"] + MultisigAlreadyExists, + #[codec(index = 6)] + #[doc = "Multisig not found"] + MultisigNotFound, + #[codec(index = 7)] + #[doc = "Caller is not a signer of this multisig"] + NotASigner, + #[codec(index = 8)] + #[doc = "Proposal not found"] + ProposalNotFound, + #[codec(index = 9)] + #[doc = "Caller is not the proposer"] + NotProposer, + #[codec(index = 10)] + #[doc = "Already approved by this signer"] + AlreadyApproved, + #[codec(index = 11)] + #[doc = "Not enough approvals to execute"] + NotEnoughApprovals, + #[codec(index = 12)] + #[doc = "Proposal expiry is in the past"] + ExpiryInPast, + #[codec(index = 13)] + #[doc = "Proposal expiry is too far in the future (exceeds MaxExpiryDuration)"] + ExpiryTooFar, + #[codec(index = 14)] + #[doc = "Proposal has expired"] + ProposalExpired, + #[codec(index = 15)] + #[doc = "Call data too large"] + CallTooLarge, + #[codec(index = 16)] + #[doc = "Failed to decode call data"] + InvalidCall, + #[codec(index = 17)] + #[doc = "Too many total proposals in storage for this multisig (cleanup required)"] + TooManyProposalsInStorage, + #[codec(index = 18)] + #[doc = "This signer has too many proposals in storage (filibuster protection)"] + TooManyProposalsPerSigner, + #[codec(index = 19)] + #[doc = "Insufficient balance for deposit"] + InsufficientBalance, + #[codec(index = 20)] + #[doc = "Proposal has active deposit"] + ProposalHasDeposit, + #[codec(index = 21)] + #[doc = "Proposal has not expired yet"] + ProposalNotExpired, + #[codec(index = 22)] + #[doc = "Proposal is not active (already executed or cancelled)"] + ProposalNotActive, + #[codec(index = 23)] + #[doc = "Cannot dissolve multisig with existing proposals (clear them first)"] + ProposalsExist, + #[codec(index = 24)] + #[doc = "Multisig account must have zero balance before dissolution"] + MultisigAccountNotZero, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -24425,39 +24502,77 @@ pub mod api { #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] - #[doc = "A new airdrop has been created."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, merkle_root]"] - AirdropCreated { - airdrop_id: ::core::primitive::u32, - airdrop_metadata: runtime_types::pallet_merkle_airdrop::AirdropMetadata< - ::core::primitive::u32, - ::core::primitive::u128, + #[doc = "A new multisig account was created"] + #[doc = "[creator, multisig_address, signers, threshold, nonce]"] + MultisigCreated { + creator: ::subxt::ext::subxt_core::utils::AccountId32, + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + signers: ::subxt::ext::subxt_core::alloc::vec::Vec< ::subxt::ext::subxt_core::utils::AccountId32, >, + threshold: ::core::primitive::u32, + nonce: ::core::primitive::u64, }, #[codec(index = 1)] - #[doc = "An airdrop has been funded with tokens."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, amount]"] - AirdropFunded { - airdrop_id: ::core::primitive::u32, - amount: ::core::primitive::u128, + #[doc = "A proposal has been created"] + ProposalCreated { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, }, #[codec(index = 2)] - #[doc = "A user has claimed tokens from an airdrop."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, account, amount]"] - Claimed { - airdrop_id: ::core::primitive::u32, - account: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, + #[doc = "A proposal has been approved by a signer"] + ProposalApproved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + approver: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + approvals_count: ::core::primitive::u32, }, #[codec(index = 3)] - #[doc = "An airdrop has been deleted."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id]"] - AirdropDeleted { airdrop_id: ::core::primitive::u32 }, + #[doc = "A proposal has been executed"] + #[doc = "Contains all data needed for indexing by SubSquid"] + ProposalExecuted { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + call: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + approvers: ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 4)] + #[doc = "A proposal has been cancelled by the proposer"] + ProposalCancelled { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "Expired proposal was removed from storage"] + ProposalRemoved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + removed_by: ::subxt::ext::subxt_core::utils::AccountId32, + }, + #[codec(index = 6)] + #[doc = "Batch deposits claimed"] + DepositsClaimed { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + claimer: ::subxt::ext::subxt_core::utils::AccountId32, + total_returned: ::core::primitive::u128, + proposals_removed: ::core::primitive::u32, + multisig_removed: ::core::primitive::bool, + }, + #[codec(index = 7)] + #[doc = "A multisig account was dissolved and deposit returned"] + MultisigDissolved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + caller: ::subxt::ext::subxt_core::utils::AccountId32, + deposit_returned: ::core::primitive::u128, + }, } } #[derive( @@ -24467,47 +24582,46 @@ 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 AirdropMetadata<_0, _1, _2> { - pub merkle_root: [::core::primitive::u8; 32usize], - pub creator: _2, - pub balance: _1, - pub vesting_period: ::core::option::Option<_0>, - pub vesting_delay: ::core::option::Option<_0>, + pub struct MultisigData<_0, _1, _2, _3, _4> { + pub signers: _2, + pub threshold: ::core::primitive::u32, + pub nonce: ::core::primitive::u64, + pub proposal_nonce: ::core::primitive::u32, + pub creator: _1, + pub deposit: _3, + pub last_activity: _0, + pub active_proposals: ::core::primitive::u32, + pub proposals_per_signer: _4, } - } - pub mod pallet_mining_rewards { - 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 `Event` enum of this pallet"] - pub enum Event { - #[codec(index = 0)] - #[doc = "A miner has been identified for a block"] - MinerRewarded { - miner: ::subxt::ext::subxt_core::utils::AccountId32, - reward: ::core::primitive::u128, - }, - #[codec(index = 1)] - #[doc = "Transaction fees were collected for later distribution"] - FeesCollected { - amount: ::core::primitive::u128, - total: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "Rewards were sent to Treasury when no miner was specified"] - TreasuryRewarded { reward: ::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")] + pub struct ProposalData<_0, _1, _2, _3, _4> { + pub proposer: _0, + pub call: _3, + pub expiry: _2, + pub approvals: _4, + pub deposit: _1, + pub status: runtime_types::pallet_multisig::ProposalStatus, + } + #[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 ProposalStatus { + #[codec(index = 0)] + Active, + #[codec(index = 1)] + Executed, + #[codec(index = 2)] + Cancelled, } } pub mod pallet_preimage { @@ -26010,6 +26124,12 @@ pub mod api { ::core::primitive::u64, >, }, + #[codec(index = 7)] + #[doc = "Allows the guardian (interceptor) to recover all funds from a high security"] + #[doc = "account by transferring the entire balance to themselves."] + #[doc = ""] + #[doc = "This is an emergency function for when the high security account may be compromised."] + recover_funds { account: ::subxt::ext::subxt_core::utils::AccountId32 }, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -26115,14 +26235,12 @@ pub mod api { }, #[codec(index = 2)] #[doc = "A scheduled transaction has been successfully cancelled by the owner."] - #[doc = "[who, tx_id]"] TransactionCancelled { who: ::subxt::ext::subxt_core::utils::AccountId32, tx_id: ::subxt::ext::subxt_core::utils::H256, }, #[codec(index = 3)] #[doc = "A scheduled transaction was executed by the scheduler."] - #[doc = "[tx_id, dispatch_result]"] TransactionExecuted { tx_id: ::subxt::ext::subxt_core::utils::H256, result: ::core::result::Result< @@ -26132,6 +26250,12 @@ pub mod api { >, >, }, + #[codec(index = 4)] + #[doc = "Funds were recovered from a high security account by its guardian."] + FundsRecovered { + account: ::subxt::ext::subxt_core::utils::AccountId32, + guardian: ::subxt::ext::subxt_core::utils::AccountId32, + }, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -27366,240 +27490,6 @@ pub mod api { } } } - pub mod pallet_vesting { - 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 = "Unlock any vested funds of the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - vest, - #[codec(index = 1)] - #[doc = "Unlock any vested funds of a `target` account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - vest_other { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - }, - #[codec(index = 2)] - #[doc = "Create a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account receiving the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - vested_transfer { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - }, - #[codec(index = 3)] - #[doc = "Force a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `source`: The account whose funds should be transferred."] - #[doc = "- `target`: The account that should be transferred the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - force_vested_transfer { - source: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - }, - #[codec(index = 4)] - #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] - #[doc = "the highest possible start and end blocks. If both schedules have already started the"] - #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] - #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] - #[doc = "unmodified."] - #[doc = ""] - #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] - #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] - #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] - #[doc = "and both will be removed."] - #[doc = ""] - #[doc = "Merged schedule attributes:"] - #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] - #[doc = " current_block)`."] - #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] - #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `schedule1_index`: index of the first schedule to merge."] - #[doc = "- `schedule2_index`: index of the second schedule to merge."] - merge_schedules { - schedule1_index: ::core::primitive::u32, - schedule2_index: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Force remove a vesting schedule"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `target`: An account that has a vesting schedule"] - #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] - force_remove_vesting_schedule { - target: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - schedule_index: ::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 = "Error for the vesting pallet."] - pub enum Error { - #[codec(index = 0)] - #[doc = "The account given is not vesting."] - NotVesting, - #[codec(index = 1)] - #[doc = "The account already has `MaxVestingSchedules` count of schedules and thus"] - #[doc = "cannot add another one. Consider merging existing schedules in order to add another."] - AtMaxVestingSchedules, - #[codec(index = 2)] - #[doc = "Amount being transferred is too low to create a vesting schedule."] - AmountLow, - #[codec(index = 3)] - #[doc = "An index was out of bounds of the vesting schedules."] - ScheduleIndexOutOfBounds, - #[codec(index = 4)] - #[doc = "Failed to create a new schedule because some parameter was invalid."] - InvalidScheduleParams, - } - #[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 = "A vesting schedule has been created."] - VestingCreated { - account: ::subxt::ext::subxt_core::utils::AccountId32, - schedule_index: ::core::primitive::u32, - }, - #[codec(index = 1)] - #[doc = "The amount vested has been updated. This could indicate a change in funds available."] - #[doc = "The balance given is the amount which is left unvested (and thus locked)."] - VestingUpdated { - account: ::subxt::ext::subxt_core::utils::AccountId32, - unvested: ::core::primitive::u128, - }, - #[codec(index = 2)] - #[doc = "An \\[account\\] has become fully vested."] - VestingCompleted { account: ::subxt::ext::subxt_core::utils::AccountId32 }, - } - } - pub mod vesting_info { - 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 VestingInfo<_0, _1> { - pub locked: _0, - pub per_block: _0, - pub starting_block: _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 enum Releases { - #[codec(index = 0)] - V0, - #[codec(index = 1)] - V1, - } - } pub mod pallet_wormhole { use super::runtime_types; pub mod pallet { @@ -27695,6 +27585,11 @@ pub mod api { AggregatedVerificationFailed, #[codec(index = 15)] InvalidAggregatedPublicInputs, + #[codec(index = 16)] + TransferAmountBelowMinimum, + #[codec(index = 17)] + #[doc = "The volume fee rate in the proof doesn't match the configured rate"] + InvalidVolumeFeeRate, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -27943,8 +27838,6 @@ pub mod api { Balances(runtime_types::pallet_balances::pallet::Call), #[codec(index = 4)] Sudo(runtime_types::pallet_sudo::pallet::Call), - #[codec(index = 8)] - Vesting(runtime_types::pallet_vesting::pallet::Call), #[codec(index = 9)] Preimage(runtime_types::pallet_preimage::pallet::Call), #[codec(index = 10)] @@ -27961,8 +27854,6 @@ pub mod api { TechCollective(runtime_types::pallet_ranked_collective::pallet::Call), #[codec(index = 16)] TechReferenda(runtime_types::pallet_referenda::pallet::Call), - #[codec(index = 17)] - MerkleAirdrop(runtime_types::pallet_merkle_airdrop::pallet::Call), #[codec(index = 18)] TreasuryPallet(runtime_types::pallet_treasury::pallet::Call), #[codec(index = 20)] @@ -27970,6 +27861,8 @@ pub mod api { #[codec(index = 21)] Assets(runtime_types::pallet_assets::pallet::Call), #[codec(index = 23)] + Multisig(runtime_types::pallet_multisig::pallet::Call), + #[codec(index = 24)] Wormhole(runtime_types::pallet_wormhole::pallet::Call), } #[derive( @@ -27986,8 +27879,6 @@ pub mod api { Balances(runtime_types::pallet_balances::pallet::Error), #[codec(index = 4)] Sudo(runtime_types::pallet_sudo::pallet::Error), - #[codec(index = 8)] - Vesting(runtime_types::pallet_vesting::pallet::Error), #[codec(index = 9)] Preimage(runtime_types::pallet_preimage::pallet::Error), #[codec(index = 10)] @@ -28004,8 +27895,6 @@ pub mod api { TechCollective(runtime_types::pallet_ranked_collective::pallet::Error), #[codec(index = 16)] TechReferenda(runtime_types::pallet_referenda::pallet::Error), - #[codec(index = 17)] - MerkleAirdrop(runtime_types::pallet_merkle_airdrop::pallet::Error), #[codec(index = 18)] TreasuryPallet(runtime_types::pallet_treasury::pallet::Error), #[codec(index = 20)] @@ -28015,6 +27904,8 @@ pub mod api { #[codec(index = 22)] AssetsHolder(runtime_types::pallet_assets_holder::pallet::Error), #[codec(index = 23)] + Multisig(runtime_types::pallet_multisig::pallet::Error), + #[codec(index = 24)] Wormhole(runtime_types::pallet_wormhole::pallet::Error), } #[derive( @@ -28037,8 +27928,6 @@ pub mod api { QPoW(runtime_types::pallet_qpow::pallet::Event), #[codec(index = 7)] MiningRewards(runtime_types::pallet_mining_rewards::pallet::Event), - #[codec(index = 8)] - Vesting(runtime_types::pallet_vesting::pallet::Event), #[codec(index = 9)] Preimage(runtime_types::pallet_preimage::pallet::Event), #[codec(index = 10)] @@ -28055,8 +27944,6 @@ pub mod api { TechCollective(runtime_types::pallet_ranked_collective::pallet::Event), #[codec(index = 16)] TechReferenda(runtime_types::pallet_referenda::pallet::Event2), - #[codec(index = 17)] - MerkleAirdrop(runtime_types::pallet_merkle_airdrop::pallet::Event), #[codec(index = 18)] TreasuryPallet(runtime_types::pallet_treasury::pallet::Event), #[codec(index = 20)] @@ -28066,6 +27953,8 @@ pub mod api { #[codec(index = 22)] AssetsHolder(runtime_types::pallet_assets_holder::pallet::Event), #[codec(index = 23)] + Multisig(runtime_types::pallet_multisig::pallet::Event), + #[codec(index = 24)] Wormhole(runtime_types::pallet_wormhole::pallet::Event), } #[derive( diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 6d9a1cd..858ba27 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -10,6 +10,7 @@ pub mod events; pub mod generic_call; pub mod high_security; pub mod metadata; +pub mod multisend; pub mod preimage; pub mod recovery; pub mod reversible; @@ -231,6 +232,49 @@ pub enum Commands { /// Wormhole proof generation and verification #[command(subcommand)] Wormhole(wormhole::WormholeCommands), + + /// Send random amounts to multiple addresses (total is distributed randomly) + Multisend { + /// Wallet name to send from + #[arg(short, long)] + from: String, + + /// File containing addresses (JSON array: ["addr1", "addr2", ...]) + #[arg(long, conflicts_with = "addresses")] + addresses_file: Option, + + /// Comma-separated list of recipient addresses + #[arg(long, value_delimiter = ',', conflicts_with = "addresses_file")] + addresses: Option>, + + /// Total amount to distribute across all recipients (e.g., "1000", "100.5") + #[arg(long)] + total: String, + + /// Minimum amount per recipient (e.g., "10", "1.5") + #[arg(long)] + min: String, + + /// Maximum amount per recipient (e.g., "100", "50.5") + #[arg(long)] + max: String, + + /// Password for the wallet (or use environment variables) + #[arg(short, long)] + password: Option, + + /// Read password from file (for scripting) + #[arg(long)] + password_file: Option, + + /// Optional tip amount to prioritize the transaction (e.g., "1", "0.5") + #[arg(long)] + tip: Option, + + /// Skip confirmation prompt (for scripting) + #[arg(long, short = 'y')] + yes: bool, + }, } /// Developer subcommands @@ -362,6 +406,33 @@ pub async fn execute_command( Commands::Block(block_cmd) => block::handle_block_command(block_cmd, node_url).await, Commands::Wormhole(wormhole_cmd) => wormhole::handle_wormhole_command(wormhole_cmd, node_url).await, + Commands::Multisend { + from, + addresses_file, + addresses, + total, + min, + max, + password, + password_file, + tip, + yes, + } => + multisend::handle_multisend_command( + from, + node_url, + addresses_file, + addresses, + total, + min, + max, + password, + password_file, + tip, + yes, + execution_mode, + ) + .await, } } diff --git a/src/cli/multisend.rs b/src/cli/multisend.rs new file mode 100644 index 0000000..4b5a321 --- /dev/null +++ b/src/cli/multisend.rs @@ -0,0 +1,393 @@ +//! Multisend command - send random amounts to multiple addresses +//! +//! Distributes a total amount across multiple recipients with random amounts, +//! subject to min/max constraints per recipient. + +use crate::{ + chain::client::QuantusClient, + cli::{ + common::{resolve_address, ExecutionMode}, + send::{ + batch_transfer, format_balance, format_balance_with_symbol, get_balance, + get_chain_properties, parse_amount, + }, + }, + error::{QuantusError, Result}, + log_info, log_print, log_success, log_verbose, +}; +use colored::Colorize; +use rand::{seq::SliceRandom, Rng}; +use std::{ + fs, + io::{self, Write}, +}; + +/// Generate a random distribution of amounts across n recipients. +/// +/// Each amount will be in the range [min, max] and all amounts will sum to exactly `total`. +/// +/// # Algorithm +/// 1. Start everyone at the minimum amount +/// 2. Randomly distribute the remaining amount (total - n*min) across recipients +/// 3. Shuffle the final amounts to avoid bias toward earlier recipients +/// +/// # Errors +/// Returns an error if the constraints are unsatisfiable: +/// - `n * min > total` (not enough total to give everyone the minimum) +/// - `n * max < total` (can't fit the total even with everyone at maximum) +pub fn generate_random_distribution( + n: usize, + total: u128, + min: u128, + max: u128, +) -> Result> { + if n == 0 { + return Err(QuantusError::Generic("Cannot distribute to zero recipients".to_string())); + } + + if min > max { + return Err(QuantusError::Generic(format!( + "Minimum amount ({}) cannot be greater than maximum amount ({})", + min, max + ))); + } + + let n_u128 = n as u128; + let min_possible = n_u128.saturating_mul(min); + let max_possible = n_u128.saturating_mul(max); + + if total < min_possible { + return Err(QuantusError::Generic(format!( + "Cannot distribute {} among {} recipients with min={}. \ + Minimum required total: {}", + total, n, min, min_possible + ))); + } + + if total > max_possible { + return Err(QuantusError::Generic(format!( + "Cannot distribute {} among {} recipients with max={}. \ + Maximum possible total: {}", + total, n, max, max_possible + ))); + } + + // Start everyone at the minimum + let mut amounts: Vec = vec![min; n]; + let mut remaining = total - min_possible; + + // Randomly distribute the remaining amount + let mut rng = rand::rng(); + + while remaining > 0 { + // Find recipients who can still receive more + let eligible_indices: Vec = amounts + .iter() + .enumerate() + .filter(|(_, &amt)| amt < max) + .map(|(i, _)| i) + .collect(); + + if eligible_indices.is_empty() { + // This shouldn't happen if our math is correct, but safety first + break; + } + + // Pick a random eligible recipient + let recipient_idx = eligible_indices[rng.random_range(0..eligible_indices.len())]; + let headroom = max - amounts[recipient_idx]; + + // Add a random amount (at least 1, at most headroom or remaining) + let max_addition = headroom.min(remaining); + let amount_to_add = if max_addition == 1 { 1 } else { rng.random_range(1..=max_addition) }; + + amounts[recipient_idx] += amount_to_add; + remaining -= amount_to_add; + } + + // Shuffle to avoid any bias from the distribution order + amounts.shuffle(&mut rng); + + // Sanity check + let sum: u128 = amounts.iter().sum(); + debug_assert_eq!(sum, total, "Distribution sum mismatch"); + + Ok(amounts) +} + +/// Load addresses from a JSON file. +/// +/// Expected format: `["addr1", "addr2", "addr3"]` +pub fn load_addresses_from_file(file_path: &str) -> Result> { + let content = fs::read_to_string(file_path).map_err(|e| { + QuantusError::Generic(format!("Failed to read addresses file '{}': {}", file_path, e)) + })?; + + let addresses: Vec = serde_json::from_str(&content).map_err(|e| { + QuantusError::Generic(format!( + "Failed to parse addresses file '{}'. Expected JSON array of strings: {}", + file_path, e + )) + })?; + + if addresses.is_empty() { + return Err(QuantusError::Generic("Addresses file is empty".to_string())); + } + + Ok(addresses) +} + +/// Handle the multisend command +#[allow(clippy::too_many_arguments)] +pub async fn handle_multisend_command( + from_wallet: String, + node_url: &str, + addresses_file: Option, + addresses_inline: Option>, + total_str: String, + min_str: String, + max_str: String, + password: Option, + password_file: Option, + tip: Option, + skip_confirmation: bool, + execution_mode: ExecutionMode, +) -> Result<()> { + // Connect to chain + let quantus_client = QuantusClient::new(node_url).await?; + let (symbol, decimals) = get_chain_properties(&quantus_client).await?; + + // Parse addresses from file or inline + let raw_addresses = if let Some(file_path) = addresses_file { + load_addresses_from_file(&file_path)? + } else if let Some(addrs) = addresses_inline { + if addrs.is_empty() { + return Err(QuantusError::Generic( + "No addresses provided. Use --addresses or --addresses-file".to_string(), + )); + } + addrs + } else { + return Err(QuantusError::Generic( + "No addresses provided. Use --addresses or --addresses-file".to_string(), + )); + }; + + // Resolve all addresses (could be wallet names or SS58 addresses) + let mut resolved_addresses = Vec::with_capacity(raw_addresses.len()); + for addr in &raw_addresses { + let resolved = resolve_address(addr)?; + resolved_addresses.push(resolved); + } + + let n = resolved_addresses.len(); + log_verbose!("Resolved {} addresses", n); + + // Parse amounts + let total = parse_amount(&quantus_client, &total_str).await?; + let min = parse_amount(&quantus_client, &min_str).await?; + let max = parse_amount(&quantus_client, &max_str).await?; + + log_verbose!("Parsed amounts - total: {}, min: {}, max: {}", total, min, max); + + // Generate random distribution + let amounts = generate_random_distribution(n, total, min, max)?; + + // Create transfers list + let transfers: Vec<(String, u128)> = + resolved_addresses.iter().cloned().zip(amounts.iter().cloned()).collect(); + + // Display preview + log_print!(""); + log_print!("{} Multisend Preview", "===".bright_cyan().bold()); + log_print!(""); + log_print!( + " Total amount: {}", + format!("{} {}", format_balance(total, decimals), symbol).bright_yellow().bold() + ); + log_print!(" Recipients: {}", n.to_string().bright_green()); + log_print!(" Min per recipient: {} {}", format_balance(min, decimals), symbol); + log_print!(" Max per recipient: {} {}", format_balance(max, decimals), symbol); + log_print!(""); + + // Display table header + log_print!(" {:>3} | {:<50} | {:>20}", "#".dimmed(), "Address".dimmed(), "Amount".dimmed()); + log_print!(" {:-<3}-+-{:-<50}-+-{:-<20}", "", "", ""); + + // Display each transfer + for (i, (addr, amount)) in transfers.iter().enumerate() { + let formatted_amount = format!("{} {}", format_balance(*amount, decimals), symbol); + + // Truncate address for display if needed + let display_addr = if addr.len() > 50 { + format!("{}...{}", &addr[..24], &addr[addr.len() - 23..]) + } else { + addr.clone() + }; + + log_print!( + " {:>3} | {:<50} | {:>20}", + (i + 1).to_string().bright_white(), + display_addr.bright_cyan(), + formatted_amount.bright_yellow() + ); + } + + // Display total line + log_print!(" {:-<3}-+-{:-<50}-+-{:-<20}", "", "", ""); + let total_formatted = format!("{} {}", format_balance(total, decimals), symbol); + log_print!( + " {:>3} | {:<50} | {:>20}", + "", + "Total".bold(), + total_formatted.bright_green().bold() + ); + log_print!(""); + + // Prompt for confirmation unless --yes is passed + if !skip_confirmation { + print!("Proceed with this transaction? (yes/no): "); + io::stdout().flush().unwrap(); + + let mut input = String::new(); + io::stdin().read_line(&mut input).unwrap(); + + if input.trim().to_lowercase() != "yes" { + log_print!("Multisend cancelled."); + return Ok(()); + } + log_print!(""); + } + + // Send the transaction + log_info!("Preparing multisend transaction..."); + + // Load wallet + let keypair = crate::wallet::load_keypair_from_wallet(&from_wallet, password, password_file)?; + let from_account_id = keypair.to_account_id_ss58check(); + + // Check balance + let balance = get_balance(&quantus_client, &from_account_id).await?; + let estimated_fee = 50_000_000_000u128; // Rough estimate for batch + + if balance < total + estimated_fee { + let formatted_balance = format_balance_with_symbol(&quantus_client, balance).await?; + let formatted_needed = + format_balance_with_symbol(&quantus_client, total + estimated_fee).await?; + return Err(QuantusError::Generic(format!( + "Insufficient balance. Have: {}, Need: {} (including estimated fees)", + formatted_balance, formatted_needed + ))); + } + + // Parse tip if provided + let tip_amount = if let Some(tip_str) = tip { + Some(parse_amount(&quantus_client, &tip_str).await?) + } else { + None + }; + + // Submit batch transaction + let tx_hash = + batch_transfer(&quantus_client, &keypair, transfers, tip_amount, execution_mode).await?; + + log_print!( + "{} Multisend transaction submitted! Hash: {:?}", + "SUCCESS".bright_green().bold(), + tx_hash + ); + + log_success!("{} Multisend transaction confirmed!", "FINISHED".bright_green().bold()); + + // Show updated balance + let new_balance = get_balance(&quantus_client, &from_account_id).await?; + let formatted_new_balance = format_balance_with_symbol(&quantus_client, new_balance).await?; + log_print!("New balance: {}", formatted_new_balance.bright_yellow()); + + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_generate_random_distribution_basic() { + let amounts = generate_random_distribution(5, 1000, 100, 300).unwrap(); + assert_eq!(amounts.len(), 5); + assert_eq!(amounts.iter().sum::(), 1000); + for &amt in &amounts { + assert!((100..=300).contains(&amt), "Amount {} out of range", amt); + } + } + + #[test] + fn test_generate_random_distribution_exact_min() { + // Total equals n * min, so everyone gets exactly min + let amounts = generate_random_distribution(4, 400, 100, 200).unwrap(); + assert_eq!(amounts.len(), 4); + assert_eq!(amounts.iter().sum::(), 400); + for &amt in &amounts { + assert_eq!(amt, 100); + } + } + + #[test] + fn test_generate_random_distribution_exact_max() { + // Total equals n * max, so everyone gets exactly max + let amounts = generate_random_distribution(4, 800, 100, 200).unwrap(); + assert_eq!(amounts.len(), 4); + assert_eq!(amounts.iter().sum::(), 800); + for &amt in &amounts { + assert_eq!(amt, 200); + } + } + + #[test] + fn test_generate_random_distribution_single_recipient() { + let amounts = generate_random_distribution(1, 500, 100, 600).unwrap(); + assert_eq!(amounts.len(), 1); + assert_eq!(amounts[0], 500); + } + + #[test] + fn test_generate_random_distribution_total_too_small() { + let result = generate_random_distribution(5, 400, 100, 200); + assert!(result.is_err()); + assert!(result.unwrap_err().to_string().contains("Minimum required")); + } + + #[test] + fn test_generate_random_distribution_total_too_large() { + let result = generate_random_distribution(5, 1500, 100, 200); + assert!(result.is_err()); + assert!(result.unwrap_err().to_string().contains("Maximum possible")); + } + + #[test] + fn test_generate_random_distribution_min_greater_than_max() { + let result = generate_random_distribution(5, 1000, 300, 100); + assert!(result.is_err()); + assert!(result.unwrap_err().to_string().contains("cannot be greater than")); + } + + #[test] + fn test_generate_random_distribution_zero_recipients() { + let result = generate_random_distribution(0, 1000, 100, 200); + assert!(result.is_err()); + assert!(result.unwrap_err().to_string().contains("zero recipients")); + } + + #[test] + fn test_distribution_randomness() { + // Run multiple times and check that we get different distributions + let mut seen_distributions = std::collections::HashSet::new(); + for _ in 0..10 { + let amounts = generate_random_distribution(5, 1000, 100, 300).unwrap(); + seen_distributions.insert(format!("{:?}", amounts)); + } + // With 5 recipients and a decent range, we should see some variety + // (though this isn't guaranteed - it's probabilistic) + assert!(seen_distributions.len() > 1, "Expected multiple different distributions"); + } +} diff --git a/src/quantus_metadata.scale b/src/quantus_metadata.scale index a4a9a4e..910bcbc 100644 Binary files a/src/quantus_metadata.scale and b/src/quantus_metadata.scale differ