From 82098cd2846088b756c4a55cb7268298e8bc3515 Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Thu, 22 Jan 2026 10:12:27 +0800 Subject: [PATCH 1/7] poc: Multisig commands - basic flows --- README.md | 154 + examples/multisig_usage.rs | 150 + src/chain/quantus_subxt.rs | 22578 +++++++++++++++++------------------ src/cli/mod.rs | 7 + src/cli/multisig.rs | 1062 ++ src/quantus_metadata.scale | Bin 165253 -> 164327 bytes 6 files changed, 12493 insertions(+), 11458 deletions(-) create mode 100644 examples/multisig_usage.rs create mode 100644 src/cli/multisig.rs diff --git a/README.md b/README.md index 8512f11..b1b9435 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,160 @@ The CLI provides a comprehensive set of commands for blockchain interaction. Sta The CLI supports both simple commands and complex workflows, with built-in help and error recovery at every level. +## ๐Ÿ” Multisig Wallets + +The Quantus CLI provides comprehensive support for multi-signature wallets, allowing you to create shared accounts that require multiple approvals before executing transactions. + +### Key Features + +- **Deterministic Address Generation**: Multisig addresses are derived from signers + nonce +- **Flexible Threshold**: Configure how many approvals are needed (e.g., 2-of-3, 5-of-7) +- **Full Call Transparency**: Complete transaction data stored on-chain (not just hashes) +- **Auto-Execution**: Proposals execute automatically when threshold is reached +- **Deposit Management**: Refundable deposits incentivize cleanup +- **Query Support**: Inspect multisig configuration and proposals + +### Quick Start Example + +```bash +# 1. Create a 2-of-3 multisig +quantus multisig create \ + --signers "alice,bob,charlie" \ + --threshold 2 \ + --from alice + +# 2. Check the events to get the multisig address +# Let's say it's: 5GMultiSigAddr... + +# 3. Fund the multisig (anyone can send funds) +quantus send \ + --from alice \ + --to 5GMultiSigAddr... \ + --amount 1000 + +# 4. Create a proposal to send funds from multisig +quantus multisig propose \ + --multisig 5GMultiSigAddr... \ + --pallet Balances \ + --call transfer_allow_death \ + --args '["5GDestination...", "500000000000"]' \ + --expiry 1000 \ + --from alice + +# 5. Check events for proposal hash +# Let's say it's: 0xabc123... + +# 6. Second signer approves (auto-executes at threshold) +quantus multisig approve \ + --multisig 5GMultiSigAddr... \ + --proposal-hash 0xabc123... \ + --from bob +``` + +### Available Commands + +#### Create Multisig +```bash +quantus multisig create \ + --signers "addr1,addr2,addr3" \ + --threshold 2 \ + --from creator_wallet +``` + +#### Propose Transaction +```bash +quantus multisig propose \ + --multisig \ + --pallet Balances \ + --call transfer_allow_death \ + --args '["recipient", "amount"]' \ + --expiry \ + --from signer_wallet +``` + +#### Approve Proposal +```bash +quantus multisig approve \ + --multisig \ + --proposal-hash \ + --from signer_wallet +``` + +#### Cancel Proposal (proposer only) +```bash +quantus multisig cancel \ + --multisig \ + --proposal-hash \ + --from proposer_wallet +``` + +#### Query Multisig Info +```bash +quantus multisig info \ + --multisig +``` + +#### List All Proposals +```bash +quantus multisig list-proposals \ + --multisig +``` + +#### Query Specific Proposal +```bash +quantus multisig proposal-info \ + --multisig \ + --proposal-hash +``` + +#### Cleanup (Recover Deposits) +```bash +# Remove single expired/executed/cancelled proposal +quantus multisig remove-expired \ + --multisig \ + --proposal-hash \ + --from signer_wallet + +# Batch cleanup all removable proposals +quantus multisig claim-deposits \ + --multisig \ + --from proposer_wallet +``` + +#### Dissolve Multisig +```bash +# Requires: no proposals exist, zero balance +quantus multisig dissolve \ + --multisig \ + --from creator_or_signer_wallet +``` + +### Economics + +The multisig pallet uses an economic model to prevent spam and incentivize cleanup: + +- **MultisigFee**: Non-refundable fee paid to treasury on creation +- **MultisigDeposit**: Refundable deposit returned on dissolution +- **ProposalFee**: Non-refundable fee per proposal (scales with signer count) +- **ProposalDeposit**: Refundable deposit per proposal (returned after cleanup) + +### Best Practices + +1. **Use Descriptive Names**: Use wallet names instead of raw addresses for better readability +2. **Set Reasonable Expiry**: Choose expiry blocks that give enough time for approvals +3. **Cleanup Regularly**: Remove executed/cancelled proposals to recover deposits +4. **Monitor Deposits**: Keep track of locked deposits and clean up when done +5. **High Security**: For high-value multisigs, use higher thresholds (e.g., 5-of-7) + +### Security Considerations + +- **Immutable Configuration**: Signers and threshold cannot be changed after creation +- **Full Transparency**: All call data is visible on-chain (no blind signing) +- **Auto-Execution**: Proposals execute automatically when threshold is reached +- **Access Control**: Only signers can propose/approve, only proposer can cancel + +For more details, see `quantus multisig --help` and explore subcommands with `--help`. + ## ๐Ÿ—๏ธ Architecture ### Quantum-Safe Cryptography diff --git a/examples/multisig_usage.rs b/examples/multisig_usage.rs new file mode 100644 index 0000000..81527b1 --- /dev/null +++ b/examples/multisig_usage.rs @@ -0,0 +1,150 @@ +//! Multisig wallet operations example +//! +//! This example demonstrates: +//! 1. Creating a multisig wallet +//! 2. Creating a proposal +//! 3. Approving proposals +//! 4. Querying multisig information +//! 5. Managing multisig lifecycle + +use quantus_cli::{ + chain::{client::QuantusClient, quantus_subxt}, + cli::common::ExecutionMode, + error::Result, + wallet::WalletManager, +}; +use sp_core::crypto::Ss58Codec; + +/// Example: Create and use a 2-of-3 multisig wallet +#[tokio::main] +async fn main() -> Result<()> { + println!("๐Ÿ” Quantus Multisig Example"); + println!("================================\n"); + + // 1. Setup: Connect to node and load wallets + let node_url = "ws://127.0.0.1:9944"; + let quantus_client = QuantusClient::new(node_url).await?; + let wallet_manager = WalletManager::new()?; + + println!("๐Ÿ“ก Connected to node: {}", node_url); + println!(""); + + // 2. Create or load test wallets + println!("๐Ÿ‘ฅ Setting up test wallets..."); + + // For this example, we assume alice, bob, and charlie wallets exist + // In real usage, create these first: + // wallet_manager.create_wallet("alice", Some("password")).await?; + // wallet_manager.create_wallet("bob", Some("password")).await?; + // wallet_manager.create_wallet("charlie", Some("password")).await?; + + let alice_addr = wallet_manager.find_wallet_address("alice")?.expect("Alice wallet not found"); + let bob_addr = wallet_manager.find_wallet_address("bob")?.expect("Bob wallet not found"); + let charlie_addr = wallet_manager + .find_wallet_address("charlie")? + .expect("Charlie wallet not found"); + + println!(" Alice: {}", alice_addr); + println!(" Bob: {}", bob_addr); + println!(" Charlie: {}", charlie_addr); + println!(""); + + // 3. Create multisig (2-of-3) + println!("๐Ÿ” Creating 2-of-3 multisig..."); + + let signers = + vec![parse_address(&alice_addr)?, parse_address(&bob_addr)?, parse_address(&charlie_addr)?]; + let threshold = 2u32; + + let alice_keypair = + quantus_cli::wallet::load_keypair_from_wallet("alice", Some("password".to_string()), None)?; + + let create_tx = quantus_subxt::api::tx().multisig().create_multisig(signers.clone(), threshold); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: true }; + + let tx_hash = quantus_cli::cli::common::submit_transaction( + &quantus_client, + &alice_keypair, + create_tx, + None, + execution_mode, + ) + .await?; + + println!("โœ… Multisig created! Tx hash: 0x{}", hex::encode(tx_hash)); + println!(""); + println!("๐Ÿ’ก NOTE: Check the events to find the multisig address"); + println!(" The address is deterministically generated from signers + nonce"); + println!(""); + + // 4. Example: Query multisig info + println!("๐Ÿ“‹ To query multisig information:"); + println!(" quantus multisig info --multisig "); + println!(""); + + // 5. Example: Create a proposal + println!("๐Ÿ“ To create a proposal:"); + println!(" quantus multisig propose \\"); + println!(" --multisig \\"); + println!(" --pallet Balances \\"); + println!(" --call transfer_allow_death \\"); + println!(" --args '[\"\", \"1000000000000\"]' \\"); + println!(" --expiry 1000 \\"); + println!(" --from alice"); + println!(""); + + // 6. Example: Approve a proposal + println!("โœ… To approve a proposal:"); + println!(" quantus multisig approve \\"); + println!(" --multisig \\"); + println!(" --proposal-hash \\"); + println!(" --from bob"); + println!(""); + + // 7. Example: List proposals + println!("๐Ÿ“‹ To list all proposals:"); + println!(" quantus multisig list-proposals --multisig "); + println!(""); + + // 8. Example: Cleanup + println!("๐Ÿงน To cleanup and recover deposits:"); + println!(" # Remove single proposal"); + println!(" quantus multisig remove-expired \\"); + println!(" --multisig \\"); + println!(" --proposal-hash \\"); + println!(" --from alice"); + println!(""); + println!(" # Batch cleanup"); + println!(" quantus multisig claim-deposits \\"); + println!(" --multisig \\"); + println!(" --from alice"); + println!(""); + + // 9. Example: Dissolve multisig + println!("๐Ÿ—‘๏ธ To dissolve multisig (requires no proposals, zero balance):"); + println!(" quantus multisig dissolve \\"); + println!(" --multisig \\"); + println!(" --from alice"); + println!(""); + + println!("โœจ Multisig example complete!"); + println!(""); + println!("๐Ÿ“š For more information:"); + println!(" quantus multisig --help"); + println!(" quantus multisig --help"); + + Ok(()) +} + +/// Helper: Parse SS58 address to subxt AccountId32 +fn parse_address(ss58: &str) -> Result { + use sp_core::crypto::AccountId32; + + let (account_id, _) = AccountId32::from_ss58check_with_version(ss58).map_err(|e| { + quantus_cli::error::QuantusError::Generic(format!("Invalid address: {:?}", e)) + })?; + + let bytes: [u8; 32] = *account_id.as_ref(); + Ok(subxt::ext::subxt_core::utils::AccountId32::from(bytes)) +} diff --git a/src/chain/quantus_subxt.rs b/src/chain/quantus_subxt.rs index a94a0d2..881b4bc 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; 22usize] = [ + pub static PALLETS: [&str; 21usize] = [ "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", ]; pub static RUNTIME_APIS: [&str; 11usize] = [ "Core", @@ -144,9 +143,10 @@ pub mod api { "execute_block", types::ExecuteBlock { block }, [ - 133u8, 135u8, 228u8, 65u8, 106u8, 27u8, 85u8, 158u8, 112u8, 254u8, - 93u8, 26u8, 102u8, 201u8, 118u8, 216u8, 249u8, 247u8, 91u8, 74u8, 56u8, - 208u8, 231u8, 115u8, 131u8, 29u8, 209u8, 6u8, 65u8, 57u8, 214u8, 125u8, + 81u8, 130u8, 143u8, 72u8, 156u8, 15u8, 28u8, 87u8, 117u8, 10u8, 192u8, + 249u8, 117u8, 214u8, 184u8, 13u8, 148u8, 224u8, 167u8, 170u8, 101u8, + 194u8, 229u8, 140u8, 199u8, 115u8, 73u8, 99u8, 183u8, 205u8, 98u8, + 33u8, ], ) } @@ -163,9 +163,9 @@ pub mod api { "initialize_block", types::InitializeBlock { header }, [ - 132u8, 169u8, 113u8, 112u8, 80u8, 139u8, 113u8, 35u8, 41u8, 81u8, 36u8, - 35u8, 37u8, 202u8, 29u8, 207u8, 205u8, 229u8, 145u8, 7u8, 133u8, 94u8, - 25u8, 108u8, 233u8, 86u8, 234u8, 29u8, 236u8, 57u8, 56u8, 186u8, + 112u8, 139u8, 92u8, 30u8, 37u8, 99u8, 47u8, 83u8, 221u8, 31u8, 204u8, + 129u8, 102u8, 92u8, 144u8, 80u8, 3u8, 98u8, 157u8, 5u8, 20u8, 31u8, + 110u8, 105u8, 86u8, 91u8, 173u8, 19u8, 140u8, 246u8, 60u8, 223u8, ], ) } @@ -193,7 +193,7 @@ pub mod api { pub struct Version {} pub mod execute_block { use super::runtime_types; - pub type Block = runtime_types :: sp_runtime :: generic :: block :: Block < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: quantus_runtime :: RuntimeCall , runtime_types :: qp_dilithium_crypto :: types :: DilithiumSignatureScheme , (runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: quantus_runtime :: transaction_extensions :: ReversibleTransactionExtension ,) > > ; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: Block < runtime_types :: qp_header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: quantus_runtime :: RuntimeCall , runtime_types :: qp_dilithium_crypto :: types :: DilithiumSignatureScheme , (runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: quantus_runtime :: transaction_extensions :: ReversibleTransactionExtension ,) > > ; pub mod output { use super::runtime_types; pub type Output = (); @@ -215,8 +215,7 @@ pub mod api { } pub mod initialize_block { use super::runtime_types; - pub type Header = - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; + pub type Header = runtime_types::qp_header::Header<::core::primitive::u32>; pub mod output { use super::runtime_types; pub type Output = runtime_types::sp_runtime::ExtrinsicInclusionMode; @@ -411,9 +410,9 @@ pub mod api { "finalize_block", types::FinalizeBlock {}, [ - 244u8, 207u8, 24u8, 33u8, 13u8, 69u8, 9u8, 249u8, 145u8, 143u8, 122u8, - 96u8, 197u8, 55u8, 64u8, 111u8, 238u8, 224u8, 34u8, 201u8, 27u8, 146u8, - 232u8, 99u8, 191u8, 30u8, 114u8, 16u8, 32u8, 220u8, 58u8, 62u8, + 135u8, 81u8, 28u8, 123u8, 19u8, 171u8, 129u8, 82u8, 85u8, 96u8, 238u8, + 155u8, 211u8, 153u8, 243u8, 31u8, 189u8, 82u8, 91u8, 225u8, 78u8, 48u8, + 241u8, 236u8, 143u8, 65u8, 91u8, 167u8, 114u8, 146u8, 31u8, 197u8, ], ) } @@ -451,10 +450,10 @@ pub mod api { "check_inherents", types::CheckInherents { block, data }, [ - 153u8, 134u8, 1u8, 215u8, 139u8, 11u8, 53u8, 51u8, 210u8, 175u8, 197u8, - 28u8, 38u8, 209u8, 175u8, 247u8, 142u8, 157u8, 50u8, 151u8, 164u8, - 191u8, 181u8, 118u8, 80u8, 97u8, 160u8, 248u8, 110u8, 217u8, 181u8, - 234u8, + 44u8, 230u8, 134u8, 154u8, 73u8, 173u8, 160u8, 231u8, 223u8, 148u8, + 247u8, 104u8, 214u8, 168u8, 43u8, 202u8, 204u8, 14u8, 148u8, 154u8, + 9u8, 103u8, 239u8, 45u8, 186u8, 21u8, 97u8, 136u8, 200u8, 108u8, 205u8, + 167u8, ], ) } @@ -487,9 +486,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - >; + pub type Output = runtime_types::qp_header::Header<::core::primitive::u32>; } } #[derive( @@ -528,7 +525,7 @@ pub mod api { } pub mod check_inherents { use super::runtime_types; - pub type Block = runtime_types :: sp_runtime :: generic :: block :: Block < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: quantus_runtime :: RuntimeCall , runtime_types :: qp_dilithium_crypto :: types :: DilithiumSignatureScheme , (runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: quantus_runtime :: transaction_extensions :: ReversibleTransactionExtension ,) > > ; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: Block < runtime_types :: qp_header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: quantus_runtime :: RuntimeCall , runtime_types :: qp_dilithium_crypto :: types :: DilithiumSignatureScheme , (runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: quantus_runtime :: transaction_extensions :: ReversibleTransactionExtension ,) > > ; pub type Data = runtime_types::sp_inherents::InherentData; pub mod output { use super::runtime_types; @@ -637,9 +634,10 @@ pub mod api { "offchain_worker", types::OffchainWorker { header }, [ - 10u8, 135u8, 19u8, 153u8, 33u8, 216u8, 18u8, 242u8, 33u8, 140u8, 4u8, - 223u8, 200u8, 130u8, 103u8, 118u8, 137u8, 24u8, 19u8, 127u8, 161u8, - 29u8, 184u8, 111u8, 222u8, 111u8, 253u8, 73u8, 45u8, 31u8, 79u8, 60u8, + 131u8, 199u8, 206u8, 86u8, 209u8, 109u8, 229u8, 152u8, 235u8, 155u8, + 35u8, 252u8, 70u8, 180u8, 47u8, 173u8, 84u8, 182u8, 176u8, 164u8, + 107u8, 88u8, 249u8, 181u8, 85u8, 174u8, 240u8, 226u8, 254u8, 189u8, + 167u8, 155u8, ], ) } @@ -648,8 +646,7 @@ pub mod api { use super::runtime_types; pub mod offchain_worker { use super::runtime_types; - pub type Header = - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; + pub type Header = runtime_types::qp_header::Header<::core::primitive::u32>; pub mod output { use super::runtime_types; pub type Output = (); @@ -1472,10 +1469,9 @@ pub mod api { "query_call_info", types::QueryCallInfo { call, len }, [ - 166u8, 173u8, 176u8, 212u8, 240u8, 248u8, 215u8, 188u8, 215u8, 21u8, - 209u8, 116u8, 183u8, 186u8, 201u8, 229u8, 28u8, 26u8, 218u8, 247u8, - 99u8, 59u8, 155u8, 235u8, 205u8, 76u8, 165u8, 181u8, 148u8, 21u8, - 122u8, 86u8, + 108u8, 157u8, 154u8, 122u8, 44u8, 54u8, 12u8, 126u8, 145u8, 198u8, + 44u8, 53u8, 68u8, 109u8, 166u8, 12u8, 170u8, 151u8, 215u8, 251u8, 1u8, + 137u8, 149u8, 132u8, 0u8, 125u8, 80u8, 96u8, 85u8, 240u8, 232u8, 109u8, ], ) } @@ -1493,9 +1489,10 @@ pub mod api { "query_call_fee_details", types::QueryCallFeeDetails { call, len }, [ - 18u8, 80u8, 212u8, 196u8, 230u8, 162u8, 108u8, 100u8, 130u8, 14u8, - 44u8, 76u8, 26u8, 143u8, 202u8, 61u8, 26u8, 132u8, 34u8, 112u8, 49u8, - 183u8, 31u8, 51u8, 122u8, 49u8, 37u8, 229u8, 87u8, 43u8, 107u8, 82u8, + 129u8, 124u8, 124u8, 57u8, 194u8, 127u8, 113u8, 187u8, 194u8, 36u8, + 47u8, 108u8, 27u8, 56u8, 137u8, 101u8, 40u8, 20u8, 106u8, 64u8, 56u8, + 119u8, 182u8, 172u8, 22u8, 250u8, 20u8, 175u8, 144u8, 225u8, 126u8, + 56u8, ], ) } @@ -1835,9 +1832,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 } @@ -1856,9 +1850,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 } @@ -1868,6 +1859,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 struct StorageApi; impl StorageApi { @@ -1892,9 +1886,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 } @@ -1916,9 +1907,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 } @@ -1931,6 +1919,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 struct TransactionApi; impl TransactionApi { @@ -1946,9 +1937,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 } @@ -1973,9 +1961,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 } @@ -1985,6 +1970,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 struct ViewFunctionsApi; impl ViewFunctionsApi {} @@ -1997,9 +1985,9 @@ pub mod api { .hash(); runtime_metadata_hash == [ - 194u8, 46u8, 30u8, 103u8, 67u8, 25u8, 224u8, 42u8, 104u8, 224u8, 105u8, 213u8, - 149u8, 58u8, 199u8, 151u8, 221u8, 215u8, 141u8, 247u8, 109u8, 85u8, 204u8, 202u8, - 96u8, 104u8, 173u8, 94u8, 198u8, 124u8, 113u8, 174u8, + 3u8, 233u8, 219u8, 118u8, 195u8, 79u8, 113u8, 105u8, 239u8, 120u8, 33u8, 65u8, + 180u8, 110u8, 1u8, 16u8, 112u8, 215u8, 110u8, 116u8, 222u8, 216u8, 186u8, 54u8, + 251u8, 178u8, 62u8, 225u8, 227u8, 123u8, 143u8, 218u8, ] } pub mod system { @@ -3098,10 +3086,9 @@ pub mod api { "Events", (), [ - 153u8, 144u8, 222u8, 32u8, 219u8, 80u8, 161u8, 232u8, 120u8, 168u8, - 102u8, 147u8, 49u8, 48u8, 3u8, 26u8, 255u8, 126u8, 218u8, 117u8, 254u8, - 217u8, 170u8, 206u8, 182u8, 174u8, 251u8, 53u8, 253u8, 242u8, 26u8, - 74u8, + 234u8, 110u8, 83u8, 79u8, 105u8, 7u8, 155u8, 40u8, 40u8, 74u8, 149u8, + 106u8, 29u8, 18u8, 32u8, 68u8, 102u8, 126u8, 237u8, 28u8, 186u8, 138u8, + 66u8, 173u8, 75u8, 8u8, 167u8, 18u8, 145u8, 12u8, 180u8, 247u8, ], ) } @@ -5463,9 +5450,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 35u8, 97u8, 151u8, 80u8, 160u8, 5u8, 249u8, 161u8, 124u8, 31u8, 46u8, - 45u8, 205u8, 88u8, 85u8, 115u8, 98u8, 172u8, 229u8, 119u8, 45u8, 74u8, - 176u8, 35u8, 216u8, 58u8, 23u8, 103u8, 209u8, 201u8, 15u8, 61u8, + 0u8, 189u8, 255u8, 87u8, 49u8, 109u8, 97u8, 93u8, 217u8, 6u8, 104u8, + 114u8, 251u8, 50u8, 3u8, 179u8, 114u8, 195u8, 122u8, 26u8, 173u8, 63u8, + 97u8, 46u8, 58u8, 217u8, 65u8, 16u8, 16u8, 30u8, 60u8, 138u8, ], ) } @@ -5488,10 +5475,9 @@ pub mod api { weight, }, [ - 129u8, 254u8, 188u8, 113u8, 132u8, 176u8, 63u8, 138u8, 200u8, 84u8, - 62u8, 198u8, 140u8, 161u8, 52u8, 222u8, 184u8, 140u8, 204u8, 144u8, - 247u8, 118u8, 46u8, 126u8, 211u8, 117u8, 140u8, 227u8, 105u8, 74u8, - 162u8, 225u8, + 191u8, 114u8, 71u8, 98u8, 82u8, 90u8, 113u8, 173u8, 56u8, 179u8, 119u8, + 29u8, 110u8, 249u8, 9u8, 69u8, 236u8, 66u8, 198u8, 102u8, 154u8, 48u8, + 129u8, 13u8, 216u8, 130u8, 166u8, 68u8, 33u8, 230u8, 113u8, 118u8, ], ) } @@ -5529,10 +5515,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 174u8, 114u8, 45u8, 150u8, 219u8, 165u8, 118u8, 166u8, 250u8, 85u8, - 15u8, 165u8, 148u8, 17u8, 160u8, 123u8, 198u8, 241u8, 78u8, 198u8, - 206u8, 131u8, 9u8, 107u8, 172u8, 188u8, 83u8, 6u8, 234u8, 14u8, 211u8, - 76u8, + 193u8, 94u8, 70u8, 20u8, 210u8, 85u8, 93u8, 91u8, 137u8, 46u8, 88u8, + 5u8, 86u8, 196u8, 245u8, 69u8, 56u8, 3u8, 165u8, 170u8, 92u8, 202u8, + 57u8, 36u8, 188u8, 184u8, 7u8, 1u8, 104u8, 131u8, 68u8, 0u8, ], ) } @@ -6128,12 +6113,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; @@ -6150,55 +6135,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, @@ -6211,37 +6162,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, @@ -6254,43 +6190,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, @@ -6303,39 +6216,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, @@ -6348,210 +6241,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( @@ -6561,19 +6375,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, @@ -6582,20 +6394,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, @@ -6604,157 +6413,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; @@ -6771,21 +6622,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, @@ -6798,22 +6657,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, @@ -6826,20 +6685,31 @@ 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; + 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; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestPreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "request_preimage"; + 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, @@ -6852,19 +6722,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, @@ -6877,131 +6745,453 @@ 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"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 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 = "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 { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Retries = ::core::primitive::u8; + pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "set_retry"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] + #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] + #[doc = "it succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. 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 = "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( + #[doc = "Anonymously schedule a task."] + pub fn schedule( &self, - bytes: types::note_preimage::Bytes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + 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( - "Preimage", - "note_preimage", - types::NotePreimage { bytes }, + "Scheduler", + "schedule", + types::Schedule { + when, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 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, + 98u8, 65u8, 33u8, 92u8, 233u8, 1u8, 246u8, 164u8, 26u8, 150u8, 53u8, + 4u8, 168u8, 83u8, 171u8, 92u8, 124u8, 171u8, 212u8, 27u8, 103u8, 13u8, + 250u8, 15u8, 87u8, 62u8, 134u8, 75u8, 133u8, 159u8, 124u8, 35u8, ], ) } - #[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 fn unnote_preimage( + #[doc = "Cancel an anonymously scheduled task."] + pub fn cancel( &self, - hash: types::unnote_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + when: types::cancel::When, + index: types::cancel::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "unnote_preimage", - types::UnnotePreimage { hash }, + "Scheduler", + "cancel", + types::Cancel { when, index }, [ - 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, + 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 = "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( + #[doc = "Schedule a named task."] + pub fn schedule_named( &self, - hash: types::request_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + 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( - "Preimage", - "request_preimage", - types::RequestPreimage { hash }, + "Scheduler", + "schedule_named", + types::ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 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, + 100u8, 205u8, 203u8, 161u8, 31u8, 57u8, 31u8, 115u8, 134u8, 81u8, + 236u8, 40u8, 95u8, 37u8, 38u8, 27u8, 67u8, 89u8, 33u8, 185u8, 24u8, + 165u8, 246u8, 246u8, 48u8, 67u8, 177u8, 12u8, 46u8, 141u8, 11u8, 25u8, ], ) } - #[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( + #[doc = "Cancel a named scheduled task."] + pub fn cancel_named( &self, - hash: types::unrequest_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + id: types::cancel_named::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_named", + types::CancelNamed { id }, + [ + 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, 93u8, + 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, 147u8, 122u8, + 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, 129u8, 193u8, + ], + ) + } + #[doc = "Anonymously schedule a task after a delay."] + pub fn schedule_after( + &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( - "Preimage", - "unrequest_preimage", - types::UnrequestPreimage { hash }, + "Scheduler", + "schedule_after", + types::ScheduleAfter { + after, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 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, + 210u8, 55u8, 125u8, 95u8, 253u8, 110u8, 140u8, 205u8, 186u8, 161u8, + 76u8, 252u8, 207u8, 226u8, 159u8, 234u8, 124u8, 20u8, 188u8, 213u8, + 104u8, 205u8, 206u8, 71u8, 35u8, 142u8, 97u8, 154u8, 74u8, 93u8, 233u8, + 20u8, ], ) } - #[doc = "Ensure that the bulk of pre-images is upgraded."] + #[doc = "Schedule a named task after a delay."] + pub fn schedule_named_after( + &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( + "Scheduler", + "schedule_named_after", + types::ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, + [ + 179u8, 212u8, 93u8, 228u8, 136u8, 199u8, 98u8, 22u8, 251u8, 201u8, + 147u8, 72u8, 198u8, 144u8, 244u8, 0u8, 108u8, 133u8, 204u8, 248u8, + 18u8, 181u8, 195u8, 254u8, 232u8, 242u8, 5u8, 197u8, 213u8, 106u8, + 197u8, 81u8, + ], + ) + } + #[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 = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub fn ensure_updated( + #[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, - hashes: types::ensure_updated::Hashes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + task: types::set_retry::Task, + retries: types::set_retry::Retries, + period: types::set_retry::Period, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "set_retry", + types::SetRetry { task, retries, period }, + [ + 31u8, 128u8, 255u8, 13u8, 13u8, 252u8, 74u8, 151u8, 60u8, 242u8, 152u8, + 58u8, 190u8, 155u8, 132u8, 65u8, 139u8, 208u8, 222u8, 175u8, 89u8, + 222u8, 186u8, 98u8, 53u8, 125u8, 71u8, 55u8, 95u8, 2u8, 76u8, 248u8, + ], + ) + } + #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] + #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] + #[doc = "it succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. 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( - "Preimage", - "ensure_updated", - types::EnsureUpdated { hashes }, + "Scheduler", + "set_retry_named", + types::SetRetryNamed { id, retries, period }, [ - 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, + 102u8, 70u8, 114u8, 48u8, 180u8, 194u8, 107u8, 81u8, 104u8, 117u8, + 33u8, 169u8, 43u8, 172u8, 61u8, 129u8, 143u8, 221u8, 44u8, 101u8, + 235u8, 228u8, 224u8, 71u8, 65u8, 223u8, 180u8, 130u8, 83u8, 89u8, + 157u8, 75u8, + ], + ) + } + #[doc = "Removes the retry configuration of a task."] + pub fn cancel_retry( + &self, + task: types::cancel_retry::Task, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_retry", + types::CancelRetry { task }, + [ + 153u8, 252u8, 168u8, 142u8, 100u8, 114u8, 25u8, 46u8, 225u8, 95u8, + 243u8, 78u8, 160u8, 175u8, 17u8, 33u8, 27u8, 241u8, 149u8, 187u8, + 228u8, 182u8, 233u8, 74u8, 10u8, 228u8, 117u8, 218u8, 210u8, 127u8, + 245u8, 105u8, + ], + ) + } + #[doc = "Cancel the retry configuration of a named task."] + pub fn cancel_retry_named( + &self, + id: types::cancel_retry_named::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_retry_named", + types::CancelRetryNamed { id }, + [ + 76u8, 157u8, 253u8, 113u8, 162u8, 54u8, 98u8, 21u8, 62u8, 44u8, 155u8, + 202u8, 2u8, 28u8, 153u8, 219u8, 67u8, 166u8, 206u8, 79u8, 139u8, 3u8, + 119u8, 182u8, 254u8, 134u8, 143u8, 121u8, 155u8, 220u8, 192u8, 209u8, ], ) } } } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_preimage::pallet::Event; + #[doc = "Events type."] + pub type Event = runtime_types::pallet_scheduler::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -7011,17 +7201,22 @@ 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 preimage has been noted."] - pub struct Noted { - pub hash: noted::Hash, + #[doc = "Scheduled some task."] + pub struct Scheduled { + pub when: scheduled::When, + pub index: scheduled::Index, } - pub mod noted { + pub mod scheduled { 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::events::StaticEvent for Noted { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Noted"; + 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, @@ -7030,17 +7225,22 @@ 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 preimage has been requested."] - pub struct Requested { - pub hash: requested::Hash, + #[doc = "Canceled some task."] + pub struct Canceled { + pub when: canceled::When, + pub index: canceled::Index, } - pub mod requested { + pub mod canceled { 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::events::StaticEvent for Requested { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Requested"; + 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, @@ -7049,239 +7249,553 @@ 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 preimage has ben cleared."] - pub struct Cleared { - pub hash: cleared::Hash, - } - pub mod cleared { + #[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 Hash = ::subxt::ext::subxt_core::utils::H256; + 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 Cleared { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Cleared"; + 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 status_for { + pub mod incomplete_block_since { use super::runtime_types; - 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::H256; + pub type IncompleteBlockSince = ::core::primitive::u32; } - pub mod request_status_for { + pub mod incomplete_timestamp_since { 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 IncompleteTimestampSince = ::core::primitive::u64; + } + pub mod last_processed_timestamp { + use super::runtime_types; + 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 Param0 = ::subxt::ext::subxt_core::utils::H256; } - pub mod preimage_for { + pub mod retries { 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 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 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]; } } pub struct StorageApi; impl StorageApi { - #[doc = " The request status of a given hash."] - pub fn status_for_iter( + #[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::status_for::StatusFor, + 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, + ], + ) + } + #[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( - "Preimage", - "StatusFor", + "Scheduler", + "IncompleteTimestampSince", (), [ - 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, + 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 = " The request status of a given hash."] - pub fn status_for( + #[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, - _0: types::status_for::Param0, + ) -> ::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, + ], + ) + } + #[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, + ], + ) + } + #[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::status_for::Param0, + types::agenda::Param0, >, - types::status_for::StatusFor, + types::agenda::Agenda, + ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, - (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "StatusFor", + "Scheduler", + "Agenda", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 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 = " The request status of a given hash."] - pub fn request_status_for_iter( + #[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::request_status_for::RequestStatusFor, + types::retries::Retries, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", + "Scheduler", + "Retries", (), [ - 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, + 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 = " The request status of a given hash."] - pub fn request_status_for( + #[doc = " Retry configurations for items to be executed, indexed by task address."] + pub fn retries( &self, - _0: types::request_status_for::Param0, + _0: types::retries::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::request_status_for::Param0, + types::retries::Param0, >, - types::request_status_for::RequestStatusFor, + types::retries::Retries, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", + "Scheduler", + "Retries", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 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 fn preimage_for_iter( + #[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::preimage_for::PreimageFor, + types::lookup::Lookup, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", + "Scheduler", + "Lookup", (), [ - 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, + 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 fn preimage_for( + #[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::preimage_for::Param0, + _0: types::lookup::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::preimage_for::Param0, + types::lookup::Param0, >, - types::preimage_for::PreimageFor, + types::lookup::Lookup, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", + "Scheduler", + "Lookup", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 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 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, + 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, + ], + ) } - 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 = " 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, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Schedule { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule"; + #[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, + ], + ) } + } + } + } + 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, @@ -7293,22 +7807,36 @@ pub mod api { #[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 = "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 cancel { + pub mod batch { use super::runtime_types; - pub type When = 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 type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7321,31 +7849,31 @@ pub mod api { #[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, + #[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 mod schedule_named { + pub mod as_derivative { 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 Priority = ::core::primitive::u8; + pub type Index = ::core::primitive::u16; 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"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsDerivative { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "as_derivative"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7358,17 +7886,31 @@ pub mod api { #[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, + #[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, } - pub mod cancel_named { + pub mod batch_all { use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; + pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_named"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BatchAll { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch_all"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7381,32 +7923,25 @@ pub mod api { #[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, + #[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, } - pub mod schedule_after { + pub mod dispatch_as { use super::runtime_types; - 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 AsOrigin = runtime_types::quantus_runtime::OriginCaller; 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"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAs { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "dispatch_as"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7419,35 +7954,31 @@ pub mod api { #[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 = "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 schedule_named_after { + pub mod force_batch { 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 Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, >; - 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"; + 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, @@ -7460,41 +7991,24 @@ pub mod api { #[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 = "Dispatch a function call with a specified weight."] #[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 = "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 = "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 = "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 set_retry { + pub mod with_weight { 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, - >; + 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 SetRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry"; + 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, @@ -7507,64 +8021,41 @@ pub mod api { #[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 = "Dispatch a fallback call in the event the main call fails to execute."] + #[doc = "May be called from any origin except `None`."] #[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 = "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 = "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, + #[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 cancel_retry { + pub mod if_else { use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); + pub type Main = runtime_types::quantus_runtime::RuntimeCall; + pub type Fallback = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry"; + 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, @@ -7577,257 +8068,274 @@ pub mod api { #[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, + #[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 cancel_retry_named { + pub mod dispatch_as_fallible { use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; + pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry_named"; + 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 = "Anonymously schedule a task."] - pub fn schedule( + #[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 fn batch( &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 { + calls: types::batch::Calls, + ) -> ::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), - }, + "Utility", + "batch", + types::Batch { calls }, [ - 171u8, 151u8, 176u8, 198u8, 154u8, 6u8, 181u8, 56u8, 10u8, 6u8, 38u8, - 136u8, 64u8, 214u8, 145u8, 96u8, 121u8, 125u8, 161u8, 234u8, 247u8, - 156u8, 152u8, 119u8, 122u8, 165u8, 125u8, 238u8, 12u8, 214u8, 135u8, - 21u8, + 59u8, 61u8, 45u8, 32u8, 55u8, 82u8, 67u8, 35u8, 143u8, 52u8, 8u8, 28u8, + 92u8, 204u8, 254u8, 33u8, 146u8, 112u8, 54u8, 88u8, 99u8, 151u8, 59u8, + 234u8, 170u8, 65u8, 108u8, 203u8, 38u8, 120u8, 69u8, 236u8, ], ) } - #[doc = "Cancel an anonymously scheduled task."] - pub fn cancel( + #[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 fn as_derivative( &self, - when: types::cancel::When, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::as_derivative::Index, + call: types::as_derivative::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel", - types::Cancel { when, index }, + "Utility", + "as_derivative", + types::AsDerivative { + index, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 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, + 49u8, 98u8, 158u8, 227u8, 229u8, 93u8, 55u8, 48u8, 105u8, 191u8, 169u8, + 209u8, 42u8, 128u8, 36u8, 126u8, 212u8, 58u8, 177u8, 230u8, 82u8, 50u8, + 221u8, 25u8, 197u8, 14u8, 165u8, 215u8, 204u8, 67u8, 26u8, 237u8, ], ) } - #[doc = "Schedule a named task."] - pub fn schedule_named( + #[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 fn batch_all( &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 - { + calls: types::batch_all::Calls, + ) -> ::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), - }, + "Utility", + "batch_all", + types::BatchAll { calls }, [ - 99u8, 222u8, 117u8, 153u8, 121u8, 239u8, 26u8, 216u8, 66u8, 132u8, - 220u8, 8u8, 92u8, 137u8, 253u8, 47u8, 9u8, 8u8, 103u8, 1u8, 116u8, - 133u8, 237u8, 51u8, 73u8, 145u8, 141u8, 64u8, 210u8, 10u8, 74u8, 191u8, + 81u8, 126u8, 134u8, 19u8, 154u8, 25u8, 143u8, 199u8, 235u8, 33u8, + 106u8, 108u8, 24u8, 240u8, 142u8, 226u8, 51u8, 81u8, 87u8, 122u8, + 238u8, 215u8, 16u8, 104u8, 138u8, 48u8, 213u8, 130u8, 185u8, 53u8, + 180u8, 201u8, ], ) } - #[doc = "Cancel a named scheduled task."] - pub fn cancel_named( - &self, - id: types::cancel_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_named", - types::CancelNamed { id }, - [ - 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, 93u8, - 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, 147u8, 122u8, - 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, 129u8, 193u8, - ], - ) - } - #[doc = "Anonymously schedule a task after a delay."] - pub fn schedule_after( - &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( - "Scheduler", - "schedule_after", - types::ScheduleAfter { - after, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 236u8, 32u8, 229u8, 48u8, 43u8, 173u8, 230u8, 106u8, 109u8, 188u8, - 137u8, 151u8, 188u8, 102u8, 252u8, 210u8, 87u8, 146u8, 152u8, 251u8, - 128u8, 10u8, 230u8, 228u8, 168u8, 203u8, 77u8, 24u8, 125u8, 18u8, 52u8, - 201u8, - ], - ) - } - #[doc = "Schedule a named task after a delay."] - pub fn schedule_named_after( + #[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 fn dispatch_as( &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 - { + as_origin: types::dispatch_as::AsOrigin, + call: types::dispatch_as::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, + "Utility", + "dispatch_as", + types::DispatchAs { + as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 120u8, 118u8, 201u8, 138u8, 43u8, 75u8, 89u8, 65u8, 107u8, 106u8, 41u8, - 229u8, 55u8, 6u8, 141u8, 24u8, 116u8, 214u8, 215u8, 1u8, 209u8, 67u8, - 157u8, 238u8, 147u8, 31u8, 188u8, 133u8, 21u8, 7u8, 199u8, 202u8, + 1u8, 7u8, 40u8, 151u8, 90u8, 139u8, 3u8, 204u8, 72u8, 237u8, 200u8, + 69u8, 65u8, 140u8, 122u8, 94u8, 185u8, 164u8, 101u8, 197u8, 33u8, 9u8, + 34u8, 144u8, 16u8, 149u8, 33u8, 17u8, 171u8, 154u8, 137u8, 18u8, ], ) } - #[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 = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] #[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 = "May be called from any origin except `None`."] #[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 = "- `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 fn force_batch( &self, - task: types::set_retry::Task, - retries: types::set_retry::Retries, - period: types::set_retry::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + calls: types::force_batch::Calls, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "set_retry", - types::SetRetry { task, retries, period }, + "Utility", + "force_batch", + types::ForceBatch { calls }, [ - 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, + 229u8, 139u8, 136u8, 184u8, 120u8, 148u8, 128u8, 70u8, 246u8, 115u8, + 103u8, 48u8, 127u8, 189u8, 22u8, 96u8, 160u8, 139u8, 72u8, 218u8, + 253u8, 243u8, 228u8, 10u8, 143u8, 23u8, 92u8, 132u8, 80u8, 22u8, 12u8, + 21u8, ], ) } - #[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 = "Dispatch a function call with a specified weight."] #[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 = "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 = "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 = "The dispatch origin for this call must be _Root_."] + pub fn with_weight( &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 - { + call: types::with_weight::Call, + weight: types::with_weight::Weight, + ) -> ::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 }, + "Utility", + "with_weight", + types::WithWeight { + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + weight, + }, [ - 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, + 123u8, 89u8, 82u8, 198u8, 245u8, 59u8, 229u8, 118u8, 168u8, 163u8, + 239u8, 132u8, 42u8, 50u8, 117u8, 205u8, 110u8, 229u8, 143u8, 194u8, + 25u8, 176u8, 2u8, 35u8, 231u8, 250u8, 98u8, 251u8, 144u8, 23u8, 35u8, + 2u8, ], ) } - #[doc = "Removes the retry configuration of a task."] - pub fn cancel_retry( + #[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 fn if_else( &self, - task: types::cancel_retry::Task, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + main: types::if_else::Main, + fallback: types::if_else::Fallback, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_retry", - types::CancelRetry { task }, + "Utility", + "if_else", + types::IfElse { + main: ::subxt::ext::subxt_core::alloc::boxed::Box::new(main), + fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), + }, [ - 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, + 62u8, 66u8, 121u8, 77u8, 185u8, 44u8, 169u8, 244u8, 134u8, 153u8, 43u8, + 220u8, 186u8, 3u8, 188u8, 16u8, 1u8, 115u8, 152u8, 34u8, 149u8, 48u8, + 157u8, 165u8, 214u8, 37u8, 115u8, 252u8, 176u8, 195u8, 134u8, 213u8, ], ) } - #[doc = "Cancel the retry configuration of a named task."] - pub fn cancel_retry_named( + #[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 fn dispatch_as_fallible( &self, - id: types::cancel_retry_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + as_origin: types::dispatch_as_fallible::AsOrigin, + call: types::dispatch_as_fallible::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_retry_named", - types::CancelRetryNamed { id }, + "Utility", + "dispatch_as_fallible", + types::DispatchAsFallible { + as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 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, + 238u8, 235u8, 190u8, 150u8, 221u8, 200u8, 0u8, 102u8, 43u8, 253u8, + 193u8, 207u8, 100u8, 94u8, 235u8, 93u8, 88u8, 135u8, 32u8, 85u8, 7u8, + 4u8, 43u8, 129u8, 4u8, 29u8, 183u8, 81u8, 81u8, 76u8, 123u8, 216u8, ], ) } } } - #[doc = "Events type."] - pub type Event = runtime_types::pallet_scheduler::pallet::Event; + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_utility::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -7837,22 +8345,20 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Scheduled some task."] - pub struct Scheduled { - pub when: scheduled::When, - pub index: scheduled::Index, + #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] + #[doc = "well as the error."] + pub struct BatchInterrupted { + pub index: batch_interrupted::Index, + pub error: batch_interrupted::Error, } - pub mod scheduled { + pub mod batch_interrupted { use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; pub type Index = ::core::primitive::u32; + pub type Error = runtime_types::sp_runtime::DispatchError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Scheduled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Scheduled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for BatchInterrupted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchInterrupted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7861,22 +8367,11 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Canceled some task."] - pub struct Canceled { - pub when: canceled::When, - pub index: canceled::Index, - } - 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"; + #[doc = "Batch of dispatches completed fully with no error."] + pub struct BatchCompleted; + impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompleted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7885,28 +8380,11 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Dispatched some task."] - pub struct Dispatched { - pub task: dispatched::Task, - pub id: dispatched::Id, - pub result: dispatched::Result, - } - pub mod dispatched { - 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"; + #[doc = "Batch of dispatches completed but has errors."] + pub struct BatchCompletedWithErrors; + impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompletedWithErrors { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompletedWithErrors"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7915,32 +8393,11 @@ 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 = "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"; + #[doc = "A single item within a Batch of dispatches has completed with no error."] + pub struct ItemCompleted; + impl ::subxt::ext::subxt_core::events::StaticEvent for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7949,25 +8406,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 = "Cancel a retry configuration for some task."] - pub struct RetryCancelled { - pub task: retry_cancelled::Task, - pub id: retry_cancelled::Id, + #[doc = "A single item within a Batch of dispatches has completed with error."] + pub struct ItemFailed { + pub error: item_failed::Error, } - pub mod retry_cancelled { + pub mod item_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]>; + pub type Error = runtime_types::sp_runtime::DispatchError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryCancelled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryCancelled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ItemFailed { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemFailed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7976,25 +8425,18 @@ 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 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, + #[doc = "A call was dispatched."] + pub struct DispatchedAs { + pub result: dispatched_as::Result, } - pub mod call_unavailable { + pub mod dispatched_as { 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 CallUnavailable { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "CallUnavailable"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DispatchedAs { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "DispatchedAs"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8003,25 +8445,11 @@ 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 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"; + #[doc = "Main call was dispatched."] + pub struct IfElseMainSuccess; + impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseMainSuccess { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "IfElseMainSuccess"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8030,408 +8458,183 @@ 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 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, + #[doc = "The fallback call was dispatched."] + pub struct IfElseFallbackCalled { + pub main_error: if_else_fallback_called::MainError, } - pub mod retry_failed { + pub mod if_else_fallback_called { 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"; + pub type MainError = runtime_types::sp_runtime::DispatchError; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[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, + impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseFallbackCalled { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "IfElseFallbackCalled"; } - pub mod permanently_overweight { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The limit on the number of batched calls."] + pub fn batched_calls_limit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::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"; + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Utility", + "batched_calls_limit", + [ + 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 storage { - use super::runtime_types; + } + pub mod referenda { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_referenda::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_referenda::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 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; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 referendum on a privileged action."] + #[doc = ""] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = ""] + #[doc = "Emits `Submitted`."] + pub struct Submit { + pub proposal_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub proposal: submit::Proposal, + pub enactment_moment: submit::EnactmentMoment, } - pub mod last_processed_timestamp { + pub mod submit { use super::runtime_types; - 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 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 ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, >; - pub type Param0 = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< + pub type EnactmentMoment = + runtime_types::frame_support::traits::schedule::DispatchTime< ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); + >; } - 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]; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "submit"; } - } - 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 = "Post the Decision Deposit for a referendum."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] + #[doc = ""] + #[doc = "Emits `DecisionDepositPlaced`."] + pub struct PlaceDecisionDeposit { + pub index: place_decision_deposit::Index, } - #[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, - ], - ) + pub mod place_decision_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; } - #[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, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "place_decision_deposit"; } - #[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, - ], - ) + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `DecisionDepositRefunded`."] + pub struct RefundDecisionDeposit { + pub index: refund_decision_deposit::Index, } - #[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, - ], - ) + pub mod refund_decision_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; } - #[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, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "refund_decision_deposit"; } - #[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, - ], - ) - } - #[doc = " Lookup from a name to the block number and index of the task."] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel an ongoing referendum."] #[doc = ""] - #[doc = " 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 = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[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 = "Emits `Cancelled`."] + pub struct Cancel { + pub index: cancel::Index, } - #[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, - ], - ) + pub mod cancel { + use super::runtime_types; + pub type Index = ::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, - > { - ::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 Cancel { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "cancel"; } - } - } - } - 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, @@ -8443,36 +8646,22 @@ pub mod api { #[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 = "Cancel an ongoing referendum and slash the deposits."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[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, + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub struct Kill { + pub index: kill::Index, } - pub mod batch { + pub mod kill { use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::quantus_runtime::RuntimeCall, - >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "kill"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8485,31 +8674,20 @@ 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 = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = "Advance a referendum onto its next logical state. Only used internally."] #[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 = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub struct NudgeReferendum { + pub index: nudge_referendum::Index, } - pub mod as_derivative { + pub mod nudge_referendum { use super::runtime_types; - pub type Index = ::core::primitive::u16; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsDerivative { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "as_derivative"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "nudge_referendum"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8522,31 +8700,25 @@ 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 = "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 = "Advance a track onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[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 = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub struct OneFewerDeciding { + pub track: one_fewer_deciding::Track, } - pub mod batch_all { + pub mod one_fewer_deciding { use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::quantus_runtime::RuntimeCall, - >; + pub type Track = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BatchAll { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch_all"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "one_fewer_deciding"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8559,139 +8731,23 @@ pub mod api { #[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 = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[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, - } - pub mod dispatch_as { - 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 { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "dispatch_as"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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 = "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 = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "## 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, + #[doc = "Emits `SubmissionDepositRefunded`."] + pub struct RefundSubmissionDeposit { + pub index: refund_submission_deposit::Index, } - pub mod if_else { + pub mod refund_submission_deposit { use super::runtime_types; - pub type Main = runtime_types::quantus_runtime::RuntimeCall; - pub type Fallback = runtime_types::quantus_runtime::RuntimeCall; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IfElse { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "if_else"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "refund_submission_deposit"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8704,275 +8760,253 @@ pub mod api { #[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 = "Set or clear metadata of a referendum."] #[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, + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub struct SetMetadata { + pub index: set_metadata::Index, + pub maybe_hash: set_metadata::MaybeHash, } - pub mod dispatch_as_fallible { + pub mod set_metadata { use super::runtime_types; - pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + pub type Index = ::core::primitive::u32; + pub type MaybeHash = + ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAsFallible { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "dispatch_as_fallible"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "set_metadata"; } } 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 = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "Propose a referendum on a privileged action."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] #[doc = ""] - #[doc = "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 fn batch( + #[doc = "Emits `Submitted`."] + pub fn submit( &self, - calls: types::batch::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + proposal_origin: types::submit::ProposalOrigin, + proposal: types::submit::Proposal, + enactment_moment: types::submit::EnactmentMoment, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "batch", - types::Batch { calls }, + "Referenda", + "submit", + types::Submit { + proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + proposal_origin, + ), + proposal, + enactment_moment, + }, [ - 135u8, 106u8, 152u8, 39u8, 199u8, 163u8, 145u8, 186u8, 129u8, 115u8, - 214u8, 162u8, 12u8, 85u8, 57u8, 122u8, 211u8, 240u8, 143u8, 159u8, - 138u8, 37u8, 114u8, 8u8, 8u8, 236u8, 197u8, 23u8, 114u8, 2u8, 105u8, - 174u8, + 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, + 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, + 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, ], ) } - #[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 = "Post the Decision Deposit for a referendum."] #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub fn as_derivative( + #[doc = "Emits `DecisionDepositPlaced`."] + pub fn place_decision_deposit( &self, - index: types::as_derivative::Index, - call: types::as_derivative::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::place_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "as_derivative", - types::AsDerivative { - index, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Referenda", + "place_decision_deposit", + types::PlaceDecisionDeposit { index }, [ - 3u8, 102u8, 237u8, 140u8, 8u8, 207u8, 27u8, 204u8, 155u8, 162u8, 124u8, - 141u8, 172u8, 210u8, 89u8, 239u8, 113u8, 175u8, 41u8, 9u8, 150u8, - 130u8, 205u8, 125u8, 205u8, 199u8, 174u8, 85u8, 24u8, 13u8, 57u8, 19u8, + 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, + 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, + 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, ], ) } - #[doc = "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 = "Refund the Decision Deposit for a closed referendum back to the depositor."] #[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 = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub fn batch_all( + #[doc = "Emits `DecisionDepositRefunded`."] + pub fn refund_decision_deposit( &self, - calls: types::batch_all::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::refund_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundDecisionDeposit, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "batch_all", - types::BatchAll { calls }, + "Referenda", + "refund_decision_deposit", + types::RefundDecisionDeposit { index }, [ - 76u8, 242u8, 205u8, 32u8, 158u8, 24u8, 255u8, 12u8, 97u8, 24u8, 211u8, - 63u8, 119u8, 183u8, 165u8, 217u8, 17u8, 178u8, 254u8, 230u8, 119u8, - 207u8, 207u8, 103u8, 39u8, 226u8, 55u8, 73u8, 233u8, 79u8, 60u8, 218u8, + 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, + 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, + 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, ], ) } - #[doc = "Dispatches a function call with a provided origin."] + #[doc = "Cancel an ongoing referendum."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn dispatch_as( + #[doc = "Emits `Cancelled`."] + pub fn cancel( &self, - as_origin: types::dispatch_as::AsOrigin, - call: types::dispatch_as::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::cancel::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "dispatch_as", - types::DispatchAs { - as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Referenda", + "cancel", + types::Cancel { index }, [ - 32u8, 108u8, 91u8, 136u8, 200u8, 228u8, 95u8, 44u8, 22u8, 92u8, 34u8, - 234u8, 170u8, 201u8, 4u8, 248u8, 16u8, 209u8, 103u8, 201u8, 207u8, - 160u8, 165u8, 231u8, 152u8, 222u8, 112u8, 63u8, 133u8, 61u8, 220u8, - 24u8, + 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, + 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, + 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, + 122u8, ], ) } - #[doc = "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 = "Cancel an ongoing referendum and slash the deposits."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub fn force_batch( + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub fn kill( &self, - calls: types::force_batch::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::kill::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "force_batch", - types::ForceBatch { calls }, + "Referenda", + "kill", + types::Kill { index }, [ - 26u8, 82u8, 61u8, 185u8, 19u8, 29u8, 151u8, 192u8, 24u8, 41u8, 115u8, - 237u8, 7u8, 38u8, 68u8, 5u8, 159u8, 117u8, 47u8, 138u8, 101u8, 126u8, - 255u8, 137u8, 144u8, 51u8, 244u8, 145u8, 113u8, 21u8, 123u8, 79u8, + 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, + 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, + 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, + 48u8, ], ) } - #[doc = "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 = "Advance a referendum onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub fn with_weight( + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub fn nudge_referendum( &self, - call: types::with_weight::Call, - weight: types::with_weight::Weight, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::nudge_referendum::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "with_weight", - types::WithWeight { - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - weight, - }, + "Referenda", + "nudge_referendum", + types::NudgeReferendum { index }, [ - 131u8, 134u8, 250u8, 73u8, 141u8, 137u8, 137u8, 15u8, 206u8, 215u8, - 199u8, 239u8, 24u8, 84u8, 247u8, 50u8, 135u8, 223u8, 110u8, 205u8, - 96u8, 170u8, 74u8, 232u8, 152u8, 135u8, 235u8, 62u8, 110u8, 230u8, - 172u8, 229u8, + 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, + 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, + 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, + 213u8, ], ) } - #[doc = "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 = "Advance a track onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "In the event of a fallback failure the whole call fails"] - #[doc = "with the weights returned."] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[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 = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub fn one_fewer_deciding( + &self, + track: types::one_fewer_deciding::Track, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Referenda", + "one_fewer_deciding", + types::OneFewerDeciding { track }, + [ + 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, + 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, + 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, + 131u8, 167u8, + ], + ) + } + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "## 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 = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "## Use Case"] - #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] - #[doc = " or both."] - pub fn if_else( + #[doc = "Emits `SubmissionDepositRefunded`."] + pub fn refund_submission_deposit( &self, - main: types::if_else::Main, - fallback: types::if_else::Fallback, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::refund_submission_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundSubmissionDeposit, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "if_else", - types::IfElse { - main: ::subxt::ext::subxt_core::alloc::boxed::Box::new(main), - fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), - }, + "Referenda", + "refund_submission_deposit", + types::RefundSubmissionDeposit { index }, [ - 195u8, 146u8, 198u8, 20u8, 96u8, 236u8, 218u8, 101u8, 252u8, 17u8, - 41u8, 246u8, 142u8, 116u8, 243u8, 198u8, 237u8, 168u8, 11u8, 211u8, - 236u8, 184u8, 71u8, 173u8, 211u8, 0u8, 129u8, 231u8, 99u8, 189u8, - 229u8, 34u8, + 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, + 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, + 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, ], ) } - #[doc = "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 = "Set or clear metadata of a referendum."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub fn dispatch_as_fallible( + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub fn set_metadata( &self, - as_origin: types::dispatch_as_fallible::AsOrigin, - call: types::dispatch_as_fallible::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + index: types::set_metadata::Index, + maybe_hash: types::set_metadata::MaybeHash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "dispatch_as_fallible", - types::DispatchAsFallible { - as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Referenda", + "set_metadata", + types::SetMetadata { index, maybe_hash }, [ - 52u8, 4u8, 122u8, 93u8, 231u8, 186u8, 88u8, 129u8, 36u8, 245u8, 176u8, - 117u8, 22u8, 203u8, 94u8, 115u8, 19u8, 27u8, 141u8, 63u8, 184u8, 171u8, - 146u8, 63u8, 124u8, 225u8, 135u8, 73u8, 51u8, 20u8, 60u8, 199u8, + 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, + 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, + 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, + 88u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_utility::pallet::Event; + pub type Event = runtime_types::pallet_referenda::pallet::Event1; pub mod events { use super::runtime_types; #[derive( @@ -8982,20 +9016,24 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] - #[doc = "well as the error."] - pub struct BatchInterrupted { - pub index: batch_interrupted::Index, - pub error: batch_interrupted::Error, + #[doc = "A referendum has been submitted."] + pub struct Submitted { + pub index: submitted::Index, + pub track: submitted::Track, + pub proposal: submitted::Proposal, } - pub mod batch_interrupted { + pub mod submitted { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Error = runtime_types::sp_runtime::DispatchError; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchInterrupted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchInterrupted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Submitted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9004,24 +9042,44 @@ 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 = "Batch of dispatches completed fully with no error."] - pub struct BatchCompleted; - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompleted"; + #[doc = "The decision deposit has been placed."] + pub struct DecisionDepositPlaced { + pub index: decision_deposit_placed::Index, + pub who: decision_deposit_placed::Who, + pub amount: decision_deposit_placed::Amount, } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, + pub mod decision_deposit_placed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "DecisionDepositPlaced"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Batch of dispatches completed but has errors."] - pub struct BatchCompletedWithErrors; - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompletedWithErrors { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompletedWithErrors"; + #[doc = "The decision deposit has been refunded."] + pub struct DecisionDepositRefunded { + pub index: decision_deposit_refunded::Index, + pub who: decision_deposit_refunded::Who, + pub amount: decision_deposit_refunded::Amount, + } + pub mod decision_deposit_refunded { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "DecisionDepositRefunded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9030,11 +9088,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A single item within a Batch of dispatches has completed with no error."] - pub struct ItemCompleted; - impl ::subxt::ext::subxt_core::events::StaticEvent for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; + #[doc = "A deposit has been slashed."] + pub struct DepositSlashed { + pub who: deposit_slashed::Who, + pub amount: deposit_slashed::Amount, + } + pub mod deposit_slashed { + use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "DepositSlashed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9043,17 +9109,27 @@ 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 single item within a Batch of dispatches has completed with error."] - pub struct ItemFailed { - pub error: item_failed::Error, + #[doc = "A referendum has moved into the deciding phase."] + pub struct DecisionStarted { + pub index: decision_started::Index, + pub track: decision_started::Track, + pub proposal: decision_started::Proposal, + pub tally: decision_started::Tally, } - pub mod item_failed { + pub mod decision_started { use super::runtime_types; - pub type Error = runtime_types::sp_runtime::DispatchError; + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ItemFailed { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemFailed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "DecisionStarted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9062,18 +9138,16 @@ 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 call was dispatched."] - pub struct DispatchedAs { - pub result: dispatched_as::Result, + pub struct ConfirmStarted { + pub index: confirm_started::Index, } - pub mod dispatched_as { + pub mod confirm_started { use super::runtime_types; - pub type Result = - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DispatchedAs { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "DispatchedAs"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "ConfirmStarted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9082,11 +9156,16 @@ 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 = "Main call was dispatched."] - pub struct IfElseMainSuccess; - impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseMainSuccess { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "IfElseMainSuccess"; + pub struct ConfirmAborted { + pub index: confirm_aborted::Index, + } + pub mod confirm_aborted { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "ConfirmAborted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9095,1394 +9174,1592 @@ 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 fallback call was dispatched."] - pub struct IfElseFallbackCalled { - pub main_error: if_else_fallback_called::MainError, + #[doc = "A referendum has ended its confirmation phase and is ready for approval."] + pub struct Confirmed { + pub index: confirmed::Index, + pub tally: confirmed::Tally, } - pub mod if_else_fallback_called { + pub mod confirmed { use super::runtime_types; - pub type MainError = runtime_types::sp_runtime::DispatchError; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseFallbackCalled { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "IfElseFallbackCalled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Confirmed"; } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The limit on the number of batched calls."] - pub fn batched_calls_limit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Utility", - "batched_calls_limit", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been approved and its proposal has been scheduled."] + pub struct Approved { + pub index: approved::Index, } - } - } - pub mod referenda { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_referenda::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_referenda::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + pub mod approved { 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 a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub struct Submit { - pub proposal_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub proposal: submit::Proposal, - pub enactment_moment: submit::EnactmentMoment, - } - pub mod submit { - use super::runtime_types; - pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - pub type EnactmentMoment = - runtime_types::frame_support::traits::schedule::DispatchTime< - ::core::primitive::u32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "submit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] - #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub struct PlaceDecisionDeposit { - pub index: place_decision_deposit::Index, - } - pub mod place_decision_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "place_decision_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub struct RefundDecisionDeposit { - pub index: refund_decision_deposit::Index, - } - pub mod refund_decision_deposit { + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Approved"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A proposal has been rejected by referendum."] + pub struct Rejected { + pub index: rejected::Index, + pub tally: rejected::Tally, + } + pub mod rejected { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Rejected"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been timed out without being decided."] + pub struct TimedOut { + pub index: timed_out::Index, + pub tally: timed_out::Tally, + } + pub mod timed_out { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "TimedOut"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been cancelled."] + pub struct Cancelled { + pub index: cancelled::Index, + pub tally: cancelled::Tally, + } + pub mod cancelled { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Cancelled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been killed."] + pub struct Killed { + pub index: killed::Index, + pub tally: killed::Tally, + } + pub mod killed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Killed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The submission deposit has been refunded."] + pub struct SubmissionDepositRefunded { + pub index: submission_deposit_refunded::Index, + pub who: submission_deposit_refunded::Who, + pub amount: submission_deposit_refunded::Amount, + } + pub mod submission_deposit_refunded { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "SubmissionDepositRefunded"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata for a referendum has been set."] + pub struct MetadataSet { + pub index: metadata_set::Index, + pub hash: metadata_set::Hash, + } + pub mod metadata_set { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata for a referendum has been cleared."] + pub struct MetadataCleared { + pub index: metadata_cleared::Index, + pub hash: metadata_cleared::Hash, + } + pub mod metadata_cleared { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "MetadataCleared"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod referendum_count { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type ReferendumCount = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "refund_decision_deposit"; + pub mod referendum_info_for { + use super::runtime_types; + pub type ReferendumInfoFor = + runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::quantus_runtime::OriginCaller, + ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >, + ::core::primitive::u128, + runtime_types::pallet_conviction_voting::types::Tally< + ::core::primitive::u128, + >, + ::subxt::ext::subxt_core::utils::AccountId32, + ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ), + >; + pub type Param0 = ::core::primitive::u32; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub struct Cancel { - pub index: cancel::Index, + pub mod track_queue { + use super::runtime_types; + pub type TrackQueue = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u128, + )>; + pub type Param0 = ::core::primitive::u16; } - pub mod cancel { + pub mod deciding_count { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type DecidingCount = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Referenda"; - 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 = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub struct Kill { - pub index: kill::Index, - } - pub mod kill { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "kill"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a referendum onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub struct NudgeReferendum { - pub index: nudge_referendum::Index, - } - pub mod nudge_referendum { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "nudge_referendum"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] - #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub struct OneFewerDeciding { - pub track: one_fewer_deciding::Track, - } - pub mod one_fewer_deciding { - use super::runtime_types; - pub type Track = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "one_fewer_deciding"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub struct RefundSubmissionDeposit { - pub index: refund_submission_deposit::Index, - } - pub mod refund_submission_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "refund_submission_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set or clear metadata of a referendum."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub struct SetMetadata { - pub index: set_metadata::Index, - pub maybe_hash: set_metadata::MaybeHash, - } - pub mod set_metadata { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeHash = - ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "set_metadata"; + pub mod metadata_of { + use super::runtime_types; + pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; } } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub fn submit( + pub struct StorageApi; + impl StorageApi { + #[doc = " The next free referendum index, aka the number of referenda started so far."] + pub fn referendum_count( &self, - proposal_origin: types::submit::ProposalOrigin, - proposal: types::submit::Proposal, - enactment_moment: types::submit::EnactmentMoment, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::referendum_count::ReferendumCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "submit", - types::Submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - proposal_origin, - ), - proposal, - enactment_moment, - }, + "ReferendumCount", + (), [ - 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, - 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, - 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, + 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, + 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, + 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, + 67u8, ], ) } - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] - #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub fn place_decision_deposit( + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for_iter( &self, - index: types::place_decision_deposit::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::referendum_info_for::ReferendumInfoFor, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "place_decision_deposit", - types::PlaceDecisionDeposit { index }, + "ReferendumInfoFor", + (), [ - 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, - 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, - 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, + 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, + 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, + 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, ], ) } - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub fn refund_decision_deposit( + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for( &self, - index: types::refund_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundDecisionDeposit, + _0: types::referendum_info_for::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::referendum_info_for::Param0, + >, + types::referendum_info_for::ReferendumInfoFor, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "refund_decision_deposit", - types::RefundDecisionDeposit { index }, + "ReferendumInfoFor", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, - 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, - 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, + 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, + 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, + 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, ], ) } - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub fn cancel( + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue_iter( &self, - 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::track_queue::TrackQueue, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "cancel", - types::Cancel { index }, + "TrackQueue", + (), [ - 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, - 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, - 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, - 122u8, + 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, + 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, + 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, ], ) } - #[doc = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub fn kill( + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue( &self, - index: types::kill::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::track_queue::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::track_queue::Param0, + >, + types::track_queue::TrackQueue, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "kill", - types::Kill { index }, + "TrackQueue", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, - 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, - 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, - 48u8, + 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, + 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, + 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, ], ) } - #[doc = "Advance a referendum onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub fn nudge_referendum( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count_iter( &self, - index: types::nudge_referendum::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::deciding_count::DecidingCount, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "nudge_referendum", - types::NudgeReferendum { index }, + "DecidingCount", + (), [ - 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, - 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, - 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, - 213u8, + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, ], ) } - #[doc = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] - #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub fn one_fewer_deciding( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count( &self, - track: types::one_fewer_deciding::Track, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::deciding_count::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::deciding_count::Param0, + >, + types::deciding_count::DecidingCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "one_fewer_deciding", - types::OneFewerDeciding { track }, + "DecidingCount", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, - 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, - 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, - 131u8, 167u8, + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, ], ) } - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub fn refund_submission_deposit( + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of_iter( &self, - index: types::refund_submission_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundSubmissionDeposit, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::metadata_of::MetadataOf, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "refund_submission_deposit", - types::RefundSubmissionDeposit { index }, + "MetadataOf", + (), [ - 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, - 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, - 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } - #[doc = "Set or clear metadata of a referendum."] + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub fn set_metadata( + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of( &self, - index: types::set_metadata::Index, - maybe_hash: types::set_metadata::MaybeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::metadata_of::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::metadata_of::Param0, + >, + types::metadata_of::MetadataOf, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "set_metadata", - types::SetMetadata { index, maybe_hash }, + "MetadataOf", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, - 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, - 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, - 88u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } } } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_referenda::pallet::Event1; - 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 = "A referendum has been submitted."] - pub struct Submitted { - pub index: submitted::Index, - pub track: submitted::Track, - pub proposal: submitted::Proposal, - } - pub mod submitted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Submitted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been placed."] - pub struct DecisionDepositPlaced { - pub index: decision_deposit_placed::Index, - pub who: decision_deposit_placed::Who, - pub amount: decision_deposit_placed::Amount, - } - pub mod decision_deposit_placed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionDepositPlaced"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been refunded."] - pub struct DecisionDepositRefunded { - pub index: decision_deposit_refunded::Index, - pub who: decision_deposit_refunded::Who, - pub amount: decision_deposit_refunded::Amount, - } - pub mod decision_deposit_refunded { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionDepositRefunded"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A deposit has been slashed."] - pub struct DepositSlashed { - pub who: deposit_slashed::Who, - pub amount: deposit_slashed::Amount, - } - pub mod deposit_slashed { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DepositSlashed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has moved into the deciding phase."] - pub struct DecisionStarted { - pub index: decision_started::Index, - pub track: decision_started::Track, - pub proposal: decision_started::Proposal, - pub tally: decision_started::Tally, - } - pub mod decision_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmStarted { - pub index: confirm_started::Index, - } - pub mod confirm_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "ConfirmStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmAborted { - pub index: confirm_aborted::Index, - } - pub mod confirm_aborted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "ConfirmAborted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has ended its confirmation phase and is ready for approval."] - pub struct Confirmed { - pub index: confirmed::Index, - pub tally: confirmed::Tally, - } - pub mod confirmed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Confirmed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been approved and its proposal has been scheduled."] - pub struct Approved { - pub index: approved::Index, + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] + pub fn submission_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Referenda", + "SubmissionDeposit", + [ + 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 = " Maximum size of the referendum queue for a single track."] + pub fn max_queued( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Referenda", + "MaxQueued", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The number of blocks after submission that a referendum must begin being decided by."] + #[doc = " Once this passes, then anyone may cancel the referendum."] + pub fn undeciding_timeout( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Referenda", + "UndecidingTimeout", + [ + 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 = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] + #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] + #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] + pub fn alarm_interval( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Referenda", + "AlarmInterval", + [ + 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 = " A list of tracks."] + #[doc = ""] + #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] + pub fn tracks( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u16, + runtime_types::pallet_referenda::types::TrackDetails< + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::subxt_core::alloc::string::String, + >, + )>, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Referenda", + "Tracks", + [ + 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, + 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, + 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, + 159u8, + ], + ) + } } - pub mod approved { + } + } + pub mod reversible_transfers { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_reversible_transfers::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_reversible_transfers::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 Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Approved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A proposal has been rejected by referendum."] - pub struct Rejected { - pub index: rejected::Index, - pub tally: rejected::Tally, - } - pub mod rejected { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Rejected"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been timed out without being decided."] - pub struct TimedOut { - pub index: timed_out::Index, - pub tally: timed_out::Tally, - } - pub mod timed_out { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "TimedOut"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been cancelled."] - pub struct Cancelled { - pub index: cancelled::Index, - pub tally: cancelled::Tally, - } - pub mod cancelled { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Cancelled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been killed."] - pub struct Killed { - pub index: killed::Index, - pub tally: killed::Tally, - } - pub mod killed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Killed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The submission deposit has been refunded."] - pub struct SubmissionDepositRefunded { - pub index: submission_deposit_refunded::Index, - pub who: submission_deposit_refunded::Who, - pub amount: submission_deposit_refunded::Amount, - } - pub mod submission_deposit_refunded { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "SubmissionDepositRefunded"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been set."] - pub struct MetadataSet { - pub index: metadata_set::Index, - pub hash: metadata_set::Hash, - } - pub mod metadata_set { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "MetadataSet"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been cleared."] - pub struct MetadataCleared { - pub index: metadata_cleared::Index, - pub hash: metadata_cleared::Hash, - } - pub mod metadata_cleared { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "MetadataCleared"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod referendum_count { - use super::runtime_types; - pub type ReferendumCount = ::core::primitive::u32; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Enable high-security for the calling account with a specified"] + #[doc = "reversibility delay."] + #[doc = ""] + #[doc = "Recoverer and interceptor (aka guardian) could be the same account or"] + #[doc = "different accounts."] + #[doc = ""] + #[doc = "Once an account is set as high security it can only make reversible"] + #[doc = "transfers. It is not allowed any other calls."] + #[doc = ""] + #[doc = "- `delay`: The reversibility time for any transfer made by the high"] + #[doc = "security account."] + #[doc = "- interceptor: The account that can intercept transctions from the"] + #[doc = "high security account."] + pub struct SetHighSecurity { + pub delay: set_high_security::Delay, + pub interceptor: set_high_security::Interceptor, } - pub mod referendum_info_for { + pub mod set_high_security { use super::runtime_types; - pub type ReferendumInfoFor = - runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::quantus_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >, - ::core::primitive::u128, - runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - ::subxt::ext::subxt_core::utils::AccountId32, - ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ), - >; - pub type Param0 = ::core::primitive::u32; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod track_queue { - use super::runtime_types; - pub type TrackQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u128, - )>; - pub type Param0 = ::core::primitive::u16; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHighSecurity { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "set_high_security"; } - pub mod deciding_count { - use super::runtime_types; - pub type DecidingCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 pending reversible transaction scheduled by the caller."] + #[doc = ""] + #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] + pub struct Cancel { + pub tx_id: cancel::TxId, } - pub mod metadata_of { + pub mod cancel { use super::runtime_types; - pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = ::core::primitive::u32; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "ReversibleTransfers"; + 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 = "Called by the Scheduler to finalize the scheduled task/call"] + #[doc = ""] + #[doc = "- `tx_id`: The unique id of the transaction to finalize and dispatch."] + pub struct ExecuteTransfer { + pub tx_id: execute_transfer::TxId, + } + pub mod execute_transfer { + use super::runtime_types; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExecuteTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "execute_transfer"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 transaction for delayed execution."] + pub struct ScheduleTransfer { + pub dest: schedule_transfer::Dest, + pub amount: schedule_transfer::Amount, + } + pub mod schedule_transfer { + use super::runtime_types; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_transfer"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 transaction for delayed execution with a custom, one-time delay."] + #[doc = ""] + #[doc = "This can only be used by accounts that have *not* set up a persistent"] + #[doc = "reversibility configuration with `set_high_security`."] + #[doc = ""] + #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] + pub struct ScheduleTransferWithDelay { + pub dest: schedule_transfer_with_delay::Dest, + pub amount: schedule_transfer_with_delay::Amount, + pub delay: schedule_transfer_with_delay::Delay, + } + pub mod schedule_transfer_with_delay { + use super::runtime_types; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransferWithDelay { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_transfer_with_delay"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 an asset transfer (pallet-assets) for delayed execution using the configured"] + #[doc = "delay."] + pub struct ScheduleAssetTransfer { + pub asset_id: schedule_asset_transfer::AssetId, + pub dest: schedule_asset_transfer::Dest, + pub amount: schedule_asset_transfer::Amount, + } + pub mod schedule_asset_transfer { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_asset_transfer"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 an asset transfer (pallet-assets) with a custom one-time delay."] + pub struct ScheduleAssetTransferWithDelay { + pub asset_id: schedule_asset_transfer_with_delay::AssetId, + pub dest: schedule_asset_transfer_with_delay::Dest, + pub amount: schedule_asset_transfer_with_delay::Amount, + pub delay: schedule_asset_transfer_with_delay::Delay, + } + pub mod schedule_asset_transfer_with_delay { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransferWithDelay { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_asset_transfer_with_delay"; } } - pub struct StorageApi; - impl StorageApi { - #[doc = " The next free referendum index, aka the number of referenda started so far."] - pub fn referendum_count( + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Enable high-security for the calling account with a specified"] + #[doc = "reversibility delay."] + #[doc = ""] + #[doc = "Recoverer and interceptor (aka guardian) could be the same account or"] + #[doc = "different accounts."] + #[doc = ""] + #[doc = "Once an account is set as high security it can only make reversible"] + #[doc = "transfers. It is not allowed any other calls."] + #[doc = ""] + #[doc = "- `delay`: The reversibility time for any transfer made by the high"] + #[doc = "security account."] + #[doc = "- interceptor: The account that can intercept transctions from the"] + #[doc = "high security account."] + pub fn set_high_security( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::referendum_count::ReferendumCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumCount", - (), + delay: types::set_high_security::Delay, + interceptor: types::set_high_security::Interceptor, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "set_high_security", + types::SetHighSecurity { delay, interceptor }, [ - 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, - 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, - 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, - 67u8, + 202u8, 17u8, 43u8, 37u8, 215u8, 198u8, 42u8, 183u8, 53u8, 124u8, 140u8, + 34u8, 112u8, 230u8, 55u8, 168u8, 242u8, 249u8, 91u8, 185u8, 244u8, + 81u8, 40u8, 231u8, 121u8, 155u8, 202u8, 76u8, 137u8, 7u8, 225u8, 184u8, ], ) } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for_iter( + #[doc = "Cancel a pending reversible transaction scheduled by the caller."] + #[doc = ""] + #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] + pub fn cancel( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::referendum_info_for::ReferendumInfoFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumInfoFor", - (), + tx_id: types::cancel::TxId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "cancel", + types::Cancel { tx_id }, [ - 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, - 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, - 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, + 228u8, 150u8, 194u8, 119u8, 243u8, 126u8, 112u8, 227u8, 70u8, 160u8, + 132u8, 82u8, 146u8, 162u8, 195u8, 149u8, 236u8, 98u8, 18u8, 44u8, + 151u8, 249u8, 193u8, 176u8, 186u8, 98u8, 224u8, 103u8, 191u8, 165u8, + 37u8, 47u8, ], ) } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for( + #[doc = "Called by the Scheduler to finalize the scheduled task/call"] + #[doc = ""] + #[doc = "- `tx_id`: The unique id of the transaction to finalize and dispatch."] + pub fn execute_transfer( &self, - _0: types::referendum_info_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::referendum_info_for::Param0, - >, - types::referendum_info_for::ReferendumInfoFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumInfoFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + tx_id: types::execute_transfer::TxId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "execute_transfer", + types::ExecuteTransfer { tx_id }, [ - 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, - 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, - 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, + 164u8, 38u8, 166u8, 81u8, 63u8, 235u8, 167u8, 178u8, 97u8, 80u8, 62u8, + 147u8, 3u8, 163u8, 129u8, 25u8, 98u8, 59u8, 17u8, 137u8, 6u8, 183u8, + 189u8, 51u8, 24u8, 211u8, 157u8, 108u8, 229u8, 253u8, 37u8, 78u8, ], ) } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue_iter( + #[doc = "Schedule a transaction for delayed execution."] + pub fn schedule_transfer( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::track_queue::TrackQueue, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "TrackQueue", - (), + dest: types::schedule_transfer::Dest, + amount: types::schedule_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "schedule_transfer", + types::ScheduleTransfer { dest, amount }, [ - 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, - 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, - 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, + 38u8, 219u8, 206u8, 56u8, 252u8, 195u8, 52u8, 74u8, 113u8, 125u8, + 107u8, 35u8, 236u8, 39u8, 31u8, 18u8, 250u8, 177u8, 174u8, 154u8, + 149u8, 122u8, 183u8, 50u8, 45u8, 111u8, 100u8, 249u8, 102u8, 82u8, + 72u8, 130u8, ], ) } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] + #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue( - &self, - _0: types::track_queue::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::track_queue::Param0, - >, - types::track_queue::TrackQueue, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "TrackQueue", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, - 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, - 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, - ], - ) - } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::deciding_count::DecidingCount, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "DecidingCount", - (), - [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, - ], - ) - } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count( + #[doc = "This can only be used by accounts that have *not* set up a persistent"] + #[doc = "reversibility configuration with `set_high_security`."] + #[doc = ""] + #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] + pub fn schedule_transfer_with_delay( &self, - _0: types::deciding_count::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::deciding_count::Param0, - >, - types::deciding_count::DecidingCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + dest: types::schedule_transfer_with_delay::Dest, + amount: types::schedule_transfer_with_delay::Amount, + delay: types::schedule_transfer_with_delay::Delay, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::ScheduleTransferWithDelay, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "DecidingCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "schedule_transfer_with_delay", + types::ScheduleTransferWithDelay { dest, amount, delay }, [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 254u8, 158u8, 173u8, 217u8, 107u8, 80u8, 229u8, 252u8, 123u8, 46u8, + 177u8, 40u8, 25u8, 15u8, 32u8, 22u8, 224u8, 52u8, 242u8, 48u8, 242u8, + 84u8, 242u8, 143u8, 111u8, 12u8, 82u8, 161u8, 129u8, 86u8, 161u8, + 216u8, ], ) } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of_iter( + #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] + #[doc = "delay."] + pub fn schedule_asset_transfer( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::metadata_of::MetadataOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + asset_id: types::schedule_asset_transfer::AssetId, + dest: types::schedule_asset_transfer::Dest, + amount: types::schedule_asset_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::ScheduleAssetTransfer, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "MetadataOf", - (), + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "schedule_asset_transfer", + types::ScheduleAssetTransfer { asset_id, dest, amount }, [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 125u8, 51u8, 89u8, 31u8, 247u8, 200u8, 156u8, 209u8, 28u8, 170u8, + 203u8, 254u8, 40u8, 131u8, 155u8, 166u8, 65u8, 152u8, 101u8, 198u8, + 70u8, 129u8, 5u8, 89u8, 220u8, 189u8, 255u8, 87u8, 58u8, 24u8, 234u8, + 42u8, ], ) } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of( + #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] + pub fn schedule_asset_transfer_with_delay( &self, - _0: types::metadata_of::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata_of::Param0, - >, - types::metadata_of::MetadataOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + asset_id: types::schedule_asset_transfer_with_delay::AssetId, + dest: types::schedule_asset_transfer_with_delay::Dest, + amount: types::schedule_asset_transfer_with_delay::Amount, + delay: types::schedule_asset_transfer_with_delay::Delay, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::ScheduleAssetTransferWithDelay, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "MetadataOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "schedule_asset_transfer_with_delay", + types::ScheduleAssetTransferWithDelay { asset_id, dest, amount, delay }, [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 249u8, 59u8, 121u8, 27u8, 78u8, 202u8, 252u8, 120u8, 76u8, 102u8, 33u8, + 232u8, 185u8, 78u8, 8u8, 157u8, 139u8, 72u8, 110u8, 91u8, 170u8, 179u8, + 89u8, 250u8, 77u8, 26u8, 160u8, 252u8, 62u8, 179u8, 128u8, 216u8, ], ) } } } - pub mod constants { + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_reversible_transfers::pallet::Event; + pub mod events { use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] - pub fn submission_deposit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "SubmissionDeposit", - [ - 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 = " Maximum size of the referendum queue for a single track."] - pub fn max_queued( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A user has enabled their high-security settings."] + #[doc = "[who, interceptor, recoverer, delay]"] + pub struct HighSecuritySet { + pub who: high_security_set::Who, + pub interceptor: high_security_set::Interceptor, + pub delay: high_security_set::Delay, + } + pub mod high_security_set { + use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "MaxQueued", + ::core::primitive::u64, + >; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for HighSecuritySet { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "HighSecuritySet"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A transaction has been intercepted and scheduled for delayed execution."] + #[doc = "[from, to, interceptor, amount, tx_id, execute_at_moment]"] + pub struct TransactionScheduled { + pub from: transaction_scheduled::From, + pub to: transaction_scheduled::To, + pub interceptor: transaction_scheduled::Interceptor, + pub asset_id: transaction_scheduled::AssetId, + pub amount: transaction_scheduled::Amount, + pub tx_id: transaction_scheduled::TxId, + pub execute_at: transaction_scheduled::ExecuteAt, + } + pub mod transaction_scheduled { + use super::runtime_types; + pub type From = ::subxt::ext::subxt_core::utils::AccountId32; + pub type To = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; + pub type AssetId = ::core::option::Option<::core::primitive::u32>; + pub type Amount = ::core::primitive::u128; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type ExecuteAt = runtime_types::qp_scheduler::DispatchTime< + ::core::primitive::u32, + ::core::primitive::u64, + >; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionScheduled { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionScheduled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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, + } + pub mod transaction_cancelled { + use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionCancelled { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionCancelled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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, + } + pub mod transaction_executed { + use super::runtime_types; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type Result = ::core::result::Result< + runtime_types::frame_support::dispatch::PostDispatchInfo, + runtime_types::sp_runtime::DispatchErrorWithPostInfo< + runtime_types::frame_support::dispatch::PostDispatchInfo, + >, + >; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionExecuted { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionExecuted"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod high_security_accounts { + use super::runtime_types; + pub type HighSecurityAccounts = + runtime_types::pallet_reversible_transfers::HighSecurityAccountData< + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod pending_transfers { + use super::runtime_types; + pub type PendingTransfers = + runtime_types::pallet_reversible_transfers::PendingTransfer< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + } + pub mod account_pending_index { + use super::runtime_types; + pub type AccountPendingIndex = ::core::primitive::u32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod pending_transfers_by_sender { + use super::runtime_types; + pub type PendingTransfersBySender = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::H256, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod pending_transfers_by_recipient { + use super::runtime_types; + pub type PendingTransfersByRecipient = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::H256, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod interceptor_index { + use super::runtime_types; + pub type InterceptorIndex = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod global_nonce { + use super::runtime_types; + pub type GlobalNonce = ::core::primitive::u64; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] + #[doc = " Accounts present in this map have reversibility enabled."] + pub fn high_security_accounts_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::high_security_accounts::HighSecurityAccounts, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "HighSecurityAccounts", + (), [ - 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, + 11u8, 143u8, 95u8, 23u8, 55u8, 163u8, 22u8, 238u8, 88u8, 24u8, 50u8, + 162u8, 72u8, 98u8, 32u8, 219u8, 231u8, 199u8, 118u8, 150u8, 84u8, + 126u8, 225u8, 88u8, 129u8, 200u8, 236u8, 214u8, 187u8, 8u8, 252u8, + 120u8, ], ) } - #[doc = " The number of blocks after submission that a referendum must begin being decided by."] - #[doc = " Once this passes, then anyone may cancel the referendum."] - pub fn undeciding_timeout( + #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] + #[doc = " Accounts present in this map have reversibility enabled."] + pub fn high_security_accounts( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + _0: types::high_security_accounts::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::high_security_accounts::Param0, + >, + types::high_security_accounts::HighSecurityAccounts, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "UndecidingTimeout", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "HighSecurityAccounts", + ::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, + 11u8, 143u8, 95u8, 23u8, 55u8, 163u8, 22u8, 238u8, 88u8, 24u8, 50u8, + 162u8, 72u8, 98u8, 32u8, 219u8, 231u8, 199u8, 118u8, 150u8, 84u8, + 126u8, 225u8, 88u8, 129u8, 200u8, 236u8, 214u8, 187u8, 8u8, 252u8, + 120u8, ], ) } - #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] - #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] - #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] - pub fn alarm_interval( + #[doc = " Stores the details of pending transactions scheduled for delayed execution."] + #[doc = " Keyed by the unique transaction ID."] + pub fn pending_transfers_iter( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::pending_transfers::PendingTransfers, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "AlarmInterval", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfers", + (), [ - 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, + 226u8, 148u8, 100u8, 60u8, 9u8, 160u8, 164u8, 177u8, 53u8, 236u8, 65u8, + 38u8, 207u8, 31u8, 170u8, 79u8, 15u8, 237u8, 127u8, 189u8, 203u8, + 147u8, 4u8, 146u8, 13u8, 87u8, 158u8, 163u8, 159u8, 87u8, 98u8, 211u8, ], ) } - #[doc = " A list of tracks."] - #[doc = ""] - #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] - pub fn tracks( + #[doc = " Stores the details of pending transactions scheduled for delayed execution."] + #[doc = " Keyed by the unique transaction ID."] + pub fn pending_transfers( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u16, - runtime_types::pallet_referenda::types::TrackDetails< - ::core::primitive::u128, - ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::string::String, - >, - )>, + _0: types::pending_transfers::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::pending_transfers::Param0, + >, + types::pending_transfers::PendingTransfers, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "Tracks", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfers", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, - 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, - 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, - 159u8, + 226u8, 148u8, 100u8, 60u8, 9u8, 160u8, 164u8, 177u8, 53u8, 236u8, 65u8, + 38u8, 207u8, 31u8, 170u8, 79u8, 15u8, 237u8, 127u8, 189u8, 203u8, + 147u8, 4u8, 146u8, 13u8, 87u8, 158u8, 163u8, 159u8, 87u8, 98u8, 211u8, ], ) } - } - } - } - pub mod reversible_transfers { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_reversible_transfers::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_reversible_transfers::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 = "Enable high-security for the calling account with a specified"] - #[doc = "reversibility delay."] - #[doc = ""] - #[doc = "Recoverer and interceptor (aka guardian) could be the same account or"] - #[doc = "different accounts."] - #[doc = ""] - #[doc = "Once an account is set as high security it can only make reversible"] - #[doc = "transfers. It is not allowed any other calls."] - #[doc = ""] - #[doc = "- `delay`: The reversibility time for any transfer made by the high"] - #[doc = "security account."] - #[doc = "- interceptor: The account that can intercept transctions from the"] - #[doc = "high security account."] - pub struct SetHighSecurity { - pub delay: set_high_security::Delay, - pub interceptor: set_high_security::Interceptor, - } - pub mod set_high_security { - use super::runtime_types; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; + #[doc = " Indexes pending transaction IDs per account for efficient lookup and cancellation."] + #[doc = " Also enforces the maximum pending transactions limit per account."] + pub fn account_pending_index_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::account_pending_index::AccountPendingIndex, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "AccountPendingIndex", + (), + [ + 142u8, 255u8, 15u8, 41u8, 210u8, 84u8, 93u8, 230u8, 194u8, 31u8, 164u8, + 88u8, 155u8, 106u8, 130u8, 110u8, 199u8, 137u8, 153u8, 99u8, 154u8, + 210u8, 108u8, 136u8, 70u8, 141u8, 242u8, 255u8, 246u8, 19u8, 247u8, + 136u8, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHighSecurity { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "set_high_security"; + #[doc = " Indexes pending transaction IDs per account for efficient lookup and cancellation."] + #[doc = " Also enforces the maximum pending transactions limit per account."] + pub fn account_pending_index( + &self, + _0: types::account_pending_index::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::account_pending_index::Param0, + >, + types::account_pending_index::AccountPendingIndex, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "AccountPendingIndex", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 142u8, 255u8, 15u8, 41u8, 210u8, 84u8, 93u8, 230u8, 194u8, 31u8, 164u8, + 88u8, 155u8, 106u8, 130u8, 110u8, 199u8, 137u8, 153u8, 99u8, 154u8, + 210u8, 108u8, 136u8, 70u8, 141u8, 242u8, 255u8, 246u8, 19u8, 247u8, + 136u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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 pending reversible transaction scheduled by the caller."] - #[doc = ""] - #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] - pub struct Cancel { - pub tx_id: cancel::TxId, + #[doc = " Maps sender accounts to their list of pending transaction IDs."] + #[doc = " This allows users to query all their outgoing pending transfers."] + pub fn pending_transfers_by_sender_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::pending_transfers_by_sender::PendingTransfersBySender, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfersBySender", + (), + [ + 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, + 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, + 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, + ], + ) } - pub mod cancel { - use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; + #[doc = " Maps sender accounts to their list of pending transaction IDs."] + #[doc = " This allows users to query all their outgoing pending transfers."] + pub fn pending_transfers_by_sender( + &self, + _0: types::pending_transfers_by_sender::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::pending_transfers_by_sender::Param0, + >, + types::pending_transfers_by_sender::PendingTransfersBySender, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfersBySender", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, + 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, + 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "cancel"; + #[doc = " Maps recipient accounts to their list of pending incoming transaction IDs."] + #[doc = " This allows users to query all their incoming pending transfers."] + pub fn pending_transfers_by_recipient_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::pending_transfers_by_recipient::PendingTransfersByRecipient, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfersByRecipient", + (), + [ + 63u8, 141u8, 24u8, 239u8, 201u8, 143u8, 36u8, 152u8, 35u8, 110u8, + 112u8, 157u8, 29u8, 61u8, 221u8, 79u8, 209u8, 192u8, 183u8, 29u8, + 145u8, 166u8, 238u8, 156u8, 131u8, 203u8, 124u8, 233u8, 210u8, 201u8, + 91u8, 212u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Called by the Scheduler to finalize the scheduled task/call"] - #[doc = ""] - #[doc = "- `tx_id`: The unique id of the transaction to finalize and dispatch."] - pub struct ExecuteTransfer { - pub tx_id: execute_transfer::TxId, + #[doc = " Maps recipient accounts to their list of pending incoming transaction IDs."] + #[doc = " This allows users to query all their incoming pending transfers."] + pub fn pending_transfers_by_recipient( + &self, + _0: types::pending_transfers_by_recipient::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::pending_transfers_by_recipient::Param0, + >, + types::pending_transfers_by_recipient::PendingTransfersByRecipient, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfersByRecipient", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 63u8, 141u8, 24u8, 239u8, 201u8, 143u8, 36u8, 152u8, 35u8, 110u8, + 112u8, 157u8, 29u8, 61u8, 221u8, 79u8, 209u8, 192u8, 183u8, 29u8, + 145u8, 166u8, 238u8, 156u8, 131u8, 203u8, 124u8, 233u8, 210u8, 201u8, + 91u8, 212u8, + ], + ) } - pub mod execute_transfer { - use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; + #[doc = " Maps interceptor accounts to the list of accounts they can intercept for."] + #[doc = " This allows the UI to efficiently query all accounts for which a given account is an"] + #[doc = " interceptor."] + pub fn interceptor_index_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::interceptor_index::InterceptorIndex, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "InterceptorIndex", + (), + [ + 7u8, 184u8, 75u8, 107u8, 42u8, 84u8, 188u8, 86u8, 2u8, 227u8, 4u8, + 136u8, 109u8, 69u8, 64u8, 123u8, 253u8, 28u8, 174u8, 121u8, 183u8, + 154u8, 135u8, 91u8, 125u8, 0u8, 58u8, 132u8, 164u8, 236u8, 182u8, + 133u8, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExecuteTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "execute_transfer"; + #[doc = " Maps interceptor accounts to the list of accounts they can intercept for."] + #[doc = " This allows the UI to efficiently query all accounts for which a given account is an"] + #[doc = " interceptor."] + pub fn interceptor_index( + &self, + _0: types::interceptor_index::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::interceptor_index::Param0, + >, + types::interceptor_index::InterceptorIndex, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "InterceptorIndex", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 7u8, 184u8, 75u8, 107u8, 42u8, 84u8, 188u8, 86u8, 2u8, 227u8, 4u8, + 136u8, 109u8, 69u8, 64u8, 123u8, 253u8, 28u8, 174u8, 121u8, 183u8, + 154u8, 135u8, 91u8, 125u8, 0u8, 58u8, 132u8, 164u8, 236u8, 182u8, + 133u8, + ], + ) + } + #[doc = " Global nonce for generating unique transaction IDs."] + pub fn global_nonce( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + 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( + "ReversibleTransfers", + "GlobalNonce", + (), + [ + 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, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Maximum pending reversible transactions allowed per account. Used for BoundedVec."] + pub fn max_pending_per_account( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "MaxPendingPerAccount", + [ + 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 number of accounts an interceptor can intercept for. Used for BoundedVec."] + pub fn max_interceptor_accounts( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "MaxInterceptorAccounts", + [ + 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 default delay period for reversible transactions if none is specified."] + #[doc = ""] + #[doc = " NOTE: default delay is always in blocks."] + pub fn default_delay( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "DefaultDelay", + [ + 245u8, 29u8, 3u8, 65u8, 154u8, 12u8, 172u8, 71u8, 67u8, 134u8, 71u8, + 180u8, 4u8, 9u8, 54u8, 89u8, 6u8, 19u8, 3u8, 168u8, 67u8, 122u8, 197u8, + 109u8, 1u8, 228u8, 44u8, 243u8, 228u8, 194u8, 241u8, 227u8, + ], + ) + } + #[doc = " The minimum delay period allowed for reversible transactions, in blocks."] + pub fn min_delay_period_blocks( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "MinDelayPeriodBlocks", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The minimum delay period allowed for reversible transactions, in milliseconds."] + pub fn min_delay_period_moment( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u64, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "MinDelayPeriodMoment", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) + } + #[doc = " Volume fee taken from reversed transactions for high-security accounts only,"] + #[doc = " expressed as a Permill (e.g., Permill::from_percent(1) = 1%). Regular accounts incur no"] + #[doc = " fees."] + pub fn volume_fee( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "VolumeFee", + [ + 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, + 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, + 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, + ], + ) } + } + } + } + pub mod conviction_voting { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_conviction_voting::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_conviction_voting::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, @@ -10494,22 +10771,30 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule a transaction for delayed execution."] - pub struct ScheduleTransfer { - pub dest: schedule_transfer::Dest, - pub amount: schedule_transfer::Amount, + #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `poll_index`: The index of the poll to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] + pub struct Vote { + #[codec(compact)] + pub poll_index: vote::PollIndex, + pub vote: vote::Vote, } - pub mod schedule_transfer { + pub mod vote { use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), + pub type PollIndex = ::core::primitive::u32; + pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< + ::core::primitive::u128, >; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_transfer"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "vote"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10522,32 +10807,49 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] + #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] + #[doc = "particular class of polls."] #[doc = ""] - #[doc = "This can only be used by accounts that have *not* set up a persistent"] - #[doc = "reversibility configuration with `set_high_security`."] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] #[doc = ""] - #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] - pub struct ScheduleTransferWithDelay { - pub dest: schedule_transfer_with_delay::Dest, - pub amount: schedule_transfer_with_delay::Amount, - pub delay: schedule_transfer_with_delay::Delay, - } - pub mod schedule_transfer_with_delay { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed through"] + #[doc = " `remove_vote`)."] + #[doc = ""] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] + #[doc = " to this function are required."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] + #[doc = ""] + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub struct Delegate { + pub class: delegate::Class, + pub to: delegate::To, + pub conviction: delegate::Conviction, + pub balance: delegate::Balance, + } + pub mod delegate { + use super::runtime_types; + pub type Class = ::core::primitive::u16; + pub type To = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), >; + pub type Conviction = + runtime_types::pallet_conviction_voting::conviction::Conviction; + pub type Balance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransferWithDelay { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_transfer_with_delay"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Delegate { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "delegate"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10560,25 +10862,66 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] - #[doc = "delay."] - pub struct ScheduleAssetTransfer { - pub asset_id: schedule_asset_transfer::AssetId, - pub dest: schedule_asset_transfer::Dest, - pub amount: schedule_asset_transfer::Amount, + #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] + #[doc = ""] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued has passed."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub struct Undelegate { + pub class: undelegate::Class, } - pub mod schedule_asset_transfer { + pub mod undelegate { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Class = ::core::primitive::u16; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Undelegate { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "undelegate"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] + #[doc = "class."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `class`: The class of polls to unlock."] + #[doc = "- `target`: The account to remove the lock on."] + #[doc = ""] + #[doc = "Weight: `O(R)` with R number of vote of target."] + pub struct Unlock { + pub class: unlock::Class, + pub target: unlock::Target, + } + pub mod unlock { + use super::runtime_types; + pub type Class = ::core::primitive::u16; + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_asset_transfer"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Unlock { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "unlock"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10591,193 +10934,303 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] - pub struct ScheduleAssetTransferWithDelay { - pub asset_id: schedule_asset_transfer_with_delay::AssetId, - pub dest: schedule_asset_transfer_with_delay::Dest, - pub amount: schedule_asset_transfer_with_delay::Amount, - pub delay: schedule_asset_transfer_with_delay::Delay, + #[doc = "Remove a vote for a poll."] + #[doc = ""] + #[doc = "If:"] + #[doc = "- the poll was cancelled, or"] + #[doc = "- the poll is ongoing, or"] + #[doc = "- the poll has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] + #[doc = ""] + #[doc = "If, however, the poll has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for poll `index`."] + #[doc = ""] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] + #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub struct RemoveVote { + pub class: remove_vote::Class, + pub index: remove_vote::Index, } - pub mod schedule_asset_transfer_with_delay { + pub mod remove_vote { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Class = ::core::option::Option<::core::primitive::u16>; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveVote { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "remove_vote"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 a vote for a poll."] + #[doc = ""] + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the poll was cancelled, because the voter lost the poll or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] + #[doc = " `index`."] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: The class of the poll."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub struct RemoveOtherVote { + pub target: remove_other_vote::Target, + pub class: remove_other_vote::Class, + pub index: remove_other_vote::Index, + } + pub mod remove_other_vote { + use super::runtime_types; + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; + pub type Class = ::core::primitive::u16; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransferWithDelay { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_asset_transfer_with_delay"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveOtherVote { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "remove_other_vote"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Enable high-security for the calling account with a specified"] - #[doc = "reversibility delay."] + #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] #[doc = ""] - #[doc = "Recoverer and interceptor (aka guardian) could be the same account or"] - #[doc = "different accounts."] + #[doc = "The dispatch origin of this call must be _Signed_."] #[doc = ""] - #[doc = "Once an account is set as high security it can only make reversible"] - #[doc = "transfers. It is not allowed any other calls."] + #[doc = "- `poll_index`: The index of the poll to vote for."] + #[doc = "- `vote`: The vote configuration."] #[doc = ""] - #[doc = "- `delay`: The reversibility time for any transfer made by the high"] - #[doc = "security account."] - #[doc = "- interceptor: The account that can intercept transctions from the"] - #[doc = "high security account."] - pub fn set_high_security( + #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] + pub fn vote( &self, - delay: types::set_high_security::Delay, - interceptor: types::set_high_security::Interceptor, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + poll_index: types::vote::PollIndex, + vote: types::vote::Vote, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "set_high_security", - types::SetHighSecurity { delay, interceptor }, + "ConvictionVoting", + "vote", + types::Vote { poll_index, vote }, [ - 202u8, 17u8, 43u8, 37u8, 215u8, 198u8, 42u8, 183u8, 53u8, 124u8, 140u8, - 34u8, 112u8, 230u8, 55u8, 168u8, 242u8, 249u8, 91u8, 185u8, 244u8, - 81u8, 40u8, 231u8, 121u8, 155u8, 202u8, 76u8, 137u8, 7u8, 225u8, 184u8, + 57u8, 170u8, 177u8, 168u8, 158u8, 43u8, 87u8, 242u8, 176u8, 85u8, + 230u8, 64u8, 103u8, 239u8, 190u8, 6u8, 228u8, 165u8, 248u8, 77u8, + 231u8, 221u8, 186u8, 107u8, 249u8, 201u8, 226u8, 52u8, 129u8, 90u8, + 142u8, 159u8, ], ) } - #[doc = "Cancel a pending reversible transaction scheduled by the caller."] + #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] + #[doc = "particular class of polls."] #[doc = ""] - #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] - pub fn cancel( - &self, - tx_id: types::cancel::TxId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "cancel", - types::Cancel { tx_id }, - [ - 228u8, 150u8, 194u8, 119u8, 243u8, 126u8, 112u8, 227u8, 70u8, 160u8, - 132u8, 82u8, 146u8, 162u8, 195u8, 149u8, 236u8, 98u8, 18u8, 44u8, - 151u8, 249u8, 193u8, 176u8, 186u8, 98u8, 224u8, 103u8, 191u8, 165u8, - 37u8, 47u8, - ], - ) - } - #[doc = "Called by the Scheduler to finalize the scheduled task/call"] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] #[doc = ""] - #[doc = "- `tx_id`: The unique id of the transaction to finalize and dispatch."] - pub fn execute_transfer( + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed through"] + #[doc = " `remove_vote`)."] + #[doc = ""] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] + #[doc = " to this function are required."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] + #[doc = ""] + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub fn delegate( &self, - tx_id: types::execute_transfer::TxId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + class: types::delegate::Class, + to: types::delegate::To, + conviction: types::delegate::Conviction, + balance: types::delegate::Balance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "execute_transfer", - types::ExecuteTransfer { tx_id }, + "ConvictionVoting", + "delegate", + types::Delegate { class, to, conviction, balance }, [ - 164u8, 38u8, 166u8, 81u8, 63u8, 235u8, 167u8, 178u8, 97u8, 80u8, 62u8, - 147u8, 3u8, 163u8, 129u8, 25u8, 98u8, 59u8, 17u8, 137u8, 6u8, 183u8, - 189u8, 51u8, 24u8, 211u8, 157u8, 108u8, 229u8, 253u8, 37u8, 78u8, + 223u8, 143u8, 33u8, 94u8, 32u8, 156u8, 43u8, 40u8, 142u8, 134u8, 209u8, + 134u8, 255u8, 179u8, 97u8, 46u8, 8u8, 140u8, 5u8, 29u8, 76u8, 22u8, + 36u8, 7u8, 108u8, 190u8, 220u8, 151u8, 10u8, 47u8, 89u8, 55u8, ], ) } - #[doc = "Schedule a transaction for delayed execution."] - pub fn schedule_transfer( + #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] + #[doc = ""] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued has passed."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub fn undelegate( &self, - dest: types::schedule_transfer::Dest, - amount: types::schedule_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + class: types::undelegate::Class, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_transfer", - types::ScheduleTransfer { dest, amount }, + "ConvictionVoting", + "undelegate", + types::Undelegate { class }, [ - 38u8, 219u8, 206u8, 56u8, 252u8, 195u8, 52u8, 74u8, 113u8, 125u8, - 107u8, 35u8, 236u8, 39u8, 31u8, 18u8, 250u8, 177u8, 174u8, 154u8, - 149u8, 122u8, 183u8, 50u8, 45u8, 111u8, 100u8, 249u8, 102u8, 82u8, - 72u8, 130u8, + 140u8, 232u8, 6u8, 53u8, 228u8, 8u8, 131u8, 144u8, 65u8, 66u8, 245u8, + 247u8, 147u8, 135u8, 198u8, 57u8, 82u8, 212u8, 89u8, 46u8, 236u8, + 168u8, 200u8, 220u8, 93u8, 168u8, 101u8, 29u8, 110u8, 76u8, 67u8, + 181u8, ], ) } - #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] + #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] + #[doc = "class."] #[doc = ""] - #[doc = "This can only be used by accounts that have *not* set up a persistent"] - #[doc = "reversibility configuration with `set_high_security`."] + #[doc = "The dispatch origin of this call must be _Signed_."] #[doc = ""] - #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] - pub fn schedule_transfer_with_delay( + #[doc = "- `class`: The class of polls to unlock."] + #[doc = "- `target`: The account to remove the lock on."] + #[doc = ""] + #[doc = "Weight: `O(R)` with R number of vote of target."] + pub fn unlock( &self, - dest: types::schedule_transfer_with_delay::Dest, - amount: types::schedule_transfer_with_delay::Amount, - delay: types::schedule_transfer_with_delay::Delay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleTransferWithDelay, - > { + class: types::unlock::Class, + target: types::unlock::Target, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_transfer_with_delay", - types::ScheduleTransferWithDelay { dest, amount, delay }, + "ConvictionVoting", + "unlock", + types::Unlock { class, target }, [ - 254u8, 158u8, 173u8, 217u8, 107u8, 80u8, 229u8, 252u8, 123u8, 46u8, - 177u8, 40u8, 25u8, 15u8, 32u8, 22u8, 224u8, 52u8, 242u8, 48u8, 242u8, - 84u8, 242u8, 143u8, 111u8, 12u8, 82u8, 161u8, 129u8, 86u8, 161u8, - 216u8, + 79u8, 5u8, 252u8, 237u8, 109u8, 238u8, 157u8, 237u8, 125u8, 171u8, + 65u8, 160u8, 102u8, 192u8, 5u8, 141u8, 179u8, 249u8, 253u8, 213u8, + 105u8, 251u8, 241u8, 145u8, 186u8, 177u8, 244u8, 139u8, 71u8, 140u8, + 173u8, 108u8, ], ) } - #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] - #[doc = "delay."] - pub fn schedule_asset_transfer( + #[doc = "Remove a vote for a poll."] + #[doc = ""] + #[doc = "If:"] + #[doc = "- the poll was cancelled, or"] + #[doc = "- the poll is ongoing, or"] + #[doc = "- the poll has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] + #[doc = ""] + #[doc = "If, however, the poll has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for poll `index`."] + #[doc = ""] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] + #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_vote( &self, - asset_id: types::schedule_asset_transfer::AssetId, - dest: types::schedule_asset_transfer::Dest, - amount: types::schedule_asset_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleAssetTransfer, - > { + class: types::remove_vote::Class, + index: types::remove_vote::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_asset_transfer", - types::ScheduleAssetTransfer { asset_id, dest, amount }, + "ConvictionVoting", + "remove_vote", + types::RemoveVote { class, index }, [ - 125u8, 51u8, 89u8, 31u8, 247u8, 200u8, 156u8, 209u8, 28u8, 170u8, - 203u8, 254u8, 40u8, 131u8, 155u8, 166u8, 65u8, 152u8, 101u8, 198u8, - 70u8, 129u8, 5u8, 89u8, 220u8, 189u8, 255u8, 87u8, 58u8, 24u8, 234u8, - 42u8, + 255u8, 108u8, 211u8, 146u8, 168u8, 231u8, 207u8, 44u8, 76u8, 24u8, + 235u8, 60u8, 23u8, 79u8, 192u8, 192u8, 46u8, 40u8, 134u8, 27u8, 125u8, + 114u8, 125u8, 247u8, 85u8, 102u8, 76u8, 159u8, 34u8, 167u8, 152u8, + 148u8, ], ) } - #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] - pub fn schedule_asset_transfer_with_delay( + #[doc = "Remove a vote for a poll."] + #[doc = ""] + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the poll was cancelled, because the voter lost the poll or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] + #[doc = " `index`."] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: The class of the poll."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_other_vote( &self, - asset_id: types::schedule_asset_transfer_with_delay::AssetId, - dest: types::schedule_asset_transfer_with_delay::Dest, - amount: types::schedule_asset_transfer_with_delay::Amount, - delay: types::schedule_asset_transfer_with_delay::Delay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleAssetTransferWithDelay, - > { + target: types::remove_other_vote::Target, + class: types::remove_other_vote::Class, + index: types::remove_other_vote::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_asset_transfer_with_delay", - types::ScheduleAssetTransferWithDelay { asset_id, dest, amount, delay }, + "ConvictionVoting", + "remove_other_vote", + types::RemoveOtherVote { target, class, index }, [ - 249u8, 59u8, 121u8, 27u8, 78u8, 202u8, 252u8, 120u8, 76u8, 102u8, 33u8, - 232u8, 185u8, 78u8, 8u8, 157u8, 139u8, 72u8, 110u8, 91u8, 170u8, 179u8, - 89u8, 250u8, 77u8, 26u8, 160u8, 252u8, 62u8, 179u8, 128u8, 216u8, + 165u8, 26u8, 166u8, 37u8, 10u8, 174u8, 243u8, 10u8, 73u8, 93u8, 213u8, + 69u8, 200u8, 16u8, 48u8, 146u8, 160u8, 92u8, 28u8, 26u8, 158u8, 55u8, + 6u8, 251u8, 36u8, 132u8, 46u8, 195u8, 107u8, 34u8, 0u8, 100u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_reversible_transfers::pallet::Event; + pub type Event = runtime_types::pallet_conviction_voting::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -10787,25 +11240,16 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A user has enabled their high-security settings."] - #[doc = "[who, interceptor, recoverer, delay]"] - pub struct HighSecuritySet { - pub who: high_security_set::Who, - pub interceptor: high_security_set::Interceptor, - pub delay: high_security_set::Delay, - } - pub mod high_security_set { + #[doc = "An account has delegated their vote to another account. \\[who, target\\]"] + pub struct Delegated(pub delegated::Field0, pub delegated::Field1); + pub mod delegated { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; + pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Field1 = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for HighSecuritySet { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "HighSecuritySet"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Delegated { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "Delegated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10814,33 +11258,38 @@ 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 transaction has been intercepted and scheduled for delayed execution."] - #[doc = "[from, to, interceptor, amount, tx_id, execute_at_moment]"] - pub struct TransactionScheduled { - pub from: transaction_scheduled::From, - pub to: transaction_scheduled::To, - pub interceptor: transaction_scheduled::Interceptor, - pub asset_id: transaction_scheduled::AssetId, - pub amount: transaction_scheduled::Amount, - pub tx_id: transaction_scheduled::TxId, - pub execute_at: transaction_scheduled::ExecuteAt, + #[doc = "An \\[account\\] has cancelled a previous delegation operation."] + pub struct Undelegated(pub undelegated::Field0); + pub mod undelegated { + use super::runtime_types; + pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod transaction_scheduled { + impl ::subxt::ext::subxt_core::events::StaticEvent for Undelegated { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "Undelegated"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "An account has voted"] + pub struct Voted { + pub who: voted::Who, + pub vote: voted::Vote, + } + pub mod voted { use super::runtime_types; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; - pub type AssetId = ::core::option::Option<::core::primitive::u32>; - pub type Amount = ::core::primitive::u128; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - pub type ExecuteAt = runtime_types::qp_scheduler::DispatchTime< - ::core::primitive::u32, - ::core::primitive::u64, + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< + ::core::primitive::u128, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionScheduled { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionScheduled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "Voted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10849,20 +11298,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 = "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, + #[doc = "A vote has been removed"] + pub struct VoteRemoved { + pub who: vote_removed::Who, + pub vote: vote_removed::Vote, } - pub mod transaction_cancelled { + pub mod vote_removed { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< + ::core::primitive::u128, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionCancelled { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionCancelled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for VoteRemoved { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "VoteRemoved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -10871,402 +11321,175 @@ 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, + #[doc = "The lockup period of a conviction vote expired, and the funds have been unlocked."] + pub struct VoteUnlocked { + pub who: vote_unlocked::Who, + pub class: vote_unlocked::Class, } - pub mod transaction_executed { + pub mod vote_unlocked { use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - pub type Result = ::core::result::Result< - runtime_types::frame_support::dispatch::PostDispatchInfo, - runtime_types::sp_runtime::DispatchErrorWithPostInfo< - runtime_types::frame_support::dispatch::PostDispatchInfo, - >, - >; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Class = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionExecuted { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionExecuted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for VoteUnlocked { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "VoteUnlocked"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod high_security_accounts { + pub mod voting_for { use super::runtime_types; - pub type HighSecurityAccounts = - runtime_types::pallet_reversible_transfers::HighSecurityAccountData< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - >; + pub type VotingFor = runtime_types::pallet_conviction_voting::vote::Voting< + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, + ::core::primitive::u32, + >; pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::core::primitive::u16; } - pub mod pending_transfers { + pub mod class_locks_for { use super::runtime_types; - pub type PendingTransfers = - runtime_types::pallet_reversible_transfers::PendingTransfer< - ::subxt::ext::subxt_core::utils::AccountId32, + pub type ClassLocksFor = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u16, ::core::primitive::u128, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - } - pub mod account_pending_index { - use super::runtime_types; - pub type AccountPendingIndex = ::core::primitive::u32; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod pending_transfers_by_sender { - use super::runtime_types; - pub type PendingTransfersBySender = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::H256, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod pending_transfers_by_recipient { - use super::runtime_types; - pub type PendingTransfersByRecipient = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::H256, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod interceptor_index { - use super::runtime_types; - pub type InterceptorIndex = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; + )>; pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod global_nonce { - use super::runtime_types; - pub type GlobalNonce = ::core::primitive::u64; - } } pub struct StorageApi; impl StorageApi { - #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] - #[doc = " Accounts present in this map have reversibility enabled."] - pub fn high_security_accounts_iter( + #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] + #[doc = " number of votes that we have recorded."] + pub fn voting_for_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::high_security_accounts::HighSecurityAccounts, - (), + types::voting_for::VotingFor, (), ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "HighSecurityAccounts", + "ConvictionVoting", + "VotingFor", (), [ - 11u8, 143u8, 95u8, 23u8, 55u8, 163u8, 22u8, 238u8, 88u8, 24u8, 50u8, - 162u8, 72u8, 98u8, 32u8, 219u8, 231u8, 199u8, 118u8, 150u8, 84u8, - 126u8, 225u8, 88u8, 129u8, 200u8, 236u8, 214u8, 187u8, 8u8, 252u8, - 120u8, + 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, + 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, + 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, ], ) } - #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] - #[doc = " Accounts present in this map have reversibility enabled."] - pub fn high_security_accounts( + #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] + #[doc = " number of votes that we have recorded."] + pub fn voting_for_iter1( &self, - _0: types::high_security_accounts::Param0, + _0: types::voting_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::high_security_accounts::Param0, + types::voting_for::Param0, >, - types::high_security_accounts::HighSecurityAccounts, - ::subxt::ext::subxt_core::utils::Yes, - (), + types::voting_for::VotingFor, (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "HighSecurityAccounts", + "ConvictionVoting", + "VotingFor", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 11u8, 143u8, 95u8, 23u8, 55u8, 163u8, 22u8, 238u8, 88u8, 24u8, 50u8, - 162u8, 72u8, 98u8, 32u8, 219u8, 231u8, 199u8, 118u8, 150u8, 84u8, - 126u8, 225u8, 88u8, 129u8, 200u8, 236u8, 214u8, 187u8, 8u8, 252u8, - 120u8, + 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, + 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, + 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, ], ) } - #[doc = " Stores the details of pending transactions scheduled for delayed execution."] - #[doc = " Keyed by the unique transaction ID."] - pub fn pending_transfers_iter( + #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] + #[doc = " number of votes that we have recorded."] + pub fn voting_for( &self, + _0: types::voting_for::Param0, + _1: types::voting_for::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pending_transfers::PendingTransfers, - (), - (), + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting_for::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting_for::Param1, + >, + ), + types::voting_for::VotingFor, + ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfers", - (), + "ConvictionVoting", + "VotingFor", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 226u8, 148u8, 100u8, 60u8, 9u8, 160u8, 164u8, 177u8, 53u8, 236u8, 65u8, - 38u8, 207u8, 31u8, 170u8, 79u8, 15u8, 237u8, 127u8, 189u8, 203u8, - 147u8, 4u8, 146u8, 13u8, 87u8, 158u8, 163u8, 159u8, 87u8, 98u8, 211u8, + 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, + 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, + 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, ], ) } - #[doc = " Stores the details of pending transactions scheduled for delayed execution."] - #[doc = " Keyed by the unique transaction ID."] - pub fn pending_transfers( + #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] + #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] + #[doc = " this list."] + pub fn class_locks_for_iter( &self, - _0: types::pending_transfers::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_transfers::Param0, - >, - types::pending_transfers::PendingTransfers, - ::subxt::ext::subxt_core::utils::Yes, (), + types::class_locks_for::ClassLocksFor, (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfers", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 226u8, 148u8, 100u8, 60u8, 9u8, 160u8, 164u8, 177u8, 53u8, 236u8, 65u8, - 38u8, 207u8, 31u8, 170u8, 79u8, 15u8, 237u8, 127u8, 189u8, 203u8, - 147u8, 4u8, 146u8, 13u8, 87u8, 158u8, 163u8, 159u8, 87u8, 98u8, 211u8, - ], - ) - } - #[doc = " Indexes pending transaction IDs per account for efficient lookup and cancellation."] - #[doc = " Also enforces the maximum pending transactions limit per account."] - pub fn account_pending_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::account_pending_index::AccountPendingIndex, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "AccountPendingIndex", - (), - [ - 142u8, 255u8, 15u8, 41u8, 210u8, 84u8, 93u8, 230u8, 194u8, 31u8, 164u8, - 88u8, 155u8, 106u8, 130u8, 110u8, 199u8, 137u8, 153u8, 99u8, 154u8, - 210u8, 108u8, 136u8, 70u8, 141u8, 242u8, 255u8, 246u8, 19u8, 247u8, - 136u8, - ], - ) - } - #[doc = " Indexes pending transaction IDs per account for efficient lookup and cancellation."] - #[doc = " Also enforces the maximum pending transactions limit per account."] - pub fn account_pending_index( - &self, - _0: types::account_pending_index::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account_pending_index::Param0, - >, - types::account_pending_index::AccountPendingIndex, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "AccountPendingIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 142u8, 255u8, 15u8, 41u8, 210u8, 84u8, 93u8, 230u8, 194u8, 31u8, 164u8, - 88u8, 155u8, 106u8, 130u8, 110u8, 199u8, 137u8, 153u8, 99u8, 154u8, - 210u8, 108u8, 136u8, 70u8, 141u8, 242u8, 255u8, 246u8, 19u8, 247u8, - 136u8, - ], - ) - } - #[doc = " Maps sender accounts to their list of pending transaction IDs."] - #[doc = " This allows users to query all their outgoing pending transfers."] - pub fn pending_transfers_by_sender_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pending_transfers_by_sender::PendingTransfersBySender, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersBySender", - (), - [ - 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, - 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, - 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, - ], - ) - } - #[doc = " Maps sender accounts to their list of pending transaction IDs."] - #[doc = " This allows users to query all their outgoing pending transfers."] - pub fn pending_transfers_by_sender( - &self, - _0: types::pending_transfers_by_sender::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_transfers_by_sender::Param0, - >, - types::pending_transfers_by_sender::PendingTransfersBySender, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersBySender", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, - 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, - 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, - ], - ) - } - #[doc = " Maps recipient accounts to their list of pending incoming transaction IDs."] - #[doc = " This allows users to query all their incoming pending transfers."] - pub fn pending_transfers_by_recipient_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pending_transfers_by_recipient::PendingTransfersByRecipient, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersByRecipient", - (), - [ - 63u8, 141u8, 24u8, 239u8, 201u8, 143u8, 36u8, 152u8, 35u8, 110u8, - 112u8, 157u8, 29u8, 61u8, 221u8, 79u8, 209u8, 192u8, 183u8, 29u8, - 145u8, 166u8, 238u8, 156u8, 131u8, 203u8, 124u8, 233u8, 210u8, 201u8, - 91u8, 212u8, - ], - ) - } - #[doc = " Maps recipient accounts to their list of pending incoming transaction IDs."] - #[doc = " This allows users to query all their incoming pending transfers."] - pub fn pending_transfers_by_recipient( - &self, - _0: types::pending_transfers_by_recipient::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_transfers_by_recipient::Param0, - >, - types::pending_transfers_by_recipient::PendingTransfersByRecipient, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersByRecipient", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 63u8, 141u8, 24u8, 239u8, 201u8, 143u8, 36u8, 152u8, 35u8, 110u8, - 112u8, 157u8, 29u8, 61u8, 221u8, 79u8, 209u8, 192u8, 183u8, 29u8, - 145u8, 166u8, 238u8, 156u8, 131u8, 203u8, 124u8, 233u8, 210u8, 201u8, - 91u8, 212u8, - ], - ) - } - #[doc = " Maps interceptor accounts to the list of accounts they can intercept for."] - #[doc = " This allows the UI to efficiently query all accounts for which a given account is an"] - #[doc = " interceptor."] - pub fn interceptor_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::interceptor_index::InterceptorIndex, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "InterceptorIndex", + "ConvictionVoting", + "ClassLocksFor", (), [ - 7u8, 184u8, 75u8, 107u8, 42u8, 84u8, 188u8, 86u8, 2u8, 227u8, 4u8, - 136u8, 109u8, 69u8, 64u8, 123u8, 253u8, 28u8, 174u8, 121u8, 183u8, - 154u8, 135u8, 91u8, 125u8, 0u8, 58u8, 132u8, 164u8, 236u8, 182u8, - 133u8, + 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, + 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, + 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, ], ) } - #[doc = " Maps interceptor accounts to the list of accounts they can intercept for."] - #[doc = " This allows the UI to efficiently query all accounts for which a given account is an"] - #[doc = " interceptor."] - pub fn interceptor_index( + #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] + #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] + #[doc = " this list."] + pub fn class_locks_for( &self, - _0: types::interceptor_index::Param0, + _0: types::class_locks_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::interceptor_index::Param0, + types::class_locks_for::Param0, >, - types::interceptor_index::InterceptorIndex, + types::class_locks_for::ClassLocksFor, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "InterceptorIndex", + "ConvictionVoting", + "ClassLocksFor", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 7u8, 184u8, 75u8, 107u8, 42u8, 84u8, 188u8, 86u8, 2u8, 227u8, 4u8, - 136u8, 109u8, 69u8, 64u8, 123u8, 253u8, 28u8, 174u8, 121u8, 183u8, - 154u8, 135u8, 91u8, 125u8, 0u8, 58u8, 132u8, 164u8, 236u8, 182u8, - 133u8, - ], - ) - } - #[doc = " Global nonce for generating unique transaction IDs."] - pub fn global_nonce( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - 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( - "ReversibleTransfers", - "GlobalNonce", - (), - [ - 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, + 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, + 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, + 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, ], ) } @@ -11276,15 +11499,18 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " Maximum pending reversible transactions allowed per account. Used for BoundedVec."] - pub fn max_pending_per_account( + #[doc = " The maximum number of concurrent votes an account may have."] + #[doc = ""] + #[doc = " Also used to compute weight, an overly large value can lead to extrinsics with large"] + #[doc = " weight estimation: see `delegate` for instance."] + pub fn max_votes( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MaxPendingPerAccount", + "ConvictionVoting", + "MaxVotes", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -11293,15 +11519,18 @@ pub mod api { ], ) } - #[doc = " Maximum number of accounts an interceptor can intercept for. Used for BoundedVec."] - pub fn max_interceptor_accounts( + #[doc = " The minimum period of vote locking."] + #[doc = ""] + #[doc = " It should be no shorter than enactment period to ensure that in the case of an approval,"] + #[doc = " those successful voters are locked into the consequences that their votes entail."] + pub fn vote_locking_period( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MaxInterceptorAccounts", + "ConvictionVoting", + "VoteLockingPeriod", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -11310,88 +11539,15 @@ pub mod api { ], ) } - #[doc = " The default delay period for reversible transactions if none is specified."] - #[doc = ""] - #[doc = " NOTE: default delay is always in blocks."] - pub fn default_delay( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "DefaultDelay", - [ - 245u8, 29u8, 3u8, 65u8, 154u8, 12u8, 172u8, 71u8, 67u8, 134u8, 71u8, - 180u8, 4u8, 9u8, 54u8, 89u8, 6u8, 19u8, 3u8, 168u8, 67u8, 122u8, 197u8, - 109u8, 1u8, 228u8, 44u8, 243u8, 228u8, 194u8, 241u8, 227u8, - ], - ) - } - #[doc = " The minimum delay period allowed for reversible transactions, in blocks."] - pub fn min_delay_period_blocks( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MinDelayPeriodBlocks", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The minimum delay period allowed for reversible transactions, in milliseconds."] - pub fn min_delay_period_moment( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MinDelayPeriodMoment", - [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, - 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, - 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, - 246u8, - ], - ) - } - #[doc = " Volume fee taken from reversed transactions for high-security accounts only,"] - #[doc = " expressed as a Permill (e.g., Permill::from_percent(1) = 1%). Regular accounts incur no"] - #[doc = " fees."] - pub fn volume_fee( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_arithmetic::per_things::Permill, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "VolumeFee", - [ - 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, - 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, - 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, - ], - ) - } } } } - pub mod conviction_voting { + pub mod tech_collective { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_conviction_voting::pallet::Error; + pub type Error = runtime_types::pallet_ranked_collective::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_conviction_voting::pallet::Call; + pub type Call = runtime_types::pallet_ranked_collective::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -11408,30 +11564,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Introduce a new member."] #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] + #[doc = "- `origin`: Must be the `AddOrigin`."] + #[doc = "- `who`: Account of non-member which will become a member."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - pub struct Vote { - #[codec(compact)] - pub poll_index: vote::PollIndex, - pub vote: vote::Vote, + #[doc = "Weight: `O(1)`"] + pub struct AddMember { + pub who: add_member::Who, } - pub mod vote { + pub mod add_member { use super::runtime_types; - pub type PollIndex = ::core::primitive::u32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "add_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11444,49 +11595,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] + #[doc = "Increment the rank of an existing member by one."] #[doc = ""] - #[doc = "Emits `Delegated`."] + #[doc = "- `origin`: Must be the `PromoteOrigin`."] + #[doc = "- `who`: Account of existing member."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub struct Delegate { - pub class: delegate::Class, - pub to: delegate::To, - pub conviction: delegate::Conviction, - pub balance: delegate::Balance, + #[doc = "Weight: `O(1)`"] + pub struct PromoteMember { + pub who: promote_member::Who, } - pub mod delegate { + pub mod promote_member { use super::runtime_types; - pub type Class = ::core::primitive::u16; - pub type To = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Conviction = - runtime_types::pallet_conviction_voting::conviction::Conviction; - pub type Balance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Delegate { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "delegate"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PromoteMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "promote_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11499,30 +11626,26 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] - #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] + #[doc = "then they are removed entirely."] #[doc = ""] - #[doc = "Emits `Undelegated`."] + #[doc = "- `origin`: Must be the `DemoteOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub struct Undelegate { - pub class: undelegate::Class, + #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] + pub struct DemoteMember { + pub who: demote_member::Who, } - pub mod undelegate { + pub mod demote_member { use super::runtime_types; - pub type Class = ::core::primitive::u16; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Undelegate { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "undelegate"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DemoteMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "demote_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11535,30 +11658,28 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Remove the member entirely."] #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] + #[doc = "- `origin`: Must be the `RemoveOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `min_rank`: The rank of the member or greater."] #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub struct Unlock { - pub class: unlock::Class, - pub target: unlock::Target, + #[doc = "Weight: `O(min_rank)`."] + pub struct RemoveMember { + pub who: remove_member::Who, + pub min_rank: remove_member::MinRank, } - pub mod unlock { + pub mod remove_member { use super::runtime_types; - pub type Class = ::core::primitive::u16; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type MinRank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Unlock { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "unlock"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "remove_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11571,47 +11692,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = "Add an aye or nay vote for the sender to the given proposal."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] + #[doc = "- `origin`: Must be `Signed` by a member account."] + #[doc = "- `poll`: Index of a poll which is ongoing."] + #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub struct RemoveVote { - pub class: remove_vote::Class, - pub index: remove_vote::Index, + #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] + pub struct Vote { + pub poll: vote::Poll, + pub aye: vote::Aye, } - pub mod remove_vote { + pub mod vote { use super::runtime_types; - pub type Class = ::core::option::Option<::core::primitive::u16>; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveVote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "remove_vote"; + pub type Poll = ::core::primitive::u32; + pub type Aye = ::core::primitive::bool; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "vote"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11624,250 +11727,239 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove a vote for a poll."] + #[doc = "Remove votes from the given poll. It must have ended."] #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] + #[doc = "- `origin`: Must be `Signed` by any account."] + #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] + #[doc = " exist."] + #[doc = "- `max`: Maximum number of vote items from remove in this call."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Transaction fees are waived if the operation is successful."] #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] + #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] + pub struct CleanupPoll { + pub poll_index: cleanup_poll::PollIndex, + pub max: cleanup_poll::Max, + } + pub mod cleanup_poll { + use super::runtime_types; + pub type PollIndex = ::core::primitive::u32; + pub type Max = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupPoll { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "cleanup_poll"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Exchanges a member with a new account and the same existing rank."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub struct RemoveOtherVote { - pub target: remove_other_vote::Target, - pub class: remove_other_vote::Class, - pub index: remove_other_vote::Index, + #[doc = "- `origin`: Must be the `ExchangeOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] + #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] + pub struct ExchangeMember { + pub who: exchange_member::Who, + pub new_who: exchange_member::NewWho, } - pub mod remove_other_vote { + pub mod exchange_member { use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type NewWho = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Class = ::core::primitive::u16; - pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveOtherVote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "remove_other_vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExchangeMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "exchange_member"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Introduce a new member."] #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] + #[doc = "- `origin`: Must be the `AddOrigin`."] + #[doc = "- `who`: Account of non-member which will become a member."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - pub fn vote( + #[doc = "Weight: `O(1)`"] + pub fn add_member( &self, - poll_index: types::vote::PollIndex, - vote: types::vote::Vote, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + who: types::add_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "vote", - types::Vote { poll_index, vote }, + "TechCollective", + "add_member", + types::AddMember { who }, [ - 57u8, 170u8, 177u8, 168u8, 158u8, 43u8, 87u8, 242u8, 176u8, 85u8, - 230u8, 64u8, 103u8, 239u8, 190u8, 6u8, 228u8, 165u8, 248u8, 77u8, - 231u8, 221u8, 186u8, 107u8, 249u8, 201u8, 226u8, 52u8, 129u8, 90u8, - 142u8, 159u8, + 2u8, 131u8, 37u8, 217u8, 112u8, 46u8, 86u8, 165u8, 248u8, 244u8, 33u8, + 236u8, 155u8, 28u8, 163u8, 169u8, 213u8, 32u8, 70u8, 217u8, 97u8, + 194u8, 138u8, 77u8, 133u8, 97u8, 188u8, 49u8, 49u8, 31u8, 177u8, 206u8, ], ) } - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] + #[doc = "Increment the rank of an existing member by one."] #[doc = ""] - #[doc = "Emits `Delegated`."] + #[doc = "- `origin`: Must be the `PromoteOrigin`."] + #[doc = "- `who`: Account of existing member."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub fn delegate( + #[doc = "Weight: `O(1)`"] + pub fn promote_member( &self, - class: types::delegate::Class, - to: types::delegate::To, - conviction: types::delegate::Conviction, - balance: types::delegate::Balance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + who: types::promote_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "delegate", - types::Delegate { class, to, conviction, balance }, + "TechCollective", + "promote_member", + types::PromoteMember { who }, [ - 223u8, 143u8, 33u8, 94u8, 32u8, 156u8, 43u8, 40u8, 142u8, 134u8, 209u8, - 134u8, 255u8, 179u8, 97u8, 46u8, 8u8, 140u8, 5u8, 29u8, 76u8, 22u8, - 36u8, 7u8, 108u8, 190u8, 220u8, 151u8, 10u8, 47u8, 89u8, 55u8, + 169u8, 155u8, 9u8, 50u8, 144u8, 133u8, 230u8, 60u8, 216u8, 147u8, 3u8, + 236u8, 94u8, 185u8, 106u8, 139u8, 235u8, 143u8, 189u8, 135u8, 208u8, + 176u8, 126u8, 124u8, 85u8, 140u8, 189u8, 125u8, 87u8, 56u8, 57u8, + 246u8, ], ) } - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] + #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] + #[doc = "then they are removed entirely."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] + #[doc = "- `origin`: Must be the `DemoteOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] + pub fn demote_member( + &self, + who: types::demote_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechCollective", + "demote_member", + types::DemoteMember { who }, + [ + 21u8, 185u8, 71u8, 166u8, 106u8, 88u8, 74u8, 251u8, 78u8, 28u8, 205u8, + 171u8, 199u8, 195u8, 97u8, 149u8, 175u8, 229u8, 25u8, 113u8, 96u8, + 25u8, 240u8, 64u8, 109u8, 246u8, 203u8, 45u8, 110u8, 205u8, 115u8, + 178u8, + ], + ) + } + #[doc = "Remove the member entirely."] #[doc = ""] - #[doc = "Emits `Undelegated`."] + #[doc = "- `origin`: Must be the `RemoveOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `min_rank`: The rank of the member or greater."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub fn undelegate( + #[doc = "Weight: `O(min_rank)`."] + pub fn remove_member( &self, - class: types::undelegate::Class, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + who: types::remove_member::Who, + min_rank: types::remove_member::MinRank, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "undelegate", - types::Undelegate { class }, + "TechCollective", + "remove_member", + types::RemoveMember { who, min_rank }, [ - 140u8, 232u8, 6u8, 53u8, 228u8, 8u8, 131u8, 144u8, 65u8, 66u8, 245u8, - 247u8, 147u8, 135u8, 198u8, 57u8, 82u8, 212u8, 89u8, 46u8, 236u8, - 168u8, 200u8, 220u8, 93u8, 168u8, 101u8, 29u8, 110u8, 76u8, 67u8, - 181u8, + 23u8, 156u8, 32u8, 64u8, 158u8, 50u8, 64u8, 199u8, 108u8, 67u8, 133u8, + 128u8, 138u8, 241u8, 14u8, 238u8, 192u8, 173u8, 250u8, 11u8, 124u8, + 119u8, 177u8, 190u8, 152u8, 116u8, 134u8, 42u8, 216u8, 49u8, 113u8, + 49u8, ], ) } - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] + #[doc = "Add an aye or nay vote for the sender to the given proposal."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "- `origin`: Must be `Signed` by a member account."] + #[doc = "- `poll`: Index of a poll which is ongoing."] + #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] + #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub fn unlock( + #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] + pub fn vote( &self, - class: types::unlock::Class, - target: types::unlock::Target, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + poll: types::vote::Poll, + aye: types::vote::Aye, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "unlock", - types::Unlock { class, target }, + "TechCollective", + "vote", + types::Vote { poll, aye }, [ - 79u8, 5u8, 252u8, 237u8, 109u8, 238u8, 157u8, 237u8, 125u8, 171u8, - 65u8, 160u8, 102u8, 192u8, 5u8, 141u8, 179u8, 249u8, 253u8, 213u8, - 105u8, 251u8, 241u8, 145u8, 186u8, 177u8, 244u8, 139u8, 71u8, 140u8, - 173u8, 108u8, + 54u8, 116u8, 81u8, 239u8, 223u8, 35u8, 11u8, 244u8, 245u8, 94u8, 23u8, + 241u8, 125u8, 231u8, 56u8, 150u8, 105u8, 125u8, 100u8, 171u8, 182u8, + 186u8, 134u8, 40u8, 4u8, 121u8, 119u8, 11u8, 93u8, 158u8, 59u8, 209u8, ], ) } - #[doc = "Remove a vote for a poll."] + #[doc = "Remove votes from the given poll. It must have ended."] #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] + #[doc = "- `origin`: Must be `Signed` by any account."] + #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] + #[doc = " exist."] + #[doc = "- `max`: Maximum number of vote items from remove in this call."] #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = "Transaction fees are waived if the operation is successful."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_vote( + #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] + pub fn cleanup_poll( &self, - class: types::remove_vote::Class, - index: types::remove_vote::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + poll_index: types::cleanup_poll::PollIndex, + max: types::cleanup_poll::Max, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "remove_vote", - types::RemoveVote { class, index }, + "TechCollective", + "cleanup_poll", + types::CleanupPoll { poll_index, max }, [ - 255u8, 108u8, 211u8, 146u8, 168u8, 231u8, 207u8, 44u8, 76u8, 24u8, - 235u8, 60u8, 23u8, 79u8, 192u8, 192u8, 46u8, 40u8, 134u8, 27u8, 125u8, - 114u8, 125u8, 247u8, 85u8, 102u8, 76u8, 159u8, 34u8, 167u8, 152u8, - 148u8, + 157u8, 109u8, 86u8, 253u8, 62u8, 107u8, 235u8, 255u8, 171u8, 68u8, + 103u8, 92u8, 245u8, 25u8, 252u8, 158u8, 174u8, 137u8, 77u8, 251u8, + 105u8, 113u8, 165u8, 46u8, 39u8, 55u8, 166u8, 79u8, 103u8, 81u8, 121u8, + 37u8, ], ) } - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] + #[doc = "Exchanges a member with a new account and the same existing rank."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_other_vote( + #[doc = "- `origin`: Must be the `ExchangeOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] + #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] + pub fn exchange_member( &self, - target: types::remove_other_vote::Target, - class: types::remove_other_vote::Class, - index: types::remove_other_vote::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + who: types::exchange_member::Who, + new_who: types::exchange_member::NewWho, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "remove_other_vote", - types::RemoveOtherVote { target, class, index }, + "TechCollective", + "exchange_member", + types::ExchangeMember { who, new_who }, [ - 165u8, 26u8, 166u8, 37u8, 10u8, 174u8, 243u8, 10u8, 73u8, 93u8, 213u8, - 69u8, 200u8, 16u8, 48u8, 146u8, 160u8, 92u8, 28u8, 26u8, 158u8, 55u8, - 6u8, 251u8, 36u8, 132u8, 46u8, 195u8, 107u8, 34u8, 0u8, 100u8, + 240u8, 208u8, 76u8, 147u8, 117u8, 23u8, 91u8, 37u8, 22u8, 101u8, 53u8, + 247u8, 161u8, 94u8, 109u8, 233u8, 104u8, 129u8, 67u8, 31u8, 223u8, + 182u8, 50u8, 233u8, 120u8, 129u8, 224u8, 135u8, 52u8, 162u8, 26u8, + 189u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_conviction_voting::pallet::Event; + pub type Event = runtime_types::pallet_ranked_collective::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -11877,16 +11969,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 = "An account has delegated their vote to another account. \\[who, target\\]"] - pub struct Delegated(pub delegated::Field0, pub delegated::Field1); - pub mod delegated { + #[doc = "A member `who` has been added."] + pub struct MemberAdded { + pub who: member_added::Who, + } + pub mod member_added { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Field1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Delegated { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Delegated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberAdded { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberAdded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11895,15 +11988,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An \\[account\\] has cancelled a previous delegation operation."] - pub struct Undelegated(pub undelegated::Field0); - pub mod undelegated { + #[doc = "The member `who`se rank has been changed to the given `rank`."] + pub struct RankChanged { + pub who: rank_changed::Who, + pub rank: rank_changed::Rank, + } + pub mod rank_changed { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Rank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Undelegated { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Undelegated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RankChanged { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "RankChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11912,21 +12009,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An account has voted"] - pub struct Voted { - pub who: voted::Who, - pub vote: voted::Vote, + #[doc = "The member `who` of given `rank` has been removed from the collective."] + pub struct MemberRemoved { + pub who: member_removed::Who, + pub rank: member_removed::Rank, } - pub mod voted { + pub mod member_removed { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, - >; + pub type Rank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Voted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberRemoved { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberRemoved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11935,21 +12030,24 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A vote has been removed"] - pub struct VoteRemoved { - pub who: vote_removed::Who, - pub vote: vote_removed::Vote, + #[doc = "The member `who` has voted for the `poll` with the given `vote` leading to an updated"] + #[doc = "`tally`."] + pub struct Voted { + pub who: voted::Who, + pub poll: voted::Poll, + pub vote: voted::Vote, + pub tally: voted::Tally, } - pub mod vote_removed { + pub mod voted { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, - >; + pub type Poll = ::core::primitive::u32; + pub type Vote = runtime_types::pallet_ranked_collective::VoteRecord; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VoteRemoved { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "VoteRemoved"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "Voted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11958,233 +12056,453 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The lockup period of a conviction vote expired, and the funds have been unlocked."] - pub struct VoteUnlocked { - pub who: vote_unlocked::Who, - pub class: vote_unlocked::Class, + #[doc = "The member `who` had their `AccountId` changed to `new_who`."] + pub struct MemberExchanged { + pub who: member_exchanged::Who, + pub new_who: member_exchanged::NewWho, } - pub mod vote_unlocked { + pub mod member_exchanged { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Class = ::core::primitive::u16; + pub type NewWho = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VoteUnlocked { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "VoteUnlocked"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberExchanged { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberExchanged"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod voting_for { + pub mod member_count { use super::runtime_types; - pub type VotingFor = runtime_types::pallet_conviction_voting::vote::Voting< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::core::primitive::u16; + pub type MemberCount = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } - pub mod class_locks_for { + pub mod members { use super::runtime_types; - pub type ClassLocksFor = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u16, - ::core::primitive::u128, - )>; + pub type Members = runtime_types::pallet_ranked_collective::MemberRecord; pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } + pub mod id_to_index { + use super::runtime_types; + pub type IdToIndex = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod index_to_id { + use super::runtime_types; + pub type IndexToId = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::core::primitive::u32; + } + pub mod voting { + use super::runtime_types; + pub type Voting = runtime_types::pallet_ranked_collective::VoteRecord; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod voting_cleanup { + use super::runtime_types; + pub type VotingCleanup = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub type Param0 = ::core::primitive::u32; + } } pub struct StorageApi; impl StorageApi { - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for_iter( + #[doc = " The number of members in the collective who have at least the rank according to the index"] + #[doc = " of the vec."] + pub fn member_count_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::voting_for::VotingFor, + types::member_count::MemberCount, (), ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", + "TechCollective", + "MemberCount", (), [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, + 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, + 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, + 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, ], ) } - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for_iter1( + #[doc = " The number of members in the collective who have at least the rank according to the index"] + #[doc = " of the vec."] + pub fn member_count( &self, - _0: types::voting_for::Param0, + _0: types::member_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param0, + types::member_count::Param0, >, - types::voting_for::VotingFor, + types::member_count::MemberCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "MemberCount", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, + 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, + 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, + ], + ) + } + #[doc = " The current members of the collective."] + pub fn members_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::members::Members, + (), (), ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Members", + (), + [ + 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, + 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, + 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, + 247u8, 133u8, + ], + ) + } + #[doc = " The current members of the collective."] + pub fn members( + &self, + _0: types::members::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::members::Param0, + >, + types::members::Members, ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", + "TechCollective", + "Members", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, + 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, + 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, + 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, + 247u8, 133u8, ], ) } - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for( + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index_iter( &self, - _0: types::voting_for::Param0, - _1: types::voting_for::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::id_to_index::IdToIndex, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "IdToIndex", + (), + [ + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + ], + ) + } + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index_iter1( + &self, + _0: types::id_to_index::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::id_to_index::Param0, + >, + types::id_to_index::IdToIndex, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "IdToIndex", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + ], + ) + } + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index( + &self, + _0: types::id_to_index::Param0, + _1: types::id_to_index::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param0, + types::id_to_index::Param0, >, ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param1, + types::id_to_index::Param1, >, ), - types::voting_for::VotingFor, - ::subxt::ext::subxt_core::utils::Yes, + types::id_to_index::IdToIndex, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", + "TechCollective", + "IdToIndex", ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), ), [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, ], ) } - #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] - #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] - #[doc = " this list."] - pub fn class_locks_for_iter( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::class_locks_for::ClassLocksFor, + types::index_to_id::IndexToId, + (), (), - ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "ClassLocksFor", + "TechCollective", + "IndexToId", (), [ - 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, - 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, - 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] - #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] - #[doc = " this list."] - pub fn class_locks_for( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id_iter1( &self, - _0: types::class_locks_for::Param0, + _0: types::index_to_id::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::class_locks_for::Param0, + types::index_to_id::Param0, >, - types::class_locks_for::ClassLocksFor, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, + types::index_to_id::IndexToId, (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "ClassLocksFor", + "TechCollective", + "IndexToId", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, - 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, - 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The maximum number of concurrent votes an account may have."] - #[doc = ""] - #[doc = " Also used to compute weight, an overly large value can lead to extrinsics with large"] - #[doc = " weight estimation: see `delegate` for instance."] - pub fn max_votes( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + _0: types::index_to_id::Param0, + _1: types::index_to_id::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::index_to_id::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::index_to_id::Param1, + >, + ), + types::index_to_id::IndexToId, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ConvictionVoting", - "MaxVotes", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "IndexToId", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - #[doc = " The minimum period of vote locking."] - #[doc = ""] - #[doc = " It should be no shorter than enactment period to ensure that in the case of an approval,"] - #[doc = " those successful voters are locked into the consequences that their votes entail."] - pub fn vote_locking_period( + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting_iter( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::voting::Voting, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ConvictionVoting", - "VoteLockingPeriod", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Voting", + (), [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, + ], + ) + } + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting_iter1( + &self, + _0: types::voting::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting::Param0, + >, + types::voting::Voting, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Voting", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, + ], + ) + } + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting( + &self, + _0: types::voting::Param0, + _1: types::voting::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting::Param1, + >, + ), + types::voting::Voting, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Voting", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, + ], + ) + } + pub fn voting_cleanup_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::voting_cleanup::VotingCleanup, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "VotingCleanup", + (), + [ + 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, + 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, + 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + ], + ) + } + pub fn voting_cleanup( + &self, + _0: types::voting_cleanup::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting_cleanup::Param0, + >, + types::voting_cleanup::VotingCleanup, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "VotingCleanup", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, + 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, + 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, ], ) } } } } - pub mod tech_collective { + pub mod tech_referenda { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_ranked_collective::pallet::Error; + pub type Error = runtime_types::pallet_referenda::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_ranked_collective::pallet::Call; + pub type Call = runtime_types::pallet_referenda::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -12201,25 +12519,36 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Introduce a new member."] + #[doc = "Propose a referendum on a privileged action."] #[doc = ""] - #[doc = "- `origin`: Must be the `AddOrigin`."] - #[doc = "- `who`: Account of non-member which will become a member."] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct AddMember { - pub who: add_member::Who, + #[doc = "Emits `Submitted`."] + pub struct Submit { + pub proposal_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub proposal: submit::Proposal, + pub enactment_moment: submit::EnactmentMoment, } - pub mod add_member { + pub mod submit { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), + pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, >; + pub type EnactmentMoment = + runtime_types::frame_support::traits::schedule::DispatchTime< + ::core::primitive::u32, + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "add_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "submit"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12232,25 +12561,24 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Increment the rank of an existing member by one."] + #[doc = "Post the Decision Deposit for a referendum."] #[doc = ""] - #[doc = "- `origin`: Must be the `PromoteOrigin`."] - #[doc = "- `who`: Account of existing member."] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct PromoteMember { - pub who: promote_member::Who, + #[doc = "Emits `DecisionDepositPlaced`."] + pub struct PlaceDecisionDeposit { + pub index: place_decision_deposit::Index, } - pub mod promote_member { + pub mod place_decision_deposit { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PromoteMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "promote_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "place_decision_deposit"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12263,26 +12591,23 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] - #[doc = "then they are removed entirely."] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "- `origin`: Must be the `DemoteOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] - pub struct DemoteMember { - pub who: demote_member::Who, + #[doc = "Emits `DecisionDepositRefunded`."] + pub struct RefundDecisionDeposit { + pub index: refund_decision_deposit::Index, } - pub mod demote_member { + pub mod refund_decision_deposit { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DemoteMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "demote_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "refund_decision_deposit"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12295,28 +12620,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove the member entirely."] + #[doc = "Cancel an ongoing referendum."] #[doc = ""] - #[doc = "- `origin`: Must be the `RemoveOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = "- `min_rank`: The rank of the member or greater."] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "Weight: `O(min_rank)`."] - pub struct RemoveMember { - pub who: remove_member::Who, - pub min_rank: remove_member::MinRank, + #[doc = "Emits `Cancelled`."] + pub struct Cancel { + pub index: cancel::Index, } - pub mod remove_member { + pub mod cancel { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MinRank = ::core::primitive::u16; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "remove_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "cancel"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12329,29 +12648,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Add an aye or nay vote for the sender to the given proposal."] - #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by a member account."] - #[doc = "- `poll`: Index of a poll which is ongoing."] - #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] + #[doc = "Cancel an ongoing referendum and slash the deposits."] #[doc = ""] - #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] - pub struct Vote { - pub poll: vote::Poll, - pub aye: vote::Aye, - } - pub mod vote { + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub struct Kill { + pub index: kill::Index, + } + pub mod kill { use super::runtime_types; - pub type Poll = ::core::primitive::u32; - pub type Aye = ::core::primitive::bool; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "kill"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12364,28 +12676,51 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove votes from the given poll. It must have ended."] + #[doc = "Advance a referendum onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by any account."] - #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] - #[doc = " exist."] - #[doc = "- `max`: Maximum number of vote items from remove in this call."] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub struct NudgeReferendum { + pub index: nudge_referendum::Index, + } + pub mod nudge_referendum { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "nudge_referendum"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Advance a track onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[doc = ""] - #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] - pub struct CleanupPoll { - pub poll_index: cleanup_poll::PollIndex, - pub max: cleanup_poll::Max, + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub struct OneFewerDeciding { + pub track: one_fewer_deciding::Track, } - pub mod cleanup_poll { + pub mod one_fewer_deciding { use super::runtime_types; - pub type PollIndex = ::core::primitive::u32; - pub type Max = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupPoll { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "cleanup_poll"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "one_fewer_deciding"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12398,205 +12733,282 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Exchanges a member with a new account and the same existing rank."] + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "- `origin`: Must be the `ExchangeOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] - #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] - pub struct ExchangeMember { - pub who: exchange_member::Who, - pub new_who: exchange_member::NewWho, + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `SubmissionDepositRefunded`."] + pub struct RefundSubmissionDeposit { + pub index: refund_submission_deposit::Index, } - pub mod exchange_member { + pub mod refund_submission_deposit { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type NewWho = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExchangeMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "exchange_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "refund_submission_deposit"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set or clear metadata of a referendum."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub struct SetMetadata { + pub index: set_metadata::Index, + pub maybe_hash: set_metadata::MaybeHash, + } + pub mod set_metadata { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type MaybeHash = + ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "set_metadata"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Introduce a new member."] + #[doc = "Propose a referendum on a privileged action."] #[doc = ""] - #[doc = "- `origin`: Must be the `AddOrigin`."] - #[doc = "- `who`: Account of non-member which will become a member."] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn add_member( + #[doc = "Emits `Submitted`."] + pub fn submit( &self, - who: types::add_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + proposal_origin: types::submit::ProposalOrigin, + proposal: types::submit::Proposal, + enactment_moment: types::submit::EnactmentMoment, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "add_member", - types::AddMember { who }, + "TechReferenda", + "submit", + types::Submit { + proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + proposal_origin, + ), + proposal, + enactment_moment, + }, [ - 2u8, 131u8, 37u8, 217u8, 112u8, 46u8, 86u8, 165u8, 248u8, 244u8, 33u8, - 236u8, 155u8, 28u8, 163u8, 169u8, 213u8, 32u8, 70u8, 217u8, 97u8, - 194u8, 138u8, 77u8, 133u8, 97u8, 188u8, 49u8, 49u8, 31u8, 177u8, 206u8, + 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, + 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, + 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, ], ) } - #[doc = "Increment the rank of an existing member by one."] + #[doc = "Post the Decision Deposit for a referendum."] #[doc = ""] - #[doc = "- `origin`: Must be the `PromoteOrigin`."] - #[doc = "- `who`: Account of existing member."] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn promote_member( + #[doc = "Emits `DecisionDepositPlaced`."] + pub fn place_decision_deposit( &self, - who: types::promote_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + index: types::place_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "promote_member", - types::PromoteMember { who }, + "TechReferenda", + "place_decision_deposit", + types::PlaceDecisionDeposit { index }, [ - 169u8, 155u8, 9u8, 50u8, 144u8, 133u8, 230u8, 60u8, 216u8, 147u8, 3u8, - 236u8, 94u8, 185u8, 106u8, 139u8, 235u8, 143u8, 189u8, 135u8, 208u8, - 176u8, 126u8, 124u8, 85u8, 140u8, 189u8, 125u8, 87u8, 56u8, 57u8, - 246u8, + 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, + 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, + 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, ], ) } - #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] - #[doc = "then they are removed entirely."] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "- `origin`: Must be the `DemoteOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] - pub fn demote_member( + #[doc = "Emits `DecisionDepositRefunded`."] + pub fn refund_decision_deposit( &self, - who: types::demote_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::refund_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundDecisionDeposit, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "demote_member", - types::DemoteMember { who }, + "TechReferenda", + "refund_decision_deposit", + types::RefundDecisionDeposit { index }, [ - 21u8, 185u8, 71u8, 166u8, 106u8, 88u8, 74u8, 251u8, 78u8, 28u8, 205u8, - 171u8, 199u8, 195u8, 97u8, 149u8, 175u8, 229u8, 25u8, 113u8, 96u8, - 25u8, 240u8, 64u8, 109u8, 246u8, 203u8, 45u8, 110u8, 205u8, 115u8, - 178u8, + 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, + 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, + 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, ], ) } - #[doc = "Remove the member entirely."] + #[doc = "Cancel an ongoing referendum."] #[doc = ""] - #[doc = "- `origin`: Must be the `RemoveOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = "- `min_rank`: The rank of the member or greater."] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "Weight: `O(min_rank)`."] - pub fn remove_member( + #[doc = "Emits `Cancelled`."] + pub fn cancel( &self, - who: types::remove_member::Who, - min_rank: types::remove_member::MinRank, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::cancel::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "remove_member", - types::RemoveMember { who, min_rank }, + "TechReferenda", + "cancel", + types::Cancel { index }, [ - 23u8, 156u8, 32u8, 64u8, 158u8, 50u8, 64u8, 199u8, 108u8, 67u8, 133u8, - 128u8, 138u8, 241u8, 14u8, 238u8, 192u8, 173u8, 250u8, 11u8, 124u8, - 119u8, 177u8, 190u8, 152u8, 116u8, 134u8, 42u8, 216u8, 49u8, 113u8, - 49u8, + 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, + 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, + 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, + 122u8, ], ) } - #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = "Cancel an ongoing referendum and slash the deposits."] #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by a member account."] - #[doc = "- `poll`: Index of a poll which is ongoing."] - #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub fn kill( + &self, + index: types::kill::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "kill", + types::Kill { index }, + [ + 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, + 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, + 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, + 48u8, + ], + ) + } + #[doc = "Advance a referendum onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] - pub fn vote( + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub fn nudge_referendum( &self, - poll: types::vote::Poll, - aye: types::vote::Aye, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::nudge_referendum::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "vote", - types::Vote { poll, aye }, + "TechReferenda", + "nudge_referendum", + types::NudgeReferendum { index }, [ - 54u8, 116u8, 81u8, 239u8, 223u8, 35u8, 11u8, 244u8, 245u8, 94u8, 23u8, - 241u8, 125u8, 231u8, 56u8, 150u8, 105u8, 125u8, 100u8, 171u8, 182u8, - 186u8, 134u8, 40u8, 4u8, 121u8, 119u8, 11u8, 93u8, 158u8, 59u8, 209u8, + 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, + 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, + 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, + 213u8, ], ) } - #[doc = "Remove votes from the given poll. It must have ended."] + #[doc = "Advance a track onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by any account."] - #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] - #[doc = " exist."] - #[doc = "- `max`: Maximum number of vote items from remove in this call."] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[doc = ""] - #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub fn one_fewer_deciding( + &self, + track: types::one_fewer_deciding::Track, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "one_fewer_deciding", + types::OneFewerDeciding { track }, + [ + 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, + 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, + 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, + 131u8, 167u8, + ], + ) + } + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] - pub fn cleanup_poll( + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `SubmissionDepositRefunded`."] + pub fn refund_submission_deposit( &self, - poll_index: types::cleanup_poll::PollIndex, - max: types::cleanup_poll::Max, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::refund_submission_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundSubmissionDeposit, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "cleanup_poll", - types::CleanupPoll { poll_index, max }, + "TechReferenda", + "refund_submission_deposit", + types::RefundSubmissionDeposit { index }, [ - 157u8, 109u8, 86u8, 253u8, 62u8, 107u8, 235u8, 255u8, 171u8, 68u8, - 103u8, 92u8, 245u8, 25u8, 252u8, 158u8, 174u8, 137u8, 77u8, 251u8, - 105u8, 113u8, 165u8, 46u8, 39u8, 55u8, 166u8, 79u8, 103u8, 81u8, 121u8, - 37u8, + 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, + 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, + 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, ], ) } - #[doc = "Exchanges a member with a new account and the same existing rank."] + #[doc = "Set or clear metadata of a referendum."] #[doc = ""] - #[doc = "- `origin`: Must be the `ExchangeOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] - #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] - pub fn exchange_member( + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub fn set_metadata( &self, - who: types::exchange_member::Who, - new_who: types::exchange_member::NewWho, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + index: types::set_metadata::Index, + maybe_hash: types::set_metadata::MaybeHash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "exchange_member", - types::ExchangeMember { who, new_who }, + "TechReferenda", + "set_metadata", + types::SetMetadata { index, maybe_hash }, [ - 240u8, 208u8, 76u8, 147u8, 117u8, 23u8, 91u8, 37u8, 22u8, 101u8, 53u8, - 247u8, 161u8, 94u8, 109u8, 233u8, 104u8, 129u8, 67u8, 31u8, 223u8, - 182u8, 50u8, 233u8, 120u8, 129u8, 224u8, 135u8, 52u8, 162u8, 26u8, - 189u8, + 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, + 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, + 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, + 88u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_ranked_collective::pallet::Event; + pub type Event = runtime_types::pallet_referenda::pallet::Event2; pub mod events { use super::runtime_types; #[derive( @@ -12606,17 +13018,24 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A member `who` has been added."] - pub struct MemberAdded { - pub who: member_added::Who, + #[doc = "A referendum has been submitted."] + pub struct Submitted { + pub index: submitted::Index, + pub track: submitted::Track, + pub proposal: submitted::Proposal, } - pub mod member_added { + pub mod submitted { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberAdded { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberAdded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Submitted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12625,19 +13044,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who`se rank has been changed to the given `rank`."] - pub struct RankChanged { - pub who: rank_changed::Who, - pub rank: rank_changed::Rank, + #[doc = "The decision deposit has been placed."] + pub struct DecisionDepositPlaced { + pub index: decision_deposit_placed::Index, + pub who: decision_deposit_placed::Who, + pub amount: decision_deposit_placed::Amount, } - pub mod rank_changed { + pub mod decision_deposit_placed { use super::runtime_types; + pub type Index = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Rank = ::core::primitive::u16; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RankChanged { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "RankChanged"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionDepositPlaced"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12646,19 +13067,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who` of given `rank` has been removed from the collective."] - pub struct MemberRemoved { - pub who: member_removed::Who, - pub rank: member_removed::Rank, + #[doc = "The decision deposit has been refunded."] + pub struct DecisionDepositRefunded { + pub index: decision_deposit_refunded::Index, + pub who: decision_deposit_refunded::Who, + pub amount: decision_deposit_refunded::Amount, } - pub mod member_removed { + pub mod decision_deposit_refunded { use super::runtime_types; + pub type Index = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Rank = ::core::primitive::u16; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberRemoved { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberRemoved"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionDepositRefunded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12667,24 +13090,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who` has voted for the `poll` with the given `vote` leading to an updated"] - #[doc = "`tally`."] - pub struct Voted { - pub who: voted::Who, - pub poll: voted::Poll, - pub vote: voted::Vote, - pub tally: voted::Tally, + #[doc = "A deposit has been slashed."] + pub struct DepositSlashed { + pub who: deposit_slashed::Who, + pub amount: deposit_slashed::Amount, } - pub mod voted { + pub mod deposit_slashed { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Poll = ::core::primitive::u32; - pub type Vote = runtime_types::pallet_ranked_collective::VoteRecord; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "Voted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DepositSlashed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12693,453 +13111,642 @@ 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 member `who` had their `AccountId` changed to `new_who`."] - pub struct MemberExchanged { - pub who: member_exchanged::Who, - pub new_who: member_exchanged::NewWho, + #[doc = "A referendum has moved into the deciding phase."] + pub struct DecisionStarted { + pub index: decision_started::Index, + pub track: decision_started::Track, + pub proposal: decision_started::Proposal, + pub tally: decision_started::Tally, } - pub mod member_exchanged { + pub mod decision_started { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type NewWho = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberExchanged { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberExchanged"; - } - } + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionStarted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct ConfirmStarted { + pub index: confirm_started::Index, + } + pub mod confirm_started { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "ConfirmStarted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct ConfirmAborted { + pub index: confirm_aborted::Index, + } + pub mod confirm_aborted { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "ConfirmAborted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has ended its confirmation phase and is ready for approval."] + pub struct Confirmed { + pub index: confirmed::Index, + pub tally: confirmed::Tally, + } + pub mod confirmed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Confirmed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been approved and its proposal has been scheduled."] + pub struct Approved { + pub index: approved::Index, + } + pub mod approved { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Approved"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A proposal has been rejected by referendum."] + pub struct Rejected { + pub index: rejected::Index, + pub tally: rejected::Tally, + } + pub mod rejected { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Rejected"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been timed out without being decided."] + pub struct TimedOut { + pub index: timed_out::Index, + pub tally: timed_out::Tally, + } + pub mod timed_out { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "TimedOut"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been cancelled."] + pub struct Cancelled { + pub index: cancelled::Index, + pub tally: cancelled::Tally, + } + pub mod cancelled { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Cancelled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been killed."] + pub struct Killed { + pub index: killed::Index, + pub tally: killed::Tally, + } + pub mod killed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Killed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The submission deposit has been refunded."] + pub struct SubmissionDepositRefunded { + pub index: submission_deposit_refunded::Index, + pub who: submission_deposit_refunded::Who, + pub amount: submission_deposit_refunded::Amount, + } + pub mod submission_deposit_refunded { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "SubmissionDepositRefunded"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata for a referendum has been set."] + pub struct MetadataSet { + pub index: metadata_set::Index, + pub hash: metadata_set::Hash, + } + pub mod metadata_set { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata for a referendum has been cleared."] + pub struct MetadataCleared { + pub index: metadata_cleared::Index, + pub hash: metadata_cleared::Hash, + } + pub mod metadata_cleared { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "MetadataCleared"; + } + } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod member_count { - use super::runtime_types; - pub type MemberCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - } - pub mod members { - use super::runtime_types; - pub type Members = runtime_types::pallet_ranked_collective::MemberRecord; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod id_to_index { + pub mod referendum_count { use super::runtime_types; - pub type IdToIndex = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ReferendumCount = ::core::primitive::u32; } - pub mod index_to_id { + pub mod referendum_info_for { use super::runtime_types; - pub type IndexToId = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ReferendumInfoFor = + runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::quantus_runtime::OriginCaller, + ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >, + ::core::primitive::u128, + runtime_types::pallet_ranked_collective::Tally, + ::subxt::ext::subxt_core::utils::AccountId32, + ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ), + >; + pub type Param0 = ::core::primitive::u32; + } + pub mod track_queue { + use super::runtime_types; + pub type TrackQueue = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u32, + )>; pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::core::primitive::u32; } - pub mod voting { + pub mod deciding_count { use super::runtime_types; - pub type Voting = runtime_types::pallet_ranked_collective::VoteRecord; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type DecidingCount = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } - pub mod voting_cleanup { + pub mod metadata_of { use super::runtime_types; - pub type VotingCleanup = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; + pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; pub type Param0 = ::core::primitive::u32; } } pub struct StorageApi; impl StorageApi { - #[doc = " The number of members in the collective who have at least the rank according to the index"] - #[doc = " of the vec."] - pub fn member_count_iter( + #[doc = " The next free referendum index, aka the number of referenda started so far."] + pub fn referendum_count( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::member_count::MemberCount, - (), + types::referendum_count::ReferendumCount, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "MemberCount", + "TechReferenda", + "ReferendumCount", (), [ - 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, - 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, - 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, + 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, + 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, + 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, + 67u8, ], ) } - #[doc = " The number of members in the collective who have at least the rank according to the index"] - #[doc = " of the vec."] - pub fn member_count( + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for_iter( &self, - _0: types::member_count::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::referendum_info_for::ReferendumInfoFor, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "ReferendumInfoFor", + (), + [ + 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, + 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, + 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, + ], + ) + } + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for( + &self, + _0: types::referendum_info_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::member_count::Param0, + types::referendum_info_for::Param0, >, - types::member_count::MemberCount, - ::subxt::ext::subxt_core::utils::Yes, + types::referendum_info_for::ReferendumInfoFor, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "MemberCount", + "TechReferenda", + "ReferendumInfoFor", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, - 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, - 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, + 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, + 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, + 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, ], ) } - #[doc = " The current members of the collective."] - pub fn members_iter( + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] + #[doc = ""] + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::members::Members, - (), + types::track_queue::TrackQueue, (), ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Members", + "TechReferenda", + "TrackQueue", (), [ - 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, - 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, - 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, - 247u8, 133u8, + 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, + 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, + 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, + 186u8, 65u8, ], ) } - #[doc = " The current members of the collective."] - pub fn members( + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] + #[doc = ""] + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue( &self, - _0: types::members::Param0, + _0: types::track_queue::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::members::Param0, + types::track_queue::Param0, >, - types::members::Members, + types::track_queue::TrackQueue, + ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, - (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Members", + "TechReferenda", + "TrackQueue", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, - 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, - 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, - 247u8, 133u8, + 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, + 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, + 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, + 186u8, 65u8, ], ) } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index_iter( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::id_to_index::IdToIndex, - (), + types::deciding_count::DecidingCount, (), ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", + "TechReferenda", + "DecidingCount", (), [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, ], ) } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index_iter1( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count( &self, - _0: types::id_to_index::Param0, + _0: types::deciding_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param0, + types::deciding_count::Param0, >, - types::id_to_index::IdToIndex, - (), - (), + types::deciding_count::DecidingCount, ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", + "TechReferenda", + "DecidingCount", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, ], ) } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index( + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] + #[doc = ""] + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of_iter( &self, - _0: types::id_to_index::Param0, - _1: types::id_to_index::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param1, - >, - ), - types::id_to_index::IdToIndex, - ::subxt::ext::subxt_core::utils::Yes, + (), + types::metadata_of::MetadataOf, (), (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + "TechReferenda", + "MetadataOf", + (), [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id_iter( + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] + #[doc = ""] + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::index_to_id::IndexToId, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", - (), - [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, - ], - ) - } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id_iter1( - &self, - _0: types::index_to_id::Param0, + _0: types::metadata_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param0, + types::metadata_of::Param0, >, - types::index_to_id::IndexToId, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, - ], - ) - } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id( - &self, - _0: types::index_to_id::Param0, - _1: types::index_to_id::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param1, - >, - ), - types::index_to_id::IndexToId, + types::metadata_of::MetadataOf, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + "TechReferenda", + "MetadataOf", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter( + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] + pub fn submission_deposit( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::voting::Voting, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "SubmissionDeposit", [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 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 = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter1( + #[doc = " Maximum size of the referendum queue for a single track."] + pub fn max_queued( &self, - _0: types::voting::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param0, - >, - types::voting::Voting, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "MaxQueued", [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 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 = " Votes on a given proposal, if it is ongoing."] - pub fn voting( + #[doc = " The number of blocks after submission that a referendum must begin being decided by."] + #[doc = " Once this passes, then anyone may cancel the referendum."] + pub fn undeciding_timeout( &self, - _0: types::voting::Param0, - _1: types::voting::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param1, - >, - ), - types::voting::Voting, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "UndecidingTimeout", [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 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 fn voting_cleanup_iter( + #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] + #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] + #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] + pub fn alarm_interval( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::voting_cleanup::VotingCleanup, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "VotingCleanup", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "AlarmInterval", [ - 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, - 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, - 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + 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 fn voting_cleanup( + #[doc = " A list of tracks."] + #[doc = ""] + #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] + pub fn tracks( &self, - _0: types::voting_cleanup::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_cleanup::Param0, - >, - types::voting_cleanup::VotingCleanup, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u16, + runtime_types::pallet_referenda::types::TrackDetails< + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::subxt_core::alloc::string::String, + >, + )>, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "VotingCleanup", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "Tracks", [ - 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, - 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, - 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, + 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, + 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, + 159u8, ], ) } } } } - pub mod tech_referenda { + pub mod treasury_pallet { use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_referenda::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_referenda::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; @@ -13156,36 +13763,39 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Propose a referendum on a privileged action."] + #[doc = "Propose and approve a spend of treasury funds."] #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `Submitted`."] - pub struct Submit { - pub proposal_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub proposal: submit::Proposal, - pub enactment_moment: submit::EnactmentMoment, + #[doc = "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 submit { + pub mod spend_local { use super::runtime_types; - pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, + pub type Amount = ::core::primitive::u128; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), >; - pub type EnactmentMoment = - runtime_types::frame_support::traits::schedule::DispatchTime< - ::core::primitive::u32, - >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "submit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SpendLocal { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "spend_local"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13198,24 +13808,38 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Post the Decision Deposit for a referendum."] + #[doc = "Force a previously approved proposal to be removed from the approval queue."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub struct PlaceDecisionDeposit { - pub index: place_decision_deposit::Index, + #[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 place_decision_deposit { + pub mod remove_approval { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type ProposalId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "place_decision_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveApproval { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "remove_approval"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13228,23 +13852,53 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = "Propose and approve a spend of treasury funds."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub struct RefundDecisionDeposit { - pub index: refund_decision_deposit::Index, + #[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 refund_decision_deposit { + pub mod spend { 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::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type ValidFrom = ::core::option::Option<::core::primitive::u32>; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "refund_decision_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Spend { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "spend"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13257,22 +13911,35 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel an ongoing referendum."] + #[doc = "Claim a spend."] #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub struct Cancel { - pub index: cancel::Index, + #[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 cancel { + pub mod payout { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "cancel"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Payout { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "payout"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13285,22 +13952,35 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = "Check the status of the spend and remove it from the storage if processed."] #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub struct Kill { - pub index: kill::Index, + #[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 kill { + pub mod check_status { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "kill"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CheckStatus { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "check_status"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13313,339 +13993,263 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = "Void previously approved spend."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub struct NudgeReferendum { - pub index: nudge_referendum::Index, + #[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 nudge_referendum { + pub mod void_spend { use super::runtime_types; pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "nudge_referendum"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VoidSpend { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "void_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 = "Advance a track onto its next logical state. Only used internally."] + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Propose and approve a spend of treasury funds."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub struct OneFewerDeciding { - pub track: one_fewer_deciding::Track, - } - pub mod one_fewer_deciding { - use super::runtime_types; - pub type Track = ::core::primitive::u16; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "one_fewer_deciding"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub struct RefundSubmissionDeposit { - pub index: refund_submission_deposit::Index, - } - pub mod refund_submission_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "refund_submission_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set or clear metadata of a referendum."] + #[doc = "### Details"] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub struct SetMetadata { - pub index: set_metadata::Index, - pub maybe_hash: set_metadata::MaybeHash, - } - pub mod set_metadata { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeHash = - ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "set_metadata"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose a referendum on a privileged action."] + #[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 = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = "## Events"] #[doc = ""] - #[doc = "Emits `Submitted`."] - pub fn submit( + #[doc = "Emits [`Event::SpendApproved`] if successful."] + pub fn spend_local( &self, - proposal_origin: types::submit::ProposalOrigin, - proposal: types::submit::Proposal, - enactment_moment: types::submit::EnactmentMoment, - ) -> ::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( - "TechReferenda", - "submit", - types::Submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - proposal_origin, - ), - proposal, - enactment_moment, - }, + "TreasuryPallet", + "spend_local", + types::SpendLocal { amount, beneficiary }, [ - 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, - 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, - 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, + 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 = "Post the Decision Deposit for a referendum."] + #[doc = "Force a previously approved proposal to be removed from the approval queue."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub fn place_decision_deposit( + #[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( &self, - index: types::place_decision_deposit::Index, - ) -> ::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( - "TechReferenda", - "place_decision_deposit", - types::PlaceDecisionDeposit { index }, + "TreasuryPallet", + "remove_approval", + types::RemoveApproval { proposal_id }, [ - 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, - 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, - 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, + 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 = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = "Propose and approve a spend of treasury funds."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub fn refund_decision_deposit( + #[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 fn spend( &self, - index: types::refund_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundDecisionDeposit, - > { + 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( - "TechReferenda", - "refund_decision_deposit", - types::RefundDecisionDeposit { index }, + "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, + }, [ - 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, - 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, - 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, + 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 = "Cancel an ongoing referendum."] + #[doc = "Claim a spend."] #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub fn cancel( + #[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( &self, - index: types::cancel::Index, - ) -> ::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( - "TechReferenda", - "cancel", - types::Cancel { index }, + "TreasuryPallet", + "payout", + types::Payout { index }, [ - 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, - 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, - 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, - 122u8, + 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 = "Cancel an ongoing referendum and slash the deposits."] + #[doc = "Check the status of the spend and remove it from the storage if processed."] #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub fn kill( - &self, - index: types::kill::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "kill", - types::Kill { index }, - [ - 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, - 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, - 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, - 48u8, - ], - ) - } - #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = "Must be signed."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub fn nudge_referendum( - &self, - index: types::nudge_referendum::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "nudge_referendum", - types::NudgeReferendum { index }, - [ - 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, - 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, - 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, - 213u8, - ], - ) - } - #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = "## Details"] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] + #[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 = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub fn one_fewer_deciding( - &self, - track: types::one_fewer_deciding::Track, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "one_fewer_deciding", - types::OneFewerDeciding { track }, - [ - 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, - 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, - 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, - 131u8, 167u8, - ], - ) - } - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "## Events"] #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub fn refund_submission_deposit( + #[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::refund_submission_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundSubmissionDeposit, - > { + index: types::check_status::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "refund_submission_deposit", - types::RefundSubmissionDeposit { index }, + "TreasuryPallet", + "check_status", + types::CheckStatus { index }, [ - 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, - 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, - 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, + 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 = "Set or clear metadata of a referendum."] + #[doc = "Void previously approved spend."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub fn set_metadata( + #[doc = "## 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::set_metadata::Index, - maybe_hash: types::set_metadata::MaybeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::void_spend::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "set_metadata", - types::SetMetadata { index, maybe_hash }, + "TreasuryPallet", + "void_spend", + types::VoidSpend { index }, [ - 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, - 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, - 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, - 88u8, + 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_referenda::pallet::Event2; + pub type Event = runtime_types::pallet_treasury::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -13655,24 +14259,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been submitted."] - pub struct Submitted { - pub index: submitted::Index, - pub track: submitted::Track, - pub proposal: submitted::Proposal, + #[doc = "We have ended a spend period and will now allocate funds."] + pub struct Spending { + pub budget_remaining: spending::BudgetRemaining, } - pub mod submitted { + pub mod spending { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; + pub type BudgetRemaining = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Submitted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Spending { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Spending"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13681,21 +14278,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been placed."] - pub struct DecisionDepositPlaced { - pub index: decision_deposit_placed::Index, - pub who: decision_deposit_placed::Who, - pub amount: decision_deposit_placed::Amount, + #[doc = "Some funds have been allocated."] + pub struct Awarded { + pub proposal_index: awarded::ProposalIndex, + pub award: awarded::Award, + pub account: awarded::Account, } - pub mod decision_deposit_placed { + pub mod awarded { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type 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 DecisionDepositPlaced { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionDepositPlaced"; + 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, @@ -13704,21 +14301,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 decision deposit has been refunded."] - pub struct DecisionDepositRefunded { - pub index: decision_deposit_refunded::Index, - pub who: decision_deposit_refunded::Who, - pub amount: decision_deposit_refunded::Amount, + #[doc = "Some of our funds have been burnt."] + pub struct Burnt { + pub burnt_funds: burnt::BurntFunds, } - pub mod decision_deposit_refunded { + pub mod burnt { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type BurntFunds = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionDepositRefunded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Burnt { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Burnt"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13727,19 +14320,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 deposit has been slashed."] - pub struct DepositSlashed { - pub who: deposit_slashed::Who, - pub amount: deposit_slashed::Amount, + #[doc = "Spending has finished; this is the amount that rolls over until next spend."] + pub struct Rollover { + pub rollover_balance: rollover::RolloverBalance, } - pub mod deposit_slashed { + pub mod rollover { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type RolloverBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DepositSlashed"; + 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, @@ -13748,102 +14339,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has moved into the deciding phase."] - pub struct DecisionStarted { - pub index: decision_started::Index, - pub track: decision_started::Track, - pub proposal: decision_started::Proposal, - pub tally: decision_started::Tally, + #[doc = "Some funds have been deposited."] + pub struct Deposit { + pub value: deposit::Value, } - pub mod decision_started { + pub mod deposit { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + pub type Value = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmStarted { - pub index: confirm_started::Index, - } - pub mod confirm_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "ConfirmStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmAborted { - pub index: confirm_aborted::Index, - } - pub mod confirm_aborted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "ConfirmAborted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has ended its confirmation phase and is ready for approval."] - pub struct Confirmed { - pub index: confirmed::Index, - pub tally: confirmed::Tally, - } - pub mod confirmed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Confirmed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been approved and its proposal has been scheduled."] - pub struct Approved { - pub index: approved::Index, - } - pub mod approved { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Approved"; + 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, @@ -13852,19 +14358,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 = "A proposal has been rejected by referendum."] - pub struct Rejected { - pub index: rejected::Index, - pub tally: rejected::Tally, + #[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 rejected { + pub mod spend_approved { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + 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 Rejected { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Rejected"; + 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, @@ -13873,19 +14381,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been timed out without being decided."] - pub struct TimedOut { - pub index: timed_out::Index, - pub tally: timed_out::Tally, + #[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 timed_out { + pub mod updated_inactive { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + pub type Reactivated = ::core::primitive::u128; + pub type Deactivated = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "TimedOut"; + impl ::subxt::ext::subxt_core::events::StaticEvent for UpdatedInactive { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "UpdatedInactive"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13894,19 +14402,27 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been cancelled."] - pub struct Cancelled { - pub index: cancelled::Index, - pub tally: cancelled::Tally, + #[doc = "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 cancelled { + pub mod asset_spend_approved { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + 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 Cancelled { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Cancelled"; + 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, @@ -13915,19 +14431,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been killed."] - pub struct Killed { - pub index: killed::Index, - pub tally: killed::Tally, + #[doc = "An approved spend was voided."] + pub struct AssetSpendVoided { + pub index: asset_spend_voided::Index, } - pub mod killed { + pub mod asset_spend_voided { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Killed"; + 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, @@ -13936,21 +14450,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The submission deposit has been refunded."] - pub struct SubmissionDepositRefunded { - pub index: submission_deposit_refunded::Index, - pub who: submission_deposit_refunded::Who, - pub amount: submission_deposit_refunded::Amount, + #[doc = "A payment happened."] + pub struct Paid { + pub index: paid::Index, + pub payment_id: paid::PaymentId, } - pub mod submission_deposit_refunded { + pub mod paid { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type PaymentId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "SubmissionDepositRefunded"; + 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, @@ -13959,19 +14471,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been set."] - pub struct MetadataSet { - pub index: metadata_set::Index, - pub hash: metadata_set::Hash, + #[doc = "A payment failed and can be retried."] + pub struct PaymentFailed { + pub index: payment_failed::Index, + pub payment_id: payment_failed::PaymentId, } - pub mod metadata_set { + pub mod payment_failed { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type PaymentId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "MetadataSet"; + 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, @@ -13980,296 +14492,280 @@ 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 = "Metadata for a referendum has been cleared."] - pub struct MetadataCleared { - pub index: metadata_cleared::Index, - pub hash: metadata_cleared::Hash, + #[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 metadata_cleared { + pub mod spend_processed { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "MetadataCleared"; + 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 referendum_count { + pub mod proposal_count { use super::runtime_types; - pub type ReferendumCount = ::core::primitive::u32; + pub type ProposalCount = ::core::primitive::u32; } - pub mod referendum_info_for { + pub mod proposals { use super::runtime_types; - pub type ReferendumInfoFor = - runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::quantus_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >, - ::core::primitive::u128, - runtime_types::pallet_ranked_collective::Tally, - ::subxt::ext::subxt_core::utils::AccountId32, - ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ), - >; + pub type Proposals = runtime_types::pallet_treasury::Proposal< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; pub type Param0 = ::core::primitive::u32; } - pub mod track_queue { + pub mod deactivated { use super::runtime_types; - pub type TrackQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u32, - )>; - pub type Param0 = ::core::primitive::u16; + pub type Deactivated = ::core::primitive::u128; } - pub mod deciding_count { + pub mod approvals { use super::runtime_types; - pub type DecidingCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; + pub type Approvals = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; } - pub mod metadata_of { + pub mod spend_count { use super::runtime_types; - pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; + pub type SpendCount = ::core::primitive::u32; + } + pub mod spends { + use super::runtime_types; + 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 Param0 = ::core::primitive::u32; } + pub mod last_spend_period { + use super::runtime_types; + pub type LastSpendPeriod = ::core::primitive::u32; + } } pub struct StorageApi; impl StorageApi { - #[doc = " The next free referendum index, aka the number of referenda started so far."] - pub fn referendum_count( + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] + #[doc = ""] + #[doc = " Number of proposals that have been made."] + pub fn proposal_count( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::referendum_count::ReferendumCount, + 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( - "TechReferenda", - "ReferendumCount", + "TreasuryPallet", + "ProposalCount", (), [ - 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, - 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, - 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, - 67u8, + 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 = " Information concerning any given referendum."] - pub fn referendum_info_for_iter( + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] + #[doc = ""] + #[doc = " Proposals that have been made."] + pub fn proposals_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::referendum_info_for::ReferendumInfoFor, + types::proposals::Proposals, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "ReferendumInfoFor", + "TreasuryPallet", + "Proposals", (), [ - 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, - 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, - 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, + 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 = " Information concerning any given referendum."] - pub fn referendum_info_for( + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] + #[doc = ""] + #[doc = " Proposals that have been made."] + pub fn proposals( &self, - _0: types::referendum_info_for::Param0, + _0: types::proposals::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::referendum_info_for::Param0, + types::proposals::Param0, >, - types::referendum_info_for::ReferendumInfoFor, + types::proposals::Proposals, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "ReferendumInfoFor", + "TreasuryPallet", + "Proposals", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, - 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, - 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, + 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 = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue_iter( + #[doc = " The amount which has been reported as inactive to Currency."] + pub fn deactivated( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::track_queue::TrackQueue, - (), + types::deactivated::Deactivated, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "TrackQueue", + "TreasuryPallet", + "Deactivated", (), [ - 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, - 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, - 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, - 186u8, 65u8, + 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 = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue( + #[doc = " Proposal indices that have been approved but not yet awarded."] + pub fn approvals( &self, - _0: types::track_queue::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::track_queue::Param0, - >, - types::track_queue::TrackQueue, + (), + types::approvals::Approvals, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "TrackQueue", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "TreasuryPallet", + "Approvals", + (), [ - 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, - 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, - 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, - 186u8, 65u8, + 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 = " The number of referenda being decided currently."] - pub fn deciding_count_iter( + #[doc = " The count of spends that have been made."] + pub fn spend_count( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::deciding_count::DecidingCount, - (), + 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( - "TechReferenda", - "DecidingCount", + "TreasuryPallet", + "SpendCount", (), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 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 = " The number of referenda being decided currently."] - pub fn deciding_count( + #[doc = " Spends that have been approved and being processed."] + pub fn spends_iter( &self, - _0: types::deciding_count::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::deciding_count::Param0, - >, - types::deciding_count::DecidingCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, (), + types::spends::Spends, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "DecidingCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "TreasuryPallet", + "Spends", + (), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 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 metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of_iter( + #[doc = " Spends that have been approved and being processed."] + pub fn spends( &self, + _0: types::spends::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::metadata_of::MetadataOf, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::spends::Param0, + >, + types::spends::Spends, + ::subxt::ext::subxt_core::utils::Yes, (), (), - ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "MetadataOf", - (), + "TreasuryPallet", + "Spends", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 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 metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of( + #[doc = " The blocknumber for the last triggered spend period."] + pub fn last_spend_period( &self, - _0: types::metadata_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata_of::Param0, - >, - types::metadata_of::MetadataOf, + (), + types::last_spend_period::LastSpendPeriod, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "MetadataOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "TreasuryPallet", + "LastSpendPeriod", + (), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 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, ], ) } @@ -14279,49 +14775,69 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] - pub fn submission_deposit( + #[doc = " Period between successive spends."] + pub fn spend_period( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "SubmissionDeposit", + "TreasuryPallet", + "SpendPeriod", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = " Maximum size of the referendum queue for a single track."] - pub fn max_queued( + #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] + pub fn burn( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + runtime_types::sp_arithmetic::per_things::Permill, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "MaxQueued", + "TreasuryPallet", + "Burn", [ - 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, + 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 number of blocks after submission that a referendum must begin being decided by."] - #[doc = " Once this passes, then anyone may cancel the referendum."] - pub fn undeciding_timeout( + #[doc = " The 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( - "TechReferenda", - "UndecidingTimeout", + "TreasuryPallet", + "MaxApprovals", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -14330,17 +14846,15 @@ pub mod api { ], ) } - #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] - #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] - #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] - pub fn alarm_interval( + #[doc = " The 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( - "TechReferenda", - "AlarmInterval", + "TreasuryPallet", + "PayoutPeriod", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -14349,41 +14863,35 @@ pub mod api { ], ) } - #[doc = " A list of tracks."] - #[doc = ""] - #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] - pub fn tracks( + #[doc = " Gets this pallet's derived pot account."] + pub fn pot_account( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u16, - runtime_types::pallet_referenda::types::TrackDetails< - ::core::primitive::u128, - ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::string::String, - >, - )>, + ::subxt::ext::subxt_core::utils::AccountId32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "Tracks", + "TreasuryPallet", + "pot_account", [ - 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, - 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, - 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, - 159u8, + 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 merkle_airdrop { + 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_merkle_airdrop::pallet::Error; + pub type Error = runtime_types::pallet_recovery::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_merkle_airdrop::pallet::Call; + pub type Call = runtime_types::pallet_recovery::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -14400,32 +14908,29 @@ 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 = "Send a call through a recovered account."] #[doc = ""] - #[doc = "# Parameters"] + #[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 = "* `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, + #[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 create_airdrop { + pub mod as_recovered { 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>; + pub type Account = ::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 CreateAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "create_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "as_recovered"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14438,32 +14943,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Fund an existing airdrop with tokens."] - #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] - #[doc = ""] - #[doc = "# Parameters"] - #[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 = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "The dispatch origin for this call must be _ROOT_."] #[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 = "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 fund_airdrop { + pub mod set_recovered { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Amount = ::core::primitive::u128; + 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 FundAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "fund_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "set_recovered"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14476,44 +14981,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 = ""] - #[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 = ""] - #[doc = "# Parameters"] + #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] #[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 = "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 = "# Errors"] + #[doc = "The dispatch origin for this call must be _Signed_."] #[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 = "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 claim { + pub mod create_recovery { 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 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 Claim { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "claim"; + 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, @@ -14526,193 +15025,564 @@ 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 = ""] - #[doc = "# Parameters"] + #[doc = "Initiate the process for recovering a recoverable account."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] + #[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 = "# Errors"] + #[doc = "The dispatch origin for this call must be _Signed_."] #[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 = "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 delete_airdrop { + pub mod initiate_recovery { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DeleteAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "delete_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for InitiateRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "initiate_recovery"; } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Create a new airdrop with a Merkle root."] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 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 = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable account."] #[doc = ""] - #[doc = "# Parameters"] + #[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 = "* `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( - &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 - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "create_airdrop", - types::CreateAirdrop { merkle_root, vesting_period, vesting_delay }, - [ - 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, - ], - ) + #[doc = "The combination of these two parameters must point to an active recovery"] + #[doc = "process."] + pub struct VouchRecovery { + pub lost: vouch_recovery::Lost, + pub rescuer: vouch_recovery::Rescuer, } - #[doc = "Fund an existing airdrop with tokens."] - #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] - #[doc = ""] - #[doc = "# Parameters"] - #[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 = ""] - #[doc = "# Errors"] - #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - pub fn fund_airdrop( - &self, - airdrop_id: types::fund_airdrop::AirdropId, - amount: types::fund_airdrop::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "fund_airdrop", - types::FundAirdrop { airdrop_id, amount }, - [ - 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, - ], - ) + 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, + (), + >; } - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] - #[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 = ""] - #[doc = "# Parameters"] - #[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 = ""] - #[doc = "# Errors"] + 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 = ""] + #[doc = "Payment: By calling this function, the recoverable account will receive"] + #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account with an active recovery process for it."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] + pub struct CloseRecovery { + pub rescuer: close_recovery::Rescuer, + } + pub mod close_recovery { + use super::runtime_types; + pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CloseRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "close_recovery"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = ""] + #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] + #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = ""] + #[doc = "Payment: By calling this function the recoverable account will unreserve"] + #[doc = "their recovery configuration deposit."] + #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account (i.e. has a recovery configuration)."] + pub struct RemoveRecovery; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "remove_recovery"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] + pub struct CancelRecovered { + pub account: cancel_recovered::Account, + } + pub mod cancel_recovered { + use super::runtime_types; + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "cancel_recovered"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + #[doc = ""] + #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] + #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = ""] + #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] + #[doc = "of the caller:"] + #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] + #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] + #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = ""] + #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] + #[doc = "account."] + #[doc = ""] + #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if any deposit is updated."] + #[doc = "Multiple events may be emitted in case both types of deposits are updated."] + pub struct PokeDeposit { + pub maybe_account: poke_deposit::MaybeAccount, + } + pub mod poke_deposit { + use super::runtime_types; + pub type MaybeAccount = ::core::option::Option< + ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >, + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "poke_deposit"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[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 = "* `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 = "Parameters:"] + #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] + #[doc = "- `call`: The call you want to make with the recovered account."] + pub fn as_recovered( &self, - 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 { + account: types::as_recovered::Account, + call: types::as_recovered::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "claim", - types::Claim { airdrop_id, recipient, amount, merkle_proof }, + "Recovery", + "as_recovered", + types::AsRecovered { + account, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 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, + 96u8, 65u8, 213u8, 54u8, 132u8, 243u8, 226u8, 209u8, 189u8, 106u8, + 220u8, 118u8, 51u8, 43u8, 78u8, 247u8, 125u8, 239u8, 232u8, 150u8, + 123u8, 220u8, 122u8, 68u8, 65u8, 92u8, 99u8, 207u8, 126u8, 58u8, 105u8, + 128u8, ], ) } - #[doc = "Delete an airdrop and reclaim any remaining funds."] + #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] #[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 = "The dispatch origin for this call must be _ROOT_."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Parameters:"] + #[doc = "- `lost`: The \"lost account\" to be recovered."] + #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] + pub fn set_recovered( + &self, + lost: types::set_recovered::Lost, + rescuer: types::set_recovered::Rescuer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "set_recovered", + types::SetRecovered { lost, rescuer }, + [ + 194u8, 147u8, 14u8, 197u8, 132u8, 185u8, 122u8, 81u8, 61u8, 14u8, 10u8, + 177u8, 74u8, 184u8, 150u8, 217u8, 246u8, 149u8, 26u8, 165u8, 196u8, + 83u8, 230u8, 195u8, 213u8, 40u8, 51u8, 180u8, 23u8, 90u8, 3u8, 14u8, + ], + ) + } + #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] + #[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 = "# Errors"] + #[doc = "The dispatch origin for this call must be _Signed_."] #[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 = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] + #[doc = " ordered and contain no duplicate values."] + #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] + #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] + #[doc = " friends."] + #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] + #[doc = " needs to pass before the account can be recovered."] + pub fn create_recovery( &self, - airdrop_id: types::delete_airdrop::AirdropId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + friends: types::create_recovery::Friends, + threshold: types::create_recovery::Threshold, + delay_period: types::create_recovery::DelayPeriod, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "delete_airdrop", - types::DeleteAirdrop { airdrop_id }, + "Recovery", + "create_recovery", + types::CreateRecovery { friends, threshold, delay_period }, [ - 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, + 36u8, 175u8, 11u8, 85u8, 95u8, 170u8, 58u8, 193u8, 102u8, 18u8, 117u8, + 27u8, 199u8, 214u8, 70u8, 47u8, 129u8, 130u8, 109u8, 242u8, 240u8, + 255u8, 120u8, 176u8, 40u8, 243u8, 175u8, 71u8, 3u8, 91u8, 186u8, 220u8, ], ) } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_merkle_airdrop::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + #[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 fn initiate_recovery( + &self, + account: types::initiate_recovery::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "initiate_recovery", + types::InitiateRecovery { account }, + [ + 60u8, 243u8, 229u8, 176u8, 221u8, 52u8, 44u8, 224u8, 233u8, 14u8, 89u8, + 100u8, 174u8, 74u8, 38u8, 32u8, 97u8, 48u8, 53u8, 74u8, 30u8, 242u8, + 19u8, 114u8, 145u8, 74u8, 69u8, 125u8, 227u8, 214u8, 144u8, 58u8, + ], + ) + } + #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] + #[doc = "process for that account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `lost`: The lost account that you want to recover."] + #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = ""] + #[doc = "The combination of these two parameters must point to an active recovery"] + #[doc = "process."] + pub fn vouch_recovery( + &self, + lost: types::vouch_recovery::Lost, + rescuer: types::vouch_recovery::Rescuer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "vouch_recovery", + types::VouchRecovery { lost, rescuer }, + [ + 97u8, 190u8, 60u8, 15u8, 191u8, 117u8, 1u8, 217u8, 62u8, 40u8, 210u8, + 1u8, 237u8, 111u8, 48u8, 196u8, 180u8, 154u8, 198u8, 12u8, 108u8, 42u8, + 6u8, 234u8, 2u8, 113u8, 163u8, 111u8, 80u8, 146u8, 6u8, 73u8, + ], + ) + } + #[doc = "Allow a successful rescuer to claim their recovered account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] + #[doc = "who has successfully completed the account recovery process: collected"] + #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] + #[doc = " you."] + pub fn claim_recovery( + &self, + account: types::claim_recovery::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "claim_recovery", + types::ClaimRecovery { account }, + [ + 41u8, 47u8, 162u8, 88u8, 13u8, 166u8, 130u8, 146u8, 218u8, 162u8, + 166u8, 33u8, 89u8, 129u8, 177u8, 178u8, 68u8, 128u8, 161u8, 229u8, + 207u8, 3u8, 57u8, 35u8, 211u8, 208u8, 74u8, 155u8, 183u8, 173u8, 74u8, + 56u8, + ], + ) + } + #[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."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account with an active recovery process for it."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] + pub fn close_recovery( + &self, + rescuer: types::close_recovery::Rescuer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "close_recovery", + types::CloseRecovery { rescuer }, + [ + 161u8, 178u8, 117u8, 209u8, 119u8, 164u8, 135u8, 41u8, 25u8, 108u8, + 194u8, 175u8, 221u8, 65u8, 184u8, 137u8, 171u8, 97u8, 204u8, 61u8, + 159u8, 39u8, 192u8, 53u8, 246u8, 69u8, 113u8, 16u8, 170u8, 232u8, + 163u8, 10u8, + ], + ) + } + #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = ""] + #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] + #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = ""] + #[doc = "Payment: By calling this function the recoverable account will unreserve"] + #[doc = "their recovery configuration deposit."] + #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] + #[doc = "recoverable account (i.e. has a recovery configuration)."] + pub fn remove_recovery( + &self, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "remove_recovery", + types::RemoveRecovery {}, + [ + 11u8, 38u8, 133u8, 172u8, 212u8, 252u8, 57u8, 216u8, 42u8, 202u8, + 206u8, 91u8, 115u8, 91u8, 242u8, 123u8, 95u8, 196u8, 172u8, 243u8, + 164u8, 1u8, 69u8, 180u8, 40u8, 68u8, 208u8, 221u8, 161u8, 250u8, 8u8, + 72u8, + ], + ) + } + #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] + pub fn cancel_recovered( + &self, + account: types::cancel_recovered::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "cancel_recovered", + types::CancelRecovered { account }, + [ + 100u8, 222u8, 80u8, 226u8, 187u8, 188u8, 111u8, 58u8, 190u8, 5u8, + 178u8, 144u8, 37u8, 98u8, 71u8, 145u8, 28u8, 248u8, 222u8, 188u8, 53u8, + 21u8, 127u8, 176u8, 249u8, 166u8, 250u8, 59u8, 170u8, 33u8, 251u8, + 239u8, + ], + ) + } + #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + #[doc = ""] + #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] + #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = ""] + #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] + #[doc = "of the caller:"] + #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] + #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] + #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = ""] + #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] + #[doc = "account."] + #[doc = ""] + #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = ""] + #[doc = "Emits `DepositPoked` if any deposit is updated."] + #[doc = "Multiple events may be emitted in case both types of deposits are updated."] + pub fn poke_deposit( + &self, + maybe_account: types::poke_deposit::MaybeAccount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Recovery", + "poke_deposit", + types::PokeDeposit { maybe_account }, + [ + 177u8, 98u8, 53u8, 15u8, 228u8, 36u8, 173u8, 55u8, 125u8, 3u8, 234u8, + 70u8, 147u8, 147u8, 124u8, 86u8, 31u8, 101u8, 171u8, 56u8, 148u8, + 180u8, 87u8, 149u8, 11u8, 113u8, 195u8, 35u8, 56u8, 32u8, 251u8, 56u8, + ], + ) + } + } + } + #[doc = "Events type."] + pub type Event = runtime_types::pallet_recovery::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A 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 = "A recovery process has been set up for an account."] + pub struct RecoveryCreated { + pub account: recovery_created::Account, + } + pub mod recovery_created { use super::runtime_types; - pub type 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 Account = ::subxt::ext::subxt_core::utils::AccountId32; } - 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 RecoveryCreated { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryCreated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14721,21 +15591,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "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 = "A recovery process has been initiated for lost account by rescuer account."] + pub struct RecoveryInitiated { + pub lost_account: recovery_initiated::LostAccount, + pub rescuer_account: recovery_initiated::RescuerAccount, + } + pub mod recovery_initiated { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Amount = ::core::primitive::u128; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropFunded { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropFunded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryInitiated { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryInitiated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14744,23 +15612,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 = "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 = "A recovery process for lost account by rescuer account has been vouched for by sender."] + pub struct RecoveryVouched { + pub lost_account: recovery_vouched::LostAccount, + pub rescuer_account: recovery_vouched::RescuerAccount, + pub sender: recovery_vouched::Sender, + } + pub mod recovery_vouched { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Sender = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Claimed { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "Claimed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryVouched { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryVouched"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14769,192 +15635,304 @@ 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 = "A recovery process for lost account by rescuer account has been closed."] + pub struct RecoveryClosed { + pub lost_account: recovery_closed::LostAccount, + pub rescuer_account: recovery_closed::RescuerAccount, } - pub mod airdrop_deleted { + pub mod recovery_closed { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropDeleted { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropDeleted"; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; } - } + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryClosed { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryClosed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Lost account has been successfully recovered by rescuer account."] + pub struct AccountRecovered { + pub lost_account: account_recovered::LostAccount, + pub rescuer_account: account_recovered::RescuerAccount, + } + pub mod account_recovered { + use super::runtime_types; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for AccountRecovered { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "AccountRecovered"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A recovery process has been removed for an account."] + pub struct RecoveryRemoved { + pub lost_account: recovery_removed::LostAccount, + } + pub mod recovery_removed { + use super::runtime_types; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryRemoved { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryRemoved"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A deposit has been updated."] + pub struct DepositPoked { + pub who: deposit_poked::Who, + pub kind: deposit_poked::Kind, + pub old_deposit: deposit_poked::OldDeposit, + pub new_deposit: deposit_poked::NewDeposit, + } + pub mod deposit_poked { + use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Kind = runtime_types::pallet_recovery::DepositKind< + runtime_types::quantus_runtime::Runtime, + >; + pub type OldDeposit = ::core::primitive::u128; + pub type NewDeposit = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "DepositPoked"; + } + } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod airdrop_info { + pub mod recoverable { use super::runtime_types; - pub type AirdropInfo = runtime_types::pallet_merkle_airdrop::AirdropMetadata< + pub type Recoverable = runtime_types::pallet_recovery::RecoveryConfig< ::core::primitive::u32, ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, >; - pub type Param0 = ::core::primitive::u32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod claimed { + pub mod active_recoveries { use super::runtime_types; - pub type Claimed = (); - pub type Param0 = ::core::primitive::u32; + pub type ActiveRecoveries = runtime_types::pallet_recovery::ActiveRecovery< + ::core::primitive::u32, + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod next_airdrop_id { + pub mod proxy { use super::runtime_types; - pub type NextAirdropId = ::core::primitive::u32; + pub type Proxy = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } } pub struct StorageApi; impl StorageApi { - #[doc = " Stores general info about an airdrop"] - pub fn airdrop_info_iter( + #[doc = " The set of recoverable accounts and their recovery configuration."] + pub fn recoverable_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::airdrop_info::AirdropInfo, + types::recoverable::Recoverable, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "AirdropInfo", + "Recovery", + "Recoverable", (), [ - 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, + 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, + 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, + 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, ], ) } - #[doc = " Stores general info about an airdrop"] - pub fn airdrop_info( + #[doc = " The set of recoverable accounts and their recovery configuration."] + pub fn recoverable( &self, - _0: types::airdrop_info::Param0, + _0: types::recoverable::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::airdrop_info::Param0, + types::recoverable::Param0, >, - types::airdrop_info::AirdropInfo, + types::recoverable::Recoverable, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "AirdropInfo", + "Recovery", + "Recoverable", ::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, + 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, + 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, + 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, ], ) } - #[doc = " Storage for claimed status"] - pub fn claimed_iter( + #[doc = " Active recovery attempts."] + #[doc = ""] + #[doc = " First account is the account to be recovered, and the second account"] + #[doc = " is the user trying to recover the account."] + pub fn active_recoveries_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::claimed::Claimed, + types::active_recoveries::ActiveRecoveries, + (), (), - ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", + "Recovery", + "ActiveRecoveries", (), [ - 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, + 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, + 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, + 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, + 91u8, 123u8, ], ) } - #[doc = " Storage for claimed status"] - pub fn claimed_iter1( + #[doc = " Active recovery attempts."] + #[doc = ""] + #[doc = " First account is the account to be recovered, and the second account"] + #[doc = " is the user trying to recover the account."] + pub fn active_recoveries_iter1( &self, - _0: types::claimed::Param0, + _0: types::active_recoveries::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param0, + types::active_recoveries::Param0, >, - types::claimed::Claimed, + types::active_recoveries::ActiveRecoveries, + (), (), - ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", + "Recovery", + "ActiveRecoveries", ::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, + 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, + 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, + 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, + 91u8, 123u8, ], ) } - #[doc = " Storage for claimed status"] - pub fn claimed( + #[doc = " Active recovery attempts."] + #[doc = ""] + #[doc = " First account is the account to be recovered, and the second account"] + #[doc = " is the user trying to recover the account."] + pub fn active_recoveries( &self, - _0: types::claimed::Param0, - _1: types::claimed::Param1, + _0: types::active_recoveries::Param0, + _1: types::active_recoveries::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param0, + types::active_recoveries::Param0, >, ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param1, + types::active_recoveries::Param1, >, ), - types::claimed::Claimed, - ::subxt::ext::subxt_core::utils::Yes, + types::active_recoveries::ActiveRecoveries, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", + "Recovery", + "ActiveRecoveries", ( ::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, + 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, + 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, + 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, + 91u8, 123u8, ], ) } - #[doc = " Counter for airdrop IDs"] - pub fn next_airdrop_id( + #[doc = " The list of allowed proxy accounts."] + #[doc = ""] + #[doc = " Map from the user who can access it to the recovered account."] + pub fn proxy_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::next_airdrop_id::NextAirdropId, + types::proxy::Proxy, + (), + (), ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Recovery", + "Proxy", + (), + [ + 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, + 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, + 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, + ], + ) + } + #[doc = " The list of allowed proxy accounts."] + #[doc = ""] + #[doc = " Map from the user who can access it to the recovered account."] + pub fn proxy( + &self, + _0: types::proxy::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::proxy::Param0, + >, + types::proxy::Proxy, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "NextAirdropId", - (), + "Recovery", + "Proxy", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, + 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, + 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, ], ) } @@ -14964,65 +15942,98 @@ pub mod api { 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( + #[doc = " The base amount of currency needed to reserve for creating a recovery configuration."] + #[doc = ""] + #[doc = " This is held for an additional storage item whose value size is"] + #[doc = " `2 + sizeof(BlockNumber, Balance)` bytes."] + pub fn config_deposit_base( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "MaxProofs", + "Recovery", + "ConfigDepositBase", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } - #[doc = " The pallet id, used for deriving its sovereign account ID."] - pub fn pallet_id( + #[doc = " The amount of currency needed per additional user when creating a recovery"] + #[doc = " configuration."] + #[doc = ""] + #[doc = " This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage"] + #[doc = " value."] + pub fn friend_deposit_factor( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, + ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "PalletId", + "Recovery", + "FriendDepositFactor", [ - 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, + 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 = " Priority for unsigned claim transactions."] - pub fn unsigned_claim_priority( + #[doc = " The maximum amount of friends allowed in a recovery configuration."] + #[doc = ""] + #[doc = " NOTE: The threshold programmed in this Pallet uses u16, so it does"] + #[doc = " not really make sense to have a limit here greater than u16::MAX."] + #[doc = " But also, that is a lot more than you should probably set this value"] + #[doc = " to anyway..."] + pub fn max_friends( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "UnsignedClaimPriority", + "Recovery", + "MaxFriends", [ - 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, + 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 treasury_pallet { - use super::{root_mod, runtime_types}; - #[doc = "Error for the treasury pallet."] - pub type Error = runtime_types::pallet_treasury::pallet::Error; + #[doc = " The base amount of currency needed to reserve for starting a recovery."] + #[doc = ""] + #[doc = " This is primarily held for deterring malicious recovery attempts, and should"] + #[doc = " have a value large enough that a bad actor would choose not to place this"] + #[doc = " deposit. It also acts to fund additional storage item whose value size is"] + #[doc = " `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable"] + #[doc = " threshold."] + pub fn recovery_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Recovery", + "RecoveryDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + } + } + } + pub mod assets { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_assets::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_treasury::pallet::Call; + pub type Call = runtime_types::pallet_assets::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -15039,39 +16050,43 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Propose and approve a spend of treasury funds."] + #[doc = "Issue a new class of fungible assets from a public origin."] #[doc = ""] - #[doc = "## Dispatch Origin"] + #[doc = "This new asset class has no assets initially and its owner is the origin."] #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] + #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] + #[doc = "Funds of sender are reserved by `AssetDeposit`."] #[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 = "Parameters:"] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] + #[doc = "member of the asset class's admin team."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] #[doc = ""] - #[doc = "## Events"] + #[doc = "Emits `Created` event when successful."] #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub struct SpendLocal { + #[doc = "Weight: `O(1)`"] + pub struct Create { #[codec(compact)] - pub amount: spend_local::Amount, - pub beneficiary: spend_local::Beneficiary, + pub id: create::Id, + pub admin: create::Admin, + pub min_balance: create::MinBalance, } - pub mod spend_local { + pub mod create { use super::runtime_types; - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type MinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SpendLocal { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "spend_local"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Create { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "create"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15084,38 +16099,46 @@ pub mod api { #[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 = "Issue a new class of fungible assets from a privileged origin."] #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = "This new asset class has no assets initially."] #[doc = ""] - #[doc = "## Details"] + #[doc = "The origin must conform to `ForceOrigin`."] #[doc = ""] - #[doc = "The original deposit will no longer be returned."] + #[doc = "Unlike `create`, no funds are reserved."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] + #[doc = "over this asset, but may later change and configure the permissions using"] + #[doc = "`transfer_ownership` and `set_team`."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] + #[doc = "Emits `ForceCreated` event when successful."] #[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 { + #[doc = "Weight: `O(1)`"] + pub struct ForceCreate { #[codec(compact)] - pub proposal_id: remove_approval::ProposalId, + pub id: force_create::Id, + pub owner: force_create::Owner, + pub is_sufficient: force_create::IsSufficient, + #[codec(compact)] + pub min_balance: force_create::MinBalance, } - pub mod remove_approval { + pub mod force_create { use super::runtime_types; - pub type ProposalId = ::core::primitive::u32; + pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type IsSufficient = ::core::primitive::bool; + pub type MinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveApproval { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "remove_approval"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCreate { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_create"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15128,53 +16151,29 @@ pub mod api { #[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 = "Start the process of destroying a fungible asset class."] #[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 = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] + #[doc = "destruction of an asset class."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `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 = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] #[doc = ""] - #[doc = "## Events"] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub struct Spend { - pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "an account contains holds or freezes in place."] + pub struct StartDestroy { #[codec(compact)] - pub amount: spend::Amount, - pub beneficiary: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub valid_from: spend::ValidFrom, + pub id: start_destroy::Id, } - pub mod spend { + pub mod start_destroy { 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>; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Spend { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "spend"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for StartDestroy { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "start_destroy"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15187,35 +16186,29 @@ pub mod api { #[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 = "Destroy all accounts associated with a given asset."] #[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 = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] #[doc = ""] - #[doc = "## Events"] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub struct Payout { - pub index: payout::Index, + #[doc = "Each call emits the `Event::DestroyedAccounts` event."] + pub struct DestroyAccounts { + #[codec(compact)] + pub id: destroy_accounts::Id, } - pub mod payout { + pub mod destroy_accounts { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Payout { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "payout"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyAccounts { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "destroy_accounts"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15228,35 +16221,29 @@ pub mod api { #[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 = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] #[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 = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] #[doc = ""] - #[doc = "## Events"] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[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, + #[doc = "Each call emits the `Event::DestroyedApprovals` event."] + pub struct DestroyApprovals { + #[codec(compact)] + pub id: destroy_approvals::Id, } - pub mod check_status { + pub mod destroy_approvals { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CheckStatus { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "check_status"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyApprovals { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "destroy_approvals"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15269,910 +16256,500 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Void previously approved spend."] + #[doc = "Complete destroying asset and unreserve currency."] #[doc = ""] - #[doc = "## Dispatch Origin"] + #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] + #[doc = "hand."] #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "## Details"] + #[doc = "Each successful call emits the `Event::Destroyed` event."] + pub struct FinishDestroy { + #[codec(compact)] + pub id: finish_destroy::Id, + } + pub mod finish_destroy { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FinishDestroy { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "finish_destroy"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Mint assets of a particular class."] #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[doc = "- `id`: The identifier of the asset to have some amount minted."] + #[doc = "- `beneficiary`: The account to be credited with the minted assets."] + #[doc = "- `amount`: The amount of the asset to be minted."] #[doc = ""] - #[doc = "## Events"] + #[doc = "Emits `Issued` event when successful."] #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - pub struct VoidSpend { - pub index: void_spend::Index, + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] + pub struct Mint { + #[codec(compact)] + pub id: mint::Id, + pub beneficiary: mint::Beneficiary, + #[codec(compact)] + pub amount: mint::Amount, } - pub mod void_spend { + pub mod mint { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Id = ::core::primitive::u32; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VoidSpend { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "void_spend"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Mint { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "mint"; } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] + #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] + #[doc = "Bails with `NoAccount` if the `who` is already dead."] #[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 = "- `id`: The identifier of the asset to have some amount burned."] + #[doc = "- `who`: The account to be debited from."] + #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] #[doc = ""] - #[doc = "## Events"] + #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] + #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub fn spend_local( - &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( - "TreasuryPallet", - "spend_local", - types::SpendLocal { amount, beneficiary }, - [ - 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 = "Weight: `O(1)`"] + #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] + pub struct Burn { + #[codec(compact)] + pub id: burn::Id, + pub who: burn::Who, + #[codec(compact)] + pub amount: burn::Amount, } - #[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"] + pub mod burn { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Burn { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "burn"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Move some assets from the sender account to another."] #[doc = ""] - #[doc = "The original deposit will no longer be returned."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] #[doc = ""] - #[doc = "### 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, - proposal_id: types::remove_approval::ProposalId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "remove_approval", - types::RemoveApproval { proposal_id }, - [ - 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 = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub struct Transfer { + #[codec(compact)] + pub id: transfer::Id, + pub target: transfer::Target, + #[codec(compact)] + pub amount: transfer::Amount, } - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] + pub mod transfer { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Transfer { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] #[doc = ""] - #[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 = "Origin must be Signed."] #[doc = ""] - #[doc = "## Details"] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "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 = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] #[doc = ""] - #[doc = "### 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 fn spend( - &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( - "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, - }, - [ - 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 = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub struct TransferKeepAlive { + #[codec(compact)] + pub id: transfer_keep_alive::Id, + pub target: transfer_keep_alive::Target, + #[codec(compact)] + pub amount: transfer_keep_alive::Amount, } - #[doc = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] + pub mod transfer_keep_alive { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer_keep_alive"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Move some assets from one account to another."] #[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 = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `source`: The account to be debited."] + #[doc = "- `dest`: The account to be credited."] + #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] + #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] + #[doc = "below the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "## Events"] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub fn payout( - &self, - 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 = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] + #[doc = "`dest`."] + pub struct ForceTransfer { + #[codec(compact)] + pub id: force_transfer::Id, + pub source: force_transfer::Source, + pub dest: force_transfer::Dest, + #[codec(compact)] + pub amount: force_transfer::Amount, } - #[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"] + pub mod force_transfer { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceTransfer { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_transfer"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] + #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] + #[doc = "account that does not have an entry, use `touch_other` first."] #[doc = ""] - #[doc = "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 = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be frozen."] #[doc = ""] - #[doc = "## Events"] + #[doc = "Emits `Frozen`."] #[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 = "Weight: `O(1)`"] + pub struct Freeze { + #[codec(compact)] + pub id: freeze::Id, + pub who: freeze::Who, } - #[doc = "Void previously approved spend."] + pub mod freeze { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Freeze { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "freeze"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Allow unprivileged transfers to and from an account again."] #[doc = ""] - #[doc = "## Dispatch Origin"] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be unfrozen."] #[doc = ""] - #[doc = "## Details"] + #[doc = "Emits `Thawed`."] #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = "Weight: `O(1)`"] + pub struct Thaw { + #[codec(compact)] + pub id: thaw::Id, + pub who: thaw::Who, + } + pub mod thaw { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Thaw { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "thaw"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Disallow further unprivileged transfers for the asset class."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "## Events"] + #[doc = "- `id`: The identifier of the asset to be frozen."] #[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( - "TreasuryPallet", - "void_spend", - types::VoidSpend { index }, - [ - 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 = "Emits `Frozen`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct FreezeAsset { + #[codec(compact)] + pub id: freeze_asset::Id, } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_treasury::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "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 mod awarded { - 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 { + pub mod freeze_asset { use super::runtime_types; - pub type ProposalCount = ::core::primitive::u32; + pub type Id = ::core::primitive::u32; } - pub mod proposals { - use super::runtime_types; - 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 FreezeAsset { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "freeze_asset"; } - 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 = "Allow unprivileged transfers for the asset again."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be thawed."] + #[doc = ""] + #[doc = "Emits `Thawed`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ThawAsset { + #[codec(compact)] + pub id: thaw_asset::Id, } - pub mod approvals { + pub mod thaw_asset { use super::runtime_types; - pub type Approvals = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; + pub type Id = ::core::primitive::u32; } - pub mod spend_count { - use super::runtime_types; - pub type SpendCount = ::core::primitive::u32; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ThawAsset { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "thaw_asset"; } - pub mod spends { + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Change the Owner of an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = ""] + #[doc = "Emits `OwnerChanged`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct TransferOwnership { + #[codec(compact)] + pub id: transfer_ownership::Id, + pub owner: transfer_ownership::Owner, + } + pub mod transfer_ownership { use super::runtime_types; - pub type Spends = runtime_types::pallet_treasury::SpendStatus< - (), - ::core::primitive::u128, + pub type Id = ::core::primitive::u32; + pub type Owner = ::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 TransferOwnership { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer_ownership"; } - } - 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 = "Change the Issuer, Admin and Freezer of an asset."] #[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 = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[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 = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = ""] - #[doc = " 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 = "Emits `TeamChanged`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct SetTeam { + #[codec(compact)] + pub id: set_team::Id, + pub issuer: set_team::Issuer, + pub admin: set_team::Admin, + pub freezer: set_team::Freezer, } - #[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", + pub mod set_team { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, (), - [ - 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 = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] - #[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 = " 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", - (), - [ - 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", + >; + pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, (), - [ - 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", + >; + pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, (), - [ - 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 SetTeam { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "set_team"; } - } - } - } - 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, @@ -16184,29 +16761,41 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a call through a recovered account."] + #[doc = "Set the metadata for an asset."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] - #[doc = "- `call`: The call you want to make with the recovered account."] - pub struct AsRecovered { - pub account: as_recovered::Account, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[doc = "Funds of sender are reserved according to the formula:"] + #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] + #[doc = "account any already reserved funds."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = ""] + #[doc = "Emits `MetadataSet`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct SetMetadata { + #[codec(compact)] + pub id: set_metadata::Id, + pub name: set_metadata::Name, + pub symbol: set_metadata::Symbol, + pub decimals: set_metadata::Decimals, } - pub mod as_recovered { + pub mod set_metadata { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + pub type Id = ::core::primitive::u32; + pub type Name = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Symbol = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Decimals = ::core::primitive::u8; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "as_recovered"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "set_metadata"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16219,32 +16808,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 = "Clear the metadata for an asset."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _ROOT_."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[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 = "Any deposit is freed for the asset owner."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ClearMetadata { + #[codec(compact)] + pub id: clear_metadata::Id, } - pub mod set_recovered { + pub mod clear_metadata { use super::runtime_types; - pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "set_recovered"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "clear_metadata"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16257,38 +16842,41 @@ 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 = "Force the metadata for an asset to some value."] #[doc = ""] - #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] - #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] - #[doc = "in full when the user calls `remove_recovery`."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "Any deposit is left alone."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] - #[doc = " ordered and contain no duplicate values."] - #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] - #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] - #[doc = " friends."] - #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] - #[doc = " needs to pass before the account can be recovered."] - pub struct CreateRecovery { - pub friends: create_recovery::Friends, - pub threshold: create_recovery::Threshold, - pub delay_period: create_recovery::DelayPeriod, + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = ""] + #[doc = "Emits `MetadataSet`."] + #[doc = ""] + #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] + pub struct ForceSetMetadata { + #[codec(compact)] + pub id: force_set_metadata::Id, + pub name: force_set_metadata::Name, + pub symbol: force_set_metadata::Symbol, + pub decimals: force_set_metadata::Decimals, + pub is_frozen: force_set_metadata::IsFrozen, } - pub mod create_recovery { + pub mod force_set_metadata { use super::runtime_types; - pub type Friends = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Threshold = ::core::primitive::u16; - pub type DelayPeriod = ::core::primitive::u32; + pub type Id = ::core::primitive::u32; + pub type Name = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Symbol = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Decimals = ::core::primitive::u8; + pub type IsFrozen = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "create_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_set_metadata"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16301,30 +16889,28 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Initiate the process for recovering a recoverable account."] + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] - #[doc = "recovery process. This deposit will always be repatriated to the account"] - #[doc = "trying to be recovered. See `close_recovery`."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "Any deposit is returned."] #[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 = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceClearMetadata { + #[codec(compact)] + pub id: force_clear_metadata::Id, } - pub mod initiate_recovery { + pub mod force_clear_metadata { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for InitiateRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "initiate_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceClearMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_clear_metadata"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16337,36 +16923,66 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] - #[doc = "process for that account."] + #[doc = "Alter the attributes of a given asset."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] - #[doc = "for the recoverable account."] + #[doc = "Origin must be `ForceOrigin`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The lost account that you want to recover."] - #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] + #[doc = "value to account for the state bloat associated with its balance storage. If set to"] + #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] + #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] + #[doc = "growth)."] + #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] + #[doc = "instructions."] #[doc = ""] - #[doc = "The combination of these two parameters must point to an active recovery"] - #[doc = "process."] - pub struct VouchRecovery { - pub lost: vouch_recovery::Lost, - pub rescuer: vouch_recovery::Rescuer, + #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceAssetStatus { + #[codec(compact)] + pub id: force_asset_status::Id, + pub owner: force_asset_status::Owner, + pub issuer: force_asset_status::Issuer, + pub admin: force_asset_status::Admin, + pub freezer: force_asset_status::Freezer, + #[codec(compact)] + pub min_balance: force_asset_status::MinBalance, + pub is_sufficient: force_asset_status::IsSufficient, + pub is_frozen: force_asset_status::IsFrozen, } - pub mod vouch_recovery { + pub mod force_asset_status { use super::runtime_types; - pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type MinBalance = ::core::primitive::u128; + pub type IsSufficient = ::core::primitive::bool; + pub type IsFrozen = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VouchRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "vouch_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceAssetStatus { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_asset_status"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16379,32 +16995,49 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Allow a successful rescuer to claim their recovered account."] + #[doc = "Approve an amount of asset for transfer by a delegated third-party 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 = "Origin must be Signed."] #[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, + #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] + #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] + #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] + #[doc = "meet the right value."] + #[doc = ""] + #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] + #[doc = "making this call."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account to delegate permission to transfer asset."] + #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] + #[doc = "already an approval in place, then this acts additively."] + #[doc = ""] + #[doc = "Emits `ApprovedTransfer` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ApproveTransfer { + #[codec(compact)] + pub id: approve_transfer::Id, + pub delegate: approve_transfer::Delegate, + #[codec(compact)] + pub amount: approve_transfer::Amount, + } + pub mod approve_transfer { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveTransfer { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "approve_transfer"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, Debug, )] #[decode_as_type( @@ -16413,30 +17046,35 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "As the controller of a recoverable account, close an active recovery"] - #[doc = "process for your account."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "Payment: By calling this function, the recoverable account will receive"] - #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = "Origin must be Signed and there must be an approval in place between signer and"] + #[doc = "`delegate`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account with an active recovery process for it."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] - pub struct CloseRecovery { - pub rescuer: close_recovery::Rescuer, + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = ""] + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct CancelApproval { + #[codec(compact)] + pub id: cancel_approval::Id, + pub delegate: cancel_approval::Delegate, } - pub mod close_recovery { + pub mod cancel_approval { use super::runtime_types; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CloseRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "close_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelApproval { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "cancel_approval"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16449,21 +17087,40 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] - #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] + #[doc = "account of the asset `id`."] #[doc = ""] - #[doc = "Payment: By calling this function the recoverable account will unreserve"] - #[doc = "their recovery configuration deposit."] - #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account (i.e. has a recovery configuration)."] - pub struct RemoveRecovery; - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "remove_recovery"; + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = ""] + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceCancelApproval { + #[codec(compact)] + pub id: force_cancel_approval::Id, + pub owner: force_cancel_approval::Owner, + pub delegate: force_cancel_approval::Delegate, + } + pub mod force_cancel_approval { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCancelApproval { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_cancel_approval"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16476,26 +17133,48 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] + #[doc = "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 = "Origin must be Signed and there must be an approval in place by the `owner` to the"] + #[doc = "signer."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] - pub struct CancelRecovered { - pub account: cancel_recovered::Account, + #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] + #[doc = "reserved by `approve_transfer` is unreserved."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] + #[doc = "from which the asset balance will be withdrawn."] + #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] + #[doc = "- `amount`: The amount of assets to transfer."] + #[doc = ""] + #[doc = "Emits `TransferredApproved` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct TransferApproved { + #[codec(compact)] + pub id: transfer_approved::Id, + pub owner: transfer_approved::Owner, + pub destination: transfer_approved::Destination, + #[codec(compact)] + pub amount: transfer_approved::Amount, } - pub mod cancel_recovered { + pub mod transfer_approved { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Destination = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "cancel_recovered"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferApproved { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer_approved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16508,3254 +17187,1299 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + #[doc = "Create an asset account for non-provider assets."] #[doc = ""] - #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] - #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = "Emits `Touched` event when successful."] + pub struct Touch { + #[codec(compact)] + pub id: touch::Id, + } + pub mod touch { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Touch { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "touch"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] + #[doc = "account."] #[doc = ""] - #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] - #[doc = "of the caller:"] - #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] - #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] - #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = "The origin must be Signed."] #[doc = ""] - #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] - #[doc = "account."] + #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] + #[doc = " refunded."] + #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] #[doc = ""] - #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Emits `DepositPoked` if any deposit is updated."] - #[doc = "Multiple events may be emitted in case both types of deposits are updated."] - pub struct PokeDeposit { - pub maybe_account: poke_deposit::MaybeAccount, + #[doc = "Emits `Refunded` event when successful."] + pub struct Refund { + #[codec(compact)] + pub id: refund::Id, + pub allow_burn: refund::AllowBurn, } - pub mod poke_deposit { + pub mod refund { use super::runtime_types; - pub type MaybeAccount = ::core::option::Option< - ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - >; + pub type Id = ::core::primitive::u32; + pub type AllowBurn = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PokeDeposit { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "poke_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Refund { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "refund"; } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Send a call through a recovered account."] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Sets the minimum balance of an asset."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "Only works if there aren't any accounts that are holding the asset or if"] + #[doc = "the new value of `min_balance` is less than the old one."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you want to make a call on-behalf-of."] - #[doc = "- `call`: The call you want to make with the recovered account."] - pub fn as_recovered( - &self, - account: types::as_recovered::Account, - call: types::as_recovered::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "as_recovered", - types::AsRecovered { - account, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 60u8, 61u8, 138u8, 19u8, 43u8, 218u8, 179u8, 117u8, 205u8, 143u8, - 128u8, 223u8, 96u8, 166u8, 90u8, 187u8, 255u8, 119u8, 238u8, 209u8, - 140u8, 58u8, 239u8, 44u8, 153u8, 196u8, 218u8, 155u8, 227u8, 228u8, - 210u8, 187u8, - ], - ) - } - #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] - #[doc = "for a lost account directly."] + #[doc = "Origin must be Signed and the sender has to be the Owner of the"] + #[doc = "asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _ROOT_."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `min_balance`: The new value of `min_balance`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The \"lost account\" to be recovered."] - #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] - pub fn set_recovered( - &self, - lost: types::set_recovered::Lost, - rescuer: types::set_recovered::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "set_recovered", - types::SetRecovered { lost, rescuer }, - [ - 194u8, 147u8, 14u8, 197u8, 132u8, 185u8, 122u8, 81u8, 61u8, 14u8, 10u8, - 177u8, 74u8, 184u8, 150u8, 217u8, 246u8, 149u8, 26u8, 165u8, 196u8, - 83u8, 230u8, 195u8, 213u8, 40u8, 51u8, 180u8, 23u8, 90u8, 3u8, 14u8, - ], - ) + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + pub struct SetMinBalance { + #[codec(compact)] + pub id: set_min_balance::Id, + pub min_balance: set_min_balance::MinBalance, } - #[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 fn create_recovery( - &self, - friends: types::create_recovery::Friends, - threshold: types::create_recovery::Threshold, - delay_period: types::create_recovery::DelayPeriod, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "create_recovery", - types::CreateRecovery { friends, threshold, delay_period }, - [ - 36u8, 175u8, 11u8, 85u8, 95u8, 170u8, 58u8, 193u8, 102u8, 18u8, 117u8, - 27u8, 199u8, 214u8, 70u8, 47u8, 129u8, 130u8, 109u8, 242u8, 240u8, - 255u8, 120u8, 176u8, 40u8, 243u8, 175u8, 71u8, 3u8, 91u8, 186u8, 220u8, - ], - ) + pub mod set_min_balance { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type MinBalance = ::core::primitive::u128; } - #[doc = "Initiate the process for recovering a recoverable account."] + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMinBalance { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "set_min_balance"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Create an asset account for `who`."] #[doc = ""] - #[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 = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "- `origin`: Must be Signed by `Freezer` or `Admin` of the asset `id`; the signer account"] + #[doc = " must have sufficient funds for a deposit to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] + #[doc = "- `who`: The account to be created."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to recover. This account needs to be"] - #[doc = " recoverable (i.e. have a recovery configuration)."] - pub fn initiate_recovery( - &self, - account: types::initiate_recovery::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "initiate_recovery", - types::InitiateRecovery { account }, - [ - 60u8, 243u8, 229u8, 176u8, 221u8, 52u8, 44u8, 224u8, 233u8, 14u8, 89u8, - 100u8, 174u8, 74u8, 38u8, 32u8, 97u8, 48u8, 53u8, 74u8, 30u8, 242u8, - 19u8, 114u8, 145u8, 74u8, 69u8, 125u8, 227u8, 214u8, 144u8, 58u8, - ], - ) + #[doc = "Emits `Touched` event when successful."] + pub struct TouchOther { + #[codec(compact)] + pub id: touch_other::Id, + pub who: touch_other::Who, } - #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] - #[doc = "process for that account."] + pub mod touch_other { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TouchOther { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "touch_other"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] - #[doc = "for the recoverable account."] + #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] + #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] + #[doc = "use `refund`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The lost account that you want to recover."] - #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `who`: The account to refund."] #[doc = ""] - #[doc = "The combination of these two parameters must point to an active recovery"] - #[doc = "process."] - pub fn vouch_recovery( - &self, - lost: types::vouch_recovery::Lost, - rescuer: types::vouch_recovery::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "vouch_recovery", - types::VouchRecovery { lost, rescuer }, - [ - 97u8, 190u8, 60u8, 15u8, 191u8, 117u8, 1u8, 217u8, 62u8, 40u8, 210u8, - 1u8, 237u8, 111u8, 48u8, 196u8, 180u8, 154u8, 198u8, 12u8, 108u8, 42u8, - 6u8, 234u8, 2u8, 113u8, 163u8, 111u8, 80u8, 146u8, 6u8, 73u8, - ], - ) + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] + #[doc = ""] + #[doc = "Emits `Refunded` event when successful."] + pub struct RefundOther { + #[codec(compact)] + pub id: refund_other::Id, + pub who: refund_other::Who, } - #[doc = "Allow a successful rescuer to claim their recovered account."] + pub mod refund_other { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundOther { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "refund_other"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] - #[doc = "who has successfully completed the account recovery process: collected"] - #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] - #[doc = " you."] - pub fn claim_recovery( - &self, - account: types::claim_recovery::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "claim_recovery", - types::ClaimRecovery { account }, - [ - 41u8, 47u8, 162u8, 88u8, 13u8, 166u8, 130u8, 146u8, 218u8, 162u8, - 166u8, 33u8, 89u8, 129u8, 177u8, 178u8, 68u8, 128u8, 161u8, 229u8, - 207u8, 3u8, 57u8, 35u8, 211u8, 208u8, 74u8, 155u8, 183u8, 173u8, 74u8, - 56u8, - ], - ) - } - #[doc = "As the controller of a recoverable account, close an active recovery"] - #[doc = "process for your account."] + #[doc = "- `id`: The identifier of the account's asset."] + #[doc = "- `who`: The account to be unblocked."] #[doc = ""] - #[doc = "Payment: By calling this function, the recoverable account will receive"] - #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = "Emits `Blocked`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account with an active recovery process for it."] + #[doc = "Weight: `O(1)`"] + pub struct Block { + #[codec(compact)] + pub id: block::Id, + pub who: block::Who, + } + pub mod block { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Block { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "block"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Transfer the entire transferable balance from the caller asset account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] + #[doc = " (false), or transfer everything except at least the minimum balance, which will"] + #[doc = " guarantee to keep the sender asset account alive (true)."] + pub struct TransferAll { + #[codec(compact)] + pub id: transfer_all::Id, + pub dest: transfer_all::Dest, + pub keep_alive: transfer_all::KeepAlive, + } + pub mod transfer_all { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type KeepAlive = ::core::primitive::bool; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAll { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer_all"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Issue a new class of fungible assets from a public origin."] + #[doc = ""] + #[doc = "This new asset class has no assets initially and its owner is the origin."] + #[doc = ""] + #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] + #[doc = ""] + #[doc = "Funds of sender are reserved by `AssetDeposit`."] #[doc = ""] #[doc = "Parameters:"] - #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] - pub fn close_recovery( + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] + #[doc = "member of the asset class's admin team."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `Created` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn create( &self, - rescuer: types::close_recovery::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + id: types::create::Id, + admin: types::create::Admin, + min_balance: types::create::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "close_recovery", - types::CloseRecovery { rescuer }, + "Assets", + "create", + types::Create { id, admin, min_balance }, [ - 161u8, 178u8, 117u8, 209u8, 119u8, 164u8, 135u8, 41u8, 25u8, 108u8, - 194u8, 175u8, 221u8, 65u8, 184u8, 137u8, 171u8, 97u8, 204u8, 61u8, - 159u8, 39u8, 192u8, 53u8, 246u8, 69u8, 113u8, 16u8, 170u8, 232u8, - 163u8, 10u8, + 120u8, 25u8, 99u8, 39u8, 102u8, 201u8, 14u8, 2u8, 32u8, 139u8, 206u8, + 218u8, 223u8, 161u8, 25u8, 98u8, 159u8, 133u8, 65u8, 105u8, 45u8, 4u8, + 28u8, 49u8, 248u8, 147u8, 2u8, 179u8, 11u8, 195u8, 177u8, 250u8, ], ) } - #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = "Issue a new class of fungible assets from a privileged origin."] #[doc = ""] - #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] - #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = "This new asset class has no assets initially."] #[doc = ""] - #[doc = "Payment: By calling this function the recoverable account will unreserve"] - #[doc = "their recovery configuration deposit."] - #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = "The origin must conform to `ForceOrigin`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account (i.e. has a recovery configuration)."] - pub fn remove_recovery( + #[doc = "Unlike `create`, no funds are reserved."] + #[doc = ""] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] + #[doc = "over this asset, but may later change and configure the permissions using"] + #[doc = "`transfer_ownership` and `set_team`."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `ForceCreated` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn force_create( &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + id: types::force_create::Id, + owner: types::force_create::Owner, + is_sufficient: types::force_create::IsSufficient, + min_balance: types::force_create::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "remove_recovery", - types::RemoveRecovery {}, + "Assets", + "force_create", + types::ForceCreate { id, owner, is_sufficient, min_balance }, [ - 11u8, 38u8, 133u8, 172u8, 212u8, 252u8, 57u8, 216u8, 42u8, 202u8, - 206u8, 91u8, 115u8, 91u8, 242u8, 123u8, 95u8, 196u8, 172u8, 243u8, - 164u8, 1u8, 69u8, 180u8, 40u8, 68u8, 208u8, 221u8, 161u8, 250u8, 8u8, - 72u8, + 149u8, 41u8, 54u8, 146u8, 18u8, 248u8, 84u8, 52u8, 202u8, 88u8, 192u8, + 208u8, 247u8, 227u8, 254u8, 98u8, 92u8, 46u8, 164u8, 152u8, 143u8, + 20u8, 179u8, 227u8, 197u8, 247u8, 242u8, 153u8, 142u8, 148u8, 40u8, + 184u8, ], ) } - #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = "Start the process of destroying a fungible asset class."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] + #[doc = "destruction of an asset class."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] - pub fn cancel_recovered( + #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "an account contains holds or freezes in place."] + pub fn start_destroy( &self, - account: types::cancel_recovered::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + id: types::start_destroy::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "cancel_recovered", - types::CancelRecovered { account }, + "Assets", + "start_destroy", + types::StartDestroy { id }, [ - 100u8, 222u8, 80u8, 226u8, 187u8, 188u8, 111u8, 58u8, 190u8, 5u8, - 178u8, 144u8, 37u8, 98u8, 71u8, 145u8, 28u8, 248u8, 222u8, 188u8, 53u8, - 21u8, 127u8, 176u8, 249u8, 166u8, 250u8, 59u8, 170u8, 33u8, 251u8, - 239u8, + 125u8, 82u8, 151u8, 106u8, 25u8, 49u8, 68u8, 203u8, 247u8, 175u8, + 117u8, 230u8, 84u8, 98u8, 172u8, 73u8, 233u8, 218u8, 212u8, 198u8, + 69u8, 35u8, 15u8, 179u8, 161u8, 205u8, 190u8, 109u8, 198u8, 214u8, + 65u8, 164u8, ], ) } - #[doc = "Poke deposits for recovery configurations and / or active recoveries."] - #[doc = ""] - #[doc = "This can be used by accounts to possibly lower their locked amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] - #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = "Destroy all accounts associated with a given asset."] #[doc = ""] - #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] - #[doc = "of the caller:"] - #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] - #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] - #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] - #[doc = "account."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] #[doc = ""] - #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Emits `DepositPoked` if any deposit is updated."] - #[doc = "Multiple events may be emitted in case both types of deposits are updated."] - pub fn poke_deposit( + #[doc = "Each call emits the `Event::DestroyedAccounts` event."] + pub fn destroy_accounts( &self, - maybe_account: types::poke_deposit::MaybeAccount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::destroy_accounts::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "poke_deposit", - types::PokeDeposit { maybe_account }, + "Assets", + "destroy_accounts", + types::DestroyAccounts { id }, [ - 177u8, 98u8, 53u8, 15u8, 228u8, 36u8, 173u8, 55u8, 125u8, 3u8, 234u8, - 70u8, 147u8, 147u8, 124u8, 86u8, 31u8, 101u8, 171u8, 56u8, 148u8, - 180u8, 87u8, 149u8, 11u8, 113u8, 195u8, 35u8, 56u8, 32u8, 251u8, 56u8, + 236u8, 102u8, 233u8, 170u8, 179u8, 46u8, 42u8, 29u8, 200u8, 116u8, + 62u8, 114u8, 233u8, 59u8, 217u8, 215u8, 109u8, 232u8, 147u8, 95u8, + 255u8, 248u8, 119u8, 222u8, 216u8, 165u8, 138u8, 47u8, 28u8, 56u8, + 204u8, 93u8, ], ) } - } - } - #[doc = "Events type."] - pub type Event = runtime_types::pallet_recovery::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been set up for an account."] - pub struct RecoveryCreated { - pub account: recovery_created::Account, - } - pub mod recovery_created { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryCreated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryCreated"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been initiated for lost account by rescuer account."] - pub struct RecoveryInitiated { - pub lost_account: recovery_initiated::LostAccount, - pub rescuer_account: recovery_initiated::RescuerAccount, - } - pub mod recovery_initiated { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryInitiated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryInitiated"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process for lost account by rescuer account has been vouched for by sender."] - pub struct RecoveryVouched { - pub lost_account: recovery_vouched::LostAccount, - pub rescuer_account: recovery_vouched::RescuerAccount, - pub sender: recovery_vouched::Sender, - } - pub mod recovery_vouched { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Sender = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryVouched { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryVouched"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process for lost account by rescuer account has been closed."] - pub struct RecoveryClosed { - pub lost_account: recovery_closed::LostAccount, - pub rescuer_account: recovery_closed::RescuerAccount, - } - pub mod recovery_closed { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryClosed { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryClosed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Lost account has been successfully recovered by rescuer account."] - pub struct AccountRecovered { - pub lost_account: account_recovered::LostAccount, - pub rescuer_account: account_recovered::RescuerAccount, - } - pub mod account_recovered { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for AccountRecovered { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "AccountRecovered"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been removed for an account."] - pub struct RecoveryRemoved { - pub lost_account: recovery_removed::LostAccount, - } - pub mod recovery_removed { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryRemoved { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryRemoved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A deposit has been updated."] - pub struct DepositPoked { - pub who: deposit_poked::Who, - pub kind: deposit_poked::Kind, - pub old_deposit: deposit_poked::OldDeposit, - pub new_deposit: deposit_poked::NewDeposit, - } - pub mod deposit_poked { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Kind = runtime_types::pallet_recovery::DepositKind< - runtime_types::quantus_runtime::Runtime, - >; - pub type OldDeposit = ::core::primitive::u128; - pub type NewDeposit = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "DepositPoked"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod recoverable { - use super::runtime_types; - pub type Recoverable = runtime_types::pallet_recovery::RecoveryConfig< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod active_recoveries { - use super::runtime_types; - pub type ActiveRecoveries = runtime_types::pallet_recovery::ActiveRecovery< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod proxy { - use super::runtime_types; - pub type Proxy = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " The set of recoverable accounts and their recovery configuration."] - pub fn recoverable_iter( + #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] + #[doc = ""] + #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] + #[doc = ""] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each call emits the `Event::DestroyedApprovals` event."] + pub fn destroy_approvals( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::recoverable::Recoverable, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Recoverable", - (), + id: types::destroy_approvals::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "destroy_approvals", + types::DestroyApprovals { id }, [ - 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, - 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, - 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, + 34u8, 35u8, 15u8, 44u8, 239u8, 232u8, 88u8, 130u8, 130u8, 87u8, 171u8, + 255u8, 247u8, 179u8, 14u8, 35u8, 47u8, 223u8, 32u8, 232u8, 41u8, 105u8, + 207u8, 199u8, 90u8, 136u8, 144u8, 139u8, 252u8, 76u8, 177u8, 106u8, ], ) } - #[doc = " The set of recoverable accounts and their recovery configuration."] - pub fn recoverable( + #[doc = "Complete destroying asset and unreserve currency."] + #[doc = ""] + #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] + #[doc = "hand."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each successful call emits the `Event::Destroyed` event."] + pub fn finish_destroy( &self, - _0: types::recoverable::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::recoverable::Param0, - >, - types::recoverable::Recoverable, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Recoverable", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + id: types::finish_destroy::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "finish_destroy", + types::FinishDestroy { id }, [ - 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, - 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, - 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, + 132u8, 67u8, 78u8, 84u8, 240u8, 51u8, 176u8, 119u8, 48u8, 34u8, 153u8, + 37u8, 25u8, 171u8, 21u8, 164u8, 53u8, 214u8, 36u8, 149u8, 20u8, 240u8, + 123u8, 195u8, 170u8, 162u8, 118u8, 81u8, 176u8, 218u8, 114u8, 113u8, ], ) } - #[doc = " Active recovery attempts."] + #[doc = "Mint assets of a particular class."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries_iter( + #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount minted."] + #[doc = "- `beneficiary`: The account to be credited with the minted assets."] + #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = ""] + #[doc = "Emits `Issued` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] + pub fn mint( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::active_recoveries::ActiveRecoveries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - (), + id: types::mint::Id, + beneficiary: types::mint::Beneficiary, + amount: types::mint::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "mint", + types::Mint { id, beneficiary, amount }, [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, + 172u8, 131u8, 103u8, 81u8, 206u8, 2u8, 143u8, 114u8, 137u8, 60u8, + 147u8, 67u8, 226u8, 64u8, 71u8, 11u8, 36u8, 145u8, 51u8, 8u8, 0u8, + 110u8, 8u8, 195u8, 103u8, 205u8, 156u8, 43u8, 215u8, 12u8, 150u8, + 135u8, ], ) } - #[doc = " Active recovery attempts."] + #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries_iter1( + #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] + #[doc = ""] + #[doc = "Bails with `NoAccount` if the `who` is already dead."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount burned."] + #[doc = "- `who`: The account to be debited from."] + #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = ""] + #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] + #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] + pub fn burn( &self, - _0: types::active_recoveries::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param0, - >, - types::active_recoveries::ActiveRecoveries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + id: types::burn::Id, + who: types::burn::Who, + amount: types::burn::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "burn", + types::Burn { id, who, amount }, [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, + 105u8, 133u8, 82u8, 100u8, 124u8, 65u8, 174u8, 31u8, 152u8, 45u8, 23u8, + 200u8, 23u8, 199u8, 239u8, 8u8, 187u8, 142u8, 21u8, 192u8, 35u8, 211u8, + 172u8, 130u8, 169u8, 74u8, 167u8, 36u8, 149u8, 7u8, 19u8, 37u8, ], ) } - #[doc = " Active recovery attempts."] + #[doc = "Move some assets from the sender account to another."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries( + #[doc = "Origin must be Signed."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] + #[doc = ""] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub fn transfer( &self, - _0: types::active_recoveries::Param0, - _1: types::active_recoveries::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param1, - >, - ), - types::active_recoveries::ActiveRecoveries, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + id: types::transfer::Id, + target: types::transfer::Target, + amount: types::transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer", + types::Transfer { id, target, amount }, [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, + 126u8, 31u8, 70u8, 179u8, 222u8, 190u8, 12u8, 19u8, 94u8, 225u8, 217u8, + 109u8, 54u8, 69u8, 124u8, 61u8, 97u8, 199u8, 193u8, 166u8, 39u8, 143u8, + 125u8, 251u8, 87u8, 173u8, 149u8, 91u8, 182u8, 18u8, 184u8, 65u8, ], ) } - #[doc = " The list of allowed proxy accounts."] + #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] #[doc = ""] - #[doc = " Map from the user who can access it to the recovered account."] - pub fn proxy_iter( + #[doc = "Origin must be Signed."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] + #[doc = ""] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub fn transfer_keep_alive( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proxy::Proxy, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Proxy", - (), + id: types::transfer_keep_alive::Id, + target: types::transfer_keep_alive::Target, + amount: types::transfer_keep_alive::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer_keep_alive", + types::TransferKeepAlive { id, target, amount }, [ - 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, - 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, - 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, + 99u8, 101u8, 219u8, 188u8, 238u8, 230u8, 141u8, 43u8, 38u8, 175u8, + 46u8, 89u8, 33u8, 23u8, 223u8, 115u8, 108u8, 18u8, 190u8, 213u8, 157u8, + 12u8, 139u8, 97u8, 7u8, 75u8, 196u8, 159u8, 122u8, 32u8, 164u8, 154u8, ], ) } - #[doc = " The list of allowed proxy accounts."] + #[doc = "Move some assets from one account to another."] #[doc = ""] - #[doc = " Map from the user who can access it to the recovered account."] - pub fn proxy( + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `source`: The account to be debited."] + #[doc = "- `dest`: The account to be credited."] + #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] + #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] + #[doc = "below the minimum balance. Must be greater than zero."] + #[doc = ""] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] + #[doc = "`dest`."] + pub fn force_transfer( &self, - _0: types::proxy::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proxy::Param0, - >, - types::proxy::Proxy, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Proxy", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + id: types::force_transfer::Id, + source: types::force_transfer::Source, + dest: types::force_transfer::Dest, + amount: types::force_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_transfer", + types::ForceTransfer { id, source, dest, amount }, [ - 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, - 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, - 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, + 10u8, 210u8, 8u8, 209u8, 8u8, 78u8, 40u8, 213u8, 235u8, 176u8, 144u8, + 145u8, 70u8, 13u8, 75u8, 72u8, 166u8, 137u8, 22u8, 191u8, 226u8, 244u8, + 92u8, 183u8, 129u8, 212u8, 158u8, 179u8, 169u8, 232u8, 177u8, 225u8, ], ) } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The base amount of currency needed to reserve for creating a recovery configuration."] + #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] + #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] + #[doc = "account that does not have an entry, use `touch_other` first."] #[doc = ""] - #[doc = " This is held for an additional storage item whose value size is"] - #[doc = " `2 + sizeof(BlockNumber, Balance)` bytes."] - pub fn config_deposit_base( + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be frozen."] + #[doc = ""] + #[doc = "Emits `Frozen`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn freeze( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "ConfigDepositBase", + id: types::freeze::Id, + who: types::freeze::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "freeze", + types::Freeze { id, who }, [ - 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, + 180u8, 124u8, 252u8, 66u8, 205u8, 23u8, 32u8, 217u8, 173u8, 10u8, 91u8, + 57u8, 44u8, 215u8, 234u8, 152u8, 115u8, 38u8, 141u8, 212u8, 57u8, + 217u8, 169u8, 61u8, 215u8, 130u8, 172u8, 58u8, 90u8, 193u8, 25u8, + 249u8, ], ) } - #[doc = " The amount of currency needed per additional user when creating a recovery"] - #[doc = " configuration."] + #[doc = "Allow unprivileged transfers to and from an account again."] #[doc = ""] - #[doc = " This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage"] - #[doc = " value."] - pub fn friend_deposit_factor( + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be unfrozen."] + #[doc = ""] + #[doc = "Emits `Thawed`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn thaw( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "FriendDepositFactor", + id: types::thaw::Id, + who: types::thaw::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "thaw", + types::Thaw { id, who }, [ - 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, + 187u8, 130u8, 9u8, 152u8, 231u8, 9u8, 245u8, 162u8, 115u8, 19u8, 73u8, + 176u8, 16u8, 230u8, 30u8, 60u8, 180u8, 183u8, 154u8, 160u8, 72u8, + 219u8, 116u8, 57u8, 140u8, 6u8, 105u8, 38u8, 98u8, 90u8, 250u8, 135u8, ], ) } - #[doc = " The maximum amount of friends allowed in a recovery configuration."] + #[doc = "Disallow further unprivileged transfers for the asset class."] #[doc = ""] - #[doc = " NOTE: The threshold programmed in this Pallet uses u16, so it does"] - #[doc = " not really make sense to have a limit here greater than u16::MAX."] - #[doc = " But also, that is a lot more than you should probably set this value"] - #[doc = " to anyway..."] - pub fn max_friends( + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = ""] + #[doc = "Emits `Frozen`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn freeze_asset( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "MaxFriends", + id: types::freeze_asset::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "freeze_asset", + types::FreezeAsset { id }, [ - 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, + 75u8, 237u8, 183u8, 112u8, 112u8, 123u8, 250u8, 203u8, 169u8, 51u8, + 218u8, 35u8, 159u8, 23u8, 21u8, 10u8, 167u8, 84u8, 161u8, 212u8, 124u8, + 236u8, 88u8, 175u8, 48u8, 195u8, 33u8, 145u8, 141u8, 156u8, 31u8, + 250u8, ], ) } - #[doc = " The base amount of currency needed to reserve for starting a recovery."] + #[doc = "Allow unprivileged transfers for the asset again."] #[doc = ""] - #[doc = " This is primarily held for deterring malicious recovery attempts, and should"] - #[doc = " have a value large enough that a bad actor would choose not to place this"] - #[doc = " deposit. It also acts to fund additional storage item whose value size is"] - #[doc = " `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable"] - #[doc = " threshold."] - pub fn recovery_deposit( + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to be thawed."] + #[doc = ""] + #[doc = "Emits `Thawed`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn thaw_asset( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "RecoveryDeposit", + id: types::thaw_asset::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "thaw_asset", + types::ThawAsset { id }, [ - 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, + 151u8, 6u8, 170u8, 114u8, 55u8, 8u8, 5u8, 194u8, 251u8, 78u8, 232u8, + 181u8, 157u8, 62u8, 16u8, 39u8, 79u8, 119u8, 205u8, 198u8, 199u8, 26u8, + 92u8, 162u8, 169u8, 173u8, 93u8, 51u8, 7u8, 79u8, 198u8, 77u8, ], ) } - } - } - } - pub mod assets { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_assets::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_assets::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Issue a new class of fungible assets from a public origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially and its owner is the origin."] - #[doc = ""] - #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] + #[doc = "Change the Owner of an asset."] #[doc = ""] - #[doc = "Funds of sender are reserved by `AssetDeposit`."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] - #[doc = "member of the asset class's admin team."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] #[doc = ""] - #[doc = "Emits `Created` event when successful."] + #[doc = "Emits `OwnerChanged`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct Create { - #[codec(compact)] - pub id: create::Id, - pub admin: create::Admin, - pub min_balance: create::MinBalance, - } - pub mod create { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MinBalance = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Create { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "create"; + pub fn transfer_ownership( + &self, + id: types::transfer_ownership::Id, + owner: types::transfer_ownership::Owner, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer_ownership", + types::TransferOwnership { id, owner }, + [ + 65u8, 85u8, 40u8, 202u8, 212u8, 170u8, 130u8, 132u8, 140u8, 90u8, 68u8, + 28u8, 101u8, 154u8, 222u8, 150u8, 244u8, 165u8, 44u8, 22u8, 225u8, + 152u8, 7u8, 162u8, 110u8, 54u8, 173u8, 181u8, 54u8, 215u8, 105u8, + 239u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Issue a new class of fungible assets from a privileged origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially."] - #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin`."] + #[doc = "Change the Issuer, Admin and Freezer of an asset."] #[doc = ""] - #[doc = "Unlike `create`, no funds are reserved."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] - #[doc = "over this asset, but may later change and configure the permissions using"] - #[doc = "`transfer_ownership` and `set_team`."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = ""] - #[doc = "Emits `ForceCreated` event when successful."] + #[doc = "Emits `TeamChanged`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceCreate { - #[codec(compact)] - pub id: force_create::Id, - pub owner: force_create::Owner, - pub is_sufficient: force_create::IsSufficient, - #[codec(compact)] - pub min_balance: force_create::MinBalance, - } - pub mod force_create { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type IsSufficient = ::core::primitive::bool; - pub type MinBalance = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCreate { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_create"; + pub fn set_team( + &self, + id: types::set_team::Id, + issuer: types::set_team::Issuer, + admin: types::set_team::Admin, + freezer: types::set_team::Freezer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "set_team", + types::SetTeam { id, issuer, admin, freezer }, + [ + 52u8, 75u8, 50u8, 30u8, 164u8, 161u8, 121u8, 25u8, 135u8, 83u8, 115u8, + 25u8, 103u8, 1u8, 124u8, 206u8, 83u8, 182u8, 41u8, 116u8, 44u8, 37u8, + 75u8, 70u8, 252u8, 225u8, 240u8, 144u8, 96u8, 160u8, 151u8, 4u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Start the process of destroying a fungible asset class."] + #[doc = "Set the metadata for an asset."] #[doc = ""] - #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] - #[doc = "destruction of an asset class."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] + #[doc = "Funds of sender are reserved according to the formula:"] + #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] + #[doc = "account any already reserved funds."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "an account contains holds or freezes in place."] - pub struct StartDestroy { - #[codec(compact)] - pub id: start_destroy::Id, - } - pub mod start_destroy { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for StartDestroy { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "start_destroy"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Destroy all accounts associated with a given asset."] + #[doc = "Emits `MetadataSet`."] #[doc = ""] - #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Weight: `O(1)`"] + pub fn set_metadata( + &self, + id: types::set_metadata::Id, + name: types::set_metadata::Name, + symbol: types::set_metadata::Symbol, + decimals: types::set_metadata::Decimals, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "set_metadata", + types::SetMetadata { id, name, symbol, decimals }, + [ + 215u8, 66u8, 15u8, 17u8, 88u8, 174u8, 77u8, 75u8, 229u8, 155u8, 160u8, + 34u8, 108u8, 194u8, 88u8, 238u8, 131u8, 97u8, 234u8, 102u8, 71u8, 56u8, + 70u8, 248u8, 211u8, 85u8, 72u8, 92u8, 71u8, 222u8, 190u8, 91u8, + ], + ) + } + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "Any deposit is freed for the asset owner."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedAccounts` event."] - pub struct DestroyAccounts { - #[codec(compact)] - pub id: destroy_accounts::Id, - } - pub mod destroy_accounts { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyAccounts { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "destroy_accounts"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] + #[doc = "- `id`: The identifier of the asset to clear."] #[doc = ""] - #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Emits `MetadataCleared`."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] + #[doc = "Weight: `O(1)`"] + pub fn clear_metadata( + &self, + id: types::clear_metadata::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "clear_metadata", + types::ClearMetadata { id }, + [ + 68u8, 172u8, 6u8, 158u8, 237u8, 254u8, 22u8, 4u8, 254u8, 157u8, 179u8, + 168u8, 105u8, 114u8, 56u8, 166u8, 213u8, 38u8, 188u8, 195u8, 99u8, + 43u8, 142u8, 220u8, 94u8, 248u8, 51u8, 226u8, 233u8, 114u8, 86u8, 93u8, + ], + ) + } + #[doc = "Force the metadata for an asset to some value."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedApprovals` event."] - pub struct DestroyApprovals { - #[codec(compact)] - pub id: destroy_approvals::Id, - } - pub mod destroy_approvals { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyApprovals { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "destroy_approvals"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Complete destroying asset and unreserve currency."] + #[doc = "Any deposit is left alone."] #[doc = ""] - #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] - #[doc = "hand."] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "Emits `MetadataSet`."] #[doc = ""] - #[doc = "Each successful call emits the `Event::Destroyed` event."] - pub struct FinishDestroy { - #[codec(compact)] - pub id: finish_destroy::Id, - } - pub mod finish_destroy { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FinishDestroy { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "finish_destroy"; + #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] + pub fn force_set_metadata( + &self, + id: types::force_set_metadata::Id, + name: types::force_set_metadata::Name, + symbol: types::force_set_metadata::Symbol, + decimals: types::force_set_metadata::Decimals, + is_frozen: types::force_set_metadata::IsFrozen, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_set_metadata", + types::ForceSetMetadata { id, name, symbol, decimals, is_frozen }, + [ + 76u8, 90u8, 182u8, 13u8, 133u8, 248u8, 94u8, 136u8, 169u8, 114u8, + 151u8, 20u8, 106u8, 89u8, 78u8, 228u8, 22u8, 29u8, 68u8, 8u8, 54u8, + 47u8, 1u8, 186u8, 45u8, 167u8, 14u8, 112u8, 34u8, 43u8, 91u8, 140u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Mint assets of a particular class."] + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount minted."] - #[doc = "- `beneficiary`: The account to be credited with the minted assets."] - #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = "Any deposit is returned."] #[doc = ""] - #[doc = "Emits `Issued` event when successful."] + #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] - pub struct Mint { - #[codec(compact)] - pub id: mint::Id, - pub beneficiary: mint::Beneficiary, - #[codec(compact)] - pub amount: mint::Amount, - } - pub mod mint { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Mint { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "mint"; + pub fn force_clear_metadata( + &self, + id: types::force_clear_metadata::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_clear_metadata", + types::ForceClearMetadata { id }, + [ + 2u8, 224u8, 84u8, 48u8, 130u8, 132u8, 79u8, 38u8, 217u8, 17u8, 165u8, + 139u8, 89u8, 53u8, 116u8, 184u8, 32u8, 91u8, 122u8, 39u8, 85u8, 40u8, + 213u8, 216u8, 135u8, 171u8, 50u8, 69u8, 202u8, 28u8, 166u8, 147u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] + #[doc = "Alter the attributes of a given asset."] #[doc = ""] - #[doc = "Bails with `NoAccount` if the `who` is already dead."] + #[doc = "Origin must be `ForceOrigin`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount burned."] - #[doc = "- `who`: The account to be debited from."] - #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] + #[doc = "value to account for the state bloat associated with its balance storage. If set to"] + #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] + #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] + #[doc = "growth)."] + #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] + #[doc = "instructions."] #[doc = ""] - #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] - #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] #[doc = ""] #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] - pub struct Burn { - #[codec(compact)] - pub id: burn::Id, - pub who: burn::Who, - #[codec(compact)] - pub amount: burn::Amount, - } - pub mod burn { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Burn { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "burn"; + pub fn force_asset_status( + &self, + id: types::force_asset_status::Id, + owner: types::force_asset_status::Owner, + issuer: types::force_asset_status::Issuer, + admin: types::force_asset_status::Admin, + freezer: types::force_asset_status::Freezer, + min_balance: types::force_asset_status::MinBalance, + is_sufficient: types::force_asset_status::IsSufficient, + is_frozen: types::force_asset_status::IsFrozen, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_asset_status", + types::ForceAssetStatus { + id, + owner, + issuer, + admin, + freezer, + min_balance, + is_sufficient, + is_frozen, + }, + [ + 149u8, 136u8, 250u8, 33u8, 53u8, 220u8, 207u8, 187u8, 42u8, 118u8, + 93u8, 173u8, 100u8, 243u8, 234u8, 207u8, 88u8, 45u8, 79u8, 221u8, + 113u8, 166u8, 229u8, 171u8, 223u8, 126u8, 20u8, 67u8, 19u8, 77u8, 44u8, + 19u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Move some assets from the sender account to another."] + #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] #[doc = ""] #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] + #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] + #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] + #[doc = "meet the right value."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] + #[doc = "making this call."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account to delegate permission to transfer asset."] + #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] + #[doc = "already an approval in place, then this acts additively."] + #[doc = ""] + #[doc = "Emits `ApprovedTransfer` on success."] #[doc = ""] #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub struct Transfer { - #[codec(compact)] - pub id: transfer::Id, - pub target: transfer::Target, - #[codec(compact)] - pub amount: transfer::Amount, - } - pub mod transfer { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Transfer { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer"; + pub fn approve_transfer( + &self, + id: types::approve_transfer::Id, + delegate: types::approve_transfer::Delegate, + amount: types::approve_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "approve_transfer", + types::ApproveTransfer { id, delegate, amount }, + [ + 39u8, 227u8, 23u8, 143u8, 10u8, 120u8, 227u8, 1u8, 223u8, 78u8, 40u8, + 213u8, 249u8, 175u8, 170u8, 183u8, 10u8, 244u8, 117u8, 111u8, 140u8, + 157u8, 153u8, 212u8, 94u8, 119u8, 213u8, 44u8, 41u8, 8u8, 114u8, 200u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "Origin must be Signed and there must be an approval in place between signer and"] + #[doc = "`delegate`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = ""] + #[doc = "Emits `ApprovalCancelled` on success."] #[doc = ""] #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub struct TransferKeepAlive { - #[codec(compact)] - pub id: transfer_keep_alive::Id, - pub target: transfer_keep_alive::Target, - #[codec(compact)] - pub amount: transfer_keep_alive::Amount, + pub fn cancel_approval( + &self, + id: types::cancel_approval::Id, + delegate: types::cancel_approval::Delegate, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "cancel_approval", + types::CancelApproval { id, delegate }, + [ + 74u8, 117u8, 101u8, 78u8, 152u8, 208u8, 16u8, 102u8, 34u8, 195u8, 61u8, + 36u8, 85u8, 91u8, 253u8, 182u8, 61u8, 199u8, 12u8, 102u8, 149u8, 20u8, + 238u8, 207u8, 236u8, 50u8, 63u8, 249u8, 34u8, 85u8, 88u8, 229u8, + ], + ) } - pub mod transfer_keep_alive { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_keep_alive"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Move some assets from one account to another."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] + #[doc = "account of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `source`: The account to be debited."] - #[doc = "- `dest`: The account to be credited."] - #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] - #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] - #[doc = "below the minimum balance. Must be greater than zero."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = ""] + #[doc = "Emits `ApprovalCancelled` on success."] #[doc = ""] #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] - #[doc = "`dest`."] - pub struct ForceTransfer { - #[codec(compact)] - pub id: force_transfer::Id, - pub source: force_transfer::Source, - pub dest: force_transfer::Dest, - #[codec(compact)] - pub amount: force_transfer::Amount, - } - pub mod force_transfer { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceTransfer { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_transfer"; + pub fn force_cancel_approval( + &self, + id: types::force_cancel_approval::Id, + owner: types::force_cancel_approval::Owner, + delegate: types::force_cancel_approval::Delegate, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_cancel_approval", + types::ForceCancelApproval { id, owner, delegate }, + [ + 27u8, 231u8, 85u8, 241u8, 18u8, 151u8, 64u8, 234u8, 11u8, 84u8, 252u8, + 128u8, 44u8, 247u8, 132u8, 82u8, 34u8, 210u8, 202u8, 50u8, 158u8, 45u8, + 239u8, 192u8, 7u8, 24u8, 39u8, 95u8, 57u8, 21u8, 178u8, 113u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] - #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] - #[doc = "account that does not have an entry, use `touch_other` first."] + #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] + #[doc = "account."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] + #[doc = "signer."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be frozen."] + #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] + #[doc = "reserved by `approve_transfer` is unreserved."] #[doc = ""] - #[doc = "Emits `Frozen`."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] + #[doc = "from which the asset balance will be withdrawn."] + #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] + #[doc = "- `amount`: The amount of assets to transfer."] + #[doc = ""] + #[doc = "Emits `TransferredApproved` on success."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct Freeze { - #[codec(compact)] - pub id: freeze::Id, - pub who: freeze::Who, - } - pub mod freeze { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub fn transfer_approved( + &self, + id: types::transfer_approved::Id, + owner: types::transfer_approved::Owner, + destination: types::transfer_approved::Destination, + amount: types::transfer_approved::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer_approved", + types::TransferApproved { id, owner, destination, amount }, + [ + 214u8, 51u8, 243u8, 129u8, 116u8, 233u8, 199u8, 183u8, 25u8, 5u8, + 109u8, 85u8, 255u8, 68u8, 36u8, 99u8, 99u8, 179u8, 34u8, 66u8, 65u8, + 82u8, 189u8, 174u8, 22u8, 100u8, 211u8, 13u8, 178u8, 19u8, 128u8, + 177u8, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Freeze { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "freeze"; + #[doc = "Create an asset account for non-provider assets."] + #[doc = ""] + #[doc = "A deposit will be taken from the signer account."] + #[doc = ""] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] + #[doc = ""] + #[doc = "Emits `Touched` event when successful."] + pub fn touch( + &self, + id: types::touch::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "touch", + types::Touch { id }, + [ + 50u8, 185u8, 46u8, 134u8, 136u8, 31u8, 191u8, 34u8, 215u8, 150u8, 73u8, + 103u8, 140u8, 36u8, 95u8, 156u8, 201u8, 152u8, 32u8, 165u8, 47u8, 86u8, + 163u8, 255u8, 8u8, 251u8, 176u8, 138u8, 165u8, 48u8, 12u8, 27u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allow unprivileged transfers to and from an account again."] + #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] + #[doc = "account."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "The origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be unfrozen."] + #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] + #[doc = " refunded."] + #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] #[doc = ""] - #[doc = "Emits `Thawed`."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct Thaw { - #[codec(compact)] - pub id: thaw::Id, - pub who: thaw::Who, - } - pub mod thaw { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Thaw { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "thaw"; + #[doc = "Emits `Refunded` event when successful."] + pub fn refund( + &self, + id: types::refund::Id, + allow_burn: types::refund::AllowBurn, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "refund", + types::Refund { id, allow_burn }, + [ + 218u8, 207u8, 8u8, 41u8, 154u8, 250u8, 117u8, 174u8, 143u8, 133u8, + 34u8, 113u8, 171u8, 18u8, 177u8, 227u8, 146u8, 92u8, 12u8, 226u8, + 101u8, 230u8, 246u8, 162u8, 32u8, 73u8, 138u8, 158u8, 95u8, 226u8, + 75u8, 95u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Disallow further unprivileged transfers for the asset class."] + #[doc = "Sets the minimum balance of an asset."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = "Only works if there aren't any accounts that are holding the asset or if"] + #[doc = "the new value of `min_balance` is less than the old one."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "Origin must be Signed and the sender has to be the Owner of the"] + #[doc = "asset `id`."] #[doc = ""] - #[doc = "Emits `Frozen`."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `min_balance`: The new value of `min_balance`."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct FreezeAsset { - #[codec(compact)] - pub id: freeze_asset::Id, - } - pub mod freeze_asset { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FreezeAsset { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "freeze_asset"; + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + pub fn set_min_balance( + &self, + id: types::set_min_balance::Id, + min_balance: types::set_min_balance::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "set_min_balance", + types::SetMinBalance { id, min_balance }, + [ + 141u8, 241u8, 137u8, 50u8, 232u8, 122u8, 252u8, 104u8, 185u8, 170u8, + 246u8, 0u8, 20u8, 128u8, 136u8, 155u8, 62u8, 243u8, 4u8, 221u8, 42u8, + 225u8, 16u8, 245u8, 58u8, 127u8, 84u8, 193u8, 175u8, 165u8, 35u8, 49u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allow unprivileged transfers for the asset again."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "Create an asset account for `who`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be thawed."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "Emits `Thawed`."] + #[doc = "- `origin`: Must be Signed by `Freezer` or `Admin` of the asset `id`; the signer account"] + #[doc = " must have sufficient funds for a deposit to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] + #[doc = "- `who`: The account to be created."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct ThawAsset { - #[codec(compact)] - pub id: thaw_asset::Id, - } - pub mod thaw_asset { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ThawAsset { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "thaw_asset"; + #[doc = "Emits `Touched` event when successful."] + pub fn touch_other( + &self, + id: types::touch_other::Id, + who: types::touch_other::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "touch_other", + types::TouchOther { id, who }, + [ + 104u8, 85u8, 80u8, 68u8, 135u8, 149u8, 102u8, 104u8, 188u8, 79u8, 42u8, + 34u8, 241u8, 84u8, 183u8, 176u8, 215u8, 172u8, 78u8, 196u8, 206u8, + 214u8, 138u8, 240u8, 92u8, 65u8, 117u8, 170u8, 140u8, 120u8, 50u8, + 166u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Change the Owner of an asset."] + #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] + #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] + #[doc = "use `refund`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `who`: The account to refund."] #[doc = ""] - #[doc = "Emits `OwnerChanged`."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct TransferOwnership { - #[codec(compact)] - pub id: transfer_ownership::Id, - pub owner: transfer_ownership::Owner, - } - pub mod transfer_ownership { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferOwnership { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_ownership"; + #[doc = "Emits `Refunded` event when successful."] + pub fn refund_other( + &self, + id: types::refund_other::Id, + who: types::refund_other::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "refund_other", + types::RefundOther { id, who }, + [ + 113u8, 58u8, 33u8, 109u8, 233u8, 229u8, 210u8, 40u8, 176u8, 252u8, + 131u8, 80u8, 33u8, 132u8, 19u8, 170u8, 145u8, 146u8, 246u8, 31u8, + 222u8, 120u8, 167u8, 187u8, 8u8, 144u8, 164u8, 251u8, 52u8, 249u8, + 91u8, 136u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Change the Issuer, Admin and Freezer of an asset."] + #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] + #[doc = "- `id`: The identifier of the account's asset."] + #[doc = "- `who`: The account to be unblocked."] #[doc = ""] - #[doc = "Emits `TeamChanged`."] + #[doc = "Emits `Blocked`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct SetTeam { - #[codec(compact)] - pub id: set_team::Id, - pub issuer: set_team::Issuer, - pub admin: set_team::Admin, - pub freezer: set_team::Freezer, - } - pub mod set_team { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTeam { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_team"; + pub fn block( + &self, + id: types::block::Id, + who: types::block::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "block", + types::Block { id, who }, + [ + 224u8, 63u8, 26u8, 229u8, 23u8, 164u8, 212u8, 170u8, 156u8, 104u8, + 63u8, 158u8, 53u8, 162u8, 157u8, 127u8, 183u8, 94u8, 211u8, 123u8, + 228u8, 198u8, 47u8, 80u8, 53u8, 122u8, 46u8, 69u8, 67u8, 170u8, 193u8, + 33u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "Funds of sender are reserved according to the formula:"] - #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] - #[doc = "account any already reserved funds."] + #[doc = "Transfer the entire transferable balance from the caller asset account."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] #[doc = ""] - #[doc = "Emits `MetadataSet`."] + #[doc = "The dispatch origin of this call must be Signed."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct SetMetadata { - #[codec(compact)] - pub id: set_metadata::Id, - pub name: set_metadata::Name, - pub symbol: set_metadata::Symbol, - pub decimals: set_metadata::Decimals, - } - pub mod set_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Name = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Symbol = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Decimals = ::core::primitive::u8; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_metadata"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "Any deposit is freed for the asset owner."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] - #[doc = ""] - #[doc = "Emits `MetadataCleared`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct ClearMetadata { - #[codec(compact)] - pub id: clear_metadata::Id, - } - pub mod clear_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "clear_metadata"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force the metadata for an asset to some value."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] - #[doc = ""] - #[doc = "Any deposit is left alone."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] - #[doc = ""] - #[doc = "Emits `MetadataSet`."] - #[doc = ""] - #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] - pub struct ForceSetMetadata { - #[codec(compact)] - pub id: force_set_metadata::Id, - pub name: force_set_metadata::Name, - pub symbol: force_set_metadata::Symbol, - pub decimals: force_set_metadata::Decimals, - pub is_frozen: force_set_metadata::IsFrozen, - } - pub mod force_set_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Name = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Symbol = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Decimals = ::core::primitive::u8; - pub type IsFrozen = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_set_metadata"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] - #[doc = ""] - #[doc = "Any deposit is returned."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] - #[doc = ""] - #[doc = "Emits `MetadataCleared`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct ForceClearMetadata { - #[codec(compact)] - pub id: force_clear_metadata::Id, - } - pub mod force_clear_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceClearMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_clear_metadata"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Alter the attributes of a given asset."] - #[doc = ""] - #[doc = "Origin must be `ForceOrigin`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] - #[doc = "value to account for the state bloat associated with its balance storage. If set to"] - #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] - #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] - #[doc = "growth)."] - #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] - #[doc = "instructions."] - #[doc = ""] - #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct ForceAssetStatus { - #[codec(compact)] - pub id: force_asset_status::Id, - pub owner: force_asset_status::Owner, - pub issuer: force_asset_status::Issuer, - pub admin: force_asset_status::Admin, - pub freezer: force_asset_status::Freezer, - #[codec(compact)] - pub min_balance: force_asset_status::MinBalance, - pub is_sufficient: force_asset_status::IsSufficient, - pub is_frozen: force_asset_status::IsFrozen, - } - pub mod force_asset_status { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MinBalance = ::core::primitive::u128; - pub type IsSufficient = ::core::primitive::bool; - pub type IsFrozen = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceAssetStatus { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_asset_status"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed."] - #[doc = ""] - #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] - #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] - #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] - #[doc = "meet the right value."] - #[doc = ""] - #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] - #[doc = "making this call."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account to delegate permission to transfer asset."] - #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] - #[doc = "already an approval in place, then this acts additively."] - #[doc = ""] - #[doc = "Emits `ApprovedTransfer` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct ApproveTransfer { - #[codec(compact)] - pub id: approve_transfer::Id, - pub delegate: approve_transfer::Delegate, - #[codec(compact)] - pub amount: approve_transfer::Amount, - } - pub mod approve_transfer { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveTransfer { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "approve_transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place between signer and"] - #[doc = "`delegate`."] - #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] - #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct CancelApproval { - #[codec(compact)] - pub id: cancel_approval::Id, - pub delegate: cancel_approval::Delegate, - } - pub mod cancel_approval { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelApproval { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "cancel_approval"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] - #[doc = "account of the asset `id`."] - #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] - #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct ForceCancelApproval { - #[codec(compact)] - pub id: force_cancel_approval::Id, - pub owner: force_cancel_approval::Owner, - pub delegate: force_cancel_approval::Delegate, - } - pub mod force_cancel_approval { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCancelApproval { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_cancel_approval"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] - #[doc = "account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] - #[doc = "signer."] - #[doc = ""] - #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] - #[doc = "reserved by `approve_transfer` is unreserved."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] - #[doc = "from which the asset balance will be withdrawn."] - #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] - #[doc = "- `amount`: The amount of assets to transfer."] - #[doc = ""] - #[doc = "Emits `TransferredApproved` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct TransferApproved { - #[codec(compact)] - pub id: transfer_approved::Id, - pub owner: transfer_approved::Owner, - pub destination: transfer_approved::Destination, - #[codec(compact)] - pub amount: transfer_approved::Amount, - } - pub mod transfer_approved { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Destination = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferApproved { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_approved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create an asset account for non-provider assets."] - #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created."] - #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub struct Touch { - #[codec(compact)] - pub id: touch::Id, - } - pub mod touch { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Touch { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "touch"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] - #[doc = "account."] - #[doc = ""] - #[doc = "The origin must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] - #[doc = " refunded."] - #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] - #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub struct Refund { - #[codec(compact)] - pub id: refund::Id, - pub allow_burn: refund::AllowBurn, - } - pub mod refund { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type AllowBurn = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Refund { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "refund"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the minimum balance of an asset."] - #[doc = ""] - #[doc = "Only works if there aren't any accounts that are holding the asset or if"] - #[doc = "the new value of `min_balance` is less than the old one."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender has to be the Owner of the"] - #[doc = "asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `min_balance`: The new value of `min_balance`."] - #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - pub struct SetMinBalance { - #[codec(compact)] - pub id: set_min_balance::Id, - pub min_balance: set_min_balance::MinBalance, - } - pub mod set_min_balance { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type MinBalance = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMinBalance { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_min_balance"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create an asset account for `who`."] - #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed by `Freezer` or `Admin` of the asset `id`; the signer account"] - #[doc = " must have sufficient funds for a deposit to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created."] - #[doc = "- `who`: The account to be created."] - #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub struct TouchOther { - #[codec(compact)] - pub id: touch_other::Id, - pub who: touch_other::Who, - } - pub mod touch_other { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TouchOther { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "touch_other"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] - #[doc = ""] - #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] - #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] - #[doc = "use `refund`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `who`: The account to refund."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] - #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub struct RefundOther { - #[codec(compact)] - pub id: refund_other::Id, - pub who: refund_other::Who, - } - pub mod refund_other { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundOther { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "refund_other"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the account's asset."] - #[doc = "- `who`: The account to be unblocked."] - #[doc = ""] - #[doc = "Emits `Blocked`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct Block { - #[codec(compact)] - pub id: block::Id, - pub who: block::Who, - } - pub mod block { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Block { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "block"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer the entire transferable balance from the caller asset account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] - #[doc = " (false), or transfer everything except at least the minimum balance, which will"] - #[doc = " guarantee to keep the sender asset account alive (true)."] - pub struct TransferAll { - #[codec(compact)] - pub id: transfer_all::Id, - pub dest: transfer_all::Dest, - pub keep_alive: transfer_all::KeepAlive, - } - pub mod transfer_all { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type KeepAlive = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAll { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_all"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Issue a new class of fungible assets from a public origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially and its owner is the origin."] - #[doc = ""] - #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] - #[doc = ""] - #[doc = "Funds of sender are reserved by `AssetDeposit`."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] - #[doc = "member of the asset class's admin team."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = ""] - #[doc = "Emits `Created` event when successful."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn create( - &self, - id: types::create::Id, - admin: types::create::Admin, - min_balance: types::create::MinBalance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "create", - types::Create { id, admin, min_balance }, - [ - 120u8, 25u8, 99u8, 39u8, 102u8, 201u8, 14u8, 2u8, 32u8, 139u8, 206u8, - 218u8, 223u8, 161u8, 25u8, 98u8, 159u8, 133u8, 65u8, 105u8, 45u8, 4u8, - 28u8, 49u8, 248u8, 147u8, 2u8, 179u8, 11u8, 195u8, 177u8, 250u8, - ], - ) - } - #[doc = "Issue a new class of fungible assets from a privileged origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially."] - #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin`."] - #[doc = ""] - #[doc = "Unlike `create`, no funds are reserved."] - #[doc = ""] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] - #[doc = "over this asset, but may later change and configure the permissions using"] - #[doc = "`transfer_ownership` and `set_team`."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = ""] - #[doc = "Emits `ForceCreated` event when successful."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn force_create( - &self, - id: types::force_create::Id, - owner: types::force_create::Owner, - is_sufficient: types::force_create::IsSufficient, - min_balance: types::force_create::MinBalance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_create", - types::ForceCreate { id, owner, is_sufficient, min_balance }, - [ - 149u8, 41u8, 54u8, 146u8, 18u8, 248u8, 84u8, 52u8, 202u8, 88u8, 192u8, - 208u8, 247u8, 227u8, 254u8, 98u8, 92u8, 46u8, 164u8, 152u8, 143u8, - 20u8, 179u8, 227u8, 197u8, 247u8, 242u8, 153u8, 142u8, 148u8, 40u8, - 184u8, - ], - ) - } - #[doc = "Start the process of destroying a fungible asset class."] - #[doc = ""] - #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] - #[doc = "destruction of an asset class."] - #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "an account contains holds or freezes in place."] - pub fn start_destroy( - &self, - id: types::start_destroy::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "start_destroy", - types::StartDestroy { id }, - [ - 125u8, 82u8, 151u8, 106u8, 25u8, 49u8, 68u8, 203u8, 247u8, 175u8, - 117u8, 230u8, 84u8, 98u8, 172u8, 73u8, 233u8, 218u8, 212u8, 198u8, - 69u8, 35u8, 15u8, 179u8, 161u8, 205u8, 190u8, 109u8, 198u8, 214u8, - 65u8, 164u8, - ], - ) - } - #[doc = "Destroy all accounts associated with a given asset."] - #[doc = ""] - #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] - #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] - #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedAccounts` event."] - pub fn destroy_accounts( - &self, - id: types::destroy_accounts::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "destroy_accounts", - types::DestroyAccounts { id }, - [ - 236u8, 102u8, 233u8, 170u8, 179u8, 46u8, 42u8, 29u8, 200u8, 116u8, - 62u8, 114u8, 233u8, 59u8, 217u8, 215u8, 109u8, 232u8, 147u8, 95u8, - 255u8, 248u8, 119u8, 222u8, 216u8, 165u8, 138u8, 47u8, 28u8, 56u8, - 204u8, 93u8, - ], - ) - } - #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] - #[doc = ""] - #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] - #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] - #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedApprovals` event."] - pub fn destroy_approvals( - &self, - id: types::destroy_approvals::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "destroy_approvals", - types::DestroyApprovals { id }, - [ - 34u8, 35u8, 15u8, 44u8, 239u8, 232u8, 88u8, 130u8, 130u8, 87u8, 171u8, - 255u8, 247u8, 179u8, 14u8, 35u8, 47u8, 223u8, 32u8, 232u8, 41u8, 105u8, - 207u8, 199u8, 90u8, 136u8, 144u8, 139u8, 252u8, 76u8, 177u8, 106u8, - ], - ) - } - #[doc = "Complete destroying asset and unreserve currency."] - #[doc = ""] - #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] - #[doc = "hand."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] - #[doc = ""] - #[doc = "Each successful call emits the `Event::Destroyed` event."] - pub fn finish_destroy( - &self, - id: types::finish_destroy::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "finish_destroy", - types::FinishDestroy { id }, - [ - 132u8, 67u8, 78u8, 84u8, 240u8, 51u8, 176u8, 119u8, 48u8, 34u8, 153u8, - 37u8, 25u8, 171u8, 21u8, 164u8, 53u8, 214u8, 36u8, 149u8, 20u8, 240u8, - 123u8, 195u8, 170u8, 162u8, 118u8, 81u8, 176u8, 218u8, 114u8, 113u8, - ], - ) - } - #[doc = "Mint assets of a particular class."] - #[doc = ""] - #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount minted."] - #[doc = "- `beneficiary`: The account to be credited with the minted assets."] - #[doc = "- `amount`: The amount of the asset to be minted."] - #[doc = ""] - #[doc = "Emits `Issued` event when successful."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] - pub fn mint( - &self, - id: types::mint::Id, - beneficiary: types::mint::Beneficiary, - amount: types::mint::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "mint", - types::Mint { id, beneficiary, amount }, - [ - 172u8, 131u8, 103u8, 81u8, 206u8, 2u8, 143u8, 114u8, 137u8, 60u8, - 147u8, 67u8, 226u8, 64u8, 71u8, 11u8, 36u8, 145u8, 51u8, 8u8, 0u8, - 110u8, 8u8, 195u8, 103u8, 205u8, 156u8, 43u8, 215u8, 12u8, 150u8, - 135u8, - ], - ) - } - #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] - #[doc = ""] - #[doc = "Bails with `NoAccount` if the `who` is already dead."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount burned."] - #[doc = "- `who`: The account to be debited from."] - #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] - #[doc = ""] - #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] - #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] - pub fn burn( - &self, - id: types::burn::Id, - who: types::burn::Who, - amount: types::burn::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "burn", - types::Burn { id, who, amount }, - [ - 105u8, 133u8, 82u8, 100u8, 124u8, 65u8, 174u8, 31u8, 152u8, 45u8, 23u8, - 200u8, 23u8, 199u8, 239u8, 8u8, 187u8, 142u8, 21u8, 192u8, 35u8, 211u8, - 172u8, 130u8, 169u8, 74u8, 167u8, 36u8, 149u8, 7u8, 19u8, 37u8, - ], - ) - } - #[doc = "Move some assets from the sender account to another."] - #[doc = ""] - #[doc = "Origin must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] - #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub fn transfer( - &self, - id: types::transfer::Id, - target: types::transfer::Target, - amount: types::transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "transfer", - types::Transfer { id, target, amount }, - [ - 126u8, 31u8, 70u8, 179u8, 222u8, 190u8, 12u8, 19u8, 94u8, 225u8, 217u8, - 109u8, 54u8, 69u8, 124u8, 61u8, 97u8, 199u8, 193u8, 166u8, 39u8, 143u8, - 125u8, 251u8, 87u8, 173u8, 149u8, 91u8, 182u8, 18u8, 184u8, 65u8, - ], - ) - } - #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] - #[doc = ""] - #[doc = "Origin must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] - #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub fn transfer_keep_alive( - &self, - id: types::transfer_keep_alive::Id, - target: types::transfer_keep_alive::Target, - amount: types::transfer_keep_alive::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "transfer_keep_alive", - types::TransferKeepAlive { id, target, amount }, - [ - 99u8, 101u8, 219u8, 188u8, 238u8, 230u8, 141u8, 43u8, 38u8, 175u8, - 46u8, 89u8, 33u8, 23u8, 223u8, 115u8, 108u8, 18u8, 190u8, 213u8, 157u8, - 12u8, 139u8, 97u8, 7u8, 75u8, 196u8, 159u8, 122u8, 32u8, 164u8, 154u8, - ], - ) - } - #[doc = "Move some assets from one account to another."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `source`: The account to be debited."] - #[doc = "- `dest`: The account to be credited."] - #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] - #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] - #[doc = "below the minimum balance. Must be greater than zero."] - #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] - #[doc = "`dest`."] - pub fn force_transfer( - &self, - id: types::force_transfer::Id, - source: types::force_transfer::Source, - dest: types::force_transfer::Dest, - amount: types::force_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_transfer", - types::ForceTransfer { id, source, dest, amount }, - [ - 10u8, 210u8, 8u8, 209u8, 8u8, 78u8, 40u8, 213u8, 235u8, 176u8, 144u8, - 145u8, 70u8, 13u8, 75u8, 72u8, 166u8, 137u8, 22u8, 191u8, 226u8, 244u8, - 92u8, 183u8, 129u8, 212u8, 158u8, 179u8, 169u8, 232u8, 177u8, 225u8, - ], - ) - } - #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] - #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] - #[doc = "account that does not have an entry, use `touch_other` first."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be frozen."] - #[doc = ""] - #[doc = "Emits `Frozen`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn freeze( - &self, - id: types::freeze::Id, - who: types::freeze::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "freeze", - types::Freeze { id, who }, - [ - 180u8, 124u8, 252u8, 66u8, 205u8, 23u8, 32u8, 217u8, 173u8, 10u8, 91u8, - 57u8, 44u8, 215u8, 234u8, 152u8, 115u8, 38u8, 141u8, 212u8, 57u8, - 217u8, 169u8, 61u8, 215u8, 130u8, 172u8, 58u8, 90u8, 193u8, 25u8, - 249u8, - ], - ) - } - #[doc = "Allow unprivileged transfers to and from an account again."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be unfrozen."] - #[doc = ""] - #[doc = "Emits `Thawed`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn thaw( - &self, - id: types::thaw::Id, - who: types::thaw::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "thaw", - types::Thaw { id, who }, - [ - 187u8, 130u8, 9u8, 152u8, 231u8, 9u8, 245u8, 162u8, 115u8, 19u8, 73u8, - 176u8, 16u8, 230u8, 30u8, 60u8, 180u8, 183u8, 154u8, 160u8, 72u8, - 219u8, 116u8, 57u8, 140u8, 6u8, 105u8, 38u8, 98u8, 90u8, 250u8, 135u8, - ], - ) - } - #[doc = "Disallow further unprivileged transfers for the asset class."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = ""] - #[doc = "Emits `Frozen`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn freeze_asset( - &self, - id: types::freeze_asset::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "freeze_asset", - types::FreezeAsset { id }, - [ - 75u8, 237u8, 183u8, 112u8, 112u8, 123u8, 250u8, 203u8, 169u8, 51u8, - 218u8, 35u8, 159u8, 23u8, 21u8, 10u8, 167u8, 84u8, 161u8, 212u8, 124u8, - 236u8, 88u8, 175u8, 48u8, 195u8, 33u8, 145u8, 141u8, 156u8, 31u8, - 250u8, - ], - ) - } - #[doc = "Allow unprivileged transfers for the asset again."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be thawed."] - #[doc = ""] - #[doc = "Emits `Thawed`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn thaw_asset( - &self, - id: types::thaw_asset::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "thaw_asset", - types::ThawAsset { id }, - [ - 151u8, 6u8, 170u8, 114u8, 55u8, 8u8, 5u8, 194u8, 251u8, 78u8, 232u8, - 181u8, 157u8, 62u8, 16u8, 39u8, 79u8, 119u8, 205u8, 198u8, 199u8, 26u8, - 92u8, 162u8, 169u8, 173u8, 93u8, 51u8, 7u8, 79u8, 198u8, 77u8, - ], - ) - } - #[doc = "Change the Owner of an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = ""] - #[doc = "Emits `OwnerChanged`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn transfer_ownership( - &self, - id: types::transfer_ownership::Id, - owner: types::transfer_ownership::Owner, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "transfer_ownership", - types::TransferOwnership { id, owner }, - [ - 65u8, 85u8, 40u8, 202u8, 212u8, 170u8, 130u8, 132u8, 140u8, 90u8, 68u8, - 28u8, 101u8, 154u8, 222u8, 150u8, 244u8, 165u8, 44u8, 22u8, 225u8, - 152u8, 7u8, 162u8, 110u8, 54u8, 173u8, 181u8, 54u8, 215u8, 105u8, - 239u8, - ], - ) - } - #[doc = "Change the Issuer, Admin and Freezer of an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = ""] - #[doc = "Emits `TeamChanged`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn set_team( - &self, - id: types::set_team::Id, - issuer: types::set_team::Issuer, - admin: types::set_team::Admin, - freezer: types::set_team::Freezer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "set_team", - types::SetTeam { id, issuer, admin, freezer }, - [ - 52u8, 75u8, 50u8, 30u8, 164u8, 161u8, 121u8, 25u8, 135u8, 83u8, 115u8, - 25u8, 103u8, 1u8, 124u8, 206u8, 83u8, 182u8, 41u8, 116u8, 44u8, 37u8, - 75u8, 70u8, 252u8, 225u8, 240u8, 144u8, 96u8, 160u8, 151u8, 4u8, - ], - ) - } - #[doc = "Set the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "Funds of sender are reserved according to the formula:"] - #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] - #[doc = "account any already reserved funds."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] - #[doc = ""] - #[doc = "Emits `MetadataSet`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn set_metadata( - &self, - id: types::set_metadata::Id, - name: types::set_metadata::Name, - symbol: types::set_metadata::Symbol, - decimals: types::set_metadata::Decimals, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "set_metadata", - types::SetMetadata { id, name, symbol, decimals }, - [ - 215u8, 66u8, 15u8, 17u8, 88u8, 174u8, 77u8, 75u8, 229u8, 155u8, 160u8, - 34u8, 108u8, 194u8, 88u8, 238u8, 131u8, 97u8, 234u8, 102u8, 71u8, 56u8, - 70u8, 248u8, 211u8, 85u8, 72u8, 92u8, 71u8, 222u8, 190u8, 91u8, - ], - ) - } - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] - #[doc = ""] - #[doc = "Any deposit is freed for the asset owner."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] - #[doc = ""] - #[doc = "Emits `MetadataCleared`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn clear_metadata( - &self, - id: types::clear_metadata::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "clear_metadata", - types::ClearMetadata { id }, - [ - 68u8, 172u8, 6u8, 158u8, 237u8, 254u8, 22u8, 4u8, 254u8, 157u8, 179u8, - 168u8, 105u8, 114u8, 56u8, 166u8, 213u8, 38u8, 188u8, 195u8, 99u8, - 43u8, 142u8, 220u8, 94u8, 248u8, 51u8, 226u8, 233u8, 114u8, 86u8, 93u8, - ], - ) - } - #[doc = "Force the metadata for an asset to some value."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] - #[doc = ""] - #[doc = "Any deposit is left alone."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to update."] - #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] - #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] - #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] - #[doc = ""] - #[doc = "Emits `MetadataSet`."] - #[doc = ""] - #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] - pub fn force_set_metadata( - &self, - id: types::force_set_metadata::Id, - name: types::force_set_metadata::Name, - symbol: types::force_set_metadata::Symbol, - decimals: types::force_set_metadata::Decimals, - is_frozen: types::force_set_metadata::IsFrozen, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_set_metadata", - types::ForceSetMetadata { id, name, symbol, decimals, is_frozen }, - [ - 76u8, 90u8, 182u8, 13u8, 133u8, 248u8, 94u8, 136u8, 169u8, 114u8, - 151u8, 20u8, 106u8, 89u8, 78u8, 228u8, 22u8, 29u8, 68u8, 8u8, 54u8, - 47u8, 1u8, 186u8, 45u8, 167u8, 14u8, 112u8, 34u8, 43u8, 91u8, 140u8, - ], - ) - } - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] - #[doc = ""] - #[doc = "Any deposit is returned."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] - #[doc = ""] - #[doc = "Emits `MetadataCleared`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn force_clear_metadata( - &self, - id: types::force_clear_metadata::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_clear_metadata", - types::ForceClearMetadata { id }, - [ - 2u8, 224u8, 84u8, 48u8, 130u8, 132u8, 79u8, 38u8, 217u8, 17u8, 165u8, - 139u8, 89u8, 53u8, 116u8, 184u8, 32u8, 91u8, 122u8, 39u8, 85u8, 40u8, - 213u8, 216u8, 135u8, 171u8, 50u8, 69u8, 202u8, 28u8, 166u8, 147u8, - ], - ) - } - #[doc = "Alter the attributes of a given asset."] - #[doc = ""] - #[doc = "Origin must be `ForceOrigin`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] - #[doc = "value to account for the state bloat associated with its balance storage. If set to"] - #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] - #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] - #[doc = "growth)."] - #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] - #[doc = "instructions."] - #[doc = ""] - #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn force_asset_status( - &self, - id: types::force_asset_status::Id, - owner: types::force_asset_status::Owner, - issuer: types::force_asset_status::Issuer, - admin: types::force_asset_status::Admin, - freezer: types::force_asset_status::Freezer, - min_balance: types::force_asset_status::MinBalance, - is_sufficient: types::force_asset_status::IsSufficient, - is_frozen: types::force_asset_status::IsFrozen, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_asset_status", - types::ForceAssetStatus { - id, - owner, - issuer, - admin, - freezer, - min_balance, - is_sufficient, - is_frozen, - }, - [ - 149u8, 136u8, 250u8, 33u8, 53u8, 220u8, 207u8, 187u8, 42u8, 118u8, - 93u8, 173u8, 100u8, 243u8, 234u8, 207u8, 88u8, 45u8, 79u8, 221u8, - 113u8, 166u8, 229u8, 171u8, 223u8, 126u8, 20u8, 67u8, 19u8, 77u8, 44u8, - 19u8, - ], - ) - } - #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed."] - #[doc = ""] - #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] - #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] - #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] - #[doc = "meet the right value."] - #[doc = ""] - #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] - #[doc = "making this call."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account to delegate permission to transfer asset."] - #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] - #[doc = "already an approval in place, then this acts additively."] - #[doc = ""] - #[doc = "Emits `ApprovedTransfer` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn approve_transfer( - &self, - id: types::approve_transfer::Id, - delegate: types::approve_transfer::Delegate, - amount: types::approve_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "approve_transfer", - types::ApproveTransfer { id, delegate, amount }, - [ - 39u8, 227u8, 23u8, 143u8, 10u8, 120u8, 227u8, 1u8, 223u8, 78u8, 40u8, - 213u8, 249u8, 175u8, 170u8, 183u8, 10u8, 244u8, 117u8, 111u8, 140u8, - 157u8, 153u8, 212u8, 94u8, 119u8, 213u8, 44u8, 41u8, 8u8, 114u8, 200u8, - ], - ) - } - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place between signer and"] - #[doc = "`delegate`."] - #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] - #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn cancel_approval( - &self, - id: types::cancel_approval::Id, - delegate: types::cancel_approval::Delegate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "cancel_approval", - types::CancelApproval { id, delegate }, - [ - 74u8, 117u8, 101u8, 78u8, 152u8, 208u8, 16u8, 102u8, 34u8, 195u8, 61u8, - 36u8, 85u8, 91u8, 253u8, 182u8, 61u8, 199u8, 12u8, 102u8, 149u8, 20u8, - 238u8, 207u8, 236u8, 50u8, 63u8, 249u8, 34u8, 85u8, 88u8, 229u8, - ], - ) - } - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] - #[doc = "account of the asset `id`."] - #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] - #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn force_cancel_approval( - &self, - id: types::force_cancel_approval::Id, - owner: types::force_cancel_approval::Owner, - delegate: types::force_cancel_approval::Delegate, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "force_cancel_approval", - types::ForceCancelApproval { id, owner, delegate }, - [ - 27u8, 231u8, 85u8, 241u8, 18u8, 151u8, 64u8, 234u8, 11u8, 84u8, 252u8, - 128u8, 44u8, 247u8, 132u8, 82u8, 34u8, 210u8, 202u8, 50u8, 158u8, 45u8, - 239u8, 192u8, 7u8, 24u8, 39u8, 95u8, 57u8, 21u8, 178u8, 113u8, - ], - ) - } - #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] - #[doc = "account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] - #[doc = "signer."] - #[doc = ""] - #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] - #[doc = "reserved by `approve_transfer` is unreserved."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] - #[doc = "from which the asset balance will be withdrawn."] - #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] - #[doc = "- `amount`: The amount of assets to transfer."] - #[doc = ""] - #[doc = "Emits `TransferredApproved` on success."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn transfer_approved( - &self, - id: types::transfer_approved::Id, - owner: types::transfer_approved::Owner, - destination: types::transfer_approved::Destination, - amount: types::transfer_approved::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "transfer_approved", - types::TransferApproved { id, owner, destination, amount }, - [ - 214u8, 51u8, 243u8, 129u8, 116u8, 233u8, 199u8, 183u8, 25u8, 5u8, - 109u8, 85u8, 255u8, 68u8, 36u8, 99u8, 99u8, 179u8, 34u8, 66u8, 65u8, - 82u8, 189u8, 174u8, 22u8, 100u8, 211u8, 13u8, 178u8, 19u8, 128u8, - 177u8, - ], - ) - } - #[doc = "Create an asset account for non-provider assets."] - #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created."] - #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub fn touch( - &self, - id: types::touch::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "touch", - types::Touch { id }, - [ - 50u8, 185u8, 46u8, 134u8, 136u8, 31u8, 191u8, 34u8, 215u8, 150u8, 73u8, - 103u8, 140u8, 36u8, 95u8, 156u8, 201u8, 152u8, 32u8, 165u8, 47u8, 86u8, - 163u8, 255u8, 8u8, 251u8, 176u8, 138u8, 165u8, 48u8, 12u8, 27u8, - ], - ) - } - #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] - #[doc = "account."] - #[doc = ""] - #[doc = "The origin must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] - #[doc = " refunded."] - #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] - #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub fn refund( - &self, - id: types::refund::Id, - allow_burn: types::refund::AllowBurn, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "refund", - types::Refund { id, allow_burn }, - [ - 218u8, 207u8, 8u8, 41u8, 154u8, 250u8, 117u8, 174u8, 143u8, 133u8, - 34u8, 113u8, 171u8, 18u8, 177u8, 227u8, 146u8, 92u8, 12u8, 226u8, - 101u8, 230u8, 246u8, 162u8, 32u8, 73u8, 138u8, 158u8, 95u8, 226u8, - 75u8, 95u8, - ], - ) - } - #[doc = "Sets the minimum balance of an asset."] - #[doc = ""] - #[doc = "Only works if there aren't any accounts that are holding the asset or if"] - #[doc = "the new value of `min_balance` is less than the old one."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender has to be the Owner of the"] - #[doc = "asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `min_balance`: The new value of `min_balance`."] - #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - pub fn set_min_balance( - &self, - id: types::set_min_balance::Id, - min_balance: types::set_min_balance::MinBalance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "set_min_balance", - types::SetMinBalance { id, min_balance }, - [ - 141u8, 241u8, 137u8, 50u8, 232u8, 122u8, 252u8, 104u8, 185u8, 170u8, - 246u8, 0u8, 20u8, 128u8, 136u8, 155u8, 62u8, 243u8, 4u8, 221u8, 42u8, - 225u8, 16u8, 245u8, 58u8, 127u8, 84u8, 193u8, 175u8, 165u8, 35u8, 49u8, - ], - ) - } - #[doc = "Create an asset account for `who`."] - #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] - #[doc = ""] - #[doc = "- `origin`: Must be Signed by `Freezer` or `Admin` of the asset `id`; the signer account"] - #[doc = " must have sufficient funds for a deposit to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created."] - #[doc = "- `who`: The account to be created."] - #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub fn touch_other( - &self, - id: types::touch_other::Id, - who: types::touch_other::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "touch_other", - types::TouchOther { id, who }, - [ - 104u8, 85u8, 80u8, 68u8, 135u8, 149u8, 102u8, 104u8, 188u8, 79u8, 42u8, - 34u8, 241u8, 84u8, 183u8, 176u8, 215u8, 172u8, 78u8, 196u8, 206u8, - 214u8, 138u8, 240u8, 92u8, 65u8, 117u8, 170u8, 140u8, 120u8, 50u8, - 166u8, - ], - ) - } - #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] - #[doc = ""] - #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] - #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] - #[doc = "use `refund`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `who`: The account to refund."] - #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] - #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub fn refund_other( - &self, - id: types::refund_other::Id, - who: types::refund_other::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "refund_other", - types::RefundOther { id, who }, - [ - 113u8, 58u8, 33u8, 109u8, 233u8, 229u8, 210u8, 40u8, 176u8, 252u8, - 131u8, 80u8, 33u8, 132u8, 19u8, 170u8, 145u8, 146u8, 246u8, 31u8, - 222u8, 120u8, 167u8, 187u8, 8u8, 144u8, 164u8, 251u8, 52u8, 249u8, - 91u8, 136u8, - ], - ) - } - #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the account's asset."] - #[doc = "- `who`: The account to be unblocked."] - #[doc = ""] - #[doc = "Emits `Blocked`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn block( - &self, - id: types::block::Id, - who: types::block::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "block", - types::Block { id, who }, - [ - 224u8, 63u8, 26u8, 229u8, 23u8, 164u8, 212u8, 170u8, 156u8, 104u8, - 63u8, 158u8, 53u8, 162u8, 157u8, 127u8, 183u8, 94u8, 211u8, 123u8, - 228u8, 198u8, 47u8, 80u8, 53u8, 122u8, 46u8, 69u8, 67u8, 170u8, 193u8, - 33u8, - ], - ) - } - #[doc = "Transfer the entire transferable balance from the caller asset account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] - #[doc = " (false), or transfer everything except at least the minimum balance, which will"] - #[doc = " guarantee to keep the sender asset account alive (true)."] - pub fn transfer_all( - &self, - id: types::transfer_all::Id, - dest: types::transfer_all::Dest, - keep_alive: types::transfer_all::KeepAlive, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Assets", - "transfer_all", - types::TransferAll { id, dest, keep_alive }, - [ - 180u8, 161u8, 252u8, 127u8, 200u8, 117u8, 245u8, 213u8, 170u8, 169u8, - 178u8, 115u8, 156u8, 8u8, 79u8, 50u8, 168u8, 229u8, 87u8, 33u8, 238u8, - 124u8, 13u8, 210u8, 81u8, 132u8, 236u8, 46u8, 101u8, 18u8, 22u8, 61u8, - ], - ) + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] + #[doc = " (false), or transfer everything except at least the minimum balance, which will"] + #[doc = " guarantee to keep the sender asset account alive (true)."] + pub fn transfer_all( + &self, + id: types::transfer_all::Id, + dest: types::transfer_all::Dest, + keep_alive: types::transfer_all::KeepAlive, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer_all", + types::TransferAll { id, dest, keep_alive }, + [ + 180u8, 161u8, 252u8, 127u8, 200u8, 117u8, 245u8, 213u8, 170u8, 169u8, + 178u8, 115u8, 156u8, 8u8, 79u8, 50u8, 168u8, 229u8, 87u8, 33u8, 238u8, + 124u8, 13u8, 210u8, 81u8, 132u8, 236u8, 46u8, 101u8, 18u8, 22u8, 61u8, + ], + ) } } } @@ -19770,21 +18494,138 @@ 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 asset class was created."] - pub struct Created { - pub asset_id: created::AssetId, - pub creator: created::Creator, - pub owner: created::Owner, + #[doc = "Some asset class was created."] + pub struct Created { + pub asset_id: created::AssetId, + pub creator: created::Creator, + pub owner: created::Owner, + } + pub mod created { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Creator = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Created { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Created"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 issued."] + pub struct Issued { + pub asset_id: issued::AssetId, + pub owner: issued::Owner, + pub amount: issued::Amount, + } + pub mod issued { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Issued { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Issued"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 transferred."] + pub struct Transferred { + pub asset_id: transferred::AssetId, + pub from: transferred::From, + pub to: transferred::To, + pub amount: transferred::Amount, + } + pub mod transferred { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type From = ::subxt::ext::subxt_core::utils::AccountId32; + pub type To = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Transferred { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Transferred"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 destroyed."] + pub struct Burned { + pub asset_id: burned::AssetId, + pub owner: burned::Owner, + pub balance: burned::Balance, + } + pub mod burned { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Balance = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Burned"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 management team changed."] + pub struct TeamChanged { + pub asset_id: team_changed::AssetId, + pub issuer: team_changed::Issuer, + pub admin: team_changed::Admin, + pub freezer: team_changed::Freezer, + } + pub mod team_changed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Issuer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Admin = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Freezer = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TeamChanged { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "TeamChanged"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 owner changed."] + pub struct OwnerChanged { + pub asset_id: owner_changed::AssetId, + pub owner: owner_changed::Owner, } - pub mod created { + pub mod owner_changed { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Creator = ::subxt::ext::subxt_core::utils::AccountId32; pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Created { + impl ::subxt::ext::subxt_core::events::StaticEvent for OwnerChanged { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Created"; + const EVENT: &'static str = "OwnerChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19793,21 +18634,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some assets were issued."] - pub struct Issued { - pub asset_id: issued::AssetId, - pub owner: issued::Owner, - pub amount: issued::Amount, + #[doc = "Some account `who` was frozen."] + pub struct Frozen { + pub asset_id: frozen::AssetId, + pub who: frozen::Who, } - pub mod issued { + pub mod frozen { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Issued { + impl ::subxt::ext::subxt_core::events::StaticEvent for Frozen { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Issued"; + const EVENT: &'static str = "Frozen"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19816,23 +18655,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some assets were transferred."] - pub struct Transferred { - pub asset_id: transferred::AssetId, - pub from: transferred::From, - pub to: transferred::To, - pub amount: transferred::Amount, + #[doc = "Some account `who` was thawed."] + pub struct Thawed { + pub asset_id: thawed::AssetId, + pub who: thawed::Who, } - pub mod transferred { + pub mod thawed { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Transferred { + impl ::subxt::ext::subxt_core::events::StaticEvent for Thawed { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Transferred"; + const EVENT: &'static str = "Thawed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19841,21 +18676,141 @@ 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 destroyed."] - pub struct Burned { - pub asset_id: burned::AssetId, - pub owner: burned::Owner, - pub balance: burned::Balance, + #[doc = "Some asset `asset_id` was frozen."] + pub struct AssetFrozen { + pub asset_id: asset_frozen::AssetId, } - pub mod burned { + pub mod asset_frozen { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetFrozen { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AssetFrozen"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 asset `asset_id` was thawed."] + pub struct AssetThawed { + pub asset_id: asset_thawed::AssetId, + } + pub mod asset_thawed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetThawed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AssetThawed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Accounts were destroyed for given asset."] + pub struct AccountsDestroyed { + pub asset_id: accounts_destroyed::AssetId, + pub accounts_destroyed: accounts_destroyed::AccountsDestroyed, + pub accounts_remaining: accounts_destroyed::AccountsRemaining, + } + pub mod accounts_destroyed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type AccountsDestroyed = ::core::primitive::u32; + pub type AccountsRemaining = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for AccountsDestroyed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AccountsDestroyed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Approvals were destroyed for given asset."] + pub struct ApprovalsDestroyed { + pub asset_id: approvals_destroyed::AssetId, + pub approvals_destroyed: approvals_destroyed::ApprovalsDestroyed, + pub approvals_remaining: approvals_destroyed::ApprovalsRemaining, + } + pub mod approvals_destroyed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type ApprovalsDestroyed = ::core::primitive::u32; + pub type ApprovalsRemaining = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovalsDestroyed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ApprovalsDestroyed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 asset class is in the process of being destroyed."] + pub struct DestructionStarted { + pub asset_id: destruction_started::AssetId, + } + pub mod destruction_started { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DestructionStarted { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "DestructionStarted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 asset class was destroyed."] + pub struct Destroyed { + pub asset_id: destroyed::AssetId, + } + pub mod destroyed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Destroyed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Destroyed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 asset class was force-created."] + pub struct ForceCreated { + pub asset_id: force_created::AssetId, + pub owner: force_created::Owner, + } + pub mod force_created { use super::runtime_types; pub type AssetId = ::core::primitive::u32; pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Balance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { + impl ::subxt::ext::subxt_core::events::StaticEvent for ForceCreated { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Burned"; + const EVENT: &'static str = "ForceCreated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19864,23 +18819,69 @@ 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 management team changed."] - pub struct TeamChanged { - pub asset_id: team_changed::AssetId, - pub issuer: team_changed::Issuer, - pub admin: team_changed::Admin, - pub freezer: team_changed::Freezer, + #[doc = "New metadata has been set for an asset."] + pub struct MetadataSet { + pub asset_id: metadata_set::AssetId, + pub name: metadata_set::Name, + pub symbol: metadata_set::Symbol, + pub decimals: metadata_set::Decimals, + pub is_frozen: metadata_set::IsFrozen, } - pub mod team_changed { + pub mod metadata_set { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Issuer = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Admin = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Freezer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Name = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Symbol = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Decimals = ::core::primitive::u8; + pub type IsFrozen = ::core::primitive::bool; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata has been cleared for an asset."] + pub struct MetadataCleared { + pub asset_id: metadata_cleared::AssetId, + } + pub mod metadata_cleared { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "MetadataCleared"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "(Additional) funds have been approved for transfer to a destination account."] + pub struct ApprovedTransfer { + pub asset_id: approved_transfer::AssetId, + pub source: approved_transfer::Source, + pub delegate: approved_transfer::Delegate, + pub amount: approved_transfer::Amount, + } + pub mod approved_transfer { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Source = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TeamChanged { + impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovedTransfer { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "TeamChanged"; + const EVENT: &'static str = "ApprovedTransfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19889,19 +18890,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The owner changed."] - pub struct OwnerChanged { - pub asset_id: owner_changed::AssetId, - pub owner: owner_changed::Owner, + #[doc = "An approval for account `delegate` was cancelled by `owner`."] + pub struct ApprovalCancelled { + pub asset_id: approval_cancelled::AssetId, + pub owner: approval_cancelled::Owner, + pub delegate: approval_cancelled::Delegate, } - pub mod owner_changed { + pub mod approval_cancelled { use super::runtime_types; pub type AssetId = ::core::primitive::u32; pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OwnerChanged { + impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovalCancelled { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "OwnerChanged"; + const EVENT: &'static str = "ApprovalCancelled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19910,19 +18913,26 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some account `who` was frozen."] - pub struct Frozen { - pub asset_id: frozen::AssetId, - pub who: frozen::Who, + #[doc = "An `amount` was transferred in its entirety from `owner` to `destination` by"] + #[doc = "the approved `delegate`."] + pub struct TransferredApproved { + pub asset_id: transferred_approved::AssetId, + pub owner: transferred_approved::Owner, + pub delegate: transferred_approved::Delegate, + pub destination: transferred_approved::Destination, + pub amount: transferred_approved::Amount, } - pub mod frozen { + pub mod transferred_approved { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Destination = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Frozen { + impl ::subxt::ext::subxt_core::events::StaticEvent for TransferredApproved { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Frozen"; + const EVENT: &'static str = "TransferredApproved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19931,19 +18941,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 = "Some account `who` was thawed."] - pub struct Thawed { - pub asset_id: thawed::AssetId, - pub who: thawed::Who, + #[doc = "An asset has had its attributes changed by the `Force` origin."] + pub struct AssetStatusChanged { + pub asset_id: asset_status_changed::AssetId, } - pub mod thawed { + pub mod asset_status_changed { 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 Thawed { + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetStatusChanged { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Thawed"; + const EVENT: &'static str = "AssetStatusChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19952,17 +18960,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some asset `asset_id` was frozen."] - pub struct AssetFrozen { - pub asset_id: asset_frozen::AssetId, + #[doc = "The min_balance of an asset has been updated by the asset owner."] + pub struct AssetMinBalanceChanged { + pub asset_id: asset_min_balance_changed::AssetId, + pub new_min_balance: asset_min_balance_changed::NewMinBalance, } - pub mod asset_frozen { + pub mod asset_min_balance_changed { use super::runtime_types; pub type AssetId = ::core::primitive::u32; + pub type NewMinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetFrozen { + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetMinBalanceChanged { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetFrozen"; + const EVENT: &'static str = "AssetMinBalanceChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19971,17 +18981,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 = "Some asset `asset_id` was thawed."] - pub struct AssetThawed { - pub asset_id: asset_thawed::AssetId, + #[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 asset_thawed { + 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 AssetThawed { + impl ::subxt::ext::subxt_core::events::StaticEvent for Touched { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetThawed"; + const EVENT: &'static str = "Touched"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19990,21 +19004,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Accounts were destroyed for given asset."] - pub struct AccountsDestroyed { - pub asset_id: accounts_destroyed::AssetId, - pub accounts_destroyed: accounts_destroyed::AccountsDestroyed, - pub accounts_remaining: accounts_destroyed::AccountsRemaining, + #[doc = "Some account `who` was blocked."] + pub struct Blocked { + pub asset_id: blocked::AssetId, + pub who: blocked::Who, } - pub mod accounts_destroyed { + pub mod blocked { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type AccountsDestroyed = ::core::primitive::u32; - pub type AccountsRemaining = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AccountsDestroyed { + impl ::subxt::ext::subxt_core::events::StaticEvent for Blocked { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AccountsDestroyed"; + const EVENT: &'static str = "Blocked"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20013,21 +19025,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 = "Approvals were destroyed for given asset."] - pub struct ApprovalsDestroyed { - pub asset_id: approvals_destroyed::AssetId, - pub approvals_destroyed: approvals_destroyed::ApprovalsDestroyed, - pub approvals_remaining: approvals_destroyed::ApprovalsRemaining, + #[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 approvals_destroyed { + pub mod deposited { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type ApprovalsDestroyed = ::core::primitive::u32; - pub type ApprovalsRemaining = ::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 ApprovalsDestroyed { + impl ::subxt::ext::subxt_core::events::StaticEvent for Deposited { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovalsDestroyed"; + const EVENT: &'static str = "Deposited"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20036,18 +19048,530 @@ 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 asset class is in the process of being destroyed."] - pub struct DestructionStarted { - pub asset_id: destruction_started::AssetId, + #[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 destruction_started { + 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, + ], + ) + } } - impl ::subxt::ext::subxt_core::events::StaticEvent for DestructionStarted { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "DestructionStarted"; + } + 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, @@ -20055,17 +19579,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 = "An asset class was destroyed."] - pub struct Destroyed { - pub asset_id: destroyed::AssetId, + #[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 destroyed { + pub mod held { 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; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Destroyed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Destroyed"; + 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, @@ -20074,19 +19604,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 asset class was force-created."] - pub struct ForceCreated { - pub asset_id: force_created::AssetId, - pub owner: force_created::Owner, + #[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 force_created { + pub mod released { use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; pub type AssetId = ::core::primitive::u32; - pub type Owner = ::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 ForceCreated { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ForceCreated"; + 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, @@ -20095,70 +19629,646 @@ 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 = "New metadata has been set for an asset."] - pub struct MetadataSet { - pub asset_id: metadata_set::AssetId, - pub name: metadata_set::Name, - pub symbol: metadata_set::Symbol, - pub decimals: metadata_set::Decimals, - pub is_frozen: metadata_set::IsFrozen, + #[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 metadata_set { + pub mod burned { use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; pub type AssetId = ::core::primitive::u32; - pub type Name = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Symbol = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Decimals = ::core::primitive::u8; - pub type IsFrozen = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataSet"; + pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; + pub type Amount = ::core::primitive::u128; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata has been cleared for an asset."] - pub struct MetadataCleared { - pub asset_id: metadata_cleared::AssetId, + impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { + const PALLET: &'static str = "AssetsHolder"; + const EVENT: &'static str = "Burned"; } - pub mod metadata_cleared { + } + pub mod storage { + use super::runtime_types; + pub mod types { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataCleared"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "(Additional) funds have been approved for transfer to a destination account."] - pub struct ApprovedTransfer { - pub asset_id: approved_transfer::AssetId, - pub source: approved_transfer::Source, - pub delegate: approved_transfer::Delegate, - pub amount: approved_transfer::Amount, + pub mod holds { + 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 Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod balances_on_hold { + 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 mod approved_transfer { + pub struct StorageApi; + impl StorageApi { + #[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::holds::Holds, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "AssetsHolder", + "Holds", + (), + [ + 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 = " A map that stores holds applied on an account for a given AssetId."] + pub fn holds_iter1( + &self, + _0: types::holds::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::holds::Param0, + >, + types::holds::Holds, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "AssetsHolder", + "Holds", + ::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, + ], + ) + } + #[doc = " A map that stores holds applied on an account for a given AssetId."] + pub fn holds( + &self, + _0: types::holds::Param0, + _1: types::holds::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::holds::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::holds::Param1, + >, + ), + types::holds::Holds, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::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), + ), + [ + 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 = " 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::balances_on_hold::BalancesOnHold, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "AssetsHolder", + "BalancesOnHold", + (), + [ + 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 = " 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::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::storage::address::StaticAddress::new_static( + "AssetsHolder", + "BalancesOnHold", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 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 = " 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::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::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), + ), + [ + 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, + ], + ) + } + } + } + } + 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; - pub type AssetId = ::core::primitive::u32; - pub type Source = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::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 = "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 (locked until proposal is removed after grace period)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "The proposal remains in storage even after execution/cancellation."] + #[doc = "Use `remove_expired()` or `claim_deposits()` after grace period to recover the deposit."] + 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 = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_hash`: Hash of the proposal to approve"] + pub struct Approve { + pub multisig_address: approve::MultisigAddress, + pub proposal_hash: approve::ProposalHash, + } + pub mod approve { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + } + 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 = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_hash`: Hash of the proposal to cancel"] + pub struct Cancel { + pub multisig_address: cancel::MultisigAddress, + pub proposal_hash: cancel::ProposalHash, + } + pub mod cancel { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + } + 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 a proposal and return deposit to proposer"] + #[doc = ""] + #[doc = "Can only be called by signers of the multisig."] + #[doc = ""] + #[doc = "Can be used to clean up proposals that are:"] + #[doc = "- Active and expired (past expiry block)"] + #[doc = "- Executed (status changed to Executed)"] + #[doc = "- Cancelled (status changed to Cancelled)"] + #[doc = ""] + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows signers to help clean up storage even if proposer is inactive."] + #[doc = ""] + #[doc = "This enforces storage cleanup - users must remove old proposals to recover deposits."] + pub struct RemoveExpired { + pub multisig_address: remove_expired::MultisigAddress, + pub proposal_hash: remove_expired::ProposalHash, + } + pub mod remove_expired { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + } + 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 cancelled, executed, and expired proposals"] + #[doc = ""] + #[doc = "This is a batch operation that removes all proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Executed, Cancelled, or Active+Expired"] + #[doc = "- Grace period has elapsed since status changed"] + #[doc = ""] + #[doc = "Returns all proposal deposits to the proposer in a single transaction."] + #[doc = "This enforces storage cleanup - users must actively clean up to recover deposits."] + pub struct ClaimDeposits { + pub multisig_address: claim_deposits::MultisigAddress, + } + pub mod claim_deposits { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + } + 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 = "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 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"; + } } - impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovedTransfer { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovedTransfer"; + pub struct TransactionApi; + impl TransactionApi { + #[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 fn create_multisig( + &self, + 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 }, + [ + 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 = "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 (locked until proposal is removed after grace period)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "The proposal remains in storage even after execution/cancellation."] + #[doc = "Use `remove_expired()` or `claim_deposits()` after grace period to recover the deposit."] + pub fn propose( + &self, + 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 }, + [ + 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 = "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 = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_hash`: Hash of the proposal to approve"] + pub fn approve( + &self, + multisig_address: types::approve::MultisigAddress, + proposal_hash: types::approve::ProposalHash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "approve", + types::Approve { multisig_address, proposal_hash }, + [ + 238u8, 153u8, 178u8, 75u8, 231u8, 35u8, 44u8, 235u8, 156u8, 34u8, + 178u8, 246u8, 232u8, 103u8, 83u8, 175u8, 172u8, 172u8, 143u8, 11u8, + 92u8, 150u8, 49u8, 101u8, 59u8, 90u8, 240u8, 255u8, 215u8, 247u8, 19u8, + 30u8, + ], + ) + } + #[doc = "Cancel a proposed transaction (only by proposer)"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_hash`: Hash of the proposal to cancel"] + pub fn cancel( + &self, + multisig_address: types::cancel::MultisigAddress, + proposal_hash: types::cancel::ProposalHash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "cancel", + types::Cancel { multisig_address, proposal_hash }, + [ + 8u8, 55u8, 236u8, 245u8, 9u8, 186u8, 177u8, 255u8, 176u8, 215u8, 18u8, + 221u8, 16u8, 31u8, 93u8, 224u8, 218u8, 147u8, 100u8, 128u8, 16u8, + 251u8, 173u8, 46u8, 186u8, 2u8, 146u8, 210u8, 111u8, 39u8, 60u8, 171u8, + ], + ) + } + #[doc = "Remove a proposal and return deposit to proposer"] + #[doc = ""] + #[doc = "Can only be called by signers of the multisig."] + #[doc = ""] + #[doc = "Can be used to clean up proposals that are:"] + #[doc = "- Active and expired (past expiry block)"] + #[doc = "- Executed (status changed to Executed)"] + #[doc = "- Cancelled (status changed to Cancelled)"] + #[doc = ""] + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows signers to help clean up storage even if proposer is inactive."] + #[doc = ""] + #[doc = "This enforces storage cleanup - users must remove old proposals to recover deposits."] + pub fn remove_expired( + &self, + multisig_address: types::remove_expired::MultisigAddress, + proposal_hash: types::remove_expired::ProposalHash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "remove_expired", + types::RemoveExpired { multisig_address, proposal_hash }, + [ + 226u8, 97u8, 94u8, 56u8, 242u8, 15u8, 151u8, 120u8, 156u8, 64u8, 92u8, + 126u8, 230u8, 75u8, 171u8, 15u8, 76u8, 89u8, 211u8, 85u8, 129u8, 123u8, + 9u8, 93u8, 157u8, 237u8, 76u8, 218u8, 55u8, 76u8, 204u8, 240u8, + ], + ) + } + #[doc = "Claim all deposits from cancelled, executed, and expired proposals"] + #[doc = ""] + #[doc = "This is a batch operation that removes all proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Executed, Cancelled, or Active+Expired"] + #[doc = "- Grace period has elapsed since status changed"] + #[doc = ""] + #[doc = "Returns all proposal deposits to the proposer in a single transaction."] + #[doc = "This enforces storage cleanup - users must actively clean up to recover deposits."] + pub fn claim_deposits( + &self, + 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 }, + [ + 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 = "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, + 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 }, + [ + 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, + ], + ) + } } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_multisig::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, @@ -20166,21 +20276,28 @@ 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 approval for account `delegate` was cancelled by `owner`."] - pub struct ApprovalCancelled { - pub asset_id: approval_cancelled::AssetId, - pub owner: approval_cancelled::Owner, - pub delegate: approval_cancelled::Delegate, - } - pub mod approval_cancelled { + #[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 AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; + 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 ApprovalCancelled { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovalCancelled"; + 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, @@ -20189,26 +20306,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 `amount` was transferred in its entirety from `owner` to `destination` by"] - #[doc = "the approved `delegate`."] - pub struct TransferredApproved { - pub asset_id: transferred_approved::AssetId, - pub owner: transferred_approved::Owner, - pub delegate: transferred_approved::Delegate, - pub destination: transferred_approved::Destination, - pub amount: transferred_approved::Amount, + #[doc = "A proposal has been created"] + pub struct ProposalCreated { + pub multisig_address: proposal_created::MultisigAddress, + pub proposer: proposal_created::Proposer, + pub proposal_hash: proposal_created::ProposalHash, } - pub mod transferred_approved { + pub mod proposal_created { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Destination = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransferredApproved { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "TransferredApproved"; + 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, @@ -20217,17 +20329,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 = "An asset has had its attributes changed by the `Force` origin."] - pub struct AssetStatusChanged { - pub asset_id: asset_status_changed::AssetId, - } - pub mod asset_status_changed { + #[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_hash: proposal_approved::ProposalHash, + pub approvals_count: proposal_approved::ApprovalsCount, + } + pub mod proposal_approved { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Approver = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + pub type ApprovalsCount = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetStatusChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetStatusChanged"; + 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, @@ -20236,19 +20354,31 @@ 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 min_balance of an asset has been updated by the asset owner."] - pub struct AssetMinBalanceChanged { - pub asset_id: asset_min_balance_changed::AssetId, - pub new_min_balance: asset_min_balance_changed::NewMinBalance, - } - pub mod asset_min_balance_changed { + #[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_hash: proposal_executed::ProposalHash, + 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 AssetId = ::core::primitive::u32; - pub type NewMinBalance = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + 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 AssetMinBalanceChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetMinBalanceChanged"; + 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, @@ -20257,21 +20387,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 = "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 = "A proposal has been cancelled by the proposer"] + pub struct ProposalCancelled { + pub multisig_address: proposal_cancelled::MultisigAddress, + pub proposer: proposal_cancelled::Proposer, + pub proposal_hash: proposal_cancelled::ProposalHash, } - pub mod touched { + pub mod proposal_cancelled { 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; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Touched { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Touched"; + 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, @@ -20280,19 +20410,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 account `who` was blocked."] - pub struct Blocked { - pub asset_id: blocked::AssetId, - pub who: blocked::Who, - } - pub mod blocked { + #[doc = "Expired proposal was removed from storage"] + pub struct ProposalRemoved { + pub multisig_address: proposal_removed::MultisigAddress, + pub proposal_hash: proposal_removed::ProposalHash, + pub proposer: proposal_removed::Proposer, + pub removed_by: proposal_removed::RemovedBy, + } + pub mod proposal_removed { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + 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 Blocked { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Blocked"; + 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, @@ -20301,21 +20435,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 = "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 { + #[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 AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - 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 Deposited { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Deposited"; + 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, @@ -20324,392 +20462,208 @@ 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 = "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 withdrawn { + pub mod multisig_dissolved { 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; + 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 Withdrawn { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Withdrawn"; + 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 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 types { + use super::runtime_types; + pub mod global_nonce { 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 type GlobalNonce = ::core::primitive::u64; } - pub mod approvals { + pub mod multisigs { use super::runtime_types; - pub type Approvals = runtime_types::pallet_assets::types::Approval< - ::core::primitive::u128, + 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, >; - 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 type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod metadata { + pub mod proposals { use super::runtime_types; - pub type Metadata = runtime_types::pallet_assets::types::AssetMetadata< + 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 = ::core::primitive::u32; - } - pub mod next_asset_id { - use super::runtime_types; - pub type NextAssetId = ::core::primitive::u32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::subxt::ext::subxt_core::utils::H256; } } pub struct StorageApi; impl StorageApi { - #[doc = " Details of an asset."] - pub fn asset_iter( + #[doc = " Global nonce for generating unique multisig addresses"] + pub fn global_nonce( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::asset::Asset, - (), - (), + types::global_nonce::GlobalNonce, ::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", + "Multisig", + "GlobalNonce", (), [ - 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, + 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 = " 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 = " Multisigs stored by their generated address"] + pub fn multisigs_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::approvals::Approvals, + types::multisigs::Multisigs, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Approvals", + "Multisig", + "Multisigs", (), [ - 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, + 234u8, 188u8, 39u8, 221u8, 0u8, 221u8, 250u8, 110u8, 209u8, 84u8, + 132u8, 110u8, 2u8, 89u8, 153u8, 228u8, 59u8, 5u8, 8u8, 33u8, 85u8, + 129u8, 131u8, 102u8, 242u8, 134u8, 183u8, 172u8, 12u8, 102u8, 130u8, + 199u8, ], ) } - #[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 = " Multisigs stored by their generated address"] + pub fn multisigs( &self, - _0: types::approvals::Param0, + _0: types::multisigs::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::approvals::Param0, + types::multisigs::Param0, >, - types::approvals::Approvals, - (), - (), + types::multisigs::Multisigs, ::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), - ), + "Multisig", + "Multisigs", + ::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, + 234u8, 188u8, 39u8, 221u8, 0u8, 221u8, 250u8, 110u8, 209u8, 84u8, + 132u8, 110u8, 2u8, 89u8, 153u8, 228u8, 59u8, 5u8, 8u8, 33u8, 85u8, + 129u8, 131u8, 102u8, 242u8, 134u8, 183u8, 172u8, 12u8, 102u8, 130u8, + 199u8, ], ) } - #[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 = " Proposals indexed by (multisig_address, proposal_hash)"] + pub fn proposals_iter( &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, (), + types::proposals::Proposals, (), - > { - ::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", + "Multisig", + "Proposals", (), [ - 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, + 236u8, 76u8, 63u8, 186u8, 167u8, 133u8, 151u8, 75u8, 46u8, 48u8, 84u8, + 214u8, 219u8, 224u8, 189u8, 213u8, 2u8, 165u8, 43u8, 197u8, 153u8, + 118u8, 17u8, 249u8, 238u8, 109u8, 252u8, 214u8, 166u8, 25u8, 67u8, + 187u8, ], ) } - #[doc = " Metadata of an asset."] - pub fn metadata( + #[doc = " Proposals indexed by (multisig_address, proposal_hash)"] + pub fn proposals_iter1( &self, - _0: types::metadata::Param0, + _0: types::proposals::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata::Param0, + types::proposals::Param0, >, - types::metadata::Metadata, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, + types::proposals::Proposals, (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Metadata", + "Multisig", + "Proposals", ::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, + 236u8, 76u8, 63u8, 186u8, 167u8, 133u8, 151u8, 75u8, 46u8, 48u8, 84u8, + 214u8, 219u8, 224u8, 189u8, 213u8, 2u8, 165u8, 43u8, 197u8, 153u8, + 118u8, 17u8, 249u8, 238u8, 109u8, 252u8, 214u8, 166u8, 25u8, 67u8, + 187u8, ], ) } - #[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( + #[doc = " Proposals indexed by (multisig_address, proposal_hash)"] + pub fn proposals( &self, + _0: types::proposals::Param0, + _1: types::proposals::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_asset_id::NextAssetId, + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::proposals::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::proposals::Param1, + >, + ), + types::proposals::Proposals, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "NextAssetId", - (), + "Multisig", + "Proposals", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 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, + 236u8, 76u8, 63u8, 186u8, 167u8, 133u8, 151u8, 75u8, 46u8, 48u8, 84u8, + 214u8, 219u8, 224u8, 189u8, 213u8, 2u8, 165u8, 43u8, 197u8, 153u8, + 118u8, 17u8, 249u8, 238u8, 109u8, 252u8, 214u8, 166u8, 25u8, 67u8, + 187u8, ], ) } @@ -20719,17 +20673,15 @@ pub mod api { 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( + #[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( - "Assets", - "RemoveItemsLimit", + "Multisig", + "MaxSigners", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -20738,97 +20690,50 @@ pub mod api { ], ) } - #[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( + #[doc = " Maximum number of active (open) proposals per multisig at any given time"] + pub fn max_active_proposals( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "MetadataDepositPerByte", + "Multisig", + "MaxActiveProposals", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = " The amount of funds that must be reserved when creating a new approval."] - pub fn approval_deposit( + #[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::u128, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "ApprovalDeposit", + "Multisig", + "MaxTotalProposalsInStorage", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = " The maximum length of a name or symbol stored on-chain."] - pub fn string_limit( + #[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( - "Assets", - "StringLimit", + "Multisig", + "MaxCallSize", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -20837,273 +20742,125 @@ pub mod api { ], ) } - } - } - } - 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 held { - 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; - } - 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, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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 { - 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; - } - 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, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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, - } - pub mod burned { - 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; - } - 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 holds { - 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 Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod balances_on_hold { - 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; + #[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, + ], + ) } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " A map that stores holds applied on an account for a given AssetId."] - pub fn holds_iter( + #[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::storage::address::StaticAddress< - (), - types::holds::Holds, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "Holds", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "MultisigDeposit", [ - 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 holds applied on an account for a given AssetId."] - pub fn holds_iter1( + #[doc = " Deposit required per proposal (returned on execute or cancel)"] + pub fn proposal_deposit( &self, - _0: types::holds::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param0, - >, - types::holds::Holds, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "Holds", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "ProposalDeposit", [ - 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 holds applied on an account for a given AssetId."] - pub fn holds( + #[doc = " Fee charged for creating a proposal (non-refundable, paid always)"] + pub fn proposal_fee( &self, - _0: types::holds::Param0, - _1: types::holds::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param1, - >, - ), - types::holds::Holds, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "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, ], ) } @@ -23922,7 +23679,7 @@ pub mod api { } } } - pub mod pallet_merkle_airdrop { + pub mod pallet_mining_rewards { use super::runtime_types; pub mod pallet { use super::runtime_types; @@ -23937,89 +23694,143 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub enum Call { + #[doc = "The `Event` enum of this pallet"] + pub enum Event { #[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 = "A miner has been identified for a block"] + MinerRewarded { + miner: ::subxt::ext::subxt_core::utils::AccountId32, + reward: ::core::primitive::u128, }, #[codec(index = 1)] - #[doc = "Fund an existing airdrop with tokens."] + #[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; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 = "Create a new multisig account"] #[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 = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] #[doc = ""] - #[doc = "# Parameters"] + #[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 = "Propose a transaction to be executed by the multisig"] #[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 = "- `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 (locked until proposal is removed after grace period)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "The proposal remains in storage even after execution/cancellation."] + #[doc = "Use `remove_expired()` or `claim_deposits()` after grace period to recover the deposit."] + 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 = "# Errors"] + #[doc = "If this approval brings the total approvals to or above the threshold,"] + #[doc = "the transaction will be automatically executed."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - fund_airdrop { - airdrop_id: ::core::primitive::u32, - amount: ::core::primitive::u128, + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_hash`: Hash of the proposal to approve"] + approve { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_hash: ::subxt::ext::subxt_core::utils::H256, }, - #[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 = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_hash`: Hash of the proposal to cancel"] + cancel { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_hash: ::subxt::ext::subxt_core::utils::H256, + }, + #[codec(index = 4)] + #[doc = "Remove a proposal and return deposit to proposer"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Can only be called by signers of the multisig."] #[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 = "Can be used to clean up proposals that are:"] + #[doc = "- Active and expired (past expiry block)"] + #[doc = "- Executed (status changed to Executed)"] + #[doc = "- Cancelled (status changed to Cancelled)"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows signers to help clean up storage even if proposer is inactive."] #[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 = "This enforces storage cleanup - users must remove old proposals to recover deposits."] + remove_expired { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_hash: ::subxt::ext::subxt_core::utils::H256, }, - #[codec(index = 3)] - #[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."] + #[codec(index = 5)] + #[doc = "Claim all deposits from cancelled, executed, and expired proposals"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "This is a batch operation that removes all proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Executed, Cancelled, or Active+Expired"] + #[doc = "- Grace period has elapsed since status changed"] #[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."] + #[doc = "This enforces storage cleanup - users must actively clean up to recover deposits."] + 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, @@ -24035,20 +23846,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 active proposals for this multisig"] + TooManyActiveProposals, + #[codec(index = 18)] + #[doc = "Too many total proposals in storage for this multisig (cleanup required)"] + TooManyProposalsInStorage, + #[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, @@ -24064,39 +23935,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_hash: ::subxt::ext::subxt_core::utils::H256, }, #[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_hash: ::subxt::ext::subxt_core::utils::H256, + 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_hash: ::subxt::ext::subxt_core::utils::H256, + 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_hash: ::subxt::ext::subxt_core::utils::H256, + }, + #[codec(index = 5)] + #[doc = "Expired proposal was removed from storage"] + ProposalRemoved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_hash: ::subxt::ext::subxt_core::utils::H256, + 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( @@ -24106,47 +24015,45 @@ 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> { + 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 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 { @@ -27005,240 +26912,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 primitive_types { use super::runtime_types; #[derive( @@ -27287,6 +26960,23 @@ pub mod api { } } } + pub mod qp_header { + 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 Header<_0> { + pub parent_hash: ::subxt::ext::subxt_core::utils::H256, + pub number: _0, + pub state_root: ::subxt::ext::subxt_core::utils::H256, + pub extrinsics_root: ::subxt::ext::subxt_core::utils::H256, + pub digest: runtime_types::sp_runtime::generic::digest::Digest, + } + } pub mod qp_poseidon { use super::runtime_types; #[derive( @@ -27424,8 +27114,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)] @@ -27442,14 +27130,14 @@ 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)] Recovery(runtime_types::pallet_recovery::pallet::Call), #[codec(index = 21)] Assets(runtime_types::pallet_assets::pallet::Call), + #[codec(index = 23)] + Multisig(runtime_types::pallet_multisig::pallet::Call), } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -27465,8 +27153,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)] @@ -27483,8 +27169,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)] @@ -27493,6 +27177,8 @@ pub mod api { Assets(runtime_types::pallet_assets::pallet::Error), #[codec(index = 22)] AssetsHolder(runtime_types::pallet_assets_holder::pallet::Error), + #[codec(index = 23)] + Multisig(runtime_types::pallet_multisig::pallet::Error), } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -27514,8 +27200,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)] @@ -27532,8 +27216,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)] @@ -27542,6 +27224,8 @@ pub mod api { Assets(runtime_types::pallet_assets::pallet::Event), #[codec(index = 22)] AssetsHolder(runtime_types::pallet_assets_holder::pallet::Event), + #[codec(index = 23)] + Multisig(runtime_types::pallet_multisig::pallet::Event), } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -28294,28 +27978,6 @@ pub mod api { Mortal255(::core::primitive::u8), } } - pub mod header { - 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 Header<_0> { - pub parent_hash: ::subxt::ext::subxt_core::utils::H256, - #[codec(compact)] - pub number: _0, - pub state_root: ::subxt::ext::subxt_core::utils::H256, - pub extrinsics_root: ::subxt::ext::subxt_core::utils::H256, - pub digest: runtime_types::sp_runtime::generic::digest::Digest, - } - } } pub mod proving_trie { use super::runtime_types; diff --git a/src/cli/mod.rs b/src/cli/mod.rs index a5c768e..05982f0 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 multisig; pub mod preimage; pub mod recovery; pub mod referenda; @@ -79,6 +80,10 @@ pub enum Commands { #[command(subcommand)] Recovery(recovery::RecoveryCommands), + /// Multisig commands (multi-signature wallets) + #[command(subcommand)] + Multisig(multisig::MultisigCommands), + /// Scheduler commands #[command(subcommand)] Scheduler(scheduler::SchedulerCommands), @@ -269,6 +274,8 @@ pub async fn execute_command( high_security::handle_high_security_command(hs_cmd, node_url, execution_mode).await, Commands::Recovery(recovery_cmd) => recovery::handle_recovery_command(recovery_cmd, node_url, execution_mode).await, + Commands::Multisig(multisig_cmd) => + multisig::handle_multisig_command(multisig_cmd, node_url, execution_mode).await, Commands::Scheduler(scheduler_cmd) => scheduler::handle_scheduler_command(scheduler_cmd, node_url, execution_mode).await, Commands::Storage(storage_cmd) => diff --git a/src/cli/multisig.rs b/src/cli/multisig.rs new file mode 100644 index 0000000..2498db5 --- /dev/null +++ b/src/cli/multisig.rs @@ -0,0 +1,1062 @@ +use crate::{ + chain::quantus_subxt::{self}, + cli::common::ExecutionMode, + log_error, log_print, log_success, log_verbose, +}; +use clap::Subcommand; +use colored::Colorize; +use hex; +use sp_core::crypto::{AccountId32 as SpAccountId32, Ss58Codec}; +use subxt::utils::H256; + +// Base unit (QUAN) decimals for amount conversions +const QUAN_DECIMALS: u128 = 1_000_000_000_000; // 10^12 + +/// Multisig-related commands +#[derive(Subcommand, Debug)] +pub enum MultisigCommands { + /// Create a new multisig account + Create { + /// List of signer addresses (SS58 or wallet names), comma-separated + #[arg(long)] + signers: String, + + /// Number of approvals required to execute transactions + #[arg(long)] + threshold: u32, + + /// Wallet name to pay for multisig creation + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file (for scripting) + #[arg(long)] + password_file: Option, + }, + + /// Propose a transaction to be executed by the multisig + Propose { + /// Multisig account address (SS58 format) + #[arg(long)] + address: String, + + /// Pallet name for the call (e.g., "Balances") + #[arg(long)] + pallet: String, + + /// Call/function name (e.g., "transfer_allow_death") + #[arg(long)] + call: String, + + /// Arguments as JSON array (e.g., '["5GrwvaEF...", "1000000000000"]') + #[arg(long)] + args: Option, + + /// Expiry block number (when this proposal expires) + #[arg(long)] + expiry: u32, + + /// Proposer wallet name (must be a signer) + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file + #[arg(long)] + password_file: Option, + }, + + /// Approve a proposed transaction + Approve { + /// Multisig account address + #[arg(long)] + address: String, + + /// Proposal hash to approve + #[arg(long)] + proposal_hash: String, + + /// Approver wallet name (must be a signer) + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file + #[arg(long)] + password_file: Option, + }, + + /// Cancel a proposed transaction (only by proposer) + Cancel { + /// Multisig account address + #[arg(long)] + address: String, + + /// Proposal hash to cancel + #[arg(long)] + proposal_hash: String, + + /// Wallet name (must be the proposer) + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file + #[arg(long)] + password_file: Option, + }, + + /// Remove an expired/executed/cancelled proposal + RemoveExpired { + /// Multisig account address + #[arg(long)] + address: String, + + /// Proposal hash to remove + #[arg(long)] + proposal_hash: String, + + /// Wallet name (must be a signer) + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file + #[arg(long)] + password_file: Option, + }, + + /// Claim all deposits from removable proposals (batch operation) + ClaimDeposits { + /// Multisig account address + #[arg(long)] + address: String, + + /// Wallet name (must be the proposer) + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file + #[arg(long)] + password_file: Option, + }, + + /// Dissolve a multisig and recover the creation deposit + Dissolve { + /// Multisig account address + #[arg(long)] + address: String, + + /// Wallet name (must be creator or a signer) + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file + #[arg(long)] + password_file: Option, + }, + + /// Query multisig information + Info { + /// Multisig account address + #[arg(long)] + address: String, + }, + + /// Query proposal information + ProposalInfo { + /// Multisig account address + #[arg(long)] + address: String, + + /// Proposal hash + #[arg(long)] + proposal_hash: String, + }, + + /// List all proposals for a multisig + ListProposals { + /// Multisig account address + #[arg(long)] + address: String, + }, +} + +/// Handle multisig command +pub async fn handle_multisig_command( + command: MultisigCommands, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + match command { + MultisigCommands::Create { signers, threshold, from, password, password_file } => + handle_create_multisig( + signers, + threshold, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::Propose { + address, + pallet, + call, + args, + expiry, + from, + password, + password_file, + } => + handle_propose( + address, + pallet, + call, + args, + expiry, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::Approve { address, proposal_hash, from, password, password_file } => + handle_approve( + address, + proposal_hash, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::Cancel { address, proposal_hash, from, password, password_file } => + handle_cancel( + address, + proposal_hash, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::RemoveExpired { + address, + proposal_hash, + from, + password, + password_file, + } => + handle_remove_expired( + address, + proposal_hash, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::ClaimDeposits { address, from, password, password_file } => + handle_claim_deposits(address, from, password, password_file, node_url, execution_mode) + .await, + MultisigCommands::Dissolve { address, from, password, password_file } => + handle_dissolve(address, from, password, password_file, node_url, execution_mode).await, + MultisigCommands::Info { address } => handle_info(address, node_url).await, + MultisigCommands::ProposalInfo { address, proposal_hash } => + handle_proposal_info(address, proposal_hash, node_url).await, + MultisigCommands::ListProposals { address } => + handle_list_proposals(address, node_url).await, + } +} + +/// Create a new multisig account +async fn handle_create_multisig( + signers: String, + threshold: u32, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿ” {} Creating multisig...", "MULTISIG".bright_magenta().bold()); + + // Parse signers - convert to AccountId32 + let signer_addresses: Vec = signers + .split(',') + .map(|s| s.trim()) + .map(|addr| { + // Resolve wallet name or SS58 address to SS58 string + let ss58_str = crate::cli::common::resolve_address(addr)?; + // Convert SS58 to AccountId32 + let (account_id, _) = + SpAccountId32::from_ss58check_with_version(&ss58_str).map_err(|e| { + crate::error::QuantusError::Generic(format!( + "Invalid address '{}': {:?}", + addr, e + )) + })?; + // Convert to subxt AccountId32 + let bytes: [u8; 32] = *account_id.as_ref(); + Ok(subxt::ext::subxt_core::utils::AccountId32::from(bytes)) + }) + .collect::, crate::error::QuantusError>>()?; + + log_verbose!("Signers: {} addresses", signer_addresses.len()); + log_verbose!("Threshold: {}", threshold); + + // Validate inputs + if signer_addresses.is_empty() { + log_error!("โŒ At least one signer is required"); + return Err(crate::error::QuantusError::Generic("No signers provided".to_string())); + } + + if threshold == 0 { + log_error!("โŒ Threshold must be greater than zero"); + return Err(crate::error::QuantusError::Generic("Invalid threshold".to_string())); + } + + if threshold > signer_addresses.len() as u32 { + log_error!("โŒ Threshold cannot exceed number of signers"); + return Err(crate::error::QuantusError::Generic("Threshold too high".to_string())); + } + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let create_tx = quantus_subxt::api::tx() + .multisig() + .create_multisig(signer_addresses.clone(), threshold); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + create_tx, + None, // no tip + execution_mode, + ) + .await?; + + log_success!("โœ… Multisig creation transaction submitted"); + log_print!(""); + log_print!( + "๐Ÿ’ก {} The multisig address will be generated deterministically", + "NOTE".bright_blue().bold() + ); + log_print!(" Check the events to find the multisig address"); + log_print!(""); + + Ok(()) +} + +/// Propose a transaction +async fn handle_propose( + multisig_address: String, + pallet: String, + call: String, + args: Option, + expiry: u32, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿ“ {} Creating proposal...", "MULTISIG".bright_magenta().bold()); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Parse arguments + let args_vec: Vec = if let Some(args_str) = args { + serde_json::from_str(&args_str).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid JSON for arguments: {}", e)) + })? + } else { + vec![] + }; + + log_verbose!("Multisig: {}", multisig_ss58); + log_verbose!("Call: {}::{}", pallet, call); + log_verbose!("Expiry: block {}", expiry); + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build the call data using runtime metadata + let call_data = build_runtime_call(&quantus_client, &pallet, &call, args_vec).await?; + + log_verbose!("Call data size: {} bytes", call_data.len()); + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Build transaction + let propose_tx = + quantus_subxt::api::tx().multisig().propose(multisig_address, call_data, expiry); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + propose_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Proposal submitted"); + log_print!(""); + log_print!("๐Ÿ’ก {} Check the events to find the proposal hash", "NOTE".bright_blue().bold()); + log_print!(""); + + Ok(()) +} + +/// Approve a proposal +async fn handle_approve( + multisig_address: String, + proposal_hash: String, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("โœ… {} Approving proposal...", "MULTISIG".bright_magenta().bold()); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + let hash = parse_hash(&proposal_hash)?; + + log_verbose!("Multisig: {}", multisig_ss58); + log_verbose!("Proposal hash: {}", proposal_hash); + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let approve_tx = quantus_subxt::api::tx().multisig().approve(multisig_address, hash); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + approve_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Approval submitted"); + log_print!(" If threshold is reached, the proposal will execute automatically"); + + Ok(()) +} + +/// Cancel a proposal +async fn handle_cancel( + multisig_address: String, + proposal_hash: String, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿšซ {} Cancelling proposal...", "MULTISIG".bright_magenta().bold()); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + let hash = parse_hash(&proposal_hash)?; + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let cancel_tx = quantus_subxt::api::tx().multisig().cancel(multisig_address, hash); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + cancel_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Proposal cancelled"); + log_print!(" Use remove-expired to cleanup and recover deposit"); + + Ok(()) +} + +/// Remove an expired/executed/cancelled proposal +async fn handle_remove_expired( + multisig_address: String, + proposal_hash: String, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿงน {} Removing proposal...", "MULTISIG".bright_magenta().bold()); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + let hash = parse_hash(&proposal_hash)?; + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let remove_tx = quantus_subxt::api::tx().multisig().remove_expired(multisig_address, hash); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + remove_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Proposal removed and deposit returned"); + + Ok(()) +} + +/// Claim all deposits (batch cleanup) +async fn handle_claim_deposits( + multisig_address: String, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿ’ฐ {} Claiming deposits...", "MULTISIG".bright_magenta().bold()); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let claim_tx = quantus_subxt::api::tx().multisig().claim_deposits(multisig_address); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + claim_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Deposits claimed"); + log_print!(" All removable proposals have been cleaned up"); + + Ok(()) +} + +/// Dissolve a multisig +async fn handle_dissolve( + multisig_address: String, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿ—‘๏ธ {} Dissolving multisig...", "MULTISIG".bright_magenta().bold()); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let dissolve_tx = quantus_subxt::api::tx().multisig().dissolve_multisig(multisig_address); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + dissolve_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Multisig dissolved and deposit returned"); + + Ok(()) +} + +/// Query multisig information +async fn handle_info(multisig_address: String, node_url: &str) -> crate::error::Result<()> { + log_print!("๐Ÿ” {} Querying multisig info...", "MULTISIG".bright_magenta().bold()); + log_print!(""); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Query storage using direct fetch with explicit block hash + crate::log_verbose!("๐Ÿ” Querying multisig with address: {}", multisig_ss58); + crate::log_verbose!("๐Ÿ” Address bytes: {}", hex::encode(multisig_bytes)); + + // Get latest block hash explicitly + let latest_block_hash = quantus_client.get_latest_block().await?; + crate::log_verbose!("๐Ÿ“ฆ Latest block hash: {:?}", latest_block_hash); + + let storage_query = + quantus_subxt::api::storage().multisig().multisigs(multisig_address.clone()); + + let storage_at = quantus_client.client().storage().at(latest_block_hash); + + let multisig_data = storage_at.fetch(&storage_query).await?; + + crate::log_verbose!( + "๐Ÿ” Fetch result: {}", + if multisig_data.is_some() { "Found" } else { "Not found" } + ); + + match multisig_data { + Some(data) => { + log_print!("๐Ÿ“‹ {} Information:", "MULTISIG".bright_green().bold()); + log_print!(" Address: {}", multisig_ss58.bright_cyan()); + log_print!(" Threshold: {}", data.threshold.to_string().bright_yellow()); + log_print!(" Signers ({}):", data.signers.0.len().to_string().bright_yellow()); + for (i, signer) in data.signers.0.iter().enumerate() { + // Convert subxt AccountId32 to SS58 + let signer_bytes: &[u8; 32] = signer.as_ref(); + let signer_sp = SpAccountId32::from(*signer_bytes); + log_print!(" {}. {}", i + 1, signer_sp.to_ss58check().bright_cyan()); + } + log_print!(" Nonce: {}", data.nonce); + log_print!(" Proposal Nonce: {}", data.proposal_nonce); + // Convert creator to SS58 + let creator_bytes: &[u8; 32] = data.creator.as_ref(); + let creator_sp = SpAccountId32::from(*creator_bytes); + log_print!(" Creator: {}", creator_sp.to_ss58check().bright_cyan()); + log_print!(" Deposit: {} (locked)", format_balance(data.deposit)); + log_print!(" Last Activity: block {}", data.last_activity); + log_print!( + " Active Proposals: {}", + data.active_proposals.to_string().bright_yellow() + ); + }, + None => { + log_error!("โŒ Multisig not found at address: {}", multisig_ss58); + }, + } + + log_print!(""); + Ok(()) +} + +/// Query proposal information +async fn handle_proposal_info( + multisig_address: String, + proposal_hash: String, + node_url: &str, +) -> crate::error::Result<()> { + log_print!("๐Ÿ” {} Querying proposal info...", "MULTISIG".bright_magenta().bold()); + log_print!(""); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + let hash = parse_hash(&proposal_hash)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Get latest block hash explicitly + let latest_block_hash = quantus_client.get_latest_block().await?; + + // Query storage + let storage_query = quantus_subxt::api::storage() + .multisig() + .proposals(multisig_address.clone(), hash); + + let storage_at = quantus_client.client().storage().at(latest_block_hash); + let proposal_data = storage_at.fetch(&storage_query).await?; + + match proposal_data { + Some(data) => { + log_print!("๐Ÿ“ {} Information:", "PROPOSAL".bright_green().bold()); + log_print!(" Multisig: {}", multisig_ss58.bright_cyan()); + log_print!(" Proposal Hash: {}", proposal_hash.bright_yellow()); + // Convert proposer to SS58 + let proposer_bytes: &[u8; 32] = data.proposer.as_ref(); + let proposer_sp = SpAccountId32::from(*proposer_bytes); + log_print!(" Proposer: {}", proposer_sp.to_ss58check().bright_cyan()); + log_print!(" Call Size: {} bytes", data.call.0.len()); + log_print!(" Expiry: block {}", data.expiry); + log_print!(" Deposit: {} (locked)", format_balance(data.deposit)); + log_print!( + " Status: {}", + match data.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => + "Active".bright_green(), + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Executed => + "Executed".bright_blue(), + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => + "Cancelled".bright_red(), + } + ); + log_print!(" Approvals ({}):", data.approvals.0.len().to_string().bright_yellow()); + for (i, approver) in data.approvals.0.iter().enumerate() { + // Convert approver to SS58 + let approver_bytes: &[u8; 32] = approver.as_ref(); + let approver_sp = SpAccountId32::from(*approver_bytes); + log_print!(" {}. {}", i + 1, approver_sp.to_ss58check().bright_cyan()); + } + }, + None => { + log_error!("โŒ Proposal not found"); + }, + } + + log_print!(""); + Ok(()) +} + +/// List all proposals for a multisig +async fn handle_list_proposals( + multisig_address: String, + node_url: &str, +) -> crate::error::Result<()> { + log_print!("๐Ÿ“‹ {} Listing proposals...", "MULTISIG".bright_magenta().bold()); + log_print!(""); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Get latest block hash explicitly + let latest_block_hash = quantus_client.get_latest_block().await?; + + // Query all proposals for this multisig using prefix iteration + let storage = quantus_client.client().storage().at(latest_block_hash); + + // Use iter_key_values to iterate over the double map + let address = quantus_subxt::api::storage().multisig().proposals_iter1(multisig_address); + let mut proposals = storage.iter(address).await?; + + let mut count = 0; + let mut active_count = 0; + let mut executed_count = 0; + let mut cancelled_count = 0; + + while let Some(result) = proposals.next().await { + match result { + Ok(kv) => { + count += 1; + + let status_str = match kv.value.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => { + active_count += 1; + "Active".bright_green() + }, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Executed => { + executed_count += 1; + "Executed".bright_blue() + }, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => { + cancelled_count += 1; + "Cancelled".bright_red() + }, + }; + + // Extract hash from key_bytes - it's the second key in the double map + // Skip the storage prefix and first key (multisig address), get the hash (32 bytes) + let key_bytes = kv.key_bytes; + // The key_bytes contains: [storage_prefix][multisig_address(32)][hash(32)] + // We need to extract just the hash part + if key_bytes.len() >= 32 { + let hash_bytes = &key_bytes[key_bytes.len() - 32..]; + + log_print!("๐Ÿ“ Proposal #{}", count); + log_print!( + " Hash: {}", + format!("0x{}", hex::encode(hash_bytes)).bright_yellow() + ); + // Convert proposer to SS58 + let proposer_bytes: &[u8; 32] = kv.value.proposer.as_ref(); + let proposer_sp = SpAccountId32::from(*proposer_bytes); + log_print!(" Proposer: {}", proposer_sp.to_ss58check().bright_cyan()); + log_print!(" Status: {}", status_str); + log_print!(" Approvals: {}", kv.value.approvals.0.len()); + log_print!(" Expiry: block {}", kv.value.expiry); + log_print!(""); + } + }, + Err(e) => { + log_error!("Error reading proposal: {:?}", e); + }, + } + } + + if count == 0 { + log_print!(" No proposals found for this multisig"); + } else { + log_print!("๐Ÿ“Š {} Summary:", "PROPOSALS".bright_green().bold()); + log_print!(" Total: {}", count.to_string().bright_yellow()); + log_print!(" Active: {}", active_count.to_string().bright_green()); + log_print!(" Executed: {}", executed_count.to_string().bright_blue()); + log_print!(" Cancelled: {}", cancelled_count.to_string().bright_red()); + } + + log_print!(""); + Ok(()) +} + +/// Build runtime call data from pallet, call name, and arguments +async fn build_runtime_call( + quantus_client: &crate::chain::client::QuantusClient, + pallet: &str, + call: &str, + args: Vec, +) -> crate::error::Result> { + // Validate pallet/call exists in metadata + let metadata = quantus_client.client().metadata(); + let pallet_metadata = metadata.pallet_by_name(pallet).ok_or_else(|| { + crate::error::QuantusError::Generic(format!("Pallet '{}' not found in metadata", pallet)) + })?; + + log_verbose!("โœ… Found pallet '{}' with index {}", pallet, pallet_metadata.index()); + + // Find the call in the pallet + let call_metadata = pallet_metadata.call_variant_by_name(call).ok_or_else(|| { + crate::error::QuantusError::Generic(format!( + "Call '{}' not found in pallet '{}'", + call, pallet + )) + })?; + + log_verbose!("โœ… Found call '{}' with index {}", call, call_metadata.index); + + // For now, we'll construct a basic call using the generic approach + // This is a simplified implementation - in production, you'd want to handle all argument types + use codec::Encode; + + let mut call_data = Vec::new(); + // Pallet index + call_data.push(pallet_metadata.index()); + // Call index + call_data.push(call_metadata.index); + + // Encode arguments based on call type + // This is a simplified version - in production you'd need proper argument encoding + match (pallet, call) { + ("Balances", "transfer_allow_death") | ("Balances", "transfer_keep_alive") => { + if args.len() != 2 { + return Err(crate::error::QuantusError::Generic( + "Balances transfer requires 2 arguments: [to_address, amount]".to_string(), + )); + } + + let to_address = args[0].as_str().ok_or_else(|| { + crate::error::QuantusError::Generic( + "First argument must be a string (to_address)".to_string(), + ) + })?; + + // Parse amount - can be either string or number in JSON + let amount: u128 = if let Some(amount_str) = args[1].as_str() { + // If it's a string, parse it + amount_str.parse().map_err(|_| { + crate::error::QuantusError::Generic( + "Second argument must be a valid number (amount)".to_string(), + ) + })? + } else if let Some(amount_num) = args[1].as_u64() { + // If it's a number, use it directly + amount_num as u128 + } else { + // Try as_i64 for negative numbers (though we'll reject them) + return Err(crate::error::QuantusError::Generic( + "Second argument must be a number (amount)".to_string(), + )); + }; + + // Convert to AccountId32 + let (to_account_id, _) = SpAccountId32::from_ss58check_with_version(to_address) + .map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid to_address: {:?}", e)) + })?; + + // Convert to subxt AccountId32 + let to_account_id_bytes: [u8; 32] = *to_account_id.as_ref(); + let to_account_id_subxt = + subxt::ext::subxt_core::utils::AccountId32::from(to_account_id_bytes); + + // Encode as MultiAddress::Id + let multi_address: subxt::ext::subxt_core::utils::MultiAddress< + subxt::ext::subxt_core::utils::AccountId32, + (), + > = subxt::ext::subxt_core::utils::MultiAddress::Id(to_account_id_subxt); + + multi_address.encode_to(&mut call_data); + // Amount must be Compact encoded for Balance type + codec::Compact(amount).encode_to(&mut call_data); + }, + _ => { + return Err(crate::error::QuantusError::Generic(format!( + "Building call data for {}.{} is not yet implemented. Use a simpler approach or add support.", + pallet, call + ))); + }, + } + + Ok(call_data) +} + +/// Parse a hex hash string into H256 +fn parse_hash(hash_str: &str) -> crate::error::Result { + let hash_str = hash_str.trim_start_matches("0x"); + + if hash_str.len() != 64 { + return Err(crate::error::QuantusError::Generic(format!( + "Invalid hash length: expected 64 hex characters, got {}", + hash_str.len() + ))); + } + + let mut bytes = [0u8; 32]; + hex::decode_to_slice(hash_str, &mut bytes) + .map_err(|e| crate::error::QuantusError::Generic(format!("Invalid hex hash: {}", e)))?; + + Ok(H256::from(bytes)) +} + +/// Format balance for display +fn format_balance(balance: u128) -> String { + let quan = balance / QUAN_DECIMALS; + let remainder = balance % QUAN_DECIMALS; + + if remainder == 0 { + format!("{} QUAN", quan) + } else { + // Show up to 12 decimal places, removing trailing zeros + let decimal_str = format!("{:012}", remainder).trim_end_matches('0').to_string(); + format!("{}.{} QUAN", quan, decimal_str) + } +} diff --git a/src/quantus_metadata.scale b/src/quantus_metadata.scale index 0e8740a72063206e0373c3ad06b37ff657e98131..37893912f108332cbbcfb248f71bcd6f981ee251 100644 GIT binary patch delta 17830 zcmcJ13w%`7wfA0oP9VVqCz6l>5;=hcGLnQuf`%9%5rPB^ZxB!nL*_uHOlFdK0I|?9 zDk!%i;6Zn-dMhgJr4v@bYs6hZCb?R+_k&U$BvIoc{M5Sd3x10z=? z*zRiyXY1KYDP7q;K^aAv>a39FYxAto6!xh8Kw1SoF6xNq>c`Ut(?MP7Gs5u#U9Xq- z9jag1XE0w+;*Z2t{gyt%>0bSzJ`E~uUt(mdg4sB@Ob z@7E#<+pX{GTS0sD6Mf6+Sv^1fVtQVmnSRk2wJGY4_`<#w3VV%cZM!kNxy@>hi28e=5~f7TARXN zhun_UU86_G4Rw4(Pa4mE9al&n>wm1fRu9+YQ-;2!rae_xvh;WAn)TzC6)L%8&G=5O zsuU3IHm3g>FO_D`wYq=&Map=hW9Ye7|6+WlQcv`nF>K?6a%Bozg)T@=wHBBi*<);ER)1@3_uaEsILv9nc^UN;KkcIadd2(}qV8?;XIrE6 zZx&?G*LucPTODacx_b4%zByjaAMt#xKYf+J;`0{1DTj_;yp;Z?Z&^I8{0maAj#gi$ zUR<$+DUAJ%u|C__7mPV_7-Q+|YrMM{5$J+)kofEY$^+O6NOtzsrO=4Y9Yy;6SNrK` z_xaacZeo$A`<4VuRP~cf(lF@!Yld~ZuB{-RMf!x{uI?QFhYrftzY4yYo-ILFv0VM_ z_QfA+n06H_V9lH{(fTDj93Oe@EtNO8yf%^5~(LMUyk;P~2Ylv1GTP;VwJvz{Y z-TkZR+uVA5Zp||s{WpI1t&xLBahdyEQRdM;N_Wl(1~f3kIXBn_YlrO#lne9?Yb&Wx zcWxNo{fD(P9Q_YbX0-AWM$Q%(BT4b_?#0)yhp*1Ij54*5P_MW`%+a9hW zn&180BTZ>W%Y_(Jv1gbgy#XBR<7AC`<&&y@-Cj2}=@0I`6@M$AETh@@J4COP_;>&A&tnJ{q~FIX$Qbo;%(Oju-M{$stusx?>;C;`zc)Mbx_|lCpUB6; zU%0wAeEv6k=IvjW618W7#H)k61mm13KxyYc)=&(&% z{G0JK#hw;lGLbH@)gpdNJw0akq)II~iEcepdqo2^*ppMo|MUui0W=hLP@3&dxb(Yc z4~UmE((fI0QOc}6%|UjV@6Jg$XmH3e%CBvK=N-`!E_6EO!@CY>p|D{BVoscHV=iV) zjZ88IsvZ^QOtn33)zi`vgtyH~XL&+!j3by>^S3f}sRd+dje4ao98rVI?U7+M(&~w* zEuMfX$EeGLA+-3y36NQY>5*30q}HH6<^_Zq(Y9q;$biw_9ty7V_`_;Q>xlY7npcek zRc(#d5{+nTB;*N%JuT8x4>LE-Yt<4!Rgc#Th+!2AdEvOP!p!BNU>nFm)YEFf_WKQt zK!G|+UEvQxx71i52=yvIBw-nx0=8{Y5Y+DJl&lB_%0k-mXu#`P=GWBanx>X4i-rQ4 z*Ik|uRNI4LEtBeOZZ%t2FshhWQ&VrUuF-4x4%L*uKx?UuR?Fx@Ths0fbvk1-`Eq}- zWu?i2DZxFf_4|>QbS91Auyuj<8Olyf5(ghfZ zY_$&@O7L1T1X{EWVC1hgRSUEPz2L2EN)gQ=j4~<0ID;THU%-Q5;9f^X>CC%e9v;I zs=6ZNY0*?Ol5;;QAs8Y|iZv$XTB@2dRef!3n%9Tz;_q~`3`4;ZSOc)f7l496uOq<_ z;$u|?($+#I+n|`Eq4+JD-|vxHTE2wlhc$JniBz*mxVOZ;RE3%?ZSi}2v9@N5rm$@8 zjkRQQNNWL2avNzj2g>t3##YhN&q4dDY$BTFUZ|pcDCbl>F|Mv$Q*Xin+s#qnU5d)F zLDab1l%KgEXkPRh)DrQBf&QC zN9s_gt#ID*9_ssF=cK)c^1gtfJqUyfO6ugEmpIye5;;%Iq}F9h>Hms(j+_IN3|XIr zb!tg40Q#^=Eyjl2tTdKlM*jsG5B>`@nxs|t)H$2d@4zOX)k>XJPn4Djf5O^nzSu`vaE~vKnH8e!q6XLSY5l={~ zxepr`Rv$Vg*R*z#TGH-;oi?qGx=b1b_dR85gLzhX)sk?;6NyE`YD=ppu)fl{0vv5299Qq#3i zxjeEA0RG_WaN;Zi@vWM_J;{L{=Eb)>0Z^W8zJNUcR%zvIwh2rN;DBw>0M0T>1|z}8 zGRfK)&N{=cn%bZS{oYgtCryiOgvzU>RZ1Eq<$pIXX+;@?2+xPJ7H5JD$UJ>xrZR%d zrHPGR+Cz%=?hLb!4dzJxsLMQ&7VKZxZNrR$hd7>05+wg^9!oy~=LCd<^XQ4R7`*1Y@5)GJa>4(URun%~ndbv5jReFwKa zk)+DNO3pFVp(l2#H)ft!hG9%W3uxltkf2t;t4J}oa0D!|4hHV<^kJ}eAD z#C(x(`D8Er?Vx{E(g{2VsrFI7m~2f`OH9_gfwH}Ut=*qImkj3#N1m+!<*aIs))A9F zTpLoh;hF{<;4^IdASI`*k&a`DNkpo8KpY9RaYK)7$6$F>o)-qKkVCY+9Co3}$_(4y zCsfA>7_3P#O-1YyEPveC@6z5FTQT7}*)HGAIUuOh+LGn05mM-}=j*S$s(#Vjv+wz( z7NDiZHUxH%?^58_&&Xv@_C!2OZ-3b$dw3i&z`o`X~&esGd5K#msq3enX>Gikj{ z$$ZyL$B30P=o!+)sF^f_HpZ`;Nysd05+`TTR@x|Tz~)Cn>>(>zmMOlPO<5J25PHwi z!r(|c@>^Sx;HSHY($iN$4zFQrx`y#n@3)xs-5#`gJZju zQ4x>Lr!F*BEuaqk{CEM~mbZhbWI-^Z&4EV~f?u2i_rc$}Gd}$)u!8R(ao{&JSadF= zO1{&2`Q<{Ij)ZPt%iwcOlJB&VZ2lDGrBd4SuGCX&CJnzA!Do&w(&qNYBQR#`sYtJuhO{Q!BkF{-cY^#lS8K zo6kSO&qX)T_4xVO4RkRb7Vq3Zmnuhy?h(g`7l=!4r2hP{kvbLE-bh2}h>?~PKe~~M zVy~SwzRNMLL5u)Tt+ltnBqM(F=1{(+jJ=|eI(zq?)dNVxhD4L~td9%q@Q`whIH>}` z;w4qc9^X=b#wbx;4MS!o193hWD=ewCt+heUHJUf` ze?NgJaYXha`K&GtDgN85a$**;b@r;3H|%wu%c`c|tA+lBRcjNza%c&1gH6P`){46nQRMaMs1ns+BQD)`{wEUeW65fKeSGISAoB^T>3sB;y7u&r!@ZJyyZ>0Gbyp3a%A0vi; zxD|9d*#~0OO>`-ebS*d0u(8LnPbLLd*N&9lp|1sIE)tr+*l|)a(JU{WP7to*@P`?H z(m4B!#8WrX)%3W*Nza$Y^k2Cm7ooK>7wChrkIL+ZSDT%0P=;$NgTbIuBB`- z<`$YzmCX~Z$mL)K{xIVYAH*5{fvW}F$qMk~NJm#XE9CNiKmOD$v<;VKqHYVA|COI7RtpDiCwGlj`vBbg}X~sh?SijQ+vZFYS@)AF-Uo#9e4Lz3Ncb`4ldW~s zCT84EGy8Rb4i2VAxpZZ7#lHKgD7TXKf&h%;0vzrXCm*0eqW=SwkL5=_K;`|{ zamt^AY7m*kW$R?WOT-?aVg0%!&`!?Q8$c^^H(KyErNG-L$5#(1;Q5wqA{Qi|?(-Ii z%N`_mzfBUxM$WdHFrfIy?xz9xS-OKN2fj$BPkRv#vZ#NW^7`E+XWqftz1Hg6t<`s? ztiIg@v!mDQJGcdgc8F(o&_y{rCA96F?ZU6(tYFN=cE?Zcpv4Zphl|nAfcuf1l;?QT zmc`DUq{6NI^-gM|XGQf-si1!W7-ihxS1)1gd6BV;<|r?6nkBaHg0mjp1#LSl#4Z}s zpb?c?+Zf4wm}Dy9Wku^u|CA1qR2A z8C9^VrU;Axi67@EEEpU=`UtJ#{Dj#v;WJA(U#18LZ7J9LpZ8wob90%`xp?+5x(H=9 zA3sI~uqpkzv8fJ-vThoi|0)?6t1r*oOsY^IKVErW<|)nADWl95)1xUZY~6%-Ry zndMAj>sFq9i52)~oSow0SKZjPd&Q^SRFSopT(gW~B9Q4oebSKl6_3+B#M2!5J?=r` zn?0!g$q+|g$42o#L4&FeRavzuCS05Zt|n9{1R~@#4brPgHO`qQBPi+;vER{!{r8b8 ze`a7s5FVDovc%7Rhu9-mY<-1{*z(xB7ZX1;#@ ztQ0XHQY$MDAqy>ke%$*gBN1mi1ISCOIX)@U*=^iWId6MdJh^S9drG==N_$KuO z$ELlBNVH2l{1k*(D2_ZuBQVb3W%ko_#fV%-s#at>dZ~Z515y!pJVvGBHy~O3;%T~k zI+XiLYeS`6&%mA)_5fGh8(gsj$C&(qhp>;i#nOXRSzYEZZDXY)X&cMTF)mh#2adO~ z@^_qr;U6X+8t-7J(vVtlWFL*pgxgR=PI;)FAffE1Cx+KMC}&bMvT4L@%$QAWJ}dHO-xd2NP>*df;8(3d_rSZqEFFUj!|k~L8=2Y24c)%@Tkx|l~( zy8rSL4$w|fdWfbX*Yn+%QSq@+-2F1@J30+SO4eCQ(v_kl>x_k*jl{a}#PPb`1X*?% zp5n#?_$&CP#B-YX$6?eF&KAutBc;%DsjbFRBk!=5x+`U=JB+0cx!7HDCA{5hLadz& zvM+muZgkLg@yu_iviJ}==Xe4u8QWn_VQi=Q;AFdu2Pb2@jfD&w?%3lni)`YN-_nB| zxfDYy|6Nt7;xkpkYe?$u0$zF4arek!1zu^$I@6izXyXZZd%ingyAAXN!JNPk&pbzPC z{((a@d`PwG2QVp9LO$4sFr%VGF2|~vLv$o<--Tz`U&jqCf%AOAAx>HltNuino}UVl zeddT?_a|yr_~#DMeu9R?|Na+JX~35bDyD%DN1FM3*C%xMc^RmTR5GEiI4viBN`9Oj#=u{EN~4urh2@CN zpTbvjo}@lQauuq&97!AGGUm#_V+BsGaA(`Hpg&hso}{rjn6`gNm8RP=ND=Rbah$k* zOqualPtvJAyg(7xUk|JD$vIV4nn%EZR7YC@WFc2%zA3uZ7Oc zCzpAHG!{a#NwL+rGO0$fvAsz@eLQ8l>Ww==C~@L`3qD9uBAq5He8(wgD;CPZr9d!b zB$K^$GlG$ZKrp(ZRYttHvP6ic_|d3pMys8;m8q#!K5T@ld3FMKG45H!KmJ4|u|(6n zU~npu3XChaCfacA(}Hwh*sc%3CB1b=T#eyPxP>uS4l{>RhZYqn4f|pyTst}1?nm7~ zL^B65MOm6?vf!vO+`ag5wKUJ(PW66d#=V^l^1dmII{0hs4qPP~J?2$ZxXx||y;G#z zk-nO0w;??pK?W18CFriV*6*v_le~A7BapX^8Jsh3ym8~$X5COFGPw!p>B>}F^hxNY z=r&uC=E_i7dxB5BL#(yvGBsNBvVO{1*%Sk|3An}$t$BGHtB^dy;#bP@ zOm@CVB7eg@>7WK>K(#8PF%zR$i#hgm(6pv4q0)S>OuBN=^J)tpYAs|V$H20Xj zV3=hq5243YPt&Sd`P!IdUazV*uLULnpfNDlys>8&D5x>8L75db?Y4Q8e6?@(d%;vo z?8|<;TF!lCV;~leE|;aPh?}e&2^*kX-xx?XCoV}PM9YRJR1u{!lg+F$%TfF`y2cf_ zMds-E@cvsnq_vXomwQ3>cmGk`t_TN|M{tsQ>fI zi~8ivaKa9Tjh)T%lq`bD3oHW!JExo2eJE~=w3_=|-aaJxYp~ELt!h)3`$FM}d!fDM zts@txO54U<%13sO-nDhWPI-r& zXi!pv(R!sI#wBlZx8NeT31f|m+%2&3);(^MIk-t2`6mq%tzRPYoh>$h zNyCQBS7_?|z{)^ybpS!OT{9^mBb@pt4Hut&NyiXL;kg4D!%1Hu#jr&9zM_jNmne#Q zIlk7?nmq04%5*B=$^xoJR?magj6WQoO5h)k<^p^X;}ZwJqB#Q=DOAxIkhK_rh&+-R zYctWB{xw}v(b0pRsFF%hRKo2^QB>^ynmoharz?##Vv>S+o)t)L*@sW~eNlCanh-tR zaEgjATi1iRUA>vxW%5h@@bwDAKhRLUQDGa!d#6yhyh;4%8}O#`8>Ha2%I9gw8~*tl zy4Zb3572k@27Q+a`Ysbf>$l`>zPAU>+d%RO`!ar8l45xmfPdS2EFcG-_HBwaZimDj z&pQ>pKpC7Z4{kVBiO;qQ?^wXgX!jjA@lx7<$8KJjh2j_cW4_~D^e0{cS9qfQNfYhz zXSUc*yq0|89paNYBEDUH3Pe5Ug~}d>^&Ox19_Pbx$9+HNlLqwq0_$yusB-Yp{4j3@IJ^3+^g-fX2Y04^)HhB!(?@-hjvgQN&5Qq!gAY%mx8nmdcr&LD;;YW% zs62l|yqC#q`DYYYv-tNY_jN`KnXAHZmCXx`Fm6)1`*T!%i#6x-$BX6|xw_TK zM^Z#Q?&JqhjS$V|C$bAU%P+N3ZSo*ED#91=IP_`M0KS!q0WWPfY;D2asGw8i9U`mxsVT3@^*9PoNNJ}ikd4k-Hq~q zVSFLd;Qu|0--|?X*KmFf?Gf(`=f(77Tq)vTIR<4Aqg$a8`*FL_1GTuTgg;KGN;vH1 zTL@~vnDC6^S0Guua}?hrUM@3a)KJddVhH}Ak^s*&1CH?zxEzh@d`6Gr_c)K=Ue13^ zj=e~xURJ?1$3CPhAE@AqX`lF}g8wuv7b72!@2ceAq8!A*(tF?`_K)FpX$2T^Q1B`~ zEjz8(h$AhiY`Ct9_eXAZV-?O>Tb*Q+1TCn3MLemuVx7VG`-`~g}NzhwfSg)eQy8xtXlCE~_9{xkB# zN7wT{lr|n<*Nd9V`QK=7eDoylCDhSuo6MhtlFw-1OC4>F4zas|AB7AzOyMu3)nmfF z@da1#UlZh6*vK!1f-Gu;er*@8H)3<_5V_NMkamjo)A%nPyBs^jjOlzz_HKv4*hQGW zU2fw&V#jp;AhH`Kwa@mTw$Bm_+eJ3HV&iQ7a`yARsBN7CYIll<=J3Js4fD84X)j_G zr`WuhKOz<{;J2n7PQL%}D*k*elvN*BMbQ-X}8$Ch))E?uPowMp+IHiV(#aN z;Kd!+@KZ8?-?oHbs~mTnaK!(l!bg;mA<3#P_}YpN?#0mMBzsPW&E?kK}0`0QPMBg%v#HfFZbSC6C~fkVjYYd=9p4 z6|b~Gh`U62fP3?wmn~% z62@Dwt!81N^nOv+fEh6q6qMLFB+FfFcf+W^b~Ds+F?x+yX$ibsE8KB9y^@RrDw=$4 z(YD_4kt}=+uErv82|WqNhE2r;)0F}`F{98iYym3<<9b1}oh#fP2iz%+5N#sQP8_-%@&x$4+QtES?c^Thv@ zzo}@KCB}#;P@55x9x7tWh;%ZOLQ+eRO-cEX#QxyG%@WmHmd}kPZkh9)NMZr-HJenc z6GaJO4e5Tfl;%w9#86mbl_eV=Uf6yxK34&l>6+GVmdDEE1JE{VuA#C?c1gUA8V;1p zLT=H3QJ-yVbhw-)qOc^w&K*ZTvJj5RU*(Gwgsrc5q^xZvkoBY%lBgH8V$7s(k1Bav z$4s85z&F5W;94P-=_x#qf$7O*PG@?%$A?XAlyAFPow@Pm;wobb_5{3lhtoNdF((*> zYZ9qH@*5AZ2J*y59N2X!Xc+;X=0TOR8Cc71gt4*27Aj{=Koj*EQNO1~T{;DY+kT1l z_#RM3sU@jEFH%jUCPB3$s{NKk(Y;h7><oP%KN4O6Q)#xU zjgt+cE%PW9#a0X3P-@{An~Y7?GjMl04{RjnYDgL*uNBg(CE%J-xgT}|RcUmR(nFvp z>vfUlH8T;iFx%p?l`JTSeduWv+U?jA0l575Yndj|G&Tx0jTHh$px^kwN0rG3BQ))l zalRH#BNKTa<@W@3Y>cXI*c2cN3{!(~6qg|N4am@L{HG$YJ7On$h{r-6jBl<0 z^G#CKlJ8xtuGX}b02@&&FAm!*DE+zz{nCs8HpUq9r1&ai_$wpiRu4Xgu#lgCo=OS7 zoY8=BIGB3)PfDw3uHu9H$^TSFx{`MCXr*{Fz=yTg^KEsLTD6vybKA9+1^6ZoA!`G7 zRvT^e)>ti#+*x6?T!BL|>g zU)isiJLQ^-6rZSx@RK=hN_u2X880#TYJL;d5uXs{lQ^c{uo?y0olmUcg+%M(!#Z&h zmR`m){aV1eNj$Tb54PX7ieqc}>b^&i3t;hkx}9ylbR|(NfW_fi;!Q9!ZJF%zJKY_k@B*ysws&>O{^m8jXy(jn*0y3v z!0mUsonc#dZD zK)SMWST^ia?in^4_A5UdHVY0bSBF*AmDI}K)m^g9>2-KL-JJ-dHwcnX|SUK~CZPAg}IPYKU4eQ23l z7C%1=e@s$mDT)mOB$R2~sKPG%vcp7S1x%~uTib!JEiOq(hQ;=?vc zW0j=WkdW(At1P>vHcrB-lWgpE43G>-0XJ(ZJ1kH%*WP7!x5;(w6%DflFx5jtr!3iB z9%Q>pUv>;o4R9(}siD*9liECiE{BAJa<(CD$u6~Z+T9&8mPqXZx5Fpd*Vvt1_SP=h znxj%}aD7SxAlQ!lyk4whEbae%_xhVDNli(#~V&95ufjM>Eey7J>(O~zjUSwx-36^fz z>-0DnC3m#V`0N$Y`}?!kM(-^-!RY-nIpOI2n#nEL`@56ZjyQyCYdUBajws7>v*9&5 z>uE>{Z_7PP;0@)TDK6-z?mFmzwcZwN2U#jZQ+!gD*(1Bi>H={zh9Ju zw{+(ccvdZm@N!z&0J2u)qiMCo)Gr7|QFz--?b{()xo!G5<4JJ=Jfz6e^I?nf{ppo( zQaLs~WAr@B(jW?sOB6nUy-Ig^ld^2aMEFE;m*1uQdPb(R;xvNRa2beDCH z8Q9{9fO`>NW@!spAPv2@Q$QoKusjno6<2u(@|92VZ>8dz`G8mhxU0Hn-lg1eOR-oB za6;|ykGEJsR*EWHl=T%;L?^&ewOFj2kaX>KcWEyR;?zLQXolG38<6xSu~!`#c0GPp znz$KM4y;m?S!0RtK{#*rWq^;AESn9^hGpAdjmaMg0{K|@n5}17nQ#`L%7jnC>u!C- z0O#q|?O;(}+csJ$T9^(O6}W6MC9Sb{1!RD*YhfqwvSDTiZq)eK%GlaRuWfO(c8t~{ ze11`fL4BQ}+-4c0Y+BL=My2Jg=tQiQIjAF!WV)tY^!iZ5DZCzfSMTq3oL>W zFGLVV06kA(ywbCx2!-HBD+*9}Z0jc}7go5nyD`BV!&_JKA-^+T`IkG~d|<=OZKzh& z+F|FNMQ}$VYQ-V-rnw3$s%q0>X1YuevR`g=GaVt>-TH3V^pK}rRWv>s^`}?TbcAyH zF^jVJ!>ka~LE0-gsZE#e*t|we~a3$46up`m0?|zfY2#NW&|& z#3?4!t}T*hpj6YqEmol zI5$~cy;!pQ{dRUjOMZ_^K<~mTtm5Jkl?#3*qXb-8RM$|=$e}E)%|IE`7DGarjuK|4 zqt_GYpcgzOxh!622AJ2-?(w$CDrkyfVFFluo&dgJ+dXBtCQ6K*4N?04ZFU;UT9C7C z?4%#W&0xta;Vfg8+N;JYZKp|G46l_xoljobVNGQ6niA@?`z2pgKw~QW|5=%vuU(pN zvNECTtxN@C$qu<$mlK}}D)jr}I4CzzJ~ggfY-j>Jq7YH}*LqZz$I2awhX?gTXGr!I zaJa|b+L>k_R2SKYoaGzdCwbP$-bP?*uhZGliF;4#_V|2G#A>>|Q@AP=|!NQfg&e z%4d~o+ND<1N>R!2aUE&zLV_)i$m_GNLV8~XYMH7%quu)XmeYG? zyir%h5gkN9LBQ?uIGpWH6hq+)zA%AolG5`Ki{}a-_79QQ}7%8|1(Md0DgFpBL@D%af12 zOE*OaJJmX5EjC1UWQ4eq(+o0AG_V)dGLtl%(eCu(p3?i(S5~%u!kDNv)kWx8ffe1YCgxSE|+d2N0rOKkqHl0G$_SevdV@w8;zE`xen)qG*!+thu)`hJUA^R zyoO`dK*dZ6O)FiMt9z4KnfwfhZJ4YINt~^!odfK&h^?uyOQkiS?)iuu;%KN+_P;r| zAbAk35Qqxy8+z@KWO>Qh;)W+ON30s$dgi(N9}VUN2zlx(*W(_*21XqxH0YxZSxoo zqLnsh9!#QFZ0H@B?YJSX#%qo{zNW^M5}VYZ!v*l<-I_LHs{ne3KWK)UsFMNL3m8i2>f;wNbQJaTJ3GCPlj#l z&0=iB@YZ{bU@Bz%JSh|_yFxcXsd6k-D3$~Gl@~T9kDfWR&g<-Ox`nZVP^w59olvg) z)5d$z036+GLsE6UIq)_!c$1ZX>KzNV@Dsh>VbC8=ynloNs>7)d{0Iy-(2Us=4=#sl zrSPE~sG%Eskn`*CRyF&>eGfG0sp*2qdOTZSjKF+%;}U+tb`K(7qiS7xD6 z>E9zMDSPr^rBb!$LHyglrx2R(Z>o~=%(rswajV}yX!X&`M?y0F>#Z(a1)7@>FOKiZjGnes$ORtas1zHQQ$Kw|v56>)YzXTryDATnAcgOSqI5b~P z%+5yT7gB8lDAB7s zyAiN??cE`CbTRi7!#s#~ymGf!M*9=(NQVB=1>kf@xb{w$FB4Gfs~|(~(JD3iWG@;G z3|e%d*UgLY!L!Eci1vt&o_2-}5d?aj?J7`mdb{N=+)u5}E;Kkp?4{ZP-mI40KC4ia zB`vml(VK+?eM0{fsl}u2zZR)bwR!lHe!ejiUCL8!Wkhy9XNMcza*2SgVirel8p{ZE z(ug>;39}>N+9{t$D*D3kb!3G2I@*yt+DXD+Nt``skZ^bHM=_1nRgG(_mLL`_$5t_B z978p}B4(WEQf7iYjbO9WVTNoQr(WYw{Wu`n1#)L_yFd#LN=D8&%2Hb%5H3RY(WEb=$B(NZWp$vXia5Dh}5)R$FO1 z4lBj%U+YH=$Q1q_1x(%MXuL@F4!hHhz%yQmV)mc)q|F^*oDI|QjyREG=Zcfp&u0Uvar*-8?anqQo+UO;Qp3P8lz3ku zzJuJknzvJSqn`=SBUKX1P*LJRpld@sWd{~ARvQY2ve)LRRhcr>>Zra0oVhAeOq>wa zqgb*fV7da&nsjLB48S7+JD)|(+(hL1}wcZfI zm(E6y+S10CTE!hs}5o4qdvU+=Q{`sB3wF>jYx6A ztA)@LUhwMkBSU0IE0M#^Z(#iE3~kLGWw*6zYiB2M?B2J77{|w-nT*s z)5Gx2XV+9joLYGDU9}Kz(|+@`e*6CWmspGAA6CJrO#s~*5L9-(m=vCNdc2ssDGn)L z9E6lFsz`aW(sQO5>Xp-9A|AIpTuwK4$A{lPQ*Yqq^v@Gv7$3CaIG4qOC-oX zzw-$)gtZ?ZKL4lT`t1!Dtom)^XAdFgSO>~i7ZX%E8H`5WrC)31bZ0(r;H|zW|NLp* zRt4{u)w0aXxA6{R%AUL0$;(ox74#7fM3Y#%h!0?kJ`KH>cg9D`jnH>(=U9Bxa2Usn z$J3Q2_>9ksI!3^su3^PH#YB&>_fiohF#h=!zZ;<+5M!{;N zPU{n4VPwx}xL4y)q{IevE2_G%pR zKGh1(iab{h=yhmRjE_q6t@$upyPbL~%tNos+FRkfu%8*ckK@x17eEhQM%Tdq8GisE zZ<)t0FF}`^*MX@jemsbReUTSy;6@M+fT=|}Jj_Brx($lOKK-e1AuJ?^;Ty%_`*<9_ zZy*le$K&vF)S{mO#(_ggJq8$H#GTJQ4d*fCi0tE#~#GqWNk}O`M|@qqCZq3ki4IRG+g(LDJa6$0o!t> zbf?~#(^0@Y-pu@GhI3O1qdW(}Ju|QV-fX(#XTxB{z+@hIWPC_`iq#logrEh2^$<+3 zqfi?KB(S`ZK||MQ^1y@&imbxM>&}Ar)Rd+{z{-T{F2w!uL)ZIN(Grf0K|+@EW1)97 z!kF=@dq9832F($UIz^QUgQloeCJ8^Wv51RTU5qFNZfB^ta{yggg{Q7RG0gzgc-f>2 z+`Nzq`yAJWhSy3Q$39VsGbD5m#dWQgRcN`+h?>N^83S9Ym9o^7vZG)c+Kp7fBnbsc z7u|$d*Dmu4{uaii2}wiyl9=5`Po0I7EG=6p&S@O)n&_c-?S=8?Yh6jK)B?vMQ67FdUu+wCw3-lHBns@M1EFYGW8Gsb$(jE`Kg!~F?xnr?DK zC!C=Vd%#N5JmBN^PvWJh8#dx)UpGvJbM)hGm;s;Cv>vdMbE?;xI(i@#i_qCw0~hFt zwa|FuC5GO<1Ob0B8^vrEuF{Hi*sz}Z*TJMxATY1Wv$i4^z2bgn8%9_BUc`Jr!~`rB zQHvW1;z9g_c|!OH|BWE@^>uJ38BJ(j5U+`ZZVEyUUX{#^7J4KI$>qs}x#Zm*ugl(* zOn@c16?o8hgME11(V}b@hNbL&k2lEc2+4%rxE|^k?*S;&klS(@LzRB?r()%G&3+Fm z>!IGFxq)Jj@vI?U3Mn+a9;QG#{q1^~K+*@sNprsq(;$=H`E96x9QxR|VM^A}9D!^n zCY?3A(NzY7p7}Q11^IN|-7sq!rl9GpDrBs}KZ5#)6cYh|k?We8 z*UQF8C8Pd0u@UAm-}HoDSP9i?Dc#%)#gi|p&Q&;>y%gPcc7MPtLk&q{H0;pG#$ASE ztDztD;^|pSbMD16xt2YpQTblTMR9rPUYMFw&t@?#jm-iZ31Z$#(nRb;CQi~r0whQ_ zkWGZ1-wJ7u-Umg{M2qi(YOu4*1iIxuBqa0uU*Ctjz{&5;-+{>^T?7yt*ag8Ane!dk zXGXlCHcHqA6K|*oU>+HaXtZHSBf#G*-3F2vB&JSfpNPcqX)IbNMX|{tg0O)mJPH#1 zJyIFfOTb*~aUg|WRyqeZQOu{R8?hN@LXhzf(KmO(IQp-TLU!^N!VRJAxCXi*w1xhe zLJA#CAq`6D6bjZc+X$pB!L(41+b0Oy*n11Thr*;0+ZoL*MA*S-7ANo0$nB0Hw~JLT z8(T{Bh!t3H?M+TcDV_NkWM!<3}MjQRm0yoy)RTqFn< z;b`Q_cDTa;$LR7MFikwJuh>s^fQ0(+=nin9BAoFAq>m{@cBUYRS^jyEjl4BdHFOeRC6!IIMuPhr#yyA~lYkRq-X_1tgITz183~Rdhlm1O zTlD$YATC>17x34$tIk!QU=aK9*yo}0wHQM71k|avGS@3Uai4_7(g6lo8<Om{EatJYhyQo=t*qfyuiGrTr3#jl*8R4RcK( zmes@tU((Jep%kvtC!Pcg0Rw&cNvI@71O5C-m@#gM9hVFsMIP75f{ZwkR8V zut7PU{W=u$Srmhfo_ZGYan{FP#}%ug=U<1(SOrRy+$@(`w?H)(&o3%bT(bLe@h7akSuT^>ZYu|;M~Chc<3$DW7WvbYxsn5Pt1V8*Q1?zj@| zO9B`D{CUW<^cX;z?_4K4YNnS6Agycmw72_Ye-ABs0mdc9y+vi>qRU@^n~}NSdjawj z0|rQNVlyFt^EW04!N}nk;8zCNK)1XEx8ZjB;3dc!br6!~vFJC0LRdbL=Iw_<%&b_p zAAM49(;fREm2Bc%Pb%RmAw9+=yqW%WKa`C|_e&HUJ;X+laifcI2hpVdvC0+$?d^f= z$YVc+9~eh%Q`bc37q%Oe<9jmbs)Nj0v0tWYORokP!LZ z5%@kq%kck6$Mp@N9{j|Z2zc^<74~Z&~bgSI*y#Wio;Cj4>*Iue~MccQhFqaN)Hu*UHj32z7Az$rM0(S5bjpO@f*A%f zTBI+ZU|2|`S582Mlqf>ld@sgP9f;wxF$-VDEX6K|mL4Z0QrkHw8y~ColJT1u#C@1I zDAK3j;iUff4$QbAmXwe#M$i@1ERsx-e)It(N1lEkPu#INA{5wssM*pF|$Y0hd#=_5faS;5h#~~p6T#5AtA_EU&V4w->s)2!rad=u>pov#* zq8l$_&g3f>kV$s>?-yWFsw~2SM)zvBXRRB-kK2dv26Z%}Z0D7${{p{5=Yrbsw$Ct( z;iNzK3_}SndgwElQtT2%X)b=jDc9P&P2xf*CE_wD!-J{^yHx*>fGFTEu4XBItreuH z7h%a*rwF(W(B49!nupGC=1{;cRuuKd&1aJsJE2XCWc-Xa@qtabgb?v8{njP4e9zJc zE7KKAI14}1>ax@<Ot<1hjcC-UE4OuEo(QhkV(g3S zf>pf6`qAp`XVbv@1GM)G$Q(8BabY>#`vs2pD1HA6C_wLk=}XA082FO#92w$kVU|jC zov(!x4RrdK=!nXv9qdv_AH$0nG{8oB>@sA~KYj@lL=1)UuZHR5%Lp)DH7KEB>C|}{ zV@;IlCfzL}(p?EB$D^w@>ILg#J` zeeo-pLWC8O8?Hc>5iUih0cj?1HKG^@MoTZyzlo%Rj3ALpBe@5XKM-JrU@2159l68Q zhu+!#VdMxJMcamx7tzPLz(iWm$GOKua=}NBo5&#yh&?ibe41EJgtP+9W?~=Loum(s zBoT}dE*ORJ!OF;QMv*%Sd=i;HhMX~Caat1j3Q?OSne4%U-OrPWm4UZpG80~<1>;C9 zoR6#@N5+Y`id!b2o8}CCdIDJirH`hP9neRgNF}S#8T3^u$${gM%rx?qA!RfO@E}Ui z3G_t94JA@4k(U5{>i>~R9tP38`|Y#zo-A@JbDd|A{UKd6K)*5RH+U`(;S?q=h$khM zDvqvbH6723_|D6|Hc-za-RNhDClYt@XigieP_`6LFZ}3y8D`p{vSIEf5u;v`R?HHx zLhOa^!O$EBLNQ2-&==vB@#`J$YW6W9`?f}nDY48=%+$h`tYHEBJjKCsFVXryZw6+9 zu`{wmcFR6I&07P`F8n?N5|KGC2&Q?pPB-&3$qrQm;`efvIX4Q7BWxRLKjK+>+Dek? zOadcktNt2XP@Y*C^OYEW?sWSQZYZ-EJ-he==WsU*CK}AfCHj;;nN60!m+X>HQ_;^q zc7$QH0XMLK=Y;?-;Wg0^nVmy^3?mOF;|u&YSE`}ixg?XCb4jJ)5ZdyKbIBcWh(4Q3 zo-t-(tCu5pYTjCtg4FjgXwHzK>L$yNeQk=kPNFi8v=goOD1{xpqLp(#AI zgxtl9q!RLfp*K=mN)`k9hrc@=WqcDYnn9k0&5;jgkYQk~L9*NFAIiu@I2ie$oHzjY zgzXk`0JhMtZXqqkZHDcJleG8>Os9`lkjLQwomNR+H`ZdieG$Vf@=L&t^5$$Z12^EX zIk&TAQ)??)92r|6Qo(PJBpWCC~4Z}nwi!kz`cjy2CBUtz&wxI75J*Mc^RMQtVq+Bx(ahnS{@G1xi*(l*^KAjKS zU@Jt`>U3T9bxv2nMN%7Swll3x?)*EbQMcFTg*P~!j$VG$-#z;KjKgDKe6D2>W~9kbv|G2 zapj-}Q{~_SLR%p*(o;hwf$O~hQLmNlRcUR9}fVlGlkZskf;CMCQ^ zEjo5E!`>fsl9D{Nh8j)kAzKU7Cw^=O$W|6fN`WB#Xf;VPY#>MI=c`FZ(k85DuEPBB zgfvZg3psR37pX*_T4xuTVX%=}`lBxLQv}8lBa%Z*Ua+fOL`+adq@?*rXTyr z22?|>ev*kgC-R*D*=8_RlY}nWZQemMgJi-;?P-@N(603)gF1p_+3=HEjl)6W*B*97 oD%O)!{ErMGE51$s0)~C!=1A=Za+d-2N1oeAri1Zh!vRtFFT9T=umAu6 From 28d14be9bd4ba5f7360cebdd81371458073fcf0b Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Thu, 22 Jan 2026 10:42:29 +0800 Subject: [PATCH 2/7] feat: Multisig - two command types --- examples/multisig_usage.rs | 13 +- src/cli/multisig.rs | 347 +++++++++++++++++++++++++++++++++---- 2 files changed, 327 insertions(+), 33 deletions(-) diff --git a/examples/multisig_usage.rs b/examples/multisig_usage.rs index 81527b1..f6c7ba7 100644 --- a/examples/multisig_usage.rs +++ b/examples/multisig_usage.rs @@ -85,8 +85,17 @@ async fn main() -> Result<()> { // 5. Example: Create a proposal println!("๐Ÿ“ To create a proposal:"); - println!(" quantus multisig propose \\"); - println!(" --multisig \\"); + println!(" # Simple transfer (recommended for transfers):"); + println!(" quantus multisig propose transfer \\"); + println!(" --address \\"); + println!(" --to \\"); + println!(" --amount 1000000000000 \\"); + println!(" --expiry 1000 \\"); + println!(" --from alice"); + println!(""); + println!(" # Custom transaction (full flexibility):"); + println!(" quantus multisig propose custom \\"); + println!(" --address \\"); println!(" --pallet Balances \\"); println!(" --call transfer_allow_death \\"); println!(" --args '[\"\", \"1000000000000\"]' \\"); diff --git a/src/cli/multisig.rs b/src/cli/multisig.rs index 2498db5..9297115 100644 --- a/src/cli/multisig.rs +++ b/src/cli/multisig.rs @@ -12,20 +12,28 @@ use subxt::utils::H256; // Base unit (QUAN) decimals for amount conversions const QUAN_DECIMALS: u128 = 1_000_000_000_000; // 10^12 -/// Multisig-related commands +/// Subcommands for proposing transactions #[derive(Subcommand, Debug)] -pub enum MultisigCommands { - /// Create a new multisig account - Create { - /// List of signer addresses (SS58 or wallet names), comma-separated +pub enum ProposeSubcommand { + /// Propose a simple transfer (most common case) + Transfer { + /// Multisig account address (SS58 format) #[arg(long)] - signers: String, + address: String, - /// Number of approvals required to execute transactions + /// Recipient address (SS58 format) #[arg(long)] - threshold: u32, + to: String, - /// Wallet name to pay for multisig creation + /// Amount to transfer (in base units, e.g., 1000000000000 for 1 QUAN) + #[arg(long)] + amount: String, + + /// Expiry block number (when this proposal expires) + #[arg(long)] + expiry: u32, + + /// Proposer wallet name (must be a signer) #[arg(long)] from: String, @@ -33,13 +41,13 @@ pub enum MultisigCommands { #[arg(short, long)] password: Option, - /// Read password from file (for scripting) + /// Read password from file #[arg(long)] password_file: Option, }, - /// Propose a transaction to be executed by the multisig - Propose { + /// Propose a custom transaction (full flexibility) + Custom { /// Multisig account address (SS58 format) #[arg(long)] address: String, @@ -72,6 +80,37 @@ pub enum MultisigCommands { #[arg(long)] password_file: Option, }, +} + +/// Multisig-related commands +#[derive(Subcommand, Debug)] +pub enum MultisigCommands { + /// Create a new multisig account + Create { + /// List of signer addresses (SS58 or wallet names), comma-separated + #[arg(long)] + signers: String, + + /// Number of approvals required to execute transactions + #[arg(long)] + threshold: u32, + + /// Wallet name to pay for multisig creation + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file (for scripting) + #[arg(long)] + password_file: Option, + }, + + /// Propose a transaction to be executed by the multisig + #[command(subcommand)] + Propose(ProposeSubcommand), /// Approve a proposed transaction Approve { @@ -224,17 +263,29 @@ pub async fn handle_multisig_command( execution_mode, ) .await, - MultisigCommands::Propose { - address, - pallet, - call, - args, - expiry, - from, - password, - password_file, - } => - handle_propose( + MultisigCommands::Propose(subcommand) => match subcommand { + ProposeSubcommand::Transfer { + address, + to, + amount, + expiry, + from, + password, + password_file, + } => + handle_propose_transfer( + address, + to, + amount, + expiry, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + ProposeSubcommand::Custom { address, pallet, call, @@ -243,10 +294,21 @@ pub async fn handle_multisig_command( from, password, password_file, - node_url, - execution_mode, - ) - .await, + } => + handle_propose( + address, + pallet, + call, + args, + expiry, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + }, MultisigCommands::Approve { address, proposal_hash, from, password, password_file } => handle_approve( address, @@ -385,6 +447,52 @@ async fn handle_create_multisig( } /// Propose a transaction +/// Propose a transfer transaction (simplified interface) +async fn handle_propose_transfer( + multisig_address: String, + to: String, + amount: String, + expiry: u32, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿ“ {} Creating transfer proposal...", "MULTISIG".bright_magenta().bold()); + + // Resolve recipient address (wallet name or SS58) + let to_address = crate::cli::common::resolve_address(&to)?; + + // Parse amount + let amount_u128: u128 = amount + .parse() + .map_err(|e| crate::error::QuantusError::Generic(format!("Invalid amount: {}", e)))?; + + // Build args as JSON array (using serde_json for proper escaping) + let args_json = serde_json::to_string(&vec![ + serde_json::Value::String(to_address), + serde_json::Value::String(amount_u128.to_string()), + ]) + .map_err(|e| crate::error::QuantusError::Generic(format!("Failed to serialize args: {}", e)))?; + + // Use the existing handle_propose with Balances::transfer_allow_death + handle_propose( + multisig_address, + "Balances".to_string(), + "transfer_allow_death".to_string(), + Some(args_json), + expiry, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await +} + +/// Propose a custom transaction async fn handle_propose( multisig_address: String, pallet: String, @@ -757,6 +865,132 @@ async fn handle_info(multisig_address: String, node_url: &str) -> crate::error:: Ok(()) } +/// Decode call data into human-readable format +async fn decode_call_data( + quantus_client: &crate::chain::client::QuantusClient, + call_data: &[u8], +) -> crate::error::Result { + use codec::Decode; + + if call_data.len() < 2 { + return Ok(format!(" {} {} bytes (too short)", "Call Size:".dimmed(), call_data.len())); + } + + let pallet_index = call_data[0]; + let call_index = call_data[1]; + let args = &call_data[2..]; + + // Get metadata to find pallet and call names + let metadata = quantus_client.client().metadata(); + + // Try to find pallet by index + let pallet_name = metadata + .pallets() + .find(|p| p.index() == pallet_index) + .map(|p| p.name()) + .unwrap_or("Unknown"); + + // Try to decode based on known patterns + match (pallet_index, call_index) { + // Balances pallet - typically index 10 or similar + (_, idx) if pallet_name == "Balances" && (idx == 0 || idx == 1) => { + // transfer_allow_death (0) or transfer_keep_alive (1) + if args.len() < 33 { + return Ok(format!( + " {} {}::{} (index {})\n {} {} bytes (too short)", + "Call:".dimmed(), + pallet_name.bright_cyan(), + if idx == 0 { "transfer_allow_death" } else { "transfer_keep_alive" } + .bright_yellow(), + idx, + "Args:".dimmed(), + args.len() + )); + } + + // Decode MultiAddress::Id (first byte is variant, 0x00 = Id) + // Then 32 bytes for AccountId32 + let address_variant = args[0]; + if address_variant != 0 { + return Ok(format!( + " {} {}::{} (index {})\n {} {} bytes\n {} Unknown address variant: {}", + "Call:".dimmed(), + pallet_name.bright_cyan(), + if idx == 0 { "transfer_allow_death" } else { "transfer_keep_alive" } + .bright_yellow(), + idx, + "Args:".dimmed(), + args.len(), + "Error:".dimmed(), + address_variant + )); + } + + let account_bytes: [u8; 32] = args[1..33].try_into().map_err(|_| { + crate::error::QuantusError::Generic("Failed to extract account bytes".to_string()) + })?; + let account_id = SpAccountId32::from(account_bytes); + let to_address = account_id.to_ss58check(); + + // Decode amount (Compact) + let mut cursor = &args[33..]; + let amount: u128 = match codec::Compact::::decode(&mut cursor) { + Ok(compact) => compact.0, + Err(_) => { + return Ok(format!( + " {} {}::{} (index {})\n {} {}\n {} Failed to decode amount", + "Call:".dimmed(), + pallet_name.bright_cyan(), + if idx == 0 { "transfer_allow_death" } else { "transfer_keep_alive" } + .bright_yellow(), + idx, + "To:".dimmed(), + to_address.bright_cyan(), + "Error:".dimmed() + )); + }, + }; + + Ok(format!( + " {} {}::{}\n {} {}\n {} {}", + "Call:".dimmed(), + pallet_name.bright_cyan(), + if idx == 0 { "transfer_allow_death" } else { "transfer_keep_alive" } + .bright_yellow(), + "To:".dimmed(), + to_address.bright_cyan(), + "Amount:".dimmed(), + format_balance(amount).bright_green() + )) + }, + _ => { + // Try to get call name from metadata + let call_name = metadata + .pallets() + .find(|p| p.index() == pallet_index) + .and_then(|p| { + p.call_variants().and_then(|calls| { + calls.iter().find(|v| v.index == call_index).map(|v| v.name.as_str()) + }) + }) + .unwrap_or("unknown"); + + Ok(format!( + " {} {}::{} (index {}:{})\n {} {} bytes\n {} {}", + "Call:".dimmed(), + pallet_name.bright_cyan(), + call_name.bright_yellow(), + pallet_index, + call_index, + "Args:".dimmed(), + args.len(), + "Raw:".dimmed(), + hex::encode(args).bright_green() + )) + }, + } +} + /// Query proposal information async fn handle_proposal_info( multisig_address: String, @@ -799,7 +1033,18 @@ async fn handle_proposal_info( let proposer_bytes: &[u8; 32] = data.proposer.as_ref(); let proposer_sp = SpAccountId32::from(*proposer_bytes); log_print!(" Proposer: {}", proposer_sp.to_ss58check().bright_cyan()); - log_print!(" Call Size: {} bytes", data.call.0.len()); + + // Decode and display call data + match decode_call_data(&quantus_client, &data.call.0).await { + Ok(decoded) => { + log_print!("{}", decoded); + }, + Err(e) => { + log_print!(" Call Size: {} bytes", data.call.0.len()); + log_verbose!("Failed to decode call data: {:?}", e); + }, + } + log_print!(" Expiry: block {}", data.expiry); log_print!(" Deposit: {} (locked)", format_balance(data.deposit)); log_print!( @@ -902,6 +1147,21 @@ async fn handle_list_proposals( let proposer_bytes: &[u8; 32] = kv.value.proposer.as_ref(); let proposer_sp = SpAccountId32::from(*proposer_bytes); log_print!(" Proposer: {}", proposer_sp.to_ss58check().bright_cyan()); + + // Decode and display call data (compact format for list) + match decode_call_data(&quantus_client, &kv.value.call.0).await { + Ok(decoded) => { + // Extract just the call info line for compact display + let lines: Vec<&str> = decoded.lines().collect(); + if !lines.is_empty() { + log_print!(" {}", lines[0].trim_start()); + } + }, + Err(_) => { + log_print!(" Call Size: {} bytes", kv.value.call.0.len()); + }, + } + log_print!(" Status: {}", status_str); log_print!(" Approvals: {}", kv.value.approvals.0.len()); log_print!(" Expiry: block {}", kv.value.expiry); @@ -1018,11 +1278,36 @@ async fn build_runtime_call( // Amount must be Compact encoded for Balance type codec::Compact(amount).encode_to(&mut call_data); }, + ("System", "remark") | ("System", "remark_with_event") => { + // System::remark takes a Vec argument + if args.len() != 1 { + return Err(crate::error::QuantusError::Generic( + "System remark requires 1 argument: [hex_data]".to_string(), + )); + } + + let hex_data = args[0].as_str().ok_or_else(|| { + crate::error::QuantusError::Generic( + "Argument must be a hex string (e.g., \"0x48656c6c6f\")".to_string(), + ) + })?; + + // Remove 0x prefix if present + let hex_str = hex_data.trim_start_matches("0x"); + + // Decode hex to bytes + let data_bytes = hex::decode(hex_str).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid hex data: {}", e)) + })?; + + // Encode as Vec (with length prefix) + data_bytes.encode_to(&mut call_data); + }, _ => { return Err(crate::error::QuantusError::Generic(format!( - "Building call data for {}.{} is not yet implemented. Use a simpler approach or add support.", - pallet, call - ))); + "Building call data for {}.{} is not yet implemented. Use a simpler approach or add support.", + pallet, call + ))); }, } From 7803cf02a0a9df299f3ce6b841d13040d448a463 Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Mon, 26 Jan 2026 10:03:26 +0800 Subject: [PATCH 3/7] feat: Consistent execution with all existing features --- README.md | 167 ++++++++++----- examples/multisig_usage.rs | 47 +++-- src/chain/quantus_subxt.rs | 413 ++++++++++++++++++++----------------- src/cli/multisig.rs | 364 ++++++++++++++++++++++---------- src/quantus_metadata.scale | Bin 164327 -> 164938 bytes 5 files changed, 619 insertions(+), 372 deletions(-) diff --git a/README.md b/README.md index b1b9435..314c00f 100644 --- a/README.md +++ b/README.md @@ -147,45 +147,54 @@ The Quantus CLI provides comprehensive support for multi-signature wallets, allo - **Deterministic Address Generation**: Multisig addresses are derived from signers + nonce - **Flexible Threshold**: Configure how many approvals are needed (e.g., 2-of-3, 5-of-7) -- **Full Call Transparency**: Complete transaction data stored on-chain (not just hashes) +- **Full Call Transparency**: Complete transaction data stored on-chain (no blind signing) - **Auto-Execution**: Proposals execute automatically when threshold is reached +- **Human-Readable Amounts**: Use simple formats like `10` instead of `10000000000000` +- **Smart Address Display**: Automatic SS58 formatting with proper network prefix (`qz...`) +- **Balance Tracking**: View multisig balance directly in `info` command +- **Expiry Validation**: Client-side checks prevent expired proposals - **Deposit Management**: Refundable deposits incentivize cleanup -- **Query Support**: Inspect multisig configuration and proposals +- **Query Support**: Inspect multisig configuration, proposals, and balances ### Quick Start Example ```bash -# 1. Create a 2-of-3 multisig +# 1. Create a 2-of-3 multisig (waits for confirmation by default) quantus multisig create \ --signers "alice,bob,charlie" \ --threshold 2 \ - --from alice + --from alice \ + --wait-for-transaction -# 2. Check the events to get the multisig address -# Let's say it's: 5GMultiSigAddr... +# Output: ๐Ÿ“ Multisig address: qz... (with proper network prefix) -# 3. Fund the multisig (anyone can send funds) +# 2. Fund the multisig (anyone can send funds) quantus send \ --from alice \ - --to 5GMultiSigAddr... \ + --to qz... \ --amount 1000 -# 4. Create a proposal to send funds from multisig -quantus multisig propose \ - --multisig 5GMultiSigAddr... \ - --pallet Balances \ - --call transfer_allow_death \ - --args '["5GDestination...", "500000000000"]' \ - --expiry 1000 \ +# 3. Create a transfer proposal (human-readable amount) +quantus multisig propose transfer \ + --address qz... \ + --to dave \ + --amount 10 \ + --expiry 1500 \ --from alice -# 5. Check events for proposal hash -# Let's say it's: 0xabc123... +# Note: Expiry is BLOCK NUMBER (e.g., current block + 1000) + +# 4. Check proposal details (shows current block + blocks remaining) +quantus multisig info --address qz... --proposal-id 0 + +# Output shows: +# Current Block: 450 +# Expiry: block 1500 (1050 blocks remaining) -# 6. Second signer approves (auto-executes at threshold) +# 5. Second signer approves (auto-executes at threshold) quantus multisig approve \ - --multisig 5GMultiSigAddr... \ - --proposal-hash 0xabc123... \ + --address qz... \ + --proposal-id 0 \ --from bob ``` @@ -193,77 +202,96 @@ quantus multisig approve \ #### Create Multisig ```bash +# Default: Wait for transaction and extract address from event quantus multisig create \ --signers "addr1,addr2,addr3" \ --threshold 2 \ --from creator_wallet + +# Fast mode: Predict address immediately (may be wrong if concurrent creation) +quantus multisig create \ + --signers "addr1,addr2,addr3" \ + --threshold 2 \ + --from creator_wallet \ + --predict ``` -#### Propose Transaction +#### Propose Transfer (Recommended for simple transfers) ```bash -quantus multisig propose \ - --multisig \ - --pallet Balances \ - --call transfer_allow_death \ - --args '["recipient", "amount"]' \ - --expiry \ +quantus multisig propose transfer \ + --address \ + --to \ + --amount 10 \ + --expiry \ + --from signer_wallet + +# Amount formats supported: +# 10 โ†’ 10 QUAN +# 10.5 โ†’ 10.5 QUAN +# 0.001 โ†’ 0.001 QUAN +# 10000000000000 โ†’ raw format (auto-detected) +``` + +#### Propose Custom Transaction (Full flexibility) +```bash +quantus multisig propose custom \ + --address \ + --pallet System \ + --call remark \ + --args '["Hello from multisig"]' \ + --expiry \ --from signer_wallet ``` #### Approve Proposal ```bash quantus multisig approve \ - --multisig \ - --proposal-hash \ + --address \ + --proposal-id \ --from signer_wallet ``` #### Cancel Proposal (proposer only) ```bash quantus multisig cancel \ - --multisig \ - --proposal-hash \ + --address \ + --proposal-id \ --from proposer_wallet ``` #### Query Multisig Info ```bash -quantus multisig info \ - --multisig -``` +# Show multisig details (signers, threshold, balance, etc.) +quantus multisig info --address -#### List All Proposals -```bash -quantus multisig list-proposals \ - --multisig +# Show specific proposal details (includes current block + time remaining) +quantus multisig info --address --proposal-id ``` -#### Query Specific Proposal +#### List All Proposals ```bash -quantus multisig proposal-info \ - --multisig \ - --proposal-hash +quantus multisig list-proposals --address ``` #### Cleanup (Recover Deposits) ```bash -# Remove single expired/executed/cancelled proposal +# Remove single expired proposal quantus multisig remove-expired \ - --multisig \ - --proposal-hash \ + --address \ + --proposal-id \ --from signer_wallet -# Batch cleanup all removable proposals +# Batch cleanup all expired proposals quantus multisig claim-deposits \ - --multisig \ - --from proposer_wallet + --address \ + --from any_signer_wallet ``` #### Dissolve Multisig ```bash # Requires: no proposals exist, zero balance quantus multisig dissolve \ - --multisig \ + --address \ --from creator_or_signer_wallet ``` @@ -272,24 +300,51 @@ quantus multisig dissolve \ The multisig pallet uses an economic model to prevent spam and incentivize cleanup: - **MultisigFee**: Non-refundable fee paid to treasury on creation -- **MultisigDeposit**: Refundable deposit returned on dissolution +- **MultisigDeposit**: Refundable deposit (locked, returned on dissolution) - **ProposalFee**: Non-refundable fee per proposal (scales with signer count) -- **ProposalDeposit**: Refundable deposit per proposal (returned after cleanup) +- **ProposalDeposit**: Refundable deposit per proposal (locked, returned after cleanup) + +**Deposits are visible in `multisig info` output:** +``` +Balance: 1000 QUAN โ† Spendable balance +Deposit: 0.5 QUAN (locked) โ† Refundable creation deposit +``` ### Best Practices 1. **Use Descriptive Names**: Use wallet names instead of raw addresses for better readability -2. **Set Reasonable Expiry**: Choose expiry blocks that give enough time for approvals -3. **Cleanup Regularly**: Remove executed/cancelled proposals to recover deposits -4. **Monitor Deposits**: Keep track of locked deposits and clean up when done -5. **High Security**: For high-value multisigs, use higher thresholds (e.g., 5-of-7) +2. **Set Reasonable Expiry**: Use future block numbers (current + 1000 for ~3.3 hours at 12s/block) +3. **Verify Proposals**: Use `info --proposal-id` to decode and verify proposal contents before approving +4. **Cleanup Regularly**: Use `claim-deposits` to recover deposits from expired proposals +5. **Monitor Balances**: Check multisig balance with `info --address` command +6. **High Security**: For high-value multisigs, use higher thresholds (e.g., 5-of-7 or 4-of-6) ### Security Considerations - **Immutable Configuration**: Signers and threshold cannot be changed after creation -- **Full Transparency**: All call data is visible on-chain (no blind signing) +- **Full Transparency**: All call data is stored and decoded on-chain (no blind signing) - **Auto-Execution**: Proposals execute automatically when threshold is reached - **Access Control**: Only signers can propose/approve, only proposer can cancel +- **Expiry Protection**: Client validates expiry before submission to prevent wasted fees +- **Deterministic Addresses**: Multisig addresses are deterministic and verifiable + +### Advanced Features + +**Decoding Proposals**: The CLI automatically decodes common call types: +```bash +$ quantus multisig info --address qz... --proposal-id 0 + +๐Ÿ“ PROPOSAL Information: + Current Block: 450 + Call: Balances::transfer_allow_death + To: qzmqr... + Amount: 10 QUAN + Expiry: block 1500 (1050 blocks remaining) +``` + +**SS58 Address Format**: All addresses use the Quantus network prefix (`qz...` for prefix 189) automatically. + +**Password Convenience**: Omit `--password ""` for wallets with no password. For more details, see `quantus multisig --help` and explore subcommands with `--help`. diff --git a/examples/multisig_usage.rs b/examples/multisig_usage.rs index f6c7ba7..67d32e4 100644 --- a/examples/multisig_usage.rs +++ b/examples/multisig_usage.rs @@ -74,66 +74,73 @@ async fn main() -> Result<()> { println!("โœ… Multisig created! Tx hash: 0x{}", hex::encode(tx_hash)); println!(""); - println!("๐Ÿ’ก NOTE: Check the events to find the multisig address"); - println!(" The address is deterministically generated from signers + nonce"); + println!("๐Ÿ’ก NOTE: The CLI automatically extracts the address from events"); + println!(" Or use --predict flag for instant (but potentially racy) address"); + println!(" quantus multisig create --signers --threshold 2 --from alice --predict"); println!(""); // 4. Example: Query multisig info println!("๐Ÿ“‹ To query multisig information:"); - println!(" quantus multisig info --multisig "); + println!(" quantus multisig info --address "); + println!(""); + println!(" Or query specific proposal:"); + println!(" quantus multisig info --address --proposal-id 0"); println!(""); // 5. Example: Create a proposal println!("๐Ÿ“ To create a proposal:"); - println!(" # Simple transfer (recommended for transfers):"); + println!(" # Simple transfer (recommended - human-readable amounts):"); println!(" quantus multisig propose transfer \\"); println!(" --address \\"); println!(" --to \\"); - println!(" --amount 1000000000000 \\"); + println!(" --amount 10 \\"); println!(" --expiry 1000 \\"); println!(" --from alice"); println!(""); println!(" # Custom transaction (full flexibility):"); println!(" quantus multisig propose custom \\"); println!(" --address \\"); - println!(" --pallet Balances \\"); - println!(" --call transfer_allow_death \\"); - println!(" --args '[\"\", \"1000000000000\"]' \\"); + println!(" --pallet System \\"); + println!(" --call remark \\"); + println!(" --args '[\"Hello from multisig\"]' \\"); println!(" --expiry 1000 \\"); println!(" --from alice"); println!(""); + println!(" NOTE: Expiry is BLOCK NUMBER, not blocks from now!"); + println!(" Use a block number in the future (e.g., current + 1000)"); + println!(""); // 6. Example: Approve a proposal - println!("โœ… To approve a proposal:"); + println!("โœ… To approve a proposal (auto-executes at threshold):"); println!(" quantus multisig approve \\"); - println!(" --multisig \\"); - println!(" --proposal-hash \\"); + println!(" --address \\"); + println!(" --proposal-id \\"); println!(" --from bob"); println!(""); // 7. Example: List proposals println!("๐Ÿ“‹ To list all proposals:"); - println!(" quantus multisig list-proposals --multisig "); + println!(" quantus multisig list-proposals --address "); println!(""); - // 8. Example: Cleanup + // 8. Example: Cleanup (recover deposits from expired proposals) println!("๐Ÿงน To cleanup and recover deposits:"); - println!(" # Remove single proposal"); + println!(" # Remove single expired proposal"); println!(" quantus multisig remove-expired \\"); - println!(" --multisig \\"); - println!(" --proposal-hash \\"); + println!(" --address \\"); + println!(" --proposal-id \\"); println!(" --from alice"); println!(""); - println!(" # Batch cleanup"); + println!(" # Batch cleanup all expired proposals"); println!(" quantus multisig claim-deposits \\"); - println!(" --multisig \\"); + println!(" --address \\"); println!(" --from alice"); println!(""); - // 9. Example: Dissolve multisig + // 9. Example: Dissolve multisig (recover creation deposit) println!("๐Ÿ—‘๏ธ To dissolve multisig (requires no proposals, zero balance):"); println!(" quantus multisig dissolve \\"); - println!(" --multisig \\"); + println!(" --address \\"); println!(" --from alice"); println!(""); diff --git a/src/chain/quantus_subxt.rs b/src/chain/quantus_subxt.rs index 881b4bc..4c41d06 100644 --- a/src/chain/quantus_subxt.rs +++ b/src/chain/quantus_subxt.rs @@ -1469,9 +1469,9 @@ pub mod api { "query_call_info", types::QueryCallInfo { call, len }, [ - 108u8, 157u8, 154u8, 122u8, 44u8, 54u8, 12u8, 126u8, 145u8, 198u8, - 44u8, 53u8, 68u8, 109u8, 166u8, 12u8, 170u8, 151u8, 215u8, 251u8, 1u8, - 137u8, 149u8, 132u8, 0u8, 125u8, 80u8, 96u8, 85u8, 240u8, 232u8, 109u8, + 200u8, 246u8, 119u8, 11u8, 15u8, 39u8, 4u8, 32u8, 250u8, 233u8, 49u8, + 214u8, 226u8, 114u8, 235u8, 182u8, 6u8, 159u8, 60u8, 126u8, 214u8, + 47u8, 184u8, 212u8, 106u8, 4u8, 167u8, 20u8, 224u8, 134u8, 167u8, 37u8, ], ) } @@ -1489,10 +1489,10 @@ pub mod api { "query_call_fee_details", types::QueryCallFeeDetails { call, len }, [ - 129u8, 124u8, 124u8, 57u8, 194u8, 127u8, 113u8, 187u8, 194u8, 36u8, - 47u8, 108u8, 27u8, 56u8, 137u8, 101u8, 40u8, 20u8, 106u8, 64u8, 56u8, - 119u8, 182u8, 172u8, 22u8, 250u8, 20u8, 175u8, 144u8, 225u8, 126u8, - 56u8, + 232u8, 99u8, 125u8, 48u8, 238u8, 249u8, 221u8, 214u8, 95u8, 163u8, + 102u8, 195u8, 154u8, 131u8, 100u8, 54u8, 201u8, 60u8, 169u8, 189u8, + 223u8, 173u8, 13u8, 76u8, 108u8, 120u8, 171u8, 5u8, 121u8, 35u8, 36u8, + 218u8, ], ) } @@ -1985,9 +1985,9 @@ pub mod api { .hash(); runtime_metadata_hash == [ - 3u8, 233u8, 219u8, 118u8, 195u8, 79u8, 113u8, 105u8, 239u8, 120u8, 33u8, 65u8, - 180u8, 110u8, 1u8, 16u8, 112u8, 215u8, 110u8, 116u8, 222u8, 216u8, 186u8, 54u8, - 251u8, 178u8, 62u8, 225u8, 227u8, 123u8, 143u8, 218u8, + 67u8, 50u8, 35u8, 34u8, 220u8, 220u8, 198u8, 52u8, 94u8, 20u8, 184u8, 166u8, 50u8, + 155u8, 167u8, 22u8, 51u8, 90u8, 10u8, 216u8, 223u8, 113u8, 230u8, 34u8, 116u8, + 224u8, 247u8, 158u8, 0u8, 120u8, 98u8, 45u8, ] } pub mod system { @@ -3086,9 +3086,10 @@ pub mod api { "Events", (), [ - 234u8, 110u8, 83u8, 79u8, 105u8, 7u8, 155u8, 40u8, 40u8, 74u8, 149u8, - 106u8, 29u8, 18u8, 32u8, 68u8, 102u8, 126u8, 237u8, 28u8, 186u8, 138u8, - 66u8, 173u8, 75u8, 8u8, 167u8, 18u8, 145u8, 12u8, 180u8, 247u8, + 150u8, 146u8, 83u8, 76u8, 57u8, 169u8, 39u8, 237u8, 122u8, 140u8, + 157u8, 117u8, 33u8, 59u8, 136u8, 201u8, 170u8, 116u8, 185u8, 117u8, + 246u8, 157u8, 116u8, 231u8, 205u8, 239u8, 61u8, 140u8, 109u8, 126u8, + 105u8, 99u8, ], ) } @@ -5156,6 +5157,25 @@ pub mod api { ], ) } + #[doc = " Account ID used as the \"from\" account when creating transfer proofs for minted tokens"] + #[doc = " (e.g., genesis balances, mining rewards). This should be a well-known address that"] + #[doc = " represents \"minted from nothing\"."] + pub fn minting_account( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Balances", + "MintingAccount", + [ + 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, + ], + ) + } } } } @@ -5450,9 +5470,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 0u8, 189u8, 255u8, 87u8, 49u8, 109u8, 97u8, 93u8, 217u8, 6u8, 104u8, - 114u8, 251u8, 50u8, 3u8, 179u8, 114u8, 195u8, 122u8, 26u8, 173u8, 63u8, - 97u8, 46u8, 58u8, 217u8, 65u8, 16u8, 16u8, 30u8, 60u8, 138u8, + 223u8, 68u8, 19u8, 56u8, 15u8, 57u8, 58u8, 42u8, 108u8, 1u8, 113u8, + 221u8, 178u8, 16u8, 75u8, 68u8, 149u8, 211u8, 61u8, 184u8, 17u8, 240u8, + 208u8, 219u8, 59u8, 86u8, 84u8, 94u8, 162u8, 126u8, 185u8, 184u8, ], ) } @@ -5475,9 +5495,10 @@ pub mod api { weight, }, [ - 191u8, 114u8, 71u8, 98u8, 82u8, 90u8, 113u8, 173u8, 56u8, 179u8, 119u8, - 29u8, 110u8, 249u8, 9u8, 69u8, 236u8, 66u8, 198u8, 102u8, 154u8, 48u8, - 129u8, 13u8, 216u8, 130u8, 166u8, 68u8, 33u8, 230u8, 113u8, 118u8, + 48u8, 14u8, 241u8, 181u8, 10u8, 128u8, 243u8, 143u8, 170u8, 154u8, + 74u8, 29u8, 125u8, 164u8, 180u8, 121u8, 12u8, 163u8, 188u8, 179u8, + 25u8, 68u8, 76u8, 77u8, 142u8, 245u8, 141u8, 33u8, 251u8, 19u8, 181u8, + 85u8, ], ) } @@ -5515,9 +5536,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 193u8, 94u8, 70u8, 20u8, 210u8, 85u8, 93u8, 91u8, 137u8, 46u8, 88u8, - 5u8, 86u8, 196u8, 245u8, 69u8, 56u8, 3u8, 165u8, 170u8, 92u8, 202u8, - 57u8, 36u8, 188u8, 184u8, 7u8, 1u8, 104u8, 131u8, 68u8, 0u8, + 10u8, 155u8, 110u8, 205u8, 59u8, 195u8, 7u8, 222u8, 169u8, 255u8, 92u8, + 242u8, 253u8, 58u8, 248u8, 212u8, 239u8, 236u8, 194u8, 71u8, 153u8, + 142u8, 219u8, 65u8, 75u8, 119u8, 82u8, 65u8, 68u8, 59u8, 157u8, 133u8, ], ) } @@ -6974,9 +6995,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 98u8, 65u8, 33u8, 92u8, 233u8, 1u8, 246u8, 164u8, 26u8, 150u8, 53u8, - 4u8, 168u8, 83u8, 171u8, 92u8, 124u8, 171u8, 212u8, 27u8, 103u8, 13u8, - 250u8, 15u8, 87u8, 62u8, 134u8, 75u8, 133u8, 159u8, 124u8, 35u8, + 85u8, 158u8, 105u8, 109u8, 132u8, 82u8, 60u8, 133u8, 15u8, 227u8, + 239u8, 229u8, 236u8, 198u8, 32u8, 194u8, 42u8, 27u8, 250u8, 108u8, 9u8, + 147u8, 84u8, 189u8, 1u8, 1u8, 230u8, 194u8, 49u8, 249u8, 94u8, 153u8, ], ) } @@ -7018,9 +7039,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 100u8, 205u8, 203u8, 161u8, 31u8, 57u8, 31u8, 115u8, 134u8, 81u8, - 236u8, 40u8, 95u8, 37u8, 38u8, 27u8, 67u8, 89u8, 33u8, 185u8, 24u8, - 165u8, 246u8, 246u8, 48u8, 67u8, 177u8, 12u8, 46u8, 141u8, 11u8, 25u8, + 254u8, 212u8, 47u8, 162u8, 236u8, 238u8, 242u8, 135u8, 208u8, 62u8, + 68u8, 91u8, 107u8, 86u8, 146u8, 63u8, 108u8, 3u8, 61u8, 101u8, 173u8, + 90u8, 203u8, 90u8, 253u8, 130u8, 236u8, 119u8, 137u8, 143u8, 23u8, + 101u8, ], ) } @@ -7059,10 +7081,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 210u8, 55u8, 125u8, 95u8, 253u8, 110u8, 140u8, 205u8, 186u8, 161u8, - 76u8, 252u8, 207u8, 226u8, 159u8, 234u8, 124u8, 20u8, 188u8, 213u8, - 104u8, 205u8, 206u8, 71u8, 35u8, 142u8, 97u8, 154u8, 74u8, 93u8, 233u8, - 20u8, + 191u8, 55u8, 201u8, 33u8, 218u8, 232u8, 254u8, 190u8, 178u8, 212u8, + 177u8, 55u8, 123u8, 193u8, 192u8, 168u8, 191u8, 152u8, 114u8, 219u8, + 36u8, 16u8, 169u8, 153u8, 177u8, 252u8, 155u8, 86u8, 6u8, 84u8, 15u8, + 138u8, ], ) } @@ -7087,10 +7109,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 179u8, 212u8, 93u8, 228u8, 136u8, 199u8, 98u8, 22u8, 251u8, 201u8, - 147u8, 72u8, 198u8, 144u8, 244u8, 0u8, 108u8, 133u8, 204u8, 248u8, - 18u8, 181u8, 195u8, 254u8, 232u8, 242u8, 5u8, 197u8, 213u8, 106u8, - 197u8, 81u8, + 196u8, 7u8, 166u8, 8u8, 233u8, 74u8, 187u8, 62u8, 55u8, 71u8, 143u8, + 206u8, 254u8, 189u8, 104u8, 165u8, 210u8, 41u8, 142u8, 62u8, 113u8, + 106u8, 114u8, 199u8, 72u8, 76u8, 154u8, 217u8, 15u8, 219u8, 40u8, + 139u8, ], ) } @@ -8118,9 +8140,9 @@ pub mod api { "batch", types::Batch { calls }, [ - 59u8, 61u8, 45u8, 32u8, 55u8, 82u8, 67u8, 35u8, 143u8, 52u8, 8u8, 28u8, - 92u8, 204u8, 254u8, 33u8, 146u8, 112u8, 54u8, 88u8, 99u8, 151u8, 59u8, - 234u8, 170u8, 65u8, 108u8, 203u8, 38u8, 120u8, 69u8, 236u8, + 29u8, 28u8, 25u8, 61u8, 37u8, 229u8, 210u8, 111u8, 193u8, 52u8, 8u8, + 21u8, 8u8, 77u8, 157u8, 19u8, 69u8, 118u8, 208u8, 3u8, 236u8, 225u8, + 131u8, 77u8, 233u8, 125u8, 14u8, 47u8, 149u8, 143u8, 196u8, 180u8, ], ) } @@ -8150,9 +8172,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 49u8, 98u8, 158u8, 227u8, 229u8, 93u8, 55u8, 48u8, 105u8, 191u8, 169u8, - 209u8, 42u8, 128u8, 36u8, 126u8, 212u8, 58u8, 177u8, 230u8, 82u8, 50u8, - 221u8, 25u8, 197u8, 14u8, 165u8, 215u8, 204u8, 67u8, 26u8, 237u8, + 78u8, 75u8, 127u8, 252u8, 226u8, 106u8, 177u8, 111u8, 109u8, 35u8, + 226u8, 24u8, 240u8, 125u8, 95u8, 164u8, 6u8, 131u8, 118u8, 140u8, + 133u8, 52u8, 134u8, 121u8, 19u8, 176u8, 158u8, 218u8, 160u8, 219u8, + 235u8, 233u8, ], ) } @@ -8178,10 +8201,9 @@ pub mod api { "batch_all", types::BatchAll { calls }, [ - 81u8, 126u8, 134u8, 19u8, 154u8, 25u8, 143u8, 199u8, 235u8, 33u8, - 106u8, 108u8, 24u8, 240u8, 142u8, 226u8, 51u8, 81u8, 87u8, 122u8, - 238u8, 215u8, 16u8, 104u8, 138u8, 48u8, 213u8, 130u8, 185u8, 53u8, - 180u8, 201u8, + 56u8, 130u8, 125u8, 42u8, 220u8, 133u8, 183u8, 94u8, 13u8, 103u8, 16u8, + 149u8, 44u8, 225u8, 125u8, 36u8, 46u8, 223u8, 93u8, 153u8, 156u8, 2u8, + 2u8, 76u8, 46u8, 82u8, 216u8, 16u8, 63u8, 192u8, 243u8, 174u8, ], ) } @@ -8204,9 +8226,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 1u8, 7u8, 40u8, 151u8, 90u8, 139u8, 3u8, 204u8, 72u8, 237u8, 200u8, - 69u8, 65u8, 140u8, 122u8, 94u8, 185u8, 164u8, 101u8, 197u8, 33u8, 9u8, - 34u8, 144u8, 16u8, 149u8, 33u8, 17u8, 171u8, 154u8, 137u8, 18u8, + 24u8, 158u8, 80u8, 1u8, 187u8, 72u8, 32u8, 2u8, 113u8, 167u8, 122u8, + 47u8, 26u8, 118u8, 234u8, 203u8, 254u8, 191u8, 117u8, 108u8, 172u8, + 111u8, 220u8, 55u8, 232u8, 14u8, 119u8, 92u8, 36u8, 201u8, 27u8, 49u8, ], ) } @@ -8232,10 +8254,10 @@ pub mod api { "force_batch", types::ForceBatch { calls }, [ - 229u8, 139u8, 136u8, 184u8, 120u8, 148u8, 128u8, 70u8, 246u8, 115u8, - 103u8, 48u8, 127u8, 189u8, 22u8, 96u8, 160u8, 139u8, 72u8, 218u8, - 253u8, 243u8, 228u8, 10u8, 143u8, 23u8, 92u8, 132u8, 80u8, 22u8, 12u8, - 21u8, + 50u8, 50u8, 57u8, 73u8, 93u8, 223u8, 143u8, 109u8, 123u8, 36u8, 226u8, + 101u8, 212u8, 87u8, 211u8, 231u8, 76u8, 118u8, 19u8, 234u8, 244u8, + 218u8, 116u8, 201u8, 212u8, 141u8, 240u8, 165u8, 58u8, 16u8, 59u8, + 170u8, ], ) } @@ -8258,10 +8280,10 @@ pub mod api { weight, }, [ - 123u8, 89u8, 82u8, 198u8, 245u8, 59u8, 229u8, 118u8, 168u8, 163u8, - 239u8, 132u8, 42u8, 50u8, 117u8, 205u8, 110u8, 229u8, 143u8, 194u8, - 25u8, 176u8, 2u8, 35u8, 231u8, 250u8, 98u8, 251u8, 144u8, 23u8, 35u8, - 2u8, + 125u8, 121u8, 97u8, 244u8, 194u8, 123u8, 194u8, 45u8, 174u8, 151u8, + 149u8, 196u8, 231u8, 109u8, 100u8, 158u8, 48u8, 243u8, 3u8, 132u8, + 18u8, 3u8, 158u8, 108u8, 106u8, 73u8, 112u8, 93u8, 70u8, 50u8, 79u8, + 44u8, ], ) } @@ -8301,9 +8323,9 @@ pub mod api { fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), }, [ - 62u8, 66u8, 121u8, 77u8, 185u8, 44u8, 169u8, 244u8, 134u8, 153u8, 43u8, - 220u8, 186u8, 3u8, 188u8, 16u8, 1u8, 115u8, 152u8, 34u8, 149u8, 48u8, - 157u8, 165u8, 214u8, 37u8, 115u8, 252u8, 176u8, 195u8, 134u8, 213u8, + 58u8, 160u8, 8u8, 132u8, 95u8, 63u8, 112u8, 54u8, 218u8, 35u8, 188u8, + 230u8, 236u8, 48u8, 141u8, 98u8, 9u8, 203u8, 228u8, 216u8, 127u8, 17u8, + 244u8, 220u8, 43u8, 36u8, 48u8, 88u8, 36u8, 134u8, 179u8, 166u8, ], ) } @@ -8326,9 +8348,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 238u8, 235u8, 190u8, 150u8, 221u8, 200u8, 0u8, 102u8, 43u8, 253u8, - 193u8, 207u8, 100u8, 94u8, 235u8, 93u8, 88u8, 135u8, 32u8, 85u8, 7u8, - 4u8, 43u8, 129u8, 4u8, 29u8, 183u8, 81u8, 81u8, 76u8, 123u8, 216u8, + 16u8, 203u8, 2u8, 142u8, 9u8, 0u8, 98u8, 108u8, 243u8, 189u8, 154u8, + 255u8, 212u8, 133u8, 216u8, 99u8, 123u8, 165u8, 94u8, 36u8, 17u8, + 171u8, 255u8, 183u8, 195u8, 149u8, 196u8, 174u8, 151u8, 59u8, 99u8, + 98u8, ], ) } @@ -10730,7 +10753,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< @@ -15295,10 +15318,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 96u8, 65u8, 213u8, 54u8, 132u8, 243u8, 226u8, 209u8, 189u8, 106u8, - 220u8, 118u8, 51u8, 43u8, 78u8, 247u8, 125u8, 239u8, 232u8, 150u8, - 123u8, 220u8, 122u8, 68u8, 65u8, 92u8, 99u8, 207u8, 126u8, 58u8, 105u8, - 128u8, + 93u8, 43u8, 222u8, 117u8, 210u8, 66u8, 22u8, 189u8, 131u8, 103u8, + 143u8, 248u8, 204u8, 35u8, 51u8, 12u8, 218u8, 193u8, 15u8, 152u8, 2u8, + 224u8, 7u8, 28u8, 80u8, 94u8, 14u8, 18u8, 147u8, 138u8, 124u8, 171u8, ], ) } @@ -19937,15 +19959,17 @@ pub mod api { #[doc = ""] #[doc = "Parameters:"] #[doc = "- `multisig_address`: The multisig account"] - #[doc = "- `proposal_hash`: Hash of the proposal to approve"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] pub struct Approve { pub multisig_address: approve::MultisigAddress, - pub proposal_hash: approve::ProposalHash, + pub proposal_id: approve::ProposalId, } pub mod approve { use super::runtime_types; pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; - pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + pub type ProposalId = ::core::primitive::u32; } impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Approve { const PALLET: &'static str = "Multisig"; @@ -19966,15 +19990,17 @@ pub mod api { #[doc = ""] #[doc = "Parameters:"] #[doc = "- `multisig_address`: The multisig account"] - #[doc = "- `proposal_hash`: Hash of the proposal to cancel"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] pub struct Cancel { pub multisig_address: cancel::MultisigAddress, - pub proposal_hash: cancel::ProposalHash, + pub proposal_id: cancel::ProposalId, } pub mod cancel { use super::runtime_types; pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; - pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + pub type ProposalId = ::core::primitive::u32; } impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { const PALLET: &'static str = "Multisig"; @@ -19991,27 +20017,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove a proposal and return deposit to proposer"] + #[doc = "Remove expired proposals and return deposits to proposers"] #[doc = ""] #[doc = "Can only be called by signers of the multisig."] - #[doc = ""] - #[doc = "Can be used to clean up proposals that are:"] - #[doc = "- Active and expired (past expiry block)"] - #[doc = "- Executed (status changed to Executed)"] - #[doc = "- Cancelled (status changed to Cancelled)"] + #[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 signers to help clean up storage even if proposer is inactive."] - #[doc = ""] - #[doc = "This enforces storage cleanup - users must remove old proposals to recover deposits."] + #[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_hash: remove_expired::ProposalHash, + 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 ProposalHash = ::subxt::ext::subxt_core::utils::H256; + pub type ProposalId = ::core::primitive::u32; } impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveExpired { const PALLET: &'static str = "Multisig"; @@ -20028,15 +20049,16 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Claim all deposits from cancelled, executed, and expired proposals"] + #[doc = "Claim all deposits from expired proposals"] #[doc = ""] - #[doc = "This is a batch operation that removes all proposals where:"] + #[doc = "This is a batch operation that removes all expired proposals where:"] #[doc = "- Caller is the proposer"] - #[doc = "- Proposal is Executed, Cancelled, or Active+Expired"] - #[doc = "- Grace period has elapsed since status changed"] + #[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."] - #[doc = "This enforces storage cleanup - users must actively clean up to recover deposits."] pub struct ClaimDeposits { pub multisig_address: claim_deposits::MultisigAddress, } @@ -20144,21 +20166,22 @@ pub mod api { #[doc = ""] #[doc = "Parameters:"] #[doc = "- `multisig_address`: The multisig account"] - #[doc = "- `proposal_hash`: Hash of the proposal to approve"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] pub fn approve( &self, multisig_address: types::approve::MultisigAddress, - proposal_hash: types::approve::ProposalHash, + 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_hash }, + types::Approve { multisig_address, proposal_id }, [ - 238u8, 153u8, 178u8, 75u8, 231u8, 35u8, 44u8, 235u8, 156u8, 34u8, - 178u8, 246u8, 232u8, 103u8, 83u8, 175u8, 172u8, 172u8, 143u8, 11u8, - 92u8, 150u8, 49u8, 101u8, 59u8, 90u8, 240u8, 255u8, 215u8, 247u8, 19u8, - 30u8, + 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, ], ) } @@ -20166,62 +20189,60 @@ pub mod api { #[doc = ""] #[doc = "Parameters:"] #[doc = "- `multisig_address`: The multisig account"] - #[doc = "- `proposal_hash`: Hash of the proposal to cancel"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] pub fn cancel( &self, multisig_address: types::cancel::MultisigAddress, - proposal_hash: types::cancel::ProposalHash, + 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_hash }, + types::Cancel { multisig_address, proposal_id }, [ - 8u8, 55u8, 236u8, 245u8, 9u8, 186u8, 177u8, 255u8, 176u8, 215u8, 18u8, - 221u8, 16u8, 31u8, 93u8, 224u8, 218u8, 147u8, 100u8, 128u8, 16u8, - 251u8, 173u8, 46u8, 186u8, 2u8, 146u8, 210u8, 111u8, 39u8, 60u8, 171u8, + 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 = "Remove a proposal and return deposit to proposer"] + #[doc = "Remove expired proposals and return deposits to proposers"] #[doc = ""] #[doc = "Can only be called by signers of the multisig."] - #[doc = ""] - #[doc = "Can be used to clean up proposals that are:"] - #[doc = "- Active and expired (past expiry block)"] - #[doc = "- Executed (status changed to Executed)"] - #[doc = "- Cancelled (status changed to Cancelled)"] + #[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 signers to help clean up storage even if proposer is inactive."] - #[doc = ""] - #[doc = "This enforces storage cleanup - users must remove old proposals to recover deposits."] + #[doc = "This allows any signer to help clean up storage even if proposer is inactive."] pub fn remove_expired( &self, multisig_address: types::remove_expired::MultisigAddress, - proposal_hash: types::remove_expired::ProposalHash, + 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_hash }, + types::RemoveExpired { multisig_address, proposal_id }, [ - 226u8, 97u8, 94u8, 56u8, 242u8, 15u8, 151u8, 120u8, 156u8, 64u8, 92u8, - 126u8, 230u8, 75u8, 171u8, 15u8, 76u8, 89u8, 211u8, 85u8, 129u8, 123u8, - 9u8, 93u8, 157u8, 237u8, 76u8, 218u8, 55u8, 76u8, 204u8, 240u8, + 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 = "Claim all deposits from cancelled, executed, and expired proposals"] + #[doc = "Claim all deposits from expired proposals"] #[doc = ""] - #[doc = "This is a batch operation that removes all proposals where:"] + #[doc = "This is a batch operation that removes all expired proposals where:"] #[doc = "- Caller is the proposer"] - #[doc = "- Proposal is Executed, Cancelled, or Active+Expired"] - #[doc = "- Grace period has elapsed since status changed"] + #[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."] - #[doc = "This enforces storage cleanup - users must actively clean up to recover deposits."] pub fn claim_deposits( &self, multisig_address: types::claim_deposits::MultisigAddress, @@ -20310,13 +20331,13 @@ pub mod api { pub struct ProposalCreated { pub multisig_address: proposal_created::MultisigAddress, pub proposer: proposal_created::Proposer, - pub proposal_hash: proposal_created::ProposalHash, + 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 ProposalHash = ::subxt::ext::subxt_core::utils::H256; + pub type ProposalId = ::core::primitive::u32; } impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalCreated { const PALLET: &'static str = "Multisig"; @@ -20333,14 +20354,14 @@ pub mod api { pub struct ProposalApproved { pub multisig_address: proposal_approved::MultisigAddress, pub approver: proposal_approved::Approver, - pub proposal_hash: proposal_approved::ProposalHash, + 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 ProposalHash = ::subxt::ext::subxt_core::utils::H256; + pub type ProposalId = ::core::primitive::u32; pub type ApprovalsCount = ::core::primitive::u32; } impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalApproved { @@ -20358,7 +20379,7 @@ pub mod api { #[doc = "Contains all data needed for indexing by SubSquid"] pub struct ProposalExecuted { pub multisig_address: proposal_executed::MultisigAddress, - pub proposal_hash: proposal_executed::ProposalHash, + pub proposal_id: proposal_executed::ProposalId, pub proposer: proposal_executed::Proposer, pub call: proposal_executed::Call, pub approvers: proposal_executed::Approvers, @@ -20367,7 +20388,7 @@ pub mod api { pub mod proposal_executed { use super::runtime_types; pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; - pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + 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< @@ -20391,13 +20412,13 @@ pub mod api { pub struct ProposalCancelled { pub multisig_address: proposal_cancelled::MultisigAddress, pub proposer: proposal_cancelled::Proposer, - pub proposal_hash: proposal_cancelled::ProposalHash, + 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 ProposalHash = ::subxt::ext::subxt_core::utils::H256; + pub type ProposalId = ::core::primitive::u32; } impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalCancelled { const PALLET: &'static str = "Multisig"; @@ -20413,14 +20434,14 @@ pub mod api { #[doc = "Expired proposal was removed from storage"] pub struct ProposalRemoved { pub multisig_address: proposal_removed::MultisigAddress, - pub proposal_hash: proposal_removed::ProposalHash, + 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 MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; - pub type ProposalHash = ::subxt::ext::subxt_core::utils::H256; + pub type ProposalId = ::core::primitive::u32; pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; pub type RemovedBy = ::subxt::ext::subxt_core::utils::AccountId32; } @@ -20496,6 +20517,10 @@ pub mod api { ::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 = ::subxt::ext::subxt_core::utils::AccountId32; } @@ -20513,7 +20538,7 @@ pub mod api { >, >; pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::subxt::ext::subxt_core::utils::H256; + pub type Param1 = ::core::primitive::u32; } } pub struct StorageApi; @@ -20554,10 +20579,9 @@ pub mod api { "Multisigs", (), [ - 234u8, 188u8, 39u8, 221u8, 0u8, 221u8, 250u8, 110u8, 209u8, 84u8, - 132u8, 110u8, 2u8, 89u8, 153u8, 228u8, 59u8, 5u8, 8u8, 33u8, 85u8, - 129u8, 131u8, 102u8, 242u8, 134u8, 183u8, 172u8, 12u8, 102u8, 130u8, - 199u8, + 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, ], ) } @@ -20579,14 +20603,13 @@ pub mod api { "Multisigs", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 234u8, 188u8, 39u8, 221u8, 0u8, 221u8, 250u8, 110u8, 209u8, 84u8, - 132u8, 110u8, 2u8, 89u8, 153u8, 228u8, 59u8, 5u8, 8u8, 33u8, 85u8, - 129u8, 131u8, 102u8, 242u8, 134u8, 183u8, 172u8, 12u8, 102u8, 130u8, - 199u8, + 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_hash)"] + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] pub fn proposals_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< @@ -20601,14 +20624,13 @@ pub mod api { "Proposals", (), [ - 236u8, 76u8, 63u8, 186u8, 167u8, 133u8, 151u8, 75u8, 46u8, 48u8, 84u8, - 214u8, 219u8, 224u8, 189u8, 213u8, 2u8, 165u8, 43u8, 197u8, 153u8, - 118u8, 17u8, 249u8, 238u8, 109u8, 252u8, 214u8, 166u8, 25u8, 67u8, - 187u8, + 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_hash)"] + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] pub fn proposals_iter1( &self, _0: types::proposals::Param0, @@ -20626,14 +20648,13 @@ pub mod api { "Proposals", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 236u8, 76u8, 63u8, 186u8, 167u8, 133u8, 151u8, 75u8, 46u8, 48u8, 84u8, - 214u8, 219u8, 224u8, 189u8, 213u8, 2u8, 165u8, 43u8, 197u8, 153u8, - 118u8, 17u8, 249u8, 238u8, 109u8, 252u8, 214u8, 166u8, 25u8, 67u8, - 187u8, + 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_hash)"] + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] pub fn proposals( &self, _0: types::proposals::Param0, @@ -20660,10 +20681,9 @@ pub mod api { ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), ), [ - 236u8, 76u8, 63u8, 186u8, 167u8, 133u8, 151u8, 75u8, 46u8, 48u8, 84u8, - 214u8, 219u8, 224u8, 189u8, 213u8, 2u8, 165u8, 43u8, 197u8, 153u8, - 118u8, 17u8, 249u8, 238u8, 109u8, 252u8, 214u8, 166u8, 25u8, 67u8, - 187u8, + 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, ], ) } @@ -20871,6 +20891,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( @@ -23773,49 +23810,49 @@ pub mod api { #[doc = ""] #[doc = "Parameters:"] #[doc = "- `multisig_address`: The multisig account"] - #[doc = "- `proposal_hash`: Hash of the proposal to approve"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] approve { multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, - proposal_hash: ::subxt::ext::subxt_core::utils::H256, + proposal_id: ::core::primitive::u32, }, #[codec(index = 3)] #[doc = "Cancel a proposed transaction (only by proposer)"] #[doc = ""] #[doc = "Parameters:"] #[doc = "- `multisig_address`: The multisig account"] - #[doc = "- `proposal_hash`: Hash of the proposal to cancel"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] cancel { multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, - proposal_hash: ::subxt::ext::subxt_core::utils::H256, + proposal_id: ::core::primitive::u32, }, #[codec(index = 4)] - #[doc = "Remove a proposal and return deposit to proposer"] + #[doc = "Remove expired proposals and return deposits to proposers"] #[doc = ""] #[doc = "Can only be called by signers of the multisig."] - #[doc = ""] - #[doc = "Can be used to clean up proposals that are:"] - #[doc = "- Active and expired (past expiry block)"] - #[doc = "- Executed (status changed to Executed)"] - #[doc = "- Cancelled (status changed to Cancelled)"] + #[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 signers to help clean up storage even if proposer is inactive."] - #[doc = ""] - #[doc = "This enforces storage cleanup - users must remove old proposals to recover deposits."] + #[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_hash: ::subxt::ext::subxt_core::utils::H256, + proposal_id: ::core::primitive::u32, }, #[codec(index = 5)] - #[doc = "Claim all deposits from cancelled, executed, and expired proposals"] + #[doc = "Claim all deposits from expired proposals"] #[doc = ""] - #[doc = "This is a batch operation that removes all proposals where:"] + #[doc = "This is a batch operation that removes all expired proposals where:"] #[doc = "- Caller is the proposer"] - #[doc = "- Proposal is Executed, Cancelled, or Active+Expired"] - #[doc = "- Grace period has elapsed since status changed"] + #[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."] - #[doc = "This enforces storage cleanup - users must actively clean up to recover deposits."] claim_deposits { multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, }, @@ -23903,21 +23940,24 @@ pub mod api { #[doc = "Too many total proposals in storage for this multisig (cleanup required)"] TooManyProposalsInStorage, #[codec(index = 19)] + #[doc = "This signer has too many proposals in storage (filibuster protection)"] + TooManyProposalsPerSigner, + #[codec(index = 20)] #[doc = "Insufficient balance for deposit"] InsufficientBalance, - #[codec(index = 20)] + #[codec(index = 21)] #[doc = "Proposal has active deposit"] ProposalHasDeposit, - #[codec(index = 21)] + #[codec(index = 22)] #[doc = "Proposal has not expired yet"] ProposalNotExpired, - #[codec(index = 22)] + #[codec(index = 23)] #[doc = "Proposal is not active (already executed or cancelled)"] ProposalNotActive, - #[codec(index = 23)] + #[codec(index = 24)] #[doc = "Cannot dissolve multisig with existing proposals (clear them first)"] ProposalsExist, - #[codec(index = 24)] + #[codec(index = 25)] #[doc = "Multisig account must have zero balance before dissolution"] MultisigAccountNotZero, } @@ -23951,14 +23991,14 @@ pub mod api { ProposalCreated { multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, proposer: ::subxt::ext::subxt_core::utils::AccountId32, - proposal_hash: ::subxt::ext::subxt_core::utils::H256, + proposal_id: ::core::primitive::u32, }, #[codec(index = 2)] #[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_hash: ::subxt::ext::subxt_core::utils::H256, + proposal_id: ::core::primitive::u32, approvals_count: ::core::primitive::u32, }, #[codec(index = 3)] @@ -23966,7 +24006,7 @@ pub mod api { #[doc = "Contains all data needed for indexing by SubSquid"] ProposalExecuted { multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, - proposal_hash: ::subxt::ext::subxt_core::utils::H256, + 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< @@ -23980,13 +24020,13 @@ pub mod api { ProposalCancelled { multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, proposer: ::subxt::ext::subxt_core::utils::AccountId32, - proposal_hash: ::subxt::ext::subxt_core::utils::H256, + 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_hash: ::subxt::ext::subxt_core::utils::H256, + proposal_id: ::core::primitive::u32, proposer: ::subxt::ext::subxt_core::utils::AccountId32, removed_by: ::subxt::ext::subxt_core::utils::AccountId32, }, @@ -24015,7 +24055,7 @@ 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 MultisigData<_0, _1, _2, _3> { + pub struct MultisigData<_0, _1, _2, _3, _4> { pub signers: _2, pub threshold: ::core::primitive::u32, pub nonce: ::core::primitive::u64, @@ -24024,6 +24064,7 @@ pub mod api { pub deposit: _3, pub last_activity: _0, pub active_proposals: ::core::primitive::u32, + pub proposals_per_signer: _4, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, diff --git a/src/cli/multisig.rs b/src/cli/multisig.rs index 9297115..656cc16 100644 --- a/src/cli/multisig.rs +++ b/src/cli/multisig.rs @@ -7,11 +7,44 @@ use clap::Subcommand; use colored::Colorize; use hex; use sp_core::crypto::{AccountId32 as SpAccountId32, Ss58Codec}; -use subxt::utils::H256; // Base unit (QUAN) decimals for amount conversions const QUAN_DECIMALS: u128 = 1_000_000_000_000; // 10^12 +/// Parse amount from human-readable format (e.g., "10", "10.5", "0.001") +/// or raw format (e.g., "10000000000000") +fn parse_amount(amount: &str) -> crate::error::Result { + // If contains decimal point, parse as float and multiply by QUAN_DECIMALS + if amount.contains('.') { + let amount_f64: f64 = amount + .parse() + .map_err(|e| crate::error::QuantusError::Generic(format!("Invalid amount: {}", e)))?; + + if amount_f64 < 0.0 { + return Err(crate::error::QuantusError::Generic( + "Amount cannot be negative".to_string(), + )); + } + + // Multiply by decimals and convert to u128 + let base_amount = (amount_f64 * QUAN_DECIMALS as f64) as u128; + Ok(base_amount) + } else { + // Try parsing as u128 first (raw format) + if let Ok(raw) = amount.parse::() { + // If the number is very large (>= 10^10), assume it's already in base units + if raw >= 10_000_000_000 { + Ok(raw) + } else { + // Otherwise assume it's in QUAN and convert + Ok(raw * QUAN_DECIMALS) + } + } else { + Err(crate::error::QuantusError::Generic(format!("Invalid amount: {}", amount))) + } + } +} + /// Subcommands for proposing transactions #[derive(Subcommand, Debug)] pub enum ProposeSubcommand { @@ -25,7 +58,7 @@ pub enum ProposeSubcommand { #[arg(long)] to: String, - /// Amount to transfer (in base units, e.g., 1000000000000 for 1 QUAN) + /// Amount to transfer (e.g., "10", "10.5", or raw "10000000000000") #[arg(long)] amount: String, @@ -106,6 +139,10 @@ pub enum MultisigCommands { /// Read password from file (for scripting) #[arg(long)] password_file: Option, + + /// Predict address before submission (faster but may be incorrect if concurrent creations) + #[arg(long)] + predict: bool, }, /// Propose a transaction to be executed by the multisig @@ -118,9 +155,9 @@ pub enum MultisigCommands { #[arg(long)] address: String, - /// Proposal hash to approve + /// Proposal ID (u32 nonce) #[arg(long)] - proposal_hash: String, + proposal_id: u32, /// Approver wallet name (must be a signer) #[arg(long)] @@ -141,9 +178,9 @@ pub enum MultisigCommands { #[arg(long)] address: String, - /// Proposal hash to cancel + /// Proposal ID (u32 nonce) to cancel #[arg(long)] - proposal_hash: String, + proposal_id: u32, /// Wallet name (must be the proposer) #[arg(long)] @@ -158,15 +195,15 @@ pub enum MultisigCommands { password_file: Option, }, - /// Remove an expired/executed/cancelled proposal + /// Remove an expired proposal RemoveExpired { /// Multisig account address #[arg(long)] address: String, - /// Proposal hash to remove + /// Proposal ID (u32 nonce) to remove #[arg(long)] - proposal_hash: String, + proposal_id: u32, /// Wallet name (must be a signer) #[arg(long)] @@ -219,22 +256,15 @@ pub enum MultisigCommands { password_file: Option, }, - /// Query multisig information + /// Query multisig information (or specific proposal if --proposal-id provided) Info { /// Multisig account address #[arg(long)] address: String, - }, - - /// Query proposal information - ProposalInfo { - /// Multisig account address - #[arg(long)] - address: String, - /// Proposal hash + /// Optional: Query specific proposal by ID #[arg(long)] - proposal_hash: String, + proposal_id: Option, }, /// List all proposals for a multisig @@ -252,13 +282,14 @@ pub async fn handle_multisig_command( execution_mode: ExecutionMode, ) -> crate::error::Result<()> { match command { - MultisigCommands::Create { signers, threshold, from, password, password_file } => + MultisigCommands::Create { signers, threshold, from, password, password_file, predict } => handle_create_multisig( signers, threshold, from, password, password_file, + predict, node_url, execution_mode, ) @@ -309,10 +340,10 @@ pub async fn handle_multisig_command( ) .await, }, - MultisigCommands::Approve { address, proposal_hash, from, password, password_file } => + MultisigCommands::Approve { address, proposal_id, from, password, password_file } => handle_approve( address, - proposal_hash, + proposal_id, from, password, password_file, @@ -320,10 +351,10 @@ pub async fn handle_multisig_command( execution_mode, ) .await, - MultisigCommands::Cancel { address, proposal_hash, from, password, password_file } => + MultisigCommands::Cancel { address, proposal_id, from, password, password_file } => handle_cancel( address, - proposal_hash, + proposal_id, from, password, password_file, @@ -331,16 +362,10 @@ pub async fn handle_multisig_command( execution_mode, ) .await, - MultisigCommands::RemoveExpired { - address, - proposal_hash, - from, - password, - password_file, - } => + MultisigCommands::RemoveExpired { address, proposal_id, from, password, password_file } => handle_remove_expired( address, - proposal_hash, + proposal_id, from, password, password_file, @@ -353,9 +378,8 @@ pub async fn handle_multisig_command( .await, MultisigCommands::Dissolve { address, from, password, password_file } => handle_dissolve(address, from, password, password_file, node_url, execution_mode).await, - MultisigCommands::Info { address } => handle_info(address, node_url).await, - MultisigCommands::ProposalInfo { address, proposal_hash } => - handle_proposal_info(address, proposal_hash, node_url).await, + MultisigCommands::Info { address, proposal_id } => + handle_info(address, proposal_id, node_url).await, MultisigCommands::ListProposals { address } => handle_list_proposals(address, node_url).await, } @@ -368,6 +392,7 @@ async fn handle_create_multisig( from: String, password: Option, password_file: Option, + predict: bool, node_url: &str, execution_mode: ExecutionMode, ) -> crate::error::Result<()> { @@ -424,23 +449,106 @@ async fn handle_create_multisig( .multisig() .create_multisig(signer_addresses.clone(), threshold); - // Submit transaction - crate::cli::common::submit_transaction( + if predict { + // PREDICT MODE: Calculate address before submission (fast but may be wrong on race) + use codec::Encode; + use sp_core::blake2_256; + + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage = quantus_client.client().storage().at(latest_block_hash); + let global_nonce_query = quantus_subxt::api::storage().multisig().global_nonce(); + let current_nonce = storage.fetch(&global_nonce_query).await?.unwrap_or(0); + + const PALLET_ID: [u8; 8] = *b"py/mltsg"; + let mut data = Vec::new(); + data.extend_from_slice(&PALLET_ID); + let signers_for_hash: Vec<[u8; 32]> = + signer_addresses.iter().map(|a| *a.as_ref()).collect(); + data.extend_from_slice(&signers_for_hash.encode()); + data.extend_from_slice(¤t_nonce.encode()); + + let hash = blake2_256(&data); + let predicted_address = SpAccountId32::from(hash) + .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + log_print!(""); + log_success!("๐Ÿ“ Predicted address: {}", predicted_address.bright_yellow().bold()); + log_print!( + " โš ๏ธ {} May differ if concurrent multisig creations occur", + "WARNING:".bright_yellow() + ); + log_print!(" Check events or use without --predict for confirmed address"); + log_print!(""); + } + + // Submit transaction (will wait if execution_mode.wait_for_transaction = true) + let _tx_hash = crate::cli::common::submit_transaction( &quantus_client, &keypair, create_tx, - None, // no tip + None, execution_mode, ) .await?; log_success!("โœ… Multisig creation transaction submitted"); - log_print!(""); - log_print!( - "๐Ÿ’ก {} The multisig address will be generated deterministically", - "NOTE".bright_blue().bold() - ); - log_print!(" Check the events to find the multisig address"); + + // If NOT predict mode AND wait_for_transaction, extract address from events + if !predict && execution_mode.wait_for_transaction { + log_print!(""); + log_print!("๐Ÿ” Looking for MultisigCreated event..."); + + // Query latest block events + let latest_block_hash = quantus_client.get_latest_block().await?; + let events = quantus_client.client().events().at(latest_block_hash).await?; + + // Find MultisigCreated event + let multisig_events = + events.find::(); + + let mut actual_address: Option = None; + for event_result in multisig_events { + match event_result { + Ok(ev) => { + let addr_bytes: &[u8; 32] = ev.multisig_address.as_ref(); + let addr = SpAccountId32::from(*addr_bytes); + actual_address = Some(addr.to_ss58check_with_version( + sp_core::crypto::Ss58AddressFormat::custom(189), + )); + log_verbose!("Found MultisigCreated event"); + break; + }, + Err(e) => { + log_verbose!("Error parsing event: {:?}", e); + }, + } + } + + if let Some(address) = actual_address { + log_print!(""); + log_success!("๐Ÿ“ Multisig address: {}", address.bright_cyan().bold()); + log_print!(""); + log_print!( + "๐Ÿ’ก {} You can now use this address to propose transactions", + "TIP".bright_blue().bold() + ); + log_print!( + " Example: quantus multisig propose transfer --address {} --to recipient --amount 1000000000000", + address.bright_cyan() + ); + } else { + log_error!("โš ๏ธ Couldn't find MultisigCreated event"); + log_print!(" Check events manually: quantus events --latest --pallet Multisig"); + } + } else if !predict { + log_print!(""); + log_print!( + "๐Ÿ’ก {} Transaction submitted. Check events for multisig address:", + "NOTE".bright_blue().bold() + ); + log_print!(" quantus events --latest --pallet Multisig"); + } + log_print!(""); Ok(()) @@ -464,10 +572,8 @@ async fn handle_propose_transfer( // Resolve recipient address (wallet name or SS58) let to_address = crate::cli::common::resolve_address(&to)?; - // Parse amount - let amount_u128: u128 = amount - .parse() - .map_err(|e| crate::error::QuantusError::Generic(format!("Invalid amount: {}", e)))?; + // Parse amount (supports both human format "10" and raw "10000000000000") + let amount_u128: u128 = parse_amount(&amount)?; // Build args as JSON array (using serde_json for proper escaping) let args_json = serde_json::to_string(&vec![ @@ -532,6 +638,23 @@ async fn handle_propose( // Connect to chain let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + // Validate expiry is in the future (client-side check) + let latest_block_hash = quantus_client.get_latest_block().await?; + let latest_block = quantus_client.client().blocks().at(latest_block_hash).await?; + let current_block_number = latest_block.number(); + + if expiry <= current_block_number { + log_error!( + "โŒ Expiry block {} is in the past (current block: {})", + expiry, + current_block_number + ); + log_print!(" Use a higher block number, e.g., --expiry {}", current_block_number + 1000); + return Err(crate::error::QuantusError::Generic("Expiry must be in the future".to_string())); + } + + log_verbose!("Current block: {}, expiry valid", current_block_number); + // Build the call data using runtime metadata let call_data = build_runtime_call(&quantus_client, &pallet, &call, args_vec).await?; @@ -565,7 +688,7 @@ async fn handle_propose( /// Approve a proposal async fn handle_approve( multisig_address: String, - proposal_hash: String, + proposal_id: u32, from: String, password: Option, password_file: Option, @@ -582,10 +705,9 @@ async fn handle_approve( })?; let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); - let hash = parse_hash(&proposal_hash)?; log_verbose!("Multisig: {}", multisig_ss58); - log_verbose!("Proposal hash: {}", proposal_hash); + log_verbose!("Proposal ID: {}", proposal_id); // Load keypair let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; @@ -594,7 +716,7 @@ async fn handle_approve( let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; // Build transaction - let approve_tx = quantus_subxt::api::tx().multisig().approve(multisig_address, hash); + let approve_tx = quantus_subxt::api::tx().multisig().approve(multisig_address, proposal_id); // Submit transaction crate::cli::common::submit_transaction( @@ -615,7 +737,7 @@ async fn handle_approve( /// Cancel a proposal async fn handle_cancel( multisig_address: String, - proposal_hash: String, + proposal_id: u32, from: String, password: Option, password_file: Option, @@ -632,7 +754,8 @@ async fn handle_cancel( })?; let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); - let hash = parse_hash(&proposal_hash)?; + + log_verbose!("Proposal ID: {}", proposal_id); // Load keypair let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; @@ -641,7 +764,7 @@ async fn handle_cancel( let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; // Build transaction - let cancel_tx = quantus_subxt::api::tx().multisig().cancel(multisig_address, hash); + let cancel_tx = quantus_subxt::api::tx().multisig().cancel(multisig_address, proposal_id); // Submit transaction crate::cli::common::submit_transaction( @@ -653,23 +776,23 @@ async fn handle_cancel( ) .await?; - log_success!("โœ… Proposal cancelled"); - log_print!(" Use remove-expired to cleanup and recover deposit"); + log_success!("โœ… Proposal cancelled and removed"); + log_print!(" Deposit returned to proposer"); Ok(()) } -/// Remove an expired/executed/cancelled proposal +/// Remove an expired proposal async fn handle_remove_expired( multisig_address: String, - proposal_hash: String, + proposal_id: u32, from: String, password: Option, password_file: Option, node_url: &str, execution_mode: ExecutionMode, ) -> crate::error::Result<()> { - log_print!("๐Ÿงน {} Removing proposal...", "MULTISIG".bright_magenta().bold()); + log_print!("๐Ÿงน {} Removing expired proposal...", "MULTISIG".bright_magenta().bold()); // Resolve multisig address let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; @@ -679,7 +802,8 @@ async fn handle_remove_expired( })?; let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); - let hash = parse_hash(&proposal_hash)?; + + log_verbose!("Proposal ID: {}", proposal_id); // Load keypair let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; @@ -688,7 +812,9 @@ async fn handle_remove_expired( let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; // Build transaction - let remove_tx = quantus_subxt::api::tx().multisig().remove_expired(multisig_address, hash); + let remove_tx = quantus_subxt::api::tx() + .multisig() + .remove_expired(multisig_address, proposal_id); // Submit transaction crate::cli::common::submit_transaction( @@ -700,7 +826,7 @@ async fn handle_remove_expired( ) .await?; - log_success!("โœ… Proposal removed and deposit returned"); + log_success!("โœ… Expired proposal removed and deposit returned"); Ok(()) } @@ -794,8 +920,17 @@ async fn handle_dissolve( Ok(()) } -/// Query multisig information -async fn handle_info(multisig_address: String, node_url: &str) -> crate::error::Result<()> { +/// Query multisig information (or specific proposal if proposal_id provided) +async fn handle_info( + multisig_address: String, + proposal_id: Option, + node_url: &str, +) -> crate::error::Result<()> { + // If proposal_id is provided, delegate to handle_proposal_info + if let Some(id) = proposal_id { + return handle_proposal_info(multisig_address, id, node_url).await; + } + log_print!("๐Ÿ” {} Querying multisig info...", "MULTISIG".bright_magenta().bold()); log_print!(""); @@ -833,8 +968,15 @@ async fn handle_info(multisig_address: String, node_url: &str) -> crate::error:: match multisig_data { Some(data) => { + // Query balance for multisig address + let balance_query = + quantus_subxt::api::storage().system().account(multisig_address.clone()); + let account_info = storage_at.fetch(&balance_query).await?; + let balance = account_info.map(|info| info.data.free).unwrap_or(0); + log_print!("๐Ÿ“‹ {} Information:", "MULTISIG".bright_green().bold()); log_print!(" Address: {}", multisig_ss58.bright_cyan()); + log_print!(" Balance: {}", format_balance(balance).bright_green().bold()); log_print!(" Threshold: {}", data.threshold.to_string().bright_yellow()); log_print!(" Signers ({}):", data.signers.0.len().to_string().bright_yellow()); for (i, signer) in data.signers.0.iter().enumerate() { @@ -892,16 +1034,21 @@ async fn decode_call_data( // Try to decode based on known patterns match (pallet_index, call_index) { - // Balances pallet - typically index 10 or similar - (_, idx) if pallet_name == "Balances" && (idx == 0 || idx == 1) => { - // transfer_allow_death (0) or transfer_keep_alive (1) + // Balances pallet transfers + // transfer_allow_death (0) or transfer_keep_alive (3) + (_, idx) if pallet_name == "Balances" && (idx == 0 || idx == 3) => { + let call_name = match idx { + 0 => "transfer_allow_death", + 3 => "transfer_keep_alive", + _ => unreachable!(), + }; + if args.len() < 33 { return Ok(format!( " {} {}::{} (index {})\n {} {} bytes (too short)", "Call:".dimmed(), pallet_name.bright_cyan(), - if idx == 0 { "transfer_allow_death" } else { "transfer_keep_alive" } - .bright_yellow(), + call_name.bright_yellow(), idx, "Args:".dimmed(), args.len() @@ -916,8 +1063,7 @@ async fn decode_call_data( " {} {}::{} (index {})\n {} {} bytes\n {} Unknown address variant: {}", "Call:".dimmed(), pallet_name.bright_cyan(), - if idx == 0 { "transfer_allow_death" } else { "transfer_keep_alive" } - .bright_yellow(), + call_name.bright_yellow(), idx, "Args:".dimmed(), args.len(), @@ -941,8 +1087,7 @@ async fn decode_call_data( " {} {}::{} (index {})\n {} {}\n {} Failed to decode amount", "Call:".dimmed(), pallet_name.bright_cyan(), - if idx == 0 { "transfer_allow_death" } else { "transfer_keep_alive" } - .bright_yellow(), + call_name.bright_yellow(), idx, "To:".dimmed(), to_address.bright_cyan(), @@ -955,8 +1100,7 @@ async fn decode_call_data( " {} {}::{}\n {} {}\n {} {}", "Call:".dimmed(), pallet_name.bright_cyan(), - if idx == 0 { "transfer_allow_death" } else { "transfer_keep_alive" } - .bright_yellow(), + call_name.bright_yellow(), "To:".dimmed(), to_address.bright_cyan(), "Amount:".dimmed(), @@ -994,7 +1138,7 @@ async fn decode_call_data( /// Query proposal information async fn handle_proposal_info( multisig_address: String, - proposal_hash: String, + proposal_id: u32, node_url: &str, ) -> crate::error::Result<()> { log_print!("๐Ÿ” {} Querying proposal info...", "MULTISIG".bright_magenta().bold()); @@ -1008,7 +1152,6 @@ async fn handle_proposal_info( })?; let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); - let hash = parse_hash(&proposal_hash)?; // Connect to chain let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; @@ -1016,10 +1159,14 @@ async fn handle_proposal_info( // Get latest block hash explicitly let latest_block_hash = quantus_client.get_latest_block().await?; - // Query storage + // Get current block number + let latest_block = quantus_client.client().blocks().at(latest_block_hash).await?; + let current_block_number = latest_block.number(); + + // Query storage by proposal ID let storage_query = quantus_subxt::api::storage() .multisig() - .proposals(multisig_address.clone(), hash); + .proposals(multisig_address.clone(), proposal_id); let storage_at = quantus_client.client().storage().at(latest_block_hash); let proposal_data = storage_at.fetch(&storage_query).await?; @@ -1027,8 +1174,12 @@ async fn handle_proposal_info( match proposal_data { Some(data) => { log_print!("๐Ÿ“ {} Information:", "PROPOSAL".bright_green().bold()); + log_print!( + " Current Block: {}", + current_block_number.to_string().bright_white().bold() + ); log_print!(" Multisig: {}", multisig_ss58.bright_cyan()); - log_print!(" Proposal Hash: {}", proposal_hash.bright_yellow()); + log_print!(" Proposal ID: {}", proposal_id.to_string().bright_yellow()); // Convert proposer to SS58 let proposer_bytes: &[u8; 32] = data.proposer.as_ref(); let proposer_sp = SpAccountId32::from(*proposer_bytes); @@ -1045,7 +1196,17 @@ async fn handle_proposal_info( }, } - log_print!(" Expiry: block {}", data.expiry); + // Calculate blocks remaining until expiry + if data.expiry > current_block_number { + let blocks_remaining = data.expiry - current_block_number; + log_print!( + " Expiry: block {} ({} blocks remaining)", + data.expiry, + blocks_remaining.to_string().bright_green() + ); + } else { + log_print!(" Expiry: block {} ({})", data.expiry, "EXPIRED".bright_red().bold()); + } log_print!(" Deposit: {} (locked)", format_balance(data.deposit)); log_print!( " Status: {}", @@ -1130,19 +1291,20 @@ async fn handle_list_proposals( }, }; - // Extract hash from key_bytes - it's the second key in the double map - // Skip the storage prefix and first key (multisig address), get the hash (32 bytes) + // Extract proposal ID from key_bytes (u32, 4 bytes with Twox64Concat hasher) + // The key_bytes contains: + // [storage_prefix][Blake2_128Concat(multisig)][Twox64Concat(u32)] Twox64Concat + // encoding: [8-byte hash][4-byte value] We need the last 4 bytes as + // little-endian u32 let key_bytes = kv.key_bytes; - // The key_bytes contains: [storage_prefix][multisig_address(32)][hash(32)] - // We need to extract just the hash part - if key_bytes.len() >= 32 { - let hash_bytes = &key_bytes[key_bytes.len() - 32..]; + if key_bytes.len() >= 4 { + let id_bytes = &key_bytes[key_bytes.len() - 4..]; + let proposal_id = + u32::from_le_bytes([id_bytes[0], id_bytes[1], id_bytes[2], id_bytes[3]]); log_print!("๐Ÿ“ Proposal #{}", count); - log_print!( - " Hash: {}", - format!("0x{}", hex::encode(hash_bytes)).bright_yellow() - ); + log_print!(" ID: {}", proposal_id.to_string().bright_yellow()); + // Convert proposer to SS58 let proposer_bytes: &[u8; 32] = kv.value.proposer.as_ref(); let proposer_sp = SpAccountId32::from(*proposer_bytes); @@ -1314,24 +1476,6 @@ async fn build_runtime_call( Ok(call_data) } -/// Parse a hex hash string into H256 -fn parse_hash(hash_str: &str) -> crate::error::Result { - let hash_str = hash_str.trim_start_matches("0x"); - - if hash_str.len() != 64 { - return Err(crate::error::QuantusError::Generic(format!( - "Invalid hash length: expected 64 hex characters, got {}", - hash_str.len() - ))); - } - - let mut bytes = [0u8; 32]; - hex::decode_to_slice(hash_str, &mut bytes) - .map_err(|e| crate::error::QuantusError::Generic(format!("Invalid hex hash: {}", e)))?; - - Ok(H256::from(bytes)) -} - /// Format balance for display fn format_balance(balance: u128) -> String { let quan = balance / QUAN_DECIMALS; diff --git a/src/quantus_metadata.scale b/src/quantus_metadata.scale index 37893912f108332cbbcfb248f71bcd6f981ee251..faa38367fc64d70eecac8d9cd85d74f98a35295e 100644 GIT binary patch delta 2347 zcmb_eU2GIp6u#%~r4~|?71~;%$ZZAPh3$q?N`CZnoq!Ao>QhYR;NaR5yiDHaW4DwG&e9$|)U7)u5L^7G5yXSuA zeBU|ep8b92gs*l_$V)P=_|Ny}oy&urHASJ6Wu{D9(YrO(4+T!u9E1bnWDR^<`h5l6 z_}H%->uGB<4H%{oV?nXE7N#skW$+r)dJ?>zE>0*`53_09v}mMh4UH+fPHk-)3(=^< zsm0=sq1rU6*i5CSL6sPH6#b!@_@EX-V+G?Y71wJ)E4}o8!5DQgx$VgX!^G}7sOlI) z8bW_v$&%(4M%mVsW=SeJfo!T6s-(#s%b+Tgl4{(h+#EJwmW@6;(7vizOsj{I;4`q? z(9_b~!?I~pjB66}5f)DsrZdHmHcpCa$s|)Xg)==J7C+TPTS+x^B{UhduA9AH>}i>-9)nq8VFT2NZyKN~ z95}gHSG1&O^N3O0GLxgpqo+Z<+6c3r8kR+DZiJbAA6C#6!_`HluVI!Rfs|tNEJ~V2 zbu+dJH9@<{Sv`GXJVTeNZBtg76e8<*R?DcA8BEHPRE$g|dTKeT@S*w8>K>gByQ?RT zE&$PJgE7|nmo}uwTEFQ)sqk0BGhzpaAB#sLB0|oJmu)B#dmUId281giq81d2&Z{tQ zn!3o8eZx39w4Dp>KblDbpO>dt01NZ`MBiv@$wDi#ewQD1X3 z>!Lf#EylW&N~&?#>7p*V5K&SEqzw>R4Sv#z5J43LYI8p|wuR{G1xT(Dnp?}ynM>PB zf>7p$s|k`9BKgRV>PUWLN|qVp-AQp|5MF`#;>sY*m5<_U5G`tw9&(I3xxyVAq4}a| z5Guvr$6+EgiHp}@32q^xy$VVS3R^78v3N0hfI>YL{t7WR>So9_fZAk)mub zWMz_V=k=}W)kRud`4fsO0&z{(qK?g(<@G3MvRzFhxUAK%op@Y}Y0Th@6y0k|R46KM zz&x4G#0{u~VsXTKJS)Dw0ZX7n6y1ak@SNb@qg8x&6P7|mJbw#(53|T&Qjj<>KqiYf?}JT_<-R5jK?R%;O+zpzbYg^$Q=@&H%KA8!+kAcqUWe0S z`U42T8PV|oUK&5(`M(b6oZJ5Z;y!3`ul@yxCPSgySB(8cTzdgmLV+lqj@R@>fCgB& zCmf9c2h4l(&hV%l zZ*o^4JGq9pbCb(auGzNZwLs7vYQTMg@#CsV9U+MPEc#SDXI$oggL_WJEAk}uyiNFB zkS*}Ojz5(xur`TXpu>GHi9Z2YB|1%fQP$mz6y`og9C0*-Zx*IWKHpk_1DSczExR-^ zce{IhGroXfmmB4{3}BD@mV=M_;IJr5<1*hdf`q;ePZMeyuak=x(s&yja~rqeDFCP4 cHE-bC;5$QhxsmO7gAWGWk9Oc%@SP**A2&Ddt^fc4 delta 1910 zcmb7FU2GIp6u#fxYi$XMtCX^7i(Zt!wcVt}7D@}6f-9|1prtf6k)P@AZ98E*vz?g* zRv--l6EK=U44fdKVBmo$3W+igk_d@LVoaaUV=3b7$`P z?sv}jos*gG_e{FFYf?d<@{I85odsVOVAq1OnzUo5ZP!R`=r!El8kD!!*Ei`W#wC5Y z0E3ZBF}ZO9W@Eh!0Q62B%4nz#75O*b1`Lg+fG91sAoGykCKT%krosSG&-*A%jj~QoLhD(IbNu(_Y>MhXUs5{MjB8P znpp&jEkdL+*9={3r52nMSUJIrvCg^dCUq`C1--inQ8gHos~?P&)a8%quY4rFQrgY~ zb1ULGW6#IrGRH{hX;6-7C#9Z8sZvHdXq0Pe)3n0z&XTzp&291jS_9z=>RdMKu(i;hS>82#WPn?L%ji*gFr;%VCL;g|fl{tQ(9Xu#r& z&3Mg0n3i9|e9j~tyM`}9Y?h$bpRsgOR4^tASq+O(=XJEAnm)OX8om5_9bF~00(E1Z zS~Kb{W7UF=pGFl8zJg~^ONVcui7ym%r5~kq{|1VX^owrda;RiQv*l*GyUm2DEN_XC z3I>}^p$$WruiZH~glbHsOTkh?e+{7t(`f1MSdR#O94w0o!+0Hyv|Q}8oYz~Rs9nLWyE+znSghqq)hJU8-L<6Wa-Hf%xc&%!MdG~Temak zMzHX=1=E)n@TwN^SR0iQ_bI4|9r62KjG+o$^1whwcy-`XztkU@5}>>1jMH{0rs0 zYeqptb}QxjoiFo&xkWrGVnQ%+nXYv6c_R2l`H>#Jxmalem~^#iyT@1 z+s%9iu*1K)g&zswJ=(pE&j{@ojDFnCpQG=#@i+D6% Date: Mon, 26 Jan 2026 10:38:10 +0800 Subject: [PATCH 4/7] fix: Clippy warns in examples --- examples/multisig_usage.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/multisig_usage.rs b/examples/multisig_usage.rs index 67d32e4..64ac631 100644 --- a/examples/multisig_usage.rs +++ b/examples/multisig_usage.rs @@ -27,7 +27,7 @@ async fn main() -> Result<()> { let wallet_manager = WalletManager::new()?; println!("๐Ÿ“ก Connected to node: {}", node_url); - println!(""); + println!(); // 2. Create or load test wallets println!("๐Ÿ‘ฅ Setting up test wallets..."); @@ -47,7 +47,7 @@ async fn main() -> Result<()> { println!(" Alice: {}", alice_addr); println!(" Bob: {}", bob_addr); println!(" Charlie: {}", charlie_addr); - println!(""); + println!(); // 3. Create multisig (2-of-3) println!("๐Ÿ” Creating 2-of-3 multisig..."); @@ -73,19 +73,19 @@ async fn main() -> Result<()> { .await?; println!("โœ… Multisig created! Tx hash: 0x{}", hex::encode(tx_hash)); - println!(""); + println!(); println!("๐Ÿ’ก NOTE: The CLI automatically extracts the address from events"); println!(" Or use --predict flag for instant (but potentially racy) address"); println!(" quantus multisig create --signers --threshold 2 --from alice --predict"); - println!(""); + println!(); // 4. Example: Query multisig info println!("๐Ÿ“‹ To query multisig information:"); println!(" quantus multisig info --address "); - println!(""); + println!(); println!(" Or query specific proposal:"); println!(" quantus multisig info --address --proposal-id 0"); - println!(""); + println!(); // 5. Example: Create a proposal println!("๐Ÿ“ To create a proposal:"); @@ -96,7 +96,7 @@ async fn main() -> Result<()> { println!(" --amount 10 \\"); println!(" --expiry 1000 \\"); println!(" --from alice"); - println!(""); + println!(); println!(" # Custom transaction (full flexibility):"); println!(" quantus multisig propose custom \\"); println!(" --address \\"); @@ -105,10 +105,10 @@ async fn main() -> Result<()> { println!(" --args '[\"Hello from multisig\"]' \\"); println!(" --expiry 1000 \\"); println!(" --from alice"); - println!(""); + println!(); println!(" NOTE: Expiry is BLOCK NUMBER, not blocks from now!"); println!(" Use a block number in the future (e.g., current + 1000)"); - println!(""); + println!(); // 6. Example: Approve a proposal println!("โœ… To approve a proposal (auto-executes at threshold):"); @@ -116,12 +116,12 @@ async fn main() -> Result<()> { println!(" --address \\"); println!(" --proposal-id \\"); println!(" --from bob"); - println!(""); + println!(); // 7. Example: List proposals println!("๐Ÿ“‹ To list all proposals:"); println!(" quantus multisig list-proposals --address "); - println!(""); + println!(); // 8. Example: Cleanup (recover deposits from expired proposals) println!("๐Ÿงน To cleanup and recover deposits:"); @@ -130,22 +130,22 @@ async fn main() -> Result<()> { println!(" --address \\"); println!(" --proposal-id \\"); println!(" --from alice"); - println!(""); + println!(); println!(" # Batch cleanup all expired proposals"); println!(" quantus multisig claim-deposits \\"); println!(" --address \\"); println!(" --from alice"); - println!(""); + println!(); // 9. Example: Dissolve multisig (recover creation deposit) println!("๐Ÿ—‘๏ธ To dissolve multisig (requires no proposals, zero balance):"); println!(" quantus multisig dissolve \\"); println!(" --address \\"); println!(" --from alice"); - println!(""); + println!(); println!("โœจ Multisig example complete!"); - println!(""); + println!(); println!("๐Ÿ“š For more information:"); println!(" quantus multisig --help"); println!(" quantus multisig --help"); From dae76a986cf25dd0ac79d37336763063a4b85d62 Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Mon, 26 Jan 2026 12:45:12 +0800 Subject: [PATCH 5/7] fix: Library perspective --- LIBRARY_USAGE.md | 219 ++++++++++++++ examples/multisig_library_usage.rs | 192 ++++++++++++ src/cli/multisig.rs | 450 ++++++++++++++++++++++++++++- src/lib.rs | 7 + 4 files changed, 867 insertions(+), 1 deletion(-) create mode 100644 examples/multisig_library_usage.rs diff --git a/LIBRARY_USAGE.md b/LIBRARY_USAGE.md index 16ae1bb..88a4001 100644 --- a/LIBRARY_USAGE.md +++ b/LIBRARY_USAGE.md @@ -291,6 +291,220 @@ The library is designed to be thread-safe: - `QuantusClient` can be shared using `Arc>` - Wallet operations are safe to call concurrently +### Multisig Operations + +The library provides full programmatic access to multisig functionality. + +#### Creating a Multisig + +```rust +use quantus_cli::{create_multisig, QuantusClient}; + +async fn create_multisig_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + + // Parse signer addresses + let alice_account = parse_address("qzkaf...")?; + let bob_account = parse_address("qzmqr...")?; + let charlie_account = parse_address("qzo4j...")?; + + let signers = vec![alice_account, bob_account, charlie_account]; + let threshold = 2; // 2-of-3 + + // Create multisig (wait_for_inclusion=true to get address) + let (tx_hash, multisig_address) = create_multisig( + &client, + &keypair, + signers, + threshold, + true // wait for address from event + ).await?; + + println!("Multisig created at: {:?}", multisig_address); + Ok(()) +} + +fn parse_address(ss58: &str) -> Result> { + use sp_core::crypto::{AccountId32, Ss58Codec}; + let (account_id, _) = AccountId32::from_ss58check_with_version(ss58)?; + let bytes: [u8; 32] = *account_id.as_ref(); + Ok(subxt::utils::AccountId32::from(bytes)) +} +``` + +#### Querying Multisig Info + +```rust +use quantus_cli::{get_multisig_info, MultisigInfo}; + +async fn query_multisig() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let multisig_account = parse_address("qz...")?; + + if let Some(info) = get_multisig_info(&client, multisig_account).await? { + println!("Address: {}", info.address); + println!("Balance: {} (raw units)", info.balance); + println!("Threshold: {}", info.threshold); + println!("Signers: {:?}", info.signers); + println!("Active Proposals: {}", info.active_proposals); + println!("Deposit: {} (locked)", info.deposit); + } + + Ok(()) +} +``` + +#### Creating a Transfer Proposal + +```rust +use quantus_cli::{propose_transfer, parse_multisig_amount}; + +async fn create_proposal() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + + let multisig_account = parse_address("qz...")?; + let recipient = parse_address("qzmqr...")?; + + // Parse amount (supports "10", "10.5", "0.001" format) + let amount = parse_multisig_amount("10")?; // 10 QUAN + + let expiry = 1000; // Block number + + let tx_hash = propose_transfer( + &client, + &keypair, + multisig_account, + recipient, + amount, + expiry + ).await?; + + println!("Proposal created: 0x{}", hex::encode(tx_hash)); + Ok(()) +} +``` + +#### Approving a Proposal + +```rust +use quantus_cli::approve_proposal; + +async fn approve_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("bob", None, None)?; + + let multisig_account = parse_address("qz...")?; + let proposal_id = 0u32; + + let tx_hash = approve_proposal( + &client, + &keypair, + multisig_account, + proposal_id + ).await?; + + println!("Approval submitted: 0x{}", hex::encode(tx_hash)); + println!("(Will auto-execute at threshold)"); + Ok(()) +} +``` + +#### Listing Proposals + +```rust +use quantus_cli::{list_proposals, ProposalInfo, ProposalStatus}; + +async fn list_all_proposals() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let multisig_account = parse_address("qz...")?; + + let proposals = list_proposals(&client, multisig_account).await?; + + println!("Found {} proposal(s)", proposals.len()); + for proposal in proposals { + println!("Proposal #{}:", proposal.id); + println!(" Proposer: {}", proposal.proposer); + println!(" Expiry: block {}", proposal.expiry); + println!(" Status: {:?}", proposal.status); + println!(" Approvals: {}", proposal.approvals.len()); + } + + Ok(()) +} +``` + +#### Getting Specific Proposal Info + +```rust +use quantus_cli::get_proposal_info; + +async fn query_proposal() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let multisig_account = parse_address("qz...")?; + let proposal_id = 0u32; + + if let Some(proposal) = get_proposal_info(&client, multisig_account, proposal_id).await? { + println!("Proposer: {}", proposal.proposer); + println!("Call data size: {} bytes", proposal.call_data.len()); + println!("Expiry: block {}", proposal.expiry); + println!("Approvals: {:?}", proposal.approvals); + println!("Status: {:?}", proposal.status); + } + + Ok(()) +} +``` + +#### Canceling a Proposal + +```rust +use quantus_cli::cancel_proposal; + +async fn cancel_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + + let multisig_account = parse_address("qz...")?; + let proposal_id = 0u32; + + let tx_hash = cancel_proposal( + &client, + &keypair, + multisig_account, + proposal_id + ).await?; + + println!("Proposal canceled: 0x{}", hex::encode(tx_hash)); + Ok(()) +} +``` + +#### Dissolving a Multisig + +```rust +use quantus_cli::dissolve_multisig; + +async fn dissolve_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + + let multisig_account = parse_address("qz...")?; + + // Requires: no proposals, zero balance + let tx_hash = dissolve_multisig( + &client, + &keypair, + multisig_account + ).await?; + + println!("Multisig dissolved: 0x{}", hex::encode(tx_hash)); + println!("(Creation deposit returned to creator)"); + Ok(()) +} +``` + ## Examples See the `examples/` directory for complete working examples: @@ -298,6 +512,8 @@ See the `examples/` directory for complete working examples: - `examples/basic_usage.rs` - Basic library usage - `examples/wallet_ops.rs` - Advanced wallet operations - `examples/service.rs` - Service architecture example +- `examples/multisig_library_usage.rs` - Multisig operations +- `examples/multisig_usage.rs` - Multisig CLI usage reference ## Running Examples @@ -310,6 +526,9 @@ cargo run --example wallet_ops # Run service example cargo run --example service + +# Run multisig library usage example +cargo run --example multisig_library_usage ``` ## Key Features diff --git a/examples/multisig_library_usage.rs b/examples/multisig_library_usage.rs new file mode 100644 index 0000000..dea9b91 --- /dev/null +++ b/examples/multisig_library_usage.rs @@ -0,0 +1,192 @@ +//! Multisig library usage example +//! +//! This example demonstrates using quantus-cli as a library for multisig operations + +use quantus_cli::{ + approve_proposal, create_multisig, get_multisig_info, get_proposal_info, list_proposals, + parse_multisig_amount, propose_transfer, + wallet::{load_keypair_from_wallet, WalletManager}, + QuantusClient, Result, +}; +use sp_core::crypto::Ss58Codec; + +#[tokio::main] +async fn main() -> Result<()> { + println!("๐Ÿ” Quantus Multisig Library Usage Example"); + println!("==========================================\n"); + + // 1. Setup: Connect to node + let node_url = "ws://127.0.0.1:9944"; + let quantus_client = QuantusClient::new(node_url).await?; + println!("๐Ÿ“ก Connected to node: {}", node_url); + println!(); + + // 2. Load wallet manager and keypairs + let wallet_manager = WalletManager::new()?; + + // Ensure test wallets exist + println!("๐Ÿ‘ฅ Loading test wallets..."); + let alice_keypair = load_keypair_from_wallet("crystal_alice", None, None)?; + let bob_keypair = load_keypair_from_wallet("crystal_bob", None, None)?; + let _charlie_keypair = load_keypair_from_wallet("crystal_charlie", None, None)?; + + // Get addresses + let alice_addr = wallet_manager + .find_wallet_address("crystal_alice")? + .expect("Alice wallet not found"); + let bob_addr = wallet_manager + .find_wallet_address("crystal_bob")? + .expect("Bob wallet not found"); + let charlie_addr = wallet_manager + .find_wallet_address("crystal_charlie")? + .expect("Charlie wallet not found"); + + println!(" Alice: {}", alice_addr); + println!(" Bob: {}", bob_addr); + println!(" Charlie: {}", charlie_addr); + println!(); + + // 3. Convert addresses to AccountId32 + let alice_account = parse_address(&alice_addr)?; + let bob_account = parse_address(&bob_addr)?; + let charlie_account = parse_address(&charlie_addr)?; + + // 4. Create multisig (2-of-3) + println!("๐Ÿ” Creating 2-of-3 multisig..."); + let signers = vec![alice_account.clone(), bob_account.clone(), charlie_account.clone()]; + let threshold = 2; + + let (tx_hash, multisig_address) = + create_multisig(&quantus_client, &alice_keypair, signers, threshold, true).await?; + + println!("โœ… Multisig created!"); + println!(" Tx hash: 0x{}", hex::encode(tx_hash)); + if let Some(addr) = &multisig_address { + println!(" Address: {}", addr); + } + println!(); + + // 5. Get multisig info + if let Some(addr) = &multisig_address { + let multisig_account = parse_address(addr)?; + + println!("๐Ÿ“‹ Querying multisig info..."); + if let Some(info) = get_multisig_info(&quantus_client, multisig_account.clone()).await? { + println!(" Address: {}", info.address); + println!(" Balance: {} (raw units)", info.balance); + println!(" Threshold: {}", info.threshold); + println!(" Signers: {}", info.signers.len()); + for (i, signer) in info.signers.iter().enumerate() { + println!(" {}. {}", i + 1, signer); + } + println!(" Active Proposals: {}", info.active_proposals); + println!(); + } + + // 6. Parse amount using library function + println!("๐Ÿ’ฐ Parsing amounts..."); + let amount_1 = parse_multisig_amount("10")?; // 10 QUAN + let amount_2 = parse_multisig_amount("10.5")?; // 10.5 QUAN + let amount_3 = parse_multisig_amount("0.001")?; // 0.001 QUAN + + println!(" 10 QUAN = {} (raw)", amount_1); + println!(" 10.5 QUAN = {} (raw)", amount_2); + println!(" 0.001 QUAN = {} (raw)", amount_3); + println!(); + + // 7. Create a proposal (transfer 10 QUAN to Bob) + println!("๐Ÿ“ Creating transfer proposal..."); + let expiry = 1000; // Block number + let amount = parse_multisig_amount("10")?; + + let propose_tx_hash = propose_transfer( + &quantus_client, + &alice_keypair, + multisig_account.clone(), + bob_account.clone(), + amount, + expiry, + ) + .await?; + + println!("โœ… Proposal submitted!"); + println!(" Tx hash: 0x{}", hex::encode(propose_tx_hash)); + println!(" Check events for proposal ID"); + println!(); + + // 8. List all proposals + println!("๐Ÿ“‹ Listing all proposals..."); + let proposals = list_proposals(&quantus_client, multisig_account.clone()).await?; + println!(" Found {} proposal(s)", proposals.len()); + + for proposal in &proposals { + println!(); + println!(" Proposal #{}:", proposal.id); + println!(" Proposer: {}", proposal.proposer); + println!(" Expiry: block {}", proposal.expiry); + println!(" Status: {:?}", proposal.status); + println!(" Approvals: {}", proposal.approvals.len()); + println!(" Deposit: {} (raw)", proposal.deposit); + } + println!(); + + // 9. Get specific proposal info + if !proposals.is_empty() { + let proposal_id = proposals[0].id; + println!("๐Ÿ” Querying proposal #{}...", proposal_id); + + if let Some(proposal) = + get_proposal_info(&quantus_client, multisig_account.clone(), proposal_id).await? + { + println!(" Proposer: {}", proposal.proposer); + println!(" Call data size: {} bytes", proposal.call_data.len()); + println!(" Expiry: block {}", proposal.expiry); + println!(" Approvals: {}", proposal.approvals.len()); + } + println!(); + + // 10. Approve proposal (as Bob) + println!("โœ… Approving proposal #{}...", proposal_id); + let approve_tx_hash = approve_proposal( + &quantus_client, + &bob_keypair, + multisig_account.clone(), + proposal_id, + ) + .await?; + + println!("โœ… Approval submitted!"); + println!(" Tx hash: 0x{}", hex::encode(approve_tx_hash)); + println!(" (Will auto-execute at threshold)"); + println!(); + } + } + + println!("โœจ Example complete!"); + println!(); + println!("๐Ÿ“š Available library functions:"); + println!(" - create_multisig()"); + println!(" - propose_transfer()"); + println!(" - propose_custom()"); + println!(" - approve_proposal()"); + println!(" - cancel_proposal()"); + println!(" - get_multisig_info()"); + println!(" - get_proposal_info()"); + println!(" - list_proposals()"); + println!(" - dissolve_multisig()"); + println!(" - parse_multisig_amount()"); + + Ok(()) +} + +/// Helper: Parse SS58 address to subxt AccountId32 +fn parse_address(ss58: &str) -> Result { + use sp_core::crypto::AccountId32; + + let (account_id, _) = AccountId32::from_ss58check_with_version(ss58).map_err(|e| { + quantus_cli::error::QuantusError::Generic(format!("Invalid address: {:?}", e)) + })?; + + let bytes: [u8; 32] = *account_id.as_ref(); + Ok(subxt::ext::subxt_core::utils::AccountId32::from(bytes)) +} diff --git a/src/cli/multisig.rs b/src/cli/multisig.rs index 656cc16..8520df4 100644 --- a/src/cli/multisig.rs +++ b/src/cli/multisig.rs @@ -11,9 +11,72 @@ use sp_core::crypto::{AccountId32 as SpAccountId32, Ss58Codec}; // Base unit (QUAN) decimals for amount conversions const QUAN_DECIMALS: u128 = 1_000_000_000_000; // 10^12 +// ============================================================================ +// PUBLIC LIBRARY API - Data Structures +// ============================================================================ + +/// Multisig account information +#[allow(dead_code)] +#[derive(Debug, Clone)] +pub struct MultisigInfo { + /// Multisig address (SS58 format) + pub address: String, + /// Current balance (spendable) + pub balance: u128, + /// Approval threshold + pub threshold: u32, + /// List of signer addresses (SS58 format) + pub signers: Vec, + /// Creation nonce + pub nonce: u64, + /// Next proposal ID + pub proposal_nonce: u32, + /// Creator address (SS58 format) + pub creator: String, + /// Locked deposit amount + pub deposit: u128, + /// Last activity block number + pub last_activity: u32, + /// Number of active proposals + pub active_proposals: u32, +} + +/// Proposal status +#[allow(dead_code)] +#[derive(Debug, Clone, PartialEq)] +pub enum ProposalStatus { + Active, + Executed, + Cancelled, +} + +/// Proposal information +#[allow(dead_code)] +#[derive(Debug, Clone)] +pub struct ProposalInfo { + /// Proposal ID + pub id: u32, + /// Proposer address (SS58 format) + pub proposer: String, + /// Encoded call data + pub call_data: Vec, + /// Expiry block number + pub expiry: u32, + /// List of approver addresses (SS58 format) + pub approvals: Vec, + /// Locked deposit amount + pub deposit: u128, + /// Proposal status + pub status: ProposalStatus, +} + +// ============================================================================ +// PUBLIC LIBRARY API - Helper Functions +// ============================================================================ + /// Parse amount from human-readable format (e.g., "10", "10.5", "0.001") /// or raw format (e.g., "10000000000000") -fn parse_amount(amount: &str) -> crate::error::Result { +pub fn parse_amount(amount: &str) -> crate::error::Result { // If contains decimal point, parse as float and multiply by QUAN_DECIMALS if amount.contains('.') { let amount_f64: f64 = amount @@ -275,6 +338,391 @@ pub enum MultisigCommands { }, } +// ============================================================================ +// PUBLIC LIBRARY API - Core Functions +// ============================================================================ +// Note: These functions are public library API and may not be used by the CLI binary + +/// Create a multisig account +/// +/// # Arguments +/// * `quantus_client` - Connected Quantus client +/// * `creator_keypair` - Keypair of the account creating the multisig +/// * `signers` - List of signer addresses (AccountId32) +/// * `threshold` - Number of approvals required +/// * `wait_for_inclusion` - Whether to wait for transaction inclusion +/// +/// # Returns +/// Transaction hash and optionally the multisig address (if wait_for_inclusion=true) +#[allow(dead_code)] +pub async fn create_multisig( + quantus_client: &crate::chain::client::QuantusClient, + creator_keypair: &crate::wallet::QuantumKeyPair, + signers: Vec, + threshold: u32, + wait_for_inclusion: bool, +) -> crate::error::Result<(subxt::utils::H256, Option)> { + // Build transaction + let create_tx = quantus_subxt::api::tx().multisig().create_multisig(signers.clone(), threshold); + + // Submit transaction + let execution_mode = + ExecutionMode { finalized: false, wait_for_transaction: wait_for_inclusion }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + creator_keypair, + create_tx, + None, + execution_mode, + ) + .await?; + + // If waiting, extract address from events + let multisig_address = if wait_for_inclusion { + let latest_block_hash = quantus_client.get_latest_block().await?; + let events = quantus_client.client().events().at(latest_block_hash).await?; + + let mut multisig_events = + events.find::(); + + let address: Option = if let Some(Ok(ev)) = multisig_events.next() { + let addr_bytes: &[u8; 32] = ev.multisig_address.as_ref(); + let addr = SpAccountId32::from(*addr_bytes); + Some(addr.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189))) + } else { + None + }; + address + } else { + None + }; + + Ok((tx_hash, multisig_address)) +} + +/// Propose a transfer from multisig +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn propose_transfer( + quantus_client: &crate::chain::client::QuantusClient, + proposer_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + to_address: subxt::ext::subxt_core::utils::AccountId32, + amount: u128, + expiry: u32, +) -> crate::error::Result { + use codec::{Compact, Encode}; + + // Build Balances::transfer_allow_death call + let pallet_index = 5u8; // Balances pallet + let call_index = 0u8; // transfer_allow_death + + let mut call_data = Vec::new(); + call_data.push(pallet_index); + call_data.push(call_index); + + // Encode destination (MultiAddress::Id) + call_data.push(0u8); // MultiAddress::Id variant + call_data.extend_from_slice(to_address.as_ref()); + + // Encode amount (Compact) + Compact(amount).encode_to(&mut call_data); + + // Build propose transaction + let propose_tx = + quantus_subxt::api::tx().multisig().propose(multisig_address, call_data, expiry); + + // Submit transaction + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + proposer_keypair, + propose_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +/// Propose a custom call from multisig +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn propose_custom( + quantus_client: &crate::chain::client::QuantusClient, + proposer_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + call_data: Vec, + expiry: u32, +) -> crate::error::Result { + // Build propose transaction + let propose_tx = + quantus_subxt::api::tx().multisig().propose(multisig_address, call_data, expiry); + + // Submit transaction + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + proposer_keypair, + propose_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +/// Approve a proposal +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn approve_proposal( + quantus_client: &crate::chain::client::QuantusClient, + approver_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + proposal_id: u32, +) -> crate::error::Result { + let approve_tx = quantus_subxt::api::tx().multisig().approve(multisig_address, proposal_id); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + approver_keypair, + approve_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +/// Cancel a proposal (only by proposer) +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn cancel_proposal( + quantus_client: &crate::chain::client::QuantusClient, + proposer_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + proposal_id: u32, +) -> crate::error::Result { + let cancel_tx = quantus_subxt::api::tx().multisig().cancel(multisig_address, proposal_id); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + proposer_keypair, + cancel_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +/// Get multisig information +/// +/// # Returns +/// Multisig information or None if not found +#[allow(dead_code)] +pub async fn get_multisig_info( + quantus_client: &crate::chain::client::QuantusClient, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, +) -> crate::error::Result> { + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage_at = quantus_client.client().storage().at(latest_block_hash); + + // Query multisig data + let storage_query = + quantus_subxt::api::storage().multisig().multisigs(multisig_address.clone()); + let multisig_data = storage_at.fetch(&storage_query).await?; + + if let Some(data) = multisig_data { + // Query balance + let balance_query = + quantus_subxt::api::storage().system().account(multisig_address.clone()); + let account_info = storage_at.fetch(&balance_query).await?; + let balance = account_info.map(|info| info.data.free).unwrap_or(0); + + // Convert to SS58 + let multisig_bytes: &[u8; 32] = multisig_address.as_ref(); + let multisig_sp = SpAccountId32::from(*multisig_bytes); + let address = + multisig_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + let creator_bytes: &[u8; 32] = data.creator.as_ref(); + let creator_sp = SpAccountId32::from(*creator_bytes); + let creator = + creator_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + let signers: Vec = data + .signers + .0 + .iter() + .map(|signer| { + let signer_bytes: &[u8; 32] = signer.as_ref(); + let signer_sp = SpAccountId32::from(*signer_bytes); + signer_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)) + }) + .collect(); + + Ok(Some(MultisigInfo { + address, + balance, + threshold: data.threshold, + signers, + nonce: data.nonce, + proposal_nonce: data.proposal_nonce, + creator, + deposit: data.deposit, + last_activity: data.last_activity, + active_proposals: data.active_proposals, + })) + } else { + Ok(None) + } +} + +/// Get proposal information +/// +/// # Returns +/// Proposal information or None if not found +#[allow(dead_code)] +pub async fn get_proposal_info( + quantus_client: &crate::chain::client::QuantusClient, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + proposal_id: u32, +) -> crate::error::Result> { + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage_at = quantus_client.client().storage().at(latest_block_hash); + + let storage_query = quantus_subxt::api::storage() + .multisig() + .proposals(multisig_address, proposal_id); + + let proposal_data = storage_at.fetch(&storage_query).await?; + + if let Some(data) = proposal_data { + let proposer_bytes: &[u8; 32] = data.proposer.as_ref(); + let proposer_sp = SpAccountId32::from(*proposer_bytes); + let proposer = + proposer_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + let approvals: Vec = data + .approvals + .0 + .iter() + .map(|approver| { + let approver_bytes: &[u8; 32] = approver.as_ref(); + let approver_sp = SpAccountId32::from(*approver_bytes); + approver_sp + .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)) + }) + .collect(); + + let status = match data.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => + ProposalStatus::Active, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Executed => + ProposalStatus::Executed, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => + ProposalStatus::Cancelled, + }; + + Ok(Some(ProposalInfo { + id: proposal_id, + proposer, + call_data: data.call.0, + expiry: data.expiry, + approvals, + deposit: data.deposit, + status, + })) + } else { + Ok(None) + } +} + +/// List all proposals for a multisig +/// +/// # Returns +/// List of proposals +#[allow(dead_code)] +pub async fn list_proposals( + quantus_client: &crate::chain::client::QuantusClient, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, +) -> crate::error::Result> { + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage = quantus_client.client().storage().at(latest_block_hash); + + let address = quantus_subxt::api::storage() + .multisig() + .proposals_iter1(multisig_address.clone()); + let mut proposals_iter = storage.iter(address).await?; + + let mut proposals = Vec::new(); + + while let Some(result) = proposals_iter.next().await { + if let Ok(kv) = result { + // Extract proposal_id from key + let key_bytes = kv.key_bytes; + if key_bytes.len() >= 4 { + let id_bytes = &key_bytes[key_bytes.len() - 4..]; + let proposal_id = + u32::from_le_bytes([id_bytes[0], id_bytes[1], id_bytes[2], id_bytes[3]]); + + // Get full proposal info + if let Some(proposal) = + get_proposal_info(quantus_client, multisig_address.clone(), proposal_id).await? + { + proposals.push(proposal); + } + } + } + } + + Ok(proposals) +} + +/// Dissolve a multisig (requires no proposals, zero balance) +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn dissolve_multisig( + quantus_client: &crate::chain::client::QuantusClient, + caller_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, +) -> crate::error::Result { + let dissolve_tx = quantus_subxt::api::tx().multisig().dissolve_multisig(multisig_address); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + caller_keypair, + dissolve_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +// ============================================================================ +// CLI HANDLERS (Internal) +// ============================================================================ + /// Handle multisig command pub async fn handle_multisig_command( command: MultisigCommands, diff --git a/src/lib.rs b/src/lib.rs index 95389b8..afd8090 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,6 +29,13 @@ pub use cli::send::{ batch_transfer, format_balance_with_symbol, get_balance, transfer, transfer_with_nonce, }; +// Re-export multisig functions for library usage +pub use cli::multisig::{ + approve_proposal, cancel_proposal, create_multisig, dissolve_multisig, get_multisig_info, + get_proposal_info, list_proposals, parse_amount as parse_multisig_amount, propose_custom, + propose_transfer, MultisigInfo, ProposalInfo, ProposalStatus, +}; + /// Library version pub const VERSION: &str = env!("CARGO_PKG_VERSION"); From 7a5481ee7f7800e3b90bf26de900603118f22737 Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Wed, 28 Jan 2026 12:18:48 +0800 Subject: [PATCH 6/7] feat: Multisig - validation --- src/cli/multisig.rs | 158 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 152 insertions(+), 6 deletions(-) diff --git a/src/cli/multisig.rs b/src/cli/multisig.rs index 8520df4..cd241a9 100644 --- a/src/cli/multisig.rs +++ b/src/cli/multisig.rs @@ -681,12 +681,45 @@ pub async fn list_proposals( let proposal_id = u32::from_le_bytes([id_bytes[0], id_bytes[1], id_bytes[2], id_bytes[3]]); - // Get full proposal info - if let Some(proposal) = - get_proposal_info(quantus_client, multisig_address.clone(), proposal_id).await? - { - proposals.push(proposal); - } + // Use value directly from iterator (more efficient) + let data = kv.value; + + let proposer_bytes: &[u8; 32] = data.proposer.as_ref(); + let proposer_sp = SpAccountId32::from(*proposer_bytes); + let proposer = proposer_sp + .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + let approvals: Vec = data + .approvals + .0 + .iter() + .map(|approver| { + let approver_bytes: &[u8; 32] = approver.as_ref(); + let approver_sp = SpAccountId32::from(*approver_bytes); + approver_sp.to_ss58check_with_version( + sp_core::crypto::Ss58AddressFormat::custom(189), + ) + }) + .collect(); + + let status = match data.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => + ProposalStatus::Active, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Executed => + ProposalStatus::Executed, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => + ProposalStatus::Cancelled, + }; + + proposals.push(ProposalInfo { + id: proposal_id, + proposer, + call_data: data.call.0, + expiry: data.expiry, + approvals, + deposit: data.deposit, + status, + }); } } } @@ -1103,6 +1136,34 @@ async fn handle_propose( log_verbose!("Current block: {}, expiry valid", current_block_number); + // Validate proposer is a signer (client-side check before submitting) + let storage_at = quantus_client.client().storage().at(latest_block_hash); + let multisig_query = + quantus_subxt::api::storage().multisig().multisigs(multisig_address.clone()); + let multisig_data = storage_at.fetch(&multisig_query).await?.ok_or_else(|| { + crate::error::QuantusError::Generic(format!( + "Multisig not found at address: {}", + multisig_ss58 + )) + })?; + + // Resolve proposer address + let proposer_ss58 = crate::cli::common::resolve_address(&from)?; + let (proposer_id, _) = + SpAccountId32::from_ss58check_with_version(&proposer_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid proposer address: {:?}", e)) + })?; + let proposer_bytes: [u8; 32] = *proposer_id.as_ref(); + let proposer_account_id = subxt::ext::subxt_core::utils::AccountId32::from(proposer_bytes); + + // Check if proposer is in signers list + if !multisig_data.signers.0.contains(&proposer_account_id) { + log_error!("โŒ Not authorized: {} is not a signer of this multisig", proposer_ss58); + return Err(crate::error::QuantusError::Generic( + "Only multisig signers can create proposals".to_string(), + )); + } + // Build the call data using runtime metadata let call_data = build_runtime_call(&quantus_client, &pallet, &call, args_vec).await?; @@ -1163,6 +1224,58 @@ async fn handle_approve( // Connect to chain let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + // Validate approver is a signer (client-side check before submitting) + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage_at = quantus_client.client().storage().at(latest_block_hash); + + let multisig_query = + quantus_subxt::api::storage().multisig().multisigs(multisig_address.clone()); + let multisig_data = storage_at.fetch(&multisig_query).await?.ok_or_else(|| { + crate::error::QuantusError::Generic(format!( + "Multisig not found at address: {}", + multisig_ss58 + )) + })?; + + // Resolve approver address + let approver_ss58 = crate::cli::common::resolve_address(&from)?; + let (approver_id, _) = + SpAccountId32::from_ss58check_with_version(&approver_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid approver address: {:?}", e)) + })?; + let approver_bytes: [u8; 32] = *approver_id.as_ref(); + let approver_account_id = subxt::ext::subxt_core::utils::AccountId32::from(approver_bytes); + + // Check if approver is in signers list + if !multisig_data.signers.0.contains(&approver_account_id) { + log_error!("โŒ Not authorized: {} is not a signer of this multisig", approver_ss58); + return Err(crate::error::QuantusError::Generic( + "Only multisig signers can approve proposals".to_string(), + )); + } + + // Check if proposal exists + let proposal_query = quantus_subxt::api::storage() + .multisig() + .proposals(multisig_address.clone(), proposal_id); + let proposal_data = storage_at.fetch(&proposal_query).await?; + if proposal_data.is_none() { + log_error!("โŒ Proposal {} not found", proposal_id); + return Err(crate::error::QuantusError::Generic(format!( + "Proposal {} does not exist", + proposal_id + ))); + } + let proposal = proposal_data.unwrap(); + + // Check if already approved by this signer + if proposal.approvals.0.contains(&approver_account_id) { + log_error!("โŒ Already approved: you have already approved this proposal"); + return Err(crate::error::QuantusError::Generic( + "You have already approved this proposal".to_string(), + )); + } + // Build transaction let approve_tx = quantus_subxt::api::tx().multisig().approve(multisig_address, proposal_id); @@ -1211,6 +1324,39 @@ async fn handle_cancel( // Connect to chain let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + // Validate caller is the proposer (client-side check before submitting) + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage_at = quantus_client.client().storage().at(latest_block_hash); + + let proposal_query = quantus_subxt::api::storage() + .multisig() + .proposals(multisig_address.clone(), proposal_id); + let proposal_data = storage_at.fetch(&proposal_query).await?.ok_or_else(|| { + crate::error::QuantusError::Generic(format!("Proposal {} not found", proposal_id)) + })?; + + // Resolve canceller address + let canceller_ss58 = crate::cli::common::resolve_address(&from)?; + let (canceller_id, _) = + SpAccountId32::from_ss58check_with_version(&canceller_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid canceller address: {:?}", e)) + })?; + let canceller_bytes: [u8; 32] = *canceller_id.as_ref(); + let canceller_account_id = subxt::ext::subxt_core::utils::AccountId32::from(canceller_bytes); + + // Check if caller is the proposer + if proposal_data.proposer != canceller_account_id { + log_error!("โŒ Not authorized: only the proposer can cancel this proposal"); + let proposer_bytes: &[u8; 32] = proposal_data.proposer.as_ref(); + let proposer_sp = SpAccountId32::from(*proposer_bytes); + let proposer_ss58 = + proposer_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + log_print!(" Proposer: {}", proposer_ss58); + return Err(crate::error::QuantusError::Generic( + "Only the proposer can cancel their proposal".to_string(), + )); + } + // Build transaction let cancel_tx = quantus_subxt::api::tx().multisig().cancel(multisig_address, proposal_id); From a03fd6a3bc06c718ccae2634152643aa00b44831 Mon Sep 17 00:00:00 2001 From: Cezary Olborski Date: Fri, 30 Jan 2026 17:33:57 +0800 Subject: [PATCH 7/7] fix: --predict removed --- src/cli/multisig.rs | 46 ++++----------------------------------------- 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/src/cli/multisig.rs b/src/cli/multisig.rs index cd241a9..dcb76b2 100644 --- a/src/cli/multisig.rs +++ b/src/cli/multisig.rs @@ -202,10 +202,6 @@ pub enum MultisigCommands { /// Read password from file (for scripting) #[arg(long)] password_file: Option, - - /// Predict address before submission (faster but may be incorrect if concurrent creations) - #[arg(long)] - predict: bool, }, /// Propose a transaction to be executed by the multisig @@ -763,14 +759,13 @@ pub async fn handle_multisig_command( execution_mode: ExecutionMode, ) -> crate::error::Result<()> { match command { - MultisigCommands::Create { signers, threshold, from, password, password_file, predict } => + MultisigCommands::Create { signers, threshold, from, password, password_file } => handle_create_multisig( signers, threshold, from, password, password_file, - predict, node_url, execution_mode, ) @@ -873,7 +868,6 @@ async fn handle_create_multisig( from: String, password: Option, password_file: Option, - predict: bool, node_url: &str, execution_mode: ExecutionMode, ) -> crate::error::Result<()> { @@ -930,38 +924,6 @@ async fn handle_create_multisig( .multisig() .create_multisig(signer_addresses.clone(), threshold); - if predict { - // PREDICT MODE: Calculate address before submission (fast but may be wrong on race) - use codec::Encode; - use sp_core::blake2_256; - - let latest_block_hash = quantus_client.get_latest_block().await?; - let storage = quantus_client.client().storage().at(latest_block_hash); - let global_nonce_query = quantus_subxt::api::storage().multisig().global_nonce(); - let current_nonce = storage.fetch(&global_nonce_query).await?.unwrap_or(0); - - const PALLET_ID: [u8; 8] = *b"py/mltsg"; - let mut data = Vec::new(); - data.extend_from_slice(&PALLET_ID); - let signers_for_hash: Vec<[u8; 32]> = - signer_addresses.iter().map(|a| *a.as_ref()).collect(); - data.extend_from_slice(&signers_for_hash.encode()); - data.extend_from_slice(¤t_nonce.encode()); - - let hash = blake2_256(&data); - let predicted_address = SpAccountId32::from(hash) - .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); - - log_print!(""); - log_success!("๐Ÿ“ Predicted address: {}", predicted_address.bright_yellow().bold()); - log_print!( - " โš ๏ธ {} May differ if concurrent multisig creations occur", - "WARNING:".bright_yellow() - ); - log_print!(" Check events or use without --predict for confirmed address"); - log_print!(""); - } - // Submit transaction (will wait if execution_mode.wait_for_transaction = true) let _tx_hash = crate::cli::common::submit_transaction( &quantus_client, @@ -974,8 +936,8 @@ async fn handle_create_multisig( log_success!("โœ… Multisig creation transaction submitted"); - // If NOT predict mode AND wait_for_transaction, extract address from events - if !predict && execution_mode.wait_for_transaction { + // If wait_for_transaction, extract address from events + if execution_mode.wait_for_transaction { log_print!(""); log_print!("๐Ÿ” Looking for MultisigCreated event..."); @@ -1021,7 +983,7 @@ async fn handle_create_multisig( log_error!("โš ๏ธ Couldn't find MultisigCreated event"); log_print!(" Check events manually: quantus events --latest --pallet Multisig"); } - } else if !predict { + } else { log_print!(""); log_print!( "๐Ÿ’ก {} Transaction submitted. Check events for multisig address:",