diff --git a/LIBRARY_USAGE.md b/LIBRARY_USAGE.md index 16ae1bb..88a4001 100644 --- a/LIBRARY_USAGE.md +++ b/LIBRARY_USAGE.md @@ -291,6 +291,220 @@ The library is designed to be thread-safe: - `QuantusClient` can be shared using `Arc>` - Wallet operations are safe to call concurrently +### Multisig Operations + +The library provides full programmatic access to multisig functionality. + +#### Creating a Multisig + +```rust +use quantus_cli::{create_multisig, QuantusClient}; + +async fn create_multisig_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + + // Parse signer addresses + let alice_account = parse_address("qzkaf...")?; + let bob_account = parse_address("qzmqr...")?; + let charlie_account = parse_address("qzo4j...")?; + + let signers = vec![alice_account, bob_account, charlie_account]; + let threshold = 2; // 2-of-3 + + // Create multisig (wait_for_inclusion=true to get address) + let (tx_hash, multisig_address) = create_multisig( + &client, + &keypair, + signers, + threshold, + true // wait for address from event + ).await?; + + println!("Multisig created at: {:?}", multisig_address); + Ok(()) +} + +fn parse_address(ss58: &str) -> Result> { + use sp_core::crypto::{AccountId32, Ss58Codec}; + let (account_id, _) = AccountId32::from_ss58check_with_version(ss58)?; + let bytes: [u8; 32] = *account_id.as_ref(); + Ok(subxt::utils::AccountId32::from(bytes)) +} +``` + +#### Querying Multisig Info + +```rust +use quantus_cli::{get_multisig_info, MultisigInfo}; + +async fn query_multisig() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let multisig_account = parse_address("qz...")?; + + if let Some(info) = get_multisig_info(&client, multisig_account).await? { + println!("Address: {}", info.address); + println!("Balance: {} (raw units)", info.balance); + println!("Threshold: {}", info.threshold); + println!("Signers: {:?}", info.signers); + println!("Active Proposals: {}", info.active_proposals); + println!("Deposit: {} (locked)", info.deposit); + } + + Ok(()) +} +``` + +#### Creating a Transfer Proposal + +```rust +use quantus_cli::{propose_transfer, parse_multisig_amount}; + +async fn create_proposal() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + + let multisig_account = parse_address("qz...")?; + let recipient = parse_address("qzmqr...")?; + + // Parse amount (supports "10", "10.5", "0.001" format) + let amount = parse_multisig_amount("10")?; // 10 QUAN + + let expiry = 1000; // Block number + + let tx_hash = propose_transfer( + &client, + &keypair, + multisig_account, + recipient, + amount, + expiry + ).await?; + + println!("Proposal created: 0x{}", hex::encode(tx_hash)); + Ok(()) +} +``` + +#### Approving a Proposal + +```rust +use quantus_cli::approve_proposal; + +async fn approve_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("bob", None, None)?; + + let multisig_account = parse_address("qz...")?; + let proposal_id = 0u32; + + let tx_hash = approve_proposal( + &client, + &keypair, + multisig_account, + proposal_id + ).await?; + + println!("Approval submitted: 0x{}", hex::encode(tx_hash)); + println!("(Will auto-execute at threshold)"); + Ok(()) +} +``` + +#### Listing Proposals + +```rust +use quantus_cli::{list_proposals, ProposalInfo, ProposalStatus}; + +async fn list_all_proposals() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let multisig_account = parse_address("qz...")?; + + let proposals = list_proposals(&client, multisig_account).await?; + + println!("Found {} proposal(s)", proposals.len()); + for proposal in proposals { + println!("Proposal #{}:", proposal.id); + println!(" Proposer: {}", proposal.proposer); + println!(" Expiry: block {}", proposal.expiry); + println!(" Status: {:?}", proposal.status); + println!(" Approvals: {}", proposal.approvals.len()); + } + + Ok(()) +} +``` + +#### Getting Specific Proposal Info + +```rust +use quantus_cli::get_proposal_info; + +async fn query_proposal() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let multisig_account = parse_address("qz...")?; + let proposal_id = 0u32; + + if let Some(proposal) = get_proposal_info(&client, multisig_account, proposal_id).await? { + println!("Proposer: {}", proposal.proposer); + println!("Call data size: {} bytes", proposal.call_data.len()); + println!("Expiry: block {}", proposal.expiry); + println!("Approvals: {:?}", proposal.approvals); + println!("Status: {:?}", proposal.status); + } + + Ok(()) +} +``` + +#### Canceling a Proposal + +```rust +use quantus_cli::cancel_proposal; + +async fn cancel_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + + let multisig_account = parse_address("qz...")?; + let proposal_id = 0u32; + + let tx_hash = cancel_proposal( + &client, + &keypair, + multisig_account, + proposal_id + ).await?; + + println!("Proposal canceled: 0x{}", hex::encode(tx_hash)); + Ok(()) +} +``` + +#### Dissolving a Multisig + +```rust +use quantus_cli::dissolve_multisig; + +async fn dissolve_example() -> Result<(), Box> { + let client = QuantusClient::new("ws://127.0.0.1:9944").await?; + let keypair = quantus_cli::wallet::load_keypair_from_wallet("alice", None, None)?; + + let multisig_account = parse_address("qz...")?; + + // Requires: no proposals, zero balance + let tx_hash = dissolve_multisig( + &client, + &keypair, + multisig_account + ).await?; + + println!("Multisig dissolved: 0x{}", hex::encode(tx_hash)); + println!("(Creation deposit returned to creator)"); + Ok(()) +} +``` + ## Examples See the `examples/` directory for complete working examples: @@ -298,6 +512,8 @@ See the `examples/` directory for complete working examples: - `examples/basic_usage.rs` - Basic library usage - `examples/wallet_ops.rs` - Advanced wallet operations - `examples/service.rs` - Service architecture example +- `examples/multisig_library_usage.rs` - Multisig operations +- `examples/multisig_usage.rs` - Multisig CLI usage reference ## Running Examples @@ -310,6 +526,9 @@ cargo run --example wallet_ops # Run service example cargo run --example service + +# Run multisig library usage example +cargo run --example multisig_library_usage ``` ## Key Features diff --git a/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..dea9b91 --- /dev/null +++ b/examples/multisig_library_usage.rs @@ -0,0 +1,192 @@ +//! Multisig library usage example +//! +//! This example demonstrates using quantus-cli as a library for multisig operations + +use quantus_cli::{ + approve_proposal, create_multisig, get_multisig_info, get_proposal_info, list_proposals, + parse_multisig_amount, propose_transfer, + wallet::{load_keypair_from_wallet, WalletManager}, + QuantusClient, Result, +}; +use sp_core::crypto::Ss58Codec; + +#[tokio::main] +async fn main() -> Result<()> { + println!("๐Ÿ” Quantus Multisig Library Usage Example"); + println!("==========================================\n"); + + // 1. Setup: Connect to node + let node_url = "ws://127.0.0.1:9944"; + let quantus_client = QuantusClient::new(node_url).await?; + println!("๐Ÿ“ก Connected to node: {}", node_url); + println!(); + + // 2. Load wallet manager and keypairs + let wallet_manager = WalletManager::new()?; + + // Ensure test wallets exist + println!("๐Ÿ‘ฅ Loading test wallets..."); + let alice_keypair = load_keypair_from_wallet("crystal_alice", None, None)?; + let bob_keypair = load_keypair_from_wallet("crystal_bob", None, None)?; + let _charlie_keypair = load_keypair_from_wallet("crystal_charlie", None, None)?; + + // Get addresses + let alice_addr = wallet_manager + .find_wallet_address("crystal_alice")? + .expect("Alice wallet not found"); + let bob_addr = wallet_manager + .find_wallet_address("crystal_bob")? + .expect("Bob wallet not found"); + let charlie_addr = wallet_manager + .find_wallet_address("crystal_charlie")? + .expect("Charlie wallet not found"); + + println!(" Alice: {}", alice_addr); + println!(" Bob: {}", bob_addr); + println!(" Charlie: {}", charlie_addr); + println!(); + + // 3. Convert addresses to AccountId32 + let alice_account = parse_address(&alice_addr)?; + let bob_account = parse_address(&bob_addr)?; + let charlie_account = parse_address(&charlie_addr)?; + + // 4. Create multisig (2-of-3) + println!("๐Ÿ” Creating 2-of-3 multisig..."); + let signers = vec![alice_account.clone(), bob_account.clone(), charlie_account.clone()]; + let threshold = 2; + + let (tx_hash, multisig_address) = + create_multisig(&quantus_client, &alice_keypair, signers, threshold, true).await?; + + println!("โœ… Multisig created!"); + println!(" Tx hash: 0x{}", hex::encode(tx_hash)); + if let Some(addr) = &multisig_address { + println!(" Address: {}", addr); + } + println!(); + + // 5. Get multisig info + if let Some(addr) = &multisig_address { + let multisig_account = parse_address(addr)?; + + println!("๐Ÿ“‹ Querying multisig info..."); + if let Some(info) = get_multisig_info(&quantus_client, multisig_account.clone()).await? { + println!(" Address: {}", info.address); + println!(" Balance: {} (raw units)", info.balance); + println!(" Threshold: {}", info.threshold); + println!(" Signers: {}", info.signers.len()); + for (i, signer) in info.signers.iter().enumerate() { + println!(" {}. {}", i + 1, signer); + } + println!(" Active Proposals: {}", info.active_proposals); + println!(); + } + + // 6. Parse amount using library function + println!("๐Ÿ’ฐ Parsing amounts..."); + let amount_1 = parse_multisig_amount("10")?; // 10 QUAN + let amount_2 = parse_multisig_amount("10.5")?; // 10.5 QUAN + let amount_3 = parse_multisig_amount("0.001")?; // 0.001 QUAN + + println!(" 10 QUAN = {} (raw)", amount_1); + println!(" 10.5 QUAN = {} (raw)", amount_2); + println!(" 0.001 QUAN = {} (raw)", amount_3); + println!(); + + // 7. Create a proposal (transfer 10 QUAN to Bob) + println!("๐Ÿ“ Creating transfer proposal..."); + let expiry = 1000; // Block number + let amount = parse_multisig_amount("10")?; + + let propose_tx_hash = propose_transfer( + &quantus_client, + &alice_keypair, + multisig_account.clone(), + bob_account.clone(), + amount, + expiry, + ) + .await?; + + println!("โœ… Proposal submitted!"); + println!(" Tx hash: 0x{}", hex::encode(propose_tx_hash)); + println!(" Check events for proposal ID"); + println!(); + + // 8. List all proposals + println!("๐Ÿ“‹ Listing all proposals..."); + let proposals = list_proposals(&quantus_client, multisig_account.clone()).await?; + println!(" Found {} proposal(s)", proposals.len()); + + for proposal in &proposals { + println!(); + println!(" Proposal #{}:", proposal.id); + println!(" Proposer: {}", proposal.proposer); + println!(" Expiry: block {}", proposal.expiry); + println!(" Status: {:?}", proposal.status); + println!(" Approvals: {}", proposal.approvals.len()); + println!(" Deposit: {} (raw)", proposal.deposit); + } + println!(); + + // 9. Get specific proposal info + if !proposals.is_empty() { + let proposal_id = proposals[0].id; + println!("๐Ÿ” Querying proposal #{}...", proposal_id); + + if let Some(proposal) = + get_proposal_info(&quantus_client, multisig_account.clone(), proposal_id).await? + { + println!(" Proposer: {}", proposal.proposer); + println!(" Call data size: {} bytes", proposal.call_data.len()); + println!(" Expiry: block {}", proposal.expiry); + println!(" Approvals: {}", proposal.approvals.len()); + } + println!(); + + // 10. Approve proposal (as Bob) + println!("โœ… Approving proposal #{}...", proposal_id); + let approve_tx_hash = approve_proposal( + &quantus_client, + &bob_keypair, + multisig_account.clone(), + proposal_id, + ) + .await?; + + println!("โœ… Approval submitted!"); + println!(" Tx hash: 0x{}", hex::encode(approve_tx_hash)); + println!(" (Will auto-execute at threshold)"); + println!(); + } + } + + println!("โœจ Example complete!"); + println!(); + println!("๐Ÿ“š Available library functions:"); + println!(" - create_multisig()"); + println!(" - propose_transfer()"); + println!(" - propose_custom()"); + println!(" - approve_proposal()"); + println!(" - cancel_proposal()"); + println!(" - get_multisig_info()"); + println!(" - get_proposal_info()"); + println!(" - list_proposals()"); + println!(" - dissolve_multisig()"); + println!(" - parse_multisig_amount()"); + + Ok(()) +} + +/// Helper: Parse SS58 address to subxt AccountId32 +fn parse_address(ss58: &str) -> Result { + use sp_core::crypto::AccountId32; + + let (account_id, _) = AccountId32::from_ss58check_with_version(ss58).map_err(|e| { + quantus_cli::error::QuantusError::Generic(format!("Invalid address: {:?}", e)) + })?; + + let bytes: [u8; 32] = *account_id.as_ref(); + Ok(subxt::ext::subxt_core::utils::AccountId32::from(bytes)) +} diff --git a/examples/multisig_usage.rs b/examples/multisig_usage.rs new file mode 100644 index 0000000..64ac631 --- /dev/null +++ b/examples/multisig_usage.rs @@ -0,0 +1,166 @@ +//! Multisig wallet operations example +//! +//! This example demonstrates: +//! 1. Creating a multisig wallet +//! 2. Creating a proposal +//! 3. Approving proposals +//! 4. Querying multisig information +//! 5. Managing multisig lifecycle + +use quantus_cli::{ + chain::{client::QuantusClient, quantus_subxt}, + cli::common::ExecutionMode, + error::Result, + wallet::WalletManager, +}; +use sp_core::crypto::Ss58Codec; + +/// Example: Create and use a 2-of-3 multisig wallet +#[tokio::main] +async fn main() -> Result<()> { + println!("๐Ÿ” Quantus Multisig Example"); + println!("================================\n"); + + // 1. Setup: Connect to node and load wallets + let node_url = "ws://127.0.0.1:9944"; + let quantus_client = QuantusClient::new(node_url).await?; + let wallet_manager = WalletManager::new()?; + + println!("๐Ÿ“ก Connected to node: {}", node_url); + println!(); + + // 2. Create or load test wallets + println!("๐Ÿ‘ฅ Setting up test wallets..."); + + // For this example, we assume alice, bob, and charlie wallets exist + // In real usage, create these first: + // wallet_manager.create_wallet("alice", Some("password")).await?; + // wallet_manager.create_wallet("bob", Some("password")).await?; + // wallet_manager.create_wallet("charlie", Some("password")).await?; + + let alice_addr = wallet_manager.find_wallet_address("alice")?.expect("Alice wallet not found"); + let bob_addr = wallet_manager.find_wallet_address("bob")?.expect("Bob wallet not found"); + let charlie_addr = wallet_manager + .find_wallet_address("charlie")? + .expect("Charlie wallet not found"); + + println!(" Alice: {}", alice_addr); + println!(" Bob: {}", bob_addr); + println!(" Charlie: {}", charlie_addr); + println!(); + + // 3. Create multisig (2-of-3) + println!("๐Ÿ” Creating 2-of-3 multisig..."); + + let signers = + vec![parse_address(&alice_addr)?, parse_address(&bob_addr)?, parse_address(&charlie_addr)?]; + let threshold = 2u32; + + let alice_keypair = + quantus_cli::wallet::load_keypair_from_wallet("alice", Some("password".to_string()), None)?; + + let create_tx = quantus_subxt::api::tx().multisig().create_multisig(signers.clone(), threshold); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: true }; + + let tx_hash = quantus_cli::cli::common::submit_transaction( + &quantus_client, + &alice_keypair, + create_tx, + None, + execution_mode, + ) + .await?; + + println!("โœ… Multisig created! Tx hash: 0x{}", hex::encode(tx_hash)); + println!(); + println!("๐Ÿ’ก NOTE: The CLI automatically extracts the address from events"); + println!(" Or use --predict flag for instant (but potentially racy) address"); + println!(" quantus multisig create --signers --threshold 2 --from alice --predict"); + println!(); + + // 4. Example: Query multisig info + println!("๐Ÿ“‹ To query multisig information:"); + println!(" quantus multisig info --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 (recover creation deposit) + println!("๐Ÿ—‘๏ธ To dissolve multisig (requires no proposals, zero balance):"); + println!(" quantus multisig dissolve \\"); + println!(" --address \\"); + println!(" --from alice"); + println!(); + + println!("โœจ Multisig example complete!"); + println!(); + println!("๐Ÿ“š For more information:"); + println!(" quantus multisig --help"); + println!(" quantus multisig --help"); + + Ok(()) +} + +/// Helper: Parse SS58 address to subxt AccountId32 +fn parse_address(ss58: &str) -> Result { + use sp_core::crypto::AccountId32; + + let (account_id, _) = AccountId32::from_ss58check_with_version(ss58).map_err(|e| { + quantus_cli::error::QuantusError::Generic(format!("Invalid address: {:?}", e)) + })?; + + let bytes: [u8; 32] = *account_id.as_ref(); + Ok(subxt::ext::subxt_core::utils::AccountId32::from(bytes)) +} diff --git a/src/chain/quantus_subxt.rs b/src/chain/quantus_subxt.rs index a94a0d2..4c41d06 100644 --- a/src/chain/quantus_subxt.rs +++ b/src/chain/quantus_subxt.rs @@ -6,7 +6,7 @@ pub mod api { mod root_mod { pub use super::*; } - pub static PALLETS: [&str; 22usize] = [ + pub static PALLETS: [&str; 21usize] = [ "System", "Timestamp", "Balances", @@ -14,7 +14,6 @@ pub mod api { "Sudo", "QPoW", "MiningRewards", - "Vesting", "Preimage", "Scheduler", "Utility", @@ -23,12 +22,12 @@ pub mod api { "ConvictionVoting", "TechCollective", "TechReferenda", - "MerkleAirdrop", "TreasuryPallet", "Origins", "Recovery", "Assets", "AssetsHolder", + "Multisig", ]; pub static RUNTIME_APIS: [&str; 11usize] = [ "Core", @@ -144,9 +143,10 @@ pub mod api { "execute_block", types::ExecuteBlock { block }, [ - 133u8, 135u8, 228u8, 65u8, 106u8, 27u8, 85u8, 158u8, 112u8, 254u8, - 93u8, 26u8, 102u8, 201u8, 118u8, 216u8, 249u8, 247u8, 91u8, 74u8, 56u8, - 208u8, 231u8, 115u8, 131u8, 29u8, 209u8, 6u8, 65u8, 57u8, 214u8, 125u8, + 81u8, 130u8, 143u8, 72u8, 156u8, 15u8, 28u8, 87u8, 117u8, 10u8, 192u8, + 249u8, 117u8, 214u8, 184u8, 13u8, 148u8, 224u8, 167u8, 170u8, 101u8, + 194u8, 229u8, 140u8, 199u8, 115u8, 73u8, 99u8, 183u8, 205u8, 98u8, + 33u8, ], ) } @@ -163,9 +163,9 @@ pub mod api { "initialize_block", types::InitializeBlock { header }, [ - 132u8, 169u8, 113u8, 112u8, 80u8, 139u8, 113u8, 35u8, 41u8, 81u8, 36u8, - 35u8, 37u8, 202u8, 29u8, 207u8, 205u8, 229u8, 145u8, 7u8, 133u8, 94u8, - 25u8, 108u8, 233u8, 86u8, 234u8, 29u8, 236u8, 57u8, 56u8, 186u8, + 112u8, 139u8, 92u8, 30u8, 37u8, 99u8, 47u8, 83u8, 221u8, 31u8, 204u8, + 129u8, 102u8, 92u8, 144u8, 80u8, 3u8, 98u8, 157u8, 5u8, 20u8, 31u8, + 110u8, 105u8, 86u8, 91u8, 173u8, 19u8, 140u8, 246u8, 60u8, 223u8, ], ) } @@ -193,7 +193,7 @@ pub mod api { pub struct Version {} pub mod execute_block { use super::runtime_types; - pub type Block = runtime_types :: sp_runtime :: generic :: block :: Block < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: quantus_runtime :: RuntimeCall , runtime_types :: qp_dilithium_crypto :: types :: DilithiumSignatureScheme , (runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: quantus_runtime :: transaction_extensions :: ReversibleTransactionExtension ,) > > ; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: Block < runtime_types :: qp_header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: quantus_runtime :: RuntimeCall , runtime_types :: qp_dilithium_crypto :: types :: DilithiumSignatureScheme , (runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: quantus_runtime :: transaction_extensions :: ReversibleTransactionExtension ,) > > ; pub mod output { use super::runtime_types; pub type Output = (); @@ -215,8 +215,7 @@ pub mod api { } pub mod initialize_block { use super::runtime_types; - pub type Header = - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; + pub type Header = runtime_types::qp_header::Header<::core::primitive::u32>; pub mod output { use super::runtime_types; pub type Output = runtime_types::sp_runtime::ExtrinsicInclusionMode; @@ -411,9 +410,9 @@ pub mod api { "finalize_block", types::FinalizeBlock {}, [ - 244u8, 207u8, 24u8, 33u8, 13u8, 69u8, 9u8, 249u8, 145u8, 143u8, 122u8, - 96u8, 197u8, 55u8, 64u8, 111u8, 238u8, 224u8, 34u8, 201u8, 27u8, 146u8, - 232u8, 99u8, 191u8, 30u8, 114u8, 16u8, 32u8, 220u8, 58u8, 62u8, + 135u8, 81u8, 28u8, 123u8, 19u8, 171u8, 129u8, 82u8, 85u8, 96u8, 238u8, + 155u8, 211u8, 153u8, 243u8, 31u8, 189u8, 82u8, 91u8, 225u8, 78u8, 48u8, + 241u8, 236u8, 143u8, 65u8, 91u8, 167u8, 114u8, 146u8, 31u8, 197u8, ], ) } @@ -451,10 +450,10 @@ pub mod api { "check_inherents", types::CheckInherents { block, data }, [ - 153u8, 134u8, 1u8, 215u8, 139u8, 11u8, 53u8, 51u8, 210u8, 175u8, 197u8, - 28u8, 38u8, 209u8, 175u8, 247u8, 142u8, 157u8, 50u8, 151u8, 164u8, - 191u8, 181u8, 118u8, 80u8, 97u8, 160u8, 248u8, 110u8, 217u8, 181u8, - 234u8, + 44u8, 230u8, 134u8, 154u8, 73u8, 173u8, 160u8, 231u8, 223u8, 148u8, + 247u8, 104u8, 214u8, 168u8, 43u8, 202u8, 204u8, 14u8, 148u8, 154u8, + 9u8, 103u8, 239u8, 45u8, 186u8, 21u8, 97u8, 136u8, 200u8, 108u8, 205u8, + 167u8, ], ) } @@ -487,9 +486,7 @@ pub mod api { use super::runtime_types; pub mod output { use super::runtime_types; - pub type Output = runtime_types::sp_runtime::generic::header::Header< - ::core::primitive::u32, - >; + pub type Output = runtime_types::qp_header::Header<::core::primitive::u32>; } } #[derive( @@ -528,7 +525,7 @@ pub mod api { } pub mod check_inherents { use super::runtime_types; - pub type Block = runtime_types :: sp_runtime :: generic :: block :: Block < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: quantus_runtime :: RuntimeCall , runtime_types :: qp_dilithium_crypto :: types :: DilithiumSignatureScheme , (runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: quantus_runtime :: transaction_extensions :: ReversibleTransactionExtension ,) > > ; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: Block < runtime_types :: qp_header :: Header < :: core :: primitive :: u32 > , :: subxt :: ext :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt :: ext :: subxt_core :: utils :: MultiAddress < :: subxt :: ext :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: quantus_runtime :: RuntimeCall , runtime_types :: qp_dilithium_crypto :: types :: DilithiumSignatureScheme , (runtime_types :: frame_system :: extensions :: check_non_zero_sender :: CheckNonZeroSender , runtime_types :: frame_system :: extensions :: check_spec_version :: CheckSpecVersion , runtime_types :: frame_system :: extensions :: check_tx_version :: CheckTxVersion , runtime_types :: frame_system :: extensions :: check_genesis :: CheckGenesis , runtime_types :: frame_system :: extensions :: check_mortality :: CheckMortality , runtime_types :: frame_system :: extensions :: check_nonce :: CheckNonce , runtime_types :: frame_system :: extensions :: check_weight :: CheckWeight , runtime_types :: pallet_transaction_payment :: ChargeTransactionPayment , runtime_types :: frame_metadata_hash_extension :: CheckMetadataHash , runtime_types :: quantus_runtime :: transaction_extensions :: ReversibleTransactionExtension ,) > > ; pub type Data = runtime_types::sp_inherents::InherentData; pub mod output { use super::runtime_types; @@ -637,9 +634,10 @@ pub mod api { "offchain_worker", types::OffchainWorker { header }, [ - 10u8, 135u8, 19u8, 153u8, 33u8, 216u8, 18u8, 242u8, 33u8, 140u8, 4u8, - 223u8, 200u8, 130u8, 103u8, 118u8, 137u8, 24u8, 19u8, 127u8, 161u8, - 29u8, 184u8, 111u8, 222u8, 111u8, 253u8, 73u8, 45u8, 31u8, 79u8, 60u8, + 131u8, 199u8, 206u8, 86u8, 209u8, 109u8, 229u8, 152u8, 235u8, 155u8, + 35u8, 252u8, 70u8, 180u8, 47u8, 173u8, 84u8, 182u8, 176u8, 164u8, + 107u8, 88u8, 249u8, 181u8, 85u8, 174u8, 240u8, 226u8, 254u8, 189u8, + 167u8, 155u8, ], ) } @@ -648,8 +646,7 @@ pub mod api { use super::runtime_types; pub mod offchain_worker { use super::runtime_types; - pub type Header = - runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; + pub type Header = runtime_types::qp_header::Header<::core::primitive::u32>; pub mod output { use super::runtime_types; pub type Output = (); @@ -1472,10 +1469,9 @@ pub mod api { "query_call_info", types::QueryCallInfo { call, len }, [ - 166u8, 173u8, 176u8, 212u8, 240u8, 248u8, 215u8, 188u8, 215u8, 21u8, - 209u8, 116u8, 183u8, 186u8, 201u8, 229u8, 28u8, 26u8, 218u8, 247u8, - 99u8, 59u8, 155u8, 235u8, 205u8, 76u8, 165u8, 181u8, 148u8, 21u8, - 122u8, 86u8, + 200u8, 246u8, 119u8, 11u8, 15u8, 39u8, 4u8, 32u8, 250u8, 233u8, 49u8, + 214u8, 226u8, 114u8, 235u8, 182u8, 6u8, 159u8, 60u8, 126u8, 214u8, + 47u8, 184u8, 212u8, 106u8, 4u8, 167u8, 20u8, 224u8, 134u8, 167u8, 37u8, ], ) } @@ -1493,9 +1489,10 @@ pub mod api { "query_call_fee_details", types::QueryCallFeeDetails { call, len }, [ - 18u8, 80u8, 212u8, 196u8, 230u8, 162u8, 108u8, 100u8, 130u8, 14u8, - 44u8, 76u8, 26u8, 143u8, 202u8, 61u8, 26u8, 132u8, 34u8, 112u8, 49u8, - 183u8, 31u8, 51u8, 122u8, 49u8, 37u8, 229u8, 87u8, 43u8, 107u8, 82u8, + 232u8, 99u8, 125u8, 48u8, 238u8, 249u8, 221u8, 214u8, 95u8, 163u8, + 102u8, 195u8, 154u8, 131u8, 100u8, 54u8, 201u8, 60u8, 169u8, 189u8, + 223u8, 173u8, 13u8, 76u8, 108u8, 120u8, 171u8, 5u8, 121u8, 35u8, 36u8, + 218u8, ], ) } @@ -1835,9 +1832,6 @@ pub mod api { pub fn mining_rewards(&self) -> mining_rewards::constants::ConstantsApi { mining_rewards::constants::ConstantsApi } - pub fn vesting(&self) -> vesting::constants::ConstantsApi { - vesting::constants::ConstantsApi - } pub fn scheduler(&self) -> scheduler::constants::ConstantsApi { scheduler::constants::ConstantsApi } @@ -1856,9 +1850,6 @@ pub mod api { pub fn tech_referenda(&self) -> tech_referenda::constants::ConstantsApi { tech_referenda::constants::ConstantsApi } - pub fn merkle_airdrop(&self) -> merkle_airdrop::constants::ConstantsApi { - merkle_airdrop::constants::ConstantsApi - } pub fn treasury_pallet(&self) -> treasury_pallet::constants::ConstantsApi { treasury_pallet::constants::ConstantsApi } @@ -1868,6 +1859,9 @@ pub mod api { pub fn assets(&self) -> assets::constants::ConstantsApi { assets::constants::ConstantsApi } + pub fn multisig(&self) -> multisig::constants::ConstantsApi { + multisig::constants::ConstantsApi + } } pub struct StorageApi; impl StorageApi { @@ -1892,9 +1886,6 @@ pub mod api { pub fn mining_rewards(&self) -> mining_rewards::storage::StorageApi { mining_rewards::storage::StorageApi } - pub fn vesting(&self) -> vesting::storage::StorageApi { - vesting::storage::StorageApi - } pub fn preimage(&self) -> preimage::storage::StorageApi { preimage::storage::StorageApi } @@ -1916,9 +1907,6 @@ pub mod api { pub fn tech_referenda(&self) -> tech_referenda::storage::StorageApi { tech_referenda::storage::StorageApi } - pub fn merkle_airdrop(&self) -> merkle_airdrop::storage::StorageApi { - merkle_airdrop::storage::StorageApi - } pub fn treasury_pallet(&self) -> treasury_pallet::storage::StorageApi { treasury_pallet::storage::StorageApi } @@ -1931,6 +1919,9 @@ pub mod api { pub fn assets_holder(&self) -> assets_holder::storage::StorageApi { assets_holder::storage::StorageApi } + pub fn multisig(&self) -> multisig::storage::StorageApi { + multisig::storage::StorageApi + } } pub struct TransactionApi; impl TransactionApi { @@ -1946,9 +1937,6 @@ pub mod api { pub fn sudo(&self) -> sudo::calls::TransactionApi { sudo::calls::TransactionApi } - pub fn vesting(&self) -> vesting::calls::TransactionApi { - vesting::calls::TransactionApi - } pub fn preimage(&self) -> preimage::calls::TransactionApi { preimage::calls::TransactionApi } @@ -1973,9 +1961,6 @@ pub mod api { pub fn tech_referenda(&self) -> tech_referenda::calls::TransactionApi { tech_referenda::calls::TransactionApi } - pub fn merkle_airdrop(&self) -> merkle_airdrop::calls::TransactionApi { - merkle_airdrop::calls::TransactionApi - } pub fn treasury_pallet(&self) -> treasury_pallet::calls::TransactionApi { treasury_pallet::calls::TransactionApi } @@ -1985,6 +1970,9 @@ pub mod api { pub fn assets(&self) -> assets::calls::TransactionApi { assets::calls::TransactionApi } + pub fn multisig(&self) -> multisig::calls::TransactionApi { + multisig::calls::TransactionApi + } } pub struct ViewFunctionsApi; impl ViewFunctionsApi {} @@ -1997,9 +1985,9 @@ pub mod api { .hash(); runtime_metadata_hash == [ - 194u8, 46u8, 30u8, 103u8, 67u8, 25u8, 224u8, 42u8, 104u8, 224u8, 105u8, 213u8, - 149u8, 58u8, 199u8, 151u8, 221u8, 215u8, 141u8, 247u8, 109u8, 85u8, 204u8, 202u8, - 96u8, 104u8, 173u8, 94u8, 198u8, 124u8, 113u8, 174u8, + 67u8, 50u8, 35u8, 34u8, 220u8, 220u8, 198u8, 52u8, 94u8, 20u8, 184u8, 166u8, 50u8, + 155u8, 167u8, 22u8, 51u8, 90u8, 10u8, 216u8, 223u8, 113u8, 230u8, 34u8, 116u8, + 224u8, 247u8, 158u8, 0u8, 120u8, 98u8, 45u8, ] } pub mod system { @@ -3098,10 +3086,10 @@ 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, + 150u8, 146u8, 83u8, 76u8, 57u8, 169u8, 39u8, 237u8, 122u8, 140u8, + 157u8, 117u8, 33u8, 59u8, 136u8, 201u8, 170u8, 116u8, 185u8, 117u8, + 246u8, 157u8, 116u8, 231u8, 205u8, 239u8, 61u8, 140u8, 109u8, 126u8, + 105u8, 99u8, ], ) } @@ -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,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 35u8, 97u8, 151u8, 80u8, 160u8, 5u8, 249u8, 161u8, 124u8, 31u8, 46u8, - 45u8, 205u8, 88u8, 85u8, 115u8, 98u8, 172u8, 229u8, 119u8, 45u8, 74u8, - 176u8, 35u8, 216u8, 58u8, 23u8, 103u8, 209u8, 201u8, 15u8, 61u8, + 223u8, 68u8, 19u8, 56u8, 15u8, 57u8, 58u8, 42u8, 108u8, 1u8, 113u8, + 221u8, 178u8, 16u8, 75u8, 68u8, 149u8, 211u8, 61u8, 184u8, 17u8, 240u8, + 208u8, 219u8, 59u8, 86u8, 84u8, 94u8, 162u8, 126u8, 185u8, 184u8, ], ) } @@ -5488,10 +5495,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, + 48u8, 14u8, 241u8, 181u8, 10u8, 128u8, 243u8, 143u8, 170u8, 154u8, + 74u8, 29u8, 125u8, 164u8, 180u8, 121u8, 12u8, 163u8, 188u8, 179u8, + 25u8, 68u8, 76u8, 77u8, 142u8, 245u8, 141u8, 33u8, 251u8, 19u8, 181u8, + 85u8, ], ) } @@ -5529,10 +5536,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, + 10u8, 155u8, 110u8, 205u8, 59u8, 195u8, 7u8, 222u8, 169u8, 255u8, 92u8, + 242u8, 253u8, 58u8, 248u8, 212u8, 239u8, 236u8, 194u8, 71u8, 153u8, + 142u8, 219u8, 65u8, 75u8, 119u8, 82u8, 65u8, 68u8, 59u8, 157u8, 133u8, ], ) } @@ -6128,12 +6134,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 +6156,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 +6183,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 +6211,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 +6237,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 +6262,131 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Force remove a vesting schedule"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "Ensure that the bulk of pre-images is upgraded."] #[doc = ""] - #[doc = "- `target`: An account that has a vesting schedule"] - #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] - pub struct ForceRemoveVestingSchedule { - pub target: force_remove_vesting_schedule::Target, - pub schedule_index: force_remove_vesting_schedule::ScheduleIndex, + #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] + pub struct EnsureUpdated { + pub hashes: ensure_updated::Hashes, } - pub mod force_remove_vesting_schedule { + pub mod ensure_updated { use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), + pub type Hashes = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::H256, >; - pub type ScheduleIndex = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceRemoveVestingSchedule { - const PALLET: &'static str = "Vesting"; - const CALL: &'static str = "force_remove_vesting_schedule"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for EnsureUpdated { + const PALLET: &'static str = "Preimage"; + const CALL: &'static str = "ensure_updated"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Unlock any vested funds of the sender account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vest( - &self, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vest", - types::Vest {}, - [ - 149u8, 89u8, 178u8, 148u8, 127u8, 127u8, 155u8, 60u8, 114u8, 126u8, - 204u8, 123u8, 166u8, 70u8, 104u8, 208u8, 186u8, 69u8, 139u8, 181u8, - 151u8, 154u8, 235u8, 161u8, 191u8, 35u8, 111u8, 60u8, 21u8, 165u8, - 44u8, 122u8, - ], - ) - } - #[doc = "Unlock any vested funds of a `target` account."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] - #[doc = "locked under this pallet."] - #[doc = ""] - #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = "Register a preimage on-chain."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vest_other( + #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] + #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] + pub fn note_preimage( &self, - target: types::vest_other::Target, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + bytes: types::note_preimage::Bytes, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vest_other", - types::VestOther { target }, + "Preimage", + "note_preimage", + types::NotePreimage { bytes }, [ - 238u8, 92u8, 25u8, 149u8, 27u8, 211u8, 196u8, 31u8, 211u8, 28u8, 241u8, - 30u8, 128u8, 35u8, 0u8, 227u8, 202u8, 215u8, 186u8, 69u8, 216u8, 110u8, - 199u8, 120u8, 134u8, 141u8, 176u8, 224u8, 234u8, 42u8, 152u8, 128u8, + 121u8, 88u8, 18u8, 92u8, 176u8, 15u8, 192u8, 198u8, 146u8, 198u8, 38u8, + 242u8, 213u8, 83u8, 7u8, 230u8, 14u8, 110u8, 235u8, 32u8, 215u8, 26u8, + 192u8, 217u8, 113u8, 224u8, 206u8, 96u8, 177u8, 198u8, 246u8, 33u8, ], ) } - #[doc = "Create a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account receiving the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] + #[doc = "Clear an unrequested preimage from the runtime storage."] #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = "If `len` is provided, then it will be a much cheaper operation."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn vested_transfer( + #[doc = "- `hash`: The hash of the preimage to be removed from the store."] + #[doc = "- `len`: The length of the preimage of `hash`."] + pub fn unnote_preimage( &self, - target: types::vested_transfer::Target, - schedule: types::vested_transfer::Schedule, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + hash: types::unnote_preimage::Hash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "vested_transfer", - types::VestedTransfer { target, schedule }, + "Preimage", + "unnote_preimage", + types::UnnotePreimage { hash }, [ - 198u8, 133u8, 254u8, 5u8, 22u8, 170u8, 205u8, 79u8, 218u8, 30u8, 81u8, - 207u8, 227u8, 121u8, 132u8, 14u8, 217u8, 43u8, 66u8, 206u8, 15u8, 80u8, - 173u8, 208u8, 128u8, 72u8, 223u8, 175u8, 93u8, 69u8, 128u8, 88u8, + 188u8, 116u8, 222u8, 22u8, 127u8, 215u8, 2u8, 133u8, 96u8, 202u8, + 190u8, 123u8, 203u8, 43u8, 200u8, 161u8, 226u8, 24u8, 49u8, 36u8, + 221u8, 160u8, 130u8, 119u8, 30u8, 138u8, 144u8, 85u8, 5u8, 164u8, + 252u8, 222u8, ], ) } - #[doc = "Force a vested transfer."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - #[doc = ""] - #[doc = "- `source`: The account whose funds should be transferred."] - #[doc = "- `target`: The account that should be transferred the vested funds."] - #[doc = "- `schedule`: The vesting schedule attached to the transfer."] - #[doc = ""] - #[doc = "Emits `VestingCreated`."] - #[doc = ""] - #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- `O(1)`."] - pub fn force_vested_transfer( + #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] + #[doc = "a user may have paid, and take the control of the preimage out of their hands."] + pub fn request_preimage( &self, - source: types::force_vested_transfer::Source, - target: types::force_vested_transfer::Target, - schedule: types::force_vested_transfer::Schedule, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + hash: types::request_preimage::Hash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "force_vested_transfer", - types::ForceVestedTransfer { source, target, schedule }, + "Preimage", + "request_preimage", + types::RequestPreimage { hash }, [ - 112u8, 17u8, 176u8, 133u8, 169u8, 192u8, 155u8, 217u8, 153u8, 36u8, - 230u8, 45u8, 9u8, 192u8, 2u8, 201u8, 165u8, 60u8, 206u8, 226u8, 95u8, - 86u8, 239u8, 196u8, 109u8, 62u8, 224u8, 237u8, 88u8, 74u8, 209u8, - 251u8, + 87u8, 0u8, 204u8, 111u8, 43u8, 115u8, 64u8, 209u8, 133u8, 13u8, 83u8, + 45u8, 164u8, 166u8, 233u8, 105u8, 242u8, 238u8, 235u8, 208u8, 113u8, + 134u8, 93u8, 242u8, 86u8, 32u8, 7u8, 152u8, 107u8, 208u8, 79u8, 59u8, ], ) } - #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] - #[doc = "the highest possible start and end blocks. If both schedules have already started the"] - #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] - #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] - #[doc = "unmodified."] - #[doc = ""] - #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] - #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] - #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] - #[doc = "and both will be removed."] - #[doc = ""] - #[doc = "Merged schedule attributes:"] - #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] - #[doc = " current_block)`."] - #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] - #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = "Clear a previously made request for a preimage."] #[doc = ""] - #[doc = "- `schedule1_index`: index of the first schedule to merge."] - #[doc = "- `schedule2_index`: index of the second schedule to merge."] - pub fn merge_schedules( + #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] + pub fn unrequest_preimage( &self, - schedule1_index: types::merge_schedules::Schedule1Index, - schedule2_index: types::merge_schedules::Schedule2Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + hash: types::unrequest_preimage::Hash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "merge_schedules", - types::MergeSchedules { schedule1_index, schedule2_index }, + "Preimage", + "unrequest_preimage", + types::UnrequestPreimage { hash }, [ - 45u8, 24u8, 13u8, 108u8, 26u8, 99u8, 61u8, 117u8, 195u8, 218u8, 182u8, - 23u8, 188u8, 157u8, 181u8, 81u8, 38u8, 136u8, 31u8, 226u8, 8u8, 190u8, - 33u8, 81u8, 86u8, 185u8, 156u8, 77u8, 157u8, 197u8, 41u8, 58u8, + 55u8, 37u8, 224u8, 149u8, 142u8, 120u8, 8u8, 68u8, 183u8, 225u8, 255u8, + 240u8, 254u8, 111u8, 58u8, 200u8, 113u8, 217u8, 177u8, 203u8, 107u8, + 104u8, 233u8, 87u8, 252u8, 53u8, 33u8, 112u8, 116u8, 254u8, 117u8, + 134u8, ], ) } - #[doc = "Force remove a vesting schedule"] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "Ensure that the bulk of pre-images is upgraded."] #[doc = ""] - #[doc = "- `target`: An account that has a vesting schedule"] - #[doc = "- `schedule_index`: The vesting schedule index that should be removed"] - pub fn force_remove_vesting_schedule( + #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] + pub fn ensure_updated( &self, - target: types::force_remove_vesting_schedule::Target, - schedule_index: types::force_remove_vesting_schedule::ScheduleIndex, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ForceRemoveVestingSchedule, - > { + hashes: types::ensure_updated::Hashes, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Vesting", - "force_remove_vesting_schedule", - types::ForceRemoveVestingSchedule { target, schedule_index }, + "Preimage", + "ensure_updated", + types::EnsureUpdated { hashes }, [ - 211u8, 253u8, 60u8, 15u8, 20u8, 53u8, 23u8, 13u8, 45u8, 223u8, 136u8, - 183u8, 162u8, 143u8, 196u8, 188u8, 35u8, 64u8, 174u8, 16u8, 47u8, 13u8, - 147u8, 173u8, 120u8, 143u8, 75u8, 89u8, 128u8, 187u8, 9u8, 18u8, + 254u8, 228u8, 88u8, 44u8, 126u8, 235u8, 188u8, 153u8, 61u8, 27u8, + 103u8, 253u8, 163u8, 161u8, 113u8, 243u8, 87u8, 136u8, 2u8, 231u8, + 209u8, 188u8, 215u8, 106u8, 192u8, 225u8, 75u8, 125u8, 224u8, 96u8, + 221u8, 90u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_vesting::pallet::Event; + pub type Event = runtime_types::pallet_preimage::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -6561,19 +6396,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 +6415,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, - } - pub mod vesting_updated { + #[doc = "A preimage has been requested."] + pub struct Requested { + pub hash: requested::Hash, + } + 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 +6434,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 +6643,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 +6678,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Clear an unrequested preimage from the runtime storage."] - #[doc = ""] - #[doc = "If `len` is provided, then it will be a much cheaper operation."] - #[doc = ""] - #[doc = "- `hash`: The hash of the preimage to be removed from the store."] - #[doc = "- `len`: The length of the preimage of `hash`."] - pub struct UnnotePreimage { - pub hash: unnote_preimage::Hash, + #[doc = "Cancel an anonymously scheduled task."] + pub struct Cancel { + pub when: cancel::When, + pub index: cancel::Index, } - pub mod unnote_preimage { + pub mod cancel { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnnotePreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "unnote_preimage"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "cancel"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6826,20 +6706,31 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub struct RequestPreimage { - pub hash: request_preimage::Hash, + #[doc = "Schedule a named task."] + pub struct ScheduleNamed { + pub id: schedule_named::Id, + pub when: schedule_named::When, + pub maybe_periodic: schedule_named::MaybePeriodic, + pub priority: schedule_named::Priority, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod request_preimage { + pub mod schedule_named { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Id = [::core::primitive::u8; 32usize]; + pub type When = ::core::primitive::u32; + pub type MaybePeriodic = ::core::option::Option<( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + )>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RequestPreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "request_preimage"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamed { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "schedule_named"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6852,19 +6743,17 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - pub struct UnrequestPreimage { - pub hash: unrequest_preimage::Hash, + #[doc = "Cancel a named scheduled task."] + pub struct CancelNamed { + pub id: cancel_named::Id, } - pub mod unrequest_preimage { + pub mod cancel_named { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Id = [::core::primitive::u8; 32usize]; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for UnrequestPreimage { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "unrequest_preimage"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelNamed { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "cancel_named"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -6877,131 +6766,454 @@ 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 = "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, + ::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 ScheduleAfter { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "schedule_after"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Schedule a named task after a delay."] + pub struct ScheduleNamedAfter { + pub id: schedule_named_after::Id, + pub after: schedule_named_after::After, + pub maybe_periodic: schedule_named_after::MaybePeriodic, + pub priority: schedule_named_after::Priority, + pub call: + ::subxt::ext::subxt_core::alloc::boxed::Box, + } + pub mod schedule_named_after { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type MaybePeriodic = ::core::option::Option<( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + )>; + pub type Priority = ::core::primitive::u8; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamedAfter { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "schedule_named_after"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] + #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] + #[doc = "succeeds."] #[doc = ""] - #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub struct EnsureUpdated { - pub hashes: ensure_updated::Hashes, + #[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 ensure_updated { + pub mod set_retry { use super::runtime_types; - pub type Hashes = ::subxt::ext::subxt_core::alloc::vec::Vec< - ::subxt::ext::subxt_core::utils::H256, + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type 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 EnsureUpdated { - const PALLET: &'static str = "Preimage"; - const CALL: &'static str = "ensure_updated"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "set_retry"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] + #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] + #[doc = "it succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + pub struct SetRetryNamed { + pub id: set_retry_named::Id, + pub retries: set_retry_named::Retries, + pub period: set_retry_named::Period, + } + pub mod set_retry_named { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + pub type Retries = ::core::primitive::u8; + pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetryNamed { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "set_retry_named"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Removes the retry configuration of a task."] + pub struct CancelRetry { + pub task: cancel_retry::Task, + } + pub mod cancel_retry { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetry { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "cancel_retry"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel the retry configuration of a named task."] + pub struct CancelRetryNamed { + pub id: cancel_retry_named::Id, + } + pub mod cancel_retry_named { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetryNamed { + const PALLET: &'static str = "Scheduler"; + const CALL: &'static str = "cancel_retry_named"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Register a preimage on-chain."] - #[doc = ""] - #[doc = "If the preimage was previously requested, no fees or deposits are taken for providing"] - #[doc = "the preimage. Otherwise, a deposit is taken proportional to the size of the preimage."] - pub fn note_preimage( + #[doc = "Anonymously schedule a task."] + pub fn schedule( &self, - bytes: types::note_preimage::Bytes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + when: types::schedule::When, + maybe_periodic: types::schedule::MaybePeriodic, + priority: types::schedule::Priority, + call: types::schedule::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "note_preimage", - types::NotePreimage { bytes }, + "Scheduler", + "schedule", + types::Schedule { + when, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 121u8, 88u8, 18u8, 92u8, 176u8, 15u8, 192u8, 198u8, 146u8, 198u8, 38u8, - 242u8, 213u8, 83u8, 7u8, 230u8, 14u8, 110u8, 235u8, 32u8, 215u8, 26u8, - 192u8, 217u8, 113u8, 224u8, 206u8, 96u8, 177u8, 198u8, 246u8, 33u8, + 85u8, 158u8, 105u8, 109u8, 132u8, 82u8, 60u8, 133u8, 15u8, 227u8, + 239u8, 229u8, 236u8, 198u8, 32u8, 194u8, 42u8, 27u8, 250u8, 108u8, 9u8, + 147u8, 84u8, 189u8, 1u8, 1u8, 230u8, 194u8, 49u8, 249u8, 94u8, 153u8, ], ) } - #[doc = "Clear an unrequested preimage from the runtime storage."] - #[doc = ""] - #[doc = "If `len` is provided, then it will be a much cheaper operation."] - #[doc = ""] - #[doc = "- `hash`: The hash of the preimage to be removed from the store."] - #[doc = "- `len`: The length of the preimage of `hash`."] - pub fn unnote_preimage( + #[doc = "Cancel an anonymously scheduled task."] + pub fn cancel( &self, - hash: types::unnote_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + when: types::cancel::When, + index: types::cancel::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel", + types::Cancel { when, index }, + [ + 134u8, 77u8, 15u8, 56u8, 137u8, 12u8, 58u8, 147u8, 164u8, 204u8, 221u8, + 150u8, 103u8, 42u8, 36u8, 79u8, 146u8, 115u8, 13u8, 194u8, 39u8, 73u8, + 109u8, 10u8, 168u8, 164u8, 190u8, 173u8, 30u8, 17u8, 35u8, 17u8, + ], + ) + } + #[doc = "Schedule a named task."] + pub fn schedule_named( + &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( - "Preimage", - "unnote_preimage", - types::UnnotePreimage { hash }, + "Scheduler", + "schedule_named", + types::ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 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, + 254u8, 212u8, 47u8, 162u8, 236u8, 238u8, 242u8, 135u8, 208u8, 62u8, + 68u8, 91u8, 107u8, 86u8, 146u8, 63u8, 108u8, 3u8, 61u8, 101u8, 173u8, + 90u8, 203u8, 90u8, 253u8, 130u8, 236u8, 119u8, 137u8, 143u8, 23u8, + 101u8, ], ) } - #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] - #[doc = ""] - #[doc = "If the preimage requests has already been provided on-chain, we unreserve any deposit"] - #[doc = "a user may have paid, and take the control of the preimage out of their hands."] - pub fn request_preimage( + #[doc = "Cancel a named scheduled task."] + pub fn cancel_named( &self, - hash: types::request_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + id: types::cancel_named::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_named", + types::CancelNamed { id }, + [ + 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, 93u8, + 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, 147u8, 122u8, + 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, 129u8, 193u8, + ], + ) + } + #[doc = "Anonymously schedule a task after a delay."] + pub fn schedule_after( + &self, + after: types::schedule_after::After, + maybe_periodic: types::schedule_after::MaybePeriodic, + priority: types::schedule_after::Priority, + call: types::schedule_after::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "request_preimage", - types::RequestPreimage { hash }, + "Scheduler", + "schedule_after", + types::ScheduleAfter { + after, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 87u8, 0u8, 204u8, 111u8, 43u8, 115u8, 64u8, 209u8, 133u8, 13u8, 83u8, - 45u8, 164u8, 166u8, 233u8, 105u8, 242u8, 238u8, 235u8, 208u8, 113u8, - 134u8, 93u8, 242u8, 86u8, 32u8, 7u8, 152u8, 107u8, 208u8, 79u8, 59u8, + 191u8, 55u8, 201u8, 33u8, 218u8, 232u8, 254u8, 190u8, 178u8, 212u8, + 177u8, 55u8, 123u8, 193u8, 192u8, 168u8, 191u8, 152u8, 114u8, 219u8, + 36u8, 16u8, 169u8, 153u8, 177u8, 252u8, 155u8, 86u8, 6u8, 84u8, 15u8, + 138u8, ], ) } - #[doc = "Clear a previously made request for a preimage."] - #[doc = ""] - #[doc = "NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`."] - pub fn unrequest_preimage( + #[doc = "Schedule a named task after a delay."] + pub fn schedule_named_after( &self, - hash: types::unrequest_preimage::Hash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + 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( - "Preimage", - "unrequest_preimage", - types::UnrequestPreimage { hash }, + "Scheduler", + "schedule_named_after", + types::ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 55u8, 37u8, 224u8, 149u8, 142u8, 120u8, 8u8, 68u8, 183u8, 225u8, 255u8, - 240u8, 254u8, 111u8, 58u8, 200u8, 113u8, 217u8, 177u8, 203u8, 107u8, - 104u8, 233u8, 87u8, 252u8, 53u8, 33u8, 112u8, 116u8, 254u8, 117u8, - 134u8, + 196u8, 7u8, 166u8, 8u8, 233u8, 74u8, 187u8, 62u8, 55u8, 71u8, 143u8, + 206u8, 254u8, 189u8, 104u8, 165u8, 210u8, 41u8, 142u8, 62u8, 113u8, + 106u8, 114u8, 199u8, 72u8, 76u8, 154u8, 217u8, 15u8, 219u8, 40u8, + 139u8, ], ) } - #[doc = "Ensure that the bulk of pre-images is upgraded."] + #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] + #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] + #[doc = "succeeds."] #[doc = ""] - #[doc = "The caller pays no fee if at least 90% of pre-images were successfully updated."] - pub fn ensure_updated( + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + pub fn set_retry( &self, - hashes: types::ensure_updated::Hashes, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + task: types::set_retry::Task, + retries: types::set_retry::Retries, + period: types::set_retry::Period, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "set_retry", + types::SetRetry { task, retries, period }, + [ + 31u8, 128u8, 255u8, 13u8, 13u8, 252u8, 74u8, 151u8, 60u8, 242u8, 152u8, + 58u8, 190u8, 155u8, 132u8, 65u8, 139u8, 208u8, 222u8, 175u8, 89u8, + 222u8, 186u8, 98u8, 53u8, 125u8, 71u8, 55u8, 95u8, 2u8, 76u8, 248u8, + ], + ) + } + #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] + #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] + #[doc = "it succeeds."] + #[doc = ""] + #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] + #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] + #[doc = "normally while the task is retrying."] + #[doc = ""] + #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] + #[doc = "clones of the original task. Their retry configuration will be derived from the"] + #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] + #[doc = "original `total_retries`."] + pub fn set_retry_named( + &self, + id: types::set_retry_named::Id, + retries: types::set_retry_named::Retries, + period: types::set_retry_named::Period, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Preimage", - "ensure_updated", - types::EnsureUpdated { hashes }, + "Scheduler", + "set_retry_named", + types::SetRetryNamed { id, retries, period }, [ - 254u8, 228u8, 88u8, 44u8, 126u8, 235u8, 188u8, 153u8, 61u8, 27u8, - 103u8, 253u8, 163u8, 161u8, 113u8, 243u8, 87u8, 136u8, 2u8, 231u8, - 209u8, 188u8, 215u8, 106u8, 192u8, 225u8, 75u8, 125u8, 224u8, 96u8, - 221u8, 90u8, + 102u8, 70u8, 114u8, 48u8, 180u8, 194u8, 107u8, 81u8, 104u8, 117u8, + 33u8, 169u8, 43u8, 172u8, 61u8, 129u8, 143u8, 221u8, 44u8, 101u8, + 235u8, 228u8, 224u8, 71u8, 65u8, 223u8, 180u8, 130u8, 83u8, 89u8, + 157u8, 75u8, + ], + ) + } + #[doc = "Removes the retry configuration of a task."] + pub fn cancel_retry( + &self, + task: types::cancel_retry::Task, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_retry", + types::CancelRetry { task }, + [ + 153u8, 252u8, 168u8, 142u8, 100u8, 114u8, 25u8, 46u8, 225u8, 95u8, + 243u8, 78u8, 160u8, 175u8, 17u8, 33u8, 27u8, 241u8, 149u8, 187u8, + 228u8, 182u8, 233u8, 74u8, 10u8, 228u8, 117u8, 218u8, 210u8, 127u8, + 245u8, 105u8, + ], + ) + } + #[doc = "Cancel the retry configuration of a named task."] + pub fn cancel_retry_named( + &self, + id: types::cancel_retry_named::Id, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Scheduler", + "cancel_retry_named", + types::CancelRetryNamed { id }, + [ + 76u8, 157u8, 253u8, 113u8, 162u8, 54u8, 98u8, 21u8, 62u8, 44u8, 155u8, + 202u8, 2u8, 28u8, 153u8, 219u8, 67u8, 166u8, 206u8, 79u8, 139u8, 3u8, + 119u8, 182u8, 254u8, 134u8, 143u8, 121u8, 155u8, 220u8, 192u8, 209u8, ], ) } } } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_preimage::pallet::Event; + #[doc = "Events type."] + pub type Event = runtime_types::pallet_scheduler::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -7011,17 +7223,22 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A preimage has been noted."] - pub struct Noted { - pub hash: noted::Hash, + #[doc = "Scheduled some task."] + pub struct Scheduled { + pub when: scheduled::When, + pub index: scheduled::Index, } - pub mod noted { + pub mod scheduled { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Noted { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Noted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Scheduled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Scheduled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7030,17 +7247,22 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A preimage has been requested."] - pub struct Requested { - pub hash: requested::Hash, + #[doc = "Canceled some task."] + pub struct Canceled { + pub when: canceled::When, + pub index: canceled::Index, } - pub mod requested { + pub mod canceled { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Requested { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Requested"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Canceled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Canceled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7049,239 +7271,553 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A preimage has ben cleared."] - pub struct Cleared { - pub hash: cleared::Hash, + #[doc = "Dispatched some task."] + pub struct Dispatched { + pub task: dispatched::Task, + pub id: dispatched::Id, + pub result: dispatched::Result, } - pub mod cleared { + pub mod dispatched { use super::runtime_types; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cleared { - const PALLET: &'static str = "Preimage"; - const EVENT: &'static str = "Cleared"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Set a retry configuration for some task."] + pub struct RetrySet { + pub task: retry_set::Task, + pub id: retry_set::Id, + pub period: retry_set::Period, + pub retries: retry_set::Retries, + } + pub mod retry_set { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + pub type Retries = ::core::primitive::u8; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for RetrySet { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "RetrySet"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Cancel a retry configuration for some task."] + pub struct RetryCancelled { + pub task: retry_cancelled::Task, + pub id: retry_cancelled::Id, + } + pub mod retry_cancelled { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for RetryCancelled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "RetryCancelled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The call for the provided hash was not found so the task has been aborted."] + pub struct CallUnavailable { + pub task: call_unavailable::Task, + pub id: call_unavailable::Id, + } + pub mod call_unavailable { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for CallUnavailable { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "CallUnavailable"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The given task was unable to be renewed since the agenda is full at that block."] + pub struct PeriodicFailed { + pub task: periodic_failed::Task, + pub id: periodic_failed::Id, + } + pub mod periodic_failed { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for PeriodicFailed { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "PeriodicFailed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The given task was unable to be retried since the agenda is full at that block or there"] + #[doc = "was not enough weight to reschedule it."] + pub struct RetryFailed { + pub task: retry_failed::Task, + pub id: retry_failed::Id, + } + pub mod retry_failed { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for RetryFailed { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "RetryFailed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The given task can never be executed since it is overweight."] + pub struct PermanentlyOverweight { + pub task: permanently_overweight::Task, + pub id: permanently_overweight::Id, + } + pub mod permanently_overweight { + use super::runtime_types; + pub type Task = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for PermanentlyOverweight { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "PermanentlyOverweight"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod status_for { + pub mod incomplete_block_since { use super::runtime_types; - pub type StatusFor = runtime_types::pallet_preimage::OldRequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub type IncompleteBlockSince = ::core::primitive::u32; } - pub mod request_status_for { + pub mod incomplete_timestamp_since { use super::runtime_types; - pub type RequestStatusFor = runtime_types::pallet_preimage::RequestStatus< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::quantus_runtime::governance::definitions::PreimageDeposit, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + pub type IncompleteTimestampSince = ::core::primitive::u64; } - pub mod preimage_for { + pub mod last_processed_timestamp { 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 LastProcessedTimestamp = ::core::primitive::u64; } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " The request status of a given hash."] - pub fn status_for_iter( - &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", - (), - [ - 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, + pub mod agenda { + use super::runtime_types; + pub type Agenda = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_scheduler::Scheduled< + [::core::primitive::u8; 32usize], + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >, + ::core::primitive::u32, + runtime_types::quantus_runtime::OriginCaller, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u64, + >, + >, + >; + pub type Param0 = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + } + pub mod retries { + use super::runtime_types; + pub type Retries = runtime_types::pallet_scheduler::RetryConfig< + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + >; + pub type Param0 = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + } + pub mod lookup { + use super::runtime_types; + pub type Lookup = ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ); + pub type Param0 = [::core::primitive::u8; 32usize]; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " 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, ], ) } - #[doc = " The request status of a given hash."] - pub fn status_for( + #[doc = " Tracks incomplete timestamp-based agendas that need to be processed in a later block."] + pub fn incomplete_timestamp_since( &self, - _0: types::status_for::Param0, + ) -> ::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, + ], + ) + } + #[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, + ], + ) + } + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] + pub fn agenda_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::agenda::Agenda, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Scheduler", + "Agenda", + (), + [ + 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, + 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, + 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, + ], + ) + } + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] + pub fn agenda( + &self, + _0: types::agenda::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::status_for::Param0, + types::agenda::Param0, >, - types::status_for::StatusFor, + types::agenda::Agenda, + ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, - (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "StatusFor", + "Scheduler", + "Agenda", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 187u8, 100u8, 54u8, 112u8, 96u8, 129u8, 36u8, 149u8, 127u8, 226u8, - 126u8, 171u8, 72u8, 189u8, 59u8, 126u8, 204u8, 125u8, 67u8, 204u8, - 231u8, 6u8, 212u8, 135u8, 166u8, 252u8, 5u8, 46u8, 111u8, 120u8, 54u8, - 209u8, + 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, + 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, + 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, ], ) } - #[doc = " The request status of a given hash."] - pub fn request_status_for_iter( + #[doc = " Retry configurations for items to be executed, indexed by task address."] + pub fn retries_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::request_status_for::RequestStatusFor, + types::retries::Retries, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", + "Scheduler", + "Retries", (), [ - 113u8, 195u8, 77u8, 23u8, 125u8, 170u8, 77u8, 145u8, 201u8, 168u8, - 39u8, 13u8, 143u8, 50u8, 100u8, 92u8, 25u8, 110u8, 125u8, 20u8, 96u8, - 156u8, 225u8, 200u8, 57u8, 199u8, 226u8, 242u8, 230u8, 126u8, 138u8, - 123u8, + 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, + 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, + 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, + 108u8, ], ) } - #[doc = " The request status of a given hash."] - pub fn request_status_for( + #[doc = " Retry configurations for items to be executed, indexed by task address."] + pub fn retries( &self, - _0: types::request_status_for::Param0, + _0: types::retries::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::request_status_for::Param0, + types::retries::Param0, >, - types::request_status_for::RequestStatusFor, + types::retries::Retries, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "RequestStatusFor", + "Scheduler", + "Retries", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 113u8, 195u8, 77u8, 23u8, 125u8, 170u8, 77u8, 145u8, 201u8, 168u8, - 39u8, 13u8, 143u8, 50u8, 100u8, 92u8, 25u8, 110u8, 125u8, 20u8, 96u8, - 156u8, 225u8, 200u8, 57u8, 199u8, 226u8, 242u8, 230u8, 126u8, 138u8, - 123u8, + 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, + 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, + 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, + 108u8, ], ) } - pub fn preimage_for_iter( + #[doc = " Lookup from a name to the block number and index of the task."] + #[doc = ""] + #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] + #[doc = " identities."] + pub fn lookup_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::preimage_for::PreimageFor, + types::lookup::Lookup, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", + "Scheduler", + "Lookup", (), [ - 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, - 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, - 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, - 139u8, + 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, + 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, + 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, ], ) } - pub fn preimage_for( + #[doc = " Lookup from a name to the block number and index of the task."] + #[doc = ""] + #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] + #[doc = " identities."] + pub fn lookup( &self, - _0: types::preimage_for::Param0, + _0: types::lookup::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::preimage_for::Param0, + types::lookup::Param0, >, - types::preimage_for::PreimageFor, + types::lookup::Lookup, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Preimage", - "PreimageFor", + "Scheduler", + "Lookup", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 106u8, 5u8, 17u8, 46u8, 6u8, 184u8, 177u8, 113u8, 169u8, 34u8, 119u8, - 141u8, 117u8, 40u8, 30u8, 94u8, 187u8, 35u8, 206u8, 216u8, 143u8, - 208u8, 49u8, 156u8, 200u8, 255u8, 109u8, 200u8, 210u8, 134u8, 24u8, - 139u8, + 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, + 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, + 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, ], ) } } } - } - pub mod scheduler { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_scheduler::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_scheduler::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Anonymously schedule a task."] - pub struct Schedule { - pub when: schedule::When, - pub maybe_periodic: schedule::MaybePeriodic, - pub priority: schedule::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The maximum weight that may be scheduled per block for any dispatchables."] + pub fn maximum_weight( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_weights::weight_v2::Weight, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Scheduler", + "MaximumWeight", + [ + 149u8, 252u8, 129u8, 80u8, 169u8, 36u8, 79u8, 127u8, 240u8, 156u8, + 56u8, 202u8, 219u8, 86u8, 5u8, 65u8, 245u8, 148u8, 138u8, 243u8, 210u8, + 128u8, 234u8, 216u8, 240u8, 219u8, 123u8, 235u8, 21u8, 158u8, 237u8, + 112u8, + ], + ) } - pub mod schedule { - use super::runtime_types; - pub type When = ::core::primitive::u32; - pub type MaybePeriodic = ::core::option::Option<( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - )>; - pub type Priority = ::core::primitive::u8; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + #[doc = " The maximum number of scheduled calls in the queue for a single block."] + #[doc = ""] + #[doc = " NOTE:"] + #[doc = " + Dependent pallets' benchmarks might require a higher limit for the setting. Set a"] + #[doc = " higher limit under `runtime-benchmarks` feature."] + pub fn max_scheduled_per_block( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Scheduler", + "MaxScheduledPerBlock", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Schedule { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule"; + #[doc = " Precision of the timestamp buckets."] + #[doc = ""] + #[doc = " Timestamp based dispatches are rounded to the nearest bucket of this precision."] + pub fn timestamp_bucket_size( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u64, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Scheduler", + "TimestampBucketSize", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) } + } + } + } + pub mod utility { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_utility::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_utility::pallet::Call; + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -7293,22 +7829,36 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel an anonymously scheduled task."] - pub struct Cancel { - pub when: cancel::When, - pub index: cancel::Index, + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub struct Batch { + pub calls: batch::Calls, } - pub mod cancel { + pub mod batch { use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, + pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, >; - pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7321,31 +7871,31 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule a named task."] - pub struct ScheduleNamed { - pub id: schedule_named::Id, - pub when: schedule_named::When, - pub maybe_periodic: schedule_named::MaybePeriodic, - pub priority: schedule_named::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct AsDerivative { + pub index: as_derivative::Index, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod schedule_named { + pub mod as_derivative { use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; - pub type When = ::core::primitive::u32; - pub type MaybePeriodic = ::core::option::Option<( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - )>; - pub type Priority = ::core::primitive::u8; + pub type Index = ::core::primitive::u16; pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_named"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsDerivative { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "as_derivative"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7358,17 +7908,31 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel a named scheduled task."] - pub struct CancelNamed { - pub id: cancel_named::Id, + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub struct BatchAll { + pub calls: batch_all::Calls, } - pub mod cancel_named { + pub mod batch_all { use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; + pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_named"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BatchAll { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch_all"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7381,32 +7945,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Anonymously schedule a task after a delay."] - pub struct ScheduleAfter { - pub after: schedule_after::After, - pub maybe_periodic: schedule_after::MaybePeriodic, - pub priority: schedule_after::Priority, - pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct DispatchAs { + pub as_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod schedule_after { + pub mod dispatch_as { use super::runtime_types; - pub type After = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type MaybePeriodic = ::core::option::Option<( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - )>; - pub type Priority = ::core::primitive::u8; + pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "schedule_after"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAs { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "dispatch_as"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7419,82 +7976,31 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Schedule a named task after a delay."] - pub struct ScheduleNamedAfter { - pub id: schedule_named_after::Id, - pub after: schedule_named_after::After, - pub maybe_periodic: schedule_named_after::MaybePeriodic, - pub priority: schedule_named_after::Priority, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - 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 = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] + #[doc = "May be called from any origin except `None`."] #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - pub struct SetRetry { - pub task: set_retry::Task, - pub retries: set_retry::Retries, - pub period: set_retry::Period, + #[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 set_retry { + pub mod force_batch { use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Retries = ::core::primitive::u8; - pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, + pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< + runtime_types::quantus_runtime::RuntimeCall, >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ForceBatch { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "force_batch"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7507,35 +8013,24 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] + #[doc = "Dispatch a function call with a specified weight."] #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - pub struct SetRetryNamed { - pub id: set_retry_named::Id, - pub retries: set_retry_named::Retries, - pub period: set_retry_named::Period, + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct WithWeight { + pub call: ::subxt::ext::subxt_core::alloc::boxed::Box, + pub weight: with_weight::Weight, } - pub mod set_retry_named { + pub mod with_weight { 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, - >; + 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 SetRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "set_retry_named"; + 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, @@ -7548,23 +8043,41 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Removes the retry configuration of a task."] - pub struct CancelRetry { - pub task: cancel_retry::Task, + #[doc = "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 cancel_retry { + pub mod if_else { use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); + pub type Main = runtime_types::quantus_runtime::RuntimeCall; + pub type Fallback = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetry { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IfElse { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "if_else"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7577,257 +8090,275 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel the retry configuration of a named task."] - pub struct CancelRetryNamed { - pub id: cancel_retry_named::Id, + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct DispatchAsFallible { + pub as_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub call: + ::subxt::ext::subxt_core::alloc::boxed::Box, } - pub mod cancel_retry_named { + pub mod dispatch_as_fallible { use super::runtime_types; - pub type Id = [::core::primitive::u8; 32usize]; + pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Call = runtime_types::quantus_runtime::RuntimeCall; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CancelRetryNamed { - const PALLET: &'static str = "Scheduler"; - const CALL: &'static str = "cancel_retry_named"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAsFallible { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "dispatch_as_fallible"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Anonymously schedule a task."] - pub fn schedule( + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub fn batch( &self, - when: types::schedule::When, - maybe_periodic: types::schedule::MaybePeriodic, - priority: types::schedule::Priority, - call: types::schedule::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + calls: types::batch::Calls, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule", - types::Schedule { - when, - maybe_periodic, - priority, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Utility", + "batch", + types::Batch { calls }, [ - 171u8, 151u8, 176u8, 198u8, 154u8, 6u8, 181u8, 56u8, 10u8, 6u8, 38u8, - 136u8, 64u8, 214u8, 145u8, 96u8, 121u8, 125u8, 161u8, 234u8, 247u8, - 156u8, 152u8, 119u8, 122u8, 165u8, 125u8, 238u8, 12u8, 214u8, 135u8, - 21u8, + 29u8, 28u8, 25u8, 61u8, 37u8, 229u8, 210u8, 111u8, 193u8, 52u8, 8u8, + 21u8, 8u8, 77u8, 157u8, 19u8, 69u8, 118u8, 208u8, 3u8, 236u8, 225u8, + 131u8, 77u8, 233u8, 125u8, 14u8, 47u8, 149u8, 143u8, 196u8, 180u8, ], ) } - #[doc = "Cancel an anonymously scheduled task."] - pub fn cancel( + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub fn as_derivative( &self, - when: types::cancel::When, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::as_derivative::Index, + call: types::as_derivative::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel", - types::Cancel { when, index }, - [ - 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 = "Schedule a named task."] - pub fn schedule_named( - &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( - "Scheduler", - "schedule_named", - types::ScheduleNamed { - id, - when, - maybe_periodic, - priority, + "Utility", + "as_derivative", + types::AsDerivative { + index, call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 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, - ], - ) - } - #[doc = "Cancel a named scheduled task."] - pub fn cancel_named( - &self, - id: types::cancel_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_named", - types::CancelNamed { id }, - [ - 205u8, 35u8, 28u8, 57u8, 224u8, 7u8, 49u8, 233u8, 236u8, 163u8, 93u8, - 236u8, 103u8, 69u8, 65u8, 51u8, 121u8, 84u8, 9u8, 196u8, 147u8, 122u8, - 227u8, 200u8, 181u8, 233u8, 62u8, 240u8, 174u8, 83u8, 129u8, 193u8, + 78u8, 75u8, 127u8, 252u8, 226u8, 106u8, 177u8, 111u8, 109u8, 35u8, + 226u8, 24u8, 240u8, 125u8, 95u8, 164u8, 6u8, 131u8, 118u8, 140u8, + 133u8, 52u8, 134u8, 121u8, 19u8, 176u8, 158u8, 218u8, 160u8, 219u8, + 235u8, 233u8, ], ) } - #[doc = "Anonymously schedule a task after a delay."] - pub fn schedule_after( + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub fn batch_all( &self, - 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 - { + calls: types::batch_all::Calls, + ) -> ::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), - }, + "Utility", + "batch_all", + types::BatchAll { calls }, [ - 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, + 56u8, 130u8, 125u8, 42u8, 220u8, 133u8, 183u8, 94u8, 13u8, 103u8, 16u8, + 149u8, 44u8, 225u8, 125u8, 36u8, 46u8, 223u8, 93u8, 153u8, 156u8, 2u8, + 2u8, 76u8, 46u8, 82u8, 216u8, 16u8, 63u8, 192u8, 243u8, 174u8, ], ) } - #[doc = "Schedule a named task after a delay."] - pub fn schedule_named_after( + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub fn dispatch_as( &self, - id: types::schedule_named_after::Id, - after: types::schedule_named_after::After, - maybe_periodic: types::schedule_named_after::MaybePeriodic, - priority: types::schedule_named_after::Priority, - call: types::schedule_named_after::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + as_origin: types::dispatch_as::AsOrigin, + call: types::dispatch_as::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "schedule_named_after", - types::ScheduleNamedAfter { - id, - after, - maybe_periodic, - priority, + "Utility", + "dispatch_as", + types::DispatchAs { + as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 120u8, 118u8, 201u8, 138u8, 43u8, 75u8, 89u8, 65u8, 107u8, 106u8, 41u8, - 229u8, 55u8, 6u8, 141u8, 24u8, 116u8, 214u8, 215u8, 1u8, 209u8, 67u8, - 157u8, 238u8, 147u8, 31u8, 188u8, 133u8, 21u8, 7u8, 199u8, 202u8, + 24u8, 158u8, 80u8, 1u8, 187u8, 72u8, 32u8, 2u8, 113u8, 167u8, 122u8, + 47u8, 26u8, 118u8, 234u8, 203u8, 254u8, 191u8, 117u8, 108u8, 172u8, + 111u8, 220u8, 55u8, 232u8, 14u8, 119u8, 92u8, 36u8, 201u8, 27u8, 49u8, ], ) } - #[doc = "Set a retry configuration for a task so that, in case its scheduled run fails, it will"] - #[doc = "be retried after `period` blocks, for a total amount of `retries` retries or until it"] - #[doc = "succeeds."] + #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] + #[doc = "May be called from any origin except `None`."] #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - pub fn set_retry( + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub fn force_batch( &self, - task: types::set_retry::Task, - retries: types::set_retry::Retries, - period: types::set_retry::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + calls: types::force_batch::Calls, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "set_retry", - types::SetRetry { task, retries, period }, + "Utility", + "force_batch", + types::ForceBatch { calls }, [ - 31u8, 128u8, 255u8, 13u8, 13u8, 252u8, 74u8, 151u8, 60u8, 242u8, 152u8, - 58u8, 190u8, 155u8, 132u8, 65u8, 139u8, 208u8, 222u8, 175u8, 89u8, - 222u8, 186u8, 98u8, 53u8, 125u8, 71u8, 55u8, 95u8, 2u8, 76u8, 248u8, + 50u8, 50u8, 57u8, 73u8, 93u8, 223u8, 143u8, 109u8, 123u8, 36u8, 226u8, + 101u8, 212u8, 87u8, 211u8, 231u8, 76u8, 118u8, 19u8, 234u8, 244u8, + 218u8, 116u8, 201u8, 212u8, 141u8, 240u8, 165u8, 58u8, 16u8, 59u8, + 170u8, ], ) } - #[doc = "Set a retry configuration for a named task so that, in case its scheduled run fails, it"] - #[doc = "will be retried after `period` blocks, for a total amount of `retries` retries or until"] - #[doc = "it succeeds."] + #[doc = "Dispatch a function call with a specified weight."] #[doc = ""] - #[doc = "Tasks which need to be scheduled for a retry are still subject to weight metering and"] - #[doc = "agenda space, same as a regular task. If a periodic task fails, it will be scheduled"] - #[doc = "normally while the task is retrying."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] #[doc = ""] - #[doc = "Tasks scheduled as a result of a retry for a periodic task are unnamed, non-periodic"] - #[doc = "clones of the original task. Their retry configuration will be derived from the"] - #[doc = "original task's configuration, but will have a lower value for `remaining` than the"] - #[doc = "original `total_retries`."] - pub fn set_retry_named( + #[doc = "The dispatch origin for this call must be _Root_."] + pub fn with_weight( &self, - id: types::set_retry_named::Id, - retries: types::set_retry_named::Retries, - period: types::set_retry_named::Period, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + call: types::with_weight::Call, + weight: types::with_weight::Weight, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "set_retry_named", - types::SetRetryNamed { id, retries, period }, + "Utility", + "with_weight", + types::WithWeight { + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + weight, + }, [ - 102u8, 70u8, 114u8, 48u8, 180u8, 194u8, 107u8, 81u8, 104u8, 117u8, - 33u8, 169u8, 43u8, 172u8, 61u8, 129u8, 143u8, 221u8, 44u8, 101u8, - 235u8, 228u8, 224u8, 71u8, 65u8, 223u8, 180u8, 130u8, 83u8, 89u8, - 157u8, 75u8, + 125u8, 121u8, 97u8, 244u8, 194u8, 123u8, 194u8, 45u8, 174u8, 151u8, + 149u8, 196u8, 231u8, 109u8, 100u8, 158u8, 48u8, 243u8, 3u8, 132u8, + 18u8, 3u8, 158u8, 108u8, 106u8, 73u8, 112u8, 93u8, 70u8, 50u8, 79u8, + 44u8, ], ) } - #[doc = "Removes the retry configuration of a task."] - pub fn cancel_retry( + #[doc = "Dispatch a fallback call in the event the main call fails to execute."] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "This function first attempts to dispatch the `main` call."] + #[doc = "If the `main` call fails, the `fallback` is attemted."] + #[doc = "if the fallback is successfully dispatched, the weights of both calls"] + #[doc = "are accumulated and an event containing the main call error is deposited."] + #[doc = ""] + #[doc = "In the event of a fallback failure the whole call fails"] + #[doc = "with the weights returned."] + #[doc = ""] + #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] + #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] + #[doc = ""] + #[doc = "## Dispatch Logic"] + #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] + #[doc = " applying any origin filters."] + #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] + #[doc = " `fallback` calls."] + #[doc = ""] + #[doc = "## Use Case"] + #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] + #[doc = " or both."] + pub fn if_else( &self, - task: types::cancel_retry::Task, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + main: types::if_else::Main, + fallback: types::if_else::Fallback, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_retry", - types::CancelRetry { task }, + "Utility", + "if_else", + types::IfElse { + main: ::subxt::ext::subxt_core::alloc::boxed::Box::new(main), + fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), + }, [ - 153u8, 252u8, 168u8, 142u8, 100u8, 114u8, 25u8, 46u8, 225u8, 95u8, - 243u8, 78u8, 160u8, 175u8, 17u8, 33u8, 27u8, 241u8, 149u8, 187u8, - 228u8, 182u8, 233u8, 74u8, 10u8, 228u8, 117u8, 218u8, 210u8, 127u8, - 245u8, 105u8, + 58u8, 160u8, 8u8, 132u8, 95u8, 63u8, 112u8, 54u8, 218u8, 35u8, 188u8, + 230u8, 236u8, 48u8, 141u8, 98u8, 9u8, 203u8, 228u8, 216u8, 127u8, 17u8, + 244u8, 220u8, 43u8, 36u8, 48u8, 88u8, 36u8, 134u8, 179u8, 166u8, ], ) } - #[doc = "Cancel the retry configuration of a named task."] - pub fn cancel_retry_named( + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + pub fn dispatch_as_fallible( &self, - id: types::cancel_retry_named::Id, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + as_origin: types::dispatch_as_fallible::AsOrigin, + call: types::dispatch_as_fallible::Call, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Scheduler", - "cancel_retry_named", - types::CancelRetryNamed { id }, + "Utility", + "dispatch_as_fallible", + types::DispatchAsFallible { + as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), + call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), + }, [ - 76u8, 157u8, 253u8, 113u8, 162u8, 54u8, 98u8, 21u8, 62u8, 44u8, 155u8, - 202u8, 2u8, 28u8, 153u8, 219u8, 67u8, 166u8, 206u8, 79u8, 139u8, 3u8, - 119u8, 182u8, 254u8, 134u8, 143u8, 121u8, 155u8, 220u8, 192u8, 209u8, + 16u8, 203u8, 2u8, 142u8, 9u8, 0u8, 98u8, 108u8, 243u8, 189u8, 154u8, + 255u8, 212u8, 133u8, 216u8, 99u8, 123u8, 165u8, 94u8, 36u8, 17u8, + 171u8, 255u8, 183u8, 195u8, 149u8, 196u8, 174u8, 151u8, 59u8, 99u8, + 98u8, ], ) } } } - #[doc = "Events type."] - pub type Event = runtime_types::pallet_scheduler::pallet::Event; + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_utility::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -7837,22 +8368,20 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Scheduled some task."] - pub struct Scheduled { - pub when: scheduled::When, - pub index: scheduled::Index, + #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] + #[doc = "well as the error."] + pub struct BatchInterrupted { + pub index: batch_interrupted::Index, + pub error: batch_interrupted::Error, } - pub mod scheduled { + pub mod batch_interrupted { use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; pub type Index = ::core::primitive::u32; + pub type Error = runtime_types::sp_runtime::DispatchError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Scheduled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Scheduled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for BatchInterrupted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchInterrupted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7861,22 +8390,11 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Canceled some task."] - pub struct Canceled { - pub when: canceled::When, - pub index: canceled::Index, - } - pub mod canceled { - use super::runtime_types; - pub type When = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Canceled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Canceled"; + #[doc = "Batch of dispatches completed fully with no error."] + pub struct BatchCompleted; + impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompleted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7885,28 +8403,11 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Dispatched some task."] - pub struct Dispatched { - pub task: dispatched::Task, - pub id: dispatched::Id, - pub result: dispatched::Result, - } - pub mod dispatched { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - pub type Result = - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Dispatched { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Dispatched"; + #[doc = "Batch of dispatches completed but has errors."] + pub struct BatchCompletedWithErrors; + impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompletedWithErrors { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompletedWithErrors"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7915,32 +8416,11 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Set a retry configuration for some task."] - pub struct RetrySet { - pub task: retry_set::Task, - pub id: retry_set::Id, - pub period: retry_set::Period, - pub retries: retry_set::Retries, - } - pub mod retry_set { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - pub type Period = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Retries = ::core::primitive::u8; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetrySet { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetrySet"; + #[doc = "A single item within a Batch of dispatches has completed with no error."] + pub struct ItemCompleted; + impl ::subxt::ext::subxt_core::events::StaticEvent for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7949,25 +8429,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Cancel a retry configuration for some task."] - pub struct RetryCancelled { - pub task: retry_cancelled::Task, - pub id: retry_cancelled::Id, + #[doc = "A single item within a Batch of dispatches has completed with error."] + pub struct ItemFailed { + pub error: item_failed::Error, } - pub mod retry_cancelled { + pub mod item_failed { use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub type Error = runtime_types::sp_runtime::DispatchError; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryCancelled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryCancelled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ItemFailed { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemFailed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -7976,25 +8448,18 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The call for the provided hash was not found so the task has been aborted."] - pub struct CallUnavailable { - pub task: call_unavailable::Task, - pub id: call_unavailable::Id, + #[doc = "A call was dispatched."] + pub struct DispatchedAs { + pub result: dispatched_as::Result, } - pub mod call_unavailable { + pub mod dispatched_as { use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for CallUnavailable { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "CallUnavailable"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DispatchedAs { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "DispatchedAs"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8003,25 +8468,11 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The given task was unable to be renewed since the agenda is full at that block."] - pub struct PeriodicFailed { - pub task: periodic_failed::Task, - pub id: periodic_failed::Id, - } - pub mod periodic_failed { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for PeriodicFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "PeriodicFailed"; + #[doc = "Main call was dispatched."] + pub struct IfElseMainSuccess; + impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseMainSuccess { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "IfElseMainSuccess"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8030,408 +8481,211 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The given task was unable to be retried since the agenda is full at that block or there"] - #[doc = "was not enough weight to reschedule it."] - pub struct RetryFailed { - pub task: retry_failed::Task, - pub id: retry_failed::Id, + #[doc = "The fallback call was dispatched."] + pub struct IfElseFallbackCalled { + pub main_error: if_else_fallback_called::MainError, } - pub mod retry_failed { + pub mod if_else_fallback_called { use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for RetryFailed { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "RetryFailed"; + pub type MainError = runtime_types::sp_runtime::DispatchError; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The given task can never be executed since it is overweight."] - pub struct PermanentlyOverweight { - pub task: permanently_overweight::Task, - pub id: permanently_overweight::Id, + impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseFallbackCalled { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "IfElseFallbackCalled"; } - pub mod permanently_overweight { - use super::runtime_types; - pub type Task = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The limit on the number of batched calls."] + pub fn batched_calls_limit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, - ); - pub type Id = ::core::option::Option<[::core::primitive::u8; 32usize]>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for PermanentlyOverweight { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "PermanentlyOverweight"; + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Utility", + "batched_calls_limit", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } } } - pub mod storage { - use super::runtime_types; + } + pub mod referenda { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_referenda::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_referenda::pallet::Call; + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; pub mod types { use super::runtime_types; - pub mod incomplete_block_since { - use super::runtime_types; - pub type IncompleteBlockSince = ::core::primitive::u32; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Propose a referendum on a privileged action."] + #[doc = ""] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = ""] + #[doc = "Emits `Submitted`."] + pub struct Submit { + pub proposal_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub proposal: submit::Proposal, + pub enactment_moment: submit::EnactmentMoment, } - pub mod incomplete_timestamp_since { + pub mod submit { use super::runtime_types; - pub type IncompleteTimestampSince = ::core::primitive::u64; + pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; + pub type EnactmentMoment = + runtime_types::frame_support::traits::schedule::DispatchTime< + ::core::primitive::u32, + >; } - pub mod last_processed_timestamp { - use super::runtime_types; - pub type LastProcessedTimestamp = ::core::primitive::u64; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "submit"; } - 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 = "Post the Decision Deposit for a referendum."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] + #[doc = ""] + #[doc = "Emits `DecisionDepositPlaced`."] + pub struct PlaceDecisionDeposit { + pub index: place_decision_deposit::Index, } - pub mod retries { + pub mod place_decision_deposit { 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::u32; } - pub mod lookup { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "place_decision_deposit"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `DecisionDepositRefunded`."] + pub struct RefundDecisionDeposit { + pub index: refund_decision_deposit::Index, + } + pub mod refund_decision_deposit { use super::runtime_types; - pub type Lookup = ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ); - pub type Param0 = [::core::primitive::u8; 32usize]; + pub type Index = ::core::primitive::u32; } - } - 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, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "refund_decision_deposit"; } - #[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, - ], - ) + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel an ongoing referendum."] + #[doc = ""] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Cancelled`."] + pub struct Cancel { + pub index: cancel::Index, } - #[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, - ], - ) + pub mod cancel { + use super::runtime_types; + pub type Index = ::core::primitive::u32; } - #[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, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "cancel"; } - #[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, - ], - ) - } - #[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, - ], - ) - } - #[doc = " Retry configurations for items to be executed, indexed by task address."] - pub fn retries( - &self, - _0: types::retries::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::retries::Param0, - >, - types::retries::Retries, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Retries", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 94u8, 54u8, 136u8, 189u8, 244u8, 118u8, 102u8, 67u8, 203u8, 238u8, - 109u8, 130u8, 229u8, 246u8, 244u8, 68u8, 59u8, 132u8, 12u8, 9u8, 219u8, - 176u8, 251u8, 1u8, 216u8, 200u8, 205u8, 176u8, 145u8, 201u8, 206u8, - 108u8, - ], - ) - } - #[doc = " Lookup from a name to the block number and index of the task."] + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel an ongoing referendum and slash the deposits."] #[doc = ""] - #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] - #[doc = " identities."] - pub fn lookup_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::lookup::Lookup, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Lookup", - (), - [ - 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, - 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, - 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, - ], - ) - } - #[doc = " Lookup from a name to the block number and index of the task."] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] - #[doc = " identities."] - pub fn lookup( - &self, - _0: types::lookup::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::lookup::Param0, - >, - types::lookup::Lookup, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Scheduler", - "Lookup", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 133u8, 194u8, 6u8, 16u8, 27u8, 10u8, 159u8, 62u8, 113u8, 59u8, 58u8, - 225u8, 244u8, 206u8, 35u8, 113u8, 41u8, 40u8, 89u8, 71u8, 133u8, 117u8, - 33u8, 192u8, 106u8, 85u8, 83u8, 186u8, 36u8, 160u8, 144u8, 221u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The maximum weight that may be scheduled per block for any dispatchables."] - pub fn maximum_weight( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_weights::weight_v2::Weight, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "MaximumWeight", - [ - 149u8, 252u8, 129u8, 80u8, 169u8, 36u8, 79u8, 127u8, 240u8, 156u8, - 56u8, 202u8, 219u8, 86u8, 5u8, 65u8, 245u8, 148u8, 138u8, 243u8, 210u8, - 128u8, 234u8, 216u8, 240u8, 219u8, 123u8, 235u8, 21u8, 158u8, 237u8, - 112u8, - ], - ) + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub struct Kill { + pub index: kill::Index, } - #[doc = " The maximum number of scheduled calls in the queue for a single block."] - #[doc = ""] - #[doc = " NOTE:"] - #[doc = " + Dependent pallets' benchmarks might require a higher limit for the setting. Set a"] - #[doc = " higher limit under `runtime-benchmarks` feature."] - pub fn max_scheduled_per_block( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "MaxScheduledPerBlock", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) + pub mod kill { + use super::runtime_types; + pub type Index = ::core::primitive::u32; } - #[doc = " Precision of the timestamp buckets."] - #[doc = ""] - #[doc = " Timestamp based dispatches are rounded to the nearest bucket of this precision."] - pub fn timestamp_bucket_size( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Scheduler", - "TimestampBucketSize", - [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, - 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, - 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, - 246u8, - ], - ) + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "kill"; } - } - } - } - pub mod utility { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_utility::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_utility::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -8443,36 +8697,20 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = "Advance a referendum onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - pub struct Batch { - pub calls: batch::Calls, + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub struct NudgeReferendum { + pub index: nudge_referendum::Index, } - pub mod batch { + pub mod nudge_referendum { use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::quantus_runtime::RuntimeCall, - >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Batch { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "nudge_referendum"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8485,31 +8723,25 @@ 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 = "Advance a track onto its next logical state. Only used internally."] #[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 = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[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, + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub struct OneFewerDeciding { + pub track: one_fewer_deciding::Track, } - pub mod as_derivative { + pub mod one_fewer_deciding { use super::runtime_types; - pub type Index = ::core::primitive::u16; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + pub type Track = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AsDerivative { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "as_derivative"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "one_fewer_deciding"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8522,31 +8754,23 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Send a batch of dispatch calls and atomically execute them."] - #[doc = "The whole transaction will rollback and fail if any of the calls failed."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] #[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 = "Emits `SubmissionDepositRefunded`."] + pub struct RefundSubmissionDeposit { + pub index: refund_submission_deposit::Index, } - pub mod batch_all { + pub mod refund_submission_deposit { use super::runtime_types; - pub type Calls = ::subxt::ext::subxt_core::alloc::vec::Vec< - runtime_types::quantus_runtime::RuntimeCall, - >; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for BatchAll { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "batch_all"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "refund_submission_deposit"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -8559,420 +8783,253 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "Set or clear metadata of a referendum."] #[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 = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub struct SetMetadata { + pub index: set_metadata::Index, + pub maybe_hash: set_metadata::MaybeHash, } - pub mod dispatch_as { + pub mod set_metadata { use super::runtime_types; - pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; + pub type Index = ::core::primitive::u32; + pub type MaybeHash = + ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAs { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "dispatch_as"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { + const PALLET: &'static str = "Referenda"; + const CALL: &'static str = "set_metadata"; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "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)."] + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Propose a referendum on a privileged action."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] #[doc = ""] - #[doc = "## 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"; + #[doc = "Emits `Submitted`."] + pub fn submit( + &self, + proposal_origin: types::submit::ProposalOrigin, + proposal: types::submit::Proposal, + enactment_moment: types::submit::EnactmentMoment, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Referenda", + "submit", + types::Submit { + proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + proposal_origin, + ), + proposal, + enactment_moment, + }, + [ + 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, + 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, + 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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 = "Post the Decision Deposit for a referendum."] #[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 = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _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"; + #[doc = "Emits `DecisionDepositPlaced`."] + pub fn place_decision_deposit( + &self, + index: types::place_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Referenda", + "place_decision_deposit", + types::PlaceDecisionDeposit { index }, + [ + 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, + 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, + 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_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 = "Refund the Decision Deposit for a closed referendum back to the depositor."] #[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 = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "In the event of a fallback failure the whole call fails"] - #[doc = "with the weights returned."] + #[doc = "Emits `DecisionDepositRefunded`."] + pub fn refund_decision_deposit( + &self, + index: types::refund_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundDecisionDeposit, + > { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Referenda", + "refund_decision_deposit", + types::RefundDecisionDeposit { index }, + [ + 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, + 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, + 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, + ], + ) + } + #[doc = "Cancel an ongoing referendum."] #[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 = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "## Dispatch Logic"] - #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] - #[doc = " applying any origin filters."] - #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] - #[doc = " `fallback` calls."] - #[doc = ""] - #[doc = "## Use Case"] - #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] - #[doc = " or both."] - pub struct IfElse { - pub main: ::subxt::ext::subxt_core::alloc::boxed::Box, - pub fallback: ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod if_else { - use super::runtime_types; - pub type Main = runtime_types::quantus_runtime::RuntimeCall; - pub type Fallback = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for IfElse { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "if_else"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub struct DispatchAsFallible { - pub as_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub call: - ::subxt::ext::subxt_core::alloc::boxed::Box, - } - pub mod dispatch_as_fallible { - use super::runtime_types; - pub type AsOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Call = runtime_types::quantus_runtime::RuntimeCall; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DispatchAsFallible { - const PALLET: &'static str = "Utility"; - const CALL: &'static str = "dispatch_as_fallible"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Send a batch of dispatch calls."] - #[doc = ""] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] - #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] - #[doc = ""] - #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] - #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - #[doc = ""] - #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] - #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] - #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] - #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] - #[doc = "event is deposited."] - pub fn batch( + #[doc = "Emits `Cancelled`."] + pub fn cancel( &self, - calls: types::batch::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::cancel::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "batch", - types::Batch { calls }, + "Referenda", + "cancel", + types::Cancel { index }, [ - 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, + 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, + 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, + 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, + 122u8, ], ) } - #[doc = "Send a 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 = "Cancel an ongoing referendum and slash the deposits."] #[doc = ""] - #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Signed_."] - pub fn as_derivative( + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub fn kill( &self, - index: types::as_derivative::Index, - call: types::as_derivative::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::kill::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "as_derivative", - types::AsDerivative { - index, - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Referenda", + "kill", + types::Kill { index }, [ - 3u8, 102u8, 237u8, 140u8, 8u8, 207u8, 27u8, 204u8, 155u8, 162u8, 124u8, - 141u8, 172u8, 210u8, 89u8, 239u8, 113u8, 175u8, 41u8, 9u8, 150u8, - 130u8, 205u8, 125u8, 205u8, 199u8, 174u8, 85u8, 24u8, 13u8, 57u8, 19u8, + 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, + 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, + 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, + 48u8, ], ) } - #[doc = "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 = "Advance a referendum onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub fn batch_all( + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub fn nudge_referendum( &self, - calls: types::batch_all::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::nudge_referendum::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "batch_all", - types::BatchAll { calls }, + "Referenda", + "nudge_referendum", + types::NudgeReferendum { index }, [ - 76u8, 242u8, 205u8, 32u8, 158u8, 24u8, 255u8, 12u8, 97u8, 24u8, 211u8, - 63u8, 119u8, 183u8, 165u8, 217u8, 17u8, 178u8, 254u8, 230u8, 119u8, - 207u8, 207u8, 103u8, 39u8, 226u8, 55u8, 73u8, 233u8, 79u8, 60u8, 218u8, + 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, + 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, + 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, + 213u8, ], ) } - #[doc = "Dispatches a function call with a provided origin."] + #[doc = "Advance a track onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(1)."] - pub fn dispatch_as( + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub fn one_fewer_deciding( &self, - as_origin: types::dispatch_as::AsOrigin, - call: types::dispatch_as::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + track: types::one_fewer_deciding::Track, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "dispatch_as", - types::DispatchAs { - as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, + "Referenda", + "one_fewer_deciding", + types::OneFewerDeciding { track }, [ - 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, + 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, + 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, + 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, + 131u8, 167u8, ], ) } - #[doc = "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 = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] - #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "## Complexity"] - #[doc = "- O(C) where C is the number of calls to be batched."] - pub fn force_batch( + #[doc = "Emits `SubmissionDepositRefunded`."] + pub fn refund_submission_deposit( &self, - calls: types::force_batch::Calls, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::refund_submission_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundSubmissionDeposit, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "force_batch", - types::ForceBatch { calls }, + "Referenda", + "refund_submission_deposit", + types::RefundSubmissionDeposit { index }, [ - 26u8, 82u8, 61u8, 185u8, 19u8, 29u8, 151u8, 192u8, 24u8, 41u8, 115u8, - 237u8, 7u8, 38u8, 68u8, 5u8, 159u8, 117u8, 47u8, 138u8, 101u8, 126u8, - 255u8, 137u8, 144u8, 51u8, 244u8, 145u8, 113u8, 21u8, 123u8, 79u8, + 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, + 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, + 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, ], ) } - #[doc = "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 = "Set or clear metadata of a referendum."] #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub fn with_weight( + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub fn set_metadata( &self, - call: types::with_weight::Call, - weight: types::with_weight::Weight, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::set_metadata::Index, + maybe_hash: types::set_metadata::MaybeHash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "with_weight", - types::WithWeight { - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - weight, - }, + "Referenda", + "set_metadata", + types::SetMetadata { index, maybe_hash }, [ - 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, - ], - ) - } - #[doc = "Dispatch a fallback call in the event the main call fails to execute."] - #[doc = "May be called from any origin except `None`."] - #[doc = ""] - #[doc = "This function first attempts to dispatch the `main` call."] - #[doc = "If the `main` call fails, the `fallback` is attemted."] - #[doc = "if the fallback is successfully dispatched, the weights of both calls"] - #[doc = "are accumulated and an event containing the main call error is deposited."] - #[doc = ""] - #[doc = "In the event of a fallback failure the whole call fails"] - #[doc = "with the weights returned."] - #[doc = ""] - #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] - #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] - #[doc = ""] - #[doc = "## Dispatch Logic"] - #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] - #[doc = " applying any origin filters."] - #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] - #[doc = " `fallback` calls."] - #[doc = ""] - #[doc = "## Use Case"] - #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] - #[doc = " or both."] - pub fn if_else( - &self, - main: types::if_else::Main, - fallback: types::if_else::Fallback, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "if_else", - types::IfElse { - main: ::subxt::ext::subxt_core::alloc::boxed::Box::new(main), - fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), - }, - [ - 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, - ], - ) - } - #[doc = "Dispatches a function call with a provided origin."] - #[doc = ""] - #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] - #[doc = ""] - #[doc = "The dispatch origin for this call must be _Root_."] - pub fn dispatch_as_fallible( - &self, - as_origin: types::dispatch_as_fallible::AsOrigin, - call: types::dispatch_as_fallible::Call, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "Utility", - "dispatch_as_fallible", - types::DispatchAsFallible { - as_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new(as_origin), - call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), - }, - [ - 52u8, 4u8, 122u8, 93u8, 231u8, 186u8, 88u8, 129u8, 36u8, 245u8, 176u8, - 117u8, 22u8, 203u8, 94u8, 115u8, 19u8, 27u8, 141u8, 63u8, 184u8, 171u8, - 146u8, 63u8, 124u8, 225u8, 135u8, 73u8, 51u8, 20u8, 60u8, 199u8, + 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, + 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, + 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, + 88u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_utility::pallet::Event; + pub type Event = runtime_types::pallet_referenda::pallet::Event1; pub mod events { use super::runtime_types; #[derive( @@ -8982,20 +9039,24 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] - #[doc = "well as the error."] - pub struct BatchInterrupted { - pub index: batch_interrupted::Index, - pub error: batch_interrupted::Error, + #[doc = "A referendum has been submitted."] + pub struct Submitted { + pub index: submitted::Index, + pub track: submitted::Track, + pub proposal: submitted::Proposal, } - pub mod batch_interrupted { + pub mod submitted { use super::runtime_types; pub type Index = ::core::primitive::u32; - pub type Error = runtime_types::sp_runtime::DispatchError; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchInterrupted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchInterrupted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Submitted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9004,11 +9065,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 = "Batch of dispatches completed fully with no error."] - pub struct BatchCompleted; - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompleted"; + #[doc = "The decision deposit has been placed."] + pub struct DecisionDepositPlaced { + pub index: decision_deposit_placed::Index, + pub who: decision_deposit_placed::Who, + pub amount: decision_deposit_placed::Amount, + } + pub mod decision_deposit_placed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "DecisionDepositPlaced"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9017,11 +9088,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 = "Batch of dispatches completed but has errors."] - pub struct BatchCompletedWithErrors; - impl ::subxt::ext::subxt_core::events::StaticEvent for BatchCompletedWithErrors { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompletedWithErrors"; + #[doc = "The decision deposit has been refunded."] + pub struct DecisionDepositRefunded { + pub index: decision_deposit_refunded::Index, + pub who: decision_deposit_refunded::Who, + pub amount: decision_deposit_refunded::Amount, + } + pub mod decision_deposit_refunded { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "DecisionDepositRefunded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9030,11 +9111,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A single item within a Batch of dispatches has completed with no error."] - pub struct ItemCompleted; - impl ::subxt::ext::subxt_core::events::StaticEvent for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; + #[doc = "A deposit has been slashed."] + pub struct DepositSlashed { + pub who: deposit_slashed::Who, + pub amount: deposit_slashed::Amount, + } + pub mod deposit_slashed { + use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "DepositSlashed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9043,17 +9132,27 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A single item within a Batch of dispatches has completed with error."] - pub struct ItemFailed { - pub error: item_failed::Error, + #[doc = "A referendum has moved into the deciding phase."] + pub struct DecisionStarted { + pub index: decision_started::Index, + pub track: decision_started::Track, + pub proposal: decision_started::Proposal, + pub tally: decision_started::Tally, } - pub mod item_failed { + pub mod decision_started { use super::runtime_types; - pub type Error = runtime_types::sp_runtime::DispatchError; + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ItemFailed { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemFailed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "DecisionStarted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9062,18 +9161,16 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A call was dispatched."] - pub struct DispatchedAs { - pub result: dispatched_as::Result, + pub struct ConfirmStarted { + pub index: confirm_started::Index, } - pub mod dispatched_as { + pub mod confirm_started { use super::runtime_types; - pub type Result = - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for DispatchedAs { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "DispatchedAs"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "ConfirmStarted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9082,11 +9179,16 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Main call was dispatched."] - pub struct IfElseMainSuccess; - impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseMainSuccess { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "IfElseMainSuccess"; + pub struct ConfirmAborted { + pub index: confirm_aborted::Index, + } + pub mod confirm_aborted { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "ConfirmAborted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -9095,2307 +9197,587 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The fallback call was dispatched."] - pub struct IfElseFallbackCalled { - pub main_error: if_else_fallback_called::MainError, + #[doc = "A referendum has ended its confirmation phase and is ready for approval."] + pub struct Confirmed { + pub index: confirmed::Index, + pub tally: confirmed::Tally, } - pub mod if_else_fallback_called { + pub mod confirmed { use super::runtime_types; - pub type MainError = runtime_types::sp_runtime::DispatchError; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for IfElseFallbackCalled { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "IfElseFallbackCalled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Confirmed"; } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The limit on the number of batched calls."] - pub fn batched_calls_limit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Utility", - "batched_calls_limit", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been approved and its proposal has been scheduled."] + pub struct Approved { + pub index: approved::Index, } - } - } - pub mod referenda { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_referenda::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_referenda::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod approved { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Approved"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A proposal has been rejected by referendum."] + pub struct Rejected { + pub index: rejected::Index, + pub tally: rejected::Tally, + } + pub mod rejected { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Rejected"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been timed out without being decided."] + pub struct TimedOut { + pub index: timed_out::Index, + pub tally: timed_out::Tally, + } + pub mod timed_out { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "TimedOut"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been cancelled."] + pub struct Cancelled { + pub index: cancelled::Index, + pub tally: cancelled::Tally, + } + pub mod cancelled { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Cancelled"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been killed."] + pub struct Killed { + pub index: killed::Index, + pub tally: killed::Tally, + } + pub mod killed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = + runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "Killed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The submission deposit has been refunded."] + pub struct SubmissionDepositRefunded { + pub index: submission_deposit_refunded::Index, + pub who: submission_deposit_refunded::Who, + pub amount: submission_deposit_refunded::Amount, + } + pub mod submission_deposit_refunded { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "SubmissionDepositRefunded"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata for a referendum has been set."] + pub struct MetadataSet { + pub index: metadata_set::Index, + pub hash: metadata_set::Hash, + } + pub mod metadata_set { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Metadata for a referendum has been cleared."] + pub struct MetadataCleared { + pub index: metadata_cleared::Index, + pub hash: metadata_cleared::Hash, + } + pub mod metadata_cleared { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { + const PALLET: &'static str = "Referenda"; + const EVENT: &'static str = "MetadataCleared"; + } + } + pub mod storage { + use super::runtime_types; pub mod types { use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub struct Submit { - pub proposal_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub proposal: submit::Proposal, - pub enactment_moment: submit::EnactmentMoment, + pub mod referendum_count { + use super::runtime_types; + pub type ReferendumCount = ::core::primitive::u32; } - pub mod submit { + pub mod referendum_info_for { use super::runtime_types; - pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - pub type EnactmentMoment = - runtime_types::frame_support::traits::schedule::DispatchTime< + pub type ReferendumInfoFor = + runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::quantus_runtime::OriginCaller, ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >, + ::core::primitive::u128, + runtime_types::pallet_conviction_voting::types::Tally< + ::core::primitive::u128, + >, + ::subxt::ext::subxt_core::utils::AccountId32, + ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ), >; + pub type Param0 = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "submit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] - #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub struct PlaceDecisionDeposit { - pub index: place_decision_deposit::Index, - } - pub mod place_decision_deposit { + pub mod track_queue { use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "place_decision_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub struct RefundDecisionDeposit { - pub index: refund_decision_deposit::Index, + pub type TrackQueue = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u128, + )>; + pub type Param0 = ::core::primitive::u16; } - pub mod refund_decision_deposit { + pub mod deciding_count { use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "refund_decision_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub struct Cancel { - pub index: cancel::Index, + pub type DecidingCount = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } - pub mod cancel { + pub mod metadata_of { use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "cancel"; + pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub struct Kill { - pub index: kill::Index, + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The next free referendum index, aka the number of referenda started so far."] + pub fn referendum_count( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::referendum_count::ReferendumCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Referenda", + "ReferendumCount", + (), + [ + 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, + 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, + 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, + 67u8, + ], + ) } - pub mod kill { - use super::runtime_types; - pub type Index = ::core::primitive::u32; + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::referendum_info_for::ReferendumInfoFor, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Referenda", + "ReferendumInfoFor", + (), + [ + 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, + 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, + 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "kill"; + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for( + &self, + _0: types::referendum_info_for::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::referendum_info_for::Param0, + >, + types::referendum_info_for::ReferendumInfoFor, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Referenda", + "ReferendumInfoFor", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, + 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, + 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub struct NudgeReferendum { - pub index: nudge_referendum::Index, - } - pub mod nudge_referendum { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "nudge_referendum"; + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::track_queue::TrackQueue, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Referenda", + "TrackQueue", + (), + [ + 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, + 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, + 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, + ], + ) } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub struct OneFewerDeciding { - pub track: one_fewer_deciding::Track, - } - pub mod one_fewer_deciding { - use super::runtime_types; - pub type Track = ::core::primitive::u16; + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue( + &self, + _0: types::track_queue::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::track_queue::Param0, + >, + types::track_queue::TrackQueue, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Referenda", + "TrackQueue", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, + 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, + 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, + ], + ) } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "one_fewer_deciding"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub struct RefundSubmissionDeposit { - pub index: refund_submission_deposit::Index, - } - pub mod refund_submission_deposit { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "refund_submission_deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Set or clear metadata of a referendum."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub struct SetMetadata { - pub index: set_metadata::Index, - pub maybe_hash: set_metadata::MaybeHash, - } - pub mod set_metadata { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeHash = - ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "Referenda"; - const CALL: &'static str = "set_metadata"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub fn submit( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count_iter( &self, - proposal_origin: types::submit::ProposalOrigin, - proposal: types::submit::Proposal, - enactment_moment: types::submit::EnactmentMoment, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::deciding_count::DecidingCount, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "submit", - types::Submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - proposal_origin, - ), - proposal, - enactment_moment, - }, + "DecidingCount", + (), [ - 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, - 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, - 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, ], ) } - #[doc = "Post the Decision Deposit for a referendum."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] - #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub fn place_decision_deposit( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count( &self, - index: types::place_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::deciding_count::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::deciding_count::Param0, + >, + types::deciding_count::DecidingCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "place_decision_deposit", - types::PlaceDecisionDeposit { index }, + "DecidingCount", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, - 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, - 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, ], ) } - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub fn refund_decision_deposit( + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of_iter( &self, - index: types::refund_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundDecisionDeposit, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::metadata_of::MetadataOf, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "refund_decision_deposit", - types::RefundDecisionDeposit { index }, + "MetadataOf", + (), [ - 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, - 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, - 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } - #[doc = "Cancel an ongoing referendum."] - #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub fn cancel( + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of( &self, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + _0: types::metadata_of::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::metadata_of::Param0, + >, + types::metadata_of::MetadataOf, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "Referenda", - "cancel", - types::Cancel { index }, + "MetadataOf", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, - 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, - 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, - 122u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } - #[doc = "Cancel an ongoing referendum and slash the deposits."] - #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] - #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub fn kill( + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] + pub fn submission_deposit( &self, - index: types::kill::Index, - ) -> ::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::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "Referenda", - "kill", - types::Kill { index }, + "SubmissionDeposit", [ - 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, - 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, - 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, - 48u8, + 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 = "Advance a referendum onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub fn nudge_referendum( - &self, - index: types::nudge_referendum::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + #[doc = " Maximum size of the referendum queue for a single track."] + pub fn max_queued( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "Referenda", - "nudge_referendum", - types::NudgeReferendum { index }, + "MaxQueued", [ - 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, - 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, - 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, - 213u8, + 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 = "Advance a track onto its next logical state. Only used internally."] - #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] - #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub fn one_fewer_deciding( + #[doc = " The number of blocks after submission that a referendum must begin being decided by."] + #[doc = " Once this passes, then anyone may cancel the referendum."] + pub fn undeciding_timeout( &self, - track: types::one_fewer_deciding::Track, - ) -> ::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( "Referenda", - "one_fewer_deciding", - types::OneFewerDeciding { track }, + "UndecidingTimeout", [ - 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, - 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, - 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, - 131u8, 167u8, + 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 = "Refund the Submission Deposit for a closed referendum back to the depositor."] - #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] - #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub fn refund_submission_deposit( + #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] + #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] + #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] + pub fn alarm_interval( &self, - index: types::refund_submission_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundSubmissionDeposit, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "Referenda", - "refund_submission_deposit", - types::RefundSubmissionDeposit { index }, + "AlarmInterval", [ - 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, - 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, - 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, + 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 = "Set or clear metadata of a referendum."] + #[doc = " A list of tracks."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub fn set_metadata( + #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] + pub fn tracks( &self, - index: types::set_metadata::Index, - maybe_hash: types::set_metadata::MaybeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u16, + runtime_types::pallet_referenda::types::TrackDetails< + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::subxt_core::alloc::string::String, + >, + )>, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( "Referenda", - "set_metadata", - types::SetMetadata { index, maybe_hash }, + "Tracks", [ - 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, - 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, - 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, - 88u8, + 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, + 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, + 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, + 159u8, ], ) } } } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_referenda::pallet::Event1; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been submitted."] - pub struct Submitted { - pub index: submitted::Index, - pub track: submitted::Track, - pub proposal: submitted::Proposal, - } - pub mod submitted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Submitted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been placed."] - pub struct DecisionDepositPlaced { - pub index: decision_deposit_placed::Index, - pub who: decision_deposit_placed::Who, - pub amount: decision_deposit_placed::Amount, - } - pub mod decision_deposit_placed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionDepositPlaced"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been refunded."] - pub struct DecisionDepositRefunded { - pub index: decision_deposit_refunded::Index, - pub who: decision_deposit_refunded::Who, - pub amount: decision_deposit_refunded::Amount, - } - pub mod decision_deposit_refunded { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionDepositRefunded"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A deposit has been slashed."] - pub struct DepositSlashed { - pub who: deposit_slashed::Who, - pub amount: deposit_slashed::Amount, - } - pub mod deposit_slashed { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DepositSlashed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has moved into the deciding phase."] - pub struct DecisionStarted { - pub index: decision_started::Index, - pub track: decision_started::Track, - pub proposal: decision_started::Proposal, - pub tally: decision_started::Tally, - } - pub mod decision_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "DecisionStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmStarted { - pub index: confirm_started::Index, - } - pub mod confirm_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "ConfirmStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmAborted { - pub index: confirm_aborted::Index, - } - pub mod confirm_aborted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "ConfirmAborted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has ended its confirmation phase and is ready for approval."] - pub struct Confirmed { - pub index: confirmed::Index, - pub tally: confirmed::Tally, - } - pub mod confirmed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Confirmed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been approved and its proposal has been scheduled."] - pub struct Approved { - pub index: approved::Index, - } - pub mod approved { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Approved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A proposal has been rejected by referendum."] - pub struct Rejected { - pub index: rejected::Index, - pub tally: rejected::Tally, - } - pub mod rejected { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Rejected"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been timed out without being decided."] - pub struct TimedOut { - pub index: timed_out::Index, - pub tally: timed_out::Tally, - } - pub mod timed_out { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "TimedOut"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been cancelled."] - pub struct Cancelled { - pub index: cancelled::Index, - pub tally: cancelled::Tally, - } - pub mod cancelled { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Cancelled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been killed."] - pub struct Killed { - pub index: killed::Index, - pub tally: killed::Tally, - } - pub mod killed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = - runtime_types::pallet_conviction_voting::types::Tally<::core::primitive::u128>; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "Killed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The submission deposit has been refunded."] - pub struct SubmissionDepositRefunded { - pub index: submission_deposit_refunded::Index, - pub who: submission_deposit_refunded::Who, - pub amount: submission_deposit_refunded::Amount, - } - pub mod submission_deposit_refunded { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "SubmissionDepositRefunded"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been set."] - pub struct MetadataSet { - pub index: metadata_set::Index, - pub hash: metadata_set::Hash, - } - pub mod metadata_set { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "MetadataSet"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been cleared."] - pub struct MetadataCleared { - pub index: metadata_cleared::Index, - pub hash: metadata_cleared::Hash, - } - pub mod metadata_cleared { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "Referenda"; - const EVENT: &'static str = "MetadataCleared"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod referendum_count { - use super::runtime_types; - pub type ReferendumCount = ::core::primitive::u32; - } - pub mod referendum_info_for { - use super::runtime_types; - pub type ReferendumInfoFor = - runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::quantus_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >, - ::core::primitive::u128, - runtime_types::pallet_conviction_voting::types::Tally< - ::core::primitive::u128, - >, - ::subxt::ext::subxt_core::utils::AccountId32, - ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ), - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod track_queue { - use super::runtime_types; - pub type TrackQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u128, - )>; - pub type Param0 = ::core::primitive::u16; - } - pub mod deciding_count { - use super::runtime_types; - pub type DecidingCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - } - pub mod metadata_of { - use super::runtime_types; - pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; - pub type Param0 = ::core::primitive::u32; - } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " The next free referendum index, aka the number of referenda started so far."] - pub fn referendum_count( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::referendum_count::ReferendumCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumCount", - (), - [ - 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, - 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, - 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, - 67u8, - ], - ) - } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::referendum_info_for::ReferendumInfoFor, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumInfoFor", - (), - [ - 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, - 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, - 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, - ], - ) - } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for( - &self, - _0: types::referendum_info_for::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::referendum_info_for::Param0, - >, - types::referendum_info_for::ReferendumInfoFor, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "ReferendumInfoFor", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, - 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, - 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, - ], - ) - } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::track_queue::TrackQueue, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "TrackQueue", - (), - [ - 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, - 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, - 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, - ], - ) - } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue( - &self, - _0: types::track_queue::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::track_queue::Param0, - >, - types::track_queue::TrackQueue, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "TrackQueue", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 125u8, 59u8, 111u8, 68u8, 27u8, 236u8, 82u8, 55u8, 83u8, 159u8, 105u8, - 20u8, 241u8, 118u8, 58u8, 141u8, 103u8, 60u8, 246u8, 49u8, 121u8, - 183u8, 7u8, 203u8, 225u8, 67u8, 132u8, 79u8, 150u8, 107u8, 71u8, 89u8, - ], - ) - } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::deciding_count::DecidingCount, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "DecidingCount", - (), - [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, - ], - ) - } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count( - &self, - _0: types::deciding_count::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::deciding_count::Param0, - >, - types::deciding_count::DecidingCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "DecidingCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, - ], - ) - } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::metadata_of::MetadataOf, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "MetadataOf", - (), - [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, - ], - ) - } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of( - &self, - _0: types::metadata_of::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata_of::Param0, - >, - types::metadata_of::MetadataOf, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Referenda", - "MetadataOf", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] - pub fn submission_deposit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "SubmissionDeposit", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) - } - #[doc = " Maximum size of the referendum queue for a single track."] - pub fn max_queued( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "MaxQueued", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The number of blocks after submission that a referendum must begin being decided by."] - #[doc = " Once this passes, then anyone may cancel the referendum."] - pub fn undeciding_timeout( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "UndecidingTimeout", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] - #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] - #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] - pub fn alarm_interval( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "AlarmInterval", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " A list of tracks."] - #[doc = ""] - #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] - pub fn tracks( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u16, - runtime_types::pallet_referenda::types::TrackDetails< - ::core::primitive::u128, - ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::string::String, - >, - )>, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Referenda", - "Tracks", - [ - 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, - 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, - 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, - 159u8, - ], - ) - } - } - } - } - pub mod reversible_transfers { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_reversible_transfers::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_reversible_transfers::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Enable high-security for the calling account with a specified"] - #[doc = "reversibility delay."] - #[doc = ""] - #[doc = "Recoverer and interceptor (aka guardian) could be the same account or"] - #[doc = "different accounts."] - #[doc = ""] - #[doc = "Once an account is set as high security it can only make reversible"] - #[doc = "transfers. It is not allowed any other calls."] - #[doc = ""] - #[doc = "- `delay`: The reversibility time for any transfer made by the high"] - #[doc = "security account."] - #[doc = "- interceptor: The account that can intercept transctions from the"] - #[doc = "high security account."] - pub struct SetHighSecurity { - pub delay: set_high_security::Delay, - pub interceptor: set_high_security::Interceptor, - } - pub mod set_high_security { - use super::runtime_types; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHighSecurity { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "set_high_security"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Cancel a pending reversible transaction scheduled by the caller."] - #[doc = ""] - #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] - pub struct Cancel { - pub tx_id: cancel::TxId, - } - pub mod cancel { - use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "cancel"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Called by the Scheduler to finalize the scheduled task/call"] - #[doc = ""] - #[doc = "- `tx_id`: The unique id of the transaction to finalize and dispatch."] - pub struct ExecuteTransfer { - pub tx_id: execute_transfer::TxId, - } - pub mod execute_transfer { - use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExecuteTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "execute_transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule a transaction for delayed execution."] - pub struct ScheduleTransfer { - pub dest: schedule_transfer::Dest, - pub amount: schedule_transfer::Amount, - } - pub mod schedule_transfer { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] - #[doc = ""] - #[doc = "This can only be used by accounts that have *not* set up a persistent"] - #[doc = "reversibility configuration with `set_high_security`."] - #[doc = ""] - #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] - pub struct ScheduleTransferWithDelay { - pub dest: schedule_transfer_with_delay::Dest, - pub amount: schedule_transfer_with_delay::Amount, - pub delay: schedule_transfer_with_delay::Delay, - } - pub mod schedule_transfer_with_delay { - use super::runtime_types; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransferWithDelay { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_transfer_with_delay"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] - #[doc = "delay."] - pub struct ScheduleAssetTransfer { - pub asset_id: schedule_asset_transfer::AssetId, - pub dest: schedule_asset_transfer::Dest, - pub amount: schedule_asset_transfer::Amount, - } - pub mod schedule_asset_transfer { - use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransfer { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_asset_transfer"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] - pub struct ScheduleAssetTransferWithDelay { - pub asset_id: schedule_asset_transfer_with_delay::AssetId, - pub dest: schedule_asset_transfer_with_delay::Dest, - pub amount: schedule_asset_transfer_with_delay::Amount, - pub delay: schedule_asset_transfer_with_delay::Delay, - } - pub mod schedule_asset_transfer_with_delay { - use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Amount = ::core::primitive::u128; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransferWithDelay { - const PALLET: &'static str = "ReversibleTransfers"; - const CALL: &'static str = "schedule_asset_transfer_with_delay"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Enable high-security for the calling account with a specified"] - #[doc = "reversibility delay."] - #[doc = ""] - #[doc = "Recoverer and interceptor (aka guardian) could be the same account or"] - #[doc = "different accounts."] - #[doc = ""] - #[doc = "Once an account is set as high security it can only make reversible"] - #[doc = "transfers. It is not allowed any other calls."] - #[doc = ""] - #[doc = "- `delay`: The reversibility time for any transfer made by the high"] - #[doc = "security account."] - #[doc = "- interceptor: The account that can intercept transctions from the"] - #[doc = "high security account."] - pub fn set_high_security( - &self, - delay: types::set_high_security::Delay, - interceptor: types::set_high_security::Interceptor, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "set_high_security", - types::SetHighSecurity { delay, interceptor }, - [ - 202u8, 17u8, 43u8, 37u8, 215u8, 198u8, 42u8, 183u8, 53u8, 124u8, 140u8, - 34u8, 112u8, 230u8, 55u8, 168u8, 242u8, 249u8, 91u8, 185u8, 244u8, - 81u8, 40u8, 231u8, 121u8, 155u8, 202u8, 76u8, 137u8, 7u8, 225u8, 184u8, - ], - ) - } - #[doc = "Cancel a pending reversible transaction scheduled by the caller."] - #[doc = ""] - #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] - pub fn cancel( - &self, - tx_id: types::cancel::TxId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "cancel", - types::Cancel { tx_id }, - [ - 228u8, 150u8, 194u8, 119u8, 243u8, 126u8, 112u8, 227u8, 70u8, 160u8, - 132u8, 82u8, 146u8, 162u8, 195u8, 149u8, 236u8, 98u8, 18u8, 44u8, - 151u8, 249u8, 193u8, 176u8, 186u8, 98u8, 224u8, 103u8, 191u8, 165u8, - 37u8, 47u8, - ], - ) - } - #[doc = "Called by the Scheduler to finalize the scheduled task/call"] - #[doc = ""] - #[doc = "- `tx_id`: The unique id of the transaction to finalize and dispatch."] - pub fn execute_transfer( - &self, - tx_id: types::execute_transfer::TxId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "execute_transfer", - types::ExecuteTransfer { tx_id }, - [ - 164u8, 38u8, 166u8, 81u8, 63u8, 235u8, 167u8, 178u8, 97u8, 80u8, 62u8, - 147u8, 3u8, 163u8, 129u8, 25u8, 98u8, 59u8, 17u8, 137u8, 6u8, 183u8, - 189u8, 51u8, 24u8, 211u8, 157u8, 108u8, 229u8, 253u8, 37u8, 78u8, - ], - ) - } - #[doc = "Schedule a transaction for delayed execution."] - pub fn schedule_transfer( - &self, - dest: types::schedule_transfer::Dest, - amount: types::schedule_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_transfer", - types::ScheduleTransfer { dest, amount }, - [ - 38u8, 219u8, 206u8, 56u8, 252u8, 195u8, 52u8, 74u8, 113u8, 125u8, - 107u8, 35u8, 236u8, 39u8, 31u8, 18u8, 250u8, 177u8, 174u8, 154u8, - 149u8, 122u8, 183u8, 50u8, 45u8, 111u8, 100u8, 249u8, 102u8, 82u8, - 72u8, 130u8, - ], - ) - } - #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] - #[doc = ""] - #[doc = "This can only be used by accounts that have *not* set up a persistent"] - #[doc = "reversibility configuration with `set_high_security`."] - #[doc = ""] - #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] - pub fn schedule_transfer_with_delay( - &self, - dest: types::schedule_transfer_with_delay::Dest, - amount: types::schedule_transfer_with_delay::Amount, - delay: types::schedule_transfer_with_delay::Delay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleTransferWithDelay, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_transfer_with_delay", - types::ScheduleTransferWithDelay { dest, amount, delay }, - [ - 254u8, 158u8, 173u8, 217u8, 107u8, 80u8, 229u8, 252u8, 123u8, 46u8, - 177u8, 40u8, 25u8, 15u8, 32u8, 22u8, 224u8, 52u8, 242u8, 48u8, 242u8, - 84u8, 242u8, 143u8, 111u8, 12u8, 82u8, 161u8, 129u8, 86u8, 161u8, - 216u8, - ], - ) - } - #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] - #[doc = "delay."] - pub fn schedule_asset_transfer( - &self, - asset_id: types::schedule_asset_transfer::AssetId, - dest: types::schedule_asset_transfer::Dest, - amount: types::schedule_asset_transfer::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleAssetTransfer, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_asset_transfer", - types::ScheduleAssetTransfer { asset_id, dest, amount }, - [ - 125u8, 51u8, 89u8, 31u8, 247u8, 200u8, 156u8, 209u8, 28u8, 170u8, - 203u8, 254u8, 40u8, 131u8, 155u8, 166u8, 65u8, 152u8, 101u8, 198u8, - 70u8, 129u8, 5u8, 89u8, 220u8, 189u8, 255u8, 87u8, 58u8, 24u8, 234u8, - 42u8, - ], - ) - } - #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] - pub fn schedule_asset_transfer_with_delay( - &self, - asset_id: types::schedule_asset_transfer_with_delay::AssetId, - dest: types::schedule_asset_transfer_with_delay::Dest, - amount: types::schedule_asset_transfer_with_delay::Amount, - delay: types::schedule_asset_transfer_with_delay::Delay, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::ScheduleAssetTransferWithDelay, - > { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ReversibleTransfers", - "schedule_asset_transfer_with_delay", - types::ScheduleAssetTransferWithDelay { asset_id, dest, amount, delay }, - [ - 249u8, 59u8, 121u8, 27u8, 78u8, 202u8, 252u8, 120u8, 76u8, 102u8, 33u8, - 232u8, 185u8, 78u8, 8u8, 157u8, 139u8, 72u8, 110u8, 91u8, 170u8, 179u8, - 89u8, 250u8, 77u8, 26u8, 160u8, 252u8, 62u8, 179u8, 128u8, 216u8, - ], - ) - } - } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_reversible_transfers::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A user has enabled their high-security settings."] - #[doc = "[who, interceptor, recoverer, delay]"] - pub struct HighSecuritySet { - pub who: high_security_set::Who, - pub interceptor: high_security_set::Interceptor, - pub delay: high_security_set::Delay, - } - pub mod high_security_set { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for HighSecuritySet { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "HighSecuritySet"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A transaction has been intercepted and scheduled for delayed execution."] - #[doc = "[from, to, interceptor, amount, tx_id, execute_at_moment]"] - pub struct TransactionScheduled { - pub from: transaction_scheduled::From, - pub to: transaction_scheduled::To, - pub interceptor: transaction_scheduled::Interceptor, - pub asset_id: transaction_scheduled::AssetId, - pub amount: transaction_scheduled::Amount, - pub tx_id: transaction_scheduled::TxId, - pub execute_at: transaction_scheduled::ExecuteAt, - } - pub mod transaction_scheduled { - use super::runtime_types; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; - pub type AssetId = ::core::option::Option<::core::primitive::u32>; - pub type Amount = ::core::primitive::u128; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - pub type ExecuteAt = runtime_types::qp_scheduler::DispatchTime< - ::core::primitive::u32, - ::core::primitive::u64, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionScheduled { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionScheduled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A scheduled transaction has been successfully cancelled by the owner."] - #[doc = "[who, tx_id]"] - pub struct TransactionCancelled { - pub who: transaction_cancelled::Who, - pub tx_id: transaction_cancelled::TxId, - } - pub mod transaction_cancelled { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionCancelled { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionCancelled"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A scheduled transaction was executed by the scheduler."] - #[doc = "[tx_id, dispatch_result]"] - pub struct TransactionExecuted { - pub tx_id: transaction_executed::TxId, - pub result: transaction_executed::Result, - } - pub mod transaction_executed { - use super::runtime_types; - pub type TxId = ::subxt::ext::subxt_core::utils::H256; - pub type Result = ::core::result::Result< - runtime_types::frame_support::dispatch::PostDispatchInfo, - runtime_types::sp_runtime::DispatchErrorWithPostInfo< - runtime_types::frame_support::dispatch::PostDispatchInfo, - >, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionExecuted { - const PALLET: &'static str = "ReversibleTransfers"; - const EVENT: &'static str = "TransactionExecuted"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod high_security_accounts { - use super::runtime_types; - pub type HighSecurityAccounts = - runtime_types::pallet_reversible_transfers::HighSecurityAccountData< - ::subxt::ext::subxt_core::utils::AccountId32, - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod pending_transfers { - use super::runtime_types; - pub type PendingTransfers = - runtime_types::pallet_reversible_transfers::PendingTransfer< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::H256; - } - pub mod account_pending_index { - use super::runtime_types; - pub type AccountPendingIndex = ::core::primitive::u32; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod pending_transfers_by_sender { - use super::runtime_types; - pub type PendingTransfersBySender = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::H256, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod pending_transfers_by_recipient { - use super::runtime_types; - pub type PendingTransfersByRecipient = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::H256, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod interceptor_index { - use super::runtime_types; - pub type InterceptorIndex = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::subxt::ext::subxt_core::utils::AccountId32, - >; - pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod global_nonce { - use super::runtime_types; - pub type GlobalNonce = ::core::primitive::u64; - } - } - pub struct StorageApi; - impl StorageApi { - #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] - #[doc = " Accounts present in this map have reversibility enabled."] - pub fn high_security_accounts_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::high_security_accounts::HighSecurityAccounts, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "HighSecurityAccounts", - (), - [ - 11u8, 143u8, 95u8, 23u8, 55u8, 163u8, 22u8, 238u8, 88u8, 24u8, 50u8, - 162u8, 72u8, 98u8, 32u8, 219u8, 231u8, 199u8, 118u8, 150u8, 84u8, - 126u8, 225u8, 88u8, 129u8, 200u8, 236u8, 214u8, 187u8, 8u8, 252u8, - 120u8, - ], - ) - } - #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] - #[doc = " Accounts present in this map have reversibility enabled."] - pub fn high_security_accounts( - &self, - _0: types::high_security_accounts::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::high_security_accounts::Param0, - >, - types::high_security_accounts::HighSecurityAccounts, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "HighSecurityAccounts", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 11u8, 143u8, 95u8, 23u8, 55u8, 163u8, 22u8, 238u8, 88u8, 24u8, 50u8, - 162u8, 72u8, 98u8, 32u8, 219u8, 231u8, 199u8, 118u8, 150u8, 84u8, - 126u8, 225u8, 88u8, 129u8, 200u8, 236u8, 214u8, 187u8, 8u8, 252u8, - 120u8, - ], - ) - } - #[doc = " Stores the details of pending transactions scheduled for delayed execution."] - #[doc = " Keyed by the unique transaction ID."] - pub fn pending_transfers_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pending_transfers::PendingTransfers, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfers", - (), - [ - 226u8, 148u8, 100u8, 60u8, 9u8, 160u8, 164u8, 177u8, 53u8, 236u8, 65u8, - 38u8, 207u8, 31u8, 170u8, 79u8, 15u8, 237u8, 127u8, 189u8, 203u8, - 147u8, 4u8, 146u8, 13u8, 87u8, 158u8, 163u8, 159u8, 87u8, 98u8, 211u8, - ], - ) - } - #[doc = " Stores the details of pending transactions scheduled for delayed execution."] - #[doc = " Keyed by the unique transaction ID."] - pub fn pending_transfers( - &self, - _0: types::pending_transfers::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_transfers::Param0, - >, - types::pending_transfers::PendingTransfers, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfers", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 226u8, 148u8, 100u8, 60u8, 9u8, 160u8, 164u8, 177u8, 53u8, 236u8, 65u8, - 38u8, 207u8, 31u8, 170u8, 79u8, 15u8, 237u8, 127u8, 189u8, 203u8, - 147u8, 4u8, 146u8, 13u8, 87u8, 158u8, 163u8, 159u8, 87u8, 98u8, 211u8, - ], - ) - } - #[doc = " Indexes pending transaction IDs per account for efficient lookup and cancellation."] - #[doc = " Also enforces the maximum pending transactions limit per account."] - pub fn account_pending_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::account_pending_index::AccountPendingIndex, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "AccountPendingIndex", - (), - [ - 142u8, 255u8, 15u8, 41u8, 210u8, 84u8, 93u8, 230u8, 194u8, 31u8, 164u8, - 88u8, 155u8, 106u8, 130u8, 110u8, 199u8, 137u8, 153u8, 99u8, 154u8, - 210u8, 108u8, 136u8, 70u8, 141u8, 242u8, 255u8, 246u8, 19u8, 247u8, - 136u8, - ], - ) - } - #[doc = " Indexes pending transaction IDs per account for efficient lookup and cancellation."] - #[doc = " Also enforces the maximum pending transactions limit per account."] - pub fn account_pending_index( - &self, - _0: types::account_pending_index::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account_pending_index::Param0, - >, - types::account_pending_index::AccountPendingIndex, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "AccountPendingIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 142u8, 255u8, 15u8, 41u8, 210u8, 84u8, 93u8, 230u8, 194u8, 31u8, 164u8, - 88u8, 155u8, 106u8, 130u8, 110u8, 199u8, 137u8, 153u8, 99u8, 154u8, - 210u8, 108u8, 136u8, 70u8, 141u8, 242u8, 255u8, 246u8, 19u8, 247u8, - 136u8, - ], - ) - } - #[doc = " Maps sender accounts to their list of pending transaction IDs."] - #[doc = " This allows users to query all their outgoing pending transfers."] - pub fn pending_transfers_by_sender_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pending_transfers_by_sender::PendingTransfersBySender, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersBySender", - (), - [ - 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, - 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, - 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, - ], - ) - } - #[doc = " Maps sender accounts to their list of pending transaction IDs."] - #[doc = " This allows users to query all their outgoing pending transfers."] - pub fn pending_transfers_by_sender( - &self, - _0: types::pending_transfers_by_sender::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_transfers_by_sender::Param0, - >, - types::pending_transfers_by_sender::PendingTransfersBySender, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersBySender", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, - 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, - 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, - ], - ) - } - #[doc = " Maps recipient accounts to their list of pending incoming transaction IDs."] - #[doc = " This allows users to query all their incoming pending transfers."] - pub fn pending_transfers_by_recipient_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::pending_transfers_by_recipient::PendingTransfersByRecipient, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersByRecipient", - (), - [ - 63u8, 141u8, 24u8, 239u8, 201u8, 143u8, 36u8, 152u8, 35u8, 110u8, - 112u8, 157u8, 29u8, 61u8, 221u8, 79u8, 209u8, 192u8, 183u8, 29u8, - 145u8, 166u8, 238u8, 156u8, 131u8, 203u8, 124u8, 233u8, 210u8, 201u8, - 91u8, 212u8, - ], - ) - } - #[doc = " Maps recipient accounts to their list of pending incoming transaction IDs."] - #[doc = " This allows users to query all their incoming pending transfers."] - pub fn pending_transfers_by_recipient( - &self, - _0: types::pending_transfers_by_recipient::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::pending_transfers_by_recipient::Param0, - >, - types::pending_transfers_by_recipient::PendingTransfersByRecipient, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "PendingTransfersByRecipient", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 63u8, 141u8, 24u8, 239u8, 201u8, 143u8, 36u8, 152u8, 35u8, 110u8, - 112u8, 157u8, 29u8, 61u8, 221u8, 79u8, 209u8, 192u8, 183u8, 29u8, - 145u8, 166u8, 238u8, 156u8, 131u8, 203u8, 124u8, 233u8, 210u8, 201u8, - 91u8, 212u8, - ], - ) - } - #[doc = " Maps interceptor accounts to the list of accounts they can intercept for."] - #[doc = " This allows the UI to efficiently query all accounts for which a given account is an"] - #[doc = " interceptor."] - pub fn interceptor_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::interceptor_index::InterceptorIndex, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "InterceptorIndex", - (), - [ - 7u8, 184u8, 75u8, 107u8, 42u8, 84u8, 188u8, 86u8, 2u8, 227u8, 4u8, - 136u8, 109u8, 69u8, 64u8, 123u8, 253u8, 28u8, 174u8, 121u8, 183u8, - 154u8, 135u8, 91u8, 125u8, 0u8, 58u8, 132u8, 164u8, 236u8, 182u8, - 133u8, - ], - ) - } - #[doc = " Maps interceptor accounts to the list of accounts they can intercept for."] - #[doc = " This allows the UI to efficiently query all accounts for which a given account is an"] - #[doc = " interceptor."] - pub fn interceptor_index( - &self, - _0: types::interceptor_index::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::interceptor_index::Param0, - >, - types::interceptor_index::InterceptorIndex, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "InterceptorIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 7u8, 184u8, 75u8, 107u8, 42u8, 84u8, 188u8, 86u8, 2u8, 227u8, 4u8, - 136u8, 109u8, 69u8, 64u8, 123u8, 253u8, 28u8, 174u8, 121u8, 183u8, - 154u8, 135u8, 91u8, 125u8, 0u8, 58u8, 132u8, 164u8, 236u8, 182u8, - 133u8, - ], - ) - } - #[doc = " Global nonce for generating unique transaction IDs."] - pub fn global_nonce( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::global_nonce::GlobalNonce, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ReversibleTransfers", - "GlobalNonce", - (), - [ - 119u8, 119u8, 84u8, 141u8, 83u8, 67u8, 42u8, 83u8, 51u8, 196u8, 185u8, - 39u8, 227u8, 125u8, 142u8, 154u8, 107u8, 62u8, 127u8, 13u8, 54u8, - 114u8, 201u8, 6u8, 100u8, 28u8, 202u8, 152u8, 246u8, 202u8, 9u8, 29u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " Maximum pending reversible transactions allowed per account. Used for BoundedVec."] - pub fn max_pending_per_account( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MaxPendingPerAccount", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " Maximum number of accounts an interceptor can intercept for. Used for BoundedVec."] - pub fn max_interceptor_accounts( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MaxInterceptorAccounts", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The default delay period for reversible transactions if none is specified."] - #[doc = ""] - #[doc = " NOTE: default delay is always in blocks."] - pub fn default_delay( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "DefaultDelay", - [ - 245u8, 29u8, 3u8, 65u8, 154u8, 12u8, 172u8, 71u8, 67u8, 134u8, 71u8, - 180u8, 4u8, 9u8, 54u8, 89u8, 6u8, 19u8, 3u8, 168u8, 67u8, 122u8, 197u8, - 109u8, 1u8, 228u8, 44u8, 243u8, 228u8, 194u8, 241u8, 227u8, - ], - ) - } - #[doc = " The minimum delay period allowed for reversible transactions, in blocks."] - pub fn min_delay_period_blocks( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MinDelayPeriodBlocks", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The minimum delay period allowed for reversible transactions, in milliseconds."] - pub fn min_delay_period_moment( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "MinDelayPeriodMoment", - [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, - 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, - 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, - 246u8, - ], - ) - } - #[doc = " Volume fee taken from reversed transactions for high-security accounts only,"] - #[doc = " expressed as a Permill (e.g., Permill::from_percent(1) = 1%). Regular accounts incur no"] - #[doc = " fees."] - pub fn volume_fee( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_arithmetic::per_things::Permill, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ReversibleTransfers", - "VolumeFee", - [ - 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, - 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, - 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, - ], - ) - } - } - } - } - pub mod conviction_voting { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_conviction_voting::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_conviction_voting::pallet::Call; - pub mod calls { - use super::{root_mod, runtime_types}; - type DispatchError = runtime_types::sp_runtime::DispatchError; - pub mod types { + } + pub mod reversible_transfers { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_reversible_transfers::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_reversible_transfers::pallet::Call; + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11408,30 +9790,34 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = "Enable high-security for the calling account with a specified"] + #[doc = "reversibility delay."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Recoverer and interceptor (aka guardian) could be the same account or"] + #[doc = "different accounts."] #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] + #[doc = "Once an account is set as high security it can only make reversible"] + #[doc = "transfers. It is not allowed any other calls."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - pub struct Vote { - #[codec(compact)] - pub poll_index: vote::PollIndex, - pub vote: vote::Vote, + #[doc = "- `delay`: The reversibility time for any transfer made by the high"] + #[doc = "security account."] + #[doc = "- interceptor: The account that can intercept transctions from the"] + #[doc = "high security account."] + pub struct SetHighSecurity { + pub delay: set_high_security::Delay, + pub interceptor: set_high_security::Interceptor, } - pub mod vote { + pub mod set_high_security { use super::runtime_types; - pub type PollIndex = ::core::primitive::u32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, >; + pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetHighSecurity { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "set_high_security"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11444,49 +9830,19 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] - #[doc = ""] - #[doc = "Emits `Delegated`."] + #[doc = "Cancel a pending reversible transaction scheduled by the caller."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub struct Delegate { - pub class: delegate::Class, - pub to: delegate::To, - pub conviction: delegate::Conviction, - pub balance: delegate::Balance, + #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] + pub struct Cancel { + pub tx_id: cancel::TxId, } - pub mod delegate { + pub mod cancel { use super::runtime_types; - pub type Class = ::core::primitive::u16; - pub type To = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type Conviction = - runtime_types::pallet_conviction_voting::conviction::Conviction; - pub type Balance = ::core::primitive::u128; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Delegate { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "delegate"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "cancel"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11499,30 +9855,19 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] - #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] - #[doc = ""] - #[doc = "Emits `Undelegated`."] + #[doc = "Called by the Scheduler to finalize the scheduled task/call"] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub struct Undelegate { - pub class: undelegate::Class, + #[doc = "- `tx_id`: The unique id of the transaction to finalize and dispatch."] + pub struct ExecuteTransfer { + pub tx_id: execute_transfer::TxId, } - pub mod undelegate { + pub mod execute_transfer { use super::runtime_types; - pub type Class = ::core::primitive::u16; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Undelegate { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "undelegate"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExecuteTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "execute_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11535,30 +9880,22 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] - #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub struct Unlock { - pub class: unlock::Class, - pub target: unlock::Target, + #[doc = "Schedule a transaction for delayed execution."] + pub struct ScheduleTransfer { + pub dest: schedule_transfer::Dest, + pub amount: schedule_transfer::Amount, } - pub mod unlock { + pub mod schedule_transfer { use super::runtime_types; - pub type Class = ::core::primitive::u16; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + 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 Unlock { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "unlock"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11571,47 +9908,63 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] + #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = "This can only be used by accounts that have *not* set up a persistent"] + #[doc = "reversibility configuration with `set_high_security`."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub struct RemoveVote { - pub class: remove_vote::Class, - pub index: remove_vote::Index, + #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] + pub struct ScheduleTransferWithDelay { + pub dest: schedule_transfer_with_delay::Dest, + pub amount: schedule_transfer_with_delay::Amount, + pub delay: schedule_transfer_with_delay::Delay, } - pub mod remove_vote { + pub mod schedule_transfer_with_delay { use super::runtime_types; - pub type Class = ::core::option::Option<::core::primitive::u16>; - pub type Index = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleTransferWithDelay { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_transfer_with_delay"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] + #[doc = "delay."] + pub struct ScheduleAssetTransfer { + pub asset_id: schedule_asset_transfer::AssetId, + pub dest: schedule_asset_transfer::Dest, + pub amount: schedule_asset_transfer::Amount, + } + pub mod schedule_asset_transfer { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveVote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "remove_vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransfer { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_asset_transfer"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11624,250 +9977,193 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub struct RemoveOtherVote { - pub target: remove_other_vote::Target, - pub class: remove_other_vote::Class, - pub index: remove_other_vote::Index, + #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] + pub struct ScheduleAssetTransferWithDelay { + pub asset_id: schedule_asset_transfer_with_delay::AssetId, + pub dest: schedule_asset_transfer_with_delay::Dest, + pub amount: schedule_asset_transfer_with_delay::Amount, + pub delay: schedule_asset_transfer_with_delay::Delay, } - pub mod remove_other_vote { + pub mod schedule_asset_transfer_with_delay { use super::runtime_types; - pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type AssetId = ::core::primitive::u32; + pub type Dest = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; - pub type Class = ::core::primitive::u16; - pub type Index = ::core::primitive::u32; + pub type Amount = ::core::primitive::u128; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveOtherVote { - const PALLET: &'static str = "ConvictionVoting"; - const CALL: &'static str = "remove_other_vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ScheduleAssetTransferWithDelay { + const PALLET: &'static str = "ReversibleTransfers"; + const CALL: &'static str = "schedule_asset_transfer_with_delay"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] - #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = "Enable high-security for the calling account with a specified"] + #[doc = "reversibility delay."] #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = "Recoverer and interceptor (aka guardian) could be the same account or"] + #[doc = "different accounts."] #[doc = ""] - #[doc = "- `poll_index`: The index of the poll to vote for."] - #[doc = "- `vote`: The vote configuration."] + #[doc = "Once an account is set as high security it can only make reversible"] + #[doc = "transfers. It is not allowed any other calls."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] - pub fn vote( + #[doc = "- `delay`: The reversibility time for any transfer made by the high"] + #[doc = "security account."] + #[doc = "- interceptor: The account that can intercept transctions from the"] + #[doc = "high security account."] + pub fn set_high_security( &self, - poll_index: types::vote::PollIndex, - vote: types::vote::Vote, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + delay: types::set_high_security::Delay, + interceptor: types::set_high_security::Interceptor, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "vote", - types::Vote { poll_index, vote }, + "ReversibleTransfers", + "set_high_security", + types::SetHighSecurity { delay, interceptor }, [ - 57u8, 170u8, 177u8, 168u8, 158u8, 43u8, 87u8, 242u8, 176u8, 85u8, - 230u8, 64u8, 103u8, 239u8, 190u8, 6u8, 228u8, 165u8, 248u8, 77u8, - 231u8, 221u8, 186u8, 107u8, 249u8, 201u8, 226u8, 52u8, 129u8, 90u8, - 142u8, 159u8, + 202u8, 17u8, 43u8, 37u8, 215u8, 198u8, 42u8, 183u8, 53u8, 124u8, 140u8, + 34u8, 112u8, 230u8, 55u8, 168u8, 242u8, 249u8, 91u8, 185u8, 244u8, + 81u8, 40u8, 231u8, 121u8, 155u8, 202u8, 76u8, 137u8, 7u8, 225u8, 184u8, ], ) } - #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] - #[doc = "particular class of polls."] - #[doc = ""] - #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] - #[doc = "time appropriate for the conviction's lock period."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] - #[doc = " - be delegating already; or"] - #[doc = " - have no voting activity (if there is, then it will need to be removed through"] - #[doc = " `remove_vote`)."] - #[doc = ""] - #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] - #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] - #[doc = " to this function are required."] - #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] - #[doc = " account is undelegated, the funds will be locked for the corresponding period."] - #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] - #[doc = " be more than the account's current balance."] - #[doc = ""] - #[doc = "Emits `Delegated`."] + #[doc = "Cancel a pending reversible transaction scheduled by the caller."] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub fn delegate( + #[doc = "- `tx_id`: The unique identifier of the transaction to cancel."] + pub fn cancel( &self, - class: types::delegate::Class, - to: types::delegate::To, - conviction: types::delegate::Conviction, - balance: types::delegate::Balance, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + tx_id: types::cancel::TxId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "delegate", - types::Delegate { class, to, conviction, balance }, + "ReversibleTransfers", + "cancel", + types::Cancel { tx_id }, [ - 223u8, 143u8, 33u8, 94u8, 32u8, 156u8, 43u8, 40u8, 142u8, 134u8, 209u8, - 134u8, 255u8, 179u8, 97u8, 46u8, 8u8, 140u8, 5u8, 29u8, 76u8, 22u8, - 36u8, 7u8, 108u8, 190u8, 220u8, 151u8, 10u8, 47u8, 89u8, 55u8, + 228u8, 150u8, 194u8, 119u8, 243u8, 126u8, 112u8, 227u8, 70u8, 160u8, + 132u8, 82u8, 146u8, 162u8, 195u8, 149u8, 236u8, 98u8, 18u8, 44u8, + 151u8, 249u8, 193u8, 176u8, 186u8, 98u8, 224u8, 103u8, 191u8, 165u8, + 37u8, 47u8, ], ) } - #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] - #[doc = ""] - #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] - #[doc = "of the conviction with which the delegation was issued has passed."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] - #[doc = "currently delegating."] - #[doc = ""] - #[doc = "- `class`: The class of polls to remove the delegation from."] - #[doc = ""] - #[doc = "Emits `Undelegated`."] + #[doc = "Called by the Scheduler to finalize the scheduled task/call"] #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] - #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] - pub fn undelegate( + #[doc = "- `tx_id`: The unique id of the transaction to finalize and dispatch."] + pub fn execute_transfer( &self, - class: types::undelegate::Class, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + tx_id: types::execute_transfer::TxId, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "undelegate", - types::Undelegate { class }, + "ReversibleTransfers", + "execute_transfer", + types::ExecuteTransfer { tx_id }, [ - 140u8, 232u8, 6u8, 53u8, 228u8, 8u8, 131u8, 144u8, 65u8, 66u8, 245u8, - 247u8, 147u8, 135u8, 198u8, 57u8, 82u8, 212u8, 89u8, 46u8, 236u8, - 168u8, 200u8, 220u8, 93u8, 168u8, 101u8, 29u8, 110u8, 76u8, 67u8, - 181u8, + 164u8, 38u8, 166u8, 81u8, 63u8, 235u8, 167u8, 178u8, 97u8, 80u8, 62u8, + 147u8, 3u8, 163u8, 129u8, 25u8, 98u8, 59u8, 17u8, 137u8, 6u8, 183u8, + 189u8, 51u8, 24u8, 211u8, 157u8, 108u8, 229u8, 253u8, 37u8, 78u8, ], ) } - #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] - #[doc = "class."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `class`: The class of polls to unlock."] - #[doc = "- `target`: The account to remove the lock on."] - #[doc = ""] - #[doc = "Weight: `O(R)` with R number of vote of target."] - pub fn unlock( + #[doc = "Schedule a transaction for delayed execution."] + pub fn schedule_transfer( &self, - class: types::unlock::Class, - target: types::unlock::Target, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + dest: types::schedule_transfer::Dest, + amount: types::schedule_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "unlock", - types::Unlock { class, target }, + "ReversibleTransfers", + "schedule_transfer", + types::ScheduleTransfer { dest, amount }, [ - 79u8, 5u8, 252u8, 237u8, 109u8, 238u8, 157u8, 237u8, 125u8, 171u8, - 65u8, 160u8, 102u8, 192u8, 5u8, 141u8, 179u8, 249u8, 253u8, 213u8, - 105u8, 251u8, 241u8, 145u8, 186u8, 177u8, 244u8, 139u8, 71u8, 140u8, - 173u8, 108u8, + 38u8, 219u8, 206u8, 56u8, 252u8, 195u8, 52u8, 74u8, 113u8, 125u8, + 107u8, 35u8, 236u8, 39u8, 31u8, 18u8, 250u8, 177u8, 174u8, 154u8, + 149u8, 122u8, 183u8, 50u8, 45u8, 111u8, 100u8, 249u8, 102u8, 82u8, + 72u8, 130u8, ], ) } - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If:"] - #[doc = "- the poll was cancelled, or"] - #[doc = "- the poll is ongoing, or"] - #[doc = "- the poll has ended such that"] - #[doc = " - the vote of the account was in opposition to the result; or"] - #[doc = " - there was no conviction to the account's vote; or"] - #[doc = " - the account made a split vote"] - #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] - #[doc = "funds being available."] - #[doc = ""] - #[doc = "If, however, the poll has ended and:"] - #[doc = "- it finished corresponding to the vote of the account, and"] - #[doc = "- the account made a standard vote with conviction, and"] - #[doc = "- the lock period of the conviction is not over"] - #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] - #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] - #[doc = "of both the amount locked and the time is it locked for)."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] - #[doc = "registered for poll `index`."] + #[doc = "Schedule a transaction for delayed execution with a custom, one-time delay."] #[doc = ""] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] - #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = "This can only be used by accounts that have *not* set up a persistent"] + #[doc = "reversibility configuration with `set_high_security`."] #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_vote( + #[doc = "- `delay`: The time (in blocks or milliseconds) before the transaction executes."] + pub fn schedule_transfer_with_delay( + &self, + dest: types::schedule_transfer_with_delay::Dest, + amount: types::schedule_transfer_with_delay::Amount, + delay: types::schedule_transfer_with_delay::Delay, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::ScheduleTransferWithDelay, + > { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "ReversibleTransfers", + "schedule_transfer_with_delay", + types::ScheduleTransferWithDelay { dest, amount, delay }, + [ + 254u8, 158u8, 173u8, 217u8, 107u8, 80u8, 229u8, 252u8, 123u8, 46u8, + 177u8, 40u8, 25u8, 15u8, 32u8, 22u8, 224u8, 52u8, 242u8, 48u8, 242u8, + 84u8, 242u8, 143u8, 111u8, 12u8, 82u8, 161u8, 129u8, 86u8, 161u8, + 216u8, + ], + ) + } + #[doc = "Schedule an asset transfer (pallet-assets) for delayed execution using the configured"] + #[doc = "delay."] + pub fn schedule_asset_transfer( &self, - class: types::remove_vote::Class, - index: types::remove_vote::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + asset_id: types::schedule_asset_transfer::AssetId, + dest: types::schedule_asset_transfer::Dest, + amount: types::schedule_asset_transfer::Amount, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::ScheduleAssetTransfer, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "remove_vote", - types::RemoveVote { class, index }, + "ReversibleTransfers", + "schedule_asset_transfer", + types::ScheduleAssetTransfer { asset_id, dest, amount }, [ - 255u8, 108u8, 211u8, 146u8, 168u8, 231u8, 207u8, 44u8, 76u8, 24u8, - 235u8, 60u8, 23u8, 79u8, 192u8, 192u8, 46u8, 40u8, 134u8, 27u8, 125u8, - 114u8, 125u8, 247u8, 85u8, 102u8, 76u8, 159u8, 34u8, 167u8, 152u8, - 148u8, + 125u8, 51u8, 89u8, 31u8, 247u8, 200u8, 156u8, 209u8, 28u8, 170u8, + 203u8, 254u8, 40u8, 131u8, 155u8, 166u8, 65u8, 152u8, 101u8, 198u8, + 70u8, 129u8, 5u8, 89u8, 220u8, 189u8, 255u8, 87u8, 58u8, 24u8, 234u8, + 42u8, ], ) } - #[doc = "Remove a vote for a poll."] - #[doc = ""] - #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] - #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] - #[doc = "either because the poll was cancelled, because the voter lost the poll or"] - #[doc = "because the conviction period is over."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] - #[doc = " `index`."] - #[doc = "- `index`: The index of poll of the vote to be removed."] - #[doc = "- `class`: The class of the poll."] - #[doc = ""] - #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] - #[doc = " Weight is calculated for the maximum number of vote."] - pub fn remove_other_vote( + #[doc = "Schedule an asset transfer (pallet-assets) with a custom one-time delay."] + pub fn schedule_asset_transfer_with_delay( &self, - target: types::remove_other_vote::Target, - class: types::remove_other_vote::Class, - index: types::remove_other_vote::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + asset_id: types::schedule_asset_transfer_with_delay::AssetId, + dest: types::schedule_asset_transfer_with_delay::Dest, + amount: types::schedule_asset_transfer_with_delay::Amount, + delay: types::schedule_asset_transfer_with_delay::Delay, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::ScheduleAssetTransferWithDelay, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "ConvictionVoting", - "remove_other_vote", - types::RemoveOtherVote { target, class, index }, + "ReversibleTransfers", + "schedule_asset_transfer_with_delay", + types::ScheduleAssetTransferWithDelay { asset_id, dest, amount, delay }, [ - 165u8, 26u8, 166u8, 37u8, 10u8, 174u8, 243u8, 10u8, 73u8, 93u8, 213u8, - 69u8, 200u8, 16u8, 48u8, 146u8, 160u8, 92u8, 28u8, 26u8, 158u8, 55u8, - 6u8, 251u8, 36u8, 132u8, 46u8, 195u8, 107u8, 34u8, 0u8, 100u8, + 249u8, 59u8, 121u8, 27u8, 78u8, 202u8, 252u8, 120u8, 76u8, 102u8, 33u8, + 232u8, 185u8, 78u8, 8u8, 157u8, 139u8, 72u8, 110u8, 91u8, 170u8, 179u8, + 89u8, 250u8, 77u8, 26u8, 160u8, 252u8, 62u8, 179u8, 128u8, 216u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_conviction_voting::pallet::Event; + pub type Event = runtime_types::pallet_reversible_transfers::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -11877,33 +10173,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 = "An account has delegated their vote to another account. \\[who, target\\]"] - pub struct Delegated(pub delegated::Field0, pub delegated::Field1); - pub mod delegated { - use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Field1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Delegated { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Delegated"; + #[doc = "A user has enabled their high-security settings."] + #[doc = "[who, interceptor, recoverer, delay]"] + pub struct HighSecuritySet { + pub who: high_security_set::Who, + pub interceptor: high_security_set::Interceptor, + pub delay: high_security_set::Delay, } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An \\[account\\] has cancelled a previous delegation operation."] - pub struct Undelegated(pub undelegated::Field0); - pub mod undelegated { + pub mod high_security_set { use super::runtime_types; - pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delay = runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Undelegated { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Undelegated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for HighSecuritySet { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "HighSecuritySet"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11912,21 +10200,33 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An account has voted"] - pub struct Voted { - pub who: voted::Who, - pub vote: voted::Vote, + #[doc = "A transaction has been intercepted and scheduled for delayed execution."] + #[doc = "[from, to, interceptor, amount, tx_id, execute_at_moment]"] + pub struct TransactionScheduled { + pub from: transaction_scheduled::From, + pub to: transaction_scheduled::To, + pub interceptor: transaction_scheduled::Interceptor, + pub asset_id: transaction_scheduled::AssetId, + pub amount: transaction_scheduled::Amount, + pub tx_id: transaction_scheduled::TxId, + pub execute_at: transaction_scheduled::ExecuteAt, } - pub mod voted { + pub mod transaction_scheduled { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, + pub type From = ::subxt::ext::subxt_core::utils::AccountId32; + pub type To = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Interceptor = ::subxt::ext::subxt_core::utils::AccountId32; + pub type AssetId = ::core::option::Option<::core::primitive::u32>; + pub type Amount = ::core::primitive::u128; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type ExecuteAt = runtime_types::qp_scheduler::DispatchTime< + ::core::primitive::u32, + ::core::primitive::u64, >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "Voted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionScheduled { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionScheduled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11935,21 +10235,20 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A vote has been removed"] - pub struct VoteRemoved { - pub who: vote_removed::Who, - pub vote: vote_removed::Vote, + #[doc = "A scheduled transaction has been successfully cancelled by the owner."] + #[doc = "[who, tx_id]"] + pub struct TransactionCancelled { + pub who: transaction_cancelled::Who, + pub tx_id: transaction_cancelled::TxId, } - pub mod vote_removed { + pub mod transaction_cancelled { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< - ::core::primitive::u128, - >; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VoteRemoved { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "VoteRemoved"; + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionCancelled { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionCancelled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -11958,175 +10257,402 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The lockup period of a conviction vote expired, and the funds have been unlocked."] - pub struct VoteUnlocked { - pub who: vote_unlocked::Who, - pub class: vote_unlocked::Class, + #[doc = "A scheduled transaction was executed by the scheduler."] + #[doc = "[tx_id, dispatch_result]"] + pub struct TransactionExecuted { + pub tx_id: transaction_executed::TxId, + pub result: transaction_executed::Result, } - pub mod vote_unlocked { + pub mod transaction_executed { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Class = ::core::primitive::u16; + pub type TxId = ::subxt::ext::subxt_core::utils::H256; + pub type Result = ::core::result::Result< + runtime_types::frame_support::dispatch::PostDispatchInfo, + runtime_types::sp_runtime::DispatchErrorWithPostInfo< + runtime_types::frame_support::dispatch::PostDispatchInfo, + >, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for VoteUnlocked { - const PALLET: &'static str = "ConvictionVoting"; - const EVENT: &'static str = "VoteUnlocked"; + impl ::subxt::ext::subxt_core::events::StaticEvent for TransactionExecuted { + const PALLET: &'static str = "ReversibleTransfers"; + const EVENT: &'static str = "TransactionExecuted"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod voting_for { + pub mod high_security_accounts { use super::runtime_types; - pub type VotingFor = runtime_types::pallet_conviction_voting::vote::Voting< - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - >; + pub type HighSecurityAccounts = + runtime_types::pallet_reversible_transfers::HighSecurityAccountData< + ::subxt::ext::subxt_core::utils::AccountId32, + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + >; pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param1 = ::core::primitive::u16; } - pub mod class_locks_for { + pub mod pending_transfers { use super::runtime_types; - pub type ClassLocksFor = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u16, + pub type PendingTransfers = + runtime_types::pallet_reversible_transfers::PendingTransfer< + ::subxt::ext::subxt_core::utils::AccountId32, ::core::primitive::u128, - )>; + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::H256; + } + pub mod account_pending_index { + use super::runtime_types; + pub type AccountPendingIndex = ::core::primitive::u32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod pending_transfers_by_sender { + use super::runtime_types; + pub type PendingTransfersBySender = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::H256, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod pending_transfers_by_recipient { + use super::runtime_types; + pub type PendingTransfersByRecipient = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::H256, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod interceptor_index { + use super::runtime_types; + pub type InterceptorIndex = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } + pub mod global_nonce { + use super::runtime_types; + pub type GlobalNonce = ::core::primitive::u64; + } } pub struct StorageApi; impl StorageApi { - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for_iter( + #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] + #[doc = " Accounts present in this map have reversibility enabled."] + pub fn high_security_accounts_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::voting_for::VotingFor, + types::high_security_accounts::HighSecurityAccounts, + (), (), ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "HighSecurityAccounts", + (), + [ + 11u8, 143u8, 95u8, 23u8, 55u8, 163u8, 22u8, 238u8, 88u8, 24u8, 50u8, + 162u8, 72u8, 98u8, 32u8, 219u8, 231u8, 199u8, 118u8, 150u8, 84u8, + 126u8, 225u8, 88u8, 129u8, 200u8, 236u8, 214u8, 187u8, 8u8, 252u8, + 120u8, + ], + ) + } + #[doc = " Maps accounts to their chosen reversibility delay period (in milliseconds)."] + #[doc = " Accounts present in this map have reversibility enabled."] + pub fn high_security_accounts( + &self, + _0: types::high_security_accounts::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::high_security_accounts::Param0, + >, + types::high_security_accounts::HighSecurityAccounts, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "HighSecurityAccounts", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 11u8, 143u8, 95u8, 23u8, 55u8, 163u8, 22u8, 238u8, 88u8, 24u8, 50u8, + 162u8, 72u8, 98u8, 32u8, 219u8, 231u8, 199u8, 118u8, 150u8, 84u8, + 126u8, 225u8, 88u8, 129u8, 200u8, 236u8, 214u8, 187u8, 8u8, 252u8, + 120u8, + ], + ) + } + #[doc = " Stores the details of pending transactions scheduled for delayed execution."] + #[doc = " Keyed by the unique transaction ID."] + pub fn pending_transfers_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::pending_transfers::PendingTransfers, + (), + (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", + "ReversibleTransfers", + "PendingTransfers", (), [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, + 226u8, 148u8, 100u8, 60u8, 9u8, 160u8, 164u8, 177u8, 53u8, 236u8, 65u8, + 38u8, 207u8, 31u8, 170u8, 79u8, 15u8, 237u8, 127u8, 189u8, 203u8, + 147u8, 4u8, 146u8, 13u8, 87u8, 158u8, 163u8, 159u8, 87u8, 98u8, 211u8, ], ) } - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for_iter1( + #[doc = " Stores the details of pending transactions scheduled for delayed execution."] + #[doc = " Keyed by the unique transaction ID."] + pub fn pending_transfers( &self, - _0: types::voting_for::Param0, + _0: types::pending_transfers::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param0, + types::pending_transfers::Param0, >, - types::voting_for::VotingFor, + types::pending_transfers::PendingTransfers, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfers", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 226u8, 148u8, 100u8, 60u8, 9u8, 160u8, 164u8, 177u8, 53u8, 236u8, 65u8, + 38u8, 207u8, 31u8, 170u8, 79u8, 15u8, 237u8, 127u8, 189u8, 203u8, + 147u8, 4u8, 146u8, 13u8, 87u8, 158u8, 163u8, 159u8, 87u8, 98u8, 211u8, + ], + ) + } + #[doc = " Indexes pending transaction IDs per account for efficient lookup and cancellation."] + #[doc = " Also enforces the maximum pending transactions limit per account."] + pub fn account_pending_index_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::account_pending_index::AccountPendingIndex, (), ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", + "ReversibleTransfers", + "AccountPendingIndex", + (), + [ + 142u8, 255u8, 15u8, 41u8, 210u8, 84u8, 93u8, 230u8, 194u8, 31u8, 164u8, + 88u8, 155u8, 106u8, 130u8, 110u8, 199u8, 137u8, 153u8, 99u8, 154u8, + 210u8, 108u8, 136u8, 70u8, 141u8, 242u8, 255u8, 246u8, 19u8, 247u8, + 136u8, + ], + ) + } + #[doc = " Indexes pending transaction IDs per account for efficient lookup and cancellation."] + #[doc = " Also enforces the maximum pending transactions limit per account."] + pub fn account_pending_index( + &self, + _0: types::account_pending_index::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::account_pending_index::Param0, + >, + types::account_pending_index::AccountPendingIndex, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "AccountPendingIndex", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, + 142u8, 255u8, 15u8, 41u8, 210u8, 84u8, 93u8, 230u8, 194u8, 31u8, 164u8, + 88u8, 155u8, 106u8, 130u8, 110u8, 199u8, 137u8, 153u8, 99u8, 154u8, + 210u8, 108u8, 136u8, 70u8, 141u8, 242u8, 255u8, 246u8, 19u8, 247u8, + 136u8, ], ) } - #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] - #[doc = " number of votes that we have recorded."] - pub fn voting_for( + #[doc = " Maps sender accounts to their list of pending transaction IDs."] + #[doc = " This allows users to query all their outgoing pending transfers."] + pub fn pending_transfers_by_sender_iter( &self, - _0: types::voting_for::Param0, - _1: types::voting_for::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_for::Param1, - >, - ), - types::voting_for::VotingFor, + (), + types::pending_transfers_by_sender::PendingTransfersBySender, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfersBySender", + (), + [ + 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, + 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, + 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, + ], + ) + } + #[doc = " Maps sender accounts to their list of pending transaction IDs."] + #[doc = " This allows users to query all their outgoing pending transfers."] + pub fn pending_transfers_by_sender( + &self, + _0: types::pending_transfers_by_sender::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::pending_transfers_by_sender::Param0, + >, + types::pending_transfers_by_sender::PendingTransfersBySender, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "VotingFor", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + "ReversibleTransfers", + "PendingTransfersBySender", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, - 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, - 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, + 183u8, 43u8, 139u8, 203u8, 182u8, 219u8, 60u8, 129u8, 67u8, 30u8, 65u8, + 47u8, 105u8, 196u8, 228u8, 154u8, 26u8, 74u8, 84u8, 72u8, 154u8, 220u8, + 216u8, 134u8, 207u8, 240u8, 7u8, 190u8, 236u8, 242u8, 184u8, 224u8, ], ) } - #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] - #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] - #[doc = " this list."] - pub fn class_locks_for_iter( + #[doc = " Maps recipient accounts to their list of pending incoming transaction IDs."] + #[doc = " This allows users to query all their incoming pending transfers."] + pub fn pending_transfers_by_recipient_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::pending_transfers_by_recipient::PendingTransfersByRecipient, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfersByRecipient", + (), + [ + 63u8, 141u8, 24u8, 239u8, 201u8, 143u8, 36u8, 152u8, 35u8, 110u8, + 112u8, 157u8, 29u8, 61u8, 221u8, 79u8, 209u8, 192u8, 183u8, 29u8, + 145u8, 166u8, 238u8, 156u8, 131u8, 203u8, 124u8, 233u8, 210u8, 201u8, + 91u8, 212u8, + ], + ) + } + #[doc = " Maps recipient accounts to their list of pending incoming transaction IDs."] + #[doc = " This allows users to query all their incoming pending transfers."] + pub fn pending_transfers_by_recipient( + &self, + _0: types::pending_transfers_by_recipient::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::pending_transfers_by_recipient::Param0, + >, + types::pending_transfers_by_recipient::PendingTransfersByRecipient, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "PendingTransfersByRecipient", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 63u8, 141u8, 24u8, 239u8, 201u8, 143u8, 36u8, 152u8, 35u8, 110u8, + 112u8, 157u8, 29u8, 61u8, 221u8, 79u8, 209u8, 192u8, 183u8, 29u8, + 145u8, 166u8, 238u8, 156u8, 131u8, 203u8, 124u8, 233u8, 210u8, 201u8, + 91u8, 212u8, + ], + ) + } + #[doc = " Maps interceptor accounts to the list of accounts they can intercept for."] + #[doc = " This allows the UI to efficiently query all accounts for which a given account is an"] + #[doc = " interceptor."] + pub fn interceptor_index_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::class_locks_for::ClassLocksFor, + types::interceptor_index::InterceptorIndex, (), ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "ClassLocksFor", + "ReversibleTransfers", + "InterceptorIndex", (), [ - 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, - 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, - 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, + 7u8, 184u8, 75u8, 107u8, 42u8, 84u8, 188u8, 86u8, 2u8, 227u8, 4u8, + 136u8, 109u8, 69u8, 64u8, 123u8, 253u8, 28u8, 174u8, 121u8, 183u8, + 154u8, 135u8, 91u8, 125u8, 0u8, 58u8, 132u8, 164u8, 236u8, 182u8, + 133u8, ], ) } - #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] - #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] - #[doc = " this list."] - pub fn class_locks_for( + #[doc = " Maps interceptor accounts to the list of accounts they can intercept for."] + #[doc = " This allows the UI to efficiently query all accounts for which a given account is an"] + #[doc = " interceptor."] + pub fn interceptor_index( &self, - _0: types::class_locks_for::Param0, + _0: types::interceptor_index::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::class_locks_for::Param0, + types::interceptor_index::Param0, >, - types::class_locks_for::ClassLocksFor, + types::interceptor_index::InterceptorIndex, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "ConvictionVoting", - "ClassLocksFor", + "ReversibleTransfers", + "InterceptorIndex", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, - 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, - 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, + 7u8, 184u8, 75u8, 107u8, 42u8, 84u8, 188u8, 86u8, 2u8, 227u8, 4u8, + 136u8, 109u8, 69u8, 64u8, 123u8, 253u8, 28u8, 174u8, 121u8, 183u8, + 154u8, 135u8, 91u8, 125u8, 0u8, 58u8, 132u8, 164u8, 236u8, 182u8, + 133u8, + ], + ) + } + #[doc = " Global nonce for generating unique transaction IDs."] + pub fn global_nonce( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::global_nonce::GlobalNonce, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "ReversibleTransfers", + "GlobalNonce", + (), + [ + 119u8, 119u8, 84u8, 141u8, 83u8, 67u8, 42u8, 83u8, 51u8, 196u8, 185u8, + 39u8, 227u8, 125u8, 142u8, 154u8, 107u8, 62u8, 127u8, 13u8, 54u8, + 114u8, 201u8, 6u8, 100u8, 28u8, 202u8, 152u8, 246u8, 202u8, 9u8, 29u8, ], ) } @@ -12136,18 +10662,15 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " The maximum number of concurrent votes an account may have."] - #[doc = ""] - #[doc = " Also used to compute weight, an overly large value can lead to extrinsics with large"] - #[doc = " weight estimation: see `delegate` for instance."] - pub fn max_votes( + #[doc = " Maximum pending reversible transactions allowed per account. Used for BoundedVec."] + pub fn max_pending_per_account( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ConvictionVoting", - "MaxVotes", + "ReversibleTransfers", + "MaxPendingPerAccount", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -12156,18 +10679,53 @@ pub mod api { ], ) } - #[doc = " The minimum period of vote locking."] + #[doc = " Maximum number of accounts an interceptor can intercept for. Used for BoundedVec."] + pub fn max_interceptor_accounts( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "MaxInterceptorAccounts", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The default delay period for reversible transactions if none is specified."] #[doc = ""] - #[doc = " It should be no shorter than enactment period to ensure that in the case of an approval,"] - #[doc = " those successful voters are locked into the consequences that their votes entail."] - pub fn vote_locking_period( + #[doc = " NOTE: default delay is always in blocks."] + pub fn default_delay( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "DefaultDelay", + [ + 245u8, 29u8, 3u8, 65u8, 154u8, 12u8, 172u8, 71u8, 67u8, 134u8, 71u8, + 180u8, 4u8, 9u8, 54u8, 89u8, 6u8, 19u8, 3u8, 168u8, 67u8, 122u8, 197u8, + 109u8, 1u8, 228u8, 44u8, 243u8, 228u8, 194u8, 241u8, 227u8, + ], + ) + } + #[doc = " The minimum delay period allowed for reversible transactions, in blocks."] + pub fn min_delay_period_blocks( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "ConvictionVoting", - "VoteLockingPeriod", + "ReversibleTransfers", + "MinDelayPeriodBlocks", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -12176,15 +10734,50 @@ pub mod api { ], ) } + #[doc = " The minimum delay period allowed for reversible transactions, in milliseconds."] + pub fn min_delay_period_moment( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u64, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "MinDelayPeriodMoment", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) + } + #[doc = " Volume fee taken from reversed transactions for high-security accounts only,"] + #[doc = " expressed as a Permill (e.g., Permill::from_percent(1) = 1%). Regular accounts incur no"] + #[doc = " fees. The fee is burned (removed from total issuance)."] + pub fn volume_fee( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ReversibleTransfers", + "VolumeFee", + [ + 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, + 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, + 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, + ], + ) + } } } } - pub mod tech_collective { + pub mod conviction_voting { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_ranked_collective::pallet::Error; + pub type Error = runtime_types::pallet_conviction_voting::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_ranked_collective::pallet::Call; + pub type Call = runtime_types::pallet_conviction_voting::pallet::Call; pub mod calls { use super::{root_mod, runtime_types}; type DispatchError = runtime_types::sp_runtime::DispatchError; @@ -12201,25 +10794,30 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Introduce a new member."] + #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] #[doc = ""] - #[doc = "- `origin`: Must be the `AddOrigin`."] - #[doc = "- `who`: Account of non-member which will become a member."] + #[doc = "The dispatch origin of this call must be _Signed_."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct AddMember { - pub who: add_member::Who, + #[doc = "- `poll_index`: The index of the poll to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] + pub struct Vote { + #[codec(compact)] + pub poll_index: vote::PollIndex, + pub vote: vote::Vote, } - pub mod add_member { + pub mod vote { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), + pub type PollIndex = ::core::primitive::u32; + pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< + ::core::primitive::u128, >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "add_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "vote"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12232,57 +10830,49 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Increment the rank of an existing member by one."] + #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] + #[doc = "particular class of polls."] #[doc = ""] - #[doc = "- `origin`: Must be the `PromoteOrigin`."] - #[doc = "- `who`: Account of existing member."] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub struct PromoteMember { - pub who: promote_member::Who, - } - pub mod promote_member { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PromoteMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "promote_member"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] - #[doc = "then they are removed entirely."] + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed through"] + #[doc = " `remove_vote`)."] #[doc = ""] - #[doc = "- `origin`: Must be the `DemoteOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] + #[doc = " to this function are required."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] - pub struct DemoteMember { - pub who: demote_member::Who, + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub struct Delegate { + pub class: delegate::Class, + pub to: delegate::To, + pub conviction: delegate::Conviction, + pub balance: delegate::Balance, } - pub mod demote_member { + pub mod delegate { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Class = ::core::primitive::u16; + pub type To = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Conviction = + runtime_types::pallet_conviction_voting::conviction::Conviction; + pub type Balance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DemoteMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "demote_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Delegate { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "delegate"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12295,28 +10885,30 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove the member entirely."] + #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] #[doc = ""] - #[doc = "- `origin`: Must be the `RemoveOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = "- `min_rank`: The rank of the member or greater."] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued has passed."] #[doc = ""] - #[doc = "Weight: `O(min_rank)`."] - pub struct RemoveMember { - pub who: remove_member::Who, - pub min_rank: remove_member::MinRank, + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub struct Undelegate { + pub class: undelegate::Class, } - pub mod remove_member { + pub mod undelegate { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type MinRank = ::core::primitive::u16; + pub type Class = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "remove_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Undelegate { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "undelegate"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12329,29 +10921,30 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] + #[doc = "class."] #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by a member account."] - #[doc = "- `poll`: Index of a poll which is ongoing."] - #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] + #[doc = "The dispatch origin of this call must be _Signed_."] #[doc = ""] - #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] + #[doc = "- `class`: The class of polls to unlock."] + #[doc = "- `target`: The account to remove the lock on."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] - pub struct Vote { - pub poll: vote::Poll, - pub aye: vote::Aye, + #[doc = "Weight: `O(R)` with R number of vote of target."] + pub struct Unlock { + pub class: unlock::Class, + pub target: unlock::Target, } - pub mod vote { + pub mod unlock { use super::runtime_types; - pub type Poll = ::core::primitive::u32; - pub type Aye = ::core::primitive::bool; + pub type Class = ::core::primitive::u16; + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "vote"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Unlock { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "unlock"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12364,28 +10957,47 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Remove votes from the given poll. It must have ended."] + #[doc = "Remove a vote for a poll."] #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by any account."] - #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] - #[doc = " exist."] - #[doc = "- `max`: Maximum number of vote items from remove in this call."] + #[doc = "If:"] + #[doc = "- the poll was cancelled, or"] + #[doc = "- the poll is ongoing, or"] + #[doc = "- the poll has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] #[doc = ""] - #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = "If, however, the poll has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] #[doc = ""] - #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] - pub struct CleanupPoll { - pub poll_index: cleanup_poll::PollIndex, - pub max: cleanup_poll::Max, + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for poll `index`."] + #[doc = ""] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] + #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub struct RemoveVote { + pub class: remove_vote::Class, + pub index: remove_vote::Index, } - pub mod cleanup_poll { + pub mod remove_vote { use super::runtime_types; - pub type PollIndex = ::core::primitive::u32; - pub type Max = ::core::primitive::u32; + pub type Class = ::core::option::Option<::core::primitive::u16>; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupPoll { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "cleanup_poll"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveVote { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "remove_vote"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12398,205 +11010,250 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Exchanges a member with a new account and the same existing rank."] + #[doc = "Remove a vote for a poll."] #[doc = ""] - #[doc = "- `origin`: Must be the `ExchangeOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] - #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] - pub struct ExchangeMember { - pub who: exchange_member::Who, - pub new_who: exchange_member::NewWho, + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the poll was cancelled, because the voter lost the poll or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] + #[doc = " `index`."] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: The class of the poll."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub struct RemoveOtherVote { + pub target: remove_other_vote::Target, + pub class: remove_other_vote::Class, + pub index: remove_other_vote::Index, } - pub mod exchange_member { + pub mod remove_other_vote { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type NewWho = ::subxt::ext::subxt_core::utils::MultiAddress< + pub type Target = ::subxt::ext::subxt_core::utils::MultiAddress< ::subxt::ext::subxt_core::utils::AccountId32, (), >; + pub type Class = ::core::primitive::u16; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExchangeMember { - const PALLET: &'static str = "TechCollective"; - const CALL: &'static str = "exchange_member"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveOtherVote { + const PALLET: &'static str = "ConvictionVoting"; + const CALL: &'static str = "remove_other_vote"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Introduce a new member."] + #[doc = "Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] #[doc = ""] - #[doc = "- `origin`: Must be the `AddOrigin`."] - #[doc = "- `who`: Account of non-member which will become a member."] + #[doc = "The dispatch origin of this call must be _Signed_."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn add_member( + #[doc = "- `poll_index`: The index of the poll to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter has voted on."] + pub fn vote( &self, - who: types::add_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + poll_index: types::vote::PollIndex, + vote: types::vote::Vote, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "add_member", - types::AddMember { who }, + "ConvictionVoting", + "vote", + types::Vote { poll_index, vote }, [ - 2u8, 131u8, 37u8, 217u8, 112u8, 46u8, 86u8, 165u8, 248u8, 244u8, 33u8, - 236u8, 155u8, 28u8, 163u8, 169u8, 213u8, 32u8, 70u8, 217u8, 97u8, - 194u8, 138u8, 77u8, 133u8, 97u8, 188u8, 49u8, 49u8, 31u8, 177u8, 206u8, + 57u8, 170u8, 177u8, 168u8, 158u8, 43u8, 87u8, 242u8, 176u8, 85u8, + 230u8, 64u8, 103u8, 239u8, 190u8, 6u8, 228u8, 165u8, 248u8, 77u8, + 231u8, 221u8, 186u8, 107u8, 249u8, 201u8, 226u8, 52u8, 129u8, 90u8, + 142u8, 159u8, ], ) } - #[doc = "Increment the rank of an existing member by one."] + #[doc = "Delegate the voting power (with some given conviction) of the sending account for a"] + #[doc = "particular class of polls."] #[doc = ""] - #[doc = "- `origin`: Must be the `PromoteOrigin`."] - #[doc = "- `who`: Account of existing member."] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] #[doc = ""] - #[doc = "Weight: `O(1)`"] - pub fn promote_member( - &self, - who: types::promote_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "promote_member", - types::PromoteMember { who }, - [ - 169u8, 155u8, 9u8, 50u8, 144u8, 133u8, 230u8, 60u8, 216u8, 147u8, 3u8, - 236u8, 94u8, 185u8, 106u8, 139u8, 235u8, 143u8, 189u8, 135u8, 208u8, - 176u8, 126u8, 124u8, 85u8, 140u8, 189u8, 125u8, 87u8, 56u8, 57u8, - 246u8, - ], - ) - } - #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] - #[doc = "then they are removed entirely."] + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed through"] + #[doc = " `remove_vote`)."] #[doc = ""] - #[doc = "- `origin`: Must be the `DemoteOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `class`: The class of polls to delegate. To delegate multiple classes, multiple calls"] + #[doc = " to this function are required."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] - pub fn demote_member( + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub fn delegate( &self, - who: types::demote_member::Who, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + class: types::delegate::Class, + to: types::delegate::To, + conviction: types::delegate::Conviction, + balance: types::delegate::Balance, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "demote_member", - types::DemoteMember { who }, + "ConvictionVoting", + "delegate", + types::Delegate { class, to, conviction, balance }, [ - 21u8, 185u8, 71u8, 166u8, 106u8, 88u8, 74u8, 251u8, 78u8, 28u8, 205u8, - 171u8, 199u8, 195u8, 97u8, 149u8, 175u8, 229u8, 25u8, 113u8, 96u8, - 25u8, 240u8, 64u8, 109u8, 246u8, 203u8, 45u8, 110u8, 205u8, 115u8, - 178u8, + 223u8, 143u8, 33u8, 94u8, 32u8, 156u8, 43u8, 40u8, 142u8, 134u8, 209u8, + 134u8, 255u8, 179u8, 97u8, 46u8, 8u8, 140u8, 5u8, 29u8, 76u8, 22u8, + 36u8, 7u8, 108u8, 190u8, 220u8, 151u8, 10u8, 47u8, 89u8, 55u8, ], ) } - #[doc = "Remove the member entirely."] + #[doc = "Undelegate the voting power of the sending account for a particular class of polls."] #[doc = ""] - #[doc = "- `origin`: Must be the `RemoveOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero."] - #[doc = "- `min_rank`: The rank of the member or greater."] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued has passed."] #[doc = ""] - #[doc = "Weight: `O(min_rank)`."] - pub fn remove_member( + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "- `class`: The class of polls to remove the delegation from."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of polls the voter delegating to has"] + #[doc = " voted on. Weight is initially charged as if maximum votes, but is refunded later."] + pub fn undelegate( &self, - who: types::remove_member::Who, - min_rank: types::remove_member::MinRank, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + class: types::undelegate::Class, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "remove_member", - types::RemoveMember { who, min_rank }, + "ConvictionVoting", + "undelegate", + types::Undelegate { class }, [ - 23u8, 156u8, 32u8, 64u8, 158u8, 50u8, 64u8, 199u8, 108u8, 67u8, 133u8, - 128u8, 138u8, 241u8, 14u8, 238u8, 192u8, 173u8, 250u8, 11u8, 124u8, - 119u8, 177u8, 190u8, 152u8, 116u8, 134u8, 42u8, 216u8, 49u8, 113u8, - 49u8, + 140u8, 232u8, 6u8, 53u8, 228u8, 8u8, 131u8, 144u8, 65u8, 66u8, 245u8, + 247u8, 147u8, 135u8, 198u8, 57u8, 82u8, 212u8, 89u8, 46u8, 236u8, + 168u8, 200u8, 220u8, 93u8, 168u8, 101u8, 29u8, 110u8, 76u8, 67u8, + 181u8, ], ) } - #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = "Remove the lock caused by prior voting/delegating which has expired within a particular"] + #[doc = "class."] #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by a member account."] - #[doc = "- `poll`: Index of a poll which is ongoing."] - #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] + #[doc = "The dispatch origin of this call must be _Signed_."] #[doc = ""] - #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] - #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] - #[doc = "fee."] + #[doc = "- `class`: The class of polls to unlock."] + #[doc = "- `target`: The account to remove the lock on."] #[doc = ""] - #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] - pub fn vote( + #[doc = "Weight: `O(R)` with R number of vote of target."] + pub fn unlock( &self, - poll: types::vote::Poll, - aye: types::vote::Aye, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + class: types::unlock::Class, + target: types::unlock::Target, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "vote", - types::Vote { poll, aye }, + "ConvictionVoting", + "unlock", + types::Unlock { class, target }, [ - 54u8, 116u8, 81u8, 239u8, 223u8, 35u8, 11u8, 244u8, 245u8, 94u8, 23u8, - 241u8, 125u8, 231u8, 56u8, 150u8, 105u8, 125u8, 100u8, 171u8, 182u8, - 186u8, 134u8, 40u8, 4u8, 121u8, 119u8, 11u8, 93u8, 158u8, 59u8, 209u8, + 79u8, 5u8, 252u8, 237u8, 109u8, 238u8, 157u8, 237u8, 125u8, 171u8, + 65u8, 160u8, 102u8, 192u8, 5u8, 141u8, 179u8, 249u8, 253u8, 213u8, + 105u8, 251u8, 241u8, 145u8, 186u8, 177u8, 244u8, 139u8, 71u8, 140u8, + 173u8, 108u8, ], ) } - #[doc = "Remove votes from the given poll. It must have ended."] + #[doc = "Remove a vote for a poll."] #[doc = ""] - #[doc = "- `origin`: Must be `Signed` by any account."] - #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] - #[doc = " exist."] - #[doc = "- `max`: Maximum number of vote items from remove in this call."] + #[doc = "If:"] + #[doc = "- the poll was cancelled, or"] + #[doc = "- the poll is ongoing, or"] + #[doc = "- the poll has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] #[doc = ""] - #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = "If, however, the poll has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] #[doc = ""] - #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] - pub fn cleanup_poll( + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for poll `index`."] + #[doc = ""] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: Optional parameter, if given it indicates the class of the poll. For polls"] + #[doc = " which have finished or are cancelled, this must be `Some`."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_vote( &self, - poll_index: types::cleanup_poll::PollIndex, - max: types::cleanup_poll::Max, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + class: types::remove_vote::Class, + index: types::remove_vote::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "cleanup_poll", - types::CleanupPoll { poll_index, max }, + "ConvictionVoting", + "remove_vote", + types::RemoveVote { class, index }, [ - 157u8, 109u8, 86u8, 253u8, 62u8, 107u8, 235u8, 255u8, 171u8, 68u8, - 103u8, 92u8, 245u8, 25u8, 252u8, 158u8, 174u8, 137u8, 77u8, 251u8, - 105u8, 113u8, 165u8, 46u8, 39u8, 55u8, 166u8, 79u8, 103u8, 81u8, 121u8, - 37u8, + 255u8, 108u8, 211u8, 146u8, 168u8, 231u8, 207u8, 44u8, 76u8, 24u8, + 235u8, 60u8, 23u8, 79u8, 192u8, 192u8, 46u8, 40u8, 134u8, 27u8, 125u8, + 114u8, 125u8, 247u8, 85u8, 102u8, 76u8, 159u8, 34u8, 167u8, 152u8, + 148u8, ], ) } - #[doc = "Exchanges a member with a new account and the same existing rank."] + #[doc = "Remove a vote for a poll."] #[doc = ""] - #[doc = "- `origin`: Must be the `ExchangeOrigin`."] - #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] - #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] - pub fn exchange_member( + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the poll was cancelled, because the voter lost the poll or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for poll"] + #[doc = " `index`."] + #[doc = "- `index`: The index of poll of the vote to be removed."] + #[doc = "- `class`: The class of the poll."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of polls that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_other_vote( &self, - who: types::exchange_member::Who, - new_who: types::exchange_member::NewWho, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + target: types::remove_other_vote::Target, + class: types::remove_other_vote::Class, + index: types::remove_other_vote::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechCollective", - "exchange_member", - types::ExchangeMember { who, new_who }, + "ConvictionVoting", + "remove_other_vote", + types::RemoveOtherVote { target, class, index }, [ - 240u8, 208u8, 76u8, 147u8, 117u8, 23u8, 91u8, 37u8, 22u8, 101u8, 53u8, - 247u8, 161u8, 94u8, 109u8, 233u8, 104u8, 129u8, 67u8, 31u8, 223u8, - 182u8, 50u8, 233u8, 120u8, 129u8, 224u8, 135u8, 52u8, 162u8, 26u8, - 189u8, + 165u8, 26u8, 166u8, 37u8, 10u8, 174u8, 243u8, 10u8, 73u8, 93u8, 213u8, + 69u8, 200u8, 16u8, 48u8, 146u8, 160u8, 92u8, 28u8, 26u8, 158u8, 55u8, + 6u8, 251u8, 36u8, 132u8, 46u8, 195u8, 107u8, 34u8, 0u8, 100u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_ranked_collective::pallet::Event; + pub type Event = runtime_types::pallet_conviction_voting::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -12606,17 +11263,16 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A member `who` has been added."] - pub struct MemberAdded { - pub who: member_added::Who, - } - pub mod member_added { + #[doc = "An account has delegated their vote to another account. \\[who, target\\]"] + pub struct Delegated(pub delegated::Field0, pub delegated::Field1); + pub mod delegated { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Field1 = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberAdded { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberAdded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Delegated { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "Delegated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12625,19 +11281,15 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who`se rank has been changed to the given `rank`."] - pub struct RankChanged { - pub who: rank_changed::Who, - pub rank: rank_changed::Rank, - } - pub mod rank_changed { + #[doc = "An \\[account\\] has cancelled a previous delegation operation."] + pub struct Undelegated(pub undelegated::Field0); + pub mod undelegated { use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Rank = ::core::primitive::u16; + pub type Field0 = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for RankChanged { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "RankChanged"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Undelegated { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "Undelegated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12646,19 +11298,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who` of given `rank` has been removed from the collective."] - pub struct MemberRemoved { - pub who: member_removed::Who, - pub rank: member_removed::Rank, + #[doc = "An account has voted"] + pub struct Voted { + pub who: voted::Who, + pub vote: voted::Vote, } - pub mod member_removed { + pub mod voted { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Rank = ::core::primitive::u16; + pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< + ::core::primitive::u128, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberRemoved { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberRemoved"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "Voted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12667,24 +11321,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who` has voted for the `poll` with the given `vote` leading to an updated"] - #[doc = "`tally`."] - pub struct Voted { - pub who: voted::Who, - pub poll: voted::Poll, - pub vote: voted::Vote, - pub tally: voted::Tally, + #[doc = "A vote has been removed"] + pub struct VoteRemoved { + pub who: vote_removed::Who, + pub vote: vote_removed::Vote, } - pub mod voted { + pub mod vote_removed { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Poll = ::core::primitive::u32; - pub type Vote = runtime_types::pallet_ranked_collective::VoteRecord; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + pub type Vote = runtime_types::pallet_conviction_voting::vote::AccountVote< + ::core::primitive::u128, + >; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "Voted"; + impl ::subxt::ext::subxt_core::events::StaticEvent for VoteRemoved { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "VoteRemoved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -12693,500 +11344,238 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The member `who` had their `AccountId` changed to `new_who`."] - pub struct MemberExchanged { - pub who: member_exchanged::Who, - pub new_who: member_exchanged::NewWho, + #[doc = "The lockup period of a conviction vote expired, and the funds have been unlocked."] + pub struct VoteUnlocked { + pub who: vote_unlocked::Who, + pub class: vote_unlocked::Class, } - pub mod member_exchanged { + pub mod vote_unlocked { use super::runtime_types; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type NewWho = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Class = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MemberExchanged { - const PALLET: &'static str = "TechCollective"; - const EVENT: &'static str = "MemberExchanged"; + impl ::subxt::ext::subxt_core::events::StaticEvent for VoteUnlocked { + const PALLET: &'static str = "ConvictionVoting"; + const EVENT: &'static str = "VoteUnlocked"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod member_count { - use super::runtime_types; - pub type MemberCount = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - } - pub mod members { + pub mod voting_for { use super::runtime_types; - pub type Members = runtime_types::pallet_ranked_collective::MemberRecord; + pub type VotingFor = runtime_types::pallet_conviction_voting::vote::Voting< + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, + ::core::primitive::u32, + >; pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::core::primitive::u16; } - pub mod id_to_index { - use super::runtime_types; - pub type IdToIndex = ::core::primitive::u32; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod index_to_id { - use super::runtime_types; - pub type IndexToId = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param0 = ::core::primitive::u16; - pub type Param1 = ::core::primitive::u32; - } - pub mod voting { - use super::runtime_types; - pub type Voting = runtime_types::pallet_ranked_collective::VoteRecord; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - } - pub mod voting_cleanup { + pub mod class_locks_for { use super::runtime_types; - pub type VotingCleanup = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u8, - >; - pub type Param0 = ::core::primitive::u32; + pub type ClassLocksFor = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u16, + ::core::primitive::u128, + )>; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } } pub struct StorageApi; impl StorageApi { - #[doc = " The number of members in the collective who have at least the rank according to the index"] - #[doc = " of the vec."] - pub fn member_count_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::member_count::MemberCount, - (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "MemberCount", - (), - [ - 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, - 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, - 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, - ], - ) - } - #[doc = " The number of members in the collective who have at least the rank according to the index"] - #[doc = " of the vec."] - pub fn member_count( - &self, - _0: types::member_count::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::member_count::Param0, - >, - types::member_count::MemberCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "MemberCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, - 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, - 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, - ], - ) - } - #[doc = " The current members of the collective."] - pub fn members_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::members::Members, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Members", - (), - [ - 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, - 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, - 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, - 247u8, 133u8, - ], - ) - } - #[doc = " The current members of the collective."] - pub fn members( - &self, - _0: types::members::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::members::Param0, - >, - types::members::Members, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Members", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, - 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, - 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, - 247u8, 133u8, - ], - ) - } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::id_to_index::IdToIndex, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", - (), - [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, - ], - ) - } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index_iter1( + #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] + #[doc = " number of votes that we have recorded."] + pub fn voting_for_iter( &self, - _0: types::id_to_index::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param0, - >, - types::id_to_index::IdToIndex, (), + types::voting_for::VotingFor, (), ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, - ], - ) - } - #[doc = " The index of each ranks's member into the group of members who have at least that rank."] - pub fn id_to_index( - &self, - _0: types::id_to_index::Param0, - _1: types::id_to_index::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::id_to_index::Param1, - >, - ), - types::id_to_index::IdToIndex, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IdToIndex", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), - [ - 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, - 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, - 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, - ], - ) - } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::index_to_id::IndexToId, - (), - (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", + "ConvictionVoting", + "VotingFor", (), [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, + 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, + 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, + 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, ], ) } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id_iter1( + #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] + #[doc = " number of votes that we have recorded."] + pub fn voting_for_iter1( &self, - _0: types::index_to_id::Param0, + _0: types::voting_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param0, + types::voting_for::Param0, >, - types::index_to_id::IndexToId, - (), + types::voting_for::VotingFor, (), ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", + "ConvictionVoting", + "VotingFor", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, + 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, + 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, + 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, ], ) } - #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] - #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] - pub fn index_to_id( + #[doc = " All voting for a particular voter in a particular voting class. We store the balance for the"] + #[doc = " number of votes that we have recorded."] + pub fn voting_for( &self, - _0: types::index_to_id::Param0, - _1: types::index_to_id::Param1, + _0: types::voting_for::Param0, + _1: types::voting_for::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param0, + types::voting_for::Param0, >, ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::index_to_id::Param1, + types::voting_for::Param1, >, ), - types::index_to_id::IndexToId, + types::voting_for::VotingFor, + ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, - (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "IndexToId", + "ConvictionVoting", + "VotingFor", ( ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), ), [ - 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, - 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, - 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, - 70u8, + 76u8, 63u8, 153u8, 193u8, 39u8, 137u8, 186u8, 29u8, 202u8, 56u8, 169u8, + 56u8, 103u8, 138u8, 192u8, 18u8, 179u8, 114u8, 56u8, 121u8, 197u8, + 12u8, 29u8, 239u8, 220u8, 231u8, 24u8, 46u8, 134u8, 99u8, 53u8, 206u8, ], ) } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter( + #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] + #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] + #[doc = " this list."] + pub fn class_locks_for_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::voting::Voting, - (), + types::class_locks_for::ClassLocksFor, (), ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", + "ConvictionVoting", + "ClassLocksFor", (), [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, + 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, + 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, ], ) } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting_iter1( + #[doc = " The voting classes which have a non-zero lock requirement and the lock amounts which they"] + #[doc = " require. The actual amount locked on behalf of this pallet should always be the maximum of"] + #[doc = " this list."] + pub fn class_locks_for( &self, - _0: types::voting::Param0, + _0: types::class_locks_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param0, + types::class_locks_for::Param0, >, - types::voting::Voting, - (), - (), + types::class_locks_for::ClassLocksFor, ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, - ], - ) - } - #[doc = " Votes on a given proposal, if it is ongoing."] - pub fn voting( - &self, - _0: types::voting::Param0, - _1: types::voting::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting::Param1, - >, - ), - types::voting::Voting, ::subxt::ext::subxt_core::utils::Yes, (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "Voting", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + "ConvictionVoting", + "ClassLocksFor", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, - 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, - 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, - 175u8, 18u8, + 74u8, 74u8, 8u8, 82u8, 215u8, 61u8, 13u8, 9u8, 44u8, 222u8, 33u8, + 245u8, 195u8, 124u8, 6u8, 174u8, 65u8, 245u8, 71u8, 42u8, 47u8, 46u8, + 164u8, 231u8, 11u8, 245u8, 115u8, 207u8, 209u8, 137u8, 90u8, 6u8, ], ) } - pub fn voting_cleanup_iter( + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The maximum number of concurrent votes an account may have."] + #[doc = ""] + #[doc = " Also used to compute weight, an overly large value can lead to extrinsics with large"] + #[doc = " weight estimation: see `delegate` for instance."] + pub fn max_votes( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::voting_cleanup::VotingCleanup, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "VotingCleanup", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ConvictionVoting", + "MaxVotes", [ - 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, - 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, - 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - pub fn voting_cleanup( + #[doc = " The minimum period of vote locking."] + #[doc = ""] + #[doc = " It should be no shorter than enactment period to ensure that in the case of an approval,"] + #[doc = " those successful voters are locked into the consequences that their votes entail."] + pub fn vote_locking_period( &self, - _0: types::voting_cleanup::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::voting_cleanup::Param0, - >, - types::voting_cleanup::VotingCleanup, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechCollective", - "VotingCleanup", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "ConvictionVoting", + "VoteLockingPeriod", [ - 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, - 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, - 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } } } } - pub mod tech_referenda { + pub mod tech_collective { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_referenda::pallet::Error; + pub type Error = runtime_types::pallet_ranked_collective::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_referenda::pallet::Call; + pub type Call = runtime_types::pallet_ranked_collective::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 a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub struct Submit { - pub proposal_origin: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub proposal: submit::Proposal, - pub enactment_moment: submit::EnactmentMoment, - } - pub mod submit { - use super::runtime_types; - pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - pub type EnactmentMoment = - runtime_types::frame_support::traits::schedule::DispatchTime< - ::core::primitive::u32, - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "submit"; - } + pub mod types { + use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -13198,24 +11587,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Post the Decision Deposit for a referendum."] + #[doc = "Introduce a new member."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] + #[doc = "- `origin`: Must be the `AddOrigin`."] + #[doc = "- `who`: Account of non-member which will become a member."] #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub struct PlaceDecisionDeposit { - pub index: place_decision_deposit::Index, + #[doc = "Weight: `O(1)`"] + pub struct AddMember { + pub who: add_member::Who, } - pub mod place_decision_deposit { + pub mod add_member { use super::runtime_types; - pub type Index = ::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 PlaceDecisionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "place_decision_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for AddMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "add_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13228,23 +11618,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = "Increment the rank of an existing member by one."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "- `origin`: Must be the `PromoteOrigin`."] + #[doc = "- `who`: Account of existing member."] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub struct RefundDecisionDeposit { - pub index: refund_decision_deposit::Index, + #[doc = "Weight: `O(1)`"] + pub struct PromoteMember { + pub who: promote_member::Who, } - pub mod refund_decision_deposit { + pub mod promote_member { use super::runtime_types; - pub type Index = ::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 RefundDecisionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "refund_decision_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PromoteMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "promote_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13257,22 +11649,26 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel an ongoing referendum."] + #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] + #[doc = "then they are removed entirely."] #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "- `origin`: Must be the `DemoteOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub struct Cancel { - pub index: cancel::Index, + #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] + pub struct DemoteMember { + pub who: demote_member::Who, } - pub mod cancel { + pub mod demote_member { use super::runtime_types; - pub type Index = ::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 Cancel { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "cancel"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DemoteMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "demote_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13285,22 +11681,28 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = "Remove the member entirely."] #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "- `origin`: Must be the `RemoveOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `min_rank`: The rank of the member or greater."] #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub struct Kill { - pub index: kill::Index, + #[doc = "Weight: `O(min_rank)`."] + pub struct RemoveMember { + pub who: remove_member::Who, + pub min_rank: remove_member::MinRank, } - pub mod kill { + pub mod remove_member { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type MinRank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "kill"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "remove_member"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13313,51 +11715,29 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = "Add an aye or nay vote for the sender to the given proposal."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub struct NudgeReferendum { - pub index: nudge_referendum::Index, - } - pub mod nudge_referendum { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "nudge_referendum"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = "- `origin`: Must be `Signed` by a member account."] + #[doc = "- `poll`: Index of a poll which is ongoing."] + #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] + #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub struct OneFewerDeciding { - pub track: one_fewer_deciding::Track, + #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] + pub struct Vote { + pub poll: vote::Poll, + pub aye: vote::Aye, } - pub mod one_fewer_deciding { + pub mod vote { use super::runtime_types; - pub type Track = ::core::primitive::u16; + pub type Poll = ::core::primitive::u32; + pub type Aye = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for OneFewerDeciding { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "one_fewer_deciding"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Vote { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "vote"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13370,23 +11750,28 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = "Remove votes from the given poll. It must have ended."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "- `origin`: Must be `Signed` by any account."] + #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] + #[doc = " exist."] + #[doc = "- `max`: Maximum number of vote items from remove in this call."] #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub struct RefundSubmissionDeposit { - pub index: refund_submission_deposit::Index, + #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = ""] + #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] + pub struct CleanupPoll { + pub poll_index: cleanup_poll::PollIndex, + pub max: cleanup_poll::Max, } - pub mod refund_submission_deposit { + pub mod cleanup_poll { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type PollIndex = ::core::primitive::u32; + pub type Max = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundSubmissionDeposit { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "refund_submission_deposit"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CleanupPoll { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "cleanup_poll"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13399,253 +11784,205 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Set or clear metadata of a referendum."] + #[doc = "Exchanges a member with a new account and the same existing rank."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub struct SetMetadata { - pub index: set_metadata::Index, - pub maybe_hash: set_metadata::MaybeHash, + #[doc = "- `origin`: Must be the `ExchangeOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] + #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] + pub struct ExchangeMember { + pub who: exchange_member::Who, + pub new_who: exchange_member::NewWho, } - pub mod set_metadata { + pub mod exchange_member { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type MaybeHash = - ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { - const PALLET: &'static str = "TechReferenda"; - const CALL: &'static str = "set_metadata"; - } - } - pub struct TransactionApi; - impl TransactionApi { - #[doc = "Propose a referendum on a privileged action."] - #[doc = ""] - #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] - #[doc = " available."] - #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] - #[doc = "- `proposal`: The proposal."] - #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] - #[doc = ""] - #[doc = "Emits `Submitted`."] - pub fn submit( - &self, - proposal_origin: types::submit::ProposalOrigin, - proposal: types::submit::Proposal, - enactment_moment: types::submit::EnactmentMoment, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "submit", - types::Submit { - proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - proposal_origin, - ), - proposal, - enactment_moment, - }, - [ - 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, - 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, - 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, - ], - ) + pub type Who = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; + pub type NewWho = ::subxt::ext::subxt_core::utils::MultiAddress< + ::subxt::ext::subxt_core::utils::AccountId32, + (), + >; } - #[doc = "Post the Decision Deposit for a referendum."] + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for ExchangeMember { + const PALLET: &'static str = "TechCollective"; + const CALL: &'static str = "exchange_member"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Introduce a new member."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] - #[doc = " referendum's track's Decision Deposit."] - #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] - #[doc = " posted."] + #[doc = "- `origin`: Must be the `AddOrigin`."] + #[doc = "- `who`: Account of non-member which will become a member."] #[doc = ""] - #[doc = "Emits `DecisionDepositPlaced`."] - pub fn place_decision_deposit( + #[doc = "Weight: `O(1)`"] + pub fn add_member( &self, - index: types::place_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + who: types::add_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "place_decision_deposit", - types::PlaceDecisionDeposit { index }, + "TechCollective", + "add_member", + types::AddMember { who }, [ - 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, - 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, - 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, + 2u8, 131u8, 37u8, 217u8, 112u8, 46u8, 86u8, 165u8, 248u8, 244u8, 33u8, + 236u8, 155u8, 28u8, 163u8, 169u8, 213u8, 32u8, 70u8, 217u8, 97u8, + 194u8, 138u8, 77u8, 133u8, 97u8, 188u8, 49u8, 49u8, 31u8, 177u8, 206u8, ], ) } - #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = "Increment the rank of an existing member by one."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "- `origin`: Must be the `PromoteOrigin`."] + #[doc = "- `who`: Account of existing member."] #[doc = ""] - #[doc = "Emits `DecisionDepositRefunded`."] - pub fn refund_decision_deposit( + #[doc = "Weight: `O(1)`"] + pub fn promote_member( &self, - index: types::refund_decision_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundDecisionDeposit, - > { + who: types::promote_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "refund_decision_deposit", - types::RefundDecisionDeposit { index }, + "TechCollective", + "promote_member", + types::PromoteMember { who }, [ - 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, - 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, - 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, + 169u8, 155u8, 9u8, 50u8, 144u8, 133u8, 230u8, 60u8, 216u8, 147u8, 3u8, + 236u8, 94u8, 185u8, 106u8, 139u8, 235u8, 143u8, 189u8, 135u8, 208u8, + 176u8, 126u8, 124u8, 85u8, 140u8, 189u8, 125u8, 87u8, 56u8, 57u8, + 246u8, ], ) } - #[doc = "Cancel an ongoing referendum."] + #[doc = "Decrement the rank of an existing member by one. If the member is already at rank zero,"] + #[doc = "then they are removed entirely."] #[doc = ""] - #[doc = "- `origin`: must be the `CancelOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "- `origin`: Must be the `DemoteOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] #[doc = ""] - #[doc = "Emits `Cancelled`."] - pub fn cancel( + #[doc = "Weight: `O(1)`, less if the member's index is highest in its rank."] + pub fn demote_member( &self, - index: types::cancel::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + who: types::demote_member::Who, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "cancel", - types::Cancel { index }, + "TechCollective", + "demote_member", + types::DemoteMember { who }, [ - 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, - 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, - 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, - 122u8, + 21u8, 185u8, 71u8, 166u8, 106u8, 88u8, 74u8, 251u8, 78u8, 28u8, 205u8, + 171u8, 199u8, 195u8, 97u8, 149u8, 175u8, 229u8, 25u8, 113u8, 96u8, + 25u8, 240u8, 64u8, 109u8, 246u8, 203u8, 45u8, 110u8, 205u8, 115u8, + 178u8, ], ) } - #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = "Remove the member entirely."] #[doc = ""] - #[doc = "- `origin`: must be the `KillOrigin`."] - #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = "- `origin`: Must be the `RemoveOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero."] + #[doc = "- `min_rank`: The rank of the member or greater."] #[doc = ""] - #[doc = "Emits `Killed` and `DepositSlashed`."] - pub fn kill( + #[doc = "Weight: `O(min_rank)`."] + pub fn remove_member( &self, - index: types::kill::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + who: types::remove_member::Who, + min_rank: types::remove_member::MinRank, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "kill", - types::Kill { index }, + "TechCollective", + "remove_member", + types::RemoveMember { who, min_rank }, [ - 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, - 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, - 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, - 48u8, + 23u8, 156u8, 32u8, 64u8, 158u8, 50u8, 64u8, 199u8, 108u8, 67u8, 133u8, + 128u8, 138u8, 241u8, 14u8, 238u8, 192u8, 173u8, 250u8, 11u8, 124u8, + 119u8, 177u8, 190u8, 152u8, 116u8, 134u8, 42u8, 216u8, 49u8, 113u8, + 49u8, ], ) } - #[doc = "Advance a referendum onto its next logical state. Only used internally."] + #[doc = "Add an aye or nay vote for the sender to the given proposal."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `index`: the referendum to be advanced."] - pub fn nudge_referendum( - &self, - index: types::nudge_referendum::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "nudge_referendum", - types::NudgeReferendum { index }, - [ - 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, - 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, - 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, - 213u8, - ], - ) - } - #[doc = "Advance a track onto its next logical state. Only used internally."] + #[doc = "- `origin`: Must be `Signed` by a member account."] + #[doc = "- `poll`: Index of a poll which is ongoing."] + #[doc = "- `aye`: `true` if the vote is to approve the proposal, `false` otherwise."] #[doc = ""] - #[doc = "- `origin`: must be `Root`."] - #[doc = "- `track`: the track to be advanced."] + #[doc = "Transaction fees are be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] #[doc = ""] - #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] - #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] - #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] - #[doc = "- decrement `DecidingCount`."] - pub fn one_fewer_deciding( + #[doc = "Weight: `O(1)`, less if there was no previous vote on the poll by the member."] + pub fn vote( &self, - track: types::one_fewer_deciding::Track, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + poll: types::vote::Poll, + aye: types::vote::Aye, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "one_fewer_deciding", - types::OneFewerDeciding { track }, + "TechCollective", + "vote", + types::Vote { poll, aye }, [ - 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, - 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, - 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, - 131u8, 167u8, + 54u8, 116u8, 81u8, 239u8, 223u8, 35u8, 11u8, 244u8, 245u8, 94u8, 23u8, + 241u8, 125u8, 231u8, 56u8, 150u8, 105u8, 125u8, 100u8, 171u8, 182u8, + 186u8, 134u8, 40u8, 4u8, 121u8, 119u8, 11u8, 93u8, 158u8, 59u8, 209u8, ], ) } - #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] + #[doc = "Remove votes from the given poll. It must have ended."] #[doc = ""] - #[doc = "- `origin`: must be `Signed` or `Root`."] - #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] - #[doc = " refunded."] + #[doc = "- `origin`: Must be `Signed` by any account."] + #[doc = "- `poll_index`: Index of a poll which is completed and for which votes continue to"] + #[doc = " exist."] + #[doc = "- `max`: Maximum number of vote items from remove in this call."] #[doc = ""] - #[doc = "Emits `SubmissionDepositRefunded`."] - pub fn refund_submission_deposit( + #[doc = "Transaction fees are waived if the operation is successful."] + #[doc = ""] + #[doc = "Weight `O(max)` (less if there are fewer items to remove than `max`)."] + pub fn cleanup_poll( &self, - index: types::refund_submission_deposit::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< - types::RefundSubmissionDeposit, - > { + poll_index: types::cleanup_poll::PollIndex, + max: types::cleanup_poll::Max, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "refund_submission_deposit", - types::RefundSubmissionDeposit { index }, + "TechCollective", + "cleanup_poll", + types::CleanupPoll { poll_index, max }, [ - 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, - 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, - 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, + 157u8, 109u8, 86u8, 253u8, 62u8, 107u8, 235u8, 255u8, 171u8, 68u8, + 103u8, 92u8, 245u8, 25u8, 252u8, 158u8, 174u8, 137u8, 77u8, 251u8, + 105u8, 113u8, 165u8, 46u8, 39u8, 55u8, 166u8, 79u8, 103u8, 81u8, 121u8, + 37u8, ], ) } - #[doc = "Set or clear metadata of a referendum."] + #[doc = "Exchanges a member with a new account and the same existing rank."] #[doc = ""] - #[doc = "Parameters:"] - #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] - #[doc = " metadata of a finished referendum."] - #[doc = "- `index`: The index of a referendum to set or clear metadata for."] - #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] - pub fn set_metadata( + #[doc = "- `origin`: Must be the `ExchangeOrigin`."] + #[doc = "- `who`: Account of existing member of rank greater than zero to be exchanged."] + #[doc = "- `new_who`: New Account of existing member of rank greater than zero to exchanged to."] + pub fn exchange_member( &self, - index: types::set_metadata::Index, - maybe_hash: types::set_metadata::MaybeHash, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + who: types::exchange_member::Who, + new_who: types::exchange_member::NewWho, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TechReferenda", - "set_metadata", - types::SetMetadata { index, maybe_hash }, + "TechCollective", + "exchange_member", + types::ExchangeMember { who, new_who }, [ - 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, - 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, - 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, - 88u8, + 240u8, 208u8, 76u8, 147u8, 117u8, 23u8, 91u8, 37u8, 22u8, 101u8, 53u8, + 247u8, 161u8, 94u8, 109u8, 233u8, 104u8, 129u8, 67u8, 31u8, 223u8, + 182u8, 50u8, 233u8, 120u8, 129u8, 224u8, 135u8, 52u8, 162u8, 26u8, + 189u8, ], ) } } } #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_referenda::pallet::Event2; + pub type Event = runtime_types::pallet_ranked_collective::pallet::Event; pub mod events { use super::runtime_types; #[derive( @@ -13655,258 +11992,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been submitted."] - pub struct Submitted { - pub index: submitted::Index, - pub track: submitted::Track, - pub proposal: submitted::Proposal, - } - pub mod submitted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Submitted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been placed."] - pub struct DecisionDepositPlaced { - pub index: decision_deposit_placed::Index, - pub who: decision_deposit_placed::Who, - pub amount: decision_deposit_placed::Amount, - } - pub mod decision_deposit_placed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionDepositPlaced"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The decision deposit has been refunded."] - pub struct DecisionDepositRefunded { - pub index: decision_deposit_refunded::Index, - pub who: decision_deposit_refunded::Who, - pub amount: decision_deposit_refunded::Amount, - } - pub mod decision_deposit_refunded { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionDepositRefunded"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A deposit has been slashed."] - pub struct DepositSlashed { - pub who: deposit_slashed::Who, - pub amount: deposit_slashed::Amount, - } - pub mod deposit_slashed { - use super::runtime_types; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DepositSlashed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has moved into the deciding phase."] - pub struct DecisionStarted { - pub index: decision_started::Index, - pub track: decision_started::Track, - pub proposal: decision_started::Proposal, - pub tally: decision_started::Tally, - } - pub mod decision_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Track = ::core::primitive::u16; - pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "DecisionStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmStarted { - pub index: confirm_started::Index, - } - pub mod confirm_started { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "ConfirmStarted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct ConfirmAborted { - pub index: confirm_aborted::Index, - } - pub mod confirm_aborted { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "ConfirmAborted"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has ended its confirmation phase and is ready for approval."] - pub struct Confirmed { - pub index: confirmed::Index, - pub tally: confirmed::Tally, - } - pub mod confirmed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Confirmed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been approved and its proposal has been scheduled."] - pub struct Approved { - pub index: approved::Index, - } - pub mod approved { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Approved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A proposal has been rejected by referendum."] - pub struct Rejected { - pub index: rejected::Index, - pub tally: rejected::Tally, - } - pub mod rejected { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Rejected"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been timed out without being decided."] - pub struct TimedOut { - pub index: timed_out::Index, - pub tally: timed_out::Tally, - } - pub mod timed_out { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "TimedOut"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been cancelled."] - pub struct Cancelled { - pub index: cancelled::Index, - pub tally: cancelled::Tally, + #[doc = "A member `who` has been added."] + pub struct MemberAdded { + pub who: member_added::Who, } - pub mod cancelled { + pub mod member_added { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Cancelled"; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberAdded { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberAdded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13915,19 +12011,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A referendum has been killed."] - pub struct Killed { - pub index: killed::Index, - pub tally: killed::Tally, + #[doc = "The member `who`se rank has been changed to the given `rank`."] + pub struct RankChanged { + pub who: rank_changed::Who, + pub rank: rank_changed::Rank, } - pub mod killed { + pub mod rank_changed { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Tally = runtime_types::pallet_ranked_collective::Tally; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Rank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Killed { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "Killed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for RankChanged { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "RankChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13936,21 +12032,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The submission deposit has been refunded."] - pub struct SubmissionDepositRefunded { - pub index: submission_deposit_refunded::Index, - pub who: submission_deposit_refunded::Who, - pub amount: submission_deposit_refunded::Amount, + #[doc = "The member `who` of given `rank` has been removed from the collective."] + pub struct MemberRemoved { + pub who: member_removed::Who, + pub rank: member_removed::Rank, } - pub mod submission_deposit_refunded { + pub mod member_removed { use super::runtime_types; - pub type Index = ::core::primitive::u32; pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Rank = ::core::primitive::u16; } - impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "SubmissionDepositRefunded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberRemoved { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberRemoved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13959,19 +12053,24 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been set."] - pub struct MetadataSet { - pub index: metadata_set::Index, - pub hash: metadata_set::Hash, + #[doc = "The member `who` has voted for the `poll` with the given `vote` leading to an updated"] + #[doc = "`tally`."] + pub struct Voted { + pub who: voted::Who, + pub poll: voted::Poll, + pub vote: voted::Vote, + pub tally: voted::Tally, } - pub mod metadata_set { + pub mod voted { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Poll = ::core::primitive::u32; + pub type Vote = runtime_types::pallet_ranked_collective::VoteRecord; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "MetadataSet"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Voted { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "Voted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -13980,415 +12079,615 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata for a referendum has been cleared."] - pub struct MetadataCleared { - pub index: metadata_cleared::Index, - pub hash: metadata_cleared::Hash, + #[doc = "The member `who` had their `AccountId` changed to `new_who`."] + pub struct MemberExchanged { + pub who: member_exchanged::Who, + pub new_who: member_exchanged::NewWho, } - pub mod metadata_cleared { + pub mod member_exchanged { use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type Hash = ::subxt::ext::subxt_core::utils::H256; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type NewWho = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "TechReferenda"; - const EVENT: &'static str = "MetadataCleared"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MemberExchanged { + const PALLET: &'static str = "TechCollective"; + const EVENT: &'static str = "MemberExchanged"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod referendum_count { + pub mod member_count { use super::runtime_types; - pub type ReferendumCount = ::core::primitive::u32; + pub type MemberCount = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; } - pub mod referendum_info_for { + pub mod members { use super::runtime_types; - pub type ReferendumInfoFor = - runtime_types::pallet_referenda::types::ReferendumInfo< - ::core::primitive::u16, - runtime_types::quantus_runtime::OriginCaller, - ::core::primitive::u32, - runtime_types::frame_support::traits::preimages::Bounded< - runtime_types::quantus_runtime::RuntimeCall, - runtime_types::qp_poseidon::PoseidonHasher, - >, - ::core::primitive::u128, - runtime_types::pallet_ranked_collective::Tally, - ::subxt::ext::subxt_core::utils::AccountId32, - ( - runtime_types::qp_scheduler::BlockNumberOrTimestamp< - ::core::primitive::u32, - ::core::primitive::u64, - >, - ::core::primitive::u32, - ), - >; - pub type Param0 = ::core::primitive::u32; + pub type Members = runtime_types::pallet_ranked_collective::MemberRecord; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod track_queue { + pub mod id_to_index { use super::runtime_types; - pub type TrackQueue = - runtime_types::bounded_collections::bounded_vec::BoundedVec<( - ::core::primitive::u32, - ::core::primitive::u32, - )>; + pub type IdToIndex = ::core::primitive::u32; pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod deciding_count { + pub mod index_to_id { use super::runtime_types; - pub type DecidingCount = ::core::primitive::u32; + pub type IndexToId = ::subxt::ext::subxt_core::utils::AccountId32; pub type Param0 = ::core::primitive::u16; + pub type Param1 = ::core::primitive::u32; } - pub mod metadata_of { + pub mod voting { use super::runtime_types; - pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; + pub type Voting = runtime_types::pallet_ranked_collective::VoteRecord; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod voting_cleanup { + use super::runtime_types; + pub type VotingCleanup = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; pub type Param0 = ::core::primitive::u32; } } pub struct StorageApi; impl StorageApi { - #[doc = " The next free referendum index, aka the number of referenda started so far."] - pub fn referendum_count( + #[doc = " The number of members in the collective who have at least the rank according to the index"] + #[doc = " of the vec."] + pub fn member_count_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::referendum_count::ReferendumCount, + types::member_count::MemberCount, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "MemberCount", + (), + [ + 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, + 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, + 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, + ], + ) + } + #[doc = " The number of members in the collective who have at least the rank according to the index"] + #[doc = " of the vec."] + pub fn member_count( + &self, + _0: types::member_count::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::member_count::Param0, + >, + types::member_count::MemberCount, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "ReferendumCount", + "TechCollective", + "MemberCount", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 0u8, 141u8, 66u8, 91u8, 155u8, 74u8, 17u8, 191u8, 143u8, 41u8, 231u8, + 56u8, 123u8, 219u8, 145u8, 27u8, 197u8, 62u8, 118u8, 237u8, 30u8, 7u8, + 107u8, 96u8, 95u8, 17u8, 242u8, 206u8, 246u8, 79u8, 53u8, 214u8, + ], + ) + } + #[doc = " The current members of the collective."] + pub fn members_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::members::Members, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Members", (), [ - 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, - 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, - 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, - 67u8, + 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, + 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, + 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, + 247u8, 133u8, ], ) } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for_iter( + #[doc = " The current members of the collective."] + pub fn members( &self, + _0: types::members::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::members::Param0, + >, + types::members::Members, + ::subxt::ext::subxt_core::utils::Yes, (), - types::referendum_info_for::ReferendumInfoFor, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Members", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 101u8, 183u8, 36u8, 241u8, 67u8, 8u8, 252u8, 116u8, 110u8, 153u8, + 117u8, 210u8, 128u8, 80u8, 130u8, 163u8, 38u8, 76u8, 230u8, 107u8, + 112u8, 90u8, 102u8, 24u8, 217u8, 2u8, 244u8, 197u8, 103u8, 215u8, + 247u8, 133u8, + ], + ) + } + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::id_to_index::IdToIndex, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "ReferendumInfoFor", + "TechCollective", + "IdToIndex", (), [ - 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, - 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, - 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, ], ) } - #[doc = " Information concerning any given referendum."] - pub fn referendum_info_for( + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index_iter1( &self, - _0: types::referendum_info_for::Param0, + _0: types::id_to_index::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::referendum_info_for::Param0, + types::id_to_index::Param0, >, - types::referendum_info_for::ReferendumInfoFor, - ::subxt::ext::subxt_core::utils::Yes, + types::id_to_index::IdToIndex, (), (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "ReferendumInfoFor", + "TechCollective", + "IdToIndex", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, - 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, - 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, ], ) } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue_iter( + #[doc = " The index of each ranks's member into the group of members who have at least that rank."] + pub fn id_to_index( &self, + _0: types::id_to_index::Param0, + _1: types::id_to_index::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::id_to_index::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::id_to_index::Param1, + >, + ), + types::id_to_index::IdToIndex, + ::subxt::ext::subxt_core::utils::Yes, (), - types::track_queue::TrackQueue, (), - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "TrackQueue", - (), + "TechCollective", + "IdToIndex", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, - 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, - 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, - 186u8, 65u8, + 121u8, 225u8, 69u8, 131u8, 194u8, 3u8, 82u8, 27u8, 129u8, 152u8, 157u8, + 45u8, 39u8, 47u8, 166u8, 28u8, 42u8, 92u8, 217u8, 189u8, 160u8, 102u8, + 153u8, 196u8, 94u8, 48u8, 248u8, 113u8, 164u8, 111u8, 27u8, 9u8, ], ) } - #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] - #[doc = " conviction-weighted approvals."] - #[doc = ""] - #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] - pub fn track_queue( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id_iter( &self, - _0: types::track_queue::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::track_queue::Param0, - >, - types::track_queue::TrackQueue, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, (), + types::index_to_id::IndexToId, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "TrackQueue", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "TechCollective", + "IndexToId", + (), [ - 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, - 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, - 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, - 186u8, 65u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count_iter( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id_iter1( &self, + _0: types::index_to_id::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::index_to_id::Param0, + >, + types::index_to_id::IndexToId, (), - types::deciding_count::DecidingCount, (), ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "DecidingCount", - (), + "TechCollective", + "IndexToId", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - #[doc = " The number of referenda being decided currently."] - pub fn deciding_count( + #[doc = " The members in the collective by index. All indices in the range `0..MemberCount` will"] + #[doc = " return `Some`, however a member's index is not guaranteed to remain unchanged over time."] + pub fn index_to_id( &self, - _0: types::deciding_count::Param0, + _0: types::index_to_id::Param0, + _1: types::index_to_id::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::deciding_count::Param0, - >, - types::deciding_count::DecidingCount, - ::subxt::ext::subxt_core::utils::Yes, + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::index_to_id::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::index_to_id::Param1, + >, + ), + types::index_to_id::IndexToId, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "DecidingCount", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "TechCollective", + "IndexToId", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, - 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, - 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, - 245u8, + 110u8, 48u8, 214u8, 224u8, 56u8, 195u8, 186u8, 24u8, 111u8, 37u8, 15u8, + 153u8, 245u8, 101u8, 229u8, 149u8, 216u8, 185u8, 7u8, 242u8, 196u8, + 29u8, 205u8, 243u8, 162u8, 92u8, 71u8, 253u8, 102u8, 152u8, 137u8, + 70u8, ], ) } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of_iter( + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::metadata_of::MetadataOf, + types::voting::Voting, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "MetadataOf", + "TechCollective", + "Voting", (), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, ], ) } - #[doc = " The metadata is a general information concerning the referendum."] - #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] - #[doc = " dump or IPFS hash of a JSON file."] - #[doc = ""] - #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] - #[doc = " large preimages."] - pub fn metadata_of( + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting_iter1( &self, - _0: types::metadata_of::Param0, + _0: types::voting::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::metadata_of::Param0, + types::voting::Param0, >, - types::metadata_of::MetadataOf, - ::subxt::ext::subxt_core::utils::Yes, + types::voting::Voting, (), (), + ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TechReferenda", - "MetadataOf", + "TechCollective", + "Voting", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, - 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, - 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, - 110u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] - pub fn submission_deposit( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "SubmissionDeposit", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, ], ) } - #[doc = " Maximum size of the referendum queue for a single track."] - pub fn max_queued( + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + _0: types::voting::Param0, + _1: types::voting::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting::Param1, + >, + ), + types::voting::Voting, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "MaxQueued", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "Voting", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 180u8, 146u8, 236u8, 178u8, 30u8, 50u8, 161u8, 50u8, 140u8, 110u8, + 220u8, 1u8, 109u8, 209u8, 17u8, 94u8, 234u8, 223u8, 222u8, 177u8, + 243u8, 194u8, 246u8, 48u8, 178u8, 86u8, 30u8, 185u8, 56u8, 206u8, + 175u8, 18u8, ], ) } - #[doc = " The number of blocks after submission that a referendum must begin being decided by."] - #[doc = " Once this passes, then anyone may cancel the referendum."] - pub fn undeciding_timeout( + pub fn voting_cleanup_iter( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::voting_cleanup::VotingCleanup, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "UndecidingTimeout", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "VotingCleanup", + (), [ - 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, + 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, + 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, + 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, ], ) } - #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] - #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] - #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] - pub fn alarm_interval( + pub fn voting_cleanup( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + _0: types::voting_cleanup::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::voting_cleanup::Param0, + >, + types::voting_cleanup::VotingCleanup, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "AlarmInterval", + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechCollective", + "VotingCleanup", + ::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, + 223u8, 130u8, 79u8, 104u8, 94u8, 221u8, 222u8, 72u8, 187u8, 95u8, + 231u8, 59u8, 28u8, 119u8, 191u8, 63u8, 40u8, 186u8, 58u8, 254u8, 14u8, + 233u8, 152u8, 36u8, 2u8, 231u8, 120u8, 13u8, 120u8, 211u8, 232u8, 11u8, ], ) } - #[doc = " A list of tracks."] + } + } + } + pub mod tech_referenda { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_referenda::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_referenda::pallet::Call; + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Propose a referendum on a privileged action."] #[doc = ""] - #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] - pub fn tracks( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::alloc::vec::Vec<( - ::core::primitive::u16, - runtime_types::pallet_referenda::types::TrackDetails< - ::core::primitive::u128, + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] + #[doc = ""] + #[doc = "Emits `Submitted`."] + pub struct Submit { + pub proposal_origin: + ::subxt::ext::subxt_core::alloc::boxed::Box, + pub proposal: submit::Proposal, + pub enactment_moment: submit::EnactmentMoment, + } + pub mod submit { + use super::runtime_types; + pub type ProposalOrigin = runtime_types::quantus_runtime::OriginCaller; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; + pub type EnactmentMoment = + runtime_types::frame_support::traits::schedule::DispatchTime< ::core::primitive::u32, - ::subxt::ext::subxt_core::alloc::string::String, - >, - )>, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TechReferenda", - "Tracks", - [ - 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, - 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, - 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, - 159u8, - ], - ) + >; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Submit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "submit"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Post the Decision Deposit for a referendum."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] + #[doc = ""] + #[doc = "Emits `DecisionDepositPlaced`."] + pub struct PlaceDecisionDeposit { + pub index: place_decision_deposit::Index, + } + pub mod place_decision_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for PlaceDecisionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "place_decision_deposit"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] + #[doc = ""] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] + #[doc = ""] + #[doc = "Emits `DecisionDepositRefunded`."] + pub struct RefundDecisionDeposit { + pub index: refund_decision_deposit::Index, + } + pub mod refund_decision_deposit { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RefundDecisionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "refund_decision_deposit"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel an ongoing referendum."] + #[doc = ""] + #[doc = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Cancelled`."] + pub struct Cancel { + pub index: cancel::Index, + } + pub mod cancel { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Cancel { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "cancel"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Cancel an ongoing referendum and slash the deposits."] + #[doc = ""] + #[doc = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] + #[doc = ""] + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub struct Kill { + pub index: kill::Index, + } + pub mod kill { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Kill { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "kill"; } - } - } - } - pub mod merkle_airdrop { - use super::{root_mod, runtime_types}; - #[doc = "The `Error` enum of this pallet."] - pub type Error = runtime_types::pallet_merkle_airdrop::pallet::Error; - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub type Call = runtime_types::pallet_merkle_airdrop::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, @@ -14400,32 +12699,20 @@ 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 = "Advance a referendum onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `merkle_root` - The Merkle root hash representing all valid claims"] - #[doc = "* `vesting_period` - Optional vesting period for the airdrop"] - #[doc = "* `vesting_delay` - Optional delay before vesting starts"] - pub struct CreateAirdrop { - pub merkle_root: create_airdrop::MerkleRoot, - pub vesting_period: create_airdrop::VestingPeriod, - pub vesting_delay: create_airdrop::VestingDelay, + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub struct NudgeReferendum { + pub index: nudge_referendum::Index, } - pub mod create_airdrop { + pub mod nudge_referendum { use super::runtime_types; - pub type MerkleRoot = [::core::primitive::u8; 32usize]; - pub type VestingPeriod = ::core::option::Option<::core::primitive::u32>; - pub type VestingDelay = ::core::option::Option<::core::primitive::u32>; + pub type Index = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "create_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for NudgeReferendum { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "nudge_referendum"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14438,32 +12725,25 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Fund an existing airdrop with tokens."] - #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to fund"] - #[doc = "* `amount` - The amount of tokens to add to the airdrop"] + #[doc = "Advance a track onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[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 = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub struct OneFewerDeciding { + pub track: one_fewer_deciding::Track, } - pub mod fund_airdrop { + pub mod one_fewer_deciding { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Amount = ::core::primitive::u128; + pub type Track = ::core::primitive::u16; } - 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 OneFewerDeciding { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "one_fewer_deciding"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14476,44 +12756,23 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] - #[doc = ""] - #[doc = "Users can claim their tokens by providing a proof of their eligibility."] - #[doc = "The proof is verified against the airdrop's Merkle root."] - #[doc = "Anyone can trigger a claim for any eligible recipient."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[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 = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "* `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 = "Emits `SubmissionDepositRefunded`."] + pub struct RefundSubmissionDeposit { + pub index: refund_submission_deposit::Index, } - pub mod claim { + pub mod refund_submission_deposit { 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 Index = ::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 RefundSubmissionDeposit { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "refund_submission_deposit"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14526,167 +12785,515 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Delete an airdrop and reclaim any remaining funds."] - #[doc = ""] - #[doc = "This function allows the creator of an airdrop to delete it and reclaim"] - #[doc = "any remaining tokens that haven't been claimed."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] - #[doc = ""] - #[doc = "# Errors"] + #[doc = "Set or clear metadata of a referendum."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `NotAirdropCreator` - If the caller is not the creator of the airdrop"] - pub struct DeleteAirdrop { - pub airdrop_id: delete_airdrop::AirdropId, + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub struct SetMetadata { + pub index: set_metadata::Index, + pub maybe_hash: set_metadata::MaybeHash, } - pub mod delete_airdrop { + pub mod set_metadata { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; + pub type MaybeHash = + ::core::option::Option<::subxt::ext::subxt_core::utils::H256>; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DeleteAirdrop { - const PALLET: &'static str = "MerkleAirdrop"; - const CALL: &'static str = "delete_airdrop"; + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetMetadata { + const PALLET: &'static str = "TechReferenda"; + const CALL: &'static str = "set_metadata"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "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 = "Propose a referendum on a privileged action."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "- `origin`: must be `SubmitOrigin` and the account must have `SubmissionDeposit` funds"] + #[doc = " available."] + #[doc = "- `proposal_origin`: The origin from which the proposal should be executed."] + #[doc = "- `proposal`: The proposal."] + #[doc = "- `enactment_moment`: The moment that the proposal should be enacted."] #[doc = ""] - #[doc = "* `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 `Submitted`."] + pub fn submit( &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 - { + proposal_origin: types::submit::ProposalOrigin, + proposal: types::submit::Proposal, + enactment_moment: types::submit::EnactmentMoment, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "create_airdrop", - types::CreateAirdrop { merkle_root, vesting_period, vesting_delay }, + "TechReferenda", + "submit", + types::Submit { + proposal_origin: ::subxt::ext::subxt_core::alloc::boxed::Box::new( + proposal_origin, + ), + proposal, + enactment_moment, + }, [ - 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, + 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, + 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, + 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, ], ) } - #[doc = "Fund an existing airdrop with tokens."] - #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] + #[doc = "Post the Decision Deposit for a referendum."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "- `origin`: must be `Signed` and the account must have funds available for the"] + #[doc = " referendum's track's Decision Deposit."] + #[doc = "- `index`: The index of the submitted referendum whose Decision Deposit is yet to be"] + #[doc = " posted."] #[doc = ""] - #[doc = "* `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 = "Emits `DecisionDepositPlaced`."] + pub fn place_decision_deposit( + &self, + index: types::place_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "place_decision_deposit", + types::PlaceDecisionDeposit { index }, + [ + 247u8, 158u8, 55u8, 191u8, 188u8, 200u8, 3u8, 47u8, 20u8, 175u8, 86u8, + 203u8, 52u8, 253u8, 91u8, 131u8, 21u8, 213u8, 56u8, 68u8, 40u8, 84u8, + 184u8, 30u8, 9u8, 193u8, 63u8, 182u8, 178u8, 241u8, 247u8, 220u8, + ], + ) + } + #[doc = "Refund the Decision Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Decision Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - pub fn fund_airdrop( + #[doc = "Emits `DecisionDepositRefunded`."] + pub fn refund_decision_deposit( &self, - airdrop_id: types::fund_airdrop::AirdropId, - amount: types::fund_airdrop::Amount, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + index: types::refund_decision_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundDecisionDeposit, + > { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "fund_airdrop", - types::FundAirdrop { airdrop_id, amount }, + "TechReferenda", + "refund_decision_deposit", + types::RefundDecisionDeposit { index }, [ - 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, + 159u8, 19u8, 35u8, 216u8, 114u8, 105u8, 18u8, 42u8, 148u8, 151u8, + 136u8, 92u8, 117u8, 30u8, 29u8, 41u8, 238u8, 58u8, 195u8, 91u8, 115u8, + 135u8, 96u8, 99u8, 154u8, 233u8, 8u8, 249u8, 145u8, 165u8, 77u8, 164u8, ], ) } - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] + #[doc = "Cancel an ongoing referendum."] #[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 = "- `origin`: must be the `CancelOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Emits `Cancelled`."] + pub fn cancel( + &self, + index: types::cancel::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "cancel", + types::Cancel { index }, + [ + 55u8, 206u8, 119u8, 156u8, 238u8, 165u8, 193u8, 73u8, 242u8, 13u8, + 212u8, 75u8, 136u8, 156u8, 151u8, 14u8, 35u8, 41u8, 156u8, 107u8, 60u8, + 190u8, 39u8, 216u8, 8u8, 74u8, 213u8, 130u8, 160u8, 131u8, 237u8, + 122u8, + ], + ) + } + #[doc = "Cancel an ongoing referendum and slash the deposits."] #[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 = "- `origin`: must be the `KillOrigin`."] + #[doc = "- `index`: The index of the referendum to be cancelled."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Emits `Killed` and `DepositSlashed`."] + pub fn kill( + &self, + index: types::kill::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "kill", + types::Kill { index }, + [ + 50u8, 89u8, 57u8, 0u8, 87u8, 129u8, 113u8, 140u8, 179u8, 178u8, 126u8, + 198u8, 92u8, 92u8, 189u8, 64u8, 123u8, 232u8, 57u8, 227u8, 223u8, + 219u8, 73u8, 217u8, 179u8, 44u8, 210u8, 125u8, 180u8, 10u8, 143u8, + 48u8, + ], + ) + } + #[doc = "Advance a referendum onto its next logical state. Only used internally."] #[doc = ""] - #[doc = "* `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 = "- `origin`: must be `Root`."] + #[doc = "- `index`: the referendum to be advanced."] + pub fn nudge_referendum( &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 { + index: types::nudge_referendum::Index, + ) -> ::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 }, + "TechReferenda", + "nudge_referendum", + types::NudgeReferendum { index }, [ - 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, + 75u8, 99u8, 172u8, 30u8, 170u8, 150u8, 211u8, 229u8, 249u8, 128u8, + 194u8, 246u8, 100u8, 142u8, 193u8, 184u8, 232u8, 81u8, 29u8, 17u8, + 99u8, 91u8, 236u8, 85u8, 230u8, 226u8, 57u8, 115u8, 45u8, 170u8, 54u8, + 213u8, ], ) } - #[doc = "Delete an airdrop and reclaim any remaining funds."] + #[doc = "Advance a track onto its next logical state. Only used internally."] #[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 = "- `origin`: must be `Root`."] + #[doc = "- `track`: the track to be advanced."] #[doc = ""] - #[doc = "# Parameters"] + #[doc = "Action item for when there is now one fewer referendum in the deciding phase and the"] + #[doc = "`DecidingCount` is not yet updated. This means that we should either:"] + #[doc = "- begin deciding another referendum (and leave `DecidingCount` alone); or"] + #[doc = "- decrement `DecidingCount`."] + pub fn one_fewer_deciding( + &self, + track: types::one_fewer_deciding::Track, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "one_fewer_deciding", + types::OneFewerDeciding { track }, + [ + 15u8, 84u8, 79u8, 231u8, 21u8, 239u8, 244u8, 143u8, 183u8, 215u8, + 181u8, 25u8, 225u8, 195u8, 95u8, 171u8, 17u8, 156u8, 182u8, 128u8, + 111u8, 40u8, 151u8, 102u8, 196u8, 55u8, 36u8, 212u8, 89u8, 190u8, + 131u8, 167u8, + ], + ) + } + #[doc = "Refund the Submission Deposit for a closed referendum back to the depositor."] #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] + #[doc = "- `origin`: must be `Signed` or `Root`."] + #[doc = "- `index`: The index of a closed referendum whose Submission Deposit has not yet been"] + #[doc = " refunded."] #[doc = ""] - #[doc = "# Errors"] + #[doc = "Emits `SubmissionDepositRefunded`."] + pub fn refund_submission_deposit( + &self, + index: types::refund_submission_deposit::Index, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload< + types::RefundSubmissionDeposit, + > { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "TechReferenda", + "refund_submission_deposit", + types::RefundSubmissionDeposit { index }, + [ + 20u8, 217u8, 115u8, 6u8, 1u8, 60u8, 54u8, 136u8, 35u8, 41u8, 38u8, + 23u8, 85u8, 100u8, 141u8, 126u8, 30u8, 160u8, 61u8, 46u8, 134u8, 98u8, + 82u8, 38u8, 211u8, 124u8, 208u8, 222u8, 210u8, 10u8, 155u8, 122u8, + ], + ) + } + #[doc = "Set or clear metadata of a referendum."] #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - #[doc = "* `NotAirdropCreator` - If the caller is not the creator of the airdrop"] - pub fn delete_airdrop( + #[doc = "Parameters:"] + #[doc = "- `origin`: Must be `Signed` by a creator of a referendum or by anyone to clear a"] + #[doc = " metadata of a finished referendum."] + #[doc = "- `index`: The index of a referendum to set or clear metadata for."] + #[doc = "- `maybe_hash`: The hash of an on-chain stored preimage. `None` to clear a metadata."] + pub fn set_metadata( &self, - airdrop_id: types::delete_airdrop::AirdropId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload - { + index: types::set_metadata::Index, + maybe_hash: types::set_metadata::MaybeHash, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "MerkleAirdrop", - "delete_airdrop", - types::DeleteAirdrop { airdrop_id }, + "TechReferenda", + "set_metadata", + types::SetMetadata { index, maybe_hash }, [ - 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, + 207u8, 29u8, 146u8, 233u8, 219u8, 205u8, 88u8, 118u8, 106u8, 61u8, + 124u8, 101u8, 2u8, 41u8, 169u8, 70u8, 114u8, 189u8, 162u8, 118u8, 1u8, + 108u8, 234u8, 98u8, 245u8, 245u8, 183u8, 126u8, 89u8, 13u8, 112u8, + 88u8, ], ) } } - } - #[doc = "The `Event` enum of this pallet"] - pub type Event = runtime_types::pallet_merkle_airdrop::pallet::Event; - pub mod events { - use super::runtime_types; + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_referenda::pallet::Event2; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been submitted."] + pub struct Submitted { + pub index: submitted::Index, + pub track: submitted::Track, + pub proposal: submitted::Proposal, + } + pub mod submitted { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Submitted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Submitted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The decision deposit has been placed."] + pub struct DecisionDepositPlaced { + pub index: decision_deposit_placed::Index, + pub who: decision_deposit_placed::Who, + pub amount: decision_deposit_placed::Amount, + } + pub mod decision_deposit_placed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositPlaced { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionDepositPlaced"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "The decision deposit has been refunded."] + pub struct DecisionDepositRefunded { + pub index: decision_deposit_refunded::Index, + pub who: decision_deposit_refunded::Who, + pub amount: decision_deposit_refunded::Amount, + } + pub mod decision_deposit_refunded { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionDepositRefunded { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionDepositRefunded"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A deposit has been slashed."] + pub struct DepositSlashed { + pub who: deposit_slashed::Who, + pub amount: deposit_slashed::Amount, + } + pub mod deposit_slashed { + use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositSlashed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DepositSlashed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has moved into the deciding phase."] + pub struct DecisionStarted { + pub index: decision_started::Index, + pub track: decision_started::Track, + pub proposal: decision_started::Proposal, + pub tally: decision_started::Tally, + } + pub mod decision_started { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Track = ::core::primitive::u16; + pub type Proposal = runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DecisionStarted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "DecisionStarted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct ConfirmStarted { + pub index: confirm_started::Index, + } + pub mod confirm_started { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmStarted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "ConfirmStarted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct ConfirmAborted { + pub index: confirm_aborted::Index, + } + pub mod confirm_aborted { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ConfirmAborted { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "ConfirmAborted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has ended its confirmation phase and is ready for approval."] + pub struct Confirmed { + pub index: confirmed::Index, + pub tally: confirmed::Tally, + } + pub mod confirmed { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Confirmed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Confirmed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been approved and its proposal has been scheduled."] + pub struct Approved { + pub index: approved::Index, + } + pub mod approved { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Approved { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Approved"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A proposal has been rejected by referendum."] + pub struct Rejected { + pub index: rejected::Index, + pub tally: rejected::Tally, + } + pub mod rejected { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Rejected { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Rejected"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been timed out without being decided."] + pub struct TimedOut { + pub index: timed_out::Index, + pub tally: timed_out::Tally, + } + pub mod timed_out { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for TimedOut { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "TimedOut"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "A referendum has been cancelled."] + pub struct Cancelled { + pub index: cancelled::Index, + pub tally: cancelled::Tally, + } + pub mod cancelled { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Cancelled { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Cancelled"; + } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -14694,25 +13301,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 new airdrop has been created."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, merkle_root]"] - pub struct AirdropCreated { - pub airdrop_id: airdrop_created::AirdropId, - pub airdrop_metadata: airdrop_created::AirdropMetadata, - } - pub mod airdrop_created { + #[doc = "A referendum has been killed."] + pub struct Killed { + pub index: killed::Index, + pub tally: killed::Tally, + } + pub mod killed { 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 Index = ::core::primitive::u32; + pub type Tally = runtime_types::pallet_ranked_collective::Tally; } - 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 Killed { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "Killed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14721,21 +13322,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 = "The submission deposit has been refunded."] + pub struct SubmissionDepositRefunded { + pub index: submission_deposit_refunded::Index, + pub who: submission_deposit_refunded::Who, + pub amount: submission_deposit_refunded::Amount, + } + pub mod submission_deposit_refunded { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AirdropFunded { - const PALLET: &'static str = "MerkleAirdrop"; - const EVENT: &'static str = "AirdropFunded"; + impl ::subxt::ext::subxt_core::events::StaticEvent for SubmissionDepositRefunded { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "SubmissionDepositRefunded"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14744,23 +13345,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 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 = "Metadata for a referendum has been set."] + pub struct MetadataSet { + pub index: metadata_set::Index, + pub hash: metadata_set::Hash, + } + pub mod metadata_set { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - 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 MetadataSet { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "MetadataSet"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14769,192 +13366,296 @@ 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 = "Metadata for a referendum has been cleared."] + pub struct MetadataCleared { + pub index: metadata_cleared::Index, + pub hash: metadata_cleared::Hash, } - pub mod airdrop_deleted { + pub mod metadata_cleared { use super::runtime_types; - pub type AirdropId = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; + pub type Hash = ::subxt::ext::subxt_core::utils::H256; } - 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 MetadataCleared { + const PALLET: &'static str = "TechReferenda"; + const EVENT: &'static str = "MetadataCleared"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod airdrop_info { + pub mod referendum_count { 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 type ReferendumCount = ::core::primitive::u32; } - pub mod claimed { + pub mod referendum_info_for { use super::runtime_types; - pub type Claimed = (); + pub type ReferendumInfoFor = + runtime_types::pallet_referenda::types::ReferendumInfo< + ::core::primitive::u16, + runtime_types::quantus_runtime::OriginCaller, + ::core::primitive::u32, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::quantus_runtime::RuntimeCall, + runtime_types::qp_poseidon::PoseidonHasher, + >, + ::core::primitive::u128, + runtime_types::pallet_ranked_collective::Tally, + ::subxt::ext::subxt_core::utils::AccountId32, + ( + runtime_types::qp_scheduler::BlockNumberOrTimestamp< + ::core::primitive::u32, + ::core::primitive::u64, + >, + ::core::primitive::u32, + ), + >; pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod next_airdrop_id { + pub mod track_queue { + use super::runtime_types; + pub type TrackQueue = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u32, + ::core::primitive::u32, + )>; + pub type Param0 = ::core::primitive::u16; + } + pub mod deciding_count { + use super::runtime_types; + pub type DecidingCount = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u16; + } + pub mod metadata_of { use super::runtime_types; - pub type NextAirdropId = ::core::primitive::u32; + pub type MetadataOf = ::subxt::ext::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; } } pub struct StorageApi; impl StorageApi { - #[doc = " Stores general info about an airdrop"] - pub fn airdrop_info_iter( + #[doc = " The next free referendum index, aka the number of referenda started so far."] + pub fn referendum_count( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::referendum_count::ReferendumCount, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "ReferendumCount", + (), + [ + 64u8, 145u8, 232u8, 153u8, 121u8, 87u8, 128u8, 253u8, 170u8, 192u8, + 139u8, 18u8, 0u8, 33u8, 243u8, 11u8, 238u8, 222u8, 244u8, 5u8, 247u8, + 198u8, 149u8, 31u8, 122u8, 208u8, 86u8, 179u8, 166u8, 167u8, 93u8, + 67u8, + ], + ) + } + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::airdrop_info::AirdropInfo, + types::referendum_info_for::ReferendumInfoFor, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "AirdropInfo", + "TechReferenda", + "ReferendumInfoFor", (), [ - 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, + 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, + 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, + 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, ], ) } - #[doc = " Stores general info about an airdrop"] - pub fn airdrop_info( + #[doc = " Information concerning any given referendum."] + pub fn referendum_info_for( &self, - _0: types::airdrop_info::Param0, + _0: types::referendum_info_for::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::airdrop_info::Param0, + types::referendum_info_for::Param0, >, - types::airdrop_info::AirdropInfo, + types::referendum_info_for::ReferendumInfoFor, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "AirdropInfo", + "TechReferenda", + "ReferendumInfoFor", ::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, + 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, + 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, + 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, ], ) } - #[doc = " Storage for claimed status"] - pub fn claimed_iter( + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] + #[doc = ""] + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::claimed::Claimed, + types::track_queue::TrackQueue, (), ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", + "TechReferenda", + "TrackQueue", (), [ - 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, + 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, + 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, + 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, + 186u8, 65u8, ], ) } - #[doc = " Storage for claimed status"] - pub fn claimed_iter1( + #[doc = " The sorted list of referenda ready to be decided but not yet being decided, ordered by"] + #[doc = " conviction-weighted approvals."] + #[doc = ""] + #[doc = " This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`."] + pub fn track_queue( &self, - _0: types::claimed::Param0, + _0: types::track_queue::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::claimed::Param0, + types::track_queue::Param0, >, - types::claimed::Claimed, - (), + types::track_queue::TrackQueue, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "Claimed", + "TechReferenda", + "TrackQueue", ::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, + 187u8, 113u8, 225u8, 99u8, 159u8, 207u8, 182u8, 41u8, 116u8, 136u8, + 119u8, 196u8, 152u8, 50u8, 192u8, 22u8, 171u8, 182u8, 237u8, 228u8, + 80u8, 255u8, 227u8, 141u8, 155u8, 83u8, 71u8, 131u8, 118u8, 109u8, + 186u8, 65u8, ], ) } - #[doc = " Storage for claimed status"] - pub fn claimed( + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count_iter( &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, + (), + types::deciding_count::DecidingCount, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "DecidingCount", + (), + [ + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, + ], + ) + } + #[doc = " The number of referenda being decided currently."] + pub fn deciding_count( + &self, + _0: types::deciding_count::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::deciding_count::Param0, + >, + types::deciding_count::DecidingCount, ::subxt::ext::subxt_core::utils::Yes, ::subxt::ext::subxt_core::utils::Yes, (), > { ::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), - ), + "TechReferenda", + "DecidingCount", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 203u8, 89u8, 158u8, 179u8, 194u8, 82u8, 248u8, 162u8, 93u8, 140u8, + 146u8, 51u8, 110u8, 232u8, 51u8, 1u8, 128u8, 212u8, 199u8, 14u8, 182u8, + 103u8, 47u8, 252u8, 126u8, 108u8, 166u8, 69u8, 252u8, 179u8, 126u8, + 245u8, + ], + ) + } + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] + #[doc = ""] + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::metadata_of::MetadataOf, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "TechReferenda", + "MetadataOf", + (), [ - 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, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } - #[doc = " Counter for airdrop IDs"] - pub fn next_airdrop_id( + #[doc = " The metadata is a general information concerning the referendum."] + #[doc = " The `Hash` refers to the preimage of the `Preimages` provider which can be a JSON"] + #[doc = " dump or IPFS hash of a JSON file."] + #[doc = ""] + #[doc = " Consider a garbage collection for a metadata of finished referendums to `unrequest` (remove)"] + #[doc = " large preimages."] + pub fn metadata_of( &self, + _0: types::metadata_of::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_airdrop_id::NextAirdropId, - ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::metadata_of::Param0, + >, + types::metadata_of::MetadataOf, ::subxt::ext::subxt_core::utils::Yes, (), + (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "MerkleAirdrop", - "NextAirdropId", - (), + "TechReferenda", + "MetadataOf", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 79u8, 145u8, 145u8, 158u8, 86u8, 58u8, 102u8, 216u8, 133u8, 34u8, - 252u8, 224u8, 222u8, 51u8, 170u8, 3u8, 135u8, 29u8, 99u8, 143u8, 93u8, - 176u8, 69u8, 231u8, 74u8, 214u8, 94u8, 126u8, 227u8, 166u8, 242u8, - 98u8, + 159u8, 250u8, 56u8, 189u8, 247u8, 165u8, 206u8, 166u8, 91u8, 139u8, + 124u8, 164u8, 25u8, 246u8, 199u8, 36u8, 159u8, 56u8, 227u8, 136u8, 4u8, + 45u8, 193u8, 72u8, 200u8, 164u8, 39u8, 207u8, 224u8, 124u8, 191u8, + 110u8, ], ) } @@ -14964,15 +13665,31 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " The maximum number of proof elements allowed in a Merkle proof."] - pub fn max_proofs( + #[doc = " The minimum amount to be used as a deposit for a public referendum proposal."] + pub fn submission_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "SubmissionDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " Maximum size of the referendum queue for a single track."] + pub fn max_queued( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "MaxProofs", + "TechReferenda", + "MaxQueued", [ 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, @@ -14981,36 +13698,66 @@ pub mod api { ], ) } - #[doc = " The pallet id, used for deriving its sovereign account ID."] - pub fn pallet_id( + #[doc = " The number of blocks after submission that a referendum must begin being decided by."] + #[doc = " Once this passes, then anyone may cancel the referendum."] + pub fn undeciding_timeout( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "PalletId", + "TechReferenda", + "UndecidingTimeout", [ - 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, + 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 = " Priority for unsigned claim transactions."] - pub fn unsigned_claim_priority( + #[doc = " Quantization level for the referendum wakeup scheduler. A higher number will result in"] + #[doc = " fewer storage reads/writes needed for smaller voters, but also result in delays to the"] + #[doc = " automatic referendum status changes. Explicit servicing instructions are unaffected."] + pub fn alarm_interval( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u64, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MerkleAirdrop", - "UnsignedClaimPriority", + "TechReferenda", + "AlarmInterval", [ - 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, - 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, - 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, - 246u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " A list of tracks."] + #[doc = ""] + #[doc = " Note: if the tracks are dynamic, the value in the static metadata might be inaccurate."] + pub fn tracks( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::subxt::ext::subxt_core::alloc::vec::Vec<( + ::core::primitive::u16, + runtime_types::pallet_referenda::types::TrackDetails< + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::subxt_core::alloc::string::String, + >, + )>, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "TechReferenda", + "Tracks", + [ + 35u8, 226u8, 207u8, 234u8, 184u8, 139u8, 187u8, 184u8, 128u8, 199u8, + 227u8, 15u8, 31u8, 196u8, 5u8, 207u8, 138u8, 174u8, 130u8, 201u8, + 200u8, 113u8, 86u8, 93u8, 221u8, 243u8, 229u8, 24u8, 18u8, 150u8, 56u8, + 159u8, ], ) } @@ -16571,10 +15318,9 @@ pub mod api { 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, + 93u8, 43u8, 222u8, 117u8, 210u8, 66u8, 22u8, 189u8, 131u8, 103u8, + 143u8, 248u8, 204u8, 35u8, 51u8, 12u8, 218u8, 193u8, 15u8, 152u8, 2u8, + 224u8, 7u8, 28u8, 80u8, 94u8, 14u8, 18u8, 147u8, 138u8, 124u8, 171u8, ], ) } @@ -19758,11 +18504,172 @@ pub mod api { ) } } - } - #[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, @@ -19770,21 +18677,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 class was created."] - pub struct Created { - pub asset_id: created::AssetId, - pub creator: created::Creator, - pub owner: created::Owner, + #[doc = "Some account `who` was thawed."] + pub struct Thawed { + pub asset_id: thawed::AssetId, + pub who: thawed::Who, } - pub mod created { + pub mod thawed { 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 Who = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Created { + impl ::subxt::ext::subxt_core::events::StaticEvent for Thawed { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Created"; + const EVENT: &'static str = "Thawed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19793,21 +18698,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some assets were issued."] - pub struct Issued { - pub asset_id: issued::AssetId, - pub owner: issued::Owner, - pub amount: issued::Amount, + #[doc = "Some asset `asset_id` was frozen."] + pub struct AssetFrozen { + pub asset_id: asset_frozen::AssetId, } - pub mod issued { + pub mod asset_frozen { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Issued { + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetFrozen { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Issued"; + const EVENT: &'static str = "AssetFrozen"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19816,23 +18717,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some assets were transferred."] - pub struct Transferred { - pub asset_id: transferred::AssetId, - pub from: transferred::From, - pub to: transferred::To, - pub amount: transferred::Amount, + #[doc = "Some asset `asset_id` was thawed."] + pub struct AssetThawed { + pub asset_id: asset_thawed::AssetId, } - pub mod transferred { + pub mod asset_thawed { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type From = ::subxt::ext::subxt_core::utils::AccountId32; - pub type To = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Transferred { + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetThawed { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Transferred"; + const EVENT: &'static str = "AssetThawed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19841,21 +18736,103 @@ 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 = "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 burned { + pub mod accounts_destroyed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type AccountsDestroyed = ::core::primitive::u32; + pub type AccountsRemaining = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for AccountsDestroyed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AccountsDestroyed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Approvals were destroyed for given asset."] + pub struct ApprovalsDestroyed { + pub asset_id: approvals_destroyed::AssetId, + pub approvals_destroyed: approvals_destroyed::ApprovalsDestroyed, + pub approvals_remaining: approvals_destroyed::ApprovalsRemaining, + } + pub mod approvals_destroyed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + pub type ApprovalsDestroyed = ::core::primitive::u32; + pub type ApprovalsRemaining = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovalsDestroyed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ApprovalsDestroyed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "An asset class is in the process of being destroyed."] + pub struct DestructionStarted { + pub asset_id: destruction_started::AssetId, + } + pub mod destruction_started { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for DestructionStarted { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "DestructionStarted"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "An asset class was destroyed."] + pub struct Destroyed { + pub asset_id: destroyed::AssetId, + } + pub mod destroyed { + use super::runtime_types; + pub type AssetId = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Destroyed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Destroyed"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + #[doc = "Some asset class was force-created."] + pub struct ForceCreated { + pub asset_id: force_created::AssetId, + pub owner: force_created::Owner, + } + pub mod force_created { use super::runtime_types; pub type AssetId = ::core::primitive::u32; pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Balance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { + impl ::subxt::ext::subxt_core::events::StaticEvent for ForceCreated { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Burned"; + const EVENT: &'static str = "ForceCreated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19864,23 +18841,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 = "The management team changed."] - pub struct TeamChanged { - pub asset_id: team_changed::AssetId, - pub issuer: team_changed::Issuer, - pub admin: team_changed::Admin, - pub freezer: team_changed::Freezer, + #[doc = "New metadata has been set for an asset."] + pub struct MetadataSet { + pub asset_id: metadata_set::AssetId, + pub name: metadata_set::Name, + pub symbol: metadata_set::Symbol, + pub decimals: metadata_set::Decimals, + pub is_frozen: metadata_set::IsFrozen, } - pub mod team_changed { + pub mod metadata_set { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Issuer = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Admin = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Freezer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Name = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Symbol = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Decimals = ::core::primitive::u8; + pub type IsFrozen = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for TeamChanged { + impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "TeamChanged"; + const EVENT: &'static str = "MetadataSet"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19889,19 +18868,65 @@ 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 = "Metadata has been cleared for an asset."] + pub struct MetadataCleared { + pub asset_id: metadata_cleared::AssetId, } - pub mod owner_changed { + 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 ApprovedTransfer { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ApprovedTransfer"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_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 { use super::runtime_types; pub type AssetId = ::core::primitive::u32; pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for OwnerChanged { + impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovalCancelled { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "OwnerChanged"; + const EVENT: &'static str = "ApprovalCancelled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19910,19 +18935,26 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some account `who` was frozen."] - pub struct Frozen { - pub asset_id: frozen::AssetId, - pub who: frozen::Who, + #[doc = "An `amount` was transferred in its entirety from `owner` to `destination` by"] + #[doc = "the approved `delegate`."] + pub struct TransferredApproved { + pub asset_id: transferred_approved::AssetId, + pub owner: transferred_approved::Owner, + pub delegate: transferred_approved::Delegate, + pub destination: transferred_approved::Destination, + pub amount: transferred_approved::Amount, } - pub mod frozen { + pub mod transferred_approved { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Destination = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Frozen { + impl ::subxt::ext::subxt_core::events::StaticEvent for TransferredApproved { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Frozen"; + const EVENT: &'static str = "TransferredApproved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19931,19 +18963,17 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some account `who` was thawed."] - pub struct Thawed { - pub asset_id: thawed::AssetId, - pub who: thawed::Who, + #[doc = "An asset has had its attributes changed by the `Force` origin."] + pub struct AssetStatusChanged { + pub asset_id: asset_status_changed::AssetId, } - pub mod thawed { + pub mod asset_status_changed { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Thawed { + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetStatusChanged { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Thawed"; + const EVENT: &'static str = "AssetStatusChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19952,17 +18982,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some asset `asset_id` was frozen."] - pub struct AssetFrozen { - pub asset_id: asset_frozen::AssetId, + #[doc = "The min_balance of an asset has been updated by the asset owner."] + pub struct AssetMinBalanceChanged { + pub asset_id: asset_min_balance_changed::AssetId, + pub new_min_balance: asset_min_balance_changed::NewMinBalance, } - pub mod asset_frozen { + pub mod asset_min_balance_changed { use super::runtime_types; pub type AssetId = ::core::primitive::u32; + pub type NewMinBalance = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetFrozen { + impl ::subxt::ext::subxt_core::events::StaticEvent for AssetMinBalanceChanged { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetFrozen"; + const EVENT: &'static str = "AssetMinBalanceChanged"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19971,17 +19003,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some asset `asset_id` was thawed."] - pub struct AssetThawed { - pub asset_id: asset_thawed::AssetId, + #[doc = "Some account `who` was created with a deposit from `depositor`."] + pub struct Touched { + pub asset_id: touched::AssetId, + pub who: touched::Who, + pub depositor: touched::Depositor, } - pub mod asset_thawed { + pub mod touched { use super::runtime_types; pub type AssetId = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Depositor = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetThawed { + impl ::subxt::ext::subxt_core::events::StaticEvent for Touched { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetThawed"; + const EVENT: &'static str = "Touched"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -19990,21 +19026,19 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Accounts were destroyed for given asset."] - pub struct AccountsDestroyed { - pub asset_id: accounts_destroyed::AssetId, - pub accounts_destroyed: accounts_destroyed::AccountsDestroyed, - pub accounts_remaining: accounts_destroyed::AccountsRemaining, + #[doc = "Some account `who` was blocked."] + pub struct Blocked { + pub asset_id: blocked::AssetId, + pub who: blocked::Who, } - pub mod accounts_destroyed { + pub mod blocked { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type AccountsDestroyed = ::core::primitive::u32; - pub type AccountsRemaining = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AccountsDestroyed { + impl ::subxt::ext::subxt_core::events::StaticEvent for Blocked { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AccountsDestroyed"; + const EVENT: &'static str = "Blocked"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20013,21 +19047,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Approvals were destroyed for given asset."] - pub struct ApprovalsDestroyed { - pub asset_id: approvals_destroyed::AssetId, - pub approvals_destroyed: approvals_destroyed::ApprovalsDestroyed, - pub approvals_remaining: approvals_destroyed::ApprovalsRemaining, + #[doc = "Some assets were deposited (e.g. for transaction fees)."] + pub struct Deposited { + pub asset_id: deposited::AssetId, + pub who: deposited::Who, + pub amount: deposited::Amount, } - pub mod approvals_destroyed { + pub mod deposited { use super::runtime_types; pub type AssetId = ::core::primitive::u32; - pub type ApprovalsDestroyed = ::core::primitive::u32; - pub type ApprovalsRemaining = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovalsDestroyed { + impl ::subxt::ext::subxt_core::events::StaticEvent for Deposited { const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovalsDestroyed"; + const EVENT: &'static str = "Deposited"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20036,18 +19070,530 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An asset class is in the process of being destroyed."] - pub struct DestructionStarted { - pub asset_id: destruction_started::AssetId, + #[doc = "Some assets were withdrawn from the account (e.g. for transaction fees)."] + pub struct Withdrawn { + pub asset_id: withdrawn::AssetId, + pub who: withdrawn::Who, + pub amount: withdrawn::Amount, } - pub mod destruction_started { + pub mod withdrawn { use super::runtime_types; pub type AssetId = ::core::primitive::u32; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt::ext::subxt_core::events::StaticEvent for Withdrawn { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Withdrawn"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod asset { + use super::runtime_types; + pub type Asset = runtime_types::pallet_assets::types::AssetDetails< + ::core::primitive::u128, + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >; + pub type Param0 = ::core::primitive::u32; + } + pub mod account { + use super::runtime_types; + pub type Account = runtime_types::pallet_assets::types::AssetAccount< + ::core::primitive::u128, + ::core::primitive::u128, + (), + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod approvals { + use super::runtime_types; + pub type Approvals = runtime_types::pallet_assets::types::Approval< + ::core::primitive::u128, + ::core::primitive::u128, + >; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param2 = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod metadata { + use super::runtime_types; + pub type Metadata = runtime_types::pallet_assets::types::AssetMetadata< + ::core::primitive::u128, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >; + pub type Param0 = ::core::primitive::u32; + } + pub mod next_asset_id { + use super::runtime_types; + pub type NextAssetId = ::core::primitive::u32; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Details of an asset."] + pub fn asset_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::asset::Asset, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Asset", + (), + [ + 159u8, 234u8, 177u8, 31u8, 58u8, 51u8, 173u8, 184u8, 250u8, 169u8, + 246u8, 122u8, 54u8, 19u8, 232u8, 60u8, 0u8, 165u8, 12u8, 101u8, 93u8, + 169u8, 23u8, 34u8, 154u8, 44u8, 134u8, 128u8, 97u8, 71u8, 167u8, 224u8, + ], + ) + } + #[doc = " Details of an asset."] + pub fn asset( + &self, + _0: types::asset::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::asset::Param0, + >, + types::asset::Asset, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Asset", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 159u8, 234u8, 177u8, 31u8, 58u8, 51u8, 173u8, 184u8, 250u8, 169u8, + 246u8, 122u8, 54u8, 19u8, 232u8, 60u8, 0u8, 165u8, 12u8, 101u8, 93u8, + 169u8, 23u8, 34u8, 154u8, 44u8, 134u8, 128u8, 97u8, 71u8, 167u8, 224u8, + ], + ) + } + #[doc = " The holdings of a specific account for a specific asset."] + pub fn account_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::account::Account, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Account", + (), + [ + 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, + 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, + 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + ], + ) + } + #[doc = " The holdings of a specific account for a specific asset."] + pub fn account_iter1( + &self, + _0: types::account::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::account::Param0, + >, + types::account::Account, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Account", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, + 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, + 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + ], + ) + } + #[doc = " The holdings of a specific account for a specific asset."] + pub fn account( + &self, + _0: types::account::Param0, + _1: types::account::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::account::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::account::Param1, + >, + ), + types::account::Account, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Account", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 188u8, 242u8, 133u8, 64u8, 0u8, 11u8, 57u8, 146u8, 60u8, 137u8, 35u8, + 23u8, 183u8, 200u8, 242u8, 8u8, 94u8, 158u8, 218u8, 13u8, 104u8, 215u8, + 87u8, 86u8, 69u8, 200u8, 11u8, 51u8, 6u8, 65u8, 216u8, 102u8, + ], + ) + } + #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] + #[doc = " is the amount of `T::Currency` reserved for storing this."] + #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] + pub fn approvals_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::approvals::Approvals, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Approvals", + (), + [ + 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, + 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, + 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + ], + ) + } + #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] + #[doc = " is the amount of `T::Currency` reserved for storing this."] + #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] + pub fn approvals_iter1( + &self, + _0: types::approvals::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param0, + >, + types::approvals::Approvals, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Approvals", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, + 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, + 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + ], + ) + } + #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] + #[doc = " is the amount of `T::Currency` reserved for storing this."] + #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] + pub fn approvals_iter2( + &self, + _0: types::approvals::Param0, + _1: types::approvals::Param1, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param1, + >, + ), + types::approvals::Approvals, + (), + (), + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Approvals", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, + 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, + 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + ], + ) + } + #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] + #[doc = " is the amount of `T::Currency` reserved for storing this."] + #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] + pub fn approvals( + &self, + _0: types::approvals::Param0, + _1: types::approvals::Param1, + _2: types::approvals::Param2, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param1, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::approvals::Param2, + >, + ), + types::approvals::Approvals, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Approvals", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_2), + ), + [ + 122u8, 92u8, 51u8, 45u8, 200u8, 200u8, 182u8, 208u8, 18u8, 47u8, 139u8, + 68u8, 254u8, 15u8, 152u8, 110u8, 3u8, 138u8, 13u8, 183u8, 5u8, 185u8, + 218u8, 44u8, 93u8, 28u8, 56u8, 189u8, 125u8, 127u8, 123u8, 8u8, + ], + ) + } + #[doc = " Metadata of an asset."] + pub fn metadata_iter( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::metadata::Metadata, + (), + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Metadata", + (), + [ + 129u8, 202u8, 244u8, 77u8, 55u8, 81u8, 86u8, 106u8, 20u8, 153u8, 209u8, + 69u8, 199u8, 107u8, 111u8, 49u8, 88u8, 157u8, 84u8, 41u8, 198u8, 190u8, + 234u8, 218u8, 68u8, 207u8, 87u8, 217u8, 73u8, 66u8, 211u8, 163u8, + ], + ) + } + #[doc = " Metadata of an asset."] + pub fn metadata( + &self, + _0: types::metadata::Param0, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::metadata::Param0, + >, + types::metadata::Metadata, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "Metadata", + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 129u8, 202u8, 244u8, 77u8, 55u8, 81u8, 86u8, 106u8, 20u8, 153u8, 209u8, + 69u8, 199u8, 107u8, 111u8, 49u8, 88u8, 157u8, 84u8, 41u8, 198u8, 190u8, + 234u8, 218u8, 68u8, 207u8, 87u8, 217u8, 73u8, 66u8, 211u8, 163u8, + ], + ) + } + #[doc = " The asset ID enforced for the next asset creation, if any present. Otherwise, this storage"] + #[doc = " item has no effect."] + #[doc = ""] + #[doc = " This can be useful for setting up constraints for IDs of the new assets. For example, by"] + #[doc = " providing an initial [`NextAssetId`] and using the [`crate::AutoIncAssetId`] callback, an"] + #[doc = " auto-increment model can be applied to all new asset IDs."] + #[doc = ""] + #[doc = " The initial next asset ID can be set using the [`GenesisConfig`] or the"] + #[doc = " [SetNextAssetId](`migration::next_asset_id::SetNextAssetId`) migration."] + pub fn next_asset_id( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::next_asset_id::NextAssetId, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), + > { + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( + "Assets", + "NextAssetId", + (), + [ + 15u8, 61u8, 40u8, 217u8, 236u8, 34u8, 95u8, 53u8, 159u8, 182u8, 70u8, + 251u8, 234u8, 188u8, 115u8, 23u8, 199u8, 118u8, 220u8, 40u8, 147u8, + 174u8, 247u8, 129u8, 246u8, 107u8, 178u8, 43u8, 8u8, 19u8, 74u8, 116u8, + ], + ) + } } - impl ::subxt::ext::subxt_core::events::StaticEvent for DestructionStarted { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "DestructionStarted"; + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Max number of items to destroy per `destroy_accounts` and `destroy_approvals` call."] + #[doc = ""] + #[doc = " Must be configured to result in a weight that makes each call fit in a block."] + pub fn remove_items_limit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "RemoveItemsLimit", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The basic amount of funds that must be reserved for an asset."] + pub fn asset_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "AssetDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The amount of funds that must be reserved for a non-provider asset account to be"] + #[doc = " maintained."] + pub fn asset_account_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "AssetAccountDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The basic amount of funds that must be reserved when adding metadata to your asset."] + pub fn metadata_deposit_base( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "MetadataDepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The additional funds that must be reserved for the number of bytes you store in your"] + #[doc = " metadata."] + pub fn metadata_deposit_per_byte( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "MetadataDepositPerByte", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The amount of funds that must be reserved when creating a new approval."] + pub fn approval_deposit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "ApprovalDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The maximum length of a name or symbol stored on-chain."] + pub fn string_limit( + &self, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, + > { + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Assets", + "StringLimit", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } } + } + } + pub mod assets_holder { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_assets_holder::pallet::Error; + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_assets_holder::pallet::Event; + pub mod events { + use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -20055,17 +19601,23 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An asset class was destroyed."] - pub struct Destroyed { - pub asset_id: destroyed::AssetId, + #[doc = "`who`s balance on hold was increased by `amount`."] + pub struct Held { + pub who: held::Who, + pub asset_id: held::AssetId, + pub reason: held::Reason, + pub amount: held::Amount, } - pub mod destroyed { + pub mod held { use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; pub type AssetId = ::core::primitive::u32; + pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Destroyed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Destroyed"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Held { + const PALLET: &'static str = "AssetsHolder"; + const EVENT: &'static str = "Held"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20074,19 +19626,23 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some asset class was force-created."] - pub struct ForceCreated { - pub asset_id: force_created::AssetId, - pub owner: force_created::Owner, + #[doc = "`who`s balance on hold was decreased by `amount`."] + pub struct Released { + pub who: released::Who, + pub asset_id: released::AssetId, + pub reason: released::Reason, + pub amount: released::Amount, } - pub mod force_created { + pub mod released { use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; + pub type Amount = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ForceCreated { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ForceCreated"; + impl ::subxt::ext::subxt_core::events::StaticEvent for Released { + const PALLET: &'static str = "AssetsHolder"; + const EVENT: &'static str = "Released"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20095,70 +19651,645 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "New metadata has been set for an asset."] - pub struct MetadataSet { - pub asset_id: metadata_set::AssetId, - pub name: metadata_set::Name, - pub symbol: metadata_set::Symbol, - pub decimals: metadata_set::Decimals, - pub is_frozen: metadata_set::IsFrozen, + #[doc = "`who`s balance on hold was burned by `amount`."] + pub struct Burned { + pub who: burned::Who, + pub asset_id: burned::AssetId, + pub reason: burned::Reason, + pub amount: burned::Amount, } - pub mod metadata_set { + pub mod burned { use super::runtime_types; + pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; pub type AssetId = ::core::primitive::u32; - pub type Name = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Symbol = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; - pub type Decimals = ::core::primitive::u8; - pub type IsFrozen = ::core::primitive::bool; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataSet { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataSet"; + pub type Reason = runtime_types::quantus_runtime::RuntimeHoldReason; + pub type Amount = ::core::primitive::u128; } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Metadata has been cleared for an asset."] - pub struct MetadataCleared { - pub asset_id: metadata_cleared::AssetId, + impl ::subxt::ext::subxt_core::events::StaticEvent for Burned { + const PALLET: &'static str = "AssetsHolder"; + const EVENT: &'static str = "Burned"; } - pub mod metadata_cleared { + } + pub mod storage { + use super::runtime_types; + pub mod types { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for MetadataCleared { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataCleared"; + 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 = "(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 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 approved_transfer { + } + } + pub mod multisig { + use super::{root_mod, runtime_types}; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_multisig::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_multisig::pallet::Call; + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Source = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Create a new multisig account"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = ""] + #[doc = "The multisig address is derived from a hash of all signers + global nonce."] + #[doc = "The creator must pay a non-refundable fee (burned)."] + pub struct CreateMultisig { + pub signers: create_multisig::Signers, + pub threshold: create_multisig::Threshold, + } + pub mod create_multisig { + use super::runtime_types; + pub type Signers = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Threshold = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CreateMultisig { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "create_multisig"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Propose a transaction to be executed by the multisig"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] + #[doc = ""] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (locked until proposal is removed after grace period)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "The proposal remains in storage even after execution/cancellation."] + #[doc = "Use `remove_expired()` or `claim_deposits()` after grace period to recover the deposit."] + pub struct Propose { + pub multisig_address: propose::MultisigAddress, + pub call: propose::Call, + pub expiry: propose::Expiry, + } + pub mod propose { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Call = + ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Expiry = ::core::primitive::u32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Propose { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "propose"; + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + #[doc = "Approve a proposed transaction"] + #[doc = ""] + #[doc = "If this approval brings the total approvals to or above the threshold,"] + #[doc = "the transaction will be automatically executed."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] + pub struct Approve { + pub multisig_address: approve::MultisigAddress, + pub proposal_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"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] + pub struct Cancel { + pub multisig_address: cancel::MultisigAddress, + pub proposal_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 = "Dissolve (remove) a multisig and recover the creation deposit."] + #[doc = ""] + #[doc = "Requirements:"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up."] + #[doc = "- Multisig account balance must be zero."] + #[doc = "- Can be called by the creator OR any signer."] + #[doc = ""] + #[doc = "The deposit is ALWAYS returned to the original `creator` stored in `MultisigData`."] + pub struct DissolveMultisig { + pub multisig_address: dissolve_multisig::MultisigAddress, + } + pub mod dissolve_multisig { + use super::runtime_types; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + } + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for DissolveMultisig { + const PALLET: &'static str = "Multisig"; + const CALL: &'static str = "dissolve_multisig"; + } } - impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovedTransfer { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovedTransfer"; + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Create a new multisig account"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = ""] + #[doc = "The multisig address is derived from a hash of all signers + global nonce."] + #[doc = "The creator must pay a non-refundable fee (burned)."] + pub fn create_multisig( + &self, + signers: types::create_multisig::Signers, + threshold: types::create_multisig::Threshold, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "create_multisig", + types::CreateMultisig { signers, threshold }, + [ + 245u8, 16u8, 24u8, 202u8, 226u8, 192u8, 244u8, 3u8, 112u8, 49u8, 179u8, + 60u8, 108u8, 206u8, 77u8, 130u8, 112u8, 243u8, 163u8, 11u8, 239u8, + 153u8, 232u8, 78u8, 27u8, 44u8, 88u8, 181u8, 65u8, 151u8, 98u8, 130u8, + ], + ) + } + #[doc = "Propose a transaction to be executed by the multisig"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] + #[doc = ""] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (locked until proposal is removed after grace period)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "The proposal remains in storage even after execution/cancellation."] + #[doc = "Use `remove_expired()` or `claim_deposits()` after grace period to recover the deposit."] + pub fn propose( + &self, + multisig_address: types::propose::MultisigAddress, + call: types::propose::Call, + expiry: types::propose::Expiry, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "propose", + types::Propose { multisig_address, call, expiry }, + [ + 131u8, 107u8, 67u8, 245u8, 123u8, 74u8, 248u8, 60u8, 181u8, 88u8, + 135u8, 198u8, 188u8, 160u8, 34u8, 137u8, 7u8, 126u8, 45u8, 169u8, + 212u8, 30u8, 251u8, 147u8, 167u8, 166u8, 76u8, 70u8, 155u8, 222u8, + 70u8, 143u8, + ], + ) + } + #[doc = "Approve a proposed transaction"] + #[doc = ""] + #[doc = "If this approval brings the total approvals to or above the threshold,"] + #[doc = "the transaction will be automatically executed."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] + pub fn approve( + &self, + multisig_address: types::approve::MultisigAddress, + proposal_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"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] + pub fn cancel( + &self, + multisig_address: types::cancel::MultisigAddress, + proposal_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 = "Dissolve (remove) a multisig and recover the creation deposit."] + #[doc = ""] + #[doc = "Requirements:"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up."] + #[doc = "- Multisig account balance must be zero."] + #[doc = "- Can be called by the creator OR any signer."] + #[doc = ""] + #[doc = "The deposit is ALWAYS returned to the original `creator` stored in `MultisigData`."] + pub fn dissolve_multisig( + &self, + multisig_address: types::dissolve_multisig::MultisigAddress, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { + ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( + "Multisig", + "dissolve_multisig", + types::DissolveMultisig { multisig_address }, + [ + 2u8, 71u8, 80u8, 125u8, 58u8, 244u8, 234u8, 154u8, 158u8, 71u8, 21u8, + 125u8, 188u8, 116u8, 1u8, 232u8, 43u8, 105u8, 162u8, 156u8, 132u8, + 57u8, 252u8, 187u8, 139u8, 106u8, 160u8, 157u8, 159u8, 64u8, 140u8, + 239u8, + ], + ) + } } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub mod events { + use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -20166,21 +20297,28 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An approval for account `delegate` was cancelled by `owner`."] - pub struct ApprovalCancelled { - pub asset_id: approval_cancelled::AssetId, - pub owner: approval_cancelled::Owner, - pub delegate: approval_cancelled::Delegate, - } - pub mod approval_cancelled { + #[doc = "A new multisig account was created"] + #[doc = "[creator, multisig_address, signers, threshold, nonce]"] + pub struct MultisigCreated { + pub creator: multisig_created::Creator, + pub multisig_address: multisig_created::MultisigAddress, + pub signers: multisig_created::Signers, + pub threshold: multisig_created::Threshold, + pub nonce: multisig_created::Nonce, + } + pub mod multisig_created { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Creator = ::subxt::ext::subxt_core::utils::AccountId32; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Signers = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Threshold = ::core::primitive::u32; + pub type Nonce = ::core::primitive::u64; } - impl ::subxt::ext::subxt_core::events::StaticEvent for ApprovalCancelled { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovalCancelled"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MultisigCreated { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigCreated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20189,26 +20327,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An `amount` was transferred in its entirety from `owner` to `destination` by"] - #[doc = "the approved `delegate`."] - pub struct TransferredApproved { - pub asset_id: transferred_approved::AssetId, - pub owner: transferred_approved::Owner, - pub delegate: transferred_approved::Delegate, - pub destination: transferred_approved::Destination, - pub amount: transferred_approved::Amount, + #[doc = "A proposal has been created"] + pub struct ProposalCreated { + pub multisig_address: proposal_created::MultisigAddress, + pub proposer: proposal_created::Proposer, + pub proposal_id: proposal_created::ProposalId, } - pub mod transferred_approved { + pub mod proposal_created { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Owner = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Delegate = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Destination = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::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 ProposalCreated { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalCreated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20217,17 +20350,23 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An asset has had its attributes changed by the `Force` origin."] - pub struct AssetStatusChanged { - pub asset_id: asset_status_changed::AssetId, - } - pub mod asset_status_changed { + #[doc = "A proposal has been approved by a signer"] + pub struct ProposalApproved { + pub multisig_address: proposal_approved::MultisigAddress, + pub approver: proposal_approved::Approver, + pub proposal_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 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 AssetStatusChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetStatusChanged"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalApproved { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalApproved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20236,19 +20375,31 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The min_balance of an asset has been updated by the asset owner."] - pub struct AssetMinBalanceChanged { - pub asset_id: asset_min_balance_changed::AssetId, - pub new_min_balance: asset_min_balance_changed::NewMinBalance, - } - pub mod asset_min_balance_changed { + #[doc = "A proposal has been executed"] + #[doc = "Contains all data needed for indexing by SubSquid"] + pub struct ProposalExecuted { + pub multisig_address: proposal_executed::MultisigAddress, + pub proposal_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 NewMinBalance = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Call = ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Approvers = ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetMinBalanceChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetMinBalanceChanged"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalExecuted { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalExecuted"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20257,21 +20408,21 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some account `who` was created with a deposit from `depositor`."] - pub struct Touched { - pub asset_id: touched::AssetId, - pub who: touched::Who, - pub depositor: touched::Depositor, + #[doc = "A proposal has been cancelled by the proposer"] + pub struct ProposalCancelled { + pub multisig_address: proposal_cancelled::MultisigAddress, + pub proposer: proposal_cancelled::Proposer, + pub proposal_id: proposal_cancelled::ProposalId, } - pub mod touched { + pub mod proposal_cancelled { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Depositor = ::subxt::ext::subxt_core::utils::AccountId32; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Proposer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type ProposalId = ::core::primitive::u32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Touched { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Touched"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalCancelled { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalCancelled"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20280,19 +20431,23 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some account `who` was blocked."] - pub struct Blocked { - pub asset_id: blocked::AssetId, - pub who: blocked::Who, - } - pub mod blocked { + #[doc = "Expired proposal was removed from storage"] + pub struct ProposalRemoved { + pub multisig_address: proposal_removed::MultisigAddress, + pub proposal_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 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 Blocked { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Blocked"; + impl ::subxt::ext::subxt_core::events::StaticEvent for ProposalRemoved { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "ProposalRemoved"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20301,21 +20456,25 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some assets were deposited (e.g. for transaction fees)."] - pub struct Deposited { - pub asset_id: deposited::AssetId, - pub who: deposited::Who, - pub amount: deposited::Amount, - } - pub mod deposited { + #[doc = "Batch deposits claimed"] + pub struct DepositsClaimed { + pub multisig_address: deposits_claimed::MultisigAddress, + pub claimer: deposits_claimed::Claimer, + pub total_returned: deposits_claimed::TotalReturned, + pub proposals_removed: deposits_claimed::ProposalsRemoved, + pub multisig_removed: deposits_claimed::MultisigRemoved, + } + pub mod deposits_claimed { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Claimer = ::subxt::ext::subxt_core::utils::AccountId32; + pub type TotalReturned = ::core::primitive::u128; + pub type ProposalsRemoved = ::core::primitive::u32; + pub type MultisigRemoved = ::core::primitive::bool; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deposited { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Deposited"; + impl ::subxt::ext::subxt_core::events::StaticEvent for DepositsClaimed { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "DepositsClaimed"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -20324,392 +20483,207 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some assets were withdrawn from the account (e.g. for transaction fees)."] - pub struct Withdrawn { - pub asset_id: withdrawn::AssetId, - pub who: withdrawn::Who, - pub amount: withdrawn::Amount, + #[doc = "A multisig account was dissolved and deposit returned"] + pub struct MultisigDissolved { + pub multisig_address: multisig_dissolved::MultisigAddress, + pub caller: multisig_dissolved::Caller, + pub deposit_returned: multisig_dissolved::DepositReturned, } - pub mod withdrawn { + pub mod multisig_dissolved { use super::runtime_types; - pub type AssetId = ::core::primitive::u32; - pub type Who = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Amount = ::core::primitive::u128; + pub type MultisigAddress = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Caller = ::subxt::ext::subxt_core::utils::AccountId32; + pub type DepositReturned = ::core::primitive::u128; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Withdrawn { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Withdrawn"; + impl ::subxt::ext::subxt_core::events::StaticEvent for MultisigDissolved { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigDissolved"; } } pub mod storage { use super::runtime_types; pub mod types { use super::runtime_types; - pub mod asset { + pub mod global_nonce { 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 type GlobalNonce = ::core::primitive::u64; } - 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< + ::core::primitive::u32, ::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, - >; - pub type Param0 = ::core::primitive::u32; - pub type Param1 = ::subxt::ext::subxt_core::utils::AccountId32; - pub type Param2 = ::subxt::ext::subxt_core::utils::AccountId32; + runtime_types::bounded_collections::bounded_btree_map::BoundedBTreeMap< + ::subxt::ext::subxt_core::utils::AccountId32, + ::core::primitive::u32, + >, + >; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; } - pub mod metadata { + pub mod proposals { use super::runtime_types; - pub type Metadata = runtime_types::pallet_assets::types::AssetMetadata< + pub type Proposals = runtime_types::pallet_multisig::ProposalData< + ::subxt::ext::subxt_core::utils::AccountId32, ::core::primitive::u128, + ::core::primitive::u32, runtime_types::bounded_collections::bounded_vec::BoundedVec< ::core::primitive::u8, >, + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, >; - pub type Param0 = ::core::primitive::u32; - } - pub mod next_asset_id { - use super::runtime_types; - pub type NextAssetId = ::core::primitive::u32; + pub type Param0 = ::subxt::ext::subxt_core::utils::AccountId32; + pub type Param1 = ::core::primitive::u32; } } pub struct StorageApi; impl StorageApi { - #[doc = " Details of an asset."] - pub fn asset_iter( + #[doc = " Global nonce for generating unique multisig addresses"] + pub fn global_nonce( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::asset::Asset, - (), - (), + types::global_nonce::GlobalNonce, ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Asset", - (), - [ - 159u8, 234u8, 177u8, 31u8, 58u8, 51u8, 173u8, 184u8, 250u8, 169u8, - 246u8, 122u8, 54u8, 19u8, 232u8, 60u8, 0u8, 165u8, 12u8, 101u8, 93u8, - 169u8, 23u8, 34u8, 154u8, 44u8, 134u8, 128u8, 97u8, 71u8, 167u8, 224u8, - ], - ) - } - #[doc = " Details of an asset."] - pub fn asset( - &self, - _0: types::asset::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::asset::Param0, - >, - types::asset::Asset, ::subxt::ext::subxt_core::utils::Yes, (), - (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Asset", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + "Multisig", + "GlobalNonce", + (), [ - 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, + 119u8, 119u8, 84u8, 141u8, 83u8, 67u8, 42u8, 83u8, 51u8, 196u8, 185u8, + 39u8, 227u8, 125u8, 142u8, 154u8, 107u8, 62u8, 127u8, 13u8, 54u8, + 114u8, 201u8, 6u8, 100u8, 28u8, 202u8, 152u8, 246u8, 202u8, 9u8, 29u8, ], ) } - #[doc = " The holdings of a specific account for a specific asset."] - pub fn account_iter( + #[doc = " Multisigs stored by their generated address"] + pub fn multisigs_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::account::Account, + types::multisigs::Multisigs, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Account", + "Multisig", + "Multisigs", (), [ - 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, + 95u8, 91u8, 215u8, 222u8, 132u8, 122u8, 22u8, 101u8, 197u8, 243u8, + 217u8, 12u8, 255u8, 230u8, 38u8, 200u8, 69u8, 179u8, 47u8, 227u8, 70u8, + 230u8, 25u8, 50u8, 224u8, 85u8, 127u8, 189u8, 241u8, 183u8, 21u8, 32u8, ], ) } - #[doc = " The holdings of a specific account for a specific asset."] - pub fn account_iter1( + #[doc = " Multisigs stored by their generated address"] + pub fn multisigs( &self, - _0: types::account::Param0, + _0: types::multisigs::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::account::Param0, + types::multisigs::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, + types::multisigs::Multisigs, ::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), - ), + "Multisig", + "Multisigs", + ::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, + 95u8, 91u8, 215u8, 222u8, 132u8, 122u8, 22u8, 101u8, 197u8, 243u8, + 217u8, 12u8, 255u8, 230u8, 38u8, 200u8, 69u8, 179u8, 47u8, 227u8, 70u8, + 230u8, 25u8, 50u8, 224u8, 85u8, 127u8, 189u8, 241u8, 183u8, 21u8, 32u8, ], ) } - #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] - #[doc = " is the amount of `T::Currency` reserved for storing this."] - #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] - pub fn approvals_iter( + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals_iter( &self, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< (), - types::approvals::Approvals, + types::proposals::Proposals, (), (), ::subxt::ext::subxt_core::utils::Yes, > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "Approvals", + "Multisig", + "Proposals", (), [ - 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, + 91u8, 232u8, 160u8, 102u8, 108u8, 104u8, 162u8, 6u8, 45u8, 30u8, 146u8, + 207u8, 18u8, 43u8, 197u8, 37u8, 166u8, 99u8, 30u8, 17u8, 46u8, 210u8, + 56u8, 209u8, 9u8, 35u8, 221u8, 140u8, 178u8, 248u8, 249u8, 214u8, ], ) } - #[doc = " Approved balance transfers. First balance is the amount approved for transfer. Second"] - #[doc = " is the amount of `T::Currency` reserved for storing this."] - #[doc = " First key is the asset ID, second key is the owner and third key is the delegate."] - pub fn approvals_iter1( + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals_iter1( &self, - _0: types::approvals::Param0, + _0: types::proposals::Param0, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::approvals::Param0, + types::proposals::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::proposals::Proposals, (), - 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", + "Multisig", + "Proposals", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 129u8, 202u8, 244u8, 77u8, 55u8, 81u8, 86u8, 106u8, 20u8, 153u8, 209u8, - 69u8, 199u8, 107u8, 111u8, 49u8, 88u8, 157u8, 84u8, 41u8, 198u8, 190u8, - 234u8, 218u8, 68u8, 207u8, 87u8, 217u8, 73u8, 66u8, 211u8, 163u8, + 91u8, 232u8, 160u8, 102u8, 108u8, 104u8, 162u8, 6u8, 45u8, 30u8, 146u8, + 207u8, 18u8, 43u8, 197u8, 37u8, 166u8, 99u8, 30u8, 17u8, 46u8, 210u8, + 56u8, 209u8, 9u8, 35u8, 221u8, 140u8, 178u8, 248u8, 249u8, 214u8, ], ) } - #[doc = " The asset ID enforced for the next asset creation, if any present. Otherwise, this storage"] - #[doc = " item has no effect."] - #[doc = ""] - #[doc = " This can be useful for setting up constraints for IDs of the new assets. For example, by"] - #[doc = " providing an initial [`NextAssetId`] and using the [`crate::AutoIncAssetId`] callback, an"] - #[doc = " auto-increment model can be applied to all new asset IDs."] - #[doc = ""] - #[doc = " The initial next asset ID can be set using the [`GenesisConfig`] or the"] - #[doc = " [SetNextAssetId](`migration::next_asset_id::SetNextAssetId`) migration."] - pub fn next_asset_id( + #[doc = " Proposals indexed by (multisig_address, proposal_nonce)"] + pub fn proposals( &self, + _0: types::proposals::Param0, + _1: types::proposals::Param1, ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::next_asset_id::NextAssetId, + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::proposals::Param0, + >, + ::subxt::ext::subxt_core::storage::address::StaticStorageKey< + types::proposals::Param1, + >, + ), + types::proposals::Proposals, ::subxt::ext::subxt_core::utils::Yes, (), (), > { ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "Assets", - "NextAssetId", - (), + "Multisig", + "Proposals", + ( + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), + ), [ - 15u8, 61u8, 40u8, 217u8, 236u8, 34u8, 95u8, 53u8, 159u8, 182u8, 70u8, - 251u8, 234u8, 188u8, 115u8, 23u8, 199u8, 118u8, 220u8, 40u8, 147u8, - 174u8, 247u8, 129u8, 246u8, 107u8, 178u8, 43u8, 8u8, 19u8, 74u8, 116u8, + 91u8, 232u8, 160u8, 102u8, 108u8, 104u8, 162u8, 6u8, 45u8, 30u8, 146u8, + 207u8, 18u8, 43u8, 197u8, 37u8, 166u8, 99u8, 30u8, 17u8, 46u8, 210u8, + 56u8, 209u8, 9u8, 35u8, 221u8, 140u8, 178u8, 248u8, 249u8, 214u8, ], ) } @@ -20719,17 +20693,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,65 +20710,67 @@ pub mod api { ], ) } - #[doc = " The basic amount of funds that must be reserved for an asset."] - pub fn asset_deposit( + #[doc = " Maximum number of active (open) proposals per multisig at any given time"] + pub fn max_active_proposals( &self, ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u128, + ::core::primitive::u32, > { ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "Assets", - "AssetDeposit", + "Multisig", + "MaxActiveProposals", [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, - 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, - 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } - #[doc = " The amount of funds that must be reserved for a non-provider asset account to be"] - #[doc = " maintained."] - pub fn asset_account_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", - "AssetAccountDeposit", + "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 basic amount of funds that must be reserved when adding metadata to your asset."] - pub fn metadata_deposit_base( + #[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", - "MetadataDepositBase", + "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 additional funds that must be reserved for the number of bytes you store in your"] - #[doc = " metadata."] - pub fn metadata_deposit_per_byte( + #[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", - "MetadataDepositPerByte", + "Multisig", + "MultisigFee", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -20804,15 +20778,16 @@ pub mod api { ], ) } - #[doc = " The amount of funds that must be reserved when creating a new approval."] - pub fn approval_deposit( + #[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", - "ApprovalDeposit", + "Multisig", + "MultisigDeposit", [ 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, @@ -20820,290 +20795,92 @@ pub mod api { ], ) } - #[doc = " The maximum length of a name or symbol stored on-chain."] - pub fn string_limit( + #[doc = " Deposit required per proposal (returned on execute or cancel)"] + pub fn proposal_deposit( &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, + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "Holds", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "ProposalDeposit", [ - 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, - 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, - 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, - 41u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } - #[doc = " A map that stores holds applied on an account for a given AssetId."] - pub fn holds( + #[doc = " Fee charged for creating a proposal (non-refundable, paid always)"] + pub fn proposal_fee( &self, - _0: types::holds::Param0, - _1: types::holds::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::holds::Param1, - >, - ), - types::holds::Holds, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u128, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "Holds", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "ProposalFee", [ - 131u8, 85u8, 98u8, 45u8, 101u8, 28u8, 94u8, 4u8, 1u8, 137u8, 126u8, - 129u8, 241u8, 99u8, 206u8, 145u8, 177u8, 135u8, 27u8, 52u8, 122u8, - 94u8, 241u8, 29u8, 253u8, 154u8, 158u8, 229u8, 208u8, 129u8, 29u8, - 41u8, + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, ], ) } - #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold_iter( + #[doc = " Percentage increase in ProposalFee for each signer in the multisig."] + #[doc = ""] + #[doc = " Formula: `FinalFee = ProposalFee + (ProposalFee * SignerCount * SignerStepFactor)`"] + #[doc = " Example: If Fee=100, Signers=5, Factor=1%, then Extra = 100 * 5 * 0.01 = 5. Total = 105."] + pub fn signer_step_factor( &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::balances_on_hold::BalancesOnHold, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Permill, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "BalancesOnHold", - (), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "SignerStepFactor", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, + 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, + 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, ], ) } - #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold_iter1( + #[doc = " Pallet ID for generating multisig addresses"] + pub fn pallet_id( &self, - _0: types::balances_on_hold::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param0, - >, - types::balances_on_hold::BalancesOnHold, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + runtime_types::frame_support::PalletId, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "BalancesOnHold", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "PalletId", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, + 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, + 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, ], ) } - #[doc = " A map that stores the current total balance on hold for every account on a given AssetId."] - pub fn balances_on_hold( + #[doc = " Maximum duration (in blocks) that a proposal can be set to expire in the future."] + #[doc = " This prevents proposals from being created with extremely far expiry dates"] + #[doc = " that would lock deposits and bloat storage for extended periods."] + #[doc = ""] + #[doc = " Example: If set to 100_000 blocks (~2 weeks at 12s blocks),"] + #[doc = " a proposal created at block 1000 cannot have expiry > 101_000."] + pub fn max_expiry_duration( &self, - _0: types::balances_on_hold::Param0, - _1: types::balances_on_hold::Param1, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param0, - >, - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::balances_on_hold::Param1, - >, - ), - types::balances_on_hold::BalancesOnHold, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), + ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< + ::core::primitive::u32, > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "AssetsHolder", - "BalancesOnHold", - ( - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_1), - ), + ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + "Multisig", + "MaxExpiryDuration", [ - 39u8, 48u8, 137u8, 178u8, 85u8, 119u8, 90u8, 207u8, 72u8, 232u8, 81u8, - 190u8, 234u8, 32u8, 246u8, 199u8, 37u8, 220u8, 0u8, 216u8, 47u8, 241u8, - 9u8, 107u8, 9u8, 130u8, 13u8, 232u8, 142u8, 226u8, 77u8, 179u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, ], ) } @@ -21114,6 +20891,23 @@ pub mod api { use super::runtime_types; pub mod bounded_collections { use super::runtime_types; + pub mod bounded_btree_map { + use super::runtime_types; + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" + )] + #[encode_as_type( + crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" + )] + pub struct BoundedBTreeMap<_0, _1>( + pub ::subxt::ext::subxt_core::utils::KeyedVec<_0, _1>, + ); + } pub mod bounded_vec { use super::runtime_types; #[derive( @@ -23922,7 +23716,7 @@ pub mod api { } } } - pub mod pallet_merkle_airdrop { + pub mod pallet_mining_rewards { use super::runtime_types; pub mod pallet { use super::runtime_types; @@ -23937,90 +23731,30 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] - pub enum Call { + #[doc = "The `Event` enum of this pallet"] + pub enum Event { #[codec(index = 0)] - #[doc = "Create a new airdrop with a Merkle root."] - #[doc = ""] - #[doc = "The Merkle root is a cryptographic hash that represents all valid claims"] - #[doc = "for this airdrop. Users will later provide Merkle proofs to verify their"] - #[doc = "eligibility to claim tokens."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `merkle_root` - The Merkle root hash representing all valid claims"] - #[doc = "* `vesting_period` - Optional vesting period for the airdrop"] - #[doc = "* `vesting_delay` - Optional delay before vesting starts"] - create_airdrop { - merkle_root: [::core::primitive::u8; 32usize], - vesting_period: ::core::option::Option<::core::primitive::u32>, - vesting_delay: ::core::option::Option<::core::primitive::u32>, + #[doc = "A miner has been identified for a block"] + MinerRewarded { + miner: ::subxt::ext::subxt_core::utils::AccountId32, + reward: ::core::primitive::u128, }, #[codec(index = 1)] - #[doc = "Fund an existing airdrop with tokens."] - #[doc = ""] - #[doc = "This function transfers tokens from the caller to the airdrop's account,"] - #[doc = "making them available for users to claim."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be signed)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to fund"] - #[doc = "* `amount` - The amount of tokens to add to the airdrop"] - #[doc = ""] - #[doc = "# Errors"] - #[doc = ""] - #[doc = "* `AirdropNotFound` - If the specified airdrop does not exist"] - fund_airdrop { - airdrop_id: ::core::primitive::u32, + #[doc = "Transaction fees were collected for later distribution"] + FeesCollected { amount: ::core::primitive::u128, + total: ::core::primitive::u128, }, #[codec(index = 2)] - #[doc = "Claim tokens from an airdrop by providing a Merkle proof."] - #[doc = ""] - #[doc = "Users can claim their tokens by providing a proof of their eligibility."] - #[doc = "The proof is verified against the airdrop's Merkle root."] - #[doc = "Anyone can trigger a claim for any eligible recipient."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "* `origin` - The origin of the call"] - #[doc = "* `airdrop_id` - The ID of the airdrop to claim from"] - #[doc = "* `amount` - The amount of tokens to claim"] - #[doc = "* `merkle_proof` - The Merkle proof verifying eligibility"] - #[doc = ""] - #[doc = "# Errors"] - #[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], - >, - }, - #[codec(index = 3)] - #[doc = "Delete an airdrop and reclaim any remaining funds."] - #[doc = ""] - #[doc = "This function allows the creator of an airdrop to delete it and reclaim"] - #[doc = "any remaining tokens that haven't been claimed."] - #[doc = ""] - #[doc = "# Parameters"] - #[doc = ""] - #[doc = "* `origin` - The origin of the call (must be the airdrop creator)"] - #[doc = "* `airdrop_id` - The ID of the airdrop to delete"] - #[doc = ""] - #[doc = "# Errors"] - #[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 = "Rewards were sent to Treasury when no miner was specified"] + TreasuryRewarded { reward: ::core::primitive::u128 }, } + } + } + pub mod pallet_multisig { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -24032,23 +23766,108 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "The `Error` enum of this pallet."] - pub enum Error { + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { #[codec(index = 0)] - #[doc = "The specified airdrop does not exist."] - AirdropNotFound, + #[doc = "Create a new multisig account"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `signers`: List of accounts that can sign for this multisig"] + #[doc = "- `threshold`: Number of approvals required to execute transactions"] + #[doc = ""] + #[doc = "The multisig address is derived from a hash of all signers + global nonce."] + #[doc = "The creator must pay a non-refundable fee (burned)."] + create_multisig { + signers: ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + threshold: ::core::primitive::u32, + }, #[codec(index = 1)] - #[doc = "The airdrop does not have sufficient balance for this operation."] - InsufficientAirdropBalance, + #[doc = "Propose a transaction to be executed by the multisig"] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account that will execute the call"] + #[doc = "- `call`: The encoded call to execute"] + #[doc = "- `expiry`: Block number when this proposal expires"] + #[doc = ""] + #[doc = "The proposer must be a signer and must pay:"] + #[doc = "- A deposit (locked until proposal is removed after grace period)"] + #[doc = "- A fee (non-refundable, burned immediately)"] + #[doc = ""] + #[doc = "The proposal remains in storage even after execution/cancellation."] + #[doc = "Use `remove_expired()` or `claim_deposits()` after grace period to recover the deposit."] + 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 = "The user has already claimed from this airdrop."] - AlreadyClaimed, + #[doc = "Approve a proposed transaction"] + #[doc = ""] + #[doc = "If this approval brings the total approvals to or above the threshold,"] + #[doc = "the transaction will be automatically executed."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multisig_address`: The multisig account"] + #[doc = "- `proposal_id`: ID (nonce) of the proposal to approve"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] + approve { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, #[codec(index = 3)] - #[doc = "The provided Merkle proof is invalid."] - InvalidProof, + #[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"] + #[doc = ""] + #[doc = "Weight: Charges for MAX call size, but refunds based on actual call size"] + cancel { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, #[codec(index = 4)] - #[doc = "Only the creator of an airdrop can delete it."] - NotAirdropCreator, + #[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."] + remove_expired { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, + #[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 = "Returns all proposal deposits to the proposer in a single transaction."] + claim_deposits { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + }, + #[codec(index = 6)] + #[doc = "Dissolve (remove) a multisig and recover the creation deposit."] + #[doc = ""] + #[doc = "Requirements:"] + #[doc = "- No proposals exist (active, executed, or cancelled) - must be fully cleaned up."] + #[doc = "- Multisig account balance must be zero."] + #[doc = "- Can be called by the creator OR any signer."] + #[doc = ""] + #[doc = "The deposit is ALWAYS returned to the original `creator` stored in `MultisigData`."] + dissolve_multisig { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + }, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -24061,63 +23880,87 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "The `Event` enum of this pallet"] - pub enum Event { + #[doc = "The `Error` enum of this pallet."] + pub enum Error { #[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, - >, - }, + #[doc = "Not enough signers provided"] + NotEnoughSigners, #[codec(index = 1)] - #[doc = "An airdrop has been funded with tokens."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, amount]"] - AirdropFunded { - airdrop_id: ::core::primitive::u32, - amount: ::core::primitive::u128, - }, + #[doc = "Threshold must be greater than zero"] + ThresholdZero, #[codec(index = 2)] - #[doc = "A user has claimed tokens from an airdrop."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id, account, amount]"] - Claimed { - airdrop_id: ::core::primitive::u32, - account: ::subxt::ext::subxt_core::utils::AccountId32, - amount: ::core::primitive::u128, - }, + #[doc = "Threshold exceeds number of signers"] + ThresholdTooHigh, #[codec(index = 3)] - #[doc = "An airdrop has been deleted."] - #[doc = ""] - #[doc = "Parameters: [airdrop_id]"] - AirdropDeleted { airdrop_id: ::core::primitive::u32 }, + #[doc = "Too many signers"] + TooManySigners, + #[codec(index = 4)] + #[doc = "Duplicate signer in list"] + DuplicateSigner, + #[codec(index = 5)] + #[doc = "Multisig already exists"] + MultisigAlreadyExists, + #[codec(index = 6)] + #[doc = "Multisig not found"] + MultisigNotFound, + #[codec(index = 7)] + #[doc = "Caller is not a signer of this multisig"] + NotASigner, + #[codec(index = 8)] + #[doc = "Proposal not found"] + ProposalNotFound, + #[codec(index = 9)] + #[doc = "Caller is not the proposer"] + NotProposer, + #[codec(index = 10)] + #[doc = "Already approved by this signer"] + AlreadyApproved, + #[codec(index = 11)] + #[doc = "Not enough approvals to execute"] + NotEnoughApprovals, + #[codec(index = 12)] + #[doc = "Proposal expiry is in the past"] + ExpiryInPast, + #[codec(index = 13)] + #[doc = "Proposal expiry is too far in the future (exceeds MaxExpiryDuration)"] + ExpiryTooFar, + #[codec(index = 14)] + #[doc = "Proposal has expired"] + ProposalExpired, + #[codec(index = 15)] + #[doc = "Call data too large"] + CallTooLarge, + #[codec(index = 16)] + #[doc = "Failed to decode call data"] + InvalidCall, + #[codec(index = 17)] + #[doc = "Too many active proposals for this multisig"] + TooManyActiveProposals, + #[codec(index = 18)] + #[doc = "Too many total proposals in storage for this multisig (cleanup required)"] + TooManyProposalsInStorage, + #[codec(index = 19)] + #[doc = "This signer has too many proposals in storage (filibuster protection)"] + TooManyProposalsPerSigner, + #[codec(index = 20)] + #[doc = "Insufficient balance for deposit"] + InsufficientBalance, + #[codec(index = 21)] + #[doc = "Proposal has active deposit"] + ProposalHasDeposit, + #[codec(index = 22)] + #[doc = "Proposal has not expired yet"] + ProposalNotExpired, + #[codec(index = 23)] + #[doc = "Proposal is not active (already executed or cancelled)"] + ProposalNotActive, + #[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, } - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[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; #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -24132,22 +23975,127 @@ 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 been executed"] + #[doc = "Contains all data needed for indexing by SubSquid"] + ProposalExecuted { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + call: ::subxt::ext::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + approvers: ::subxt::ext::subxt_core::alloc::vec::Vec< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 4)] + #[doc = "A proposal has been cancelled by the proposer"] + ProposalCancelled { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "Expired proposal was removed from storage"] + ProposalRemoved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + proposal_id: ::core::primitive::u32, + proposer: ::subxt::ext::subxt_core::utils::AccountId32, + removed_by: ::subxt::ext::subxt_core::utils::AccountId32, + }, + #[codec(index = 6)] + #[doc = "Batch deposits claimed"] + DepositsClaimed { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + claimer: ::subxt::ext::subxt_core::utils::AccountId32, + total_returned: ::core::primitive::u128, + proposals_removed: ::core::primitive::u32, + multisig_removed: ::core::primitive::bool, + }, + #[codec(index = 7)] + #[doc = "A multisig account was dissolved and deposit returned"] + MultisigDissolved { + multisig_address: ::subxt::ext::subxt_core::utils::AccountId32, + caller: ::subxt::ext::subxt_core::utils::AccountId32, + deposit_returned: ::core::primitive::u128, + }, } } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[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, _4> { + pub signers: _2, + pub threshold: ::core::primitive::u32, + pub nonce: ::core::primitive::u64, + pub proposal_nonce: ::core::primitive::u32, + pub creator: _1, + pub deposit: _3, + pub last_activity: _0, + pub active_proposals: ::core::primitive::u32, + pub proposals_per_signer: _4, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub struct ProposalData<_0, _1, _2, _3, _4> { + pub proposer: _0, + pub call: _3, + pub expiry: _2, + pub approvals: _4, + pub deposit: _1, + pub status: runtime_types::pallet_multisig::ProposalStatus, + } + #[derive( + :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Debug, + )] + #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] + pub enum ProposalStatus { + #[codec(index = 0)] + Active, + #[codec(index = 1)] + Executed, + #[codec(index = 2)] + Cancelled, + } } pub mod pallet_preimage { use super::runtime_types; @@ -27005,240 +26953,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 +27001,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 +27155,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 +27171,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 +27194,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 +27210,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 +27218,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 +27241,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 +27257,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 +27265,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 +28019,6 @@ pub mod api { Mortal255(::core::primitive::u8), } } - pub mod header { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub struct Header<_0> { - pub parent_hash: ::subxt::ext::subxt_core::utils::H256, - #[codec(compact)] - pub number: _0, - pub state_root: ::subxt::ext::subxt_core::utils::H256, - pub extrinsics_root: ::subxt::ext::subxt_core::utils::H256, - pub digest: runtime_types::sp_runtime::generic::digest::Digest, - } - } } pub mod proving_trie { use super::runtime_types; diff --git a/src/cli/mod.rs b/src/cli/mod.rs index a5c768e..05982f0 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -10,6 +10,7 @@ pub mod events; pub mod generic_call; pub mod high_security; pub mod metadata; +pub mod multisig; pub mod preimage; pub mod recovery; pub mod referenda; @@ -79,6 +80,10 @@ pub enum Commands { #[command(subcommand)] Recovery(recovery::RecoveryCommands), + /// Multisig commands (multi-signature wallets) + #[command(subcommand)] + Multisig(multisig::MultisigCommands), + /// Scheduler commands #[command(subcommand)] Scheduler(scheduler::SchedulerCommands), @@ -269,6 +274,8 @@ pub async fn execute_command( high_security::handle_high_security_command(hs_cmd, node_url, execution_mode).await, Commands::Recovery(recovery_cmd) => recovery::handle_recovery_command(recovery_cmd, node_url, execution_mode).await, + Commands::Multisig(multisig_cmd) => + multisig::handle_multisig_command(multisig_cmd, node_url, execution_mode).await, Commands::Scheduler(scheduler_cmd) => scheduler::handle_scheduler_command(scheduler_cmd, node_url, execution_mode).await, Commands::Storage(storage_cmd) => diff --git a/src/cli/multisig.rs b/src/cli/multisig.rs new file mode 100644 index 0000000..dcb76b2 --- /dev/null +++ b/src/cli/multisig.rs @@ -0,0 +1,2047 @@ +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, + /// Current balance (spendable) + pub balance: u128, + /// Approval threshold + pub threshold: u32, + /// List of signer addresses (SS58 format) + pub signers: Vec, + /// Creation nonce + pub nonce: u64, + /// Next proposal ID + pub proposal_nonce: u32, + /// Creator address (SS58 format) + pub creator: String, + /// Locked deposit amount + pub deposit: u128, + /// Last activity block number + pub last_activity: u32, + /// Number of active proposals + pub active_proposals: u32, +} + +/// Proposal status +#[allow(dead_code)] +#[derive(Debug, Clone, PartialEq)] +pub enum ProposalStatus { + Active, + Executed, + Cancelled, +} + +/// Proposal information +#[allow(dead_code)] +#[derive(Debug, Clone)] +pub struct ProposalInfo { + /// Proposal ID + pub id: u32, + /// Proposer address (SS58 format) + pub proposer: String, + /// Encoded call data + pub call_data: Vec, + /// Expiry block number + pub expiry: u32, + /// List of approver addresses (SS58 format) + pub approvals: Vec, + /// Locked deposit amount + pub deposit: u128, + /// Proposal status + pub status: ProposalStatus, +} + +// ============================================================================ +// PUBLIC LIBRARY API - Helper Functions +// ============================================================================ + +/// Parse amount from human-readable format (e.g., "10", "10.5", "0.001") +/// or raw format (e.g., "10000000000000") +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, + }, +} + +/// Multisig-related commands +#[derive(Subcommand, Debug)] +pub enum MultisigCommands { + /// Create a new multisig account + Create { + /// List of signer addresses (SS58 or wallet names), comma-separated + #[arg(long)] + signers: String, + + /// Number of approvals required to execute transactions + #[arg(long)] + threshold: u32, + + /// Wallet name to pay for multisig creation + #[arg(long)] + from: String, + + /// Password for the wallet + #[arg(short, long)] + password: Option, + + /// Read password from file (for scripting) + #[arg(long)] + password_file: Option, + }, + + /// Propose a transaction to be executed by the multisig + #[command(subcommand)] + Propose(ProposeSubcommand), + + /// Approve a proposed transaction + Approve { + /// 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, + }, + + /// 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, + }, +} + +// ============================================================================ +// PUBLIC LIBRARY API - Core Functions +// ============================================================================ +// Note: These functions are public library API and may not be used by the CLI binary + +/// Create a multisig account +/// +/// # Arguments +/// * `quantus_client` - Connected Quantus client +/// * `creator_keypair` - Keypair of the account creating the multisig +/// * `signers` - List of signer addresses (AccountId32) +/// * `threshold` - Number of approvals required +/// * `wait_for_inclusion` - Whether to wait for transaction inclusion +/// +/// # Returns +/// Transaction hash and optionally the multisig address (if wait_for_inclusion=true) +#[allow(dead_code)] +pub async fn create_multisig( + quantus_client: &crate::chain::client::QuantusClient, + creator_keypair: &crate::wallet::QuantumKeyPair, + signers: Vec, + threshold: u32, + wait_for_inclusion: bool, +) -> crate::error::Result<(subxt::utils::H256, Option)> { + // Build transaction + let create_tx = quantus_subxt::api::tx().multisig().create_multisig(signers.clone(), threshold); + + // Submit transaction + let execution_mode = + ExecutionMode { finalized: false, wait_for_transaction: wait_for_inclusion }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + creator_keypair, + create_tx, + None, + execution_mode, + ) + .await?; + + // If waiting, extract address from events + let multisig_address = if wait_for_inclusion { + let latest_block_hash = quantus_client.get_latest_block().await?; + let events = quantus_client.client().events().at(latest_block_hash).await?; + + let mut multisig_events = + events.find::(); + + let address: Option = if let Some(Ok(ev)) = multisig_events.next() { + let addr_bytes: &[u8; 32] = ev.multisig_address.as_ref(); + let addr = SpAccountId32::from(*addr_bytes); + Some(addr.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189))) + } else { + None + }; + address + } else { + None + }; + + Ok((tx_hash, multisig_address)) +} + +/// Propose a transfer from multisig +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn propose_transfer( + quantus_client: &crate::chain::client::QuantusClient, + proposer_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + to_address: subxt::ext::subxt_core::utils::AccountId32, + amount: u128, + expiry: u32, +) -> crate::error::Result { + use codec::{Compact, Encode}; + + // Build Balances::transfer_allow_death call + let pallet_index = 5u8; // Balances pallet + let call_index = 0u8; // transfer_allow_death + + let mut call_data = Vec::new(); + call_data.push(pallet_index); + call_data.push(call_index); + + // Encode destination (MultiAddress::Id) + call_data.push(0u8); // MultiAddress::Id variant + call_data.extend_from_slice(to_address.as_ref()); + + // Encode amount (Compact) + Compact(amount).encode_to(&mut call_data); + + // Build propose transaction + let propose_tx = + quantus_subxt::api::tx().multisig().propose(multisig_address, call_data, expiry); + + // Submit transaction + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + proposer_keypair, + propose_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +/// Propose a custom call from multisig +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn propose_custom( + quantus_client: &crate::chain::client::QuantusClient, + proposer_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + call_data: Vec, + expiry: u32, +) -> crate::error::Result { + // Build propose transaction + let propose_tx = + quantus_subxt::api::tx().multisig().propose(multisig_address, call_data, expiry); + + // Submit transaction + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + proposer_keypair, + propose_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +/// Approve a proposal +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn approve_proposal( + quantus_client: &crate::chain::client::QuantusClient, + approver_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + proposal_id: u32, +) -> crate::error::Result { + let approve_tx = quantus_subxt::api::tx().multisig().approve(multisig_address, proposal_id); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + approver_keypair, + approve_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +/// Cancel a proposal (only by proposer) +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn cancel_proposal( + quantus_client: &crate::chain::client::QuantusClient, + proposer_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + proposal_id: u32, +) -> crate::error::Result { + let cancel_tx = quantus_subxt::api::tx().multisig().cancel(multisig_address, proposal_id); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + proposer_keypair, + cancel_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +/// Get multisig information +/// +/// # Returns +/// Multisig information or None if not found +#[allow(dead_code)] +pub async fn get_multisig_info( + quantus_client: &crate::chain::client::QuantusClient, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, +) -> crate::error::Result> { + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage_at = quantus_client.client().storage().at(latest_block_hash); + + // Query multisig data + let storage_query = + quantus_subxt::api::storage().multisig().multisigs(multisig_address.clone()); + let multisig_data = storage_at.fetch(&storage_query).await?; + + if let Some(data) = multisig_data { + // Query balance + let balance_query = + quantus_subxt::api::storage().system().account(multisig_address.clone()); + let account_info = storage_at.fetch(&balance_query).await?; + let balance = account_info.map(|info| info.data.free).unwrap_or(0); + + // Convert to SS58 + let multisig_bytes: &[u8; 32] = multisig_address.as_ref(); + let multisig_sp = SpAccountId32::from(*multisig_bytes); + let address = + multisig_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + let creator_bytes: &[u8; 32] = data.creator.as_ref(); + let creator_sp = SpAccountId32::from(*creator_bytes); + let creator = + creator_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + let signers: Vec = data + .signers + .0 + .iter() + .map(|signer| { + let signer_bytes: &[u8; 32] = signer.as_ref(); + let signer_sp = SpAccountId32::from(*signer_bytes); + signer_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)) + }) + .collect(); + + Ok(Some(MultisigInfo { + address, + balance, + threshold: data.threshold, + signers, + nonce: data.nonce, + proposal_nonce: data.proposal_nonce, + creator, + deposit: data.deposit, + last_activity: data.last_activity, + active_proposals: data.active_proposals, + })) + } else { + Ok(None) + } +} + +/// Get proposal information +/// +/// # Returns +/// Proposal information or None if not found +#[allow(dead_code)] +pub async fn get_proposal_info( + quantus_client: &crate::chain::client::QuantusClient, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, + proposal_id: u32, +) -> crate::error::Result> { + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage_at = quantus_client.client().storage().at(latest_block_hash); + + let storage_query = quantus_subxt::api::storage() + .multisig() + .proposals(multisig_address, proposal_id); + + let proposal_data = storage_at.fetch(&storage_query).await?; + + if let Some(data) = proposal_data { + let proposer_bytes: &[u8; 32] = data.proposer.as_ref(); + let proposer_sp = SpAccountId32::from(*proposer_bytes); + let proposer = + proposer_sp.to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + let approvals: Vec = data + .approvals + .0 + .iter() + .map(|approver| { + let approver_bytes: &[u8; 32] = approver.as_ref(); + let approver_sp = SpAccountId32::from(*approver_bytes); + approver_sp + .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)) + }) + .collect(); + + let status = match data.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => + ProposalStatus::Active, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Executed => + ProposalStatus::Executed, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => + ProposalStatus::Cancelled, + }; + + Ok(Some(ProposalInfo { + id: proposal_id, + proposer, + call_data: data.call.0, + expiry: data.expiry, + approvals, + deposit: data.deposit, + status, + })) + } else { + Ok(None) + } +} + +/// List all proposals for a multisig +/// +/// # Returns +/// List of proposals +#[allow(dead_code)] +pub async fn list_proposals( + quantus_client: &crate::chain::client::QuantusClient, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, +) -> crate::error::Result> { + let latest_block_hash = quantus_client.get_latest_block().await?; + let storage = quantus_client.client().storage().at(latest_block_hash); + + let address = quantus_subxt::api::storage() + .multisig() + .proposals_iter1(multisig_address.clone()); + let mut proposals_iter = storage.iter(address).await?; + + let mut proposals = Vec::new(); + + while let Some(result) = proposals_iter.next().await { + if let Ok(kv) = result { + // Extract proposal_id from key + let key_bytes = kv.key_bytes; + if key_bytes.len() >= 4 { + let id_bytes = &key_bytes[key_bytes.len() - 4..]; + let proposal_id = + u32::from_le_bytes([id_bytes[0], id_bytes[1], id_bytes[2], id_bytes[3]]); + + // Use value directly from iterator (more efficient) + let data = kv.value; + + let proposer_bytes: &[u8; 32] = data.proposer.as_ref(); + let proposer_sp = SpAccountId32::from(*proposer_bytes); + let proposer = proposer_sp + .to_ss58check_with_version(sp_core::crypto::Ss58AddressFormat::custom(189)); + + let approvals: Vec = data + .approvals + .0 + .iter() + .map(|approver| { + let approver_bytes: &[u8; 32] = approver.as_ref(); + let approver_sp = SpAccountId32::from(*approver_bytes); + approver_sp.to_ss58check_with_version( + sp_core::crypto::Ss58AddressFormat::custom(189), + ) + }) + .collect(); + + let status = match data.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => + ProposalStatus::Active, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Executed => + ProposalStatus::Executed, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => + ProposalStatus::Cancelled, + }; + + proposals.push(ProposalInfo { + id: proposal_id, + proposer, + call_data: data.call.0, + expiry: data.expiry, + approvals, + deposit: data.deposit, + status, + }); + } + } + } + + Ok(proposals) +} + +/// Dissolve a multisig (requires no proposals, zero balance) +/// +/// # Returns +/// Transaction hash +#[allow(dead_code)] +pub async fn dissolve_multisig( + quantus_client: &crate::chain::client::QuantusClient, + caller_keypair: &crate::wallet::QuantumKeyPair, + multisig_address: subxt::ext::subxt_core::utils::AccountId32, +) -> crate::error::Result { + let dissolve_tx = quantus_subxt::api::tx().multisig().dissolve_multisig(multisig_address); + + let execution_mode = ExecutionMode { finalized: false, wait_for_transaction: false }; + let tx_hash = crate::cli::common::submit_transaction( + quantus_client, + caller_keypair, + dissolve_tx, + None, + execution_mode, + ) + .await?; + + Ok(tx_hash) +} + +// ============================================================================ +// CLI HANDLERS (Internal) +// ============================================================================ + +/// Handle multisig command +pub async fn handle_multisig_command( + command: MultisigCommands, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + match command { + MultisigCommands::Create { signers, threshold, from, password, password_file } => + handle_create_multisig( + signers, + threshold, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await, + MultisigCommands::Propose(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, + }, + MultisigCommands::Approve { address, proposal_id, from, password, password_file } => + handle_approve( + 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, + } +} + +/// Create a new multisig account +async fn handle_create_multisig( + signers: String, + threshold: u32, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿ” {} Creating multisig...", "MULTISIG".bright_magenta().bold()); + + // Parse signers - convert to AccountId32 + let signer_addresses: Vec = signers + .split(',') + .map(|s| s.trim()) + .map(|addr| { + // Resolve wallet name or SS58 address to SS58 string + let ss58_str = crate::cli::common::resolve_address(addr)?; + // Convert SS58 to AccountId32 + let (account_id, _) = + SpAccountId32::from_ss58check_with_version(&ss58_str).map_err(|e| { + crate::error::QuantusError::Generic(format!( + "Invalid address '{}': {:?}", + addr, e + )) + })?; + // Convert to subxt AccountId32 + let bytes: [u8; 32] = *account_id.as_ref(); + Ok(subxt::ext::subxt_core::utils::AccountId32::from(bytes)) + }) + .collect::, crate::error::QuantusError>>()?; + + log_verbose!("Signers: {} addresses", signer_addresses.len()); + log_verbose!("Threshold: {}", threshold); + + // Validate inputs + if signer_addresses.is_empty() { + log_error!("โŒ At least one signer is required"); + return Err(crate::error::QuantusError::Generic("No signers provided".to_string())); + } + + if threshold == 0 { + log_error!("โŒ Threshold must be greater than zero"); + return Err(crate::error::QuantusError::Generic("Invalid threshold".to_string())); + } + + if threshold > signer_addresses.len() as u32 { + log_error!("โŒ Threshold cannot exceed number of signers"); + return Err(crate::error::QuantusError::Generic("Threshold too high".to_string())); + } + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let create_tx = quantus_subxt::api::tx() + .multisig() + .create_multisig(signer_addresses.clone(), threshold); + + // Submit transaction (will wait if execution_mode.wait_for_transaction = true) + let _tx_hash = crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + create_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Multisig creation transaction submitted"); + + // If wait_for_transaction, extract address from events + if execution_mode.wait_for_transaction { + log_print!(""); + log_print!("๐Ÿ” Looking for MultisigCreated event..."); + + // Query latest block events + let latest_block_hash = quantus_client.get_latest_block().await?; + let events = quantus_client.client().events().at(latest_block_hash).await?; + + // Find MultisigCreated event + let multisig_events = + events.find::(); + + let mut actual_address: Option = None; + for event_result in multisig_events { + match event_result { + Ok(ev) => { + let addr_bytes: &[u8; 32] = ev.multisig_address.as_ref(); + let addr = SpAccountId32::from(*addr_bytes); + actual_address = Some(addr.to_ss58check_with_version( + sp_core::crypto::Ss58AddressFormat::custom(189), + )); + log_verbose!("Found MultisigCreated event"); + break; + }, + Err(e) => { + log_verbose!("Error parsing event: {:?}", e); + }, + } + } + + if let Some(address) = actual_address { + log_print!(""); + log_success!("๐Ÿ“ Multisig address: {}", address.bright_cyan().bold()); + log_print!(""); + log_print!( + "๐Ÿ’ก {} You can now use this address to propose transactions", + "TIP".bright_blue().bold() + ); + log_print!( + " Example: quantus multisig propose transfer --address {} --to recipient --amount 1000000000000", + address.bright_cyan() + ); + } else { + log_error!("โš ๏ธ Couldn't find MultisigCreated event"); + log_print!(" Check events manually: quantus events --latest --pallet Multisig"); + } + } else { + log_print!(""); + log_print!( + "๐Ÿ’ก {} Transaction submitted. Check events for multisig address:", + "NOTE".bright_blue().bold() + ); + log_print!(" quantus events --latest --pallet Multisig"); + } + + log_print!(""); + + Ok(()) +} + +/// 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)?; + + // Build args as JSON array (using serde_json for proper escaping) + let args_json = serde_json::to_string(&vec![ + serde_json::Value::String(to_address), + serde_json::Value::String(amount_u128.to_string()), + ]) + .map_err(|e| crate::error::QuantusError::Generic(format!("Failed to serialize args: {}", e)))?; + + // Use the existing handle_propose with Balances::transfer_allow_death + handle_propose( + multisig_address, + "Balances".to_string(), + "transfer_allow_death".to_string(), + Some(args_json), + expiry, + from, + password, + password_file, + node_url, + execution_mode, + ) + .await +} + +/// Propose a custom transaction +async fn handle_propose( + multisig_address: String, + pallet: String, + 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(), + )); + } + + // Build the call data using runtime metadata + let call_data = build_runtime_call(&quantus_client, &pallet, &call, args_vec).await?; + + log_verbose!("Call data size: {} bytes", call_data.len()); + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Build transaction + let propose_tx = + quantus_subxt::api::tx().multisig().propose(multisig_address, call_data, expiry); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + propose_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Proposal submitted"); + log_print!(""); + log_print!("๐Ÿ’ก {} Check the events to find the proposal hash", "NOTE".bright_blue().bold()); + log_print!(""); + + Ok(()) +} + +/// Approve a proposal +async fn handle_approve( + multisig_address: String, + proposal_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); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + approve_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Approval submitted"); + log_print!(" If threshold is reached, the proposal will execute automatically"); + + Ok(()) +} + +/// Cancel a proposal +async fn handle_cancel( + multisig_address: String, + proposal_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); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + cancel_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Proposal cancelled and removed"); + 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); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + remove_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Expired proposal removed and deposit returned"); + + Ok(()) +} + +/// Claim all deposits (batch cleanup) +async fn handle_claim_deposits( + multisig_address: String, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿ’ฐ {} Claiming deposits...", "MULTISIG".bright_magenta().bold()); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let claim_tx = quantus_subxt::api::tx().multisig().claim_deposits(multisig_address); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + claim_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Deposits claimed"); + log_print!(" All removable proposals have been cleaned up"); + + Ok(()) +} + +/// Dissolve a multisig +async fn handle_dissolve( + multisig_address: String, + from: String, + password: Option, + password_file: Option, + node_url: &str, + execution_mode: ExecutionMode, +) -> crate::error::Result<()> { + log_print!("๐Ÿ—‘๏ธ {} Dissolving multisig...", "MULTISIG".bright_magenta().bold()); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Load keypair + let keypair = crate::wallet::load_keypair_from_wallet(&from, password, password_file)?; + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Build transaction + let dissolve_tx = quantus_subxt::api::tx().multisig().dissolve_multisig(multisig_address); + + // Submit transaction + crate::cli::common::submit_transaction( + &quantus_client, + &keypair, + dissolve_tx, + None, + execution_mode, + ) + .await?; + + log_success!("โœ… Multisig dissolved and deposit returned"); + + Ok(()) +} + +/// Query multisig information (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 = account_info.map(|info| info.data.free).unwrap_or(0); + + log_print!("๐Ÿ“‹ {} Information:", "MULTISIG".bright_green().bold()); + log_print!(" Address: {}", multisig_ss58.bright_cyan()); + log_print!(" Balance: {}", format_balance(balance).bright_green().bold()); + log_print!(" Threshold: {}", data.threshold.to_string().bright_yellow()); + log_print!(" Signers ({}):", data.signers.0.len().to_string().bright_yellow()); + for (i, signer) in data.signers.0.iter().enumerate() { + // Convert subxt AccountId32 to SS58 + let signer_bytes: &[u8; 32] = signer.as_ref(); + let signer_sp = SpAccountId32::from(*signer_bytes); + log_print!(" {}. {}", i + 1, signer_sp.to_ss58check().bright_cyan()); + } + log_print!(" Nonce: {}", data.nonce); + log_print!(" Proposal Nonce: {}", data.proposal_nonce); + // Convert creator to SS58 + let creator_bytes: &[u8; 32] = data.creator.as_ref(); + let creator_sp = SpAccountId32::from(*creator_bytes); + log_print!(" Creator: {}", creator_sp.to_ss58check().bright_cyan()); + log_print!(" Deposit: {} (locked)", format_balance(data.deposit)); + log_print!(" Last Activity: block {}", data.last_activity); + log_print!( + " Active Proposals: {}", + data.active_proposals.to_string().bright_yellow() + ); + }, + None => { + log_error!("โŒ Multisig not found at address: {}", multisig_ss58); + }, + } + + log_print!(""); + Ok(()) +} + +/// 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() + )) + }, + _ => { + // 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) => { + log_print!("๐Ÿ“ {} Information:", "PROPOSAL".bright_green().bold()); + log_print!( + " Current Block: {}", + current_block_number.to_string().bright_white().bold() + ); + log_print!(" Multisig: {}", multisig_ss58.bright_cyan()); + log_print!(" Proposal 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 + 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); + }, + } + + // 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::Executed => + "Executed".bright_blue(), + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => + "Cancelled".bright_red(), + } + ); + log_print!(" Approvals ({}):", data.approvals.0.len().to_string().bright_yellow()); + for (i, approver) in data.approvals.0.iter().enumerate() { + // Convert approver to SS58 + let approver_bytes: &[u8; 32] = approver.as_ref(); + let approver_sp = SpAccountId32::from(*approver_bytes); + log_print!(" {}. {}", i + 1, approver_sp.to_ss58check().bright_cyan()); + } + }, + None => { + log_error!("โŒ Proposal not found"); + }, + } + + log_print!(""); + Ok(()) +} + +/// List all proposals for a multisig +async fn handle_list_proposals( + multisig_address: String, + node_url: &str, +) -> crate::error::Result<()> { + log_print!("๐Ÿ“‹ {} Listing proposals...", "MULTISIG".bright_magenta().bold()); + log_print!(""); + + // Resolve multisig address + let multisig_ss58 = crate::cli::common::resolve_address(&multisig_address)?; + let (multisig_id, _) = + SpAccountId32::from_ss58check_with_version(&multisig_ss58).map_err(|e| { + crate::error::QuantusError::Generic(format!("Invalid multisig address: {:?}", e)) + })?; + let multisig_bytes: [u8; 32] = *multisig_id.as_ref(); + let multisig_address = subxt::ext::subxt_core::utils::AccountId32::from(multisig_bytes); + + // Connect to chain + let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; + + // Get latest block hash explicitly + let latest_block_hash = quantus_client.get_latest_block().await?; + + // Query all proposals for this multisig using prefix iteration + let storage = quantus_client.client().storage().at(latest_block_hash); + + // Use iter_key_values to iterate over the double map + let address = quantus_subxt::api::storage().multisig().proposals_iter1(multisig_address); + let mut proposals = storage.iter(address).await?; + + let mut count = 0; + let mut active_count = 0; + let mut executed_count = 0; + let mut cancelled_count = 0; + + while let Some(result) = proposals.next().await { + match result { + Ok(kv) => { + count += 1; + + let status_str = match kv.value.status { + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Active => { + active_count += 1; + "Active".bright_green() + }, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Executed => { + executed_count += 1; + "Executed".bright_blue() + }, + quantus_subxt::api::runtime_types::pallet_multisig::ProposalStatus::Cancelled => { + cancelled_count += 1; + "Cancelled".bright_red() + }, + }; + + // Extract 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!(" 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) + } +} diff --git a/src/lib.rs b/src/lib.rs index 95389b8..afd8090 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,6 +29,13 @@ pub use cli::send::{ batch_transfer, format_balance_with_symbol, get_balance, transfer, transfer_with_nonce, }; +// Re-export multisig functions for library usage +pub use cli::multisig::{ + approve_proposal, cancel_proposal, create_multisig, dissolve_multisig, get_multisig_info, + get_proposal_info, list_proposals, parse_amount as parse_multisig_amount, propose_custom, + propose_transfer, MultisigInfo, ProposalInfo, ProposalStatus, +}; + /// Library version pub const VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/src/quantus_metadata.scale b/src/quantus_metadata.scale index 0e8740a..faa3836 100644 Binary files a/src/quantus_metadata.scale and b/src/quantus_metadata.scale differ