diff --git a/LIBRARY_USAGE.md b/LIBRARY_USAGE.md index 16ae1bb..4df3086 100644 --- a/LIBRARY_USAGE.md +++ b/LIBRARY_USAGE.md @@ -291,6 +291,445 @@ 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. + +#### Predicting Multisig Address (Deterministic) + +Multisig addresses are deterministically calculated from signers, threshold, and nonce. You can predict the address before creating: + +```rust +use quantus_cli::predict_multisig_address; + +fn predict_address_example() -> Result<(), Box> { + 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; + let nonce = 0; // Default nonce + + // Calculate predicted address + let predicted_address = predict_multisig_address(signers.clone(), threshold, nonce); + println!("Predicted address: {}", predicted_address); + + // Now create with the same parameters - address will match! + 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)) +} +``` + +**Key points:** +- Same signers + threshold + nonce = same address (deterministic) +- Order of signers doesn't matter (automatically sorted) +- Use different nonce to create multiple multisigs with same signers + +#### Creating a Multisig + +```rust +use quantus_cli::{create_multisig, predict_multisig_address, 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 + let nonce = 0; // Default: 0. Use different values to create multiple multisigs + + // Optional: Predict address before creating + let predicted = predict_multisig_address(signers.clone(), threshold, nonce); + println!("Will create at: {}", predicted); + + // Create multisig (wait_for_inclusion=true to get address from event) + let (tx_hash, multisig_address) = create_multisig( + &client, + &keypair, + signers, + threshold, + nonce, // NEW: nonce parameter for deterministic addresses + true // wait for address from event + ).await?; + + println!("Multisig created at: {:?}", multisig_address); + assert_eq!(multisig_address.unwrap(), predicted); // Should match! + Ok(()) +} +``` + +#### 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!("Creator: {}", info.creator); + println!("Signers: {:?}", info.signers); + println!("Active Proposals: {}", info.active_proposals); + println!("Deposit: {} (returned to creator on dissolve)", info.deposit); + println!("๐Ÿ’ก INFO: Deposit will be returned to creator when multisig is dissolved"); + } + + 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 + +When a proposal reaches the approval threshold, its status becomes **Approved**. Execution is **not** automatic: any signer must then call **execute** to dispatch the call (CLI: `quantus multisig execute --address --proposal-id --from `). + +```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)); + // Once threshold is reached, status becomes Approved; any signer must call execute to dispatch + Ok(()) +} +``` + +#### Executing an Approved Proposal + +After enough signers have approved, the proposal status is **Approved**. Any signer must then submit an **execute** transaction to actually run the call. From the CLI: + +```bash +quantus multisig execute --address --proposal-id --from +``` + +Proposal statuses: **Active** (collecting approvals), **Approved** (threshold reached, ready to execute), **Executed**, **Cancelled**. + +#### 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 + +**IMPORTANT:** Dissolution now requires threshold approvals and the deposit is **RETURNED** to the creator. + +```rust +use quantus_cli::approve_dissolve_multisig; + +async fn dissolve_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + + // Each signer must approve dissolution + let multisig_account = parse_address("qz...")?; + + // Alice approves (1/2) + let alice_keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + let tx_hash1 = approve_dissolve_multisig( + &client, + &alice_keypair, + multisig_account.clone() + ).await?; + println!("Alice approved dissolution: 0x{}", hex::encode(tx_hash1)); + + // Bob approves (2/2) - threshold reached, multisig dissolved automatically + let bob_keypair = quantus_cli::wallet::load_keypair_from_wallet("bob", None, None)?; + let tx_hash2 = approve_dissolve_multisig( + &client, + &bob_keypair, + multisig_account + ).await?; + println!("Bob approved - Multisig dissolved: 0x{}", hex::encode(tx_hash2)); + + Ok(()) +} +``` + +**Requirements for dissolution:** +- โœ… No proposals (any status: active, executed, or cancelled) +- โœ… Balance must be zero +- โœ… Threshold approvals required +- ๐Ÿ’ก **Deposit is RETURNED** to creator on successful dissolution + +**Note:** If proposals exist, you must first cancel or claim them before dissolution can proceed. + +#### Multisig Errors (Chain) + +When a multisig extrinsic fails, the CLI (and any code using the chain) receives a dispatch error. The runtime returns named errors; after metadata is up to date, you will see messages such as: + +| Error | When | +|-------|------| +| `ExpiryTooFar` | Proposal expiry is beyond the chain's `MaxExpiryDuration` (e.g. ~2 weeks in blocks). | +| `TooManyProposalsInStorage` | Multisig has reached the max total proposals in storage; cleanup via `claim_deposits` or `remove_expired` first. | +| `TooManyProposalsPerSigner` | This signer has too many proposals (per-signer limit for filibuster protection). | +| `ProposalNotApproved` | `execute` was called but the proposal is not in **Approved** status (e.g. still Active or already removed). | +| `ProposalNotFound` | No proposal with the given ID for this multisig. | +| `CallNotAllowedForHighSecurityMultisig` | Multisig is high-security and the proposed call is not whitelisted (e.g. use `schedule_transfer` instead of `transfer_allow_death`). | +| `ProposalsExist` | Cannot dissolve: there are still proposals; clear them first. | +| `MultisigAccountNotZero` | Cannot dissolve: multisig balance is not zero. | + +Other errors (e.g. `NotASigner`, `AlreadyApproved`, `ExpiryInPast`, `ProposalExpired`) are self-explanatory. Error text is resolved from runtime metadata when available. + +#### High-Security Operations for Multisig + +Multisig accounts can be configured with high-security mode, which delays all transfers and allows a guardian to intercept suspicious transactions. + +##### Checking High-Security Status + +```bash +# CLI usage +quantus multisig high-security status --address qz... +``` + +Example output: +``` +๐Ÿ” MULTISIG Checking High-Security status... + +๐Ÿ“‹ Multisig: qz... + +โœ… High-Security: ENABLED + +๐Ÿ›ก๏ธ Guardian/Interceptor: qzmqr... +โฑ๏ธ Delay: 100 blocks + +๐Ÿ’ก INFO All transfers from this multisig will be delayed and reversible + The guardian can intercept suspicious transactions during the delay period +``` + +##### Enabling High-Security via Proposal + +To enable high-security for a multisig, you need to create a proposal that will call `reversible_transfers.set_high_security`. This requires approval from threshold signers. + +```bash +# CLI usage - Create proposal to enable high-security +quantus multisig propose high-security \ + --address qz... \ + --interceptor qzmqr... \ + --delay-blocks 100 \ + --expiry 2000 \ + --from alice \ + -p password + +# Alternative: delay in seconds instead of blocks +quantus multisig propose high-security \ + --address qz... \ + --interceptor qzmqr... \ + --delay-seconds 600 \ + --expiry 2000 \ + --from alice \ + -p password +``` + +Example workflow: +```bash +# 1. Alice (signer) proposes high-security +quantus multisig propose high-security \ + --address qz123... \ + --interceptor qzguardian... \ + --delay-blocks 100 \ + --expiry 2000 \ + --from alice + +# 2. Check proposals to find the ID +quantus multisig list-proposals --address qz123... + +# 3. Bob (another signer) approves +quantus multisig approve \ + --address qz123... \ + --proposal-id 0 \ + --from bob + +# 4. Once threshold is reached, high-security is automatically enabled +# 5. Verify it's enabled +quantus multisig high-security status --address qz123... +``` + +##### Key Concepts + +- **Guardian/Interceptor**: An account that can intercept (reverse) transactions during the delay period +- **Delay**: Time window during which transactions are reversible (in blocks or seconds) +- **Delayed Transfers**: All transfers from a high-security multisig are scheduled for delayed execution +- **Interception**: Guardian can cancel suspicious transactions and recover funds + +##### Disabling High-Security + +**Note:** There is currently no `remove` command for disabling high-security mode. The runtime does not expose a `remove_high_security` extrinsic. + +If you need to disable high-security for a multisig: +1. Create a new multisig without high-security +2. Transfer funds from the HS multisig to the new one +3. Dissolve the old HS multisig (after cleanup) + +Alternatively, request a runtime upgrade to add `remove_high_security` functionality. + +##### Security Considerations + +- Choose a trusted guardian account (can be another multisig) +- Set an appropriate delay period (longer = more secure, but less convenient) +- Guardian has full control to intercept transactions during delay +- Once enabled, only whitelisted calls are allowed from high-security multisigs +- **High-security cannot be disabled** - consider this permanent for the multisig account + +##### Programmatic Usage (Library) + +Currently, high-security operations are best performed via CLI. For programmatic access, you can build the runtime call manually: + +```rust +use quantus_cli::{chain::client::QuantusClient, chain::quantus_subxt}; + +async fn enable_hs_via_proposal() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + + // Build set_high_security call + use quantus_subxt::api::reversible_transfers::calls::types::set_high_security::Delay; + let delay = Delay::BlockNumber(100); + let interceptor = parse_address("qzguardian...")?; + + let set_hs_call = quantus_subxt::api::tx() + .reversible_transfers() + .set_high_security(delay, interceptor); + + // Encode as call data + use subxt::tx::Payload; + let call_data = set_hs_call.encode_call_data(&client.client().metadata())?; + + // Create multisig proposal with this call + let multisig_account = parse_address("qz...")?; + let expiry = 2000; + + let propose_tx = quantus_subxt::api::tx() + .multisig() + .propose(multisig_account, call_data, expiry); + + // Submit via your signer keypair + // ... (submit transaction) + + Ok(()) +} +``` + ## Examples See the `examples/` directory for complete working examples: @@ -298,6 +737,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 +751,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/README.md b/README.md index 8512f11..314c00f 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,215 @@ 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 (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, proposals, and balances + +### Quick Start Example + +```bash +# 1. Create a 2-of-3 multisig (waits for confirmation by default) +quantus multisig create \ + --signers "alice,bob,charlie" \ + --threshold 2 \ + --from alice \ + --wait-for-transaction + +# Output: ๐Ÿ“ Multisig address: qz... (with proper network prefix) + +# 2. Fund the multisig (anyone can send funds) +quantus send \ + --from alice \ + --to qz... \ + --amount 1000 + +# 3. Create a transfer proposal (human-readable amount) +quantus multisig propose transfer \ + --address qz... \ + --to dave \ + --amount 10 \ + --expiry 1500 \ + --from alice + +# 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) + +# 5. Second signer approves (auto-executes at threshold) +quantus multisig approve \ + --address qz... \ + --proposal-id 0 \ + --from bob +``` + +### Available Commands + +#### 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 Transfer (Recommended for simple transfers) +```bash +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 \ + --address \ + --proposal-id \ + --from signer_wallet +``` + +#### Cancel Proposal (proposer only) +```bash +quantus multisig cancel \ + --address \ + --proposal-id \ + --from proposer_wallet +``` + +#### Query Multisig Info +```bash +# Show multisig details (signers, threshold, balance, etc.) +quantus multisig info --address + +# Show specific proposal details (includes current block + time remaining) +quantus multisig info --address --proposal-id +``` + +#### List All Proposals +```bash +quantus multisig list-proposals --address +``` + +#### Cleanup (Recover Deposits) +```bash +# Remove single expired proposal +quantus multisig remove-expired \ + --address \ + --proposal-id \ + --from signer_wallet + +# Batch cleanup all expired proposals +quantus multisig claim-deposits \ + --address \ + --from any_signer_wallet +``` + +#### Dissolve Multisig +```bash +# Requires: no proposals exist, zero balance +quantus multisig dissolve \ + --address \ + --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 (locked, returned on dissolution) +- **ProposalFee**: Non-refundable fee per proposal (scales with signer count) +- **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**: 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 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`. + ## ๐Ÿ—๏ธ Architecture ### Quantum-Safe Cryptography diff --git a/examples/multisig_library_usage.rs b/examples/multisig_library_usage.rs new file mode 100644 index 0000000..657307f --- /dev/null +++ b/examples/multisig_library_usage.rs @@ -0,0 +1,201 @@ +//! Multisig library usage example +//! +//! This example demonstrates using quantus-cli as a library for multisig operations + +use quantus_cli::{ + approve_dissolve_multisig, approve_proposal, create_multisig, get_multisig_info, + get_proposal_info, list_proposals, parse_multisig_amount, predict_multisig_address, + 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 nonce = 0; // Use different nonce to create multiple multisigs with same signers + + // Predict address before creating + let predicted_address = predict_multisig_address(signers.clone(), threshold, nonce); + println!("๐Ÿ“ Predicted address: {}", predicted_address); + + let (tx_hash, multisig_address) = + create_multisig(&quantus_client, &alice_keypair, signers, threshold, nonce, 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!(" - predict_multisig_address() - Calculate address before creating"); + println!(" - create_multisig() - Create with nonce for deterministic addresses"); + println!(" - propose_transfer()"); + println!(" - propose_custom()"); + println!(" - approve_proposal()"); + println!(" - cancel_proposal()"); + println!(" - get_multisig_info()"); + println!(" - get_proposal_info()"); + println!(" - list_proposals()"); + println!(" - approve_dissolve_multisig() - Requires threshold approvals"); + println!(" - parse_multisig_amount()"); + println!(); + println!("๐Ÿ’ก Note: Multisig deposits are RETURNED to creator upon dissolution"); + + 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/examples/multisig_usage.rs b/examples/multisig_usage.rs new file mode 100644 index 0000000..06626b6 --- /dev/null +++ b/examples/multisig_usage.rs @@ -0,0 +1,181 @@ +//! 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 nonce = 0u64; // Default nonce. Use different values to create multiple multisigs + + 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, nonce); + + 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: Multisig addresses are deterministic (hash of signers + threshold + nonce)"); + println!(" Use 'quantus multisig predict-address' to calculate address before creating:"); + println!(" quantus multisig predict-address --signers --threshold 2 --nonce 0"); + println!(); + + // 4. Example: Query multisig info + println!("๐Ÿ“‹ To query multisig information:"); + 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 - human-readable amounts):"); + println!(" quantus multisig propose transfer \\"); + println!(" --address \\"); + println!(" --to \\"); + println!(" --amount 10 \\"); + println!(" --expiry 1000 \\"); + println!(" --from alice"); + println!(); + println!(" # Custom transaction (full flexibility):"); + println!(" quantus multisig propose custom \\"); + println!(" --address \\"); + 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 (auto-executes at threshold):"); + println!(" quantus multisig approve \\"); + println!(" --address \\"); + println!(" --proposal-id \\"); + println!(" --from bob"); + println!(); + + // 7. Example: List proposals + println!("๐Ÿ“‹ To list all proposals:"); + println!(" quantus multisig list-proposals --address "); + println!(); + + // 8. Example: Cleanup (recover deposits from expired proposals) + println!("๐Ÿงน To cleanup and recover deposits:"); + println!(" # Remove single expired proposal"); + println!(" quantus multisig remove-expired \\"); + println!(" --address \\"); + println!(" --proposal-id \\"); + println!(" --from alice"); + println!(); + println!(" # Batch cleanup all expired proposals"); + println!(" quantus multisig claim-deposits \\"); + println!(" --address \\"); + println!(" --from alice"); + println!(); + + // 9. Example: Dissolve multisig (requires threshold approvals) + println!("๐Ÿ—‘๏ธ To dissolve multisig:"); + println!(" Requirements:"); + println!(" - No proposals (any status)"); + println!(" - Zero balance"); + println!(" - Threshold approvals"); + println!(" ๐Ÿ’ก INFO: Deposit is RETURNED to creator on successful dissolution"); + println!(); + println!(" # Each signer must approve:"); + println!(" quantus multisig dissolve --address --from alice # 1/2"); + println!( + " quantus multisig dissolve --address --from bob # 2/2 (dissolved)" + ); + println!(); + println!(" # Check dissolution progress:"); + println!(" quantus multisig info --address "); + 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..399a72e 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,10 @@ 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, + 83u8, 201u8, 36u8, 223u8, 93u8, 149u8, 193u8, 203u8, 41u8, 142u8, + 158u8, 244u8, 6u8, 74u8, 118u8, 113u8, 120u8, 252u8, 164u8, 254u8, + 183u8, 172u8, 250u8, 63u8, 190u8, 25u8, 10u8, 225u8, 247u8, 167u8, + 237u8, 198u8, ], ) } @@ -1493,9 +1490,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, + 35u8, 19u8, 78u8, 196u8, 172u8, 255u8, 227u8, 182u8, 90u8, 16u8, 181u8, + 213u8, 194u8, 231u8, 244u8, 40u8, 40u8, 197u8, 65u8, 151u8, 18u8, + 249u8, 10u8, 204u8, 76u8, 171u8, 51u8, 142u8, 31u8, 101u8, 152u8, + 223u8, ], ) } @@ -1835,9 +1833,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 +1851,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 +1860,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 +1887,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 +1908,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 +1920,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 +1938,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 +1962,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 +1971,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 +1986,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, + 141u8, 30u8, 93u8, 76u8, 51u8, 74u8, 143u8, 3u8, 170u8, 144u8, 91u8, 30u8, 143u8, + 254u8, 72u8, 198u8, 209u8, 91u8, 194u8, 160u8, 173u8, 115u8, 246u8, 148u8, 50u8, + 131u8, 213u8, 242u8, 58u8, 207u8, 89u8, 21u8, ] } pub mod system { @@ -3098,10 +3087,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, + 8u8, 154u8, 5u8, 78u8, 19u8, 58u8, 120u8, 42u8, 16u8, 99u8, 212u8, + 26u8, 107u8, 40u8, 80u8, 88u8, 65u8, 30u8, 24u8, 221u8, 98u8, 190u8, + 2u8, 250u8, 220u8, 127u8, 102u8, 140u8, 151u8, 224u8, 205u8, 29u8, ], ) } @@ -5169,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, + ], + ) + } } } } @@ -5463,9 +5470,10 @@ 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, + 54u8, 116u8, 88u8, 237u8, 238u8, 7u8, 121u8, 110u8, 194u8, 159u8, + 116u8, 146u8, 148u8, 66u8, 112u8, 248u8, 194u8, 153u8, 210u8, 232u8, + 61u8, 11u8, 92u8, 15u8, 90u8, 150u8, 217u8, 200u8, 210u8, 239u8, 48u8, + 9u8, ], ) } @@ -5488,10 +5496,10 @@ 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, + 208u8, 91u8, 30u8, 229u8, 2u8, 127u8, 215u8, 117u8, 140u8, 175u8, + 230u8, 108u8, 24u8, 190u8, 161u8, 108u8, 49u8, 35u8, 221u8, 242u8, + 20u8, 112u8, 195u8, 141u8, 161u8, 207u8, 172u8, 84u8, 61u8, 67u8, 95u8, + 44u8, ], ) } @@ -5529,10 +5537,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, + 236u8, 43u8, 79u8, 74u8, 143u8, 20u8, 163u8, 6u8, 96u8, 140u8, 168u8, + 55u8, 236u8, 140u8, 202u8, 212u8, 73u8, 63u8, 10u8, 118u8, 78u8, 46u8, + 190u8, 73u8, 181u8, 36u8, 74u8, 94u8, 39u8, 107u8, 70u8, 52u8, ], ) } @@ -6060,15 +6067,15 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " The base block reward given to miners"] - pub fn miner_block_reward( + #[doc = " The maximum total supply of tokens"] + pub fn max_supply( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "MiningRewards", - "MinerBlockReward", + "MaxSupply", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -6076,15 +6083,15 @@ pub mod api { ], ) } - #[doc = " The base block reward given to treasury"] - pub fn treasury_block_reward( + #[doc = " The divisor used to calculate block rewards from remaining supply"] + pub fn emission_divisor( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "MiningRewards", - "TreasuryBlockReward", + "EmissionDivisor", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -6092,6 +6099,23 @@ pub mod api { ], ) } + #[doc = " The portion of rewards that goes to treasury (out of 100)"] + pub fn treasury_portion( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u8, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "MiningRewards", + "TreasuryPortion", + [ + 141u8, 130u8, 11u8, 35u8, 226u8, 114u8, 92u8, 179u8, 168u8, 110u8, + 28u8, 91u8, 221u8, 64u8, 4u8, 148u8, 201u8, 193u8, 185u8, 66u8, 226u8, + 114u8, 97u8, 79u8, 62u8, 212u8, 202u8, 114u8, 237u8, 228u8, 183u8, + 165u8, + ], + ) + } #[doc = " The treasury pallet ID"] pub fn treasury_pallet_id( &self, @@ -6128,12 +6152,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 +6174,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 +6201,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 +6229,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 +6255,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 +6280,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 = "Register a preimage on-chain."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vest( + #[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, - ) -> ::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", - types::Vest {}, + "Preimage", + "note_preimage", + types::NotePreimage { bytes }, [ - 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, + 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 = "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 = "Clear an unrequested preimage from the runtime storage."] #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = "If `len` is provided, then it will be a much cheaper operation."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vest_other( + #[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::vest_other::Target, - ) -> ::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", - "vest_other", - types::VestOther { target }, + "Preimage", + "unnote_preimage", + types::UnnotePreimage { hash }, [ - 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, + 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 = "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 = "Request a preimage be uploaded to the chain without paying any fees or deposits."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn 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, - target: types::vested_transfer::Target, - schedule: types::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", - "vested_transfer", - types::VestedTransfer { target, schedule }, + "Preimage", + "request_preimage", + types::RequestPreimage { 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, + 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 = "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 = "Clear a previously made request for a preimage."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn force_vested_transfer( + #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] + pub fn unrequest_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::unrequest_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", + "unrequest_preimage", + types::UnrequestPreimage { 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, + 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 = "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 = "Ensure that the bulk of pre-images is upgraded."] #[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 = "The caller pays no fee if at least 90% of pre-images were successfully updated."] + pub fn ensure_updated( &self, - schedule1_index: types::merge_schedules::Schedule1Index, - schedule2_index: types::merge_schedules::Schedule2Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + hashes: types::ensure_updated::Hashes, + ) -> ::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", + "ensure_updated", + types::EnsureUpdated { hashes }, [ - 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, - ], - ) - } - #[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"] - pub fn force_remove_vesting_schedule( - &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, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "force_remove_vesting_schedule", - types::ForceRemoveVestingSchedule { target, schedule_index }, - [ - 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 +6414,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 +6433,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 +6452,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 +6661,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 +6696,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,25 +6724,36 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub struct RequestPreimage { - pub hash: request_preimage::Hash, + #[doc = "Schedule a named task."] + pub struct ScheduleNamed { + pub id: schedule_named::Id, + pub when: schedule_named::When, + pub maybe_periodic: schedule_named::MaybePeriodic, + pub priority: schedule_named::Priority, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod request_preimage { + pub mod schedule_named { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestPreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "request_preimage"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, + 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 ScheduleNamed { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "schedule_named"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, )] #[decode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" @@ -6852,19 +6761,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,1561 +6784,1203 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Ensure that the bulk of pre-images is upgraded."] - #[doc = ""] - #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub struct EnsureUpdated { - pub hashes: ensure_updated::Hashes, + #[doc = "Anonymously schedule a task after a delay."] + pub struct ScheduleAfter { + pub after: schedule_after::After, + pub maybe_periodic: schedule_after::MaybePeriodic, + pub priority: schedule_after::Priority, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod ensure_updated { + pub mod schedule_after { use super::runtime_types; - pub type Hashes = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::H256, + pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, >; + pub type MaybePeriodic = ::core::option::Option<( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + )>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for EnsureUpdated { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "ensure_updated"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAfter { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "schedule_after"; } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Register a preimage on-chain."] - #[doc = ""] - #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] - #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] - pub fn note_preimage( - &self, - bytes: types::note_preimage::Bytes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "note_preimage", - types::NotePreimage { bytes }, - [ - 121u8, 88u8, 18u8, 92u8, 176u8, 15u8, 192u8, 198u8, 146u8, 198u8, 38u8, - 242u8, 213u8, 83u8, 7u8, 230u8, 14u8, 110u8, 235u8, 32u8, 215u8, 26u8, - 192u8, 217u8, 113u8, 224u8, 206u8, 96u8, 177u8, 198u8, 246u8, 33u8, - ], - ) + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Schedule a named task after a delay."] + pub struct ScheduleNamedAfter { + pub id: schedule_named_after::Id, + pub after: schedule_named_after::After, + pub maybe_periodic: schedule_named_after::MaybePeriodic, + pub priority: schedule_named_after::Priority, + pub call: + ::subxt::ext::subxt_core::alloc::boxed::Box, } - #[doc = "Clear an unrequested preimage from the runtime storage."] + pub mod schedule_named_after { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type MaybePeriodic = ::core::option::Option<( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + )>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamedAfter { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "schedule_named_after"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] + #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] + #[doc = "succeeds."] #[doc = ""] - #[doc = "If `len` is provided, then it will be a much cheaper operation."] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] #[doc = ""] - #[doc = "- `hash`: The hash of the preimage to be removed from the store."] - #[doc = "- `len`: The length of the preimage of `hash`."] - pub fn unnote_preimage( - &self, - hash: types::unnote_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "unnote_preimage", - types::UnnotePreimage { hash }, - [ - 188u8, 116u8, 222u8, 22u8, 127u8, 215u8, 2u8, 133u8, 96u8, 202u8, - 190u8, 123u8, 203u8, 43u8, 200u8, 161u8, 226u8, 24u8, 49u8, 36u8, - 221u8, 160u8, 130u8, 119u8, 30u8, 138u8, 144u8, 85u8, 5u8, 164u8, - 252u8, 222u8, - ], - ) + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + pub struct SetRetry { + pub task: set_retry::Task, + pub retries: set_retry::Retries, + pub period: set_retry::Period, } - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub fn request_preimage( - &self, - hash: types::request_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "request_preimage", - types::RequestPreimage { hash }, - [ - 87u8, 0u8, 204u8, 111u8, 43u8, 115u8, 64u8, 209u8, 133u8, 13u8, 83u8, - 45u8, 164u8, 166u8, 233u8, 105u8, 242u8, 238u8, 235u8, 208u8, 113u8, - 134u8, 93u8, 242u8, 86u8, 32u8, 7u8, 152u8, 107u8, 208u8, 79u8, 59u8, - ], - ) + pub mod set_retry { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Retries = ::core::primitive::u8; + pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; } - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - pub fn unrequest_preimage( - &self, - hash: types::unrequest_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "unrequest_preimage", - types::UnrequestPreimage { hash }, - [ - 55u8, 37u8, 224u8, 149u8, 142u8, 120u8, 8u8, 68u8, 183u8, 225u8, 255u8, - 240u8, 254u8, 111u8, 58u8, 200u8, 113u8, 217u8, 177u8, 203u8, 107u8, - 104u8, 233u8, 87u8, 252u8, 53u8, 33u8, 112u8, 116u8, 254u8, 117u8, - 134u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "set_retry"; } - #[doc = "Ensure that the bulk of pre-images is upgraded."] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] + #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] + #[doc = "it succeeds."] #[doc = ""] - #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub fn ensure_updated( - &self, - hashes: types::ensure_updated::Hashes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "ensure_updated", - types::EnsureUpdated { hashes }, - [ - 254u8, 228u8, 88u8, 44u8, 126u8, 235u8, 188u8, 153u8, 61u8, 27u8, - 103u8, 253u8, 163u8, 161u8, 113u8, 243u8, 87u8, 136u8, 2u8, 231u8, - 209u8, 188u8, 215u8, 106u8, 192u8, 225u8, 75u8, 125u8, 224u8, 96u8, - 221u8, 90u8, - ], - ) + #[doc = "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, } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_preimage::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A preimage has been noted."] - pub struct Noted { - pub hash: noted::Hash, - } - pub mod noted { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Noted { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Noted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A preimage has been requested."] - pub struct Requested { - pub hash: requested::Hash, - } - pub mod requested { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Requested { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Requested"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A preimage has ben cleared."] - pub struct Cleared { - pub hash: cleared::Hash, - } - pub mod cleared { - use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cleared { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Cleared"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod status_for { + pub mod set_retry_named { use super::runtime_types; - pub type StatusFor = runtime_types::pallet_preimage::OldRequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, + pub type Id = [::core::primitive::u8; 32usize]; + pub type Retries = ::core::primitive::u8; + pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; } - pub mod request_status_for { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetryNamed { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "set_retry_named"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Removes the retry configuration of a task."] + pub struct CancelRetry { + pub task: cancel_retry::Task, + } + pub mod cancel_retry { use super::runtime_types; - pub type RequestStatusFor = runtime_types::pallet_preimage::RequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::quantus_runtime::governance::definitions::PreimageDeposit, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); } - pub mod preimage_for { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetry { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "cancel_retry"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel the retry configuration of a named task."] + pub struct CancelRetryNamed { + pub id: cancel_retry_named::Id, + } + pub mod cancel_retry_named { use super::runtime_types; - pub type PreimageFor = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = - (::subxt::ext::subxt_core::utils::H256, ::core::primitive::u32); + pub type Id = [::core::primitive::u8; 32usize]; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetryNamed { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "cancel_retry_named"; } } - pub struct StorageApi; - impl StorageApi { - #[doc = " The request status of a given hash."] - pub fn status_for_iter( + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Anonymously schedule a task."] + pub fn schedule( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::status_for::StatusFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "StatusFor", - (), + when: types::schedule::When, + maybe_periodic: types::schedule::MaybePeriodic, + priority: types::schedule::Priority, + call: types::schedule::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "schedule", + types::Schedule { + when, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, - 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, - 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, - 209u8, + 236u8, 231u8, 231u8, 168u8, 11u8, 169u8, 145u8, 163u8, 233u8, 78u8, + 85u8, 35u8, 153u8, 88u8, 73u8, 214u8, 120u8, 146u8, 62u8, 118u8, 71u8, + 2u8, 26u8, 113u8, 253u8, 191u8, 8u8, 117u8, 59u8, 243u8, 66u8, 45u8, ], ) } - #[doc = " The request status of a given hash."] - pub fn status_for( + #[doc = "Cancel an anonymously scheduled task."] + pub fn cancel( &self, - _0: types::status_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::status_for::Param0, - >, - types::status_for::StatusFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "StatusFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + when: types::cancel::When, + index: types::cancel::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel", + types::Cancel { when, index }, [ - 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, - 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, - 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, - 209u8, + 134u8, 77u8, 15u8, 56u8, 137u8, 12u8, 58u8, 147u8, 164u8, 204u8, 221u8, + 150u8, 103u8, 42u8, 36u8, 79u8, 146u8, 115u8, 13u8, 194u8, 39u8, 73u8, + 109u8, 10u8, 168u8, 164u8, 190u8, 173u8, 30u8, 17u8, 35u8, 17u8, ], ) } - #[doc = " The request status of a given hash."] - pub fn request_status_for_iter( + #[doc = "Schedule a named task."] + pub fn schedule_named( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::request_status_for::RequestStatusFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", - (), - [ - 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( + id: types::schedule_named::Id, + when: types::schedule_named::When, + maybe_periodic: types::schedule_named::MaybePeriodic, + priority: types::schedule_named::Priority, + call: types::schedule_named::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "schedule_named", + types::ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, + [ + 105u8, 192u8, 53u8, 116u8, 86u8, 56u8, 217u8, 166u8, 105u8, 241u8, + 128u8, 54u8, 189u8, 45u8, 228u8, 212u8, 46u8, 255u8, 46u8, 253u8, 27u8, + 220u8, 36u8, 119u8, 155u8, 239u8, 101u8, 151u8, 147u8, 236u8, 114u8, + 85u8, + ], + ) + } + #[doc = "Cancel a named scheduled task."] + pub fn cancel_named( &self, - _0: types::request_status_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::request_status_for::Param0, - >, - types::request_status_for::RequestStatusFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + id: types::cancel_named::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_named", + types::CancelNamed { id }, [ - 113u8, 195u8, 77u8, 23u8, 125u8, 170u8, 77u8, 145u8, 201u8, 168u8, - 39u8, 13u8, 143u8, 50u8, 100u8, 92u8, 25u8, 110u8, 125u8, 20u8, 96u8, - 156u8, 225u8, 200u8, 57u8, 199u8, 226u8, 242u8, 230u8, 126u8, 138u8, - 123u8, + 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, 93u8, + 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, 147u8, 122u8, + 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, 129u8, 193u8, ], ) } - pub fn preimage_for_iter( + #[doc = "Anonymously schedule a task after a delay."] + pub fn schedule_after( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::preimage_for::PreimageFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", - (), + after: types::schedule_after::After, + maybe_periodic: types::schedule_after::MaybePeriodic, + priority: types::schedule_after::Priority, + call: types::schedule_after::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "schedule_after", + types::ScheduleAfter { + after, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, - 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, - 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, - 139u8, + 159u8, 77u8, 104u8, 198u8, 72u8, 191u8, 216u8, 98u8, 158u8, 103u8, + 234u8, 81u8, 129u8, 81u8, 225u8, 2u8, 169u8, 76u8, 168u8, 161u8, 139u8, + 220u8, 7u8, 123u8, 179u8, 11u8, 43u8, 71u8, 39u8, 71u8, 98u8, 158u8, ], ) } - pub fn preimage_for( + #[doc = "Schedule a named task after a delay."] + pub fn schedule_named_after( &self, - _0: types::preimage_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::preimage_for::Param0, - >, - types::preimage_for::PreimageFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + id: types::schedule_named_after::Id, + after: types::schedule_named_after::After, + maybe_periodic: types::schedule_named_after::MaybePeriodic, + priority: types::schedule_named_after::Priority, + call: types::schedule_named_after::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "schedule_named_after", + types::ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, - 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, - 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, - 139u8, + 156u8, 5u8, 175u8, 217u8, 0u8, 41u8, 25u8, 8u8, 65u8, 137u8, 55u8, + 139u8, 32u8, 53u8, 218u8, 128u8, 160u8, 86u8, 170u8, 149u8, 245u8, + 10u8, 213u8, 49u8, 58u8, 49u8, 20u8, 49u8, 19u8, 220u8, 63u8, 81u8, ], ) } - } - } - } - pub mod scheduler { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_scheduler::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_scheduler::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Anonymously schedule a task."] - pub struct Schedule { - pub when: schedule::When, - pub maybe_periodic: schedule::MaybePeriodic, - pub priority: schedule::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] + #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] + #[doc = "succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + pub fn set_retry( + &self, + task: types::set_retry::Task, + retries: types::set_retry::Retries, + period: types::set_retry::Period, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "set_retry", + types::SetRetry { task, retries, period }, + [ + 31u8, 128u8, 255u8, 13u8, 13u8, 252u8, 74u8, 151u8, 60u8, 242u8, 152u8, + 58u8, 190u8, 155u8, 132u8, 65u8, 139u8, 208u8, 222u8, 175u8, 89u8, + 222u8, 186u8, 98u8, 53u8, 125u8, 71u8, 55u8, 95u8, 2u8, 76u8, 248u8, + ], + ) } - pub mod schedule { - use super::runtime_types; - pub type When = ::core::primitive::u32; - pub type MaybePeriodic = ::core::option::Option<( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - )>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] + #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] + #[doc = "it succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + pub fn set_retry_named( + &self, + id: types::set_retry_named::Id, + retries: types::set_retry_named::Retries, + period: types::set_retry_named::Period, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "set_retry_named", + types::SetRetryNamed { id, retries, period }, + [ + 102u8, 70u8, 114u8, 48u8, 180u8, 194u8, 107u8, 81u8, 104u8, 117u8, + 33u8, 169u8, 43u8, 172u8, 61u8, 129u8, 143u8, 221u8, 44u8, 101u8, + 235u8, 228u8, 224u8, 71u8, 65u8, 223u8, 180u8, 130u8, 83u8, 89u8, + 157u8, 75u8, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Schedule { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule"; + #[doc = "Removes the retry configuration of a task."] + pub fn cancel_retry( + &self, + task: types::cancel_retry::Task, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_retry", + types::CancelRetry { task }, + [ + 153u8, 252u8, 168u8, 142u8, 100u8, 114u8, 25u8, 46u8, 225u8, 95u8, + 243u8, 78u8, 160u8, 175u8, 17u8, 33u8, 27u8, 241u8, 149u8, 187u8, + 228u8, 182u8, 233u8, 74u8, 10u8, 228u8, 117u8, 218u8, 210u8, 127u8, + 245u8, 105u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an anonymously scheduled task."] - pub struct Cancel { - pub when: cancel::When, - pub index: cancel::Index, + #[doc = "Cancel the retry configuration of a named task."] + pub fn cancel_retry_named( + &self, + id: types::cancel_retry_named::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_retry_named", + types::CancelRetryNamed { id }, + [ + 76u8, 157u8, 253u8, 113u8, 162u8, 54u8, 98u8, 21u8, 62u8, 44u8, 155u8, + 202u8, 2u8, 28u8, 153u8, 219u8, 67u8, 166u8, 206u8, 79u8, 139u8, 3u8, + 119u8, 182u8, 254u8, 134u8, 143u8, 121u8, 155u8, 220u8, 192u8, 209u8, + ], + ) } - pub mod cancel { - use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + } + } + #[doc = "Events type."] + pub type Event = runtime_types::pallet_scheduler::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Scheduled some task."] + pub struct Scheduled { + pub when: scheduled::When, + pub index: scheduled::Index, + } + pub mod scheduled { + use super::runtime_types; + pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Scheduled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Scheduled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Canceled some task."] + pub struct Canceled { + pub when: canceled::When, + pub index: canceled::Index, + } + pub mod canceled { + use super::runtime_types; + pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Canceled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Canceled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Dispatched some task."] + pub struct Dispatched { + pub task: dispatched::Task, + pub id: dispatched::Id, + pub result: dispatched::Result, + } + pub mod dispatched { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, - >; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule a named task."] - pub struct ScheduleNamed { - pub id: schedule_named::Id, - pub when: schedule_named::When, - pub maybe_periodic: schedule_named::MaybePeriodic, - pub priority: schedule_named::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type When = ::core::primitive::u32; - pub type MaybePeriodic = ::core::option::Option<( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - )>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_named"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a named scheduled task."] - pub struct CancelNamed { - pub id: cancel_named::Id, - } - pub mod cancel_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_named"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Anonymously schedule a task after a delay."] - pub struct ScheduleAfter { - pub after: schedule_after::After, - pub maybe_periodic: schedule_after::MaybePeriodic, - pub priority: schedule_after::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod schedule_after { - use super::runtime_types; - pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Set a retry configuration for some task."] + pub struct RetrySet { + pub task: retry_set::Task, + pub id: retry_set::Id, + pub period: retry_set::Period, + pub retries: retry_set::Retries, + } + pub mod retry_set { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, - >; - pub type MaybePeriodic = ::core::option::Option<( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub type 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, - )>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_after"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[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, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for RetryCancelled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "RetryCancelled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The call for the provided hash was not found so the task has been aborted."] + pub struct CallUnavailable { + pub task: call_unavailable::Task, + pub id: call_unavailable::Id, + } + pub mod call_unavailable { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for CallUnavailable { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "CallUnavailable"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The given task was unable to be renewed since the agenda is full at that block."] + pub struct PeriodicFailed { + pub task: periodic_failed::Task, + pub id: periodic_failed::Id, + } + pub mod periodic_failed { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for PeriodicFailed { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "PeriodicFailed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The given task was unable to be retried since the agenda is full at that block or there"] + #[doc = "was not enough weight to reschedule it."] + pub struct RetryFailed { + pub task: retry_failed::Task, + pub id: retry_failed::Id, + } + pub mod retry_failed { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for RetryFailed { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "RetryFailed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The given task can never be executed since it is overweight."] + pub struct PermanentlyOverweight { + pub task: permanently_overweight::Task, + pub id: permanently_overweight::Id, + } + pub mod permanently_overweight { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for PermanentlyOverweight { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "PermanentlyOverweight"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod incomplete_block_since { + use super::runtime_types; + pub type IncompleteBlockSince = ::core::primitive::u32; } - pub mod schedule_named_after { + pub mod incomplete_timestamp_since { use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + 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 MaybePeriodic = ::core::option::Option<( + } + pub mod retries { + use super::runtime_types; + pub type Retries = runtime_types::pallet_scheduler::RetryConfig< + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + >; + pub type Param0 = ( runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, >, ::core::primitive::u32, - )>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamedAfter { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_named_after"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] - #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] - #[doc = "succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - pub struct SetRetry { - pub task: set_retry::Task, - pub retries: set_retry::Retries, - pub period: set_retry::Period, + ); } - pub mod set_retry { + pub mod lookup { use super::runtime_types; - pub type Task = ( + pub type Lookup = ( runtime_types::qp_scheduler::BlockNumberOrTimestamp< ::core::primitive::u32, ::core::primitive::u64, >, ::core::primitive::u32, ); - pub type Retries = ::core::primitive::u8; - pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; + pub type Param0 = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry"; + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Tracks incomplete block-based agendas that need to be processed in a later block."] + pub fn incomplete_block_since( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::incomplete_block_since::IncompleteBlockSince, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Scheduler", + "IncompleteBlockSince", + (), + [ + 134u8, 34u8, 161u8, 236u8, 176u8, 35u8, 218u8, 109u8, 229u8, 93u8, + 29u8, 95u8, 81u8, 106u8, 98u8, 65u8, 132u8, 91u8, 237u8, 225u8, 75u8, + 125u8, 81u8, 218u8, 72u8, 215u8, 20u8, 66u8, 160u8, 196u8, 68u8, 34u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] - #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - pub struct SetRetryNamed { - pub id: set_retry_named::Id, - pub retries: set_retry_named::Retries, - pub period: set_retry_named::Period, - } - pub mod set_retry_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type Retries = ::core::primitive::u8; - pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry_named"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Removes the retry configuration of a task."] - pub struct CancelRetry { - pub task: cancel_retry::Task, - } - pub mod cancel_retry { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel the retry configuration of a named task."] - pub struct CancelRetryNamed { - pub id: cancel_retry_named::Id, - } - pub mod cancel_retry_named { - use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry_named"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Anonymously schedule a task."] - pub fn schedule( + #[doc = " Tracks incomplete timestamp-based agendas that need to be processed in a later block."] + pub fn incomplete_timestamp_since( &self, - when: types::schedule::When, - maybe_periodic: types::schedule::MaybePeriodic, - priority: types::schedule::Priority, - call: types::schedule::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::incomplete_timestamp_since::IncompleteTimestampSince, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "schedule", - types::Schedule { - when, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "IncompleteTimestampSince", + (), [ - 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, + 223u8, 125u8, 99u8, 28u8, 81u8, 135u8, 125u8, 26u8, 3u8, 20u8, 32u8, + 125u8, 141u8, 114u8, 100u8, 38u8, 219u8, 191u8, 30u8, 88u8, 82u8, 33u8, + 140u8, 223u8, 168u8, 84u8, 144u8, 85u8, 57u8, 241u8, 97u8, 141u8, ], ) } - #[doc = "Cancel an anonymously scheduled task."] - pub fn cancel( + #[doc = " Tracks the last timestamp bucket that was fully processed."] + #[doc = " Used to avoid reprocessing all buckets from 0 on every run."] + pub fn last_processed_timestamp( &self, - when: types::cancel::When, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::last_processed_timestamp::LastProcessedTimestamp, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "cancel", - types::Cancel { when, index }, + "LastProcessedTimestamp", + (), [ - 134u8, 77u8, 15u8, 56u8, 137u8, 12u8, 58u8, 147u8, 164u8, 204u8, 221u8, - 150u8, 103u8, 42u8, 36u8, 79u8, 146u8, 115u8, 13u8, 194u8, 39u8, 73u8, - 109u8, 10u8, 168u8, 164u8, 190u8, 173u8, 30u8, 17u8, 35u8, 17u8, + 172u8, 193u8, 6u8, 47u8, 185u8, 134u8, 179u8, 132u8, 178u8, 0u8, 228u8, + 198u8, 232u8, 24u8, 85u8, 199u8, 102u8, 222u8, 246u8, 178u8, 8u8, + 221u8, 51u8, 188u8, 239u8, 218u8, 112u8, 245u8, 46u8, 146u8, 65u8, + 119u8, ], ) } - #[doc = "Schedule a named task."] - pub fn schedule_named( + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] + pub fn agenda_iter( &self, - id: types::schedule_named::Id, - when: types::schedule_named::When, - maybe_periodic: types::schedule_named::MaybePeriodic, - priority: types::schedule_named::Priority, - call: types::schedule_named::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::agenda::Agenda, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "schedule_named", - types::ScheduleNamed { - id, - when, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Agenda", + (), [ - 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, + 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, + 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, + 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, ], ) } - #[doc = "Cancel a named scheduled task."] - pub fn cancel_named( + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] + pub fn agenda( &self, - id: types::cancel_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::agenda::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::agenda::Param0, + >, + types::agenda::Agenda, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "cancel_named", - types::CancelNamed { id }, + "Agenda", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, 93u8, - 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, 147u8, 122u8, - 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, 129u8, 193u8, + 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, + 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, + 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, ], ) } - #[doc = "Anonymously schedule a task after a delay."] - pub fn schedule_after( + #[doc = " Retry configurations for items to be executed, indexed by task address."] + pub fn retries_iter( &self, - after: types::schedule_after::After, - maybe_periodic: types::schedule_after::MaybePeriodic, - priority: types::schedule_after::Priority, - call: types::schedule_after::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::retries::Retries, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "schedule_after", - types::ScheduleAfter { - after, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Retries", + (), [ - 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, + 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, + 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, + 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, + 108u8, ], ) } - #[doc = "Schedule a named task after a delay."] - pub fn schedule_named_after( + #[doc = " Retry configurations for items to be executed, indexed by task address."] + pub fn retries( &self, - id: types::schedule_named_after::Id, - after: types::schedule_named_after::After, - maybe_periodic: types::schedule_named_after::MaybePeriodic, - priority: types::schedule_named_after::Priority, - call: types::schedule_named_after::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::retries::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::retries::Param0, + >, + types::retries::Retries, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "schedule_named_after", - types::ScheduleNamedAfter { - id, - after, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Retries", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, + 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, + 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, + 108u8, ], ) } - #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] - #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] - #[doc = "succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] + #[doc = " Lookup from a name to the block number and index of the task."] #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - pub fn set_retry( + #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] + #[doc = " identities."] + pub fn lookup_iter( &self, - task: types::set_retry::Task, - retries: types::set_retry::Retries, - period: types::set_retry::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::lookup::Lookup, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "set_retry", - types::SetRetry { task, retries, period }, + "Lookup", + (), [ - 31u8, 128u8, 255u8, 13u8, 13u8, 252u8, 74u8, 151u8, 60u8, 242u8, 152u8, - 58u8, 190u8, 155u8, 132u8, 65u8, 139u8, 208u8, 222u8, 175u8, 89u8, - 222u8, 186u8, 98u8, 53u8, 125u8, 71u8, 55u8, 95u8, 2u8, 76u8, 248u8, + 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, + 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, + 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, ], ) } - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] - #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] + #[doc = " Lookup from a name to the block number and index of the task."] #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - pub fn set_retry_named( + #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] + #[doc = " identities."] + pub fn lookup( &self, - id: types::set_retry_named::Id, - retries: types::set_retry_named::Retries, - period: types::set_retry_named::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::lookup::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::lookup::Param0, + >, + types::lookup::Lookup, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Scheduler", - "set_retry_named", - types::SetRetryNamed { id, retries, period }, + "Lookup", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 102u8, 70u8, 114u8, 48u8, 180u8, 194u8, 107u8, 81u8, 104u8, 117u8, - 33u8, 169u8, 43u8, 172u8, 61u8, 129u8, 143u8, 221u8, 44u8, 101u8, - 235u8, 228u8, 224u8, 71u8, 65u8, 223u8, 180u8, 130u8, 83u8, 89u8, - 157u8, 75u8, + 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, + 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, + 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, ], ) } - #[doc = "Removes the retry configuration of a task."] - pub fn cancel_retry( + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The maximum weight that may be scheduled per block for any dispatchables."] + pub fn maximum_weight( &self, - task: types::cancel_retry::Task, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_weights::weight_v2::Weight, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "Scheduler", - "cancel_retry", - types::CancelRetry { task }, + "MaximumWeight", [ - 153u8, 252u8, 168u8, 142u8, 100u8, 114u8, 25u8, 46u8, 225u8, 95u8, - 243u8, 78u8, 160u8, 175u8, 17u8, 33u8, 27u8, 241u8, 149u8, 187u8, - 228u8, 182u8, 233u8, 74u8, 10u8, 228u8, 117u8, 218u8, 210u8, 127u8, - 245u8, 105u8, + 149u8, 252u8, 129u8, 80u8, 169u8, 36u8, 79u8, 127u8, 240u8, 156u8, + 56u8, 202u8, 219u8, 86u8, 5u8, 65u8, 245u8, 148u8, 138u8, 243u8, 210u8, + 128u8, 234u8, 216u8, 240u8, 219u8, 123u8, 235u8, 21u8, 158u8, 237u8, + 112u8, ], ) } - #[doc = "Cancel the retry configuration of a named task."] - pub fn cancel_retry_named( + #[doc = " The maximum number of scheduled calls in the queue for a single block."] + #[doc = ""] + #[doc = " NOTE:"] + #[doc = " + Dependent pallets' benchmarks might require a higher limit for the setting. Set a"] + #[doc = " higher limit under `runtime-benchmarks` feature."] + pub fn max_scheduled_per_block( &self, - id: types::cancel_retry_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "Scheduler", - "cancel_retry_named", - types::CancelRetryNamed { id }, + "MaxScheduledPerBlock", [ - 76u8, 157u8, 253u8, 113u8, 162u8, 54u8, 98u8, 21u8, 62u8, 44u8, 155u8, - 202u8, 2u8, 28u8, 153u8, 219u8, 67u8, 166u8, 206u8, 79u8, 139u8, 3u8, - 119u8, 182u8, 254u8, 134u8, 143u8, 121u8, 155u8, 220u8, 192u8, 209u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - } - } - #[doc = "Events type."] - pub type Event = runtime_types::pallet_scheduler::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Scheduled some task."] - pub struct Scheduled { - pub when: scheduled::When, - pub index: scheduled::Index, - } - pub mod scheduled { - use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, + #[doc = " Precision of the timestamp buckets."] + #[doc = ""] + #[doc = " Timestamp based dispatches are rounded to the nearest bucket of this precision."] + pub fn timestamp_bucket_size( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u64, - >; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Scheduled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Scheduled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Canceled some task."] - pub struct Canceled { - pub when: canceled::When, - pub index: canceled::Index, + > { + ::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 canceled { + } + } + pub mod utility { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_utility::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_utility::pallet::Call; + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Canceled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Canceled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Dispatched some task."] - pub struct Dispatched { - pub task: dispatched::Task, - pub id: dispatched::Id, - pub result: dispatched::Result, - } - pub mod dispatched { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - pub type Result = - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Dispatched { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Dispatched"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Set a retry configuration for some task."] - pub struct RetrySet { - pub task: retry_set::Task, - pub id: retry_set::Id, - pub period: retry_set::Period, - pub retries: retry_set::Retries, - } - pub mod retry_set { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Retries = ::core::primitive::u8; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetrySet { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetrySet"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Cancel a retry configuration for some task."] - pub struct RetryCancelled { - pub task: retry_cancelled::Task, - pub id: retry_cancelled::Id, - } - pub mod retry_cancelled { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryCancelled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryCancelled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The call for the provided hash was not found so the task has been aborted."] - pub struct CallUnavailable { - pub task: call_unavailable::Task, - pub id: call_unavailable::Id, - } - pub mod call_unavailable { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for CallUnavailable { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "CallUnavailable"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The given task was unable to be renewed since the agenda is full at that block."] - pub struct PeriodicFailed { - pub task: periodic_failed::Task, - pub id: periodic_failed::Id, - } - pub mod periodic_failed { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for PeriodicFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "PeriodicFailed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The given task was unable to be retried since the agenda is full at that block or there"] - #[doc = "was not enough weight to reschedule it."] - pub struct RetryFailed { - pub task: retry_failed::Task, - pub id: retry_failed::Id, - } - pub mod retry_failed { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryFailed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The given task can never be executed since it is overweight."] - pub struct PermanentlyOverweight { - pub task: permanently_overweight::Task, - pub id: permanently_overweight::Id, - } - pub mod permanently_overweight { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for PermanentlyOverweight { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "PermanentlyOverweight"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod incomplete_block_since { - use super::runtime_types; - pub type IncompleteBlockSince = ::core::primitive::u32; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub struct Batch { + pub calls: batch::Calls, } - pub mod incomplete_timestamp_since { + pub mod batch { use super::runtime_types; - pub type IncompleteTimestampSince = ::core::primitive::u64; + pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, + >; } - pub mod last_processed_timestamp { - use super::runtime_types; - pub type LastProcessedTimestamp = ::core::primitive::u64; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch"; } - 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, - >; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct AsDerivative { + pub index: as_derivative::Index, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod retries { + pub mod as_derivative { use super::runtime_types; - pub type Retries = runtime_types::pallet_scheduler::RetryConfig< - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - >; - pub type Param0 = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); + pub type Index = ::core::primitive::u16; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - 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 AsDerivative { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "as_derivative"; } - } - 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 = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub struct BatchAll { + pub calls: batch_all::Calls, } - #[doc = " 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 batch_all { + use super::runtime_types; + pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, + >; } - #[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 BatchAll { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch_all"; } - #[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 = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct DispatchAs { + pub as_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - #[doc = " 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 dispatch_as { + use super::runtime_types; + pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - #[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 DispatchAs { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "dispatch_as"; } - #[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."] - #[doc = ""] - #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] - #[doc = " identities."] - pub fn lookup_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::lookup::Lookup, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Lookup", - (), - [ - 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, - 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, - 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, - ], - ) - } - #[doc = " Lookup from a name to the block number and index of the task."] - #[doc = ""] - #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] - #[doc = " identities."] - pub fn lookup( - &self, - _0: types::lookup::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::lookup::Param0, - >, - types::lookup::Lookup, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Lookup", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, - 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, - 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The maximum weight that may be scheduled per block for any dispatchables."] - pub fn maximum_weight( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_weights::weight_v2::Weight, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "MaximumWeight", - [ - 149u8, 252u8, 129u8, 80u8, 169u8, 36u8, 79u8, 127u8, 240u8, 156u8, - 56u8, 202u8, 219u8, 86u8, 5u8, 65u8, 245u8, 148u8, 138u8, 243u8, 210u8, - 128u8, 234u8, 216u8, 240u8, 219u8, 123u8, 235u8, 21u8, 158u8, 237u8, - 112u8, - ], - ) - } - #[doc = " The maximum number of scheduled calls in the queue for a single block."] - #[doc = ""] - #[doc = " NOTE:"] - #[doc = " + Dependent pallets' benchmarks might require a higher limit for the setting. Set a"] - #[doc = " higher limit under `runtime-benchmarks` feature."] - pub fn max_scheduled_per_block( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "MaxScheduledPerBlock", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " Precision of the timestamp buckets."] - #[doc = ""] - #[doc = " Timestamp based dispatches are rounded to the nearest bucket of this precision."] - pub fn timestamp_bucket_size( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "TimestampBucketSize", - [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, - 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, - 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, - 246u8, - ], - ) - } - } - } - } - 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, @@ -8444,35 +7993,30 @@ pub mod api { crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] #[doc = ""] #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "## Complexity"] #[doc = "- O(C) where C is the number of calls to be batched."] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - pub struct Batch { - pub calls: batch::Calls, + pub struct ForceBatch { + pub calls: force_batch::Calls, } - pub mod batch { + pub mod force_batch { use super::runtime_types; pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< runtime_types::quantus_runtime::RuntimeCall, >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceBatch { const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch"; + const CALL: &'static str = "force_batch"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8485,31 +8029,24 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a call through an indexed pseudonym of the sender."] - #[doc = ""] - #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] - #[doc = "use the same filter as the origin of this call."] - #[doc = ""] - #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] - #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] - #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] - #[doc = "in the Multisig pallet instead."] + #[doc = "Dispatch a function call with a specified weight."] #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub struct AsDerivative { - pub index: as_derivative::Index, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct WithWeight { + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + pub weight: with_weight::Weight, } - pub mod as_derivative { + pub mod with_weight { use super::runtime_types; - pub type Index = ::core::primitive::u16; pub type Call = runtime_types::quantus_runtime::RuntimeCall; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsDerivative { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for WithWeight { const PALLET: &'static str = "Utility"; - const CALL: &'static str = "as_derivative"; + const CALL: &'static str = "with_weight"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8522,31 +8059,41 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] + #[doc = "Dispatch a fallback call in the event the main call fails to execute."] #[doc = "May be called from any origin except `None`."] #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = "This function first attempts to dispatch the `main` call."] + #[doc = "If the `main` call fails, the `fallback` is attemted."] + #[doc = "if the fallback is successfully dispatched, the weights of both calls"] + #[doc = "are accumulated and an event containing the main call error is deposited."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "In the event of a fallback failure the whole call fails"] + #[doc = "with the weights returned."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub struct BatchAll { - pub calls: batch_all::Calls, + #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] + #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] + #[doc = ""] + #[doc = "## Dispatch Logic"] + #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] + #[doc = " applying any origin filters."] + #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] + #[doc = " `fallback` calls."] + #[doc = ""] + #[doc = "## Use Case"] + #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] + #[doc = " or both."] + pub struct IfElse { + pub main: ::subxt::ext::subxt_core::alloc::boxed::Box, + pub fallback: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod batch_all { + pub mod if_else { use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::quantus_runtime::RuntimeCall, - >; + pub type Main = runtime_types::quantus_runtime::RuntimeCall; + pub type Fallback = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BatchAll { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IfElse { const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch_all"; + const CALL: &'static str = "if_else"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8561,159 +8108,14 @@ pub mod api { )] #[doc = "Dispatches a function call with a provided origin."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub struct DispatchAs { + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct DispatchAsFallible { pub as_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - 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 = ""] - #[doc = "## Use Case"] - #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] - #[doc = " or both."] - pub struct IfElse { - pub main: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub fallback: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod if_else { - use super::runtime_types; - pub type Main = runtime_types::quantus_runtime::RuntimeCall; - pub type Fallback = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IfElse { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "if_else"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub struct DispatchAsFallible { - pub as_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub call: + ::subxt::ext::subxt_core::alloc::boxed::Box, } pub mod dispatch_as_fallible { use super::runtime_types; @@ -8754,10 +8156,9 @@ pub mod api { "batch", types::Batch { calls }, [ - 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, + 42u8, 67u8, 83u8, 210u8, 110u8, 154u8, 63u8, 179u8, 169u8, 240u8, 75u8, + 177u8, 80u8, 53u8, 233u8, 255u8, 60u8, 6u8, 174u8, 182u8, 207u8, 195u8, + 173u8, 213u8, 165u8, 142u8, 128u8, 97u8, 218u8, 251u8, 0u8, 155u8, ], ) } @@ -8787,9 +8188,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 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, + 61u8, 3u8, 74u8, 78u8, 64u8, 101u8, 191u8, 28u8, 9u8, 233u8, 93u8, + 44u8, 8u8, 193u8, 7u8, 24u8, 137u8, 5u8, 252u8, 51u8, 5u8, 4u8, 81u8, + 3u8, 127u8, 126u8, 141u8, 123u8, 224u8, 103u8, 16u8, 94u8, ], ) } @@ -8815,9 +8216,10 @@ pub mod api { "batch_all", types::BatchAll { calls }, [ - 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, + 52u8, 11u8, 147u8, 121u8, 221u8, 163u8, 119u8, 127u8, 134u8, 225u8, + 199u8, 206u8, 148u8, 23u8, 31u8, 249u8, 104u8, 92u8, 22u8, 230u8, + 105u8, 171u8, 107u8, 103u8, 60u8, 57u8, 215u8, 209u8, 55u8, 34u8, + 168u8, 143u8, ], ) } @@ -8840,10 +8242,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 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, + 87u8, 194u8, 148u8, 83u8, 189u8, 151u8, 125u8, 121u8, 189u8, 5u8, 83u8, + 160u8, 224u8, 202u8, 37u8, 108u8, 168u8, 119u8, 40u8, 58u8, 141u8, + 87u8, 14u8, 26u8, 39u8, 140u8, 188u8, 184u8, 173u8, 63u8, 109u8, 39u8, ], ) } @@ -8869,9 +8270,9 @@ pub mod api { "force_batch", types::ForceBatch { calls }, [ - 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, + 111u8, 54u8, 197u8, 10u8, 94u8, 57u8, 219u8, 95u8, 220u8, 182u8, 42u8, + 170u8, 239u8, 9u8, 143u8, 57u8, 243u8, 174u8, 214u8, 57u8, 51u8, 234u8, + 118u8, 192u8, 30u8, 194u8, 39u8, 44u8, 16u8, 147u8, 189u8, 69u8, ], ) } @@ -8894,10 +8295,9 @@ pub mod api { weight, }, [ - 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, + 26u8, 91u8, 230u8, 241u8, 5u8, 82u8, 215u8, 238u8, 45u8, 207u8, 132u8, + 29u8, 167u8, 62u8, 134u8, 37u8, 217u8, 75u8, 119u8, 79u8, 68u8, 218u8, + 176u8, 204u8, 36u8, 113u8, 207u8, 196u8, 234u8, 185u8, 202u8, 229u8, ], ) } @@ -8937,10 +8337,10 @@ pub mod api { fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), }, [ - 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, + 85u8, 132u8, 60u8, 222u8, 146u8, 253u8, 242u8, 57u8, 178u8, 35u8, 13u8, + 161u8, 230u8, 94u8, 90u8, 245u8, 105u8, 175u8, 143u8, 220u8, 124u8, + 242u8, 172u8, 209u8, 178u8, 142u8, 251u8, 132u8, 139u8, 104u8, 253u8, + 23u8, ], ) } @@ -8963,9 +8363,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 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, + 83u8, 136u8, 126u8, 131u8, 102u8, 8u8, 130u8, 115u8, 47u8, 14u8, 44u8, + 61u8, 52u8, 10u8, 191u8, 229u8, 252u8, 6u8, 70u8, 15u8, 186u8, 74u8, + 158u8, 42u8, 106u8, 112u8, 19u8, 75u8, 165u8, 220u8, 240u8, 124u8, ], ) } @@ -10615,6 +10015,32 @@ pub mod api { const PALLET: &'static str = "ReversibleTransfers"; const CALL: &'static str = "schedule_asset_transfer_with_delay"; } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Allows the guardian (interceptor) to recover all funds from a high security"] + #[doc = "account by transferring the entire balance to themselves."] + #[doc = ""] + #[doc = "This is an emergency function for when the high security account may be compromised."] + pub struct RecoverFunds { + pub account: recover_funds::Account, + } + pub mod recover_funds { + use super::runtime_types; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RecoverFunds { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "recover_funds"; + } } pub struct TransactionApi; impl TransactionApi { @@ -10774,6 +10200,26 @@ pub mod api { ], ) } + #[doc = "Allows the guardian (interceptor) to recover all funds from a high security"] + #[doc = "account by transferring the entire balance to themselves."] + #[doc = ""] + #[doc = "This is an emergency function for when the high security account may be compromised."] + pub fn recover_funds( + &self, + account: types::recover_funds::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "recover_funds", + types::RecoverFunds { account }, + [ + 94u8, 241u8, 255u8, 110u8, 4u8, 169u8, 1u8, 45u8, 236u8, 88u8, 167u8, + 180u8, 240u8, 70u8, 111u8, 99u8, 185u8, 143u8, 153u8, 33u8, 101u8, + 30u8, 203u8, 103u8, 229u8, 39u8, 162u8, 76u8, 49u8, 125u8, 247u8, + 220u8, + ], + ) + } } } #[doc = "The `Event` enum of this pallet"] @@ -10850,7 +10296,6 @@ pub mod api { #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] #[doc = "A scheduled transaction has been successfully cancelled by the owner."] - #[doc = "[who, tx_id]"] pub struct TransactionCancelled { pub who: transaction_cancelled::Who, pub tx_id: transaction_cancelled::TxId, @@ -10872,7 +10317,6 @@ pub mod api { #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] #[doc = "A scheduled transaction was executed by the scheduler."] - #[doc = "[tx_id, dispatch_result]"] pub struct TransactionExecuted { pub tx_id: transaction_executed::TxId, pub result: transaction_executed::Result, @@ -10891,6 +10335,27 @@ pub mod api { const PALLET: &'static str = "ReversibleTransfers"; const EVENT: &'static str = "TransactionExecuted"; } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Funds were recovered from a high security account by its guardian."] + pub struct FundsRecovered { + pub account: funds_recovered::Account, + pub guardian: funds_recovered::Guardian, + } + pub mod funds_recovered { + use super::runtime_types; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Guardian = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for FundsRecovered { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "FundsRecovered"; + } } pub mod storage { use super::runtime_types; @@ -11367,7 +10832,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< @@ -14378,12 +13843,12 @@ pub mod api { } } } - pub mod merkle_airdrop { + pub mod treasury_pallet { use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_merkle_airdrop::pallet::Error; + #[doc = "Error for the treasury pallet."] + pub type Error = runtime_types::pallet_treasury::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_merkle_airdrop::pallet::Call; + pub type Call = runtime_types::pallet_treasury::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -14400,70 +13865,39 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Create a new airdrop with a Merkle root."] - #[doc = ""] - #[doc = "The Merkle root is a cryptographic hash that represents all valid claims"] - #[doc = "for this airdrop. Users will later provide Merkle proofs to verify their"] - #[doc = "eligibility to claim tokens."] - #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Propose and approve a spend of treasury funds."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `merkle_root` - The Merkle root hash representing all valid claims"] - #[doc = "* `vesting_period` - Optional vesting period for the airdrop"] - #[doc = "* `vesting_delay` - Optional delay before vesting starts"] - pub struct CreateAirdrop { - pub merkle_root: create_airdrop::MerkleRoot, - pub vesting_period: create_airdrop::VestingPeriod, - pub vesting_delay: create_airdrop::VestingDelay, - } - pub mod create_airdrop { - use super::runtime_types; - pub type MerkleRoot = [::core::primitive::u8; 32usize]; - pub type VestingPeriod = ::core::option::Option<::core::primitive::u32>; - pub type VestingDelay = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "create_airdrop"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Fund an existing airdrop with tokens."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "### Details"] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to fund"] - #[doc = "* `amount` - The amount of tokens to add to the airdrop"] + #[doc = "### Parameters"] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "## Events"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - pub struct FundAirdrop { - pub airdrop_id: fund_airdrop::AirdropId, - pub amount: fund_airdrop::Amount, + #[doc = "Emits [`Event::SpendApproved`] if successful."] + pub struct SpendLocal { + #[codec(compact)] + pub amount: spend_local::Amount, + pub beneficiary: spend_local::Beneficiary, } - pub mod fund_airdrop { + pub mod spend_local { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; pub type Amount = ::core::primitive::u128; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FundAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "fund_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SpendLocal { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "spend_local"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14476,44 +13910,38 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] + #[doc = "Force a previously approved proposal to be removed from the approval queue."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] #[doc = ""] - #[doc = "Users can claim their tokens by providing a proof of their eligibility."] - #[doc = "The proof is verified against the airdrop's Merkle root."] - #[doc = "Anyone can trigger a claim for any eligible recipient."] + #[doc = "## Details"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "The original deposit will no longer be returned."] #[doc = ""] - #[doc = "* `origin` - The origin of the call"] - #[doc = "* `airdrop_id` - The ID of the airdrop to claim from"] - #[doc = "* `amount` - The amount of tokens to claim"] - #[doc = "* `merkle_proof` - The Merkle proof verifying eligibility"] + #[doc = "### Parameters"] + #[doc = "- `proposal_id`: The index of a proposal"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "### Complexity"] + #[doc = "- O(A) where `A` is the number of approvals"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `AlreadyClaimed` - If the recipient has already claimed from this airdrop"] - #[doc = "* `InvalidProof` - If the provided Merkle proof is invalid"] - #[doc = "* `InsufficientAirdropBalance` - If the airdrop doesn't have enough tokens"] - pub struct Claim { - pub airdrop_id: claim::AirdropId, - pub recipient: claim::Recipient, - pub amount: claim::Amount, - pub merkle_proof: claim::MerkleProof, + #[doc = "### Errors"] + #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] + #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] + #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] + #[doc = " in the first place."] + pub struct RemoveApproval { + #[codec(compact)] + pub proposal_id: remove_approval::ProposalId, } - pub mod claim { + pub mod remove_approval { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Recipient = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - pub type MerkleProof = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >; + pub type ProposalId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Claim { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "claim"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveApproval { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "remove_approval"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14526,165 +13954,404 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Delete an airdrop and reclaim any remaining funds."] + #[doc = "Propose and approve a spend of treasury 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 = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] + #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] + #[doc = "for assertion using the [`Config::BalanceConverter`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] + #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] + #[doc = "the [`Config::PayoutPeriod`]."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The beneficiary of the spend."] + #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] + #[doc = " the past if the resulting spend has not yet expired according to the"] + #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] + #[doc = " approval."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] + pub struct Spend { + pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[codec(compact)] + pub amount: spend::Amount, + pub beneficiary: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub valid_from: spend::ValidFrom, + } + pub mod spend { + use super::runtime_types; + pub type AssetKind = (); + pub type Amount = ::core::primitive::u128; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type ValidFrom = ::core::option::Option<::core::primitive::u32>; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Spend { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "spend"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Claim a spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed"] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] + #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] + #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] + #[doc = "dispatchable before retrying with the current function."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::Paid`] if successful."] + pub struct Payout { + pub index: payout::Index, + } + pub mod payout { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Payout { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "payout"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Check the status of the spend and remove it from the storage if processed."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "The status check is a prerequisite for retrying a failed payout."] + #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] + #[doc = "function. In such instances, transaction fees are refunded."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] + #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] + pub struct CheckStatus { + pub index: check_status::Index, + } + pub mod check_status { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CheckStatus { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "check_status"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Void previously approved spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "## Details"] + #[doc = ""] + #[doc = "A spend void is only possible if the payout has not been attempted yet."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "## Events"] #[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 = "Emits [`Event::AssetSpendVoided`] if successful."] + pub struct VoidSpend { + pub index: void_spend::Index, } - pub mod delete_airdrop { + pub mod void_spend { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DeleteAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "delete_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VoidSpend { + const PALLET: &'static str = "TreasuryPallet"; + const CALL: &'static str = "void_spend"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Create a new airdrop with a Merkle root."] + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] + #[doc = ""] + #[doc = "### Details"] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] #[doc = ""] - #[doc = "The Merkle root is a cryptographic hash that represents all valid claims"] - #[doc = "for this airdrop. Users will later provide Merkle proofs to verify their"] - #[doc = "eligibility to claim tokens."] + #[doc = "### Parameters"] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "## Events"] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `merkle_root` - The Merkle root hash representing all valid claims"] - #[doc = "* `vesting_period` - Optional vesting period for the airdrop"] - #[doc = "* `vesting_delay` - Optional delay before vesting starts"] - pub fn create_airdrop( + #[doc = "Emits [`Event::SpendApproved`] if successful."] + pub fn spend_local( &self, - merkle_root: types::create_airdrop::MerkleRoot, - vesting_period: types::create_airdrop::VestingPeriod, - vesting_delay: types::create_airdrop::VestingDelay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + amount: types::spend_local::Amount, + beneficiary: types::spend_local::Beneficiary, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "create_airdrop", - types::CreateAirdrop { merkle_root, vesting_period, vesting_delay }, + "TreasuryPallet", + "spend_local", + types::SpendLocal { amount, beneficiary }, [ - 18u8, 201u8, 105u8, 56u8, 66u8, 207u8, 57u8, 177u8, 133u8, 38u8, 185u8, - 19u8, 205u8, 119u8, 177u8, 206u8, 188u8, 88u8, 138u8, 33u8, 246u8, - 179u8, 148u8, 0u8, 79u8, 201u8, 89u8, 229u8, 46u8, 77u8, 42u8, 117u8, + 137u8, 171u8, 83u8, 247u8, 245u8, 212u8, 152u8, 127u8, 210u8, 71u8, + 254u8, 134u8, 189u8, 26u8, 249u8, 41u8, 214u8, 175u8, 24u8, 64u8, 33u8, + 90u8, 23u8, 134u8, 44u8, 110u8, 63u8, 46u8, 46u8, 146u8, 222u8, 79u8, ], ) } - #[doc = "Fund an existing airdrop with tokens."] + #[doc = "Force a previously approved proposal to be removed from the approval queue."] #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = ""] + #[doc = "## Details"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "The original deposit will no longer be returned."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to fund"] - #[doc = "* `amount` - The amount of tokens to add to the airdrop"] + #[doc = "### Parameters"] + #[doc = "- `proposal_id`: The index of a proposal"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "### Complexity"] + #[doc = "- O(A) where `A` is the number of approvals"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - pub fn fund_airdrop( + #[doc = "### Errors"] + #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] + #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] + #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] + #[doc = " in the first place."] + pub fn remove_approval( &self, - airdrop_id: types::fund_airdrop::AirdropId, - amount: types::fund_airdrop::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + proposal_id: types::remove_approval::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "fund_airdrop", - types::FundAirdrop { airdrop_id, amount }, + "TreasuryPallet", + "remove_approval", + types::RemoveApproval { proposal_id }, [ - 11u8, 155u8, 135u8, 152u8, 19u8, 196u8, 79u8, 68u8, 24u8, 46u8, 27u8, - 63u8, 202u8, 242u8, 166u8, 160u8, 81u8, 44u8, 115u8, 247u8, 110u8, - 49u8, 11u8, 204u8, 70u8, 39u8, 7u8, 43u8, 103u8, 78u8, 39u8, 131u8, + 180u8, 20u8, 39u8, 227u8, 29u8, 228u8, 234u8, 36u8, 155u8, 114u8, + 197u8, 135u8, 185u8, 31u8, 56u8, 247u8, 224u8, 168u8, 254u8, 233u8, + 250u8, 134u8, 186u8, 155u8, 108u8, 84u8, 94u8, 226u8, 207u8, 130u8, + 196u8, 100u8, ], ) } - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] + #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] + #[doc = "for assertion using the [`Config::BalanceConverter`]."] #[doc = ""] - #[doc = "Users can claim their tokens by providing a proof of their eligibility."] - #[doc = "The proof is verified against the airdrop's Merkle root."] - #[doc = "Anyone can trigger a claim for any eligible recipient."] + #[doc = "## Details"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] + #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] + #[doc = "the [`Config::PayoutPeriod`]."] #[doc = ""] - #[doc = "* `origin` - The origin of the call"] - #[doc = "* `airdrop_id` - The ID of the airdrop to claim from"] - #[doc = "* `amount` - The amount of tokens to claim"] - #[doc = "* `merkle_proof` - The Merkle proof verifying eligibility"] + #[doc = "### Parameters"] + #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The beneficiary of the spend."] + #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] + #[doc = " the past if the resulting spend has not yet expired according to the"] + #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] + #[doc = " approval."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "## Events"] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `AlreadyClaimed` - If the recipient has already claimed from this airdrop"] - #[doc = "* `InvalidProof` - If the provided Merkle proof is invalid"] - #[doc = "* `InsufficientAirdropBalance` - If the airdrop doesn't have enough tokens"] - pub fn claim( + #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] + pub fn spend( &self, - airdrop_id: types::claim::AirdropId, - recipient: types::claim::Recipient, - amount: types::claim::Amount, - merkle_proof: types::claim::MerkleProof, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + asset_kind: types::spend::AssetKind, + amount: types::spend::Amount, + beneficiary: types::spend::Beneficiary, + valid_from: types::spend::ValidFrom, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "claim", - types::Claim { airdrop_id, recipient, amount, merkle_proof }, + "TreasuryPallet", + "spend", + types::Spend { + asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + asset_kind, + ), + amount, + beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + beneficiary, + ), + valid_from, + }, [ - 137u8, 9u8, 80u8, 195u8, 157u8, 215u8, 158u8, 30u8, 26u8, 104u8, 183u8, - 55u8, 102u8, 100u8, 41u8, 40u8, 26u8, 193u8, 255u8, 95u8, 201u8, 240u8, - 18u8, 253u8, 71u8, 117u8, 88u8, 250u8, 192u8, 67u8, 127u8, 159u8, + 64u8, 121u8, 249u8, 219u8, 22u8, 188u8, 167u8, 85u8, 45u8, 27u8, 200u8, + 219u8, 138u8, 17u8, 230u8, 106u8, 145u8, 39u8, 43u8, 161u8, 69u8, 10u8, + 202u8, 251u8, 127u8, 131u8, 0u8, 194u8, 25u8, 153u8, 169u8, 206u8, ], ) } - #[doc = "Delete an airdrop and reclaim any remaining funds."] + #[doc = "Claim a spend."] #[doc = ""] - #[doc = "This function allows the creator of an airdrop to delete it and reclaim"] - #[doc = "any remaining tokens that haven't been claimed."] + #[doc = "## Dispatch Origin"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Must be signed"] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] + #[doc = "## Details"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] + #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] + #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] + #[doc = "dispatchable before retrying with the current function."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] #[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 = "Emits [`Event::Paid`] if successful."] + pub fn payout( &self, - airdrop_id: types::delete_airdrop::AirdropId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + index: types::payout::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TreasuryPallet", + "payout", + types::Payout { index }, + [ + 179u8, 254u8, 82u8, 94u8, 248u8, 26u8, 6u8, 34u8, 93u8, 244u8, 186u8, + 199u8, 163u8, 32u8, 110u8, 220u8, 78u8, 11u8, 168u8, 182u8, 169u8, + 56u8, 53u8, 194u8, 168u8, 218u8, 131u8, 38u8, 46u8, 156u8, 93u8, 234u8, + ], + ) + } + #[doc = "Check the status of the spend and remove it from the storage if processed."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be signed."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "The status check is a prerequisite for retrying a failed payout."] + #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] + #[doc = "function. In such instances, transaction fees are refunded."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] + #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] + pub fn check_status( + &self, + index: types::check_status::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TreasuryPallet", + "check_status", + types::CheckStatus { index }, + [ + 164u8, 111u8, 10u8, 11u8, 104u8, 237u8, 112u8, 240u8, 104u8, 130u8, + 179u8, 221u8, 54u8, 18u8, 8u8, 172u8, 148u8, 245u8, 110u8, 174u8, 75u8, + 38u8, 46u8, 143u8, 101u8, 232u8, 65u8, 252u8, 36u8, 152u8, 29u8, 209u8, + ], + ) + } + #[doc = "Void previously approved spend."] + #[doc = ""] + #[doc = "## Dispatch Origin"] + #[doc = ""] + #[doc = "Must be [`Config::RejectOrigin`]."] + #[doc = ""] + #[doc = "## Details"] + #[doc = ""] + #[doc = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = ""] + #[doc = "### Parameters"] + #[doc = "- `index`: The spend index."] + #[doc = ""] + #[doc = "## Events"] + #[doc = ""] + #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] + pub fn void_spend( + &self, + index: types::void_spend::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "delete_airdrop", - types::DeleteAirdrop { airdrop_id }, + "TreasuryPallet", + "void_spend", + types::VoidSpend { index }, [ - 34u8, 88u8, 199u8, 36u8, 214u8, 19u8, 124u8, 24u8, 29u8, 222u8, 138u8, - 174u8, 47u8, 199u8, 59u8, 155u8, 118u8, 157u8, 82u8, 96u8, 81u8, 186u8, - 27u8, 96u8, 116u8, 99u8, 185u8, 8u8, 100u8, 34u8, 179u8, 185u8, + 9u8, 212u8, 174u8, 92u8, 43u8, 102u8, 224u8, 124u8, 247u8, 239u8, + 196u8, 68u8, 132u8, 171u8, 116u8, 206u8, 52u8, 23u8, 92u8, 31u8, 156u8, + 160u8, 25u8, 16u8, 125u8, 60u8, 9u8, 109u8, 145u8, 139u8, 102u8, 224u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_merkle_airdrop::pallet::Event; + pub type Event = runtime_types::pallet_treasury::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -14694,25 +14361,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A new airdrop has been created."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, merkle_root]"] - pub struct AirdropCreated { - pub airdrop_id: airdrop_created::AirdropId, - pub airdrop_metadata: airdrop_created::AirdropMetadata, - } - pub mod airdrop_created { + #[doc = "We have ended a spend period and will now allocate funds."] + pub struct Spending { + pub budget_remaining: spending::BudgetRemaining, + } + pub mod spending { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type AirdropMetadata = runtime_types::pallet_merkle_airdrop::AirdropMetadata< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - >; + pub type BudgetRemaining = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropCreated { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropCreated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Spending { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Spending"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14721,21 +14380,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An airdrop has been funded with tokens."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, amount]"] - pub struct AirdropFunded { - pub airdrop_id: airdrop_funded::AirdropId, - pub amount: airdrop_funded::Amount, - } - pub mod airdrop_funded { + #[doc = "Some funds have been allocated."] + pub struct Awarded { + pub proposal_index: awarded::ProposalIndex, + pub award: awarded::Award, + pub account: awarded::Account, + } + pub mod awarded { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Amount = ::core::primitive::u128; + pub type ProposalIndex = ::core::primitive::u32; + pub type Award = ::core::primitive::u128; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropFunded { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropFunded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Awarded { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Awarded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14744,23 +14403,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A user has claimed tokens from an airdrop."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, account, amount]"] - pub struct Claimed { - pub airdrop_id: claimed::AirdropId, - pub account: claimed::Account, - pub amount: claimed::Amount, - } - pub mod claimed { + #[doc = "Some of our funds have been burnt."] + pub struct Burnt { + pub burnt_funds: burnt::BurntFunds, + } + pub mod burnt { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type BurntFunds = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Claimed { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "Claimed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Burnt { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Burnt"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14769,415 +14422,585 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An airdrop has been deleted."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id]"] - pub struct AirdropDeleted { - pub airdrop_id: airdrop_deleted::AirdropId, + #[doc = "Spending has finished; this is the amount that rolls over until next spend."] + pub struct Rollover { + pub rollover_balance: rollover::RolloverBalance, } - pub mod airdrop_deleted { + pub mod rollover { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; + pub type RolloverBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropDeleted { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropDeleted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Rollover { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Rollover"; } - } - pub mod storage { - use super::runtime_types; - pub mod types { + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Some funds have been deposited."] + pub struct Deposit { + pub value: deposit::Value, + } + pub mod deposit { use super::runtime_types; - pub mod airdrop_info { - use super::runtime_types; - pub type AirdropInfo = runtime_types::pallet_merkle_airdrop::AirdropMetadata< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod claimed { - use super::runtime_types; - pub type Claimed = (); - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod next_airdrop_id { - use super::runtime_types; - pub type NextAirdropId = ::core::primitive::u32; - } + pub type Value = ::core::primitive::u128; } - pub struct StorageApi; - impl StorageApi { - #[doc = " Stores general info about an airdrop"] - pub fn airdrop_info_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::airdrop_info::AirdropInfo, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "AirdropInfo", - (), - [ - 38u8, 176u8, 25u8, 251u8, 80u8, 201u8, 118u8, 175u8, 89u8, 80u8, 227u8, - 241u8, 250u8, 0u8, 112u8, 71u8, 133u8, 50u8, 137u8, 13u8, 255u8, 24u8, - 253u8, 237u8, 195u8, 1u8, 192u8, 177u8, 167u8, 248u8, 11u8, 160u8, - ], - ) - } - #[doc = " Stores general info about an airdrop"] - pub fn airdrop_info( - &self, - _0: types::airdrop_info::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::airdrop_info::Param0, - >, - types::airdrop_info::AirdropInfo, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "AirdropInfo", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 38u8, 176u8, 25u8, 251u8, 80u8, 201u8, 118u8, 175u8, 89u8, 80u8, 227u8, - 241u8, 250u8, 0u8, 112u8, 71u8, 133u8, 50u8, 137u8, 13u8, 255u8, 24u8, - 253u8, 237u8, 195u8, 1u8, 192u8, 177u8, 167u8, 248u8, 11u8, 160u8, - ], - ) - } - #[doc = " Storage for claimed status"] - pub fn claimed_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::claimed::Claimed, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", - (), - [ - 214u8, 178u8, 109u8, 48u8, 230u8, 120u8, 107u8, 211u8, 179u8, 251u8, - 164u8, 29u8, 197u8, 154u8, 160u8, 230u8, 112u8, 212u8, 14u8, 157u8, - 248u8, 207u8, 101u8, 159u8, 203u8, 82u8, 199u8, 102u8, 99u8, 239u8, - 162u8, 10u8, - ], - ) - } - #[doc = " Storage for claimed status"] - pub fn claimed_iter1( - &self, - _0: types::claimed::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param0, - >, - types::claimed::Claimed, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 214u8, 178u8, 109u8, 48u8, 230u8, 120u8, 107u8, 211u8, 179u8, 251u8, - 164u8, 29u8, 197u8, 154u8, 160u8, 230u8, 112u8, 212u8, 14u8, 157u8, - 248u8, 207u8, 101u8, 159u8, 203u8, 82u8, 199u8, 102u8, 99u8, 239u8, - 162u8, 10u8, - ], - ) - } - #[doc = " Storage for claimed status"] - pub fn claimed( - &self, - _0: types::claimed::Param0, - _1: types::claimed::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param1, - >, - ), - types::claimed::Claimed, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 214u8, 178u8, 109u8, 48u8, 230u8, 120u8, 107u8, 211u8, 179u8, 251u8, - 164u8, 29u8, 197u8, 154u8, 160u8, 230u8, 112u8, 212u8, 14u8, 157u8, - 248u8, 207u8, 101u8, 159u8, 203u8, 82u8, 199u8, 102u8, 99u8, 239u8, - 162u8, 10u8, - ], - ) - } - #[doc = " Counter for airdrop IDs"] - pub fn next_airdrop_id( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_airdrop_id::NextAirdropId, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "NextAirdropId", - (), - [ - 79u8, 145u8, 145u8, 158u8, 86u8, 58u8, 102u8, 216u8, 133u8, 34u8, - 252u8, 224u8, 222u8, 51u8, 170u8, 3u8, 135u8, 29u8, 99u8, 143u8, 93u8, - 176u8, 69u8, 231u8, 74u8, 214u8, 94u8, 126u8, 227u8, 166u8, 242u8, - 98u8, - ], - ) - } + impl ::subxt::ext::subxt_core::events::StaticEvent for Deposit { + const PALLET: &'static str = "TreasuryPallet"; + const EVENT: &'static str = "Deposit"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 constants { + pub mod storage { use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The maximum number of proof elements allowed in a Merkle proof."] - pub fn max_proofs( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "MaxProofs", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) + pub mod types { + use super::runtime_types; + pub mod proposal_count { + use super::runtime_types; + pub type ProposalCount = ::core::primitive::u32; } - #[doc = " The pallet id, used for deriving its sovereign account ID."] - pub fn pallet_id( + 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; + } + pub mod deactivated { + use super::runtime_types; + pub type Deactivated = ::core::primitive::u128; + } + pub mod approvals { + use super::runtime_types; + pub type Approvals = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; + } + pub mod spend_count { + use super::runtime_types; + 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 = " 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::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, + ) -> ::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::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "PalletId", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "ProposalCount", + (), [ - 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, + 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 = " Priority for unsigned claim transactions."] - pub fn unsigned_claim_priority( + #[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::constants::address::StaticAddress< - ::core::primitive::u64, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::proposals::Proposals, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "UnsignedClaimPriority", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "Proposals", + (), [ - 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, + 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, ], ) } - } - } - } - pub mod treasury_pallet { - use super::{root_mod, runtime_types}; - #[doc = "Error for the treasury pallet."] - pub type Error = runtime_types::pallet_treasury::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_treasury::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] - #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] - #[doc = ""] - #[doc = "## Events"] + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub struct SpendLocal { - #[codec(compact)] - pub amount: spend_local::Amount, - pub beneficiary: spend_local::Beneficiary, + #[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, + ], + ) } - pub mod spend_local { - use super::runtime_types; - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, + #[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", (), - >; - } - 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, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force a previously approved proposal to be removed from the approval queue."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The original deposit will no longer be returned."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] - #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] - #[doc = ""] - #[doc = "### Errors"] - #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] - #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] - #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] - #[doc = " in the first place."] - pub struct RemoveApproval { - #[codec(compact)] - pub proposal_id: remove_approval::ProposalId, - } - pub mod remove_approval { - use super::runtime_types; - pub type ProposalId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveApproval { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "remove_approval"; + [ + 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, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] - #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] - #[doc = "for assertion using the [`Config::BalanceConverter`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] - #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] - #[doc = "the [`Config::PayoutPeriod`]."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The beneficiary of the spend."] - #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] - #[doc = " the past if the resulting spend has not yet expired according to the"] - #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] - #[doc = " approval."] - #[doc = ""] - #[doc = "## Events"] + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub struct Spend { - pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, - #[codec(compact)] - pub amount: spend::Amount, - pub beneficiary: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub valid_from: spend::ValidFrom, - } - pub mod spend { - use super::runtime_types; - pub type AssetKind = (); - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, + #[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", (), - >; - pub type ValidFrom = ::core::option::Option<::core::primitive::u32>; + [ + 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, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Spend { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "spend"; + #[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, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + #[doc = " Spends that have been approved and being processed."] + pub fn spends_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::spends::Spends, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "Spends", + (), + [ + 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, + 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, + 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, + 168u8, + ], + ) + } + #[doc = " Spends that have been approved and being processed."] + pub fn spends( + &self, + _0: types::spends::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::spends::Param0, + >, + types::spends::Spends, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "Spends", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, + 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, + 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, + 168u8, + ], + ) + } + #[doc = " The blocknumber for the last triggered spend period."] + pub fn last_spend_period( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::last_spend_period::LastSpendPeriod, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TreasuryPallet", + "LastSpendPeriod", + (), + [ + 6u8, 200u8, 107u8, 132u8, 60u8, 31u8, 24u8, 196u8, 108u8, 227u8, 5u8, + 63u8, 249u8, 139u8, 82u8, 140u8, 169u8, 242u8, 118u8, 93u8, 83u8, + 155u8, 120u8, 175u8, 224u8, 227u8, 39u8, 39u8, 255u8, 247u8, 79u8, + 30u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Period between successive spends."] + pub fn spend_period( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "SpendPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] + pub fn burn( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "Burn", + [ + 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, + 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, + 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, + ], + ) + } + #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] + pub fn pallet_id( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::frame_support::PalletId, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "PalletId", + [ + 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, + 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, + 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, + ], + ) + } + #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] + #[doc = " Refer to for migration to `spend`."] + #[doc = ""] + #[doc = " The maximum number of approvals that can wait in the spending queue."] + #[doc = ""] + #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] + pub fn max_approvals( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "MaxApprovals", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The period during which an approved treasury spend has to be claimed."] + pub fn payout_period( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "PayoutPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Gets this pallet's derived pot account."] + pub fn pot_account( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TreasuryPallet", + "pot_account", + [ + 115u8, 233u8, 13u8, 223u8, 88u8, 20u8, 202u8, 139u8, 153u8, 28u8, + 155u8, 157u8, 224u8, 66u8, 3u8, 250u8, 23u8, 53u8, 88u8, 168u8, 211u8, + 204u8, 122u8, 166u8, 248u8, 23u8, 174u8, 225u8, 99u8, 108u8, 89u8, + 135u8, + ], + ) + } + } + } + } + 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, Debug, )] @@ -15187,35 +15010,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 = ""] - #[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 = "Send a call through a recovered account."] #[doc = ""] - #[doc = "## Events"] + #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] + #[doc = "be able to make calls on behalf of the recovered account."] #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub struct Payout { - pub index: payout::Index, + #[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 payout { + pub mod as_recovered { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - 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 AsRecovered { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "as_recovered"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -15228,35 +15045,32 @@ 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 = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] #[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 = "The dispatch origin for this call must be _ROOT_."] #[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, + #[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 check_status { + pub mod set_recovered { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CheckStatus { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "check_status"; + 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, @@ -15269,263 +15083,587 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Void previously approved spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] + #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] + #[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 = "## Details"] + #[doc = "The dispatch origin for this call must be _Signed_."] #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = "Parameters:"] + #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] + #[doc = " ordered and contain no duplicate values."] + #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] + #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] + #[doc = " friends."] + #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] + #[doc = " needs to pass before the account can be recovered."] + pub struct CreateRecovery { + pub friends: create_recovery::Friends, + pub threshold: create_recovery::Threshold, + pub delay_period: create_recovery::DelayPeriod, + } + pub mod create_recovery { + use super::runtime_types; + pub type Friends = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Threshold = ::core::primitive::u16; + pub type DelayPeriod = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "create_recovery"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Initiate the process for recovering a recoverable account."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[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 = "## Events"] + #[doc = "The dispatch origin for this call must be _Signed_."] #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - pub struct VoidSpend { - pub index: void_spend::Index, + #[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 void_spend { + pub mod initiate_recovery { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VoidSpend { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "void_spend"; + 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 = "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 = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] + #[doc = "process for that account."] #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable account."] #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] + #[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 = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] + #[doc = "The combination of these two parameters must point to an active recovery"] + #[doc = "process."] + pub struct VouchRecovery { + pub lost: vouch_recovery::Lost, + pub rescuer: vouch_recovery::Rescuer, + } + pub mod vouch_recovery { + use super::runtime_types; + pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VouchRecovery { + const PALLET: &'static str = "Recovery"; + const CALL: &'static str = "vouch_recovery"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Allow a successful rescuer to claim their recovered account."] #[doc = ""] - #[doc = "## Events"] + #[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 = "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 = "Parameters:"] + #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] + #[doc = " you."] + pub struct ClaimRecovery { + pub account: claim_recovery::Account, } - #[doc = "Force a previously approved proposal to be removed from the approval queue."] + 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 = "## Dispatch Origin"] + #[doc = "Payment: By calling this function, the recoverable account will receive"] + #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] + #[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 = "## Details"] + #[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 = "The original deposit will no longer be returned."] + #[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 = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] + #[doc = "Payment: By calling this function the recoverable account will unreserve"] + #[doc = "their recovery configuration deposit."] + #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] + #[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 = "### 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 = "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, } - #[doc = "Propose and approve a spend of treasury funds."] + 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 = "## Dispatch Origin"] + #[doc = "This can be used by accounts to possibly lower their locked amount."] #[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 = "The dispatch origin for this call must be _Signed_."] #[doc = ""] - #[doc = "## Details"] + #[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 = "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 = "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 = "### 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 = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] + #[doc = "account."] #[doc = ""] - #[doc = "## Events"] + #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub fn spend( + #[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 = "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, - 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 { + 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( - "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, + "Recovery", + "as_recovered", + types::AsRecovered { + account, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 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, + 72u8, 161u8, 33u8, 183u8, 142u8, 112u8, 117u8, 152u8, 90u8, 54u8, + 115u8, 156u8, 247u8, 97u8, 58u8, 195u8, 155u8, 17u8, 146u8, 3u8, 109u8, + 179u8, 117u8, 224u8, 192u8, 39u8, 58u8, 215u8, 24u8, 77u8, 154u8, 80u8, ], ) } - #[doc = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] - #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] - #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] - #[doc = "dispatchable before retrying with the current function."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[doc = "Allow ROOT to bypass the recovery process and set a rescuer account"] + #[doc = "for a lost account directly."] #[doc = ""] - #[doc = "## Events"] + #[doc = "The dispatch origin for this call must be _ROOT_."] #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub fn payout( + #[doc = "Parameters:"] + #[doc = "- `lost`: The \"lost account\" to be recovered."] + #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] + pub fn set_recovered( &self, - index: types::payout::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + lost: types::set_recovered::Lost, + rescuer: types::set_recovered::Rescuer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "payout", - types::Payout { index }, + "Recovery", + "set_recovered", + types::SetRecovered { lost, rescuer }, [ - 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, + 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 = "Check the status of the spend and remove it from the storage if processed."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The status check is a prerequisite for retrying a failed payout."] - #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] - #[doc = "function. In such instances, transaction fees are refunded."] + #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[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 = "## Events"] + #[doc = "The dispatch origin for this call must be _Signed_."] #[doc = ""] - #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] - #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] - pub fn check_status( + #[doc = "Parameters:"] + #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] + #[doc = " ordered and contain no duplicate values."] + #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] + #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] + #[doc = " friends."] + #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] + #[doc = " needs to pass before the account can be recovered."] + pub fn create_recovery( &self, - index: types::check_status::Index, - ) -> ::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( - "TreasuryPallet", - "check_status", - types::CheckStatus { index }, + "Recovery", + "create_recovery", + types::CreateRecovery { friends, threshold, delay_period }, [ - 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, + 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 = "Void previously approved spend."] + #[doc = "Initiate the process for recovering a recoverable account."] #[doc = ""] - #[doc = "## Dispatch Origin"] + #[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 = "Must be [`Config::RejectOrigin`]."] + #[doc = "The dispatch origin for this call must be _Signed_."] #[doc = ""] - #[doc = "## Details"] + #[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 = "A spend void is only possible if the payout has not been attempted yet."] + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] + #[doc = "for the recoverable account."] #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] + #[doc = "Parameters:"] + #[doc = "- `lost`: The lost account that you want to recover."] + #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] #[doc = ""] - #[doc = "## Events"] + #[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 = "Emits [`Event::AssetSpendVoided`] if successful."] - pub fn void_spend( + #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"rescuer\""] + #[doc = "who has successfully completed the account recovery process: collected"] + #[doc = "`threshold` or more vouches, waited `delay_period` blocks since initiation."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] + #[doc = " you."] + pub fn claim_recovery( &self, - index: types::void_spend::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + account: types::claim_recovery::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "void_spend", - types::VoidSpend { index }, + "Recovery", + "claim_recovery", + types::ClaimRecovery { account }, [ - 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, + 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 = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_treasury::pallet::Event; + #[doc = "Events type."] + pub type Event = runtime_types::pallet_recovery::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -15535,17 +15673,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 = "We have ended a spend period and will now allocate funds."] - pub struct Spending { - pub budget_remaining: spending::BudgetRemaining, + #[doc = "A recovery process has been set up for an account."] + pub struct RecoveryCreated { + pub account: recovery_created::Account, } - pub mod spending { + pub mod recovery_created { use super::runtime_types; - pub type BudgetRemaining = ::core::primitive::u128; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Spending { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Spending"; + 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, @@ -15554,21 +15692,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 funds have been allocated."] - pub struct Awarded { - pub proposal_index: awarded::ProposalIndex, - pub award: awarded::Award, - pub account: awarded::Account, + #[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 awarded { + pub mod recovery_initiated { 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; + 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 Awarded { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Awarded"; + 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, @@ -15577,128 +15713,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 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, + #[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 asset_spend_approved { + pub mod recovery_vouched { 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; + 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 AssetSpendApproved { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "AssetSpendApproved"; + 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, @@ -15707,17 +15736,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 approved spend was voided."] - pub struct AssetSpendVoided { - pub index: asset_spend_voided::Index, + #[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 asset_spend_voided { + pub mod recovery_closed { use super::runtime_types; - pub type Index = ::core::primitive::u32; + 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 AssetSpendVoided { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "AssetSpendVoided"; + 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, @@ -15726,19 +15757,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 payment happened."] - pub struct Paid { - pub index: paid::Index, - pub payment_id: paid::PaymentId, + #[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 paid { + pub mod account_recovered { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type PaymentId = ::core::primitive::u32; + 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 Paid { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Paid"; + 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, @@ -15747,19 +15778,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 payment failed and can be retried."] - pub struct PaymentFailed { - pub index: payment_failed::Index, - pub payment_id: payment_failed::PaymentId, + #[doc = "A recovery process has been removed for an account."] + pub struct RecoveryRemoved { + pub lost_account: recovery_removed::LostAccount, } - pub mod payment_failed { + pub mod recovery_removed { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type PaymentId = ::core::primitive::u32; + pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for PaymentFailed { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "PaymentFailed"; + 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, @@ -15768,280 +15797,243 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "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, + #[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 spend_processed { + pub mod deposit_poked { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type 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 SpendProcessed { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "SpendProcessed"; + 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 proposal_count { - use super::runtime_types; - pub type ProposalCount = ::core::primitive::u32; - } - pub mod proposals { + pub mod recoverable { use super::runtime_types; - pub type Proposals = runtime_types::pallet_treasury::Proposal< - ::subxt::ext::subxt_core::utils::AccountId32, + pub type Recoverable = runtime_types::pallet_recovery::RecoveryConfig< + ::core::primitive::u32, ::core::primitive::u128, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod deactivated { - use super::runtime_types; - pub type Deactivated = ::core::primitive::u128; - } - pub mod approvals { - use super::runtime_types; - pub type Approvals = runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; - } - pub mod spend_count { - use super::runtime_types; - pub type SpendCount = ::core::primitive::u32; + ::subxt::ext::subxt_core::utils::AccountId32, + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod spends { + pub mod active_recoveries { use super::runtime_types; - pub type Spends = runtime_types::pallet_treasury::SpendStatus< - (), - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::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 = ::core::primitive::u32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod last_spend_period { + pub mod proxy { use super::runtime_types; - pub type LastSpendPeriod = ::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 = " 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::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 = ""] - #[doc = " Proposals that have been made."] - pub fn proposals_iter( + #[doc = " The set of recoverable accounts and their recovery configuration."] + pub fn recoverable_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::proposals::Proposals, + types::recoverable::Recoverable, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Proposals", + "Recovery", + "Recoverable", (), [ - 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, + 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 = " 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( + #[doc = " The set of recoverable accounts and their recovery configuration."] + pub fn recoverable( &self, - _0: types::proposals::Param0, + _0: types::recoverable::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proposals::Param0, + types::recoverable::Param0, >, - types::proposals::Proposals, + types::recoverable::Recoverable, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Proposals", + "Recovery", + "Recoverable", ::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, + 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, + 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, + 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, ], ) } - #[doc = " The amount which has been reported as inactive to Currency."] - pub fn deactivated( + #[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::deactivated::Deactivated, - ::subxt::ext::subxt_core::utils::Yes, - ::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( - "TreasuryPallet", - "Deactivated", + "Recovery", + "ActiveRecoveries", (), [ - 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, + 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 = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] + #[doc = " Active recovery attempts."] #[doc = ""] - #[doc = " Proposal indices that have been approved but not yet awarded."] - pub fn approvals( + #[doc = " First account is the account to be recovered, and the second account"] + #[doc = " is the user trying to recover the account."] + pub fn active_recoveries_iter1( &self, + _0: types::active_recoveries::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::active_recoveries::Param0, + >, + types::active_recoveries::ActiveRecoveries, (), - types::approvals::Approvals, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Approvals", - (), + "Recovery", + "ActiveRecoveries", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, + 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, + 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, + 91u8, 123u8, ], ) } - #[doc = " The count of spends that have been made."] - pub fn spend_count( + #[doc = " Active recovery attempts."] + #[doc = ""] + #[doc = " First account is the account to be recovered, and the second account"] + #[doc = " is the user trying to recover the account."] + pub fn active_recoveries( &self, + _0: types::active_recoveries::Param0, + _1: types::active_recoveries::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::spend_count::SpendCount, - ::subxt::ext::subxt_core::utils::Yes, + ( + ::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( - "TreasuryPallet", - "SpendCount", - (), + "Recovery", + "ActiveRecoveries", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 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, + 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 = " Spends that have been approved and being processed."] - pub fn spends_iter( + #[doc = " The list of allowed proxy accounts."] + #[doc = ""] + #[doc = " Map from the user who can access it to the recovered account."] + pub fn proxy_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::spends::Spends, + types::proxy::Proxy, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Spends", + "Recovery", + "Proxy", (), [ - 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, + 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 = " Spends that have been approved and being processed."] - pub fn spends( + #[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::spends::Param0, + _0: types::proxy::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::spends::Param0, + types::proxy::Param0, >, - types::spends::Spends, + types::proxy::Proxy, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Spends", + "Recovery", + "Proxy", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, - 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, - 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, - 168u8, - ], - ) - } - #[doc = " The blocknumber for the last triggered spend period."] - pub fn last_spend_period( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::last_spend_period::LastSpendPeriod, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "LastSpendPeriod", - (), - [ - 6u8, 200u8, 107u8, 132u8, 60u8, 31u8, 24u8, 196u8, 108u8, 227u8, 5u8, - 63u8, 249u8, 139u8, 82u8, 140u8, 169u8, 242u8, 118u8, 93u8, 83u8, - 155u8, 120u8, 175u8, 224u8, 227u8, 39u8, 39u8, 255u8, 247u8, 79u8, - 30u8, + 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, ], ) } @@ -16051,86 +16043,59 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " Period between successive spends."] - pub fn spend_period( + #[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( - "TreasuryPallet", - "SpendPeriod", + "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 = " 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 = " The amount of currency needed per additional user when creating a recovery"] + #[doc = " configuration."] #[doc = ""] - #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] - pub fn max_approvals( + #[doc = " This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage"] + #[doc = " value."] + pub fn friend_deposit_factor( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "MaxApprovals", + "Recovery", + "FriendDepositFactor", [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } - #[doc = " The period during which an approved treasury spend has to be claimed."] - pub fn payout_period( + #[doc = " The maximum amount of friends allowed in a recovery configuration."] + #[doc = ""] + #[doc = " NOTE: The threshold programmed in this Pallet uses u16, so it does"] + #[doc = " not really make sense to have a limit here greater than u16::MAX."] + #[doc = " But also, that is a lot more than you should probably set this value"] + #[doc = " to anyway..."] + pub fn max_friends( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "PayoutPeriod", + "Recovery", + "MaxFriends", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -16139,35 +16104,37 @@ pub mod api { ], ) } - #[doc = " Gets this pallet's derived pot account."] - pub fn pot_account( + #[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< - ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "pot_account", + "Recovery", + "RecoveryDeposit", [ - 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, + 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 origins { - use super::{root_mod, runtime_types}; - } - pub mod recovery { + pub mod assets { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_recovery::pallet::Error; + pub type Error = runtime_types::pallet_assets::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_recovery::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; @@ -16184,29 +16151,43 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a call through a recovered account."] + #[doc = "Issue a new class of fungible assets from a public origin."] #[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 = "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 = "- `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 = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] + #[doc = "member of the asset class's admin team."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `Created` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct Create { + #[codec(compact)] + pub id: create::Id, + pub admin: create::Admin, + pub min_balance: create::MinBalance, } - pub mod as_recovered { + pub mod create { use super::runtime_types; - pub type Account = ::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 Call = runtime_types::quantus_runtime::RuntimeCall; + pub type MinBalance = ::core::primitive::u128; } - 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 Create { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "create"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16219,32 +16200,46 @@ 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 = "Issue a new class of fungible assets from a privileged origin."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _ROOT_."] + #[doc = "This new asset class has no assets initially."] #[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 = "The origin must conform to `ForceOrigin`."] + #[doc = ""] + #[doc = "Unlike `create`, no funds are reserved."] + #[doc = ""] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] + #[doc = "over this asset, but may later change and configure the permissions using"] + #[doc = "`transfer_ownership` and `set_team`."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `ForceCreated` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceCreate { + #[codec(compact)] + pub id: force_create::Id, + pub owner: force_create::Owner, + pub is_sufficient: force_create::IsSufficient, + #[codec(compact)] + pub min_balance: force_create::MinBalance, } - pub mod set_recovered { + pub mod force_create { use super::runtime_types; - pub type Lost = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type 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 SetRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "set_recovered"; + 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, @@ -16257,38 +16252,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Create a recovery configuration for your account. This makes your account recoverable."] + #[doc = "Start the process of destroying a fungible asset class."] #[doc = ""] - #[doc = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] - #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] - #[doc = "in full when the user calls `remove_recovery`."] + #[doc = "`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 dispatch origin for this call must be _Signed_."] + #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] - #[doc = " ordered and contain no duplicate values."] - #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] - #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] - #[doc = " friends."] - #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] - #[doc = " needs to pass before the account can be recovered."] - pub struct CreateRecovery { - pub friends: create_recovery::Friends, - pub threshold: create_recovery::Threshold, - pub delay_period: create_recovery::DelayPeriod, + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "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 create_recovery { + pub mod start_destroy { use super::runtime_types; - pub type Friends = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Threshold = ::core::primitive::u16; - pub type DelayPeriod = ::core::primitive::u32; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "create_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for StartDestroy { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "start_destroy"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16301,30 +16287,29 @@ 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 = "Destroy all accounts associated with a given 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 = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] #[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 be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each call emits the `Event::DestroyedAccounts` event."] + pub struct DestroyAccounts { + #[codec(compact)] + pub id: destroy_accounts::Id, } - pub mod initiate_recovery { + pub mod destroy_accounts { 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 DestroyAccounts { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "destroy_accounts"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16337,36 +16322,29 @@ 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 = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] - #[doc = "for the recoverable account."] + #[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 = "- `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 = "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 = "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 = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] + #[doc = ""] + #[doc = "Each call emits the `Event::DestroyedApprovals` event."] + pub struct DestroyApprovals { + #[codec(compact)] + pub id: destroy_approvals::Id, } - pub mod vouch_recovery { + pub mod destroy_approvals { 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 VouchRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "vouch_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyApprovals { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "destroy_approvals"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16379,28 +16357,27 @@ 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 = "Complete destroying asset and unreserve currency."] #[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 = "`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 = "Parameters:"] - #[doc = "- `account`: The lost account that you want to claim has been successfully recovered by"] - #[doc = " you."] - pub struct ClaimRecovery { - pub account: claim_recovery::Account, + #[doc = "- `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 struct FinishDestroy { + #[codec(compact)] + pub id: finish_destroy::Id, } - pub mod claim_recovery { + pub mod finish_destroy { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; + pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClaimRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "claim_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FinishDestroy { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "finish_destroy"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16413,30 +16390,37 @@ 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 = "Mint assets of a particular class."] #[doc = ""] - #[doc = "Payment: By calling this function, the recoverable account will receive"] - #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account with an active recovery process for it."] + #[doc = "- `id`: The identifier of the asset 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 = "Parameters:"] - #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] - pub struct CloseRecovery { - pub rescuer: close_recovery::Rescuer, + #[doc = "Emits `Issued` event when successful."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] + pub struct Mint { + #[codec(compact)] + pub id: mint::Id, + pub beneficiary: mint::Beneficiary, + #[codec(compact)] + pub amount: mint::Amount, } - pub mod close_recovery { + pub mod mint { use super::runtime_types; - pub type Rescuer = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CloseRecovery { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "close_recovery"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Mint { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "mint"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -16449,21 +16433,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 = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] #[doc = ""] - #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] - #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = "Origin must be Signed and the sender should be the Manager 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 = "Bails with `NoAccount` if the `who` is already dead."] #[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 to have some amount burned."] + #[doc = "- `who`: The account to be debited from."] + #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = ""] + #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] + #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] + pub struct Burn { + #[codec(compact)] + pub id: burn::Id, + pub who: burn::Who, + #[codec(compact)] + pub amount: burn::Amount, + } + pub mod 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, @@ -16476,26 +16479,43 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = "Move some assets from the sender account to another."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "Origin must be Signed."] #[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 = "- `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 struct Transfer { + #[codec(compact)] + pub id: transfer::Id, + pub target: transfer::Target, + #[codec(compact)] + pub amount: transfer::Amount, } - pub mod cancel_recovered { + pub mod transfer { use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Id = ::core::primitive::u32; + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRecovered { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "cancel_recovered"; + 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, @@ -16508,813 +16528,491 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Poke deposits for recovery configurations and / or active recoveries."] - #[doc = ""] - #[doc = "This can be used by accounts to possibly lower their locked amount."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `maybe_account`: Optional recoverable account for which you have an active recovery"] - #[doc = "and want to adjust the deposit for the active recovery."] + #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] #[doc = ""] - #[doc = "This function checks both recovery configuration deposit and active recovery deposits"] - #[doc = "of the caller:"] - #[doc = "- If the caller has created a recovery configuration, checks and adjusts its deposit"] - #[doc = "- If the caller has initiated any active recoveries, and provides the account in"] - #[doc = "`maybe_account`, checks and adjusts those deposits"] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] - #[doc = "account."] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[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 `DepositPoked` if any deposit is updated."] - #[doc = "Multiple events may be emitted in case both types of deposits are updated."] - pub struct PokeDeposit { - pub maybe_account: poke_deposit::MaybeAccount, + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub struct TransferKeepAlive { + #[codec(compact)] + pub id: transfer_keep_alive::Id, + pub target: transfer_keep_alive::Target, + #[codec(compact)] + pub amount: transfer_keep_alive::Amount, } - pub mod poke_deposit { + pub mod transfer_keep_alive { 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 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 PokeDeposit { - const PALLET: &'static str = "Recovery"; - const CALL: &'static str = "poke_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer_keep_alive"; } - } - 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 = "Move some assets from one account to another."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you 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 = "- `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 = "The dispatch origin for this call must be _ROOT_."] + #[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 = "- `lost`: The \"lost account\" to be recovered."] - #[doc = "- `rescuer`: The \"rescuer account\" which can call as the lost account."] - pub fn set_recovered( - &self, - lost: types::set_recovered::Lost, - rescuer: types::set_recovered::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "set_recovered", - types::SetRecovered { lost, rescuer }, - [ - 194u8, 147u8, 14u8, 197u8, 132u8, 185u8, 122u8, 81u8, 61u8, 14u8, 10u8, - 177u8, 74u8, 184u8, 150u8, 217u8, 246u8, 149u8, 26u8, 165u8, 196u8, - 83u8, 230u8, 195u8, 213u8, 40u8, 51u8, 180u8, 23u8, 90u8, 3u8, 14u8, - ], - ) + #[doc = "Weight: `O(1)`"] + #[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 = "Create a recovery configuration for your account. This makes your account recoverable."] + 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 = "Payment: `ConfigDepositBase` + `FriendDepositFactor` * #_of_friends balance"] - #[doc = "will be reserved for storing the recovery configuration. This deposit is returned"] - #[doc = "in full when the user calls `remove_recovery`."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be frozen."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `friends`: A list of friends you trust to vouch for recovery attempts. Should be"] - #[doc = " ordered and contain no duplicate values."] - #[doc = "- `threshold`: The number of friends that must vouch for a recovery attempt before the"] - #[doc = " account can be recovered. Should be less than or equal to the length of the list of"] - #[doc = " friends."] - #[doc = "- `delay_period`: The number of blocks after a recovery attempt is initialized that"] - #[doc = " needs to pass before the account can be recovered."] - pub fn create_recovery( - &self, - friends: types::create_recovery::Friends, - threshold: types::create_recovery::Threshold, - delay_period: types::create_recovery::DelayPeriod, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "create_recovery", - types::CreateRecovery { friends, threshold, delay_period }, - [ - 36u8, 175u8, 11u8, 85u8, 95u8, 170u8, 58u8, 193u8, 102u8, 18u8, 117u8, - 27u8, 199u8, 214u8, 70u8, 47u8, 129u8, 130u8, 109u8, 242u8, 240u8, - 255u8, 120u8, 176u8, 40u8, 243u8, 175u8, 71u8, 3u8, 91u8, 186u8, 220u8, - ], - ) + #[doc = "Emits `Frozen`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct Freeze { + #[codec(compact)] + pub id: freeze::Id, + pub who: freeze::Who, } - #[doc = "Initiate the process for recovering a recoverable account."] + 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 = "Payment: `RecoveryDeposit` balance will be reserved for initiating the"] - #[doc = "recovery process. This deposit will always be repatriated to the account"] - #[doc = "trying to be recovered. See `close_recovery`."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be unfrozen."] #[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 `Thawed`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct Thaw { + #[codec(compact)] + pub id: thaw::Id, + pub who: thaw::Who, } - #[doc = "Allow a \"friend\" of a recoverable account to vouch for an active recovery"] - #[doc = "process for that account."] + 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 = "The dispatch origin for this call must be _Signed_ and must be a \"friend\""] - #[doc = "for the recoverable account."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `lost`: The lost account that you want to recover."] - #[doc = "- `rescuer`: The account trying to rescue the lost account that you want to vouch for."] + #[doc = "- `id`: The identifier of the asset to be frozen."] #[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 = "Emits `Frozen`."] #[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 = "Weight: `O(1)`"] + pub struct FreezeAsset { + #[codec(compact)] + pub id: freeze_asset::Id, } - #[doc = "As the controller of a recoverable account, close an active recovery"] - #[doc = "process for your account."] + pub mod freeze_asset { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FreezeAsset { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "freeze_asset"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Allow unprivileged transfers for the asset again."] #[doc = ""] - #[doc = "Payment: By calling this function, the recoverable account will receive"] - #[doc = "the recovery deposit `RecoveryDeposit` placed by the rescuer."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account with an active recovery process for it."] + #[doc = "- `id`: The identifier of the asset to be thawed."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `rescuer`: The account trying to rescue this recoverable account."] - pub fn close_recovery( - &self, - rescuer: types::close_recovery::Rescuer, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "close_recovery", - types::CloseRecovery { rescuer }, - [ - 161u8, 178u8, 117u8, 209u8, 119u8, 164u8, 135u8, 41u8, 25u8, 108u8, - 194u8, 175u8, 221u8, 65u8, 184u8, 137u8, 171u8, 97u8, 204u8, 61u8, - 159u8, 39u8, 192u8, 53u8, 246u8, 69u8, 113u8, 16u8, 170u8, 232u8, - 163u8, 10u8, - ], - ) - } - #[doc = "Remove the recovery process for your account. Recovered accounts are still accessible."] + #[doc = "Emits `Thawed`."] #[doc = ""] - #[doc = "NOTE: The user must make sure to call `close_recovery` on all active"] - #[doc = "recovery attempts before calling this function else it will fail."] + #[doc = "Weight: `O(1)`"] + pub struct 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"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Change the Owner of an asset."] #[doc = ""] - #[doc = "Payment: By calling this function the recoverable account will unreserve"] - #[doc = "their recovery configuration deposit."] - #[doc = "(`ConfigDepositBase` + `FriendDepositFactor` * #_of_friends)"] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and must be a"] - #[doc = "recoverable account (i.e. has a recovery configuration)."] - pub fn remove_recovery( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "remove_recovery", - types::RemoveRecovery {}, - [ - 11u8, 38u8, 133u8, 172u8, 212u8, 252u8, 57u8, 216u8, 42u8, 202u8, - 206u8, 91u8, 115u8, 91u8, 242u8, 123u8, 95u8, 196u8, 172u8, 243u8, - 164u8, 1u8, 69u8, 180u8, 40u8, 68u8, 208u8, 221u8, 161u8, 250u8, 8u8, - 72u8, - ], - ) - } - #[doc = "Cancel the ability to use `as_recovered` for `account`."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and registered to"] - #[doc = "be able to make calls on behalf of the recovered account."] + #[doc = "Emits `OwnerChanged`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `account`: The recovered account you are able to call on-behalf-of."] - pub fn cancel_recovered( - &self, - account: types::cancel_recovered::Account, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Recovery", - "cancel_recovered", - types::CancelRecovered { account }, - [ - 100u8, 222u8, 80u8, 226u8, 187u8, 188u8, 111u8, 58u8, 190u8, 5u8, - 178u8, 144u8, 37u8, 98u8, 71u8, 145u8, 28u8, 248u8, 222u8, 188u8, 53u8, - 21u8, 127u8, 176u8, 249u8, 166u8, 250u8, 59u8, 170u8, 33u8, 251u8, - 239u8, - ], - ) + #[doc = "Weight: `O(1)`"] + pub struct TransferOwnership { + #[codec(compact)] + pub id: transfer_ownership::Id, + pub owner: transfer_ownership::Owner, } - #[doc = "Poke deposits for recovery configurations and / or active recoveries."] + pub mod transfer_ownership { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferOwnership { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "transfer_ownership"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Change the Issuer, Admin and Freezer of an asset."] #[doc = ""] - #[doc = "This can be used by accounts to possibly lower their locked amount."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "- `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 = "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 `TeamChanged`."] #[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 = "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"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 = "If any deposit is updated, the difference will be reserved/unreserved from the caller's"] - #[doc = "account."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "The transaction is made free if any deposit is updated and paid otherwise."] + #[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 = "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 = "- `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, } - } - } - #[doc = "Events type."] - pub type Event = runtime_types::pallet_recovery::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been set up for an account."] - pub struct RecoveryCreated { - pub account: recovery_created::Account, - } - pub mod recovery_created { - use super::runtime_types; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryCreated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryCreated"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been initiated for lost account by rescuer account."] - pub struct RecoveryInitiated { - pub lost_account: recovery_initiated::LostAccount, - pub rescuer_account: recovery_initiated::RescuerAccount, - } - pub mod recovery_initiated { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryInitiated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryInitiated"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process for lost account by rescuer account has been vouched for by sender."] - pub struct RecoveryVouched { - pub lost_account: recovery_vouched::LostAccount, - pub rescuer_account: recovery_vouched::RescuerAccount, - pub sender: recovery_vouched::Sender, - } - pub mod recovery_vouched { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Sender = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryVouched { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryVouched"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process for lost account by rescuer account has been closed."] - pub struct RecoveryClosed { - pub lost_account: recovery_closed::LostAccount, - pub rescuer_account: recovery_closed::RescuerAccount, - } - pub mod recovery_closed { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryClosed { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryClosed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Lost account has been successfully recovered by rescuer account."] - pub struct AccountRecovered { - pub lost_account: account_recovered::LostAccount, - pub rescuer_account: account_recovered::RescuerAccount, - } - pub mod account_recovered { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - pub type RescuerAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for AccountRecovered { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "AccountRecovered"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A recovery process has been removed for an account."] - pub struct RecoveryRemoved { - pub lost_account: recovery_removed::LostAccount, - } - pub mod recovery_removed { - use super::runtime_types; - pub type LostAccount = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RecoveryRemoved { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryRemoved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A deposit has been updated."] - pub struct DepositPoked { - pub who: deposit_poked::Who, - pub kind: deposit_poked::Kind, - pub old_deposit: deposit_poked::OldDeposit, - pub new_deposit: deposit_poked::NewDeposit, - } - pub mod deposit_poked { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Kind = runtime_types::pallet_recovery::DepositKind< - runtime_types::quantus_runtime::Runtime, - >; - pub type OldDeposit = ::core::primitive::u128; - pub type NewDeposit = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositPoked { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "DepositPoked"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod recoverable { + pub mod set_metadata { use super::runtime_types; - pub type Recoverable = runtime_types::pallet_recovery::RecoveryConfig< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Id = ::core::primitive::u32; + pub type Name = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Symbol = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Decimals = ::core::primitive::u8; } - pub mod active_recoveries { - use super::runtime_types; - pub type ActiveRecoveries = runtime_types::pallet_recovery::ActiveRecovery< - ::core::primitive::u32, - ::core::primitive::u128, - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "set_metadata"; } - pub mod proxy { + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Clear the metadata for an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = ""] + #[doc = "Any deposit is freed for the asset owner."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ClearMetadata { + #[codec(compact)] + pub id: clear_metadata::Id, + } + pub mod clear_metadata { use super::runtime_types; - pub type Proxy = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Id = ::core::primitive::u32; } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " The set of recoverable accounts and their recovery configuration."] - pub fn recoverable_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::recoverable::Recoverable, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Recoverable", - (), - [ - 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, - 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, - 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, - ], - ) - } - #[doc = " The set of recoverable accounts and their recovery configuration."] - pub fn recoverable( - &self, - _0: types::recoverable::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::recoverable::Param0, - >, - types::recoverable::Recoverable, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Recoverable", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 112u8, 7u8, 56u8, 46u8, 138u8, 197u8, 63u8, 234u8, 140u8, 123u8, 145u8, - 106u8, 189u8, 190u8, 247u8, 61u8, 250u8, 67u8, 107u8, 42u8, 170u8, - 79u8, 54u8, 168u8, 33u8, 214u8, 91u8, 227u8, 5u8, 107u8, 38u8, 26u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "clear_metadata"; } - #[doc = " Active recovery attempts."] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Force the metadata for an asset to some value."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::active_recoveries::ActiveRecoveries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - (), - [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, - ], - ) - } - #[doc = " Active recovery attempts."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries_iter1( - &self, - _0: types::active_recoveries::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param0, - >, - types::active_recoveries::ActiveRecoveries, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, - ], - ) - } - #[doc = " Active recovery attempts."] + #[doc = "Any deposit is left alone."] #[doc = ""] - #[doc = " First account is the account to be recovered, and the second account"] - #[doc = " is the user trying to recover the account."] - pub fn active_recoveries( - &self, - _0: types::active_recoveries::Param0, - _1: types::active_recoveries::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::active_recoveries::Param1, - >, - ), - types::active_recoveries::ActiveRecoveries, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "ActiveRecoveries", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 104u8, 252u8, 28u8, 142u8, 48u8, 26u8, 91u8, 201u8, 184u8, 163u8, - 180u8, 197u8, 189u8, 71u8, 144u8, 88u8, 225u8, 13u8, 183u8, 84u8, - 244u8, 41u8, 164u8, 212u8, 153u8, 247u8, 191u8, 25u8, 162u8, 25u8, - 91u8, 123u8, - ], - ) - } - #[doc = " The list of allowed proxy accounts."] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] #[doc = ""] - #[doc = " Map from the user who can access it to the recovered account."] - pub fn proxy_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proxy::Proxy, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Proxy", - (), - [ - 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, - 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, - 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, - ], - ) - } - #[doc = " The list of allowed proxy accounts."] + #[doc = "Emits `MetadataSet`."] #[doc = ""] - #[doc = " Map from the user who can access it to the recovered account."] - pub fn proxy( - &self, - _0: types::proxy::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proxy::Param0, - >, - types::proxy::Proxy, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Recovery", - "Proxy", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 161u8, 242u8, 17u8, 183u8, 161u8, 47u8, 87u8, 110u8, 201u8, 177u8, - 199u8, 157u8, 30u8, 131u8, 49u8, 89u8, 182u8, 86u8, 152u8, 19u8, 199u8, - 33u8, 12u8, 138u8, 51u8, 215u8, 130u8, 5u8, 251u8, 115u8, 69u8, 159u8, - ], - ) + #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] + pub struct ForceSetMetadata { + #[codec(compact)] + pub id: force_set_metadata::Id, + pub name: force_set_metadata::Name, + pub symbol: force_set_metadata::Symbol, + pub decimals: force_set_metadata::Decimals, + pub is_frozen: force_set_metadata::IsFrozen, } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The base amount of currency needed to reserve for creating a recovery configuration."] - #[doc = ""] - #[doc = " This is held for an additional storage item whose value size is"] - #[doc = " `2 + sizeof(BlockNumber, Balance)` bytes."] - pub fn config_deposit_base( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "ConfigDepositBase", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) + pub mod force_set_metadata { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + pub type Name = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Symbol = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Decimals = ::core::primitive::u8; + pub type IsFrozen = ::core::primitive::bool; } - #[doc = " The amount of currency needed per additional user when creating a recovery"] - #[doc = " configuration."] + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_set_metadata"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = " This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage"] - #[doc = " value."] - pub fn friend_deposit_factor( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "FriendDepositFactor", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) - } - #[doc = " The maximum amount of friends allowed in a recovery configuration."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = " NOTE: The threshold programmed in this Pallet uses u16, so it does"] - #[doc = " not really make sense to have a limit here greater than u16::MAX."] - #[doc = " But also, that is a lot more than you should probably set this value"] - #[doc = " to anyway..."] - pub fn max_friends( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "MaxFriends", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The base amount of currency needed to reserve for starting a recovery."] + #[doc = "Any deposit is returned."] #[doc = ""] - #[doc = " This is primarily held for deterring malicious recovery attempts, and should"] - #[doc = " have a value large enough that a bad actor would choose not to place this"] - #[doc = " deposit. It also acts to fund additional storage item whose value size is"] - #[doc = " `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable"] - #[doc = " threshold."] - pub fn recovery_deposit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Recovery", - "RecoveryDeposit", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) + #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = ""] + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceClearMetadata { + #[codec(compact)] + pub id: force_clear_metadata::Id, + } + pub mod force_clear_metadata { + use super::runtime_types; + pub type Id = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceClearMetadata { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_clear_metadata"; } - } - } - } - pub mod assets { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_assets::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_assets::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -17326,43 +17024,66 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Issue a new class of fungible assets from a public origin."] - #[doc = ""] - #[doc = "This new asset class has no assets initially and its owner is the origin."] - #[doc = ""] - #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] + #[doc = "Alter the attributes of a given asset."] #[doc = ""] - #[doc = "Funds of sender are reserved by `AssetDeposit`."] + #[doc = "Origin must be `ForceOrigin`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] - #[doc = "member of the asset class's admin team."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] + #[doc = "value to account for the state bloat associated with its balance storage. If set to"] + #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] + #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] + #[doc = "growth)."] + #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] + #[doc = "instructions."] #[doc = ""] - #[doc = "Emits `Created` event when successful."] + #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct Create { + pub struct ForceAssetStatus { #[codec(compact)] - pub id: create::Id, - pub admin: create::Admin, - pub min_balance: create::MinBalance, + pub id: force_asset_status::Id, + pub owner: force_asset_status::Owner, + pub issuer: force_asset_status::Issuer, + pub admin: force_asset_status::Admin, + pub freezer: force_asset_status::Freezer, + #[codec(compact)] + pub min_balance: force_asset_status::MinBalance, + pub is_sufficient: force_asset_status::IsSufficient, + pub is_frozen: force_asset_status::IsFrozen, } - pub mod create { + pub mod force_asset_status { use super::runtime_types; pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; pub type MinBalance = ::core::primitive::u128; + pub type IsSufficient = ::core::primitive::bool; + pub type IsFrozen = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Create { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceAssetStatus { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "create"; + const CALL: &'static str = "force_asset_status"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17375,46 +17096,45 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Issue a new class of fungible assets from a privileged origin."] + #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] #[doc = ""] - #[doc = "This new asset class has no assets initially."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin`."] + #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] + #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] + #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] + #[doc = "meet the right value."] #[doc = ""] - #[doc = "Unlike `create`, no funds are reserved."] + #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] + #[doc = "making this call."] #[doc = ""] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] - #[doc = "over this asset, but may later change and configure the permissions using"] - #[doc = "`transfer_ownership` and `set_team`."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account to delegate permission to transfer asset."] + #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] + #[doc = "already an approval in place, then this acts additively."] #[doc = ""] - #[doc = "Emits `ForceCreated` event when successful."] + #[doc = "Emits `ApprovedTransfer` on success."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceCreate { + pub struct ApproveTransfer { #[codec(compact)] - pub id: force_create::Id, - pub owner: force_create::Owner, - pub is_sufficient: force_create::IsSufficient, + pub id: approve_transfer::Id, + pub delegate: approve_transfer::Delegate, #[codec(compact)] - pub min_balance: force_create::MinBalance, + pub amount: approve_transfer::Amount, } - pub mod force_create { + pub mod approve_transfer { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type IsSufficient = ::core::primitive::bool; - pub type MinBalance = ::core::primitive::u128; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCreate { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveTransfer { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_create"; + const CALL: &'static str = "approve_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17427,29 +17147,35 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Start the process of destroying a fungible asset class."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] - #[doc = "destruction of an asset class."] + #[doc = "Origin must be Signed and there must be an approval in place between signer and"] + #[doc = "`delegate`."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "an account contains holds or freezes in place."] - pub struct StartDestroy { + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct CancelApproval { #[codec(compact)] - pub id: start_destroy::Id, + pub id: cancel_approval::Id, + pub delegate: cancel_approval::Delegate, } - pub mod start_destroy { + pub mod cancel_approval { use super::runtime_types; pub type Id = ::core::primitive::u32; + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for StartDestroy { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelApproval { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "start_destroy"; + const CALL: &'static str = "cancel_approval"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17462,30 +17188,41 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Destroy all accounts associated with a given asset."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] + #[doc = "account of the asset `id`."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedAccounts` event."] - pub struct DestroyAccounts { + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct ForceCancelApproval { #[codec(compact)] - pub id: destroy_accounts::Id, + pub id: force_cancel_approval::Id, + pub owner: force_cancel_approval::Owner, + pub delegate: force_cancel_approval::Delegate, } - pub mod destroy_accounts { + pub mod force_cancel_approval { use super::runtime_types; pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCancelApproval { + const PALLET: &'static str = "Assets"; + const CALL: &'static str = "force_cancel_approval"; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyAccounts { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "destroy_accounts"; - } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -17497,29 +17234,48 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] + #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] + #[doc = "account."] #[doc = ""] - #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] + #[doc = "signer."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] + #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] + #[doc = "reserved by `approve_transfer` is unreserved."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] + #[doc = "from which the asset balance will be withdrawn."] + #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] + #[doc = "- `amount`: The amount of assets to transfer."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedApprovals` event."] - pub struct DestroyApprovals { + #[doc = "Emits `TransferredApproved` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub struct TransferApproved { #[codec(compact)] - pub id: destroy_approvals::Id, + pub id: transfer_approved::Id, + pub owner: transfer_approved::Owner, + pub destination: transfer_approved::Destination, + #[codec(compact)] + pub amount: transfer_approved::Amount, } - pub mod destroy_approvals { + pub mod transfer_approved { use super::runtime_types; pub type Id = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Destination = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DestroyApprovals { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferApproved { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "destroy_approvals"; + const CALL: &'static str = "transfer_approved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17532,27 +17288,26 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Complete destroying asset and unreserve currency."] + #[doc = "Create an asset account for non-provider assets."] #[doc = ""] - #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] - #[doc = "hand."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] #[doc = ""] - #[doc = "Each successful call emits the `Event::Destroyed` event."] - pub struct FinishDestroy { + #[doc = "Emits `Touched` event when successful."] + pub struct Touch { #[codec(compact)] - pub id: finish_destroy::Id, + pub id: touch::Id, } - pub mod finish_destroy { + pub mod touch { use super::runtime_types; pub type Id = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FinishDestroy { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Touch { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "finish_destroy"; + const CALL: &'static str = "touch"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17565,37 +17320,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Mint assets of a particular class."] + #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] + #[doc = "account."] #[doc = ""] - #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = "The origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount minted."] - #[doc = "- `beneficiary`: The account to be credited with the minted assets."] - #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] + #[doc = " refunded."] + #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] #[doc = ""] - #[doc = "Emits `Issued` event when successful."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] - pub struct Mint { - #[codec(compact)] - pub id: mint::Id, - pub beneficiary: mint::Beneficiary, + #[doc = "Emits `Refunded` event when successful."] + pub struct Refund { #[codec(compact)] - pub amount: mint::Amount, + pub id: refund::Id, + pub allow_burn: refund::AllowBurn, } - pub mod mint { + pub mod refund { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; + pub type AllowBurn = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Mint { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Refund { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "mint"; + const CALL: &'static str = "refund"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17608,40 +17358,31 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] + #[doc = "Sets the minimum balance of an asset."] #[doc = ""] - #[doc = "Bails with `NoAccount` if the `who` is already dead."] + #[doc = "Only works if there aren't any accounts that are holding the asset or if"] + #[doc = "the new value of `min_balance` is less than the old one."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount burned."] - #[doc = "- `who`: The account to be debited from."] - #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = "Origin must be Signed and the sender has to be the Owner of the"] + #[doc = "asset `id`."] #[doc = ""] - #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] - #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `min_balance`: The new value of `min_balance`."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] - pub struct Burn { - #[codec(compact)] - pub id: burn::Id, - pub who: burn::Who, + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + pub struct SetMinBalance { #[codec(compact)] - pub amount: burn::Amount, + pub id: set_min_balance::Id, + pub min_balance: set_min_balance::MinBalance, } - pub mod burn { + pub mod set_min_balance { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; + pub type MinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Burn { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMinBalance { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "burn"; + const CALL: &'static str = "set_min_balance"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17654,43 +17395,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Move some assets from the sender account to another."] - #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "Create an asset account for `who`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "- `origin`: Must be Signed 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)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub struct Transfer { - #[codec(compact)] - pub id: transfer::Id, - pub target: transfer::Target, + #[doc = "Emits `Touched` event when successful."] + pub struct TouchOther { #[codec(compact)] - pub amount: transfer::Amount, + pub id: touch_other::Id, + pub who: touch_other::Who, } - pub mod transfer { + pub mod touch_other { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Transfer { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TouchOther { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer"; + const CALL: &'static str = "touch_other"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17703,43 +17433,35 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] + #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] + #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] + #[doc = "use `refund`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `who`: The account to refund."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub struct TransferKeepAlive { - #[codec(compact)] - pub id: transfer_keep_alive::Id, - pub target: transfer_keep_alive::Target, + #[doc = "Emits `Refunded` event when successful."] + pub struct RefundOther { #[codec(compact)] - pub amount: transfer_keep_alive::Amount, + pub id: refund_other::Id, + pub who: refund_other::Who, } - pub mod transfer_keep_alive { + pub mod refund_other { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundOther { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_keep_alive"; + const CALL: &'static str = "refund_other"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17752,49 +17474,32 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Move some assets from one account to another."] + #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `source`: The account to be debited."] - #[doc = "- `dest`: The account to be credited."] - #[doc = "- `amount`: The amount by which the `source`'s balance of assets should be reduced and"] - #[doc = "`dest`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the `source` balance above zero but"] - #[doc = "below the minimum balance. Must be greater than zero."] + #[doc = "- `id`: The identifier of the account's asset."] + #[doc = "- `who`: The account to be unblocked."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "Emits `Blocked`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of"] - #[doc = "`dest`."] - pub struct ForceTransfer { + pub struct Block { #[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 id: block::Id, + pub who: block::Who, } - pub mod force_transfer { + pub mod block { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Source = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceTransfer { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Block { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_transfer"; + const CALL: &'static str = "block"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -17807,1962 +17512,1302 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Disallow further unprivileged transfers of an asset `id` from an account `who`. `who`"] - #[doc = "must already exist as an entry in `Account`s of the asset. If you want to freeze an"] - #[doc = "account that does not have an entry, use `touch_other` first."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = "Transfer the entire transferable balance from the caller asset account."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be frozen."] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] #[doc = ""] - #[doc = "Emits `Frozen`."] + #[doc = "The dispatch origin of this call must be Signed."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct Freeze { + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] + #[doc = " (false), or transfer everything except at least the minimum balance, which will"] + #[doc = " guarantee to keep the sender asset account alive (true)."] + pub struct TransferAll { #[codec(compact)] - pub id: freeze::Id, - pub who: freeze::Who, + pub id: transfer_all::Id, + pub dest: transfer_all::Dest, + pub keep_alive: transfer_all::KeepAlive, } - pub mod freeze { + pub mod transfer_all { use super::runtime_types; pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type KeepAlive = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Freeze { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAll { const PALLET: &'static str = "Assets"; - const CALL: &'static str = "freeze"; + const CALL: &'static str = "transfer_all"; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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."] + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Issue a new class of fungible assets from a public origin."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "This new asset class has no assets initially and its owner is the origin."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `who`: The account to be unfrozen."] + #[doc = "The origin must conform to the configured `CreateOrigin` and have sufficient funds free."] #[doc = ""] - #[doc = "Emits `Thawed`."] + #[doc = "Funds of sender are reserved by `AssetDeposit`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] + #[doc = "member of the asset class's admin team."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `Created` event when successful."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct 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"; + pub fn create( + &self, + id: types::create::Id, + admin: types::create::Admin, + min_balance: types::create::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "create", + types::Create { id, admin, min_balance }, + [ + 120u8, 25u8, 99u8, 39u8, 102u8, 201u8, 14u8, 2u8, 32u8, 139u8, 206u8, + 218u8, 223u8, 161u8, 25u8, 98u8, 159u8, 133u8, 65u8, 105u8, 45u8, 4u8, + 28u8, 49u8, 248u8, 147u8, 2u8, 179u8, 11u8, 195u8, 177u8, 250u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Disallow further unprivileged transfers for the asset class."] + #[doc = "Issue a new class of fungible assets from a privileged origin."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] + #[doc = "This new asset class has no assets initially."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "The origin must conform to `ForceOrigin`."] #[doc = ""] - #[doc = "Emits `Frozen`."] + #[doc = "Unlike `create`, no funds are reserved."] + #[doc = ""] + #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] + #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] + #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] + #[doc = "over this asset, but may later change and configure the permissions using"] + #[doc = "`transfer_ownership` and `set_team`."] + #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] + #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = ""] + #[doc = "Emits `ForceCreated` event when successful."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct FreezeAsset { - #[codec(compact)] - pub id: freeze_asset::Id, - } - pub mod freeze_asset { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for FreezeAsset { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "freeze_asset"; + pub fn force_create( + &self, + id: types::force_create::Id, + owner: types::force_create::Owner, + is_sufficient: types::force_create::IsSufficient, + min_balance: types::force_create::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_create", + types::ForceCreate { id, owner, is_sufficient, min_balance }, + [ + 149u8, 41u8, 54u8, 146u8, 18u8, 248u8, 84u8, 52u8, 202u8, 88u8, 192u8, + 208u8, 247u8, 227u8, 254u8, 98u8, 92u8, 46u8, 164u8, 152u8, 143u8, + 20u8, 179u8, 227u8, 197u8, 247u8, 242u8, 153u8, 142u8, 148u8, 40u8, + 184u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Allow unprivileged transfers for the asset again."] + #[doc = "Start the process of destroying a fungible asset class."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] + #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] + #[doc = "destruction of an asset class."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be thawed."] + #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] #[doc = ""] - #[doc = "Emits `Thawed`."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[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 = "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, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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 = "Destroy all accounts associated with a given asset."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] #[doc = ""] - #[doc = "Emits `OwnerChanged`."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct TransferOwnership { - #[codec(compact)] - pub id: transfer_ownership::Id, - pub owner: transfer_ownership::Owner, - } - 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 = "Each call emits the `Event::DestroyedAccounts` event."] + pub fn destroy_accounts( + &self, + id: types::destroy_accounts::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "destroy_accounts", + types::DestroyAccounts { id }, + [ + 236u8, 102u8, 233u8, 170u8, 179u8, 46u8, 42u8, 29u8, 200u8, 116u8, + 62u8, 114u8, 233u8, 59u8, 217u8, 215u8, 109u8, 232u8, 147u8, 95u8, + 255u8, 248u8, 119u8, 222u8, 216u8, 165u8, 138u8, 47u8, 28u8, 56u8, + 204u8, 93u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Change the Issuer, Admin and Freezer of an asset."] + #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be frozen."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] + #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] + #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] #[doc = ""] - #[doc = "Emits `TeamChanged`."] + #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct SetTeam { - #[codec(compact)] - pub id: set_team::Id, - pub issuer: set_team::Issuer, - pub admin: set_team::Admin, - pub freezer: set_team::Freezer, - } - pub mod set_team { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTeam { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_team"; + #[doc = "Each call emits the `Event::DestroyedApprovals` event."] + pub fn destroy_approvals( + &self, + id: types::destroy_approvals::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "destroy_approvals", + types::DestroyApprovals { id }, + [ + 34u8, 35u8, 15u8, 44u8, 239u8, 232u8, 88u8, 130u8, 130u8, 87u8, 171u8, + 255u8, 247u8, 179u8, 14u8, 35u8, 47u8, 223u8, 32u8, 232u8, 41u8, 105u8, + 207u8, 199u8, 90u8, 136u8, 144u8, 139u8, 252u8, 76u8, 177u8, 106u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set the metadata for an asset."] + #[doc = "Complete destroying asset and unreserve currency."] #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] + #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] + #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] + #[doc = "hand."] #[doc = ""] - #[doc = "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 = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] + #[doc = " asset."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to 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 = "Each successful call emits the `Event::Destroyed` event."] + pub fn finish_destroy( + &self, + id: types::finish_destroy::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "finish_destroy", + types::FinishDestroy { id }, + [ + 132u8, 67u8, 78u8, 84u8, 240u8, 51u8, 176u8, 119u8, 48u8, 34u8, 153u8, + 37u8, 25u8, 171u8, 21u8, 164u8, 53u8, 214u8, 36u8, 149u8, 20u8, 240u8, + 123u8, 195u8, 170u8, 162u8, 118u8, 81u8, 176u8, 218u8, 114u8, 113u8, + ], + ) + } + #[doc = "Mint assets of a particular class."] #[doc = ""] - #[doc = "Emits `MetadataSet`."] + #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = ""] + #[doc = "- `id`: The identifier of the asset to have some amount minted."] + #[doc = "- `beneficiary`: The account to be credited with the minted assets."] + #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = ""] + #[doc = "Emits `Issued` event when successful."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct SetMetadata { - #[codec(compact)] - pub id: set_metadata::Id, - pub name: set_metadata::Name, - pub symbol: set_metadata::Symbol, - pub decimals: set_metadata::Decimals, - } - pub mod set_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Name = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Symbol = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Decimals = ::core::primitive::u8; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_metadata"; + #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] + pub fn mint( + &self, + id: types::mint::Id, + beneficiary: types::mint::Beneficiary, + amount: types::mint::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "mint", + types::Mint { id, beneficiary, amount }, + [ + 172u8, 131u8, 103u8, 81u8, 206u8, 2u8, 143u8, 114u8, 137u8, 60u8, + 147u8, 67u8, 226u8, 64u8, 71u8, 11u8, 36u8, 145u8, 51u8, 8u8, 0u8, + 110u8, 8u8, 195u8, 103u8, 205u8, 156u8, 43u8, 215u8, 12u8, 150u8, + 135u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear the metadata for an asset."] + #[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 Owner of the asset `id`."] + #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] #[doc = ""] - #[doc = "Any deposit is freed for the asset owner."] + #[doc = "Bails with `NoAccount` if the `who` is already dead."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] + #[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 `MetadataCleared`."] + #[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)`"] - pub struct ClearMetadata { - #[codec(compact)] - pub id: clear_metadata::Id, - } - pub mod clear_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ClearMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "clear_metadata"; + #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] + pub fn burn( + &self, + id: types::burn::Id, + who: types::burn::Who, + amount: types::burn::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "burn", + types::Burn { id, who, amount }, + [ + 105u8, 133u8, 82u8, 100u8, 124u8, 65u8, 174u8, 31u8, 152u8, 45u8, 23u8, + 200u8, 23u8, 199u8, 239u8, 8u8, 187u8, 142u8, 21u8, 192u8, 35u8, 211u8, + 172u8, 130u8, 169u8, 74u8, 167u8, 36u8, 149u8, 7u8, 19u8, 37u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force the metadata for an asset to some value."] + #[doc = "Move some assets from the sender account to another."] #[doc = ""] - #[doc = "Origin must be ForceOrigin."] + #[doc = "Origin must be Signed."] #[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 = "- `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 `MetadataSet`."] + #[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(N + S)` where N and S are the length of the name and symbol respectively."] - pub struct ForceSetMetadata { - #[codec(compact)] - pub id: force_set_metadata::Id, - pub name: force_set_metadata::Name, - pub symbol: force_set_metadata::Symbol, - pub decimals: force_set_metadata::Decimals, - pub is_frozen: force_set_metadata::IsFrozen, - } - pub mod force_set_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Name = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Symbol = - ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Decimals = ::core::primitive::u8; - pub type IsFrozen = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceSetMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_set_metadata"; + #[doc = "Weight: `O(1)`"] + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub fn transfer( + &self, + id: types::transfer::Id, + target: types::transfer::Target, + amount: types::transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer", + types::Transfer { id, target, amount }, + [ + 126u8, 31u8, 70u8, 179u8, 222u8, 190u8, 12u8, 19u8, 94u8, 225u8, 217u8, + 109u8, 54u8, 69u8, 124u8, 61u8, 97u8, 199u8, 193u8, 166u8, 39u8, 143u8, + 125u8, 251u8, 87u8, 173u8, 149u8, 91u8, 182u8, 18u8, 184u8, 65u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Clear the metadata for an asset."] - #[doc = ""] - #[doc = "Origin must be ForceOrigin."] + #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] #[doc = ""] - #[doc = "Any deposit is returned."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to clear."] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `target`: The account to be credited."] + #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] + #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] + #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] + #[doc = "the minimum balance. Must be greater than zero."] #[doc = ""] - #[doc = "Emits `MetadataCleared`."] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceClearMetadata { - #[codec(compact)] - pub id: force_clear_metadata::Id, - } - pub mod force_clear_metadata { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceClearMetadata { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_clear_metadata"; + #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] + #[doc = "`target`."] + pub fn transfer_keep_alive( + &self, + id: types::transfer_keep_alive::Id, + target: types::transfer_keep_alive::Target, + amount: types::transfer_keep_alive::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer_keep_alive", + types::TransferKeepAlive { id, target, amount }, + [ + 99u8, 101u8, 219u8, 188u8, 238u8, 230u8, 141u8, 43u8, 38u8, 175u8, + 46u8, 89u8, 33u8, 23u8, 223u8, 115u8, 108u8, 18u8, 190u8, 213u8, 157u8, + 12u8, 139u8, 97u8, 7u8, 75u8, 196u8, 159u8, 122u8, 32u8, 164u8, 154u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Alter the attributes of a given asset."] + #[doc = "Move some assets from one account to another."] #[doc = ""] - #[doc = "Origin must be `ForceOrigin`."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The new Owner of this asset."] - #[doc = "- `issuer`: The new Issuer of this asset."] - #[doc = "- `admin`: The new Admin of this asset."] - #[doc = "- `freezer`: The new Freezer of this asset."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] - #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] - #[doc = "value to account for the state bloat associated with its balance storage. If set to"] - #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] - #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] - #[doc = "growth)."] - #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] - #[doc = "instructions."] + #[doc = "- `id`: The identifier of the asset to have some amount transferred."] + #[doc = "- `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 `AssetStatusChanged` with the identity of the asset."] + #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] + #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] + #[doc = "to zero."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceAssetStatus { - #[codec(compact)] - pub id: force_asset_status::Id, - pub owner: force_asset_status::Owner, - pub issuer: force_asset_status::Issuer, - pub admin: force_asset_status::Admin, - pub freezer: force_asset_status::Freezer, - #[codec(compact)] - pub min_balance: force_asset_status::MinBalance, - pub is_sufficient: force_asset_status::IsSufficient, - pub is_frozen: force_asset_status::IsFrozen, - } - pub mod force_asset_status { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Issuer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Admin = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Freezer = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MinBalance = ::core::primitive::u128; - pub type IsSufficient = ::core::primitive::bool; - pub type IsFrozen = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceAssetStatus { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_asset_status"; + #[doc = "Modes: Pre-existence of `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, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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 = "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 = "NOTE: The signing account does not need to own `amount` of assets at the point of"] - #[doc = "making this call."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account 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 = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be frozen."] #[doc = ""] - #[doc = "Emits `ApprovedTransfer` on success."] + #[doc = "Emits `Frozen`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ApproveTransfer { - #[codec(compact)] - pub id: approve_transfer::Id, - pub delegate: approve_transfer::Delegate, - #[codec(compact)] - pub amount: approve_transfer::Amount, - } - pub mod approve_transfer { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveTransfer { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "approve_transfer"; + pub fn freeze( + &self, + id: types::freeze::Id, + who: types::freeze::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "freeze", + types::Freeze { id, who }, + [ + 180u8, 124u8, 252u8, 66u8, 205u8, 23u8, 32u8, 217u8, 173u8, 10u8, 91u8, + 57u8, 44u8, 215u8, 234u8, 152u8, 115u8, 38u8, 141u8, 212u8, 57u8, + 217u8, 169u8, 61u8, 215u8, 130u8, 172u8, 58u8, 90u8, 193u8, 25u8, + 249u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place between signer and"] - #[doc = "`delegate`."] + #[doc = "Allow unprivileged transfers to and from an account again."] #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `who`: The account to be unfrozen."] #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = "Emits `Thawed`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct CancelApproval { - #[codec(compact)] - pub id: cancel_approval::Id, - pub delegate: cancel_approval::Delegate, - } - pub mod cancel_approval { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelApproval { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "cancel_approval"; + pub fn thaw( + &self, + id: types::thaw::Id, + who: types::thaw::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "thaw", + types::Thaw { id, who }, + [ + 187u8, 130u8, 9u8, 152u8, 231u8, 9u8, 245u8, 162u8, 115u8, 19u8, 73u8, + 176u8, 16u8, 230u8, 30u8, 60u8, 180u8, 183u8, 154u8, 160u8, 72u8, + 219u8, 116u8, 57u8, 140u8, 6u8, 105u8, 38u8, 98u8, 90u8, 250u8, 135u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] - #[doc = ""] - #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] - #[doc = "account of the asset `id`."] + #[doc = "Disallow further unprivileged transfers for the asset class."] #[doc = ""] - #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] + #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `delegate`: The account delegated permission to transfer asset."] + #[doc = "- `id`: The identifier of the asset to be frozen."] #[doc = ""] - #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = "Emits `Frozen`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct ForceCancelApproval { - #[codec(compact)] - pub id: force_cancel_approval::Id, - pub owner: force_cancel_approval::Owner, - pub delegate: force_cancel_approval::Delegate, - } - pub mod force_cancel_approval { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Delegate = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceCancelApproval { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "force_cancel_approval"; + pub fn freeze_asset( + &self, + id: types::freeze_asset::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "freeze_asset", + types::FreezeAsset { id }, + [ + 75u8, 237u8, 183u8, 112u8, 112u8, 123u8, 250u8, 203u8, 169u8, 51u8, + 218u8, 35u8, 159u8, 23u8, 21u8, 10u8, 167u8, 84u8, 161u8, 212u8, 124u8, + 236u8, 88u8, 175u8, 48u8, 195u8, 33u8, 145u8, 141u8, 156u8, 31u8, + 250u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] - #[doc = "account."] + #[doc = "Allow unprivileged transfers for the asset again."] #[doc = ""] - #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] - #[doc = "signer."] + #[doc = "Origin must be Signed and the sender should be the Admin of the asset `id`."] #[doc = ""] - #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] - #[doc = "reserved by `approve_transfer` is unreserved."] + #[doc = "- `id`: The identifier of the asset to be thawed."] + #[doc = ""] + #[doc = "Emits `Thawed`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn thaw_asset( + &self, + id: types::thaw_asset::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "thaw_asset", + types::ThawAsset { id }, + [ + 151u8, 6u8, 170u8, 114u8, 55u8, 8u8, 5u8, 194u8, 251u8, 78u8, 232u8, + 181u8, 157u8, 62u8, 16u8, 39u8, 79u8, 119u8, 205u8, 198u8, 199u8, 26u8, + 92u8, 162u8, 169u8, 173u8, 93u8, 51u8, 7u8, 79u8, 198u8, 77u8, + ], + ) + } + #[doc = "Change the Owner of an asset."] + #[doc = ""] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] - #[doc = "from which the asset balance will be withdrawn."] - #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] - #[doc = "- `amount`: The amount of assets to transfer."] + #[doc = "- `owner`: The new Owner of this asset."] #[doc = ""] - #[doc = "Emits `TransferredApproved` on success."] + #[doc = "Emits `OwnerChanged`."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub struct TransferApproved { - #[codec(compact)] - pub id: transfer_approved::Id, - pub owner: transfer_approved::Owner, - pub destination: transfer_approved::Destination, - #[codec(compact)] - pub amount: transfer_approved::Amount, - } - pub mod transfer_approved { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Destination = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferApproved { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_approved"; + pub fn transfer_ownership( + &self, + id: types::transfer_ownership::Id, + owner: types::transfer_ownership::Owner, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "transfer_ownership", + types::TransferOwnership { id, owner }, + [ + 65u8, 85u8, 40u8, 202u8, 212u8, 170u8, 130u8, 132u8, 140u8, 90u8, 68u8, + 28u8, 101u8, 154u8, 222u8, 150u8, 244u8, 165u8, 44u8, 22u8, 225u8, + 152u8, 7u8, 162u8, 110u8, 54u8, 173u8, 181u8, 54u8, 215u8, 105u8, + 239u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create an asset account for non-provider assets."] + #[doc = "Change the Issuer, Admin and Freezer of an asset."] #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] - #[doc = " to be taken."] - #[doc = "- `id`: The identifier of the asset for the account to be created."] + #[doc = "- `id`: The identifier of the asset to be frozen."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub struct Touch { - #[codec(compact)] - pub id: touch::Id, - } - pub mod touch { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Touch { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "touch"; + #[doc = "Emits `TeamChanged`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn set_team( + &self, + id: types::set_team::Id, + issuer: types::set_team::Issuer, + admin: types::set_team::Admin, + freezer: types::set_team::Freezer, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "set_team", + types::SetTeam { id, issuer, admin, freezer }, + [ + 52u8, 75u8, 50u8, 30u8, 164u8, 161u8, 121u8, 25u8, 135u8, 83u8, 115u8, + 25u8, 103u8, 1u8, 124u8, 206u8, 83u8, 182u8, 41u8, 116u8, 44u8, 37u8, + 75u8, 70u8, 252u8, 225u8, 240u8, 144u8, 96u8, 160u8, 151u8, 4u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] - #[doc = "account."] + #[doc = "Set the metadata for an asset."] #[doc = ""] - #[doc = "The origin must be Signed."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] - #[doc = " refunded."] - #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] + #[doc = "Funds of sender are reserved according to the formula:"] + #[doc = "`MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)` taking into"] + #[doc = "account any already reserved funds."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub struct Refund { - #[codec(compact)] - pub id: refund::Id, - pub allow_burn: refund::AllowBurn, - } - pub mod refund { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type AllowBurn = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Refund { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "refund"; + #[doc = "Emits `MetadataSet`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn set_metadata( + &self, + id: types::set_metadata::Id, + name: types::set_metadata::Name, + symbol: types::set_metadata::Symbol, + decimals: types::set_metadata::Decimals, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "set_metadata", + types::SetMetadata { id, name, symbol, decimals }, + [ + 215u8, 66u8, 15u8, 17u8, 88u8, 174u8, 77u8, 75u8, 229u8, 155u8, 160u8, + 34u8, 108u8, 194u8, 88u8, 238u8, 131u8, 97u8, 234u8, 102u8, 71u8, 56u8, + 70u8, 248u8, 211u8, 85u8, 72u8, 92u8, 71u8, 222u8, 190u8, 91u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Sets the minimum balance of an asset."] + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = "Only works if there aren't any accounts that are holding the asset or if"] - #[doc = "the new value of `min_balance` is less than the old one."] + #[doc = "Origin must be Signed and the sender should be the Owner of the asset `id`."] #[doc = ""] - #[doc = "Origin must be Signed and the sender has to be the Owner of the"] - #[doc = "asset `id`."] + #[doc = "Any deposit is freed for the asset owner."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset."] - #[doc = "- `min_balance`: The new value of `min_balance`."] + #[doc = "- `id`: The identifier of the asset to clear."] #[doc = ""] - #[doc = "Emits `AssetMinBalanceChanged` event when successful."] - pub struct SetMinBalance { - #[codec(compact)] - pub id: set_min_balance::Id, - pub min_balance: set_min_balance::MinBalance, - } - pub mod set_min_balance { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type MinBalance = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMinBalance { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "set_min_balance"; + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn clear_metadata( + &self, + id: types::clear_metadata::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "clear_metadata", + types::ClearMetadata { id }, + [ + 68u8, 172u8, 6u8, 158u8, 237u8, 254u8, 22u8, 4u8, 254u8, 157u8, 179u8, + 168u8, 105u8, 114u8, 56u8, 166u8, 213u8, 38u8, 188u8, 195u8, 99u8, + 43u8, 142u8, 220u8, 94u8, 248u8, 51u8, 226u8, 233u8, 114u8, 86u8, 93u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Create an asset account for `who`."] + #[doc = "Force the metadata for an asset to some value."] #[doc = ""] - #[doc = "A deposit will be taken from the signer account."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = "- `origin`: Must be Signed 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 = "Any deposit is left alone."] #[doc = ""] - #[doc = "Emits `Touched` event when successful."] - pub struct TouchOther { - #[codec(compact)] - pub id: touch_other::Id, - pub who: touch_other::Who, - } - pub mod touch_other { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TouchOther { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "touch_other"; + #[doc = "- `id`: The identifier of the asset to update."] + #[doc = "- `name`: The user friendly name of this asset. Limited in length by `StringLimit`."] + #[doc = "- `symbol`: The exchange symbol for this asset. Limited in length by `StringLimit`."] + #[doc = "- `decimals`: The number of decimals this asset uses to represent one unit."] + #[doc = ""] + #[doc = "Emits `MetadataSet`."] + #[doc = ""] + #[doc = "Weight: `O(N + S)` where N and S are the length of the name and symbol respectively."] + pub fn force_set_metadata( + &self, + id: types::force_set_metadata::Id, + name: types::force_set_metadata::Name, + symbol: types::force_set_metadata::Symbol, + decimals: types::force_set_metadata::Decimals, + is_frozen: types::force_set_metadata::IsFrozen, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_set_metadata", + types::ForceSetMetadata { id, name, symbol, decimals, is_frozen }, + [ + 76u8, 90u8, 182u8, 13u8, 133u8, 248u8, 94u8, 136u8, 169u8, 114u8, + 151u8, 20u8, 106u8, 89u8, 78u8, 228u8, 22u8, 29u8, 68u8, 8u8, 54u8, + 47u8, 1u8, 186u8, 45u8, 167u8, 14u8, 112u8, 34u8, 43u8, 91u8, 140u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] + #[doc = "Clear the metadata for an asset."] #[doc = ""] - #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] - #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] - #[doc = "use `refund`."] + #[doc = "Origin must be ForceOrigin."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `who`: The account to refund."] + #[doc = "Any deposit is returned."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "the asset account contains holds or freezes in place."] + #[doc = "- `id`: The identifier of the asset to clear."] #[doc = ""] - #[doc = "Emits `Refunded` event when successful."] - pub struct RefundOther { - #[codec(compact)] - pub id: refund_other::Id, - pub who: refund_other::Who, + #[doc = "Emits `MetadataCleared`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn force_clear_metadata( + &self, + id: types::force_clear_metadata::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Assets", + "force_clear_metadata", + types::ForceClearMetadata { id }, + [ + 2u8, 224u8, 84u8, 48u8, 130u8, 132u8, 79u8, 38u8, 217u8, 17u8, 165u8, + 139u8, 89u8, 53u8, 116u8, 184u8, 32u8, 91u8, 122u8, 39u8, 85u8, 40u8, + 213u8, 216u8, 135u8, 171u8, 50u8, 69u8, 202u8, 28u8, 166u8, 147u8, + ], + ) } - pub mod refund_other { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundOther { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "refund_other"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Disallow further unprivileged transfers of an asset `id` to and from an account `who`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Freezer of the asset `id`."] - #[doc = ""] - #[doc = "- `id`: The identifier of the account's asset."] - #[doc = "- `who`: The account to be unblocked."] - #[doc = ""] - #[doc = "Emits `Blocked`."] - #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct Block { - #[codec(compact)] - pub id: block::Id, - pub who: block::Who, - } - pub mod block { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Block { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "block"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Transfer the entire transferable balance from the caller asset account."] - #[doc = ""] - #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] - #[doc = "any held, frozen, or minimum balance (when `keep_alive` is `true`), will not be"] - #[doc = "transferred by this function. To ensure that this function results in a killed account,"] - #[doc = "you might need to prepare the account by removing any reference counters, storage"] - #[doc = "deposits, etc..."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be Signed."] - #[doc = ""] - #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] - #[doc = "- `dest`: The recipient of the transfer."] - #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] - #[doc = " of the funds the asset account has, causing the sender asset account to be killed"] - #[doc = " (false), or transfer everything except at least the minimum balance, which will"] - #[doc = " guarantee to keep the sender asset account alive (true)."] - pub struct TransferAll { - #[codec(compact)] - pub id: transfer_all::Id, - pub dest: transfer_all::Dest, - pub keep_alive: transfer_all::KeepAlive, - } - pub mod transfer_all { - use super::runtime_types; - pub type Id = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type KeepAlive = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for TransferAll { - const PALLET: &'static str = "Assets"; - const CALL: &'static str = "transfer_all"; - } - } - 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 = "Alter the attributes of a given asset."] #[doc = ""] - #[doc = "Funds of sender are reserved by `AssetDeposit`."] + #[doc = "Origin must be `ForceOrigin`."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `admin`: The admin of this class of assets. The admin is the initial address of each"] - #[doc = "member of the asset class's admin team."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The new Owner of this asset."] + #[doc = "- `issuer`: The new Issuer of this asset."] + #[doc = "- `admin`: The new Admin of this asset."] + #[doc = "- `freezer`: The new Freezer of this asset."] #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `is_sufficient`: Whether a non-zero balance of this asset is deposit of sufficient"] + #[doc = "value to account for the state bloat associated with its balance storage. If set to"] + #[doc = "`true`, then non-zero balances may be stored without a `consumer` reference (and thus"] + #[doc = "an ED in the Balances pallet or whatever else is used to control user-account state"] + #[doc = "growth)."] + #[doc = "- `is_frozen`: Whether this asset class is frozen except for permissioned/admin"] + #[doc = "instructions."] #[doc = ""] - #[doc = "Emits `Created` event when successful."] + #[doc = "Emits `AssetStatusChanged` with the identity of the asset."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub fn create( + pub fn force_asset_status( &self, - id: types::create::Id, - admin: types::create::Admin, - min_balance: types::create::MinBalance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::force_asset_status::Id, + owner: types::force_asset_status::Owner, + issuer: types::force_asset_status::Issuer, + admin: types::force_asset_status::Admin, + freezer: types::force_asset_status::Freezer, + min_balance: types::force_asset_status::MinBalance, + is_sufficient: types::force_asset_status::IsSufficient, + is_frozen: types::force_asset_status::IsFrozen, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "create", - types::Create { id, admin, min_balance }, + "force_asset_status", + types::ForceAssetStatus { + id, + owner, + issuer, + admin, + freezer, + min_balance, + is_sufficient, + is_frozen, + }, [ - 120u8, 25u8, 99u8, 39u8, 102u8, 201u8, 14u8, 2u8, 32u8, 139u8, 206u8, - 218u8, 223u8, 161u8, 25u8, 98u8, 159u8, 133u8, 65u8, 105u8, 45u8, 4u8, - 28u8, 49u8, 248u8, 147u8, 2u8, 179u8, 11u8, 195u8, 177u8, 250u8, + 149u8, 136u8, 250u8, 33u8, 53u8, 220u8, 207u8, 187u8, 42u8, 118u8, + 93u8, 173u8, 100u8, 243u8, 234u8, 207u8, 88u8, 45u8, 79u8, 221u8, + 113u8, 166u8, 229u8, 171u8, 223u8, 126u8, 20u8, 67u8, 19u8, 77u8, 44u8, + 19u8, ], ) } - #[doc = "Issue a new class of fungible assets from a privileged origin."] + #[doc = "Approve an amount of asset for transfer by a delegated third-party account."] #[doc = ""] - #[doc = "This new asset class has no assets initially."] + #[doc = "Origin must be Signed."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin`."] + #[doc = "Ensures that `ApprovalDeposit` worth of `Currency` is reserved from signing account"] + #[doc = "for the purpose of holding the approval. If some non-zero amount of assets is already"] + #[doc = "approved from signing account to `delegate`, then it is topped up or unreserved to"] + #[doc = "meet the right value."] #[doc = ""] - #[doc = "Unlike `create`, no funds are reserved."] + #[doc = "NOTE: The signing account does not need to own `amount` of assets at the point of"] + #[doc = "making this call."] #[doc = ""] - #[doc = "- `id`: The identifier of the new asset. This must not be currently in use to identify"] - #[doc = "an existing asset. If [`NextAssetId`] is set, then this must be equal to it."] - #[doc = "- `owner`: The owner of this class of assets. The owner has full superuser permissions"] - #[doc = "over this asset, but may later change and configure the permissions using"] - #[doc = "`transfer_ownership` and `set_team`."] - #[doc = "- `min_balance`: The minimum balance of this new asset that any single account must"] - #[doc = "have. If an account's balance is reduced below this, then it collapses to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account to delegate permission to transfer asset."] + #[doc = "- `amount`: The amount of asset that may be transferred by `delegate`. If there is"] + #[doc = "already an approval in place, then this acts additively."] #[doc = ""] - #[doc = "Emits `ForceCreated` event when successful."] + #[doc = "Emits `ApprovedTransfer` on success."] #[doc = ""] #[doc = "Weight: `O(1)`"] - pub fn force_create( + pub fn approve_transfer( &self, - id: types::force_create::Id, - owner: types::force_create::Owner, - is_sufficient: types::force_create::IsSufficient, - min_balance: types::force_create::MinBalance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::approve_transfer::Id, + delegate: types::approve_transfer::Delegate, + amount: types::approve_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "force_create", - types::ForceCreate { id, owner, is_sufficient, min_balance }, + "approve_transfer", + types::ApproveTransfer { id, delegate, amount }, [ - 149u8, 41u8, 54u8, 146u8, 18u8, 248u8, 84u8, 52u8, 202u8, 88u8, 192u8, - 208u8, 247u8, 227u8, 254u8, 98u8, 92u8, 46u8, 164u8, 152u8, 143u8, - 20u8, 179u8, 227u8, 197u8, 247u8, 242u8, 153u8, 142u8, 148u8, 40u8, - 184u8, + 39u8, 227u8, 23u8, 143u8, 10u8, 120u8, 227u8, 1u8, 223u8, 78u8, 40u8, + 213u8, 249u8, 175u8, 170u8, 183u8, 10u8, 244u8, 117u8, 111u8, 140u8, + 157u8, 153u8, 212u8, 94u8, 119u8, 213u8, 44u8, 41u8, 8u8, 114u8, 200u8, ], ) } - #[doc = "Start the process of destroying a fungible asset class."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`start_destroy` is the first in a series of extrinsics that should be called, to allow"] - #[doc = "destruction of an asset class."] + #[doc = "Origin must be Signed and there must be an approval in place between signer and"] + #[doc = "`delegate`."] #[doc = ""] - #[doc = "The origin must conform to `ForceOrigin` or must be `Signed` by the asset's `owner`."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] #[doc = ""] - #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] - #[doc = "an account contains holds or freezes in place."] - pub fn start_destroy( + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn cancel_approval( &self, - id: types::start_destroy::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::cancel_approval::Id, + delegate: types::cancel_approval::Delegate, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "start_destroy", - types::StartDestroy { id }, + "cancel_approval", + types::CancelApproval { id, delegate }, [ - 125u8, 82u8, 151u8, 106u8, 25u8, 49u8, 68u8, 203u8, 247u8, 175u8, - 117u8, 230u8, 84u8, 98u8, 172u8, 73u8, 233u8, 218u8, 212u8, 198u8, - 69u8, 35u8, 15u8, 179u8, 161u8, 205u8, 190u8, 109u8, 198u8, 214u8, - 65u8, 164u8, + 74u8, 117u8, 101u8, 78u8, 152u8, 208u8, 16u8, 102u8, 34u8, 195u8, 61u8, + 36u8, 85u8, 91u8, 253u8, 182u8, 61u8, 199u8, 12u8, 102u8, 149u8, 20u8, + 238u8, 207u8, 236u8, 50u8, 63u8, 249u8, 34u8, 85u8, 88u8, 229u8, ], ) } - #[doc = "Destroy all accounts associated with a given asset."] + #[doc = "Cancel all of some asset approved for delegated transfer by a third-party account."] #[doc = ""] - #[doc = "`destroy_accounts` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Origin must be either ForceOrigin or Signed origin with the signer being the Admin"] + #[doc = "account of the asset `id`."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all accounts. It will destroy `RemoveItemsLimit` accounts at a time."] + #[doc = "Unreserves any deposit previously reserved by `approve_transfer` for the approval."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `delegate`: The account delegated permission to transfer asset."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedAccounts` event."] - pub fn destroy_accounts( + #[doc = "Emits `ApprovalCancelled` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn force_cancel_approval( &self, - id: types::destroy_accounts::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + id: types::force_cancel_approval::Id, + owner: types::force_cancel_approval::Owner, + delegate: types::force_cancel_approval::Delegate, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "destroy_accounts", - types::DestroyAccounts { id }, + "force_cancel_approval", + types::ForceCancelApproval { id, owner, delegate }, [ - 236u8, 102u8, 233u8, 170u8, 179u8, 46u8, 42u8, 29u8, 200u8, 116u8, - 62u8, 114u8, 233u8, 59u8, 217u8, 215u8, 109u8, 232u8, 147u8, 95u8, - 255u8, 248u8, 119u8, 222u8, 216u8, 165u8, 138u8, 47u8, 28u8, 56u8, - 204u8, 93u8, + 27u8, 231u8, 85u8, 241u8, 18u8, 151u8, 64u8, 234u8, 11u8, 84u8, 252u8, + 128u8, 44u8, 247u8, 132u8, 82u8, 34u8, 210u8, 202u8, 50u8, 158u8, 45u8, + 239u8, 192u8, 7u8, 24u8, 39u8, 95u8, 57u8, 21u8, 178u8, 113u8, ], ) } - #[doc = "Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit)."] + #[doc = "Transfer some asset balance from a previously delegated account to some third-party"] + #[doc = "account."] #[doc = ""] - #[doc = "`destroy_approvals` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state."] + #[doc = "Origin must be Signed and there must be an approval in place by the `owner` to the"] + #[doc = "signer."] #[doc = ""] - #[doc = "Due to weight restrictions, this function may need to be called multiple times to fully"] - #[doc = "destroy all approvals. It will destroy `RemoveItemsLimit` approvals at a time."] + #[doc = "If the entire amount approved for transfer is transferred, then any deposit previously"] + #[doc = "reserved by `approve_transfer` is unreserved."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `owner`: The account which previously approved for a transfer of at least `amount` and"] + #[doc = "from which the asset balance will be withdrawn."] + #[doc = "- `destination`: The account to which the asset balance of `amount` will be transferred."] + #[doc = "- `amount`: The amount of assets to transfer."] #[doc = ""] - #[doc = "Each call emits the `Event::DestroyedApprovals` event."] - pub fn destroy_approvals( + #[doc = "Emits `TransferredApproved` on success."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn transfer_approved( &self, - id: types::destroy_approvals::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + id: types::transfer_approved::Id, + owner: types::transfer_approved::Owner, + destination: types::transfer_approved::Destination, + amount: types::transfer_approved::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "destroy_approvals", - types::DestroyApprovals { id }, + "transfer_approved", + types::TransferApproved { id, owner, destination, amount }, [ - 34u8, 35u8, 15u8, 44u8, 239u8, 232u8, 88u8, 130u8, 130u8, 87u8, 171u8, - 255u8, 247u8, 179u8, 14u8, 35u8, 47u8, 223u8, 32u8, 232u8, 41u8, 105u8, - 207u8, 199u8, 90u8, 136u8, 144u8, 139u8, 252u8, 76u8, 177u8, 106u8, + 214u8, 51u8, 243u8, 129u8, 116u8, 233u8, 199u8, 183u8, 25u8, 5u8, + 109u8, 85u8, 255u8, 68u8, 36u8, 99u8, 99u8, 179u8, 34u8, 66u8, 65u8, + 82u8, 189u8, 174u8, 22u8, 100u8, 211u8, 13u8, 178u8, 19u8, 128u8, + 177u8, ], ) } - #[doc = "Complete destroying asset and unreserve currency."] + #[doc = "Create an asset account for non-provider assets."] #[doc = ""] - #[doc = "`finish_destroy` should only be called after `start_destroy` has been called, and the"] - #[doc = "asset is in a `Destroying` state. All accounts or approvals should be destroyed before"] - #[doc = "hand."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to be destroyed. This must identify an existing"] - #[doc = " asset."] + #[doc = "- `origin`: Must be Signed; the signer account must have sufficient funds for a deposit"] + #[doc = " to be taken."] + #[doc = "- `id`: The identifier of the asset for the account to be created."] #[doc = ""] - #[doc = "Each successful call emits the `Event::Destroyed` event."] - pub fn finish_destroy( + #[doc = "Emits `Touched` event when successful."] + pub fn touch( &self, - id: types::finish_destroy::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + id: types::touch::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "finish_destroy", - types::FinishDestroy { id }, + "touch", + types::Touch { id }, [ - 132u8, 67u8, 78u8, 84u8, 240u8, 51u8, 176u8, 119u8, 48u8, 34u8, 153u8, - 37u8, 25u8, 171u8, 21u8, 164u8, 53u8, 214u8, 36u8, 149u8, 20u8, 240u8, - 123u8, 195u8, 170u8, 162u8, 118u8, 81u8, 176u8, 218u8, 114u8, 113u8, + 50u8, 185u8, 46u8, 134u8, 136u8, 31u8, 191u8, 34u8, 215u8, 150u8, 73u8, + 103u8, 140u8, 36u8, 95u8, 156u8, 201u8, 152u8, 32u8, 165u8, 47u8, 86u8, + 163u8, 255u8, 8u8, 251u8, 176u8, 138u8, 165u8, 48u8, 12u8, 27u8, ], ) } - #[doc = "Mint assets of a particular class."] + #[doc = "Return the deposit (if any) of an asset account or a consumer reference (if any) of an"] + #[doc = "account."] #[doc = ""] - #[doc = "The origin must be Signed and the sender must be the Issuer of the asset `id`."] + #[doc = "The origin must be Signed."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount minted."] - #[doc = "- `beneficiary`: The account to be credited with the minted assets."] - #[doc = "- `amount`: The amount of the asset to be minted."] + #[doc = "- `id`: The identifier of the asset for which the caller would like the deposit"] + #[doc = " refunded."] + #[doc = "- `allow_burn`: If `true` then assets may be destroyed in order to complete the refund."] #[doc = ""] - #[doc = "Emits `Issued` event when successful."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`."] - pub fn mint( + #[doc = "Emits `Refunded` event when successful."] + pub fn refund( &self, - id: types::mint::Id, - beneficiary: types::mint::Beneficiary, - amount: types::mint::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::refund::Id, + allow_burn: types::refund::AllowBurn, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "mint", - types::Mint { id, beneficiary, amount }, + "refund", + types::Refund { id, allow_burn }, [ - 172u8, 131u8, 103u8, 81u8, 206u8, 2u8, 143u8, 114u8, 137u8, 60u8, - 147u8, 67u8, 226u8, 64u8, 71u8, 11u8, 36u8, 145u8, 51u8, 8u8, 0u8, - 110u8, 8u8, 195u8, 103u8, 205u8, 156u8, 43u8, 215u8, 12u8, 150u8, - 135u8, + 218u8, 207u8, 8u8, 41u8, 154u8, 250u8, 117u8, 174u8, 143u8, 133u8, + 34u8, 113u8, 171u8, 18u8, 177u8, 227u8, 146u8, 92u8, 12u8, 226u8, + 101u8, 230u8, 246u8, 162u8, 32u8, 73u8, 138u8, 158u8, 95u8, 226u8, + 75u8, 95u8, ], ) } - #[doc = "Reduce the balance of `who` by as much as possible up to `amount` assets of `id`."] - #[doc = ""] - #[doc = "Origin must be Signed and the sender should be the Manager of the asset `id`."] + #[doc = "Sets the minimum balance of an asset."] #[doc = ""] - #[doc = "Bails with `NoAccount` if the `who` is already dead."] + #[doc = "Only works if there aren't any accounts that are holding the asset or if"] + #[doc = "the new value of `min_balance` is less than the old one."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount burned."] - #[doc = "- `who`: The account to be debited from."] - #[doc = "- `amount`: The maximum amount by which `who`'s balance should be reduced."] + #[doc = "Origin must be Signed and the sender has to be the Owner of the"] + #[doc = "asset `id`."] #[doc = ""] - #[doc = "Emits `Burned` with the actual amount burned. If this takes the balance to below the"] - #[doc = "minimum for the asset, then the amount burned is increased to take it to zero."] + #[doc = "- `id`: The identifier of the asset."] + #[doc = "- `min_balance`: The new value of `min_balance`."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Post-existence of `who`; Pre & post Zombie-status of `who`."] - pub fn burn( + #[doc = "Emits `AssetMinBalanceChanged` event when successful."] + pub fn set_min_balance( &self, - id: types::burn::Id, - who: types::burn::Who, - amount: types::burn::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::set_min_balance::Id, + min_balance: types::set_min_balance::MinBalance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "burn", - types::Burn { id, who, amount }, + "set_min_balance", + types::SetMinBalance { id, min_balance }, [ - 105u8, 133u8, 82u8, 100u8, 124u8, 65u8, 174u8, 31u8, 152u8, 45u8, 23u8, - 200u8, 23u8, 199u8, 239u8, 8u8, 187u8, 142u8, 21u8, 192u8, 35u8, 211u8, - 172u8, 130u8, 169u8, 74u8, 167u8, 36u8, 149u8, 7u8, 19u8, 37u8, + 141u8, 241u8, 137u8, 50u8, 232u8, 122u8, 252u8, 104u8, 185u8, 170u8, + 246u8, 0u8, 20u8, 128u8, 136u8, 155u8, 62u8, 243u8, 4u8, 221u8, 42u8, + 225u8, 16u8, 245u8, 58u8, 127u8, 84u8, 193u8, 175u8, 165u8, 35u8, 49u8, ], ) } - #[doc = "Move some assets from the sender account to another."] - #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "Create an asset account for `who`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "A deposit will be taken from the signer account."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "- `origin`: Must be Signed 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)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub fn transfer( + #[doc = "Emits `Touched` event when successful."] + pub fn touch_other( &self, - id: types::transfer::Id, - target: types::transfer::Target, - amount: types::transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + id: types::touch_other::Id, + who: types::touch_other::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "transfer", - types::Transfer { id, target, amount }, + "touch_other", + types::TouchOther { id, who }, [ - 126u8, 31u8, 70u8, 179u8, 222u8, 190u8, 12u8, 19u8, 94u8, 225u8, 217u8, - 109u8, 54u8, 69u8, 124u8, 61u8, 97u8, 199u8, 193u8, 166u8, 39u8, 143u8, - 125u8, 251u8, 87u8, 173u8, 149u8, 91u8, 182u8, 18u8, 184u8, 65u8, + 104u8, 85u8, 80u8, 68u8, 135u8, 149u8, 102u8, 104u8, 188u8, 79u8, 42u8, + 34u8, 241u8, 84u8, 183u8, 176u8, 215u8, 172u8, 78u8, 196u8, 206u8, + 214u8, 138u8, 240u8, 92u8, 65u8, 117u8, 170u8, 140u8, 120u8, 50u8, + 166u8, ], ) } - #[doc = "Move some assets from the sender account to another, keeping the sender account alive."] + #[doc = "Return the deposit (if any) of a target asset account. Useful if you are the depositor."] #[doc = ""] - #[doc = "Origin must be Signed."] + #[doc = "The origin must be Signed and either the account owner, depositor, or asset `Admin`. In"] + #[doc = "order to burn a non-zero balance of the asset, the caller must be the account and should"] + #[doc = "use `refund`."] #[doc = ""] - #[doc = "- `id`: The identifier of the asset to have some amount transferred."] - #[doc = "- `target`: The account to be credited."] - #[doc = "- `amount`: The amount by which the sender's balance of assets should be reduced and"] - #[doc = "`target`'s balance increased. The amount actually transferred may be slightly greater in"] - #[doc = "the case that the transfer would otherwise take the sender balance above zero but below"] - #[doc = "the minimum balance. Must be greater than zero."] + #[doc = "- `id`: The identifier of the asset for the account holding a deposit."] + #[doc = "- `who`: The account to refund."] #[doc = ""] - #[doc = "Emits `Transferred` with the actual amount transferred. If this takes the source balance"] - #[doc = "to below the minimum for the asset, then the amount transferred is increased to take it"] - #[doc = "to zero."] + #[doc = "It will fail with either [`Error::ContainsHolds`] or [`Error::ContainsFreezes`] if"] + #[doc = "the asset account contains holds or freezes in place."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - #[doc = "Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of"] - #[doc = "`target`."] - pub fn transfer_keep_alive( + #[doc = "Emits `Refunded` event when successful."] + pub fn refund_other( &self, - id: types::transfer_keep_alive::Id, - target: types::transfer_keep_alive::Target, - amount: types::transfer_keep_alive::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + id: types::refund_other::Id, + who: types::refund_other::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "Assets", - "transfer_keep_alive", - types::TransferKeepAlive { id, target, amount }, + "refund_other", + types::RefundOther { id, who }, [ - 99u8, 101u8, 219u8, 188u8, 238u8, 230u8, 141u8, 43u8, 38u8, 175u8, - 46u8, 89u8, 33u8, 23u8, 223u8, 115u8, 108u8, 18u8, 190u8, 213u8, 157u8, - 12u8, 139u8, 97u8, 7u8, 75u8, 196u8, 159u8, 122u8, 32u8, 164u8, 154u8, - ], - ) - } - #[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, + 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 for the asset class."] + #[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 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 = "- `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 fn set_team( + pub fn block( &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 { + 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", - "set_team", - types::SetTeam { id, issuer, admin, freezer }, + "block", + types::Block { id, who }, [ - 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, + 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 = "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 fn set_metadata( + #[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::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 { + 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", - "set_metadata", - types::SetMetadata { id, name, symbol, decimals }, + "transfer_all", + types::TransferAll { id, dest, keep_alive }, [ - 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, + 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 = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_assets::pallet::Event; - pub mod events { - use super::runtime_types; + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_assets::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 = "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 owner_changed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for OwnerChanged { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "OwnerChanged"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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, + } + pub mod frozen { + 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 Frozen { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Frozen"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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, + } + pub mod thawed { + 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 { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Thawed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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, + } + 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, @@ -19770,21 +18815,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 class was created."] - pub struct Created { - pub asset_id: created::AssetId, - pub creator: created::Creator, - pub owner: created::Owner, + #[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 created { + pub mod accounts_destroyed { 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; + pub type AccountsDestroyed = ::core::primitive::u32; + pub type AccountsRemaining = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Created { + impl ::subxt::ext::subxt_core::events::StaticEvent for AccountsDestroyed { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Created"; + const EVENT: &'static str = "AccountsDestroyed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19793,21 +18838,80 @@ 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 = "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 issued { + 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 Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Issued { + impl ::subxt::ext::subxt_core::events::StaticEvent for ForceCreated { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Issued"; + const EVENT: &'static str = "ForceCreated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19816,23 +18920,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 = "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 = "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 transferred { + pub mod metadata_set { 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 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 Transferred { + impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovedTransfer { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Transferred"; + const EVENT: &'static str = "ApprovedTransfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19841,21 +18991,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 assets were destroyed."] - pub struct Burned { - pub asset_id: burned::AssetId, - pub owner: burned::Owner, - pub balance: burned::Balance, + #[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 burned { + 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 Balance = ::core::primitive::u128; + pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { + impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovalCancelled { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Burned"; + const EVENT: &'static str = "ApprovalCancelled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19864,23 +19014,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 = "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 = "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 team_changed { + pub mod transferred_approved { 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 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 TeamChanged { + impl ::subxt::ext::subxt_core::events::StaticEvent for TransferredApproved { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "TeamChanged"; + const EVENT: &'static str = "TransferredApproved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19889,19 +19042,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 owner changed."] - pub struct OwnerChanged { - pub asset_id: owner_changed::AssetId, - pub owner: owner_changed::Owner, + #[doc = "An asset has had its attributes changed by the `Force` origin."] + pub struct AssetStatusChanged { + pub asset_id: asset_status_changed::AssetId, } - pub mod owner_changed { + pub mod asset_status_changed { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OwnerChanged { + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetStatusChanged { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "OwnerChanged"; + const EVENT: &'static str = "AssetStatusChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19910,19 +19061,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 account `who` was frozen."] - pub struct Frozen { - pub asset_id: frozen::AssetId, - pub who: frozen::Who, + #[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 frozen { + pub mod asset_min_balance_changed { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type NewMinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Frozen { + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetMinBalanceChanged { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Frozen"; + const EVENT: &'static str = "AssetMinBalanceChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19931,19 +19082,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 thawed."] - pub struct Thawed { - pub asset_id: thawed::AssetId, - pub who: thawed::Who, + #[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 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 Thawed { + impl ::subxt::ext::subxt_core::events::StaticEvent for Touched { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Thawed"; + const EVENT: &'static str = "Touched"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19952,17 +19105,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 = "Some account `who` was blocked."] + pub struct Blocked { + pub asset_id: blocked::AssetId, + pub who: blocked::Who, } - pub mod asset_frozen { + pub mod blocked { use super::runtime_types; pub type AssetId = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetFrozen { + impl ::subxt::ext::subxt_core::events::StaticEvent for Blocked { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetFrozen"; + const EVENT: &'static str = "Blocked"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19971,17 +19126,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 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 asset_thawed { + pub mod deposited { use super::runtime_types; pub type AssetId = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetThawed { + impl ::subxt::ext::subxt_core::events::StaticEvent for Deposited { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetThawed"; + const EVENT: &'static str = "Deposited"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19990,22 +19149,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 = "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 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 accounts_destroyed { + pub mod withdrawn { 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; + 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 AccountsDestroyed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AccountsDestroyed"; + } + 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, @@ -20013,21 +19680,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 = "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 = "`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 approvals_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 ApprovalsDestroyed = ::core::primitive::u32; - pub type ApprovalsRemaining = ::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 ApprovalsDestroyed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovalsDestroyed"; + 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, @@ -20036,17 +19705,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 is in the process of being destroyed."] - pub struct DestructionStarted { - pub asset_id: destruction_started::AssetId, + #[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 destruction_started { + 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 DestructionStarted { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "DestructionStarted"; + 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, @@ -20055,66 +19730,745 @@ 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 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 destroyed { + 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 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, + impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { + const PALLET: &'static str = "AssetsHolder"; + const EVENT: &'static str = "Burned"; } - pub mod force_created { + } + pub mod storage { + use super::runtime_types; + pub mod types { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ForceCreated { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ForceCreated"; + 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; + } } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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, + 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 metadata_set { + } + } + 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 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; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 with deterministic address"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = "- `nonce`: User-provided nonce for address uniqueness"] + #[doc = ""] + #[doc = "The multisig address is deterministically derived from:"] + #[doc = "hash(pallet_id || sorted_signers || threshold || nonce)"] + #[doc = ""] + #[doc = "Signers are automatically sorted before hashing, so order doesn't matter."] + #[doc = ""] + #[doc = "Economic costs:"] + #[doc = "- MultisigFee: burned immediately (spam prevention)"] + #[doc = "- MultisigDeposit: reserved until dissolution, then returned to creator (storage bond)"] + pub struct CreateMultisig { + pub signers: create_multisig::Signers, + pub threshold: create_multisig::Threshold, + pub nonce: create_multisig::Nonce, + } + 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; + pub type Nonce = ::core::primitive::u64; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateMultisig { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "create_multisig"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Propose a transaction to be executed by the multisig"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] + #[doc = ""] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (refundable - returned immediately on execution/cancellation)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before creating a new proposal, ALL proposer's expired"] + #[doc = "proposals are automatically removed. This is the primary cleanup mechanism."] + #[doc = ""] + #[doc = "**For threshold=1:** If the multisig threshold is 1, the proposal executes immediately."] + #[doc = ""] + #[doc = "**Weight:** Charged upfront for worst-case (high-security path with decode)."] + #[doc = "Refunded to actual cost on success based on whether HS path was taken."] + 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 proposal status changes to `Approved` and can be executed via `execute()`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, refunds based on actual"] + pub struct Approve { + pub multisig_address: approve::MultisigAddress, + pub proposal_id: approve::ProposalId, + } + pub mod approve { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Approve { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "approve"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel a proposed transaction (only by proposer)"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] + pub struct Cancel { + pub multisig_address: cancel::MultisigAddress, + pub proposal_id: cancel::ProposalId, + } + pub mod cancel { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "cancel"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Remove expired proposals and return deposits to proposers"] + #[doc = ""] + #[doc = "Can only be called by signers of the multisig."] + #[doc = "Only removes Active proposals that have expired (past expiry block)."] + #[doc = "Executed and Cancelled proposals are automatically cleaned up immediately."] + #[doc = ""] + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows any signer to help clean up storage even if proposer is inactive."] + pub struct RemoveExpired { + pub multisig_address: remove_expired::MultisigAddress, + pub proposal_id: remove_expired::ProposalId, + } + pub mod remove_expired { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveExpired { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "remove_expired"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Claim all deposits from expired proposals"] + #[doc = ""] + #[doc = "This is a batch operation that removes all expired proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Active and past expiry block"] + #[doc = ""] + #[doc = "Note: Executed and Cancelled proposals are automatically cleaned up immediately,"] + #[doc = "so only Active+Expired proposals need manual cleanup."] + #[doc = ""] + #[doc = "Returns all proposal deposits to the proposer in a single transaction."] + pub struct ClaimDeposits { + pub multisig_address: claim_deposits::MultisigAddress, + } + 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 = "Execute an approved proposal"] + #[doc = ""] + #[doc = "Can be called by any signer of the multisig once the proposal has reached"] + #[doc = "the approval threshold (status = Approved). The proposal must not be expired."] + #[doc = ""] + #[doc = "On execution:"] + #[doc = "- The call is decoded and dispatched as the multisig account"] + #[doc = "- Proposal is removed from storage"] + #[doc = "- Deposit is returned to the proposer"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to execute"] + pub struct Execute { + pub multisig_address: execute::MultisigAddress, + pub proposal_id: execute::ProposalId, + } + pub mod execute { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Execute { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "execute"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 dissolving a multisig account"] + #[doc = ""] + #[doc = "Signers call this to approve dissolving the multisig."] + #[doc = "When threshold is reached, the multisig is automatically dissolved."] + #[doc = ""] + #[doc = "Requirements:"] + #[doc = "- Caller must be a signer"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up"] + #[doc = "- Multisig account balance must be zero"] + #[doc = ""] + #[doc = "When threshold is reached:"] + #[doc = "- Deposit is returned to creator"] + #[doc = "- Multisig storage is removed"] + pub struct ApproveDissolve { + pub multisig_address: approve_dissolve::MultisigAddress, + } + pub mod approve_dissolve { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ApproveDissolve { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "approve_dissolve"; + } } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataSet"; + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Create a new multisig account with deterministic address"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = "- `nonce`: User-provided nonce for address uniqueness"] + #[doc = ""] + #[doc = "The multisig address is deterministically derived from:"] + #[doc = "hash(pallet_id || sorted_signers || threshold || nonce)"] + #[doc = ""] + #[doc = "Signers are automatically sorted before hashing, so order doesn't matter."] + #[doc = ""] + #[doc = "Economic costs:"] + #[doc = "- MultisigFee: burned immediately (spam prevention)"] + #[doc = "- MultisigDeposit: reserved until dissolution, then returned to creator (storage bond)"] + pub fn create_multisig( + &self, + signers: types::create_multisig::Signers, + threshold: types::create_multisig::Threshold, + nonce: types::create_multisig::Nonce, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "create_multisig", + types::CreateMultisig { signers, threshold, nonce }, + [ + 126u8, 145u8, 23u8, 129u8, 179u8, 174u8, 124u8, 92u8, 17u8, 77u8, 39u8, + 143u8, 138u8, 202u8, 71u8, 46u8, 71u8, 104u8, 68u8, 236u8, 223u8, + 128u8, 124u8, 89u8, 133u8, 103u8, 92u8, 150u8, 75u8, 49u8, 253u8, + 177u8, + ], + ) + } + #[doc = "Propose a transaction to be executed by the multisig"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] + #[doc = ""] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (refundable - returned immediately on execution/cancellation)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "**Auto-cleanup:** Before creating a new proposal, ALL proposer's expired"] + #[doc = "proposals are automatically removed. This is the primary cleanup mechanism."] + #[doc = ""] + #[doc = "**For threshold=1:** If the multisig threshold is 1, the proposal executes immediately."] + #[doc = ""] + #[doc = "**Weight:** Charged upfront for worst-case (high-security path with decode)."] + #[doc = "Refunded to actual cost on success based on whether HS path was taken."] + 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 proposal status changes to `Approved` and can be executed via `execute()`."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, refunds based on actual"] + pub fn approve( + &self, + multisig_address: types::approve::MultisigAddress, + proposal_id: types::approve::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "approve", + types::Approve { multisig_address, proposal_id }, + [ + 9u8, 56u8, 186u8, 135u8, 222u8, 23u8, 37u8, 64u8, 123u8, 199u8, 205u8, + 29u8, 216u8, 128u8, 37u8, 185u8, 170u8, 121u8, 75u8, 100u8, 198u8, + 80u8, 16u8, 249u8, 170u8, 91u8, 162u8, 201u8, 215u8, 81u8, 87u8, 190u8, + ], + ) + } + #[doc = "Cancel a proposed transaction (only by proposer)"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] + pub fn cancel( + &self, + multisig_address: types::cancel::MultisigAddress, + proposal_id: types::cancel::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "cancel", + types::Cancel { multisig_address, proposal_id }, + [ + 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 expired proposals and return deposits to proposers"] + #[doc = ""] + #[doc = "Can only be called by signers of the multisig."] + #[doc = "Only removes Active proposals that have expired (past expiry block)."] + #[doc = "Executed and Cancelled proposals are automatically cleaned up immediately."] + #[doc = ""] + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows any signer to help clean up storage even if proposer is inactive."] + pub fn remove_expired( + &self, + multisig_address: types::remove_expired::MultisigAddress, + proposal_id: types::remove_expired::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "remove_expired", + types::RemoveExpired { multisig_address, proposal_id }, + [ + 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 expired proposals"] + #[doc = ""] + #[doc = "This is a batch operation that removes all expired proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Active and past expiry block"] + #[doc = ""] + #[doc = "Note: Executed and Cancelled proposals are automatically cleaned up immediately,"] + #[doc = "so only Active+Expired proposals need manual cleanup."] + #[doc = ""] + #[doc = "Returns all proposal deposits to the proposer in a single transaction."] + pub fn claim_deposits( + &self, + 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 = "Execute an approved proposal"] + #[doc = ""] + #[doc = "Can be called by any signer of the multisig once the proposal has reached"] + #[doc = "the approval threshold (status = Approved). The proposal must not be expired."] + #[doc = ""] + #[doc = "On execution:"] + #[doc = "- The call is decoded and dispatched as the multisig account"] + #[doc = "- Proposal is removed from storage"] + #[doc = "- Deposit is returned to the proposer"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to execute"] + pub fn execute( + &self, + multisig_address: types::execute::MultisigAddress, + proposal_id: types::execute::ProposalId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "execute", + types::Execute { multisig_address, proposal_id }, + [ + 209u8, 110u8, 225u8, 231u8, 188u8, 230u8, 192u8, 42u8, 43u8, 233u8, + 158u8, 149u8, 58u8, 203u8, 142u8, 44u8, 40u8, 27u8, 211u8, 194u8, 26u8, + 7u8, 7u8, 254u8, 29u8, 245u8, 230u8, 195u8, 82u8, 108u8, 1u8, 27u8, + ], + ) + } + #[doc = "Approve dissolving a multisig account"] + #[doc = ""] + #[doc = "Signers call this to approve dissolving the multisig."] + #[doc = "When threshold is reached, the multisig is automatically dissolved."] + #[doc = ""] + #[doc = "Requirements:"] + #[doc = "- Caller must be a signer"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up"] + #[doc = "- Multisig account balance must be zero"] + #[doc = ""] + #[doc = "When threshold is reached:"] + #[doc = "- Deposit is returned to creator"] + #[doc = "- Multisig storage is removed"] + pub fn approve_dissolve( + &self, + multisig_address: types::approve_dissolve::MultisigAddress, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "approve_dissolve", + types::ApproveDissolve { multisig_address }, + [ + 156u8, 98u8, 164u8, 184u8, 61u8, 224u8, 117u8, 109u8, 44u8, 173u8, + 59u8, 188u8, 164u8, 233u8, 191u8, 223u8, 240u8, 203u8, 164u8, 113u8, + 184u8, 187u8, 41u8, 154u8, 87u8, 135u8, 229u8, 56u8, 35u8, 196u8, + 136u8, 241u8, + ], + ) + } } + } + #[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, @@ -20122,17 +20476,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 = "Metadata has been cleared for an asset."] - pub struct MetadataCleared { - pub asset_id: metadata_cleared::AssetId, - } - pub mod metadata_cleared { + #[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 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 MetadataCleared { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataCleared"; + 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, @@ -20141,23 +20506,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 = "(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, + #[doc = "A proposal has been created"] + pub struct ProposalCreated { + pub multisig_address: proposal_created::MultisigAddress, + pub proposer: proposal_created::Proposer, + pub proposal_id: proposal_created::ProposalId, } - pub mod approved_transfer { + pub mod proposal_created { 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; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovedTransfer { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovedTransfer"; + 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, @@ -20166,21 +20529,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 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 proposal has been approved by a signer"] + pub struct ProposalApproved { + pub multisig_address: proposal_approved::MultisigAddress, + pub approver: proposal_approved::Approver, + pub proposal_id: proposal_approved::ProposalId, + pub approvals_count: proposal_approved::ApprovalsCount, + } + pub mod proposal_approved { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Approver = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + pub type ApprovalsCount = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovalCancelled { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovalCancelled"; + 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, @@ -20189,26 +20554,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 reached threshold and is ready to execute"] + pub struct ProposalReadyToExecute { + pub multisig_address: proposal_ready_to_execute::MultisigAddress, + pub proposal_id: proposal_ready_to_execute::ProposalId, + pub approvals_count: proposal_ready_to_execute::ApprovalsCount, } - pub mod transferred_approved { + pub mod proposal_ready_to_execute { 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 ProposalId = ::core::primitive::u32; + pub type ApprovalsCount = ::core::primitive::u32; } - 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 ProposalReadyToExecute { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalReadyToExecute"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20217,17 +20577,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 = "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 executed"] + #[doc = "Contains all data needed for indexing by SubSquid"] + pub struct ProposalExecuted { + pub multisig_address: proposal_executed::MultisigAddress, + pub proposal_id: proposal_executed::ProposalId, + pub proposer: proposal_executed::Proposer, + pub call: proposal_executed::Call, + pub approvers: proposal_executed::Approvers, + pub result: proposal_executed::Result, + } + pub mod proposal_executed { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Call = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Approvers = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetStatusChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetStatusChanged"; + 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, @@ -20236,19 +20610,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 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, + #[doc = "A proposal has been cancelled by the proposer"] + pub struct ProposalCancelled { + pub multisig_address: proposal_cancelled::MultisigAddress, + pub proposer: proposal_cancelled::Proposer, + pub proposal_id: proposal_cancelled::ProposalId, } - pub mod asset_min_balance_changed { + pub mod proposal_cancelled { 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 Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; } - 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 ProposalCancelled { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalCancelled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20257,21 +20633,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 created with a deposit from `depositor`."] - pub struct Touched { - pub asset_id: touched::AssetId, - pub who: touched::Who, - pub depositor: touched::Depositor, - } - pub mod touched { + #[doc = "Expired proposal was removed from storage"] + pub struct ProposalRemoved { + pub multisig_address: proposal_removed::MultisigAddress, + pub proposal_id: proposal_removed::ProposalId, + pub proposer: proposal_removed::Proposer, + pub removed_by: proposal_removed::RemovedBy, + } + pub mod proposal_removed { use super::runtime_types; - pub type 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 ProposalId = ::core::primitive::u32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type RemovedBy = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Touched { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Touched"; + 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, @@ -20280,19 +20658,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 account `who` was blocked."] - pub struct Blocked { - pub asset_id: blocked::AssetId, - pub who: blocked::Who, - } - pub mod blocked { + #[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 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 Blocked { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Blocked"; + 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, @@ -20301,21 +20685,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 assets were deposited (e.g. for transaction fees)."] - pub struct Deposited { - pub asset_id: deposited::AssetId, - pub who: deposited::Who, - pub amount: deposited::Amount, + #[doc = "A signer approved dissolving the multisig"] + pub struct DissolveApproved { + pub multisig_address: dissolve_approved::MultisigAddress, + pub approver: dissolve_approved::Approver, + pub approvals_count: dissolve_approved::ApprovalsCount, } - pub mod deposited { + pub mod dissolve_approved { 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 Approver = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ApprovalsCount = ::core::primitive::u32; } - 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 DissolveApproved { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "DissolveApproved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20324,392 +20708,241 @@ 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 (threshold reached)"] + pub struct MultisigDissolved { + pub multisig_address: multisig_dissolved::MultisigAddress, + pub deposit_returned: multisig_dissolved::DepositReturned, + pub approvers: multisig_dissolved::Approvers, } - 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 DepositReturned = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Approvers = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; } - 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 multisigs { use super::runtime_types; - pub type Account = runtime_types::pallet_assets::types::AssetAccount< - ::core::primitive::u128, - ::core::primitive::u128, - (), + pub type Multisigs = runtime_types::pallet_multisig::MultisigData< ::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, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, ::core::primitive::u128, + runtime_types::bounded_collections::bounded_btree_map::BoundedBTreeMap< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, + >, >; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type 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 type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::core::primitive::u32; } - pub mod next_asset_id { + pub mod dissolve_approvals { use super::runtime_types; - pub type NextAssetId = ::core::primitive::u32; + pub type DissolveApprovals = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } } pub struct StorageApi; impl StorageApi { - #[doc = " Details of an asset."] - pub fn asset_iter( + #[doc = " Multisigs stored by their deterministic address"] + pub fn multisigs_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::asset::Asset, + types::multisigs::Multisigs, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Asset", + "Multisig", + "Multisigs", (), [ - 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, + 81u8, 182u8, 236u8, 127u8, 98u8, 244u8, 6u8, 51u8, 209u8, 6u8, 214u8, + 144u8, 49u8, 117u8, 203u8, 39u8, 180u8, 247u8, 172u8, 228u8, 72u8, + 25u8, 171u8, 55u8, 41u8, 236u8, 14u8, 135u8, 22u8, 6u8, 241u8, 230u8, ], ) } - #[doc = " Details of an asset."] - pub fn asset( + #[doc = " Multisigs stored by their deterministic address"] + pub fn multisigs( &self, - _0: types::asset::Param0, + _0: types::multisigs::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::asset::Param0, + types::multisigs::Param0, >, - types::asset::Asset, + types::multisigs::Multisigs, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Asset", + "Multisig", + "Multisigs", ::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, + 81u8, 182u8, 236u8, 127u8, 98u8, 244u8, 6u8, 51u8, 209u8, 6u8, 214u8, + 144u8, 49u8, 117u8, 203u8, 39u8, 180u8, 247u8, 172u8, 228u8, 72u8, + 25u8, 171u8, 55u8, 41u8, 236u8, 14u8, 135u8, 22u8, 6u8, 241u8, 230u8, ], ) } - #[doc = " The holdings of a specific account for a specific asset."] - pub fn account_iter( + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::account::Account, + types::proposals::Proposals, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Account", + "Multisig", + "Proposals", (), [ - 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, + 102u8, 10u8, 240u8, 43u8, 229u8, 237u8, 64u8, 243u8, 64u8, 7u8, 59u8, + 83u8, 229u8, 106u8, 209u8, 184u8, 240u8, 116u8, 205u8, 176u8, 4u8, + 247u8, 234u8, 87u8, 177u8, 197u8, 117u8, 38u8, 83u8, 216u8, 218u8, + 67u8, ], ) } - #[doc = " The holdings of a specific account for a specific asset."] - pub fn account_iter1( + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals_iter1( &self, - _0: types::account::Param0, + _0: types::proposals::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param0, + types::proposals::Param0, >, - types::account::Account, + types::proposals::Proposals, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Account", + "Multisig", + "Proposals", ::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, + 102u8, 10u8, 240u8, 43u8, 229u8, 237u8, 64u8, 243u8, 64u8, 7u8, 59u8, + 83u8, 229u8, 106u8, 209u8, 184u8, 240u8, 116u8, 205u8, 176u8, 4u8, + 247u8, 234u8, 87u8, 177u8, 197u8, 117u8, 38u8, 83u8, 216u8, 218u8, + 67u8, ], ) } - #[doc = " The holdings of a specific account for a specific asset."] - pub fn account( + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals( &self, - _0: types::account::Param0, - _1: types::account::Param1, + _0: types::proposals::Param0, + _1: types::proposals::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param0, + types::proposals::Param0, >, ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param1, + types::proposals::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, - (), - (), + types::proposals::Proposals, ::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", + "Multisig", + "Proposals", ( ::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, + 102u8, 10u8, 240u8, 43u8, 229u8, 237u8, 64u8, 243u8, 64u8, 7u8, 59u8, + 83u8, 229u8, 106u8, 209u8, 184u8, 240u8, 116u8, 205u8, 176u8, 4u8, + 247u8, 234u8, 87u8, 177u8, 197u8, 117u8, 38u8, 83u8, 216u8, 218u8, + 67u8, ], ) } - #[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 = " Dissolve approvals: tracks which signers approved dissolving the multisig"] + #[doc = " Maps multisig_address -> Vec"] + pub fn dissolve_approvals_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::dissolve_approvals::DissolveApprovals, (), - > { - ::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( + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Multisig", + "DissolveApprovals", + (), + [ + 204u8, 17u8, 210u8, 54u8, 125u8, 128u8, 75u8, 21u8, 158u8, 13u8, 205u8, + 89u8, 98u8, 73u8, 141u8, 159u8, 53u8, 129u8, 19u8, 195u8, 2u8, 178u8, + 26u8, 137u8, 206u8, 7u8, 108u8, 196u8, 195u8, 4u8, 54u8, 111u8, + ], + ) + } + #[doc = " Dissolve approvals: tracks which signers approved dissolving the multisig"] + #[doc = " Maps multisig_address -> Vec"] + pub fn dissolve_approvals( &self, + _0: types::dissolve_approvals::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_asset_id::NextAssetId, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::dissolve_approvals::Param0, + >, + types::dissolve_approvals::DissolveApprovals, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "NextAssetId", - (), + "Multisig", + "DissolveApprovals", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 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, + 204u8, 17u8, 210u8, 54u8, 125u8, 128u8, 75u8, 21u8, 158u8, 13u8, 205u8, + 89u8, 98u8, 73u8, 141u8, 159u8, 53u8, 129u8, 19u8, 195u8, 2u8, 178u8, + 26u8, 137u8, 206u8, 7u8, 108u8, 196u8, 195u8, 4u8, 54u8, 111u8, ], ) } @@ -20719,17 +20952,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,48 +20969,50 @@ pub mod api { ], ) } - #[doc = " The basic amount of funds that must be reserved for an asset."] - pub fn asset_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", - "AssetDeposit", + "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 amount of funds that must be reserved for a non-provider asset account to be"] - #[doc = " maintained."] - pub fn asset_account_deposit( + #[doc = " Maximum size of an encoded call"] + pub fn max_call_size( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "AssetAccountDeposit", + "Multisig", + "MaxCallSize", [ - 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 basic amount of funds that must be reserved when adding metadata to your asset."] - pub fn metadata_deposit_base( + #[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( - "Assets", - "MetadataDepositBase", + "Multisig", + "MultisigFee", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -20787,16 +21020,16 @@ pub mod api { ], ) } - #[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 = " Deposit reserved for creating a multisig (returned when dissolved)."] + #[doc = " Keeps the state clean by incentivizing removal of unused multisigs."] + pub fn multisig_deposit( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "MetadataDepositPerByte", + "Multisig", + "MultisigDeposit", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -20804,15 +21037,15 @@ pub mod api { ], ) } - #[doc = " The amount of funds that must be reserved when creating a new approval."] - pub fn approval_deposit( + #[doc = " Deposit required per proposal (returned on execute or cancel)"] + pub fn proposal_deposit( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u128, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "ApprovalDeposit", + "Multisig", + "ProposalDeposit", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -20820,290 +21053,76 @@ pub mod api { ], ) } - #[doc = " The maximum length of a name or symbol stored on-chain."] - pub fn string_limit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "StringLimit", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - } - } - } - pub mod assets_holder { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_assets_holder::pallet::Error; - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_assets_holder::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "`who`s balance on hold was increased by `amount`."] - pub struct Held { - pub who: held::Who, - pub asset_id: held::AssetId, - pub reason: held::Reason, - pub amount: held::Amount, - } - pub mod 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; - } - } - 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, - (), + #[doc = " Fee charged for creating a proposal (non-refundable, paid always)"] + pub fn proposal_fee( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "Holds", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "ProposalFee", [ - 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, - 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, - 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, - 41u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } - #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold_iter( + #[doc = " Percentage increase in ProposalFee for each signer in the multisig."] + #[doc = ""] + #[doc = " Formula: `FinalFee = ProposalFee + (ProposalFee * SignerCount * SignerStepFactor)`"] + #[doc = " Example: If Fee=100, Signers=5, Factor=1%, then Extra = 100 * 5 * 0.01 = 5. Total = 105."] + pub fn signer_step_factor( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::balances_on_hold::BalancesOnHold, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "BalancesOnHold", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "SignerStepFactor", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, + 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, + 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, ], ) } - #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold_iter1( + #[doc = " Pallet ID for generating multisig addresses"] + pub fn pallet_id( &self, - _0: types::balances_on_hold::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param0, - >, - types::balances_on_hold::BalancesOnHold, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::frame_support::PalletId, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "BalancesOnHold", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "PalletId", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, + 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, + 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, ], ) } - #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold( + #[doc = " Maximum duration (in blocks) that a proposal can be set to expire in the future."] + #[doc = " This prevents proposals from being created with extremely far expiry dates"] + #[doc = " that would lock deposits and bloat storage for extended periods."] + #[doc = ""] + #[doc = " Example: If set to 100_000 blocks (~2 weeks at 12s blocks),"] + #[doc = " a proposal created at block 1000 cannot have expiry > 101_000."] + pub fn max_expiry_duration( &self, - _0: types::balances_on_hold::Param0, - _1: types::balances_on_hold::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param1, - >, - ), - types::balances_on_hold::BalancesOnHold, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "BalancesOnHold", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "MaxExpiryDuration", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } @@ -21114,6 +21133,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( @@ -23922,7 +23958,42 @@ pub mod api { } } } - pub mod pallet_merkle_airdrop { + pub mod pallet_mining_rewards { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A miner has been identified for a block"] + MinerRewarded { + miner: ::subxt::ext::subxt_core::utils::AccountId32, + reward: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Transaction fees were collected for later distribution"] + FeesCollected { + amount: ::core::primitive::u128, + total: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Rewards were sent to Treasury when no miner was specified"] + TreasuryRewarded { reward: ::core::primitive::u128 }, + } + } + } + pub mod pallet_multisig { use super::runtime_types; pub mod pallet { use super::runtime_types; @@ -23940,86 +24011,139 @@ pub mod api { #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { #[codec(index = 0)] - #[doc = "Create a new airdrop with a Merkle root."] - #[doc = ""] - #[doc = "The Merkle root is a cryptographic hash that represents all valid claims"] - #[doc = "for this airdrop. Users will later provide Merkle proofs to verify their"] - #[doc = "eligibility to claim tokens."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `merkle_root` - The Merkle root hash representing all valid claims"] - #[doc = "* `vesting_period` - Optional vesting period for the airdrop"] - #[doc = "* `vesting_delay` - Optional delay before vesting starts"] - create_airdrop { - merkle_root: [::core::primitive::u8; 32usize], - vesting_period: ::core::option::Option<::core::primitive::u32>, - vesting_delay: ::core::option::Option<::core::primitive::u32>, + #[doc = "Create a new multisig account with deterministic address"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = "- `nonce`: User-provided nonce for address uniqueness"] + #[doc = ""] + #[doc = "The multisig address is deterministically derived from:"] + #[doc = "hash(pallet_id || sorted_signers || threshold || nonce)"] + #[doc = ""] + #[doc = "Signers are automatically sorted before hashing, so order doesn't matter."] + #[doc = ""] + #[doc = "Economic costs:"] + #[doc = "- MultisigFee: burned immediately (spam prevention)"] + #[doc = "- MultisigDeposit: reserved until dissolution, then returned to creator (storage bond)"] + create_multisig { + 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 = "Fund an existing airdrop with tokens."] + #[doc = "Propose a transaction to be executed by the multisig"] #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (refundable - returned immediately on execution/cancellation)"] + #[doc = "- A fee (non-refundable, burned immediately)"] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to fund"] - #[doc = "* `amount` - The amount of tokens to add to the airdrop"] + #[doc = "**Auto-cleanup:** Before creating a new proposal, ALL proposer's expired"] + #[doc = "proposals are automatically removed. This is the primary cleanup mechanism."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "**For threshold=1:** If the multisig threshold is 1, the proposal executes immediately."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - fund_airdrop { - airdrop_id: ::core::primitive::u32, - amount: ::core::primitive::u128, + #[doc = "**Weight:** Charged upfront for worst-case (high-security path with decode)."] + #[doc = "Refunded to actual cost on success based on whether HS path was taken."] + 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 = "Claim tokens from an airdrop by providing a Merkle proof."] + #[doc = "Approve a proposed transaction"] + #[doc = ""] + #[doc = "If this approval brings the total approvals to or above the threshold,"] + #[doc = "the proposal status changes to `Approved` and can be executed via `execute()`."] #[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_id`: ID (nonce) of the proposal to approve"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Weight: Charges for MAX call size, refunds based on actual"] + approve { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Cancel a proposed transaction (only by proposer)"] #[doc = ""] - #[doc = "* `origin` - The origin of the call"] - #[doc = "* `airdrop_id` - The ID of the airdrop to claim from"] - #[doc = "* `amount` - The amount of tokens to claim"] - #[doc = "* `merkle_proof` - The Merkle proof verifying eligibility"] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to cancel"] + cancel { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "Remove expired proposals and return deposits to proposers"] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Can only be called by signers of the multisig."] + #[doc = "Only removes Active proposals that have expired (past expiry block)."] + #[doc = "Executed and Cancelled proposals are automatically cleaned up immediately."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `AlreadyClaimed` - If the recipient has already claimed from this airdrop"] - #[doc = "* `InvalidProof` - If the provided Merkle proof is invalid"] - #[doc = "* `InsufficientAirdropBalance` - If the airdrop doesn't have enough tokens"] - claim { - airdrop_id: ::core::primitive::u32, - recipient: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - merkle_proof: runtime_types::bounded_collections::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >, + #[doc = "The deposit is always returned to the original proposer, not the caller."] + #[doc = "This allows any signer to help clean up storage even if proposer is inactive."] + remove_expired { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, }, - #[codec(index = 3)] - #[doc = "Delete an airdrop and reclaim any remaining funds."] + #[codec(index = 5)] + #[doc = "Claim all deposits from expired proposals"] + #[doc = ""] + #[doc = "This is a batch operation that removes all expired proposals where:"] + #[doc = "- Caller is the proposer"] + #[doc = "- Proposal is Active and past expiry block"] + #[doc = ""] + #[doc = "Note: Executed and Cancelled proposals are automatically cleaned up immediately,"] + #[doc = "so only Active+Expired proposals need manual cleanup."] #[doc = ""] - #[doc = "This function allows the creator of an airdrop to delete it and reclaim"] - #[doc = "any remaining tokens that haven't been claimed."] + #[doc = "Returns all proposal deposits to the proposer in a single transaction."] + claim_deposits { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + }, + #[codec(index = 7)] + #[doc = "Execute an approved proposal"] + #[doc = ""] + #[doc = "Can be called by any signer of the multisig once the proposal has reached"] + #[doc = "the approval threshold (status = Approved). The proposal must not be expired."] + #[doc = ""] + #[doc = "On execution:"] + #[doc = "- The call is decoded and dispatched as the multisig account"] + #[doc = "- Proposal is removed from storage"] + #[doc = "- Deposit is returned to the proposer"] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to execute"] + execute { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 6)] + #[doc = "Approve dissolving a multisig 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 = "Signers call this to approve dissolving the multisig."] + #[doc = "When threshold is reached, the multisig is automatically dissolved."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Requirements:"] + #[doc = "- Caller must be a signer"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up"] + #[doc = "- Multisig account balance must be zero"] #[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 = "When threshold is reached:"] + #[doc = "- Deposit is returned to creator"] + #[doc = "- Multisig storage is removed"] + approve_dissolve { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + }, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -24035,89 +24159,87 @@ 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, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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 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, - ::subxt::ext::subxt_core::utils::AccountId32, - >, - }, - #[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, - }, - #[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, - }, - #[codec(index = 3)] - #[doc = "An airdrop has been deleted."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id]"] - AirdropDeleted { airdrop_id: ::core::primitive::u32 }, - } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct 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 mod pallet_mining_rewards { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; + #[doc = "Duplicate signer in list"] + DuplicateSigner, + #[codec(index = 5)] + #[doc = "Multisig already exists"] + MultisigAlreadyExists, + #[codec(index = 6)] + #[doc = "Multisig not found"] + MultisigNotFound, + #[codec(index = 7)] + #[doc = "Caller is not a signer of this multisig"] + NotASigner, + #[codec(index = 8)] + #[doc = "Proposal not found"] + ProposalNotFound, + #[codec(index = 9)] + #[doc = "Caller is not the proposer"] + NotProposer, + #[codec(index = 10)] + #[doc = "Already approved by this signer"] + AlreadyApproved, + #[codec(index = 11)] + #[doc = "Not enough approvals to execute"] + NotEnoughApprovals, + #[codec(index = 12)] + #[doc = "Proposal expiry is in the past"] + ExpiryInPast, + #[codec(index = 13)] + #[doc = "Proposal expiry is too far in the future (exceeds MaxExpiryDuration)"] + ExpiryTooFar, + #[codec(index = 14)] + #[doc = "Proposal has expired"] + ProposalExpired, + #[codec(index = 15)] + #[doc = "Call data too large"] + CallTooLarge, + #[codec(index = 16)] + #[doc = "Failed to decode call data"] + InvalidCall, + #[codec(index = 17)] + #[doc = "Too many total proposals in storage for this multisig (cleanup required)"] + TooManyProposalsInStorage, + #[codec(index = 18)] + #[doc = "This signer has too many proposals in storage (filibuster protection)"] + TooManyProposalsPerSigner, + #[codec(index = 19)] + #[doc = "Insufficient balance for deposit"] + InsufficientBalance, + #[codec(index = 20)] + #[doc = "Proposal has active deposit"] + ProposalHasDeposit, + #[codec(index = 21)] + #[doc = "Proposal has not expired yet"] + ProposalNotExpired, + #[codec(index = 22)] + #[doc = "Proposal is not active (already executed or cancelled)"] + ProposalNotActive, + #[codec(index = 23)] + #[doc = "Proposal has not been approved yet (threshold not reached)"] + ProposalNotApproved, + #[codec(index = 24)] + #[doc = "Cannot dissolve multisig with existing proposals (clear them first)"] + ProposalsExist, + #[codec(index = 25)] + #[doc = "Multisig account must have zero balance before dissolution"] + MultisigAccountNotZero, + #[codec(index = 26)] + #[doc = "Call is not allowed for high-security multisig"] + CallNotAllowedForHighSecurityMultisig, + } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -24132,22 +24254,143 @@ pub mod api { #[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, + #[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 = "Transaction fees were collected for later distribution"] - FeesCollected { - amount: ::core::primitive::u128, - total: ::core::primitive::u128, + #[doc = "A proposal has been created"] + ProposalCreated { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, }, #[codec(index = 2)] - #[doc = "Rewards were sent to Treasury when no miner was specified"] - TreasuryRewarded { reward: ::core::primitive::u128 }, + #[doc = "A proposal has been approved by a signer"] + ProposalApproved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + approver: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + approvals_count: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "A proposal has reached threshold and is ready to execute"] + ProposalReadyToExecute { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + approvals_count: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "A proposal has been executed"] + #[doc = "Contains all data needed for indexing by SubSquid"] + ProposalExecuted { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + call: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + approvers: ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 5)] + #[doc = "A proposal has been cancelled by the proposer"] + ProposalCancelled { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 6)] + #[doc = "Expired proposal was removed from storage"] + ProposalRemoved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + removed_by: ::subxt::ext::subxt_core::utils::AccountId32, + }, + #[codec(index = 7)] + #[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 = 8)] + #[doc = "A signer approved dissolving the multisig"] + DissolveApproved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + approver: ::subxt::ext::subxt_core::utils::AccountId32, + approvals_count: ::core::primitive::u32, + }, + #[codec(index = 9)] + #[doc = "A multisig account was dissolved (threshold reached)"] + MultisigDissolved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + deposit_returned: ::subxt::ext::subxt_core::utils::AccountId32, + approvers: ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + }, } } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[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 creator: _0, + pub signers: _1, + pub threshold: ::core::primitive::u32, + pub proposal_nonce: ::core::primitive::u32, + pub deposit: _2, + pub active_proposals: ::core::primitive::u32, + pub proposals_per_signer: _3, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[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)] + Approved, + #[codec(index = 2)] + Executed, + #[codec(index = 3)] + Cancelled, + } } pub mod pallet_preimage { use super::runtime_types; @@ -25649,6 +25892,12 @@ pub mod api { ::core::primitive::u64, >, }, + #[codec(index = 7)] + #[doc = "Allows the guardian (interceptor) to recover all funds from a high security"] + #[doc = "account by transferring the entire balance to themselves."] + #[doc = ""] + #[doc = "This is an emergency function for when the high security account may be compromised."] + recover_funds { account: ::subxt::ext::subxt_core::utils::AccountId32 }, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -25754,14 +26003,12 @@ pub mod api { }, #[codec(index = 2)] #[doc = "A scheduled transaction has been successfully cancelled by the owner."] - #[doc = "[who, tx_id]"] TransactionCancelled { who: ::subxt::ext::subxt_core::utils::AccountId32, tx_id: ::subxt::ext::subxt_core::utils::H256, }, #[codec(index = 3)] #[doc = "A scheduled transaction was executed by the scheduler."] - #[doc = "[tx_id, dispatch_result]"] TransactionExecuted { tx_id: ::subxt::ext::subxt_core::utils::H256, result: ::core::result::Result< @@ -25771,6 +26018,12 @@ pub mod api { >, >, }, + #[codec(index = 4)] + #[doc = "Funds were recovered from a high security account by its guardian."] + FundsRecovered { + account: ::subxt::ext::subxt_core::utils::AccountId32, + guardian: ::subxt::ext::subxt_core::utils::AccountId32, + }, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -27005,240 +27258,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 +27306,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 +27460,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 +27476,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 +27499,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 +27515,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 +27523,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 +27546,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 +27562,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 +27570,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 +28324,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/common.rs b/src/cli/common.rs index 32cda72..c82d6b1 100644 --- a/src/cli/common.rs +++ b/src/cli/common.rs @@ -216,7 +216,7 @@ where <_ as subxt::tx::Payload>::encode_call_data(&call, &metadata).map_err(|e| { crate::error::QuantusError::NetworkError(format!("Failed to encode call: {:?}", e)) })?; - crate::log_print!("๐Ÿ“ Encoded call: 0x{}", hex::encode(&encoded_call)); + crate::log_verbose!("๐Ÿ“ Encoded call: 0x{}", hex::encode(&encoded_call)); crate::log_print!("๐Ÿ“ Encoded call size: {} bytes", encoded_call.len()); if execution_mode.wait_for_transaction { @@ -492,12 +492,27 @@ fn format_dispatch_error( match error { DispatchError::Module(module_error) => { - let pallet_name = metadata - .pallet_by_index(module_error.index) - .map(|p| p.name()) - .unwrap_or("Unknown"); + let pallet_index = module_error.index; let error_index = module_error.error[0]; - format!("{}::Error[{}]", pallet_name, error_index) + + // Try to get human-readable error name from metadata + if let Some(pallet) = metadata.pallet_by_index(pallet_index) { + let pallet_name = pallet.name(); + // Look up the error variant name from metadata + if let Some(variant) = pallet.error_variant_by_index(error_index) { + let error_name = &variant.name; + let docs = variant.docs.join(" "); + if docs.is_empty() { + format!("{}::{}", pallet_name, error_name) + } else { + format!("{}::{} - {}", pallet_name, error_name, docs) + } + } else { + format!("{}::Error[{}]", pallet_name, error_index) + } + } else { + format!("Pallet[{}]::Error[{}]", pallet_index, error_index) + } }, DispatchError::BadOrigin => "BadOrigin".to_string(), DispatchError::CannotLookup => "CannotLookup".to_string(), diff --git a/src/cli/mod.rs b/src/cli/mod.rs index a5c768e..d3cc3d1 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) => @@ -326,10 +333,17 @@ pub async fn execute_command( // Resolve address (could be wallet name or SS58 address) let resolved_address = common::resolve_address(&address)?; - let balance = send::get_balance(&quantus_client, &resolved_address).await?; - let formatted_balance = - send::format_balance_with_symbol(&quantus_client, balance).await?; - log_print!("๐Ÿ’ฐ Balance: {}", formatted_balance); + let account_data = send::get_account_data(&quantus_client, &resolved_address).await?; + let (symbol, decimals) = send::get_chain_properties(&quantus_client).await?; + + let free_fmt = send::format_balance(account_data.free, decimals); + let reserved_fmt = send::format_balance(account_data.reserved, decimals); + let frozen_fmt = send::format_balance(account_data.frozen, decimals); + + log_print!("๐Ÿ’ฐ {} {}", "Balance".bright_green().bold(), resolved_address.bright_cyan()); + log_print!(" Free: {} {}", free_fmt.bright_green(), symbol); + log_print!(" Reserved: {} {}", reserved_fmt.bright_yellow(), symbol); + log_print!(" Frozen: {} {}", frozen_fmt.bright_red(), symbol); Ok(()) }, Commands::Developer(dev_cmd) => match dev_cmd { diff --git a/src/cli/multisig.rs b/src/cli/multisig.rs new file mode 100644 index 0000000..0f117f1 --- /dev/null +++ b/src/cli/multisig.rs @@ -0,0 +1,3170 @@ +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}; + +// 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, + /// Creator address (SS58 format) - receives deposit back on dissolve + pub creator: String, + /// Current balance (spendable) + pub balance: u128, + /// Approval threshold + pub threshold: u32, + /// List of signer addresses (SS58 format) + pub signers: Vec, + /// Next proposal ID + pub proposal_nonce: u32, + /// Locked deposit amount (returned to creator on dissolve) + pub deposit: u128, + /// Number of active proposals + pub active_proposals: u32, +} + +/// Proposal status +#[allow(dead_code)] +#[derive(Debug, Clone, PartialEq)] +pub enum ProposalStatus { + Active, + /// Threshold reached; any signer can call execute to dispatch + Approved, + 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") +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 + .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 { + /// Propose a simple transfer (most common case) + Transfer { + /// Multisig account address (SS58 format) + #[arg(long)] + address: String, + + /// Recipient address (SS58 format) + #[arg(long)] + to: String, + + /// Amount to transfer (e.g., "10", "10.5", or raw "10000000000000") + #[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, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file + #[arg(long)] + password_file: Option, + }, + + /// Propose a custom transaction (full flexibility) + Custom { + /// 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, + }, + + /// Propose to enable high-security for this multisig + HighSecurity { + /// Multisig account address (SS58 format) + #[arg(long)] + address: String, + + /// Guardian/Interceptor account (SS58 or wallet name) + #[arg(long)] + interceptor: String, + + /// Delay in blocks (mutually exclusive with --delay-seconds) + #[arg(long, conflicts_with = "delay_seconds")] + delay_blocks: Option, + + /// Delay in seconds (mutually exclusive with --delay-blocks) + #[arg(long, conflicts_with = "delay_blocks")] + delay_seconds: 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, + }, +} + +/// 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, + + /// Nonce for deterministic address generation (allows creating multiple multisigs with + /// same signers) + #[arg(long, default_value = "0")] + nonce: u64, + + /// 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, + }, + + /// Predict multisig address without creating it (deterministic calculation) + PredictAddress { + /// 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, + + /// Nonce for deterministic address generation + #[arg(long, default_value = "0")] + nonce: u64, + }, + + /// Propose a transaction to be executed by the multisig + #[command(subcommand)] + Propose(ProposeSubcommand), + + /// Approve a proposed transaction + Approve { + /// Multisig account address + #[arg(long)] + address: String, + + /// Proposal ID (u32 nonce) + #[arg(long)] + proposal_id: u32, + + /// 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, + }, + + /// Execute an approved proposal (any signer; proposal must have reached threshold) + Execute { + /// Multisig account address + #[arg(long)] + address: String, + + /// Proposal ID (u32 nonce) to execute + #[arg(long)] + proposal_id: u32, + + /// 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 ID (u32 nonce) to cancel + #[arg(long)] + proposal_id: u32, + + /// 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 proposal + RemoveExpired { + /// Multisig account address + #[arg(long)] + address: String, + + /// Proposal ID (u32 nonce) to remove + #[arg(long)] + proposal_id: u32, + + /// 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 (or specific proposal if --proposal-id provided) + Info { + /// Multisig account address + #[arg(long)] + address: String, + + /// Optional: Query specific proposal by ID + #[arg(long)] + proposal_id: Option, + }, + + /// List all proposals for a multisig + ListProposals { + /// Multisig account address + #[arg(long)] + address: String, + }, + + /// High-Security operations for multisig accounts + #[command(subcommand)] + HighSecurity(HighSecuritySubcommands), +} + +/// High-Security subcommands for multisig (query only) +#[derive(Subcommand, Debug)] +pub enum HighSecuritySubcommands { + /// Check if multisig has high-security enabled + Status { + /// Multisig account address + #[arg(long)] + address: String, + }, +} + +// ============================================================================ +// PUBLIC LIBRARY API - Core Functions +// ============================================================================ +// Note: These functions are public library API and may not be used by the CLI binary + +/// Predict multisig address deterministically +/// +/// This function calculates what the multisig address will be BEFORE creating it. +/// The address is computed as: hash(pallet_id || sorted_signers || threshold || nonce) +/// +/// # Arguments +/// * `signers` - List of signer AccountId32 (order doesn't matter - will be sorted) +/// * `threshold` - Number of approvals required +/// * `nonce` - Nonce for uniqueness (allows multiple multisigs with same signers) +/// +/// # Returns +/// Predicted multisig address in SS58 format +#[allow(dead_code)] +pub fn predict_multisig_address( + signers: Vec, + threshold: u32, + nonce: u64, +) -> String { + use codec::Encode; + + // Pallet ID from runtime: py/mltsg + const PALLET_ID: [u8; 8] = *b"py/mltsg"; + + // Convert subxt AccountId32 to sp_core AccountId32 for consistent encoding + use sp_core::crypto::AccountId32 as SpAccountId32; + let sp_signers: Vec = signers + .iter() + .map(|s| { + let bytes: [u8; 32] = *s.as_ref(); + SpAccountId32::from(bytes) + }) + .collect(); + + // Sort signers for deterministic address (same as runtime does) + let mut sorted_signers = sp_signers; + sorted_signers.sort(); + + // Build data to hash: pallet_id || sorted_signers || threshold || nonce + // IMPORTANT: Must match runtime encoding exactly + let mut data = Vec::new(); + data.extend_from_slice(&PALLET_ID); + // Encode Vec - same as runtime! + data.extend_from_slice(&sorted_signers.encode()); + data.extend_from_slice(&threshold.encode()); + data.extend_from_slice(&nonce.encode()); + + // Hash the data and map it deterministically into an AccountId + // CRITICAL: Use PoseidonHasher (same as runtime!) and TrailingZeroInput + use codec::Decode; + use qp_poseidon::PoseidonHasher; + use sp_core::crypto::AccountId32; + use sp_runtime::traits::{Hash as HashT, TrailingZeroInput}; + + let hash = PoseidonHasher::hash(&data); + let account_id = AccountId32::decode(&mut TrailingZeroInput::new(hash.as_ref())) + .expect("TrailingZeroInput provides sufficient bytes; qed"); + + // Convert to SS58 format (network 189 for Quantus) + account_id.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)) +} + +/// 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 +/// * `nonce` - Nonce for deterministic address (allows multiple multisigs with same signers) +/// * `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, + nonce: u64, + wait_for_inclusion: bool, +) -> crate::error::Result<(subxt::utils::H256, Option)> { + // Build transaction with nonce + let create_tx = + quantus_subxt::api::tx() + .multisig() + .create_multisig(signers.clone(), threshold, nonce); + + // 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)); + + // Convert creator to SS58 + 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, + creator, + balance, + threshold: data.threshold, + signers, + proposal_nonce: data.proposal_nonce, + deposit: data.deposit, + 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::Approved => + ProposalStatus::Approved, + 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]]); + + // 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::Approved => + ProposalStatus::Approved, + 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, + }); + } + } + } + + Ok(proposals) +} + +/// Approve dissolving a multisig +/// +/// Requires threshold approvals. When threshold is reached, multisig is dissolved. +/// Requirements: +/// - No proposals exist (active, executed, or cancelled) +/// - Multisig account balance must be zero +/// - Deposit is returned to creator +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn approve_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 approve_tx = quantus_subxt::api::tx().multisig().approve_dissolve(multisig_address); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + caller_keypair, + approve_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +// ============================================================================ +// CLI HANDLERS (Internal) +// ============================================================================ + +/// 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, nonce, from, password, password_file } => + handle_create_multisig( + signers, + threshold, + nonce, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::PredictAddress { signers, threshold, nonce } => + handle_predict_address(signers, threshold, nonce).await, + 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, + args, + expiry, + from, + password, + password_file, + } => + handle_propose( + address, + pallet, + call, + args, + expiry, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + ProposeSubcommand::HighSecurity { + address, + interceptor, + delay_blocks, + delay_seconds, + expiry, + from, + password, + password_file, + } => + handle_high_security_set( + address, + interceptor, + delay_blocks, + delay_seconds, + expiry, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + }, + MultisigCommands::Approve { address, proposal_id, from, password, password_file } => + handle_approve( + address, + proposal_id, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::Execute { address, proposal_id, from, password, password_file } => + handle_execute( + address, + proposal_id, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::Cancel { address, proposal_id, from, password, password_file } => + handle_cancel( + address, + proposal_id, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::RemoveExpired { address, proposal_id, from, password, password_file } => + handle_remove_expired( + address, + proposal_id, + 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, proposal_id } => + handle_info(address, proposal_id, node_url).await, + MultisigCommands::ListProposals { address } => + handle_list_proposals(address, node_url).await, + MultisigCommands::HighSecurity(subcommand) => match subcommand { + HighSecuritySubcommands::Status { address } => + handle_high_security_status(address, node_url).await, + }, + } +} + +/// Create a new multisig account +async fn handle_create_multisig( + signers: String, + threshold: u32, + nonce: u64, + 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); + log_verbose!("Nonce: {}", nonce); + + // 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())); + } + + // Calculate predicted address BEFORE submission (deterministic) + let predicted_address = predict_multisig_address(signer_addresses.clone(), threshold, nonce); + + log_print!(""); + log_print!("๐Ÿ“ {} Predicted multisig address:", "DETERMINISTIC".bright_green().bold()); + log_print!(" {}", predicted_address.bright_cyan().bold()); + log_print!(""); + + // 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 with nonce + let create_tx = quantus_subxt::api::tx().multisig().create_multisig( + signer_addresses.clone(), + threshold, + nonce, + ); + + // Always wait for transaction to confirm creation + let create_execution_mode = ExecutionMode { + finalized: execution_mode.finalized, + wait_for_transaction: true, // Always wait to confirm address + }; + + let _tx_hash = crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + create_tx, + None, + create_execution_mode, + ) + .await?; + + log_success!("โœ… Multisig creation transaction confirmed"); + + // Extract and verify address from events + { + 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!(""); + + // Verify address matches prediction + if address == predicted_address { + log_success!("โœ… Confirmed multisig address: {}", address.bright_cyan().bold()); + log_print!(" {} Matches predicted address!", "โœ“".bright_green().bold()); + } else { + log_error!("โš ๏ธ Address mismatch!"); + log_print!(" Expected: {}", predicted_address.bright_yellow()); + log_print!(" Got: {}", address.bright_red()); + log_print!(" This should never happen with deterministic addresses!"); + } + + 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 100", + address.bright_cyan() + ); + } else { + log_error!("โš ๏ธ Couldn't find MultisigCreated event"); + log_print!(" Check events manually: quantus events --latest --pallet Multisig"); + } + } + + log_print!(""); + + Ok(()) +} + +/// Predict multisig address without creating it +async fn handle_predict_address( + signers: String, + threshold: u32, + nonce: u64, +) -> crate::error::Result<()> { + log_print!("๐Ÿ”ฎ {} Predicting multisig address...", "PREDICT".bright_cyan().bold()); + log_print!(""); + + // 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>>()?; + + // 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())); + } + + // Calculate deterministic address + let predicted_address = predict_multisig_address(signer_addresses.clone(), threshold, nonce); + + log_print!("๐Ÿ“ {} Predicted multisig address:", "RESULT".bright_green().bold()); + log_print!(" {}", predicted_address.bright_cyan().bold()); + log_print!(""); + log_print!("โš™๏ธ {} Configuration:", "PARAMS".bright_blue().bold()); + log_print!(" Signers: {}", signer_addresses.len()); + log_print!(" Threshold: {}", threshold); + log_print!(" Nonce: {}", nonce); + log_print!(""); + log_print!("๐Ÿ’ก {} This address is deterministic:", "INFO".bright_yellow().bold()); + log_print!(" - Same signers + threshold + nonce = same address"); + log_print!(" - Order of signers doesn't matter (automatically sorted)"); + log_print!(" - Use different nonce to create multiple multisigs with same signers"); + log_print!(""); + log_print!("๐Ÿš€ {} To create this multisig, run:", "NEXT".bright_magenta().bold()); + log_print!( + " quantus multisig create --signers \"{}\" --threshold {} --nonce {} --from ", + signers, + threshold, + nonce + ); + log_print!(""); + + Ok(()) +} + +/// 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 (supports both human format "10" and raw "10000000000000") + let amount_u128: u128 = parse_amount(&amount)?; + + // Resolve multisig address to check HS status + 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_account_id = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Connect to chain and check if multisig has High Security enabled + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage_at = quantus_client.client().storage().at(latest_block_hash); + + let hs_query = quantus_subxt::api::storage() + .reversible_transfers() + .high_security_accounts(multisig_account_id); + let is_high_security = storage_at.fetch(&hs_query).await?.is_some(); + + if is_high_security { + // HS enabled: use ReversibleTransfers::schedule_transfer (delayed + reversible) + log_print!( + "๐Ÿ›ก๏ธ {} High-Security detected: using delayed transfer (ReversibleTransfers::schedule_transfer)", + "HS".bright_green().bold() + ); + + // Build schedule_transfer call data directly + let (to_id, _) = SpAccountId32::from_ss58check_with_version(&to_address).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid recipient address: {:?}", e)) + })?; + let to_bytes: [u8; 32] = *to_id.as_ref(); + let to_account_id = subxt::ext::subxt_core::utils::AccountId32::from(to_bytes); + let dest = subxt::utils::MultiAddress::Id(to_account_id); + + let schedule_call = quantus_subxt::api::tx() + .reversible_transfers() + .schedule_transfer(dest, amount_u128); + + use subxt::tx::Payload; + let call_data = schedule_call + .encode_call_data(&quantus_client.client().metadata()) + .map_err(|e| { + crate::error::QuantusError::Generic(format!("Failed to encode call: {:?}", e)) + })?; + + // Submit as multisig proposal with pre-built call data + handle_propose_with_call_data( + multisig_address, + call_data, + expiry, + from, + password, + password_file, + &quantus_client, + execution_mode, + ) + .await + } else { + // No HS: use standard Balances::transfer_allow_death + 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)) + })?; + + 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, + 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?; + + // 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); + + // 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(), + )); + } + + // Check for expired proposals from this proposer (will be auto-cleaned by runtime) + let mut expired_count = 0; + let proposals_query = quantus_subxt::api::storage().multisig().proposals_iter(); + let mut proposals_stream = storage_at.iter(proposals_query).await?; + + while let Some(Ok(kv)) = proposals_stream.next().await { + let proposal = kv.value; + // Check if this proposal belongs to our proposer + if proposal.proposer == proposer_account_id { + // Check if expired + if proposal.expiry <= current_block_number { + expired_count += 1; + } + } + } + + if expired_count > 0 { + log_print!(""); + log_print!( + "๐Ÿงน {} Auto-cleanup: Runtime will remove your {} expired proposal(s)", + "INFO".bright_blue().bold(), + expired_count.to_string().bright_yellow() + ); + log_print!(" This happens automatically before creating the new proposal"); + log_print!(""); + } + + // 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.clone(), call_data, expiry); + + // Always wait for transaction confirmation + let propose_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + // Submit transaction and wait for on-chain confirmation + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + propose_tx, + None, + propose_execution_mode, + ) + .await?; + + log_success!("โœ… Proposal confirmed on-chain"); + + Ok(()) +} + +/// Submit a multisig proposal with pre-built call data (used for HS transfers) +async fn handle_propose_with_call_data( + multisig_address: String, + call_data: Vec, + expiry: u32, + from: String, + password: Option, + password_file: Option, + quantus_client: &crate::chain::client::QuantusClient, + 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_account_id = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // 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); + 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_account_id, call_data, expiry); + + // Always wait for transaction confirmation + let propose_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + // Submit transaction and wait for on-chain confirmation + crate::cli::common::submit_transaction( + quantus_client, + &keypair, + propose_tx, + None, + propose_execution_mode, + ) + .await?; + + log_success!("โœ… Proposal confirmed on-chain"); + + Ok(()) +} + +/// Approve a proposal +async fn handle_approve( + multisig_address: String, + proposal_id: u32, + 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); + + log_verbose!("Multisig: {}", multisig_ss58); + log_verbose!("Proposal ID: {}", proposal_id); + + // 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?; + + // 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); + + // Always wait for transaction confirmation + let approve_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + // Submit transaction and wait for on-chain confirmation + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + approve_tx, + None, + approve_execution_mode, + ) + .await?; + + log_success!("โœ… Approval confirmed on-chain"); + log_print!( + " If threshold is reached, the proposal becomes Approved. Any signer can run: quantus multisig execute --address {} --proposal-id {} --from ", + multisig_ss58, + proposal_id + ); + + Ok(()) +} + +/// Execute an approved proposal (any signer) +async fn handle_execute( + multisig_address: String, + proposal_id: u32, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("โ–ถ๏ธ {} Executing 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_account_id = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + log_verbose!("Multisig: {}", multisig_ss58); + log_verbose!("Proposal ID: {}", proposal_id); + + // 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?; + + // Validate executor is a signer (client-side check) + 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_account_id.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 + )) + })?; + + let executor_ss58 = crate::cli::common::resolve_address(&from)?; + let (executor_id, _) = + SpAccountId32::from_ss58check_with_version(&executor_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid executor address: {:?}", e)) + })?; + let executor_bytes: [u8; 32] = *executor_id.as_ref(); + let executor_account_id = subxt::ext::subxt_core::utils::AccountId32::from(executor_bytes); + + if !multisig_data.signers.0.contains(&executor_account_id) { + log_error!("โŒ Not authorized: {} is not a signer of this multisig", executor_ss58); + return Err(crate::error::QuantusError::Generic( + "Only multisig signers can execute proposals".to_string(), + )); + } + + // Build transaction + let execute_tx = quantus_subxt::api::tx().multisig().execute(multisig_account_id, proposal_id); + + let exec_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + execute_tx, + None, + exec_execution_mode, + ) + .await?; + + log_success!("โœ… Proposal executed on-chain"); + + Ok(()) +} + +/// Cancel a proposal +async fn handle_cancel( + multisig_address: String, + proposal_id: u32, + 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); + + log_verbose!("Proposal ID: {}", proposal_id); + + // 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?; + + // 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); + + // Always wait for transaction confirmation + let cancel_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + // Submit transaction and wait for on-chain confirmation + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + cancel_tx, + None, + cancel_execution_mode, + ) + .await?; + + log_success!("โœ… Proposal cancelled and removed (confirmed on-chain)"); + log_print!(" Deposit returned to proposer"); + + Ok(()) +} + +/// Remove an expired proposal +async fn handle_remove_expired( + multisig_address: String, + proposal_id: u32, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿงน {} Removing expired 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); + + log_verbose!("Proposal ID: {}", proposal_id); + + // 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, proposal_id); + + // Always wait for transaction confirmation + let remove_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + // Submit transaction and wait for on-chain confirmation + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + remove_tx, + None, + remove_execution_mode, + ) + .await?; + + log_success!("โœ… Expired proposal removed and deposit returned (confirmed on-chain)"); + + 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); + + // Always wait for transaction confirmation + let claim_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + // Submit transaction and wait for on-chain confirmation + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + claim_tx, + None, + claim_execution_mode, + ) + .await?; + + log_success!("โœ… Deposits claimed (confirmed on-chain)"); + log_print!(" All removable proposals have been cleaned up"); + + Ok(()) +} + +/// Approve dissolving 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!("๐Ÿ—‘๏ธ {} Approving multisig dissolution...", "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_id = 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?; + + // Get threshold for info message + 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_id.clone()); + let multisig_info = storage_at.fetch(&multisig_query).await?; + + // Build transaction + let approve_tx = quantus_subxt::api::tx() + .multisig() + .approve_dissolve(multisig_address_id.clone()); + + // Always wait for transaction confirmation - runtime validates all conditions + let dissolve_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + // Submit transaction and wait for on-chain confirmation + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + approve_tx, + None, + dissolve_execution_mode, + ) + .await?; + + log_success!("โœ… Dissolution approval confirmed on-chain"); + + if let Some(info) = multisig_info { + // Convert creator to SS58 + let creator_bytes: &[u8; 32] = info.creator.as_ref(); + let creator_sp = SpAccountId32::from(*creator_bytes); + let creator_ss58 = creator_sp.to_ss58check(); + + log_print!(" Requires {} total approvals to dissolve", info.threshold); + log_print!(""); + log_print!("๐Ÿ’ก {} When threshold is reached:", "INFO".bright_blue().bold()); + log_print!(" - Multisig will be dissolved automatically"); + log_print!(" - Deposit ({}) will be RETURNED to creator", format_balance(info.deposit)); + log_print!(" - Creator: {}", creator_ss58.bright_cyan()); + log_print!(" - Storage will be removed"); + } + + Ok(()) +} + +/// 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!(""); + + // 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) => { + // 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, reserved, frozen) = account_info + .map(|info| (info.data.free, info.data.reserved, info.data.frozen)) + .unwrap_or((0, 0, 0)); + + // Convert creator to SS58 + let creator_bytes: &[u8; 32] = data.creator.as_ref(); + let creator_sp = SpAccountId32::from(*creator_bytes); + let creator_ss58 = creator_sp.to_ss58check(); + + log_print!("๐Ÿ“‹ {} Information:", "MULTISIG".bright_green().bold()); + log_print!(" Address: {}", multisig_ss58.bright_cyan()); + log_print!(" Creator: {} (receives deposit back)", creator_ss58.bright_cyan()); + if reserved == 0 && frozen == 0 { + log_print!(" Balance: {}", format_balance(balance).bright_green().bold()); + } else { + log_print!(" Balance: {} (free)", format_balance(balance).bright_green().bold()); + if reserved > 0 { + log_print!( + " {} (reserved)", + format_balance(reserved).bright_yellow() + ); + } + if frozen > 0 { + log_print!(" {} (frozen)", format_balance(frozen).bright_yellow()); + } + } + 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!(" Proposal Nonce: {}", data.proposal_nonce); + log_print!( + " Deposit: {} (returned to creator on dissolve)", + format_balance(data.deposit) + ); + log_print!( + " Active Proposals: {}", + data.active_proposals.to_string().bright_yellow() + ); + + // Show active proposals summary if any exist + if data.active_proposals > 0 { + log_print!(""); + log_print!("๐Ÿ“ {} Active Proposals:", "PROPOSALS".bright_magenta().bold()); + let proposals_query = quantus_subxt::api::storage() + .multisig() + .proposals_iter1(multisig_address.clone()); + let mut proposals_stream = storage_at.iter(proposals_query).await?; + while let Some(Ok(kv)) = proposals_stream.next().await { + let proposal = kv.value; + // Extract proposal ID from key_bytes (last 4 bytes = u32 LE) + let proposal_id = if kv.key_bytes.len() >= 4 { + let id_bytes = &kv.key_bytes[kv.key_bytes.len() - 4..]; + u32::from_le_bytes([id_bytes[0], id_bytes[1], id_bytes[2], id_bytes[3]]) + } else { + 0 + }; + let status = match proposal.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => + "Active".bright_green(), + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Approved => + "Approved (ready to execute)".bright_yellow(), + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Executed => + "Executed".bright_blue(), + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => + "Cancelled".bright_red(), + }; + // Decode call name from the call field + let call_name = if proposal.call.0.len() >= 2 { + let pallet_idx = proposal.call.0[0]; + let call_idx = proposal.call.0[1]; + let metadata = quantus_client.client().metadata(); + if let Some(pallet) = metadata.pallet_by_index(pallet_idx) { + if let Some(variant) = pallet.call_variant_by_index(call_idx) { + format!("{}::{}", pallet.name(), variant.name) + } else { + format!("{}::call[{}]", pallet.name(), call_idx) + } + } else { + format!("pallet[{}]::call[{}]", pallet_idx, call_idx) + } + } else { + format!("({}B encoded)", proposal.call.0.len()) + }; + let proposer_bytes: &[u8; 32] = proposal.proposer.as_ref(); + let proposer_sp = SpAccountId32::from(*proposer_bytes); + log_print!( + " #{}: {} | {} | Approvals: {} | Proposer: {}", + proposal_id, + call_name.bright_white(), + status, + proposal.approvals.0.len(), + proposer_sp.to_ss58check().dimmed() + ); + } + } + + // Check for dissolution progress + let dissolve_query = quantus_subxt::api::storage() + .multisig() + .dissolve_approvals(multisig_address.clone()); + if let Some(dissolve_approvals) = storage_at.fetch(&dissolve_query).await? { + log_print!(""); + log_print!("๐Ÿ—‘๏ธ {} Dissolution in progress:", "DISSOLVE".bright_red().bold()); + log_print!( + " Progress: {}/{}", + dissolve_approvals.0.len().to_string().bright_yellow(), + data.threshold.to_string().bright_yellow() + ); + log_print!(" Approvals:"); + for (i, approver) in dissolve_approvals.0.iter().enumerate() { + 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()); + } + + // Show pending approvals + let pending_signers: Vec<_> = + data.signers.0.iter().filter(|s| !dissolve_approvals.0.contains(s)).collect(); + + if !pending_signers.is_empty() { + log_print!(" Pending:"); + for (i, signer) in pending_signers.iter().enumerate() { + let signer_bytes: &[u8; 32] = signer.as_ref(); + let signer_sp = SpAccountId32::from(*signer_bytes); + log_print!(" {}. {}", i + 1, signer_sp.to_ss58check().dimmed()); + } + } + + log_print!(""); + log_print!(" โš ๏ธ {} When threshold is reached:", "WARNING".bright_red().bold()); + log_print!(" - Multisig will be dissolved IMMEDIATELY"); + log_print!( + " - Deposit will be RETURNED to creator: {}", + creator_ss58.bright_cyan() + ); + } else { + log_print!(""); + log_print!( + " ๐Ÿ’ก {} Deposit ({}) will be returned to creator on dissolve", + "INFO".bright_blue().bold(), + format_balance(data.deposit) + ); + } + }, + None => { + log_error!("โŒ Multisig not found at address: {}", multisig_ss58); + }, + } + + log_print!(""); + 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 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(), + call_name.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(), + call_name.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(), + call_name.bright_yellow(), + idx, + "To:".dimmed(), + to_address.bright_cyan(), + "Error:".dimmed() + )); + }, + }; + + Ok(format!( + " {} {}::{}\n {} {}\n {} {}", + "Call:".dimmed(), + pallet_name.bright_cyan(), + call_name.bright_yellow(), + "To:".dimmed(), + to_address.bright_cyan(), + "Amount:".dimmed(), + format_balance(amount).bright_green() + )) + }, + // ReversibleTransfers::set_high_security + (_, idx) if pallet_name == "ReversibleTransfers" && idx == 0 => { + // set_high_security has: delay (enum), interceptor (AccountId32) + if args.is_empty() { + return Ok(format!( + " {} {}::set_high_security\n {} {} bytes (too short)", + "Call:".dimmed(), + pallet_name.bright_cyan(), + "Args:".dimmed(), + args.len() + )); + } + + // Decode delay (BlockNumberOrTimestamp enum) + let delay_variant = args[0]; + let delay_str: String; + let offset: usize; + + match delay_variant { + 0 => { + // BlockNumber(u32) + if args.len() < 5 { + return Ok(format!( + " {} {}::set_high_security\n {} Failed to decode delay (BlockNumber)", + "Call:".dimmed(), + pallet_name.bright_cyan(), + "Error:".dimmed() + )); + } + let blocks = u32::from_le_bytes([args[1], args[2], args[3], args[4]]); + delay_str = format!("{} blocks", blocks); + offset = 5; + }, + 1 => { + // Timestamp(u64) + if args.len() < 9 { + return Ok(format!( + " {} {}::set_high_security\n {} Failed to decode delay (Timestamp)", + "Call:".dimmed(), + pallet_name.bright_cyan(), + "Error:".dimmed() + )); + } + let millis = u64::from_le_bytes([ + args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], + ]); + let seconds = millis / 1000; + delay_str = format!("{} seconds ({} ms)", seconds, millis); + offset = 9; + }, + _ => { + return Ok(format!( + " {} {}::set_high_security\n {} Unknown delay variant: {}", + "Call:".dimmed(), + pallet_name.bright_cyan(), + "Error:".dimmed(), + delay_variant + )); + }, + } + + // Decode interceptor (AccountId32) + if args.len() < offset + 32 { + return Ok(format!( + " {} {}::set_high_security\n {} {}\n {} Failed to decode interceptor", + "Call:".dimmed(), + pallet_name.bright_cyan(), + "Delay:".dimmed(), + delay_str.bright_yellow(), + "Error:".dimmed() + )); + } + + let interceptor_bytes: [u8; 32] = + args[offset..offset + 32].try_into().map_err(|_| { + crate::error::QuantusError::Generic( + "Failed to extract interceptor bytes".to_string(), + ) + })?; + let interceptor = SpAccountId32::from(interceptor_bytes); + let interceptor_ss58 = interceptor + .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + Ok(format!( + " {} {}::set_high_security\n {} {}\n {} {}", + "Call:".dimmed(), + pallet_name.bright_cyan(), + "Delay:".dimmed(), + delay_str.bright_yellow(), + "Guardian:".dimmed(), + interceptor_ss58.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, + proposal_id: u32, + 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); + + // 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?; + + // 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(), proposal_id); + + 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) => { + // Get multisig info for context + let multisig_query = + quantus_subxt::api::storage().multisig().multisigs(multisig_address.clone()); + let multisig_info = storage_at.fetch(&multisig_query).await?; + + 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()); + + // Show threshold and approval progress + if let Some(ref ms_data) = multisig_info { + let progress = format!("{}/{}", data.approvals.0.len(), ms_data.threshold); + log_print!( + " Threshold: {} (progress: {})", + ms_data.threshold.to_string().bright_yellow(), + progress.bright_cyan() + ); + } + + 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); + log_print!(" Proposer: {}", proposer_sp.to_ss58check().bright_cyan()); + + // Decode and display call data + log_print!(""); + 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!(""); + + // 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: {}", + match data.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => + "Active".bright_green(), + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Approved => + "Approved (ready to execute)".bright_yellow(), + 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()); + } + + // Show which signers haven't approved yet + if let Some(ms_data) = multisig_info { + let pending_signers: Vec = ms_data + .signers + .0 + .iter() + .filter(|s| !data.approvals.0.contains(s)) + .map(|s| { + let bytes: &[u8; 32] = s.as_ref(); + let sp = SpAccountId32::from(*bytes); + sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom( + 189, + )) + }) + .collect(); + + if !pending_signers.is_empty() { + log_print!(""); + log_print!( + " Pending Approvals ({}):", + pending_signers.len().to_string().bright_red() + ); + for (i, signer) in pending_signers.iter().enumerate() { + log_print!(" {}. {}", i + 1, signer.bright_red()); + } + } + } + }, + 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 approved_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::Approved => { + approved_count += 1; + "Approved (ready to execute)".bright_yellow() + }, + 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 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; + 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!(" 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); + 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); + 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!(" Approved: {}", approved_count.to_string().bright_yellow()); + 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); + }, + ("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 + ))); + }, + } + + Ok(call_data) +} + +/// 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) + } +} + +// ============================================================================ +// HIGH SECURITY HANDLERS +// ============================================================================ + +/// Check high-security status for a multisig +async fn handle_high_security_status( + multisig_address: String, + node_url: &str, +) -> crate::error::Result<()> { + log_print!("๐Ÿ” {} Checking High-Security status...", "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_account_id = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Query high-security status + 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() + .reversible_transfers() + .high_security_accounts(multisig_account_id); + + let high_security_data = storage_at.fetch(&storage_query).await?; + + log_print!("๐Ÿ“‹ Multisig: {}", multisig_ss58.bright_cyan()); + log_print!(""); + + match high_security_data { + Some(data) => { + log_success!("โœ… High-Security: {}", "ENABLED".bright_green().bold()); + log_print!(""); + + // Convert interceptor to SS58 + let interceptor_bytes: &[u8; 32] = data.interceptor.as_ref(); + let interceptor_sp = SpAccountId32::from(*interceptor_bytes); + let interceptor_ss58 = interceptor_sp + .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + log_print!("๐Ÿ›ก๏ธ Guardian/Interceptor: {}", interceptor_ss58.bright_green().bold()); + + // Format delay display + match data.delay { + quantus_subxt::api::runtime_types::qp_scheduler::BlockNumberOrTimestamp::BlockNumber( + blocks, + ) => { + log_print!("โฑ๏ธ Delay: {} blocks", blocks.to_string().bright_yellow()); + }, + quantus_subxt::api::runtime_types::qp_scheduler::BlockNumberOrTimestamp::Timestamp( + ms, + ) => { + let seconds = ms / 1000; + log_print!("โฑ๏ธ Delay: {} seconds", seconds.to_string().bright_yellow()); + }, + } + + log_print!(""); + log_print!( + "๐Ÿ’ก {} All transfers from this multisig will be delayed and reversible", + "INFO".bright_blue().bold() + ); + log_print!(" The guardian can intercept transactions during the delay period"); + log_print!(""); + log_print!( + "โš ๏ธ {} Guardian interception requires direct runtime call (not yet in CLI)", + "NOTE".bright_yellow().bold() + ); + log_print!(" Use: pallet_reversible_transfers::cancel(tx_id) as guardian account"); + }, + None => { + log_print!("โŒ High-Security: {}", "DISABLED".bright_red().bold()); + log_print!(""); + log_print!("๐Ÿ’ก This multisig does not have high-security enabled."); + log_print!(" Use 'quantus multisig high-security set' to enable it via a proposal."); + }, + } + + log_print!(""); + Ok(()) +} + +/// Enable high-security for a multisig (via proposal) +async fn handle_high_security_set( + multisig_address: String, + interceptor: String, + delay_blocks: Option, + delay_seconds: Option, + expiry: u32, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!( + "๐Ÿ›ก๏ธ {} Enabling High-Security (via proposal)...", + "MULTISIG".bright_magenta().bold() + ); + + // Validate delay parameters + if delay_blocks.is_none() && delay_seconds.is_none() { + log_error!("โŒ You must specify either --delay-blocks or --delay-seconds"); + return Err(crate::error::QuantusError::Generic("Missing delay parameter".to_string())); + } + + // 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_account_id = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Resolve interceptor address + let interceptor_ss58 = crate::cli::common::resolve_address(&interceptor)?; + let (interceptor_id, _) = SpAccountId32::from_ss58check_with_version(&interceptor_ss58) + .map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid interceptor address: {:?}", e)) + })?; + let interceptor_bytes: [u8; 32] = *interceptor_id.as_ref(); + let interceptor_account_id = + subxt::ext::subxt_core::utils::AccountId32::from(interceptor_bytes); + + log_verbose!("Multisig: {}", multisig_ss58); + log_verbose!("Interceptor: {}", interceptor_ss58); + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build the set_high_security call + use quantus_subxt::api::reversible_transfers::calls::types::set_high_security::Delay as HsDelay; + + let delay_value = if let Some(blocks) = delay_blocks { + HsDelay::BlockNumber(blocks) + } else if let Some(seconds) = delay_seconds { + HsDelay::Timestamp(seconds * 1000) // Convert seconds to milliseconds + } else { + return Err(crate::error::QuantusError::Generic("Missing delay parameter".to_string())); + }; + + log_verbose!("Delay: {:?}", delay_value); + + // Build the runtime call + let set_hs_call = quantus_subxt::api::tx() + .reversible_transfers() + .set_high_security(delay_value, interceptor_account_id); + + // Encode the call + use subxt::tx::Payload; + let call_data = + set_hs_call.encode_call_data(&quantus_client.client().metadata()).map_err(|e| { + crate::error::QuantusError::Generic(format!("Failed to encode call: {:?}", e)) + })?; + + log_verbose!("Call data size: {} bytes", call_data.len()); + + // 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())); + } + + // Validate proposer is a signer + let storage_at = quantus_client.client().storage().at(latest_block_hash); + let multisig_query = + quantus_subxt::api::storage().multisig().multisigs(multisig_account_id.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(), + )); + } + + // Check for expired proposals from this proposer (will be auto-cleaned by runtime) + let mut expired_count = 0; + let proposals_query = quantus_subxt::api::storage().multisig().proposals_iter(); + let mut proposals_stream = storage_at.iter(proposals_query).await?; + + while let Some(Ok(kv)) = proposals_stream.next().await { + let proposal = kv.value; + // Check if this proposal belongs to our proposer + if proposal.proposer == proposer_account_id { + // Check if expired + if proposal.expiry <= current_block_number { + expired_count += 1; + } + } + } + + if expired_count > 0 { + log_print!(""); + log_print!( + "๐Ÿงน {} Auto-cleanup: Runtime will remove your {} expired proposal(s)", + "INFO".bright_blue().bold(), + expired_count.to_string().bright_yellow() + ); + log_print!(" This happens automatically before creating the new proposal"); + log_print!(""); + } + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Build propose transaction + let propose_tx = + quantus_subxt::api::tx() + .multisig() + .propose(multisig_account_id, call_data, expiry); + + // Always wait for transaction confirmation + let propose_execution_mode = ExecutionMode { wait_for_transaction: true, ..execution_mode }; + + // Submit transaction and wait for on-chain confirmation + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + propose_tx, + None, + propose_execution_mode, + ) + .await?; + + log_print!(""); + log_success!("โœ… High-Security proposal confirmed on-chain!"); + log_print!(""); + log_print!( + "๐Ÿ’ก {} Once this proposal reaches threshold, High-Security will be enabled", + "NEXT STEPS".bright_blue().bold() + ); + log_print!( + " - Other signers need to approve: quantus multisig approve --address {} --proposal-id --from ", + multisig_ss58.bright_cyan() + ); + log_print!(" - After threshold is reached, all transfers will be delayed and reversible"); + log_print!(""); + + Ok(()) +} diff --git a/src/cli/send.rs b/src/cli/send.rs index 55317c0..1fad9c9 100644 --- a/src/cli/send.rs +++ b/src/cli/send.rs @@ -7,8 +7,18 @@ use crate::{ use colored::Colorize; use sp_core::crypto::{AccountId32 as SpAccountId32, Ss58Codec}; -/// Get the `free` balance for the given account using on-chain storage. -pub async fn get_balance(quantus_client: &QuantusClient, account_address: &str) -> Result { +/// Account balance data +pub struct AccountBalanceData { + pub free: u128, + pub reserved: u128, + pub frozen: u128, +} + +/// Get full account balance data (free, reserved, frozen) from on-chain storage. +pub async fn get_account_data( + quantus_client: &QuantusClient, + account_address: &str, +) -> Result { use quantus_subxt::api; log_verbose!("๐Ÿ’ฐ Querying balance for account: {}", account_address.bright_green()); @@ -37,7 +47,17 @@ pub async fn get_balance(quantus_client: &QuantusClient, account_address: &str) crate::error::QuantusError::NetworkError(format!("Failed to fetch account info: {e:?}")) })?; - Ok(account_info.data.free) + Ok(AccountBalanceData { + free: account_info.data.free, + reserved: account_info.data.reserved, + frozen: account_info.data.frozen, + }) +} + +/// Get the `free` balance for the given account using on-chain storage. +pub async fn get_balance(quantus_client: &QuantusClient, account_address: &str) -> Result { + let data = get_account_data(quantus_client, account_address).await?; + Ok(data.free) } /// Get chain properties for formatting (uses system.rs ChainHead API) diff --git a/src/lib.rs b/src/lib.rs index 95389b8..079cd10 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,6 +29,14 @@ 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_dissolve_multisig, approve_proposal, cancel_proposal, create_multisig, + get_multisig_info, get_proposal_info, list_proposals, parse_amount as parse_multisig_amount, + predict_multisig_address, propose_custom, propose_transfer, MultisigInfo, ProposalInfo, + ProposalStatus, +}; + /// Library version pub const VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/src/quantus_metadata.scale b/src/quantus_metadata.scale index 0e8740a..0aecc91 100644 Binary files a/src/quantus_metadata.scale and b/src/quantus_metadata.scale differ