diff --git a/Cargo.lock b/Cargo.lock index ecae963f..9fb3b335 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3183,8 +3183,7 @@ dependencies = [ "sp-runtime", "storage-client", "storage-primitives", - "subxt", - "subxt-signer", + "storage-subxt", "thiserror 2.0.18", "tokio", "tokio-test", @@ -7835,11 +7834,8 @@ dependencies = [ "hex", "reqwest", "s3-primitives", - "sp-core", - "sp-runtime", "storage-client", - "subxt", - "subxt-signer", + "storage-subxt", "thiserror 2.0.18", "tokio", "tracing", @@ -9593,11 +9589,9 @@ dependencies = [ "serde_json", "serde_with", "sp-core", - "sp-runtime", "storage-primitives", "storage-provider-node", - "subxt", - "subxt-signer", + "storage-subxt", "tempfile", "thiserror 2.0.18", "tokio", @@ -9775,12 +9769,11 @@ dependencies = [ "rocksdb", "serde", "serde_json", + "serde_with", "sp-core", - "sp-runtime", "storage-client", "storage-primitives", - "subxt", - "subxt-signer", + "storage-subxt", "tempfile", "thiserror 2.0.18", "tokio", @@ -9790,6 +9783,18 @@ dependencies = [ "tracing-subscriber 0.3.19", ] +[[package]] +name = "storage-subxt" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "subxt", + "subxt-core", + "subxt-signer", +] + [[package]] name = "strsim" version = "0.11.1" diff --git a/Cargo.toml b/Cargo.toml index dc71a8ef..6d63c25e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ members = [ "provider-node", "runtimes/web3-storage-local", "runtimes/web3-storage-paseo", + "storage-subxt", # Smart-contract precompiles (pallet_revive integration) "precompiles/drive-registry-precompile", @@ -41,6 +42,7 @@ storage-client = { path = "client" } storage-parachain-runtime = { path = "runtimes/web3-storage-local" } storage-primitives = { path = "primitives", default-features = false } storage-provider-node = { path = "provider-node" } +storage-subxt = { path = "storage-subxt" } # Storage Interfaces: File System Interface file-system-client = { path = "storage-interfaces/file-system/client" } @@ -164,6 +166,7 @@ rand = "0.8" # Subxt (chain interaction for off-chain clients) subxt = { version = "0.44.3" } +subxt-core = { version = "0.44.3", default-features = false } subxt-signer = { version = "0.44.3", features = ["sr25519"] } # Testing diff --git a/client/Cargo.toml b/client/Cargo.toml index 11f46d46..dacca8d6 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -15,7 +15,6 @@ serde = { workspace = true, features = ["std"] } serde_json = { workspace = true } serde_with = { workspace = true } sp-core = { workspace = true, features = ["std"] } -sp-runtime = { workspace = true, features = ["std"] } tokio = { workspace = true } base64 = { workspace = true } thiserror = { workspace = true } @@ -25,8 +24,7 @@ rand = { workspace = true } chacha20poly1305 = { workspace = true } hex = { workspace = true, features = ["std"] } async-trait = { workspace = true } -subxt = { workspace = true } -subxt-signer = { workspace = true } +storage-subxt = { workspace = true } futures = { workspace = true } [dev-dependencies] @@ -34,3 +32,6 @@ tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } storage-provider-node = { workspace = true } axum = { workspace = true } tempfile = { workspace = true } + +[features] +mainnet = ["storage-subxt/mainnet"] diff --git a/client/examples/complete_workflow.rs b/client/examples/complete_workflow.rs index 88b62cf2..b9dff136 100644 --- a/client/examples/complete_workflow.rs +++ b/client/examples/complete_workflow.rs @@ -20,14 +20,12 @@ //! provider_url - HTTP URL for the provider node (default: http://127.0.0.1:3333) //! user_seed - Seed of the paying user (default: //Bob) -use sp_core::crypto::Ss58Codec; -use sp_runtime::AccountId32; use std::env; use storage_client::{ AdminClient, ChunkingStrategy, ClientConfig, NegotiateRequest, ProviderClient, SignedTerms, StorageUserClient, }; -use subxt_signer::{sr25519::Keypair, SecretUri}; +use storage_subxt::subxt_signer::{sr25519::Keypair, SecretUri}; const DEFAULT_CHAIN_WS: &str = "ws://127.0.0.1:2222"; const DEFAULT_PROVIDER_URL: &str = "http://127.0.0.1:3333"; @@ -46,12 +44,12 @@ async fn main() -> Result<(), Box> { let user_seed = args.get(3).map(String::as_str).unwrap_or(DEFAULT_USER_SEED); let user_keypair = Keypair::from_uri(&user_seed.parse::()?)?; - let user_account = AccountId32::from(user_keypair.public_key().0); - let user_ss58 = user_account.to_ss58check(); + let user_account = user_keypair.public_key().to_account_id(); + let user_ss58 = user_account.to_string(); let provider_ss58 = ProviderClient::fetch_provider_id(provider_url) .await? - .to_ss58check(); + .to_string(); println!("=== Complete Storage Workflow ==="); println!("Chain WebSocket: {chain_ws}"); diff --git a/client/examples/register_provider.rs b/client/examples/register_provider.rs index 8fec8dc3..881599e3 100644 --- a/client/examples/register_provider.rs +++ b/client/examples/register_provider.rs @@ -14,10 +14,10 @@ //! multiaddr - Provider multiaddr (default: /ip4/127.0.0.1/tcp/3333) //! keyfile - Path to file containing seed (default: dev seed //Alice) -use sp_core::crypto::Ss58Codec; use std::env; -use storage_client::{ClientConfig, ProviderClient, ProviderSettings}; -use subxt_signer::{sr25519::Keypair, SecretUri}; +use storage_client::{ClientConfig, ProviderClient}; +use storage_subxt::api::runtime_types::pallet_storage_provider::pallet::ProviderSettings; +use storage_subxt::subxt_signer::{sr25519::Keypair, SecretUri}; const DEFAULT_CHAIN_WS: &str = "ws://127.0.0.1:2222"; const DEFAULT_PROVIDER_URL: &str = "http://127.0.0.1:3333"; @@ -52,8 +52,8 @@ async fn main() -> Result<(), Box> { // Derive SS58 address from the keypair for display and ProviderClient identity. let public_key_bytes = keypair.public_key().0; - let account = sp_runtime::AccountId32::from(public_key_bytes); - let ss58_address = account.to_ss58check(); + let account = storage_subxt::subxt::utils::AccountId32::from(public_key_bytes); + let ss58_address = account.to_string(); println!("=== Provider Registration ==="); println!("Chain WebSocket: {chain_ws}"); diff --git a/client/src/admin.rs b/client/src/admin.rs index 75c7b5e7..c06af9af 100644 --- a/client/src/admin.rs +++ b/client/src/admin.rs @@ -13,10 +13,14 @@ use crate::agreement::AgreementTermsOf; use crate::base::{BaseClient, ClientConfig, ClientError, ClientResult}; use crate::event_subscription::{EventParser, StorageEvent, StorageProviderEventParser}; use crate::substrate::{extrinsics, storage, SubstrateClient}; -use sp_core::H256; -use sp_runtime::MultiSignature; +use rt::pallet_storage_provider::pallet::Bucket; use storage_primitives::{BucketId, Commitment, EndAction, Role}; -use subxt::ext::scale_value::{Composite, ValueDef, Variant}; +use storage_subxt::api::runtime_types as rt; +use storage_subxt::api::runtime_types::pallet_storage_provider::runtime_api as rt_api; +use storage_subxt::api::runtime_types::sp_runtime::MultiSignature; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; +use storage_subxt::subxt_signer; /// Client for bucket administrators. pub struct AdminClient { @@ -109,7 +113,7 @@ impl AdminClient { terms.nonce, ); - let tx = extrinsics::establish_storage_agreement(provider_account, &terms, &sig); + let tx = extrinsics::establish_storage_agreement(provider_account, &terms, sig); let tx_progress = chain .api() @@ -451,11 +455,13 @@ impl AdminClient { nonce: u64, // nonce the providers signed over (echoed from their commitment) signatures: Vec<(String, Vec)>, // (provider SS58, signature bytes) ) -> ClientResult<()> { + // TODO: replace `nonce`, `signatures` with API call + let chain = self.base.chain()?; let signer = chain.signer()?; // Parse provider accounts - let parsed_sigs: Vec<(sp_runtime::AccountId32, Vec)> = signatures + let parsed_sigs: Vec<(AccountId32, Vec)> = signatures .into_iter() .map(|(account_str, sig)| { let account = SubstrateClient::parse_account(&account_str)?; @@ -490,7 +496,7 @@ impl AdminClient { // ═════════════════════════════════════════════════════════════════════════ /// Get bucket information. - pub async fn get_bucket_info(&self, bucket_id: BucketId) -> ClientResult { + pub async fn get_bucket_info(&self, bucket_id: BucketId) -> ClientResult { let chain = self.base.chain()?; let thunk = chain @@ -504,168 +510,29 @@ impl AdminClient { .map_err(|e| ClientError::Chain(format!("Failed to fetch bucket: {e}")))? .ok_or_else(|| ClientError::Chain(format!("Bucket {bucket_id} not found")))?; - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode bucket: {e}")))?; - - let min_providers = named_field(&value, "min_providers") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let frozen_start_seq = - named_field(&value, "frozen_start_seq").and_then(|v| match &v.value { - ValueDef::Variant(Variant { name, .. }) if name == "None" => None, - ValueDef::Variant(Variant { - name, - values: Composite::Unnamed(items), - }) if name == "Some" => items.first().and_then(|v| v.as_u128()).map(|n| n as u64), - _ => None, - }); - - let members = named_field(&value, "members") - .and_then(|v| match &v.value { - // BoundedVec is a newtype: Unnamed([inner_vec]) where inner_vec is Unnamed([entries...]). - // Peel one level to reach the actual Vec contents. - ValueDef::Composite(Composite::Unnamed(outer)) => { - outer.first().and_then(|inner| match &inner.value { - ValueDef::Composite(Composite::Unnamed(entries)) => Some(entries), - _ => None, - }) - } - _ => None, - }) - .map(|items| { - items - .iter() - .filter_map(|item| { - let account_bytes = - named_field(item, "account").and_then(decode_account_bytes)?; - let account = format!("0x{}", hex::encode(&account_bytes)); - let role = named_field(item, "role").and_then(|r| match &r.value { - ValueDef::Variant(Variant { name, .. }) => match name.as_str() { - "Admin" => Some(Role::Admin), - "Writer" => Some(Role::Writer), - "Reader" => Some(Role::Reader), - _ => None, - }, - _ => None, - })?; - Some(MemberInfo { account, role }) - }) - .collect() - }) - .unwrap_or_default(); - - let snapshot = named_field(&value, "snapshot").and_then(|v| match &v.value { - ValueDef::Variant(Variant { name, .. }) if name == "None" => None, - ValueDef::Variant(Variant { - name, - values: Composite::Unnamed(items), - }) if name == "Some" => { - let snap = items.first()?; - let mmr_root_bytes = named_field(snap, "mmr_root") - .and_then(decode_account_bytes) - .filter(|b| b.len() == 32)?; - let mut mmr_root = [0u8; 32]; - mmr_root.copy_from_slice(&mmr_root_bytes); - let start_seq = named_field(snap, "start_seq") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - let leaf_count = named_field(snap, "leaf_count") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - let checkpoint_block = named_field(snap, "checkpoint_block") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - Some(SnapshotInfo { - mmr_root: H256::from(mmr_root), - start_seq, - leaf_count, - checkpoint_block, - }) - } - _ => None, - }); - - Ok(BucketInfo { - bucket_id, - members, - frozen_start_seq, - min_providers, - snapshot, - }) + Ok(thunk) } /// List all agreements for a bucket. pub async fn list_bucket_agreements( &self, bucket_id: BucketId, - ) -> ClientResult> { + ) -> ClientResult> { let chain = self.base.chain()?; - let storage = chain + chain .api() - .storage() + .runtime_api() .at_latest() .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let mut iter = storage - .iter(storage::agreements_for_bucket(bucket_id)) + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))? + .call( + storage_subxt::api::apis() + .storage_provider_api() + .bucket_agreements(bucket_id), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate agreements: {e}")))?; - - let mut agreements = Vec::new(); - - while let Some(result) = iter.next().await { - let kv = - result.map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; - - // Key layout: [pallet_hash=16][storage_hash=16][blake2_128(bucket_id)=16][bucket_id=8] - // [blake2_128(provider)=16][provider=32]; provider at [72..104] - let key = &kv.key_bytes; - let provider = if key.len() >= 104 { - format!("0x{}", hex::encode(&key[72..104])) - } else { - String::new() - }; - - let value = match kv.value.to_value() { - Ok(v) => v, - Err(e) => { - tracing::warn!("Failed to decode agreement: {e}"); - continue; - } - }; - - let max_bytes = named_field(&value, "max_bytes") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - let payment_locked = named_field(&value, "payment_locked") - .and_then(|v| v.as_u128()) - .unwrap_or(0); - - let expires_at = named_field(&value, "expires_at") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let is_primary = named_field(&value, "role") - .map(|r| { - matches!(&r.value, ValueDef::Variant(Variant { name, .. }) if name == "Primary") - }) - .unwrap_or(false); - - agreements.push(AgreementInfo { - provider, - max_bytes, - payment_locked, - expires_at, - is_primary, - }); - } - - Ok(agreements) + .map_err(|e| ClientError::Chain(format!("bucket_agreements: {e}"))) } /// Get the buckets this admin account is a member of. @@ -687,102 +554,6 @@ impl AdminClient { return Ok(vec![]); }; - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode member buckets: {e}")))?; - - // BoundedVec is a newtype: Unnamed([inner_vec]) where inner_vec is Unnamed([entries...]). - let bucket_ids = match &value.value { - ValueDef::Composite(Composite::Unnamed(outer)) => outer - .first() - .and_then(|inner| match &inner.value { - ValueDef::Composite(Composite::Unnamed(entries)) => Some(entries), - _ => None, - }) - .map(|entries| { - entries - .iter() - .filter_map(|v| v.as_u128().map(|n| n as BucketId)) - .collect() - }) - .unwrap_or_default(), - _ => vec![], - }; - - Ok(bucket_ids) - } -} - -fn named_field<'a>( - value: &'a subxt::ext::scale_value::Value, - field: &str, -) -> Option<&'a subxt::ext::scale_value::Value> { - match &value.value { - ValueDef::Composite(Composite::Named(fields)) => { - fields.iter().find(|(n, _)| n == field).map(|(_, v)| v) - } - _ => None, + Ok(thunk.0) } } - -/// Decode raw bytes from a SCALE value, handling `AccountId32`'s newtype nesting. -/// -/// `AccountId32` is decoded by subxt as `Composite::Unnamed([Composite::Unnamed([byte × 32])])`. -/// This function recurses through any level of `Composite::Unnamed` wrapping to collect -/// all `Primitive::U128` leaf values as bytes. -fn decode_account_bytes(value: &subxt::ext::scale_value::Value) -> Option> { - let mut buf = Vec::new(); - collect_bytes_recursive(value, &mut buf); - if buf.is_empty() { - None - } else { - Some(buf) - } -} - -fn collect_bytes_recursive(value: &subxt::ext::scale_value::Value, buf: &mut Vec) { - use subxt::ext::scale_value::Primitive; - match &value.value { - ValueDef::Primitive(Primitive::U128(n)) => buf.push(*n as u8), - ValueDef::Composite(Composite::Unnamed(items)) => { - for item in items { - collect_bytes_recursive(item, buf); - } - } - _ => {} - } -} - -// Types - -#[derive(Debug, Clone)] -pub struct BucketInfo { - pub bucket_id: BucketId, - pub members: Vec, - pub frozen_start_seq: Option, - pub min_providers: u32, - pub snapshot: Option, -} - -#[derive(Debug, Clone)] -pub struct MemberInfo { - pub account: String, - pub role: Role, -} - -#[derive(Debug, Clone)] -pub struct SnapshotInfo { - pub mmr_root: H256, - pub start_seq: u64, - pub leaf_count: u64, - pub checkpoint_block: u32, -} - -#[derive(Debug, Clone)] -pub struct AgreementInfo { - pub provider: String, - pub max_bytes: u64, - pub payment_locked: u128, - pub expires_at: u32, - pub is_primary: bool, -} diff --git a/client/src/agreement.rs b/client/src/agreement.rs index 762cb1f9..f143bd8d 100644 --- a/client/src/agreement.rs +++ b/client/src/agreement.rs @@ -20,9 +20,10 @@ use serde::{Deserialize, Serialize}; use serde_with::{serde_as, DisplayFromStr, PickFirst}; -use sp_core::hashing::blake2_256; -use sp_runtime::{AccountId32, MultiSignature}; -use storage_primitives::{AgreementTerms, BucketId}; +use storage_primitives::{AgreementTerms, BucketId, ReplicaTerms}; +use storage_subxt::api::runtime_types::sp_runtime::MultiSignature; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt_signer; /// Concrete [`AgreementTerms`] type for the storage parachain. /// @@ -32,7 +33,7 @@ pub type AgreementTermsOf = AgreementTerms; /// Concrete `ReplicaTerms` matching the parachain's /// `(Balance, BlockNumber) = (u128, u32)`. -pub type ReplicaTermsOf = storage_primitives::ReplicaTerms; +pub type ReplicaTermsOf = ReplicaTerms; /// The owner proposes the agreement shape they want; the provider node /// allocates a fresh nonce and a validity window from its own state, @@ -82,16 +83,16 @@ pub fn sign_terms( keypair: &subxt_signer::sr25519::Keypair, terms: &AgreementTermsOf, ) -> MultiSignature { - let hash = blake2_256(&terms.signing_payload()); + let hash = sp_core::hashing::blake2_256(&terms.signing_payload()); let raw = keypair.sign(&hash); - MultiSignature::Sr25519(sp_core::sr25519::Signature::from_raw(raw.0)) + MultiSignature::Sr25519(raw.0) } /// Hex-bytes serde adapter for [`MultiSignature`] — SCALE-encode then hex. mod hex_multi_signature { + use super::MultiSignature; use codec::{Decode, Encode}; use serde::{Deserialize, Deserializer, Serializer}; - use sp_runtime::MultiSignature; pub fn serialize(sig: &MultiSignature, s: S) -> Result { s.serialize_str(&hex::encode(sig.encode())) @@ -103,41 +104,3 @@ mod hex_multi_signature { MultiSignature::decode(&mut &bytes[..]).map_err(serde::de::Error::custom) } } - -#[cfg(test)] -mod tests { - use super::*; - - // Rust clients serialize `max_bytes`/`price_per_byte` as raw JSON - // numbers. Regression test: the previous untagged-enum deserializer - // rejected any JSON number for the u128 field (serde's untagged - // buffering has no 128-bit support), surfacing as a 422 from - // `/negotiate` for every Rust caller. - #[test] - fn negotiate_request_roundtrips_rust_numbers() { - let req = NegotiateRequest { - owner: AccountId32::new([0u8; 32]), - max_bytes: 1_000_000_000, - duration: 500, - price_per_byte: 1, - bucket_id: None, - replica_params: None, - }; - let json = serde_json::to_string(&req).unwrap(); - let decoded: NegotiateRequest = serde_json::from_str(&json).unwrap(); - assert_eq!(decoded.max_bytes, req.max_bytes); - assert_eq!(decoded.price_per_byte, req.price_per_byte); - } - - // JS clients send BigInt fields as decimal strings (commit 17528eb). - #[test] - fn negotiate_request_accepts_js_bigint_strings() { - let json = format!( - r#"{{"owner":"{}","max_bytes":"1073741824","duration":50,"price_per_byte":"340282366920938463463374607431768211455","bucket_id":null,"replica_params":null}}"#, - AccountId32::new([0u8; 32]) - ); - let decoded: NegotiateRequest = serde_json::from_str(&json).unwrap(); - assert_eq!(decoded.max_bytes, 1_073_741_824); - assert_eq!(decoded.price_per_byte, u128::MAX); - } -} diff --git a/client/src/base.rs b/client/src/base.rs index e82265e1..7e9865fb 100644 --- a/client/src/base.rs +++ b/client/src/base.rs @@ -10,9 +10,8 @@ use crate::substrate::SubstrateClient; use reqwest::Client as HttpClient; -use serde::{Deserialize, Serialize}; use std::sync::Arc; -use subxt_signer::sr25519::Keypair; +use storage_subxt::subxt_signer::sr25519::Keypair; use thiserror::Error; /// Client errors. @@ -173,43 +172,6 @@ impl BaseClient { } } -// Common API types used across clients - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct ProviderInfo { - pub multiaddr: String, - pub stake: u128, - pub committed_bytes: u64, - pub price_per_byte: u128, - pub accepting_primary: bool, - pub reputation: u8, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct BucketInfo { - pub bucket_id: u64, - pub min_providers: u32, - pub frozen: bool, - pub snapshot: Option, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SnapshotInfo { - pub mmr_root: String, - pub start_seq: u64, - pub leaf_count: u64, - pub checkpoint_block: u32, -} - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct AgreementInfo { - pub provider: String, - pub max_bytes: u64, - pub payment_locked: u128, - pub expires_at: u32, - pub is_primary: bool, -} - /// Chunking strategy for data upload. #[derive(Debug, Clone, Copy)] pub enum ChunkingStrategy { diff --git a/client/src/block_subscription.rs b/client/src/block_subscription.rs index 90741096..5298d7a0 100644 --- a/client/src/block_subscription.rs +++ b/client/src/block_subscription.rs @@ -11,8 +11,8 @@ use crate::ClientError; use futures::Stream; use std::pin::Pin; use std::task::{Context, Poll}; -use subxt::blocks::Block; -use subxt::{OnlineClient, PolkadotConfig}; +use storage_subxt::subxt::blocks::Block; +use storage_subxt::subxt::{OnlineClient, PolkadotConfig}; use tokio::sync::mpsc; /// A finalized block as delivered by the subscription. diff --git a/client/src/challenger.rs b/client/src/challenger.rs index 1e1da80c..f793435a 100644 --- a/client/src/challenger.rs +++ b/client/src/challenger.rs @@ -10,12 +10,12 @@ use crate::base::{BaseClient, ClientConfig, ClientError, ClientResult}; use crate::substrate::{extrinsics, storage, SubstrateClient}; -use sp_runtime::AccountId32; use storage_primitives::{BucketId, ChunkLocation, Commitment}; -use subxt::blocks::ExtrinsicEvents; -use subxt::dynamic::At; -use subxt::ext::scale_value::{Composite, ValueDef}; -use subxt::PolkadotConfig; +use storage_subxt::api::runtime_types::storage_primitives::ChallengerStatRecord; +use storage_subxt::api::storage_provider::events::ChallengeCreated as EvChallengeCreated; +use storage_subxt::subxt::blocks::ExtrinsicEvents; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::PolkadotConfig; /// Client for challengers (third parties who verify data integrity). pub struct ChallengerClient { @@ -147,12 +147,13 @@ impl ChallengerClient { let chain = self.base.chain()?; let signer = chain.signer()?; - tracing::info!( - "Challenging {} on bucket {} using off-chain commitment (leaf {}, chunk {})", + tracing::debug!( + "Challenging {} on bucket {} using off-chain commitment (leaf index {}, chunk index {}) with nonce {}", provider, bucket_id, target.leaf_index, - target.chunk_index + target.chunk_index, + nonce ); // Parse provider account @@ -245,85 +246,35 @@ impl ChallengerClient { pub async fn list_my_challenges(&self) -> ClientResult> { let chain = self.base.chain()?; let challenger_account = SubstrateClient::parse_account(&self.challenger_account)?; - let challenger_bytes: &[u8] = challenger_account.as_ref(); - let storage = chain + let raw = chain .api() - .storage() + .runtime_api() .at_latest() .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let mut iter = storage - .iter(storage::all_challenges()) + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))? + .call( + storage_subxt::api::apis() + .storage_provider_api() + .challenger_challenges(challenger_account), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate challenges: {e}")))?; - - let mut challenges = Vec::new(); - - while let Some(result) = iter.next().await { - let kv = - result.map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; - - // Key layout: [twox128(pallet)=16][twox128(storage)=16][blake2_128(block)=16][block=4] - // deadline block at [48..52] - let key = &kv.key_bytes; - if key.len() < 52 { - continue; - } - let deadline = u32::from_le_bytes(key[48..52].try_into().unwrap_or([0u8; 4])); - - let value = match kv.value.to_value() { - Ok(v) => v, - Err(e) => { - tracing::warn!("Failed to decode challenges at block {deadline}: {e}"); - continue; - } - }; - - // Value is Vec> encoded as unnamed composite - let challenge_list = match &value.value { - ValueDef::Composite(Composite::Unnamed(items)) => items.clone(), - _ => continue, - }; - - for (idx, challenge_val) in challenge_list.iter().enumerate() { - let ch_bytes = named_field(challenge_val, "challenger") - .and_then(decode_account_bytes) - .unwrap_or_default(); - - if ch_bytes != challenger_bytes { - continue; - } - - let bucket_id = named_field(challenge_val, "bucket_id") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as BucketId; - - let provider_bytes = named_field(challenge_val, "provider") - .and_then(decode_account_bytes) - .unwrap_or_default(); - let provider = format!("0x{}", hex::encode(&provider_bytes)); - - let deposit = named_field(challenge_val, "deposit") - .and_then(|v| v.as_u128()) - .unwrap_or(0); - - challenges.push(ChallengeInfo { - challenge_id: ChallengeId { - deadline, - index: idx as u16, - }, - bucket_id, - provider, - deadline, - deposit, - status: ChallengeStatus::Pending, - }); - } - } - - Ok(challenges) + .map_err(|e| ClientError::Chain(format!("challenger_challenges: {e}")))?; + + Ok(raw + .into_iter() + .map(|c| ChallengeInfo { + challenge_id: ChallengeId { + deadline: c.deadline, + index: c.index, + }, + bucket_id: c.bucket_id, + provider: format!("0x{}", hex::encode(&c.provider)), + deadline: c.deadline, + deposit: c.deposit, + status: ChallengeStatus::Pending, + }) + .collect()) } /// Analyze a provider to decide whether to challenge them. @@ -351,21 +302,8 @@ impl ChallengerClient { .await .map_err(|e| ClientError::Chain(format!("Failed to fetch provider: {e}")))?; - let (challenges_received, challenges_failed) = if let Some(thunk) = provider_thunk { - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode provider: {e}")))?; - - let stats = named_field(&value, "stats"); - let received = stats - .and_then(|s| named_field(s, "challenges_received")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - let failed = stats - .and_then(|s| named_field(s, "challenges_failed")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - (received, failed) + let (challenges_received, challenges_failed) = if let Some(p) = provider_thunk { + (p.stats.challenges_received, p.stats.challenges_failed) } else { return Err(ClientError::Chain(format!("Provider {provider} not found"))); }; @@ -385,23 +323,12 @@ impl ChallengerClient { .await .map_err(|e| ClientError::Chain(format!("Failed to fetch bucket: {e}")))?; - if let Some(thunk) = bucket_thunk { - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode bucket: {e}")))?; - - let checkpoint_block = named_field(&value, "snapshot") - .and_then(|snap| match &snap.value { - ValueDef::Variant(v) if v.name == "Some" => match &v.values { - Composite::Unnamed(items) => items.first(), - _ => None, - }, - _ => None, - }) - .and_then(|s| named_field(s, "checkpoint_block")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - + if let Some(bucket) = bucket_thunk { + let checkpoint_block = bucket + .snapshot + .as_ref() + .map(|s| s.checkpoint_block) + .unwrap_or(0); current_block.saturating_sub(checkpoint_block) } else { 0 @@ -450,89 +377,60 @@ impl ChallengerClient { let chain = self.base.chain()?; - // Step 1: collect all (bucket_id, provider_bytes) from active agreements - let mut candidates: Vec<(BucketId, Vec)> = { - let storage = chain - .api() - .storage() - .at_latest() - .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; + let rt_api = chain + .api() + .runtime_api() + .at_latest() + .await + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))?; - let mut iter = storage - .iter(storage::all_storage_agreements()) + // Step 1: enumerate all providers and score by reputation; collect those below + // the threshold along with one of their active agreement bucket_ids. + const PAGE: u32 = 256; + let mut scored: Vec<(BucketId, AccountId32, u8)> = Vec::new(); + let mut seen: std::collections::HashSet<[u8; 32]> = std::collections::HashSet::new(); + let mut offset = 0u32; + + loop { + let page = rt_api + .call( + storage_subxt::api::apis() + .storage_provider_api() + .providers(offset, PAGE), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate agreements: {e}")))?; + .map_err(|e| ClientError::Chain(format!("providers: {e}")))?; + let done = (page.len() as u32) < PAGE; - let mut raw: Vec<(BucketId, Vec)> = Vec::new(); - let mut seen = std::collections::HashSet::new(); - - while let Some(result) = iter.next().await { - let kv = result - .map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; - - // Key layout: [pallet=16][storage=16][blake2_128(bucket_id)=16][bucket_id=8] - // [blake2_128(provider)=16][provider=32] - let key = &kv.key_bytes; - if key.len() < 104 { + for (account, info) in page { + if !seen.insert(account.0) { continue; } - - let bucket_id = - u64::from_le_bytes(key[48..56].try_into().unwrap_or([0u8; 8])) as BucketId; - let provider_bytes = key[72..104].to_vec(); - - if seen.insert(provider_bytes.clone()) { - raw.push((bucket_id, provider_bytes)); + let rep = reputation_score(info.challenges_received, info.challenges_failed); + if rep >= min_reputation_threshold { + continue; + } + let agreements = rt_api + .call( + storage_subxt::api::apis() + .storage_provider_api() + .provider_agreements(account.clone()), + ) + .await + .map_err(|e| ClientError::Chain(format!("provider_agreements: {e}")))?; + if let Some(a) = agreements.into_iter().next() { + scored.push((a.bucket_id, account, rep)); } } - raw - }; - - // Step 2: score each provider, keep only those below the threshold - let storage = chain - .api() - .storage() - .at_latest() - .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let mut scored: Vec<(BucketId, AccountId32, u8)> = Vec::new(); - - for (bucket_id, provider_bytes) in &candidates { - let Ok(arr) = <[u8; 32]>::try_from(provider_bytes.as_slice()) else { - continue; - }; - let account = AccountId32::from(arr); - - let Ok(Some(thunk)) = storage.fetch(&storage::provider_info(&account)).await else { - continue; - }; - - let Ok(value) = thunk.to_value() else { - continue; - }; - - let stats = named_field(&value, "stats"); - let received = stats - .and_then(|s| named_field(s, "challenges_received")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - let failed = stats - .and_then(|s| named_field(s, "challenges_failed")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let rep = reputation_score(received, failed); - if rep < min_reputation_threshold { - scored.push((*bucket_id, account, rep)); + if done { + break; } + offset += PAGE; } // Sort by worst reputation first scored.sort_by_key(|(_, _, rep)| *rep); - candidates.truncate(max_challenges_per_round); // Step 3: submit challenges let mut challenge_ids = Vec::new(); @@ -579,67 +477,6 @@ impl ChallengerClient { Ok(challenge_ids) } - /// Check if a challenge has been settled. - /// - /// Challenge rewards are distributed automatically by the chain in `on_finalize` - /// when the response deadline passes without a valid response from the provider. - /// Returns `None` if the challenge is still pending or has already been settled - /// (reward auto-distributed). The exact reward amount is not available on-chain - /// after settlement without querying historical events. - pub async fn check_and_claim_reward( - &self, - challenge_id: ChallengeId, - ) -> ClientResult> { - let chain = self.base.chain()?; - - let thunk = chain - .api() - .storage() - .at_latest() - .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))? - .fetch(&storage::challenges(challenge_id.deadline)) - .await - .map_err(|e| ClientError::Chain(format!("Failed to fetch challenges: {e}")))?; - - let Some(thunk) = thunk else { - // No entry at this deadline block — all challenges there were settled - tracing::info!( - "Challenge (deadline={}, index={}) has been settled (no longer in storage)", - challenge_id.deadline, - challenge_id.index - ); - return Ok(None); - }; - - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode challenges: {e}")))?; - - let still_exists = match &value.value { - ValueDef::Composite(Composite::Unnamed(items)) => { - (challenge_id.index as usize) < items.len() - } - _ => false, - }; - - if still_exists { - tracing::info!( - "Challenge (deadline={}, index={}) is still pending", - challenge_id.deadline, - challenge_id.index - ); - Ok(None) // Pending — no reward yet - } else { - tracing::info!( - "Challenge (deadline={}, index={}) has been settled", - challenge_id.deadline, - challenge_id.index - ); - Ok(None) // Settled — reward was auto-distributed on-chain - } - } - // ═════════════════════════════════════════════════════════════════════════ // Analytics // ═════════════════════════════════════════════════════════════════════════ @@ -664,49 +501,19 @@ impl ChallengerClient { /// Read this account's `ChallengerStats` record from chain. Returns a /// zeroed record (matching the pallet's `ValueQuery` default) if the /// account has never opened a challenge. - async fn fetch_challenger_stats(&self) -> ClientResult { + async fn fetch_challenger_stats(&self) -> ClientResult { let chain = self.base.chain()?; let challenger_account = SubstrateClient::parse_account(&self.challenger_account)?; - let challenger_bytes: &[u8] = challenger_account.as_ref(); - let storage = chain + chain .api() .storage() .at_latest() .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let query = subxt::dynamic::storage( - "StorageProvider", - "ChallengerStats", - vec![subxt::dynamic::Value::from_bytes(challenger_bytes)], - ); - - let value = match storage - .fetch(&query) + .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))? + .fetch_or_default(&storage::challenger_stats(&challenger_account)) .await - .map_err(|e| ClientError::Chain(format!("Failed to fetch ChallengerStats: {e}")))? - { - Some(v) => v, - None => return Ok(FetchedChallengerStats::default()), - }; - - let decoded = value - .to_value() - .map_err(|e| ClientError::Chain(format!("Decode ChallengerStats: {e}")))?; - - fn read_u128(value: &subxt::ext::scale_value::Value, field: &str) -> Option { - named_field(value, field).and_then(|v| match &v.value { - ValueDef::Primitive(subxt::ext::scale_value::Primitive::U128(n)) => Some(*n), - _ => None, - }) - } - - Ok(FetchedChallengerStats { - total_challenges: read_u128(&decoded, "total_challenges").unwrap_or(0) as u32, - successful_challenges: read_u128(&decoded, "successful_challenges").unwrap_or(0) as u32, - failed_challenges: read_u128(&decoded, "failed_challenges").unwrap_or(0) as u32, - }) + .map_err(|e| ClientError::Chain(format!("Failed to fetch ChallengerStats: {e}"))) } /// Find the most profitable providers to challenge, ranked by expected value. @@ -716,110 +523,86 @@ impl ChallengerClient { pub async fn find_challenge_targets(&self, limit: usize) -> ClientResult> { let chain = self.base.chain()?; - // Step 1: collect unique (bucket_id, provider_bytes) from all agreements - let candidates: Vec<(BucketId, Vec)> = { - let storage = chain - .api() - .storage() - .at_latest() - .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; + let rt_api = chain + .api() + .runtime_api() + .at_latest() + .await + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))?; - let mut iter = storage - .iter(storage::all_storage_agreements()) + // Enumerate all providers; score and collect those below the 90-rep threshold. + const PAGE: u32 = 256; + let mut targets: Vec = Vec::new(); + let mut seen: std::collections::HashSet<[u8; 32]> = std::collections::HashSet::new(); + let mut offset = 0u32; + + loop { + let page = rt_api + .call( + storage_subxt::api::apis() + .storage_provider_api() + .providers(offset, PAGE), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate agreements: {e}")))?; - - let mut raw: Vec<(BucketId, Vec)> = Vec::new(); - let mut seen = std::collections::HashSet::new(); - - while let Some(result) = iter.next().await { - let kv = result - .map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; + .map_err(|e| ClientError::Chain(format!("providers: {e}")))?; + let done = (page.len() as u32) < PAGE; - let key = &kv.key_bytes; - if key.len() < 104 { + for (account, info) in page { + if !seen.insert(account.0) { continue; } - let bucket_id = - u64::from_le_bytes(key[48..56].try_into().unwrap_or([0u8; 8])) as BucketId; - let provider_bytes = key[72..104].to_vec(); + let stake = info.stake; + let received = info.challenges_received; + let failed = info.challenges_failed; - if seen.insert(provider_bytes.clone()) { - raw.push((bucket_id, provider_bytes)); - } - } + let rep = reputation_score(received, failed); - raw - }; - - // Step 2: score each provider - let storage = chain - .api() - .storage() - .at_latest() - .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; + // Providers below 90 reputation are worth considering + if rep >= 90 { + continue; + } - let mut targets: Vec = Vec::new(); + let agreements = rt_api + .call( + storage_subxt::api::apis() + .storage_provider_api() + .provider_agreements(account.clone()), + ) + .await + .map_err(|e| ClientError::Chain(format!("provider_agreements: {e}")))?; - for (bucket_id, provider_bytes) in &candidates { - let Ok(arr) = <[u8; 32]>::try_from(provider_bytes.as_slice()) else { - continue; - }; - let account = AccountId32::from(arr); - - let Ok(Some(thunk)) = storage.fetch(&storage::provider_info(&account)).await else { - continue; - }; - - let Ok(value) = thunk.to_value() else { - continue; - }; - - let stake = named_field(&value, "stake") - .and_then(|v| v.as_u128()) - .unwrap_or(0); - - let stats = named_field(&value, "stats"); - let received = stats - .and_then(|s| named_field(s, "challenges_received")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - let failed = stats - .and_then(|s| named_field(s, "challenges_failed")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let rep = reputation_score(received, failed); - - // Providers below 90 reputation are worth considering - if rep >= 90 { - continue; + let Some(a) = agreements.into_iter().next() else { + continue; + }; + + // Rough reward estimate: ~10% of stake gets slashed on failure + let potential_reward = stake / 10; + + // Success probability is inverse of their historic defense rate + let fail_rate = if received == 0 { + 0.1 // assume 10% base risk for untested providers + } else { + failed as f64 / received as f64 + }; + // Higher fail_rate = higher success probability for challenger + let success_probability = (fail_rate * 0.8 + 0.1).min(1.0); + + let expected_value = (potential_reward as f64 * success_probability) as u128; + + targets.push(ChallengeTarget { + provider: format!("0x{}", hex::encode(account.0)), + bucket_id: a.bucket_id, + potential_reward, + success_probability, + expected_value, + }); } - // Rough reward estimate: ~10% of stake gets slashed on failure - let potential_reward = stake / 10; - - // Success probability is inverse of their historic defense rate - let fail_rate = if received == 0 { - 0.1 // assume 10% base risk for untested providers - } else { - failed as f64 / received as f64 - }; - // Higher fail_rate = higher success probability for challenger - let success_probability = (fail_rate * 0.8 + 0.1).min(1.0); - - let expected_value = (potential_reward as f64 * success_probability) as u128; - - targets.push(ChallengeTarget { - provider: format!("0x{}", hex::encode(provider_bytes)), - bucket_id: *bucket_id, - potential_reward, - success_probability, - expected_value, - }); + if done { + break; + } + offset += PAGE; } // Rank by expected value descending @@ -838,37 +621,11 @@ impl ChallengerClient { for event in events.iter() { let event = event.map_err(|e| ClientError::Chain(format!("Failed to decode event: {e}")))?; - - if event.pallet_name() == "StorageProvider" - && event.variant_name() == "ChallengeCreated" - { - let fields = event.field_values().map_err(|e| { - ClientError::Chain(format!("Failed to decode event fields: {e}")) - })?; - - // fields is a scale_value::Value — navigate the composite - // ChallengeCreated { challenge_id: { deadline, index }, ... } - let challenge_id_val = fields.at("challenge_id").ok_or_else(|| { - ClientError::Chain( - "ChallengeCreated event missing challenge_id field".to_string(), - ) - })?; - - let deadline = challenge_id_val - .at("deadline") - .and_then(|v| v.as_u128()) - .ok_or_else(|| { - ClientError::Chain("ChallengeCreated: cannot parse deadline".to_string()) - })? as u32; - - let index = challenge_id_val - .at("index") - .and_then(|v| v.as_u128()) - .ok_or_else(|| { - ClientError::Chain("ChallengeCreated: cannot parse index".to_string()) - })? as u16; - - return Ok(ChallengeId { deadline, index }); + if let Some(e) = event.as_event::().ok().flatten() { + return Ok(ChallengeId { + deadline: e.challenge_id.deadline, + index: e.challenge_id.index, + }); } } @@ -882,27 +639,6 @@ impl ChallengerClient { // Private helpers // ───────────────────────────────────────────────────────────────────────────── -fn named_field<'a>( - value: &'a subxt::ext::scale_value::Value, - field: &str, -) -> Option<&'a subxt::ext::scale_value::Value> { - match &value.value { - ValueDef::Composite(Composite::Named(fields)) => { - fields.iter().find(|(n, _)| n == field).map(|(_, v)| v) - } - _ => None, - } -} - -fn decode_account_bytes(value: &subxt::ext::scale_value::Value) -> Option> { - match &value.value { - ValueDef::Composite(Composite::Unnamed(items)) if items.len() == 32 => { - items.iter().map(|b| b.as_u128().map(|n| n as u8)).collect() - } - _ => None, - } -} - /// Compute a 0–100 reputation score from on-chain challenge stats. /// Providers with no recorded challenges score 100 (benefit of the doubt). fn reputation_score(challenges_received: u32, challenges_failed: u32) -> u8 { @@ -967,16 +703,6 @@ pub struct ChallengeStats { pub avg_response_time: u32, } -/// Internal: the raw `ChallengerStatRecord` shape pulled from chain. -/// Public callers see `ChallengeStats` which wraps these counters with the -/// `avg_response_time` field the SDK historically exposed. -#[derive(Debug, Clone, Default)] -struct FetchedChallengerStats { - total_challenges: u32, - successful_challenges: u32, - failed_challenges: u32, -} - #[derive(Debug, Clone)] pub struct ChallengeTarget { pub provider: String, diff --git a/client/src/checkpoint.rs b/client/src/checkpoint.rs index 87899f58..a72c3494 100644 --- a/client/src/checkpoint.rs +++ b/client/src/checkpoint.rs @@ -34,14 +34,14 @@ use crate::checkpoint_persistence::{ }; use crate::substrate::SubstrateClient; use crate::{ClientError, CommitmentResponse}; -use sp_core::H256; -use sp_runtime::AccountId32; -use std::collections::{HashMap, VecDeque}; +use std::collections::{BTreeMap, HashMap, VecDeque}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::{Duration, Instant}; use storage_primitives::{BucketId, ChunkLocation}; -use subxt::dynamic::Value; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; +use storage_subxt::subxt_signer; use tokio::sync::{mpsc, RwLock}; // ============================================================================ @@ -231,6 +231,8 @@ pub struct CommitmentCollection { pub start_seq: u64, /// Number of leaves in the MMR. pub leaf_count: u64, + /// The block at which the provider signed. Recency-checked to prevent replay. + pub nonce: u64, /// Signatures from agreeing providers: (account_id, signature_bytes). pub signatures: Vec<(AccountId32, Vec)>, /// Providers that agreed on the majority root. @@ -701,11 +703,20 @@ pub struct CheckpointManager { /// Cached provider info per bucket. provider_cache: Arc>>, /// Provider health history tracking. - health_history: Arc>>, + /// + /// Keyed by the raw `[u8; 32]` account bytes (`AccountId32.0`) rather than + /// `AccountId32` itself: `subxt`'s `AccountId32` does not implement `Hash` + /// (only `Eq`/`Ord`), so it cannot be used directly as a `HashMap` key. + /// `[u8; 32]` has the same identity and already implements `Hash`, keeping + /// O(1) lookups instead of falling back to a `BTreeMap`. + health_history: Arc>>, /// Metrics tracking. metrics: Arc>, /// Conflict history for auto-challenge analysis. - conflict_history: Arc>>>, + /// + /// See `health_history` above for why the key is `[u8; 32]` instead of + /// `AccountId32`. + conflict_history: Arc>>>, /// Auto-challenge configuration. auto_challenge_config: AutoChallengeConfig, } @@ -811,7 +822,7 @@ impl CheckpointManager { .iter() .enumerate() .map(|(i, endpoint)| ProviderInfo { - account_id: AccountId32::new([i as u8; 32]), // Placeholder + account_id: AccountId32([i as u8; 32]), // Placeholder endpoint: endpoint.clone(), public_key: Vec::new(), last_seen: None, @@ -1212,10 +1223,22 @@ impl CheckpointManager { ))); } + // `nonce` is the recency-checked block providers sign over (see + // `CommitmentPayload::new`); it must be shared across every provider + // query and the eventual on-chain `checkpoint` submission. + let nonce = self + .chain_client + .api() + .blocks() + .at_latest() + .await + .map_err(|e| ClientError::Chain(format!("Failed to get latest block: {e}")))? + .number() as u64; + // Query all providers in parallel let futures: Vec<_> = providers .iter() - .map(|p| self.query_provider_commitment(p, bucket_id)) + .map(|p| self.query_provider_commitment(p, bucket_id, nonce)) .collect(); let results = futures::future::join_all(futures).await; @@ -1281,6 +1304,7 @@ impl CheckpointManager { start_seq, leaf_count, signatures, + nonce, agreeing_providers: agreeing.iter().map(|(id, _)| id.clone()).collect(), disagreeing_providers: disagreeing, unreachable_providers: unreachable, @@ -1292,13 +1316,17 @@ impl CheckpointManager { &self, provider: &ProviderInfo, bucket_id: BucketId, + nonce: u64, ) -> Result { let mut retries = 0; let mut delay = self.config.retry_delay; let start = Instant::now(); loop { - let url = format!("{}/commitment?bucket_id={}", provider.endpoint, bucket_id); + let url = format!( + "{}/commitment?bucket_id={}&nonce={}", + provider.endpoint, bucket_id, nonce + ); let result = tokio::time::timeout(self.config.provider_timeout, async { self.http_client.get(&url).send().await @@ -1434,37 +1462,16 @@ impl CheckpointManager { let api = self.chain_client.api(); let signer = self.chain_client.signer()?; - // Build signatures array for the extrinsic - // Format: Vec<(AccountId, MultiSignature)> - let signatures_value: Vec = collection - .signatures - .iter() - .map(|(account_id, sig_bytes)| { - // Create tuple (AccountId, MultiSignature) - Value::unnamed_composite(vec![ - Value::from_bytes(account_id.as_ref() as &[u8]), - // MultiSignature::Sr25519(Signature) - Value::unnamed_variant("Sr25519", vec![Value::from_bytes(sig_bytes)]), - ]) - }) - .collect(); - - // Build the extrinsic - let tx = subxt::dynamic::tx( - "StorageProvider", - "submit_commitment", - vec![ - // bucket_id: u64 - Value::u128(collection.bucket_id as u128), - // mmr_root: H256 - Value::from_bytes(collection.mmr_root.as_bytes()), - // start_seq: u64 - Value::u128(collection.start_seq as u128), - // leaf_count: u64 - Value::u128(collection.leaf_count as u128), - // signatures: Vec<(AccountId, MultiSignature)> - Value::unnamed_composite(signatures_value), - ], + let commitment = storage_primitives::Commitment { + mmr_root: collection.mmr_root, + start_seq: collection.start_seq, + leaf_count: collection.leaf_count, + }; + let tx = crate::substrate::extrinsics::checkpoint( + collection.bucket_id, + commitment, + collection.nonce, + collection.signatures.clone(), ); // Submit and wait for finalization @@ -1675,7 +1682,7 @@ impl CheckpointManager { async fn record_provider_success(&self, account_id: &AccountId32, response_time_ms: u64) { let mut history = self.health_history.write().await; let entry = history - .entry(account_id.clone()) + .entry(account_id.0) .or_insert_with(|| ProviderHealthHistory::new(account_id.clone())); entry.record_success(response_time_ms); } @@ -1684,7 +1691,7 @@ impl CheckpointManager { async fn record_provider_failure(&self, account_id: &AccountId32, error: String) { let mut history = self.health_history.write().await; let entry = history - .entry(account_id.clone()) + .entry(account_id.0) .or_insert_with(|| ProviderHealthHistory::new(account_id.clone())); entry.record_failure(error); } @@ -1695,7 +1702,7 @@ impl CheckpointManager { account_id: &AccountId32, ) -> Option { let history = self.health_history.read().await; - history.get(account_id).cloned() + history.get(&account_id.0).cloned() } /// Get health history for all known providers. @@ -1716,7 +1723,7 @@ impl CheckpointManager { .into_iter() .map(|p| { let score = history - .get(&p.account_id) + .get(&p.account_id.0) .map(|h| h.success_rate()) .unwrap_or(0.5); // Unknown providers get neutral score (p, score) @@ -1741,7 +1748,7 @@ impl CheckpointManager { .iter() .filter(|p| { history - .get(&p.account_id) + .get(&p.account_id.0) .map(|h| h.is_healthy()) .unwrap_or(true) // Unknown is considered potentially healthy }) @@ -1790,7 +1797,7 @@ impl CheckpointManager { // Store in conflict history for auto-challenge analysis let mut history = self.conflict_history.write().await; for conflicting in &conflict.conflicts { - let key = (bucket_id, conflicting.account_id.clone()); + let key = (bucket_id, conflicting.account_id.0); history .entry(key) .or_insert_with(Vec::new) @@ -1820,6 +1827,10 @@ impl CheckpointManager { .collect(); for ((_, provider), conflicts) in bucket_conflicts { + // Reconstruct `AccountId32` from the raw bytes used as the map + // key (see `conflict_history` field doc). + let provider = AccountId32(*provider); + // Check if enough conflicts to consider challenge if conflicts.len() < self.auto_challenge_config.min_conflict_count as usize { continue; @@ -1829,14 +1840,14 @@ impl CheckpointManager { let divergence_count = conflicts .iter() .flat_map(|c| &c.conflicts) - .filter(|c| c.account_id == *provider) + .filter(|c| c.account_id == provider) .filter(|c| matches!(c.conflict_type, ConflictType::DataDivergence)) .count(); let sync_delay_count = conflicts .iter() .flat_map(|c| &c.conflicts) - .filter(|c| c.account_id == *provider) + .filter(|c| c.account_id == provider) .filter(|c| matches!(c.conflict_type, ConflictType::SyncDelay { .. })) .count(); @@ -1847,7 +1858,7 @@ impl CheckpointManager { if let Some(provider_conflict) = latest_conflict .conflicts .iter() - .find(|c| c.account_id == *provider) + .find(|c| c.account_id == provider) { recommendations.push(ChallengeRecommendation { provider: provider.clone(), @@ -1885,7 +1896,7 @@ impl CheckpointManager { if let Some(provider_conflict) = latest_conflict .conflicts .iter() - .find(|c| c.account_id == *provider) + .find(|c| c.account_id == provider) { if let ConflictType::SyncDelay { behind_by } = provider_conflict.conflict_type @@ -1961,7 +1972,7 @@ impl CheckpointManager { pub async fn get_conflict_count(&self, bucket_id: BucketId, provider: &AccountId32) -> usize { let history = self.conflict_history.read().await; history - .get(&(bucket_id, provider.clone())) + .get(&(bucket_id, provider.0)) .map(|v| v.len()) .unwrap_or(0) } @@ -2083,7 +2094,7 @@ impl CheckpointManager { // Clear conflict history for this provider since we've challenged them let mut history = self.conflict_history.write().await; - history.remove(&(bucket_id, recommendation.provider.clone())); + history.remove(&(bucket_id, recommendation.provider.0)); // Update metrics let mut metrics = self.metrics.write().await; @@ -2405,7 +2416,15 @@ impl CheckpointManager { /// /// Useful for custom persistence implementations or debugging. pub async fn export_state(&self) -> PersistedCheckpointState { - let health_histories = self.health_history.read().await; + // `with_health_histories` takes a `BTreeMap`; re-key + // from our `[u8; 32]`-keyed storage (see `health_history` field doc). + let health_histories: BTreeMap = self + .health_history + .read() + .await + .values() + .map(|history| (history.account_id.clone(), history.clone())) + .collect(); let metrics = self.metrics.read().await; StateBuilder::new() @@ -2423,7 +2442,7 @@ impl CheckpointManager { let mut health_histories = self.health_history.write().await; for persisted in state.health_histories.values() { let history = persisted.to_health_history()?; - health_histories.insert(history.account_id.clone(), history); + health_histories.insert(history.account_id.0, history); } } @@ -2445,7 +2464,7 @@ impl CheckpointManager { /// Get a copy of all provider health histories. /// /// Useful for monitoring and diagnostics. - pub async fn get_health_histories(&self) -> HashMap { + pub async fn get_health_histories(&self) -> HashMap<[u8; 32], ProviderHealthHistory> { self.health_history.read().await.clone() } @@ -2454,7 +2473,7 @@ impl CheckpointManager { &self, provider: &AccountId32, ) -> Option { - self.health_history.read().await.get(provider).cloned() + self.health_history.read().await.get(&provider.0).cloned() } /// Clear all conflict history for all buckets. @@ -2570,7 +2589,7 @@ mod tests { #[test] fn test_health_history_new() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let history = ProviderHealthHistory::new(account.clone()); assert_eq!(history.account_id, account); @@ -2586,7 +2605,7 @@ mod tests { #[test] fn test_health_history_record_success() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let mut history = ProviderHealthHistory::new(account); history.record_success(100); @@ -2605,7 +2624,7 @@ mod tests { #[test] fn test_health_history_record_failure() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let mut history = ProviderHealthHistory::new(account); history.record_failure("Connection refused".to_string()); @@ -2621,7 +2640,7 @@ mod tests { #[test] fn test_health_history_success_resets_consecutive_failures() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let mut history = ProviderHealthHistory::new(account); history.record_failure("Error 1".to_string()); @@ -2634,7 +2653,7 @@ mod tests { #[test] fn test_health_history_success_rate() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let mut history = ProviderHealthHistory::new(account); // No requests = 100% success rate (optimistic default) @@ -2660,7 +2679,7 @@ mod tests { #[test] fn test_health_history_is_healthy() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let mut history = ProviderHealthHistory::new(account); // New provider with no history is considered healthy @@ -2683,7 +2702,7 @@ mod tests { #[test] fn test_health_history_current_status() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let mut history = ProviderHealthHistory::new(account); // Unknown status when no requests @@ -2712,7 +2731,7 @@ mod tests { #[test] fn test_health_history_recent_statuses_limit() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let mut history = ProviderHealthHistory::new(account); // Add 15 entries @@ -2799,7 +2818,7 @@ mod tests { } ); - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); assert_eq!( ConflictResolution::ConsiderChallenge { provider: account.clone() @@ -2819,6 +2838,7 @@ mod tests { mmr_root: H256::zero(), start_seq: 0, leaf_count: 10, + nonce: 0, signatures: vec![], agreeing_providers: vec![], disagreeing_providers: vec![], @@ -2836,7 +2856,7 @@ mod tests { #[test] fn test_provider_info_clone() { - let account = AccountId32::new([1u8; 32]); + let account = AccountId32([1u8; 32]); let info = ProviderInfo { account_id: account.clone(), endpoint: "http://localhost:3333".to_string(), @@ -2981,7 +3001,7 @@ mod tests { let result = CheckpointResult::Submitted { block_hash: H256::zero(), - signers: vec![AccountId32::new([1u8; 32]), AccountId32::new([2u8; 32])], + signers: vec![AccountId32([1u8; 32]), AccountId32([2u8; 32])], }; metrics.record_attempt(&result, 100); @@ -3007,7 +3027,7 @@ mod tests { // Record unreachable let result2 = CheckpointResult::ProvidersUnreachable { - providers: vec![AccountId32::new([1u8; 32])], + providers: vec![AccountId32([1u8; 32])], }; metrics.record_attempt(&result2, 30); assert_eq!(metrics.unreachable_failures, 1); @@ -3034,14 +3054,14 @@ mod tests { majority_root: H256::zero(), majority_count: 2, conflicts: vec![ConflictingProvider { - account_id: AccountId32::new([1u8; 32]), + account_id: AccountId32([1u8; 32]), mmr_root: H256::repeat_byte(0x11), leaf_count: 10, conflict_type: ConflictType::DataDivergence, }], detected_at: Instant::now(), resolution: ConflictResolution::ConsiderChallenge { - provider: AccountId32::new([1u8; 32]), + provider: AccountId32([1u8; 32]), }, }; @@ -3140,7 +3160,7 @@ mod tests { #[test] fn test_submitted_challenge() { let challenge = SubmittedChallenge { - provider: AccountId32::new([1u8; 32]), + provider: AccountId32([1u8; 32]), challenge_id: ChallengeId { deadline: 1000, index: 1, @@ -3161,7 +3181,7 @@ mod tests { #[test] fn test_failed_challenge() { let failed = FailedChallenge { - provider: AccountId32::new([2u8; 32]), + provider: AccountId32([2u8; 32]), reason: ChallengeReason::PersistentlySyncing { behind_by: 10, duration: Duration::from_secs(60), @@ -3184,7 +3204,7 @@ mod tests { providers_analyzed: 10, challenges_submitted: vec![ SubmittedChallenge { - provider: AccountId32::new([1u8; 32]), + provider: AccountId32([1u8; 32]), challenge_id: ChallengeId { deadline: 1000, index: 0, @@ -3197,7 +3217,7 @@ mod tests { confidence: 0.95, }, SubmittedChallenge { - provider: AccountId32::new([2u8; 32]), + provider: AccountId32([2u8; 32]), challenge_id: ChallengeId { deadline: 1000, index: 1, @@ -3211,7 +3231,7 @@ mod tests { }, ], challenges_failed: vec![FailedChallenge { - provider: AccountId32::new([3u8; 32]), + provider: AccountId32([3u8; 32]), reason: ChallengeReason::PersistentlySyncing { behind_by: 5, duration: Duration::from_secs(120), @@ -3242,7 +3262,7 @@ mod tests { let mut metrics = CheckpointMetrics::default(); let result = CheckpointResult::Submitted { block_hash: H256::zero(), - signers: vec![AccountId32::new([1u8; 32])], + signers: vec![AccountId32([1u8; 32])], }; metrics.record_attempt(&result, 200); @@ -3256,7 +3276,7 @@ mod tests { let mut metrics = CheckpointMetrics::default(); let result = CheckpointResult::Submitted { block_hash: H256::zero(), - signers: vec![AccountId32::new([1u8; 32])], + signers: vec![AccountId32([1u8; 32])], }; metrics.record_attempt(&result, 100); @@ -3274,7 +3294,7 @@ mod tests { let mut metrics = CheckpointMetrics::default(); let success = CheckpointResult::Submitted { block_hash: H256::zero(), - signers: vec![AccountId32::new([1u8; 32])], + signers: vec![AccountId32([1u8; 32])], }; let failure = CheckpointResult::TransactionFailed { error: "timeout".to_string(), diff --git a/client/src/checkpoint_persistence.rs b/client/src/checkpoint_persistence.rs index 07615a8e..9b331858 100644 --- a/client/src/checkpoint_persistence.rs +++ b/client/src/checkpoint_persistence.rs @@ -33,11 +33,11 @@ use crate::checkpoint::{ }; use crate::ClientError; use serde::{Deserialize, Serialize}; -use sp_runtime::AccountId32; -use std::collections::{HashMap, VecDeque}; +use std::collections::{BTreeMap, HashMap, VecDeque}; use std::path::{Path, PathBuf}; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; use storage_primitives::BucketId; +use storage_subxt::subxt::utils::AccountId32; use tokio::fs; use tokio::sync::RwLock; @@ -534,7 +534,7 @@ impl StateBuilder { /// Add health histories. pub fn with_health_histories( mut self, - histories: &HashMap, + histories: &BTreeMap, ) -> Self { for (account_id, history) in histories { self.state.health_histories.insert( @@ -662,7 +662,7 @@ mod tests { #[test] fn test_health_history_conversion() { - let account_id = AccountId32::new([1u8; 32]); + let account_id = AccountId32([1u8; 32]); let mut history = ProviderHealthHistory::new(account_id.clone()); history.record_success(100); history.record_success(150); @@ -753,7 +753,7 @@ mod tests { #[test] fn test_account_id_conversion() { - let original = AccountId32::new([42u8; 32]); + let original = AccountId32([42u8; 32]); let string = account_id_to_string(&original); let restored = string_to_account_id(&string).unwrap(); assert_eq!(original, restored); @@ -761,8 +761,8 @@ mod tests { #[test] fn test_state_builder() { - let mut histories = HashMap::new(); - let account_id = AccountId32::new([1u8; 32]); + let mut histories = BTreeMap::new(); + let account_id = AccountId32([1u8; 32]); histories.insert(account_id.clone(), ProviderHealthHistory::new(account_id)); let metrics = CheckpointMetrics { diff --git a/client/src/discovery.rs b/client/src/discovery.rs index a1b2b017..47b58575 100644 --- a/client/src/discovery.rs +++ b/client/src/discovery.rs @@ -9,92 +9,11 @@ use crate::base::{BaseClient, ClientConfig, ClientError, ClientResult}; use crate::substrate::{storage, SubstrateClient}; -use sp_core::crypto::Ss58Codec; -use sp_runtime::AccountId32; -use subxt::ext::scale_value::{Composite, Primitive, ValueDef, Variant}; - -/// Storage requirements for provider matching. -#[derive(Debug, Clone)] -pub struct StorageRequirements { - /// Bytes needed for storage. - pub bytes_needed: u64, - /// Minimum agreement duration in blocks. - pub min_duration: u32, - /// Maximum acceptable price per byte. - pub max_price_per_byte: u128, - /// If true, only match providers accepting primary agreements. - pub primary_only: bool, -} - -impl Default for StorageRequirements { - fn default() -> Self { - Self { - bytes_needed: 0, - min_duration: 0, - max_price_per_byte: u128::MAX, - primary_only: true, - } - } -} - -/// Reason for partial match when provider doesn't fully meet requirements. -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum PartialMatchReason { - /// Provider's price exceeds max_price_per_byte. - PriceTooHigh, - /// Provider doesn't have enough available capacity. - InsufficientCapacity, - /// Provider's duration constraints don't match. - DurationMismatch, - /// Provider is not accepting agreements. - NotAccepting, -} - -/// Provider matching result. -#[derive(Debug, Clone)] -pub struct MatchedProvider { - /// Provider account ID (SS58 encoded). - pub account: String, - /// Provider information. - pub info: ProviderInfo, - /// Match score (0-100, 100 = perfect match). - pub match_score: u8, - /// Available capacity in bytes (None if unlimited). - pub available_capacity: Option, - /// If not a perfect match, why. - pub partial_reason: Option, -} - -/// Provider information for discovery. -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] -pub struct ProviderInfo { - /// Network address for connecting. - pub multiaddr: String, - /// Total stake locked. - pub stake: u128, - /// Currently committed bytes. - pub committed_bytes: u64, - /// Maximum capacity (0 = unlimited). - pub max_capacity: u64, - /// Minimum agreement duration. - pub min_duration: u32, - /// Maximum agreement duration. - pub max_duration: u32, - /// Price per byte per block. - pub price_per_byte: u128, - /// Whether accepting primary agreements. - pub accepting_primary: bool, - /// Replica sync price (None if not accepting replicas). - pub replica_sync_price: Option, - /// Whether accepting extensions. - pub accepting_extensions: bool, - /// Total agreements ever. - pub agreements_total: u32, - /// Failed challenges count. - pub challenges_failed: u32, - /// Block at which deregistration becomes finalisable (`None` = not deregistering). - pub deregister_at: Option, -} +use rt::pallet_storage_provider::pallet::ProviderInfo; +use rt_api::{MatchedProvider, ProviderInfoResponse}; +use storage_subxt::api as runtime; +use storage_subxt::api::runtime_types as rt; +use storage_subxt::api::runtime_types::pallet_storage_provider::runtime_api as rt_api; /// Provider recommendation with additional context. #[derive(Debug, Clone)] @@ -147,7 +66,8 @@ impl DiscoveryClient { /// /// # Example /// ```no_run - /// # use storage_client::discovery::{DiscoveryClient, StorageRequirements}; + /// # use storage_client::discovery::DiscoveryClient; + /// # use storage_subxt::api::runtime_types::pallet_storage_provider::runtime_api::StorageRequirements; /// # async fn example() -> Result<(), Box> { /// let mut client = DiscoveryClient::with_defaults()?; /// client.connect().await?; @@ -161,14 +81,14 @@ impl DiscoveryClient { /// /// let providers = client.find_providers(requirements, 10).await?; /// for provider in providers { - /// println!("Provider {}: score {}", provider.account, provider.match_score); + /// println!("Provider {:?}: score {}", provider.account, provider.match_score); /// } /// # Ok(()) /// # } /// ``` pub async fn find_providers( &self, - requirements: StorageRequirements, + requirements: rt_api::StorageRequirements, limit: u32, ) -> ClientResult> { let chain = self.base.chain()?; @@ -180,64 +100,21 @@ impl DiscoveryClient { requirements.max_price_per_byte ); - let storage = chain + let raw = chain .api() - .storage() + .runtime_api() .at_latest() .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let mut iter = storage - .iter(storage::all_providers()) + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))? + .call( + runtime::apis() + .storage_provider_api() + .find_matching_providers(requirements, limit), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate providers: {e}")))?; - - let mut results: Vec = Vec::new(); - - while let Some(result) = iter.next().await { - let kv = - result.map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; - - let account_str = match account_ss58_from_key(&kv.key_bytes) { - Some(s) => s, - None => continue, - }; - - let value = match kv.value.to_value() { - Ok(v) => v, - Err(e) => { - tracing::warn!("Failed to decode provider {account_str}: {e}"); - continue; - } - }; - - let info = match parse_provider_info(&value) { - Some(i) => i, - None => { - tracing::warn!("Failed to parse provider fields for {account_str}"); - continue; - } - }; - - // Hard filter: enforce the caller's price ceiling. Other partial-match - // conditions (capacity, duration) still surface via score_provider. - if info.price_per_byte > requirements.max_price_per_byte { - continue; - } - - let matched = score_provider(account_str, info, &requirements); - results.push(matched); - } + .map_err(|e| ClientError::Chain(format!("find_matching_providers: {e}")))?; - // Sort: score descending, price ascending for ties (mirrors pallet logic) - results.sort_by(|a, b| { - b.match_score - .cmp(&a.match_score) - .then(a.info.price_per_byte.cmp(&b.info.price_per_byte)) - }); - - results.truncate(limit as usize); - Ok(results) + Ok(raw) } /// Find the best provider for the given requirements. @@ -245,7 +122,7 @@ impl DiscoveryClient { /// Returns the highest-scoring provider, or None if no providers match. pub async fn find_best_provider( &self, - requirements: StorageRequirements, + requirements: rt_api::StorageRequirements, ) -> ClientResult> { let providers = self.find_providers(requirements, 1).await?; Ok(providers.into_iter().next()) @@ -265,7 +142,7 @@ impl DiscoveryClient { bytes_needed: u64, offset: u32, limit: u32, - ) -> ClientResult> { + ) -> ClientResult> { let chain = self.base.chain()?; tracing::info!( @@ -275,62 +152,24 @@ impl DiscoveryClient { limit ); - let storage = chain + let raw = chain .api() - .storage() + .runtime_api() .at_latest() .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let mut iter = storage - .iter(storage::all_providers()) + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))? + .call( + runtime::apis() + .storage_provider_api() + .providers_with_capacity(bytes_needed, offset, limit), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate providers: {e}")))?; - - let mut matching: Vec<(String, ProviderInfo)> = Vec::new(); - - while let Some(result) = iter.next().await { - let kv = - result.map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; - - let account_str = match account_ss58_from_key(&kv.key_bytes) { - Some(s) => s, - None => continue, - }; - - let value = match kv.value.to_value() { - Ok(v) => v, - Err(_) => continue, - }; - - let info = match parse_provider_info(&value) { - Some(i) => i, - None => continue, - }; - - // Must be accepting some kind of agreement - if !info.accepting_primary && info.replica_sync_price.is_none() { - continue; - } - - // Must have sufficient available capacity (0 = unlimited) - if info.max_capacity > 0 { - let available = info.max_capacity.saturating_sub(info.committed_bytes); - if available < bytes_needed { - continue; - } - } + .map_err(|e| ClientError::Chain(format!("providers_with_capacity: {e}")))?; - matching.push((account_str, info)); - } - - let page: Vec<(String, ProviderInfo)> = matching + Ok(raw .into_iter() - .skip(offset as usize) - .take(limit as usize) - .collect(); - - Ok(page) + .map(|(account, info)| (account.to_string(), info)) + .collect()) } /// Get recommendations for provider selection based on requirements and budget. @@ -357,7 +196,7 @@ impl DiscoveryClient { u128::MAX }; - let requirements = StorageRequirements { + let requirements = rt_api::StorageRequirements { bytes_needed: bytes, min_duration: duration, max_price_per_byte, @@ -418,7 +257,7 @@ impl DiscoveryClient { let account_id = SubstrateClient::parse_account(account)?; - let thunk = chain + chain .api() .storage() .at_latest() @@ -426,17 +265,7 @@ impl DiscoveryClient { .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))? .fetch(&storage::provider_info(&account_id)) .await - .map_err(|e| ClientError::Chain(format!("Failed to fetch provider: {e}")))?; - - let Some(thunk) = thunk else { - return Ok(None); - }; - - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode provider: {e}")))?; - - Ok(parse_provider_info(&value)) + .map_err(|e| ClientError::Chain(format!("Failed to fetch provider: {e}"))) } /// Check if a provider can accept additional bytes. @@ -459,7 +288,7 @@ impl DiscoveryClient { let account_id = SubstrateClient::parse_account(account)?; - let thunk = chain + let Some(info) = chain .api() .storage() .at_latest() @@ -467,26 +296,20 @@ impl DiscoveryClient { .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))? .fetch(&storage::provider_info(&account_id)) .await - .map_err(|e| ClientError::Chain(format!("Failed to fetch provider: {e}")))?; - - let Some(thunk) = thunk else { + .map_err(|e| ClientError::Chain(format!("Failed to fetch provider: {e}")))? + else { return Ok(false); }; - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode provider: {e}")))?; - - let Some(info) = parse_provider_info(&value) else { - return Ok(false); - }; - - if !info.accepting_primary && info.replica_sync_price.is_none() { + if !info.settings.accepting_primary && info.settings.replica_sync_price.is_none() { return Ok(false); } - if info.max_capacity > 0 { - let available = info.max_capacity.saturating_sub(info.committed_bytes); + if info.settings.max_capacity > 0 { + let available = info + .settings + .max_capacity + .saturating_sub(info.committed_bytes); return Ok(available >= additional_bytes); } @@ -498,249 +321,28 @@ impl DiscoveryClient { &self, offset: u32, limit: u32, - ) -> ClientResult> { + ) -> ClientResult> { let chain = self.base.chain()?; tracing::info!("Listing providers (offset={}, limit={})", offset, limit); - let storage = chain + let raw = chain .api() - .storage() + .runtime_api() .at_latest() .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let mut iter = storage - .iter(storage::all_providers()) + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))? + .call( + runtime::apis() + .storage_provider_api() + .providers(offset, limit), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate providers: {e}")))?; - - let mut all: Vec<(String, ProviderInfo)> = Vec::new(); - - while let Some(result) = iter.next().await { - let kv = - result.map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; + .map_err(|e| ClientError::Chain(format!("providers: {e}")))?; - let account_str = match account_ss58_from_key(&kv.key_bytes) { - Some(s) => s, - None => continue, - }; - - let value = match kv.value.to_value() { - Ok(v) => v, - Err(_) => continue, - }; - - if let Some(info) = parse_provider_info(&value) { - all.push((account_str, info)); - } - } - - let page: Vec<(String, ProviderInfo)> = all + Ok(raw .into_iter() - .skip(offset as usize) - .take(limit as usize) - .collect(); - - Ok(page) - } -} - -// ───────────────────────────────────────────────────────────────────────────── -// Private helpers -// ───────────────────────────────────────────────────────────────────────────── - -/// Extract the provider's `AccountId32` from a `Providers` storage key and render it as -/// SS58. -/// -/// Key layout: `[twox128(pallet)=16][twox128(storage)=16][blake2_128(account)=16][account=32]`, -/// so the raw account bytes live at `[48..80]`. Returns `None` when the key is too short -/// to contain the account suffix. -fn account_ss58_from_key(key: &[u8]) -> Option { - if key.len() < 80 { - return None; - } - let mut bytes = [0u8; 32]; - bytes.copy_from_slice(&key[48..80]); - Some(AccountId32::from(bytes).to_ss58check()) -} - -fn named_field<'a>( - value: &'a subxt::ext::scale_value::Value, - field: &str, -) -> Option<&'a subxt::ext::scale_value::Value> { - match &value.value { - ValueDef::Composite(Composite::Named(fields)) => { - fields.iter().find(|(n, _)| n == field).map(|(_, v)| v) - } - _ => None, - } -} - -fn as_bool(value: &subxt::ext::scale_value::Value) -> bool { - match &value.value { - ValueDef::Primitive(Primitive::Bool(b)) => *b, - // Fallback: some decoders emit booleans as u128 0/1 without type info - _ => value.as_u128().map(|n| n != 0).unwrap_or(false), - } -} - -fn decode_bytes(value: &subxt::ext::scale_value::Value) -> Vec { - match &value.value { - ValueDef::Composite(Composite::Unnamed(items)) => items - .iter() - .filter_map(|b| b.as_u128().map(|n| n as u8)) - .collect(), - _ => vec![], - } -} - -/// Parse a `ProviderInfo` dynamic value into the client-side [`ProviderInfo`]. -fn parse_provider_info(value: &subxt::ext::scale_value::Value) -> Option { - let multiaddr_bytes = named_field(value, "multiaddr") - .map(decode_bytes) - .unwrap_or_default(); - let multiaddr = String::from_utf8_lossy(&multiaddr_bytes).into_owned(); - - let stake = named_field(value, "stake") - .and_then(|v| v.as_u128()) - .unwrap_or(0); - - let committed_bytes = named_field(value, "committed_bytes") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - let settings = named_field(value, "settings")?; - - let min_duration = named_field(settings, "min_duration") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let max_duration = named_field(settings, "max_duration") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let price_per_byte = named_field(settings, "price_per_byte") - .and_then(|v| v.as_u128()) - .unwrap_or(0); - - let accepting_primary = named_field(settings, "accepting_primary") - .map(as_bool) - .unwrap_or(false); - - let replica_sync_price = - named_field(settings, "replica_sync_price").and_then(|v| match &v.value { - ValueDef::Variant(Variant { name, .. }) if name == "None" => None, - ValueDef::Variant(Variant { - name, - values: Composite::Unnamed(items), - }) if name == "Some" => items.first().and_then(|v| v.as_u128()), - _ => None, - }); - - let accepting_extensions = named_field(settings, "accepting_extensions") - .map(as_bool) - .unwrap_or(false); - - let max_capacity = named_field(settings, "max_capacity") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - let stats = named_field(value, "stats"); - - let agreements_total = stats - .and_then(|s| named_field(s, "agreements_total")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let challenges_failed = stats - .and_then(|s| named_field(s, "challenges_failed")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let deregister_at = named_field(value, "deregister_at").and_then(|v| match &v.value { - ValueDef::Variant(Variant { name, .. }) if name == "None" => None, - ValueDef::Variant(Variant { - name, - values: Composite::Unnamed(items), - }) if name == "Some" => items.first().and_then(|v| v.as_u128()).map(|n| n as u32), - _ => None, - }); - - Some(ProviderInfo { - multiaddr, - stake, - committed_bytes, - max_capacity, - min_duration, - max_duration, - price_per_byte, - accepting_primary, - replica_sync_price, - accepting_extensions, - agreements_total, - challenges_failed, - deregister_at, - }) -} - -/// Score a provider against requirements, mirroring the pallet's `query_find_matching_providers`. -fn score_provider( - account: String, - info: ProviderInfo, - req: &StorageRequirements, -) -> MatchedProvider { - let available_capacity = if info.max_capacity > 0 { - Some(info.max_capacity.saturating_sub(info.committed_bytes)) - } else { - None - }; - - let available = available_capacity.unwrap_or(u64::MAX); - - let mut score: u8 = 100; - let mut partial_reason: Option = None; - - // Not accepting - let not_accepting = if req.primary_only { - !info.accepting_primary - } else { - !info.accepting_primary && info.replica_sync_price.is_none() - }; - if not_accepting { - score = 0; - partial_reason = Some(PartialMatchReason::NotAccepting); - } - - // Insufficient capacity - if score > 0 && available < req.bytes_needed { - score = score.saturating_sub(50); - if partial_reason.is_none() { - partial_reason = Some(PartialMatchReason::InsufficientCapacity); - } - } - - // Price too high - if score > 0 && info.price_per_byte > req.max_price_per_byte { - score = score.saturating_sub(30); - if partial_reason.is_none() { - partial_reason = Some(PartialMatchReason::PriceTooHigh); - } - } - - // Duration mismatch - if score > 0 && (req.min_duration < info.min_duration || req.min_duration > info.max_duration) { - score = score.saturating_sub(20); - if partial_reason.is_none() { - partial_reason = Some(PartialMatchReason::DurationMismatch); - } - } - - MatchedProvider { - account, - info, - match_score: score, - available_capacity, - partial_reason, + .map(|(account, info)| (account.to_string(), info)) + .collect()) } } diff --git a/client/src/event_subscription.rs b/client/src/event_subscription.rs index 5c4368d5..05c8a2fe 100644 --- a/client/src/event_subscription.rs +++ b/client/src/event_subscription.rs @@ -33,20 +33,23 @@ //! # } //! ``` -use crate::scale_decode; +use crate::runtime_convert as rc; use crate::substrate::PALLET_NAME; use crate::ClientError; use futures::Stream; -use sp_core::H256; -use sp_runtime::AccountId32; +use rt::pallet_storage_provider::pallet::ProviderSettings; use std::collections::HashSet; use std::pin::Pin; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::task::{Context, Poll}; use storage_primitives::{BucketId, Commitment}; -use subxt::ext::scale_value::{self, At}; -use subxt::{OnlineClient, PolkadotConfig}; +use storage_subxt::api::runtime_types as rt; +use storage_subxt::api::storage_provider::events as ev; +use storage_subxt::subxt; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; +use storage_subxt::subxt::{OnlineClient, PolkadotConfig}; use tokio::sync::mpsc; // ============================================================================ @@ -139,7 +142,7 @@ pub enum StorageEvent { provider: AccountId32, block_hash: H256, block_number: u32, - provider_settings: crate::ProviderSettings, + provider_settings: ProviderSettings, }, /// A provider updated its on-chain multiaddr. @@ -407,7 +410,9 @@ pub struct EventFilter { /// Only include events for these bucket IDs (empty = all buckets). pub bucket_ids: HashSet, /// Only include events for these providers (empty = all providers). - pub providers: HashSet, + /// + /// Stored as raw bytes because `AccountId32` doesn't implement `Hash`. + pub providers: HashSet<[u8; 32]>, /// Include checkpoint events. pub include_checkpoints: bool, /// Include challenge events. @@ -450,7 +455,7 @@ impl EventFilter { /// Create a filter for a specific provider. pub fn provider(provider: AccountId32) -> Self { let mut filter = Self::all(); - filter.providers.insert(provider); + filter.providers.insert(provider.0); filter } @@ -478,7 +483,7 @@ impl EventFilter { /// Add a provider to the filter. pub fn with_provider(mut self, provider: AccountId32) -> Self { - self.providers.insert(provider); + self.providers.insert(provider.0); self } @@ -496,7 +501,7 @@ impl EventFilter { // Check provider filter if !self.providers.is_empty() { if let Some(provider) = event.provider() { - if !self.providers.contains(provider) { + if !self.providers.contains(&provider.0) { return false; } } @@ -921,10 +926,10 @@ pub trait EventParser { /// # Example — parse a finalized extrinsic's events /// /// ```no_run -/// # use sp_core::H256; +/// # use storage_subxt::subxt::utils::H256; /// # use storage_client::event_subscription::{EventParser, StorageProviderEventParser}; -/// # use subxt::blocks::ExtrinsicEvents; -/// # use subxt::PolkadotConfig; +/// # use storage_subxt::subxt::blocks::ExtrinsicEvents; +/// # use storage_subxt::subxt::PolkadotConfig; /// # async fn example(events: ExtrinsicEvents, block_hash: H256, block_number: u32) { /// let storage_events = /// StorageProviderEventParser::from_extrinsic_events(&events, block_hash, block_number); @@ -951,190 +956,227 @@ impl EventParser for StorageProviderEventParser { return None; } - // We log decode failures at TRACE level so callers don't need to - // worry about noisy warnings for known-unhandled variants. - let fields = match event.field_values() { - Ok(f) => f, - Err(e) => { - tracing::trace!("Failed to decode fields for {}: {e}", event.variant_name()); - return None; - } - }; - match event.variant_name() { // ── Checkpoint ──────────────────────────────────────────────────── - "BucketCheckpointed" => Some(StorageEvent::BucketCheckpointed { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - commitment: scale_decode::field_commitment(&fields, "commitment")?, - providers: scale_decode::field_accounts(&fields, "providers"), - block_hash, - block_number, - }), + "BucketCheckpointed" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::BucketCheckpointed { + bucket_id: e.bucket_id, + commitment: rc::from_commitment(e.commitment), + providers: e.providers.into_iter().collect(), + block_hash, + block_number, + }) + } // ── Challenges ──────────────────────────────────────────────────── "ChallengeCreated" => { - let (deadline, index) = field_challenge_id(&fields, "challenge_id")?; + let e = event.as_event::().ok()??; Some(StorageEvent::ChallengeCreated { - challenge_id: (deadline, index), - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - provider: scale_decode::field_account(&fields, "provider")?, - challenger: scale_decode::field_account(&fields, "challenger")?, - respond_by: scale_decode::field_u32(&fields, "respond_by")?, + challenge_id: (e.challenge_id.deadline, e.challenge_id.index), + bucket_id: e.bucket_id, + provider: e.provider, + challenger: e.challenger, + respond_by: e.respond_by, block_hash, block_number, }) } "ChallengeDefended" => { - let (deadline, index) = field_challenge_id(&fields, "challenge_id")?; + let e = event.as_event::().ok()??; Some(StorageEvent::ChallengeDefended { - challenge_id: (deadline, index), - provider: scale_decode::field_account(&fields, "provider")?, - response_time_blocks: scale_decode::field_u32(&fields, "response_time_blocks")?, - challenger_cost: scale_decode::field_u128(&fields, "challenger_cost")?, - provider_cost: scale_decode::field_u128(&fields, "provider_cost")?, + challenge_id: (e.challenge_id.deadline, e.challenge_id.index), + provider: e.provider, + response_time_blocks: e.response_time_blocks, + challenger_cost: e.challenger_cost, + provider_cost: e.provider_cost, block_hash, block_number, }) } "ChallengeSlashed" => { - let (deadline, index) = field_challenge_id(&fields, "challenge_id")?; + let e = event.as_event::().ok()??; Some(StorageEvent::ChallengeSlashed { - challenge_id: (deadline, index), - provider: scale_decode::field_account(&fields, "provider")?, - slashed_amount: scale_decode::field_u128(&fields, "slashed_amount")?, - challenger_reward: scale_decode::field_u128(&fields, "challenger_reward")?, + challenge_id: (e.challenge_id.deadline, e.challenge_id.index), + provider: e.provider, + slashed_amount: e.slashed_amount, + challenger_reward: e.challenger_reward, block_hash, block_number, }) } // ── Providers ───────────────────────────────────────────────────── - "ProviderRegistered" => Some(StorageEvent::ProviderRegistered { - provider: scale_decode::field_account(&fields, "provider")?, - stake: scale_decode::field_u128(&fields, "stake")?, - block_hash, - block_number, - }), - "ProviderAddedToBucket" => Some(StorageEvent::ProviderAddedToBucket { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - provider: scale_decode::field_account(&fields, "provider")?, - block_hash, - block_number, - }), - "PrimaryProviderRemoved" => Some(StorageEvent::PrimaryProviderRemoved { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - provider: scale_decode::field_account(&fields, "provider")?, - reason: field_removal_reason(&fields, "reason"), - block_hash, - block_number, - }), - "ProviderSettingsUpdated" => Some(StorageEvent::ProviderSettingsUpdated { - provider: scale_decode::field_account(&fields, "provider")?, - provider_settings: field_provider_settings(&fields, "settings")?, - block_hash, - block_number, - }), - "ProviderMultiaddrUpdated" => Some(StorageEvent::ProviderMultiaddrUpdated { - provider: scale_decode::field_account(&fields, "provider")?, - multiaddr: String::from_utf8_lossy(&scale_decode::field_bytes( - &fields, - "multiaddr", - )?) - .into_owned(), - block_hash, - block_number, - }), - "DeregisterAnnounced" => Some(StorageEvent::DeregisterAnnounced { - provider: scale_decode::field_account(&fields, "provider")?, - complete_after: scale_decode::field_u32(&fields, "complete_after")?, - block_hash, - block_number, - }), - "ProviderDeregistered" => Some(StorageEvent::ProviderDeregistered { - provider: scale_decode::field_account(&fields, "provider")?, - stake_returned: scale_decode::field_u128(&fields, "stake_returned")?, - block_hash, - block_number, - }), - "DeregisterCancelled" => Some(StorageEvent::DeregisterCancelled { - provider: scale_decode::field_account(&fields, "provider")?, - block_hash, - block_number, - }), + "ProviderRegistered" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::ProviderRegistered { + provider: e.provider, + stake: e.stake, + block_hash, + block_number, + }) + } + "ProviderAddedToBucket" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::ProviderAddedToBucket { + bucket_id: e.bucket_id, + provider: e.provider, + block_hash, + block_number, + }) + } + "PrimaryProviderRemoved" => { + let e = event.as_event::().ok()??; + let reason = match e.reason { + rt::storage_primitives::RemovalReason::Slashed => "Slashed", + rt::storage_primitives::RemovalReason::AdminTerminated => "AdminTerminated", + rt::storage_primitives::RemovalReason::Expired => "Expired", + } + .to_string(); + Some(StorageEvent::PrimaryProviderRemoved { + bucket_id: e.bucket_id, + provider: e.provider, + reason, + block_hash, + block_number, + }) + } + "ProviderSettingsUpdated" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::ProviderSettingsUpdated { + provider: e.provider, + provider_settings: e.settings, + block_hash, + block_number, + }) + } + "ProviderMultiaddrUpdated" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::ProviderMultiaddrUpdated { + provider: e.provider, + multiaddr: String::from_utf8_lossy(&e.multiaddr.0).into_owned(), + block_hash, + block_number, + }) + } + "DeregisterAnnounced" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::DeregisterAnnounced { + provider: e.provider, + complete_after: e.complete_after, + block_hash, + block_number, + }) + } + "ProviderDeregistered" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::ProviderDeregistered { + provider: e.provider, + stake_returned: e.stake_returned, + block_hash, + block_number, + }) + } + "DeregisterCancelled" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::DeregisterCancelled { + provider: e.provider, + block_hash, + block_number, + }) + } // ── Agreements ──────────────────────────────────────────────────── "StorageAgreementEstablished" => { - let (max_bytes, duration, price_per_byte) = field_terms_scalars(&fields, "terms"); + let e = event.as_event::().ok()??; Some(StorageEvent::StorageAgreementEstablished { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - provider: scale_decode::field_account(&fields, "provider")?, - owner: scale_decode::field_account(&fields, "owner")?, - max_bytes, - duration, - price_per_byte, - expires_at: scale_decode::field_u32(&fields, "expires_at")?, + bucket_id: e.bucket_id, + provider: e.provider, + owner: e.owner, + max_bytes: e.terms.max_bytes, + duration: e.terms.duration, + price_per_byte: e.terms.price_per_byte, + expires_at: e.expires_at, block_hash, block_number, }) } "ReplicaAgreementEstablished" => { - let (max_bytes, duration, price_per_byte) = field_terms_scalars(&fields, "terms"); + let e = event.as_event::().ok()??; Some(StorageEvent::ReplicaAgreementEstablished { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - provider: scale_decode::field_account(&fields, "provider")?, - owner: scale_decode::field_account(&fields, "owner")?, - max_bytes, - duration, - price_per_byte, - expires_at: scale_decode::field_u32(&fields, "expires_at")?, + bucket_id: e.bucket_id, + provider: e.provider, + owner: e.owner, + max_bytes: e.terms.max_bytes, + duration: e.terms.duration, + price_per_byte: e.terms.price_per_byte, + expires_at: e.expires_at, + block_hash, + block_number, + }) + } + "AgreementAccepted" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::AgreementAccepted { + bucket_id: e.bucket_id, + provider: e.provider, + expires_at: e.expires_at, + block_hash, + block_number, + }) + } + "AgreementEnded" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::AgreementEnded { + bucket_id: e.bucket_id, + provider: e.provider, + payment_to_provider: e.payment_to_provider, + burned: e.burned, block_hash, block_number, }) } - "AgreementAccepted" => Some(StorageEvent::AgreementAccepted { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - provider: scale_decode::field_account(&fields, "provider")?, - expires_at: scale_decode::field_u32(&fields, "expires_at")?, - block_hash, - block_number, - }), - "AgreementEnded" => Some(StorageEvent::AgreementEnded { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - provider: scale_decode::field_account(&fields, "provider")?, - payment_to_provider: scale_decode::field_u128(&fields, "payment_to_provider")?, - burned: scale_decode::field_u128(&fields, "burned")?, - block_hash, - block_number, - }), // ── Buckets ─────────────────────────────────────────────────────── - "BucketCreated" => Some(StorageEvent::BucketCreated { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - admin: scale_decode::field_account(&fields, "admin")?, - block_hash, - block_number, - }), - "BucketFrozen" => Some(StorageEvent::BucketFrozen { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - frozen_start_seq: scale_decode::field_u64(&fields, "frozen_start_seq")?, - block_hash, - block_number, - }), - "BucketDeleted" => Some(StorageEvent::BucketDeleted { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - block_hash, - block_number, - }), + "BucketCreated" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::BucketCreated { + bucket_id: e.bucket_id, + admin: e.admin, + block_hash, + block_number, + }) + } + "BucketFrozen" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::BucketFrozen { + bucket_id: e.bucket_id, + frozen_start_seq: e.frozen_start_seq, + block_hash, + block_number, + }) + } + "BucketDeleted" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::BucketDeleted { + bucket_id: e.bucket_id, + block_hash, + block_number, + }) + } // ── Replicas ────────────────────────────────────────────────────── - "ReplicaSynced" => Some(StorageEvent::ReplicaSynced { - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - provider: scale_decode::field_account(&fields, "provider")?, - mmr_root: scale_decode::field_h256(&fields, "mmr_root")?, - sync_payment: scale_decode::field_u128(&fields, "sync_payment")?, - block_hash, - block_number, - }), + "ReplicaSynced" => { + let e = event.as_event::().ok()??; + Some(StorageEvent::ReplicaSynced { + bucket_id: e.bucket_id, + provider: e.provider, + mmr_root: e.mmr_root, + sync_payment: e.sync_payment, + block_hash, + block_number, + }) + } // ── Everything else ─────────────────────────────────────────────── other => Some(StorageEvent::Unknown { @@ -1147,77 +1189,6 @@ impl EventParser for StorageProviderEventParser { } } -// Parser-specific field helpers — these encode shapes from the StorageProvider pallet -// (the `ChallengeId` struct and `RemovalReason` enum) and so stay alongside the parser -// rather than in [`crate::scale_decode`]. - -/// Read `max_bytes`, `duration`, and `price_per_byte` from a nested `AgreementTerms` -/// composite. Returns `(0, 0, 0)` if the composite is absent; individual scalars default -/// to 0 on decode failure so the outer event is never silently dropped. -/// -/// A missing composite or a field that fails to decode is logged at `warn`: with correct -/// runtime metadata this never happens, so a hit signals a metadata-shape regression that -/// would otherwise be masked by the zero default. -fn field_terms_scalars(fields: &scale_value::Composite, name: &str) -> (u64, u32, u128) { - let Some(terms) = fields.at(name) else { - tracing::warn!("AgreementTerms field '{name}' absent; defaulting scalars to 0"); - return (0, 0, 0); - }; - let scalar = |field: &str| { - let value = terms.at(field).and_then(|v| v.as_u128()); - if value.is_none() { - tracing::warn!("AgreementTerms.{field} missing or not an integer; defaulting to 0"); - } - value - }; - let max_bytes = scalar("max_bytes").unwrap_or(0) as u64; - let duration = scalar("duration").unwrap_or(0) as u32; - let price_per_byte = scalar("price_per_byte").unwrap_or(0); - (max_bytes, duration, price_per_byte) -} - -/// Read the StorageProvider pallet's `ChallengeId` named composite as a `(deadline, index)` -/// pair. -fn field_challenge_id(fields: &scale_value::Composite, name: &str) -> Option<(u32, u16)> { - let v = fields.at(name)?; - let deadline = v.at("deadline")?.as_u128()? as u32; - let index = v.at("index")?.as_u128()? as u16; - Some((deadline, index)) -} - -/// Read the StorageProvider pallet's `ProviderSettings` named composite into the client-side -/// [`crate::ProviderSettings`]. Returns `None` if a required field is missing or mistyped. -fn field_provider_settings( - fields: &scale_value::Composite, - name: &str, -) -> Option { - let settings = fields.at(name)?; - let replica_sync_price = match settings.at("replica_sync_price").map(|v| &v.value) { - Some(scale_value::ValueDef::Variant(var)) if var.name == "Some" => { - var.values.values().next().and_then(|v| v.as_u128()) - } - _ => None, - }; - Some(crate::ProviderSettings { - price_per_byte: settings.at("price_per_byte")?.as_u128()?, - min_duration: settings.at("min_duration")?.as_u128()? as u32, - max_duration: settings.at("max_duration")?.as_u128()? as u32, - accepting_primary: settings.at("accepting_primary")?.as_bool()?, - replica_sync_price, - accepting_extensions: settings.at("accepting_extensions")?.as_bool()?, - max_capacity: settings.at("max_capacity")?.as_u128()? as u64, - }) -} - -/// Read a `RemovalReason`-shaped variant field, falling back to `"Unknown"` when the field -/// is missing or not a variant. -fn field_removal_reason(fields: &scale_value::Composite, name: &str) -> String { - fields - .at(name) - .and_then(scale_decode::variant_name) - .unwrap_or_else(|| "Unknown".to_string()) -} - // ============================================================================ // Tests // ============================================================================ @@ -1288,8 +1259,8 @@ mod tests { let challenge_event = StorageEvent::ChallengeCreated { challenge_id: (0, 0), bucket_id: 1, - provider: AccountId32::new([0u8; 32]), - challenger: AccountId32::new([0u8; 32]), + provider: AccountId32([0u8; 32]), + challenger: AccountId32([0u8; 32]), respond_by: 0, block_hash: H256::zero(), block_number: 0, @@ -1308,7 +1279,7 @@ mod tests { start_seq: 100, leaf_count: 50, }, - providers: vec![AccountId32::new([1u8; 32])], + providers: vec![AccountId32::from([1u8; 32])], block_hash: H256::repeat_byte(0xCD), block_number: 12345, }; @@ -1322,8 +1293,8 @@ mod tests { #[test] fn test_storage_agreement_established_helpers() { - let provider = AccountId32::new([2u8; 32]); - let owner = AccountId32::new([3u8; 32]); + let provider = AccountId32([2u8; 32]); + let owner = AccountId32([3u8; 32]); let event = StorageEvent::StorageAgreementEstablished { bucket_id: 7, provider: provider.clone(), @@ -1344,8 +1315,8 @@ mod tests { #[test] fn test_replica_agreement_established_helpers() { - let provider = AccountId32::new([4u8; 32]); - let owner = AccountId32::new([5u8; 32]); + let provider = AccountId32([4u8; 32]); + let owner = AccountId32([5u8; 32]); let event = StorageEvent::ReplicaAgreementEstablished { bucket_id: 8, provider: provider.clone(), diff --git a/client/src/lib.rs b/client/src/lib.rs index 2a2a4991..2921a4e3 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -111,7 +111,7 @@ pub mod discovery; pub mod encryption; pub mod event_subscription; pub mod provider; -pub mod scale_decode; +pub mod runtime_convert; pub mod storage_user; pub mod substrate; pub mod verification; @@ -134,15 +134,13 @@ pub use checkpoint_persistence::{ CheckpointPersistence, PersistedBucketStatus, PersistedCheckpointState, PersistedConflict, PersistedHealthHistory, PersistedMetrics, PersistenceConfig, StateBuilder, }; -pub use discovery::{ - DiscoveryClient, MatchedProvider, ProviderRecommendation, StorageRequirements, -}; +pub use discovery::DiscoveryClient; pub use event_subscription::{ subscribe_bucket_events, subscribe_challenges, subscribe_checkpoints, subscribe_with_callback, EventCallback, EventFilter, EventParser, EventStream, EventSubscriber, StorageEvent, StorageProviderEventParser, SubscriptionHandle, }; -pub use provider::{ProviderClient, ProviderSettings}; +pub use provider::ProviderClient; pub use storage_user::{ CheckpointSignatureResponse, CommitResponse, CommitmentResponse, ExistsResponse, HealthResponse, StorageUserClient, diff --git a/client/src/provider.rs b/client/src/provider.rs index 17f75a74..a61a84c1 100644 --- a/client/src/provider.rs +++ b/client/src/provider.rs @@ -10,12 +10,15 @@ //! - Monitoring earnings and performance use crate::base::{BaseClient, ClientConfig, ClientError, ClientResult}; -use crate::discovery::ProviderInfo; use crate::substrate::{constants, extrinsics, storage, SubstrateClient}; -use sp_core::H256; -use sp_runtime::AccountId32; +use rt::pallet_storage_provider::pallet::ProviderInfo; +use rt::pallet_storage_provider::pallet::ProviderSettings; use storage_primitives::BucketId; -use subxt::ext::scale_value::{Composite, ValueDef, Variant}; +use storage_subxt::api::runtime_types as rt; +use storage_subxt::api::runtime_types::pallet_storage_provider::runtime_api as rt_api; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; +use storage_subxt::subxt_signer; /// Client for storage providers. pub struct ProviderClient { @@ -136,88 +139,7 @@ impl ProviderClient { .await .map_err(|e| ClientError::Chain(format!("Failed to fetch provider: {e}")))?; - let Some(thunk) = thunk else { - return Ok(None); - }; - - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode provider: {e}")))?; - - // Decode top-level fields. - let multiaddr = named_field(&value, "multiaddr") - .map(|v| String::from_utf8_lossy(&decode_byte_vec(v)).into_owned()) - .unwrap_or_default(); - - let stake = named_field(&value, "stake") - .and_then(|v| v.as_u128()) - .ok_or_else(|| ClientError::Chain("Missing 'stake'".to_string()))?; - - let committed_bytes = named_field(&value, "committed_bytes") - .and_then(|v| v.as_u128()) - .ok_or_else(|| ClientError::Chain("Missing 'committed_bytes'".to_string()))? - as u64; - - // Decode settings sub-composite. - let settings = named_field(&value, "settings") - .ok_or_else(|| ClientError::Chain("Missing 'settings' in ProviderInfo".to_string()))?; - - let replica_sync_price = - named_field(settings, "replica_sync_price").and_then(|v| match &v.value { - ValueDef::Variant(Variant { name, values }) if name == "Some" => { - values.values().next().and_then(|v| v.as_u128()) - } - _ => None, - }); - - // Decode stats sub-composite. - let stats = named_field(&value, "stats"); - let agreements_total = stats - .and_then(|s| named_field(s, "agreements_total")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - let challenges_failed = stats - .and_then(|s| named_field(s, "challenges_failed")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - Ok(Some(ProviderInfo { - multiaddr, - stake, - committed_bytes, - max_capacity: named_field(settings, "max_capacity") - .and_then(|v| v.as_u128()) - .ok_or_else(|| ClientError::Chain("Missing 'max_capacity'".to_string()))? - as u64, - min_duration: named_field(settings, "min_duration") - .and_then(|v| v.as_u128()) - .ok_or_else(|| ClientError::Chain("Missing 'min_duration'".to_string()))? - as u32, - max_duration: named_field(settings, "max_duration") - .and_then(|v| v.as_u128()) - .ok_or_else(|| ClientError::Chain("Missing 'max_duration'".to_string()))? - as u32, - price_per_byte: named_field(settings, "price_per_byte") - .and_then(|v| v.as_u128()) - .ok_or_else(|| ClientError::Chain("Missing 'price_per_byte'".to_string()))?, - accepting_primary: named_field(settings, "accepting_primary") - .and_then(|v| v.as_bool()) - .ok_or_else(|| ClientError::Chain("Missing 'accepting_primary'".to_string()))?, - replica_sync_price, - accepting_extensions: named_field(settings, "accepting_extensions") - .and_then(|v| v.as_bool()) - .ok_or_else(|| ClientError::Chain("Missing 'accepting_extensions'".to_string()))?, - agreements_total, - challenges_failed, - deregister_at: named_field(&value, "deregister_at").and_then(|v| match &v.value { - ValueDef::Variant(Variant { name, values }) if name == "Some" => values - .values() - .next() - .and_then(|v| v.as_u128()) - .map(|n| n as u32), - _ => None, - }), - })) + Ok(thunk) } /// Update provider settings. @@ -233,15 +155,7 @@ impl ProviderClient { settings.price_per_byte ); - let tx = extrinsics::update_provider_settings( - settings.min_duration, - settings.max_duration, - settings.price_per_byte, - settings.accepting_primary, - settings.replica_sync_price, - settings.accepting_extensions, - settings.max_capacity, - ); + let tx = extrinsics::update_provider_settings(settings); chain .api() @@ -329,15 +243,10 @@ impl ProviderClient { .await .map_err(|e| ClientError::Chain(format!("Failed to fetch replay state: {e}")))?; - let Some(thunk) = thunk else { + let Some(replay) = thunk else { return Ok(None); }; - let decoded = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode replay state: {e}")))?; - Ok(named_field(&decoded, "hsn") - .and_then(|v| v.as_u128()) - .map(|h| h as u64)) + Ok(Some(replay.hsn)) } /// Read the chain's `StorageProvider::RequestTimeout` runtime constant — @@ -350,11 +259,9 @@ impl ProviderClient { .api() .constants() .at(&constants::request_timeout()) - .map_err(|e| ClientError::Chain(format!("Failed to read RequestTimeout: {e}")))? - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode RequestTimeout: {e}")))?; + .map_err(|e| ClientError::Chain(format!("Failed to read RequestTimeout: {e}")))?; - Ok(value.as_u128().map(|v| v as u32)) + Ok(Some(value)) } /// Negotiate provider-signed agreement terms over HTTP. @@ -422,78 +329,28 @@ impl ProviderClient { let chain = self.base.chain()?; let provider_account = SubstrateClient::parse_account(&self.provider_account) .map_err(|e| ClientError::Chain(format!("Invalid provider account: {e}")))?; - let provider_bytes: &[u8] = provider_account.as_ref(); - let storage = chain + let raw = chain .api() - .storage() + .runtime_api() .at_latest() .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let mut iter = storage - .iter(storage::all_storage_agreements()) + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))? + .call( + storage_subxt::api::apis() + .storage_provider_api() + .provider_agreements(provider_account), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate agreements: {e}")))?; - - let mut agreements = Vec::new(); - - while let Some(result) = iter.next().await { - let kv = - result.map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; - - // Key layout: [twox128(pallet)=16][twox128(storage)=16] - // [blake2_128(bucket_id)=16][bucket_id=8] - // [blake2_128(provider)=16][provider=32] - // bucket_id at [48..56], provider at [72..104] - let key = &kv.key_bytes; - if key.len() < 104 { - continue; - } - if &key[72..104] != provider_bytes { - continue; - } - - let bucket_id = - u64::from_le_bytes(key[48..56].try_into().unwrap_or([0u8; 8])) as BucketId; - - let value = match kv.value.to_value() { - Ok(v) => v, - Err(e) => { - tracing::warn!("Failed to decode agreement: {e}"); - continue; - } - }; - - let owner = named_field(&value, "owner") - .and_then(decode_account_bytes) - .map(|b| format!("0x{}", hex::encode(b))) - .unwrap_or_default(); - - let max_bytes = named_field(&value, "max_bytes") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - let expires_at = named_field(&value, "expires_at") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let is_primary = named_field(&value, "role") - .map(|r| { - matches!(&r.value, ValueDef::Variant(Variant { name, .. }) if name == "Primary") - }) - .unwrap_or(false); - - agreements.push(ActiveAgreement { - bucket_id, - owner, - max_bytes, - expires_at, - is_primary, - }); - } - - Ok(agreements) + .map_err(|e| ClientError::Chain(format!("provider_agreements: {e}")))?; + + Ok(raw + .into_iter() + .map(|a| ActiveAgreement { + bucket_id: a.bucket_id, + agreement: a, + }) + .collect()) } /// Confirm replica sync to receive payment. @@ -586,82 +443,28 @@ impl ProviderClient { let chain = self.base.chain()?; let provider_account = SubstrateClient::parse_account(&self.provider_account) .map_err(|e| ClientError::Chain(format!("Invalid provider account: {e}")))?; - let provider_bytes: Vec = AsRef::<[u8]>::as_ref(&provider_account).to_vec(); - let storage = chain + let raw = chain .api() - .storage() + .runtime_api() .at_latest() .await - .map_err(|e| ClientError::Chain(format!("Failed to get storage: {e}")))?; - - let mut iter = storage - .iter(storage::all_challenges()) + .map_err(|e| ClientError::Chain(format!("runtime api: {e}")))? + .call( + storage_subxt::api::apis() + .storage_provider_api() + .provider_challenges(provider_account), + ) .await - .map_err(|e| ClientError::Chain(format!("Failed to iterate challenges: {e}")))?; - - let mut challenges = Vec::new(); - - while let Some(result) = iter.next().await { - let kv = - result.map_err(|e| ClientError::Chain(format!("Storage iteration error: {e}")))?; - - // Key layout: [twox128(pallet)=16][twox128(storage)=16] - // [blake2_128(deadline)=16][deadline=4]; deadline at [48..52] - let key = &kv.key_bytes; - if key.len() < 52 { - continue; - } - let deadline = u32::from_le_bytes(key[48..52].try_into().unwrap_or([0u8; 4])); - - let value = match kv.value.to_value() { - Ok(v) => v, - Err(e) => { - tracing::warn!("Failed to decode challenges at block {deadline}: {e}"); - continue; - } - }; - - // Value is Vec, decoded as an unnamed Composite - let ValueDef::Composite(Composite::Unnamed(items)) = &value.value else { - continue; - }; - let items: Vec<_> = items.iter().collect(); - - for (index, item) in items.iter().enumerate() { - let Some(pv) = named_field(item, "provider") else { - continue; - }; - let Some(pv_bytes) = decode_account_bytes(pv) else { - continue; - }; - if pv_bytes != provider_bytes { - continue; - } - - let bucket_id = named_field(item, "bucket_id") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as BucketId; - - let leaf_index = named_field(item, "leaf_index") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - let chunk_index = named_field(item, "chunk_index") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - challenges.push(ChallengeInfo { - challenge_id: (deadline, index as u16), - bucket_id, - deadline, - leaf_index, - chunk_index, - }); - } - } - - Ok(challenges) + .map_err(|e| ClientError::Chain(format!("provider_challenges: {e}")))?; + + Ok(raw + .into_iter() + .map(|c| ChallengeInfo { + challenge_id: (c.deadline, c.index), + challenge: c, + }) + .collect()) } // ═════════════════════════════════════════════════════════════════════════ @@ -684,58 +487,24 @@ impl ProviderClient { .await .map_err(|e| ClientError::Chain(format!("Failed to fetch provider: {e}")))?; - let Some(thunk) = thunk else { + let Some(p) = thunk else { return Ok(ProviderStats::default()); }; - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode provider: {e}")))?; - - let stake = named_field(&value, "stake") - .and_then(|v| v.as_u128()) - .unwrap_or(0); - - let committed_bytes = named_field(&value, "committed_bytes") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - let stats = named_field(&value, "stats"); - - let agreements_total = stats - .and_then(|s| named_field(s, "agreements_total")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let agreements_extended = stats - .and_then(|s| named_field(s, "agreements_extended")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let challenges_received = stats - .and_then(|s| named_field(s, "challenges_received")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let challenges_failed = stats - .and_then(|s| named_field(s, "challenges_failed")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u32; - - let reputation = if agreements_total > 0 { - let failure_rate = challenges_failed as f64 / agreements_total as f64; + let reputation = if p.stats.agreements_total > 0 { + let failure_rate = p.stats.challenges_failed as f64 / p.stats.agreements_total as f64; ((1.0 - failure_rate) * 100.0).clamp(0.0, 100.0) as u8 } else { 100 }; Ok(ProviderStats { - stake, - committed_bytes, - agreements_total, - agreements_extended, - challenges_received, - challenges_failed, + stake: p.stake, + committed_bytes: p.committed_bytes, + agreements_total: p.stats.agreements_total, + agreements_extended: p.stats.agreements_extended, + challenges_received: p.stats.challenges_received, + challenges_failed: p.stats.challenges_failed, reputation, }) } @@ -763,7 +532,7 @@ impl ProviderClient { .await .map_err(|e| ClientError::Chain(format!("Failed to fetch provider: {e}")))?; - let Some(thunk) = thunk else { + let Some(p) = thunk else { return Ok(CapacityInfo { committed_bytes: 0, available_bytes: 0, @@ -772,31 +541,12 @@ impl ProviderClient { }); }; - let value = thunk - .to_value() - .map_err(|e| ClientError::Chain(format!("Failed to decode provider: {e}")))?; - - let stake = named_field(&value, "stake") - .and_then(|v| v.as_u128()) - .unwrap_or(0); - - let committed_bytes = named_field(&value, "committed_bytes") - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - let settings = named_field(&value, "settings"); - - let max_capacity = settings - .and_then(|s| named_field(s, "max_capacity")) - .and_then(|v| v.as_u128()) - .unwrap_or(0) as u64; - - let available_bytes = max_capacity.saturating_sub(committed_bytes); + let available_bytes = p.settings.max_capacity.saturating_sub(p.committed_bytes); Ok(CapacityInfo { - committed_bytes, + committed_bytes: p.committed_bytes, available_bytes, - stake, + stake: p.stake, required_stake: 0, }) } @@ -808,93 +558,18 @@ impl ProviderClient { } } -fn named_field<'a>( - value: &'a subxt::ext::scale_value::Value, - field: &str, -) -> Option<&'a subxt::ext::scale_value::Value> { - match &value.value { - ValueDef::Composite(Composite::Named(fields)) => { - fields.iter().find(|(n, _)| n == field).map(|(_, v)| v) - } - _ => None, - } -} - -/// Decode an AccountId32 from a scale_value unnamed composite of 32 u8 items. -fn decode_account_bytes(value: &subxt::ext::scale_value::Value) -> Option> { - match &value.value { - ValueDef::Composite(Composite::Unnamed(items)) if items.len() == 32 => { - items.iter().map(|b| b.as_u128().map(|n| n as u8)).collect() - } - _ => None, - } -} - -/// Decode a `Vec` / `BoundedVec` from a scale_value composite. -/// -/// `BoundedVec` serializes its `TypeInfo` as a 1-field unnamed composite -/// wrapping the inner `Vec`, so scale_value surfaces it as -/// `Composite::Unnamed([inner_vec])`. This helper drills through that wrapper -/// if present, then collects the bytes. -fn decode_byte_vec(value: &subxt::ext::scale_value::Value) -> Vec { - let ValueDef::Composite(Composite::Unnamed(items)) = &value.value else { - return Vec::new(); - }; - // Direct sequence of byte primitives. - let bytes: Vec = items - .iter() - .filter_map(|b| b.as_u128().map(|n| n as u8)) - .collect(); - if !items.is_empty() && bytes.len() == items.len() { - return bytes; - } - // BoundedVec wrapper: single inner field holds the actual sequence. - if items.len() == 1 { - return decode_byte_vec(&items[0]); - } - Vec::new() -} - // Types -#[derive(Debug, Clone)] -pub struct ProviderSettings { - pub price_per_byte: u128, - pub min_duration: u32, - pub max_duration: u32, - pub accepting_primary: bool, - pub replica_sync_price: Option, - pub accepting_extensions: bool, - /// Maximum storage capacity in bytes. 0 = unlimited. - pub max_capacity: u64, -} - -#[derive(Debug, Clone)] -pub struct AgreementRequest { - pub bucket_id: BucketId, - pub requester: String, - pub max_bytes: u64, - pub payment_locked: u128, - pub duration: u32, - pub expires_at: u32, -} - #[derive(Debug, Clone)] pub struct ActiveAgreement { pub bucket_id: BucketId, - pub owner: String, - pub max_bytes: u64, - pub expires_at: u32, - pub is_primary: bool, + pub agreement: rt_api::AgreementResponse, } #[derive(Debug, Clone)] pub struct ChallengeInfo { pub challenge_id: (u32, u16), - pub bucket_id: BucketId, - pub deadline: u32, - pub leaf_index: u64, - pub chunk_index: u64, + pub challenge: rt_api::ChallengeResponse, } #[derive(Debug, Clone, Default)] diff --git a/client/src/runtime_convert.rs b/client/src/runtime_convert.rs new file mode 100644 index 00000000..6e339e81 --- /dev/null +++ b/client/src/runtime_convert.rs @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: Apache-2.0 + +//! Conversions between the client's domain types and the generated +//! `runtime_types::*` from `storage-subxt`. +//! +//! All conversions are byte-exact — they extract inner bytes directly +//! rather than going through string formatting or re-encoding. + +use crate::AgreementTermsOf; +use storage_primitives::{ChunkLocation, Commitment, EndAction, MerkleProof, MmrProof, Role}; +use storage_subxt::api::runtime_types as rt; +use storage_subxt::subxt::utils::AccountId32; + +// Convenient type aliases (for return types only, not constructors) +pub type RtMultiSig = rt::sp_runtime::MultiSignature; +pub type RtRole = rt::storage_primitives::Role; +pub type RtEndAction = rt::storage_primitives::EndAction; +pub type RtAgreementTerms = + rt::storage_primitives::agreement_term::AgreementTerms; +pub type RtChallengeId = rt::storage_primitives::ChallengeId; +pub type RtChallengeResponse = rt::pallet_storage_provider::pallet::ChallengeResponse; +pub type RtMmrProof = rt::storage_primitives::MmrProof; +pub type RtMerkleProof = rt::storage_primitives::MerkleProof; +pub type RtChunkLocation = rt::storage_primitives::ChunkLocation; +pub type RtCommitment = rt::storage_primitives::Commitment; +pub type BoundedVec = rt::bounded_collections::bounded_vec::BoundedVec; + +// ── Client domain → generated runtime_types ──────────────────────────────── + +/// Convert raw Sr25519 bytes (64 bytes) into `MultiSignature::Sr25519`. +/// +/// The checkpoint call passes raw signature slices — always Sr25519 because +/// that's what the provider node signs with. +pub fn raw_sr25519_to_multi_sig(bytes: Vec) -> RtMultiSig { + let mut arr = [0u8; 64]; + let len = bytes.len().min(64); + arr[..len].copy_from_slice(&bytes[..len]); + rt::sp_runtime::MultiSignature::Sr25519(arr) +} + +pub fn to_bounded_bytes(v: Vec) -> BoundedVec { + rt::bounded_collections::bounded_vec::BoundedVec(v) +} + +pub fn to_signatures(sigs: Vec<(AccountId32, Vec)>) -> BoundedVec<(AccountId32, RtMultiSig)> { + let pairs = sigs + .into_iter() + .map(|(account, raw_sig)| (account, raw_sr25519_to_multi_sig(raw_sig))) + .collect(); + rt::bounded_collections::bounded_vec::BoundedVec(pairs) +} + +pub fn to_agreement_terms(terms: &AgreementTermsOf) -> RtAgreementTerms { + let replica_params = terms.replica_params.as_ref().map(|rp| { + rt::storage_primitives::agreement_term::ReplicaTerms { + sync_balance: rp.sync_balance, + min_sync_interval: rp.min_sync_interval, + sync_price: rp.sync_price, + } + }); + rt::storage_primitives::agreement_term::AgreementTerms { + owner: terms.owner.clone(), + max_bytes: terms.max_bytes, + duration: terms.duration, + price_per_byte: terms.price_per_byte, + valid_until: terms.valid_until, + nonce: terms.nonce, + bucket_id: terms.bucket_id, + replica_params, + } +} + +pub fn to_role(role: Role) -> RtRole { + match role { + Role::Admin => rt::storage_primitives::Role::Admin, + Role::Writer => rt::storage_primitives::Role::Writer, + Role::Reader => rt::storage_primitives::Role::Reader, + } +} + +pub fn to_end_action(action: EndAction) -> RtEndAction { + match action { + EndAction::Pay => rt::storage_primitives::EndAction::Pay, + EndAction::Burn { burn_percent } => { + rt::storage_primitives::EndAction::Burn { burn_percent } + } + } +} + +pub fn to_challenge_id(deadline: u32, index: u16) -> RtChallengeId { + rt::storage_primitives::ChallengeId { deadline, index } +} + +pub fn to_chunk_location(location: ChunkLocation) -> RtChunkLocation { + rt::storage_primitives::ChunkLocation { + leaf_index: location.leaf_index, + chunk_index: location.chunk_index, + } +} + +pub fn to_commitment(commitment: &Commitment) -> RtCommitment { + rt::storage_primitives::Commitment { + mmr_root: commitment.mmr_root, + start_seq: commitment.start_seq, + leaf_count: commitment.leaf_count, + } +} + +pub fn from_commitment(commitment: RtCommitment) -> Commitment { + Commitment { + mmr_root: commitment.mmr_root, + start_seq: commitment.start_seq, + leaf_count: commitment.leaf_count, + } +} + +fn to_merkle_proof_inner(proof: &MerkleProof) -> RtMerkleProof { + rt::storage_primitives::MerkleProof { + siblings: proof.siblings.to_vec(), + path: proof.path.clone(), + } +} + +pub fn to_challenge_response_proof( + chunk_data: &[u8], + mmr_proof: &MmrProof, + chunk_proof: &MerkleProof, +) -> RtChallengeResponse { + let rt_mmr_proof = rt::storage_primitives::MmrProof { + peaks: mmr_proof.peaks.to_vec(), + leaf: rt::storage_primitives::MmrLeaf { + data_root: mmr_proof.leaf.data_root, + data_size: mmr_proof.leaf.data_size, + total_size: mmr_proof.leaf.total_size, + }, + leaf_proof: to_merkle_proof_inner(&mmr_proof.leaf_proof), + }; + rt::pallet_storage_provider::pallet::ChallengeResponse::Proof { + chunk_data: rt::bounded_collections::bounded_vec::BoundedVec(chunk_data.to_vec()), + mmr_proof: rt_mmr_proof, + chunk_proof: to_merkle_proof_inner(chunk_proof), + } +} diff --git a/client/src/scale_decode.rs b/client/src/scale_decode.rs deleted file mode 100644 index 67e5c700..00000000 --- a/client/src/scale_decode.rs +++ /dev/null @@ -1,247 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 - -//! Generic SCALE value decoders for use with subxt's dynamic event and storage APIs. -//! -//! Subxt's event API returns field values as `Composite` (field index as context); -//! `.at(name)` on that composite yields `Option<&Value>`. The helpers here wrap the -//! common access + decode patterns so callers don't repeat the same match arms. -//! -//! Only generic, domain-agnostic decoders belong here. Pallet-specific shapes (e.g. a -//! `ChallengeId` struct with `deadline`/`index` fields) should stay alongside their parser. - -use sp_core::H256; -use sp_runtime::AccountId32; -use storage_primitives::Commitment; -use subxt::ext::scale_value::{At, Composite, Primitive, Value, ValueDef}; - -/// Read a named field as a `u64` (decoded from the underlying `u128`). -pub fn field_u64(fields: &Composite, name: &str) -> Option { - fields.at(name)?.as_u128().map(|v| v as u64) -} - -/// Read a named field as a `u32` (decoded from the underlying `u128`). -pub fn field_u32(fields: &Composite, name: &str) -> Option { - fields.at(name)?.as_u128().map(|v| v as u32) -} - -/// Read a named field as a `u128`. -pub fn field_u128(fields: &Composite, name: &str) -> Option { - fields.at(name)?.as_u128() -} - -/// Read a named field and decode it as an [`AccountId32`]. -pub fn field_account(fields: &Composite, name: &str) -> Option { - decode_account(fields.at(name)?) -} - -/// Read a named field and decode it as an [`H256`]. -pub fn field_h256(fields: &Composite, name: &str) -> Option { - decode_h256(fields.at(name)?) -} - -/// Read a named field and decode it as a [`Commitment`]. -/// -/// `Commitment` is a named-struct field (`mmr_root`/`start_seq`/`leaf_count`), -/// so subxt decodes it as a nested `Composite::Named` — pull that inner -/// composite out and reuse the flat-field decoders on it. -pub fn field_commitment(fields: &Composite, name: &str) -> Option { - let inner = match &fields.at(name)?.value { - ValueDef::Composite(c) => c, - _ => return None, - }; - Some(Commitment { - mmr_root: field_h256(inner, "mmr_root")?, - start_seq: field_u64(inner, "start_seq")?, - leaf_count: field_u64(inner, "leaf_count")?, - }) -} - -/// Read a named field as a `Vec`. Missing or unparseable fields yield an -/// empty vec. -pub fn field_accounts(fields: &Composite, name: &str) -> Vec { - fields.at(name).map(decode_account_vec).unwrap_or_default() -} - -/// Read a named field as a `Vec` (e.g. a `BoundedVec` or raw `Vec`). -pub fn field_bytes(fields: &Composite, name: &str) -> Option> { - decode_bytes(fields.at(name)?) -} - -/// Decode an [`AccountId32`] from a SCALE value. -/// -/// `AccountId32` is a newtype struct in the SCALE type system, so subxt decodes it as -/// `Composite::Unnamed([Composite::Unnamed([byte × 32])])`. [`collect_le_bytes`] handles -/// arbitrary nesting depth. -pub fn decode_account(v: &Value) -> Option { - let mut bytes = [0u8; 32]; - if collect_le_bytes(v, &mut bytes, 0) == 32 { - Some(AccountId32::new(bytes)) - } else { - None - } -} - -/// Decode an [`H256`] from a SCALE value (same nesting shape as `AccountId32`). -pub fn decode_h256(v: &Value) -> Option { - let mut bytes = [0u8; 32]; - if collect_le_bytes(v, &mut bytes, 0) == 32 { - Some(H256::from(bytes)) - } else { - None - } -} - -/// Decode a `Vec` from a SCALE value. -/// -/// Handles a flat unnamed composite of byte-as-`u128` leaves and a single-element wrapper -/// composite (e.g. `BoundedVec` decoded as `Composite::Unnamed([Composite::Unnamed([ -/// byte … ])])`). An empty unnamed composite decodes to an empty `Vec`. -pub fn decode_bytes(v: &Value) -> Option> { - match &v.value { - ValueDef::Composite(Composite::Unnamed(items)) => { - if items.is_empty() { - return Some(Vec::new()); - } - let bytes: Vec = items - .iter() - .filter_map(|child| child.as_u128().map(|n| n as u8)) - .collect(); - if bytes.len() == items.len() { - return Some(bytes); - } - if items.len() == 1 { - return decode_bytes(&items[0]); - } - None - } - ValueDef::Composite(Composite::Named(items)) if items.len() == 1 => { - decode_bytes(&items[0].1) - } - _ => None, - } -} - -/// Decode a `Vec` from an unnamed composite of account composites. -pub fn decode_account_vec(v: &Value) -> Vec { - match &v.value { - ValueDef::Composite(Composite::Unnamed(items)) => { - items.iter().filter_map(decode_account).collect() - } - _ => vec![], - } -} - -/// Extract the variant name from a `ValueDef::Variant`. Returns `None` for non-variant -/// values. -pub fn variant_name(v: &Value) -> Option { - match &v.value { - ValueDef::Variant(var) => Some(var.name.clone()), - _ => None, - } -} - -/// Recursively collect raw bytes from a SCALE value into `buf` starting at `offset`, -/// returning the new offset. -/// -/// Treats `Primitive::U128` leaves as one byte each and recurses into `Composite::Unnamed` -/// nodes — covering both flat byte arrays and newtype-wrapped arrays like `AccountId32`. -pub fn collect_le_bytes(v: &Value, buf: &mut [u8; 32], offset: usize) -> usize { - match &v.value { - ValueDef::Primitive(Primitive::U128(n)) => { - if offset < 32 { - buf[offset] = *n as u8; - offset + 1 - } else { - offset - } - } - ValueDef::Composite(Composite::Unnamed(items)) => { - let mut pos = offset; - for item in items { - pos = collect_le_bytes(item, buf, pos); - } - pos - } - _ => offset, - } -} - -#[cfg(test)] -mod tests { - use super::*; - - fn u64_leaf(n: u64) -> Value { - Value { - value: ValueDef::Primitive(Primitive::u128(n as u128)), - context: 0, - } - } - - /// `H256`/`AccountId32` decode as a newtype wrapping a fixed-size byte array, - /// i.e. `Composite::Unnamed([Composite::Unnamed([byte × 32])])` — see - /// `decode_h256`'s doc comment. - fn h256_leaf(byte: u8) -> Value { - let bytes = Composite::Unnamed((0..32).map(|_| u64_leaf(byte as u64)).collect()); - Value { - value: ValueDef::Composite(Composite::Unnamed(vec![Value { - value: ValueDef::Composite(bytes), - context: 0, - }])), - context: 0, - } - } - - fn commitment_leaf(mmr_root_byte: u8, start_seq: u64, leaf_count: u64) -> Value { - Value { - value: ValueDef::Composite(Composite::named([ - ("mmr_root", h256_leaf(mmr_root_byte)), - ("start_seq", u64_leaf(start_seq)), - ("leaf_count", u64_leaf(leaf_count)), - ])), - context: 0, - } - } - - #[test] - fn field_commitment_decodes_nested_named_composite() { - let fields = Composite::named([("commitment", commitment_leaf(0xAB, 10, 5))]); - - let commitment = field_commitment(&fields, "commitment").expect("decodes"); - - assert_eq!(commitment.mmr_root, H256::repeat_byte(0xAB)); - assert_eq!(commitment.start_seq, 10); - assert_eq!(commitment.leaf_count, 5); - } - - #[test] - fn field_commitment_none_when_field_missing() { - let fields: Composite = Composite::named(Vec::<(String, Value)>::new()); - - assert!(field_commitment(&fields, "commitment").is_none()); - } - - #[test] - fn field_commitment_none_when_not_a_composite() { - // A same-named field that isn't a composite (e.g. a bare primitive) - // must not be mistaken for a `Commitment`. - let fields = Composite::named([("commitment", u64_leaf(42))]); - - assert!(field_commitment(&fields, "commitment").is_none()); - } - - #[test] - fn field_commitment_none_when_inner_field_missing() { - // A commitment composite missing one of the three expected fields - // (here: no `leaf_count`) must fail closed, not default to 0. - let incomplete = Value { - value: ValueDef::Composite(Composite::named([ - ("mmr_root", h256_leaf(0xAB)), - ("start_seq", u64_leaf(10)), - ])), - context: 0, - }; - let fields = Composite::named([("commitment", incomplete)]); - - assert!(field_commitment(&fields, "commitment").is_none()); - } -} diff --git a/client/src/substrate.rs b/client/src/substrate.rs index b6c47e7b..3c782655 100644 --- a/client/src/substrate.rs +++ b/client/src/substrate.rs @@ -6,15 +6,13 @@ //! the storage parachain. use crate::base::ClientError; -use codec::Encode; +use crate::AgreementTermsOf; use futures::StreamExt; -use sp_core::H256; -use sp_runtime::AccountId32; use std::str::FromStr; use std::sync::Arc; -use storage_primitives::{ChunkLocation, Commitment}; -use subxt::{OnlineClient, PolkadotConfig}; -use subxt_signer::sr25519::{dev, Keypair}; +use storage_subxt::subxt::utils::{AccountId32, H256}; +use storage_subxt::subxt::{OnlineClient, PolkadotConfig}; +use storage_subxt::subxt_signer::sr25519::{dev, Keypair}; pub const PALLET_NAME: &str = "StorageProvider"; @@ -112,206 +110,35 @@ impl SubstrateClient { /// these automatically from runtime metadata. pub mod extrinsics { use super::*; - use subxt::tx::Payload; + use crate::runtime_convert as rc; + use storage_primitives::{ChunkLocation, Commitment}; + use storage_subxt::api as runtime; + use storage_subxt::api::runtime_types::pallet_storage_provider::pallet::ProviderSettings; + use storage_subxt::api::runtime_types::sp_runtime::MultiSignature; + use storage_subxt::subxt::tx::Payload; - /// Create a register_provider extrinsic payload. pub fn register_provider(multiaddr: Vec, public_key: Vec, stake: u128) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "register_provider", - vec![ - subxt::dynamic::Value::from_bytes(multiaddr), - subxt::dynamic::Value::from_bytes(public_key), - subxt::dynamic::Value::u128(stake), - ], + runtime::tx().storage_provider().register_provider( + rc::to_bounded_bytes(multiaddr), + rc::to_bounded_bytes(public_key), + stake, ) } - /// Create an update_provider_settings extrinsic payload. - /// - /// # Parameters - /// - `min_duration`: Minimum agreement duration - /// - `max_duration`: Maximum agreement duration - /// - `price_per_byte`: Price per byte per block - /// - `accepting_primary`: Whether accepting primary agreements - /// - `replica_sync_price`: Price for replica sync (None = not accepting replicas) - /// - `accepting_extensions`: Whether accepting extensions - /// - `max_capacity`: Maximum storage capacity in bytes (0 = unlimited) - #[allow(clippy::too_many_arguments)] - pub fn update_provider_settings( - min_duration: u32, - max_duration: u32, - price_per_byte: u128, - accepting_primary: bool, - replica_sync_price: Option, - accepting_extensions: bool, - max_capacity: u64, - ) -> impl Payload { - let replica_price_value = match replica_sync_price { - Some(price) => subxt::dynamic::Value::unnamed_variant( - "Some", - vec![subxt::dynamic::Value::u128(price)], - ), - None => subxt::dynamic::Value::unnamed_variant("None", vec![]), - }; - - subxt::dynamic::tx( - PALLET_NAME, - "update_provider_settings", - vec![subxt::dynamic::Value::named_composite([ - ( - "min_duration", - subxt::dynamic::Value::u128(min_duration as u128), - ), - ( - "max_duration", - subxt::dynamic::Value::u128(max_duration as u128), - ), - ( - "price_per_byte", - subxt::dynamic::Value::u128(price_per_byte), - ), - ( - "accepting_primary", - subxt::dynamic::Value::bool(accepting_primary), - ), - ("replica_sync_price", replica_price_value), - ( - "accepting_extensions", - subxt::dynamic::Value::bool(accepting_extensions), - ), - ( - "max_capacity", - subxt::dynamic::Value::u128(max_capacity as u128), - ), - ])], - ) + pub fn update_provider_settings(settings: ProviderSettings) -> impl Payload { + runtime::tx() + .storage_provider() + .update_provider_settings(settings) } - /// Encode an [`AgreementTermsOf`](crate::agreement::AgreementTermsOf) as - /// a subxt dynamic value matching the on-chain composite. - pub fn dynamic_agreement_terms( - terms: &crate::agreement::AgreementTermsOf, - ) -> subxt::dynamic::Value { - let replica_params_value = match &terms.replica_params { - None => subxt::dynamic::Value::unnamed_variant("None", vec![]), - Some(rp) => subxt::dynamic::Value::unnamed_variant( - "Some", - vec![subxt::dynamic::Value::named_composite([ - ("sync_balance", subxt::dynamic::Value::u128(rp.sync_balance)), - ( - "min_sync_interval", - subxt::dynamic::Value::u128(rp.min_sync_interval as u128), - ), - ])], - ), - }; - let bucket_id_value = match terms.bucket_id { - None => subxt::dynamic::Value::unnamed_variant("None", vec![]), - Some(id) => subxt::dynamic::Value::unnamed_variant( - "Some", - vec![subxt::dynamic::Value::u128(id as u128)], - ), - }; - subxt::dynamic::Value::named_composite([ - ( - "owner", - subxt::dynamic::Value::from_bytes(terms.owner.as_ref() as &[u8]), - ), - ( - "max_bytes", - subxt::dynamic::Value::u128(terms.max_bytes as u128), - ), - ( - "duration", - subxt::dynamic::Value::u128(terms.duration as u128), - ), - ( - "price_per_byte", - subxt::dynamic::Value::u128(terms.price_per_byte), - ), - ( - "valid_until", - subxt::dynamic::Value::u128(terms.valid_until as u128), - ), - ("nonce", subxt::dynamic::Value::u128(terms.nonce as u128)), - ("bucket_id", bucket_id_value), - ("replica_params", replica_params_value), - ]) - } - - /// Encode a [`sp_runtime::MultiSignature`] as a subxt dynamic variant. - /// - /// Variant names and payloads mirror the pallet's - /// `verify_terms_signature` match: the signature travels as the - /// variant's raw inner bytes. - pub fn dynamic_multi_signature(sig: &sp_runtime::MultiSignature) -> subxt::dynamic::Value { - let (variant, bytes) = match sig { - sp_runtime::MultiSignature::Sr25519(s) => ("Sr25519", s.encode()), - sp_runtime::MultiSignature::Ed25519(s) => ("Ed25519", s.encode()), - sp_runtime::MultiSignature::Ecdsa(s) => ("Ecdsa", s.encode()), - sp_runtime::MultiSignature::Eth(s) => ("Eth", s.encode()), - }; - subxt::dynamic::Value::unnamed_variant( - variant, - vec![subxt::dynamic::Value::from_bytes(bytes)], - ) - } - - /// Build an `establish_storage_agreement` extrinsic payload. - /// - /// Bundles the SCALE-encoded provider-signed terms and signature into - /// the dynamic call shape Layer 0 expects. The chain hashes - /// `blake2_256(TERM_CONTEXT | SCALE(terms))` and verifies the - /// signature against the provider's registered public key. pub fn establish_storage_agreement( provider: AccountId32, - terms: &crate::agreement::AgreementTermsOf, - sig: &sp_runtime::MultiSignature, + terms: &AgreementTermsOf, + sig: MultiSignature, ) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "establish_storage_agreement", - vec![ - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - dynamic_agreement_terms(terms), - dynamic_multi_signature(sig), - ], - ) - } - - /// Encode a [`Commitment`](storage_primitives::Commitment) as a subxt - /// dynamic named composite (`mmr_root`, `start_seq`, `leaf_count`). - fn dynamic_commitment(commitment: Commitment) -> subxt::dynamic::Value { - subxt::dynamic::Value::named_composite([ - ( - "mmr_root", - subxt::dynamic::Value::from_bytes(commitment.mmr_root.as_bytes()), - ), - ( - "start_seq", - subxt::dynamic::Value::u128(commitment.start_seq as u128), - ), - ( - "leaf_count", - subxt::dynamic::Value::u128(commitment.leaf_count as u128), - ), - ]) - } - - /// Encode a [`ChunkLocation`](storage_primitives::ChunkLocation) as a subxt - /// dynamic named composite (`leaf_index`, `chunk_index`). - fn dynamic_chunk_location(target: ChunkLocation) -> subxt::dynamic::Value { - subxt::dynamic::Value::named_composite([ - ( - "leaf_index", - subxt::dynamic::Value::u128(target.leaf_index as u128), - ), - ( - "chunk_index", - subxt::dynamic::Value::u128(target.chunk_index as u128), - ), - ]) + runtime::tx() + .storage_provider() + .establish_storage_agreement(provider, rc::to_agreement_terms(terms), sig) } /// Create a checkpoint extrinsic payload to submit an on-chain snapshot. @@ -321,51 +148,27 @@ pub mod extrinsics { nonce: u64, signatures: Vec<(AccountId32, Vec)>, ) -> impl Payload { - let sigs: Vec = signatures - .into_iter() - .map(|(account, sig)| { - subxt::dynamic::Value::unnamed_composite(vec![ - subxt::dynamic::Value::from_bytes(account.as_ref() as &[u8]), - subxt::dynamic::Value::unnamed_variant( - "Sr25519", - vec![subxt::dynamic::Value::from_bytes(&sig)], - ), - ]) - }) - .collect(); - - subxt::dynamic::tx( - PALLET_NAME, - "checkpoint", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - dynamic_commitment(commitment), - subxt::dynamic::Value::u128(nonce as u128), - subxt::dynamic::Value::unnamed_composite(sigs), - ], + runtime::tx().storage_provider().checkpoint( + bucket_id, + rc::to_commitment(&commitment), + nonce, + rc::to_signatures(signatures), ) } - /// Create a challenge_checkpoint extrinsic payload. pub fn challenge_checkpoint( bucket_id: u64, provider: AccountId32, target: ChunkLocation, ) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "challenge_checkpoint", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - dynamic_chunk_location(target), - ], + runtime::tx().storage_provider().challenge_checkpoint( + bucket_id, + provider, + rc::to_chunk_location(target), ) } - /// Create a challenge_offchain extrinsic payload. - /// - /// Uses the provider's off-chain signature instead of an on-chain checkpoint. + #[allow(clippy::too_many_arguments)] pub fn challenge_offchain( bucket_id: u64, provider: AccountId32, @@ -374,528 +177,286 @@ pub mod extrinsics { nonce: u64, provider_signature: Vec, ) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "challenge_offchain", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - dynamic_commitment(commitment), - dynamic_chunk_location(target), - subxt::dynamic::Value::u128(nonce as u128), - // MultiSignature enum: Sr25519 = 0, Ed25519 = 1, Ecdsa = 2 - subxt::dynamic::Value::unnamed_variant( - "Sr25519", - vec![subxt::dynamic::Value::from_bytes(&provider_signature)], - ), - ], + runtime::tx().storage_provider().challenge_offchain( + bucket_id, + provider, + rc::to_commitment(&commitment), + rc::to_chunk_location(target), + nonce, + rc::raw_sr25519_to_multi_sig(provider_signature), ) } - /// Create an add_stake extrinsic payload. pub fn add_stake(amount: u128) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "add_stake", - vec![subxt::dynamic::Value::u128(amount)], - ) + runtime::tx().storage_provider().add_stake(amount) } - /// Create a deregister_provider extrinsic payload. pub fn deregister_provider() -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "deregister_provider", - Vec::::new(), - ) + runtime::tx().storage_provider().deregister_provider() } - /// Create a confirm_replica_sync extrinsic payload. pub fn confirm_replica_sync( bucket_id: u64, roots: [Option; 7], signature: Vec, ) -> impl Payload { - let roots_value = subxt::dynamic::Value::unnamed_composite( - roots - .iter() - .map(|r| match r { - Some(h) => subxt::dynamic::Value::unnamed_variant( - "Some", - vec![subxt::dynamic::Value::from_bytes(h.as_bytes())], - ), - None => subxt::dynamic::Value::unnamed_variant("None", vec![]), - }) - .collect::>(), - ); - - let sig_value = subxt::dynamic::Value::unnamed_variant( - "Sr25519", - vec![subxt::dynamic::Value::from_bytes(&signature)], - ); - - subxt::dynamic::tx( - PALLET_NAME, - "confirm_replica_sync", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - roots_value, - sig_value, - ], + runtime::tx().storage_provider().confirm_replica_sync( + bucket_id, + roots, + rc::raw_sr25519_to_multi_sig(signature), ) } - /// Create a challenge_replica extrinsic payload. pub fn challenge_replica( bucket_id: u64, provider: AccountId32, target: ChunkLocation, ) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "challenge_replica", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - dynamic_chunk_location(target), - ], + runtime::tx().storage_provider().challenge_replica( + bucket_id, + provider, + rc::to_chunk_location(target), ) } - /// Create a set_member extrinsic payload (add or update a bucket member's role). pub fn set_member( bucket_id: u64, member: AccountId32, role: storage_primitives::Role, ) -> impl Payload { - let role_value = match role { - storage_primitives::Role::Admin => { - subxt::dynamic::Value::unnamed_variant("Admin", vec![]) - } - storage_primitives::Role::Writer => { - subxt::dynamic::Value::unnamed_variant("Writer", vec![]) - } - storage_primitives::Role::Reader => { - subxt::dynamic::Value::unnamed_variant("Reader", vec![]) - } - }; - - subxt::dynamic::tx( - PALLET_NAME, - "set_member", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(member.as_ref() as &[u8]), - role_value, - ], - ) + runtime::tx() + .storage_provider() + .set_member(bucket_id, member, rc::to_role(role)) } - /// Create a remove_member extrinsic payload. pub fn remove_bucket_member(bucket_id: u64, member: AccountId32) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "remove_member", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(member.as_ref() as &[u8]), - ], - ) + runtime::tx() + .storage_provider() + .remove_member(bucket_id, member) } - /// Create a freeze_bucket extrinsic payload. - /// - /// The chain uses the current snapshot's start_seq to set the freeze point. pub fn freeze_bucket(bucket_id: u64) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "freeze_bucket", - vec![subxt::dynamic::Value::u128(bucket_id as u128)], - ) + runtime::tx().storage_provider().freeze_bucket(bucket_id) } - /// Create an extend_agreement extrinsic payload. pub fn extend_agreement( bucket_id: u64, provider: AccountId32, additional_duration: u32, max_payment: u128, ) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "extend_agreement", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - subxt::dynamic::Value::u128(additional_duration as u128), - subxt::dynamic::Value::u128(max_payment), - ], + runtime::tx().storage_provider().extend_agreement( + bucket_id, + provider, + additional_duration, + max_payment, ) } - /// Create a top_up_agreement extrinsic payload. pub fn top_up_agreement( bucket_id: u64, provider: AccountId32, additional_bytes: u64, max_payment: u128, ) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "top_up_agreement", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - subxt::dynamic::Value::u128(additional_bytes as u128), - subxt::dynamic::Value::u128(max_payment), - ], + runtime::tx().storage_provider().top_up_agreement( + bucket_id, + provider, + additional_bytes, + max_payment, ) } - /// Create an end_agreement extrinsic payload. pub fn end_agreement( bucket_id: u64, provider: AccountId32, action: storage_primitives::EndAction, ) -> impl Payload { - let action_value = match action { - storage_primitives::EndAction::Pay => { - subxt::dynamic::Value::unnamed_variant("Pay", vec![]) - } - storage_primitives::EndAction::Burn { burn_percent } => { - subxt::dynamic::Value::named_variant( - "Burn", - [( - "burn_percent", - subxt::dynamic::Value::u128(burn_percent as u128), - )], - ) - } - }; - - subxt::dynamic::tx( - PALLET_NAME, - "end_agreement", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - action_value, - ], + runtime::tx().storage_provider().end_agreement( + bucket_id, + provider, + rc::to_end_action(action), ) } - /// Create a set_extensions_blocked extrinsic payload (provider-side call). pub fn set_extensions_blocked(bucket_id: u64, blocked: bool) -> impl Payload { - subxt::dynamic::tx( - PALLET_NAME, - "set_extensions_blocked", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::bool(blocked), - ], - ) + runtime::tx() + .storage_provider() + .set_extensions_blocked(bucket_id, blocked) } - /// Create a respond_to_challenge extrinsic payload with a Proof response. - /// - /// Builds the `ChallengeResponse::Proof` variant with proper nested types - /// matching the pallet's expected format. pub fn respond_to_challenge_proof( challenge_id: (u32, u16), chunk_data: &[u8], mmr_proof: &storage_primitives::MmrProof, chunk_proof: &storage_primitives::MerkleProof, ) -> impl Payload { - // Build ChallengeId named composite - let challenge_id_value = subxt::dynamic::Value::named_composite([ - ( - "deadline", - subxt::dynamic::Value::u128(challenge_id.0 as u128), - ), - ("index", subxt::dynamic::Value::u128(challenge_id.1 as u128)), - ]); - - // Build MerkleProof for leaf_proof (MMR leaf to peak) - let leaf_proof_value = subxt::dynamic::Value::named_composite([ - ( - "siblings", - subxt::dynamic::Value::unnamed_composite( - mmr_proof - .leaf_proof - .siblings - .iter() - .map(|h| subxt::dynamic::Value::from_bytes(h.as_bytes())) - .collect::>(), - ), - ), - ( - "path", - subxt::dynamic::Value::unnamed_composite( - mmr_proof - .leaf_proof - .path - .iter() - .map(|b| subxt::dynamic::Value::bool(*b)) - .collect::>(), - ), - ), - ]); - - // Build MmrLeaf - let leaf_value = subxt::dynamic::Value::named_composite([ - ( - "data_root", - subxt::dynamic::Value::from_bytes(mmr_proof.leaf.data_root.as_bytes()), - ), - ( - "data_size", - subxt::dynamic::Value::u128(mmr_proof.leaf.data_size as u128), - ), - ( - "total_size", - subxt::dynamic::Value::u128(mmr_proof.leaf.total_size as u128), - ), - ]); - - // Build MmrProof - let mmr_proof_value = subxt::dynamic::Value::named_composite([ - ( - "peaks", - subxt::dynamic::Value::unnamed_composite( - mmr_proof - .peaks - .iter() - .map(|h| subxt::dynamic::Value::from_bytes(h.as_bytes())) - .collect::>(), - ), - ), - ("leaf", leaf_value), - ("leaf_proof", leaf_proof_value), - ]); - - // Build MerkleProof for chunk proof (chunk to data_root) - let chunk_proof_value = subxt::dynamic::Value::named_composite([ - ( - "siblings", - subxt::dynamic::Value::unnamed_composite( - chunk_proof - .siblings - .iter() - .map(|h| subxt::dynamic::Value::from_bytes(h.as_bytes())) - .collect::>(), - ), - ), - ( - "path", - subxt::dynamic::Value::unnamed_composite( - chunk_proof - .path - .iter() - .map(|b| subxt::dynamic::Value::bool(*b)) - .collect::>(), - ), - ), - ]); - - // Build ChallengeResponse::Proof variant - let response = subxt::dynamic::Value::named_variant( - "Proof", - [ - ("chunk_data", subxt::dynamic::Value::from_bytes(chunk_data)), - ("mmr_proof", mmr_proof_value), - ("chunk_proof", chunk_proof_value), - ], - ); - - subxt::dynamic::tx( - PALLET_NAME, - "respond_to_challenge", - vec![challenge_id_value, response], + runtime::tx().storage_provider().respond_to_challenge( + rc::to_challenge_id(challenge_id.0, challenge_id.1), + rc::to_challenge_response_proof(chunk_data, mmr_proof, chunk_proof), + ) + } + + pub fn update_provider_multiaddr(multiaddr: Vec) -> impl Payload { + runtime::tx() + .storage_provider() + .update_provider_multiaddr(rc::to_bounded_bytes(multiaddr)) + } + + pub fn provider_checkpoint( + bucket_id: u64, + commitment: Commitment, + window: u64, + signatures: Vec<(AccountId32, Vec)>, + ) -> impl Payload { + runtime::tx().storage_provider().provider_checkpoint( + bucket_id, + rc::to_commitment(&commitment), + window, + rc::to_signatures(signatures), ) } } /// Runtime constant addresses for reading on-chain config. pub mod constants { - use super::*; + use storage_subxt::api as runtime; + use storage_subxt::subxt_core::constants::address::StaticAddress; - /// Dynamic constant address for `StorageProvider::RequestTimeout`, - /// the validity window (in blocks) the chain enforces on provider-signed - /// agreement terms. - pub fn request_timeout() -> subxt::constants::DynamicAddress { - subxt::dynamic::constant(PALLET_NAME, "RequestTimeout") + /// Typed constant address for `StorageProvider::RequestTimeout`. + pub fn request_timeout() -> StaticAddress { + runtime::constants().storage_provider().request_timeout() } } /// Storage queries for reading chain state. pub mod storage { - use super::*; + use storage_subxt::api as runtime; + use storage_subxt::api::runtime_types as rt; + use storage_subxt::subxt; + use storage_subxt::subxt::utils::AccountId32; - /// Query provider info. pub fn provider_info( account: &AccountId32, - ) -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + ) -> impl subxt::storage::Address< + IsFetchable = subxt::utils::Yes, + Target = rt::pallet_storage_provider::pallet::ProviderInfo, > { - subxt::dynamic::storage( - PALLET_NAME, - "Providers", - vec![subxt::dynamic::Value::from_bytes(account.as_ref() as &[u8])], - ) + runtime::storage() + .storage_provider() + .providers(account.clone()) } - /// Query bucket info. pub fn bucket_info( bucket_id: u64, - ) -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + ) -> impl subxt::storage::Address< + IsFetchable = subxt::utils::Yes, + Target = rt::pallet_storage_provider::pallet::Bucket, > { - subxt::dynamic::storage( - PALLET_NAME, - "Buckets", - vec![subxt::dynamic::Value::u128(bucket_id as u128)], - ) + runtime::storage().storage_provider().buckets(bucket_id) } - /// Query agreement info. pub fn agreement_info( bucket_id: u64, provider: &AccountId32, - ) -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + ) -> impl subxt::storage::Address< + IsFetchable = subxt::utils::Yes, + Target = rt::pallet_storage_provider::pallet::StorageAgreement, > { - subxt::dynamic::storage( - PALLET_NAME, - "StorageAgreements", - vec![ - subxt::dynamic::Value::u128(bucket_id as u128), - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - ], - ) + runtime::storage() + .storage_provider() + .storage_agreements(bucket_id, provider.clone()) + } + + pub fn challenger_stats( + account: &AccountId32, + ) -> impl subxt::storage::Address< + IsFetchable = subxt::utils::Yes, + IsDefaultable = subxt::utils::Yes, + Target = rt::storage_primitives::ChallengerStatRecord, + > { + runtime::storage() + .storage_provider() + .challenger_stats(account.clone()) } - /// Query all storage agreements for a specific bucket (prefix iteration). - /// - /// Key layout after prefix: [blake2_128(provider)=16][provider=32]; provider at offset 72 in full key. pub fn agreements_for_bucket( bucket_id: u64, - ) -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + ) -> impl subxt::storage::Address< + IsIterable = subxt::utils::Yes, + Target = rt::pallet_storage_provider::pallet::StorageAgreement, > { - subxt::dynamic::storage( - PALLET_NAME, - "StorageAgreements", - vec![subxt::dynamic::Value::u128(bucket_id as u128)], - ) + runtime::storage() + .storage_provider() + .storage_agreements_iter1(bucket_id) } - /// Query the list of bucket IDs that an account is a member of. pub fn member_buckets( account: &AccountId32, - ) -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + ) -> impl subxt::storage::Address< + IsFetchable = subxt::utils::Yes, + Target = rt::bounded_collections::bounded_vec::BoundedVec, > { - subxt::dynamic::storage( - PALLET_NAME, - "MemberBuckets", - vec![subxt::dynamic::Value::from_bytes(account.as_ref() as &[u8])], - ) + runtime::storage() + .storage_provider() + .member_buckets(account.clone()) } - /// Iterate all registered providers. - /// - /// Key layout: [twox128(pallet)=16][twox128(storage)=16][blake2_128(account)=16][account=32]; - /// account at [48..80]. - pub fn all_providers() -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + pub fn all_providers() -> impl subxt::storage::Address< + IsIterable = subxt::utils::Yes, + Target = rt::pallet_storage_provider::pallet::ProviderInfo, > { - subxt::dynamic::storage(PALLET_NAME, "Providers", vec![]) - } - - /// Iterate all storage agreements (bucket_id × provider DoubleMap). - /// - /// Key layout: [twox128(pallet)=16][twox128(storage)=16][blake2_128(bucket_id)=16][bucket_id=8] - /// [blake2_128(provider)=16][provider=32]; bucket_id at [48..56], provider at [72..104]. - pub fn all_storage_agreements() -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, - > { - subxt::dynamic::storage(PALLET_NAME, "StorageAgreements", vec![]) - } - - /// Iterate all active challenge entries (deadline_block → Vec). - /// - /// Key layout: [twox128(pallet)=16][twox128(storage)=16][blake2_128(block)=16][block=4]; - /// deadline block at [48..52]. - pub fn all_challenges() -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + runtime::storage().storage_provider().providers_iter() + } + + pub fn all_storage_agreements() -> impl subxt::storage::Address< + IsIterable = subxt::utils::Yes, + Target = rt::pallet_storage_provider::pallet::StorageAgreement, > { - subxt::dynamic::storage(PALLET_NAME, "Challenges", vec![]) + runtime::storage() + .storage_provider() + .storage_agreements_iter() } - /// Query challenges at a deadline block. pub fn challenges( deadline_block: u32, - ) -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + index: u16, + ) -> impl subxt::storage::Address< + IsFetchable = subxt::utils::Yes, + Target = rt::pallet_storage_provider::pallet::Challenge, > { - subxt::dynamic::storage( - PALLET_NAME, - "Challenges", - vec![subxt::dynamic::Value::u128(deadline_block as u128)], - ) + runtime::storage() + .storage_provider() + .challenges(deadline_block, index) } - /// Query the provider's replay-window state. pub fn provider_replay_state( account: &AccountId32, - ) -> subxt::storage::DefaultAddress< - Vec, - subxt::dynamic::DecodedValueThunk, - subxt::utils::Yes, - subxt::utils::Yes, - subxt::utils::Yes, + ) -> impl subxt::storage::Address< + IsFetchable = subxt::utils::Yes, + Target = rt::storage_primitives::provider_replay_state::ReplayWindow, > { - subxt::dynamic::storage( - PALLET_NAME, - "ProviderReplayStates", - vec![subxt::dynamic::Value::from_bytes(account.as_ref() as &[u8])], - ) + runtime::storage() + .storage_provider() + .provider_replay_states(account.clone()) + } + + pub fn iter_providers_typed() -> impl subxt::storage::Address< + IsIterable = subxt::utils::Yes, + Target = rt::pallet_storage_provider::pallet::ProviderInfo, + > { + runtime::storage().storage_provider().providers_iter() + } + + pub fn checkpoint_config( + bucket_id: u64, + ) -> impl subxt::storage::Address< + IsFetchable = subxt::utils::Yes, + Target = rt::storage_primitives::CheckpointWindowConfig, + > { + runtime::storage() + .storage_provider() + .checkpoint_configs(bucket_id) } } diff --git a/client/src/verification.rs b/client/src/verification.rs index b10ad62b..b293ff07 100644 --- a/client/src/verification.rs +++ b/client/src/verification.rs @@ -8,9 +8,9 @@ //! - Make informed provider selection decisions use crate::ClientError as Error; -use sp_core::H256; use std::collections::HashMap; use std::time::{Duration, Instant}; +use storage_subxt::subxt::utils::H256; /// Provider performance statistics. #[derive(Debug, Clone, Default)] diff --git a/client/tests/admin_integration.rs b/client/tests/admin_integration.rs index a8b4a6b4..c3973bbf 100644 --- a/client/tests/admin_integration.rs +++ b/client/tests/admin_integration.rs @@ -64,16 +64,15 @@ async fn test_bucket_lifecycle() { .await .expect("get_bucket_info should succeed"); - assert_eq!(info.bucket_id, bucket_id); assert_eq!(info.min_providers, 1); // The pallet auto-adds the creator (Alice) as an Admin member. assert_eq!( - info.members.len(), + info.members.0.len(), 1, "creator should be auto-added as Admin" ); assert_eq!( - info.members[0].role as u8, + info.members.0[0].role.clone() as u8, Role::Admin as u8, "creator's initial role should be Admin" ); @@ -91,14 +90,19 @@ async fn test_bucket_lifecycle() { .await .expect("get_bucket_info after add_member"); - assert_eq!(info.members.len(), 2, "should have 2 members (Alice + Bob)"); + assert_eq!( + info.members.0.len(), + 2, + "should have 2 members (Alice + Bob)" + ); let bob_info = info .members + .0 .iter() - .find(|m| m.role as u8 == Role::Reader as u8) + .find(|m| m.role.clone() as u8 == Role::Reader as u8) .expect("Bob should be in members with Reader role"); assert_eq!( - bob_info.role as u8, + bob_info.role.clone() as u8, Role::Reader as u8, "Bob's role should be Reader" ); @@ -115,16 +119,17 @@ async fn test_bucket_lifecycle() { .expect("get_bucket_info after update_member_role"); assert_eq!( - info.members.len(), + info.members.0.len(), 2, "should still have 2 members after role update" ); let bob_info = info .members + .0 .iter() - .find(|m| m.role as u8 == Role::Writer as u8) + .find(|m| m.role.clone() as u8 == Role::Writer as u8) .expect("Bob should have Writer role after update"); - assert_eq!(bob_info.role as u8, Role::Writer as u8); + assert_eq!(bob_info.role.clone() as u8, Role::Writer as u8); // ── remove Bob ──────────────────────────────────────────────────────────── admin @@ -138,7 +143,7 @@ async fn test_bucket_lifecycle() { .expect("get_bucket_info after remove_member"); assert_eq!( - info.members.len(), + info.members.0.len(), 1, "only Alice should remain after removing Bob" ); diff --git a/client/tests/challenger_integration.rs b/client/tests/challenger_integration.rs index 0a922f86..5b25c108 100644 --- a/client/tests/challenger_integration.rs +++ b/client/tests/challenger_integration.rs @@ -181,35 +181,3 @@ async fn test_analyze_provider() { "analysis.provider should match the queried account" ); } - -/// `check_and_claim_reward` always returns `None` — rewards are auto-distributed -/// by `on_finalize`; there is no manual claim extrinsic. -#[tokio::test] -async fn test_check_and_claim_reward_returns_none() { - use storage_client::challenger::ChallengeId; - - let _guard = chain_guard().await; - - let challenger = match alice_challenger().await { - Some(c) => c, - None => { - eprintln!("Chain not reachable — skipping test_check_and_claim_reward_returns_none"); - return; - } - }; - - let fake_id = ChallengeId { - deadline: 999_999, - index: 0, - }; - - let reward = challenger - .check_and_claim_reward(fake_id) - .await - .expect("check_and_claim_reward should not error"); - - assert!( - reward.is_none(), - "reward should be None (rewards are auto-distributed by on_finalize)" - ); -} diff --git a/client/tests/checkpoint_integration.rs b/client/tests/checkpoint_integration.rs index f6b631f6..1abfb9fe 100644 --- a/client/tests/checkpoint_integration.rs +++ b/client/tests/checkpoint_integration.rs @@ -81,7 +81,6 @@ async fn test_multiple_providers_track_commitments_independently() { client.commit(bucket_id, vec![root], 0u64).await.unwrap(); let commitment = client.get_commitment(bucket_id, 0u64).await.unwrap(); - assert_eq!(commitment.bucket_id, bucket_id); assert_eq!(commitment.leaf_count, 1); } diff --git a/client/tests/client_integration.rs b/client/tests/client_integration.rs index 559da156..f7c4a11c 100644 --- a/client/tests/client_integration.rs +++ b/client/tests/client_integration.rs @@ -9,8 +9,8 @@ mod common; use common::{make_client, start_test_provider}; -use sp_core::H256; use storage_client::{ChunkingStrategy, EncryptionKey, ENCRYPTION_OVERHEAD}; +use storage_subxt::subxt::utils::H256; // ============================================================================ // Health @@ -435,7 +435,6 @@ async fn test_get_commitment_reflects_uploads() { let commitment = client.get_commitment(1, 0u64).await.unwrap(); - assert_eq!(commitment.bucket_id, 1); assert_eq!(commitment.leaf_count, 1); assert_eq!(commitment.start_seq, 0); assert!(!commitment.mmr_root.is_empty()); @@ -596,7 +595,5 @@ async fn test_different_buckets_are_independent() { let c1 = client.get_commitment(1, 0u64).await.unwrap(); let c2 = client.get_commitment(2, 0u64).await.unwrap(); - assert_eq!(c1.bucket_id, 1); - assert_eq!(c2.bucket_id, 2); assert_ne!(c1.mmr_root, c2.mmr_root); } diff --git a/client/tests/common/mod.rs b/client/tests/common/mod.rs index aaba1b4a..966ec908 100644 --- a/client/tests/common/mod.rs +++ b/client/tests/common/mod.rs @@ -2,15 +2,15 @@ //! Shared test helpers for integration tests. -use sp_core::crypto::Ss58Codec; -use sp_runtime::AccountId32; use std::sync::{Arc, OnceLock}; use storage_client::{ sign_terms, AdminClient, AgreementTermsOf, ChallengerClient, ClientConfig, DiscoveryClient, - ProviderClient, ProviderSettings, StorageUserClient, + ProviderClient, StorageUserClient, }; use storage_primitives::AgreementTerms; use storage_provider_node::{create_router, ProviderState, Storage}; +use storage_subxt::api::runtime_types::pallet_storage_provider::pallet::ProviderSettings; +use storage_subxt::subxt; use tokio::net::TcpListener; use tokio::sync::{Mutex, MutexGuard}; @@ -49,7 +49,7 @@ const MIN_STAKE: u128 = 1_000 * 1_000_000_000_000u128; /// `set_dev_signer` uses internally, so the account and signer always match. #[allow(dead_code)] pub fn dev_ss58(name: &str) -> String { - dev_account(name).to_ss58check() + dev_account(name).to_string() } /// Derive the typed `AccountId32` for a dev account by name ("alice", "bob", …). @@ -57,8 +57,8 @@ pub fn dev_ss58(name: &str) -> String { /// Same derivation as [`dev_ss58`], just without the SS58 round-trip — useful for /// storage queries / parser APIs that take `&AccountId32` directly. #[allow(dead_code)] -pub fn dev_account(name: &str) -> AccountId32 { - use subxt_signer::sr25519::dev; +pub fn dev_account(name: &str) -> subxt::utils::AccountId32 { + use storage_subxt::subxt_signer::sr25519::dev; let keypair = match name { "alice" => dev::alice(), @@ -69,7 +69,7 @@ pub fn dev_account(name: &str) -> AccountId32 { "ferdie" => dev::ferdie(), other => panic!("unknown dev account: {other}"), }; - AccountId32::from(keypair.public_key().0) + keypair.public_key().to_account_id() } // ─── Chain client config ────────────────────────────────────────────────────── @@ -123,7 +123,7 @@ pub async fn chain_setup() -> Option { Ok(Some(_)) ); - let alice_keypair = subxt_signer::sr25519::dev::alice(); + let alice_keypair = storage_subxt::subxt_signer::sr25519::dev::alice(); let alice_pubkey = alice_keypair.public_key().0.to_vec(); if !already_registered { diff --git a/client/tests/discovery_integration.rs b/client/tests/discovery_integration.rs index 170639f4..069e6272 100644 --- a/client/tests/discovery_integration.rs +++ b/client/tests/discovery_integration.rs @@ -17,7 +17,13 @@ mod common; use common::{chain_guard, chain_setup, dev_discovery}; -use storage_client::StorageRequirements; +use storage_subxt::api::runtime_types::pallet_storage_provider::runtime_api::StorageRequirements; +use storage_subxt::subxt::utils::AccountId32; + +fn account_bytes_to_ss58(bytes: &[u8]) -> String { + let arr: [u8; 32] = bytes.try_into().unwrap_or_default(); + AccountId32::from(arr).to_string() +} // ─── list_providers ─────────────────────────────────────────────────────────── @@ -129,12 +135,15 @@ async fn test_get_provider_info() { .expect("get_provider_info should not error") .expect("Alice should be found after chain_setup"); - assert!(info.accepting_primary, "Alice should be accepting primary"); + assert!( + info.settings.accepting_primary, + "Alice should be accepting primary" + ); assert!(info.stake > 0, "Alice's stake should be > 0"); println!( "get_provider_info OK: account={} stake={} accepting={}", - setup.alice_ss58, info.stake, info.accepting_primary + setup.alice_ss58, info.stake, info.settings.accepting_primary ); // Zero account — must return None. @@ -280,9 +289,12 @@ async fn test_find_providers_sorted_by_score() { .await .expect("find_providers should not error"); - let accounts: Vec<&str> = matched.iter().map(|m| m.account.as_str()).collect(); + let accounts: Vec = matched + .iter() + .map(|m| account_bytes_to_ss58(&m.account)) + .collect(); assert!( - accounts.contains(&setup.alice_ss58.as_str()), + accounts.iter().any(|a| a == &setup.alice_ss58), "Alice should be in find_providers results" ); @@ -298,7 +310,9 @@ async fn test_find_providers_sorted_by_score() { for m in &matched { println!( " account={} score={} price={}", - m.account, m.match_score, m.info.price_per_byte + account_bytes_to_ss58(&m.account), + m.match_score, + m.info.price_per_byte ); } } @@ -335,9 +349,12 @@ async fn test_find_providers_price_filter_excludes_alice() { .await .expect("find_providers with price=0 should not error"); - let accounts: Vec<&str> = matched.iter().map(|m| m.account.as_str()).collect(); + let accounts: Vec = matched + .iter() + .map(|m| account_bytes_to_ss58(&m.account)) + .collect(); assert!( - !accounts.contains(&setup.alice_ss58.as_str()), + !accounts.iter().any(|a| a == &setup.alice_ss58), "Alice (price=1_000_000) should not match max_price_per_byte=0" ); diff --git a/client/tests/provider_integration.rs b/client/tests/provider_integration.rs index 8e136a64..63286f75 100644 --- a/client/tests/provider_integration.rs +++ b/client/tests/provider_integration.rs @@ -14,7 +14,14 @@ mod common; use common::{alice_provider, chain_guard, chain_setup, dev_account}; -use storage_client::ProviderSettings; +use storage_subxt::api::runtime_types::{ + pallet_storage_provider::{pallet::ProviderSettings, runtime_api::AgreementResponse}, + storage_primitives::ProviderRole, +}; + +pub fn is_primary(agreement: &AgreementResponse) -> bool { + matches!(agreement.role, ProviderRole::Primary,) +} /// After `chain_setup`, Alice is a registered provider, so `get_provider_info` /// returns `Some(info)` with the settings established by setup. @@ -39,12 +46,12 @@ async fn test_get_provider_info_alice_registered() { println!( "Alice ProviderInfo: multiaddr={} stake={} committed={} max_capacity={} price={} accepting_primary={}", - info.multiaddr, + String::from_utf8_lossy(&info.multiaddr.0), info.stake, info.committed_bytes, - info.max_capacity, - info.price_per_byte, - info.accepting_primary, + info.settings.max_capacity, + info.settings.price_per_byte, + info.settings.accepting_primary, ); assert!( @@ -52,22 +59,22 @@ async fn test_get_provider_info_alice_registered() { "stake should be positive after registration" ); assert!( - info.accepting_primary, + info.settings.accepting_primary, "chain_setup configures accepting_primary=true" ); assert_eq!( - info.replica_sync_price, None, + info.settings.replica_sync_price, None, "chain_setup configures replica_sync_price=None" ); assert!( - info.max_capacity > 0, + info.settings.max_capacity > 0, "chain_setup configures a non-zero max_capacity" ); assert!( - info.committed_bytes <= info.max_capacity, + info.committed_bytes <= info.settings.max_capacity, "committed_bytes ({}) should never exceed max_capacity ({})", info.committed_bytes, - info.max_capacity + info.settings.max_capacity ); } @@ -117,11 +124,15 @@ async fn test_list_active_agreements() { println!("Alice has {} active agreement(s)", agreements.len()); for a in &agreements { - assert!(!a.owner.is_empty(), "owner should not be empty"); + assert!(!a.agreement.owner.is_empty(), "owner should not be empty"); assert!(a.bucket_id > 0, "bucket_id should be non-zero"); println!( " bucket={} owner={} max_bytes={} expires_at={} primary={}", - a.bucket_id, a.owner, a.max_bytes, a.expires_at, a.is_primary + a.bucket_id, + hex::encode(&a.agreement.owner), + a.agreement.max_bytes, + a.agreement.expires_at, + is_primary(&a.agreement), ); } } @@ -148,15 +159,15 @@ async fn test_list_active_challenges() { println!("Alice has {} active challenge(s)", challenges.len()); for c in &challenges { - assert!(c.bucket_id > 0, "bucket_id should be non-zero"); + assert!(c.challenge.bucket_id > 0, "bucket_id should be non-zero"); println!( " challenge=({},{}) bucket={} deadline={} leaf={} chunk={}", c.challenge_id.0, c.challenge_id.1, - c.bucket_id, - c.deadline, - c.leaf_index, - c.chunk_index + c.challenge.bucket_id, + c.challenge.deadline, + c.challenge.leaf_index, + c.challenge.chunk_index ); } } @@ -271,7 +282,7 @@ async fn test_get_capacity_info() { ); assert_eq!( info.available_bytes, - pi.max_capacity.saturating_sub(pi.committed_bytes), + pi.settings.max_capacity.saturating_sub(pi.committed_bytes), "available_bytes should equal max_capacity − committed_bytes" ); } @@ -333,16 +344,20 @@ async fn test_update_settings_round_trip() { // Pick a price clearly different from the current one to make the assertion // meaningful regardless of what previous tests left behind. - let new_price = before.price_per_byte.saturating_add(500_000).max(1_500_000); + let new_price = before + .settings + .price_per_byte + .saturating_add(500_000) + .max(1_500_000); let new_settings = ProviderSettings { price_per_byte: new_price, - min_duration: before.min_duration, - max_duration: before.max_duration, - accepting_primary: before.accepting_primary, - replica_sync_price: before.replica_sync_price, - accepting_extensions: before.accepting_extensions, - max_capacity: before.max_capacity, + min_duration: before.settings.min_duration, + max_duration: before.settings.max_duration, + accepting_primary: before.settings.accepting_primary, + replica_sync_price: before.settings.replica_sync_price, + accepting_extensions: before.settings.accepting_extensions, + max_capacity: before.settings.max_capacity, }; provider @@ -357,19 +372,19 @@ async fn test_update_settings_round_trip() { .expect("Alice should still be registered"); assert_eq!( - after.price_per_byte, new_price, + after.settings.price_per_byte, new_price, "price_per_byte should reflect the update" ); // Restore prior settings so subsequent tests see Alice in her chain_setup state. let restored = ProviderSettings { - price_per_byte: before.price_per_byte, - min_duration: before.min_duration, - max_duration: before.max_duration, - accepting_primary: before.accepting_primary, - replica_sync_price: before.replica_sync_price, - accepting_extensions: before.accepting_extensions, - max_capacity: before.max_capacity, + price_per_byte: before.settings.price_per_byte, + min_duration: before.settings.min_duration, + max_duration: before.settings.max_duration, + accepting_primary: before.settings.accepting_primary, + replica_sync_price: before.settings.replica_sync_price, + accepting_extensions: before.settings.accepting_extensions, + max_capacity: before.settings.max_capacity, }; provider .update_settings(restored) diff --git a/justfile b/justfile index 5c7ce65f..54b13721 100644 --- a/justfile +++ b/justfile @@ -130,6 +130,33 @@ setup: download-binaries build @echo "" @echo "Setup complete! Run 'just start-chain' and 'just start-provider' to start the local network." +# Generate subxt code from runtime metadata (paseo runtime). +# Requires a running node (`just start-paseo-chain` in another terminal) and +# the `subxt` CLI (`cargo install subxt-cli --force --locked`) + `rustfmt` on PATH. +subxt-codegen URL=CHAIN_WS OUTPUT="storage-subxt/src/storage_paseo_runtime.rs": + #!/usr/bin/env bash + set -euo pipefail + echo "Downloading metadata from {{ URL }}..." + subxt metadata -f bytes --url "{{ URL }}" > storage-subxt/metadata/storage_paseo_runtime.scale + echo "Generating subxt code..." + subxt codegen --file storage-subxt/metadata/storage_paseo_runtime.scale \ + --crate "::subxt_core" \ + --derive Clone \ + --derive Eq \ + --derive PartialEq \ + --derive-for-type "pallet_storage_provider::pallet::ProviderInfo=serde::Serialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderInfo=serde::Deserialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderSettings=serde::Serialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderSettings=serde::Deserialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderStats=serde::Serialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderStats=serde::Deserialize" \ + --derive-for-type "bounded_collections::bounded_vec::BoundedVec=serde::Serialize" \ + --derive-for-type "bounded_collections::bounded_vec::BoundedVec=serde::Deserialize" \ + --derive-for-type "sp_runtime::MultiSignature=codec::Encode" \ + --derive-for-type "sp_runtime::MultiSignature=codec::Decode" \ + | rustfmt --edition=2021 --emit=stdout > "{{ OUTPUT }}" + echo "Generated {{ OUTPUT }}" + # Start the blockchain (relay chain + parachain) start-chain: check build-runtime #!/usr/bin/env bash diff --git a/packages/layer0/src/pallets/storage-provider.ts b/packages/layer0/src/pallets/storage-provider.ts index 230079bc..d89c650f 100644 --- a/packages/layer0/src/pallets/storage-provider.ts +++ b/packages/layer0/src/pallets/storage-provider.ts @@ -108,7 +108,7 @@ export async function ensureProviderRegistered( const priceSynced = readiness.provider_info_loaded && provider_registration_info != null && - BigInt(provider_registration_info.price_per_byte) === pricePerByte; + BigInt(provider_registration_info.settings.price_per_byte) === pricePerByte; if (readiness.signing_configured && readiness.nonce_counter_ready && priceSynced) return; await new Promise((resolve) => setTimeout(resolve, 3000)); } diff --git a/packages/layer0/src/provider-http.ts b/packages/layer0/src/provider-http.ts index 699d0cdc..f53e7beb 100644 --- a/packages/layer0/src/provider-http.ts +++ b/packages/layer0/src/provider-http.ts @@ -60,7 +60,7 @@ export interface ProviderNodeInfo { * The provider's on-chain registration as the node currently sees it; `null` * until `readiness.provider_info_loaded`. */ - provider_registration_info: { price_per_byte: string | number | bigint } | null; + provider_registration_info: any | null; } /** diff --git a/packages/papi/.papi/metadata/parachain.scale b/packages/papi/.papi/metadata/parachain.scale index a124934d..c1a65e8e 100644 Binary files a/packages/papi/.papi/metadata/parachain.scale and b/packages/papi/.papi/metadata/parachain.scale differ diff --git a/packages/papi/.papi/polkadot-api.json b/packages/papi/.papi/polkadot-api.json index ab7232e7..684bfda9 100644 --- a/packages/papi/.papi/polkadot-api.json +++ b/packages/papi/.papi/polkadot-api.json @@ -5,8 +5,8 @@ "parachain": { "wsUrl": "ws://127.0.0.1:2222", "metadata": ".papi/metadata/parachain.scale", - "genesis": "0xb04fdf186c5b31c3c8e8065eff232fbbdd6ebe92f4838468d62a496f5e967831", - "codeHash": "0xda06dc684cfc50527e04b5cb1547a2830b71a5518a14a504f33114eff6040932" + "genesis": "0x4545454545454545454545454545454545454545454545454545454545454545", + "codeHash": "0x013ece9e417d495cccfc5841f593a9b8ddfd667691ed6f815a2cac5855b008d1" } } } diff --git a/pallet/src/tests/runtime_api.rs b/pallet/src/tests/runtime_api.rs index 09ca6ae1..56307426 100644 --- a/pallet/src/tests/runtime_api.rs +++ b/pallet/src/tests/runtime_api.rs @@ -447,70 +447,301 @@ fn setup_two_challenges() -> u64 { } #[test] -fn query_bucket_challenges_returns_data() { +fn query_bucket_challenges_empty_for_unknown() { new_test_ext().execute_with(|| { - let bucket_id = setup_two_challenges(); + setup_two_challenges(); - let challenges = StorageProvider::query_bucket_challenges(bucket_id); - assert_eq!(challenges.len(), 2); - assert!(challenges.iter().all(|c| c.bucket_id == bucket_id)); - assert!(challenges.iter().any(|c| c.provider == 2u64.encode())); - assert!(challenges.iter().any(|c| c.provider == 4u64.encode())); + let challenges = StorageProvider::query_bucket_challenges(999); + assert!(challenges.is_empty()); }); } #[test] -fn query_bucket_challenges_empty_for_unknown() { +fn query_provider_challenges_empty_for_unknown() { new_test_ext().execute_with(|| { setup_two_challenges(); - let challenges = StorageProvider::query_bucket_challenges(999); + let challenges = StorageProvider::query_provider_challenges(&99); assert!(challenges.is_empty()); }); } #[test] -fn query_provider_challenges_returns_data() { +fn query_challenger_challenges_empty_for_unknown() { new_test_ext().execute_with(|| { - let bucket_id = setup_two_challenges(); + setup_two_challenges(); - let challenges = StorageProvider::query_provider_challenges(&2); - assert_eq!(challenges.len(), 1); - assert_eq!(challenges[0].bucket_id, bucket_id); - assert_eq!(challenges[0].provider, 2u64.encode()); - assert_eq!(challenges[0].challenger, 3u64.encode()); + let challenges = StorageProvider::query_challenger_challenges(&99); + assert!(challenges.is_empty()); }); } #[test] -fn query_provider_challenges_empty_for_unknown() { +fn agreement_response_includes_bucket_id() { new_test_ext().execute_with(|| { - setup_two_challenges(); + register_provider(2, 200); + let bucket_id = setup_agreement(2, 1, 50, 200); - let challenges = StorageProvider::query_provider_challenges(&99); - assert!(challenges.is_empty()); + let response = StorageProvider::query_agreement_info(bucket_id, &2).unwrap(); + assert_eq!(response.bucket_id, bucket_id); + + let bucket_agreements = StorageProvider::query_bucket_agreements(bucket_id); + assert_eq!(bucket_agreements.len(), 1); + assert_eq!(bucket_agreements[0].bucket_id, bucket_id); + + let provider_agreements = StorageProvider::query_provider_agreements(&2); + assert_eq!(provider_agreements.len(), 1); + assert_eq!(provider_agreements[0].bucket_id, bucket_id); }); } #[test] -fn query_challenger_challenges_returns_data() { +fn challenge_response_includes_index() { new_test_ext().execute_with(|| { - let bucket_id = setup_two_challenges(); + frame_system::Pallet::::set_block_number(1); + register_provider(2, 200); + register_provider(3, 200); + let bucket_id_a = setup_agreement(2, 1, 50, 200); + let bucket_id_b = setup_agreement(3, 1, 50, 200); + + let snapshot = BucketSnapshot { + commitment: Commitment { + mmr_root: H256::repeat_byte(0xAB), + start_seq: 0, + leaf_count: 10, + }, + checkpoint_block: 1, + primary_signers: vec![0x01], + commitment_nonce: 0, + }; + Buckets::::mutate(bucket_id_a, |b| { + if let Some(b) = b { + b.snapshot = Some(snapshot.clone()); + } + }); + Buckets::::mutate(bucket_id_b, |b| { + if let Some(b) = b { + b.snapshot = Some(snapshot); + } + }); + + // Two challenges at the same deadline block + assert_ok!(StorageProvider::challenge_checkpoint( + RuntimeOrigin::signed(4), + bucket_id_a, + 2, + ChunkLocation { + leaf_index: 0, + chunk_index: 0, + }, + )); + assert_ok!(StorageProvider::challenge_checkpoint( + RuntimeOrigin::signed(4), + bucket_id_b, + 3, + ChunkLocation { + leaf_index: 0, + chunk_index: 0, + }, + )); - let challenges = StorageProvider::query_challenger_challenges(&5); - assert_eq!(challenges.len(), 1); - assert_eq!(challenges[0].bucket_id, bucket_id); - assert_eq!(challenges[0].provider, 4u64.encode()); - assert_eq!(challenges[0].challenger, 5u64.encode()); + let challenges = StorageProvider::query_challenges_at(101); + assert_eq!(challenges.len(), 2); + assert_eq!(challenges[0].index, 0); + assert_eq!(challenges[1].index, 1); }); } #[test] -fn query_challenger_challenges_empty_for_unknown() { +fn query_bucket_challenges_returns_data() { new_test_ext().execute_with(|| { - setup_two_challenges(); + frame_system::Pallet::::set_block_number(1); + register_provider(2, 200); + register_provider(3, 200); + let bucket_id_a = setup_agreement(2, 1, 50, 200); + let bucket_id_b = setup_agreement(3, 1, 50, 200); + + let snapshot = BucketSnapshot { + commitment: Commitment { + mmr_root: H256::repeat_byte(0xAB), + start_seq: 0, + leaf_count: 10, + }, + checkpoint_block: 1, + primary_signers: vec![0x01], + commitment_nonce: 0, + }; + Buckets::::mutate(bucket_id_a, |b| { + if let Some(b) = b { + b.snapshot = Some(snapshot.clone()); + } + }); + Buckets::::mutate(bucket_id_b, |b| { + if let Some(b) = b { + b.snapshot = Some(snapshot); + } + }); - let challenges = StorageProvider::query_challenger_challenges(&99); - assert!(challenges.is_empty()); + assert_ok!(StorageProvider::challenge_checkpoint( + RuntimeOrigin::signed(4), + bucket_id_a, + 2, + ChunkLocation { + leaf_index: 0, + chunk_index: 0, + }, + )); + assert_ok!(StorageProvider::challenge_checkpoint( + RuntimeOrigin::signed(4), + bucket_id_b, + 3, + ChunkLocation { + leaf_index: 0, + chunk_index: 0, + }, + )); + + let results = StorageProvider::query_bucket_challenges(bucket_id_a); + assert_eq!(results.len(), 1); + assert_eq!(results[0].bucket_id, bucket_id_a); + assert_eq!(results[0].deadline, 101); + assert_eq!(results[0].index, 0); + + let results = StorageProvider::query_bucket_challenges(bucket_id_b); + assert_eq!(results.len(), 1); + assert_eq!(results[0].bucket_id, bucket_id_b); + + let empty = StorageProvider::query_bucket_challenges(999); + assert!(empty.is_empty()); + }); +} + +#[test] +fn query_provider_challenges_returns_data() { + new_test_ext().execute_with(|| { + frame_system::Pallet::::set_block_number(1); + register_provider(2, 200); + register_provider(3, 200); + let bucket_id_a = setup_agreement(2, 1, 50, 200); + let bucket_id_b = setup_agreement(3, 1, 50, 200); + + let snapshot = BucketSnapshot { + commitment: Commitment { + mmr_root: H256::repeat_byte(0xAB), + start_seq: 0, + leaf_count: 10, + }, + checkpoint_block: 1, + primary_signers: vec![0x01], + commitment_nonce: 0, + }; + Buckets::::mutate(bucket_id_a, |b| { + if let Some(b) = b { + b.snapshot = Some(snapshot.clone()); + } + }); + Buckets::::mutate(bucket_id_b, |b| { + if let Some(b) = b { + b.snapshot = Some(snapshot); + } + }); + + assert_ok!(StorageProvider::challenge_checkpoint( + RuntimeOrigin::signed(4), + bucket_id_a, + 2, + ChunkLocation { + leaf_index: 0, + chunk_index: 0, + }, + )); + assert_ok!(StorageProvider::challenge_checkpoint( + RuntimeOrigin::signed(4), + bucket_id_b, + 3, + ChunkLocation { + leaf_index: 0, + chunk_index: 0, + }, + )); + + let results = StorageProvider::query_provider_challenges(&2); + assert_eq!(results.len(), 1); + assert_eq!(results[0].bucket_id, bucket_id_a); + assert_eq!(results[0].provider, 2u64.encode()); + assert_eq!(results[0].index, 0); + + let results = StorageProvider::query_provider_challenges(&3); + assert_eq!(results.len(), 1); + assert_eq!(results[0].bucket_id, bucket_id_b); + + let empty = StorageProvider::query_provider_challenges(&99); + assert!(empty.is_empty()); + }); +} + +#[test] +fn query_challenger_challenges_returns_data() { + new_test_ext().execute_with(|| { + frame_system::Pallet::::set_block_number(1); + register_provider(2, 200); + register_provider(3, 200); + let bucket_id_a = setup_agreement(2, 1, 50, 200); + let bucket_id_b = setup_agreement(3, 1, 50, 200); + + let snapshot = BucketSnapshot { + commitment: Commitment { + mmr_root: H256::repeat_byte(0xAB), + start_seq: 0, + leaf_count: 10, + }, + checkpoint_block: 1, + primary_signers: vec![0x01], + commitment_nonce: 0, + }; + Buckets::::mutate(bucket_id_a, |b| { + if let Some(b) = b { + b.snapshot = Some(snapshot.clone()); + } + }); + Buckets::::mutate(bucket_id_b, |b| { + if let Some(b) = b { + b.snapshot = Some(snapshot); + } + }); + + // challenger 4 challenges provider 2; challenger 5 challenges provider 3 + assert_ok!(StorageProvider::challenge_checkpoint( + RuntimeOrigin::signed(4), + bucket_id_a, + 2, + ChunkLocation { + leaf_index: 0, + chunk_index: 0, + }, + )); + assert_ok!(StorageProvider::challenge_checkpoint( + RuntimeOrigin::signed(5), + bucket_id_b, + 3, + ChunkLocation { + leaf_index: 0, + chunk_index: 0, + }, + )); + + let results = StorageProvider::query_challenger_challenges(&4); + assert_eq!(results.len(), 1); + assert_eq!(results[0].bucket_id, bucket_id_a); + assert_eq!(results[0].challenger, 4u64.encode()); + assert_eq!(results[0].index, 0); + + let results = StorageProvider::query_challenger_challenges(&5); + assert_eq!(results.len(), 1); + assert_eq!(results[0].bucket_id, bucket_id_b); + assert_eq!(results[0].challenger, 5u64.encode()); + + let empty = StorageProvider::query_challenger_challenges(&99); + assert!(empty.is_empty()); }); } diff --git a/provider-node/Cargo.toml b/provider-node/Cargo.toml index 60c49972..c3d02fbd 100644 --- a/provider-node/Cargo.toml +++ b/provider-node/Cargo.toml @@ -9,6 +9,7 @@ description = "Off-chain provider node for scalable Web3 storage" [dependencies] storage-client = { workspace = true } +storage-subxt = { workspace = true } storage-primitives = { workspace = true, features = ["serde", "std"] } tokio = { workspace = true } axum = { workspace = true } @@ -16,10 +17,8 @@ tower-http = { workspace = true } tokio-rate-limit = { workspace = true } serde = { workspace = true, features = ["std"] } serde_json = { workspace = true } +serde_with = { workspace = true } sp-core = { workspace = true, features = ["std"] } -sp-runtime = { workspace = true, features = ["std"] } -subxt = { workspace = true } -subxt-signer = { workspace = true } base64 = { workspace = true } thiserror = { workspace = true } tracing = { workspace = true, features = ["std"] } @@ -38,3 +37,6 @@ async-trait = { workspace = true } tokio = { workspace = true, features = ["macros", "rt-multi-thread", "test-util", "time"] } serde_json = { workspace = true } tempfile = { workspace = true } + +[features] +mainnet = ["storage-client/mainnet", "storage-subxt/mainnet"] diff --git a/provider-node/src/api.rs b/provider-node/src/api.rs index 3ceb9732..3e5bcbaa 100644 --- a/provider-node/src/api.rs +++ b/provider-node/src/api.rs @@ -22,11 +22,11 @@ use axum::{ }; use base64::{engine::general_purpose::STANDARD as BASE64, Engine}; use codec::Encode; -use sp_core::H256; use std::net::SocketAddr; use std::sync::Arc; use storage_primitives::AgreementTerms; use storage_primitives::{CheckpointProposal, Commitment, CommitmentPayload}; +use storage_subxt::subxt::utils::H256; use tokio_rate_limit::RateLimiter; use tower_http::cors::CorsLayer; use tower_http::trace::TraceLayer; @@ -965,7 +965,7 @@ async fn negotiate_terms( owner: req.owner, max_bytes: req.max_bytes, duration: req.duration, - price_per_byte: info.price_per_byte, + price_per_byte: info.settings.price_per_byte, valid_until: current_block.saturating_add(request_timeout), nonce: nonce_counter.next(), bucket_id: req.bucket_id, diff --git a/provider-node/src/auth.rs b/provider-node/src/auth.rs index ae99b1db..d8d07870 100644 --- a/provider-node/src/auth.rs +++ b/provider-node/src/auth.rs @@ -10,10 +10,12 @@ use crate::error::Error; use crate::ProviderState; use dashmap::DashMap; -use sp_core::{crypto::AccountId32, sr25519, Pair}; +use sp_core::{sr25519, Pair}; use std::time::{Duration, Instant}; +use storage_client::substrate::storage; +use storage_client::substrate::SubstrateClient; use storage_primitives::Role; -use subxt::{OnlineClient, PolkadotConfig}; +use storage_subxt::subxt::utils::AccountId32; use tokio::sync::OnceCell; /// Caller identity extracted from a signed request. @@ -107,33 +109,31 @@ fn find_role(members: &[(AccountId32, Role)], account: &AccountId32) -> Option>, + /// `SubstrateClient` is `Arc`-backed so connecting once and cloning is cheap. + /// We store it in a `OnceCell` so we connect on the first lookup and reuse + /// the connection for every subsequent one. If the first attempt fails the + /// cell stays empty, so the next lookup retries. + client: OnceCell, } impl ChainMembershipResolver { pub fn new(chain_rpc: String) -> Self { Self { chain_rpc, - api: OnceCell::new(), + client: OnceCell::new(), } } /// Return the shared chain client, connecting on first use. - async fn api(&self) -> Result<&OnlineClient, String> { - self.api + async fn client(&self) -> Result<&SubstrateClient, String> { + self.client .get_or_try_init(|| async { - OnlineClient::::from_url(&self.chain_rpc) + SubstrateClient::connect(&self.chain_rpc) .await .map_err(|e| format!("Failed to connect to chain: {e}")) }) @@ -144,100 +144,44 @@ impl ChainMembershipResolver { #[async_trait::async_trait] impl MembershipResolver for ChainMembershipResolver { async fn fetch_members(&self, bucket_id: u64) -> Result, String> { - use subxt::dynamic::{At, Value}; + let client = self.client().await?; - let api = self.api().await?; - - let storage_query = subxt::dynamic::storage( - "StorageProvider", - "Buckets", - vec![Value::u128(bucket_id as u128)], - ); - - let result = api + let storage_api = client + .api() .storage() .at_latest() .await - .map_err(|e| format!("Failed to get storage: {e}"))? - .fetch(&storage_query) - .await - .map_err(|e| format!("Failed to fetch bucket: {e}"))?; - - let bucket_value = match result { - Some(v) => v, - None => return Ok(vec![]), - }; + .map_err(|e| format!("Failed to get storage: {e}"))?; - let decoded = bucket_value - .to_value() - .map_err(|e| format!("Failed to decode bucket: {e}"))?; - - let members_val = match decoded.at("members") { - Some(v) => v, + let bucket = match storage_api + .fetch(&storage::bucket_info(bucket_id)) + .await + .map_err(|e| format!("Failed to fetch bucket: {e}"))? + { + Some(b) => b, None => return Ok(vec![]), }; - let mut members = Vec::new(); - if let subxt::ext::scale_value::ValueDef::Composite( - subxt::ext::scale_value::Composite::Unnamed(items), - ) = &members_val.value - { - for item in items { - let account_val = item.at("account"); - let role_val = item.at("role"); - - if let (Some(account_v), Some(role_v)) = (account_val, role_val) { - let account_bytes = extract_account_bytes(account_v); - if let Some(bytes) = account_bytes { - let account = AccountId32::from(bytes); - let role = extract_role(role_v); - members.push((account, role)); - } - } - } - } + let members = bucket + .members + .0 + .into_iter() + .map(|m| { + let account = AccountId32::from(m.account.0); + use storage_subxt::api::runtime_types as rt; + let role = match m.role { + rt::storage_primitives::Role::Admin => Role::Admin, + rt::storage_primitives::Role::Writer => Role::Writer, + rt::storage_primitives::Role::Reader => Role::Reader, + }; + (account, role) + }) + .collect(); Ok(members) } } -fn extract_account_bytes(val: &subxt::ext::scale_value::Value) -> Option<[u8; 32]> { - use subxt::ext::scale_value::{Composite, Primitive, ValueDef}; - match &val.value { - ValueDef::Composite(Composite::Unnamed(items)) => { - let bytes: Vec = items - .iter() - .filter_map(|item| match &item.value { - ValueDef::Primitive(Primitive::U128(n)) => Some(*n as u8), - _ => None, - }) - .collect(); - if bytes.len() == 32 { - let mut arr = [0u8; 32]; - arr.copy_from_slice(&bytes); - Some(arr) - } else { - None - } - } - _ => None, - } -} - -fn extract_role(val: &subxt::ext::scale_value::Value) -> Role { - use subxt::ext::scale_value::ValueDef; - if let ValueDef::Variant(variant) = &val.value { - match variant.name.as_str() { - "Admin" => Role::Admin, - "Writer" => Role::Writer, - "Reader" => Role::Reader, - _ => Role::Reader, // default to least privilege - } - } else { - Role::Reader - } -} - /// Verify an sr25519 signature from an `Authorization` header. /// /// The client signs the request by building the message @@ -325,7 +269,7 @@ pub fn verify_signature( return Err(Error::AuthRequired); } - Ok(AccountId32::new(pubkey.0)) + Ok(AccountId32(pubkey.0)) } /// Check that the caller has sufficient permissions. @@ -409,7 +353,7 @@ mod tests { let result = verify_signature(&header, "PUT", 1, Duration::from_secs(300)); assert!(result.is_ok()); - assert_eq!(result.unwrap(), AccountId32::new(keypair.public().0)); + assert_eq!(result.unwrap(), AccountId32(keypair.public().0)); } #[test] @@ -474,9 +418,9 @@ mod tests { #[test] fn test_find_role() { - let alice = AccountId32::new([1u8; 32]); - let bob = AccountId32::new([2u8; 32]); - let charlie = AccountId32::new([3u8; 32]); + let alice = AccountId32([1u8; 32]); + let bob = AccountId32([2u8; 32]); + let charlie = AccountId32([3u8; 32]); let members = vec![ (alice.clone(), Role::Admin), @@ -488,7 +432,7 @@ mod tests { assert_eq!(find_role(&members, &bob), Some(Role::Writer)); assert_eq!(find_role(&members, &charlie), Some(Role::Reader)); - let unknown = AccountId32::new([4u8; 32]); + let unknown = AccountId32([4u8; 32]); assert_eq!(find_role(&members, &unknown), None); } } diff --git a/provider-node/src/chain_state_coordinator.rs b/provider-node/src/chain_state_coordinator.rs index b162d0c8..7baa7dcc 100644 --- a/provider-node/src/chain_state_coordinator.rs +++ b/provider-node/src/chain_state_coordinator.rs @@ -21,17 +21,18 @@ use crate::negotiate::NonceCounter; use crate::storage::{NonceStore, NullNonceStore}; use async_trait::async_trait; use parking_lot::RwLock; -use sp_core::H256; -use sp_runtime::AccountId32; use std::sync::atomic::AtomicU32; use std::sync::Arc; use std::time::Duration; -use storage_client::discovery::ProviderInfo; use storage_client::{ BlockSubscriberStream, ClientConfig, ClientError, EventParser, ProviderClient, StorageEvent, StorageProviderEventParser, }; -use subxt::ext::futures::StreamExt; +use storage_subxt::api::runtime_types::pallet_storage_provider::pallet::ProviderInfo; +use storage_subxt::subxt; +use storage_subxt::subxt::ext::futures::StreamExt; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; use tokio::task::JoinHandle; // ── ChainState ──────────────────────────────────────────────────────────────── @@ -459,19 +460,34 @@ mod tests { use std::sync::atomic::Ordering; fn sample_provider_info() -> ProviderInfo { + use storage_subxt::api::runtime_types::{ + bounded_collections::bounded_vec::BoundedVec, + pallet_storage_provider::pallet::{ProviderSettings, ProviderStats}, + }; ProviderInfo { - multiaddr: "/ip4/1.2.3.4/tcp/3333".to_string(), + multiaddr: BoundedVec(b"/ip4/1.2.3.4/tcp/3333".to_vec()), + public_key: BoundedVec(vec![]), stake: 1_000, committed_bytes: 500, - max_capacity: 10_000, - min_duration: 10, - max_duration: 100, - price_per_byte: 5, - accepting_primary: true, - replica_sync_price: None, - accepting_extensions: true, - agreements_total: 3, - challenges_failed: 1, + settings: ProviderSettings { + min_duration: 10, + max_duration: 100, + price_per_byte: 5, + accepting_primary: true, + replica_sync_price: None, + accepting_extensions: true, + max_capacity: 10_000, + }, + stats: ProviderStats { + registered_at: 0, + agreements_total: 3, + agreements_extended: 0, + agreements_not_extended: 0, + agreements_burned: 0, + total_bytes_committed: 0, + challenges_received: 0, + challenges_failed: 1, + }, deregister_at: None, } } @@ -498,9 +514,12 @@ mod tests { *cs.provider_info.write() = Some(sample_provider_info()); let guard = cs.provider_info.read(); let info = guard.as_ref().unwrap(); - assert_eq!(info.price_per_byte, 5); + assert_eq!(info.settings.price_per_byte, 5); assert_eq!(info.committed_bytes, 500); - assert_eq!(info.multiaddr, "/ip4/1.2.3.4/tcp/3333"); + assert_eq!( + String::from_utf8_lossy(&info.multiaddr.0), + "/ip4/1.2.3.4/tcp/3333" + ); } #[test] diff --git a/provider-node/src/challenge_responder.rs b/provider-node/src/challenge_responder.rs index 4a91df1d..e039fb28 100644 --- a/provider-node/src/challenge_responder.rs +++ b/provider-node/src/challenge_responder.rs @@ -7,11 +7,11 @@ //! the required proof data. use crate::{Error, ProviderState}; -use sp_core::H256; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; use storage_primitives::BucketId; +use storage_subxt::subxt::utils::H256; use tokio::sync::mpsc; /// Configuration for the challenge responder. diff --git a/provider-node/src/checkpoint_coordinator.rs b/provider-node/src/checkpoint_coordinator.rs index c8813afc..0e31a631 100644 --- a/provider-node/src/checkpoint_coordinator.rs +++ b/provider-node/src/checkpoint_coordinator.rs @@ -8,11 +8,11 @@ use crate::{Error, ProviderState}; use codec::Encode; -use sp_core::H256; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; use storage_primitives::{BucketId, CheckpointProposal}; +use storage_subxt::subxt::utils::H256; use tokio::sync::mpsc; /// Configuration for the checkpoint coordinator. diff --git a/provider-node/src/command.rs b/provider-node/src/command.rs index b06ed715..ef85a7b6 100644 --- a/provider-node/src/command.rs +++ b/provider-node/src/command.rs @@ -177,16 +177,17 @@ fn start_chain_state_coordinator( cli: &Cli, state: Arc, ) -> Option { - let provider_account = match sp_runtime::AccountId32::from_str(&state.provider_id) { - Ok(a) => a, - Err(e) => { - tracing::warn!( - "chain-state coordinator: invalid provider SS58 '{}': {e:?}", - state.provider_id - ); - return None; - } - }; + let provider_account = + match storage_subxt::subxt::utils::AccountId32::from_str(&state.provider_id) { + Ok(a) => a, + Err(e) => { + tracing::warn!( + "chain-state coordinator: invalid provider SS58 '{}': {e:?}", + state.provider_id + ); + return None; + } + }; let coordinator = ChainStateCoordinator::new( cli.rpc.chain_rpc.clone(), diff --git a/provider-node/src/fs_api.rs b/provider-node/src/fs_api.rs index 6d18d6b3..6dcf5a27 100644 --- a/provider-node/src/fs_api.rs +++ b/provider-node/src/fs_api.rs @@ -22,10 +22,10 @@ use axum::{ Json, }; use serde::{Deserialize, Serialize}; -use sp_core::H256; use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; use storage_primitives::{blake2_256, BucketId}; +use storage_subxt::subxt::utils::H256; /// Query parameter for file path. #[derive(Debug, Deserialize)] diff --git a/provider-node/src/fs_index.rs b/provider-node/src/fs_index.rs index e785b752..60ac57e8 100644 --- a/provider-node/src/fs_index.rs +++ b/provider-node/src/fs_index.rs @@ -10,10 +10,10 @@ use codec::Encode; use dashmap::DashMap; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; -use sp_core::H256; use std::collections::BTreeMap; use std::path::{Path, PathBuf}; use storage_primitives::{blake2_256, hash_children, BucketId}; +use storage_subxt::subxt::utils::H256; /// Per-entry metadata stored in the FS index. #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/provider-node/src/lib.rs b/provider-node/src/lib.rs index 32a5a65f..a34e4b56 100644 --- a/provider-node/src/lib.rs +++ b/provider-node/src/lib.rs @@ -30,6 +30,7 @@ pub mod storage; pub(crate) mod subxt_client; pub mod types; +pub use crate::types::*; pub use api::create_router; pub use chain_state_coordinator::{ is_relevant_provider_event, refresh_if_relevant_event, refresh_provider_state, sync_constants, @@ -57,12 +58,12 @@ pub use storage::{ build_merkle_proof, build_padded_merkle_tree, hex_decode, hex_encode, BucketInfo, DiskNonceStore, DiskStorage, NonceStore, NullNonceStore, Storage, StorageBackend, StoredNode, }; -pub use types::*; use std::str::FromStr; use std::sync::Arc; use std::time::Duration; -use subxt_signer::sr25519; +use storage_subxt::subxt_signer; +use storage_subxt::subxt_signer::sr25519; use tokio::sync::mpsc; /// Provider node state shared across handlers. diff --git a/provider-node/src/mmr.rs b/provider-node/src/mmr.rs index b83a7035..f84520e5 100644 --- a/provider-node/src/mmr.rs +++ b/provider-node/src/mmr.rs @@ -7,8 +7,8 @@ //! After inserting n leaves, the number of parent merges equals //! `n.trailing_zeros()`. -use sp_core::H256; use storage_primitives::hash_children; +use storage_subxt::subxt::utils::H256; /// A Merkle Mountain Range for storing bucket data. #[derive(Debug, Clone)] diff --git a/provider-node/src/negotiate.rs b/provider-node/src/negotiate.rs index 77c810d8..8d81825f 100644 --- a/provider-node/src/negotiate.rs +++ b/provider-node/src/negotiate.rs @@ -23,7 +23,7 @@ use crate::error::Error; use crate::storage::{NonceStore, NullNonceStore}; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use std::sync::Arc; -use storage_client::discovery::ProviderInfo; +use storage_subxt::api::runtime_types::pallet_storage_provider::pallet::ProviderInfo; // Wire types are shared with the SDK so client + server agree on serde shape. pub use storage_client::agreement::{AgreementTermsOf, NegotiateRequest, SignedTerms}; @@ -38,23 +38,25 @@ pub use storage_client::agreement::{AgreementTermsOf, NegotiateRequest, SignedTe /// bind the provider to it. pub fn validate_request(req: &NegotiateRequest, info: &ProviderInfo) -> Result<(), Error> { match &req.replica_params { - None if !info.accepting_primary => return Err(Error::NotAcceptingPrimary), - Some(_) if info.replica_sync_price.is_none() => return Err(Error::NotAcceptingReplicas), + None if !info.settings.accepting_primary => return Err(Error::NotAcceptingPrimary), + Some(_) if info.settings.replica_sync_price.is_none() => { + return Err(Error::NotAcceptingReplicas) + } _ => {} } - if req.price_per_byte < info.price_per_byte { + if req.price_per_byte < info.settings.price_per_byte { return Err(Error::PriceBelowListed { proposed: req.price_per_byte, - listed: info.price_per_byte, + listed: info.settings.price_per_byte, }); } - if req.duration < info.min_duration || req.duration > info.max_duration { + if req.duration < info.settings.min_duration || req.duration > info.settings.max_duration { return Err(Error::DurationOutOfBounds { duration: req.duration, - min: info.min_duration, - max: info.max_duration, + min: info.settings.min_duration, + max: info.settings.max_duration, }); } @@ -62,18 +64,18 @@ pub fn validate_request(req: &NegotiateRequest, info: &ProviderInfo) -> Result<( return Err(Error::CapacityExceeded { requested: req.max_bytes, committed: info.committed_bytes, - max_capacity: info.max_capacity, + max_capacity: info.settings.max_capacity, }); } // `max_capacity == 0` means unlimited. - if info.max_capacity > 0 - && info.committed_bytes.saturating_add(req.max_bytes) > info.max_capacity + if info.settings.max_capacity > 0 + && info.committed_bytes.saturating_add(req.max_bytes) > info.settings.max_capacity { return Err(Error::CapacityExceeded { requested: req.max_bytes, committed: info.committed_bytes, - max_capacity: info.max_capacity, + max_capacity: info.settings.max_capacity, }); } diff --git a/provider-node/src/replica_sync.rs b/provider-node/src/replica_sync.rs index 3de3bfdf..882431f7 100644 --- a/provider-node/src/replica_sync.rs +++ b/provider-node/src/replica_sync.rs @@ -11,9 +11,9 @@ use crate::error::Error; use crate::StorageBackend; use base64::Engine; use reqwest::Client; -use sp_core::H256; use std::sync::Arc; use storage_primitives::BucketId; +use storage_subxt::subxt::utils::H256; /// Replica synchronization manager. pub struct ReplicaSync { diff --git a/provider-node/src/replica_sync_coordinator.rs b/provider-node/src/replica_sync_coordinator.rs index fe4be14a..b241c1d9 100644 --- a/provider-node/src/replica_sync_coordinator.rs +++ b/provider-node/src/replica_sync_coordinator.rs @@ -11,12 +11,12 @@ use crate::replica_sync::ReplicaSync; use crate::{Error, ProviderState}; -use sp_core::H256; use std::collections::HashMap; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::time::Duration; -use storage_primitives::BucketId; +use storage_primitives::{BucketId, ReplicaSyncRecord}; +use storage_subxt::subxt::utils::H256; use tokio::sync::{mpsc, oneshot}; /// Configuration for the replica sync coordinator. @@ -60,8 +60,8 @@ pub struct SyncDuty { pub sync_price: u128, /// Minimum blocks between syncs. pub min_sync_interval: u64, - /// Last sync info (root, block) if any. - pub last_sync: Option<(H256, u64)>, + /// Last confirmed sync, if any. + pub last_sync: Option>, } /// Result of a replica sync operation. @@ -137,7 +137,7 @@ pub struct ReplicaAgreementInfo { pub sync_balance: u128, pub sync_price: u128, pub min_sync_interval: u64, - pub last_sync: Option<(H256, u64)>, + pub last_sync: Option>, } /// Bucket snapshot from chain. @@ -458,8 +458,8 @@ impl ReplicaSyncCoordinator { continue; } - if let Some((_, last_block)) = agreement.last_sync { - let elapsed = current_block.saturating_sub(last_block); + if let Some(record) = &agreement.last_sync { + let elapsed = current_block.saturating_sub(record.block); if elapsed < agreement.min_sync_interval { tracing::debug!( "Bucket {} sync interval not elapsed: {} < {}", diff --git a/provider-node/src/s3_api.rs b/provider-node/src/s3_api.rs index 9b955bd3..ed029167 100644 --- a/provider-node/src/s3_api.rs +++ b/provider-node/src/s3_api.rs @@ -22,10 +22,10 @@ use axum::{ Json, }; use serde::{Deserialize, Serialize}; -use sp_core::H256; use std::sync::Arc; use std::time::{SystemTime, UNIX_EPOCH}; use storage_primitives::{blake2_256, BucketId}; +use storage_subxt::subxt::utils::H256; /// Query parameter for object key. #[derive(Debug, Deserialize)] diff --git a/provider-node/src/s3_index.rs b/provider-node/src/s3_index.rs index d079d01c..9cfafdea 100644 --- a/provider-node/src/s3_index.rs +++ b/provider-node/src/s3_index.rs @@ -9,10 +9,10 @@ use codec::Encode; use dashmap::DashMap; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; -use sp_core::H256; use std::collections::BTreeMap; use std::path::{Path, PathBuf}; use storage_primitives::{blake2_256, hash_children, BucketId}; +use storage_subxt::subxt::utils::H256; /// Per-object metadata stored in the index. #[derive(Debug, Clone, Serialize, Deserialize)] diff --git a/provider-node/src/storage/disk.rs b/provider-node/src/storage/disk.rs index ca0bb707..13949985 100644 --- a/provider-node/src/storage/disk.rs +++ b/provider-node/src/storage/disk.rs @@ -11,10 +11,10 @@ use crate::error::Error; use crate::types::*; use codec::Encode; use rocksdb::{Options, DB}; -use sp_core::H256; use std::path::Path; use std::sync::{Arc, Mutex}; use storage_primitives::{blake2_256, BucketId, MmrLeaf}; +use storage_subxt::subxt::utils::H256; /// Column families for organizing data const CF_NODES: &str = "nodes"; diff --git a/provider-node/src/storage/in_memory.rs b/provider-node/src/storage/in_memory.rs index 19514429..6135adea 100644 --- a/provider-node/src/storage/in_memory.rs +++ b/provider-node/src/storage/in_memory.rs @@ -12,9 +12,9 @@ use crate::types::*; use codec::Encode; use dashmap::DashMap; use parking_lot::RwLock; -use sp_core::H256; use std::collections::HashMap; use storage_primitives::{blake2_256, BucketId, MmrLeaf}; +use storage_subxt::subxt::utils::H256; /// Bucket state managed by this provider. #[derive(Debug, Clone)] diff --git a/provider-node/src/storage/mod.rs b/provider-node/src/storage/mod.rs index 240c840a..c566a3d4 100644 --- a/provider-node/src/storage/mod.rs +++ b/provider-node/src/storage/mod.rs @@ -53,8 +53,8 @@ impl NonceStore for NullNonceStore { use crate::error::Error; use crate::types::*; -use sp_core::H256; use storage_primitives::{hash_children, BucketId}; +use storage_subxt::subxt::utils::H256; /// A stored node (chunk or internal node). #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] diff --git a/provider-node/src/subxt_client.rs b/provider-node/src/subxt_client.rs index b68f26ed..4ddac61e 100644 --- a/provider-node/src/subxt_client.rs +++ b/provider-node/src/subxt_client.rs @@ -10,23 +10,24 @@ //! one a clone of the same client (a cheap `OnlineClient`/`Keypair` clone that //! shares the underlying WebSocket connection). -use crate::challenge_responder::{ - decode_challenge_for_provider, ChallengeChainClient, DetectedChallenge, -}; +use crate::challenge_responder::{ChallengeChainClient, DetectedChallenge}; use crate::checkpoint_coordinator::{CheckpointChainClient, CheckpointDuty}; use crate::replica_sync_coordinator::{ BucketSnapshot, ReplicaAgreementInfo, ReplicaSyncChainClient, }; use crate::Error; use sp_core::crypto::Ss58Codec; -use sp_core::H256; -use storage_primitives::BucketId; -use subxt::dynamic::Value; -use subxt::ext::scale_value::value; +use std::str::FromStr; +use storage_client::substrate::{extrinsics, storage}; +use storage_primitives::{BucketId, Commitment, ReplicaSyncRecord}; +use storage_subxt::api::runtime_types as rt; +use storage_subxt::subxt; +use storage_subxt::subxt::utils::{AccountId32, H256}; +use storage_subxt::subxt_signer; /// Production implementation that talks to the chain via subxt. /// -/// Cloning is cheap: `OnlineClient` shares one connection behind an `Arc`, and +/// Cloning is cheap: `OnlineClient` shares one connection behind an `Arc`, andAdd a comment on line L29Add diff commentMarkdown input: edit mode selected.WritePreviewHeadingBoldItalicQuoteCodeLinkUnordered listNumbered listTask listMentionReferenceMore Formatting tools items 0Saved repliesAdd FilesPaste, drop, or click to add filesCancelCommentStart a review /// the `Keypair` clone is a key copy. This lets a single instance be shared /// across every background coordinator. #[derive(Clone)] @@ -131,90 +132,36 @@ impl SubxtChainClient { format!("/ip4/{host}/tcp/{port}") } - /// Extract the raw bytes of a decoded byte-sequence storage field - /// (e.g. a `Vec` / `BoundedVec`). - /// - /// subxt's dynamic decoder represents such a field either as a flat - /// sequence of byte primitives, or — for `BoundedVec` and similar newtype - /// wrappers — as a single-element composite whose inner value holds the - /// real sequence. We handle both, recursing through the wrapper layer. This - /// mirrors the decoder behind the typed `storage_client` read path, so the - /// shared connection here decodes a multiaddr exactly as that path would. - fn extract_byte_vec(val: &subxt::ext::scale_value::Value) -> Vec { - use subxt::ext::scale_value::{Composite, Primitive, ValueDef}; - match &val.value { - ValueDef::Composite(Composite::Unnamed(items)) => { - // Direct sequence of byte primitives. - let bytes: Vec = items - .iter() - .filter_map(|item| match &item.value { - ValueDef::Primitive(Primitive::U128(n)) => Some(*n as u8), - _ => None, - }) - .collect(); - if !items.is_empty() && bytes.len() == items.len() { - return bytes; - } - // BoundedVec wrapper: a single inner field holds the sequence. - if items.len() == 1 { - return Self::extract_byte_vec(&items[0]); - } - Vec::new() - } - // Some subxt versions encode a single byte as a bare primitive. - ValueDef::Primitive(Primitive::U128(n)) => vec![*n as u8], - _ => Vec::new(), - } - } - - /// Ensure the provider's on-chain multiaddr matches the address it - /// advertises. - /// - /// The advertised value is `public_multiaddr` when set (hosted deployments - /// behind a reverse proxy), otherwise one derived from `bind_addr` (local - /// dev). If the provider is registered and its recorded multiaddr differs, - /// submit an `update_provider_multiaddr` transaction. Reuses this client's - /// existing connection and signer rather than opening a new one. + /// Ensure the provider's on-chain multiaddr matches the address it advertises. pub async fn sync_multiaddr( &self, provider_id: &str, bind_addr: &str, public_multiaddr: Option<&str>, ) { - use subxt::dynamic::At; - let expected_multiaddr = match public_multiaddr { Some(addr) => addr.to_string(), None => Self::bind_addr_to_multiaddr(bind_addr), }; - // Read current on-chain provider info - let our_account: sp_core::crypto::AccountId32 = - match sp_core::crypto::Ss58Codec::from_ss58check(provider_id) { - Ok(a) => a, - Err(_) => { - tracing::warn!("Invalid provider SS58 address, skipping multiaddr sync"); - return; - } - }; - let our_bytes: [u8; 32] = our_account.into(); - - let storage_query = subxt::dynamic::storage( - "StorageProvider", - "Providers", - vec![Value::from_bytes(our_bytes)], - ); + let account = match Self::parse_account(provider_id) { + Ok(a) => a, + Err(_) => { + tracing::warn!("Invalid provider SS58 address, skipping multiaddr sync"); + return; + } + }; - let result = match self.api.storage().at_latest().await { - Ok(s) => s.fetch(&storage_query).await, + let storage_api = match self.api.storage().at_latest().await { + Ok(s) => s, Err(e) => { tracing::warn!("Failed to query storage for multiaddr sync: {}", e); return; } }; - let provider_value = match result { - Ok(Some(v)) => v, + let provider_info = match storage_api.fetch(&storage::provider_info(&account)).await { + Ok(Some(info)) => info, Ok(None) => { tracing::info!("Provider not registered on chain yet, skipping multiaddr sync"); return; @@ -225,38 +172,7 @@ impl SubxtChainClient { } }; - // Extract the current multiaddr from the encoded provider storage entry. - let current = { - let decoded = match provider_value.to_value() { - Ok(v) => v, - Err(e) => { - tracing::warn!("Could not decode provider value: {}, skipping sync", e); - return; - } - }; - - let multiaddr_val = match decoded.at("multiaddr") { - Some(v) => v, - None => { - tracing::warn!("No multiaddr field in provider info, skipping sync"); - return; - } - }; - - let bytes = Self::extract_byte_vec(multiaddr_val); - if bytes.is_empty() { - // Couldn't decode the stored multiaddr. Skip rather than treat - // it as a mismatch — otherwise we'd submit a needless - // update_provider_multiaddr transaction on every startup. - tracing::warn!( - "Could not decode on-chain multiaddr (value: {:?}); skipping sync", - multiaddr_val - ); - return; - } - String::from_utf8_lossy(&bytes).to_string() - }; - + let current = String::from_utf8_lossy(&provider_info.multiaddr.0).to_string(); if current == expected_multiaddr { tracing::info!( "On-chain multiaddr matches advertised address: {}", @@ -271,13 +187,7 @@ impl SubxtChainClient { expected_multiaddr ); - let multiaddr_bytes = expected_multiaddr.as_bytes().to_vec(); - let tx = subxt::dynamic::tx( - "StorageProvider", - "update_provider_multiaddr", - vec![Value::from_bytes(multiaddr_bytes)], - ); - + let tx = extrinsics::update_provider_multiaddr(expected_multiaddr.as_bytes().to_vec()); match self .api .tx() @@ -296,126 +206,39 @@ impl SubxtChainClient { } } - /// Decode a storage agreement from raw SCALE-encoded bytes. - fn decode_storage_agreement_bytes( + /// Extract `ReplicaAgreementInfo` from a typed `StorageAgreement` if it is a Replica. + fn to_replica_info( bucket_id: BucketId, - bytes: &[u8], - ) -> Result { - // StorageAgreement layout: - // - owner: AccountId (32 bytes) - // - max_bytes: u64 (8 bytes) - // - payment_locked: Balance (16 bytes) - // - price_per_byte: Balance (16 bytes) - // - expires_at: BlockNumber (4 bytes) - // - extensions_blocked: bool (1 byte) - // - role: ProviderRole (variable, enum) - // - started_at: BlockNumber (4 bytes) - - let min_size = 32 + 8 + 16 + 16 + 4 + 1; // up to role enum - if bytes.len() < min_size { - return Err(Error::Internal("Agreement data too short".to_string())); - } - - let role_start = 32 + 8 + 16 + 16 + 4 + 1; // Skip to role enum - let role_variant = bytes.get(role_start).copied().unwrap_or(0); - - // Role enum: 0 = Primary, 1 = Replica - if role_variant != 1 { - return Err(Error::Internal("Not a replica agreement".to_string())); - } - - // Parse Replica fields: sync_balance, sync_price, min_sync_interval, last_sync - let replica_start = role_start + 1; - let remaining = &bytes[replica_start..]; - - if remaining.len() < 16 + 16 + 4 { - return Err(Error::Internal("Replica data too short".to_string())); + agreement: &rt::pallet_storage_provider::pallet::StorageAgreement, + ) -> Option { + match &agreement.role { + rt::storage_primitives::ProviderRole::Replica { + sync_balance, + sync_price, + min_sync_interval, + last_sync, + } => Some(ReplicaAgreementInfo { + bucket_id, + sync_balance: *sync_balance, + sync_price: *sync_price, + min_sync_interval: *min_sync_interval as u64, + last_sync: last_sync.as_ref().map(|r| ReplicaSyncRecord { + commitment: storage_primitives::Commitment { + mmr_root: r.commitment.mmr_root, + start_seq: r.commitment.start_seq, + leaf_count: r.commitment.leaf_count, + }, + block: r.block as u64, + }), + }), + rt::storage_primitives::ProviderRole::Primary => None, } - - let sync_balance = u128::from_le_bytes( - remaining[0..16] - .try_into() - .map_err(|_| Error::Internal("Failed to parse sync_balance".to_string()))?, - ); - - let sync_price = u128::from_le_bytes( - remaining[16..32] - .try_into() - .map_err(|_| Error::Internal("Failed to parse sync_price".to_string()))?, - ); - - let min_sync_interval = u32::from_le_bytes( - remaining[32..36] - .try_into() - .map_err(|_| Error::Internal("Failed to parse min_sync_interval".to_string()))?, - ) as u64; - - let last_sync_option = remaining.get(36).copied().unwrap_or(0); - let last_sync = if last_sync_option == 1 && remaining.len() >= 36 + 1 + 32 + 4 { - let root_bytes: [u8; 32] = remaining[37..69] - .try_into() - .map_err(|_| Error::Internal("Failed to parse last_sync root".to_string()))?; - let block = u32::from_le_bytes( - remaining[69..73] - .try_into() - .map_err(|_| Error::Internal("Failed to parse last_sync block".to_string()))?, - ) as u64; - Some((H256::from(root_bytes), block)) - } else { - None - }; - - Ok(ReplicaAgreementInfo { - bucket_id, - sync_balance, - sync_price, - min_sync_interval, - last_sync, - }) } - /// Parse a BucketSnapshot value from scale_value. - fn parse_bucket_snapshot_value(value: &subxt::ext::scale_value::Value) -> BucketSnapshot { - use subxt::ext::scale_value::{At, Composite, Primitive, ValueDef}; - - let mmr_root = if let Some(field0) = value.at(0) { - if let ValueDef::Composite(Composite::Unnamed(bytes_vec)) = &field0.value { - let bytes: Vec = bytes_vec - .iter() - .filter_map(|v| { - if let ValueDef::Primitive(Primitive::U128(n)) = &v.value { - Some(*n as u8) - } else { - None - } - }) - .collect(); - if bytes.len() == 32 { - H256::from_slice(&bytes) - } else { - H256::zero() - } - } else { - H256::zero() - } - } else { - H256::zero() - }; - - let leaf_count = if let Some(field2) = value.at(2) { - if let ValueDef::Primitive(Primitive::U128(n)) = &field2.value { - *n as u64 - } else { - 0 - } - } else { - 0 - }; - - BucketSnapshot { - mmr_root, - leaf_count, - } + /// Parse an SS58 account ID string into AccountId32. + pub fn parse_account(account: &str) -> Result { + AccountId32::from_str(account) + .map_err(|e| Error::Internal(format!("Invalid SS58 account '{account}': {e}"))) } } @@ -429,39 +252,19 @@ impl CheckpointChainClient for SubxtChainClient { &self, bucket_id: BucketId, ) -> Result, Error> { - use subxt::dynamic::At; - - let config_query = subxt::dynamic::storage( - "StorageProvider", - "CheckpointConfigs", - vec![Value::u128(bucket_id as u128)], - ); - let storage = self + let storage_api = self .api .storage() .at_latest() .await .map_err(|e| Error::Internal(format!("Failed to get storage: {e}")))?; - match storage - .fetch(&config_query) + match storage_api + .fetch(&storage::checkpoint_config(bucket_id)) .await .map_err(|e| Error::Internal(format!("Failed to fetch config: {e}")))? { - Some(val) => { - let decoded = val - .to_value() - .map_err(|e| Error::Internal(format!("Failed to decode config: {e}")))?; - let interval = decoded - .at("interval") - .and_then(|v| v.as_u128()) - .unwrap_or(100) as u32; - let grace_period = decoded - .at("grace_period") - .and_then(|v| v.as_u128()) - .unwrap_or(20) as u32; - Ok(Some((interval, grace_period))) - } + Some(config) => Ok(Some((config.interval, config.grace_period))), None => Ok(None), } } @@ -471,44 +274,20 @@ impl CheckpointChainClient for SubxtChainClient { duty: &CheckpointDuty, signatures: Vec<(String, String)>, ) -> Result { - let bucket_id = duty.bucket_id; - let mmr_root = duty.mmr_root; - let start_seq = duty.start_seq; - let leaf_count = duty.leaf_count; - let window = duty.window; - - // Build signature tuples for the extrinsic - let mut sig_values = Vec::with_capacity(signatures.len()); + let mut sig_vec = Vec::with_capacity(signatures.len()); for (account, sig) in &signatures { - let account_id: sp_core::crypto::AccountId32 = - sp_core::crypto::Ss58Codec::from_ss58check(account).map_err(|e| { - Error::Internal(format!("Invalid SS58 account '{account}': {e:?}")) - })?; - let account_bytes: [u8; 32] = account_id.into(); - + let account_id = Self::parse_account(account)?; let sig_bytes = hex::decode(sig.trim_start_matches("0x")) .map_err(|e| Error::Internal(format!("Invalid signature hex: {e}")))?; - - sig_values.push(value!(( - Value::from_bytes(account_bytes), - Sr25519(Value::from_bytes(sig_bytes)) - ))); + sig_vec.push((account_id, sig_bytes)); } - let tx = subxt::dynamic::tx( - "StorageProvider", - "provider_checkpoint", - vec![ - Value::u128(bucket_id as u128), - Value::named_composite(vec![ - ("mmr_root", Value::from_bytes(mmr_root.as_bytes())), - ("start_seq", Value::u128(start_seq as u128)), - ("leaf_count", Value::u128(leaf_count as u128)), - ]), - Value::u128(window as u128), - Value::unnamed_composite(sig_values), - ], - ); + let commitment = Commitment { + mmr_root: duty.mmr_root, + start_seq: duty.start_seq, + leaf_count: duty.leaf_count, + }; + let tx = extrinsics::provider_checkpoint(duty.bucket_id, commitment, duty.window, sig_vec); let tx_progress = self .api @@ -517,7 +296,7 @@ impl CheckpointChainClient for SubxtChainClient { .await .map_err(|e| Error::Internal(format!("Failed to submit tx: {e}")))?; - let _events = tx_progress + tx_progress .wait_for_finalized_success() .await .map_err(|e| Error::Internal(format!("Transaction failed: {e}")))?; @@ -537,130 +316,99 @@ impl ReplicaSyncChainClient for SubxtChainClient { provider_account: &str, local_buckets: Vec, ) -> Result, Error> { - let provider_account = provider_account.to_string(); - { - let mut agreements = Vec::new(); - - let account_bytes = hex::decode(provider_account.trim_start_matches("0x")) - .map_err(|e| Error::Internal(format!("Invalid account hex: {e}")))?; - - // Query local buckets for agreements - for bucket_id in &local_buckets { - let storage_address = subxt::dynamic::storage( - "StorageProvider", - "StorageAgreements", - vec![ - Value::u128(*bucket_id as u128), - Value::from_bytes(&account_bytes), - ], - ); - - let storage = self - .api - .storage() - .at_latest() - .await - .map_err(|e| Error::Internal(format!("Failed to get storage: {e}")))?; - - if let Ok(Some(value)) = storage.fetch(&storage_address).await { - let encoded = value.encoded(); - if let Ok(agreement) = Self::decode_storage_agreement_bytes(*bucket_id, encoded) - { - agreements.push(agreement); - } + let account = Self::parse_account(provider_account)?; + + let mut agreements = Vec::new(); + + let storage_api = self + .api + .storage() + .at_latest() + .await + .map_err(|e| Error::Internal(format!("Failed to get storage: {e}")))?; + + // Fast path: direct queries for locally-known buckets + for bucket_id in &local_buckets { + if let Ok(Some(agreement)) = storage_api + .fetch(&storage::agreement_info(*bucket_id, &account)) + .await + { + if let Some(info) = Self::to_replica_info(*bucket_id, &agreement) { + agreements.push(info); } } + } - // Also iterate chain storage for agreements we might not have locally - let storage_address = - subxt::dynamic::storage("StorageProvider", "StorageAgreements", ()); - - if let Ok(storage) = self.api.storage().at_latest().await { - if let Ok(mut iter) = storage.iter(storage_address).await { - while let Some(result) = iter.next().await { - let kv = match result { - Ok(kv) => kv, - Err(e) => { - tracing::debug!("Error iterating storage: {e}"); - continue; - } - }; - - let key_bytes = kv.key_bytes; - if key_bytes.len() < 32 + 16 + 8 + 16 + 32 { - continue; - } - - let bucket_id_start = 32 + 16; - let bucket_id_bytes = &key_bytes[bucket_id_start..bucket_id_start + 8]; - let bucket_id = - u64::from_le_bytes(bucket_id_bytes.try_into().unwrap_or([0; 8])); - - let provider_start = bucket_id_start + 8 + 16; - let provider_bytes = &key_bytes[provider_start..]; - - if provider_bytes.len() < 32 || provider_bytes[..32] != account_bytes[..32] - { - continue; - } - - let encoded = kv.value.encoded(); - if let Ok(agreement) = - Self::decode_storage_agreement_bytes(bucket_id, encoded) - { - if !agreements - .iter() - .any(|a| a.bucket_id == agreement.bucket_id) - { - agreements.push(agreement); - } - } + // Chain-wide scan via runtime API to discover agreements for buckets we don't have locally + match self + .api + .runtime_api() + .at_latest() + .await + .map_err(|e| Error::Internal(format!("runtime api: {e}")))? + .call( + storage_subxt::api::apis() + .storage_provider_api() + .provider_agreements(account), + ) + .await + { + Ok(all) => { + for a in all { + if agreements.iter().any(|x| x.bucket_id == a.bucket_id) { + continue; + } + if let rt::storage_primitives::ProviderRole::Replica { + sync_balance, + sync_price, + min_sync_interval, + last_sync, + } = a.role + { + agreements.push(ReplicaAgreementInfo { + bucket_id: a.bucket_id, + sync_balance, + sync_price, + min_sync_interval: min_sync_interval as u64, + last_sync: last_sync.map(|r| ReplicaSyncRecord { + commitment: storage_primitives::Commitment { + mmr_root: r.commitment.mmr_root, + start_seq: r.commitment.start_seq, + leaf_count: r.commitment.leaf_count, + }, + block: r.block as u64, + }), + }); } } } - - Ok(agreements) + Err(e) => { + tracing::debug!("provider_agreements runtime API error: {e}"); + } } + + Ok(agreements) } async fn fetch_bucket_snapshot(&self, bucket_id: BucketId) -> Result { - use subxt::ext::scale_value::ValueDef; - - let storage_address = subxt::dynamic::storage( - "StorageProvider", - "Buckets", - vec![Value::u128(bucket_id as u128)], - ); - - let storage = self + let storage_api = self .api .storage() .at_latest() .await .map_err(|e| Error::Internal(format!("Failed to get storage: {e}")))?; - match storage.fetch(&storage_address).await { - Ok(Some(value)) => { - use subxt::ext::scale_value::At; - let decoded = value - .to_value() - .map_err(|e| Error::Internal(format!("Failed to decode bucket: {e}")))?; - - if let Some(snapshot_opt) = decoded.at(4) { - if let ValueDef::Variant(variant) = &snapshot_opt.value { - if variant.name == "Some" { - if let Some(snapshot_val) = variant.values.values().next() { - return Ok(Self::parse_bucket_snapshot_value(snapshot_val)); - } - } - } - } - - Ok(BucketSnapshot { + match storage_api.fetch(&storage::bucket_info(bucket_id)).await { + Ok(Some(bucket)) => match bucket.snapshot { + Some(snap) => Ok(BucketSnapshot { + mmr_root: snap.commitment.mmr_root, + leaf_count: snap.commitment.leaf_count, + }), + None => Ok(BucketSnapshot { mmr_root: H256::zero(), leaf_count: 0, - }) - } + }), + }, _ => Ok(BucketSnapshot { mmr_root: H256::zero(), leaf_count: 0, @@ -669,83 +417,24 @@ impl ReplicaSyncChainClient for SubxtChainClient { } async fn fetch_primary_endpoints(&self, bucket_id: BucketId) -> Result, Error> { - use subxt::ext::scale_value::{At, Composite, Primitive, ValueDef}; - - let storage_address = subxt::dynamic::storage( - "StorageProvider", - "Buckets", - vec![Value::u128(bucket_id as u128)], - ); - - let storage = self + let storage_api = self .api .storage() .at_latest() .await .map_err(|e| Error::Internal(format!("Failed to get storage: {e}")))?; - let bucket_value = match storage.fetch(&storage_address).await { - Ok(Some(v)) => v, + let bucket = match storage_api.fetch(&storage::bucket_info(bucket_id)).await { + Ok(Some(b)) => b, _ => return Ok(vec![]), }; - let decoded = bucket_value - .to_value() - .map_err(|e| Error::Internal(format!("Failed to decode bucket: {e}")))?; - - let mut provider_bytes_list = Vec::new(); - - // primary_providers is at index 3 - if let Some(field3) = decoded.at(3) { - if let ValueDef::Composite(Composite::Unnamed(providers_vec)) = &field3.value { - for provider_value in providers_vec { - if let ValueDef::Composite(Composite::Unnamed(account_bytes)) = - &provider_value.value - { - let bytes: Vec = account_bytes - .iter() - .filter_map(|v| { - if let ValueDef::Primitive(Primitive::U128(n)) = &v.value { - Some(*n as u8) - } else { - None - } - }) - .collect(); - if bytes.len() == 32 { - provider_bytes_list.push(bytes); - } - } - } - } - } - - // Look up each provider's multiaddr let mut endpoints = Vec::new(); - for provider_bytes in provider_bytes_list { - let provider_addr = subxt::dynamic::storage( - "StorageProvider", - "Providers", - vec![Value::from_bytes(&provider_bytes)], - ); - - let storage = self - .api - .storage() - .at_latest() - .await - .map_err(|e| Error::Internal(format!("Failed to get storage: {e}")))?; - - if let Ok(Some(value)) = storage.fetch(&provider_addr).await { - if let Ok(decoded) = value.to_value() { - if let Some(field0) = decoded.at(0) { - let bytes = Self::extract_byte_vec(field0); - if !bytes.is_empty() { - let multiaddr_str = String::from_utf8_lossy(&bytes); - endpoints.push(Self::multiaddr_to_http_endpoint(&multiaddr_str)); - } - } - } + for rt_account in bucket.primary_providers.0 { + let account = AccountId32::from(rt_account.0); + if let Ok(Some(info)) = storage_api.fetch(&storage::provider_info(&account)).await { + let multiaddr_str = String::from_utf8_lossy(&info.multiaddr.0); + endpoints.push(Self::multiaddr_to_http_endpoint(&multiaddr_str)); } } @@ -757,28 +446,10 @@ impl ReplicaSyncChainClient for SubxtChainClient { bucket_id: BucketId, target_mmr_root: H256, ) -> Result<(u8, u128), Error> { - // Build roots array: position 0 = current root, rest = None - let roots_value: Vec = (0..7) - .map(|i| { - if i == 0 { - value!(Some(Value::from_bytes(target_mmr_root.as_bytes()))) - } else { - value!(None()) - } - }) - .collect(); - - let signature = value!(Sr25519(Value::from_bytes([0u8; 64]))); - - let tx = subxt::dynamic::tx( - "StorageProvider", - "confirm_replica_sync", - vec![ - Value::u128(bucket_id as u128), - Value::unnamed_composite(roots_value), - signature, - ], - ); + let mut roots = [None; 7]; + roots[0] = Some(target_mmr_root); + + let tx = extrinsics::confirm_replica_sync(bucket_id, roots, vec![0u8; 64]); tracing::info!( "Submitting confirm_replica_sync for bucket {} with root 0x{}", @@ -793,7 +464,7 @@ impl ReplicaSyncChainClient for SubxtChainClient { .await .map_err(|e| Error::Internal(format!("Failed to submit tx: {e}")))?; - let _events = tx_progress + tx_progress .wait_for_finalized_success() .await .map_err(|e| Error::Internal(format!("Transaction failed: {e}")))?; @@ -803,7 +474,7 @@ impl ReplicaSyncChainClient for SubxtChainClient { bucket_id ); - Ok((0, 0)) // Position 0, payment extracted from events in production + Ok((0, 0)) } } @@ -811,76 +482,48 @@ impl ReplicaSyncChainClient for SubxtChainClient { impl ChallengeChainClient for SubxtChainClient { /// Poll for active challenges against this provider. /// - /// Iterates the on-chain `StorageProvider::Challenges` map. It is a - /// `StorageDoubleMap`, so each - /// key holds exactly one challenge. We scan all entries, decode each - /// single `Challenge` from raw SCALE, and keep only the ones whose - /// `provider` matches our account. - /// - /// Cost is bounded by `ChallengeTimeout` (storage entries past their - /// deadline are reaped in `on_finalize`), so iteration is at worst the - /// number of open challenges across all unexpired deadlines. + /// Delegates to the `StorageProviderApi::provider_challenges` runtime API, + /// which already scans and filters `StorageProvider::Challenges` on the + /// node side and returns only the challenges targeting the given account. async fn poll_challenges(&self) -> Result, Error> { - // Our account's raw bytes, used to filter challenges targeting us. - let our_bytes: [u8; 32] = self.signer.public_key().0; + let our_account: AccountId32 = self.signer.public_key().0.into(); - let storage_address = subxt::dynamic::storage("StorageProvider", "Challenges", ()); - let storage = self + let challenges = self .api - .storage() + .runtime_api() .at_latest() .await - .map_err(|e| Error::Internal(format!("Failed to get storage: {e}")))?; - - let mut iter = storage - .iter(storage_address) + .map_err(|e| Error::Internal(format!("runtime api: {e}")))? + .call( + storage_subxt::api::apis() + .storage_provider_api() + .provider_challenges(our_account), + ) .await - .map_err(|e| Error::Internal(format!("Failed to iterate Challenges: {e}")))?; - - let mut detected = Vec::new(); - while let Some(result) = iter.next().await { - let kv = match result { - Ok(kv) => kv, - Err(e) => { - tracing::debug!("Error iterating Challenges: {e}"); - continue; - } - }; - - // DoubleMap key layout: - // 16 (pallet hash) + 16 (storage hash) - // + 16 (blake2_128 of deadline) + 4 (BlockNumber u32 LE) - // + 8 (twox64 of index) + 2 (u16 index LE) - // = 62 bytes total. - let key_bytes = &kv.key_bytes; - if key_bytes.len() < 62 { - continue; - } - let deadline = u32::from_le_bytes(key_bytes[48..52].try_into().unwrap_or([0; 4])); - let index = u16::from_le_bytes(key_bytes[60..62].try_into().unwrap_or([0; 2])); - - let encoded = kv.value.encoded(); - let challenge = match decode_challenge_for_provider(encoded, &our_bytes) { - Ok(Some(c)) => c, - Ok(None) => continue, - Err(e) => { - tracing::warn!("Failed to decode challenge at {deadline}/{index}: {e}"); - continue; + .map_err(|e| Error::Internal(format!("Failed to fetch provider_challenges: {e}")))?; + + tracing::debug!( + "Detected {} challenges for current provider", + challenges.len() + ); + + Ok(challenges + .into_iter() + .map(|c| { + let mut challenger = [0u8; 32]; + challenger.copy_from_slice(&c.challenger); + DetectedChallenge { + bucket_id: c.bucket_id, + deadline: c.deadline, + index: c.index, + mmr_root: c.mmr_root, + start_seq: c.start_seq, + leaf_index: c.leaf_index, + chunk_index: c.chunk_index, + challenger: sp_core::crypto::AccountId32::from(challenger).to_ss58check(), } - }; - - detected.push(DetectedChallenge { - bucket_id: challenge.bucket_id, - deadline, - index, - mmr_root: challenge.mmr_root, - start_seq: challenge.start_seq, - leaf_index: challenge.leaf_index, - chunk_index: challenge.chunk_index, - challenger: sp_core::crypto::AccountId32::from(challenge.challenger).to_ss58check(), - }); - } - Ok(detected) + }) + .collect()) } async fn submit_response( @@ -890,79 +533,11 @@ impl ChallengeChainClient for SubxtChainClient { mmr_proof: storage_primitives::MmrProof, chunk_proof: storage_primitives::MerkleProof, ) -> Result { - let challenge_id_val = value!({ - deadline: challenge_id.0 as u128, - index: challenge_id.1 as u128 - }); - - // Dynamic arrays built from iterators, then embedded in the macro - let peaks = Value::unnamed_composite( - mmr_proof - .peaks - .iter() - .map(|p| Value::from_bytes(p.as_bytes())) - .collect::>(), - ); - let mmr_siblings = Value::unnamed_composite( - mmr_proof - .leaf_proof - .siblings - .iter() - .map(|s| Value::from_bytes(s.as_bytes())) - .collect::>(), - ); - let mmr_path = Value::unnamed_composite( - mmr_proof - .leaf_proof - .path - .iter() - .map(|b| Value::bool(*b)) - .collect::>(), - ); - - let mmr_proof_val = value!({ - peaks: peaks, - leaf: { - data_root: Value::from_bytes(mmr_proof.leaf.data_root.as_bytes()), - data_size: mmr_proof.leaf.data_size as u128, - total_size: mmr_proof.leaf.total_size as u128 - }, - leaf_proof: { - siblings: mmr_siblings, - path: mmr_path - } - }); - - let chunk_siblings = Value::unnamed_composite( - chunk_proof - .siblings - .iter() - .map(|s| Value::from_bytes(s.as_bytes())) - .collect::>(), - ); - let chunk_path = Value::unnamed_composite( - chunk_proof - .path - .iter() - .map(|b| Value::bool(*b)) - .collect::>(), - ); - - let chunk_proof_val = value!({ - siblings: chunk_siblings, - path: chunk_path - }); - - let response_val = value!(Proof { - chunk_data: Value::from_bytes(&chunk_data), - mmr_proof: mmr_proof_val, - chunk_proof: chunk_proof_val - }); - - let tx = subxt::dynamic::tx( - "StorageProvider", - "respond_to_challenge", - vec![challenge_id_val, response_val], + let tx = extrinsics::respond_to_challenge_proof( + challenge_id, + &chunk_data, + &mmr_proof, + &chunk_proof, ); let tx_progress = self @@ -972,7 +547,7 @@ impl ChallengeChainClient for SubxtChainClient { .await .map_err(|e| Error::Internal(format!("Failed to submit tx: {e}")))?; - let _events = tx_progress + tx_progress .wait_for_finalized_success() .await .map_err(|e| Error::Internal(format!("Transaction failed: {e}")))?; diff --git a/provider-node/src/types.rs b/provider-node/src/types.rs index 8a307158..06bedb53 100644 --- a/provider-node/src/types.rs +++ b/provider-node/src/types.rs @@ -3,8 +3,8 @@ //! API types for the provider node. use serde::{Deserialize, Serialize}; -use storage_client::discovery::ProviderInfo; use storage_primitives::BucketId; +use storage_subxt::storage_paseo_runtime::api::runtime_types::pallet_storage_provider::pallet::ProviderInfo; // ───────────────────────────────────────────────────────────────────────────── // Node Upload/Download Types diff --git a/provider-node/tests/api_integration.rs b/provider-node/tests/api_integration.rs index 9073adba..03dbf0b2 100644 --- a/provider-node/tests/api_integration.rs +++ b/provider-node/tests/api_integration.rs @@ -10,11 +10,12 @@ use codec::Encode; use reqwest::Client; use serde_json::{json, Value}; use sp_core::crypto::Ss58Codec; -use sp_core::{sr25519, ByteArray, Pair, H256}; +use sp_core::{sr25519, ByteArray, Pair}; use std::net::SocketAddr; use std::sync::Arc; use storage_primitives::{Commitment, CommitmentPayload}; use storage_provider_node::{create_router, ProviderState, Storage}; +use storage_subxt::subxt::utils::H256; use tokio::net::TcpListener; /// Test server helper that starts the provider node on a random port. diff --git a/provider-node/tests/auth_integration.rs b/provider-node/tests/auth_integration.rs index 2a632da8..12d65d55 100644 --- a/provider-node/tests/auth_integration.rs +++ b/provider-node/tests/auth_integration.rs @@ -20,7 +20,7 @@ use storage_provider_node::auth::{MembershipCache, MembershipResolver}; use storage_provider_node::{create_router, ProviderState, Storage}; use tokio::net::TcpListener; -type AccountId32 = sp_core::crypto::AccountId32; +use storage_subxt::subxt::utils::AccountId32; // ───────────────────────────────────────────────────────────────────────────── // Mock resolver (returns configurable roles, no chain needed) @@ -85,7 +85,7 @@ impl AuthTestServer { /// Start a server with auth enabled and Alice as the given role. async fn with_role(alice_role: Role) -> Self { let alice_kp = sr25519::Pair::from_string("//Alice", None).unwrap(); - let alice_account = AccountId32::new(alice_kp.public().0); + let alice_account = AccountId32(alice_kp.public().0); let resolver = MockResolver::new(vec![(alice_account, alice_role)]); let cache = Arc::new(MembershipCache::new( diff --git a/provider-node/tests/chain_state_integration.rs b/provider-node/tests/chain_state_integration.rs index 7478e3b4..673e2084 100644 --- a/provider-node/tests/chain_state_integration.rs +++ b/provider-node/tests/chain_state_integration.rs @@ -22,19 +22,21 @@ //! shut down cleanly when stopped. use async_trait::async_trait; -use sp_core::H256; -use sp_runtime::AccountId32; use std::sync::atomic::Ordering; use std::sync::Arc; use std::time::Duration; -use storage_client::discovery::ProviderInfo; -use storage_client::{ClientError, ProviderSettings, StorageEvent}; +use storage_client::{ClientError, StorageEvent}; use storage_primitives::Commitment; use storage_provider_node::{ is_relevant_provider_event, refresh_if_relevant_event, refresh_provider_state, sync_constants, ChainState, ChainStateChainClient, ChainStateCoordinator, NonceCounter, NonceStore, PalletConstants, }; +use storage_subxt::api::runtime_types::pallet_storage_provider::pallet::{ + ProviderInfo, ProviderSettings, +}; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; /// A WS URL that refuses immediately: port 1 on loopback is never listening, so /// every connect attempt fails fast and the coordinator loops on the error arm. @@ -42,24 +44,39 @@ const UNREACHABLE_CHAIN: &str = "ws://127.0.0.1:1"; /// `[1u8; 32]` provider account — the coordinator only uses it to identify /// relevant events, which never fire here since the chain is unreachable. -fn provider_account() -> sp_runtime::AccountId32 { - sp_runtime::AccountId32::new([1u8; 32]) +fn provider_account() -> AccountId32 { + AccountId32([1u8; 32]) } fn sample_provider_info() -> ProviderInfo { + use storage_subxt::api::runtime_types::{ + bounded_collections::bounded_vec::BoundedVec, + pallet_storage_provider::pallet::{ProviderSettings, ProviderStats}, + }; ProviderInfo { - multiaddr: "/ip4/1.2.3.4/tcp/3333".to_string(), + multiaddr: BoundedVec(b"/ip4/1.2.3.4/tcp/3333".to_vec()), + public_key: BoundedVec(vec![]), stake: 1_000, committed_bytes: 500, - max_capacity: 10_000, - min_duration: 10, - max_duration: 100, - price_per_byte: 5, - accepting_primary: true, - replica_sync_price: None, - accepting_extensions: true, - agreements_total: 3, - challenges_failed: 1, + settings: ProviderSettings { + min_duration: 10, + max_duration: 100, + price_per_byte: 5, + accepting_primary: true, + replica_sync_price: None, + accepting_extensions: true, + max_capacity: 10_000, + }, + stats: ProviderStats { + registered_at: 0, + agreements_total: 3, + agreements_extended: 0, + agreements_not_extended: 0, + agreements_burned: 0, + total_bytes_committed: 0, + challenges_received: 0, + challenges_failed: 1, + }, deregister_at: None, } } @@ -219,7 +236,7 @@ impl ChainStateChainClient for MockChainClient { } fn provider_account_2() -> AccountId32 { - AccountId32::new([2u8; 32]) + AccountId32([2u8; 32]) } // ── sync_constants ──────────────────────────────────────────────────────────── diff --git a/provider-node/tests/coordinators/challenge.rs b/provider-node/tests/coordinators/challenge.rs index 67321cf5..0fb55b48 100644 --- a/provider-node/tests/coordinators/challenge.rs +++ b/provider-node/tests/coordinators/challenge.rs @@ -3,7 +3,6 @@ //! Integration tests for the challenge responder. use super::{test_state, wait_for, ALICE_SS58}; -use sp_core::H256; use std::sync::{Arc, Mutex}; use std::time::Duration; use storage_primitives::{blake2_256, BucketId}; @@ -11,6 +10,7 @@ use storage_provider_node::{ build_padded_merkle_tree, ChallengeChainClient, ChallengeResponder, ChallengeResponderConfig, ChallengeResponseResult, DetectedChallenge, Error, ProviderState, Storage, }; +use storage_subxt::subxt::utils::H256; struct MockChallengeChainClient { challenges: Mutex>, diff --git a/provider-node/tests/coordinators/checkpoint.rs b/provider-node/tests/coordinators/checkpoint.rs index 8eaae975..05ae4293 100644 --- a/provider-node/tests/coordinators/checkpoint.rs +++ b/provider-node/tests/coordinators/checkpoint.rs @@ -3,7 +3,6 @@ //! Integration tests for the checkpoint coordinator. use super::{test_state_with_seed, wait_for}; -use sp_core::H256; use std::sync::{Arc, Mutex}; use std::time::Duration; use storage_primitives::BucketId; @@ -12,6 +11,7 @@ use storage_provider_node::{ CheckpointChainClient, CheckpointCoordinator, CheckpointCoordinatorConfig, CheckpointDuty, CheckpointResult, Error, ProviderState, Storage, }; +use storage_subxt::subxt::utils::H256; struct MockCheckpointChainClient { block_number: Mutex, diff --git a/provider-node/tests/coordinators/replica_sync.rs b/provider-node/tests/coordinators/replica_sync.rs index 141896fe..55855763 100644 --- a/provider-node/tests/coordinators/replica_sync.rs +++ b/provider-node/tests/coordinators/replica_sync.rs @@ -3,16 +3,16 @@ //! Integration tests for the replica sync coordinator. use super::{test_state, ALICE_SS58}; -use sp_core::H256; use std::collections::HashMap; use std::sync::{Arc, Mutex}; use std::time::Duration; -use storage_primitives::BucketId; +use storage_primitives::{BucketId, Commitment, ReplicaSyncRecord}; use storage_provider_node::replica_sync_coordinator::{BucketSnapshot, ReplicaAgreementInfo}; use storage_provider_node::{ Error, ProviderState, ReplicaSyncChainClient, ReplicaSyncCoordinator, ReplicaSyncCoordinatorConfig, Storage, SyncDuty, SyncResult, }; +use storage_subxt::subxt::utils::H256; struct MockReplicaSyncChainClient { block: Mutex, @@ -301,7 +301,14 @@ async fn test_duties_filter_sync_interval_not_elapsed() { sync_balance: 1000, sync_price: 100, min_sync_interval: 200, - last_sync: Some((H256::repeat_byte(0xBB), 50)), + last_sync: Some(ReplicaSyncRecord { + commitment: Commitment { + mmr_root: H256::repeat_byte(0xBB), + start_seq: 0, + leaf_count: 5, + }, + block: 50, + }), }; let mock = MockReplicaSyncChainClient::new() diff --git a/provider-node/tests/negotiate_integration.rs b/provider-node/tests/negotiate_integration.rs index 8ff0fbfc..4a475898 100644 --- a/provider-node/tests/negotiate_integration.rs +++ b/provider-node/tests/negotiate_integration.rs @@ -11,16 +11,18 @@ use axum::http::StatusCode; use reqwest::Client; use serde_json::Value; -use sp_core::{sr25519, Pair}; -use sp_runtime::{AccountId32, MultiSignature}; use std::net::SocketAddr; +use std::str::FromStr; use std::sync::Arc; -use storage_client::discovery::ProviderInfo; use storage_primitives::ReplicaTerms; use storage_provider_node::{ create_router, DiskStorage, NegotiateRequest, NonceCounter, NonceStore, NullNonceStore, PalletConstants, ProviderState, SignedTerms, Storage, }; +use storage_subxt::api::runtime_types::pallet_storage_provider::pallet::ProviderInfo; +use storage_subxt::api::runtime_types::sp_runtime::MultiSignature; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt_signer; use tokio::net::TcpListener; const PROVIDER_SEED: &str = "//Alice"; @@ -103,26 +105,41 @@ impl TestServer { /// primary agreements, listed price 5, duration window [10, 100_000], /// unlimited capacity. fn provider_info() -> ProviderInfo { + use storage_subxt::api::runtime_types::{ + bounded_collections::bounded_vec::BoundedVec, + pallet_storage_provider::pallet::{ProviderSettings, ProviderStats}, + }; ProviderInfo { - multiaddr: "/ip4/127.0.0.1/tcp/3333".to_string(), + multiaddr: BoundedVec(b"/ip4/127.0.0.1/tcp/3333".to_vec()), + public_key: BoundedVec(vec![]), stake: 1_000_000_000_000, committed_bytes: 0, - max_capacity: 0, - min_duration: 10, - max_duration: 100_000, - price_per_byte: 5, - accepting_primary: true, - replica_sync_price: None, - accepting_extensions: true, - agreements_total: 0, - challenges_failed: 0, + settings: ProviderSettings { + min_duration: 10, + max_duration: 100_000, + price_per_byte: 5, + accepting_primary: true, + replica_sync_price: None, + accepting_extensions: true, + max_capacity: 0, + }, + stats: ProviderStats { + registered_at: 0, + agreements_total: 0, + agreements_extended: 0, + agreements_not_extended: 0, + agreements_burned: 0, + total_bytes_committed: 0, + challenges_received: 0, + challenges_failed: 0, + }, deregister_at: None, } } fn primary_request() -> NegotiateRequest { NegotiateRequest { - owner: AccountId32::new([7u8; 32]), + owner: AccountId32([7u8; 32]), max_bytes: 1024, duration: 50, price_per_byte: 5, @@ -131,12 +148,11 @@ fn primary_request() -> NegotiateRequest { } } -/// `//Alice`'s sr25519 public key — the negotiate handler signs with the same -/// keypair, so signatures must verify under this. -fn alice_public() -> sr25519::Public { - sr25519::Pair::from_string(PROVIDER_SEED, None) - .expect("//Alice is a valid SURI") - .public() +fn provider_public() -> subxt_signer::sr25519::PublicKey { + let uri = subxt_signer::SecretUri::from_str(PROVIDER_SEED).unwrap(); + subxt_signer::sr25519::Keypair::from_uri(&uri) + .expect("PROVIDER_SEED is a valid SURI") + .public_key() } #[tokio::test] @@ -158,14 +174,15 @@ async fn negotiate_returns_signed_terms_with_valid_signature() { // The signature must verify under //Alice over blake2_256(signing_payload). let hash = sp_core::hashing::blake2_256(&signed.terms.signing_payload()); - let sig = match signed.signature { - MultiSignature::Sr25519(s) => s, + match signed.signature { + MultiSignature::Sr25519(s) => { + assert!( + subxt_signer::sr25519::verify(&subxt_signer::sr25519::Signature(s), hash, &provider_public()), + "negotiated terms signature did not verify under PROVIDER_SEED using subxt_signer::sr25519::Pair" + ); + } other => panic!("expected an sr25519 signature, got {other:?}"), }; - assert!( - sr25519::Pair::verify(&sig, hash, &alice_public()), - "negotiated terms signature did not verify under //Alice" - ); } #[tokio::test] @@ -208,8 +225,8 @@ async fn negotiate_allocates_distinct_monotonic_nonces() { #[tokio::test] async fn negotiate_accepts_replica_when_sync_price_configured() { let mut info = provider_info(); - info.accepting_primary = false; // closed for primary… - info.replica_sync_price = Some(7); // …but open for replicas. + info.settings.accepting_primary = false; // closed for primary… + info.settings.replica_sync_price = Some(7); // …but open for replicas. let server = TestServer::ready(info).await; let mut req = primary_request(); @@ -504,7 +521,7 @@ async fn negotiate_422_duration_out_of_bounds() { #[tokio::test] async fn negotiate_422_capacity_exceeded() { let mut info = provider_info(); - info.max_capacity = 2048; + info.settings.max_capacity = 2048; info.committed_bytes = 1536; // only 512 bytes free let server = TestServer::ready(info).await; @@ -531,7 +548,7 @@ async fn negotiate_422_zero_bytes() { #[tokio::test] async fn negotiate_422_not_accepting_primary() { let mut info = provider_info(); - info.accepting_primary = false; + info.settings.accepting_primary = false; let server = TestServer::ready(info).await; let resp = server.negotiate(&primary_request()).await; diff --git a/storage-interfaces/file-system/client/Cargo.toml b/storage-interfaces/file-system/client/Cargo.toml index 5f2241f9..a52e1403 100644 --- a/storage-interfaces/file-system/client/Cargo.toml +++ b/storage-interfaces/file-system/client/Cargo.toml @@ -20,8 +20,7 @@ reqwest = { workspace = true } # Substrate/Polkadot sp-core = { workspace = true, features = ["std"] } sp-runtime = { workspace = true, features = ["std"] } -subxt = { workspace = true } -subxt-signer = { workspace = true } +storage-subxt = { workspace = true } # Utilities tracing = { workspace = true } diff --git a/storage-interfaces/file-system/client/examples/basic_usage.rs b/storage-interfaces/file-system/client/examples/basic_usage.rs index d4df46a5..08e3c4e0 100644 --- a/storage-interfaces/file-system/client/examples/basic_usage.rs +++ b/storage-interfaces/file-system/client/examples/basic_usage.rs @@ -22,10 +22,10 @@ //! ``` use file_system_client::FileSystemClient; -use sp_runtime::AccountId32; use std::env; use storage_client::{NegotiateRequest, ProviderClient}; -use subxt_signer::sr25519::dev as dev_signer; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt_signer::sr25519::dev as dev_signer; const DEFAULT_CHAIN_WS: &str = "ws://127.0.0.1:2222"; const DEFAULT_PROVIDER_URL: &str = "http://127.0.0.1:3333"; diff --git a/storage-interfaces/file-system/client/examples/ci_integration_test.rs b/storage-interfaces/file-system/client/examples/ci_integration_test.rs index aa409451..4f91f047 100644 --- a/storage-interfaces/file-system/client/examples/ci_integration_test.rs +++ b/storage-interfaces/file-system/client/examples/ci_integration_test.rs @@ -17,10 +17,10 @@ use file_system_client::FileSystemClient; use file_system_primitives::DirectoryEntry; -use sp_runtime::AccountId32; use std::env; use storage_client::{NegotiateRequest, ProviderClient}; -use subxt_signer::sr25519::dev as dev_signer; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt_signer::sr25519::dev as dev_signer; async fn list_and_verify( fs_client: &mut FileSystemClient, diff --git a/storage-interfaces/file-system/client/src/lib.rs b/storage-interfaces/file-system/client/src/lib.rs index bfc700e4..509980b9 100644 --- a/storage-interfaces/file-system/client/src/lib.rs +++ b/storage-interfaces/file-system/client/src/lib.rs @@ -42,14 +42,16 @@ mod substrate; use file_system_primitives::{ compute_cid, Cid, DirectoryEntry, DirectoryNode, EntryType, FileManifest, }; -use sp_core::H256; -use sp_runtime::{AccountId32, BoundedVec}; +use sp_runtime::BoundedVec; use std::collections::HashMap; use std::sync::Arc; +use storage_client::storage_user::StorageUserClient; use storage_client::{ BatchedCheckpointConfig, BatchedInterval, CheckpointCallback, CheckpointLoopHandle, - CheckpointManager, ClientConfig, EventParser, StorageUserClient, + CheckpointManager, ClientConfig, EventParser, }; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; use substrate::{FileSystemEvent, FileSystemEventParser}; use thiserror::Error; use tokio::sync::Mutex; @@ -155,7 +157,7 @@ impl FileSystemClient { } /// Set a custom signer for blockchain transactions. - pub fn with_signer(mut self, signer: subxt_signer::sr25519::Keypair) -> Self { + pub fn with_signer(mut self, signer: storage_subxt::subxt_signer::sr25519::Keypair) -> Self { self.substrate_client = self.substrate_client.with_signer(signer); self } @@ -210,10 +212,10 @@ impl FileSystemClient { name: Option<&str>, provider: AccountId32, terms: storage_client::AgreementTermsOf, - sig: sp_runtime::MultiSignature, + sig: storage_subxt::api::runtime_types::sp_runtime::MultiSignature, ) -> Result { let drive_id = self - .create_drive_on_chain(name, provider, &terms, &sig) + .create_drive_on_chain(name, provider, &terms, sig) .await?; // Get the bucket_id for this drive @@ -882,7 +884,7 @@ impl FileSystemClient { name: Option<&str>, provider: AccountId32, terms: &storage_client::AgreementTermsOf, - sig: &sp_runtime::MultiSignature, + sig: storage_subxt::api::runtime_types::sp_runtime::MultiSignature, ) -> Result { let name_bytes = name.map(|n| n.as_bytes().to_vec()); diff --git a/storage-interfaces/file-system/client/src/substrate.rs b/storage-interfaces/file-system/client/src/substrate.rs index 5eaff894..e962e6e3 100644 --- a/storage-interfaces/file-system/client/src/substrate.rs +++ b/storage-interfaces/file-system/client/src/substrate.rs @@ -2,17 +2,20 @@ //! Substrate blockchain integration for Drive Registry. //! -//! This module provides blockchain interaction using subxt with dynamic dispatch. +//! This module provides blockchain interaction using subxt with typed dispatch. use crate::FsClientError; use file_system_primitives::DriveId; -use sp_core::H256; -use sp_runtime::AccountId32; use std::str::FromStr; use std::sync::Arc; -use storage_client::{scale_decode, EventParser}; +use storage_client::runtime_convert as rc; +use storage_client::EventParser; use storage_primitives::Role; -use subxt::ext::scale_value::{At, Composite}; +use storage_subxt::api as runtime; +use storage_subxt::subxt; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; +use storage_subxt::subxt_signer; use subxt::{OnlineClient, PolkadotConfig}; use subxt_signer::sr25519::Keypair; @@ -106,7 +109,6 @@ impl SubstrateClient { /// Drive Registry extrinsics. pub mod extrinsics { use super::*; - use storage_client::substrate::extrinsics::{dynamic_agreement_terms, dynamic_multi_signature}; use storage_client::AgreementTermsOf; use subxt::tx::Payload; @@ -121,30 +123,20 @@ pub mod extrinsics { name: Option>, provider: AccountId32, terms: &AgreementTermsOf, - sig: &sp_runtime::MultiSignature, + sig: storage_subxt::api::runtime_types::sp_runtime::MultiSignature, ) -> impl Payload { - subxt::dynamic::tx( - "DriveRegistry", - "create_drive", - vec![ - name.map(|n| subxt::dynamic::Value::from_bytes(&n)) - .map(|v| subxt::dynamic::Value::unnamed_variant("Some", vec![v])) - .unwrap_or_else(|| subxt::dynamic::Value::unnamed_variant("None", vec![])), - subxt::dynamic::Value::from_bytes(provider.as_ref() as &[u8]), - dynamic_agreement_terms(terms), - dynamic_multi_signature(sig), - ], + runtime::tx().drive_registry().create_drive( + name, + provider, + rc::to_agreement_terms(terms), + sig, ) } /// Delete drive extrinsic. #[allow(dead_code)] pub fn delete_drive(drive_id: DriveId) -> impl Payload { - subxt::dynamic::tx( - "DriveRegistry", - "delete_drive", - vec![subxt::dynamic::Value::u128(drive_id as u128)], - ) + runtime::tx().drive_registry().delete_drive(drive_id) } } @@ -156,34 +148,26 @@ pub mod storage { /// Query drive info. pub fn drive_info(drive_id: DriveId) -> impl Address { - subxt::dynamic::storage( - "DriveRegistry", - "Drives", - vec![subxt::dynamic::Value::u128(drive_id as u128)], - ) + runtime::storage().drive_registry().drives(drive_id) } /// Query user drives list. pub fn user_drives(account: &AccountId32) -> impl Address { - subxt::dynamic::storage( - "DriveRegistry", - "UserDrives", - vec![subxt::dynamic::Value::from_bytes(account.as_ref() as &[u8])], - ) + runtime::storage() + .drive_registry() + .user_drives(account.clone()) } /// Query bucket to drive mapping. pub fn bucket_to_drive(bucket_id: u64) -> impl Address { - subxt::dynamic::storage( - "DriveRegistry", - "BucketToDrive", - vec![subxt::dynamic::Value::u128(bucket_id as u128)], - ) + runtime::storage() + .drive_registry() + .bucket_to_drive(bucket_id) } /// Query next drive ID. pub fn next_drive_id() -> impl Address { - subxt::dynamic::storage("DriveRegistry", "NextDriveId", vec![]) + runtime::storage().drive_registry().next_drive_id() } } @@ -258,62 +242,59 @@ impl EventParser for FileSystemEventParser { block_hash: H256, block_number: u32, ) -> Option { + use runtime::drive_registry::events as ev; + use storage_subxt::api::runtime_types as rt; + if event.pallet_name() != PALLET_NAME { return None; } - let fields = match event.field_values() { - Ok(f) => f, - Err(e) => { - tracing::trace!("Failed to decode fields for {}: {e}", event.variant_name()); - return None; - } - }; - - match event.variant_name() { - "DriveCreated" => Some(FileSystemEvent::DriveCreated { - drive_id: scale_decode::field_u64(&fields, "drive_id")?, - owner: scale_decode::field_account(&fields, "owner")?, - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, + if let Ok(Some(e)) = event.as_event::() { + return Some(FileSystemEvent::DriveCreated { + drive_id: e.drive_id, + owner: e.owner, + bucket_id: e.bucket_id, block_hash, block_number, - }), - "DriveDeleted" => Some(FileSystemEvent::DriveDeleted { - drive_id: scale_decode::field_u64(&fields, "drive_id")?, - owner: scale_decode::field_account(&fields, "owner")?, - bucket_id: scale_decode::field_u64(&fields, "bucket_id")?, - refunded: scale_decode::field_u128(&fields, "refunded")?, - block_hash, - block_number, - }), - "DriveShared" => Some(FileSystemEvent::DriveShared { - drive_id: scale_decode::field_u64(&fields, "drive_id")?, - member: scale_decode::field_account(&fields, "member")?, - role: field_role(&fields, "role")?, + }); + } + if let Ok(Some(e)) = event.as_event::() { + return Some(FileSystemEvent::DriveDeleted { + drive_id: e.drive_id, + owner: e.owner, + bucket_id: e.bucket_id, + refunded: e.refunded, block_hash, block_number, - }), - "DriveUnshared" => Some(FileSystemEvent::DriveUnshared { - drive_id: scale_decode::field_u64(&fields, "drive_id")?, - member: scale_decode::field_account(&fields, "member")?, + }); + } + if let Ok(Some(e)) = event.as_event::() { + let role = match e.role { + rt::storage_primitives::Role::Admin => Role::Admin, + rt::storage_primitives::Role::Writer => Role::Writer, + rt::storage_primitives::Role::Reader => Role::Reader, + }; + return Some(FileSystemEvent::DriveShared { + drive_id: e.drive_id, + member: e.member, + role, block_hash, block_number, - }), - other => Some(FileSystemEvent::Unknown { - variant: other.to_string(), + }); + } + if let Ok(Some(e)) = event.as_event::() { + return Some(FileSystemEvent::DriveUnshared { + drive_id: e.drive_id, + member: e.member, block_hash, block_number, - }), + }); } - } -} -/// Decode a `storage_primitives::Role`-shaped variant field. -fn field_role(fields: &Composite, name: &str) -> Option { - match scale_decode::variant_name(fields.at(name)?)?.as_str() { - "Admin" => Some(Role::Admin), - "Writer" => Some(Role::Writer), - "Reader" => Some(Role::Reader), - _ => None, + Some(FileSystemEvent::Unknown { + variant: event.variant_name().to_string(), + block_hash, + block_number, + }) } } diff --git a/storage-interfaces/s3/client/Cargo.toml b/storage-interfaces/s3/client/Cargo.toml index 3291d830..86e2f538 100644 --- a/storage-interfaces/s3/client/Cargo.toml +++ b/storage-interfaces/s3/client/Cargo.toml @@ -12,17 +12,12 @@ description = "S3-compatible client SDK for web3-storage" s3-primitives = { workspace = true, features = ["std"] } storage-client = { workspace = true } -# Substrate primitives -sp-core = { workspace = true, features = ["std"] } -sp-runtime = { workspace = true, features = ["std"] } - # Async/HTTP reqwest = { workspace = true } tokio = { workspace = true } # Subxt for chain interaction -subxt = { workspace = true } -subxt-signer = { workspace = true } +storage-subxt = { workspace = true } bip39 = { workspace = true } # Utilities diff --git a/storage-interfaces/s3/client/examples/basic_usage.rs b/storage-interfaces/s3/client/examples/basic_usage.rs index 94f38334..f2776feb 100644 --- a/storage-interfaces/s3/client/examples/basic_usage.rs +++ b/storage-interfaces/s3/client/examples/basic_usage.rs @@ -5,11 +5,11 @@ //! Usage: cargo run --example basic_usage [chain_ws] [provider_url] [seed] use s3_client::{PutObjectOptions, S3Client}; -use sp_runtime::AccountId32; use std::collections::HashMap; use std::env; use storage_client::{NegotiateRequest, ProviderClient}; -use subxt_signer::sr25519::dev as dev_signer; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt_signer::sr25519::dev as dev_signer; const DEFAULT_CHAIN_WS: &str = "ws://127.0.0.1:2222"; const DEFAULT_PROVIDER_URL: &str = "http://127.0.0.1:3333"; diff --git a/storage-interfaces/s3/client/examples/ci_integration_test.rs b/storage-interfaces/s3/client/examples/ci_integration_test.rs index 3d1562dc..1b9f6194 100644 --- a/storage-interfaces/s3/client/examples/ci_integration_test.rs +++ b/storage-interfaces/s3/client/examples/ci_integration_test.rs @@ -18,11 +18,11 @@ //! Usage: cargo run --example ci_integration_test [chain_ws] [provider_url] use s3_client::{PutObjectOptions, S3Client}; -use sp_runtime::AccountId32; use std::collections::HashMap; use std::env; use storage_client::{NegotiateRequest, ProviderClient}; -use subxt_signer::sr25519::dev as dev_signer; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt_signer::sr25519::dev as dev_signer; const DEFAULT_CHAIN_WS: &str = "ws://127.0.0.1:2222"; const DEFAULT_PROVIDER_URL: &str = "http://127.0.0.1:3333"; diff --git a/storage-interfaces/s3/client/src/lib.rs b/storage-interfaces/s3/client/src/lib.rs index 591cd953..4df259e0 100644 --- a/storage-interfaces/s3/client/src/lib.rs +++ b/storage-interfaces/s3/client/src/lib.rs @@ -11,8 +11,9 @@ pub use substrate::SubstrateClient; use s3_primitives::{ validate_bucket_name, validate_object_key, ListObjectsParams, ListObjectsResponse, S3BucketId, }; -use sp_core::H256; use std::collections::HashMap; +use storage_client::storage_user::StorageUserClient; +use storage_subxt::subxt::utils::H256; use thiserror::Error; use tracing::{debug, info}; @@ -127,7 +128,7 @@ pub struct BucketInfo { /// S3 client for interacting with web3-storage using S3-compatible semantics. pub struct S3Client { /// Layer 0 storage client for blob operations. - storage_client: storage_client::StorageUserClient, + storage_client: StorageUserClient, /// Substrate client for chain operations. substrate_client: SubstrateClient, } @@ -145,7 +146,7 @@ impl S3Client { provider_urls: vec![provider_url.to_string()], ..Default::default() }; - let storage_client = storage_client::StorageUserClient::new(config) + let storage_client = StorageUserClient::new(config) .map_err(|e| S3ClientError::ProviderError(e.to_string()))?; let substrate_client = SubstrateClient::new(chain_url, seed_phrase) @@ -166,9 +167,9 @@ impl S3Client { pub async fn create_bucket( &self, name: &str, - provider: sp_runtime::AccountId32, + provider: storage_subxt::subxt::utils::AccountId32, terms: storage_client::AgreementTermsOf, - sig: sp_runtime::MultiSignature, + sig: storage_subxt::api::runtime_types::sp_runtime::MultiSignature, ) -> Result { info!("Creating bucket: {}", name); @@ -180,7 +181,7 @@ impl S3Client { // The pallet validates name uniqueness, so no need to pre-check. let s3_bucket_id = self .substrate_client - .create_s3_bucket(name, provider, &terms, &sig) + .create_s3_bucket(name, provider, &terms, sig) .await .map_err(S3ClientError::ChainError)?; diff --git a/storage-interfaces/s3/client/src/substrate.rs b/storage-interfaces/s3/client/src/substrate.rs index 0593f8b4..3c828cf2 100644 --- a/storage-interfaces/s3/client/src/substrate.rs +++ b/storage-interfaces/s3/client/src/substrate.rs @@ -4,11 +4,14 @@ use crate::{BucketInfo, S3ClientError}; use s3_primitives::{ListObjectsParams, ListObjectsResponse, S3BucketId}; -use sp_core::H256; -use sp_runtime::AccountId32; use std::sync::Arc; -use storage_client::{scale_decode, EventParser}; -use subxt::ext::scale_value::{At, Composite, Value, ValueDef}; +use storage_client::runtime_convert as rc; +use storage_client::EventParser; +use storage_subxt::api as runtime; +use storage_subxt::subxt; +use storage_subxt::subxt::utils::AccountId32; +use storage_subxt::subxt::utils::H256; +use storage_subxt::subxt_signer; use subxt::{OnlineClient, PolkadotConfig}; use subxt_signer::sr25519::Keypair; use tracing::{debug, info}; @@ -101,9 +104,9 @@ impl SubstrateClient { /// Retries on stale-nonce (error 1010) which can happen when submitting /// multiple transactions in quick succession — the RPC node's cached nonce /// may not yet reflect the previous tx's inclusion. - async fn submit_and_finalize( + async fn submit_and_finalize( &self, - tx: subxt::tx::DefaultPayload>, + tx: P, ) -> std::result::Result, String> { let signer = self.signer()?; @@ -155,19 +158,15 @@ impl SubstrateClient { name: &str, provider: AccountId32, terms: &storage_client::AgreementTermsOf, - sig: &sp_runtime::MultiSignature, + sig: storage_subxt::api::runtime_types::sp_runtime::MultiSignature, ) -> std::result::Result { debug!("Creating S3 bucket: {}", name); - let tx = subxt::dynamic::tx( - PALLET_NAME, - "create_s3_bucket", - vec![ - Value::from_bytes(name.as_bytes()), - Value::from_bytes(provider.as_ref() as &[u8]), - storage_client::substrate::extrinsics::dynamic_agreement_terms(terms), - storage_client::substrate::extrinsics::dynamic_multi_signature(sig), - ], + let tx = runtime::tx().s3_registry().create_s3_bucket( + name.as_bytes().to_vec(), + provider, + rc::to_agreement_terms(terms), + sig, ); let events = self.submit_and_finalize(tx).await?; @@ -192,12 +191,7 @@ impl SubstrateClient { pub async fn delete_s3_bucket(&self, bucket_id: S3BucketId) -> std::result::Result<(), String> { debug!("Deleting S3 bucket: {}", bucket_id); - let tx = subxt::dynamic::tx( - PALLET_NAME, - "delete_s3_bucket", - vec![Value::u128(bucket_id as u128)], - ); - + let tx = runtime::tx().s3_registry().delete_s3_bucket(bucket_id); self.submit_and_finalize(tx).await?; Ok(()) } @@ -214,23 +208,13 @@ impl SubstrateClient { ) -> std::result::Result<(), String> { debug!("Putting object metadata: bucket={}, key={}", bucket_id, key); - // Build metadata tuples - let metadata_values: Vec = user_metadata - .into_iter() - .map(|(k, v)| Value::unnamed_composite([Value::from_bytes(&k), Value::from_bytes(&v)])) - .collect(); - - let tx = subxt::dynamic::tx( - PALLET_NAME, - "put_object_metadata", - vec![ - Value::u128(bucket_id as u128), - Value::from_bytes(key.as_bytes()), - Value::from_bytes(cid.as_bytes()), - Value::u128(size as u128), - Value::from_bytes(content_type.as_bytes()), - Value::unnamed_composite(metadata_values), - ], + let tx = runtime::tx().s3_registry().put_object_metadata( + bucket_id, + key.as_bytes().to_vec(), + cid, + size, + content_type.as_bytes().to_vec(), + user_metadata, ); self.submit_and_finalize(tx).await?; @@ -248,14 +232,9 @@ impl SubstrateClient { bucket_id, key ); - let tx = subxt::dynamic::tx( - PALLET_NAME, - "delete_object_metadata", - vec![ - Value::u128(bucket_id as u128), - Value::from_bytes(key.as_bytes()), - ], - ); + let tx = runtime::tx() + .s3_registry() + .delete_object_metadata(bucket_id, key.as_bytes().to_vec()); self.submit_and_finalize(tx).await?; Ok(()) @@ -274,15 +253,11 @@ impl SubstrateClient { src_bucket_id, src_key, dst_bucket_id, dst_key ); - let tx = subxt::dynamic::tx( - PALLET_NAME, - "copy_object_metadata", - vec![ - Value::u128(src_bucket_id as u128), - Value::from_bytes(src_key.as_bytes()), - Value::u128(dst_bucket_id as u128), - Value::from_bytes(dst_key.as_bytes()), - ], + let tx = runtime::tx().s3_registry().copy_object_metadata( + src_bucket_id, + src_key.as_bytes().to_vec(), + dst_bucket_id, + dst_key.as_bytes().to_vec(), ); self.submit_and_finalize(tx).await?; @@ -294,11 +269,9 @@ impl SubstrateClient { &self, name: &str, ) -> std::result::Result, S3ClientError> { - let storage_query = subxt::dynamic::storage( - PALLET_NAME, - "BucketNameToId", - vec![Value::from_bytes(name.as_bytes())], - ); + let addr = runtime::storage() + .s3_registry() + .bucket_name_to_id(rc::to_bounded_bytes(name.as_bytes().to_vec())); let result = self .client @@ -306,11 +279,11 @@ impl SubstrateClient { .at_latest() .await .map_err(|e| S3ClientError::InternalError(e.to_string()))? - .fetch(&storage_query) + .fetch(&addr) .await .map_err(|e| S3ClientError::InternalError(e.to_string()))?; - Ok(result.and_then(|v| v.as_type::().ok())) + Ok(result) } /// Get bucket info by ID. @@ -318,11 +291,7 @@ impl SubstrateClient { &self, bucket_id: S3BucketId, ) -> std::result::Result, String> { - let storage_query = subxt::dynamic::storage( - PALLET_NAME, - "S3Buckets", - vec![Value::u128(bucket_id as u128)], - ); + let addr = runtime::storage().s3_registry().s3_buckets(bucket_id); let result = self .client @@ -330,31 +299,18 @@ impl SubstrateClient { .at_latest() .await .map_err(|e| e.to_string())? - .fetch(&storage_query) + .fetch(&addr) .await .map_err(|e| e.to_string())?; - match result { - Some(value) => { - let decoded = value.to_value().map_err(|e| e.to_string())?; - - let name = extract_bytes_field(&decoded, "name").unwrap_or_default(); - let layer0_bucket_id = extract_u64_field(&decoded, "layer0_bucket_id").unwrap_or(0); - let object_count = extract_u64_field(&decoded, "object_count").unwrap_or(0); - let total_size = extract_u64_field(&decoded, "total_size").unwrap_or(0); - let created_at = extract_u64_field(&decoded, "created_at").unwrap_or(0) as u32; - - Ok(Some(BucketInfo { - s3_bucket_id: bucket_id, - name: String::from_utf8_lossy(&name).to_string(), - layer0_bucket_id, - object_count, - total_size, - created_at, - })) - } - None => Ok(None), - } + Ok(result.map(|info| BucketInfo { + s3_bucket_id: info.s3_bucket_id, + name: String::from_utf8_lossy(&info.name.0).to_string(), + layer0_bucket_id: info.layer0_bucket_id, + object_count: info.object_count, + total_size: info.total_size, + created_at: info.created_at, + })) } /// Get object metadata. @@ -363,14 +319,9 @@ impl SubstrateClient { bucket_id: S3BucketId, key: &str, ) -> std::result::Result, String> { - let storage_query = subxt::dynamic::storage( - PALLET_NAME, - "Objects", - vec![ - Value::u128(bucket_id as u128), - Value::from_bytes(key.as_bytes()), - ], - ); + let addr = runtime::storage() + .s3_registry() + .objects(bucket_id, rc::to_bounded_bytes(key.as_bytes().to_vec())); let result = self .client @@ -378,48 +329,33 @@ impl SubstrateClient { .at_latest() .await .map_err(|e| e.to_string())? - .fetch(&storage_query) + .fetch(&addr) .await .map_err(|e| e.to_string())?; - match result { - Some(value) => { - let decoded = value.to_value().map_err(|e| e.to_string())?; - - let cid_bytes = extract_bytes_field(&decoded, "cid").unwrap_or_default(); - let cid = if cid_bytes.len() == 32 { - H256::from_slice(&cid_bytes) - } else { - H256::zero() - }; - - let size = extract_u64_field(&decoded, "size").unwrap_or(0); - let last_modified = extract_u64_field(&decoded, "last_modified").unwrap_or(0); - let content_type = - extract_bytes_field(&decoded, "content_type").unwrap_or_default(); - let etag = extract_bytes_field(&decoded, "etag").unwrap_or_default(); - let user_metadata = extract_metadata_entries(&decoded, "user_metadata"); - - Ok(Some(ChainObjectMetadata { - cid, - size, - last_modified, - content_type, - etag, - user_metadata, - })) - } - None => Ok(None), - } + Ok(result.map(|meta| ChainObjectMetadata { + cid: meta.cid, + size: meta.size, + last_modified: meta.last_modified, + content_type: meta.content_type.0, + etag: meta.etag.0, + user_metadata: meta + .user_metadata + .0 + .into_iter() + .map(|e| MetadataEntry { + key: e.key.0, + value: e.value.0, + }) + .collect(), + })) } /// List user's buckets. pub async fn list_user_buckets(&self) -> std::result::Result, String> { - let storage_query = subxt::dynamic::storage( - PALLET_NAME, - "UserBuckets", - vec![Value::from_bytes(self.account_id)], - ); + let addr = runtime::storage() + .s3_registry() + .user_buckets(AccountId32::from(self.account_id)); let result = self .client @@ -427,17 +363,11 @@ impl SubstrateClient { .at_latest() .await .map_err(|e| e.to_string())? - .fetch(&storage_query) + .fetch(&addr) .await .map_err(|e| e.to_string())?; - let bucket_ids: Vec = match result { - Some(value) => { - let decoded = value.to_value().map_err(|e| e.to_string())?; - extract_u64_vec(&decoded) - } - None => vec![], - }; + let bucket_ids: Vec = result.map(|bvec| bvec.0).unwrap_or_default(); let mut buckets = Vec::new(); for id in bucket_ids { @@ -476,124 +406,6 @@ impl SubstrateClient { } } -// Helper functions for extracting values from scale_value::Value -// Using pattern matching on ValueDef for composite access - -/// Extract bytes from a named field. -fn extract_bytes_field(value: &Value, field: &str) -> Option> { - let field_value = value.at(field)?; - extract_bytes_from_value(field_value) -} - -/// Extract u64 from a named field. -fn extract_u64_field(value: &Value, field: &str) -> Option { - let field_value = value.at(field)?; - field_value.as_u128().map(|v| v as u64) -} - -/// Extract a vec of u64 values from a sequence/composite. -fn extract_u64_vec(value: &Value) -> Vec { - let mut result = Vec::new(); - match &value.value { - ValueDef::Composite(Composite::Unnamed(values)) => { - for item in values { - if let Some(v) = item.as_u128() { - result.push(v as u64); - } - } - } - ValueDef::Composite(Composite::Named(values)) => { - for (_name, item) in values { - if let Some(v) = item.as_u128() { - result.push(v as u64); - } - } - } - _ => {} - } - result -} - -/// Extract bytes from a Value (handles BoundedVec and H256 encoding). -/// -/// Subxt decodes wrapper types like H256 and BoundedVec as nested composites: -/// e.g. H256 becomes Composite::Unnamed([Composite::Unnamed([b0..b31])]). -/// This function handles both flat byte sequences and single-element wrapper composites. -fn extract_bytes_from_value(value: &Value) -> Option> { - match &value.value { - ValueDef::Composite(Composite::Unnamed(values)) => { - // Try direct byte extraction (each element is a u8 encoded as u128) - let bytes: Vec = values - .iter() - .filter_map(|v| v.as_u128().map(|n| n as u8)) - .collect(); - if bytes.len() == values.len() && !bytes.is_empty() { - return Some(bytes); - } - // Single-element wrapper (e.g., H256 wrapping [u8; 32], BoundedVec wrapping Vec) - if values.len() == 1 { - return extract_bytes_from_value(&values[0]); - } - None - } - ValueDef::Composite(Composite::Named(values)) => { - let bytes: Vec = values - .iter() - .filter_map(|(_, v)| v.as_u128().map(|n| n as u8)) - .collect(); - if bytes.len() == values.len() && !bytes.is_empty() { - return Some(bytes); - } - if values.len() == 1 { - return extract_bytes_from_value(&values[0].1); - } - None - } - _ => None, - } -} - -/// Extract metadata entries from user_metadata field. -fn extract_metadata_entries(value: &Value, field: &str) -> Vec { - let mut entries = Vec::new(); - if let Some(field_value) = value.at(field) { - match &field_value.value { - ValueDef::Composite(Composite::Unnamed(items)) => { - for entry_value in items { - let key = entry_value - .at("key") - .and_then(extract_bytes_from_value) - .unwrap_or_default(); - let val = entry_value - .at("value") - .and_then(extract_bytes_from_value) - .unwrap_or_default(); - if !key.is_empty() { - entries.push(MetadataEntry { key, value: val }); - } - } - } - ValueDef::Composite(Composite::Named(items)) => { - for (_name, entry_value) in items { - let key = entry_value - .at("key") - .and_then(extract_bytes_from_value) - .unwrap_or_default(); - let val = entry_value - .at("value") - .and_then(extract_bytes_from_value) - .unwrap_or_default(); - if !key.is_empty() { - entries.push(MetadataEntry { key, value: val }); - } - } - } - _ => {} - } - } - entries -} - // ============================================================================ // Event Parser // ============================================================================ @@ -674,59 +486,62 @@ impl EventParser for S3EventParser { block_hash: H256, block_number: u32, ) -> Option { + use runtime::s3_registry::events as ev; + if event.pallet_name() != PALLET_NAME { return None; } - let fields = match event.field_values() { - Ok(f) => f, - Err(e) => { - tracing::trace!("Failed to decode fields for {}: {e}", event.variant_name()); - return None; - } - }; - - match event.variant_name() { - "S3BucketCreated" => Some(S3Event::S3BucketCreated { - s3_bucket_id: scale_decode::field_u64(&fields, "s3_bucket_id")?, - name: scale_decode::field_bytes(&fields, "name")?, - layer0_bucket_id: scale_decode::field_u64(&fields, "layer0_bucket_id")?, - owner: scale_decode::field_account(&fields, "owner")?, - block_hash, - block_number, - }), - "S3BucketDeleted" => Some(S3Event::S3BucketDeleted { - s3_bucket_id: scale_decode::field_u64(&fields, "s3_bucket_id")?, + if let Ok(Some(e)) = event.as_event::() { + return Some(S3Event::S3BucketCreated { + s3_bucket_id: e.s3_bucket_id, + name: e.name, + layer0_bucket_id: e.layer0_bucket_id, + owner: e.owner, block_hash, block_number, - }), - "ObjectPut" => Some(S3Event::ObjectPut { - s3_bucket_id: scale_decode::field_u64(&fields, "s3_bucket_id")?, - key: scale_decode::field_bytes(&fields, "key")?, - cid: scale_decode::field_h256(&fields, "cid")?, - size: scale_decode::field_u64(&fields, "size")?, + }); + } + if let Ok(Some(e)) = event.as_event::() { + return Some(S3Event::S3BucketDeleted { + s3_bucket_id: e.s3_bucket_id, block_hash, block_number, - }), - "ObjectDeleted" => Some(S3Event::ObjectDeleted { - s3_bucket_id: scale_decode::field_u64(&fields, "s3_bucket_id")?, - key: scale_decode::field_bytes(&fields, "key")?, + }); + } + if let Ok(Some(e)) = event.as_event::() { + return Some(S3Event::ObjectPut { + s3_bucket_id: e.s3_bucket_id, + key: e.key, + cid: e.cid, + size: e.size, block_hash, block_number, - }), - "ObjectCopied" => Some(S3Event::ObjectCopied { - src_bucket_id: scale_decode::field_u64(&fields, "src_bucket_id")?, - src_key: scale_decode::field_bytes(&fields, "src_key")?, - dst_bucket_id: scale_decode::field_u64(&fields, "dst_bucket_id")?, - dst_key: scale_decode::field_bytes(&fields, "dst_key")?, + }); + } + if let Ok(Some(e)) = event.as_event::() { + return Some(S3Event::ObjectDeleted { + s3_bucket_id: e.s3_bucket_id, + key: e.key, block_hash, block_number, - }), - other => Some(S3Event::Unknown { - variant: other.to_string(), + }); + } + if let Ok(Some(e)) = event.as_event::() { + return Some(S3Event::ObjectCopied { + src_bucket_id: e.src_bucket_id, + src_key: e.src_key, + dst_bucket_id: e.dst_bucket_id, + dst_key: e.dst_key, block_hash, block_number, - }), + }); } + + Some(S3Event::Unknown { + variant: event.variant_name().to_string(), + block_hash, + block_number, + }) } } diff --git a/storage-subxt/Cargo.toml b/storage-subxt/Cargo.toml new file mode 100644 index 00000000..d23b6f25 --- /dev/null +++ b/storage-subxt/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "storage-subxt" +description = "Rust bindings and interface to interact with Web3 Storage using subxt" +version = "0.1.0" +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +exclude = ["./metadata"] +readme = "README.md" + + +[dependencies] +codec = { workspace = true } +scale-info = { workspace = true } +subxt = { workspace = true, features = ["jsonrpsee"], optional = true } +subxt-signer = { workspace = true, features = ["ecdsa", "sr25519", "subxt"] } +serde = { workspace = true, features = ["derive"] } +subxt-core = { workspace = true } + +[features] +default = ["std"] +std = [ + "codec/std", + "dep:subxt", + "scale-info/std", + "serde/std", + "subxt-core/std", + "subxt-signer/std", + "subxt/jsonrpsee", + "subxt/native", +] +# Select the network runtime bindings exposed as `storage_runtime`. +# Off (default): testnet (`storage_paseo_runtime`). On: mainnet (`storage_mainnet_runtime`). +mainnet = [] diff --git a/storage-subxt/README.md b/storage-subxt/README.md new file mode 100644 index 00000000..daf24fed --- /dev/null +++ b/storage-subxt/README.md @@ -0,0 +1,43 @@ +# Web3-Storage-Subxt + +### Downloading metadata from a Substrate node + +Use the [`subxt-cli`](https://crates.io/crates/subxt-cli) tool to download the metadata for your target runtime from a node. + +1. Install: + +```bash +cargo install subxt-cli@0.44.3 --force --locked +``` + +2. To Save the metadata of runtime: + Run the release build of the web3-storage runtime: + ```rust + just start-paseo-chain + ``` + + Then on another terminal run: + ```bash + subxt metadata -f bytes --url ws://localhost:2222 > ./metadata/storage_paseo_runtime.scale + ``` + +3. Generating the subxt code from the metadata: + +```bash +subxt codegen --file ./metadata/storage_paseo_runtime.scale \ + --crate "::subxt_core" \ + --derive Clone \ + --derive Eq \ + --derive PartialEq \ + --derive-for-type "pallet_storage_provider::pallet::ProviderInfo=serde::Serialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderInfo=serde::Deserialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderSettings=serde::Serialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderSettings=serde::Deserialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderStats=serde::Serialize" \ + --derive-for-type "pallet_storage_provider::pallet::ProviderStats=serde::Deserialize" \ + --derive-for-type "bounded_collections::bounded_vec::BoundedVec=serde::Serialize" \ + --derive-for-type "bounded_collections::bounded_vec::BoundedVec=serde::Deserialize" \ + --derive-for-type "sp_runtime::MultiSignature=codec::Encode" \ + --derive-for-type "sp_runtime::MultiSignature=codec::Decode" \ + | rustfmt --edition=2021 --emit=stdout > ./src/storage_paseo_runtime.rs +``` diff --git a/storage-subxt/metadata/storage_mainnet_runtime.scale b/storage-subxt/metadata/storage_mainnet_runtime.scale new file mode 100644 index 00000000..8e4a30b2 --- /dev/null +++ b/storage-subxt/metadata/storage_mainnet_runtime.scale @@ -0,0 +1 @@ +// TODO: resolve mainnet scale \ No newline at end of file diff --git a/storage-subxt/metadata/storage_paseo_runtime.scale b/storage-subxt/metadata/storage_paseo_runtime.scale new file mode 100644 index 00000000..c1a65e8e Binary files /dev/null and b/storage-subxt/metadata/storage_paseo_runtime.scale differ diff --git a/storage-subxt/src/lib.rs b/storage-subxt/src/lib.rs new file mode 100644 index 00000000..19730072 --- /dev/null +++ b/storage-subxt/src/lib.rs @@ -0,0 +1,28 @@ +#![deny( + stable_features, + non_shorthand_field_patterns, + renamed_and_removed_lints, + unsafe_code +)] + +pub use codec; +pub use scale_info; +#[cfg(feature = "std")] +pub use subxt; +#[cfg(feature = "std")] +pub use subxt::ext::subxt_core; +#[cfg(not(feature = "std"))] +pub use subxt_core; +pub use subxt_signer; + +#[cfg(feature = "mainnet")] +#[rustfmt::skip] +pub mod storage_mainnet_runtime; +#[cfg(feature = "mainnet")] +pub use storage_mainnet_runtime::*; + +// #[cfg(not(feature = "mainnet"))] +#[rustfmt::skip] +pub mod storage_paseo_runtime; +#[cfg(not(feature = "mainnet"))] +pub use storage_paseo_runtime::*; diff --git a/storage-subxt/src/storage_mainnet_runtime.rs b/storage-subxt/src/storage_mainnet_runtime.rs new file mode 100644 index 00000000..b91dedc4 --- /dev/null +++ b/storage-subxt/src/storage_mainnet_runtime.rs @@ -0,0 +1,7 @@ +// Placeholder for the mainnet runtime bindings. +// TODO: resolve mainnet artifact +// +// Mainnet metadata has not been generated yet. Re-exports paseo bindings so +// --all-features compiles. Replace with real generated bindings once the +// mainnet metadata file is available (generate like storage_paseo_runtime.rs). +pub use crate::storage_paseo_runtime::*; \ No newline at end of file diff --git a/storage-subxt/src/storage_paseo_runtime.rs b/storage-subxt/src/storage_paseo_runtime.rs new file mode 100644 index 00000000..8f213993 --- /dev/null +++ b/storage-subxt/src/storage_paseo_runtime.rs @@ -0,0 +1,34104 @@ +#[allow(dead_code, unused_imports, non_camel_case_types, unreachable_patterns)] +#[allow(clippy::all)] +#[allow(rustdoc::broken_intra_doc_links)] +pub mod api { + #[allow(unused_imports)] + mod root_mod { + pub use super::*; + } + pub static PALLETS: [&str; 22usize] = [ + "System", + "ParachainSystem", + "Timestamp", + "ParachainInfo", + "Balances", + "TransactionPayment", + "Sudo", + "Authorship", + "CollatorSelection", + "Session", + "Aura", + "AuraExt", + "XcmpQueue", + "PolkadotXcm", + "CumulusXcm", + "MessageQueue", + "Utility", + "WeightReclaim", + "StorageProvider", + "DriveRegistry", + "S3Registry", + "Revive", + ]; + pub static RUNTIME_APIS: [&str; 21usize] = [ + "Core", + "Metadata", + "BlockBuilder", + "TaggedTransactionQueue", + "OffchainWorkerApi", + "SessionKeys", + "AuraApi", + "AccountNonceApi", + "TransactionPaymentApi", + "CollectCollationInfo", + "AuraUnincludedSegmentApi", + "RelayParentOffsetApi", + "GetParachainInfo", + "GenesisBuilder", + "StorageProviderApi", + "XcmPaymentApi", + "DryRunApi", + "LocationToAccountApi", + "TrustedQueryApi", + "AuthorizedAliasersApi", + "ReviveApi", + ]; + #[doc = r" The error type that is returned when there is a runtime issue."] + pub type DispatchError = runtime_types::sp_runtime::DispatchError; + #[doc = r" The outer event enum."] + pub type Event = runtime_types::storage_paseo_runtime::RuntimeEvent; + #[doc = r" The outer extrinsic enum."] + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + #[doc = r" The outer error enum represents the DispatchError's Module variant."] + pub type Error = runtime_types::storage_paseo_runtime::RuntimeError; + pub fn constants() -> ConstantsApi { + ConstantsApi + } + pub fn storage() -> StorageApi { + StorageApi + } + pub fn tx() -> TransactionApi { + TransactionApi + } + pub fn apis() -> runtime_apis::RuntimeApi { + runtime_apis::RuntimeApi + } + pub mod runtime_apis { + use super::root_mod; + use super::runtime_types; + use ::subxt_core::ext::codec::Encode; + pub struct RuntimeApi; + impl RuntimeApi { + pub fn core(&self) -> core::Core { + core::Core + } + pub fn metadata(&self) -> metadata::Metadata { + metadata::Metadata + } + pub fn block_builder(&self) -> block_builder::BlockBuilder { + block_builder::BlockBuilder + } + pub fn tagged_transaction_queue( + &self, + ) -> tagged_transaction_queue::TaggedTransactionQueue { + tagged_transaction_queue::TaggedTransactionQueue + } + pub fn offchain_worker_api(&self) -> offchain_worker_api::OffchainWorkerApi { + offchain_worker_api::OffchainWorkerApi + } + pub fn session_keys(&self) -> session_keys::SessionKeys { + session_keys::SessionKeys + } + pub fn aura_api(&self) -> aura_api::AuraApi { + aura_api::AuraApi + } + pub fn account_nonce_api(&self) -> account_nonce_api::AccountNonceApi { + account_nonce_api::AccountNonceApi + } + pub fn transaction_payment_api( + &self, + ) -> transaction_payment_api::TransactionPaymentApi { + transaction_payment_api::TransactionPaymentApi + } + pub fn collect_collation_info(&self) -> collect_collation_info::CollectCollationInfo { + collect_collation_info::CollectCollationInfo + } + pub fn aura_unincluded_segment_api( + &self, + ) -> aura_unincluded_segment_api::AuraUnincludedSegmentApi { + aura_unincluded_segment_api::AuraUnincludedSegmentApi + } + pub fn relay_parent_offset_api(&self) -> relay_parent_offset_api::RelayParentOffsetApi { + relay_parent_offset_api::RelayParentOffsetApi + } + pub fn get_parachain_info(&self) -> get_parachain_info::GetParachainInfo { + get_parachain_info::GetParachainInfo + } + pub fn genesis_builder(&self) -> genesis_builder::GenesisBuilder { + genesis_builder::GenesisBuilder + } + pub fn storage_provider_api(&self) -> storage_provider_api::StorageProviderApi { + storage_provider_api::StorageProviderApi + } + pub fn xcm_payment_api(&self) -> xcm_payment_api::XcmPaymentApi { + xcm_payment_api::XcmPaymentApi + } + pub fn dry_run_api(&self) -> dry_run_api::DryRunApi { + dry_run_api::DryRunApi + } + pub fn location_to_account_api(&self) -> location_to_account_api::LocationToAccountApi { + location_to_account_api::LocationToAccountApi + } + pub fn trusted_query_api(&self) -> trusted_query_api::TrustedQueryApi { + trusted_query_api::TrustedQueryApi + } + pub fn authorized_aliasers_api( + &self, + ) -> authorized_aliasers_api::AuthorizedAliasersApi { + authorized_aliasers_api::AuthorizedAliasersApi + } + pub fn revive_api(&self) -> revive_api::ReviveApi { + revive_api::ReviveApi + } + } + pub mod core { + use super::root_mod; + use super::runtime_types; + #[doc = " The `Core` runtime api that every Substrate runtime needs to implement."] + pub struct Core; + impl Core { + #[doc = " Returns the version of the runtime."] + pub fn version( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Version, + types::version::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "Core", + "version", + types::Version {}, + [ + 79u8, 22u8, 137u8, 4u8, 40u8, 64u8, 30u8, 180u8, 49u8, 222u8, 114u8, + 125u8, 44u8, 25u8, 33u8, 152u8, 98u8, 42u8, 72u8, 178u8, 240u8, 103u8, + 34u8, 187u8, 81u8, 161u8, 183u8, 6u8, 120u8, 2u8, 146u8, 0u8, + ], + ) + } + #[doc = " Execute the given block."] + pub fn execute_block( + &self, + block: types::execute_block::Block, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ExecuteBlock, + types::execute_block::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "Core", + "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, + ], + ) + } + #[doc = " Initialize a block with the given header and return the runtime executive mode."] + pub fn initialize_block( + &self, + header: types::initialize_block::Header, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::InitializeBlock, + types::initialize_block::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "Core", + "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, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod version { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_version::RuntimeVersion; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Version {} + pub mod execute_block { + use super::runtime_types; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > > ; + pub mod output { + use super::runtime_types; + pub type Output = (); + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ExecuteBlock { + pub block: execute_block::Block, + } + pub mod initialize_block { + use super::runtime_types; + pub type Header = + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_runtime::ExtrinsicInclusionMode; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InitializeBlock { + pub header: initialize_block::Header, + } + } + } + pub mod metadata { + use super::root_mod; + use super::runtime_types; + #[doc = " The `Metadata` api trait that returns metadata for the runtime."] + pub struct Metadata; + impl Metadata { + #[doc = " Returns the metadata of a runtime."] + pub fn metadata( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Metadata, + types::metadata::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "Metadata", + "metadata", + types::Metadata {}, + [ + 231u8, 24u8, 67u8, 152u8, 23u8, 26u8, 188u8, 82u8, 229u8, 6u8, 185u8, + 27u8, 175u8, 68u8, 83u8, 122u8, 69u8, 89u8, 185u8, 74u8, 248u8, 87u8, + 217u8, 124u8, 193u8, 252u8, 199u8, 186u8, 196u8, 179u8, 179u8, 96u8, + ], + ) + } + #[doc = " Returns the metadata at a given version."] + #[doc = ""] + #[doc = " If the given `version` isn't supported, this will return `None`."] + #[doc = " Use [`Self::metadata_versions`] to find out about supported metadata version of the runtime."] + pub fn metadata_at_version( + &self, + version: types::metadata_at_version::Version, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::MetadataAtVersion, + types::metadata_at_version::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "Metadata", + "metadata_at_version", + types::MetadataAtVersion { version }, + [ + 131u8, 53u8, 212u8, 234u8, 16u8, 25u8, 120u8, 252u8, 153u8, 153u8, + 216u8, 28u8, 54u8, 113u8, 52u8, 236u8, 146u8, 68u8, 142u8, 8u8, 10u8, + 169u8, 131u8, 142u8, 204u8, 38u8, 48u8, 108u8, 134u8, 86u8, 226u8, + 61u8, + ], + ) + } + #[doc = " Returns the supported metadata versions."] + #[doc = ""] + #[doc = " This can be used to call `metadata_at_version`."] + pub fn metadata_versions( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::MetadataVersions, + types::metadata_versions::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "Metadata", + "metadata_versions", + types::MetadataVersions {}, + [ + 23u8, 144u8, 137u8, 91u8, 188u8, 39u8, 231u8, 208u8, 252u8, 218u8, + 224u8, 176u8, 77u8, 32u8, 130u8, 212u8, 223u8, 76u8, 100u8, 190u8, + 82u8, 94u8, 190u8, 8u8, 82u8, 244u8, 225u8, 179u8, 85u8, 176u8, 56u8, + 16u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod metadata { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_core::OpaqueMetadata; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Metadata {} + pub mod metadata_at_version { + use super::runtime_types; + pub type Version = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = + ::core::option::Option; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MetadataAtVersion { + pub version: metadata_at_version::Version, + } + pub mod metadata_versions { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec<::core::primitive::u32>; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MetadataVersions {} + } + } + pub mod block_builder { + use super::root_mod; + use super::runtime_types; + #[doc = " The `BlockBuilder` api trait that provides the required functionality for building a block."] + pub struct BlockBuilder; + impl BlockBuilder { + #[doc = " Apply the given extrinsic."] + #[doc = ""] + #[doc = " Returns an inclusion outcome which specifies if this extrinsic is included in"] + #[doc = " this block or not."] + pub fn apply_extrinsic( + &self, + extrinsic: types::apply_extrinsic::Extrinsic, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ApplyExtrinsic, + types::apply_extrinsic::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "BlockBuilder", + "apply_extrinsic", + types::ApplyExtrinsic { extrinsic }, + [ + 192u8, 184u8, 199u8, 4u8, 85u8, 136u8, 214u8, 205u8, 29u8, 29u8, 98u8, + 145u8, 172u8, 92u8, 168u8, 161u8, 150u8, 133u8, 100u8, 243u8, 100u8, + 100u8, 118u8, 28u8, 104u8, 82u8, 93u8, 63u8, 79u8, 36u8, 149u8, 144u8, + ], + ) + } + #[doc = " Finish the current block."] + pub fn finalize_block( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::FinalizeBlock, + types::finalize_block::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "BlockBuilder", + "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, + ], + ) + } + #[doc = " Generate inherent extrinsics. The inherent data will vary from chain to chain."] + pub fn inherent_extrinsics( + &self, + inherent: types::inherent_extrinsics::Inherent, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::InherentExtrinsics, + types::inherent_extrinsics::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "BlockBuilder", + "inherent_extrinsics", + types::InherentExtrinsics { inherent }, + [ + 254u8, 110u8, 245u8, 201u8, 250u8, 192u8, 27u8, 228u8, 151u8, 213u8, + 166u8, 89u8, 94u8, 81u8, 189u8, 234u8, 64u8, 18u8, 245u8, 80u8, 29u8, + 18u8, 140u8, 129u8, 113u8, 236u8, 135u8, 55u8, 79u8, 159u8, 175u8, + 183u8, + ], + ) + } + #[doc = " Check that the inherents are valid. The inherent data will vary from chain to chain."] + pub fn check_inherents( + &self, + block: types::check_inherents::Block, + data: types::check_inherents::Data, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::CheckInherents, + types::check_inherents::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "BlockBuilder", + "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, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod apply_extrinsic { + use super::runtime_types; + pub type Extrinsic = :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > ; + pub mod output { + use super::runtime_types; + pub type Output = :: core :: result :: Result < :: core :: result :: Result < () , runtime_types :: sp_runtime :: DispatchError > , runtime_types :: sp_runtime :: transaction_validity :: TransactionValidityError > ; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ApplyExtrinsic { + pub extrinsic: apply_extrinsic::Extrinsic, + } + pub mod finalize_block { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct FinalizeBlock {} + pub mod inherent_extrinsics { + use super::runtime_types; + pub type Inherent = runtime_types::sp_inherents::InherentData; + pub mod output { + use super::runtime_types; + pub type Output = :: subxt_core :: alloc :: vec :: Vec < :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > > ; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InherentExtrinsics { + pub inherent: inherent_extrinsics::Inherent, + } + pub mod check_inherents { + use super::runtime_types; + pub type Block = runtime_types :: sp_runtime :: generic :: block :: LazyBlock < runtime_types :: sp_runtime :: generic :: header :: Header < :: core :: primitive :: u32 > , :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > > ; + pub type Data = runtime_types::sp_inherents::InherentData; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_inherents::CheckInherentsResult; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckInherents { + pub block: check_inherents::Block, + pub data: check_inherents::Data, + } + } + } + pub mod tagged_transaction_queue { + use super::root_mod; + use super::runtime_types; + #[doc = " The `TaggedTransactionQueue` api trait for interfering with the transaction queue."] + pub struct TaggedTransactionQueue; + impl TaggedTransactionQueue { + #[doc = " Validate the transaction."] + #[doc = ""] + #[doc = " This method is invoked by the transaction pool to learn details about given transaction."] + #[doc = " The implementation should make sure to verify the correctness of the transaction"] + #[doc = " against current state. The given `block_hash` corresponds to the hash of the block"] + #[doc = " that is used as current state."] + #[doc = ""] + #[doc = " Note that this call may be performed by the pool multiple times and transactions"] + #[doc = " might be verified in any possible order."] + pub fn validate_transaction( + &self, + source: types::validate_transaction::Source, + tx: types::validate_transaction::Tx, + block_hash: types::validate_transaction::BlockHash, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ValidateTransaction, + types::validate_transaction::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "TaggedTransactionQueue", + "validate_transaction", + types::ValidateTransaction { + source, + tx, + block_hash, + }, + [ + 19u8, 53u8, 170u8, 115u8, 75u8, 121u8, 231u8, 50u8, 199u8, 181u8, + 243u8, 170u8, 163u8, 224u8, 213u8, 134u8, 206u8, 207u8, 88u8, 242u8, + 80u8, 139u8, 233u8, 87u8, 175u8, 249u8, 178u8, 169u8, 255u8, 171u8, + 4u8, 125u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod validate_transaction { + use super::runtime_types; + pub type Source = + runtime_types::sp_runtime::transaction_validity::TransactionSource; + pub type Tx = :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > ; + pub type BlockHash = ::subxt_core::utils::H256; + pub mod output { + use super::runtime_types; + pub type Output = :: core :: result :: Result < runtime_types :: sp_runtime :: transaction_validity :: ValidTransaction , runtime_types :: sp_runtime :: transaction_validity :: TransactionValidityError > ; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ValidateTransaction { + pub source: validate_transaction::Source, + pub tx: validate_transaction::Tx, + pub block_hash: validate_transaction::BlockHash, + } + } + } + pub mod offchain_worker_api { + use super::root_mod; + use super::runtime_types; + #[doc = " The offchain worker api."] + pub struct OffchainWorkerApi; + impl OffchainWorkerApi { + #[doc = " Starts the off-chain task for given block header."] + pub fn offchain_worker( + &self, + header: types::offchain_worker::Header, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::OffchainWorker, + types::offchain_worker::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "OffchainWorkerApi", + "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, + ], + ) + } + } + pub mod types { + 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 mod output { + use super::runtime_types; + pub type Output = (); + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OffchainWorker { + pub header: offchain_worker::Header, + } + } + } + pub mod session_keys { + use super::root_mod; + use super::runtime_types; + #[doc = " Session keys runtime api."] + pub struct SessionKeys; + impl SessionKeys { + #[doc = " Generate a set of session keys with optionally using the given seed."] + #[doc = " The keys should be stored within the keystore exposed via runtime"] + #[doc = " externalities."] + #[doc = ""] + #[doc = " The seed needs to be a valid `utf8` string."] + #[doc = ""] + #[doc = " Returns the concatenated SCALE encoded public keys."] + pub fn generate_session_keys( + &self, + owner: types::generate_session_keys::Owner, + seed: types::generate_session_keys::Seed, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::GenerateSessionKeys, + types::generate_session_keys::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "SessionKeys", + "generate_session_keys", + types::GenerateSessionKeys { owner, seed }, + [ + 94u8, 230u8, 217u8, 119u8, 217u8, 37u8, 67u8, 190u8, 118u8, 204u8, + 72u8, 95u8, 58u8, 138u8, 153u8, 164u8, 95u8, 31u8, 85u8, 83u8, 199u8, + 12u8, 119u8, 135u8, 248u8, 96u8, 85u8, 142u8, 84u8, 238u8, 111u8, + 254u8, + ], + ) + } + #[doc = " Decode the given public session keys."] + #[doc = ""] + #[doc = " Returns the list of public raw public keys + key type."] + pub fn decode_session_keys( + &self, + encoded: types::decode_session_keys::Encoded, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::DecodeSessionKeys, + types::decode_session_keys::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "SessionKeys", + "decode_session_keys", + types::DecodeSessionKeys { encoded }, + [ + 57u8, 242u8, 18u8, 51u8, 132u8, 110u8, 238u8, 255u8, 39u8, 194u8, 8u8, + 54u8, 198u8, 178u8, 75u8, 151u8, 148u8, 176u8, 144u8, 197u8, 87u8, + 29u8, 179u8, 235u8, 176u8, 78u8, 252u8, 103u8, 72u8, 203u8, 151u8, + 248u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod generate_session_keys { + use super::runtime_types; + pub type Owner = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Seed = ::core::option::Option< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::sp_session::runtime_api::OpaqueGeneratedSessionKeys; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct GenerateSessionKeys { + pub owner: generate_session_keys::Owner, + pub seed: generate_session_keys::Seed, + } + pub mod decode_session_keys { + use super::runtime_types; + pub type Encoded = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + ::subxt_core::alloc::vec::Vec<( + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + runtime_types::sp_core::crypto::KeyTypeId, + )>, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DecodeSessionKeys { + pub encoded: decode_session_keys::Encoded, + } + } + } + pub mod aura_api { + use super::root_mod; + use super::runtime_types; + #[doc = " API necessary for block authorship with aura."] + pub struct AuraApi; + impl AuraApi { + #[doc = " Returns the slot duration for Aura."] + #[doc = ""] + #[doc = " Currently, only the value provided by this type at genesis will be used."] + pub fn slot_duration( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::SlotDuration, + types::slot_duration::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "AuraApi", + "slot_duration", + types::SlotDuration {}, + [ + 233u8, 210u8, 132u8, 172u8, 100u8, 125u8, 239u8, 92u8, 114u8, 82u8, + 7u8, 110u8, 179u8, 196u8, 10u8, 19u8, 211u8, 15u8, 174u8, 2u8, 91u8, + 73u8, 133u8, 100u8, 205u8, 201u8, 191u8, 60u8, 163u8, 122u8, 215u8, + 10u8, + ], + ) + } + #[doc = " Return the current set of authorities."] + pub fn authorities( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Authorities, + types::authorities::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "AuraApi", + "authorities", + types::Authorities {}, + [ + 35u8, 244u8, 24u8, 155u8, 95u8, 1u8, 221u8, 159u8, 33u8, 144u8, 213u8, + 26u8, 13u8, 21u8, 136u8, 72u8, 45u8, 47u8, 15u8, 51u8, 235u8, 10u8, + 6u8, 219u8, 9u8, 246u8, 50u8, 252u8, 49u8, 77u8, 64u8, 182u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod slot_duration { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::sp_consensus_slots::SlotDuration; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct SlotDuration {} + pub mod authorities { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Authorities {} + } + } + pub mod account_nonce_api { + use super::root_mod; + use super::runtime_types; + #[doc = " The API to query account nonce."] + pub struct AccountNonceApi; + impl AccountNonceApi { + #[doc = " Get current account nonce of given `AccountId`."] + pub fn account_nonce( + &self, + account: types::account_nonce::Account, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::AccountNonce, + types::account_nonce::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "AccountNonceApi", + "account_nonce", + types::AccountNonce { account }, + [ + 231u8, 82u8, 7u8, 227u8, 131u8, 2u8, 215u8, 252u8, 173u8, 82u8, 11u8, + 103u8, 200u8, 25u8, 114u8, 116u8, 79u8, 229u8, 152u8, 150u8, 236u8, + 37u8, 101u8, 26u8, 220u8, 146u8, 182u8, 101u8, 73u8, 55u8, 191u8, + 171u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod account_nonce { + use super::runtime_types; + pub type Account = ::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AccountNonce { + pub account: account_nonce::Account, + } + } + } + pub mod transaction_payment_api { + use super::root_mod; + use super::runtime_types; + pub struct TransactionPaymentApi; + impl TransactionPaymentApi { + pub fn query_info( + &self, + uxt: types::query_info::Uxt, + len: types::query_info::Len, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::QueryInfo, + types::query_info::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "TransactionPaymentApi", + "query_info", + types::QueryInfo { uxt, len }, + [ + 56u8, 30u8, 174u8, 34u8, 202u8, 24u8, 177u8, 189u8, 145u8, 36u8, 1u8, + 156u8, 98u8, 209u8, 178u8, 49u8, 198u8, 23u8, 150u8, 173u8, 35u8, + 205u8, 147u8, 129u8, 42u8, 22u8, 69u8, 3u8, 129u8, 8u8, 196u8, 139u8, + ], + ) + } + pub fn query_fee_details( + &self, + uxt: types::query_fee_details::Uxt, + len: types::query_fee_details::Len, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::QueryFeeDetails, + types::query_fee_details::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "TransactionPaymentApi", + "query_fee_details", + types::QueryFeeDetails { uxt, len }, + [ + 117u8, 60u8, 137u8, 159u8, 237u8, 252u8, 216u8, 238u8, 232u8, 1u8, + 100u8, 152u8, 26u8, 185u8, 145u8, 125u8, 68u8, 189u8, 4u8, 30u8, 125u8, + 7u8, 196u8, 153u8, 235u8, 51u8, 219u8, 108u8, 185u8, 254u8, 100u8, + 201u8, + ], + ) + } + pub fn query_weight_to_fee( + &self, + weight: types::query_weight_to_fee::Weight, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::QueryWeightToFee, + types::query_weight_to_fee::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "TransactionPaymentApi", + "query_weight_to_fee", + types::QueryWeightToFee { weight }, + [ + 206u8, 243u8, 189u8, 83u8, 231u8, 244u8, 247u8, 52u8, 126u8, 208u8, + 224u8, 5u8, 163u8, 108u8, 254u8, 114u8, 214u8, 156u8, 227u8, 217u8, + 211u8, 198u8, 121u8, 164u8, 110u8, 54u8, 181u8, 146u8, 50u8, 146u8, + 146u8, 23u8, + ], + ) + } + pub fn query_length_to_fee( + &self, + length: types::query_length_to_fee::Length, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::QueryLengthToFee, + types::query_length_to_fee::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "TransactionPaymentApi", + "query_length_to_fee", + types::QueryLengthToFee { length }, + [ + 92u8, 132u8, 29u8, 119u8, 66u8, 11u8, 196u8, 224u8, 129u8, 23u8, 249u8, + 12u8, 32u8, 28u8, 92u8, 50u8, 188u8, 101u8, 203u8, 229u8, 248u8, 216u8, + 130u8, 150u8, 212u8, 161u8, 81u8, 254u8, 116u8, 89u8, 162u8, 48u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod query_info { + use super::runtime_types; + pub type Uxt = :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > ; + pub type Len = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_transaction_payment::types::RuntimeDispatchInfo< + ::core::primitive::u128, + runtime_types::sp_weights::weight_v2::Weight, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryInfo { + pub uxt: query_info::Uxt, + pub len: query_info::Len, + } + pub mod query_fee_details { + use super::runtime_types; + pub type Uxt = :: subxt_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > ; + pub type Len = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_transaction_payment::types::FeeDetails< + ::core::primitive::u128, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryFeeDetails { + pub uxt: query_fee_details::Uxt, + pub len: query_fee_details::Len, + } + pub mod query_weight_to_fee { + use super::runtime_types; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryWeightToFee { + pub weight: query_weight_to_fee::Weight, + } + pub mod query_length_to_fee { + use super::runtime_types; + pub type Length = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u128; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryLengthToFee { + pub length: query_length_to_fee::Length, + } + } + } + pub mod collect_collation_info { + use super::root_mod; + use super::runtime_types; + #[doc = " Runtime api to collect information about a collation."] + #[doc = ""] + #[doc = " Version history:"] + #[doc = " - Version 2: Changed [`Self::collect_collation_info`] signature"] + #[doc = " - Version 3: Signals to the node to use version 1 of [`ParachainBlockData`]."] + pub struct CollectCollationInfo; + impl CollectCollationInfo { + #[doc = " Collect information about a collation."] + #[doc = ""] + #[doc = " The given `header` is the header of the built block for that"] + #[doc = " we are collecting the collation info for."] + pub fn collect_collation_info( + &self, + header: types::collect_collation_info::Header, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::CollectCollationInfo, + types::collect_collation_info::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "CollectCollationInfo", + "collect_collation_info", + types::CollectCollationInfo { header }, + [ + 56u8, 138u8, 105u8, 91u8, 216u8, 40u8, 255u8, 98u8, 86u8, 138u8, 185u8, + 155u8, 80u8, 141u8, 85u8, 48u8, 252u8, 235u8, 178u8, 231u8, 111u8, + 216u8, 71u8, 20u8, 33u8, 202u8, 24u8, 215u8, 214u8, 132u8, 51u8, 166u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod collect_collation_info { + use super::runtime_types; + pub type Header = + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::cumulus_primitives_core::CollationInfo; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CollectCollationInfo { + pub header: collect_collation_info::Header, + } + } + } + pub mod aura_unincluded_segment_api { + use super::root_mod; + use super::runtime_types; + #[doc = " This runtime API is used to inform potential block authors whether they will"] + #[doc = " have the right to author at a slot, assuming they have claimed the slot."] + #[doc = ""] + #[doc = " In particular, this API allows Aura-based parachains to regulate their \"unincluded segment\","] + #[doc = " which is the section of the head of the chain which has not yet been made available in the"] + #[doc = " relay chain."] + #[doc = ""] + #[doc = " When the unincluded segment is short, Aura chains will allow authors to create multiple"] + #[doc = " blocks per slot in order to build a backlog. When it is saturated, this API will limit"] + #[doc = " the amount of blocks that can be created."] + #[doc = ""] + #[doc = " Changes:"] + #[doc = " - Version 2: Update to `can_build_upon` to take a relay chain `Slot` instead of a parachain `Slot`."] + pub struct AuraUnincludedSegmentApi; + impl AuraUnincludedSegmentApi { + #[doc = " Whether it is legal to extend the chain, assuming the given block is the most"] + #[doc = " recently included one as-of the relay parent that will be built against, and"] + #[doc = " the given relay chain slot."] + #[doc = ""] + #[doc = " This should be consistent with the logic the runtime uses when validating blocks to"] + #[doc = " avoid issues."] + #[doc = ""] + #[doc = " When the unincluded segment is empty, i.e. `included_hash == at`, where at is the block"] + #[doc = " whose state we are querying against, this must always return `true` as long as the slot"] + #[doc = " is more recent than the included block itself."] + pub fn can_build_upon( + &self, + included_hash: types::can_build_upon::IncludedHash, + slot: types::can_build_upon::Slot, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::CanBuildUpon, + types::can_build_upon::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "AuraUnincludedSegmentApi", + "can_build_upon", + types::CanBuildUpon { + included_hash, + slot, + }, + [ + 255u8, 59u8, 225u8, 229u8, 189u8, 250u8, 48u8, 150u8, 92u8, 226u8, + 221u8, 202u8, 143u8, 145u8, 107u8, 112u8, 151u8, 146u8, 136u8, 155u8, + 118u8, 174u8, 52u8, 178u8, 14u8, 89u8, 194u8, 157u8, 110u8, 103u8, + 92u8, 72u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod can_build_upon { + use super::runtime_types; + pub type IncludedHash = ::subxt_core::utils::H256; + pub type Slot = runtime_types::sp_consensus_slots::Slot; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CanBuildUpon { + pub included_hash: can_build_upon::IncludedHash, + pub slot: can_build_upon::Slot, + } + } + } + pub mod relay_parent_offset_api { + use super::root_mod; + use super::runtime_types; + #[doc = " API to tell the node side how the relay parent should be chosen."] + #[doc = ""] + #[doc = " A larger offset indicates that the relay parent should not be the tip of the relay chain,"] + #[doc = " but `N` blocks behind the tip. This offset is then enforced by the runtime."] + pub struct RelayParentOffsetApi; + impl RelayParentOffsetApi { + #[doc = " Fetch the slot offset that is expected from the relay chain."] + pub fn relay_parent_offset( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::RelayParentOffset, + types::relay_parent_offset::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "RelayParentOffsetApi", + "relay_parent_offset", + types::RelayParentOffset {}, + [ + 135u8, 224u8, 54u8, 99u8, 48u8, 220u8, 254u8, 136u8, 192u8, 226u8, + 21u8, 5u8, 211u8, 150u8, 231u8, 148u8, 139u8, 209u8, 114u8, 27u8, 12u8, + 250u8, 12u8, 154u8, 161u8, 95u8, 113u8, 128u8, 3u8, 141u8, 79u8, 114u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod relay_parent_offset { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct RelayParentOffset {} + } + } + pub mod get_parachain_info { + use super::root_mod; + use super::runtime_types; + #[doc = " Runtime api used to access general info about a parachain runtime."] + pub struct GetParachainInfo; + impl GetParachainInfo { + #[doc = " Retrieve the parachain id used for runtime."] + pub fn parachain_id( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ParachainId, + types::parachain_id::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "GetParachainInfo", + "parachain_id", + types::ParachainId {}, + [ + 133u8, 200u8, 87u8, 39u8, 197u8, 166u8, 184u8, 238u8, 60u8, 133u8, + 176u8, 139u8, 162u8, 6u8, 45u8, 152u8, 186u8, 33u8, 185u8, 175u8, + 225u8, 15u8, 226u8, 54u8, 157u8, 126u8, 214u8, 90u8, 155u8, 34u8, 1u8, + 208u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod parachain_id { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::polkadot_parachain_primitives::primitives::Id; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ParachainId {} + } + } + pub mod genesis_builder { + use super::root_mod; + use super::runtime_types; + #[doc = " API to interact with `RuntimeGenesisConfig` for the runtime"] + pub struct GenesisBuilder; + impl GenesisBuilder { + #[doc = " Build `RuntimeGenesisConfig` from a JSON blob not using any defaults and store it in the"] + #[doc = " storage."] + #[doc = ""] + #[doc = " In the case of a FRAME-based runtime, this function deserializes the full"] + #[doc = " `RuntimeGenesisConfig` from the given JSON blob and puts it into the storage. If the"] + #[doc = " provided JSON blob is incorrect or incomplete or the deserialization fails, an error"] + #[doc = " is returned."] + #[doc = ""] + #[doc = " Please note that provided JSON blob must contain all `RuntimeGenesisConfig` fields, no"] + #[doc = " defaults will be used."] + pub fn build_state( + &self, + json: types::build_state::Json, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::BuildState, + types::build_state::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "GenesisBuilder", + "build_state", + types::BuildState { json }, + [ + 203u8, 233u8, 104u8, 116u8, 111u8, 131u8, 201u8, 235u8, 117u8, 116u8, + 140u8, 185u8, 93u8, 25u8, 155u8, 210u8, 56u8, 49u8, 23u8, 32u8, 253u8, + 92u8, 149u8, 241u8, 85u8, 245u8, 137u8, 45u8, 209u8, 189u8, 81u8, 2u8, + ], + ) + } + #[doc = " Returns a JSON blob representation of the built-in `RuntimeGenesisConfig` identified by"] + #[doc = " `id`."] + #[doc = ""] + #[doc = " If `id` is `None` the function should return JSON blob representation of the default"] + #[doc = " `RuntimeGenesisConfig` struct of the runtime. Implementation must provide default"] + #[doc = " `RuntimeGenesisConfig`."] + #[doc = ""] + #[doc = " Otherwise function returns a JSON representation of the built-in, named"] + #[doc = " `RuntimeGenesisConfig` preset identified by `id`, or `None` if such preset does not"] + #[doc = " exist. Returned `Vec` contains bytes of JSON blob (patch) which comprises a list of"] + #[doc = " (potentially nested) key-value pairs that are intended for customizing the default"] + #[doc = " runtime genesis config. The patch shall be merged (rfc7386) with the JSON representation"] + #[doc = " of the default `RuntimeGenesisConfig` to create a comprehensive genesis config that can"] + #[doc = " be used in `build_state` method."] + pub fn get_preset( + &self, + id: types::get_preset::Id, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::GetPreset, + types::get_preset::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "GenesisBuilder", + "get_preset", + types::GetPreset { id }, + [ + 43u8, 153u8, 23u8, 52u8, 113u8, 161u8, 227u8, 122u8, 169u8, 135u8, + 119u8, 8u8, 128u8, 33u8, 143u8, 235u8, 13u8, 173u8, 58u8, 121u8, 178u8, + 223u8, 66u8, 217u8, 22u8, 244u8, 168u8, 113u8, 202u8, 186u8, 241u8, + 124u8, + ], + ) + } + #[doc = " Returns a list of identifiers for available builtin `RuntimeGenesisConfig` presets."] + #[doc = ""] + #[doc = " The presets from the list can be queried with [`GenesisBuilder::get_preset`] method. If"] + #[doc = " no named presets are provided by the runtime the list is empty."] + pub fn preset_names( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::PresetNames, + types::preset_names::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "GenesisBuilder", + "preset_names", + types::PresetNames {}, + [ + 150u8, 117u8, 54u8, 129u8, 221u8, 130u8, 186u8, 71u8, 13u8, 140u8, + 77u8, 180u8, 141u8, 37u8, 22u8, 219u8, 149u8, 218u8, 186u8, 206u8, + 80u8, 42u8, 165u8, 41u8, 99u8, 184u8, 73u8, 37u8, 125u8, 188u8, 167u8, + 122u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod build_state { + use super::runtime_types; + pub type Json = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub mod output { + use super::runtime_types; + pub type Output = + ::core::result::Result<(), ::subxt_core::alloc::string::String>; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BuildState { + pub json: build_state::Json, + } + pub mod get_preset { + use super::runtime_types; + pub type Id = ::core::option::Option<::subxt_core::alloc::string::String>; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct GetPreset { + pub id: get_preset::Id, + } + pub mod preset_names { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + ::subxt_core::alloc::vec::Vec<::subxt_core::alloc::string::String>; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PresetNames {} + } + } + pub mod storage_provider_api { + use super::root_mod; + use super::runtime_types; + #[doc = " Runtime API for the storage provider pallet."] + pub struct StorageProviderApi; + impl StorageProviderApi { + #[doc = " Get provider information."] + pub fn provider_info( + &self, + provider: types::provider_info::Provider, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ProviderInfo, + types::provider_info::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "provider_info", + types::ProviderInfo { provider }, + [ + 239u8, 251u8, 158u8, 49u8, 100u8, 13u8, 217u8, 238u8, 217u8, 47u8, + 161u8, 4u8, 87u8, 83u8, 144u8, 226u8, 166u8, 44u8, 155u8, 178u8, 10u8, + 13u8, 228u8, 125u8, 137u8, 4u8, 237u8, 58u8, 8u8, 53u8, 197u8, 83u8, + ], + ) + } + #[doc = " Get all registered providers (paginated)."] + pub fn providers( + &self, + offset: types::providers::Offset, + limit: types::providers::Limit, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Providers, + types::providers::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "providers", + types::Providers { offset, limit }, + [ + 97u8, 130u8, 175u8, 149u8, 151u8, 253u8, 160u8, 108u8, 35u8, 101u8, + 0u8, 209u8, 166u8, 33u8, 86u8, 45u8, 252u8, 236u8, 124u8, 151u8, 113u8, + 156u8, 174u8, 180u8, 9u8, 9u8, 149u8, 232u8, 121u8, 210u8, 41u8, 46u8, + ], + ) + } + #[doc = " Get bucket information."] + pub fn bucket_info( + &self, + bucket_id: types::bucket_info::BucketId, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::BucketInfo, + types::bucket_info::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "bucket_info", + types::BucketInfo { bucket_id }, + [ + 108u8, 252u8, 24u8, 93u8, 83u8, 38u8, 147u8, 72u8, 205u8, 95u8, 5u8, + 175u8, 95u8, 175u8, 181u8, 1u8, 136u8, 254u8, 161u8, 175u8, 43u8, 5u8, + 236u8, 161u8, 5u8, 221u8, 137u8, 21u8, 13u8, 152u8, 74u8, 228u8, + ], + ) + } + #[doc = " Get all bucket IDs (paginated)."] + pub fn bucket_ids( + &self, + offset: types::bucket_ids::Offset, + limit: types::bucket_ids::Limit, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::BucketIds, + types::bucket_ids::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "bucket_ids", + types::BucketIds { offset, limit }, + [ + 250u8, 238u8, 158u8, 71u8, 229u8, 157u8, 195u8, 152u8, 142u8, 101u8, + 92u8, 88u8, 101u8, 71u8, 203u8, 50u8, 214u8, 107u8, 117u8, 139u8, 17u8, + 146u8, 146u8, 42u8, 233u8, 226u8, 168u8, 192u8, 91u8, 140u8, 134u8, + 184u8, + ], + ) + } + #[doc = " Get providers for a specific bucket."] + pub fn bucket_providers( + &self, + bucket_id: types::bucket_providers::BucketId, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::BucketProviders, + types::bucket_providers::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "bucket_providers", + types::BucketProviders { bucket_id }, + [ + 171u8, 41u8, 71u8, 11u8, 104u8, 165u8, 17u8, 19u8, 211u8, 221u8, 180u8, + 19u8, 145u8, 181u8, 142u8, 196u8, 43u8, 111u8, 40u8, 109u8, 96u8, + 107u8, 50u8, 99u8, 153u8, 0u8, 231u8, 0u8, 79u8, 88u8, 0u8, 175u8, + ], + ) + } + #[doc = " Get agreement information."] + pub fn agreement_info( + &self, + bucket_id: types::agreement_info::BucketId, + provider: types::agreement_info::Provider, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::AgreementInfo, + types::agreement_info::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "agreement_info", + types::AgreementInfo { + bucket_id, + provider, + }, + [ + 54u8, 115u8, 72u8, 52u8, 77u8, 212u8, 24u8, 77u8, 31u8, 216u8, 163u8, + 8u8, 223u8, 185u8, 26u8, 78u8, 110u8, 203u8, 140u8, 2u8, 11u8, 135u8, + 60u8, 202u8, 238u8, 132u8, 127u8, 103u8, 228u8, 217u8, 232u8, 118u8, + ], + ) + } + #[doc = " Get all agreements for a bucket."] + pub fn bucket_agreements( + &self, + bucket_id: types::bucket_agreements::BucketId, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::BucketAgreements, + types::bucket_agreements::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "bucket_agreements", + types::BucketAgreements { bucket_id }, + [ + 39u8, 164u8, 145u8, 254u8, 45u8, 99u8, 175u8, 198u8, 122u8, 211u8, 8u8, + 234u8, 91u8, 215u8, 146u8, 220u8, 4u8, 65u8, 100u8, 10u8, 160u8, 58u8, + 139u8, 203u8, 220u8, 45u8, 184u8, 150u8, 132u8, 206u8, 195u8, 125u8, + ], + ) + } + #[doc = " Get all agreements for a provider."] + pub fn provider_agreements( + &self, + provider: types::provider_agreements::Provider, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ProviderAgreements, + types::provider_agreements::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "provider_agreements", + types::ProviderAgreements { provider }, + [ + 196u8, 169u8, 194u8, 163u8, 31u8, 208u8, 207u8, 98u8, 75u8, 88u8, 73u8, + 247u8, 32u8, 137u8, 47u8, 133u8, 27u8, 90u8, 189u8, 151u8, 193u8, 64u8, + 210u8, 154u8, 210u8, 149u8, 228u8, 25u8, 52u8, 124u8, 25u8, 222u8, + ], + ) + } + #[doc = " Get challenges expiring at a specific block."] + pub fn challenges_at( + &self, + block: types::challenges_at::Block, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ChallengesAt, + types::challenges_at::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "challenges_at", + types::ChallengesAt { block }, + [ + 173u8, 97u8, 89u8, 253u8, 87u8, 109u8, 200u8, 3u8, 162u8, 165u8, 15u8, + 240u8, 136u8, 40u8, 220u8, 56u8, 21u8, 135u8, 15u8, 15u8, 169u8, 88u8, + 189u8, 153u8, 242u8, 199u8, 132u8, 162u8, 130u8, 85u8, 9u8, 3u8, + ], + ) + } + #[doc = " Get all challenges for a specific bucket."] + pub fn bucket_challenges( + &self, + bucket_id: types::bucket_challenges::BucketId, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::BucketChallenges, + types::bucket_challenges::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "bucket_challenges", + types::BucketChallenges { bucket_id }, + [ + 74u8, 24u8, 86u8, 254u8, 75u8, 122u8, 176u8, 254u8, 51u8, 228u8, 125u8, + 9u8, 161u8, 85u8, 116u8, 218u8, 203u8, 129u8, 31u8, 81u8, 8u8, 209u8, + 180u8, 251u8, 9u8, 27u8, 217u8, 156u8, 143u8, 53u8, 1u8, 48u8, + ], + ) + } + #[doc = " Get all challenges targeting a specific provider."] + pub fn provider_challenges( + &self, + provider: types::provider_challenges::Provider, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ProviderChallenges, + types::provider_challenges::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "provider_challenges", + types::ProviderChallenges { provider }, + [ + 198u8, 162u8, 7u8, 225u8, 86u8, 110u8, 53u8, 138u8, 248u8, 47u8, 228u8, + 110u8, 141u8, 216u8, 213u8, 243u8, 18u8, 29u8, 229u8, 199u8, 114u8, + 128u8, 28u8, 44u8, 161u8, 75u8, 93u8, 55u8, 30u8, 192u8, 156u8, 229u8, + ], + ) + } + #[doc = " Get all challenges created by a specific challenger."] + pub fn challenger_challenges( + &self, + challenger: types::challenger_challenges::Challenger, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ChallengerChallenges, + types::challenger_challenges::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "challenger_challenges", + types::ChallengerChallenges { challenger }, + [ + 72u8, 180u8, 154u8, 21u8, 162u8, 72u8, 30u8, 142u8, 74u8, 226u8, 211u8, + 175u8, 142u8, 30u8, 60u8, 144u8, 77u8, 137u8, 190u8, 61u8, 121u8, + 155u8, 213u8, 209u8, 159u8, 155u8, 195u8, 19u8, 153u8, 213u8, 123u8, + 75u8, + ], + ) + } + #[doc = " Check if a provider has sufficient stake for additional bytes."] + pub fn can_accept_bytes( + &self, + provider: types::can_accept_bytes::Provider, + additional_bytes: types::can_accept_bytes::AdditionalBytes, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::CanAcceptBytes, + types::can_accept_bytes::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "can_accept_bytes", + types::CanAcceptBytes { + provider, + additional_bytes, + }, + [ + 115u8, 229u8, 128u8, 146u8, 157u8, 153u8, 246u8, 7u8, 78u8, 26u8, + 135u8, 84u8, 237u8, 135u8, 87u8, 208u8, 63u8, 74u8, 172u8, 247u8, + 146u8, 241u8, 127u8, 17u8, 72u8, 125u8, 30u8, 70u8, 153u8, 237u8, + 231u8, 181u8, + ], + ) + } + #[doc = " Find providers matching the given storage requirements."] + #[doc = " Returns up to `limit` providers, sorted by match score (best first)."] + pub fn find_matching_providers( + &self, + requirements: types::find_matching_providers::Requirements, + limit: types::find_matching_providers::Limit, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::FindMatchingProviders, + types::find_matching_providers::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "find_matching_providers", + types::FindMatchingProviders { + requirements, + limit, + }, + [ + 166u8, 24u8, 123u8, 132u8, 131u8, 106u8, 58u8, 240u8, 16u8, 44u8, + 105u8, 219u8, 209u8, 149u8, 4u8, 9u8, 205u8, 72u8, 36u8, 81u8, 51u8, + 11u8, 159u8, 46u8, 88u8, 43u8, 114u8, 212u8, 204u8, 100u8, 167u8, 92u8, + ], + ) + } + #[doc = " Get providers with sufficient capacity for the given bytes (paginated)."] + pub fn providers_with_capacity( + &self, + bytes_needed: types::providers_with_capacity::BytesNeeded, + offset: types::providers_with_capacity::Offset, + limit: types::providers_with_capacity::Limit, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ProvidersWithCapacity, + types::providers_with_capacity::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "StorageProviderApi", + "providers_with_capacity", + types::ProvidersWithCapacity { + bytes_needed, + offset, + limit, + }, + [ + 129u8, 122u8, 84u8, 248u8, 212u8, 51u8, 191u8, 3u8, 140u8, 218u8, + 138u8, 241u8, 140u8, 163u8, 7u8, 191u8, 221u8, 130u8, 220u8, 82u8, + 23u8, 202u8, 38u8, 246u8, 172u8, 130u8, 202u8, 222u8, 77u8, 114u8, + 240u8, 197u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod provider_info { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = :: core :: option :: Option < runtime_types :: pallet_storage_provider :: runtime_api :: ProviderInfoResponse > ; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderInfo { + pub provider: provider_info::Provider, + } + pub mod providers { + use super::runtime_types; + pub type Offset = ::core::primitive::u32; + pub type Limit = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = :: subxt_core :: alloc :: vec :: Vec < (:: subxt_core :: utils :: AccountId32 , runtime_types :: pallet_storage_provider :: runtime_api :: ProviderInfoResponse ,) > ; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Providers { + pub offset: providers::Offset, + pub limit: providers::Limit, + } + pub mod bucket_info { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::pallet_storage_provider::runtime_api::BucketResponse, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketInfo { + pub bucket_id: bucket_info::BucketId, + } + pub mod bucket_ids { + use super::runtime_types; + pub type Offset = ::core::primitive::u32; + pub type Limit = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec<::core::primitive::u64>; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketIds { + pub offset: bucket_ids::Offset, + pub limit: bucket_ids::Limit, + } + pub mod bucket_providers { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = + ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketProviders { + pub bucket_id: bucket_providers::BucketId, + } + pub mod agreement_info { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::pallet_storage_provider::runtime_api::AgreementResponse, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementInfo { + pub bucket_id: agreement_info::BucketId, + pub provider: agreement_info::Provider, + } + pub mod bucket_agreements { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_storage_provider::runtime_api::AgreementResponse, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketAgreements { + pub bucket_id: bucket_agreements::BucketId, + } + pub mod provider_agreements { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_storage_provider::runtime_api::AgreementResponse, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderAgreements { + pub provider: provider_agreements::Provider, + } + pub mod challenges_at { + use super::runtime_types; + pub type Block = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_storage_provider::runtime_api::ChallengeResponse, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChallengesAt { + pub block: challenges_at::Block, + } + pub mod bucket_challenges { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_storage_provider::runtime_api::ChallengeResponse, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketChallenges { + pub bucket_id: bucket_challenges::BucketId, + } + pub mod provider_challenges { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_storage_provider::runtime_api::ChallengeResponse, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderChallenges { + pub provider: provider_challenges::Provider, + } + pub mod challenger_challenges { + use super::runtime_types; + pub type Challenger = ::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_storage_provider::runtime_api::ChallengeResponse, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChallengerChallenges { + pub challenger: challenger_challenges::Challenger, + } + pub mod can_accept_bytes { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type AdditionalBytes = ::core::primitive::u64; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::bool; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CanAcceptBytes { + pub provider: can_accept_bytes::Provider, + pub additional_bytes: can_accept_bytes::AdditionalBytes, + } + pub mod find_matching_providers { + use super::runtime_types; + pub type Requirements = + runtime_types::pallet_storage_provider::runtime_api::StorageRequirements; + pub type Limit = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_storage_provider::runtime_api::MatchedProvider, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct FindMatchingProviders { + pub requirements: find_matching_providers::Requirements, + pub limit: find_matching_providers::Limit, + } + pub mod providers_with_capacity { + use super::runtime_types; + pub type BytesNeeded = ::core::primitive::u64; + pub type Offset = ::core::primitive::u32; + pub type Limit = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = :: subxt_core :: alloc :: vec :: Vec < (:: subxt_core :: utils :: AccountId32 , runtime_types :: pallet_storage_provider :: runtime_api :: ProviderInfoResponse ,) > ; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProvidersWithCapacity { + pub bytes_needed: providers_with_capacity::BytesNeeded, + pub offset: providers_with_capacity::Offset, + pub limit: providers_with_capacity::Limit, + } + } + } + pub mod xcm_payment_api { + use super::root_mod; + use super::runtime_types; + #[doc = " A trait of XCM payment API."] + #[doc = ""] + #[doc = " API provides functionality for obtaining:"] + #[doc = ""] + #[doc = " * the weight required to execute an XCM message,"] + #[doc = " * a list of acceptable `AssetId`s for message execution payment,"] + #[doc = " * the cost of the weight in the specified acceptable `AssetId`."] + #[doc = " * the fees for an XCM message delivery."] + #[doc = ""] + #[doc = " To determine the execution weight of the calls required for"] + #[doc = " [`xcm::latest::Instruction::Transact`] instruction, `TransactionPaymentCallApi` can be used."] + pub struct XcmPaymentApi; + impl XcmPaymentApi { + #[doc = " Returns a list of acceptable payment assets."] + #[doc = ""] + #[doc = " # Arguments"] + #[doc = ""] + #[doc = " * `xcm_version`: Version."] + pub fn query_acceptable_payment_assets( + &self, + xcm_version: types::query_acceptable_payment_assets::XcmVersion, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::QueryAcceptablePaymentAssets, + types::query_acceptable_payment_assets::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "XcmPaymentApi", + "query_acceptable_payment_assets", + types::QueryAcceptablePaymentAssets { xcm_version }, + [ + 29u8, 81u8, 159u8, 80u8, 29u8, 95u8, 91u8, 180u8, 135u8, 23u8, 106u8, + 224u8, 21u8, 102u8, 89u8, 89u8, 23u8, 72u8, 125u8, 136u8, 144u8, 136u8, + 96u8, 224u8, 207u8, 197u8, 111u8, 238u8, 3u8, 46u8, 162u8, 78u8, + ], + ) + } + #[doc = " Returns a weight needed to execute a XCM."] + #[doc = ""] + #[doc = " # Arguments"] + #[doc = ""] + #[doc = " * `message`: `VersionedXcm`."] + pub fn query_xcm_weight( + &self, + message: types::query_xcm_weight::Message, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::QueryXcmWeight, + types::query_xcm_weight::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "XcmPaymentApi", + "query_xcm_weight", + types::QueryXcmWeight { message }, + [ + 210u8, 246u8, 6u8, 74u8, 134u8, 215u8, 196u8, 176u8, 38u8, 218u8, + 239u8, 142u8, 11u8, 235u8, 204u8, 218u8, 123u8, 66u8, 106u8, 60u8, + 110u8, 100u8, 28u8, 124u8, 48u8, 26u8, 115u8, 68u8, 86u8, 117u8, 10u8, + 73u8, + ], + ) + } + #[doc = " Converts a weight into a fee for the specified `AssetId`."] + #[doc = ""] + #[doc = " # Arguments"] + #[doc = ""] + #[doc = " * `weight`: convertible `Weight`."] + #[doc = " * `asset`: `VersionedAssetId`."] + pub fn query_weight_to_asset_fee( + &self, + weight: types::query_weight_to_asset_fee::Weight, + asset: types::query_weight_to_asset_fee::Asset, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::QueryWeightToAssetFee, + types::query_weight_to_asset_fee::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "XcmPaymentApi", + "query_weight_to_asset_fee", + types::QueryWeightToAssetFee { weight, asset }, + [ + 170u8, 180u8, 252u8, 70u8, 130u8, 183u8, 254u8, 104u8, 112u8, 235u8, + 227u8, 117u8, 29u8, 40u8, 30u8, 158u8, 149u8, 222u8, 126u8, 30u8, 2u8, + 107u8, 177u8, 35u8, 13u8, 203u8, 148u8, 83u8, 83u8, 74u8, 242u8, 210u8, + ], + ) + } + #[doc = " Query delivery fees V2."] + #[doc = ""] + #[doc = " Get delivery fees for sending a specific `message` to a `destination`."] + #[doc = " These always come in a specific asset, defined by the chain."] + #[doc = ""] + #[doc = " # Arguments"] + #[doc = " * `message`: The message that'll be sent, necessary because most delivery fees are based on the"] + #[doc = " size of the message."] + #[doc = " * `destination`: The destination to send the message to. Different destinations may use"] + #[doc = " different senders that charge different fees."] + pub fn query_delivery_fees( + &self, + destination: types::query_delivery_fees::Destination, + message: types::query_delivery_fees::Message, + asset_id: types::query_delivery_fees::AssetId, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::QueryDeliveryFees, + types::query_delivery_fees::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "XcmPaymentApi", + "query_delivery_fees", + types::QueryDeliveryFees { + destination, + message, + asset_id, + }, + [ + 94u8, 168u8, 171u8, 19u8, 250u8, 154u8, 56u8, 169u8, 174u8, 135u8, + 250u8, 84u8, 205u8, 92u8, 11u8, 209u8, 43u8, 253u8, 66u8, 153u8, 164u8, + 21u8, 251u8, 117u8, 67u8, 129u8, 167u8, 65u8, 50u8, 87u8, 249u8, 52u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod query_acceptable_payment_assets { + use super::runtime_types; + pub type XcmVersion = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::subxt_core::alloc::vec::Vec, + runtime_types::xcm_runtime_apis::fees::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryAcceptablePaymentAssets { + pub xcm_version: query_acceptable_payment_assets::XcmVersion, + } + pub mod query_xcm_weight { + use super::runtime_types; + pub type Message = runtime_types::xcm::VersionedXcm; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + runtime_types::sp_weights::weight_v2::Weight, + runtime_types::xcm_runtime_apis::fees::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryXcmWeight { + pub message: query_xcm_weight::Message, + } + pub mod query_weight_to_asset_fee { + use super::runtime_types; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; + pub type Asset = runtime_types::xcm::VersionedAssetId; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::core::primitive::u128, + runtime_types::xcm_runtime_apis::fees::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryWeightToAssetFee { + pub weight: query_weight_to_asset_fee::Weight, + pub asset: query_weight_to_asset_fee::Asset, + } + pub mod query_delivery_fees { + use super::runtime_types; + pub type Destination = runtime_types::xcm::VersionedLocation; + pub type Message = runtime_types::xcm::VersionedXcm; + pub type AssetId = runtime_types::xcm::VersionedAssetId; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + runtime_types::xcm::VersionedAssets, + runtime_types::xcm_runtime_apis::fees::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryDeliveryFees { + pub destination: query_delivery_fees::Destination, + pub message: query_delivery_fees::Message, + pub asset_id: query_delivery_fees::AssetId, + } + } + } + pub mod dry_run_api { + use super::root_mod; + use super::runtime_types; + #[doc = " API for dry-running extrinsics and XCM programs to get the programs that need to be passed to the fees API."] + #[doc = ""] + #[doc = " All calls return a vector of tuples (location, xcm) where each \"xcm\" is executed in \"location\"."] + #[doc = " If there's local execution, the location will be \"Here\"."] + #[doc = " This vector can be used to calculate both execution and delivery fees."] + #[doc = ""] + #[doc = " Calls or XCMs might fail when executed, this doesn't mean the result of these calls will be an `Err`."] + #[doc = " In those cases, there might still be a valid result, with the execution error inside it."] + #[doc = " The only reasons why these calls might return an error are listed in the [`Error`] enum."] + pub struct DryRunApi; + impl DryRunApi { + #[doc = " Dry run call V2."] + pub fn dry_run_call( + &self, + origin: types::dry_run_call::Origin, + call: types::dry_run_call::Call, + result_xcms_version: types::dry_run_call::ResultXcmsVersion, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::DryRunCall, + types::dry_run_call::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "DryRunApi", + "dry_run_call", + types::DryRunCall { + origin, + call, + result_xcms_version, + }, + [ + 246u8, 144u8, 31u8, 59u8, 168u8, 201u8, 183u8, 35u8, 156u8, 156u8, + 137u8, 127u8, 181u8, 89u8, 232u8, 249u8, 54u8, 30u8, 159u8, 34u8, + 195u8, 80u8, 66u8, 191u8, 54u8, 30u8, 249u8, 161u8, 74u8, 85u8, 135u8, + 169u8, + ], + ) + } + #[doc = " Dry run XCM program"] + pub fn dry_run_xcm( + &self, + origin_location: types::dry_run_xcm::OriginLocation, + xcm: types::dry_run_xcm::Xcm, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::DryRunXcm, + types::dry_run_xcm::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "DryRunApi", + "dry_run_xcm", + types::DryRunXcm { + origin_location, + xcm, + }, + [ + 27u8, 184u8, 255u8, 67u8, 207u8, 149u8, 14u8, 64u8, 9u8, 89u8, 109u8, + 255u8, 60u8, 219u8, 0u8, 154u8, 220u8, 4u8, 48u8, 110u8, 163u8, 219u8, + 1u8, 2u8, 164u8, 17u8, 187u8, 103u8, 36u8, 200u8, 99u8, 183u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod dry_run_call { + use super::runtime_types; + pub type Origin = runtime_types::storage_paseo_runtime::OriginCaller; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + pub type ResultXcmsVersion = ::core::primitive::u32; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + runtime_types::xcm_runtime_apis::dry_run::CallDryRunEffects< + runtime_types::storage_paseo_runtime::RuntimeEvent, + >, + runtime_types::xcm_runtime_apis::dry_run::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DryRunCall { + pub origin: dry_run_call::Origin, + pub call: dry_run_call::Call, + pub result_xcms_version: dry_run_call::ResultXcmsVersion, + } + pub mod dry_run_xcm { + use super::runtime_types; + pub type OriginLocation = runtime_types::xcm::VersionedLocation; + pub type Xcm = runtime_types::xcm::VersionedXcm; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + runtime_types::xcm_runtime_apis::dry_run::XcmDryRunEffects< + runtime_types::storage_paseo_runtime::RuntimeEvent, + >, + runtime_types::xcm_runtime_apis::dry_run::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DryRunXcm { + pub origin_location: dry_run_xcm::OriginLocation, + pub xcm: dry_run_xcm::Xcm, + } + } + } + pub mod location_to_account_api { + use super::root_mod; + use super::runtime_types; + #[doc = " API for useful conversions between XCM `Location` and `AccountId`."] + pub struct LocationToAccountApi; + impl LocationToAccountApi { + #[doc = " Converts `Location` to `AccountId`."] + pub fn convert_location( + &self, + location: types::convert_location::Location, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::ConvertLocation, + types::convert_location::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "LocationToAccountApi", + "convert_location", + types::ConvertLocation { location }, + [ + 179u8, 162u8, 1u8, 26u8, 111u8, 211u8, 90u8, 95u8, 137u8, 123u8, 87u8, + 117u8, 40u8, 105u8, 246u8, 228u8, 103u8, 128u8, 236u8, 197u8, 187u8, + 234u8, 126u8, 122u8, 89u8, 135u8, 132u8, 148u8, 136u8, 31u8, 129u8, + 230u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod convert_location { + use super::runtime_types; + pub type Location = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::subxt_core::utils::AccountId32, + runtime_types::xcm_runtime_apis::conversions::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ConvertLocation { + pub location: convert_location::Location, + } + } + } + pub mod trusted_query_api { + use super::root_mod; + use super::runtime_types; + #[doc = " API for querying trusted reserves and trusted teleporters."] + pub struct TrustedQueryApi; + impl TrustedQueryApi { + #[doc = " Returns if the location is a trusted reserve for the asset."] + #[doc = ""] + #[doc = " # Arguments"] + #[doc = " * `asset`: `VersionedAsset`."] + #[doc = " * `location`: `VersionedLocation`."] + pub fn is_trusted_reserve( + &self, + asset: types::is_trusted_reserve::Asset, + location: types::is_trusted_reserve::Location, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::IsTrustedReserve, + types::is_trusted_reserve::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "TrustedQueryApi", + "is_trusted_reserve", + types::IsTrustedReserve { asset, location }, + [ + 45u8, 87u8, 28u8, 66u8, 50u8, 121u8, 129u8, 188u8, 160u8, 192u8, 14u8, + 205u8, 141u8, 223u8, 5u8, 125u8, 82u8, 180u8, 231u8, 162u8, 134u8, + 98u8, 62u8, 104u8, 243u8, 184u8, 47u8, 49u8, 139u8, 206u8, 2u8, 86u8, + ], + ) + } + #[doc = " Returns if the asset can be teleported to the location."] + #[doc = ""] + #[doc = " # Arguments"] + #[doc = " * `asset`: `VersionedAsset`."] + #[doc = " * `location`: `VersionedLocation`."] + pub fn is_trusted_teleporter( + &self, + asset: types::is_trusted_teleporter::Asset, + location: types::is_trusted_teleporter::Location, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::IsTrustedTeleporter, + types::is_trusted_teleporter::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "TrustedQueryApi", + "is_trusted_teleporter", + types::IsTrustedTeleporter { asset, location }, + [ + 1u8, 161u8, 124u8, 10u8, 170u8, 140u8, 226u8, 50u8, 114u8, 90u8, 61u8, + 123u8, 58u8, 135u8, 75u8, 38u8, 140u8, 55u8, 177u8, 33u8, 38u8, 89u8, + 147u8, 54u8, 44u8, 56u8, 234u8, 193u8, 234u8, 206u8, 139u8, 84u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod is_trusted_reserve { + use super::runtime_types; + pub type Asset = runtime_types::xcm::VersionedAsset; + pub type Location = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::core::primitive::bool, + runtime_types::xcm_runtime_apis::trusted_query::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct IsTrustedReserve { + pub asset: is_trusted_reserve::Asset, + pub location: is_trusted_reserve::Location, + } + pub mod is_trusted_teleporter { + use super::runtime_types; + pub type Asset = runtime_types::xcm::VersionedAsset; + pub type Location = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::core::primitive::bool, + runtime_types::xcm_runtime_apis::trusted_query::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct IsTrustedTeleporter { + pub asset: is_trusted_teleporter::Asset, + pub location: is_trusted_teleporter::Location, + } + } + } + pub mod authorized_aliasers_api { + use super::root_mod; + use super::runtime_types; + #[doc = " API for querying XCM authorized aliases"] + pub struct AuthorizedAliasersApi; + impl AuthorizedAliasersApi { + #[doc = " Returns locations allowed to alias into and act as `target`."] + pub fn authorized_aliasers( + &self, + target: types::authorized_aliasers::Target, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::AuthorizedAliasers, + types::authorized_aliasers::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "AuthorizedAliasersApi", + "authorized_aliasers", + types::AuthorizedAliasers { target }, + [ + 113u8, 103u8, 58u8, 103u8, 69u8, 89u8, 203u8, 49u8, 6u8, 102u8, 88u8, + 133u8, 150u8, 212u8, 127u8, 110u8, 119u8, 77u8, 118u8, 153u8, 146u8, + 10u8, 159u8, 113u8, 210u8, 230u8, 135u8, 13u8, 24u8, 93u8, 162u8, 55u8, + ], + ) + } + #[doc = " Returns whether `origin` is allowed to alias into and act as `target`."] + pub fn is_authorized_alias( + &self, + origin: types::is_authorized_alias::Origin, + target: types::is_authorized_alias::Target, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::IsAuthorizedAlias, + types::is_authorized_alias::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "AuthorizedAliasersApi", + "is_authorized_alias", + types::IsAuthorizedAlias { origin, target }, + [ + 255u8, 28u8, 69u8, 187u8, 1u8, 99u8, 189u8, 87u8, 174u8, 245u8, 160u8, + 127u8, 27u8, 250u8, 215u8, 120u8, 29u8, 255u8, 94u8, 245u8, 236u8, + 194u8, 156u8, 114u8, 9u8, 32u8, 71u8, 140u8, 121u8, 73u8, 177u8, 75u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod authorized_aliasers { + use super::runtime_types; + pub type Target = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::subxt_core::alloc::vec::Vec< + runtime_types::xcm_runtime_apis::authorized_aliases::OriginAliaser, + >, + runtime_types::xcm_runtime_apis::authorized_aliases::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AuthorizedAliasers { + pub target: authorized_aliasers::Target, + } + pub mod is_authorized_alias { + use super::runtime_types; + pub type Origin = runtime_types::xcm::VersionedLocation; + pub type Target = runtime_types::xcm::VersionedLocation; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::core::primitive::bool, + runtime_types::xcm_runtime_apis::authorized_aliases::Error, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct IsAuthorizedAlias { + pub origin: is_authorized_alias::Origin, + pub target: is_authorized_alias::Target, + } + } + } + pub mod revive_api { + use super::root_mod; + use super::runtime_types; + #[doc = " The API used to dry-run contract interactions."] + pub struct ReviveApi; + impl ReviveApi { + #[doc = " Returns the current ETH block."] + #[doc = ""] + #[doc = " This is one block behind the substrate block."] + pub fn eth_block( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::EthBlock, + types::eth_block::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "eth_block", + types::EthBlock {}, + [ + 188u8, 199u8, 155u8, 90u8, 252u8, 234u8, 162u8, 36u8, 208u8, 229u8, + 204u8, 202u8, 62u8, 90u8, 231u8, 135u8, 147u8, 15u8, 126u8, 9u8, 89u8, + 84u8, 18u8, 107u8, 2u8, 54u8, 242u8, 248u8, 245u8, 125u8, 27u8, 175u8, + ], + ) + } + #[doc = " Returns the ETH block hash for the given block number."] + pub fn eth_block_hash( + &self, + number: types::eth_block_hash::Number, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::EthBlockHash, + types::eth_block_hash::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "eth_block_hash", + types::EthBlockHash { number }, + [ + 59u8, 64u8, 164u8, 34u8, 94u8, 40u8, 254u8, 113u8, 67u8, 217u8, 85u8, + 250u8, 46u8, 172u8, 162u8, 35u8, 89u8, 102u8, 160u8, 9u8, 199u8, 10u8, + 186u8, 26u8, 67u8, 199u8, 247u8, 174u8, 59u8, 239u8, 118u8, 184u8, + ], + ) + } + #[doc = " The details needed to reconstruct the receipt information offchain."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " Each entry corresponds to the appropriate Ethereum transaction in the current block."] + pub fn eth_receipt_data( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::EthReceiptData, + types::eth_receipt_data::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "eth_receipt_data", + types::EthReceiptData {}, + [ + 27u8, 52u8, 173u8, 217u8, 36u8, 69u8, 25u8, 135u8, 119u8, 124u8, 15u8, + 206u8, 145u8, 168u8, 93u8, 187u8, 109u8, 106u8, 134u8, 183u8, 99u8, + 81u8, 83u8, 200u8, 34u8, 186u8, 40u8, 149u8, 30u8, 41u8, 61u8, 203u8, + ], + ) + } + #[doc = " Returns the block gas limit."] + pub fn block_gas_limit( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::BlockGasLimit, + types::block_gas_limit::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "block_gas_limit", + types::BlockGasLimit {}, + [ + 0u8, 11u8, 121u8, 191u8, 144u8, 234u8, 56u8, 185u8, 34u8, 39u8, 242u8, + 147u8, 4u8, 253u8, 71u8, 105u8, 133u8, 206u8, 91u8, 55u8, 126u8, 76u8, + 157u8, 102u8, 132u8, 95u8, 131u8, 129u8, 23u8, 114u8, 98u8, 63u8, + ], + ) + } + #[doc = " Returns the free balance of the given `[H160]` address, using EVM decimals."] + pub fn balance( + &self, + address: types::balance::Address, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Balance, + types::balance::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "balance", + types::Balance { address }, + [ + 217u8, 187u8, 169u8, 218u8, 169u8, 108u8, 220u8, 41u8, 105u8, 22u8, + 137u8, 204u8, 210u8, 172u8, 79u8, 100u8, 75u8, 128u8, 105u8, 126u8, + 143u8, 126u8, 6u8, 98u8, 182u8, 142u8, 231u8, 13u8, 1u8, 21u8, 125u8, + 199u8, + ], + ) + } + #[doc = " Returns the gas price."] + pub fn gas_price( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::GasPrice, + types::gas_price::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "gas_price", + types::GasPrice {}, + [ + 192u8, 101u8, 215u8, 25u8, 224u8, 227u8, 185u8, 56u8, 211u8, 63u8, + 240u8, 94u8, 56u8, 77u8, 224u8, 155u8, 211u8, 24u8, 246u8, 136u8, + 186u8, 136u8, 59u8, 123u8, 143u8, 177u8, 169u8, 74u8, 77u8, 125u8, + 137u8, 146u8, + ], + ) + } + #[doc = " Returns the nonce of the given `[H160]` address."] + pub fn nonce( + &self, + address: types::nonce::Address, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Nonce, + types::nonce::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "nonce", + types::Nonce { address }, + [ + 166u8, 246u8, 168u8, 246u8, 58u8, 222u8, 243u8, 98u8, 121u8, 109u8, + 16u8, 240u8, 243u8, 184u8, 8u8, 124u8, 223u8, 187u8, 39u8, 184u8, + 241u8, 6u8, 57u8, 182u8, 240u8, 80u8, 79u8, 224u8, 112u8, 186u8, 85u8, + 80u8, + ], + ) + } + #[doc = " Perform a call from a specified account to a given contract."] + #[doc = ""] + #[doc = " See [`crate::Pallet::bare_call`]."] + pub fn call( + &self, + origin: types::call::Origin, + dest: types::call::Dest, + value: types::call::Value, + gas_limit: types::call::GasLimit, + storage_deposit_limit: types::call::StorageDepositLimit, + input_data: types::call::InputData, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Call, + types::call::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "call", + types::Call { + origin, + dest, + value, + gas_limit, + storage_deposit_limit, + input_data, + }, + [ + 226u8, 52u8, 27u8, 112u8, 81u8, 168u8, 120u8, 216u8, 130u8, 189u8, + 170u8, 183u8, 164u8, 65u8, 117u8, 156u8, 254u8, 1u8, 247u8, 202u8, + 129u8, 224u8, 6u8, 0u8, 217u8, 168u8, 77u8, 42u8, 136u8, 203u8, 56u8, + 89u8, + ], + ) + } + #[doc = " Instantiate a new contract."] + #[doc = ""] + #[doc = " See `[crate::Pallet::bare_instantiate]`."] + pub fn instantiate( + &self, + origin: types::instantiate::Origin, + value: types::instantiate::Value, + gas_limit: types::instantiate::GasLimit, + storage_deposit_limit: types::instantiate::StorageDepositLimit, + code: types::instantiate::Code, + data: types::instantiate::Data, + salt: types::instantiate::Salt, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Instantiate, + types::instantiate::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "instantiate", + types::Instantiate { + origin, + value, + gas_limit, + storage_deposit_limit, + code, + data, + salt, + }, + [ + 142u8, 16u8, 130u8, 213u8, 231u8, 246u8, 132u8, 51u8, 5u8, 21u8, 73u8, + 187u8, 157u8, 89u8, 15u8, 126u8, 168u8, 206u8, 69u8, 153u8, 88u8, 35u8, + 94u8, 81u8, 151u8, 184u8, 3u8, 107u8, 159u8, 73u8, 61u8, 167u8, + ], + ) + } + #[doc = " Perform an Ethereum call."] + #[doc = ""] + #[doc = " Deprecated use `v2` version instead."] + #[doc = " See [`crate::Pallet::dry_run_eth_transact`]"] + pub fn eth_transact( + &self, + tx: types::eth_transact::Tx, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::EthTransact, + types::eth_transact::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "eth_transact", + types::EthTransact { tx }, + [ + 216u8, 32u8, 233u8, 194u8, 104u8, 250u8, 45u8, 147u8, 79u8, 250u8, + 214u8, 84u8, 186u8, 13u8, 55u8, 25u8, 99u8, 45u8, 10u8, 64u8, 134u8, + 207u8, 118u8, 9u8, 7u8, 76u8, 189u8, 188u8, 136u8, 208u8, 183u8, 183u8, + ], + ) + } + #[doc = " Perform an Ethereum call."] + #[doc = ""] + #[doc = " See [`crate::Pallet::dry_run_eth_transact`]"] + pub fn eth_transact_with_config( + &self, + tx: types::eth_transact_with_config::Tx, + config: types::eth_transact_with_config::Config, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::EthTransactWithConfig, + types::eth_transact_with_config::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "eth_transact_with_config", + types::EthTransactWithConfig { tx, config }, + [ + 123u8, 155u8, 163u8, 24u8, 249u8, 148u8, 255u8, 246u8, 31u8, 93u8, + 139u8, 161u8, 45u8, 5u8, 31u8, 27u8, 222u8, 80u8, 0u8, 27u8, 153u8, + 94u8, 38u8, 232u8, 247u8, 64u8, 109u8, 161u8, 167u8, 111u8, 162u8, + 153u8, + ], + ) + } + #[doc = " Upload new code without instantiating a contract from it."] + #[doc = ""] + #[doc = " See [`crate::Pallet::bare_upload_code`]."] + pub fn upload_code( + &self, + origin: types::upload_code::Origin, + code: types::upload_code::Code, + storage_deposit_limit: types::upload_code::StorageDepositLimit, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::UploadCode, + types::upload_code::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "upload_code", + types::UploadCode { + origin, + code, + storage_deposit_limit, + }, + [ + 197u8, 181u8, 209u8, 147u8, 118u8, 181u8, 30u8, 199u8, 193u8, 46u8, + 58u8, 243u8, 34u8, 66u8, 243u8, 61u8, 92u8, 253u8, 24u8, 195u8, 170u8, + 17u8, 65u8, 252u8, 163u8, 41u8, 235u8, 161u8, 201u8, 94u8, 83u8, 147u8, + ], + ) + } + #[doc = " Query a given storage key in a given contract."] + #[doc = ""] + #[doc = " Returns `Ok(Some(Vec))` if the storage value exists under the given key in the"] + #[doc = " specified account and `Ok(None)` if it doesn't. If the account specified by the address"] + #[doc = " doesn't exist, or doesn't have a contract then `Err` is returned."] + pub fn get_storage( + &self, + address: types::get_storage::Address, + key: types::get_storage::Key, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::GetStorage, + types::get_storage::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "get_storage", + types::GetStorage { address, key }, + [ + 10u8, 60u8, 170u8, 36u8, 56u8, 99u8, 85u8, 101u8, 176u8, 169u8, 231u8, + 205u8, 243u8, 5u8, 220u8, 251u8, 208u8, 140u8, 116u8, 87u8, 253u8, + 187u8, 152u8, 166u8, 11u8, 234u8, 20u8, 121u8, 182u8, 45u8, 117u8, + 199u8, + ], + ) + } + #[doc = " Query a given variable-sized storage key in a given contract."] + #[doc = ""] + #[doc = " Returns `Ok(Some(Vec))` if the storage value exists under the given key in the"] + #[doc = " specified account and `Ok(None)` if it doesn't. If the account specified by the address"] + #[doc = " doesn't exist, or doesn't have a contract then `Err` is returned."] + pub fn get_storage_var_key( + &self, + address: types::get_storage_var_key::Address, + key: types::get_storage_var_key::Key, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::GetStorageVarKey, + types::get_storage_var_key::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "get_storage_var_key", + types::GetStorageVarKey { address, key }, + [ + 207u8, 177u8, 64u8, 3u8, 134u8, 129u8, 48u8, 119u8, 88u8, 234u8, 69u8, + 82u8, 48u8, 96u8, 16u8, 65u8, 62u8, 13u8, 40u8, 243u8, 62u8, 47u8, + 66u8, 80u8, 104u8, 92u8, 13u8, 227u8, 133u8, 188u8, 156u8, 175u8, + ], + ) + } + #[doc = " Traces the execution of an entire block and returns call traces."] + #[doc = ""] + #[doc = " This is intended to be called through `state_call` to replay the block from the"] + #[doc = " parent block."] + #[doc = ""] + #[doc = " See eth-rpc `debug_traceBlockByNumber` for usage."] + pub fn trace_block( + &self, + block: types::trace_block::Block, + config: types::trace_block::Config, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::TraceBlock, + types::trace_block::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "trace_block", + types::TraceBlock { block, config }, + [ + 151u8, 114u8, 192u8, 251u8, 126u8, 140u8, 39u8, 80u8, 85u8, 88u8, + 254u8, 82u8, 212u8, 92u8, 27u8, 10u8, 92u8, 165u8, 186u8, 62u8, 91u8, + 226u8, 239u8, 108u8, 40u8, 243u8, 53u8, 168u8, 82u8, 130u8, 89u8, + 201u8, + ], + ) + } + #[doc = " Traces the execution of a specific transaction within a block."] + #[doc = ""] + #[doc = " This is intended to be called through `state_call` to replay the block from the"] + #[doc = " parent hash up to the transaction."] + #[doc = ""] + #[doc = " See eth-rpc `debug_traceTransaction` for usage."] + pub fn trace_tx( + &self, + block: types::trace_tx::Block, + tx_index: types::trace_tx::TxIndex, + config: types::trace_tx::Config, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::TraceTx, + types::trace_tx::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "trace_tx", + types::TraceTx { + block, + tx_index, + config, + }, + [ + 240u8, 209u8, 116u8, 149u8, 99u8, 16u8, 102u8, 102u8, 204u8, 151u8, + 142u8, 124u8, 110u8, 118u8, 94u8, 101u8, 100u8, 95u8, 158u8, 174u8, + 231u8, 135u8, 64u8, 77u8, 25u8, 223u8, 180u8, 118u8, 230u8, 49u8, 99u8, + 237u8, + ], + ) + } + #[doc = " Dry run and return the trace of the given call."] + #[doc = ""] + #[doc = " See eth-rpc `debug_traceCall` for usage."] + pub fn trace_call( + &self, + tx: types::trace_call::Tx, + config: types::trace_call::Config, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::TraceCall, + types::trace_call::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "trace_call", + types::TraceCall { tx, config }, + [ + 241u8, 57u8, 157u8, 180u8, 25u8, 8u8, 238u8, 160u8, 179u8, 246u8, 40u8, + 18u8, 127u8, 197u8, 135u8, 72u8, 94u8, 149u8, 4u8, 176u8, 188u8, 128u8, + 203u8, 87u8, 182u8, 57u8, 123u8, 102u8, 226u8, 64u8, 227u8, 24u8, + ], + ) + } + #[doc = " The address of the validator that produced the current block."] + pub fn block_author( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::BlockAuthor, + types::block_author::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "block_author", + types::BlockAuthor {}, + [ + 167u8, 170u8, 75u8, 59u8, 115u8, 192u8, 26u8, 96u8, 25u8, 254u8, 80u8, + 55u8, 206u8, 151u8, 207u8, 70u8, 83u8, 19u8, 1u8, 173u8, 115u8, 196u8, + 106u8, 139u8, 8u8, 124u8, 173u8, 170u8, 227u8, 154u8, 31u8, 24u8, + ], + ) + } + #[doc = " Get the H160 address associated to this account id"] + pub fn address( + &self, + account_id: types::address::AccountId, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Address, + types::address::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "address", + types::Address { account_id }, + [ + 255u8, 91u8, 186u8, 46u8, 72u8, 136u8, 40u8, 17u8, 88u8, 238u8, 13u8, + 55u8, 93u8, 217u8, 216u8, 181u8, 161u8, 186u8, 79u8, 255u8, 145u8, + 211u8, 193u8, 238u8, 4u8, 19u8, 103u8, 226u8, 86u8, 221u8, 53u8, 217u8, + ], + ) + } + #[doc = " Get the account id associated to this H160 address."] + pub fn account_id( + &self, + address: types::account_id::Address, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::AccountId, + types::account_id::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "account_id", + types::AccountId { address }, + [ + 20u8, 247u8, 117u8, 139u8, 43u8, 90u8, 174u8, 97u8, 51u8, 143u8, 16u8, + 128u8, 4u8, 251u8, 28u8, 64u8, 32u8, 105u8, 38u8, 226u8, 40u8, 64u8, + 186u8, 209u8, 167u8, 168u8, 78u8, 21u8, 213u8, 200u8, 111u8, 80u8, + ], + ) + } + #[doc = " The address used to call the runtime's pallets dispatchables"] + pub fn runtime_pallets_address( + &self, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::RuntimePalletsAddress, + types::runtime_pallets_address::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "runtime_pallets_address", + types::RuntimePalletsAddress {}, + [ + 185u8, 206u8, 171u8, 98u8, 21u8, 200u8, 9u8, 174u8, 58u8, 252u8, 226u8, + 41u8, 248u8, 49u8, 178u8, 229u8, 158u8, 71u8, 112u8, 93u8, 20u8, 50u8, + 22u8, 105u8, 29u8, 125u8, 39u8, 22u8, 181u8, 177u8, 221u8, 203u8, + ], + ) + } + #[doc = " The code at the specified address taking pre-compiles into account."] + pub fn code( + &self, + address: types::code::Address, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::Code, + types::code::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "code", + types::Code { address }, + [ + 8u8, 165u8, 219u8, 12u8, 137u8, 182u8, 149u8, 207u8, 178u8, 2u8, 185u8, + 215u8, 102u8, 184u8, 57u8, 51u8, 96u8, 30u8, 240u8, 250u8, 145u8, 95u8, + 127u8, 149u8, 114u8, 213u8, 241u8, 171u8, 145u8, 180u8, 161u8, 208u8, + ], + ) + } + #[doc = " Construct the new balance and dust components of this EVM balance."] + pub fn new_balance_with_dust( + &self, + balance: types::new_balance_with_dust::Balance, + ) -> ::subxt_core::runtime_api::payload::StaticPayload< + types::NewBalanceWithDust, + types::new_balance_with_dust::output::Output, + > { + ::subxt_core::runtime_api::payload::StaticPayload::new_static( + "ReviveApi", + "new_balance_with_dust", + types::NewBalanceWithDust { balance }, + [ + 112u8, 37u8, 26u8, 78u8, 237u8, 161u8, 52u8, 63u8, 196u8, 34u8, 77u8, + 254u8, 77u8, 170u8, 109u8, 183u8, 188u8, 58u8, 47u8, 79u8, 109u8, 87u8, + 205u8, 130u8, 177u8, 163u8, 206u8, 38u8, 246u8, 40u8, 204u8, 55u8, + ], + ) + } + } + pub mod types { + use super::runtime_types; + pub mod eth_block { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = + runtime_types::pallet_revive::evm::api::rpc_types_gen::Block; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct EthBlock {} + pub mod eth_block_hash { + use super::runtime_types; + pub type Number = runtime_types::primitive_types::U256; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option<::subxt_core::utils::H256>; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct EthBlockHash { + pub number: eth_block_hash::Number, + } + pub mod eth_receipt_data { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_revive::evm::block_hash::ReceiptGasInfo, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct EthReceiptData {} + pub mod block_gas_limit { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::primitive_types::U256; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BlockGasLimit {} + pub mod balance { + use super::runtime_types; + pub type Address = ::subxt_core::utils::H160; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::primitive_types::U256; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Balance { + pub address: balance::Address, + } + pub mod gas_price { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::primitive_types::U256; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct GasPrice {} + pub mod nonce { + use super::runtime_types; + pub type Address = ::subxt_core::utils::H160; + pub mod output { + use super::runtime_types; + pub type Output = ::core::primitive::u32; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Nonce { + pub address: nonce::Address, + } + pub mod call { + use super::runtime_types; + pub type Origin = ::subxt_core::utils::AccountId32; + pub type Dest = ::subxt_core::utils::H160; + pub type Value = ::core::primitive::u128; + pub type GasLimit = + ::core::option::Option; + pub type StorageDepositLimit = ::core::option::Option<::core::primitive::u128>; + pub type InputData = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_revive::primitives::ContractResult< + runtime_types::pallet_revive::primitives::ExecReturnValue, + ::core::primitive::u128, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Call { + pub origin: call::Origin, + pub dest: call::Dest, + pub value: call::Value, + pub gas_limit: call::GasLimit, + pub storage_deposit_limit: call::StorageDepositLimit, + pub input_data: call::InputData, + } + pub mod instantiate { + use super::runtime_types; + pub type Origin = ::subxt_core::utils::AccountId32; + pub type Value = ::core::primitive::u128; + pub type GasLimit = + ::core::option::Option; + pub type StorageDepositLimit = ::core::option::Option<::core::primitive::u128>; + pub type Code = runtime_types::pallet_revive::primitives::Code; + pub type Data = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Salt = ::core::option::Option<[::core::primitive::u8; 32usize]>; + pub mod output { + use super::runtime_types; + pub type Output = runtime_types::pallet_revive::primitives::ContractResult< + runtime_types::pallet_revive::primitives::InstantiateReturnValue, + ::core::primitive::u128, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Instantiate { + pub origin: instantiate::Origin, + pub value: instantiate::Value, + pub gas_limit: instantiate::GasLimit, + pub storage_deposit_limit: instantiate::StorageDepositLimit, + pub code: instantiate::Code, + pub data: instantiate::Data, + pub salt: instantiate::Salt, + } + pub mod eth_transact { + use super::runtime_types; + pub type Tx = + runtime_types::pallet_revive::evm::api::rpc_types_gen::GenericTransaction; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + runtime_types::pallet_revive::primitives::EthTransactInfo< + ::core::primitive::u128, + >, + runtime_types::pallet_revive::primitives::EthTransactError, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct EthTransact { + pub tx: eth_transact::Tx, + } + pub mod eth_transact_with_config { + use super::runtime_types; + pub type Tx = + runtime_types::pallet_revive::evm::api::rpc_types_gen::GenericTransaction; + pub type Config = + runtime_types::pallet_revive::evm::api::rpc_types::DryRunConfig< + ::core::primitive::u64, + >; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + runtime_types::pallet_revive::primitives::EthTransactInfo< + ::core::primitive::u128, + >, + runtime_types::pallet_revive::primitives::EthTransactError, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct EthTransactWithConfig { + pub tx: eth_transact_with_config::Tx, + pub config: eth_transact_with_config::Config, + } + pub mod upload_code { + use super::runtime_types; + pub type Origin = ::subxt_core::utils::AccountId32; + pub type Code = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type StorageDepositLimit = ::core::option::Option<::core::primitive::u128>; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + runtime_types::pallet_revive::primitives::CodeUploadReturnValue< + ::core::primitive::u128, + >, + runtime_types::sp_runtime::DispatchError, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct UploadCode { + pub origin: upload_code::Origin, + pub code: upload_code::Code, + pub storage_deposit_limit: upload_code::StorageDepositLimit, + } + pub mod get_storage { + use super::runtime_types; + pub type Address = ::subxt_core::utils::H160; + pub type Key = [::core::primitive::u8; 32usize]; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::core::option::Option< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + runtime_types::pallet_revive::primitives::ContractAccessError, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct GetStorage { + pub address: get_storage::Address, + pub key: get_storage::Key, + } + pub mod get_storage_var_key { + use super::runtime_types; + pub type Address = ::subxt_core::utils::H160; + pub type Key = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + ::core::option::Option< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + runtime_types::pallet_revive::primitives::ContractAccessError, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct GetStorageVarKey { + pub address: get_storage_var_key::Address, + pub key: get_storage_var_key::Key, + } + pub mod trace_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_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > > ; + pub type Config = + runtime_types::pallet_revive::evm::api::debug_rpc_types::TracerType; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + runtime_types::pallet_revive::evm::api::debug_rpc_types::Trace, + )>; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct TraceBlock { + pub block: trace_block::Block, + pub config: trace_block::Config, + } + pub mod trace_tx { + 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_core :: utils :: UncheckedExtrinsic < :: subxt_core :: utils :: MultiAddress < :: subxt_core :: utils :: AccountId32 , () > , runtime_types :: storage_paseo_runtime :: RuntimeCall , runtime_types :: sp_runtime :: MultiSignature , runtime_types :: cumulus_pallet_weight_reclaim :: StorageWeightReclaim < (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 :: pallet_revive :: evm :: tx_extension :: SetOrigin ,) > > > ; + pub type TxIndex = ::core::primitive::u32; + pub type Config = + runtime_types::pallet_revive::evm::api::debug_rpc_types::TracerType; + pub mod output { + use super::runtime_types; + pub type Output = ::core::option::Option< + runtime_types::pallet_revive::evm::api::debug_rpc_types::Trace, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct TraceTx { + pub block: trace_tx::Block, + pub tx_index: trace_tx::TxIndex, + pub config: trace_tx::Config, + } + pub mod trace_call { + use super::runtime_types; + pub type Tx = + runtime_types::pallet_revive::evm::api::rpc_types_gen::GenericTransaction; + pub type Config = + runtime_types::pallet_revive::evm::api::debug_rpc_types::TracerType; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + runtime_types::pallet_revive::evm::api::debug_rpc_types::Trace, + runtime_types::pallet_revive::primitives::EthTransactError, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct TraceCall { + pub tx: trace_call::Tx, + pub config: trace_call::Config, + } + pub mod block_author { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::utils::H160; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BlockAuthor {} + pub mod address { + use super::runtime_types; + pub type AccountId = ::subxt_core::utils::AccountId32; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::utils::H160; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Address { + pub account_id: address::AccountId, + } + pub mod account_id { + use super::runtime_types; + pub type Address = ::subxt_core::utils::H160; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::utils::AccountId32; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AccountId { + pub address: account_id::Address, + } + pub mod runtime_pallets_address { + use super::runtime_types; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::utils::H160; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct RuntimePalletsAddress {} + pub mod code { + use super::runtime_types; + pub type Address = ::subxt_core::utils::H160; + pub mod output { + use super::runtime_types; + pub type Output = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Code { + pub address: code::Address, + } + pub mod new_balance_with_dust { + use super::runtime_types; + pub type Balance = runtime_types::primitive_types::U256; + pub mod output { + use super::runtime_types; + pub type Output = ::core::result::Result< + (::core::primitive::u128, ::core::primitive::u32), + runtime_types::pallet_revive::primitives::BalanceConversionError, + >; + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct NewBalanceWithDust { + pub balance: new_balance_with_dust::Balance, + } + } + } + } + pub fn view_functions() -> ViewFunctionsApi { + ViewFunctionsApi + } + pub fn custom() -> CustomValuesApi { + CustomValuesApi + } + pub struct CustomValuesApi; + impl CustomValuesApi {} + pub struct ConstantsApi; + impl ConstantsApi { + pub fn system(&self) -> system::constants::ConstantsApi { + system::constants::ConstantsApi + } + pub fn parachain_system(&self) -> parachain_system::constants::ConstantsApi { + parachain_system::constants::ConstantsApi + } + pub fn timestamp(&self) -> timestamp::constants::ConstantsApi { + timestamp::constants::ConstantsApi + } + pub fn balances(&self) -> balances::constants::ConstantsApi { + balances::constants::ConstantsApi + } + pub fn transaction_payment(&self) -> transaction_payment::constants::ConstantsApi { + transaction_payment::constants::ConstantsApi + } + pub fn collator_selection(&self) -> collator_selection::constants::ConstantsApi { + collator_selection::constants::ConstantsApi + } + pub fn session(&self) -> session::constants::ConstantsApi { + session::constants::ConstantsApi + } + pub fn aura(&self) -> aura::constants::ConstantsApi { + aura::constants::ConstantsApi + } + pub fn xcmp_queue(&self) -> xcmp_queue::constants::ConstantsApi { + xcmp_queue::constants::ConstantsApi + } + pub fn polkadot_xcm(&self) -> polkadot_xcm::constants::ConstantsApi { + polkadot_xcm::constants::ConstantsApi + } + pub fn message_queue(&self) -> message_queue::constants::ConstantsApi { + message_queue::constants::ConstantsApi + } + pub fn utility(&self) -> utility::constants::ConstantsApi { + utility::constants::ConstantsApi + } + pub fn storage_provider(&self) -> storage_provider::constants::ConstantsApi { + storage_provider::constants::ConstantsApi + } + pub fn drive_registry(&self) -> drive_registry::constants::ConstantsApi { + drive_registry::constants::ConstantsApi + } + pub fn s3_registry(&self) -> s3_registry::constants::ConstantsApi { + s3_registry::constants::ConstantsApi + } + pub fn revive(&self) -> revive::constants::ConstantsApi { + revive::constants::ConstantsApi + } + } + pub struct StorageApi; + impl StorageApi { + pub fn system(&self) -> system::storage::StorageApi { + system::storage::StorageApi + } + pub fn parachain_system(&self) -> parachain_system::storage::StorageApi { + parachain_system::storage::StorageApi + } + pub fn timestamp(&self) -> timestamp::storage::StorageApi { + timestamp::storage::StorageApi + } + pub fn parachain_info(&self) -> parachain_info::storage::StorageApi { + parachain_info::storage::StorageApi + } + pub fn balances(&self) -> balances::storage::StorageApi { + balances::storage::StorageApi + } + pub fn transaction_payment(&self) -> transaction_payment::storage::StorageApi { + transaction_payment::storage::StorageApi + } + pub fn sudo(&self) -> sudo::storage::StorageApi { + sudo::storage::StorageApi + } + pub fn authorship(&self) -> authorship::storage::StorageApi { + authorship::storage::StorageApi + } + pub fn collator_selection(&self) -> collator_selection::storage::StorageApi { + collator_selection::storage::StorageApi + } + pub fn session(&self) -> session::storage::StorageApi { + session::storage::StorageApi + } + pub fn aura(&self) -> aura::storage::StorageApi { + aura::storage::StorageApi + } + pub fn aura_ext(&self) -> aura_ext::storage::StorageApi { + aura_ext::storage::StorageApi + } + pub fn xcmp_queue(&self) -> xcmp_queue::storage::StorageApi { + xcmp_queue::storage::StorageApi + } + pub fn polkadot_xcm(&self) -> polkadot_xcm::storage::StorageApi { + polkadot_xcm::storage::StorageApi + } + pub fn message_queue(&self) -> message_queue::storage::StorageApi { + message_queue::storage::StorageApi + } + pub fn storage_provider(&self) -> storage_provider::storage::StorageApi { + storage_provider::storage::StorageApi + } + pub fn drive_registry(&self) -> drive_registry::storage::StorageApi { + drive_registry::storage::StorageApi + } + pub fn s3_registry(&self) -> s3_registry::storage::StorageApi { + s3_registry::storage::StorageApi + } + pub fn revive(&self) -> revive::storage::StorageApi { + revive::storage::StorageApi + } + } + pub struct TransactionApi; + impl TransactionApi { + pub fn system(&self) -> system::calls::TransactionApi { + system::calls::TransactionApi + } + pub fn parachain_system(&self) -> parachain_system::calls::TransactionApi { + parachain_system::calls::TransactionApi + } + pub fn timestamp(&self) -> timestamp::calls::TransactionApi { + timestamp::calls::TransactionApi + } + pub fn parachain_info(&self) -> parachain_info::calls::TransactionApi { + parachain_info::calls::TransactionApi + } + pub fn balances(&self) -> balances::calls::TransactionApi { + balances::calls::TransactionApi + } + pub fn sudo(&self) -> sudo::calls::TransactionApi { + sudo::calls::TransactionApi + } + pub fn collator_selection(&self) -> collator_selection::calls::TransactionApi { + collator_selection::calls::TransactionApi + } + pub fn session(&self) -> session::calls::TransactionApi { + session::calls::TransactionApi + } + pub fn xcmp_queue(&self) -> xcmp_queue::calls::TransactionApi { + xcmp_queue::calls::TransactionApi + } + pub fn polkadot_xcm(&self) -> polkadot_xcm::calls::TransactionApi { + polkadot_xcm::calls::TransactionApi + } + pub fn cumulus_xcm(&self) -> cumulus_xcm::calls::TransactionApi { + cumulus_xcm::calls::TransactionApi + } + pub fn message_queue(&self) -> message_queue::calls::TransactionApi { + message_queue::calls::TransactionApi + } + pub fn utility(&self) -> utility::calls::TransactionApi { + utility::calls::TransactionApi + } + pub fn storage_provider(&self) -> storage_provider::calls::TransactionApi { + storage_provider::calls::TransactionApi + } + pub fn drive_registry(&self) -> drive_registry::calls::TransactionApi { + drive_registry::calls::TransactionApi + } + pub fn s3_registry(&self) -> s3_registry::calls::TransactionApi { + s3_registry::calls::TransactionApi + } + pub fn revive(&self) -> revive::calls::TransactionApi { + revive::calls::TransactionApi + } + } + pub struct ViewFunctionsApi; + impl ViewFunctionsApi {} + #[doc = r" check whether the metadata provided is aligned with this statically generated code."] + pub fn is_codegen_valid_for(metadata: &::subxt_core::Metadata) -> bool { + let runtime_metadata_hash = metadata + .hasher() + .only_these_pallets(&PALLETS) + .only_these_runtime_apis(&RUNTIME_APIS) + .hash(); + runtime_metadata_hash + == [ + 119u8, 245u8, 108u8, 92u8, 5u8, 180u8, 32u8, 70u8, 31u8, 3u8, 203u8, 238u8, 205u8, + 53u8, 101u8, 61u8, 193u8, 220u8, 73u8, 142u8, 115u8, 107u8, 38u8, 123u8, 121u8, + 245u8, 69u8, 189u8, 15u8, 96u8, 247u8, 17u8, + ] + } + pub mod system { + use super::root_mod; + use super::runtime_types; + #[doc = "Error for the System pallet"] + pub type Error = runtime_types::frame_system::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::frame_system::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "Can be executed by every `origin`."] + pub struct Remark { + pub remark: remark::Remark, + } + pub mod remark { + use super::runtime_types; + pub type Remark = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for Remark { + const PALLET: &'static str = "System"; + const CALL: &'static str = "remark"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + pub struct SetHeapPages { + pub pages: set_heap_pages::Pages, + } + pub mod set_heap_pages { + use super::runtime_types; + pub type Pages = ::core::primitive::u64; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetHeapPages { + const PALLET: &'static str = "System"; + const CALL: &'static str = "set_heap_pages"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the new runtime code."] + pub struct SetCode { + pub code: set_code::Code, + } + pub mod set_code { + use super::runtime_types; + pub type Code = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetCode { + const PALLET: &'static str = "System"; + const CALL: &'static str = "set_code"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] + #[doc = "version!"] + pub struct SetCodeWithoutChecks { + pub code: set_code_without_checks::Code, + } + pub mod set_code_without_checks { + use super::runtime_types; + pub type Code = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetCodeWithoutChecks { + const PALLET: &'static str = "System"; + const CALL: &'static str = "set_code_without_checks"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set some items of storage."] + pub struct SetStorage { + pub items: set_storage::Items, + } + pub mod set_storage { + use super::runtime_types; + pub type Items = ::subxt_core::alloc::vec::Vec<( + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + )>; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetStorage { + const PALLET: &'static str = "System"; + const CALL: &'static str = "set_storage"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Kill some items from storage."] + pub struct KillStorage { + pub keys: kill_storage::Keys, + } + pub mod kill_storage { + use super::runtime_types; + pub type Keys = ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; + } + impl ::subxt_core::blocks::StaticExtrinsic for KillStorage { + const PALLET: &'static str = "System"; + const CALL: &'static str = "kill_storage"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + pub struct KillPrefix { + pub prefix: kill_prefix::Prefix, + pub subkeys: kill_prefix::Subkeys, + } + pub mod kill_prefix { + use super::runtime_types; + pub type Prefix = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Subkeys = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for KillPrefix { + const PALLET: &'static str = "System"; + const CALL: &'static str = "kill_prefix"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Make some on-chain remark and emit event."] + pub struct RemarkWithEvent { + pub remark: remark_with_event::Remark, + } + pub mod remark_with_event { + use super::runtime_types; + pub type Remark = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for RemarkWithEvent { + const PALLET: &'static str = "System"; + const CALL: &'static str = "remark_with_event"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "This call requires Root origin."] + pub struct AuthorizeUpgrade { + pub code_hash: authorize_upgrade::CodeHash, + } + pub mod authorize_upgrade { + use super::runtime_types; + pub type CodeHash = ::subxt_core::utils::H256; + } + impl ::subxt_core::blocks::StaticExtrinsic for AuthorizeUpgrade { + const PALLET: &'static str = "System"; + const CALL: &'static str = "authorize_upgrade"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] + #[doc = "example that the spec name remains the same and that the version number increases. Not"] + #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] + #[doc = ""] + #[doc = "This call requires Root origin."] + pub struct AuthorizeUpgradeWithoutChecks { + pub code_hash: authorize_upgrade_without_checks::CodeHash, + } + pub mod authorize_upgrade_without_checks { + use super::runtime_types; + pub type CodeHash = ::subxt_core::utils::H256; + } + impl ::subxt_core::blocks::StaticExtrinsic for AuthorizeUpgradeWithoutChecks { + const PALLET: &'static str = "System"; + const CALL: &'static str = "authorize_upgrade_without_checks"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] + #[doc = ""] + #[doc = "If the authorization required a version check, this call will ensure the spec name"] + #[doc = "remains unchanged and that the spec version has increased."] + #[doc = ""] + #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] + #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] + #[doc = ""] + #[doc = "All origins are allowed."] + pub struct ApplyAuthorizedUpgrade { + pub code: apply_authorized_upgrade::Code, + } + pub mod apply_authorized_upgrade { + use super::runtime_types; + pub type Code = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for ApplyAuthorizedUpgrade { + const PALLET: &'static str = "System"; + const CALL: &'static str = "apply_authorized_upgrade"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "Can be executed by every `origin`."] + pub fn remark( + &self, + remark: types::remark::Remark, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "remark", + types::Remark { remark }, + [ + 43u8, 126u8, 180u8, 174u8, 141u8, 48u8, 52u8, 125u8, 166u8, 212u8, + 216u8, 98u8, 100u8, 24u8, 132u8, 71u8, 101u8, 64u8, 246u8, 169u8, 33u8, + 250u8, 147u8, 208u8, 2u8, 40u8, 129u8, 209u8, 232u8, 207u8, 207u8, + 13u8, + ], + ) + } + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + pub fn set_heap_pages( + &self, + pages: types::set_heap_pages::Pages, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "set_heap_pages", + types::SetHeapPages { pages }, + [ + 188u8, 191u8, 99u8, 216u8, 219u8, 109u8, 141u8, 50u8, 78u8, 235u8, + 215u8, 242u8, 195u8, 24u8, 111u8, 76u8, 229u8, 64u8, 99u8, 225u8, + 134u8, 121u8, 81u8, 209u8, 127u8, 223u8, 98u8, 215u8, 150u8, 70u8, + 57u8, 147u8, + ], + ) + } + #[doc = "Set the new runtime code."] + pub fn set_code( + &self, + code: types::set_code::Code, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "set_code", + types::SetCode { code }, + [ + 233u8, 248u8, 88u8, 245u8, 28u8, 65u8, 25u8, 169u8, 35u8, 237u8, 19u8, + 203u8, 136u8, 160u8, 18u8, 3u8, 20u8, 197u8, 81u8, 169u8, 244u8, 188u8, + 27u8, 147u8, 147u8, 236u8, 65u8, 25u8, 3u8, 143u8, 182u8, 22u8, + ], + ) + } + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] + #[doc = "version!"] + pub fn set_code_without_checks( + &self, + code: types::set_code_without_checks::Code, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "set_code_without_checks", + types::SetCodeWithoutChecks { code }, + [ + 82u8, 212u8, 157u8, 44u8, 70u8, 0u8, 143u8, 15u8, 109u8, 109u8, 107u8, + 157u8, 141u8, 42u8, 169u8, 11u8, 15u8, 186u8, 252u8, 138u8, 10u8, + 147u8, 15u8, 178u8, 247u8, 229u8, 213u8, 98u8, 207u8, 231u8, 119u8, + 115u8, + ], + ) + } + #[doc = "Set some items of storage."] + pub fn set_storage( + &self, + items: types::set_storage::Items, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "set_storage", + types::SetStorage { items }, + [ + 141u8, 216u8, 52u8, 222u8, 223u8, 136u8, 123u8, 181u8, 19u8, 75u8, + 163u8, 102u8, 229u8, 189u8, 158u8, 142u8, 95u8, 235u8, 240u8, 49u8, + 150u8, 76u8, 78u8, 137u8, 126u8, 88u8, 183u8, 88u8, 231u8, 146u8, + 234u8, 43u8, + ], + ) + } + #[doc = "Kill some items from storage."] + pub fn kill_storage( + &self, + keys: types::kill_storage::Keys, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "kill_storage", + types::KillStorage { keys }, + [ + 73u8, 63u8, 196u8, 36u8, 144u8, 114u8, 34u8, 213u8, 108u8, 93u8, 209u8, + 234u8, 153u8, 185u8, 33u8, 91u8, 187u8, 195u8, 223u8, 130u8, 58u8, + 156u8, 63u8, 47u8, 228u8, 249u8, 216u8, 139u8, 143u8, 177u8, 41u8, + 35u8, + ], + ) + } + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + pub fn kill_prefix( + &self, + prefix: types::kill_prefix::Prefix, + subkeys: types::kill_prefix::Subkeys, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "kill_prefix", + types::KillPrefix { prefix, subkeys }, + [ + 184u8, 57u8, 139u8, 24u8, 208u8, 87u8, 108u8, 215u8, 198u8, 189u8, + 175u8, 242u8, 167u8, 215u8, 97u8, 63u8, 110u8, 166u8, 238u8, 98u8, + 67u8, 236u8, 111u8, 110u8, 234u8, 81u8, 102u8, 5u8, 182u8, 5u8, 214u8, + 85u8, + ], + ) + } + #[doc = "Make some on-chain remark and emit event."] + pub fn remark_with_event( + &self, + remark: types::remark_with_event::Remark, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "remark_with_event", + types::RemarkWithEvent { remark }, + [ + 120u8, 120u8, 153u8, 92u8, 184u8, 85u8, 34u8, 2u8, 174u8, 206u8, 105u8, + 228u8, 233u8, 130u8, 80u8, 246u8, 228u8, 59u8, 234u8, 240u8, 4u8, 49u8, + 147u8, 170u8, 115u8, 91u8, 149u8, 200u8, 228u8, 181u8, 8u8, 154u8, + ], + ) + } + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "This call requires Root origin."] + pub fn authorize_upgrade( + &self, + code_hash: types::authorize_upgrade::CodeHash, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "authorize_upgrade", + types::AuthorizeUpgrade { code_hash }, + [ + 4u8, 14u8, 76u8, 107u8, 209u8, 129u8, 9u8, 39u8, 193u8, 17u8, 84u8, + 254u8, 170u8, 214u8, 24u8, 155u8, 29u8, 184u8, 249u8, 241u8, 109u8, + 58u8, 145u8, 131u8, 109u8, 63u8, 38u8, 165u8, 107u8, 215u8, 217u8, + 172u8, + ], + ) + } + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] + #[doc = "example that the spec name remains the same and that the version number increases. Not"] + #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] + #[doc = ""] + #[doc = "This call requires Root origin."] + pub fn authorize_upgrade_without_checks( + &self, + code_hash: types::authorize_upgrade_without_checks::CodeHash, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "authorize_upgrade_without_checks", + types::AuthorizeUpgradeWithoutChecks { code_hash }, + [ + 126u8, 126u8, 55u8, 26u8, 47u8, 55u8, 66u8, 8u8, 167u8, 18u8, 29u8, + 136u8, 146u8, 14u8, 189u8, 117u8, 16u8, 227u8, 162u8, 61u8, 149u8, + 197u8, 104u8, 184u8, 185u8, 161u8, 99u8, 154u8, 80u8, 125u8, 181u8, + 233u8, + ], + ) + } + #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] + #[doc = ""] + #[doc = "If the authorization required a version check, this call will ensure the spec name"] + #[doc = "remains unchanged and that the spec version has increased."] + #[doc = ""] + #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] + #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] + #[doc = ""] + #[doc = "All origins are allowed."] + pub fn apply_authorized_upgrade( + &self, + code: types::apply_authorized_upgrade::Code, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "System", + "apply_authorized_upgrade", + types::ApplyAuthorizedUpgrade { code }, + [ + 232u8, 107u8, 127u8, 38u8, 230u8, 29u8, 97u8, 4u8, 160u8, 191u8, 222u8, + 156u8, 245u8, 102u8, 196u8, 141u8, 44u8, 163u8, 98u8, 68u8, 125u8, + 32u8, 124u8, 101u8, 108u8, 93u8, 211u8, 52u8, 0u8, 231u8, 33u8, 227u8, + ], + ) + } + } + } + #[doc = "Event for the System pallet."] + pub type Event = runtime_types::frame_system::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An extrinsic completed successfully."] + pub struct ExtrinsicSuccess { + pub dispatch_info: extrinsic_success::DispatchInfo, + } + pub mod extrinsic_success { + use super::runtime_types; + pub type DispatchInfo = runtime_types::frame_system::DispatchEventInfo; + } + impl ::subxt_core::events::StaticEvent for ExtrinsicSuccess { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "ExtrinsicSuccess"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An extrinsic failed."] + pub struct ExtrinsicFailed { + pub dispatch_error: extrinsic_failed::DispatchError, + pub dispatch_info: extrinsic_failed::DispatchInfo, + } + pub mod extrinsic_failed { + use super::runtime_types; + pub type DispatchError = runtime_types::sp_runtime::DispatchError; + pub type DispatchInfo = runtime_types::frame_system::DispatchEventInfo; + } + impl ::subxt_core::events::StaticEvent for ExtrinsicFailed { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "ExtrinsicFailed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "`:code` was updated."] + pub struct CodeUpdated; + impl ::subxt_core::events::StaticEvent for CodeUpdated { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "CodeUpdated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A new account was created."] + pub struct NewAccount { + pub account: new_account::Account, + } + pub mod new_account { + use super::runtime_types; + pub type Account = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for NewAccount { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "NewAccount"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An account was reaped."] + pub struct KilledAccount { + pub account: killed_account::Account, + } + pub mod killed_account { + use super::runtime_types; + pub type Account = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for KilledAccount { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "KilledAccount"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "On on-chain remark happened."] + pub struct Remarked { + pub sender: remarked::Sender, + pub hash: remarked::Hash, + } + pub mod remarked { + use super::runtime_types; + pub type Sender = ::subxt_core::utils::AccountId32; + pub type Hash = ::subxt_core::utils::H256; + } + impl ::subxt_core::events::StaticEvent for Remarked { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "Remarked"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An upgrade was authorized."] + pub struct UpgradeAuthorized { + pub code_hash: upgrade_authorized::CodeHash, + pub check_version: upgrade_authorized::CheckVersion, + } + pub mod upgrade_authorized { + use super::runtime_types; + pub type CodeHash = ::subxt_core::utils::H256; + pub type CheckVersion = ::core::primitive::bool; + } + impl ::subxt_core::events::StaticEvent for UpgradeAuthorized { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "UpgradeAuthorized"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An invalid authorized upgrade was rejected while trying to apply it."] + pub struct RejectedInvalidAuthorizedUpgrade { + pub code_hash: rejected_invalid_authorized_upgrade::CodeHash, + pub error: rejected_invalid_authorized_upgrade::Error, + } + pub mod rejected_invalid_authorized_upgrade { + use super::runtime_types; + pub type CodeHash = ::subxt_core::utils::H256; + pub type Error = runtime_types::sp_runtime::DispatchError; + } + impl ::subxt_core::events::StaticEvent for RejectedInvalidAuthorizedUpgrade { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "RejectedInvalidAuthorizedUpgrade"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod account { + use super::runtime_types; + pub type Account = runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>, + >; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod extrinsic_count { + use super::runtime_types; + pub type ExtrinsicCount = ::core::primitive::u32; + } + pub mod inherents_applied { + use super::runtime_types; + pub type InherentsApplied = ::core::primitive::bool; + } + pub mod block_weight { + use super::runtime_types; + pub type BlockWeight = runtime_types::frame_support::dispatch::PerDispatchClass< + runtime_types::sp_weights::weight_v2::Weight, + >; + } + pub mod block_size { + use super::runtime_types; + pub type BlockSize = ::core::primitive::u32; + } + pub mod block_hash { + use super::runtime_types; + pub type BlockHash = ::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; + } + pub mod extrinsic_data { + use super::runtime_types; + pub type ExtrinsicData = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Param0 = ::core::primitive::u32; + } + pub mod number { + use super::runtime_types; + pub type Number = ::core::primitive::u32; + } + pub mod parent_hash { + use super::runtime_types; + pub type ParentHash = ::subxt_core::utils::H256; + } + pub mod digest { + use super::runtime_types; + pub type Digest = runtime_types::sp_runtime::generic::digest::Digest; + } + pub mod events { + use super::runtime_types; + pub type Events = ::subxt_core::alloc::vec::Vec< + runtime_types::frame_system::EventRecord< + runtime_types::storage_paseo_runtime::RuntimeEvent, + ::subxt_core::utils::H256, + >, + >; + } + pub mod event_count { + use super::runtime_types; + pub type EventCount = ::core::primitive::u32; + } + pub mod event_topics { + use super::runtime_types; + pub type EventTopics = ::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + ::core::primitive::u32, + )>; + pub type Param0 = ::subxt_core::utils::H256; + } + pub mod last_runtime_upgrade { + use super::runtime_types; + pub type LastRuntimeUpgrade = + runtime_types::frame_system::LastRuntimeUpgradeInfo; + } + pub mod blocks_till_upgrade { + use super::runtime_types; + pub type BlocksTillUpgrade = ::core::primitive::u8; + } + pub mod upgraded_to_u32_ref_count { + use super::runtime_types; + pub type UpgradedToU32RefCount = ::core::primitive::bool; + } + pub mod upgraded_to_triple_ref_count { + use super::runtime_types; + pub type UpgradedToTripleRefCount = ::core::primitive::bool; + } + pub mod execution_phase { + use super::runtime_types; + pub type ExecutionPhase = runtime_types::frame_system::Phase; + } + pub mod authorized_upgrade { + use super::runtime_types; + pub type AuthorizedUpgrade = + runtime_types::frame_system::CodeUpgradeAuthorization; + } + pub mod extrinsic_weight_reclaimed { + use super::runtime_types; + pub type ExtrinsicWeightReclaimed = + runtime_types::sp_weights::weight_v2::Weight; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The full account information for a particular account ID."] + pub fn account_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::account::Account, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "Account", + (), + [ + 14u8, 233u8, 115u8, 214u8, 0u8, 109u8, 222u8, 121u8, 162u8, 65u8, 60u8, + 175u8, 209u8, 79u8, 222u8, 124u8, 22u8, 235u8, 138u8, 176u8, 133u8, + 124u8, 90u8, 158u8, 85u8, 45u8, 37u8, 174u8, 47u8, 79u8, 47u8, 166u8, + ], + ) + } + #[doc = " The full account information for a particular account ID."] + pub fn account( + &self, + _0: types::account::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::account::Account, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "Account", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 14u8, 233u8, 115u8, 214u8, 0u8, 109u8, 222u8, 121u8, 162u8, 65u8, 60u8, + 175u8, 209u8, 79u8, 222u8, 124u8, 22u8, 235u8, 138u8, 176u8, 133u8, + 124u8, 90u8, 158u8, 85u8, 45u8, 37u8, 174u8, 47u8, 79u8, 47u8, 166u8, + ], + ) + } + #[doc = " Total extrinsics count for the current block."] + pub fn extrinsic_count( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::extrinsic_count::ExtrinsicCount, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "ExtrinsicCount", + (), + [ + 102u8, 76u8, 236u8, 42u8, 40u8, 231u8, 33u8, 222u8, 123u8, 147u8, + 153u8, 148u8, 234u8, 203u8, 181u8, 119u8, 6u8, 187u8, 177u8, 199u8, + 120u8, 47u8, 137u8, 254u8, 96u8, 100u8, 165u8, 182u8, 249u8, 230u8, + 159u8, 79u8, + ], + ) + } + #[doc = " Whether all inherents have been applied."] + pub fn inherents_applied( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::inherents_applied::InherentsApplied, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "InherentsApplied", + (), + [ + 132u8, 249u8, 142u8, 252u8, 8u8, 103u8, 80u8, 120u8, 50u8, 6u8, 188u8, + 223u8, 101u8, 55u8, 165u8, 189u8, 172u8, 249u8, 165u8, 230u8, 183u8, + 109u8, 34u8, 65u8, 185u8, 150u8, 29u8, 8u8, 186u8, 129u8, 135u8, 239u8, + ], + ) + } + #[doc = " The current weight for the block."] + pub fn block_weight( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::block_weight::BlockWeight, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "BlockWeight", + (), + [ + 158u8, 46u8, 228u8, 89u8, 210u8, 214u8, 84u8, 154u8, 50u8, 68u8, 63u8, + 62u8, 43u8, 42u8, 99u8, 27u8, 54u8, 42u8, 146u8, 44u8, 241u8, 216u8, + 229u8, 30u8, 216u8, 255u8, 165u8, 238u8, 181u8, 130u8, 36u8, 102u8, + ], + ) + } + #[doc = " Total size (in bytes) of the current block."] + #[doc = ""] + #[doc = " Tracks the size of the header and all extrinsics."] + pub fn block_size( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::block_size::BlockSize, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "BlockSize", + (), + [ + 77u8, 144u8, 151u8, 134u8, 144u8, 38u8, 126u8, 109u8, 143u8, 21u8, + 62u8, 112u8, 157u8, 215u8, 82u8, 57u8, 128u8, 199u8, 44u8, 36u8, 56u8, + 29u8, 160u8, 127u8, 93u8, 214u8, 74u8, 241u8, 114u8, 253u8, 244u8, + 33u8, + ], + ) + } + #[doc = " Map of block numbers to block hashes."] + pub fn block_hash_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::block_hash::BlockHash, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "BlockHash", + (), + [ + 217u8, 32u8, 215u8, 253u8, 24u8, 182u8, 207u8, 178u8, 157u8, 24u8, + 103u8, 100u8, 195u8, 165u8, 69u8, 152u8, 112u8, 181u8, 56u8, 192u8, + 164u8, 16u8, 20u8, 222u8, 28u8, 214u8, 144u8, 142u8, 146u8, 69u8, + 202u8, 118u8, + ], + ) + } + #[doc = " Map of block numbers to block hashes."] + pub fn block_hash( + &self, + _0: types::block_hash::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::block_hash::BlockHash, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "BlockHash", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 217u8, 32u8, 215u8, 253u8, 24u8, 182u8, 207u8, 178u8, 157u8, 24u8, + 103u8, 100u8, 195u8, 165u8, 69u8, 152u8, 112u8, 181u8, 56u8, 192u8, + 164u8, 16u8, 20u8, 222u8, 28u8, 214u8, 144u8, 142u8, 146u8, 69u8, + 202u8, 118u8, + ], + ) + } + #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] + pub fn extrinsic_data_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::extrinsic_data::ExtrinsicData, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "ExtrinsicData", + (), + [ + 160u8, 180u8, 122u8, 18u8, 196u8, 26u8, 2u8, 37u8, 115u8, 232u8, 133u8, + 220u8, 106u8, 245u8, 4u8, 129u8, 42u8, 84u8, 241u8, 45u8, 199u8, 179u8, + 128u8, 61u8, 170u8, 137u8, 231u8, 156u8, 247u8, 57u8, 47u8, 38u8, + ], + ) + } + #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] + pub fn extrinsic_data( + &self, + _0: types::extrinsic_data::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::extrinsic_data::ExtrinsicData, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "ExtrinsicData", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 160u8, 180u8, 122u8, 18u8, 196u8, 26u8, 2u8, 37u8, 115u8, 232u8, 133u8, + 220u8, 106u8, 245u8, 4u8, 129u8, 42u8, 84u8, 241u8, 45u8, 199u8, 179u8, + 128u8, 61u8, 170u8, 137u8, 231u8, 156u8, 247u8, 57u8, 47u8, 38u8, + ], + ) + } + #[doc = " The current block number being processed. Set by `execute_block`."] + pub fn number( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::number::Number, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "Number", + (), + [ + 30u8, 194u8, 177u8, 90u8, 194u8, 232u8, 46u8, 180u8, 85u8, 129u8, 14u8, + 9u8, 8u8, 8u8, 23u8, 95u8, 230u8, 5u8, 13u8, 105u8, 125u8, 2u8, 22u8, + 200u8, 78u8, 93u8, 115u8, 28u8, 150u8, 113u8, 48u8, 53u8, + ], + ) + } + #[doc = " Hash of the previous block."] + pub fn parent_hash( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::parent_hash::ParentHash, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "ParentHash", + (), + [ + 26u8, 130u8, 11u8, 216u8, 155u8, 71u8, 128u8, 170u8, 30u8, 153u8, 21u8, + 192u8, 62u8, 93u8, 137u8, 80u8, 120u8, 81u8, 202u8, 94u8, 248u8, 125u8, + 71u8, 82u8, 141u8, 229u8, 32u8, 56u8, 73u8, 50u8, 101u8, 78u8, + ], + ) + } + #[doc = " Digest of the current block, also part of the block header."] + pub fn digest( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::digest::Digest, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "Digest", + (), + [ + 61u8, 64u8, 237u8, 91u8, 145u8, 232u8, 17u8, 254u8, 181u8, 16u8, 234u8, + 91u8, 51u8, 140u8, 254u8, 131u8, 98u8, 135u8, 21u8, 37u8, 251u8, 20u8, + 58u8, 92u8, 123u8, 141u8, 14u8, 227u8, 146u8, 46u8, 222u8, 117u8, + ], + ) + } + #[doc = " Events deposited for the current block."] + #[doc = ""] + #[doc = " NOTE: The item is unbound and should therefore never be read on chain."] + #[doc = " It could otherwise inflate the PoV size of a block."] + #[doc = ""] + #[doc = " Events have a large in-memory size. Box the events to not go out-of-memory"] + #[doc = " just in case someone still reads them from within the runtime."] + pub fn events( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::events::Events, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "Events", + (), + [ + 38u8, 5u8, 88u8, 184u8, 221u8, 56u8, 133u8, 214u8, 164u8, 23u8, 74u8, + 137u8, 97u8, 117u8, 156u8, 98u8, 94u8, 227u8, 11u8, 13u8, 53u8, 238u8, + 12u8, 62u8, 58u8, 175u8, 243u8, 239u8, 235u8, 2u8, 68u8, 7u8, + ], + ) + } + #[doc = " The number of events in the `Events` list."] + pub fn event_count( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::event_count::EventCount, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "EventCount", + (), + [ + 175u8, 24u8, 252u8, 184u8, 210u8, 167u8, 146u8, 143u8, 164u8, 80u8, + 151u8, 205u8, 189u8, 189u8, 55u8, 220u8, 47u8, 101u8, 181u8, 33u8, + 254u8, 131u8, 13u8, 143u8, 3u8, 244u8, 245u8, 45u8, 2u8, 210u8, 79u8, + 133u8, + ], + ) + } + #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] + #[doc = " of events in the `>` list."] + #[doc = ""] + #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] + #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] + #[doc = " in case of changes fetch the list of events of interest."] + #[doc = ""] + #[doc = " The value has the type `(BlockNumberFor, EventIndex)` because if we used only just"] + #[doc = " the `EventIndex` then in case if the topic has the same contents on the next block"] + #[doc = " no notification will be triggered thus the event might be lost."] + pub fn event_topics_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::event_topics::EventTopics, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "EventTopics", + (), + [ + 40u8, 225u8, 14u8, 75u8, 44u8, 176u8, 76u8, 34u8, 143u8, 107u8, 69u8, + 133u8, 114u8, 13u8, 172u8, 250u8, 141u8, 73u8, 12u8, 65u8, 217u8, 63u8, + 120u8, 241u8, 48u8, 106u8, 143u8, 161u8, 128u8, 100u8, 166u8, 59u8, + ], + ) + } + #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] + #[doc = " of events in the `>` list."] + #[doc = ""] + #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] + #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] + #[doc = " in case of changes fetch the list of events of interest."] + #[doc = ""] + #[doc = " The value has the type `(BlockNumberFor, EventIndex)` because if we used only just"] + #[doc = " the `EventIndex` then in case if the topic has the same contents on the next block"] + #[doc = " no notification will be triggered thus the event might be lost."] + pub fn event_topics( + &self, + _0: types::event_topics::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::event_topics::EventTopics, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "EventTopics", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 40u8, 225u8, 14u8, 75u8, 44u8, 176u8, 76u8, 34u8, 143u8, 107u8, 69u8, + 133u8, 114u8, 13u8, 172u8, 250u8, 141u8, 73u8, 12u8, 65u8, 217u8, 63u8, + 120u8, 241u8, 48u8, 106u8, 143u8, 161u8, 128u8, 100u8, 166u8, 59u8, + ], + ) + } + #[doc = " Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened."] + pub fn last_runtime_upgrade( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::last_runtime_upgrade::LastRuntimeUpgrade, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "LastRuntimeUpgrade", + (), + [ + 197u8, 212u8, 249u8, 209u8, 79u8, 34u8, 55u8, 203u8, 31u8, 42u8, 199u8, + 242u8, 188u8, 74u8, 234u8, 250u8, 245u8, 44u8, 139u8, 162u8, 45u8, + 150u8, 230u8, 249u8, 135u8, 100u8, 158u8, 167u8, 118u8, 219u8, 28u8, + 98u8, + ], + ) + } + #[doc = " Number of blocks till the pending code upgrade is applied."] + pub fn blocks_till_upgrade( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::blocks_till_upgrade::BlocksTillUpgrade, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "BlocksTillUpgrade", + (), + [ + 184u8, 49u8, 238u8, 134u8, 27u8, 13u8, 184u8, 216u8, 19u8, 142u8, + 140u8, 16u8, 147u8, 29u8, 112u8, 20u8, 53u8, 194u8, 123u8, 137u8, 79u8, + 56u8, 139u8, 136u8, 50u8, 155u8, 131u8, 108u8, 62u8, 230u8, 106u8, + 173u8, + ], + ) + } + #[doc = " True if we have upgraded so that `type RefCount` is `u32`. False (default) if not."] + pub fn upgraded_to_u32_ref_count( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::upgraded_to_u32_ref_count::UpgradedToU32RefCount, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "UpgradedToU32RefCount", + (), + [ + 229u8, 73u8, 9u8, 132u8, 186u8, 116u8, 151u8, 171u8, 145u8, 29u8, 34u8, + 130u8, 52u8, 146u8, 124u8, 175u8, 79u8, 189u8, 147u8, 230u8, 234u8, + 107u8, 124u8, 31u8, 2u8, 22u8, 86u8, 190u8, 4u8, 147u8, 50u8, 245u8, + ], + ) + } + #[doc = " True if we have upgraded so that AccountInfo contains three types of `RefCount`. False"] + #[doc = " (default) if not."] + pub fn upgraded_to_triple_ref_count( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::upgraded_to_triple_ref_count::UpgradedToTripleRefCount, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "UpgradedToTripleRefCount", + (), + [ + 97u8, 66u8, 124u8, 243u8, 27u8, 167u8, 147u8, 81u8, 254u8, 201u8, + 101u8, 24u8, 40u8, 231u8, 14u8, 179u8, 154u8, 163u8, 71u8, 81u8, 185u8, + 167u8, 82u8, 254u8, 189u8, 3u8, 101u8, 207u8, 206u8, 194u8, 155u8, + 151u8, + ], + ) + } + #[doc = " The execution phase of the block."] + pub fn execution_phase( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::execution_phase::ExecutionPhase, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "ExecutionPhase", + (), + [ + 191u8, 129u8, 100u8, 134u8, 126u8, 116u8, 154u8, 203u8, 220u8, 200u8, + 0u8, 26u8, 161u8, 250u8, 133u8, 205u8, 146u8, 24u8, 5u8, 156u8, 158u8, + 35u8, 36u8, 253u8, 52u8, 235u8, 86u8, 167u8, 35u8, 100u8, 119u8, 27u8, + ], + ) + } + #[doc = " `Some` if a code upgrade has been authorized."] + pub fn authorized_upgrade( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::authorized_upgrade::AuthorizedUpgrade, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "AuthorizedUpgrade", + (), + [ + 165u8, 97u8, 27u8, 138u8, 2u8, 28u8, 55u8, 92u8, 96u8, 96u8, 168u8, + 169u8, 55u8, 178u8, 44u8, 127u8, 58u8, 140u8, 206u8, 178u8, 1u8, 37u8, + 214u8, 213u8, 251u8, 123u8, 5u8, 111u8, 90u8, 148u8, 217u8, 135u8, + ], + ) + } + #[doc = " The weight reclaimed for the extrinsic."] + #[doc = ""] + #[doc = " This information is available until the end of the extrinsic execution."] + #[doc = " More precisely this information is removed in `note_applied_extrinsic`."] + #[doc = ""] + #[doc = " Logic doing some post dispatch weight reduction must update this storage to avoid duplicate"] + #[doc = " reduction."] + pub fn extrinsic_weight_reclaimed( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::extrinsic_weight_reclaimed::ExtrinsicWeightReclaimed, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "System", + "ExtrinsicWeightReclaimed", + (), + [ + 195u8, 143u8, 164u8, 84u8, 225u8, 194u8, 227u8, 128u8, 196u8, 241u8, + 188u8, 159u8, 59u8, 197u8, 11u8, 12u8, 119u8, 164u8, 46u8, 229u8, 92u8, + 212u8, 236u8, 255u8, 238u8, 54u8, 105u8, 200u8, 229u8, 191u8, 221u8, + 202u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Block & extrinsics weights: base values and limits."] + pub fn block_weights( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::frame_system::limits::BlockWeights, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "System", + "BlockWeights", + [ + 176u8, 124u8, 225u8, 136u8, 25u8, 73u8, 247u8, 33u8, 82u8, 206u8, 85u8, + 190u8, 127u8, 102u8, 71u8, 11u8, 185u8, 8u8, 58u8, 0u8, 94u8, 55u8, + 163u8, 177u8, 104u8, 59u8, 60u8, 136u8, 246u8, 116u8, 0u8, 239u8, + ], + ) + } + #[doc = " The maximum length of a block (in bytes)."] + pub fn block_length( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::frame_system::limits::BlockLength, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "System", + "BlockLength", + [ + 25u8, 97u8, 176u8, 77u8, 2u8, 60u8, 44u8, 69u8, 161u8, 69u8, 251u8, + 229u8, 198u8, 186u8, 185u8, 237u8, 105u8, 56u8, 122u8, 35u8, 78u8, + 195u8, 98u8, 222u8, 215u8, 49u8, 249u8, 146u8, 231u8, 21u8, 224u8, + 134u8, + ], + ) + } + #[doc = " Maximum number of block number to block hash mappings to keep (oldest pruned first)."] + pub fn block_hash_count( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "System", + "BlockHashCount", + [ + 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 weight of runtime database operations the runtime can invoke."] + pub fn db_weight( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::sp_weights::RuntimeDbWeight, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "System", + "DbWeight", + [ + 42u8, 43u8, 178u8, 142u8, 243u8, 203u8, 60u8, 173u8, 118u8, 111u8, + 200u8, 170u8, 102u8, 70u8, 237u8, 187u8, 198u8, 120u8, 153u8, 232u8, + 183u8, 76u8, 74u8, 10u8, 70u8, 243u8, 14u8, 218u8, 213u8, 126u8, 29u8, + 177u8, + ], + ) + } + #[doc = " Get the chain's in-code version."] + pub fn version( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::sp_version::RuntimeVersion, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "System", + "Version", + [ + 214u8, 43u8, 96u8, 193u8, 96u8, 213u8, 63u8, 124u8, 22u8, 111u8, 41u8, + 78u8, 146u8, 77u8, 34u8, 163u8, 117u8, 100u8, 6u8, 216u8, 238u8, 54u8, + 80u8, 185u8, 219u8, 11u8, 192u8, 200u8, 129u8, 88u8, 161u8, 250u8, + ], + ) + } + #[doc = " The designated SS58 prefix of this chain."] + #[doc = ""] + #[doc = " This replaces the \"ss58Format\" property declared in the chain spec. Reason is"] + #[doc = " that the runtime should know about the prefix in order to make use of it as"] + #[doc = " an identifier of the chain."] + pub fn ss58_prefix( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u16> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "System", + "SS58Prefix", + [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, 227u8, + 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, 184u8, 72u8, 169u8, + 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, 123u8, 128u8, 193u8, 29u8, 70u8, + ], + ) + } + } + } + } + pub mod parachain_system { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::cumulus_pallet_parachain_system::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::cumulus_pallet_parachain_system::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the current validation data."] + #[doc = ""] + #[doc = "This should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase if the call was not invoked."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Inherent`"] + #[doc = ""] + #[doc = "As a side effect, this function upgrades the current validation function"] + #[doc = "if the appropriate time has come."] + pub struct SetValidationData { + pub data: set_validation_data::Data, + pub inbound_messages_data: set_validation_data::InboundMessagesData, + } + pub mod set_validation_data { + use super::runtime_types; + pub type Data = runtime_types :: cumulus_pallet_parachain_system :: parachain_inherent :: BasicParachainInherentData ; + pub type InboundMessagesData = runtime_types :: cumulus_pallet_parachain_system :: parachain_inherent :: InboundMessagesData ; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetValidationData { + const PALLET: &'static str = "ParachainSystem"; + const CALL: &'static str = "set_validation_data"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct SudoSendUpwardMessage { + pub message: sudo_send_upward_message::Message, + } + pub mod sudo_send_upward_message { + use super::runtime_types; + pub type Message = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for SudoSendUpwardMessage { + const PALLET: &'static str = "ParachainSystem"; + const CALL: &'static str = "sudo_send_upward_message"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the current validation data."] + #[doc = ""] + #[doc = "This should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase if the call was not invoked."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Inherent`"] + #[doc = ""] + #[doc = "As a side effect, this function upgrades the current validation function"] + #[doc = "if the appropriate time has come."] + pub fn set_validation_data( + &self, + data: types::set_validation_data::Data, + inbound_messages_data: types::set_validation_data::InboundMessagesData, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "ParachainSystem", + "set_validation_data", + types::SetValidationData { + data, + inbound_messages_data, + }, + [ + 24u8, 248u8, 40u8, 54u8, 164u8, 120u8, 191u8, 152u8, 197u8, 48u8, 72u8, + 153u8, 142u8, 201u8, 158u8, 234u8, 61u8, 234u8, 41u8, 241u8, 25u8, + 129u8, 21u8, 111u8, 226u8, 120u8, 125u8, 118u8, 216u8, 226u8, 70u8, + 28u8, + ], + ) + } + pub fn sudo_send_upward_message( + &self, + message: types::sudo_send_upward_message::Message, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "ParachainSystem", + "sudo_send_upward_message", + types::SudoSendUpwardMessage { message }, + [ + 1u8, 231u8, 11u8, 78u8, 127u8, 117u8, 248u8, 67u8, 230u8, 199u8, 126u8, + 47u8, 20u8, 62u8, 252u8, 138u8, 199u8, 48u8, 41u8, 21u8, 28u8, 157u8, + 218u8, 143u8, 4u8, 253u8, 62u8, 192u8, 94u8, 252u8, 92u8, 180u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::cumulus_pallet_parachain_system::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The validation function has been scheduled to apply."] + pub struct ValidationFunctionStored; + impl ::subxt_core::events::StaticEvent for ValidationFunctionStored { + const PALLET: &'static str = "ParachainSystem"; + const EVENT: &'static str = "ValidationFunctionStored"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The validation function was applied as of the contained relay chain block number."] + pub struct ValidationFunctionApplied { + pub relay_chain_block_num: validation_function_applied::RelayChainBlockNum, + } + pub mod validation_function_applied { + use super::runtime_types; + pub type RelayChainBlockNum = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for ValidationFunctionApplied { + const PALLET: &'static str = "ParachainSystem"; + const EVENT: &'static str = "ValidationFunctionApplied"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The relay-chain aborted the upgrade process."] + pub struct ValidationFunctionDiscarded; + impl ::subxt_core::events::StaticEvent for ValidationFunctionDiscarded { + const PALLET: &'static str = "ParachainSystem"; + const EVENT: &'static str = "ValidationFunctionDiscarded"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some downward messages have been received and will be processed."] + pub struct DownwardMessagesReceived { + pub count: downward_messages_received::Count, + } + pub mod downward_messages_received { + use super::runtime_types; + pub type Count = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for DownwardMessagesReceived { + const PALLET: &'static str = "ParachainSystem"; + const EVENT: &'static str = "DownwardMessagesReceived"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Downward messages were processed using the given weight."] + pub struct DownwardMessagesProcessed { + pub weight_used: downward_messages_processed::WeightUsed, + pub dmq_head: downward_messages_processed::DmqHead, + } + pub mod downward_messages_processed { + use super::runtime_types; + pub type WeightUsed = runtime_types::sp_weights::weight_v2::Weight; + pub type DmqHead = ::subxt_core::utils::H256; + } + impl ::subxt_core::events::StaticEvent for DownwardMessagesProcessed { + const PALLET: &'static str = "ParachainSystem"; + const EVENT: &'static str = "DownwardMessagesProcessed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An upward message was sent to the relay chain."] + pub struct UpwardMessageSent { + pub message_hash: upward_message_sent::MessageHash, + } + pub mod upward_message_sent { + use super::runtime_types; + pub type MessageHash = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt_core::events::StaticEvent for UpwardMessageSent { + const PALLET: &'static str = "ParachainSystem"; + const EVENT: &'static str = "UpwardMessageSent"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod block_weight_mode { + use super::runtime_types; + pub type BlockWeightMode = runtime_types :: cumulus_pallet_parachain_system :: block_weight :: BlockWeightMode ; + } + pub mod previous_core_count { + use super::runtime_types; + pub type PreviousCoreCount = + ::subxt_core::ext::codec::Compact<::core::primitive::u16>; + } + pub mod unincluded_segment { + use super::runtime_types; + pub type UnincludedSegment = :: subxt_core :: alloc :: vec :: Vec < runtime_types :: cumulus_pallet_parachain_system :: unincluded_segment :: Ancestor < :: subxt_core :: utils :: H256 > > ; + } + pub mod aggregated_unincluded_segment { + use super::runtime_types; + pub type AggregatedUnincludedSegment = runtime_types :: cumulus_pallet_parachain_system :: unincluded_segment :: SegmentTracker < :: subxt_core :: utils :: H256 > ; + } + pub mod pending_validation_code { + use super::runtime_types; + pub type PendingValidationCode = + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + pub mod new_validation_code { + use super::runtime_types; + pub type NewValidationCode = + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + pub mod validation_data { + use super::runtime_types; + pub type ValidationData = + runtime_types::polkadot_primitives::v9::PersistedValidationData< + ::subxt_core::utils::H256, + ::core::primitive::u32, + >; + } + pub mod did_set_validation_code { + use super::runtime_types; + pub type DidSetValidationCode = ::core::primitive::bool; + } + pub mod last_relay_chain_block_number { + use super::runtime_types; + pub type LastRelayChainBlockNumber = ::core::primitive::u32; + } + pub mod upgrade_restriction_signal { + use super::runtime_types; + pub type UpgradeRestrictionSignal = ::core::option::Option< + runtime_types::polkadot_primitives::v9::UpgradeRestriction, + >; + } + pub mod upgrade_go_ahead { + use super::runtime_types; + pub type UpgradeGoAhead = ::core::option::Option< + runtime_types::polkadot_primitives::v9::UpgradeGoAhead, + >; + } + pub mod relay_state_proof { + use super::runtime_types; + pub type RelayStateProof = runtime_types::sp_trie::storage_proof::StorageProof; + } + pub mod relevant_messaging_state { + use super::runtime_types; + pub type RelevantMessagingState = runtime_types :: cumulus_pallet_parachain_system :: relay_state_snapshot :: MessagingStateSnapshot ; + } + pub mod host_configuration { + use super::runtime_types; + pub type HostConfiguration = + runtime_types::polkadot_primitives::v9::AbridgedHostConfiguration; + } + pub mod last_dmq_mqc_head { + use super::runtime_types; + pub type LastDmqMqcHead = + runtime_types::cumulus_primitives_parachain_inherent::MessageQueueChain; + } + pub mod last_hrmp_mqc_heads { + use super::runtime_types; + pub type LastHrmpMqcHeads = ::subxt_core::utils::KeyedVec< + runtime_types::polkadot_parachain_primitives::primitives::Id, + runtime_types::cumulus_primitives_parachain_inherent::MessageQueueChain, + >; + } + pub mod processed_downward_messages { + use super::runtime_types; + pub type ProcessedDownwardMessages = ::core::primitive::u32; + } + pub mod last_processed_downward_message { + use super::runtime_types; + pub type LastProcessedDownwardMessage = runtime_types :: cumulus_pallet_parachain_system :: parachain_inherent :: InboundMessageId ; + } + pub mod hrmp_watermark { + use super::runtime_types; + pub type HrmpWatermark = ::core::primitive::u32; + } + pub mod last_processed_hrmp_message { + use super::runtime_types; + pub type LastProcessedHrmpMessage = runtime_types :: cumulus_pallet_parachain_system :: parachain_inherent :: InboundMessageId ; + } + pub mod hrmp_outbound_messages { + use super::runtime_types; + pub type HrmpOutboundMessages = ::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_core_primitives::OutboundHrmpMessage< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >, + >; + } + pub mod upward_messages { + use super::runtime_types; + pub type UpwardMessages = ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; + } + pub mod pending_upward_messages { + use super::runtime_types; + pub type PendingUpwardMessages = ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; + } + pub mod pending_upward_signals { + use super::runtime_types; + pub type PendingUpwardSignals = ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; + } + pub mod upward_delivery_fee_factor { + use super::runtime_types; + pub type UpwardDeliveryFeeFactor = + runtime_types::sp_arithmetic::fixed_point::FixedU128; + } + pub mod announced_hrmp_messages_per_candidate { + use super::runtime_types; + pub type AnnouncedHrmpMessagesPerCandidate = ::core::primitive::u32; + } + pub mod reserved_xcmp_weight_override { + use super::runtime_types; + pub type ReservedXcmpWeightOverride = + runtime_types::sp_weights::weight_v2::Weight; + } + pub mod reserved_dmp_weight_override { + use super::runtime_types; + pub type ReservedDmpWeightOverride = + runtime_types::sp_weights::weight_v2::Weight; + } + pub mod custom_validation_head_data { + use super::runtime_types; + pub type CustomValidationHeadData = + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + pub mod po_v_messages_tracker { + use super::runtime_types; + pub type PoVMessagesTracker = + runtime_types::cumulus_pallet_parachain_system::PoVMessages; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The current block weight mode."] + #[doc = ""] + #[doc = " This is used to determine what is the maximum allowed block weight, for more information see"] + #[doc = " [`block_weight`]."] + #[doc = ""] + #[doc = " Killed in [`Self::on_initialize`] and set by the [`block_weight`] logic."] + pub fn block_weight_mode( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::block_weight_mode::BlockWeightMode, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "BlockWeightMode", + (), + [ + 140u8, 255u8, 133u8, 169u8, 34u8, 223u8, 67u8, 94u8, 116u8, 29u8, + 151u8, 29u8, 168u8, 9u8, 107u8, 124u8, 17u8, 176u8, 119u8, 163u8, 31u8, + 105u8, 199u8, 98u8, 62u8, 68u8, 179u8, 170u8, 135u8, 237u8, 30u8, + 141u8, + ], + ) + } + #[doc = " The core count available to the parachain in the previous block."] + #[doc = ""] + #[doc = " This is mainly used for offchain functionality to calculate the correct target block weight."] + pub fn previous_core_count( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::previous_core_count::PreviousCoreCount, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "PreviousCoreCount", + (), + [ + 157u8, 187u8, 34u8, 152u8, 156u8, 193u8, 155u8, 209u8, 202u8, 3u8, 6u8, + 183u8, 125u8, 41u8, 106u8, 26u8, 235u8, 240u8, 127u8, 211u8, 140u8, + 187u8, 42u8, 242u8, 229u8, 153u8, 29u8, 198u8, 53u8, 189u8, 228u8, + 224u8, + ], + ) + } + #[doc = " Latest included block descendants the runtime accepted. In other words, these are"] + #[doc = " ancestors of the currently executing block which have not been included in the observed"] + #[doc = " relay-chain state."] + #[doc = ""] + #[doc = " The segment length is limited by the capacity returned from the [`ConsensusHook`] configured"] + #[doc = " in the pallet."] + pub fn unincluded_segment( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::unincluded_segment::UnincludedSegment, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "UnincludedSegment", + (), + [ + 73u8, 83u8, 226u8, 16u8, 203u8, 233u8, 221u8, 109u8, 23u8, 114u8, 56u8, + 154u8, 100u8, 116u8, 253u8, 10u8, 164u8, 22u8, 110u8, 73u8, 245u8, + 226u8, 54u8, 146u8, 67u8, 109u8, 149u8, 142u8, 154u8, 218u8, 55u8, + 178u8, + ], + ) + } + #[doc = " Storage field that keeps track of bandwidth used by the unincluded segment along with the"] + #[doc = " latest HRMP watermark. Used for limiting the acceptance of new blocks with"] + #[doc = " respect to relay chain constraints."] + pub fn aggregated_unincluded_segment( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::aggregated_unincluded_segment::AggregatedUnincludedSegment, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "AggregatedUnincludedSegment", + (), + [ + 165u8, 51u8, 182u8, 156u8, 65u8, 114u8, 167u8, 133u8, 245u8, 52u8, + 32u8, 119u8, 159u8, 65u8, 201u8, 108u8, 99u8, 43u8, 84u8, 63u8, 95u8, + 182u8, 134u8, 163u8, 51u8, 202u8, 243u8, 82u8, 225u8, 192u8, 186u8, + 2u8, + ], + ) + } + #[doc = " In case of a scheduled upgrade, this storage field contains the validation code to be"] + #[doc = " applied."] + #[doc = ""] + #[doc = " As soon as the relay chain gives us the go-ahead signal, we will overwrite the"] + #[doc = " [`:pending_code`][sp_core::storage::well_known_keys::PENDING_CODE] which will result the"] + #[doc = " next block to be processed with the new validation code. This concludes the upgrade process."] + pub fn pending_validation_code( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::pending_validation_code::PendingValidationCode, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "PendingValidationCode", + (), + [ + 78u8, 159u8, 219u8, 211u8, 177u8, 80u8, 102u8, 93u8, 83u8, 146u8, 90u8, + 233u8, 232u8, 11u8, 104u8, 172u8, 93u8, 68u8, 44u8, 228u8, 99u8, 197u8, + 254u8, 28u8, 181u8, 215u8, 247u8, 238u8, 49u8, 49u8, 195u8, 249u8, + ], + ) + } + #[doc = " Validation code that is set by the parachain and is to be communicated to collator and"] + #[doc = " consequently the relay-chain."] + #[doc = ""] + #[doc = " This will be cleared in `on_initialize` of each new block if no other pallet already set"] + #[doc = " the value."] + pub fn new_validation_code( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::new_validation_code::NewValidationCode, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "NewValidationCode", + (), + [ + 185u8, 123u8, 152u8, 122u8, 230u8, 136u8, 79u8, 73u8, 206u8, 19u8, + 59u8, 57u8, 75u8, 250u8, 83u8, 185u8, 29u8, 76u8, 89u8, 137u8, 77u8, + 163u8, 25u8, 125u8, 182u8, 67u8, 2u8, 180u8, 48u8, 237u8, 49u8, 171u8, + ], + ) + } + #[doc = " The [`PersistedValidationData`] set for this block."] + #[doc = ""] + #[doc = " This value is expected to be set only once by the [`Pallet::set_validation_data`] inherent."] + pub fn validation_data( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::validation_data::ValidationData, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "ValidationData", + (), + [ + 193u8, 240u8, 25u8, 56u8, 103u8, 173u8, 56u8, 56u8, 229u8, 243u8, 91u8, + 25u8, 249u8, 95u8, 122u8, 93u8, 37u8, 181u8, 54u8, 244u8, 217u8, 200u8, + 62u8, 136u8, 80u8, 148u8, 16u8, 177u8, 124u8, 211u8, 95u8, 24u8, + ], + ) + } + #[doc = " Were the validation data set to notify the relay chain?"] + pub fn did_set_validation_code( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::did_set_validation_code::DidSetValidationCode, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "DidSetValidationCode", + (), + [ + 233u8, 228u8, 48u8, 111u8, 200u8, 35u8, 30u8, 139u8, 251u8, 77u8, + 196u8, 252u8, 35u8, 222u8, 129u8, 235u8, 7u8, 19u8, 156u8, 82u8, 126u8, + 173u8, 29u8, 62u8, 20u8, 67u8, 166u8, 116u8, 108u8, 182u8, 57u8, 246u8, + ], + ) + } + #[doc = " The relay chain block number associated with the last parachain block."] + #[doc = ""] + #[doc = " This is updated in `on_finalize`."] + pub fn last_relay_chain_block_number( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::last_relay_chain_block_number::LastRelayChainBlockNumber, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "LastRelayChainBlockNumber", + (), + [ + 17u8, 65u8, 131u8, 169u8, 195u8, 243u8, 195u8, 93u8, 220u8, 174u8, + 75u8, 216u8, 214u8, 227u8, 96u8, 40u8, 8u8, 153u8, 116u8, 160u8, 79u8, + 255u8, 35u8, 232u8, 242u8, 42u8, 100u8, 150u8, 208u8, 210u8, 142u8, + 186u8, + ], + ) + } + #[doc = " An option which indicates if the relay-chain restricts signalling a validation code upgrade."] + #[doc = " In other words, if this is `Some` and [`NewValidationCode`] is `Some` then the produced"] + #[doc = " candidate will be invalid."] + #[doc = ""] + #[doc = " This storage item is a mirror of the corresponding value for the current parachain from the"] + #[doc = " relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is"] + #[doc = " set after the inherent."] + pub fn upgrade_restriction_signal( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::upgrade_restriction_signal::UpgradeRestrictionSignal, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "UpgradeRestrictionSignal", + (), + [ + 235u8, 240u8, 37u8, 44u8, 181u8, 52u8, 7u8, 216u8, 20u8, 139u8, 69u8, + 124u8, 21u8, 173u8, 237u8, 64u8, 105u8, 88u8, 49u8, 69u8, 123u8, 55u8, + 181u8, 167u8, 112u8, 183u8, 190u8, 231u8, 231u8, 127u8, 77u8, 148u8, + ], + ) + } + #[doc = " Optional upgrade go-ahead signal from the relay-chain."] + #[doc = ""] + #[doc = " This storage item is a mirror of the corresponding value for the current parachain from the"] + #[doc = " relay-chain. This value is ephemeral which means it doesn't hit the storage. This value is"] + #[doc = " set after the inherent."] + pub fn upgrade_go_ahead( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::upgrade_go_ahead::UpgradeGoAhead, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "UpgradeGoAhead", + (), + [ + 149u8, 144u8, 186u8, 88u8, 180u8, 34u8, 82u8, 226u8, 100u8, 148u8, + 246u8, 55u8, 233u8, 97u8, 43u8, 0u8, 48u8, 31u8, 69u8, 154u8, 29u8, + 147u8, 241u8, 91u8, 81u8, 126u8, 206u8, 117u8, 14u8, 149u8, 87u8, 88u8, + ], + ) + } + #[doc = " The state proof for the last relay parent block."] + #[doc = ""] + #[doc = " This field is meant to be updated each block with the validation data inherent. Therefore,"] + #[doc = " before processing of the inherent, e.g. in `on_initialize` this data may be stale."] + #[doc = ""] + #[doc = " This data is also absent from the genesis."] + pub fn relay_state_proof( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::relay_state_proof::RelayStateProof, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "RelayStateProof", + (), + [ + 46u8, 115u8, 163u8, 190u8, 246u8, 47u8, 200u8, 159u8, 206u8, 204u8, + 94u8, 250u8, 127u8, 112u8, 109u8, 111u8, 210u8, 195u8, 244u8, 41u8, + 36u8, 187u8, 71u8, 150u8, 149u8, 253u8, 143u8, 33u8, 83u8, 189u8, + 182u8, 238u8, + ], + ) + } + #[doc = " The snapshot of some state related to messaging relevant to the current parachain as per"] + #[doc = " the relay parent."] + #[doc = ""] + #[doc = " This field is meant to be updated each block with the validation data inherent. Therefore,"] + #[doc = " before processing of the inherent, e.g. in `on_initialize` this data may be stale."] + #[doc = ""] + #[doc = " This data is also absent from the genesis."] + pub fn relevant_messaging_state( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::relevant_messaging_state::RelevantMessagingState, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "RelevantMessagingState", + (), + [ + 117u8, 166u8, 186u8, 126u8, 21u8, 174u8, 86u8, 253u8, 163u8, 90u8, + 54u8, 226u8, 186u8, 253u8, 126u8, 168u8, 145u8, 45u8, 155u8, 32u8, + 97u8, 110u8, 208u8, 125u8, 47u8, 113u8, 165u8, 199u8, 210u8, 118u8, + 217u8, 73u8, + ], + ) + } + #[doc = " The parachain host configuration that was obtained from the relay parent."] + #[doc = ""] + #[doc = " This field is meant to be updated each block with the validation data inherent. Therefore,"] + #[doc = " before processing of the inherent, e.g. in `on_initialize` this data may be stale."] + #[doc = ""] + #[doc = " This data is also absent from the genesis."] + pub fn host_configuration( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::host_configuration::HostConfiguration, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "HostConfiguration", + (), + [ + 252u8, 23u8, 111u8, 189u8, 120u8, 204u8, 129u8, 223u8, 248u8, 179u8, + 239u8, 173u8, 133u8, 61u8, 140u8, 2u8, 75u8, 32u8, 204u8, 178u8, 69u8, + 21u8, 44u8, 227u8, 178u8, 179u8, 33u8, 26u8, 131u8, 156u8, 78u8, 85u8, + ], + ) + } + #[doc = " The last downward message queue chain head we have observed."] + #[doc = ""] + #[doc = " This value is loaded before and saved after processing inbound downward messages carried"] + #[doc = " by the system inherent."] + pub fn last_dmq_mqc_head( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::last_dmq_mqc_head::LastDmqMqcHead, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "LastDmqMqcHead", + (), + [ + 1u8, 70u8, 140u8, 40u8, 51u8, 127u8, 75u8, 80u8, 5u8, 49u8, 196u8, + 31u8, 30u8, 61u8, 54u8, 252u8, 0u8, 0u8, 100u8, 115u8, 177u8, 250u8, + 138u8, 48u8, 107u8, 41u8, 93u8, 87u8, 195u8, 107u8, 206u8, 227u8, + ], + ) + } + #[doc = " The message queue chain heads we have observed per each channel incoming channel."] + #[doc = ""] + #[doc = " This value is loaded before and saved after processing inbound downward messages carried"] + #[doc = " by the system inherent."] + pub fn last_hrmp_mqc_heads( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::last_hrmp_mqc_heads::LastHrmpMqcHeads, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "LastHrmpMqcHeads", + (), + [ + 131u8, 170u8, 142u8, 30u8, 101u8, 113u8, 131u8, 81u8, 38u8, 168u8, + 98u8, 3u8, 9u8, 109u8, 96u8, 179u8, 115u8, 177u8, 128u8, 11u8, 238u8, + 54u8, 81u8, 60u8, 97u8, 112u8, 224u8, 175u8, 86u8, 133u8, 182u8, 76u8, + ], + ) + } + #[doc = " Number of downward messages processed in a block."] + #[doc = ""] + #[doc = " This will be cleared in `on_initialize` of each new block."] + pub fn processed_downward_messages( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::processed_downward_messages::ProcessedDownwardMessages, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "ProcessedDownwardMessages", + (), + [ + 151u8, 234u8, 196u8, 87u8, 130u8, 79u8, 4u8, 102u8, 47u8, 10u8, 33u8, + 132u8, 149u8, 118u8, 61u8, 141u8, 5u8, 1u8, 30u8, 120u8, 220u8, 156u8, + 16u8, 11u8, 14u8, 52u8, 126u8, 151u8, 244u8, 149u8, 197u8, 51u8, + ], + ) + } + #[doc = " The last processed downward message."] + #[doc = ""] + #[doc = " We need to keep track of this to filter the messages that have been already processed."] + pub fn last_processed_downward_message( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::last_processed_downward_message::LastProcessedDownwardMessage, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "LastProcessedDownwardMessage", + (), + [ + 75u8, 141u8, 16u8, 195u8, 57u8, 191u8, 162u8, 116u8, 7u8, 137u8, 238u8, + 206u8, 120u8, 162u8, 226u8, 113u8, 40u8, 71u8, 47u8, 192u8, 124u8, + 120u8, 66u8, 84u8, 172u8, 32u8, 122u8, 251u8, 26u8, 6u8, 52u8, 151u8, + ], + ) + } + #[doc = " HRMP watermark that was set in a block."] + pub fn hrmp_watermark( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::hrmp_watermark::HrmpWatermark, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "HrmpWatermark", + (), + [ + 77u8, 62u8, 59u8, 220u8, 7u8, 125u8, 98u8, 249u8, 108u8, 212u8, 223u8, + 99u8, 152u8, 13u8, 29u8, 80u8, 166u8, 65u8, 232u8, 113u8, 145u8, 128u8, + 123u8, 35u8, 238u8, 31u8, 113u8, 156u8, 220u8, 104u8, 217u8, 165u8, + ], + ) + } + #[doc = " The last processed HRMP message."] + #[doc = ""] + #[doc = " We need to keep track of this to filter the messages that have been already processed."] + pub fn last_processed_hrmp_message( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::last_processed_hrmp_message::LastProcessedHrmpMessage, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "LastProcessedHrmpMessage", + (), + [ + 174u8, 198u8, 88u8, 234u8, 120u8, 225u8, 81u8, 245u8, 0u8, 11u8, 124u8, + 147u8, 11u8, 224u8, 133u8, 151u8, 152u8, 194u8, 195u8, 99u8, 61u8, + 34u8, 142u8, 173u8, 241u8, 198u8, 19u8, 136u8, 127u8, 160u8, 173u8, + 111u8, + ], + ) + } + #[doc = " HRMP messages that were sent in a block."] + #[doc = ""] + #[doc = " This will be cleared in `on_initialize` of each new block."] + pub fn hrmp_outbound_messages( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::hrmp_outbound_messages::HrmpOutboundMessages, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "HrmpOutboundMessages", + (), + [ + 42u8, 9u8, 96u8, 217u8, 25u8, 101u8, 129u8, 147u8, 150u8, 20u8, 164u8, + 186u8, 217u8, 178u8, 15u8, 201u8, 233u8, 104u8, 92u8, 120u8, 29u8, + 245u8, 196u8, 13u8, 141u8, 210u8, 102u8, 62u8, 216u8, 80u8, 246u8, + 145u8, + ], + ) + } + #[doc = " Upward messages that were sent in a block."] + #[doc = ""] + #[doc = " This will be cleared in `on_initialize` for each new block."] + pub fn upward_messages( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::upward_messages::UpwardMessages, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "UpwardMessages", + (), + [ + 179u8, 127u8, 8u8, 94u8, 194u8, 246u8, 53u8, 79u8, 80u8, 22u8, 18u8, + 75u8, 116u8, 163u8, 90u8, 161u8, 30u8, 140u8, 57u8, 126u8, 60u8, 91u8, + 23u8, 30u8, 120u8, 245u8, 125u8, 96u8, 152u8, 25u8, 248u8, 85u8, + ], + ) + } + #[doc = " Upward messages that are still pending and not yet sent to the relay chain."] + pub fn pending_upward_messages( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::pending_upward_messages::PendingUpwardMessages, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "PendingUpwardMessages", + (), + [ + 239u8, 45u8, 18u8, 173u8, 148u8, 150u8, 55u8, 176u8, 173u8, 156u8, + 246u8, 226u8, 198u8, 214u8, 104u8, 187u8, 186u8, 13u8, 83u8, 194u8, + 153u8, 29u8, 228u8, 109u8, 26u8, 18u8, 212u8, 151u8, 246u8, 24u8, + 133u8, 216u8, + ], + ) + } + #[doc = " Upward signals that are still pending and not yet sent to the relay chain."] + #[doc = ""] + #[doc = " This will be cleared in `on_finalize` for each block."] + pub fn pending_upward_signals( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::pending_upward_signals::PendingUpwardSignals, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "PendingUpwardSignals", + (), + [ + 147u8, 182u8, 136u8, 253u8, 198u8, 173u8, 0u8, 194u8, 95u8, 74u8, + 136u8, 176u8, 60u8, 121u8, 145u8, 69u8, 223u8, 150u8, 137u8, 241u8, + 17u8, 38u8, 160u8, 116u8, 238u8, 242u8, 123u8, 169u8, 170u8, 244u8, + 83u8, 152u8, + ], + ) + } + #[doc = " The factor to multiply the base delivery fee by for UMP."] + pub fn upward_delivery_fee_factor( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::upward_delivery_fee_factor::UpwardDeliveryFeeFactor, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "UpwardDeliveryFeeFactor", + (), + [ + 40u8, 217u8, 164u8, 111u8, 151u8, 132u8, 69u8, 226u8, 163u8, 175u8, + 43u8, 239u8, 179u8, 217u8, 136u8, 161u8, 13u8, 251u8, 163u8, 102u8, + 24u8, 27u8, 168u8, 89u8, 221u8, 83u8, 93u8, 64u8, 96u8, 117u8, 146u8, + 71u8, + ], + ) + } + #[doc = " The number of HRMP messages we observed in `on_initialize` and thus used that number for"] + #[doc = " announcing the weight of `on_initialize` and `on_finalize`."] + pub fn announced_hrmp_messages_per_candidate( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::announced_hrmp_messages_per_candidate::AnnouncedHrmpMessagesPerCandidate, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "AnnouncedHrmpMessagesPerCandidate", + (), + [ + 93u8, 11u8, 229u8, 172u8, 73u8, 87u8, 13u8, 149u8, 15u8, 94u8, 163u8, + 107u8, 156u8, 22u8, 131u8, 177u8, 96u8, 247u8, 213u8, 224u8, 41u8, + 126u8, 157u8, 33u8, 154u8, 194u8, 95u8, 234u8, 65u8, 19u8, 58u8, 161u8, + ], + ) + } + #[doc = " The weight we reserve at the beginning of the block for processing XCMP messages. This"] + #[doc = " overrides the amount set in the Config trait."] + pub fn reserved_xcmp_weight_override( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::reserved_xcmp_weight_override::ReservedXcmpWeightOverride, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "ReservedXcmpWeightOverride", + (), + [ + 176u8, 93u8, 203u8, 74u8, 18u8, 170u8, 246u8, 203u8, 109u8, 89u8, 86u8, + 77u8, 96u8, 66u8, 189u8, 79u8, 184u8, 253u8, 11u8, 230u8, 87u8, 120u8, + 1u8, 254u8, 215u8, 41u8, 210u8, 86u8, 239u8, 206u8, 60u8, 2u8, + ], + ) + } + #[doc = " The weight we reserve at the beginning of the block for processing DMP messages. This"] + #[doc = " overrides the amount set in the Config trait."] + pub fn reserved_dmp_weight_override( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::reserved_dmp_weight_override::ReservedDmpWeightOverride, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "ReservedDmpWeightOverride", + (), + [ + 205u8, 124u8, 9u8, 156u8, 255u8, 207u8, 208u8, 23u8, 179u8, 132u8, + 254u8, 157u8, 237u8, 240u8, 167u8, 203u8, 253u8, 111u8, 136u8, 32u8, + 100u8, 152u8, 16u8, 19u8, 175u8, 14u8, 108u8, 61u8, 59u8, 231u8, 70u8, + 112u8, + ], + ) + } + #[doc = " A custom head data that should be returned as result of `validate_block`."] + #[doc = ""] + #[doc = " See `Pallet::set_custom_validation_head_data` for more information."] + pub fn custom_validation_head_data( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::custom_validation_head_data::CustomValidationHeadData, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "CustomValidationHeadData", + (), + [ + 52u8, 186u8, 187u8, 57u8, 245u8, 171u8, 202u8, 23u8, 92u8, 80u8, 118u8, + 66u8, 251u8, 156u8, 175u8, 254u8, 141u8, 185u8, 115u8, 209u8, 170u8, + 165u8, 1u8, 242u8, 120u8, 234u8, 162u8, 24u8, 135u8, 105u8, 8u8, 177u8, + ], + ) + } + #[doc = " Tracks cumulative `UMP` and `HRMP` messages sent across blocks in the current `PoV`."] + #[doc = ""] + #[doc = " Across different candidates/PoVs the budgets are tracked by [`AggregatedUnincludedSegment`]."] + pub fn po_v_messages_tracker( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::po_v_messages_tracker::PoVMessagesTracker, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainSystem", + "PoVMessagesTracker", + (), + [ + 159u8, 60u8, 105u8, 32u8, 215u8, 122u8, 93u8, 85u8, 34u8, 203u8, 87u8, + 59u8, 21u8, 160u8, 236u8, 38u8, 211u8, 71u8, 22u8, 241u8, 23u8, 141u8, + 176u8, 14u8, 53u8, 141u8, 85u8, 196u8, 190u8, 132u8, 184u8, 25u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Returns the parachain ID we are running with."] + pub fn self_para_id( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::polkadot_parachain_primitives::primitives::Id, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "ParachainSystem", + "SelfParaId", + [ + 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 timestamp { + use super::root_mod; + use super::runtime_types; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_timestamp::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "[`Config::MinimumPeriod`]."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware"] + #[doc = "that changing the complexity of this call could result exhausting the resources in a"] + #[doc = "block to execute any other calls."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + pub struct Set { + #[codec(compact)] + pub now: set::Now, + } + pub mod set { + use super::runtime_types; + pub type Now = ::core::primitive::u64; + } + impl ::subxt_core::blocks::StaticExtrinsic for Set { + const PALLET: &'static str = "Timestamp"; + const CALL: &'static str = "set"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "[`Config::MinimumPeriod`]."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware"] + #[doc = "that changing the complexity of this call could result exhausting the resources in a"] + #[doc = "block to execute any other calls."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + pub fn set( + &self, + now: types::set::Now, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Timestamp", + "set", + types::Set { now }, + [ + 37u8, 95u8, 49u8, 218u8, 24u8, 22u8, 0u8, 95u8, 72u8, 35u8, 155u8, + 199u8, 213u8, 54u8, 207u8, 22u8, 185u8, 193u8, 221u8, 70u8, 18u8, + 200u8, 4u8, 231u8, 195u8, 173u8, 6u8, 122u8, 11u8, 203u8, 231u8, 227u8, + ], + ) + } + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod now { + use super::runtime_types; + pub type Now = ::core::primitive::u64; + } + pub mod did_update { + use super::runtime_types; + pub type DidUpdate = ::core::primitive::bool; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The current time for the current block."] + pub fn now( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::now::Now, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Timestamp", + "Now", + (), + [ + 44u8, 50u8, 80u8, 30u8, 195u8, 146u8, 123u8, 238u8, 8u8, 163u8, 187u8, + 92u8, 61u8, 39u8, 51u8, 29u8, 173u8, 169u8, 217u8, 158u8, 85u8, 187u8, + 141u8, 26u8, 12u8, 115u8, 51u8, 11u8, 200u8, 244u8, 138u8, 152u8, + ], + ) + } + #[doc = " Whether the timestamp has been updated in this block."] + #[doc = ""] + #[doc = " This value is updated to `true` upon successful submission of a timestamp by a node."] + #[doc = " It is then checked at the end of each block execution in the `on_finalize` hook."] + pub fn did_update( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::did_update::DidUpdate, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Timestamp", + "DidUpdate", + (), + [ + 229u8, 175u8, 246u8, 102u8, 237u8, 158u8, 212u8, 229u8, 238u8, 214u8, + 205u8, 160u8, 164u8, 252u8, 195u8, 75u8, 139u8, 110u8, 22u8, 34u8, + 248u8, 204u8, 107u8, 46u8, 20u8, 200u8, 238u8, 167u8, 71u8, 41u8, + 214u8, 140u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum period between blocks."] + #[doc = ""] + #[doc = " Be aware that this is different to the *expected* period that the block production"] + #[doc = " apparatus provides. Your chosen consensus system will generally work with this to"] + #[doc = " determine a sensible block time. For example, in the Aura pallet it will be double this"] + #[doc = " period on default settings."] + pub fn minimum_period( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u64> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Timestamp", + "MinimumPeriod", + [ + 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 parachain_info { + use super::root_mod; + use super::runtime_types; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::staging_parachain_info::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + } + pub struct TransactionApi; + impl TransactionApi {} + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod parachain_id { + use super::runtime_types; + pub type ParachainId = + runtime_types::polkadot_parachain_primitives::primitives::Id; + } + } + pub struct StorageApi; + impl StorageApi { + pub fn parachain_id( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::parachain_id::ParachainId, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "ParachainInfo", + "ParachainId", + (), + [ + 160u8, 130u8, 74u8, 181u8, 231u8, 180u8, 246u8, 152u8, 204u8, 44u8, + 245u8, 91u8, 113u8, 246u8, 218u8, 50u8, 254u8, 248u8, 35u8, 219u8, + 83u8, 144u8, 228u8, 245u8, 122u8, 53u8, 194u8, 172u8, 222u8, 118u8, + 202u8, 91u8, + ], + ) + } + } + } + } + pub mod balances { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_balances::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_balances::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + pub struct TransferAllowDeath { + pub dest: transfer_allow_death::Dest, + #[codec(compact)] + pub value: transfer_allow_death::Value, + } + pub mod transfer_allow_death { + use super::runtime_types; + pub type Dest = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for TransferAllowDeath { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "transfer_allow_death"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] + #[doc = "may be specified."] + pub struct ForceTransfer { + pub source: force_transfer::Source, + pub dest: force_transfer::Dest, + #[codec(compact)] + pub value: force_transfer::Value, + } + pub mod force_transfer { + use super::runtime_types; + pub type Source = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + pub type Dest = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceTransfer { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "force_transfer"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] + #[doc = "kill the origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer_allow_death`] instead."] + #[doc = ""] + #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] + pub struct TransferKeepAlive { + pub dest: transfer_keep_alive::Dest, + #[codec(compact)] + pub value: transfer_keep_alive::Value, + } + pub mod transfer_keep_alive { + use super::runtime_types; + pub type Dest = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + pub type Value = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for TransferKeepAlive { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "transfer_keep_alive"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true)."] + pub struct TransferAll { + pub dest: transfer_all::Dest, + pub keep_alive: transfer_all::KeepAlive, + } + pub mod transfer_all { + use super::runtime_types; + pub type Dest = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + pub type KeepAlive = ::core::primitive::bool; + } + impl ::subxt_core::blocks::StaticExtrinsic for TransferAll { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "transfer_all"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + pub struct ForceUnreserve { + pub who: force_unreserve::Who, + pub amount: force_unreserve::Amount, + } + pub mod force_unreserve { + use super::runtime_types; + pub type Who = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceUnreserve { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "force_unreserve"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Upgrade a specified account."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `who`: The account to be upgraded."] + #[doc = ""] + #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] + #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] + #[doc = "possibility of churn)."] + pub struct UpgradeAccounts { + pub who: upgrade_accounts::Who, + } + pub mod upgrade_accounts { + use super::runtime_types; + pub type Who = ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>; + } + impl ::subxt_core::blocks::StaticExtrinsic for UpgradeAccounts { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "upgrade_accounts"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the regular balance of a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + pub struct ForceSetBalance { + pub who: force_set_balance::Who, + #[codec(compact)] + pub new_free: force_set_balance::NewFree, + } + pub mod force_set_balance { + use super::runtime_types; + pub type Who = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + pub type NewFree = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceSetBalance { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "force_set_balance"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Adjust the total issuance in a saturating way."] + #[doc = ""] + #[doc = "Can only be called by root and always needs a positive `delta`."] + #[doc = ""] + #[doc = "# Example"] + pub struct ForceAdjustTotalIssuance { + pub direction: force_adjust_total_issuance::Direction, + #[codec(compact)] + pub delta: force_adjust_total_issuance::Delta, + } + pub mod force_adjust_total_issuance { + use super::runtime_types; + pub type Direction = runtime_types::pallet_balances::types::AdjustmentDirection; + pub type Delta = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceAdjustTotalIssuance { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "force_adjust_total_issuance"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Burn the specified liquid free balance from the origin account."] + #[doc = ""] + #[doc = "If the origin's account ends up below the existential deposit as a result"] + #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] + #[doc = ""] + #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] + #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] + pub struct Burn { + #[codec(compact)] + pub value: burn::Value, + pub keep_alive: burn::KeepAlive, + } + pub mod burn { + use super::runtime_types; + pub type Value = ::core::primitive::u128; + pub type KeepAlive = ::core::primitive::bool; + } + impl ::subxt_core::blocks::StaticExtrinsic for Burn { + const PALLET: &'static str = "Balances"; + const CALL: &'static str = "burn"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + pub fn transfer_allow_death( + &self, + dest: types::transfer_allow_death::Dest, + value: types::transfer_allow_death::Value, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "transfer_allow_death", + types::TransferAllowDeath { dest, value }, + [ + 51u8, 166u8, 195u8, 10u8, 139u8, 218u8, 55u8, 130u8, 6u8, 194u8, 35u8, + 140u8, 27u8, 205u8, 214u8, 222u8, 102u8, 43u8, 143u8, 145u8, 86u8, + 219u8, 210u8, 147u8, 13u8, 39u8, 51u8, 21u8, 237u8, 179u8, 132u8, + 130u8, + ], + ) + } + #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] + #[doc = "may be specified."] + pub fn force_transfer( + &self, + source: types::force_transfer::Source, + dest: types::force_transfer::Dest, + value: types::force_transfer::Value, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "force_transfer", + types::ForceTransfer { + source, + dest, + value, + }, + [ + 154u8, 93u8, 222u8, 27u8, 12u8, 248u8, 63u8, 213u8, 224u8, 86u8, 250u8, + 153u8, 249u8, 102u8, 83u8, 160u8, 79u8, 125u8, 105u8, 222u8, 77u8, + 180u8, 90u8, 105u8, 81u8, 217u8, 60u8, 25u8, 213u8, 51u8, 185u8, 96u8, + ], + ) + } + #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] + #[doc = "kill the origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer_allow_death`] instead."] + #[doc = ""] + #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] + pub fn transfer_keep_alive( + &self, + dest: types::transfer_keep_alive::Dest, + value: types::transfer_keep_alive::Value, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "transfer_keep_alive", + types::TransferKeepAlive { dest, value }, + [ + 245u8, 14u8, 190u8, 193u8, 32u8, 210u8, 74u8, 92u8, 25u8, 182u8, 76u8, + 55u8, 247u8, 83u8, 114u8, 75u8, 143u8, 236u8, 117u8, 25u8, 54u8, 157u8, + 208u8, 207u8, 233u8, 89u8, 70u8, 161u8, 235u8, 242u8, 222u8, 59u8, + ], + ) + } + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true)."] + pub fn transfer_all( + &self, + dest: types::transfer_all::Dest, + keep_alive: types::transfer_all::KeepAlive, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "transfer_all", + types::TransferAll { dest, keep_alive }, + [ + 105u8, 132u8, 49u8, 144u8, 195u8, 250u8, 34u8, 46u8, 213u8, 248u8, + 112u8, 188u8, 81u8, 228u8, 136u8, 18u8, 67u8, 172u8, 37u8, 38u8, 238u8, + 9u8, 34u8, 15u8, 67u8, 34u8, 148u8, 195u8, 223u8, 29u8, 154u8, 6u8, + ], + ) + } + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + pub fn force_unreserve( + &self, + who: types::force_unreserve::Who, + amount: types::force_unreserve::Amount, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "force_unreserve", + types::ForceUnreserve { who, amount }, + [ + 142u8, 151u8, 64u8, 205u8, 46u8, 64u8, 62u8, 122u8, 108u8, 49u8, 223u8, + 140u8, 120u8, 153u8, 35u8, 165u8, 187u8, 38u8, 157u8, 200u8, 123u8, + 199u8, 198u8, 168u8, 208u8, 159u8, 39u8, 134u8, 92u8, 103u8, 84u8, + 171u8, + ], + ) + } + #[doc = "Upgrade a specified account."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `who`: The account to be upgraded."] + #[doc = ""] + #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] + #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] + #[doc = "possibility of churn)."] + pub fn upgrade_accounts( + &self, + who: types::upgrade_accounts::Who, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "upgrade_accounts", + types::UpgradeAccounts { who }, + [ + 66u8, 200u8, 179u8, 104u8, 65u8, 2u8, 101u8, 56u8, 130u8, 161u8, 224u8, + 233u8, 255u8, 124u8, 70u8, 122u8, 8u8, 49u8, 103u8, 178u8, 68u8, 47u8, + 214u8, 166u8, 217u8, 116u8, 178u8, 50u8, 212u8, 164u8, 98u8, 226u8, + ], + ) + } + #[doc = "Set the regular balance of a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + pub fn force_set_balance( + &self, + who: types::force_set_balance::Who, + new_free: types::force_set_balance::NewFree, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "force_set_balance", + types::ForceSetBalance { who, new_free }, + [ + 114u8, 229u8, 59u8, 204u8, 180u8, 83u8, 17u8, 4u8, 59u8, 4u8, 55u8, + 39u8, 151u8, 196u8, 124u8, 60u8, 209u8, 65u8, 193u8, 11u8, 44u8, 164u8, + 116u8, 93u8, 169u8, 30u8, 199u8, 165u8, 55u8, 231u8, 223u8, 43u8, + ], + ) + } + #[doc = "Adjust the total issuance in a saturating way."] + #[doc = ""] + #[doc = "Can only be called by root and always needs a positive `delta`."] + #[doc = ""] + #[doc = "# Example"] + pub fn force_adjust_total_issuance( + &self, + direction: types::force_adjust_total_issuance::Direction, + delta: types::force_adjust_total_issuance::Delta, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "force_adjust_total_issuance", + types::ForceAdjustTotalIssuance { direction, delta }, + [ + 208u8, 134u8, 56u8, 133u8, 232u8, 164u8, 10u8, 213u8, 53u8, 193u8, + 190u8, 63u8, 236u8, 186u8, 96u8, 122u8, 104u8, 87u8, 173u8, 38u8, 58u8, + 176u8, 21u8, 78u8, 42u8, 106u8, 46u8, 248u8, 251u8, 190u8, 150u8, + 202u8, + ], + ) + } + #[doc = "Burn the specified liquid free balance from the origin account."] + #[doc = ""] + #[doc = "If the origin's account ends up below the existential deposit as a result"] + #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] + #[doc = ""] + #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] + #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] + pub fn burn( + &self, + value: types::burn::Value, + keep_alive: types::burn::KeepAlive, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Balances", + "burn", + types::Burn { value, keep_alive }, + [ + 176u8, 64u8, 7u8, 109u8, 16u8, 44u8, 145u8, 125u8, 147u8, 152u8, 130u8, + 114u8, 221u8, 201u8, 150u8, 162u8, 118u8, 71u8, 52u8, 92u8, 240u8, + 116u8, 203u8, 98u8, 5u8, 22u8, 43u8, 102u8, 94u8, 208u8, 101u8, 57u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_balances::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An account was created with some free balance."] + pub struct Endowed { + pub account: endowed::Account, + pub free_balance: endowed::FreeBalance, + } + pub mod endowed { + use super::runtime_types; + pub type Account = ::subxt_core::utils::AccountId32; + pub type FreeBalance = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Endowed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Endowed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] + #[doc = "resulting in an outright loss."] + pub struct DustLost { + pub account: dust_lost::Account, + pub amount: dust_lost::Amount, + } + pub mod dust_lost { + use super::runtime_types; + pub type Account = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for DustLost { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "DustLost"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Transfer succeeded."] + pub struct Transfer { + pub from: transfer::From, + pub to: transfer::To, + pub amount: transfer::Amount, + } + pub mod transfer { + use super::runtime_types; + pub type From = ::subxt_core::utils::AccountId32; + pub type To = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Transfer { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Transfer"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A balance was set by root."] + pub struct BalanceSet { + pub who: balance_set::Who, + pub free: balance_set::Free, + } + pub mod balance_set { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Free = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for BalanceSet { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "BalanceSet"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was reserved (moved from free to reserved)."] + pub struct Reserved { + pub who: reserved::Who, + pub amount: reserved::Amount, + } + pub mod reserved { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Reserved { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Reserved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was unreserved (moved from reserved to free)."] + pub struct Unreserved { + pub who: unreserved::Who, + pub amount: unreserved::Amount, + } + pub mod unreserved { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Unreserved { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Unreserved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was moved from the reserve of the first account to the second account."] + #[doc = "Final argument indicates the destination balance type."] + pub struct ReserveRepatriated { + pub from: reserve_repatriated::From, + pub to: reserve_repatriated::To, + pub amount: reserve_repatriated::Amount, + pub destination_status: reserve_repatriated::DestinationStatus, + } + pub mod reserve_repatriated { + use super::runtime_types; + pub type From = ::subxt_core::utils::AccountId32; + pub type To = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + pub type DestinationStatus = + runtime_types::frame_support::traits::tokens::misc::BalanceStatus; + } + impl ::subxt_core::events::StaticEvent for ReserveRepatriated { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "ReserveRepatriated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some amount was deposited (e.g. for transaction fees)."] + pub struct Deposit { + pub who: deposit::Who, + pub amount: deposit::Amount, + } + pub mod deposit { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Deposit { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Deposit"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] + pub struct Withdraw { + pub who: withdraw::Who, + pub amount: withdraw::Amount, + } + pub mod withdraw { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Withdraw { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Withdraw"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] + pub struct Slashed { + pub who: slashed::Who, + pub amount: slashed::Amount, + } + pub mod slashed { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Slashed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Slashed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some amount was minted into an account."] + pub struct Minted { + pub who: minted::Who, + pub amount: minted::Amount, + } + pub mod minted { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Minted { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Minted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some credit was balanced and added to the TotalIssuance."] + pub struct MintedCredit { + pub amount: minted_credit::Amount, + } + pub mod minted_credit { + use super::runtime_types; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for MintedCredit { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "MintedCredit"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some amount was burned from an account."] + pub struct Burned { + pub who: burned::Who, + pub amount: burned::Amount, + } + pub mod burned { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Burned { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Burned"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some debt has been dropped from the Total Issuance."] + pub struct BurnedDebt { + pub amount: burned_debt::Amount, + } + pub mod burned_debt { + use super::runtime_types; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for BurnedDebt { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "BurnedDebt"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some amount was suspended from an account (it can be restored later)."] + pub struct Suspended { + pub who: suspended::Who, + pub amount: suspended::Amount, + } + pub mod suspended { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Suspended { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Suspended"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some amount was restored into an account."] + pub struct Restored { + pub who: restored::Who, + pub amount: restored::Amount, + } + pub mod restored { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Restored { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Restored"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An account was upgraded."] + pub struct Upgraded { + pub who: upgraded::Who, + } + pub mod upgraded { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for Upgraded { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Upgraded"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Total issuance was increased by `amount`, creating a credit to be balanced."] + pub struct Issued { + pub amount: issued::Amount, + } + pub mod issued { + use super::runtime_types; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Issued { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Issued"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Total issuance was decreased by `amount`, creating a debt to be balanced."] + pub struct Rescinded { + pub amount: rescinded::Amount, + } + pub mod rescinded { + use super::runtime_types; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Rescinded { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Rescinded"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was locked."] + pub struct Locked { + pub who: locked::Who, + pub amount: locked::Amount, + } + pub mod locked { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Locked { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Locked"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was unlocked."] + pub struct Unlocked { + pub who: unlocked::Who, + pub amount: unlocked::Amount, + } + pub mod unlocked { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Unlocked { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Unlocked"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was frozen."] + pub struct Frozen { + pub who: frozen::Who, + pub amount: frozen::Amount, + } + pub mod frozen { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Frozen { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Frozen"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was thawed."] + pub struct Thawed { + pub who: thawed::Who, + pub amount: thawed::Amount, + } + pub mod thawed { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Thawed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Thawed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `TotalIssuance` was forcefully changed."] + pub struct TotalIssuanceForced { + pub old: total_issuance_forced::Old, + pub new: total_issuance_forced::New, + } + pub mod total_issuance_forced { + use super::runtime_types; + pub type Old = ::core::primitive::u128; + pub type New = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for TotalIssuanceForced { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "TotalIssuanceForced"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was placed on hold."] + pub struct Held { + pub reason: held::Reason, + pub who: held::Who, + pub amount: held::Amount, + } + pub mod held { + use super::runtime_types; + pub type Reason = runtime_types::storage_paseo_runtime::RuntimeHoldReason; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Held { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Held"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Held balance was burned from an account."] + pub struct BurnedHeld { + pub reason: burned_held::Reason, + pub who: burned_held::Who, + pub amount: burned_held::Amount, + } + pub mod burned_held { + use super::runtime_types; + pub type Reason = runtime_types::storage_paseo_runtime::RuntimeHoldReason; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for BurnedHeld { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "BurnedHeld"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A transfer of `amount` on hold from `source` to `dest` was initiated."] + pub struct TransferOnHold { + pub reason: transfer_on_hold::Reason, + pub source: transfer_on_hold::Source, + pub dest: transfer_on_hold::Dest, + pub amount: transfer_on_hold::Amount, + } + pub mod transfer_on_hold { + use super::runtime_types; + pub type Reason = runtime_types::storage_paseo_runtime::RuntimeHoldReason; + pub type Source = ::subxt_core::utils::AccountId32; + pub type Dest = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for TransferOnHold { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "TransferOnHold"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `transferred` balance is placed on hold at the `dest` account."] + pub struct TransferAndHold { + pub reason: transfer_and_hold::Reason, + pub source: transfer_and_hold::Source, + pub dest: transfer_and_hold::Dest, + pub transferred: transfer_and_hold::Transferred, + } + pub mod transfer_and_hold { + use super::runtime_types; + pub type Reason = runtime_types::storage_paseo_runtime::RuntimeHoldReason; + pub type Source = ::subxt_core::utils::AccountId32; + pub type Dest = ::subxt_core::utils::AccountId32; + pub type Transferred = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for TransferAndHold { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "TransferAndHold"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some balance was released from hold."] + pub struct Released { + pub reason: released::Reason, + pub who: released::Who, + pub amount: released::Amount, + } + pub mod released { + use super::runtime_types; + pub type Reason = runtime_types::storage_paseo_runtime::RuntimeHoldReason; + pub type Who = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for Released { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Released"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An unexpected/defensive event was triggered."] + pub struct Unexpected(pub unexpected::Field0); + pub mod unexpected { + use super::runtime_types; + pub type Field0 = runtime_types::pallet_balances::pallet::UnexpectedKind; + } + impl ::subxt_core::events::StaticEvent for Unexpected { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Unexpected"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod total_issuance { + use super::runtime_types; + pub type TotalIssuance = ::core::primitive::u128; + } + pub mod inactive_issuance { + use super::runtime_types; + pub type InactiveIssuance = ::core::primitive::u128; + } + pub mod account { + use super::runtime_types; + pub type Account = + runtime_types::pallet_balances::types::AccountData<::core::primitive::u128>; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod locks { + use super::runtime_types; + pub type Locks = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + runtime_types::pallet_balances::types::BalanceLock< + ::core::primitive::u128, + >, + >; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod reserves { + use super::runtime_types; + pub type Reserves = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_balances::types::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + 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::storage_paseo_runtime::RuntimeHoldReason, + ::core::primitive::u128, + >, + >; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod freezes { + use super::runtime_types; + pub type Freezes = runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::frame_support::traits::tokens::misc::IdAmount< + runtime_types::storage_paseo_runtime::RuntimeFreezeReason, + ::core::primitive::u128, + >, + >; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The total units issued in the system."] + pub fn total_issuance( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::total_issuance::TotalIssuance, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "TotalIssuance", + (), + [ + 116u8, 70u8, 119u8, 194u8, 69u8, 37u8, 116u8, 206u8, 171u8, 70u8, + 171u8, 210u8, 226u8, 111u8, 184u8, 204u8, 206u8, 11u8, 68u8, 72u8, + 255u8, 19u8, 194u8, 11u8, 27u8, 194u8, 81u8, 204u8, 59u8, 224u8, 202u8, + 185u8, + ], + ) + } + #[doc = " The total units of outstanding deactivated balance in the system."] + pub fn inactive_issuance( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::inactive_issuance::InactiveIssuance, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "InactiveIssuance", + (), + [ + 212u8, 185u8, 19u8, 50u8, 250u8, 72u8, 173u8, 50u8, 4u8, 104u8, 161u8, + 249u8, 77u8, 247u8, 204u8, 248u8, 11u8, 18u8, 57u8, 4u8, 82u8, 110u8, + 30u8, 216u8, 16u8, 37u8, 87u8, 67u8, 189u8, 235u8, 214u8, 155u8, + ], + ) + } + #[doc = " The Balances pallet example of storing the balance of an account."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " You can also store the balance of an account in the `System` pallet."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = System"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] + #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] + #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] + #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] + pub fn account_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::account::Account, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Account", + (), + [ + 213u8, 38u8, 200u8, 69u8, 218u8, 0u8, 112u8, 181u8, 160u8, 23u8, 96u8, + 90u8, 3u8, 88u8, 126u8, 22u8, 103u8, 74u8, 64u8, 69u8, 29u8, 247u8, + 18u8, 17u8, 234u8, 143u8, 189u8, 22u8, 247u8, 194u8, 154u8, 249u8, + ], + ) + } + #[doc = " The Balances pallet example of storing the balance of an account."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " You can also store the balance of an account in the `System` pallet."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = System"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] + #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] + #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] + #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] + pub fn account( + &self, + _0: types::account::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::account::Account, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Account", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 213u8, 38u8, 200u8, 69u8, 218u8, 0u8, 112u8, 181u8, 160u8, 23u8, 96u8, + 90u8, 3u8, 88u8, 126u8, 22u8, 103u8, 74u8, 64u8, 69u8, 29u8, 247u8, + 18u8, 17u8, 234u8, 143u8, 189u8, 22u8, 247u8, 194u8, 154u8, 249u8, + ], + ) + } + #[doc = " Any liquidity locks on some account balances."] + #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] + #[doc = ""] + #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn locks_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::locks::Locks, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Locks", + (), + [ + 10u8, 223u8, 55u8, 0u8, 249u8, 69u8, 168u8, 41u8, 75u8, 35u8, 120u8, + 167u8, 18u8, 132u8, 9u8, 20u8, 91u8, 51u8, 27u8, 69u8, 136u8, 187u8, + 13u8, 220u8, 163u8, 122u8, 26u8, 141u8, 174u8, 249u8, 85u8, 37u8, + ], + ) + } + #[doc = " Any liquidity locks on some account balances."] + #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] + #[doc = ""] + #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn locks( + &self, + _0: types::locks::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::locks::Locks, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Locks", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 10u8, 223u8, 55u8, 0u8, 249u8, 69u8, 168u8, 41u8, 75u8, 35u8, 120u8, + 167u8, 18u8, 132u8, 9u8, 20u8, 91u8, 51u8, 27u8, 69u8, 136u8, 187u8, + 13u8, 220u8, 163u8, 122u8, 26u8, 141u8, 174u8, 249u8, 85u8, 37u8, + ], + ) + } + #[doc = " Named reserves on some account balances."] + #[doc = ""] + #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn reserves_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::reserves::Reserves, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Reserves", + (), + [ + 112u8, 10u8, 241u8, 77u8, 64u8, 187u8, 106u8, 159u8, 13u8, 153u8, + 140u8, 178u8, 182u8, 50u8, 1u8, 55u8, 149u8, 92u8, 196u8, 229u8, 170u8, + 106u8, 193u8, 88u8, 255u8, 244u8, 2u8, 193u8, 62u8, 235u8, 204u8, 91u8, + ], + ) + } + #[doc = " Named reserves on some account balances."] + #[doc = ""] + #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn reserves( + &self, + _0: types::reserves::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::reserves::Reserves, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Reserves", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 112u8, 10u8, 241u8, 77u8, 64u8, 187u8, 106u8, 159u8, 13u8, 153u8, + 140u8, 178u8, 182u8, 50u8, 1u8, 55u8, 149u8, 92u8, 196u8, 229u8, 170u8, + 106u8, 193u8, 88u8, 255u8, 244u8, 2u8, 193u8, 62u8, 235u8, 204u8, 91u8, + ], + ) + } + #[doc = " Holds on account balances."] + pub fn holds_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::holds::Holds, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Holds", + (), + [ + 239u8, 165u8, 18u8, 0u8, 248u8, 25u8, 87u8, 127u8, 127u8, 142u8, 51u8, + 133u8, 184u8, 158u8, 151u8, 55u8, 117u8, 255u8, 27u8, 177u8, 50u8, + 170u8, 137u8, 217u8, 48u8, 202u8, 128u8, 25u8, 183u8, 188u8, 40u8, + 209u8, + ], + ) + } + #[doc = " Holds on account balances."] + pub fn holds( + &self, + _0: types::holds::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::holds::Holds, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Holds", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 239u8, 165u8, 18u8, 0u8, 248u8, 25u8, 87u8, 127u8, 127u8, 142u8, 51u8, + 133u8, 184u8, 158u8, 151u8, 55u8, 117u8, 255u8, 27u8, 177u8, 50u8, + 170u8, 137u8, 217u8, 48u8, 202u8, 128u8, 25u8, 183u8, 188u8, 40u8, + 209u8, + ], + ) + } + #[doc = " Freeze locks on account balances."] + pub fn freezes_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::freezes::Freezes, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Freezes", + (), + [ + 170u8, 69u8, 116u8, 92u8, 165u8, 14u8, 129u8, 179u8, 165u8, 6u8, 123u8, + 156u8, 4u8, 30u8, 25u8, 181u8, 191u8, 29u8, 3u8, 92u8, 96u8, 167u8, + 102u8, 38u8, 128u8, 140u8, 85u8, 248u8, 114u8, 127u8, 128u8, 40u8, + ], + ) + } + #[doc = " Freeze locks on account balances."] + pub fn freezes( + &self, + _0: types::freezes::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::freezes::Freezes, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Balances", + "Freezes", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 170u8, 69u8, 116u8, 92u8, 165u8, 14u8, 129u8, 179u8, 165u8, 6u8, 123u8, + 156u8, 4u8, 30u8, 25u8, 181u8, 191u8, 29u8, 3u8, 92u8, 96u8, 167u8, + 102u8, 38u8, 128u8, 140u8, 85u8, 248u8, 114u8, 127u8, 128u8, 40u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO!"] + #[doc = ""] + #[doc = " If you *really* need it to be zero, you can enable the feature `insecure_zero_ed` for"] + #[doc = " this pallet. However, you do so at your own risk: this will open up a major DoS vector."] + #[doc = " In case you have multiple sources of provider references, you may also get unexpected"] + #[doc = " behaviour if you set this to zero."] + #[doc = ""] + #[doc = " Bottom line: Do yourself a favour and make it at least one!"] + pub fn existential_deposit( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Balances", + "ExistentialDeposit", + [ + 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 number of locks that should exist on an account."] + #[doc = " Not strictly enforced, but used for weight estimation."] + #[doc = ""] + #[doc = " Use of locks is deprecated in favour of freezes. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn max_locks( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Balances", + "MaxLocks", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum number of named reserves that can exist on an account."] + #[doc = ""] + #[doc = " Use of reserves is deprecated in favour of holds. See `https://github.com/paritytech/substrate/pull/12951/`"] + pub fn max_reserves( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Balances", + "MaxReserves", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum number of individual freeze locks that can exist on an account at any time."] + pub fn max_freezes( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Balances", + "MaxFreezes", + [ + 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 transaction_payment { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_transaction_payment::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,"] + #[doc = "has been paid by `who`."] + pub struct TransactionFeePaid { + pub who: transaction_fee_paid::Who, + pub actual_fee: transaction_fee_paid::ActualFee, + pub tip: transaction_fee_paid::Tip, + } + pub mod transaction_fee_paid { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + pub type ActualFee = ::core::primitive::u128; + pub type Tip = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for TransactionFeePaid { + const PALLET: &'static str = "TransactionPayment"; + const EVENT: &'static str = "TransactionFeePaid"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod next_fee_multiplier { + use super::runtime_types; + pub type NextFeeMultiplier = + runtime_types::sp_arithmetic::fixed_point::FixedU128; + } + pub mod storage_version { + use super::runtime_types; + pub type StorageVersion = runtime_types::pallet_transaction_payment::Releases; + } + pub mod tx_payment_credit { + use super::runtime_types; + pub type TxPaymentCredit = runtime_types :: frame_support :: traits :: storage :: NoDrop < runtime_types :: frame_support :: traits :: tokens :: fungible :: imbalance :: Imbalance < :: core :: primitive :: u128 > > ; + } + } + pub struct StorageApi; + impl StorageApi { + pub fn next_fee_multiplier( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::next_fee_multiplier::NextFeeMultiplier, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "TransactionPayment", + "NextFeeMultiplier", + (), + [ + 247u8, 39u8, 81u8, 170u8, 225u8, 226u8, 82u8, 147u8, 34u8, 113u8, + 147u8, 213u8, 59u8, 80u8, 139u8, 35u8, 36u8, 196u8, 152u8, 19u8, 9u8, + 159u8, 176u8, 79u8, 249u8, 201u8, 170u8, 1u8, 129u8, 79u8, 146u8, + 197u8, + ], + ) + } + pub fn storage_version( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::storage_version::StorageVersion, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "TransactionPayment", + "StorageVersion", + (), + [ + 105u8, 243u8, 158u8, 241u8, 159u8, 231u8, 253u8, 6u8, 4u8, 32u8, 85u8, + 178u8, 126u8, 31u8, 203u8, 134u8, 154u8, 38u8, 122u8, 155u8, 150u8, + 251u8, 174u8, 15u8, 74u8, 134u8, 216u8, 244u8, 168u8, 175u8, 158u8, + 144u8, + ], + ) + } + #[doc = " The `OnChargeTransaction` stores the withdrawn tx fee here."] + #[doc = ""] + #[doc = " Use `withdraw_txfee` and `remaining_txfee` to access from outside the crate."] + pub fn tx_payment_credit( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::tx_payment_credit::TxPaymentCredit, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "TransactionPayment", + "TxPaymentCredit", + (), + [ + 39u8, 127u8, 132u8, 77u8, 25u8, 10u8, 195u8, 64u8, 255u8, 212u8, 183u8, + 177u8, 238u8, 24u8, 81u8, 65u8, 93u8, 177u8, 209u8, 134u8, 245u8, + 241u8, 252u8, 87u8, 179u8, 61u8, 168u8, 77u8, 65u8, 13u8, 72u8, 205u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " A fee multiplier for `Operational` extrinsics to compute \"virtual tip\" to boost their"] + #[doc = " `priority`"] + #[doc = ""] + #[doc = " This value is multiplied by the `final_fee` to obtain a \"virtual tip\" that is later"] + #[doc = " added to a tip component in regular `priority` calculations."] + #[doc = " It means that a `Normal` transaction can front-run a similarly-sized `Operational`"] + #[doc = " extrinsic (with no tip), by including a tip value greater than the virtual tip."] + #[doc = ""] + #[doc = " ```rust,ignore"] + #[doc = " // For `Normal`"] + #[doc = " let priority = priority_calc(tip);"] + #[doc = ""] + #[doc = " // For `Operational`"] + #[doc = " let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;"] + #[doc = " let priority = priority_calc(tip + virtual_tip);"] + #[doc = " ```"] + #[doc = ""] + #[doc = " Note that since we use `final_fee` the multiplier applies also to the regular `tip`"] + #[doc = " sent with the transaction. So, not only does the transaction get a priority bump based"] + #[doc = " on the `inclusion_fee`, but we also amplify the impact of tips applied to `Operational`"] + #[doc = " transactions."] + pub fn operational_fee_multiplier( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u8> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "TransactionPayment", + "OperationalFeeMultiplier", + [ + 141u8, 130u8, 11u8, 35u8, 226u8, 114u8, 92u8, 179u8, 168u8, 110u8, + 28u8, 91u8, 221u8, 64u8, 4u8, 148u8, 201u8, 193u8, 185u8, 66u8, 226u8, + 114u8, 97u8, 79u8, 62u8, 212u8, 202u8, 114u8, 237u8, 228u8, 183u8, + 165u8, + ], + ) + } + } + } + } + pub mod sudo { + use super::root_mod; + use super::runtime_types; + #[doc = "Error for the Sudo pallet."] + pub type Error = runtime_types::pallet_sudo::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_sudo::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + pub struct Sudo { + pub call: ::subxt_core::alloc::boxed::Box, + } + pub mod sudo { + use super::runtime_types; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + } + impl ::subxt_core::blocks::StaticExtrinsic for Sudo { + const PALLET: &'static str = "Sudo"; + const CALL: &'static str = "sudo"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Sudo user to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct SudoUncheckedWeight { + pub call: ::subxt_core::alloc::boxed::Box, + pub weight: sudo_unchecked_weight::Weight, + } + pub mod sudo_unchecked_weight { + use super::runtime_types; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; + } + impl ::subxt_core::blocks::StaticExtrinsic for SudoUncheckedWeight { + const PALLET: &'static str = "Sudo"; + const CALL: &'static str = "sudo_unchecked_weight"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] + #[doc = "key."] + pub struct SetKey { + pub new: set_key::New, + } + pub mod set_key { + use super::runtime_types; + pub type New = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetKey { + const PALLET: &'static str = "Sudo"; + const CALL: &'static str = "set_key"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] + #[doc = "a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct SudoAs { + pub who: sudo_as::Who, + pub call: ::subxt_core::alloc::boxed::Box, + } + pub mod sudo_as { + use super::runtime_types; + pub type Who = + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + } + impl ::subxt_core::blocks::StaticExtrinsic for SudoAs { + const PALLET: &'static str = "Sudo"; + const CALL: &'static str = "sudo_as"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Permanently removes the sudo key."] + #[doc = ""] + #[doc = "**This cannot be un-done.**"] + pub struct RemoveKey; + impl ::subxt_core::blocks::StaticExtrinsic for RemoveKey { + const PALLET: &'static str = "Sudo"; + const CALL: &'static str = "remove_key"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + pub fn sudo( + &self, + call: types::sudo::Call, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Sudo", + "sudo", + types::Sudo { + call: ::subxt_core::alloc::boxed::Box::new(call), + }, + [ + 210u8, 157u8, 95u8, 197u8, 59u8, 38u8, 228u8, 214u8, 99u8, 234u8, + 246u8, 190u8, 12u8, 223u8, 38u8, 78u8, 112u8, 161u8, 55u8, 105u8, 14u8, + 116u8, 116u8, 206u8, 43u8, 53u8, 92u8, 154u8, 3u8, 100u8, 6u8, 171u8, + ], + ) + } + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Sudo user to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub fn sudo_unchecked_weight( + &self, + call: types::sudo_unchecked_weight::Call, + weight: types::sudo_unchecked_weight::Weight, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Sudo", + "sudo_unchecked_weight", + types::SudoUncheckedWeight { + call: ::subxt_core::alloc::boxed::Box::new(call), + weight, + }, + [ + 176u8, 134u8, 83u8, 185u8, 53u8, 177u8, 16u8, 124u8, 58u8, 241u8, 16u8, + 250u8, 146u8, 133u8, 62u8, 30u8, 148u8, 115u8, 107u8, 115u8, 101u8, + 190u8, 167u8, 193u8, 45u8, 10u8, 15u8, 139u8, 2u8, 9u8, 195u8, 102u8, + ], + ) + } + #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] + #[doc = "key."] + pub fn set_key( + &self, + new: types::set_key::New, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Sudo", + "set_key", + types::SetKey { new }, + [ + 9u8, 73u8, 39u8, 205u8, 188u8, 127u8, 143u8, 54u8, 128u8, 94u8, 8u8, + 227u8, 197u8, 44u8, 70u8, 93u8, 228u8, 196u8, 64u8, 165u8, 226u8, + 158u8, 101u8, 192u8, 22u8, 193u8, 102u8, 84u8, 21u8, 35u8, 92u8, 198u8, + ], + ) + } + #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] + #[doc = "a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub fn sudo_as( + &self, + who: types::sudo_as::Who, + call: types::sudo_as::Call, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Sudo", + "sudo_as", + types::SudoAs { + who, + call: ::subxt_core::alloc::boxed::Box::new(call), + }, + [ + 141u8, 10u8, 101u8, 211u8, 149u8, 132u8, 101u8, 156u8, 97u8, 241u8, + 138u8, 124u8, 128u8, 156u8, 174u8, 176u8, 5u8, 18u8, 43u8, 237u8, 51u8, + 51u8, 100u8, 252u8, 20u8, 46u8, 132u8, 128u8, 231u8, 81u8, 84u8, 1u8, + ], + ) + } + #[doc = "Permanently removes the sudo key."] + #[doc = ""] + #[doc = "**This cannot be un-done.**"] + pub fn remove_key( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Sudo", + "remove_key", + types::RemoveKey {}, + [ + 133u8, 253u8, 54u8, 175u8, 202u8, 239u8, 5u8, 198u8, 180u8, 138u8, + 25u8, 28u8, 109u8, 40u8, 30u8, 56u8, 126u8, 100u8, 52u8, 205u8, 250u8, + 191u8, 61u8, 195u8, 172u8, 142u8, 184u8, 239u8, 247u8, 10u8, 211u8, + 79u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_sudo::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A sudo call just took place."] + pub struct Sudid { + pub sudo_result: sudid::SudoResult, + } + pub mod sudid { + use super::runtime_types; + pub type SudoResult = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + } + impl ::subxt_core::events::StaticEvent for Sudid { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "Sudid"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The sudo key has been updated."] + pub struct KeyChanged { + pub old: key_changed::Old, + pub new: key_changed::New, + } + pub mod key_changed { + use super::runtime_types; + pub type Old = ::core::option::Option<::subxt_core::utils::AccountId32>; + pub type New = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for KeyChanged { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "KeyChanged"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The key was permanently removed."] + pub struct KeyRemoved; + impl ::subxt_core::events::StaticEvent for KeyRemoved { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "KeyRemoved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A [sudo_as](Pallet::sudo_as) call just took place."] + pub struct SudoAsDone { + pub sudo_result: sudo_as_done::SudoResult, + } + pub mod sudo_as_done { + use super::runtime_types; + pub type SudoResult = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + } + impl ::subxt_core::events::StaticEvent for SudoAsDone { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "SudoAsDone"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod key { + use super::runtime_types; + pub type Key = ::subxt_core::utils::AccountId32; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The `AccountId` of the sudo key."] + pub fn key( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::key::Key, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Sudo", + "Key", + (), + [ + 72u8, 14u8, 225u8, 162u8, 205u8, 247u8, 227u8, 105u8, 116u8, 57u8, 4u8, + 31u8, 84u8, 137u8, 227u8, 228u8, 133u8, 245u8, 206u8, 227u8, 117u8, + 36u8, 252u8, 151u8, 107u8, 15u8, 180u8, 4u8, 4u8, 152u8, 195u8, 144u8, + ], + ) + } + } + } + } + pub mod authorship { + use super::root_mod; + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod author { + use super::runtime_types; + pub type Author = ::subxt_core::utils::AccountId32; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Author of current block."] + pub fn author( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::author::Author, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Authorship", + "Author", + (), + [ + 247u8, 192u8, 118u8, 227u8, 47u8, 20u8, 203u8, 199u8, 216u8, 87u8, + 220u8, 50u8, 166u8, 61u8, 168u8, 213u8, 253u8, 62u8, 202u8, 199u8, + 61u8, 192u8, 237u8, 53u8, 22u8, 148u8, 164u8, 245u8, 99u8, 24u8, 146u8, + 18u8, + ], + ) + } + } + } + } + pub mod collator_selection { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_collator_selection::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_collator_selection::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the list of invulnerable (fixed) collators. These collators must do some"] + #[doc = "preparation, namely to have registered session keys."] + #[doc = ""] + #[doc = "The call will remove any accounts that have not registered keys from the set. That is,"] + #[doc = "it is non-atomic; the caller accepts all `AccountId`s passed in `new` _individually_ as"] + #[doc = "acceptable Invulnerables, and is not proposing a _set_ of new Invulnerables."] + #[doc = ""] + #[doc = "This call does not maintain mutual exclusivity of `Invulnerables` and `Candidates`. It"] + #[doc = "is recommended to use a batch of `add_invulnerable` and `remove_invulnerable` instead. A"] + #[doc = "`batch_all` can also be used to enforce atomicity. If any candidates are included in"] + #[doc = "`new`, they should be removed with `remove_invulnerable_candidate` after execution."] + #[doc = ""] + #[doc = "Must be called by the `UpdateOrigin`."] + pub struct SetInvulnerables { + pub new: set_invulnerables::New, + } + pub mod set_invulnerables { + use super::runtime_types; + pub type New = ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetInvulnerables { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "set_invulnerables"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the ideal number of non-invulnerable collators. If lowering this number, then the"] + #[doc = "number of running collators could be higher than this figure. Aside from that edge case,"] + #[doc = "there should be no other way to have more candidates than the desired number."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + pub struct SetDesiredCandidates { + pub max: set_desired_candidates::Max, + } + pub mod set_desired_candidates { + use super::runtime_types; + pub type Max = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetDesiredCandidates { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "set_desired_candidates"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set the candidacy bond amount."] + #[doc = ""] + #[doc = "If the candidacy bond is increased by this call, all current candidates which have a"] + #[doc = "deposit lower than the new bond will be kicked from the list and get their deposits"] + #[doc = "back."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + pub struct SetCandidacyBond { + pub bond: set_candidacy_bond::Bond, + } + pub mod set_candidacy_bond { + use super::runtime_types; + pub type Bond = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetCandidacyBond { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "set_candidacy_bond"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Register this account as a collator candidate. The account must (a) already have"] + #[doc = "registered session keys and (b) be able to reserve the `CandidacyBond`."] + #[doc = ""] + #[doc = "This call is not available to `Invulnerable` collators."] + pub struct RegisterAsCandidate; + impl ::subxt_core::blocks::StaticExtrinsic for RegisterAsCandidate { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "register_as_candidate"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Deregister `origin` as a collator candidate. Note that the collator can only leave on"] + #[doc = "session change. The `CandidacyBond` will be unreserved immediately."] + #[doc = ""] + #[doc = "This call will fail if the total number of candidates would drop below"] + #[doc = "`MinEligibleCollators`."] + pub struct LeaveIntent; + impl ::subxt_core::blocks::StaticExtrinsic for LeaveIntent { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "leave_intent"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Add a new account `who` to the list of `Invulnerables` collators. `who` must have"] + #[doc = "registered session keys. If `who` is a candidate, they will be removed."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + pub struct AddInvulnerable { + pub who: add_invulnerable::Who, + } + pub mod add_invulnerable { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::blocks::StaticExtrinsic for AddInvulnerable { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "add_invulnerable"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Remove an account `who` from the list of `Invulnerables` collators. `Invulnerables` must"] + #[doc = "be sorted."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + pub struct RemoveInvulnerable { + pub who: remove_invulnerable::Who, + } + pub mod remove_invulnerable { + use super::runtime_types; + pub type Who = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::blocks::StaticExtrinsic for RemoveInvulnerable { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "remove_invulnerable"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Update the candidacy bond of collator candidate `origin` to a new amount `new_deposit`."] + #[doc = ""] + #[doc = "Setting a `new_deposit` that is lower than the current deposit while `origin` is"] + #[doc = "occupying a top-`DesiredCandidates` slot is not allowed."] + #[doc = ""] + #[doc = "This call will fail if `origin` is not a collator candidate, the updated bond is lower"] + #[doc = "than the minimum candidacy bond, and/or the amount cannot be reserved."] + pub struct UpdateBond { + pub new_deposit: update_bond::NewDeposit, + } + pub mod update_bond { + use super::runtime_types; + pub type NewDeposit = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for UpdateBond { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "update_bond"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The caller `origin` replaces a candidate `target` in the collator candidate list by"] + #[doc = "reserving `deposit`. The amount `deposit` reserved by the caller must be greater than"] + #[doc = "the existing bond of the target it is trying to replace."] + #[doc = ""] + #[doc = "This call will fail if the caller is already a collator candidate or invulnerable, the"] + #[doc = "caller does not have registered session keys, the target is not a collator candidate,"] + #[doc = "and/or the `deposit` amount cannot be reserved."] + pub struct TakeCandidateSlot { + pub deposit: take_candidate_slot::Deposit, + pub target: take_candidate_slot::Target, + } + pub mod take_candidate_slot { + use super::runtime_types; + pub type Deposit = ::core::primitive::u128; + pub type Target = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::blocks::StaticExtrinsic for TakeCandidateSlot { + const PALLET: &'static str = "CollatorSelection"; + const CALL: &'static str = "take_candidate_slot"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the list of invulnerable (fixed) collators. These collators must do some"] + #[doc = "preparation, namely to have registered session keys."] + #[doc = ""] + #[doc = "The call will remove any accounts that have not registered keys from the set. That is,"] + #[doc = "it is non-atomic; the caller accepts all `AccountId`s passed in `new` _individually_ as"] + #[doc = "acceptable Invulnerables, and is not proposing a _set_ of new Invulnerables."] + #[doc = ""] + #[doc = "This call does not maintain mutual exclusivity of `Invulnerables` and `Candidates`. It"] + #[doc = "is recommended to use a batch of `add_invulnerable` and `remove_invulnerable` instead. A"] + #[doc = "`batch_all` can also be used to enforce atomicity. If any candidates are included in"] + #[doc = "`new`, they should be removed with `remove_invulnerable_candidate` after execution."] + #[doc = ""] + #[doc = "Must be called by the `UpdateOrigin`."] + pub fn set_invulnerables( + &self, + new: types::set_invulnerables::New, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "set_invulnerables", + types::SetInvulnerables { new }, + [ + 113u8, 217u8, 14u8, 48u8, 6u8, 198u8, 8u8, 170u8, 8u8, 237u8, 230u8, + 184u8, 17u8, 181u8, 15u8, 126u8, 117u8, 3u8, 208u8, 215u8, 40u8, 16u8, + 150u8, 162u8, 37u8, 196u8, 235u8, 36u8, 247u8, 24u8, 187u8, 17u8, + ], + ) + } + #[doc = "Set the ideal number of non-invulnerable collators. If lowering this number, then the"] + #[doc = "number of running collators could be higher than this figure. Aside from that edge case,"] + #[doc = "there should be no other way to have more candidates than the desired number."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + pub fn set_desired_candidates( + &self, + max: types::set_desired_candidates::Max, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "set_desired_candidates", + types::SetDesiredCandidates { max }, + [ + 174u8, 44u8, 232u8, 155u8, 228u8, 219u8, 239u8, 75u8, 86u8, 150u8, + 135u8, 214u8, 58u8, 9u8, 25u8, 133u8, 245u8, 101u8, 85u8, 246u8, 15u8, + 248u8, 165u8, 87u8, 88u8, 28u8, 10u8, 196u8, 86u8, 89u8, 28u8, 165u8, + ], + ) + } + #[doc = "Set the candidacy bond amount."] + #[doc = ""] + #[doc = "If the candidacy bond is increased by this call, all current candidates which have a"] + #[doc = "deposit lower than the new bond will be kicked from the list and get their deposits"] + #[doc = "back."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + pub fn set_candidacy_bond( + &self, + bond: types::set_candidacy_bond::Bond, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "set_candidacy_bond", + types::SetCandidacyBond { bond }, + [ + 250u8, 4u8, 185u8, 228u8, 101u8, 223u8, 49u8, 44u8, 172u8, 148u8, + 216u8, 242u8, 192u8, 88u8, 228u8, 59u8, 225u8, 222u8, 171u8, 40u8, + 23u8, 1u8, 46u8, 183u8, 189u8, 191u8, 156u8, 12u8, 218u8, 116u8, 76u8, + 59u8, + ], + ) + } + #[doc = "Register this account as a collator candidate. The account must (a) already have"] + #[doc = "registered session keys and (b) be able to reserve the `CandidacyBond`."] + #[doc = ""] + #[doc = "This call is not available to `Invulnerable` collators."] + pub fn register_as_candidate( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "register_as_candidate", + types::RegisterAsCandidate {}, + [ + 69u8, 222u8, 214u8, 106u8, 105u8, 168u8, 82u8, 239u8, 158u8, 117u8, + 224u8, 89u8, 228u8, 51u8, 221u8, 244u8, 88u8, 63u8, 72u8, 119u8, 224u8, + 111u8, 93u8, 39u8, 18u8, 66u8, 72u8, 105u8, 70u8, 66u8, 178u8, 173u8, + ], + ) + } + #[doc = "Deregister `origin` as a collator candidate. Note that the collator can only leave on"] + #[doc = "session change. The `CandidacyBond` will be unreserved immediately."] + #[doc = ""] + #[doc = "This call will fail if the total number of candidates would drop below"] + #[doc = "`MinEligibleCollators`."] + pub fn leave_intent( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "leave_intent", + types::LeaveIntent {}, + [ + 126u8, 57u8, 10u8, 67u8, 120u8, 229u8, 70u8, 23u8, 154u8, 215u8, 226u8, + 178u8, 203u8, 152u8, 195u8, 177u8, 157u8, 158u8, 40u8, 17u8, 93u8, + 225u8, 253u8, 217u8, 48u8, 165u8, 55u8, 79u8, 43u8, 123u8, 193u8, + 147u8, + ], + ) + } + #[doc = "Add a new account `who` to the list of `Invulnerables` collators. `who` must have"] + #[doc = "registered session keys. If `who` is a candidate, they will be removed."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + pub fn add_invulnerable( + &self, + who: types::add_invulnerable::Who, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "add_invulnerable", + types::AddInvulnerable { who }, + [ + 115u8, 109u8, 38u8, 19u8, 81u8, 194u8, 124u8, 140u8, 239u8, 23u8, 85u8, + 62u8, 241u8, 83u8, 11u8, 241u8, 14u8, 34u8, 206u8, 63u8, 104u8, 78u8, + 96u8, 182u8, 173u8, 198u8, 230u8, 107u8, 102u8, 6u8, 164u8, 75u8, + ], + ) + } + #[doc = "Remove an account `who` from the list of `Invulnerables` collators. `Invulnerables` must"] + #[doc = "be sorted."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + pub fn remove_invulnerable( + &self, + who: types::remove_invulnerable::Who, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "remove_invulnerable", + types::RemoveInvulnerable { who }, + [ + 103u8, 146u8, 23u8, 136u8, 61u8, 65u8, 172u8, 157u8, 216u8, 200u8, + 119u8, 28u8, 189u8, 215u8, 13u8, 100u8, 102u8, 13u8, 94u8, 12u8, 78u8, + 156u8, 149u8, 74u8, 126u8, 118u8, 127u8, 49u8, 129u8, 2u8, 12u8, 118u8, + ], + ) + } + #[doc = "Update the candidacy bond of collator candidate `origin` to a new amount `new_deposit`."] + #[doc = ""] + #[doc = "Setting a `new_deposit` that is lower than the current deposit while `origin` is"] + #[doc = "occupying a top-`DesiredCandidates` slot is not allowed."] + #[doc = ""] + #[doc = "This call will fail if `origin` is not a collator candidate, the updated bond is lower"] + #[doc = "than the minimum candidacy bond, and/or the amount cannot be reserved."] + pub fn update_bond( + &self, + new_deposit: types::update_bond::NewDeposit, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "update_bond", + types::UpdateBond { new_deposit }, + [ + 47u8, 184u8, 193u8, 220u8, 160u8, 1u8, 253u8, 203u8, 8u8, 142u8, 43u8, + 151u8, 190u8, 138u8, 201u8, 174u8, 233u8, 112u8, 200u8, 247u8, 251u8, + 94u8, 23u8, 224u8, 150u8, 179u8, 190u8, 140u8, 199u8, 50u8, 2u8, 249u8, + ], + ) + } + #[doc = "The caller `origin` replaces a candidate `target` in the collator candidate list by"] + #[doc = "reserving `deposit`. The amount `deposit` reserved by the caller must be greater than"] + #[doc = "the existing bond of the target it is trying to replace."] + #[doc = ""] + #[doc = "This call will fail if the caller is already a collator candidate or invulnerable, the"] + #[doc = "caller does not have registered session keys, the target is not a collator candidate,"] + #[doc = "and/or the `deposit` amount cannot be reserved."] + pub fn take_candidate_slot( + &self, + deposit: types::take_candidate_slot::Deposit, + target: types::take_candidate_slot::Target, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "CollatorSelection", + "take_candidate_slot", + types::TakeCandidateSlot { deposit, target }, + [ + 48u8, 150u8, 189u8, 206u8, 199u8, 196u8, 173u8, 3u8, 206u8, 10u8, 50u8, + 160u8, 15u8, 53u8, 189u8, 126u8, 154u8, 36u8, 90u8, 66u8, 235u8, 12u8, + 107u8, 44u8, 117u8, 33u8, 207u8, 194u8, 251u8, 194u8, 224u8, 80u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_collator_selection::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "New Invulnerables were set."] + pub struct NewInvulnerables { + pub invulnerables: new_invulnerables::Invulnerables, + } + pub mod new_invulnerables { + use super::runtime_types; + pub type Invulnerables = + ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>; + } + impl ::subxt_core::events::StaticEvent for NewInvulnerables { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "NewInvulnerables"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A new Invulnerable was added."] + pub struct InvulnerableAdded { + pub account_id: invulnerable_added::AccountId, + } + pub mod invulnerable_added { + use super::runtime_types; + pub type AccountId = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for InvulnerableAdded { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "InvulnerableAdded"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An Invulnerable was removed."] + pub struct InvulnerableRemoved { + pub account_id: invulnerable_removed::AccountId, + } + pub mod invulnerable_removed { + use super::runtime_types; + pub type AccountId = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for InvulnerableRemoved { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "InvulnerableRemoved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The number of desired candidates was set."] + pub struct NewDesiredCandidates { + pub desired_candidates: new_desired_candidates::DesiredCandidates, + } + pub mod new_desired_candidates { + use super::runtime_types; + pub type DesiredCandidates = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for NewDesiredCandidates { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "NewDesiredCandidates"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The candidacy bond was set."] + pub struct NewCandidacyBond { + pub bond_amount: new_candidacy_bond::BondAmount, + } + pub mod new_candidacy_bond { + use super::runtime_types; + pub type BondAmount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for NewCandidacyBond { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "NewCandidacyBond"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A new candidate joined."] + pub struct CandidateAdded { + pub account_id: candidate_added::AccountId, + pub deposit: candidate_added::Deposit, + } + pub mod candidate_added { + use super::runtime_types; + pub type AccountId = ::subxt_core::utils::AccountId32; + pub type Deposit = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for CandidateAdded { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "CandidateAdded"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Bond of a candidate updated."] + pub struct CandidateBondUpdated { + pub account_id: candidate_bond_updated::AccountId, + pub deposit: candidate_bond_updated::Deposit, + } + pub mod candidate_bond_updated { + use super::runtime_types; + pub type AccountId = ::subxt_core::utils::AccountId32; + pub type Deposit = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for CandidateBondUpdated { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "CandidateBondUpdated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A candidate was removed."] + pub struct CandidateRemoved { + pub account_id: candidate_removed::AccountId, + } + pub mod candidate_removed { + use super::runtime_types; + pub type AccountId = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for CandidateRemoved { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "CandidateRemoved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An account was replaced in the candidate list by another one."] + pub struct CandidateReplaced { + pub old: candidate_replaced::Old, + pub new: candidate_replaced::New, + pub deposit: candidate_replaced::Deposit, + } + pub mod candidate_replaced { + use super::runtime_types; + pub type Old = ::subxt_core::utils::AccountId32; + pub type New = ::subxt_core::utils::AccountId32; + pub type Deposit = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for CandidateReplaced { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "CandidateReplaced"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An account was unable to be added to the Invulnerables because they did not have keys"] + #[doc = "registered. Other Invulnerables may have been set."] + pub struct InvalidInvulnerableSkipped { + pub account_id: invalid_invulnerable_skipped::AccountId, + } + pub mod invalid_invulnerable_skipped { + use super::runtime_types; + pub type AccountId = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for InvalidInvulnerableSkipped { + const PALLET: &'static str = "CollatorSelection"; + const EVENT: &'static str = "InvalidInvulnerableSkipped"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod invulnerables { + use super::runtime_types; + pub type Invulnerables = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt_core::utils::AccountId32, + >; + } + pub mod candidate_list { + use super::runtime_types; + pub type CandidateList = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_collator_selection::pallet::CandidateInfo< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + >, + >; + } + pub mod last_authored_block { + use super::runtime_types; + pub type LastAuthoredBlock = ::core::primitive::u32; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod desired_candidates { + use super::runtime_types; + pub type DesiredCandidates = ::core::primitive::u32; + } + pub mod candidacy_bond { + use super::runtime_types; + pub type CandidacyBond = ::core::primitive::u128; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The invulnerable, permissioned collators. This list must be sorted."] + pub fn invulnerables( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::invulnerables::Invulnerables, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "CollatorSelection", + "Invulnerables", + (), + [ + 109u8, 180u8, 25u8, 41u8, 152u8, 158u8, 186u8, 214u8, 89u8, 222u8, + 103u8, 14u8, 91u8, 3u8, 65u8, 6u8, 255u8, 62u8, 47u8, 255u8, 132u8, + 164u8, 217u8, 200u8, 130u8, 29u8, 168u8, 23u8, 81u8, 217u8, 35u8, + 123u8, + ], + ) + } + #[doc = " The (community, limited) collation candidates. `Candidates` and `Invulnerables` should be"] + #[doc = " mutually exclusive."] + #[doc = ""] + #[doc = " This list is sorted in ascending order by deposit and when the deposits are equal, the least"] + #[doc = " recently updated is considered greater."] + pub fn candidate_list( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::candidate_list::CandidateList, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "CollatorSelection", + "CandidateList", + (), + [ + 77u8, 195u8, 89u8, 139u8, 79u8, 111u8, 151u8, 215u8, 19u8, 152u8, 67u8, + 49u8, 74u8, 76u8, 3u8, 60u8, 51u8, 140u8, 6u8, 134u8, 159u8, 55u8, + 196u8, 57u8, 189u8, 31u8, 219u8, 218u8, 164u8, 189u8, 196u8, 60u8, + ], + ) + } + #[doc = " Last block authored by collator."] + pub fn last_authored_block_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::last_authored_block::LastAuthoredBlock, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "CollatorSelection", + "LastAuthoredBlock", + (), + [ + 176u8, 170u8, 165u8, 244u8, 101u8, 126u8, 24u8, 132u8, 228u8, 138u8, + 72u8, 241u8, 144u8, 100u8, 79u8, 112u8, 9u8, 46u8, 210u8, 80u8, 12u8, + 126u8, 32u8, 214u8, 26u8, 171u8, 155u8, 3u8, 233u8, 22u8, 164u8, 25u8, + ], + ) + } + #[doc = " Last block authored by collator."] + pub fn last_authored_block( + &self, + _0: types::last_authored_block::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::last_authored_block::Param0, + >, + types::last_authored_block::LastAuthoredBlock, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "CollatorSelection", + "LastAuthoredBlock", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 176u8, 170u8, 165u8, 244u8, 101u8, 126u8, 24u8, 132u8, 228u8, 138u8, + 72u8, 241u8, 144u8, 100u8, 79u8, 112u8, 9u8, 46u8, 210u8, 80u8, 12u8, + 126u8, 32u8, 214u8, 26u8, 171u8, 155u8, 3u8, 233u8, 22u8, 164u8, 25u8, + ], + ) + } + #[doc = " Desired number of candidates."] + #[doc = ""] + #[doc = " This should ideally always be less than [`Config::MaxCandidates`] for weights to be correct."] + pub fn desired_candidates( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::desired_candidates::DesiredCandidates, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "CollatorSelection", + "DesiredCandidates", + (), + [ + 69u8, 199u8, 130u8, 132u8, 10u8, 127u8, 204u8, 220u8, 59u8, 107u8, + 96u8, 180u8, 42u8, 235u8, 14u8, 126u8, 231u8, 242u8, 162u8, 126u8, + 63u8, 223u8, 15u8, 250u8, 22u8, 210u8, 54u8, 34u8, 235u8, 191u8, 250u8, + 21u8, + ], + ) + } + #[doc = " Fixed amount to deposit to become a collator."] + #[doc = ""] + #[doc = " When a collator calls `leave_intent` they immediately receive the deposit back."] + pub fn candidacy_bond( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::candidacy_bond::CandidacyBond, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "CollatorSelection", + "CandidacyBond", + (), + [ + 71u8, 134u8, 156u8, 102u8, 201u8, 83u8, 240u8, 251u8, 189u8, 213u8, + 211u8, 182u8, 126u8, 122u8, 41u8, 174u8, 105u8, 29u8, 216u8, 23u8, + 255u8, 55u8, 245u8, 187u8, 234u8, 234u8, 178u8, 155u8, 145u8, 49u8, + 196u8, 214u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Account Identifier from which the internal Pot is generated."] + pub fn pot_id( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::frame_support::PalletId, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "CollatorSelection", + "PotId", + [ + 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 = " Maximum number of candidates that we should have."] + #[doc = ""] + #[doc = " This does not take into account the invulnerables."] + pub fn max_candidates( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "CollatorSelection", + "MaxCandidates", + [ + 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 = " Minimum number eligible collators. Should always be greater than zero. This includes"] + #[doc = " Invulnerable collators. This ensures that there will always be one collator who can"] + #[doc = " produce a block."] + pub fn min_eligible_collators( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "CollatorSelection", + "MinEligibleCollators", + [ + 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 invulnerables."] + pub fn max_invulnerables( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "CollatorSelection", + "MaxInvulnerables", + [ + 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 kick_threshold( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "CollatorSelection", + "KickThreshold", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Gets this pallet's derived pot account."] + pub fn pot_account( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::subxt_core::utils::AccountId32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "CollatorSelection", + "pot_account", + [ + 115u8, 233u8, 13u8, 223u8, 88u8, 20u8, 202u8, 139u8, 153u8, 28u8, + 155u8, 157u8, 224u8, 66u8, 3u8, 250u8, 23u8, 53u8, 88u8, 168u8, 211u8, + 204u8, 122u8, 166u8, 248u8, 23u8, 174u8, 225u8, 99u8, 108u8, 89u8, + 135u8, + ], + ) + } + } + } + } + pub mod session { + use super::root_mod; + use super::runtime_types; + #[doc = "Error for the session pallet."] + pub type Error = runtime_types::pallet_session::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_session::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = ""] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "- `origin`: The dispatch origin of this function must be signed."] + #[doc = "- `keys`: The new session keys to set. These are the public keys of all sessions keys"] + #[doc = " setup in the runtime."] + #[doc = "- `proof`: The proof that `origin` has access to the private keys of `keys`. See"] + #[doc = " [`impl_opaque_keys`](sp_runtime::impl_opaque_keys) for more information about the"] + #[doc = " proof format."] + pub struct SetKeys { + pub keys: set_keys::Keys, + pub proof: set_keys::Proof, + } + pub mod set_keys { + use super::runtime_types; + pub type Keys = runtime_types::storage_paseo_runtime::SessionKeys; + pub type Proof = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetKeys { + const PALLET: &'static str = "Session"; + const CALL: &'static str = "set_keys"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + pub struct PurgeKeys; + impl ::subxt_core::blocks::StaticExtrinsic for PurgeKeys { + const PALLET: &'static str = "Session"; + const CALL: &'static str = "purge_keys"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = ""] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "- `origin`: The dispatch origin of this function must be signed."] + #[doc = "- `keys`: The new session keys to set. These are the public keys of all sessions keys"] + #[doc = " setup in the runtime."] + #[doc = "- `proof`: The proof that `origin` has access to the private keys of `keys`. See"] + #[doc = " [`impl_opaque_keys`](sp_runtime::impl_opaque_keys) for more information about the"] + #[doc = " proof format."] + pub fn set_keys( + &self, + keys: types::set_keys::Keys, + proof: types::set_keys::Proof, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Session", + "set_keys", + types::SetKeys { keys, proof }, + [ + 219u8, 63u8, 235u8, 242u8, 176u8, 248u8, 204u8, 20u8, 121u8, 176u8, + 105u8, 242u8, 190u8, 124u8, 153u8, 219u8, 12u8, 224u8, 196u8, 18u8, + 183u8, 159u8, 33u8, 97u8, 44u8, 64u8, 0u8, 10u8, 52u8, 181u8, 70u8, + 206u8, + ], + ) + } + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + pub fn purge_keys( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Session", + "purge_keys", + types::PurgeKeys {}, + [ + 215u8, 204u8, 146u8, 236u8, 32u8, 78u8, 198u8, 79u8, 85u8, 214u8, 15u8, + 151u8, 158u8, 31u8, 146u8, 119u8, 119u8, 204u8, 151u8, 169u8, 226u8, + 67u8, 217u8, 39u8, 241u8, 245u8, 203u8, 240u8, 203u8, 172u8, 16u8, + 209u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_session::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "New session has happened. Note that the argument is the session index, not the"] + #[doc = "block number as the type might suggest."] + pub struct NewSession { + pub session_index: new_session::SessionIndex, + } + pub mod new_session { + use super::runtime_types; + pub type SessionIndex = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for NewSession { + const PALLET: &'static str = "Session"; + const EVENT: &'static str = "NewSession"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `NewSession` event in the current block also implies a new validator set to be"] + #[doc = "queued."] + pub struct NewQueued; + impl ::subxt_core::events::StaticEvent for NewQueued { + const PALLET: &'static str = "Session"; + const EVENT: &'static str = "NewQueued"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Validator has been disabled."] + pub struct ValidatorDisabled { + pub validator: validator_disabled::Validator, + } + pub mod validator_disabled { + use super::runtime_types; + pub type Validator = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for ValidatorDisabled { + const PALLET: &'static str = "Session"; + const EVENT: &'static str = "ValidatorDisabled"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Validator has been re-enabled."] + pub struct ValidatorReenabled { + pub validator: validator_reenabled::Validator, + } + pub mod validator_reenabled { + use super::runtime_types; + pub type Validator = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for ValidatorReenabled { + const PALLET: &'static str = "Session"; + const EVENT: &'static str = "ValidatorReenabled"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod validators { + use super::runtime_types; + pub type Validators = + ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>; + } + pub mod current_index { + use super::runtime_types; + pub type CurrentIndex = ::core::primitive::u32; + } + pub mod queued_changed { + use super::runtime_types; + pub type QueuedChanged = ::core::primitive::bool; + } + pub mod queued_keys { + use super::runtime_types; + pub type QueuedKeys = ::subxt_core::alloc::vec::Vec<( + ::subxt_core::utils::AccountId32, + runtime_types::storage_paseo_runtime::SessionKeys, + )>; + } + pub mod disabled_validators { + use super::runtime_types; + pub type DisabledValidators = ::subxt_core::alloc::vec::Vec<( + ::core::primitive::u32, + runtime_types::sp_staking::offence::OffenceSeverity, + )>; + } + pub mod next_keys { + use super::runtime_types; + pub type NextKeys = runtime_types::storage_paseo_runtime::SessionKeys; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod key_owner { + use super::runtime_types; + pub type KeyOwner = ::subxt_core::utils::AccountId32; + pub type Param0 = ( + runtime_types::sp_core::crypto::KeyTypeId, + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ); + } + pub mod externally_set_keys { + use super::runtime_types; + pub type ExternallySetKeys = (); + pub type Param0 = ::subxt_core::utils::AccountId32; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The current set of validators."] + pub fn validators( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::validators::Validators, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "Validators", + (), + [ + 50u8, 86u8, 154u8, 222u8, 249u8, 209u8, 156u8, 22u8, 155u8, 25u8, + 133u8, 194u8, 210u8, 50u8, 38u8, 28u8, 139u8, 201u8, 90u8, 139u8, + 115u8, 12u8, 12u8, 141u8, 4u8, 178u8, 201u8, 241u8, 223u8, 234u8, 6u8, + 86u8, + ], + ) + } + #[doc = " Current index of the session."] + pub fn current_index( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::current_index::CurrentIndex, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "CurrentIndex", + (), + [ + 167u8, 151u8, 125u8, 150u8, 159u8, 21u8, 78u8, 217u8, 237u8, 183u8, + 135u8, 65u8, 187u8, 114u8, 188u8, 206u8, 16u8, 32u8, 69u8, 208u8, + 134u8, 159u8, 232u8, 224u8, 243u8, 27u8, 31u8, 166u8, 145u8, 44u8, + 221u8, 230u8, + ], + ) + } + #[doc = " True if the underlying economic identities or weighting behind the validators"] + #[doc = " has changed in the queued validator set."] + pub fn queued_changed( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::queued_changed::QueuedChanged, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "QueuedChanged", + (), + [ + 184u8, 137u8, 224u8, 137u8, 31u8, 236u8, 95u8, 164u8, 102u8, 225u8, + 198u8, 227u8, 140u8, 37u8, 113u8, 57u8, 59u8, 4u8, 202u8, 102u8, 117u8, + 36u8, 226u8, 64u8, 113u8, 141u8, 199u8, 111u8, 99u8, 144u8, 198u8, + 153u8, + ], + ) + } + #[doc = " The queued keys for the next session. When the next session begins, these keys"] + #[doc = " will be used to determine the validator's session keys."] + pub fn queued_keys( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::queued_keys::QueuedKeys, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "QueuedKeys", + (), + [ + 205u8, 110u8, 116u8, 201u8, 29u8, 220u8, 3u8, 147u8, 3u8, 236u8, 73u8, + 108u8, 108u8, 173u8, 76u8, 44u8, 102u8, 69u8, 47u8, 90u8, 185u8, 162u8, + 57u8, 23u8, 210u8, 45u8, 18u8, 242u8, 10u8, 95u8, 67u8, 109u8, + ], + ) + } + #[doc = " Indices of disabled validators."] + #[doc = ""] + #[doc = " The vec is always kept sorted so that we can find whether a given validator is"] + #[doc = " disabled using binary search. It gets cleared when `on_session_ending` returns"] + #[doc = " a new set of identities."] + pub fn disabled_validators( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::disabled_validators::DisabledValidators, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "DisabledValidators", + (), + [ + 214u8, 48u8, 28u8, 150u8, 143u8, 29u8, 183u8, 40u8, 236u8, 227u8, + 195u8, 5u8, 202u8, 54u8, 184u8, 26u8, 239u8, 237u8, 113u8, 39u8, 200u8, + 111u8, 163u8, 3u8, 24u8, 101u8, 107u8, 91u8, 228u8, 135u8, 12u8, 86u8, + ], + ) + } + #[doc = " The next session keys for a validator."] + pub fn next_keys_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::next_keys::NextKeys, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "NextKeys", + (), + [ + 45u8, 92u8, 45u8, 21u8, 150u8, 181u8, 197u8, 56u8, 229u8, 146u8, 183u8, + 210u8, 56u8, 197u8, 9u8, 202u8, 226u8, 183u8, 110u8, 173u8, 100u8, + 75u8, 248u8, 207u8, 215u8, 163u8, 13u8, 113u8, 222u8, 128u8, 18u8, + 192u8, + ], + ) + } + #[doc = " The next session keys for a validator."] + pub fn next_keys( + &self, + _0: types::next_keys::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::next_keys::NextKeys, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "NextKeys", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 45u8, 92u8, 45u8, 21u8, 150u8, 181u8, 197u8, 56u8, 229u8, 146u8, 183u8, + 210u8, 56u8, 197u8, 9u8, 202u8, 226u8, 183u8, 110u8, 173u8, 100u8, + 75u8, 248u8, 207u8, 215u8, 163u8, 13u8, 113u8, 222u8, 128u8, 18u8, + 192u8, + ], + ) + } + #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] + pub fn key_owner_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::key_owner::KeyOwner, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "KeyOwner", + (), + [ + 217u8, 204u8, 21u8, 114u8, 247u8, 129u8, 32u8, 242u8, 93u8, 91u8, + 253u8, 253u8, 248u8, 90u8, 12u8, 202u8, 195u8, 25u8, 18u8, 100u8, + 253u8, 109u8, 88u8, 77u8, 217u8, 140u8, 51u8, 40u8, 118u8, 35u8, 107u8, + 206u8, + ], + ) + } + #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] + pub fn key_owner( + &self, + _0: types::key_owner::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::key_owner::KeyOwner, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "KeyOwner", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 217u8, 204u8, 21u8, 114u8, 247u8, 129u8, 32u8, 242u8, 93u8, 91u8, + 253u8, 253u8, 248u8, 90u8, 12u8, 202u8, 195u8, 25u8, 18u8, 100u8, + 253u8, 109u8, 88u8, 77u8, 217u8, 140u8, 51u8, 40u8, 118u8, 35u8, 107u8, + 206u8, + ], + ) + } + #[doc = " Accounts whose keys were set via `SessionInterface` (external path) without"] + #[doc = " incrementing the consumer reference or placing a key deposit. `do_purge_keys`"] + #[doc = " only decrements consumers for accounts that were registered through the local"] + #[doc = " session pallet."] + pub fn externally_set_keys_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::externally_set_keys::ExternallySetKeys, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "ExternallySetKeys", + (), + [ + 103u8, 36u8, 104u8, 62u8, 115u8, 230u8, 203u8, 146u8, 219u8, 182u8, + 233u8, 0u8, 192u8, 190u8, 156u8, 191u8, 219u8, 33u8, 130u8, 215u8, + 198u8, 202u8, 146u8, 77u8, 184u8, 40u8, 152u8, 66u8, 192u8, 235u8, + 162u8, 109u8, + ], + ) + } + #[doc = " Accounts whose keys were set via `SessionInterface` (external path) without"] + #[doc = " incrementing the consumer reference or placing a key deposit. `do_purge_keys`"] + #[doc = " only decrements consumers for accounts that were registered through the local"] + #[doc = " session pallet."] + pub fn externally_set_keys( + &self, + _0: types::externally_set_keys::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::externally_set_keys::Param0, + >, + types::externally_set_keys::ExternallySetKeys, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Session", + "ExternallySetKeys", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 103u8, 36u8, 104u8, 62u8, 115u8, 230u8, 203u8, 146u8, 219u8, 182u8, + 233u8, 0u8, 192u8, 190u8, 156u8, 191u8, 219u8, 33u8, 130u8, 215u8, + 198u8, 202u8, 146u8, 77u8, 184u8, 40u8, 152u8, 66u8, 192u8, 235u8, + 162u8, 109u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The amount to be held when setting keys."] + pub fn key_deposit( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Session", + "KeyDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + } + } + } + pub mod aura { + use super::root_mod; + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod authorities { + use super::runtime_types; + pub type Authorities = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public, + >; + } + pub mod current_slot { + use super::runtime_types; + pub type CurrentSlot = runtime_types::sp_consensus_slots::Slot; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The current authority set."] + pub fn authorities( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::authorities::Authorities, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Aura", + "Authorities", + (), + [ + 95u8, 52u8, 203u8, 53u8, 254u8, 107u8, 134u8, 122u8, 95u8, 253u8, 51u8, + 137u8, 142u8, 106u8, 237u8, 248u8, 159u8, 80u8, 41u8, 233u8, 137u8, + 133u8, 13u8, 217u8, 176u8, 88u8, 132u8, 199u8, 241u8, 47u8, 125u8, + 27u8, + ], + ) + } + #[doc = " The current slot of this block."] + #[doc = ""] + #[doc = " This will be set in `on_initialize`."] + pub fn current_slot( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::current_slot::CurrentSlot, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Aura", + "CurrentSlot", + (), + [ + 112u8, 199u8, 115u8, 248u8, 217u8, 242u8, 45u8, 231u8, 178u8, 53u8, + 236u8, 167u8, 219u8, 238u8, 81u8, 243u8, 39u8, 140u8, 68u8, 19u8, + 201u8, 169u8, 211u8, 133u8, 135u8, 213u8, 150u8, 105u8, 60u8, 252u8, + 43u8, 57u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The slot duration Aura should run with, expressed in milliseconds."] + #[doc = ""] + #[doc = " The effective value of this type can be changed with a runtime upgrade."] + #[doc = ""] + #[doc = " For backwards compatibility either use [`MinimumPeriodTimesTwo`] or a const."] + pub fn slot_duration( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u64> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Aura", + "SlotDuration", + [ + 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 aura_ext { + use super::root_mod; + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod authorities { + use super::runtime_types; + pub type Authorities = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public, + >; + } + pub mod relay_slot_info { + use super::runtime_types; + pub type RelaySlotInfo = ( + runtime_types::sp_consensus_slots::Slot, + ::core::primitive::u32, + ); + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Serves as cache for the authorities."] + #[doc = ""] + #[doc = " The authorities in AuRa are overwritten in `on_initialize` when we switch to a new session,"] + #[doc = " but we require the old authorities to verify the seal when validating a PoV. This will"] + #[doc = " always be updated to the latest AuRa authorities in `on_finalize`."] + pub fn authorities( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::authorities::Authorities, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "AuraExt", + "Authorities", + (), + [ + 95u8, 52u8, 203u8, 53u8, 254u8, 107u8, 134u8, 122u8, 95u8, 253u8, 51u8, + 137u8, 142u8, 106u8, 237u8, 248u8, 159u8, 80u8, 41u8, 233u8, 137u8, + 133u8, 13u8, 217u8, 176u8, 88u8, 132u8, 199u8, 241u8, 47u8, 125u8, + 27u8, + ], + ) + } + #[doc = " Current relay chain slot paired with a number of authored blocks."] + #[doc = ""] + #[doc = " This is updated in [`FixedVelocityConsensusHook::on_state_proof`] with the current relay"] + #[doc = " chain slot as provided by the relay chain state proof."] + pub fn relay_slot_info( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::relay_slot_info::RelaySlotInfo, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "AuraExt", + "RelaySlotInfo", + (), + [ + 11u8, 108u8, 55u8, 103u8, 229u8, 143u8, 64u8, 46u8, 237u8, 138u8, + 124u8, 27u8, 85u8, 52u8, 235u8, 93u8, 234u8, 78u8, 240u8, 22u8, 83u8, + 157u8, 169u8, 243u8, 220u8, 87u8, 174u8, 125u8, 63u8, 251u8, 83u8, + 228u8, + ], + ) + } + } + } + } + pub mod xcmp_queue { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::cumulus_pallet_xcmp_queue::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::cumulus_pallet_xcmp_queue::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Suspends all XCM executions for the XCMP queue, regardless of the sender's origin."] + #[doc = ""] + #[doc = "- `origin`: Must pass `ControllerOrigin`."] + pub struct SuspendXcmExecution; + impl ::subxt_core::blocks::StaticExtrinsic for SuspendXcmExecution { + const PALLET: &'static str = "XcmpQueue"; + const CALL: &'static str = "suspend_xcm_execution"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Resumes all XCM executions for the XCMP queue."] + #[doc = ""] + #[doc = "Note that this function doesn't change the status of the in/out bound channels."] + #[doc = ""] + #[doc = "- `origin`: Must pass `ControllerOrigin`."] + pub struct ResumeXcmExecution; + impl ::subxt_core::blocks::StaticExtrinsic for ResumeXcmExecution { + const PALLET: &'static str = "XcmpQueue"; + const CALL: &'static str = "resume_xcm_execution"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Overwrites the number of pages which must be in the queue for the other side to be"] + #[doc = "told to suspend their sending."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.suspend_value`"] + pub struct UpdateSuspendThreshold { + pub new: update_suspend_threshold::New, + } + pub mod update_suspend_threshold { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for UpdateSuspendThreshold { + const PALLET: &'static str = "XcmpQueue"; + const CALL: &'static str = "update_suspend_threshold"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Overwrites the number of pages which must be in the queue after which we drop any"] + #[doc = "further messages from the channel."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.drop_threshold`"] + pub struct UpdateDropThreshold { + pub new: update_drop_threshold::New, + } + pub mod update_drop_threshold { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for UpdateDropThreshold { + const PALLET: &'static str = "XcmpQueue"; + const CALL: &'static str = "update_drop_threshold"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Overwrites the number of pages which the queue must be reduced to before it signals"] + #[doc = "that message sending may recommence after it has been suspended."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.resume_threshold`"] + pub struct UpdateResumeThreshold { + pub new: update_resume_threshold::New, + } + pub mod update_resume_threshold { + use super::runtime_types; + pub type New = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for UpdateResumeThreshold { + const PALLET: &'static str = "XcmpQueue"; + const CALL: &'static str = "update_resume_threshold"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Suspends all XCM executions for the XCMP queue, regardless of the sender's origin."] + #[doc = ""] + #[doc = "- `origin`: Must pass `ControllerOrigin`."] + pub fn suspend_xcm_execution( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "XcmpQueue", + "suspend_xcm_execution", + types::SuspendXcmExecution {}, + [ + 54u8, 120u8, 33u8, 251u8, 74u8, 56u8, 29u8, 76u8, 104u8, 218u8, 115u8, + 198u8, 148u8, 237u8, 9u8, 191u8, 241u8, 48u8, 33u8, 24u8, 60u8, 144u8, + 22u8, 78u8, 58u8, 50u8, 26u8, 188u8, 231u8, 42u8, 201u8, 76u8, + ], + ) + } + #[doc = "Resumes all XCM executions for the XCMP queue."] + #[doc = ""] + #[doc = "Note that this function doesn't change the status of the in/out bound channels."] + #[doc = ""] + #[doc = "- `origin`: Must pass `ControllerOrigin`."] + pub fn resume_xcm_execution( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "XcmpQueue", + "resume_xcm_execution", + types::ResumeXcmExecution {}, + [ + 173u8, 231u8, 78u8, 253u8, 108u8, 234u8, 199u8, 124u8, 184u8, 154u8, + 95u8, 194u8, 13u8, 77u8, 175u8, 7u8, 7u8, 112u8, 161u8, 72u8, 133u8, + 71u8, 63u8, 218u8, 97u8, 226u8, 133u8, 6u8, 93u8, 177u8, 247u8, 109u8, + ], + ) + } + #[doc = "Overwrites the number of pages which must be in the queue for the other side to be"] + #[doc = "told to suspend their sending."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.suspend_value`"] + pub fn update_suspend_threshold( + &self, + new: types::update_suspend_threshold::New, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "XcmpQueue", + "update_suspend_threshold", + types::UpdateSuspendThreshold { new }, + [ + 64u8, 91u8, 172u8, 51u8, 220u8, 174u8, 54u8, 47u8, 57u8, 89u8, 75u8, + 39u8, 126u8, 198u8, 143u8, 35u8, 70u8, 125u8, 167u8, 14u8, 17u8, 18u8, + 146u8, 222u8, 100u8, 92u8, 81u8, 239u8, 173u8, 43u8, 42u8, 174u8, + ], + ) + } + #[doc = "Overwrites the number of pages which must be in the queue after which we drop any"] + #[doc = "further messages from the channel."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.drop_threshold`"] + pub fn update_drop_threshold( + &self, + new: types::update_drop_threshold::New, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "XcmpQueue", + "update_drop_threshold", + types::UpdateDropThreshold { new }, + [ + 123u8, 54u8, 12u8, 180u8, 165u8, 198u8, 141u8, 200u8, 149u8, 168u8, + 186u8, 237u8, 162u8, 91u8, 89u8, 242u8, 229u8, 16u8, 32u8, 254u8, 59u8, + 168u8, 31u8, 134u8, 217u8, 251u8, 0u8, 102u8, 113u8, 194u8, 175u8, 9u8, + ], + ) + } + #[doc = "Overwrites the number of pages which the queue must be reduced to before it signals"] + #[doc = "that message sending may recommence after it has been suspended."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.resume_threshold`"] + pub fn update_resume_threshold( + &self, + new: types::update_resume_threshold::New, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "XcmpQueue", + "update_resume_threshold", + types::UpdateResumeThreshold { new }, + [ + 172u8, 136u8, 11u8, 106u8, 42u8, 157u8, 167u8, 183u8, 87u8, 62u8, + 182u8, 17u8, 184u8, 59u8, 215u8, 230u8, 18u8, 243u8, 212u8, 34u8, 54u8, + 188u8, 95u8, 119u8, 173u8, 20u8, 91u8, 206u8, 212u8, 57u8, 136u8, 77u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::cumulus_pallet_xcmp_queue::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An HRMP message was sent to a sibling parachain."] + pub struct XcmpMessageSent { + pub message_hash: xcmp_message_sent::MessageHash, + } + pub mod xcmp_message_sent { + use super::runtime_types; + pub type MessageHash = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for XcmpMessageSent { + const PALLET: &'static str = "XcmpQueue"; + const EVENT: &'static str = "XcmpMessageSent"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod inbound_xcmp_suspended { + use super::runtime_types; + pub type InboundXcmpSuspended = + runtime_types::bounded_collections::bounded_btree_set::BoundedBTreeSet< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >; + } + pub mod outbound_xcmp_status { + use super::runtime_types; + pub type OutboundXcmpStatus = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::cumulus_pallet_xcmp_queue::OutboundChannelDetails, + >; + } + pub mod outbound_xcmp_messages { + use super::runtime_types; + pub type OutboundXcmpMessages = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + ::core::primitive::u8, + >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + pub type Param1 = ::core::primitive::u16; + } + pub mod signal_messages { + use super::runtime_types; + pub type SignalMessages = + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + ::core::primitive::u8, + >; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + pub mod queue_config { + use super::runtime_types; + pub type QueueConfig = + runtime_types::cumulus_pallet_xcmp_queue::QueueConfigData; + } + pub mod queue_suspended { + use super::runtime_types; + pub type QueueSuspended = ::core::primitive::bool; + } + pub mod delivery_fee_factor { + use super::runtime_types; + pub type DeliveryFeeFactor = + runtime_types::sp_arithmetic::fixed_point::FixedU128; + pub type Param0 = runtime_types::polkadot_parachain_primitives::primitives::Id; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The suspended inbound XCMP channels. All others are not suspended."] + #[doc = ""] + #[doc = " This is a `StorageValue` instead of a `StorageMap` since we expect multiple reads per block"] + #[doc = " to different keys with a one byte payload. The access to `BoundedBTreeSet` will be cached"] + #[doc = " within the block and therefore only included once in the proof size."] + #[doc = ""] + #[doc = " NOTE: The PoV benchmarking cannot know this and will over-estimate, but the actual proof"] + #[doc = " will be smaller."] + pub fn inbound_xcmp_suspended( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::inbound_xcmp_suspended::InboundXcmpSuspended, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "InboundXcmpSuspended", + (), + [ + 110u8, 23u8, 239u8, 104u8, 136u8, 224u8, 179u8, 180u8, 40u8, 159u8, + 54u8, 15u8, 55u8, 111u8, 75u8, 147u8, 131u8, 127u8, 9u8, 57u8, 133u8, + 70u8, 175u8, 181u8, 232u8, 49u8, 13u8, 19u8, 59u8, 151u8, 179u8, 215u8, + ], + ) + } + #[doc = " The non-empty XCMP channels in order of becoming non-empty, and the index of the first"] + #[doc = " and last outbound message. If the two indices are equal, then it indicates an empty"] + #[doc = " queue and there must be a non-`Ok` `OutboundStatus`. We assume queues grow no greater"] + #[doc = " than 65535 items. Queue indices for normal messages begin at one; zero is reserved in"] + #[doc = " case of the need to send a high-priority signal message this block."] + #[doc = " The bool is true if there is a signal message waiting to be sent."] + pub fn outbound_xcmp_status( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::outbound_xcmp_status::OutboundXcmpStatus, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "OutboundXcmpStatus", + (), + [ + 13u8, 206u8, 22u8, 3u8, 237u8, 137u8, 239u8, 6u8, 114u8, 145u8, 66u8, + 94u8, 105u8, 20u8, 47u8, 97u8, 240u8, 42u8, 86u8, 24u8, 164u8, 46u8, + 253u8, 201u8, 115u8, 155u8, 96u8, 7u8, 224u8, 126u8, 150u8, 115u8, + ], + ) + } + #[doc = " The messages outbound in a given XCMP channel."] + pub fn outbound_xcmp_messages_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::outbound_xcmp_messages::OutboundXcmpMessages, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "OutboundXcmpMessages", + (), + [ + 163u8, 69u8, 82u8, 238u8, 52u8, 57u8, 181u8, 23u8, 138u8, 75u8, 43u8, + 208u8, 209u8, 195u8, 180u8, 199u8, 174u8, 101u8, 28u8, 248u8, 76u8, + 190u8, 140u8, 116u8, 251u8, 123u8, 160u8, 119u8, 204u8, 91u8, 59u8, + 234u8, + ], + ) + } + #[doc = " The messages outbound in a given XCMP channel."] + pub fn outbound_xcmp_messages_iter1( + &self, + _0: types::outbound_xcmp_messages::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::outbound_xcmp_messages::Param0, + >, + types::outbound_xcmp_messages::OutboundXcmpMessages, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "OutboundXcmpMessages", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 163u8, 69u8, 82u8, 238u8, 52u8, 57u8, 181u8, 23u8, 138u8, 75u8, 43u8, + 208u8, 209u8, 195u8, 180u8, 199u8, 174u8, 101u8, 28u8, 248u8, 76u8, + 190u8, 140u8, 116u8, 251u8, 123u8, 160u8, 119u8, 204u8, 91u8, 59u8, + 234u8, + ], + ) + } + #[doc = " The messages outbound in a given XCMP channel."] + pub fn outbound_xcmp_messages( + &self, + _0: types::outbound_xcmp_messages::Param0, + _1: types::outbound_xcmp_messages::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::outbound_xcmp_messages::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::outbound_xcmp_messages::Param1, + >, + ), + types::outbound_xcmp_messages::OutboundXcmpMessages, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "OutboundXcmpMessages", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 163u8, 69u8, 82u8, 238u8, 52u8, 57u8, 181u8, 23u8, 138u8, 75u8, 43u8, + 208u8, 209u8, 195u8, 180u8, 199u8, 174u8, 101u8, 28u8, 248u8, 76u8, + 190u8, 140u8, 116u8, 251u8, 123u8, 160u8, 119u8, 204u8, 91u8, 59u8, + 234u8, + ], + ) + } + #[doc = " Any signal messages waiting to be sent."] + pub fn signal_messages_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::signal_messages::SignalMessages, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "SignalMessages", + (), + [ + 35u8, 133u8, 54u8, 149u8, 97u8, 64u8, 30u8, 174u8, 154u8, 60u8, 119u8, + 92u8, 207u8, 67u8, 151u8, 242u8, 6u8, 128u8, 60u8, 204u8, 15u8, 135u8, + 36u8, 234u8, 29u8, 122u8, 220u8, 28u8, 243u8, 152u8, 217u8, 61u8, + ], + ) + } + #[doc = " Any signal messages waiting to be sent."] + pub fn signal_messages( + &self, + _0: types::signal_messages::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::signal_messages::Param0, + >, + types::signal_messages::SignalMessages, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "SignalMessages", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 35u8, 133u8, 54u8, 149u8, 97u8, 64u8, 30u8, 174u8, 154u8, 60u8, 119u8, + 92u8, 207u8, 67u8, 151u8, 242u8, 6u8, 128u8, 60u8, 204u8, 15u8, 135u8, + 36u8, 234u8, 29u8, 122u8, 220u8, 28u8, 243u8, 152u8, 217u8, 61u8, + ], + ) + } + #[doc = " The configuration which controls the dynamics of the outbound queue."] + pub fn queue_config( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::queue_config::QueueConfig, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "QueueConfig", + (), + [ + 185u8, 67u8, 247u8, 243u8, 211u8, 232u8, 57u8, 240u8, 237u8, 181u8, + 23u8, 114u8, 215u8, 128u8, 193u8, 1u8, 176u8, 53u8, 110u8, 195u8, + 148u8, 80u8, 187u8, 143u8, 62u8, 30u8, 143u8, 34u8, 248u8, 109u8, 3u8, + 141u8, + ], + ) + } + #[doc = " Whether or not the XCMP queue is suspended from executing incoming XCMs or not."] + pub fn queue_suspended( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::queue_suspended::QueueSuspended, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "QueueSuspended", + (), + [ + 165u8, 66u8, 105u8, 244u8, 113u8, 43u8, 177u8, 252u8, 212u8, 243u8, + 143u8, 184u8, 87u8, 51u8, 163u8, 104u8, 29u8, 84u8, 119u8, 74u8, 233u8, + 129u8, 203u8, 105u8, 2u8, 101u8, 19u8, 170u8, 69u8, 253u8, 80u8, 132u8, + ], + ) + } + #[doc = " The factor to multiply the base delivery fee by."] + pub fn delivery_fee_factor_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::delivery_fee_factor::DeliveryFeeFactor, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "DeliveryFeeFactor", + (), + [ + 43u8, 5u8, 63u8, 235u8, 115u8, 155u8, 130u8, 27u8, 75u8, 216u8, 177u8, + 135u8, 203u8, 147u8, 167u8, 95u8, 208u8, 188u8, 25u8, 14u8, 84u8, 63u8, + 116u8, 41u8, 148u8, 110u8, 115u8, 215u8, 196u8, 36u8, 75u8, 102u8, + ], + ) + } + #[doc = " The factor to multiply the base delivery fee by."] + pub fn delivery_fee_factor( + &self, + _0: types::delivery_fee_factor::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::delivery_fee_factor::Param0, + >, + types::delivery_fee_factor::DeliveryFeeFactor, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "XcmpQueue", + "DeliveryFeeFactor", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 43u8, 5u8, 63u8, 235u8, 115u8, 155u8, 130u8, 27u8, 75u8, 216u8, 177u8, + 135u8, 203u8, 147u8, 167u8, 95u8, 208u8, 188u8, 25u8, 14u8, 84u8, 63u8, + 116u8, 41u8, 148u8, 110u8, 115u8, 215u8, 196u8, 36u8, 75u8, 102u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The maximum number of inbound XCMP channels that can be suspended simultaneously."] + #[doc = ""] + #[doc = " Any further channel suspensions will fail and messages may get dropped without further"] + #[doc = " notice. Choosing a high value (1000) is okay; the trade-off that is described in"] + #[doc = " [`InboundXcmpSuspended`] still applies at that scale."] + pub fn max_inbound_suspended( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "XcmpQueue", + "MaxInboundSuspended", + [ + 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 = " Maximal number of outbound XCMP channels that can have messages queued at the same time."] + #[doc = ""] + #[doc = " If this is reached, then no further messages can be sent to channels that do not yet"] + #[doc = " have a message queued. This should be set to the expected maximum of outbound channels"] + #[doc = " which is determined by [`Self::ChannelInfo`]. It is important to set this large enough,"] + #[doc = " since otherwise the congestion control protocol will not work as intended and messages"] + #[doc = " may be dropped. This value increases the PoV and should therefore not be picked too"] + #[doc = " high. Governance needs to pay attention to not open more channels than this value."] + pub fn max_active_outbound_channels( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "XcmpQueue", + "MaxActiveOutboundChannels", + [ + 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 maximal page size for HRMP message pages."] + #[doc = ""] + #[doc = " A lower limit can be set dynamically, but this is the hard-limit for the PoV worst case"] + #[doc = " benchmarking. The limit for the size of a message is slightly below this, since some"] + #[doc = " overhead is incurred for encoding the format."] + pub fn max_page_size( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "XcmpQueue", + "MaxPageSize", + [ + 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 polkadot_xcm { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_xcm::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_xcm::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Send { + pub dest: ::subxt_core::alloc::boxed::Box, + pub message: ::subxt_core::alloc::boxed::Box, + } + pub mod send { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Message = runtime_types::xcm::VersionedXcm; + } + impl ::subxt_core::blocks::StaticExtrinsic for Send { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "send"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` chain."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub struct TeleportAssets { + pub dest: ::subxt_core::alloc::boxed::Box, + pub beneficiary: ::subxt_core::alloc::boxed::Box, + pub assets: ::subxt_core::alloc::boxed::Box, + pub fee_asset_item: teleport_assets::FeeAssetItem, + } + pub mod teleport_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for TeleportAssets { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "teleport_assets"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve."] + #[doc = ""] + #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] + #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] + #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] + #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] + #[doc = ""] + #[doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub struct ReserveTransferAssets { + pub dest: ::subxt_core::alloc::boxed::Box, + pub beneficiary: + ::subxt_core::alloc::boxed::Box, + pub assets: ::subxt_core::alloc::boxed::Box, + pub fee_asset_item: reserve_transfer_assets::FeeAssetItem, + } + pub mod reserve_transfer_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for ReserveTransferAssets { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "reserve_transfer_assets"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Execute an XCM message from a local, signed, origin."] + #[doc = ""] + #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] + #[doc = "partially."] + #[doc = ""] + #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] + #[doc = "the maximum amount of weight that the message could take to be executed, then no"] + #[doc = "execution attempt will be made."] + pub struct Execute { + pub message: ::subxt_core::alloc::boxed::Box, + pub max_weight: execute::MaxWeight, + } + pub mod execute { + use super::runtime_types; + pub type Message = runtime_types::xcm::VersionedXcm; + pub type MaxWeight = runtime_types::sp_weights::weight_v2::Weight; + } + impl ::subxt_core::blocks::StaticExtrinsic for Execute { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "execute"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Extoll that a particular destination can be communicated with through a particular"] + #[doc = "version of XCM."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The destination that is being described."] + #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] + pub struct ForceXcmVersion { + pub location: ::subxt_core::alloc::boxed::Box, + pub version: force_xcm_version::Version, + } + pub mod force_xcm_version { + use super::runtime_types; + pub type Location = runtime_types::staging_xcm::v5::location::Location; + pub type Version = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceXcmVersion { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "force_xcm_version"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] + #[doc = "version a destination can accept is unknown)."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] + pub struct ForceDefaultXcmVersion { + pub maybe_xcm_version: force_default_xcm_version::MaybeXcmVersion, + } + pub mod force_default_xcm_version { + use super::runtime_types; + pub type MaybeXcmVersion = ::core::option::Option<::core::primitive::u32>; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceDefaultXcmVersion { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "force_default_xcm_version"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] + pub struct ForceSubscribeVersionNotify { + pub location: + ::subxt_core::alloc::boxed::Box, + } + pub mod force_subscribe_version_notify { + use super::runtime_types; + pub type Location = runtime_types::xcm::VersionedLocation; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceSubscribeVersionNotify { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "force_subscribe_version_notify"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] + #[doc = "version changes."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] + #[doc = " notifications which we no longer desire."] + pub struct ForceUnsubscribeVersionNotify { + pub location: + ::subxt_core::alloc::boxed::Box, + } + pub mod force_unsubscribe_version_notify { + use super::runtime_types; + pub type Location = runtime_types::xcm::VersionedLocation; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceUnsubscribeVersionNotify { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "force_unsubscribe_version_notify"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve."] + #[doc = ""] + #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] + #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] + #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] + #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub struct LimitedReserveTransferAssets { + pub dest: + ::subxt_core::alloc::boxed::Box, + pub beneficiary: ::subxt_core::alloc::boxed::Box< + limited_reserve_transfer_assets::Beneficiary, + >, + pub assets: + ::subxt_core::alloc::boxed::Box, + pub fee_asset_item: limited_reserve_transfer_assets::FeeAssetItem, + pub weight_limit: limited_reserve_transfer_assets::WeightLimit, + } + pub mod limited_reserve_transfer_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; + } + impl ::subxt_core::blocks::StaticExtrinsic for LimitedReserveTransferAssets { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "limited_reserve_transfer_assets"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` chain."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub struct LimitedTeleportAssets { + pub dest: ::subxt_core::alloc::boxed::Box, + pub beneficiary: + ::subxt_core::alloc::boxed::Box, + pub assets: ::subxt_core::alloc::boxed::Box, + pub fee_asset_item: limited_teleport_assets::FeeAssetItem, + pub weight_limit: limited_teleport_assets::WeightLimit, + } + pub mod limited_teleport_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; + } + impl ::subxt_core::blocks::StaticExtrinsic for LimitedTeleportAssets { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "limited_teleport_assets"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set or unset the global suspension state of the XCM executor."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `suspended`: `true` to suspend, `false` to resume."] + pub struct ForceSuspension { + pub suspended: force_suspension::Suspended, + } + pub mod force_suspension { + use super::runtime_types; + pub type Suspended = ::core::primitive::bool; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceSuspension { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "force_suspension"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve, or through teleports."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] + #[doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] + #[doc = "operation will fail and the sent assets may be at risk."] + #[doc = ""] + #[doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] + #[doc = "to `dest`, no limitations imposed on `fees`."] + #[doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] + #[doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] + #[doc = " `beneficiary`."] + #[doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] + #[doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] + #[doc = " to `beneficiary`."] + #[doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] + #[doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] + #[doc = " and deposit reserve-based assets to `beneficiary`."] + #[doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] + #[doc = " assets and deposit them to `beneficiary`."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] + #[doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] + #[doc = " from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub struct TransferAssets { + pub dest: ::subxt_core::alloc::boxed::Box, + pub beneficiary: ::subxt_core::alloc::boxed::Box, + pub assets: ::subxt_core::alloc::boxed::Box, + pub fee_asset_item: transfer_assets::FeeAssetItem, + pub weight_limit: transfer_assets::WeightLimit, + } + pub mod transfer_assets { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type FeeAssetItem = ::core::primitive::u32; + pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; + } + impl ::subxt_core::blocks::StaticExtrinsic for TransferAssets { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "transfer_assets"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] + #[doc = ""] + #[doc = "- `origin`: Anyone can call this extrinsic."] + #[doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] + #[doc = "was the latest when they were trapped."] + #[doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] + pub struct ClaimAssets { + pub assets: ::subxt_core::alloc::boxed::Box, + pub beneficiary: ::subxt_core::alloc::boxed::Box, + } + pub mod claim_assets { + use super::runtime_types; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type Beneficiary = runtime_types::xcm::VersionedLocation; + } + impl ::subxt_core::blocks::StaticExtrinsic for ClaimAssets { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "claim_assets"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] + #[doc = "types for assets and fees."] + #[doc = ""] + #[doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] + #[doc = "provide the `assets_transfer_type` to be used for `assets`:"] + #[doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] + #[doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] + #[doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] + #[doc = " the remote `reserve` is Asset Hub."] + #[doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] + #[doc = " mint/teleport assets and deposit them to `beneficiary`."] + #[doc = ""] + #[doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] + #[doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] + #[doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] + #[doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] + #[doc = "specified through `fees_transfer_type`."] + #[doc = ""] + #[doc = "The caller needs to specify what should happen to the transferred assets once they reach"] + #[doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] + #[doc = "contains the instructions to execute on `dest` as a final step."] + #[doc = " This is usually as simple as:"] + #[doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] + #[doc = " but could be something more exotic like sending the `assets` even further."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] + #[doc = " parachain across a bridge to another ecosystem destination."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] + #[doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] + #[doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] + #[doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] + #[doc = " transfer, which also determines what happens to the assets on the destination chain."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub struct TransferAssetsUsingTypeAndThen { + pub dest: + ::subxt_core::alloc::boxed::Box, + pub assets: ::subxt_core::alloc::boxed::Box< + transfer_assets_using_type_and_then::Assets, + >, + pub assets_transfer_type: ::subxt_core::alloc::boxed::Box< + transfer_assets_using_type_and_then::AssetsTransferType, + >, + pub remote_fees_id: ::subxt_core::alloc::boxed::Box< + transfer_assets_using_type_and_then::RemoteFeesId, + >, + pub fees_transfer_type: ::subxt_core::alloc::boxed::Box< + transfer_assets_using_type_and_then::FeesTransferType, + >, + pub custom_xcm_on_dest: ::subxt_core::alloc::boxed::Box< + transfer_assets_using_type_and_then::CustomXcmOnDest, + >, + pub weight_limit: transfer_assets_using_type_and_then::WeightLimit, + } + pub mod transfer_assets_using_type_and_then { + use super::runtime_types; + pub type Dest = runtime_types::xcm::VersionedLocation; + pub type Assets = runtime_types::xcm::VersionedAssets; + pub type AssetsTransferType = + runtime_types::staging_xcm_executor::traits::asset_transfer::TransferType; + pub type RemoteFeesId = runtime_types::xcm::VersionedAssetId; + pub type FeesTransferType = + runtime_types::staging_xcm_executor::traits::asset_transfer::TransferType; + pub type CustomXcmOnDest = runtime_types::xcm::VersionedXcm; + pub type WeightLimit = runtime_types::xcm::v3::WeightLimit; + } + impl ::subxt_core::blocks::StaticExtrinsic for TransferAssetsUsingTypeAndThen { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "transfer_assets_using_type_and_then"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] + #[doc = "The `aliaser` is only authorized until the provided `expiry` block number."] + #[doc = "The call can also be used for a previously authorized alias in order to update its"] + #[doc = "`expiry` block number."] + #[doc = ""] + #[doc = "Usually useful to allow your local account to be aliased into from a remote location"] + #[doc = "also under your control (like your account on another chain)."] + #[doc = ""] + #[doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] + #[doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] + #[doc = "`origin` in XCM programs executed on the local chain."] + pub struct AddAuthorizedAlias { + pub aliaser: ::subxt_core::alloc::boxed::Box, + pub expires: add_authorized_alias::Expires, + } + pub mod add_authorized_alias { + use super::runtime_types; + pub type Aliaser = runtime_types::xcm::VersionedLocation; + pub type Expires = ::core::option::Option<::core::primitive::u64>; + } + impl ::subxt_core::blocks::StaticExtrinsic for AddAuthorizedAlias { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "add_authorized_alias"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] + #[doc = "the local `origin` making this call."] + pub struct RemoveAuthorizedAlias { + pub aliaser: ::subxt_core::alloc::boxed::Box, + } + pub mod remove_authorized_alias { + use super::runtime_types; + pub type Aliaser = runtime_types::xcm::VersionedLocation; + } + impl ::subxt_core::blocks::StaticExtrinsic for RemoveAuthorizedAlias { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "remove_authorized_alias"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] + #[doc = "making this call."] + pub struct RemoveAllAuthorizedAliases; + impl ::subxt_core::blocks::StaticExtrinsic for RemoveAllAuthorizedAliases { + const PALLET: &'static str = "PolkadotXcm"; + const CALL: &'static str = "remove_all_authorized_aliases"; + } + } + pub struct TransactionApi; + impl TransactionApi { + pub fn send( + &self, + dest: types::send::Dest, + message: types::send::Message, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "send", + types::Send { + dest: ::subxt_core::alloc::boxed::Box::new(dest), + message: ::subxt_core::alloc::boxed::Box::new(message), + }, + [ + 209u8, 111u8, 170u8, 6u8, 115u8, 11u8, 18u8, 171u8, 249u8, 3u8, 67u8, + 107u8, 212u8, 16u8, 140u8, 96u8, 29u8, 157u8, 20u8, 1u8, 21u8, 19u8, + 105u8, 188u8, 10u8, 5u8, 87u8, 67u8, 71u8, 188u8, 35u8, 66u8, + ], + ) + } + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` chain."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub fn teleport_assets( + &self, + dest: types::teleport_assets::Dest, + beneficiary: types::teleport_assets::Beneficiary, + assets: types::teleport_assets::Assets, + fee_asset_item: types::teleport_assets::FeeAssetItem, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "teleport_assets", + types::TeleportAssets { + dest: ::subxt_core::alloc::boxed::Box::new(dest), + beneficiary: ::subxt_core::alloc::boxed::Box::new(beneficiary), + assets: ::subxt_core::alloc::boxed::Box::new(assets), + fee_asset_item, + }, + [ + 31u8, 60u8, 0u8, 220u8, 157u8, 38u8, 28u8, 140u8, 79u8, 243u8, 182u8, + 229u8, 158u8, 45u8, 213u8, 132u8, 149u8, 196u8, 212u8, 239u8, 23u8, + 19u8, 69u8, 27u8, 250u8, 110u8, 193u8, 60u8, 227u8, 252u8, 174u8, 35u8, + ], + ) + } + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve."] + #[doc = ""] + #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] + #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] + #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] + #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] + #[doc = ""] + #[doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] + #[doc = "with all fees taken as needed from the asset."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + pub fn reserve_transfer_assets( + &self, + dest: types::reserve_transfer_assets::Dest, + beneficiary: types::reserve_transfer_assets::Beneficiary, + assets: types::reserve_transfer_assets::Assets, + fee_asset_item: types::reserve_transfer_assets::FeeAssetItem, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "reserve_transfer_assets", + types::ReserveTransferAssets { + dest: ::subxt_core::alloc::boxed::Box::new(dest), + beneficiary: ::subxt_core::alloc::boxed::Box::new(beneficiary), + assets: ::subxt_core::alloc::boxed::Box::new(assets), + fee_asset_item, + }, + [ + 76u8, 122u8, 201u8, 193u8, 160u8, 210u8, 58u8, 150u8, 236u8, 130u8, + 225u8, 28u8, 35u8, 9u8, 206u8, 235u8, 14u8, 101u8, 193u8, 118u8, 145u8, + 230u8, 112u8, 65u8, 172u8, 251u8, 62u8, 64u8, 130u8, 223u8, 153u8, + 139u8, + ], + ) + } + #[doc = "Execute an XCM message from a local, signed, origin."] + #[doc = ""] + #[doc = "An event is deposited indicating whether `msg` could be executed completely or only"] + #[doc = "partially."] + #[doc = ""] + #[doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] + #[doc = "the maximum amount of weight that the message could take to be executed, then no"] + #[doc = "execution attempt will be made."] + pub fn execute( + &self, + message: types::execute::Message, + max_weight: types::execute::MaxWeight, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "execute", + types::Execute { + message: ::subxt_core::alloc::boxed::Box::new(message), + max_weight, + }, + [ + 122u8, 9u8, 129u8, 102u8, 188u8, 214u8, 143u8, 187u8, 175u8, 221u8, + 157u8, 67u8, 208u8, 30u8, 97u8, 133u8, 171u8, 14u8, 144u8, 97u8, 18u8, + 124u8, 196u8, 254u8, 70u8, 31u8, 175u8, 197u8, 230u8, 36u8, 147u8, + 211u8, + ], + ) + } + #[doc = "Extoll that a particular destination can be communicated with through a particular"] + #[doc = "version of XCM."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The destination that is being described."] + #[doc = "- `xcm_version`: The latest version of XCM that `location` supports."] + pub fn force_xcm_version( + &self, + location: types::force_xcm_version::Location, + version: types::force_xcm_version::Version, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "force_xcm_version", + types::ForceXcmVersion { + location: ::subxt_core::alloc::boxed::Box::new(location), + version, + }, + [ + 136u8, 43u8, 72u8, 5u8, 164u8, 97u8, 177u8, 61u8, 8u8, 112u8, 148u8, + 43u8, 0u8, 23u8, 134u8, 21u8, 173u8, 181u8, 207u8, 249u8, 98u8, 122u8, + 74u8, 131u8, 172u8, 12u8, 146u8, 124u8, 220u8, 97u8, 126u8, 253u8, + ], + ) + } + #[doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] + #[doc = "version a destination can accept is unknown)."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] + pub fn force_default_xcm_version( + &self, + maybe_xcm_version: types::force_default_xcm_version::MaybeXcmVersion, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "force_default_xcm_version", + types::ForceDefaultXcmVersion { maybe_xcm_version }, + [ + 43u8, 114u8, 102u8, 104u8, 209u8, 234u8, 108u8, 173u8, 109u8, 188u8, + 94u8, 214u8, 136u8, 43u8, 153u8, 75u8, 161u8, 192u8, 76u8, 12u8, 221u8, + 237u8, 158u8, 247u8, 41u8, 193u8, 35u8, 174u8, 183u8, 207u8, 79u8, + 213u8, + ], + ) + } + #[doc = "Ask a location to notify us regarding their XCM version and any changes to it."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The location to which we should subscribe for XCM version notifications."] + pub fn force_subscribe_version_notify( + &self, + location: types::force_subscribe_version_notify::Location, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "force_subscribe_version_notify", + types::ForceSubscribeVersionNotify { + location: ::subxt_core::alloc::boxed::Box::new(location), + }, + [ + 51u8, 103u8, 204u8, 180u8, 35u8, 50u8, 212u8, 76u8, 243u8, 161u8, 5u8, + 180u8, 61u8, 194u8, 181u8, 13u8, 209u8, 18u8, 182u8, 26u8, 138u8, + 139u8, 205u8, 98u8, 62u8, 185u8, 194u8, 240u8, 5u8, 60u8, 245u8, 91u8, + ], + ) + } + #[doc = "Require that a particular destination should no longer notify us regarding any XCM"] + #[doc = "version changes."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `location`: The location to which we are currently subscribed for XCM version"] + #[doc = " notifications which we no longer desire."] + pub fn force_unsubscribe_version_notify( + &self, + location: types::force_unsubscribe_version_notify::Location, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "force_unsubscribe_version_notify", + types::ForceUnsubscribeVersionNotify { + location: ::subxt_core::alloc::boxed::Box::new(location), + }, + [ + 80u8, 153u8, 123u8, 155u8, 105u8, 164u8, 139u8, 252u8, 89u8, 174u8, + 54u8, 14u8, 99u8, 172u8, 85u8, 239u8, 45u8, 141u8, 84u8, 69u8, 47u8, + 18u8, 173u8, 201u8, 137u8, 186u8, 217u8, 105u8, 105u8, 20u8, 6u8, + 198u8, + ], + ) + } + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve."] + #[doc = ""] + #[doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] + #[doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] + #[doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] + #[doc = " to mint and deposit reserve-based assets to `beneficiary`."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn limited_reserve_transfer_assets( + &self, + dest: types::limited_reserve_transfer_assets::Dest, + beneficiary: types::limited_reserve_transfer_assets::Beneficiary, + assets: types::limited_reserve_transfer_assets::Assets, + fee_asset_item: types::limited_reserve_transfer_assets::FeeAssetItem, + weight_limit: types::limited_reserve_transfer_assets::WeightLimit, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "limited_reserve_transfer_assets", + types::LimitedReserveTransferAssets { + dest: ::subxt_core::alloc::boxed::Box::new(dest), + beneficiary: ::subxt_core::alloc::boxed::Box::new(beneficiary), + assets: ::subxt_core::alloc::boxed::Box::new(assets), + fee_asset_item, + weight_limit, + }, + [ + 72u8, 168u8, 103u8, 54u8, 253u8, 3u8, 152u8, 167u8, 60u8, 214u8, 24u8, + 47u8, 179u8, 36u8, 251u8, 15u8, 213u8, 191u8, 95u8, 128u8, 93u8, 42u8, + 205u8, 37u8, 214u8, 170u8, 241u8, 71u8, 176u8, 11u8, 43u8, 74u8, + ], + ) + } + #[doc = "Teleport some assets from the local chain to some destination chain."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` chain."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn limited_teleport_assets( + &self, + dest: types::limited_teleport_assets::Dest, + beneficiary: types::limited_teleport_assets::Beneficiary, + assets: types::limited_teleport_assets::Assets, + fee_asset_item: types::limited_teleport_assets::FeeAssetItem, + weight_limit: types::limited_teleport_assets::WeightLimit, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "limited_teleport_assets", + types::LimitedTeleportAssets { + dest: ::subxt_core::alloc::boxed::Box::new(dest), + beneficiary: ::subxt_core::alloc::boxed::Box::new(beneficiary), + assets: ::subxt_core::alloc::boxed::Box::new(assets), + fee_asset_item, + weight_limit, + }, + [ + 56u8, 190u8, 251u8, 133u8, 34u8, 100u8, 32u8, 57u8, 114u8, 73u8, 153u8, + 74u8, 178u8, 228u8, 239u8, 87u8, 242u8, 202u8, 56u8, 66u8, 22u8, 216u8, + 113u8, 25u8, 233u8, 238u8, 164u8, 76u8, 144u8, 204u8, 219u8, 91u8, + ], + ) + } + #[doc = "Set or unset the global suspension state of the XCM executor."] + #[doc = ""] + #[doc = "- `origin`: Must be an origin specified by AdminOrigin."] + #[doc = "- `suspended`: `true` to suspend, `false` to resume."] + pub fn force_suspension( + &self, + suspended: types::force_suspension::Suspended, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "force_suspension", + types::ForceSuspension { suspended }, + [ + 78u8, 125u8, 93u8, 55u8, 129u8, 44u8, 36u8, 227u8, 75u8, 46u8, 68u8, + 202u8, 81u8, 127u8, 111u8, 92u8, 149u8, 38u8, 225u8, 185u8, 183u8, + 154u8, 89u8, 159u8, 79u8, 10u8, 229u8, 1u8, 226u8, 243u8, 65u8, 238u8, + ], + ) + } + #[doc = "Transfer some assets from the local chain to the destination chain through their local,"] + #[doc = "destination or remote reserve, or through teleports."] + #[doc = ""] + #[doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] + #[doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] + #[doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] + #[doc = "operation will fail and the sent assets may be at risk."] + #[doc = ""] + #[doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] + #[doc = "to `dest`, no limitations imposed on `fees`."] + #[doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] + #[doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] + #[doc = " `beneficiary`."] + #[doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] + #[doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] + #[doc = " to `beneficiary`."] + #[doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] + #[doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] + #[doc = " and deposit reserve-based assets to `beneficiary`."] + #[doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] + #[doc = " assets and deposit them to `beneficiary`."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] + #[doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] + #[doc = " from relay to parachain."] + #[doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] + #[doc = " generally be an `AccountId32` value."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] + #[doc = " fees."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn transfer_assets( + &self, + dest: types::transfer_assets::Dest, + beneficiary: types::transfer_assets::Beneficiary, + assets: types::transfer_assets::Assets, + fee_asset_item: types::transfer_assets::FeeAssetItem, + weight_limit: types::transfer_assets::WeightLimit, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "transfer_assets", + types::TransferAssets { + dest: ::subxt_core::alloc::boxed::Box::new(dest), + beneficiary: ::subxt_core::alloc::boxed::Box::new(beneficiary), + assets: ::subxt_core::alloc::boxed::Box::new(assets), + fee_asset_item, + weight_limit, + }, + [ + 204u8, 118u8, 44u8, 144u8, 51u8, 77u8, 235u8, 235u8, 86u8, 166u8, 92u8, + 106u8, 197u8, 151u8, 154u8, 136u8, 137u8, 206u8, 111u8, 118u8, 94u8, + 22u8, 7u8, 21u8, 13u8, 169u8, 214u8, 87u8, 84u8, 140u8, 6u8, 54u8, + ], + ) + } + #[doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] + #[doc = ""] + #[doc = "- `origin`: Anyone can call this extrinsic."] + #[doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] + #[doc = "was the latest when they were trapped."] + #[doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] + pub fn claim_assets( + &self, + assets: types::claim_assets::Assets, + beneficiary: types::claim_assets::Beneficiary, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "claim_assets", + types::ClaimAssets { + assets: ::subxt_core::alloc::boxed::Box::new(assets), + beneficiary: ::subxt_core::alloc::boxed::Box::new(beneficiary), + }, + [ + 7u8, 158u8, 80u8, 180u8, 145u8, 151u8, 34u8, 132u8, 236u8, 243u8, 77u8, + 177u8, 66u8, 172u8, 57u8, 182u8, 226u8, 110u8, 246u8, 159u8, 61u8, + 31u8, 167u8, 210u8, 226u8, 215u8, 103u8, 234u8, 16u8, 95u8, 92u8, + 248u8, + ], + ) + } + #[doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] + #[doc = "types for assets and fees."] + #[doc = ""] + #[doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] + #[doc = "provide the `assets_transfer_type` to be used for `assets`:"] + #[doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] + #[doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] + #[doc = " assets to `beneficiary`."] + #[doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] + #[doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] + #[doc = " deposit them to `beneficiary`."] + #[doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] + #[doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] + #[doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] + #[doc = " the remote `reserve` is Asset Hub."] + #[doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] + #[doc = " mint/teleport assets and deposit them to `beneficiary`."] + #[doc = ""] + #[doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] + #[doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] + #[doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] + #[doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] + #[doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] + #[doc = "at risk."] + #[doc = ""] + #[doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] + #[doc = "specified through `fees_transfer_type`."] + #[doc = ""] + #[doc = "The caller needs to specify what should happen to the transferred assets once they reach"] + #[doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] + #[doc = "contains the instructions to execute on `dest` as a final step."] + #[doc = " This is usually as simple as:"] + #[doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] + #[doc = " but could be something more exotic like sending the `assets` even further."] + #[doc = ""] + #[doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] + #[doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] + #[doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] + #[doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] + #[doc = " parachain across a bridge to another ecosystem destination."] + #[doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] + #[doc = " fee on the `dest` (and possibly reserve) chains."] + #[doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] + #[doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] + #[doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] + #[doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] + #[doc = " transfer, which also determines what happens to the assets on the destination chain."] + #[doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] + pub fn transfer_assets_using_type_and_then( + &self, + dest: types::transfer_assets_using_type_and_then::Dest, + assets: types::transfer_assets_using_type_and_then::Assets, + assets_transfer_type : types :: transfer_assets_using_type_and_then :: AssetsTransferType, + remote_fees_id: types::transfer_assets_using_type_and_then::RemoteFeesId, + fees_transfer_type : types :: transfer_assets_using_type_and_then :: FeesTransferType, + custom_xcm_on_dest: types::transfer_assets_using_type_and_then::CustomXcmOnDest, + weight_limit: types::transfer_assets_using_type_and_then::WeightLimit, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "transfer_assets_using_type_and_then", + types::TransferAssetsUsingTypeAndThen { + dest: ::subxt_core::alloc::boxed::Box::new(dest), + assets: ::subxt_core::alloc::boxed::Box::new(assets), + assets_transfer_type: ::subxt_core::alloc::boxed::Box::new( + assets_transfer_type, + ), + remote_fees_id: ::subxt_core::alloc::boxed::Box::new(remote_fees_id), + fees_transfer_type: ::subxt_core::alloc::boxed::Box::new( + fees_transfer_type, + ), + custom_xcm_on_dest: ::subxt_core::alloc::boxed::Box::new( + custom_xcm_on_dest, + ), + weight_limit, + }, + [ + 199u8, 248u8, 143u8, 192u8, 39u8, 87u8, 220u8, 150u8, 207u8, 131u8, + 122u8, 214u8, 240u8, 15u8, 201u8, 146u8, 166u8, 101u8, 154u8, 151u8, + 218u8, 25u8, 195u8, 200u8, 96u8, 141u8, 210u8, 113u8, 16u8, 238u8, + 208u8, 192u8, + ], + ) + } + #[doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] + #[doc = "The `aliaser` is only authorized until the provided `expiry` block number."] + #[doc = "The call can also be used for a previously authorized alias in order to update its"] + #[doc = "`expiry` block number."] + #[doc = ""] + #[doc = "Usually useful to allow your local account to be aliased into from a remote location"] + #[doc = "also under your control (like your account on another chain)."] + #[doc = ""] + #[doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] + #[doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] + #[doc = "`origin` in XCM programs executed on the local chain."] + pub fn add_authorized_alias( + &self, + aliaser: types::add_authorized_alias::Aliaser, + expires: types::add_authorized_alias::Expires, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "add_authorized_alias", + types::AddAuthorizedAlias { + aliaser: ::subxt_core::alloc::boxed::Box::new(aliaser), + expires, + }, + [ + 223u8, 55u8, 95u8, 81u8, 3u8, 249u8, 197u8, 169u8, 247u8, 139u8, 84u8, + 142u8, 87u8, 70u8, 51u8, 169u8, 137u8, 190u8, 116u8, 253u8, 220u8, + 101u8, 221u8, 132u8, 245u8, 23u8, 0u8, 212u8, 3u8, 54u8, 60u8, 78u8, + ], + ) + } + #[doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] + #[doc = "the local `origin` making this call."] + pub fn remove_authorized_alias( + &self, + aliaser: types::remove_authorized_alias::Aliaser, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "remove_authorized_alias", + types::RemoveAuthorizedAlias { + aliaser: ::subxt_core::alloc::boxed::Box::new(aliaser), + }, + [ + 210u8, 231u8, 143u8, 176u8, 120u8, 169u8, 22u8, 200u8, 5u8, 41u8, 51u8, + 229u8, 158u8, 72u8, 19u8, 54u8, 204u8, 207u8, 191u8, 47u8, 145u8, 71u8, + 204u8, 235u8, 75u8, 245u8, 190u8, 106u8, 119u8, 203u8, 66u8, 0u8, + ], + ) + } + #[doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] + #[doc = "making this call."] + pub fn remove_all_authorized_aliases( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "PolkadotXcm", + "remove_all_authorized_aliases", + types::RemoveAllAuthorizedAliases {}, + [ + 223u8, 17u8, 58u8, 180u8, 190u8, 164u8, 106u8, 17u8, 237u8, 243u8, + 160u8, 39u8, 13u8, 103u8, 166u8, 51u8, 192u8, 73u8, 193u8, 21u8, 69u8, + 170u8, 101u8, 195u8, 42u8, 123u8, 56u8, 90u8, 8u8, 109u8, 15u8, 110u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_xcm::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Execution of an XCM message was attempted."] + pub struct Attempted { + pub outcome: attempted::Outcome, + } + pub mod attempted { + use super::runtime_types; + pub type Outcome = runtime_types::staging_xcm::v5::traits::Outcome; + } + impl ::subxt_core::events::StaticEvent for Attempted { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "Attempted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An XCM message was sent."] + pub struct Sent { + pub origin: sent::Origin, + pub destination: sent::Destination, + pub message: sent::Message, + pub message_id: sent::MessageId, + } + pub mod sent { + use super::runtime_types; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type Destination = runtime_types::staging_xcm::v5::location::Location; + pub type Message = runtime_types::staging_xcm::v5::Xcm; + pub type MessageId = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for Sent { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "Sent"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An XCM message failed to send."] + pub struct SendFailed { + pub origin: send_failed::Origin, + pub destination: send_failed::Destination, + pub error: send_failed::Error, + pub message_id: send_failed::MessageId, + } + pub mod send_failed { + use super::runtime_types; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type Destination = runtime_types::staging_xcm::v5::location::Location; + pub type Error = runtime_types::xcm::v3::traits::SendError; + pub type MessageId = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for SendFailed { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "SendFailed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An XCM message failed to process."] + pub struct ProcessXcmError { + pub origin: process_xcm_error::Origin, + pub error: process_xcm_error::Error, + pub message_id: process_xcm_error::MessageId, + } + pub mod process_xcm_error { + use super::runtime_types; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type Error = runtime_types::xcm::v5::traits::Error; + pub type MessageId = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for ProcessXcmError { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "ProcessXcmError"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Query response received which does not match a registered query. This may be because a"] + #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] + #[doc = "because the query timed out."] + pub struct UnexpectedResponse { + pub origin: unexpected_response::Origin, + pub query_id: unexpected_response::QueryId, + } + pub mod unexpected_response { + use super::runtime_types; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type QueryId = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for UnexpectedResponse { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "UnexpectedResponse"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] + #[doc = "no registered notification call."] + pub struct ResponseReady { + pub query_id: response_ready::QueryId, + pub response: response_ready::Response, + } + pub mod response_ready { + use super::runtime_types; + pub type QueryId = ::core::primitive::u64; + pub type Response = runtime_types::staging_xcm::v5::Response; + } + impl ::subxt_core::events::StaticEvent for ResponseReady { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "ResponseReady"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Query response has been received and query is removed. The registered notification has"] + #[doc = "been dispatched and executed successfully."] + pub struct Notified { + pub query_id: notified::QueryId, + pub pallet_index: notified::PalletIndex, + pub call_index: notified::CallIndex, + } + pub mod notified { + use super::runtime_types; + pub type QueryId = ::core::primitive::u64; + pub type PalletIndex = ::core::primitive::u8; + pub type CallIndex = ::core::primitive::u8; + } + impl ::subxt_core::events::StaticEvent for Notified { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "Notified"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Query response has been received and query is removed. The registered notification"] + #[doc = "could not be dispatched because the dispatch weight is greater than the maximum weight"] + #[doc = "originally budgeted by this runtime for the query result."] + pub struct NotifyOverweight { + pub query_id: notify_overweight::QueryId, + pub pallet_index: notify_overweight::PalletIndex, + pub call_index: notify_overweight::CallIndex, + pub actual_weight: notify_overweight::ActualWeight, + pub max_budgeted_weight: notify_overweight::MaxBudgetedWeight, + } + pub mod notify_overweight { + use super::runtime_types; + pub type QueryId = ::core::primitive::u64; + pub type PalletIndex = ::core::primitive::u8; + pub type CallIndex = ::core::primitive::u8; + pub type ActualWeight = runtime_types::sp_weights::weight_v2::Weight; + pub type MaxBudgetedWeight = runtime_types::sp_weights::weight_v2::Weight; + } + impl ::subxt_core::events::StaticEvent for NotifyOverweight { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "NotifyOverweight"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Query response has been received and query is removed. There was a general error with"] + #[doc = "dispatching the notification call."] + pub struct NotifyDispatchError { + pub query_id: notify_dispatch_error::QueryId, + pub pallet_index: notify_dispatch_error::PalletIndex, + pub call_index: notify_dispatch_error::CallIndex, + } + pub mod notify_dispatch_error { + use super::runtime_types; + pub type QueryId = ::core::primitive::u64; + pub type PalletIndex = ::core::primitive::u8; + pub type CallIndex = ::core::primitive::u8; + } + impl ::subxt_core::events::StaticEvent for NotifyDispatchError { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "NotifyDispatchError"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] + #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] + #[doc = "is not `(origin, QueryId, Response)`."] + pub struct NotifyDecodeFailed { + pub query_id: notify_decode_failed::QueryId, + pub pallet_index: notify_decode_failed::PalletIndex, + pub call_index: notify_decode_failed::CallIndex, + } + pub mod notify_decode_failed { + use super::runtime_types; + pub type QueryId = ::core::primitive::u64; + pub type PalletIndex = ::core::primitive::u8; + pub type CallIndex = ::core::primitive::u8; + } + impl ::subxt_core::events::StaticEvent for NotifyDecodeFailed { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "NotifyDecodeFailed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Expected query response has been received but the origin location of the response does"] + #[doc = "not match that expected. The query remains registered for a later, valid, response to"] + #[doc = "be received and acted upon."] + pub struct InvalidResponder { + pub origin: invalid_responder::Origin, + pub query_id: invalid_responder::QueryId, + pub expected_location: invalid_responder::ExpectedLocation, + } + pub mod invalid_responder { + use super::runtime_types; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type QueryId = ::core::primitive::u64; + pub type ExpectedLocation = + ::core::option::Option; + } + impl ::subxt_core::events::StaticEvent for InvalidResponder { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "InvalidResponder"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Expected query response has been received but the expected origin location placed in"] + #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] + #[doc = ""] + #[doc = "This is unexpected (since a location placed in storage in a previously executing"] + #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] + #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] + #[doc = "needed."] + pub struct InvalidResponderVersion { + pub origin: invalid_responder_version::Origin, + pub query_id: invalid_responder_version::QueryId, + } + pub mod invalid_responder_version { + use super::runtime_types; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type QueryId = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for InvalidResponderVersion { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "InvalidResponderVersion"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Received query response has been read and removed."] + pub struct ResponseTaken { + pub query_id: response_taken::QueryId, + } + pub mod response_taken { + use super::runtime_types; + pub type QueryId = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for ResponseTaken { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "ResponseTaken"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some assets have been placed in an asset trap."] + pub struct AssetsTrapped { + pub hash: assets_trapped::Hash, + pub origin: assets_trapped::Origin, + pub assets: assets_trapped::Assets, + } + pub mod assets_trapped { + use super::runtime_types; + pub type Hash = ::subxt_core::utils::H256; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type Assets = runtime_types::xcm::VersionedAssets; + } + impl ::subxt_core::events::StaticEvent for AssetsTrapped { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "AssetsTrapped"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An XCM version change notification message has been attempted to be sent."] + #[doc = ""] + #[doc = "The cost of sending it (borne by the chain) is included."] + pub struct VersionChangeNotified { + pub destination: version_change_notified::Destination, + pub result: version_change_notified::Result, + pub cost: version_change_notified::Cost, + pub message_id: version_change_notified::MessageId, + } + pub mod version_change_notified { + use super::runtime_types; + pub type Destination = runtime_types::staging_xcm::v5::location::Location; + pub type Result = ::core::primitive::u32; + pub type Cost = runtime_types::staging_xcm::v5::asset::Assets; + pub type MessageId = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for VersionChangeNotified { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "VersionChangeNotified"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The supported version of a location has been changed. This might be through an"] + #[doc = "automatic notification or a manual intervention."] + pub struct SupportedVersionChanged { + pub location: supported_version_changed::Location, + pub version: supported_version_changed::Version, + } + pub mod supported_version_changed { + use super::runtime_types; + pub type Location = runtime_types::staging_xcm::v5::location::Location; + pub type Version = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for SupportedVersionChanged { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "SupportedVersionChanged"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A given location which had a version change subscription was dropped owing to an error"] + #[doc = "sending the notification to it."] + pub struct NotifyTargetSendFail { + pub location: notify_target_send_fail::Location, + pub query_id: notify_target_send_fail::QueryId, + pub error: notify_target_send_fail::Error, + } + pub mod notify_target_send_fail { + use super::runtime_types; + pub type Location = runtime_types::staging_xcm::v5::location::Location; + pub type QueryId = ::core::primitive::u64; + pub type Error = runtime_types::xcm::v5::traits::Error; + } + impl ::subxt_core::events::StaticEvent for NotifyTargetSendFail { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "NotifyTargetSendFail"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A given location which had a version change subscription was dropped owing to an error"] + #[doc = "migrating the location to our new XCM format."] + pub struct NotifyTargetMigrationFail { + pub location: notify_target_migration_fail::Location, + pub query_id: notify_target_migration_fail::QueryId, + } + pub mod notify_target_migration_fail { + use super::runtime_types; + pub type Location = runtime_types::xcm::VersionedLocation; + pub type QueryId = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for NotifyTargetMigrationFail { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "NotifyTargetMigrationFail"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Expected query response has been received but the expected querier location placed in"] + #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] + #[doc = ""] + #[doc = "This is unexpected (since a location placed in storage in a previously executing"] + #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] + #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] + #[doc = "needed."] + pub struct InvalidQuerierVersion { + pub origin: invalid_querier_version::Origin, + pub query_id: invalid_querier_version::QueryId, + } + pub mod invalid_querier_version { + use super::runtime_types; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type QueryId = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for InvalidQuerierVersion { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "InvalidQuerierVersion"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Expected query response has been received but the querier location of the response does"] + #[doc = "not match the expected. The query remains registered for a later, valid, response to"] + #[doc = "be received and acted upon."] + pub struct InvalidQuerier { + pub origin: invalid_querier::Origin, + pub query_id: invalid_querier::QueryId, + pub expected_querier: invalid_querier::ExpectedQuerier, + pub maybe_actual_querier: invalid_querier::MaybeActualQuerier, + } + pub mod invalid_querier { + use super::runtime_types; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type QueryId = ::core::primitive::u64; + pub type ExpectedQuerier = runtime_types::staging_xcm::v5::location::Location; + pub type MaybeActualQuerier = + ::core::option::Option; + } + impl ::subxt_core::events::StaticEvent for InvalidQuerier { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "InvalidQuerier"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A remote has requested XCM version change notification from us and we have honored it."] + #[doc = "A version information message is sent to them and its cost is included."] + pub struct VersionNotifyStarted { + pub destination: version_notify_started::Destination, + pub cost: version_notify_started::Cost, + pub message_id: version_notify_started::MessageId, + } + pub mod version_notify_started { + use super::runtime_types; + pub type Destination = runtime_types::staging_xcm::v5::location::Location; + pub type Cost = runtime_types::staging_xcm::v5::asset::Assets; + pub type MessageId = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for VersionNotifyStarted { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "VersionNotifyStarted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "We have requested that a remote chain send us XCM version change notifications."] + pub struct VersionNotifyRequested { + pub destination: version_notify_requested::Destination, + pub cost: version_notify_requested::Cost, + pub message_id: version_notify_requested::MessageId, + } + pub mod version_notify_requested { + use super::runtime_types; + pub type Destination = runtime_types::staging_xcm::v5::location::Location; + pub type Cost = runtime_types::staging_xcm::v5::asset::Assets; + pub type MessageId = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for VersionNotifyRequested { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "VersionNotifyRequested"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "We have requested that a remote chain stops sending us XCM version change"] + #[doc = "notifications."] + pub struct VersionNotifyUnrequested { + pub destination: version_notify_unrequested::Destination, + pub cost: version_notify_unrequested::Cost, + pub message_id: version_notify_unrequested::MessageId, + } + pub mod version_notify_unrequested { + use super::runtime_types; + pub type Destination = runtime_types::staging_xcm::v5::location::Location; + pub type Cost = runtime_types::staging_xcm::v5::asset::Assets; + pub type MessageId = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for VersionNotifyUnrequested { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "VersionNotifyUnrequested"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Fees were paid from a location for an operation (often for using `SendXcm`)."] + pub struct FeesPaid { + pub paying: fees_paid::Paying, + pub fees: fees_paid::Fees, + } + pub mod fees_paid { + use super::runtime_types; + pub type Paying = runtime_types::staging_xcm::v5::location::Location; + pub type Fees = runtime_types::staging_xcm::v5::asset::Assets; + } + impl ::subxt_core::events::StaticEvent for FeesPaid { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "FeesPaid"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Some assets have been claimed from an asset trap"] + pub struct AssetsClaimed { + pub hash: assets_claimed::Hash, + pub origin: assets_claimed::Origin, + pub assets: assets_claimed::Assets, + } + pub mod assets_claimed { + use super::runtime_types; + pub type Hash = ::subxt_core::utils::H256; + pub type Origin = runtime_types::staging_xcm::v5::location::Location; + pub type Assets = runtime_types::xcm::VersionedAssets; + } + impl ::subxt_core::events::StaticEvent for AssetsClaimed { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "AssetsClaimed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A XCM version migration finished."] + pub struct VersionMigrationFinished { + pub version: version_migration_finished::Version, + } + pub mod version_migration_finished { + use super::runtime_types; + pub type Version = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for VersionMigrationFinished { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "VersionMigrationFinished"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "An `aliaser` location was authorized by `target` to alias it, authorization valid until"] + #[doc = "`expiry` block number."] + pub struct AliasAuthorized { + pub aliaser: alias_authorized::Aliaser, + pub target: alias_authorized::Target, + pub expiry: alias_authorized::Expiry, + } + pub mod alias_authorized { + use super::runtime_types; + pub type Aliaser = runtime_types::staging_xcm::v5::location::Location; + pub type Target = runtime_types::staging_xcm::v5::location::Location; + pub type Expiry = ::core::option::Option<::core::primitive::u64>; + } + impl ::subxt_core::events::StaticEvent for AliasAuthorized { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "AliasAuthorized"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "`target` removed alias authorization for `aliaser`."] + pub struct AliasAuthorizationRemoved { + pub aliaser: alias_authorization_removed::Aliaser, + pub target: alias_authorization_removed::Target, + } + pub mod alias_authorization_removed { + use super::runtime_types; + pub type Aliaser = runtime_types::staging_xcm::v5::location::Location; + pub type Target = runtime_types::staging_xcm::v5::location::Location; + } + impl ::subxt_core::events::StaticEvent for AliasAuthorizationRemoved { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "AliasAuthorizationRemoved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "`target` removed all alias authorizations."] + pub struct AliasesAuthorizationsRemoved { + pub target: aliases_authorizations_removed::Target, + } + pub mod aliases_authorizations_removed { + use super::runtime_types; + pub type Target = runtime_types::staging_xcm::v5::location::Location; + } + impl ::subxt_core::events::StaticEvent for AliasesAuthorizationsRemoved { + const PALLET: &'static str = "PolkadotXcm"; + const EVENT: &'static str = "AliasesAuthorizationsRemoved"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod query_counter { + use super::runtime_types; + pub type QueryCounter = ::core::primitive::u64; + } + pub mod queries { + use super::runtime_types; + pub type Queries = + runtime_types::pallet_xcm::pallet::QueryStatus<::core::primitive::u32>; + pub type Param0 = ::core::primitive::u64; + } + pub mod asset_traps { + use super::runtime_types; + pub type AssetTraps = ::core::primitive::u32; + pub type Param0 = ::subxt_core::utils::H256; + } + pub mod safe_xcm_version { + use super::runtime_types; + pub type SafeXcmVersion = ::core::primitive::u32; + } + pub mod supported_version { + use super::runtime_types; + pub type SupportedVersion = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; + } + pub mod version_notifiers { + use super::runtime_types; + pub type VersionNotifiers = ::core::primitive::u64; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; + } + pub mod version_notify_targets { + use super::runtime_types; + pub type VersionNotifyTargets = ( + ::core::primitive::u64, + runtime_types::sp_weights::weight_v2::Weight, + ::core::primitive::u32, + ); + pub type Param0 = ::core::primitive::u32; + pub type Param1 = runtime_types::xcm::VersionedLocation; + } + pub mod version_discovery_queue { + use super::runtime_types; + pub type VersionDiscoveryQueue = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + runtime_types::xcm::VersionedLocation, + ::core::primitive::u32, + )>; + } + pub mod current_migration { + use super::runtime_types; + pub type CurrentMigration = + runtime_types::pallet_xcm::pallet::VersionMigrationStage; + } + pub mod remote_locked_fungibles { + use super::runtime_types; + pub type RemoteLockedFungibles = + runtime_types::pallet_xcm::pallet::RemoteLockedFungibleRecord<()>; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::subxt_core::utils::AccountId32; + pub type Param2 = runtime_types::xcm::VersionedAssetId; + } + pub mod locked_fungibles { + use super::runtime_types; + pub type LockedFungibles = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::core::primitive::u128, + runtime_types::xcm::VersionedLocation, + )>; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod xcm_execution_suspended { + use super::runtime_types; + pub type XcmExecutionSuspended = ::core::primitive::bool; + } + pub mod should_record_xcm { + use super::runtime_types; + pub type ShouldRecordXcm = ::core::primitive::bool; + } + pub mod recorded_xcm { + use super::runtime_types; + pub type RecordedXcm = runtime_types::staging_xcm::v5::Xcm; + } + pub mod authorized_aliases { + use super::runtime_types; + pub type AuthorizedAliases = runtime_types::pallet_xcm::AuthorizedAliasesEntry< + runtime_types::frame_support::traits::tokens::fungible::HoldConsideration, + runtime_types::pallet_xcm::pallet::MaxAuthorizedAliases, + >; + pub type Param0 = runtime_types::xcm::VersionedLocation; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The latest available query index."] + pub fn query_counter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::query_counter::QueryCounter, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "QueryCounter", + (), + [ + 216u8, 73u8, 160u8, 232u8, 60u8, 245u8, 218u8, 219u8, 152u8, 68u8, + 146u8, 219u8, 255u8, 7u8, 86u8, 112u8, 83u8, 49u8, 94u8, 173u8, 64u8, + 203u8, 147u8, 226u8, 236u8, 39u8, 129u8, 106u8, 209u8, 113u8, 150u8, + 50u8, + ], + ) + } + #[doc = " The ongoing queries."] + pub fn queries_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::queries::Queries, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "Queries", + (), + [ + 134u8, 206u8, 252u8, 211u8, 156u8, 173u8, 214u8, 205u8, 17u8, 177u8, + 139u8, 121u8, 43u8, 29u8, 30u8, 233u8, 210u8, 222u8, 172u8, 171u8, + 13u8, 223u8, 153u8, 88u8, 43u8, 44u8, 183u8, 253u8, 252u8, 251u8, + 184u8, 249u8, + ], + ) + } + #[doc = " The ongoing queries."] + pub fn queries( + &self, + _0: types::queries::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::queries::Queries, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "Queries", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 134u8, 206u8, 252u8, 211u8, 156u8, 173u8, 214u8, 205u8, 17u8, 177u8, + 139u8, 121u8, 43u8, 29u8, 30u8, 233u8, 210u8, 222u8, 172u8, 171u8, + 13u8, 223u8, 153u8, 88u8, 43u8, 44u8, 183u8, 253u8, 252u8, 251u8, + 184u8, 249u8, + ], + ) + } + #[doc = " The existing asset traps."] + #[doc = ""] + #[doc = " Key is the blake2 256 hash of (origin, versioned `Assets`) pair. Value is the number of"] + #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] + pub fn asset_traps_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::asset_traps::AssetTraps, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "AssetTraps", + (), + [ + 148u8, 41u8, 254u8, 134u8, 61u8, 172u8, 126u8, 146u8, 78u8, 178u8, + 50u8, 77u8, 226u8, 8u8, 200u8, 78u8, 77u8, 91u8, 26u8, 133u8, 104u8, + 126u8, 28u8, 28u8, 202u8, 62u8, 87u8, 183u8, 231u8, 191u8, 5u8, 181u8, + ], + ) + } + #[doc = " The existing asset traps."] + #[doc = ""] + #[doc = " Key is the blake2 256 hash of (origin, versioned `Assets`) pair. Value is the number of"] + #[doc = " times this pair has been trapped (usually just 1 if it exists at all)."] + pub fn asset_traps( + &self, + _0: types::asset_traps::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::asset_traps::AssetTraps, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "AssetTraps", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 148u8, 41u8, 254u8, 134u8, 61u8, 172u8, 126u8, 146u8, 78u8, 178u8, + 50u8, 77u8, 226u8, 8u8, 200u8, 78u8, 77u8, 91u8, 26u8, 133u8, 104u8, + 126u8, 28u8, 28u8, 202u8, 62u8, 87u8, 183u8, 231u8, 191u8, 5u8, 181u8, + ], + ) + } + #[doc = " Default version to encode XCM when latest version of destination is unknown. If `None`,"] + #[doc = " then the destinations whose XCM version is unknown are considered unreachable."] + pub fn safe_xcm_version( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::safe_xcm_version::SafeXcmVersion, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "SafeXcmVersion", + (), + [ + 187u8, 8u8, 74u8, 126u8, 80u8, 215u8, 177u8, 60u8, 223u8, 123u8, 196u8, + 155u8, 166u8, 66u8, 25u8, 164u8, 191u8, 66u8, 116u8, 131u8, 116u8, + 188u8, 224u8, 122u8, 75u8, 195u8, 246u8, 188u8, 83u8, 134u8, 49u8, + 143u8, + ], + ) + } + #[doc = " The Latest versions that we know various locations support."] + pub fn supported_version_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::supported_version::SupportedVersion, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "SupportedVersion", + (), + [ + 156u8, 153u8, 195u8, 67u8, 72u8, 227u8, 183u8, 107u8, 71u8, 221u8, + 125u8, 172u8, 34u8, 22u8, 56u8, 182u8, 219u8, 223u8, 183u8, 137u8, + 243u8, 231u8, 153u8, 254u8, 144u8, 104u8, 48u8, 189u8, 232u8, 104u8, + 180u8, 65u8, + ], + ) + } + #[doc = " The Latest versions that we know various locations support."] + pub fn supported_version_iter1( + &self, + _0: types::supported_version::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::supported_version::Param0, + >, + types::supported_version::SupportedVersion, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "SupportedVersion", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 156u8, 153u8, 195u8, 67u8, 72u8, 227u8, 183u8, 107u8, 71u8, 221u8, + 125u8, 172u8, 34u8, 22u8, 56u8, 182u8, 219u8, 223u8, 183u8, 137u8, + 243u8, 231u8, 153u8, 254u8, 144u8, 104u8, 48u8, 189u8, 232u8, 104u8, + 180u8, 65u8, + ], + ) + } + #[doc = " The Latest versions that we know various locations support."] + pub fn supported_version( + &self, + _0: types::supported_version::Param0, + _1: types::supported_version::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::supported_version::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::supported_version::Param1, + >, + ), + types::supported_version::SupportedVersion, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "SupportedVersion", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 156u8, 153u8, 195u8, 67u8, 72u8, 227u8, 183u8, 107u8, 71u8, 221u8, + 125u8, 172u8, 34u8, 22u8, 56u8, 182u8, 219u8, 223u8, 183u8, 137u8, + 243u8, 231u8, 153u8, 254u8, 144u8, 104u8, 48u8, 189u8, 232u8, 104u8, + 180u8, 65u8, + ], + ) + } + #[doc = " All locations that we have requested version notifications from."] + pub fn version_notifiers_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::version_notifiers::VersionNotifiers, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "VersionNotifiers", + (), + [ + 216u8, 78u8, 44u8, 71u8, 246u8, 59u8, 163u8, 153u8, 68u8, 31u8, 197u8, + 114u8, 33u8, 203u8, 20u8, 60u8, 61u8, 177u8, 94u8, 13u8, 213u8, 203u8, + 150u8, 145u8, 134u8, 249u8, 53u8, 21u8, 122u8, 208u8, 66u8, 67u8, + ], + ) + } + #[doc = " All locations that we have requested version notifications from."] + pub fn version_notifiers_iter1( + &self, + _0: types::version_notifiers::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::version_notifiers::Param0, + >, + types::version_notifiers::VersionNotifiers, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "VersionNotifiers", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 216u8, 78u8, 44u8, 71u8, 246u8, 59u8, 163u8, 153u8, 68u8, 31u8, 197u8, + 114u8, 33u8, 203u8, 20u8, 60u8, 61u8, 177u8, 94u8, 13u8, 213u8, 203u8, + 150u8, 145u8, 134u8, 249u8, 53u8, 21u8, 122u8, 208u8, 66u8, 67u8, + ], + ) + } + #[doc = " All locations that we have requested version notifications from."] + pub fn version_notifiers( + &self, + _0: types::version_notifiers::Param0, + _1: types::version_notifiers::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::version_notifiers::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::version_notifiers::Param1, + >, + ), + types::version_notifiers::VersionNotifiers, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "VersionNotifiers", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 216u8, 78u8, 44u8, 71u8, 246u8, 59u8, 163u8, 153u8, 68u8, 31u8, 197u8, + 114u8, 33u8, 203u8, 20u8, 60u8, 61u8, 177u8, 94u8, 13u8, 213u8, 203u8, + 150u8, 145u8, 134u8, 249u8, 53u8, 21u8, 122u8, 208u8, 66u8, 67u8, + ], + ) + } + #[doc = " The target locations that are subscribed to our version changes, as well as the most recent"] + #[doc = " of our versions we informed them of."] + pub fn version_notify_targets_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::version_notify_targets::VersionNotifyTargets, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "VersionNotifyTargets", + (), + [ + 166u8, 29u8, 245u8, 121u8, 177u8, 119u8, 188u8, 0u8, 32u8, 188u8, 9u8, + 180u8, 60u8, 28u8, 161u8, 5u8, 189u8, 78u8, 238u8, 14u8, 148u8, 5u8, + 151u8, 153u8, 62u8, 163u8, 144u8, 82u8, 91u8, 227u8, 210u8, 205u8, + ], + ) + } + #[doc = " The target locations that are subscribed to our version changes, as well as the most recent"] + #[doc = " of our versions we informed them of."] + pub fn version_notify_targets_iter1( + &self, + _0: types::version_notify_targets::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::version_notify_targets::Param0, + >, + types::version_notify_targets::VersionNotifyTargets, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "VersionNotifyTargets", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 166u8, 29u8, 245u8, 121u8, 177u8, 119u8, 188u8, 0u8, 32u8, 188u8, 9u8, + 180u8, 60u8, 28u8, 161u8, 5u8, 189u8, 78u8, 238u8, 14u8, 148u8, 5u8, + 151u8, 153u8, 62u8, 163u8, 144u8, 82u8, 91u8, 227u8, 210u8, 205u8, + ], + ) + } + #[doc = " The target locations that are subscribed to our version changes, as well as the most recent"] + #[doc = " of our versions we informed them of."] + pub fn version_notify_targets( + &self, + _0: types::version_notify_targets::Param0, + _1: types::version_notify_targets::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::version_notify_targets::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::version_notify_targets::Param1, + >, + ), + types::version_notify_targets::VersionNotifyTargets, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "VersionNotifyTargets", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 166u8, 29u8, 245u8, 121u8, 177u8, 119u8, 188u8, 0u8, 32u8, 188u8, 9u8, + 180u8, 60u8, 28u8, 161u8, 5u8, 189u8, 78u8, 238u8, 14u8, 148u8, 5u8, + 151u8, 153u8, 62u8, 163u8, 144u8, 82u8, 91u8, 227u8, 210u8, 205u8, + ], + ) + } + #[doc = " Destinations whose latest XCM version we would like to know. Duplicates not allowed, and"] + #[doc = " the `u32` counter is the number of times that a send to the destination has been attempted,"] + #[doc = " which is used as a prioritization."] + pub fn version_discovery_queue( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::version_discovery_queue::VersionDiscoveryQueue, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "VersionDiscoveryQueue", + (), + [ + 206u8, 152u8, 58u8, 105u8, 70u8, 142u8, 210u8, 246u8, 107u8, 8u8, + 190u8, 195u8, 255u8, 27u8, 199u8, 241u8, 221u8, 238u8, 61u8, 92u8, + 245u8, 162u8, 151u8, 234u8, 151u8, 6u8, 216u8, 115u8, 214u8, 138u8, + 8u8, 27u8, + ], + ) + } + #[doc = " The current migration's stage, if any."] + pub fn current_migration( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::current_migration::CurrentMigration, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "CurrentMigration", + (), + [ + 74u8, 138u8, 181u8, 162u8, 59u8, 251u8, 37u8, 28u8, 232u8, 51u8, 30u8, + 152u8, 252u8, 133u8, 95u8, 195u8, 47u8, 127u8, 21u8, 44u8, 62u8, 143u8, + 170u8, 234u8, 160u8, 37u8, 131u8, 179u8, 57u8, 241u8, 140u8, 124u8, + ], + ) + } + #[doc = " Fungible assets which we know are locked on a remote chain."] + pub fn remote_locked_fungibles_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::remote_locked_fungibles::RemoteLockedFungibles, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "RemoteLockedFungibles", + (), + [ + 166u8, 178u8, 87u8, 32u8, 245u8, 121u8, 41u8, 67u8, 60u8, 239u8, 43u8, + 155u8, 114u8, 241u8, 54u8, 176u8, 63u8, 204u8, 197u8, 250u8, 60u8, + 185u8, 88u8, 124u8, 242u8, 145u8, 45u8, 16u8, 248u8, 181u8, 236u8, + 11u8, + ], + ) + } + #[doc = " Fungible assets which we know are locked on a remote chain."] + pub fn remote_locked_fungibles_iter1( + &self, + _0: types::remote_locked_fungibles::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::remote_locked_fungibles::Param0, + >, + types::remote_locked_fungibles::RemoteLockedFungibles, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "RemoteLockedFungibles", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 166u8, 178u8, 87u8, 32u8, 245u8, 121u8, 41u8, 67u8, 60u8, 239u8, 43u8, + 155u8, 114u8, 241u8, 54u8, 176u8, 63u8, 204u8, 197u8, 250u8, 60u8, + 185u8, 88u8, 124u8, 242u8, 145u8, 45u8, 16u8, 248u8, 181u8, 236u8, + 11u8, + ], + ) + } + #[doc = " Fungible assets which we know are locked on a remote chain."] + pub fn remote_locked_fungibles_iter2( + &self, + _0: types::remote_locked_fungibles::Param0, + _1: types::remote_locked_fungibles::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::remote_locked_fungibles::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::remote_locked_fungibles::Param1, + >, + ), + types::remote_locked_fungibles::RemoteLockedFungibles, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "RemoteLockedFungibles", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 166u8, 178u8, 87u8, 32u8, 245u8, 121u8, 41u8, 67u8, 60u8, 239u8, 43u8, + 155u8, 114u8, 241u8, 54u8, 176u8, 63u8, 204u8, 197u8, 250u8, 60u8, + 185u8, 88u8, 124u8, 242u8, 145u8, 45u8, 16u8, 248u8, 181u8, 236u8, + 11u8, + ], + ) + } + #[doc = " Fungible assets which we know are locked on a remote chain."] + pub fn remote_locked_fungibles( + &self, + _0: types::remote_locked_fungibles::Param0, + _1: types::remote_locked_fungibles::Param1, + _2: types::remote_locked_fungibles::Param2, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::remote_locked_fungibles::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::remote_locked_fungibles::Param1, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::remote_locked_fungibles::Param2, + >, + ), + types::remote_locked_fungibles::RemoteLockedFungibles, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "RemoteLockedFungibles", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ::subxt_core::storage::address::StaticStorageKey::new(_2), + ), + [ + 166u8, 178u8, 87u8, 32u8, 245u8, 121u8, 41u8, 67u8, 60u8, 239u8, 43u8, + 155u8, 114u8, 241u8, 54u8, 176u8, 63u8, 204u8, 197u8, 250u8, 60u8, + 185u8, 88u8, 124u8, 242u8, 145u8, 45u8, 16u8, 248u8, 181u8, 236u8, + 11u8, + ], + ) + } + #[doc = " Fungible assets which we know are locked on this chain."] + pub fn locked_fungibles_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::locked_fungibles::LockedFungibles, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "LockedFungibles", + (), + [ + 112u8, 157u8, 87u8, 224u8, 37u8, 77u8, 11u8, 17u8, 173u8, 230u8, 168u8, + 230u8, 33u8, 8u8, 209u8, 110u8, 182u8, 34u8, 118u8, 28u8, 15u8, 14u8, + 185u8, 50u8, 16u8, 52u8, 90u8, 125u8, 46u8, 20u8, 120u8, 136u8, + ], + ) + } + #[doc = " Fungible assets which we know are locked on this chain."] + pub fn locked_fungibles( + &self, + _0: types::locked_fungibles::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::locked_fungibles::Param0, + >, + types::locked_fungibles::LockedFungibles, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "LockedFungibles", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 112u8, 157u8, 87u8, 224u8, 37u8, 77u8, 11u8, 17u8, 173u8, 230u8, 168u8, + 230u8, 33u8, 8u8, 209u8, 110u8, 182u8, 34u8, 118u8, 28u8, 15u8, 14u8, + 185u8, 50u8, 16u8, 52u8, 90u8, 125u8, 46u8, 20u8, 120u8, 136u8, + ], + ) + } + #[doc = " Global suspension state of the XCM executor."] + pub fn xcm_execution_suspended( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::xcm_execution_suspended::XcmExecutionSuspended, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "XcmExecutionSuspended", + (), + [ + 182u8, 54u8, 69u8, 68u8, 78u8, 76u8, 103u8, 79u8, 47u8, 136u8, 99u8, + 104u8, 128u8, 129u8, 249u8, 54u8, 214u8, 136u8, 97u8, 48u8, 178u8, + 42u8, 26u8, 27u8, 82u8, 24u8, 33u8, 77u8, 33u8, 27u8, 20u8, 127u8, + ], + ) + } + #[doc = " Whether or not incoming XCMs (both executed locally and received) should be recorded."] + #[doc = " Only one XCM program will be recorded at a time."] + #[doc = " This is meant to be used in runtime APIs, and it's advised it stays false"] + #[doc = " for all other use cases, so as to not degrade regular performance."] + #[doc = ""] + #[doc = " Only relevant if this pallet is being used as the [`xcm_executor::traits::RecordXcm`]"] + #[doc = " implementation in the XCM executor configuration."] + pub fn should_record_xcm( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::should_record_xcm::ShouldRecordXcm, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "ShouldRecordXcm", + (), + [ + 77u8, 184u8, 154u8, 92u8, 185u8, 225u8, 131u8, 210u8, 55u8, 115u8, 3u8, + 182u8, 191u8, 132u8, 51u8, 136u8, 42u8, 136u8, 54u8, 36u8, 229u8, + 229u8, 47u8, 88u8, 4u8, 175u8, 136u8, 78u8, 226u8, 253u8, 13u8, 178u8, + ], + ) + } + #[doc = " If [`ShouldRecordXcm`] is set to true, then the last XCM program executed locally"] + #[doc = " will be stored here."] + #[doc = " Runtime APIs can fetch the XCM that was executed by accessing this value."] + #[doc = ""] + #[doc = " Only relevant if this pallet is being used as the [`xcm_executor::traits::RecordXcm`]"] + #[doc = " implementation in the XCM executor configuration."] + pub fn recorded_xcm( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::recorded_xcm::RecordedXcm, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "RecordedXcm", + (), + [ + 21u8, 172u8, 234u8, 160u8, 115u8, 240u8, 135u8, 8u8, 11u8, 62u8, 121u8, + 113u8, 13u8, 164u8, 179u8, 0u8, 139u8, 216u8, 216u8, 236u8, 135u8, + 116u8, 200u8, 199u8, 199u8, 249u8, 211u8, 0u8, 4u8, 86u8, 187u8, 198u8, + ], + ) + } + #[doc = " Map of authorized aliasers of local origins. Each local location can authorize a list of"] + #[doc = " other locations to alias into it. Each aliaser is only valid until its inner `expiry`"] + #[doc = " block number."] + pub fn authorized_aliases_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::authorized_aliases::AuthorizedAliases, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "AuthorizedAliases", + (), + [ + 63u8, 80u8, 205u8, 122u8, 167u8, 12u8, 220u8, 136u8, 173u8, 89u8, + 222u8, 76u8, 94u8, 51u8, 225u8, 207u8, 186u8, 196u8, 85u8, 177u8, + 207u8, 174u8, 53u8, 173u8, 200u8, 21u8, 101u8, 183u8, 1u8, 13u8, 145u8, + 239u8, + ], + ) + } + #[doc = " Map of authorized aliasers of local origins. Each local location can authorize a list of"] + #[doc = " other locations to alias into it. Each aliaser is only valid until its inner `expiry`"] + #[doc = " block number."] + pub fn authorized_aliases( + &self, + _0: types::authorized_aliases::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::authorized_aliases::Param0, + >, + types::authorized_aliases::AuthorizedAliases, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "PolkadotXcm", + "AuthorizedAliases", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 63u8, 80u8, 205u8, 122u8, 167u8, 12u8, 220u8, 136u8, 173u8, 89u8, + 222u8, 76u8, 94u8, 51u8, 225u8, 207u8, 186u8, 196u8, 85u8, 177u8, + 207u8, 174u8, 53u8, 173u8, 200u8, 21u8, 101u8, 183u8, 1u8, 13u8, 145u8, + 239u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " This chain's Universal Location."] + pub fn universal_location( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::staging_xcm::v5::junctions::Junctions, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "PolkadotXcm", + "UniversalLocation", + [ + 241u8, 114u8, 225u8, 116u8, 227u8, 77u8, 161u8, 134u8, 134u8, 121u8, + 72u8, 16u8, 209u8, 208u8, 114u8, 110u8, 163u8, 156u8, 92u8, 109u8, + 134u8, 194u8, 160u8, 228u8, 126u8, 244u8, 254u8, 171u8, 162u8, 58u8, + 216u8, 63u8, + ], + ) + } + #[doc = " The latest supported version that we advertise. Generally just set it to"] + #[doc = " `pallet_xcm::CurrentXcmVersion`."] + pub fn advertised_xcm_version( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "PolkadotXcm", + "AdvertisedXcmVersion", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum number of local XCM locks that a single account may have."] + pub fn max_lockers( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "PolkadotXcm", + "MaxLockers", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum number of consumers a single remote lock may have."] + pub fn max_remote_lock_consumers( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "PolkadotXcm", + "MaxRemoteLockConsumers", + [ + 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 cumulus_xcm { + use super::root_mod; + use super::runtime_types; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::cumulus_pallet_xcm::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + } + pub struct TransactionApi; + impl TransactionApi {} + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::cumulus_pallet_xcm::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Downward message is invalid XCM."] + #[doc = "\\[ id \\]"] + pub struct InvalidFormat(pub invalid_format::Field0); + pub mod invalid_format { + use super::runtime_types; + pub type Field0 = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for InvalidFormat { + const PALLET: &'static str = "CumulusXcm"; + const EVENT: &'static str = "InvalidFormat"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Downward message is unsupported version of XCM."] + #[doc = "\\[ id \\]"] + pub struct UnsupportedVersion(pub unsupported_version::Field0); + pub mod unsupported_version { + use super::runtime_types; + pub type Field0 = [::core::primitive::u8; 32usize]; + } + impl ::subxt_core::events::StaticEvent for UnsupportedVersion { + const PALLET: &'static str = "CumulusXcm"; + const EVENT: &'static str = "UnsupportedVersion"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Downward message executed with the given outcome."] + #[doc = "\\[ id, outcome \\]"] + pub struct ExecutedDownward( + pub executed_downward::Field0, + pub executed_downward::Field1, + ); + pub mod executed_downward { + use super::runtime_types; + pub type Field0 = [::core::primitive::u8; 32usize]; + pub type Field1 = runtime_types::staging_xcm::v5::traits::Outcome; + } + impl ::subxt_core::events::StaticEvent for ExecutedDownward { + const PALLET: &'static str = "CumulusXcm"; + const EVENT: &'static str = "ExecutedDownward"; + } + } + } + pub mod message_queue { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_message_queue::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_message_queue::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Remove a page which has no more messages remaining to be processed or is stale."] + pub struct ReapPage { + pub message_origin: reap_page::MessageOrigin, + pub page_index: reap_page::PageIndex, + } + pub mod reap_page { + use super::runtime_types; + pub type MessageOrigin = + runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + pub type PageIndex = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for ReapPage { + const PALLET: &'static str = "MessageQueue"; + const CALL: &'static str = "reap_page"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Execute an overweight message."] + #[doc = ""] + #[doc = "Temporary processing errors will be propagated whereas permanent errors are treated"] + #[doc = "as success condition."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `message_origin`: The origin from which the message to be executed arrived."] + #[doc = "- `page`: The page in the queue in which the message to be executed is sitting."] + #[doc = "- `index`: The index into the queue of the message to be executed."] + #[doc = "- `weight_limit`: The maximum amount of weight allowed to be consumed in the execution"] + #[doc = " of the message."] + #[doc = ""] + #[doc = "Benchmark complexity considerations: O(index + weight_limit)."] + pub struct ExecuteOverweight { + pub message_origin: execute_overweight::MessageOrigin, + pub page: execute_overweight::Page, + pub index: execute_overweight::Index, + pub weight_limit: execute_overweight::WeightLimit, + } + pub mod execute_overweight { + use super::runtime_types; + pub type MessageOrigin = + runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + pub type Page = ::core::primitive::u32; + pub type Index = ::core::primitive::u32; + pub type WeightLimit = runtime_types::sp_weights::weight_v2::Weight; + } + impl ::subxt_core::blocks::StaticExtrinsic for ExecuteOverweight { + const PALLET: &'static str = "MessageQueue"; + const CALL: &'static str = "execute_overweight"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Remove a page which has no more messages remaining to be processed or is stale."] + pub fn reap_page( + &self, + message_origin: types::reap_page::MessageOrigin, + page_index: types::reap_page::PageIndex, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "MessageQueue", + "reap_page", + types::ReapPage { + message_origin, + page_index, + }, + [ + 116u8, 17u8, 120u8, 238u8, 117u8, 222u8, 10u8, 166u8, 132u8, 181u8, + 114u8, 150u8, 242u8, 202u8, 31u8, 143u8, 212u8, 65u8, 145u8, 249u8, + 27u8, 204u8, 137u8, 133u8, 220u8, 187u8, 137u8, 90u8, 112u8, 55u8, + 104u8, 163u8, + ], + ) + } + #[doc = "Execute an overweight message."] + #[doc = ""] + #[doc = "Temporary processing errors will be propagated whereas permanent errors are treated"] + #[doc = "as success condition."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `message_origin`: The origin from which the message to be executed arrived."] + #[doc = "- `page`: The page in the queue in which the message to be executed is sitting."] + #[doc = "- `index`: The index into the queue of the message to be executed."] + #[doc = "- `weight_limit`: The maximum amount of weight allowed to be consumed in the execution"] + #[doc = " of the message."] + #[doc = ""] + #[doc = "Benchmark complexity considerations: O(index + weight_limit)."] + pub fn execute_overweight( + &self, + message_origin: types::execute_overweight::MessageOrigin, + page: types::execute_overweight::Page, + index: types::execute_overweight::Index, + weight_limit: types::execute_overweight::WeightLimit, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "MessageQueue", + "execute_overweight", + types::ExecuteOverweight { + message_origin, + page, + index, + weight_limit, + }, + [ + 177u8, 54u8, 82u8, 58u8, 94u8, 125u8, 241u8, 172u8, 52u8, 7u8, 236u8, + 80u8, 66u8, 99u8, 42u8, 199u8, 38u8, 195u8, 65u8, 118u8, 166u8, 246u8, + 239u8, 195u8, 144u8, 153u8, 155u8, 8u8, 224u8, 56u8, 106u8, 135u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_message_queue::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Message discarded due to an error in the `MessageProcessor` (usually a format error)."] + pub struct ProcessingFailed { + pub id: processing_failed::Id, + pub origin: processing_failed::Origin, + pub error: processing_failed::Error, + } + pub mod processing_failed { + use super::runtime_types; + pub type Id = ::subxt_core::utils::H256; + pub type Origin = runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + pub type Error = + runtime_types::frame_support::traits::messages::ProcessMessageError; + } + impl ::subxt_core::events::StaticEvent for ProcessingFailed { + const PALLET: &'static str = "MessageQueue"; + const EVENT: &'static str = "ProcessingFailed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Message is processed."] + pub struct Processed { + pub id: processed::Id, + pub origin: processed::Origin, + pub weight_used: processed::WeightUsed, + pub success: processed::Success, + } + pub mod processed { + use super::runtime_types; + pub type Id = ::subxt_core::utils::H256; + pub type Origin = runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + pub type WeightUsed = runtime_types::sp_weights::weight_v2::Weight; + pub type Success = ::core::primitive::bool; + } + impl ::subxt_core::events::StaticEvent for Processed { + const PALLET: &'static str = "MessageQueue"; + const EVENT: &'static str = "Processed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Message placed in overweight queue."] + pub struct OverweightEnqueued { + pub id: overweight_enqueued::Id, + pub origin: overweight_enqueued::Origin, + pub page_index: overweight_enqueued::PageIndex, + pub message_index: overweight_enqueued::MessageIndex, + } + pub mod overweight_enqueued { + use super::runtime_types; + pub type Id = [::core::primitive::u8; 32usize]; + pub type Origin = runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + pub type PageIndex = ::core::primitive::u32; + pub type MessageIndex = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for OverweightEnqueued { + const PALLET: &'static str = "MessageQueue"; + const EVENT: &'static str = "OverweightEnqueued"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "This page was reaped."] + pub struct PageReaped { + pub origin: page_reaped::Origin, + pub index: page_reaped::Index, + } + pub mod page_reaped { + use super::runtime_types; + pub type Origin = runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + pub type Index = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for PageReaped { + const PALLET: &'static str = "MessageQueue"; + const EVENT: &'static str = "PageReaped"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod book_state_for { + use super::runtime_types; + pub type BookStateFor = runtime_types::pallet_message_queue::BookState< + runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + >; + pub type Param0 = + runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + } + pub mod service_head { + use super::runtime_types; + pub type ServiceHead = + runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + } + pub mod pages { + use super::runtime_types; + pub type Pages = + runtime_types::pallet_message_queue::Page<::core::primitive::u32>; + pub type Param0 = + runtime_types::cumulus_primitives_core::AggregateMessageOrigin; + pub type Param1 = ::core::primitive::u32; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " The index of the first and last (non-empty) pages."] + pub fn book_state_for_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::book_state_for::BookStateFor, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "MessageQueue", + "BookStateFor", + (), + [ + 33u8, 240u8, 235u8, 59u8, 150u8, 42u8, 91u8, 248u8, 235u8, 52u8, 170u8, + 52u8, 195u8, 129u8, 6u8, 174u8, 57u8, 242u8, 30u8, 220u8, 232u8, 4u8, + 246u8, 218u8, 162u8, 174u8, 102u8, 95u8, 210u8, 92u8, 133u8, 143u8, + ], + ) + } + #[doc = " The index of the first and last (non-empty) pages."] + pub fn book_state_for( + &self, + _0: types::book_state_for::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::book_state_for::BookStateFor, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "MessageQueue", + "BookStateFor", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 33u8, 240u8, 235u8, 59u8, 150u8, 42u8, 91u8, 248u8, 235u8, 52u8, 170u8, + 52u8, 195u8, 129u8, 6u8, 174u8, 57u8, 242u8, 30u8, 220u8, 232u8, 4u8, + 246u8, 218u8, 162u8, 174u8, 102u8, 95u8, 210u8, 92u8, 133u8, 143u8, + ], + ) + } + #[doc = " The origin at which we should begin servicing."] + pub fn service_head( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::service_head::ServiceHead, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "MessageQueue", + "ServiceHead", + (), + [ + 104u8, 146u8, 240u8, 41u8, 171u8, 68u8, 20u8, 147u8, 212u8, 155u8, + 59u8, 39u8, 174u8, 186u8, 97u8, 250u8, 41u8, 247u8, 67u8, 190u8, 252u8, + 167u8, 234u8, 36u8, 124u8, 239u8, 163u8, 72u8, 223u8, 82u8, 82u8, + 171u8, + ], + ) + } + #[doc = " The map of page indices to pages."] + pub fn pages_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::pages::Pages, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "MessageQueue", + "Pages", + (), + [ + 45u8, 202u8, 18u8, 128u8, 31u8, 194u8, 175u8, 173u8, 99u8, 81u8, 161u8, + 44u8, 32u8, 183u8, 238u8, 181u8, 110u8, 240u8, 203u8, 12u8, 152u8, + 58u8, 239u8, 190u8, 144u8, 168u8, 210u8, 33u8, 121u8, 250u8, 137u8, + 142u8, + ], + ) + } + #[doc = " The map of page indices to pages."] + pub fn pages_iter1( + &self, + _0: types::pages::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::pages::Pages, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "MessageQueue", + "Pages", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 45u8, 202u8, 18u8, 128u8, 31u8, 194u8, 175u8, 173u8, 99u8, 81u8, 161u8, + 44u8, 32u8, 183u8, 238u8, 181u8, 110u8, 240u8, 203u8, 12u8, 152u8, + 58u8, 239u8, 190u8, 144u8, 168u8, 210u8, 33u8, 121u8, 250u8, 137u8, + 142u8, + ], + ) + } + #[doc = " The map of page indices to pages."] + pub fn pages( + &self, + _0: types::pages::Param0, + _1: types::pages::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey, + ::subxt_core::storage::address::StaticStorageKey, + ), + types::pages::Pages, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "MessageQueue", + "Pages", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 45u8, 202u8, 18u8, 128u8, 31u8, 194u8, 175u8, 173u8, 99u8, 81u8, 161u8, + 44u8, 32u8, 183u8, 238u8, 181u8, 110u8, 240u8, 203u8, 12u8, 152u8, + 58u8, 239u8, 190u8, 144u8, 168u8, 210u8, 33u8, 121u8, 250u8, 137u8, + 142u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The size of the page; this implies the maximum message size which can be sent."] + #[doc = ""] + #[doc = " A good value depends on the expected message sizes, their weights, the weight that is"] + #[doc = " available for processing them and the maximal needed message size. The maximal message"] + #[doc = " size is slightly lower than this as defined by [`MaxMessageLenOf`]."] + pub fn heap_size( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "MessageQueue", + "HeapSize", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum number of stale pages (i.e. of overweight messages) allowed before culling"] + #[doc = " can happen. Once there are more stale pages than this, then historical pages may be"] + #[doc = " dropped, even if they contain unprocessed overweight messages."] + pub fn max_stale( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "MessageQueue", + "MaxStale", + [ + 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 weight (if any) which should be provided to the message queue for"] + #[doc = " servicing enqueued items `on_initialize`."] + #[doc = ""] + #[doc = " This may be legitimately `None` in the case that you will call"] + #[doc = " `ServiceQueues::service_queues` manually or set [`Self::IdleMaxServiceWeight`] to have"] + #[doc = " it run in `on_idle`."] + pub fn service_weight( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + ::core::option::Option, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "MessageQueue", + "ServiceWeight", + [ + 204u8, 140u8, 63u8, 167u8, 49u8, 8u8, 148u8, 163u8, 190u8, 224u8, 15u8, + 103u8, 86u8, 153u8, 248u8, 117u8, 223u8, 117u8, 210u8, 80u8, 205u8, + 155u8, 40u8, 11u8, 59u8, 63u8, 129u8, 156u8, 17u8, 83u8, 177u8, 250u8, + ], + ) + } + #[doc = " The maximum amount of weight (if any) to be used from remaining weight `on_idle` which"] + #[doc = " should be provided to the message queue for servicing enqueued items `on_idle`."] + #[doc = " Useful for parachains to process messages at the same block they are received."] + #[doc = ""] + #[doc = " If `None`, it will not call `ServiceQueues::service_queues` in `on_idle`."] + pub fn idle_max_service_weight( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + ::core::option::Option, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "MessageQueue", + "IdleMaxServiceWeight", + [ + 204u8, 140u8, 63u8, 167u8, 49u8, 8u8, 148u8, 163u8, 190u8, 224u8, 15u8, + 103u8, 86u8, 153u8, 248u8, 117u8, 223u8, 117u8, 210u8, 80u8, 205u8, + 155u8, 40u8, 11u8, 59u8, 63u8, 129u8, 156u8, 17u8, 83u8, 177u8, 250u8, + ], + ) + } + } + } + } + pub mod utility { + use super::root_mod; + use super::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; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub struct Batch { + pub calls: batch::Calls, + } + pub mod batch { + use super::runtime_types; + pub type Calls = ::subxt_core::alloc::vec::Vec< + runtime_types::storage_paseo_runtime::RuntimeCall, + >; + } + impl ::subxt_core::blocks::StaticExtrinsic for Batch { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub struct AsDerivative { + pub index: as_derivative::Index, + pub call: ::subxt_core::alloc::boxed::Box, + } + pub mod as_derivative { + use super::runtime_types; + pub type Index = ::core::primitive::u16; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + } + impl ::subxt_core::blocks::StaticExtrinsic for AsDerivative { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "as_derivative"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub struct BatchAll { + pub calls: batch_all::Calls, + } + pub mod batch_all { + use super::runtime_types; + pub type Calls = ::subxt_core::alloc::vec::Vec< + runtime_types::storage_paseo_runtime::RuntimeCall, + >; + } + impl ::subxt_core::blocks::StaticExtrinsic for BatchAll { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "batch_all"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(1)."] + pub struct DispatchAs { + pub as_origin: ::subxt_core::alloc::boxed::Box, + pub call: ::subxt_core::alloc::boxed::Box, + } + pub mod dispatch_as { + use super::runtime_types; + pub type AsOrigin = runtime_types::storage_paseo_runtime::OriginCaller; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + } + impl ::subxt_core::blocks::StaticExtrinsic for DispatchAs { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "dispatch_as"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub struct ForceBatch { + pub calls: force_batch::Calls, + } + pub mod force_batch { + use super::runtime_types; + pub type Calls = ::subxt_core::alloc::vec::Vec< + runtime_types::storage_paseo_runtime::RuntimeCall, + >; + } + impl ::subxt_core::blocks::StaticExtrinsic for ForceBatch { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "force_batch"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Dispatch a function call with a specified weight."] + #[doc = ""] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + pub struct WithWeight { + pub call: ::subxt_core::alloc::boxed::Box, + pub weight: with_weight::Weight, + } + pub mod with_weight { + use super::runtime_types; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + pub type Weight = runtime_types::sp_weights::weight_v2::Weight; + } + impl ::subxt_core::blocks::StaticExtrinsic for WithWeight { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "with_weight"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Dispatch a fallback call in the event the main call fails to execute."] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "This function first attempts to dispatch the `main` call."] + #[doc = "If the `main` call fails, the `fallback` is attemted."] + #[doc = "if the fallback is successfully dispatched, the weights of both calls"] + #[doc = "are accumulated and an event containing the main call error is deposited."] + #[doc = ""] + #[doc = "In the event of a fallback failure the whole call fails"] + #[doc = "with the weights returned."] + #[doc = ""] + #[doc = "- `main`: The main call to be dispatched. This is the primary action to execute."] + #[doc = "- `fallback`: The fallback call to be dispatched in case the `main` call fails."] + #[doc = ""] + #[doc = "## Dispatch Logic"] + #[doc = "- If the origin is `root`, both the main and fallback calls are executed without"] + #[doc = " applying any origin filters."] + #[doc = "- If the origin is not `root`, the origin filter is applied to both the `main` and"] + #[doc = " `fallback` calls."] + #[doc = ""] + #[doc = "## Use Case"] + #[doc = "- Some use cases might involve submitting a `batch` type call in either main, fallback"] + #[doc = " or both."] + pub struct IfElse { + pub main: ::subxt_core::alloc::boxed::Box, + pub fallback: ::subxt_core::alloc::boxed::Box, + } + pub mod if_else { + use super::runtime_types; + pub type Main = runtime_types::storage_paseo_runtime::RuntimeCall; + pub type Fallback = runtime_types::storage_paseo_runtime::RuntimeCall; + } + impl ::subxt_core::blocks::StaticExtrinsic for IfElse { + const PALLET: &'static str = "Utility"; + const CALL: &'static str = "if_else"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: 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_core::alloc::boxed::Box, + pub call: ::subxt_core::alloc::boxed::Box, + } + pub mod dispatch_as_fallible { + use super::runtime_types; + pub type AsOrigin = runtime_types::storage_paseo_runtime::OriginCaller; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + } + impl ::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( + &self, + calls: types::batch::Calls, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Utility", + "batch", + types::Batch { calls }, + [ + 188u8, 179u8, 46u8, 25u8, 239u8, 225u8, 241u8, 55u8, 177u8, 254u8, + 131u8, 234u8, 228u8, 120u8, 0u8, 2u8, 107u8, 29u8, 29u8, 154u8, 181u8, + 73u8, 23u8, 66u8, 35u8, 53u8, 238u8, 69u8, 139u8, 200u8, 41u8, 207u8, + ], + ) + } + #[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, + index: types::as_derivative::Index, + call: types::as_derivative::Call, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Utility", + "as_derivative", + types::AsDerivative { + index, + call: ::subxt_core::alloc::boxed::Box::new(call), + }, + [ + 240u8, 225u8, 57u8, 6u8, 63u8, 195u8, 4u8, 201u8, 78u8, 116u8, 109u8, + 109u8, 109u8, 235u8, 216u8, 198u8, 210u8, 173u8, 32u8, 19u8, 188u8, + 67u8, 81u8, 105u8, 169u8, 251u8, 43u8, 109u8, 170u8, 9u8, 86u8, 9u8, + ], + ) + } + #[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, + calls: types::batch_all::Calls, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Utility", + "batch_all", + types::BatchAll { calls }, + [ + 127u8, 81u8, 243u8, 28u8, 199u8, 180u8, 205u8, 250u8, 127u8, 67u8, + 125u8, 175u8, 78u8, 248u8, 32u8, 120u8, 115u8, 104u8, 113u8, 70u8, + 120u8, 239u8, 2u8, 61u8, 168u8, 110u8, 253u8, 247u8, 248u8, 5u8, 218u8, + 142u8, + ], + ) + } + #[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, + as_origin: types::dispatch_as::AsOrigin, + call: types::dispatch_as::Call, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Utility", + "dispatch_as", + types::DispatchAs { + as_origin: ::subxt_core::alloc::boxed::Box::new(as_origin), + call: ::subxt_core::alloc::boxed::Box::new(call), + }, + [ + 159u8, 48u8, 140u8, 134u8, 91u8, 247u8, 245u8, 98u8, 141u8, 115u8, + 18u8, 4u8, 34u8, 92u8, 52u8, 119u8, 233u8, 161u8, 234u8, 99u8, 138u8, + 211u8, 254u8, 13u8, 240u8, 13u8, 108u8, 255u8, 128u8, 121u8, 20u8, + 214u8, + ], + ) + } + #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + pub fn force_batch( + &self, + calls: types::force_batch::Calls, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Utility", + "force_batch", + types::ForceBatch { calls }, + [ + 24u8, 145u8, 42u8, 162u8, 212u8, 153u8, 185u8, 18u8, 200u8, 186u8, + 241u8, 9u8, 194u8, 65u8, 222u8, 251u8, 247u8, 241u8, 70u8, 119u8, + 253u8, 103u8, 140u8, 101u8, 201u8, 138u8, 198u8, 164u8, 251u8, 253u8, + 65u8, 191u8, + ], + ) + } + #[doc = "Dispatch a function call with a specified weight."] + #[doc = ""] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + pub fn with_weight( + &self, + call: types::with_weight::Call, + weight: types::with_weight::Weight, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Utility", + "with_weight", + types::WithWeight { + call: ::subxt_core::alloc::boxed::Box::new(call), + weight, + }, + [ + 21u8, 57u8, 88u8, 159u8, 227u8, 67u8, 215u8, 149u8, 22u8, 8u8, 47u8, + 116u8, 37u8, 229u8, 169u8, 32u8, 22u8, 21u8, 184u8, 97u8, 199u8, 96u8, + 96u8, 116u8, 42u8, 223u8, 148u8, 170u8, 220u8, 0u8, 26u8, 81u8, + ], + ) + } + #[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_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Utility", + "if_else", + types::IfElse { + main: ::subxt_core::alloc::boxed::Box::new(main), + fallback: ::subxt_core::alloc::boxed::Box::new(fallback), + }, + [ + 47u8, 161u8, 224u8, 182u8, 119u8, 247u8, 150u8, 216u8, 60u8, 239u8, + 131u8, 156u8, 89u8, 85u8, 126u8, 142u8, 100u8, 195u8, 148u8, 55u8, + 166u8, 98u8, 142u8, 15u8, 86u8, 197u8, 66u8, 237u8, 165u8, 176u8, 62u8, + 122u8, + ], + ) + } + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "Almost the same as [`Pallet::dispatch_as`] but forwards any error of the inner call."] + #[doc = ""] + #[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_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Utility", + "dispatch_as_fallible", + types::DispatchAsFallible { + as_origin: ::subxt_core::alloc::boxed::Box::new(as_origin), + call: ::subxt_core::alloc::boxed::Box::new(call), + }, + [ + 63u8, 40u8, 208u8, 222u8, 8u8, 160u8, 133u8, 218u8, 91u8, 56u8, 132u8, + 10u8, 124u8, 231u8, 223u8, 216u8, 35u8, 229u8, 9u8, 60u8, 44u8, 240u8, + 178u8, 67u8, 79u8, 188u8, 128u8, 87u8, 124u8, 177u8, 117u8, 91u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_utility::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: 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, + } + pub mod batch_interrupted { + use super::runtime_types; + pub type Index = ::core::primitive::u32; + pub type Error = runtime_types::sp_runtime::DispatchError; + } + impl ::subxt_core::events::StaticEvent for BatchInterrupted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchInterrupted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Batch of dispatches completed fully with no error."] + pub struct BatchCompleted; + impl ::subxt_core::events::StaticEvent for BatchCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompleted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Batch of dispatches completed but has errors."] + pub struct BatchCompletedWithErrors; + impl ::subxt_core::events::StaticEvent for BatchCompletedWithErrors { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompletedWithErrors"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A single item within a Batch of dispatches has completed with no error."] + pub struct ItemCompleted; + impl ::subxt_core::events::StaticEvent for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: 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, + } + pub mod item_failed { + use super::runtime_types; + pub type Error = runtime_types::sp_runtime::DispatchError; + } + impl ::subxt_core::events::StaticEvent for ItemFailed { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemFailed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A call was dispatched."] + pub struct DispatchedAs { + pub result: dispatched_as::Result, + } + pub mod dispatched_as { + use super::runtime_types; + pub type Result = + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>; + } + impl ::subxt_core::events::StaticEvent for DispatchedAs { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "DispatchedAs"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Main call was dispatched."] + pub struct IfElseMainSuccess; + impl ::subxt_core::events::StaticEvent for IfElseMainSuccess { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "IfElseMainSuccess"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The fallback call was dispatched."] + pub struct IfElseFallbackCalled { + pub main_error: if_else_fallback_called::MainError, + } + pub mod if_else_fallback_called { + use super::runtime_types; + pub type MainError = runtime_types::sp_runtime::DispatchError; + } + impl ::subxt_core::events::StaticEvent for IfElseFallbackCalled { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "IfElseFallbackCalled"; + } + } + 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_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::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 weight_reclaim { + use super::root_mod; + use super::runtime_types; + } + pub mod storage_provider { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_storage_provider::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_storage_provider::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Register as a storage provider."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multiaddr`: Network address for clients to connect"] + #[doc = "- `public_key`: Public key for signature verification (raw bytes, 32-64 bytes)"] + #[doc = "- `stake`: Initial stake to lock"] + pub struct RegisterProvider { + pub multiaddr: register_provider::Multiaddr, + pub public_key: register_provider::PublicKey, + pub stake: register_provider::Stake, + } + pub mod register_provider { + use super::runtime_types; + pub type Multiaddr = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub type PublicKey = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub type Stake = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for RegisterProvider { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "register_provider"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Add stake to an existing provider registration."] + pub struct AddStake { + pub amount: add_stake::Amount, + } + pub mod add_stake { + use super::runtime_types; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for AddStake { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "add_stake"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Announce intent to deregister."] + #[doc = ""] + #[doc = "This is the first step of a two-step exit:"] + #[doc = ""] + #[doc = "1. `deregister_provider` (this call) — marks the provider as"] + #[doc = " leaving, freezes them from accepting new agreements or"] + #[doc = " extensions, and stamps `deregister_at = now + DeregisterAnnouncementPeriod`."] + #[doc = " Stake stays reserved; the provider remains on-chain and fully"] + #[doc = " slashable for any pending or freshly-created challenge."] + #[doc = "2. `complete_deregister` — callable once `deregister_at` has"] + #[doc = " elapsed (by which point any challenge created up to the"] + #[doc = " announcement block has already matured, because the period"] + #[doc = " must be `> ChallengeTimeout`)."] + #[doc = ""] + #[doc = "The two-step flow closes the slashing race where a provider"] + #[doc = "could withdraw stake between the end of their last agreement"] + #[doc = "and the deadline of a challenge created against it."] + pub struct DeregisterProvider; + impl ::subxt_core::blocks::StaticExtrinsic for DeregisterProvider { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "deregister_provider"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Finalise a previously-announced deregistration."] + #[doc = ""] + #[doc = "Callable by the provider once `DeregisterAnnouncementPeriod` has"] + #[doc = "elapsed since their `deregister_provider` call. Drains any"] + #[doc = "pending `CheckpointRewards` into the provider's free balance,"] + #[doc = "unreserves the remaining stake, and removes the provider record."] + #[doc = ""] + #[doc = "Still requires `committed_bytes == 0` — if the provider somehow"] + #[doc = "re-acquired commitments mid-window (they cannot today, since"] + #[doc = "announce forces `accepting_primary = false` and"] + #[doc = "`update_provider_settings` is blocked during the window) the"] + #[doc = "caller must wait for those agreements to end first."] + pub struct CompleteDeregister; + impl ::subxt_core::blocks::StaticExtrinsic for CompleteDeregister { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "complete_deregister"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Cancel a previously-announced deregistration."] + #[doc = ""] + #[doc = "Restores `accepting_primary` / `accepting_extensions` to `true`"] + #[doc = "(mirroring what `deregister_provider` forced to `false` on"] + #[doc = "announce) and clears `deregister_at`. If the provider wants"] + #[doc = "different post-cancel settings they can call"] + #[doc = "`update_provider_settings` afterwards."] + pub struct CancelDeregister; + impl ::subxt_core::blocks::StaticExtrinsic for CancelDeregister { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "cancel_deregister"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Update provider settings."] + pub struct UpdateProviderSettings { + pub settings: update_provider_settings::Settings, + } + pub mod update_provider_settings { + use super::runtime_types; + pub type Settings = + runtime_types::pallet_storage_provider::pallet::ProviderSettings; + } + impl ::subxt_core::blocks::StaticExtrinsic for UpdateProviderSettings { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "update_provider_settings"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Update the provider's multiaddr (network endpoint)."] + pub struct UpdateProviderMultiaddr { + pub multiaddr: update_provider_multiaddr::Multiaddr, + } + pub mod update_provider_multiaddr { + use super::runtime_types; + pub type Multiaddr = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + impl ::subxt_core::blocks::StaticExtrinsic for UpdateProviderMultiaddr { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "update_provider_multiaddr"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Block or unblock extensions for a specific bucket."] + pub struct SetExtensionsBlocked { + pub bucket_id: set_extensions_blocked::BucketId, + pub blocked: set_extensions_blocked::Blocked, + } + pub mod set_extensions_blocked { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Blocked = ::core::primitive::bool; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetExtensionsBlocked { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "set_extensions_blocked"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Redeem provider-signed terms: create a bucket + primary agreement"] + #[doc = "in a single call."] + #[doc = ""] + #[doc = "The provider signs a SCALE-encoded [`AgreementTermsOf`] off-chain;"] + #[doc = "the owner submits it here. The pallet verifies the signature,"] + #[doc = "rejects replays via the provider's sliding nonce window, then runs"] + #[doc = "the standard provider/capacity/stake checks and opens the"] + #[doc = "agreement."] + pub struct EstablishStorageAgreement { + pub provider: establish_storage_agreement::Provider, + pub terms: establish_storage_agreement::Terms, + pub sig: establish_storage_agreement::Sig, + } + pub mod establish_storage_agreement { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Terms = + runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + pub type Sig = runtime_types::sp_runtime::MultiSignature; + } + impl ::subxt_core::blocks::StaticExtrinsic for EstablishStorageAgreement { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "establish_storage_agreement"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Set minimum providers required for checkpoint."] + pub struct SetMinProviders { + pub bucket_id: set_min_providers::BucketId, + pub min_providers: set_min_providers::MinProviders, + } + pub mod set_min_providers { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type MinProviders = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetMinProviders { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "set_min_providers"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Freeze bucket - make append-only (irreversible)."] + pub struct FreezeBucket { + pub bucket_id: freeze_bucket::BucketId, + } + pub mod freeze_bucket { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + } + impl ::subxt_core::blocks::StaticExtrinsic for FreezeBucket { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "freeze_bucket"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Add or update a member's role."] + pub struct SetMember { + pub bucket_id: set_member::BucketId, + pub member: set_member::Member, + pub role: set_member::Role, + } + pub mod set_member { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Member = ::subxt_core::utils::AccountId32; + pub type Role = runtime_types::storage_primitives::Role; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetMember { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "set_member"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Remove member from bucket."] + pub struct RemoveMember { + pub bucket_id: remove_member::BucketId, + pub member: remove_member::Member, + } + pub mod remove_member { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Member = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::blocks::StaticExtrinsic for RemoveMember { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "remove_member"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Remove a slashed provider from a bucket (permissionless)."] + #[doc = ""] + #[doc = "Anyone can call this to clean up slashed providers."] + #[doc = "The provider must have zero stake (indicating they were slashed)."] + #[doc = "Returns payment to agreement owner and removes the provider from the bucket."] + pub struct RemoveSlashed { + pub bucket_id: remove_slashed::BucketId, + pub provider: remove_slashed::Provider, + } + pub mod remove_slashed { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::blocks::StaticExtrinsic for RemoveSlashed { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "remove_slashed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Redeem provider-signed terms for a replica storage agreement."] + #[doc = ""] + #[doc = "The provider signs a SCALE-encoded [`AgreementTermsOf`] with"] + #[doc = "`replica_params: Some(_)` off-chain; the owner submits it here."] + #[doc = "The pallet verifies the signature, rejects replays via the"] + #[doc = "provider's sliding nonce window, then runs the standard"] + #[doc = "provider/capacity/stake checks and opens the replica agreement on"] + #[doc = "an existing bucket."] + pub struct EstablishReplicaAgreement { + pub bucket_id: establish_replica_agreement::BucketId, + pub provider: establish_replica_agreement::Provider, + pub terms: establish_replica_agreement::Terms, + pub sig: establish_replica_agreement::Sig, + } + pub mod establish_replica_agreement { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Terms = + runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + pub type Sig = runtime_types::sp_runtime::MultiSignature; + } + impl ::subxt_core::blocks::StaticExtrinsic for EstablishReplicaAgreement { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "establish_replica_agreement"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "End agreement with pay/burn decision."] + pub struct EndAgreement { + pub bucket_id: end_agreement::BucketId, + pub provider: end_agreement::Provider, + pub action: end_agreement::Action, + } + pub mod end_agreement { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Action = runtime_types::storage_primitives::EndAction; + } + impl ::subxt_core::blocks::StaticExtrinsic for EndAgreement { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "end_agreement"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Claim payment for expired agreement (provider only)."] + pub struct ClaimExpiredAgreement { + pub bucket_id: claim_expired_agreement::BucketId, + } + pub mod claim_expired_agreement { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + } + impl ::subxt_core::blocks::StaticExtrinsic for ClaimExpiredAgreement { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "claim_expired_agreement"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Top up quota for an existing agreement (owner only)."] + #[doc = ""] + #[doc = "Increases max_bytes, does not change duration."] + #[doc = "Actual payment = provider.price_per_byte * additional_bytes * remaining_duration."] + pub struct TopUpAgreement { + pub bucket_id: top_up_agreement::BucketId, + pub provider: top_up_agreement::Provider, + pub additional_bytes: top_up_agreement::AdditionalBytes, + pub max_payment: top_up_agreement::MaxPayment, + } + pub mod top_up_agreement { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type AdditionalBytes = ::core::primitive::u64; + pub type MaxPayment = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for TopUpAgreement { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "top_up_agreement"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Extend agreement duration (immediate, no provider approval needed)."] + #[doc = ""] + #[doc = "This:"] + #[doc = "1. Settles current period: releases payment to provider for elapsed time"] + #[doc = "2. Calculates and locks new payment for extension at current provider prices"] + #[doc = "3. Updates end date to now + additional_duration"] + #[doc = "4. Updates agreement.price_per_byte (and sync_price for replicas) to current prices"] + #[doc = ""] + #[doc = "Price change rules:"] + #[doc = "- If provider's current price <= agreement's locked price: anyone can extend"] + #[doc = "- If provider's current price > agreement's locked price: only owner can extend"] + #[doc = ""] + #[doc = "This enables permissionless persistence for frozen buckets while protecting"] + #[doc = "owners from unwanted price increases."] + pub struct ExtendAgreement { + pub bucket_id: extend_agreement::BucketId, + pub provider: extend_agreement::Provider, + pub additional_duration: extend_agreement::AdditionalDuration, + pub max_payment: extend_agreement::MaxPayment, + } + pub mod extend_agreement { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type AdditionalDuration = ::core::primitive::u32; + pub type MaxPayment = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for ExtendAgreement { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "extend_agreement"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Submit a new checkpoint with provider signatures."] + pub struct Checkpoint { + pub bucket_id: checkpoint::BucketId, + pub commitment: checkpoint::Commitment, + pub nonce: checkpoint::Nonce, + pub signatures: checkpoint::Signatures, + } + pub mod checkpoint { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Commitment = runtime_types::storage_primitives::Commitment; + pub type Nonce = ::core::primitive::u64; + pub type Signatures = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::subxt_core::utils::AccountId32, + runtime_types::sp_runtime::MultiSignature, + )>; + } + impl ::subxt_core::blocks::StaticExtrinsic for Checkpoint { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "checkpoint"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Add additional provider signatures to existing checkpoint."] + #[doc = ""] + #[doc = "Allows late-signing providers to add their signatures to the current"] + #[doc = "snapshot. Useful when a provider signs off-chain commitments later."] + pub struct ExtendCheckpoint { + pub bucket_id: extend_checkpoint::BucketId, + pub additional_signatures: extend_checkpoint::AdditionalSignatures, + } + pub mod extend_checkpoint { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type AdditionalSignatures = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::subxt_core::utils::AccountId32, + runtime_types::sp_runtime::MultiSignature, + )>; + } + impl ::subxt_core::blocks::StaticExtrinsic for ExtendCheckpoint { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "extend_checkpoint"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Submit a provider-initiated checkpoint."] + #[doc = ""] + #[doc = "Providers autonomously coordinate checkpoints without requiring"] + #[doc = "clients to be online. Uses deterministic leader election with"] + #[doc = "fallback to any primary provider after grace period."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `bucket_id`: The bucket to checkpoint"] + #[doc = "- `mmr_root`: MMR root that providers agreed on"] + #[doc = "- `start_seq`: Starting sequence number"] + #[doc = "- `leaf_count`: Number of leaves in the MMR"] + #[doc = "- `window`: Checkpoint window number (prevents replay)"] + #[doc = "- `signatures`: Provider signatures over the checkpoint proposal"] + pub struct ProviderCheckpoint { + pub bucket_id: provider_checkpoint::BucketId, + pub commitment: provider_checkpoint::Commitment, + pub window: provider_checkpoint::Window, + pub signatures: provider_checkpoint::Signatures, + } + pub mod provider_checkpoint { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Commitment = runtime_types::storage_primitives::Commitment; + pub type Window = ::core::primitive::u64; + pub type Signatures = + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::subxt_core::utils::AccountId32, + runtime_types::sp_runtime::MultiSignature, + )>; + } + impl ::subxt_core::blocks::StaticExtrinsic for ProviderCheckpoint { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "provider_checkpoint"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Configure checkpoint window settings for a bucket."] + #[doc = ""] + #[doc = "Only bucket admin can configure. Setting enabled=false disables"] + #[doc = "provider-initiated checkpoints (client-initiated still work)."] + pub struct ConfigureCheckpointWindow { + pub bucket_id: configure_checkpoint_window::BucketId, + pub interval: configure_checkpoint_window::Interval, + pub grace_period: configure_checkpoint_window::GracePeriod, + pub enabled: configure_checkpoint_window::Enabled, + } + pub mod configure_checkpoint_window { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Interval = ::core::primitive::u32; + pub type GracePeriod = ::core::primitive::u32; + pub type Enabled = ::core::primitive::bool; + } + impl ::subxt_core::blocks::StaticExtrinsic for ConfigureCheckpointWindow { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "configure_checkpoint_window"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Report a missed checkpoint window and penalize the leader."] + #[doc = ""] + #[doc = "Can only be called after the checkpoint window has fully passed"] + #[doc = "(beyond grace period) and no checkpoint was submitted."] + #[doc = "Reporter receives a portion of the penalty."] + pub struct ReportMissedCheckpoint { + pub bucket_id: report_missed_checkpoint::BucketId, + pub window: report_missed_checkpoint::Window, + } + pub mod report_missed_checkpoint { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Window = ::core::primitive::u64; + } + impl ::subxt_core::blocks::StaticExtrinsic for ReportMissedCheckpoint { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "report_missed_checkpoint"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Claim accumulated checkpoint rewards."] + #[doc = ""] + #[doc = "Providers accumulate rewards for submitting checkpoints."] + #[doc = "This transfers accumulated rewards to the provider."] + pub struct ClaimCheckpointRewards { + pub bucket_id: claim_checkpoint_rewards::BucketId, + } + pub mod claim_checkpoint_rewards { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + } + impl ::subxt_core::blocks::StaticExtrinsic for ClaimCheckpointRewards { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "claim_checkpoint_rewards"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Fund the checkpoint reward pool for a bucket."] + #[doc = ""] + #[doc = "Anyone can fund the pool. Funds are used to reward providers"] + #[doc = "for submitting checkpoints."] + pub struct FundCheckpointPool { + pub bucket_id: fund_checkpoint_pool::BucketId, + pub amount: fund_checkpoint_pool::Amount, + } + pub mod fund_checkpoint_pool { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for FundCheckpointPool { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "fund_checkpoint_pool"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Challenge on-chain checkpoint (no signatures needed)."] + #[doc = ""] + #[doc = "Provider must be in current snapshot's provider list."] + #[doc = ""] + #[doc = "NOTE: May race with new checkpoints in hot buckets. If the provider is"] + #[doc = "no longer in the snapshot when the transaction executes, this fails."] + #[doc = "For hot buckets, prefer challenge_offchain with the signature you have."] + pub struct ChallengeCheckpoint { + pub bucket_id: challenge_checkpoint::BucketId, + pub provider: challenge_checkpoint::Provider, + pub target: challenge_checkpoint::Target, + } + pub mod challenge_checkpoint { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Target = runtime_types::storage_primitives::ChunkLocation; + } + impl ::subxt_core::blocks::StaticExtrinsic for ChallengeCheckpoint { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "challenge_checkpoint"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Challenge off-chain commitment (requires provider signature)."] + #[doc = ""] + #[doc = "Works regardless of current snapshot state - the signature proves"] + #[doc = "the provider committed to this data."] + #[doc = ""] + #[doc = "Preferred for hot buckets where snapshots change frequently."] + pub struct ChallengeOffchain { + pub bucket_id: challenge_offchain::BucketId, + pub provider: challenge_offchain::Provider, + pub commitment: challenge_offchain::Commitment, + pub target: challenge_offchain::Target, + pub nonce: challenge_offchain::Nonce, + pub provider_signature: challenge_offchain::ProviderSignature, + } + pub mod challenge_offchain { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Commitment = runtime_types::storage_primitives::Commitment; + pub type Target = runtime_types::storage_primitives::ChunkLocation; + pub type Nonce = ::core::primitive::u64; + pub type ProviderSignature = runtime_types::sp_runtime::MultiSignature; + } + impl ::subxt_core::blocks::StaticExtrinsic for ChallengeOffchain { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "challenge_offchain"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Challenge a replica based on their on-chain sync confirmation."] + #[doc = ""] + #[doc = "Uses the replica's last_synced_root stored in their agreement."] + #[doc = "No signature needed - the chain already has their commitment."] + pub struct ChallengeReplica { + pub bucket_id: challenge_replica::BucketId, + pub provider: challenge_replica::Provider, + pub target: challenge_replica::Target, + } + pub mod challenge_replica { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Target = runtime_types::storage_primitives::ChunkLocation; + } + impl ::subxt_core::blocks::StaticExtrinsic for ChallengeReplica { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "challenge_replica"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Respond to a challenge."] + pub struct RespondToChallenge { + pub challenge_id: respond_to_challenge::ChallengeId, + pub response: respond_to_challenge::Response, + } + pub mod respond_to_challenge { + use super::runtime_types; + pub type ChallengeId = + runtime_types::storage_primitives::ChallengeId<::core::primitive::u32>; + pub type Response = + runtime_types::pallet_storage_provider::pallet::ChallengeResponse; + } + impl ::subxt_core::blocks::StaticExtrinsic for RespondToChallenge { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "respond_to_challenge"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Replica confirms sync to MMR roots."] + pub struct ConfirmReplicaSync { + pub bucket_id: confirm_replica_sync::BucketId, + pub roots: confirm_replica_sync::Roots, + pub signature: confirm_replica_sync::Signature, + } + pub mod confirm_replica_sync { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Roots = [::core::option::Option<::subxt_core::utils::H256>; 7usize]; + pub type Signature = runtime_types::sp_runtime::MultiSignature; + } + impl ::subxt_core::blocks::StaticExtrinsic for ConfirmReplicaSync { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "confirm_replica_sync"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Top up a replica's sync balance."] + pub struct TopUpReplicaSyncBalance { + pub bucket_id: top_up_replica_sync_balance::BucketId, + pub provider: top_up_replica_sync_balance::Provider, + pub amount: top_up_replica_sync_balance::Amount, + } + pub mod top_up_replica_sync_balance { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for TopUpReplicaSyncBalance { + const PALLET: &'static str = "StorageProvider"; + const CALL: &'static str = "top_up_replica_sync_balance"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Register as a storage provider."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multiaddr`: Network address for clients to connect"] + #[doc = "- `public_key`: Public key for signature verification (raw bytes, 32-64 bytes)"] + #[doc = "- `stake`: Initial stake to lock"] + pub fn register_provider( + &self, + multiaddr: types::register_provider::Multiaddr, + public_key: types::register_provider::PublicKey, + stake: types::register_provider::Stake, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "register_provider", + types::RegisterProvider { + multiaddr, + public_key, + stake, + }, + [ + 52u8, 23u8, 212u8, 31u8, 133u8, 104u8, 23u8, 13u8, 160u8, 162u8, 80u8, + 160u8, 72u8, 93u8, 169u8, 76u8, 237u8, 192u8, 65u8, 114u8, 144u8, + 158u8, 79u8, 254u8, 168u8, 21u8, 248u8, 50u8, 86u8, 65u8, 74u8, 90u8, + ], + ) + } + #[doc = "Add stake to an existing provider registration."] + pub fn add_stake( + &self, + amount: types::add_stake::Amount, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "add_stake", + types::AddStake { amount }, + [ + 231u8, 126u8, 29u8, 18u8, 219u8, 21u8, 184u8, 16u8, 77u8, 21u8, 140u8, + 211u8, 41u8, 95u8, 167u8, 227u8, 103u8, 149u8, 112u8, 245u8, 132u8, + 124u8, 9u8, 151u8, 208u8, 226u8, 217u8, 195u8, 254u8, 139u8, 47u8, + 194u8, + ], + ) + } + #[doc = "Announce intent to deregister."] + #[doc = ""] + #[doc = "This is the first step of a two-step exit:"] + #[doc = ""] + #[doc = "1. `deregister_provider` (this call) — marks the provider as"] + #[doc = " leaving, freezes them from accepting new agreements or"] + #[doc = " extensions, and stamps `deregister_at = now + DeregisterAnnouncementPeriod`."] + #[doc = " Stake stays reserved; the provider remains on-chain and fully"] + #[doc = " slashable for any pending or freshly-created challenge."] + #[doc = "2. `complete_deregister` — callable once `deregister_at` has"] + #[doc = " elapsed (by which point any challenge created up to the"] + #[doc = " announcement block has already matured, because the period"] + #[doc = " must be `> ChallengeTimeout`)."] + #[doc = ""] + #[doc = "The two-step flow closes the slashing race where a provider"] + #[doc = "could withdraw stake between the end of their last agreement"] + #[doc = "and the deadline of a challenge created against it."] + pub fn deregister_provider( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "deregister_provider", + types::DeregisterProvider {}, + [ + 159u8, 25u8, 41u8, 180u8, 130u8, 156u8, 173u8, 68u8, 170u8, 211u8, + 242u8, 92u8, 207u8, 235u8, 220u8, 2u8, 175u8, 49u8, 66u8, 126u8, 66u8, + 60u8, 27u8, 46u8, 157u8, 115u8, 250u8, 168u8, 148u8, 143u8, 243u8, + 44u8, + ], + ) + } + #[doc = "Finalise a previously-announced deregistration."] + #[doc = ""] + #[doc = "Callable by the provider once `DeregisterAnnouncementPeriod` has"] + #[doc = "elapsed since their `deregister_provider` call. Drains any"] + #[doc = "pending `CheckpointRewards` into the provider's free balance,"] + #[doc = "unreserves the remaining stake, and removes the provider record."] + #[doc = ""] + #[doc = "Still requires `committed_bytes == 0` — if the provider somehow"] + #[doc = "re-acquired commitments mid-window (they cannot today, since"] + #[doc = "announce forces `accepting_primary = false` and"] + #[doc = "`update_provider_settings` is blocked during the window) the"] + #[doc = "caller must wait for those agreements to end first."] + pub fn complete_deregister( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "complete_deregister", + types::CompleteDeregister {}, + [ + 242u8, 70u8, 111u8, 107u8, 124u8, 246u8, 14u8, 212u8, 44u8, 246u8, + 206u8, 143u8, 4u8, 166u8, 157u8, 41u8, 149u8, 14u8, 98u8, 2u8, 21u8, + 57u8, 104u8, 157u8, 181u8, 194u8, 46u8, 209u8, 138u8, 184u8, 248u8, + 131u8, + ], + ) + } + #[doc = "Cancel a previously-announced deregistration."] + #[doc = ""] + #[doc = "Restores `accepting_primary` / `accepting_extensions` to `true`"] + #[doc = "(mirroring what `deregister_provider` forced to `false` on"] + #[doc = "announce) and clears `deregister_at`. If the provider wants"] + #[doc = "different post-cancel settings they can call"] + #[doc = "`update_provider_settings` afterwards."] + pub fn cancel_deregister( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "cancel_deregister", + types::CancelDeregister {}, + [ + 184u8, 7u8, 87u8, 58u8, 253u8, 113u8, 13u8, 89u8, 246u8, 85u8, 88u8, + 189u8, 235u8, 101u8, 116u8, 104u8, 175u8, 83u8, 130u8, 189u8, 187u8, + 40u8, 153u8, 232u8, 241u8, 77u8, 170u8, 192u8, 192u8, 191u8, 156u8, + 119u8, + ], + ) + } + #[doc = "Update provider settings."] + pub fn update_provider_settings( + &self, + settings: types::update_provider_settings::Settings, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "update_provider_settings", + types::UpdateProviderSettings { settings }, + [ + 92u8, 167u8, 191u8, 132u8, 166u8, 214u8, 185u8, 187u8, 154u8, 120u8, + 142u8, 79u8, 96u8, 132u8, 143u8, 86u8, 208u8, 80u8, 17u8, 69u8, 190u8, + 252u8, 145u8, 118u8, 185u8, 99u8, 107u8, 82u8, 51u8, 144u8, 233u8, + 28u8, + ], + ) + } + #[doc = "Update the provider's multiaddr (network endpoint)."] + pub fn update_provider_multiaddr( + &self, + multiaddr: types::update_provider_multiaddr::Multiaddr, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "update_provider_multiaddr", + types::UpdateProviderMultiaddr { multiaddr }, + [ + 224u8, 35u8, 116u8, 147u8, 246u8, 146u8, 184u8, 138u8, 197u8, 207u8, + 29u8, 73u8, 130u8, 124u8, 195u8, 200u8, 46u8, 209u8, 41u8, 101u8, 1u8, + 162u8, 234u8, 79u8, 20u8, 141u8, 167u8, 128u8, 104u8, 149u8, 102u8, + 156u8, + ], + ) + } + #[doc = "Block or unblock extensions for a specific bucket."] + pub fn set_extensions_blocked( + &self, + bucket_id: types::set_extensions_blocked::BucketId, + blocked: types::set_extensions_blocked::Blocked, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "set_extensions_blocked", + types::SetExtensionsBlocked { bucket_id, blocked }, + [ + 131u8, 120u8, 176u8, 151u8, 81u8, 126u8, 16u8, 86u8, 190u8, 120u8, + 87u8, 175u8, 177u8, 3u8, 78u8, 95u8, 176u8, 19u8, 80u8, 231u8, 51u8, + 232u8, 45u8, 22u8, 236u8, 19u8, 86u8, 145u8, 182u8, 64u8, 45u8, 63u8, + ], + ) + } + #[doc = "Redeem provider-signed terms: create a bucket + primary agreement"] + #[doc = "in a single call."] + #[doc = ""] + #[doc = "The provider signs a SCALE-encoded [`AgreementTermsOf`] off-chain;"] + #[doc = "the owner submits it here. The pallet verifies the signature,"] + #[doc = "rejects replays via the provider's sliding nonce window, then runs"] + #[doc = "the standard provider/capacity/stake checks and opens the"] + #[doc = "agreement."] + pub fn establish_storage_agreement( + &self, + provider: types::establish_storage_agreement::Provider, + terms: types::establish_storage_agreement::Terms, + sig: types::establish_storage_agreement::Sig, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "establish_storage_agreement", + types::EstablishStorageAgreement { + provider, + terms, + sig, + }, + [ + 131u8, 51u8, 98u8, 212u8, 112u8, 217u8, 254u8, 11u8, 109u8, 138u8, + 107u8, 216u8, 7u8, 59u8, 225u8, 179u8, 146u8, 123u8, 82u8, 149u8, 71u8, + 74u8, 219u8, 77u8, 211u8, 242u8, 47u8, 81u8, 96u8, 195u8, 191u8, 187u8, + ], + ) + } + #[doc = "Set minimum providers required for checkpoint."] + pub fn set_min_providers( + &self, + bucket_id: types::set_min_providers::BucketId, + min_providers: types::set_min_providers::MinProviders, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "set_min_providers", + types::SetMinProviders { + bucket_id, + min_providers, + }, + [ + 19u8, 93u8, 129u8, 219u8, 178u8, 246u8, 167u8, 223u8, 8u8, 111u8, 80u8, + 157u8, 62u8, 171u8, 84u8, 84u8, 196u8, 98u8, 205u8, 129u8, 47u8, 173u8, + 127u8, 240u8, 157u8, 73u8, 154u8, 84u8, 84u8, 171u8, 63u8, 79u8, + ], + ) + } + #[doc = "Freeze bucket - make append-only (irreversible)."] + pub fn freeze_bucket( + &self, + bucket_id: types::freeze_bucket::BucketId, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "freeze_bucket", + types::FreezeBucket { bucket_id }, + [ + 206u8, 129u8, 171u8, 233u8, 123u8, 10u8, 213u8, 91u8, 245u8, 44u8, + 18u8, 113u8, 229u8, 39u8, 217u8, 237u8, 117u8, 31u8, 54u8, 162u8, + 215u8, 170u8, 86u8, 52u8, 95u8, 123u8, 201u8, 81u8, 166u8, 113u8, 79u8, + 166u8, + ], + ) + } + #[doc = "Add or update a member's role."] + pub fn set_member( + &self, + bucket_id: types::set_member::BucketId, + member: types::set_member::Member, + role: types::set_member::Role, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "set_member", + types::SetMember { + bucket_id, + member, + role, + }, + [ + 243u8, 80u8, 11u8, 175u8, 31u8, 19u8, 121u8, 9u8, 95u8, 152u8, 13u8, + 27u8, 27u8, 90u8, 44u8, 230u8, 178u8, 200u8, 179u8, 156u8, 62u8, 170u8, + 219u8, 133u8, 67u8, 86u8, 67u8, 112u8, 23u8, 98u8, 0u8, 92u8, + ], + ) + } + #[doc = "Remove member from bucket."] + pub fn remove_member( + &self, + bucket_id: types::remove_member::BucketId, + member: types::remove_member::Member, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "remove_member", + types::RemoveMember { bucket_id, member }, + [ + 138u8, 107u8, 214u8, 73u8, 198u8, 40u8, 157u8, 24u8, 254u8, 234u8, + 136u8, 33u8, 84u8, 107u8, 51u8, 123u8, 20u8, 103u8, 160u8, 114u8, + 179u8, 112u8, 219u8, 15u8, 158u8, 207u8, 58u8, 49u8, 178u8, 73u8, + 235u8, 19u8, + ], + ) + } + #[doc = "Remove a slashed provider from a bucket (permissionless)."] + #[doc = ""] + #[doc = "Anyone can call this to clean up slashed providers."] + #[doc = "The provider must have zero stake (indicating they were slashed)."] + #[doc = "Returns payment to agreement owner and removes the provider from the bucket."] + pub fn remove_slashed( + &self, + bucket_id: types::remove_slashed::BucketId, + provider: types::remove_slashed::Provider, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "remove_slashed", + types::RemoveSlashed { + bucket_id, + provider, + }, + [ + 133u8, 58u8, 201u8, 112u8, 86u8, 244u8, 202u8, 218u8, 55u8, 191u8, + 26u8, 109u8, 183u8, 220u8, 100u8, 127u8, 72u8, 174u8, 180u8, 181u8, + 185u8, 131u8, 243u8, 216u8, 57u8, 13u8, 227u8, 37u8, 235u8, 126u8, 9u8, + 231u8, + ], + ) + } + #[doc = "Redeem provider-signed terms for a replica storage agreement."] + #[doc = ""] + #[doc = "The provider signs a SCALE-encoded [`AgreementTermsOf`] with"] + #[doc = "`replica_params: Some(_)` off-chain; the owner submits it here."] + #[doc = "The pallet verifies the signature, rejects replays via the"] + #[doc = "provider's sliding nonce window, then runs the standard"] + #[doc = "provider/capacity/stake checks and opens the replica agreement on"] + #[doc = "an existing bucket."] + pub fn establish_replica_agreement( + &self, + bucket_id: types::establish_replica_agreement::BucketId, + provider: types::establish_replica_agreement::Provider, + terms: types::establish_replica_agreement::Terms, + sig: types::establish_replica_agreement::Sig, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "establish_replica_agreement", + types::EstablishReplicaAgreement { + bucket_id, + provider, + terms, + sig, + }, + [ + 136u8, 47u8, 100u8, 90u8, 194u8, 237u8, 110u8, 161u8, 102u8, 30u8, + 206u8, 218u8, 148u8, 232u8, 191u8, 243u8, 211u8, 154u8, 108u8, 98u8, + 187u8, 136u8, 162u8, 72u8, 21u8, 57u8, 135u8, 221u8, 2u8, 222u8, 100u8, + 227u8, + ], + ) + } + #[doc = "End agreement with pay/burn decision."] + pub fn end_agreement( + &self, + bucket_id: types::end_agreement::BucketId, + provider: types::end_agreement::Provider, + action: types::end_agreement::Action, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "end_agreement", + types::EndAgreement { + bucket_id, + provider, + action, + }, + [ + 24u8, 165u8, 131u8, 155u8, 228u8, 26u8, 59u8, 200u8, 55u8, 205u8, 57u8, + 99u8, 129u8, 5u8, 104u8, 241u8, 62u8, 107u8, 232u8, 181u8, 186u8, + 233u8, 209u8, 3u8, 140u8, 169u8, 252u8, 116u8, 121u8, 29u8, 253u8, + 244u8, + ], + ) + } + #[doc = "Claim payment for expired agreement (provider only)."] + pub fn claim_expired_agreement( + &self, + bucket_id: types::claim_expired_agreement::BucketId, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "claim_expired_agreement", + types::ClaimExpiredAgreement { bucket_id }, + [ + 206u8, 11u8, 134u8, 14u8, 89u8, 178u8, 53u8, 241u8, 183u8, 5u8, 25u8, + 39u8, 141u8, 153u8, 233u8, 21u8, 33u8, 148u8, 135u8, 175u8, 118u8, + 244u8, 8u8, 137u8, 134u8, 45u8, 37u8, 62u8, 70u8, 79u8, 218u8, 49u8, + ], + ) + } + #[doc = "Top up quota for an existing agreement (owner only)."] + #[doc = ""] + #[doc = "Increases max_bytes, does not change duration."] + #[doc = "Actual payment = provider.price_per_byte * additional_bytes * remaining_duration."] + pub fn top_up_agreement( + &self, + bucket_id: types::top_up_agreement::BucketId, + provider: types::top_up_agreement::Provider, + additional_bytes: types::top_up_agreement::AdditionalBytes, + max_payment: types::top_up_agreement::MaxPayment, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "top_up_agreement", + types::TopUpAgreement { + bucket_id, + provider, + additional_bytes, + max_payment, + }, + [ + 114u8, 235u8, 89u8, 146u8, 208u8, 59u8, 211u8, 4u8, 162u8, 79u8, 146u8, + 252u8, 224u8, 38u8, 33u8, 178u8, 225u8, 134u8, 109u8, 244u8, 143u8, + 20u8, 182u8, 86u8, 169u8, 79u8, 41u8, 115u8, 55u8, 113u8, 225u8, 228u8, + ], + ) + } + #[doc = "Extend agreement duration (immediate, no provider approval needed)."] + #[doc = ""] + #[doc = "This:"] + #[doc = "1. Settles current period: releases payment to provider for elapsed time"] + #[doc = "2. Calculates and locks new payment for extension at current provider prices"] + #[doc = "3. Updates end date to now + additional_duration"] + #[doc = "4. Updates agreement.price_per_byte (and sync_price for replicas) to current prices"] + #[doc = ""] + #[doc = "Price change rules:"] + #[doc = "- If provider's current price <= agreement's locked price: anyone can extend"] + #[doc = "- If provider's current price > agreement's locked price: only owner can extend"] + #[doc = ""] + #[doc = "This enables permissionless persistence for frozen buckets while protecting"] + #[doc = "owners from unwanted price increases."] + pub fn extend_agreement( + &self, + bucket_id: types::extend_agreement::BucketId, + provider: types::extend_agreement::Provider, + additional_duration: types::extend_agreement::AdditionalDuration, + max_payment: types::extend_agreement::MaxPayment, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "extend_agreement", + types::ExtendAgreement { + bucket_id, + provider, + additional_duration, + max_payment, + }, + [ + 5u8, 176u8, 133u8, 113u8, 164u8, 85u8, 147u8, 68u8, 84u8, 241u8, 69u8, + 16u8, 72u8, 114u8, 95u8, 72u8, 95u8, 186u8, 21u8, 90u8, 141u8, 128u8, + 16u8, 12u8, 28u8, 3u8, 200u8, 57u8, 247u8, 6u8, 25u8, 229u8, + ], + ) + } + #[doc = "Submit a new checkpoint with provider signatures."] + pub fn checkpoint( + &self, + bucket_id: types::checkpoint::BucketId, + commitment: types::checkpoint::Commitment, + nonce: types::checkpoint::Nonce, + signatures: types::checkpoint::Signatures, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "checkpoint", + types::Checkpoint { + bucket_id, + commitment, + nonce, + signatures, + }, + [ + 135u8, 160u8, 81u8, 16u8, 171u8, 245u8, 13u8, 226u8, 125u8, 87u8, + 144u8, 202u8, 117u8, 175u8, 62u8, 198u8, 178u8, 210u8, 161u8, 129u8, + 36u8, 7u8, 226u8, 28u8, 214u8, 121u8, 158u8, 248u8, 187u8, 188u8, + 136u8, 229u8, + ], + ) + } + #[doc = "Add additional provider signatures to existing checkpoint."] + #[doc = ""] + #[doc = "Allows late-signing providers to add their signatures to the current"] + #[doc = "snapshot. Useful when a provider signs off-chain commitments later."] + pub fn extend_checkpoint( + &self, + bucket_id: types::extend_checkpoint::BucketId, + additional_signatures: types::extend_checkpoint::AdditionalSignatures, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "extend_checkpoint", + types::ExtendCheckpoint { + bucket_id, + additional_signatures, + }, + [ + 141u8, 205u8, 220u8, 70u8, 166u8, 226u8, 88u8, 69u8, 209u8, 204u8, + 77u8, 73u8, 204u8, 239u8, 62u8, 125u8, 114u8, 23u8, 173u8, 121u8, + 134u8, 193u8, 37u8, 208u8, 133u8, 31u8, 88u8, 192u8, 146u8, 84u8, + 199u8, 90u8, + ], + ) + } + #[doc = "Submit a provider-initiated checkpoint."] + #[doc = ""] + #[doc = "Providers autonomously coordinate checkpoints without requiring"] + #[doc = "clients to be online. Uses deterministic leader election with"] + #[doc = "fallback to any primary provider after grace period."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `bucket_id`: The bucket to checkpoint"] + #[doc = "- `mmr_root`: MMR root that providers agreed on"] + #[doc = "- `start_seq`: Starting sequence number"] + #[doc = "- `leaf_count`: Number of leaves in the MMR"] + #[doc = "- `window`: Checkpoint window number (prevents replay)"] + #[doc = "- `signatures`: Provider signatures over the checkpoint proposal"] + pub fn provider_checkpoint( + &self, + bucket_id: types::provider_checkpoint::BucketId, + commitment: types::provider_checkpoint::Commitment, + window: types::provider_checkpoint::Window, + signatures: types::provider_checkpoint::Signatures, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "provider_checkpoint", + types::ProviderCheckpoint { + bucket_id, + commitment, + window, + signatures, + }, + [ + 72u8, 81u8, 224u8, 202u8, 178u8, 15u8, 123u8, 164u8, 78u8, 35u8, 134u8, + 90u8, 164u8, 2u8, 55u8, 31u8, 154u8, 50u8, 44u8, 101u8, 231u8, 65u8, + 63u8, 18u8, 19u8, 50u8, 140u8, 107u8, 6u8, 146u8, 2u8, 231u8, + ], + ) + } + #[doc = "Configure checkpoint window settings for a bucket."] + #[doc = ""] + #[doc = "Only bucket admin can configure. Setting enabled=false disables"] + #[doc = "provider-initiated checkpoints (client-initiated still work)."] + pub fn configure_checkpoint_window( + &self, + bucket_id: types::configure_checkpoint_window::BucketId, + interval: types::configure_checkpoint_window::Interval, + grace_period: types::configure_checkpoint_window::GracePeriod, + enabled: types::configure_checkpoint_window::Enabled, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "configure_checkpoint_window", + types::ConfigureCheckpointWindow { + bucket_id, + interval, + grace_period, + enabled, + }, + [ + 118u8, 183u8, 248u8, 204u8, 218u8, 141u8, 253u8, 227u8, 230u8, 169u8, + 103u8, 160u8, 127u8, 137u8, 178u8, 70u8, 74u8, 230u8, 126u8, 3u8, + 226u8, 13u8, 233u8, 10u8, 155u8, 252u8, 15u8, 163u8, 190u8, 0u8, 108u8, + 140u8, + ], + ) + } + #[doc = "Report a missed checkpoint window and penalize the leader."] + #[doc = ""] + #[doc = "Can only be called after the checkpoint window has fully passed"] + #[doc = "(beyond grace period) and no checkpoint was submitted."] + #[doc = "Reporter receives a portion of the penalty."] + pub fn report_missed_checkpoint( + &self, + bucket_id: types::report_missed_checkpoint::BucketId, + window: types::report_missed_checkpoint::Window, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "report_missed_checkpoint", + types::ReportMissedCheckpoint { bucket_id, window }, + [ + 72u8, 7u8, 7u8, 7u8, 50u8, 237u8, 249u8, 182u8, 16u8, 236u8, 119u8, + 202u8, 182u8, 51u8, 108u8, 143u8, 239u8, 71u8, 169u8, 79u8, 210u8, + 151u8, 144u8, 69u8, 67u8, 132u8, 247u8, 70u8, 241u8, 232u8, 131u8, + 224u8, + ], + ) + } + #[doc = "Claim accumulated checkpoint rewards."] + #[doc = ""] + #[doc = "Providers accumulate rewards for submitting checkpoints."] + #[doc = "This transfers accumulated rewards to the provider."] + pub fn claim_checkpoint_rewards( + &self, + bucket_id: types::claim_checkpoint_rewards::BucketId, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "claim_checkpoint_rewards", + types::ClaimCheckpointRewards { bucket_id }, + [ + 227u8, 105u8, 210u8, 189u8, 63u8, 228u8, 152u8, 192u8, 63u8, 174u8, + 111u8, 190u8, 245u8, 57u8, 209u8, 88u8, 161u8, 48u8, 35u8, 255u8, 80u8, + 5u8, 165u8, 161u8, 238u8, 215u8, 193u8, 96u8, 242u8, 105u8, 82u8, 49u8, + ], + ) + } + #[doc = "Fund the checkpoint reward pool for a bucket."] + #[doc = ""] + #[doc = "Anyone can fund the pool. Funds are used to reward providers"] + #[doc = "for submitting checkpoints."] + pub fn fund_checkpoint_pool( + &self, + bucket_id: types::fund_checkpoint_pool::BucketId, + amount: types::fund_checkpoint_pool::Amount, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "fund_checkpoint_pool", + types::FundCheckpointPool { bucket_id, amount }, + [ + 237u8, 239u8, 44u8, 254u8, 27u8, 202u8, 157u8, 124u8, 120u8, 141u8, + 222u8, 182u8, 44u8, 51u8, 198u8, 17u8, 135u8, 84u8, 122u8, 12u8, 235u8, + 161u8, 157u8, 118u8, 57u8, 119u8, 40u8, 209u8, 7u8, 110u8, 190u8, + 126u8, + ], + ) + } + #[doc = "Challenge on-chain checkpoint (no signatures needed)."] + #[doc = ""] + #[doc = "Provider must be in current snapshot's provider list."] + #[doc = ""] + #[doc = "NOTE: May race with new checkpoints in hot buckets. If the provider is"] + #[doc = "no longer in the snapshot when the transaction executes, this fails."] + #[doc = "For hot buckets, prefer challenge_offchain with the signature you have."] + pub fn challenge_checkpoint( + &self, + bucket_id: types::challenge_checkpoint::BucketId, + provider: types::challenge_checkpoint::Provider, + target: types::challenge_checkpoint::Target, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "challenge_checkpoint", + types::ChallengeCheckpoint { + bucket_id, + provider, + target, + }, + [ + 159u8, 60u8, 255u8, 131u8, 48u8, 206u8, 255u8, 206u8, 152u8, 58u8, + 174u8, 69u8, 122u8, 2u8, 84u8, 74u8, 80u8, 243u8, 103u8, 3u8, 172u8, + 161u8, 121u8, 101u8, 76u8, 21u8, 8u8, 217u8, 56u8, 220u8, 250u8, 110u8, + ], + ) + } + #[doc = "Challenge off-chain commitment (requires provider signature)."] + #[doc = ""] + #[doc = "Works regardless of current snapshot state - the signature proves"] + #[doc = "the provider committed to this data."] + #[doc = ""] + #[doc = "Preferred for hot buckets where snapshots change frequently."] + pub fn challenge_offchain( + &self, + bucket_id: types::challenge_offchain::BucketId, + provider: types::challenge_offchain::Provider, + commitment: types::challenge_offchain::Commitment, + target: types::challenge_offchain::Target, + nonce: types::challenge_offchain::Nonce, + provider_signature: types::challenge_offchain::ProviderSignature, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "challenge_offchain", + types::ChallengeOffchain { + bucket_id, + provider, + commitment, + target, + nonce, + provider_signature, + }, + [ + 183u8, 129u8, 166u8, 48u8, 241u8, 79u8, 112u8, 157u8, 81u8, 184u8, + 176u8, 17u8, 167u8, 102u8, 50u8, 60u8, 75u8, 107u8, 224u8, 118u8, + 192u8, 116u8, 48u8, 231u8, 136u8, 195u8, 76u8, 186u8, 113u8, 44u8, + 255u8, 215u8, + ], + ) + } + #[doc = "Challenge a replica based on their on-chain sync confirmation."] + #[doc = ""] + #[doc = "Uses the replica's last_synced_root stored in their agreement."] + #[doc = "No signature needed - the chain already has their commitment."] + pub fn challenge_replica( + &self, + bucket_id: types::challenge_replica::BucketId, + provider: types::challenge_replica::Provider, + target: types::challenge_replica::Target, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "challenge_replica", + types::ChallengeReplica { + bucket_id, + provider, + target, + }, + [ + 122u8, 208u8, 245u8, 140u8, 32u8, 197u8, 217u8, 185u8, 97u8, 2u8, + 255u8, 134u8, 210u8, 168u8, 112u8, 139u8, 209u8, 169u8, 110u8, 55u8, + 82u8, 123u8, 230u8, 206u8, 71u8, 68u8, 108u8, 192u8, 65u8, 226u8, + 253u8, 145u8, + ], + ) + } + #[doc = "Respond to a challenge."] + pub fn respond_to_challenge( + &self, + challenge_id: types::respond_to_challenge::ChallengeId, + response: types::respond_to_challenge::Response, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "respond_to_challenge", + types::RespondToChallenge { + challenge_id, + response, + }, + [ + 65u8, 86u8, 85u8, 54u8, 124u8, 137u8, 93u8, 88u8, 68u8, 192u8, 200u8, + 121u8, 11u8, 120u8, 74u8, 22u8, 68u8, 169u8, 66u8, 79u8, 131u8, 131u8, + 203u8, 94u8, 124u8, 201u8, 65u8, 133u8, 2u8, 73u8, 124u8, 150u8, + ], + ) + } + #[doc = "Replica confirms sync to MMR roots."] + pub fn confirm_replica_sync( + &self, + bucket_id: types::confirm_replica_sync::BucketId, + roots: types::confirm_replica_sync::Roots, + signature: types::confirm_replica_sync::Signature, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "confirm_replica_sync", + types::ConfirmReplicaSync { + bucket_id, + roots, + signature, + }, + [ + 223u8, 202u8, 91u8, 124u8, 19u8, 116u8, 83u8, 38u8, 15u8, 11u8, 220u8, + 160u8, 80u8, 75u8, 12u8, 31u8, 16u8, 80u8, 206u8, 44u8, 52u8, 2u8, + 62u8, 166u8, 170u8, 141u8, 202u8, 184u8, 91u8, 156u8, 35u8, 168u8, + ], + ) + } + #[doc = "Top up a replica's sync balance."] + pub fn top_up_replica_sync_balance( + &self, + bucket_id: types::top_up_replica_sync_balance::BucketId, + provider: types::top_up_replica_sync_balance::Provider, + amount: types::top_up_replica_sync_balance::Amount, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "StorageProvider", + "top_up_replica_sync_balance", + types::TopUpReplicaSyncBalance { + bucket_id, + provider, + amount, + }, + [ + 103u8, 101u8, 126u8, 203u8, 255u8, 104u8, 243u8, 204u8, 131u8, 86u8, + 211u8, 240u8, 183u8, 57u8, 252u8, 155u8, 207u8, 60u8, 200u8, 46u8, + 242u8, 87u8, 42u8, 149u8, 131u8, 160u8, 109u8, 158u8, 149u8, 76u8, + 217u8, 39u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_storage_provider::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderRegistered { + pub provider: provider_registered::Provider, + pub stake: provider_registered::Stake, + } + pub mod provider_registered { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Stake = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for ProviderRegistered { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ProviderRegistered"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderDeregistered { + pub provider: provider_deregistered::Provider, + pub stake_returned: provider_deregistered::StakeReturned, + } + pub mod provider_deregistered { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type StakeReturned = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for ProviderDeregistered { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ProviderDeregistered"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Provider has announced their intention to deregister. Stake stays"] + #[doc = "reserved and the provider remains on-chain (and slashable) until"] + #[doc = "`complete_after`, at which point they may call `complete_deregister`."] + pub struct DeregisterAnnounced { + pub provider: deregister_announced::Provider, + pub complete_after: deregister_announced::CompleteAfter, + } + pub mod deregister_announced { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type CompleteAfter = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for DeregisterAnnounced { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "DeregisterAnnounced"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Provider cancelled a previously-announced deregistration."] + pub struct DeregisterCancelled { + pub provider: deregister_cancelled::Provider, + } + pub mod deregister_cancelled { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for DeregisterCancelled { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "DeregisterCancelled"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderStakeAdded { + pub provider: provider_stake_added::Provider, + pub amount: provider_stake_added::Amount, + pub total_stake: provider_stake_added::TotalStake, + } + pub mod provider_stake_added { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + pub type TotalStake = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for ProviderStakeAdded { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ProviderStakeAdded"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderSettingsUpdated { + pub provider: provider_settings_updated::Provider, + pub settings: provider_settings_updated::Settings, + } + pub mod provider_settings_updated { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Settings = + runtime_types::pallet_storage_provider::pallet::ProviderSettings; + } + impl ::subxt_core::events::StaticEvent for ProviderSettingsUpdated { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ProviderSettingsUpdated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderMultiaddrUpdated { + pub provider: provider_multiaddr_updated::Provider, + pub multiaddr: provider_multiaddr_updated::Multiaddr, + } + pub mod provider_multiaddr_updated { + use super::runtime_types; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Multiaddr = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + impl ::subxt_core::events::StaticEvent for ProviderMultiaddrUpdated { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ProviderMultiaddrUpdated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ExtensionsBlocked { + pub bucket_id: extensions_blocked::BucketId, + pub provider: extensions_blocked::Provider, + pub blocked: extensions_blocked::Blocked, + } + pub mod extensions_blocked { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Blocked = ::core::primitive::bool; + } + impl ::subxt_core::events::StaticEvent for ExtensionsBlocked { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ExtensionsBlocked"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketCreated { + pub bucket_id: bucket_created::BucketId, + pub admin: bucket_created::Admin, + } + pub mod bucket_created { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Admin = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for BucketCreated { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "BucketCreated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketFrozen { + pub bucket_id: bucket_frozen::BucketId, + pub frozen_start_seq: bucket_frozen::FrozenStartSeq, + } + pub mod bucket_frozen { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type FrozenStartSeq = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for BucketFrozen { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "BucketFrozen"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketDeleted { + pub bucket_id: bucket_deleted::BucketId, + } + pub mod bucket_deleted { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for BucketDeleted { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "BucketDeleted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MemberSet { + pub bucket_id: member_set::BucketId, + pub member: member_set::Member, + pub role: member_set::Role, + } + pub mod member_set { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Member = ::subxt_core::utils::AccountId32; + pub type Role = runtime_types::storage_primitives::Role; + } + impl ::subxt_core::events::StaticEvent for MemberSet { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "MemberSet"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MemberRemoved { + pub bucket_id: member_removed::BucketId, + pub member: member_removed::Member, + } + pub mod member_removed { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Member = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for MemberRemoved { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "MemberRemoved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketCheckpointed { + pub bucket_id: bucket_checkpointed::BucketId, + pub commitment: bucket_checkpointed::Commitment, + pub providers: bucket_checkpointed::Providers, + } + pub mod bucket_checkpointed { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Commitment = runtime_types::storage_primitives::Commitment; + pub type Providers = + ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>; + } + impl ::subxt_core::events::StaticEvent for BucketCheckpointed { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "BucketCheckpointed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderAddedToBucket { + pub bucket_id: provider_added_to_bucket::BucketId, + pub provider: provider_added_to_bucket::Provider, + } + pub mod provider_added_to_bucket { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for ProviderAddedToBucket { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ProviderAddedToBucket"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PrimaryProviderRemoved { + pub bucket_id: primary_provider_removed::BucketId, + pub provider: primary_provider_removed::Provider, + pub reason: primary_provider_removed::Reason, + } + pub mod primary_provider_removed { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Reason = runtime_types::storage_primitives::RemovalReason; + } + impl ::subxt_core::events::StaticEvent for PrimaryProviderRemoved { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "PrimaryProviderRemoved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PrimaryAgreementEndedEarly { + pub bucket_id: primary_agreement_ended_early::BucketId, + pub provider: primary_agreement_ended_early::Provider, + pub payment_to_provider: primary_agreement_ended_early::PaymentToProvider, + pub burned: primary_agreement_ended_early::Burned, + } + pub mod primary_agreement_ended_early { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type PaymentToProvider = ::core::primitive::u128; + pub type Burned = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for PrimaryAgreementEndedEarly { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "PrimaryAgreementEndedEarly"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct SlashedProviderRemoved { + pub bucket_id: slashed_provider_removed::BucketId, + pub provider: slashed_provider_removed::Provider, + pub payment_returned_to_owner: slashed_provider_removed::PaymentReturnedToOwner, + } + pub mod slashed_provider_removed { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type PaymentReturnedToOwner = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for SlashedProviderRemoved { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "SlashedProviderRemoved"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ReplicaSynced { + pub bucket_id: replica_synced::BucketId, + pub provider: replica_synced::Provider, + pub mmr_root: replica_synced::MmrRoot, + pub position_matched: replica_synced::PositionMatched, + pub sync_payment: replica_synced::SyncPayment, + } + pub mod replica_synced { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type MmrRoot = ::subxt_core::utils::H256; + pub type PositionMatched = ::core::primitive::u8; + pub type SyncPayment = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for ReplicaSynced { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ReplicaSynced"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ReplicaSyncBalanceToppedUp { + pub bucket_id: replica_sync_balance_topped_up::BucketId, + pub provider: replica_sync_balance_topped_up::Provider, + pub amount: replica_sync_balance_topped_up::Amount, + pub new_total: replica_sync_balance_topped_up::NewTotal, + } + pub mod replica_sync_balance_topped_up { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + pub type NewTotal = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for ReplicaSyncBalanceToppedUp { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ReplicaSyncBalanceToppedUp"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementAccepted { + pub bucket_id: agreement_accepted::BucketId, + pub provider: agreement_accepted::Provider, + pub expires_at: agreement_accepted::ExpiresAt, + } + pub mod agreement_accepted { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type ExpiresAt = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for AgreementAccepted { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "AgreementAccepted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementToppedUp { + pub bucket_id: agreement_topped_up::BucketId, + pub provider: agreement_topped_up::Provider, + pub amount: agreement_topped_up::Amount, + pub new_max_bytes: agreement_topped_up::NewMaxBytes, + } + pub mod agreement_topped_up { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + pub type NewMaxBytes = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for AgreementToppedUp { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "AgreementToppedUp"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementExtended { + pub bucket_id: agreement_extended::BucketId, + pub provider: agreement_extended::Provider, + pub new_expires_at: agreement_extended::NewExpiresAt, + pub payment: agreement_extended::Payment, + } + pub mod agreement_extended { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type NewExpiresAt = ::core::primitive::u32; + pub type Payment = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for AgreementExtended { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "AgreementExtended"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementOwnershipTransferred { + pub bucket_id: agreement_ownership_transferred::BucketId, + pub provider: agreement_ownership_transferred::Provider, + pub old_owner: agreement_ownership_transferred::OldOwner, + pub new_owner: agreement_ownership_transferred::NewOwner, + } + pub mod agreement_ownership_transferred { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type OldOwner = ::subxt_core::utils::AccountId32; + pub type NewOwner = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for AgreementOwnershipTransferred { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "AgreementOwnershipTransferred"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementEnded { + pub bucket_id: agreement_ended::BucketId, + pub provider: agreement_ended::Provider, + pub payment_to_provider: agreement_ended::PaymentToProvider, + pub burned: agreement_ended::Burned, + } + pub mod agreement_ended { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type PaymentToProvider = ::core::primitive::u128; + pub type Burned = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for AgreementEnded { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "AgreementEnded"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementExpiredClaimed { + pub bucket_id: agreement_expired_claimed::BucketId, + pub provider: agreement_expired_claimed::Provider, + pub payment_to_provider: agreement_expired_claimed::PaymentToProvider, + } + pub mod agreement_expired_claimed { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type PaymentToProvider = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for AgreementExpiredClaimed { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "AgreementExpiredClaimed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Owner redeemed provider-signed terms; bucket created and agreement"] + #[doc = "opened atomically."] + pub struct StorageAgreementEstablished { + pub bucket_id: storage_agreement_established::BucketId, + pub provider: storage_agreement_established::Provider, + pub owner: storage_agreement_established::Owner, + pub terms: storage_agreement_established::Terms, + pub expires_at: storage_agreement_established::ExpiresAt, + } + pub mod storage_agreement_established { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Owner = ::subxt_core::utils::AccountId32; + pub type Terms = runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + pub type ExpiresAt = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for StorageAgreementEstablished { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "StorageAgreementEstablished"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Owner redeemed provider-signed replica terms; replica agreement"] + #[doc = "opened against an existing bucket."] + pub struct ReplicaAgreementEstablished { + pub bucket_id: replica_agreement_established::BucketId, + pub provider: replica_agreement_established::Provider, + pub owner: replica_agreement_established::Owner, + pub terms: replica_agreement_established::Terms, + pub expires_at: replica_agreement_established::ExpiresAt, + } + pub mod replica_agreement_established { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Owner = ::subxt_core::utils::AccountId32; + pub type Terms = runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + pub type ExpiresAt = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for ReplicaAgreementEstablished { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ReplicaAgreementEstablished"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChallengeCreated { + pub challenge_id: challenge_created::ChallengeId, + pub bucket_id: challenge_created::BucketId, + pub provider: challenge_created::Provider, + pub challenger: challenge_created::Challenger, + pub respond_by: challenge_created::RespondBy, + } + pub mod challenge_created { + use super::runtime_types; + pub type ChallengeId = + runtime_types::storage_primitives::ChallengeId<::core::primitive::u32>; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Challenger = ::subxt_core::utils::AccountId32; + pub type RespondBy = ::core::primitive::u32; + } + impl ::subxt_core::events::StaticEvent for ChallengeCreated { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ChallengeCreated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChallengeDefended { + pub challenge_id: challenge_defended::ChallengeId, + pub provider: challenge_defended::Provider, + pub response_time_blocks: challenge_defended::ResponseTimeBlocks, + pub challenger_cost: challenge_defended::ChallengerCost, + pub provider_cost: challenge_defended::ProviderCost, + } + pub mod challenge_defended { + use super::runtime_types; + pub type ChallengeId = + runtime_types::storage_primitives::ChallengeId<::core::primitive::u32>; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type ResponseTimeBlocks = ::core::primitive::u32; + pub type ChallengerCost = ::core::primitive::u128; + pub type ProviderCost = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for ChallengeDefended { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ChallengeDefended"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChallengeSlashed { + pub challenge_id: challenge_slashed::ChallengeId, + pub provider: challenge_slashed::Provider, + pub slashed_amount: challenge_slashed::SlashedAmount, + pub challenger_reward: challenge_slashed::ChallengerReward, + pub reason: challenge_slashed::Reason, + } + pub mod challenge_slashed { + use super::runtime_types; + pub type ChallengeId = + runtime_types::storage_primitives::ChallengeId<::core::primitive::u32>; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type SlashedAmount = ::core::primitive::u128; + pub type ChallengerReward = ::core::primitive::u128; + pub type Reason = runtime_types::storage_primitives::SlashReason; + } + impl ::subxt_core::events::StaticEvent for ChallengeSlashed { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ChallengeSlashed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderCheckpointSubmitted { + pub bucket_id: provider_checkpoint_submitted::BucketId, + pub mmr_root: provider_checkpoint_submitted::MmrRoot, + pub window: provider_checkpoint_submitted::Window, + pub leader: provider_checkpoint_submitted::Leader, + pub signers: provider_checkpoint_submitted::Signers, + pub reward: provider_checkpoint_submitted::Reward, + } + pub mod provider_checkpoint_submitted { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type MmrRoot = ::subxt_core::utils::H256; + pub type Window = ::core::primitive::u64; + pub type Leader = ::subxt_core::utils::AccountId32; + pub type Signers = ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>; + pub type Reward = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for ProviderCheckpointSubmitted { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "ProviderCheckpointSubmitted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckpointConfigUpdated { + pub bucket_id: checkpoint_config_updated::BucketId, + pub interval: checkpoint_config_updated::Interval, + pub grace_period: checkpoint_config_updated::GracePeriod, + pub enabled: checkpoint_config_updated::Enabled, + } + pub mod checkpoint_config_updated { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Interval = ::core::primitive::u32; + pub type GracePeriod = ::core::primitive::u32; + pub type Enabled = ::core::primitive::bool; + } + impl ::subxt_core::events::StaticEvent for CheckpointConfigUpdated { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "CheckpointConfigUpdated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckpointMissPenalized { + pub bucket_id: checkpoint_miss_penalized::BucketId, + pub provider: checkpoint_miss_penalized::Provider, + pub window: checkpoint_miss_penalized::Window, + pub penalty: checkpoint_miss_penalized::Penalty, + } + pub mod checkpoint_miss_penalized { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Window = ::core::primitive::u64; + pub type Penalty = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for CheckpointMissPenalized { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "CheckpointMissPenalized"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckpointRewardClaimed { + pub bucket_id: checkpoint_reward_claimed::BucketId, + pub provider: checkpoint_reward_claimed::Provider, + pub amount: checkpoint_reward_claimed::Amount, + } + pub mod checkpoint_reward_claimed { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for CheckpointRewardClaimed { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "CheckpointRewardClaimed"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckpointPoolFunded { + pub bucket_id: checkpoint_pool_funded::BucketId, + pub funder: checkpoint_pool_funded::Funder, + pub amount: checkpoint_pool_funded::Amount, + } + pub mod checkpoint_pool_funded { + use super::runtime_types; + pub type BucketId = ::core::primitive::u64; + pub type Funder = ::subxt_core::utils::AccountId32; + pub type Amount = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for CheckpointPoolFunded { + const PALLET: &'static str = "StorageProvider"; + const EVENT: &'static str = "CheckpointPoolFunded"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod providers { + use super::runtime_types; + pub type Providers = + runtime_types::pallet_storage_provider::pallet::ProviderInfo; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod provider_replay_states { + use super::runtime_types; + pub type ProviderReplayStates = + runtime_types::storage_primitives::provider_replay_state::ReplayWindow; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod next_bucket_id { + use super::runtime_types; + pub type NextBucketId = ::core::primitive::u64; + } + pub mod buckets { + use super::runtime_types; + pub type Buckets = runtime_types::pallet_storage_provider::pallet::Bucket; + pub type Param0 = ::core::primitive::u64; + } + pub mod storage_agreements { + use super::runtime_types; + pub type StorageAgreements = + runtime_types::pallet_storage_provider::pallet::StorageAgreement; + pub type Param0 = ::core::primitive::u64; + pub type Param1 = ::subxt_core::utils::AccountId32; + } + pub mod challenges { + use super::runtime_types; + pub type Challenges = runtime_types::pallet_storage_provider::pallet::Challenge; + pub type Param0 = ::core::primitive::u32; + pub type Param1 = ::core::primitive::u16; + } + pub mod next_challenge_index { + use super::runtime_types; + pub type NextChallengeIndex = ::core::primitive::u16; + pub type Param0 = ::core::primitive::u32; + } + pub mod pending_challenges { + use super::runtime_types; + pub type PendingChallenges = ::core::primitive::u32; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod pending_challenges_by_bucket { + use super::runtime_types; + pub type PendingChallengesByBucket = ::core::primitive::u32; + pub type Param0 = ::core::primitive::u64; + pub type Param1 = ::subxt_core::utils::AccountId32; + } + pub mod challenger_stats { + use super::runtime_types; + pub type ChallengerStats = + runtime_types::storage_primitives::ChallengerStatRecord; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod checkpoint_configs { + use super::runtime_types; + pub type CheckpointConfigs = + runtime_types::storage_primitives::CheckpointWindowConfig< + ::core::primitive::u32, + >; + pub type Param0 = ::core::primitive::u64; + } + pub mod last_checkpoint_window { + use super::runtime_types; + pub type LastCheckpointWindow = ::core::primitive::u64; + pub type Param0 = ::core::primitive::u64; + } + pub mod checkpoint_rewards { + use super::runtime_types; + pub type CheckpointRewards = ::core::primitive::u128; + pub type Param0 = ::subxt_core::utils::AccountId32; + pub type Param1 = ::core::primitive::u64; + } + pub mod checkpoint_pool { + use super::runtime_types; + pub type CheckpointPool = ::core::primitive::u128; + pub type Param0 = ::core::primitive::u64; + } + pub mod member_buckets { + use super::runtime_types; + pub type MemberBuckets = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u64, + >; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Provider registry."] + pub fn providers_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::providers::Providers, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "Providers", + (), + [ + 81u8, 12u8, 169u8, 85u8, 179u8, 143u8, 57u8, 159u8, 127u8, 77u8, 88u8, + 244u8, 7u8, 40u8, 207u8, 18u8, 142u8, 170u8, 103u8, 211u8, 126u8, + 164u8, 11u8, 111u8, 171u8, 10u8, 206u8, 20u8, 188u8, 110u8, 12u8, 47u8, + ], + ) + } + #[doc = " Provider registry."] + pub fn providers( + &self, + _0: types::providers::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::providers::Providers, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "Providers", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 81u8, 12u8, 169u8, 85u8, 179u8, 143u8, 57u8, 159u8, 127u8, 77u8, 88u8, + 244u8, 7u8, 40u8, 207u8, 18u8, 142u8, 170u8, 103u8, 211u8, 126u8, + 164u8, 11u8, 111u8, 171u8, 10u8, 206u8, 20u8, 188u8, 110u8, 12u8, 47u8, + ], + ) + } + #[doc = " Per-provider sliding replay window over signed agreement-term nonces."] + #[doc = " See [`storage_primitives::ReplayWindow`] for the bit layout"] + pub fn provider_replay_states_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::provider_replay_states::ProviderReplayStates, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "ProviderReplayStates", + (), + [ + 71u8, 39u8, 184u8, 108u8, 232u8, 168u8, 43u8, 138u8, 21u8, 221u8, + 104u8, 132u8, 124u8, 128u8, 3u8, 224u8, 104u8, 222u8, 84u8, 201u8, + 240u8, 126u8, 255u8, 61u8, 227u8, 172u8, 179u8, 92u8, 136u8, 113u8, + 234u8, 120u8, + ], + ) + } + #[doc = " Per-provider sliding replay window over signed agreement-term nonces."] + #[doc = " See [`storage_primitives::ReplayWindow`] for the bit layout"] + pub fn provider_replay_states( + &self, + _0: types::provider_replay_states::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::provider_replay_states::Param0, + >, + types::provider_replay_states::ProviderReplayStates, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "ProviderReplayStates", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 71u8, 39u8, 184u8, 108u8, 232u8, 168u8, 43u8, 138u8, 21u8, 221u8, + 104u8, 132u8, 124u8, 128u8, 3u8, 224u8, 104u8, 222u8, 84u8, 201u8, + 240u8, 126u8, 255u8, 61u8, 227u8, 172u8, 179u8, 92u8, 136u8, 113u8, + 234u8, 120u8, + ], + ) + } + #[doc = " Monotonically increasing bucket ID counter."] + pub fn next_bucket_id( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::next_bucket_id::NextBucketId, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "NextBucketId", + (), + [ + 134u8, 174u8, 106u8, 86u8, 235u8, 5u8, 20u8, 36u8, 118u8, 129u8, 147u8, + 43u8, 5u8, 53u8, 75u8, 206u8, 127u8, 29u8, 194u8, 231u8, 26u8, 218u8, + 18u8, 4u8, 164u8, 63u8, 97u8, 51u8, 167u8, 29u8, 68u8, 247u8, + ], + ) + } + #[doc = " Buckets: containers for data with membership and storage agreements."] + pub fn buckets_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::buckets::Buckets, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "Buckets", + (), + [ + 141u8, 66u8, 126u8, 76u8, 114u8, 190u8, 139u8, 13u8, 151u8, 248u8, + 255u8, 164u8, 54u8, 223u8, 60u8, 166u8, 100u8, 9u8, 38u8, 70u8, 30u8, + 230u8, 221u8, 14u8, 74u8, 168u8, 96u8, 9u8, 179u8, 177u8, 224u8, 24u8, + ], + ) + } + #[doc = " Buckets: containers for data with membership and storage agreements."] + pub fn buckets( + &self, + _0: types::buckets::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::buckets::Buckets, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "Buckets", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 141u8, 66u8, 126u8, 76u8, 114u8, 190u8, 139u8, 13u8, 151u8, 248u8, + 255u8, 164u8, 54u8, 223u8, 60u8, 166u8, 100u8, 9u8, 38u8, 70u8, 30u8, + 230u8, 221u8, 14u8, 74u8, 168u8, 96u8, 9u8, 179u8, 177u8, 224u8, 24u8, + ], + ) + } + #[doc = " Storage agreements: per-provider contracts for a bucket."] + pub fn storage_agreements_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::storage_agreements::StorageAgreements, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "StorageAgreements", + (), + [ + 91u8, 109u8, 228u8, 172u8, 227u8, 76u8, 50u8, 8u8, 111u8, 236u8, 198u8, + 26u8, 62u8, 89u8, 61u8, 201u8, 245u8, 17u8, 24u8, 144u8, 50u8, 245u8, + 67u8, 145u8, 72u8, 79u8, 1u8, 176u8, 106u8, 12u8, 142u8, 136u8, + ], + ) + } + #[doc = " Storage agreements: per-provider contracts for a bucket."] + pub fn storage_agreements_iter1( + &self, + _0: types::storage_agreements::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::storage_agreements::Param0, + >, + types::storage_agreements::StorageAgreements, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "StorageAgreements", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 91u8, 109u8, 228u8, 172u8, 227u8, 76u8, 50u8, 8u8, 111u8, 236u8, 198u8, + 26u8, 62u8, 89u8, 61u8, 201u8, 245u8, 17u8, 24u8, 144u8, 50u8, 245u8, + 67u8, 145u8, 72u8, 79u8, 1u8, 176u8, 106u8, 12u8, 142u8, 136u8, + ], + ) + } + #[doc = " Storage agreements: per-provider contracts for a bucket."] + pub fn storage_agreements( + &self, + _0: types::storage_agreements::Param0, + _1: types::storage_agreements::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::storage_agreements::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::storage_agreements::Param1, + >, + ), + types::storage_agreements::StorageAgreements, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "StorageAgreements", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 91u8, 109u8, 228u8, 172u8, 227u8, 76u8, 50u8, 8u8, 111u8, 236u8, 198u8, + 26u8, 62u8, 89u8, 61u8, 201u8, 245u8, 17u8, 24u8, 144u8, 50u8, 245u8, + 67u8, 145u8, 72u8, 79u8, 1u8, 176u8, 106u8, 12u8, 142u8, 136u8, + ], + ) + } + #[doc = " Pending challenges indexed by `(deadline block, stable per-deadline"] + #[doc = " index)`. The index is allocated by [`NextChallengeIndex`] and never"] + #[doc = " reused for a given deadline, so a `ChallengeId { deadline, index }`"] + #[doc = " stays valid even when sibling challenges sharing the same deadline are"] + #[doc = " resolved (the old `Vec`-backed layout shifted indices on removal,"] + #[doc = " making siblings unaddressable)."] + pub fn challenges_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::challenges::Challenges, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "Challenges", + (), + [ + 195u8, 168u8, 198u8, 200u8, 61u8, 124u8, 8u8, 12u8, 161u8, 226u8, 34u8, + 18u8, 158u8, 204u8, 141u8, 0u8, 37u8, 130u8, 5u8, 141u8, 244u8, 190u8, + 253u8, 23u8, 228u8, 63u8, 222u8, 144u8, 26u8, 124u8, 50u8, 244u8, + ], + ) + } + #[doc = " Pending challenges indexed by `(deadline block, stable per-deadline"] + #[doc = " index)`. The index is allocated by [`NextChallengeIndex`] and never"] + #[doc = " reused for a given deadline, so a `ChallengeId { deadline, index }`"] + #[doc = " stays valid even when sibling challenges sharing the same deadline are"] + #[doc = " resolved (the old `Vec`-backed layout shifted indices on removal,"] + #[doc = " making siblings unaddressable)."] + pub fn challenges_iter1( + &self, + _0: types::challenges::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::challenges::Challenges, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "Challenges", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 195u8, 168u8, 198u8, 200u8, 61u8, 124u8, 8u8, 12u8, 161u8, 226u8, 34u8, + 18u8, 158u8, 204u8, 141u8, 0u8, 37u8, 130u8, 5u8, 141u8, 244u8, 190u8, + 253u8, 23u8, 228u8, 63u8, 222u8, 144u8, 26u8, 124u8, 50u8, 244u8, + ], + ) + } + #[doc = " Pending challenges indexed by `(deadline block, stable per-deadline"] + #[doc = " index)`. The index is allocated by [`NextChallengeIndex`] and never"] + #[doc = " reused for a given deadline, so a `ChallengeId { deadline, index }`"] + #[doc = " stays valid even when sibling challenges sharing the same deadline are"] + #[doc = " resolved (the old `Vec`-backed layout shifted indices on removal,"] + #[doc = " making siblings unaddressable)."] + pub fn challenges( + &self, + _0: types::challenges::Param0, + _1: types::challenges::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey, + ::subxt_core::storage::address::StaticStorageKey, + ), + types::challenges::Challenges, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "Challenges", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 195u8, 168u8, 198u8, 200u8, 61u8, 124u8, 8u8, 12u8, 161u8, 226u8, 34u8, + 18u8, 158u8, 204u8, 141u8, 0u8, 37u8, 130u8, 5u8, 141u8, 244u8, 190u8, + 253u8, 23u8, 228u8, 63u8, 222u8, 144u8, 26u8, 124u8, 50u8, 244u8, + ], + ) + } + #[doc = " Next stable challenge index to allocate for a given deadline block."] + #[doc = " Monotonically increasing per deadline; never decremented when a"] + #[doc = " challenge is resolved, guaranteeing index stability for siblings."] + pub fn next_challenge_index_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::next_challenge_index::NextChallengeIndex, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "NextChallengeIndex", + (), + [ + 79u8, 126u8, 119u8, 118u8, 101u8, 135u8, 107u8, 252u8, 250u8, 199u8, + 244u8, 49u8, 13u8, 255u8, 199u8, 215u8, 37u8, 217u8, 240u8, 190u8, + 17u8, 78u8, 170u8, 64u8, 195u8, 113u8, 190u8, 242u8, 29u8, 163u8, 10u8, + 214u8, + ], + ) + } + #[doc = " Next stable challenge index to allocate for a given deadline block."] + #[doc = " Monotonically increasing per deadline; never decremented when a"] + #[doc = " challenge is resolved, guaranteeing index stability for siblings."] + pub fn next_challenge_index( + &self, + _0: types::next_challenge_index::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::next_challenge_index::Param0, + >, + types::next_challenge_index::NextChallengeIndex, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "NextChallengeIndex", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 79u8, 126u8, 119u8, 118u8, 101u8, 135u8, 107u8, 252u8, 250u8, 199u8, + 244u8, 49u8, 13u8, 255u8, 199u8, 215u8, 37u8, 217u8, 240u8, 190u8, + 17u8, 78u8, 170u8, 64u8, 195u8, 113u8, 190u8, 242u8, 29u8, 163u8, 10u8, + 214u8, + ], + ) + } + #[doc = " Number of unresolved challenges currently outstanding against a"] + #[doc = " provider, summed across every bucket. Incremented in `create_challenge`"] + #[doc = " and decremented exactly once per resolution (defended/invalid-response"] + #[doc = " in `respond_to_challenge`, or timeout in `on_finalize`). Gates"] + #[doc = " `complete_deregister`: a provider cannot exit while still slashable for"] + #[doc = " a pending challenge."] + pub fn pending_challenges_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::pending_challenges::PendingChallenges, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "PendingChallenges", + (), + [ + 94u8, 204u8, 239u8, 211u8, 129u8, 5u8, 129u8, 82u8, 173u8, 5u8, 38u8, + 97u8, 113u8, 176u8, 214u8, 221u8, 234u8, 22u8, 205u8, 70u8, 38u8, 79u8, + 135u8, 1u8, 75u8, 128u8, 79u8, 166u8, 185u8, 150u8, 39u8, 12u8, + ], + ) + } + #[doc = " Number of unresolved challenges currently outstanding against a"] + #[doc = " provider, summed across every bucket. Incremented in `create_challenge`"] + #[doc = " and decremented exactly once per resolution (defended/invalid-response"] + #[doc = " in `respond_to_challenge`, or timeout in `on_finalize`). Gates"] + #[doc = " `complete_deregister`: a provider cannot exit while still slashable for"] + #[doc = " a pending challenge."] + pub fn pending_challenges( + &self, + _0: types::pending_challenges::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::pending_challenges::Param0, + >, + types::pending_challenges::PendingChallenges, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "PendingChallenges", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 94u8, 204u8, 239u8, 211u8, 129u8, 5u8, 129u8, 82u8, 173u8, 5u8, 38u8, + 97u8, 113u8, 176u8, 214u8, 221u8, 234u8, 22u8, 205u8, 70u8, 38u8, 79u8, + 135u8, 1u8, 75u8, 128u8, 79u8, 166u8, 185u8, 150u8, 39u8, 12u8, + ], + ) + } + #[doc = " Number of unresolved challenges outstanding against a specific"] + #[doc = " `(bucket, provider)` pair. Maintained in lockstep with"] + #[doc = " [`PendingChallenges`] and gates that bucket's agreement teardown"] + #[doc = " (`end_agreement`, `claim_expired_agreement`, `cleanup_bucket_internal`)."] + pub fn pending_challenges_by_bucket_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::pending_challenges_by_bucket::PendingChallengesByBucket, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "PendingChallengesByBucket", + (), + [ + 34u8, 165u8, 211u8, 10u8, 211u8, 135u8, 214u8, 31u8, 54u8, 76u8, 170u8, + 79u8, 153u8, 35u8, 237u8, 216u8, 241u8, 44u8, 201u8, 232u8, 94u8, 65u8, + 194u8, 233u8, 84u8, 32u8, 167u8, 102u8, 233u8, 242u8, 156u8, 250u8, + ], + ) + } + #[doc = " Number of unresolved challenges outstanding against a specific"] + #[doc = " `(bucket, provider)` pair. Maintained in lockstep with"] + #[doc = " [`PendingChallenges`] and gates that bucket's agreement teardown"] + #[doc = " (`end_agreement`, `claim_expired_agreement`, `cleanup_bucket_internal`)."] + pub fn pending_challenges_by_bucket_iter1( + &self, + _0: types::pending_challenges_by_bucket::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::pending_challenges_by_bucket::Param0, + >, + types::pending_challenges_by_bucket::PendingChallengesByBucket, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "PendingChallengesByBucket", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 34u8, 165u8, 211u8, 10u8, 211u8, 135u8, 214u8, 31u8, 54u8, 76u8, 170u8, + 79u8, 153u8, 35u8, 237u8, 216u8, 241u8, 44u8, 201u8, 232u8, 94u8, 65u8, + 194u8, 233u8, 84u8, 32u8, 167u8, 102u8, 233u8, 242u8, 156u8, 250u8, + ], + ) + } + #[doc = " Number of unresolved challenges outstanding against a specific"] + #[doc = " `(bucket, provider)` pair. Maintained in lockstep with"] + #[doc = " [`PendingChallenges`] and gates that bucket's agreement teardown"] + #[doc = " (`end_agreement`, `claim_expired_agreement`, `cleanup_bucket_internal`)."] + pub fn pending_challenges_by_bucket( + &self, + _0: types::pending_challenges_by_bucket::Param0, + _1: types::pending_challenges_by_bucket::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::pending_challenges_by_bucket::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::pending_challenges_by_bucket::Param1, + >, + ), + types::pending_challenges_by_bucket::PendingChallengesByBucket, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "PendingChallengesByBucket", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 34u8, 165u8, 211u8, 10u8, 211u8, 135u8, 214u8, 31u8, 54u8, 76u8, 170u8, + 79u8, 153u8, 35u8, 237u8, 216u8, 241u8, 44u8, 201u8, 232u8, 94u8, 65u8, + 194u8, 233u8, 84u8, 32u8, 167u8, 102u8, 233u8, 242u8, 156u8, 250u8, + ], + ) + } + #[doc = " Per-challenger aggregates so the SDK doesn't have to scan historical"] + #[doc = " events to answer `get_challenge_stats`. Updated by `create_challenge`,"] + #[doc = " the defended path of `respond_to_challenge`, and"] + #[doc = " `slash_provider_for_failed_challenge`."] + pub fn challenger_stats_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::challenger_stats::ChallengerStats, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "ChallengerStats", + (), + [ + 215u8, 246u8, 46u8, 216u8, 16u8, 15u8, 54u8, 70u8, 246u8, 142u8, 163u8, + 161u8, 121u8, 145u8, 116u8, 69u8, 61u8, 247u8, 132u8, 29u8, 34u8, + 120u8, 50u8, 179u8, 188u8, 88u8, 237u8, 127u8, 133u8, 47u8, 49u8, 34u8, + ], + ) + } + #[doc = " Per-challenger aggregates so the SDK doesn't have to scan historical"] + #[doc = " events to answer `get_challenge_stats`. Updated by `create_challenge`,"] + #[doc = " the defended path of `respond_to_challenge`, and"] + #[doc = " `slash_provider_for_failed_challenge`."] + pub fn challenger_stats( + &self, + _0: types::challenger_stats::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::challenger_stats::Param0, + >, + types::challenger_stats::ChallengerStats, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "ChallengerStats", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 215u8, 246u8, 46u8, 216u8, 16u8, 15u8, 54u8, 70u8, 246u8, 142u8, 163u8, + 161u8, 121u8, 145u8, 116u8, 69u8, 61u8, 247u8, 132u8, 29u8, 34u8, + 120u8, 50u8, 179u8, 188u8, 88u8, 237u8, 127u8, 133u8, 47u8, 49u8, 34u8, + ], + ) + } + #[doc = " Checkpoint window configuration per bucket."] + #[doc = " When None, bucket uses runtime defaults."] + pub fn checkpoint_configs_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::checkpoint_configs::CheckpointConfigs, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointConfigs", + (), + [ + 36u8, 165u8, 92u8, 226u8, 233u8, 56u8, 91u8, 19u8, 9u8, 102u8, 86u8, + 99u8, 60u8, 97u8, 115u8, 134u8, 109u8, 143u8, 77u8, 150u8, 201u8, + 128u8, 220u8, 33u8, 112u8, 214u8, 236u8, 172u8, 94u8, 226u8, 162u8, + 126u8, + ], + ) + } + #[doc = " Checkpoint window configuration per bucket."] + #[doc = " When None, bucket uses runtime defaults."] + pub fn checkpoint_configs( + &self, + _0: types::checkpoint_configs::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::checkpoint_configs::Param0, + >, + types::checkpoint_configs::CheckpointConfigs, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointConfigs", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 36u8, 165u8, 92u8, 226u8, 233u8, 56u8, 91u8, 19u8, 9u8, 102u8, 86u8, + 99u8, 60u8, 97u8, 115u8, 134u8, 109u8, 143u8, 77u8, 150u8, 201u8, + 128u8, 220u8, 33u8, 112u8, 214u8, 236u8, 172u8, 94u8, 226u8, 162u8, + 126u8, + ], + ) + } + #[doc = " Last successful checkpoint window per bucket."] + #[doc = " `None` means no checkpoint has been submitted yet."] + pub fn last_checkpoint_window_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::last_checkpoint_window::LastCheckpointWindow, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "LastCheckpointWindow", + (), + [ + 227u8, 180u8, 103u8, 149u8, 41u8, 58u8, 60u8, 163u8, 208u8, 41u8, + 146u8, 36u8, 52u8, 45u8, 190u8, 100u8, 99u8, 183u8, 194u8, 79u8, 183u8, + 200u8, 33u8, 222u8, 186u8, 251u8, 29u8, 107u8, 77u8, 110u8, 254u8, + 203u8, + ], + ) + } + #[doc = " Last successful checkpoint window per bucket."] + #[doc = " `None` means no checkpoint has been submitted yet."] + pub fn last_checkpoint_window( + &self, + _0: types::last_checkpoint_window::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::last_checkpoint_window::Param0, + >, + types::last_checkpoint_window::LastCheckpointWindow, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "LastCheckpointWindow", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 227u8, 180u8, 103u8, 149u8, 41u8, 58u8, 60u8, 163u8, 208u8, 41u8, + 146u8, 36u8, 52u8, 45u8, 190u8, 100u8, 99u8, 183u8, 194u8, 79u8, 183u8, + 200u8, 33u8, 222u8, 186u8, 251u8, 29u8, 107u8, 77u8, 110u8, 254u8, + 203u8, + ], + ) + } + #[doc = " Pending checkpoint rewards per (provider, bucket)."] + #[doc = " Accumulates rewards for providers who submit or sign checkpoints."] + #[doc = " Provider-first key order enables `iter_prefix(&provider)` so a"] + #[doc = " provider's pending rewards can be drained on deregistration without"] + #[doc = " scanning every bucket."] + pub fn checkpoint_rewards_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::checkpoint_rewards::CheckpointRewards, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointRewards", + (), + [ + 90u8, 40u8, 5u8, 185u8, 46u8, 154u8, 19u8, 211u8, 141u8, 3u8, 223u8, + 203u8, 241u8, 180u8, 182u8, 7u8, 232u8, 181u8, 169u8, 224u8, 101u8, + 175u8, 117u8, 176u8, 71u8, 17u8, 116u8, 25u8, 193u8, 34u8, 194u8, + 100u8, + ], + ) + } + #[doc = " Pending checkpoint rewards per (provider, bucket)."] + #[doc = " Accumulates rewards for providers who submit or sign checkpoints."] + #[doc = " Provider-first key order enables `iter_prefix(&provider)` so a"] + #[doc = " provider's pending rewards can be drained on deregistration without"] + #[doc = " scanning every bucket."] + pub fn checkpoint_rewards_iter1( + &self, + _0: types::checkpoint_rewards::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::checkpoint_rewards::Param0, + >, + types::checkpoint_rewards::CheckpointRewards, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointRewards", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 90u8, 40u8, 5u8, 185u8, 46u8, 154u8, 19u8, 211u8, 141u8, 3u8, 223u8, + 203u8, 241u8, 180u8, 182u8, 7u8, 232u8, 181u8, 169u8, 224u8, 101u8, + 175u8, 117u8, 176u8, 71u8, 17u8, 116u8, 25u8, 193u8, 34u8, 194u8, + 100u8, + ], + ) + } + #[doc = " Pending checkpoint rewards per (provider, bucket)."] + #[doc = " Accumulates rewards for providers who submit or sign checkpoints."] + #[doc = " Provider-first key order enables `iter_prefix(&provider)` so a"] + #[doc = " provider's pending rewards can be drained on deregistration without"] + #[doc = " scanning every bucket."] + pub fn checkpoint_rewards( + &self, + _0: types::checkpoint_rewards::Param0, + _1: types::checkpoint_rewards::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey< + types::checkpoint_rewards::Param0, + >, + ::subxt_core::storage::address::StaticStorageKey< + types::checkpoint_rewards::Param1, + >, + ), + types::checkpoint_rewards::CheckpointRewards, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointRewards", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 90u8, 40u8, 5u8, 185u8, 46u8, 154u8, 19u8, 211u8, 141u8, 3u8, 223u8, + 203u8, 241u8, 180u8, 182u8, 7u8, 232u8, 181u8, 169u8, 224u8, 101u8, + 175u8, 117u8, 176u8, 71u8, 17u8, 116u8, 25u8, 193u8, 34u8, 194u8, + 100u8, + ], + ) + } + #[doc = " Checkpoint pool balance per bucket."] + #[doc = " Funded by clients to pay for provider-initiated checkpoints."] + pub fn checkpoint_pool_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::checkpoint_pool::CheckpointPool, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointPool", + (), + [ + 242u8, 196u8, 199u8, 122u8, 72u8, 20u8, 161u8, 189u8, 181u8, 149u8, + 218u8, 61u8, 234u8, 232u8, 53u8, 248u8, 190u8, 191u8, 132u8, 154u8, + 245u8, 230u8, 213u8, 236u8, 19u8, 119u8, 131u8, 218u8, 100u8, 212u8, + 216u8, 247u8, + ], + ) + } + #[doc = " Checkpoint pool balance per bucket."] + #[doc = " Funded by clients to pay for provider-initiated checkpoints."] + pub fn checkpoint_pool( + &self, + _0: types::checkpoint_pool::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::checkpoint_pool::Param0, + >, + types::checkpoint_pool::CheckpointPool, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointPool", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 242u8, 196u8, 199u8, 122u8, 72u8, 20u8, 161u8, 189u8, 181u8, 149u8, + 218u8, 61u8, 234u8, 232u8, 53u8, 248u8, 190u8, 191u8, 132u8, 154u8, + 245u8, 230u8, 213u8, 236u8, 19u8, 119u8, 131u8, 218u8, 100u8, 212u8, + 216u8, 247u8, + ], + ) + } + #[doc = " Reverse index: account → bucket IDs they are a member of."] + pub fn member_buckets_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::member_buckets::MemberBuckets, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "MemberBuckets", + (), + [ + 23u8, 123u8, 80u8, 148u8, 148u8, 85u8, 50u8, 32u8, 54u8, 115u8, 41u8, + 46u8, 53u8, 143u8, 112u8, 49u8, 132u8, 75u8, 46u8, 90u8, 181u8, 196u8, + 245u8, 82u8, 135u8, 151u8, 212u8, 18u8, 216u8, 28u8, 203u8, 14u8, + ], + ) + } + #[doc = " Reverse index: account → bucket IDs they are a member of."] + pub fn member_buckets( + &self, + _0: types::member_buckets::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::member_buckets::MemberBuckets, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "StorageProvider", + "MemberBuckets", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 23u8, 123u8, 80u8, 148u8, 148u8, 85u8, 50u8, 32u8, 54u8, 115u8, 41u8, + 46u8, 53u8, 143u8, 112u8, 49u8, 132u8, 75u8, 46u8, 90u8, 181u8, 196u8, + 245u8, 82u8, 135u8, 151u8, 212u8, 18u8, 216u8, 28u8, 203u8, 14u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Minimum stake per byte committed (e.g., 1 token per GB = 1e12 per 1e9 bytes)."] + #[doc = " Prevents providers from over-committing relative to their collateral."] + pub fn min_stake_per_byte( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MinStakePerByte", + [ + 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 length of provider multiaddr."] + pub fn max_multiaddr_length( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MaxMultiaddrLength", + [ + 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 members per bucket."] + pub fn max_members( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MaxMembers", + [ + 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 primary providers per bucket (e.g., 5)."] + pub fn max_primary_providers( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MaxPrimaryProviders", + [ + 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 = " Minimum stake required to register as a provider."] + pub fn min_provider_stake( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MinProviderStake", + [ + 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 chunk size for challenge responses (e.g., 256 KiB)."] + pub fn max_chunk_size( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MaxChunkSize", + [ + 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 = " Timeout for challenge response (e.g., ~48 hours in blocks)."] + pub fn challenge_timeout( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "ChallengeTimeout", + [ + 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 = " Deposit required to open a challenge. Reserved from the challenger"] + #[doc = " on `challenge_*` and refunded (minus a response-time-proportional"] + #[doc = " cost share) when the provider successfully defends, or returned"] + #[doc = " in full alongside a 10% slash reward when the provider is"] + #[doc = " slashed. Sets the floor on challenge spam economics — too low"] + #[doc = " and griefing is free; too high and legitimate challenges become"] + #[doc = " unaffordable."] + pub fn challenge_deposit( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "ChallengeDeposit", + [ + 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 age of a `CommitmentPayload::nonce` (in blocks) the pallet"] + #[doc = " will accept on inbound signatures. The nonce is the block number"] + #[doc = " at which the signer signed; values older than this are rejected"] + #[doc = " to prevent indefinite signature replay."] + pub fn max_nonce_age( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MaxNonceAge", + [ + 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 = " Settlement window after agreement expiry for owner to call end_agreement."] + pub fn settlement_timeout( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "SettlementTimeout", + [ + 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 duration for agreement requests before expiry."] + pub fn request_timeout( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "RequestTimeout", + [ + 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 = " Default interval between provider-initiated checkpoints (e.g., 100 blocks)."] + pub fn default_checkpoint_interval( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "DefaultCheckpointInterval", + [ + 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 = " Default grace period for checkpoint leader (e.g., 20 blocks)."] + pub fn default_checkpoint_grace( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "DefaultCheckpointGrace", + [ + 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 = " Reward paid to provider for submitting a checkpoint."] + pub fn checkpoint_reward( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointReward", + [ + 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 = " Penalty for missing a checkpoint window (slashed from provider stake)."] + pub fn checkpoint_miss_penalty( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "CheckpointMissPenalty", + [ + 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 number of buckets a single account can be a member of."] + pub fn max_buckets_per_member( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MaxBucketsPerMember", + [ + 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 = " Minimum number of blocks between announcing a deregistration and"] + #[doc = " being allowed to complete it. Must be `> ChallengeTimeout` so any"] + #[doc = " challenge against this provider that was created up to the"] + #[doc = " announcement block matures while the provider is still slashable."] + pub fn deregister_announcement_period( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "DeregisterAnnouncementPeriod", + [ + 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 challenges that may share a single deadline block."] + #[doc = ""] + #[doc = " Bounds the per-deadline challenge count so the `on_finalize` slash"] + #[doc = " sweep — which drains and slashes every challenge expiring at a given"] + #[doc = " block — does a bounded amount of work whose weight `on_initialize`"] + #[doc = " can reserve up front. Only challenges created in the *same* block"] + #[doc = " share a deadline (`deadline = created_at + ChallengeTimeout`), so a"] + #[doc = " generous value still cannot be exceeded under honest load."] + pub fn max_challenges_per_deadline( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u16> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "StorageProvider", + "MaxChallengesPerDeadline", + [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, 227u8, + 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, 184u8, 72u8, 169u8, + 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, 123u8, 128u8, 193u8, 29u8, 70u8, + ], + ) + } + } + } + } + pub mod drive_registry { + use super::root_mod; + use super::runtime_types; + #[doc = "Errors"] + pub type Error = runtime_types::pallet_drive_registry::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_drive_registry::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Create a new drive with automatic bucket creation"] + #[doc = ""] + #[doc = "Atomically opens the Layer 0 bucket + primary storage agreement"] + #[doc = "(via `establish_storage_agreement_internal`) and records the"] + #[doc = "drive metadata on top. The caller obtains `terms` and `sig`"] + #[doc = "off-chain from the provider; Layer 0 enforces signature, replay"] + #[doc = "window, and capacity/stake/duration/price checks — those errors"] + #[doc = "surface directly so the caller can react to them."] + #[doc = ""] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `name`: Optional human-readable name for the drive"] + #[doc = "- `provider`: Provider account that signed the terms."] + #[doc = "- `terms`: Provider-signed agreement terms."] + #[doc = "- `sig`: Provider signature over the SCALE-encoded terms."] + pub struct CreateDrive { + pub name: create_drive::Name, + pub provider: create_drive::Provider, + pub terms: create_drive::Terms, + pub sig: create_drive::Sig, + } + pub mod create_drive { + use super::runtime_types; + pub type Name = ::core::option::Option< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Terms = + runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + pub type Sig = runtime_types::sp_runtime::MultiSignature; + } + impl ::subxt_core::blocks::StaticExtrinsic for CreateDrive { + const PALLET: &'static str = "DriveRegistry"; + const CALL: &'static str = "create_drive"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Delete a drive completely"] + #[doc = ""] + #[doc = "Ends all storage agreements with prorated refunds, pays providers for"] + #[doc = "time served, removes the bucket from Layer 0, and removes the drive."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to delete"] + pub struct DeleteDrive { + pub drive_id: delete_drive::DriveId, + } + pub mod delete_drive { + use super::runtime_types; + pub type DriveId = ::core::primitive::u64; + } + impl ::subxt_core::blocks::StaticExtrinsic for DeleteDrive { + const PALLET: &'static str = "DriveRegistry"; + const CALL: &'static str = "delete_drive"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Share a drive with another account by adding them as a member of"] + #[doc = "the underlying Layer 0 bucket."] + #[doc = ""] + #[doc = "The caller must be the drive owner or an Admin of the underlying bucket."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to share"] + #[doc = "- `member`: Account to add"] + #[doc = "- `role`: Role to assign (Admin, Writer, or Reader)"] + pub struct ShareDrive { + pub drive_id: share_drive::DriveId, + pub member: share_drive::Member, + pub role: share_drive::Role, + } + pub mod share_drive { + use super::runtime_types; + pub type DriveId = ::core::primitive::u64; + pub type Member = ::subxt_core::utils::AccountId32; + pub type Role = runtime_types::storage_primitives::Role; + } + impl ::subxt_core::blocks::StaticExtrinsic for ShareDrive { + const PALLET: &'static str = "DriveRegistry"; + const CALL: &'static str = "share_drive"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Remove a member's access to a shared drive."] + #[doc = ""] + #[doc = "The caller must be the drive owner or an Admin of the underlying bucket."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to unshare"] + #[doc = "- `member`: Account to remove"] + pub struct UnshareDrive { + pub drive_id: unshare_drive::DriveId, + pub member: unshare_drive::Member, + } + pub mod unshare_drive { + use super::runtime_types; + pub type DriveId = ::core::primitive::u64; + pub type Member = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::blocks::StaticExtrinsic for UnshareDrive { + const PALLET: &'static str = "DriveRegistry"; + const CALL: &'static str = "unshare_drive"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Create a new drive with automatic bucket creation"] + #[doc = ""] + #[doc = "Atomically opens the Layer 0 bucket + primary storage agreement"] + #[doc = "(via `establish_storage_agreement_internal`) and records the"] + #[doc = "drive metadata on top. The caller obtains `terms` and `sig`"] + #[doc = "off-chain from the provider; Layer 0 enforces signature, replay"] + #[doc = "window, and capacity/stake/duration/price checks — those errors"] + #[doc = "surface directly so the caller can react to them."] + #[doc = ""] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `name`: Optional human-readable name for the drive"] + #[doc = "- `provider`: Provider account that signed the terms."] + #[doc = "- `terms`: Provider-signed agreement terms."] + #[doc = "- `sig`: Provider signature over the SCALE-encoded terms."] + pub fn create_drive( + &self, + name: types::create_drive::Name, + provider: types::create_drive::Provider, + terms: types::create_drive::Terms, + sig: types::create_drive::Sig, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "DriveRegistry", + "create_drive", + types::CreateDrive { + name, + provider, + terms, + sig, + }, + [ + 58u8, 121u8, 21u8, 232u8, 141u8, 250u8, 202u8, 157u8, 0u8, 223u8, 1u8, + 201u8, 11u8, 137u8, 177u8, 251u8, 214u8, 35u8, 152u8, 189u8, 251u8, + 203u8, 114u8, 90u8, 132u8, 240u8, 181u8, 145u8, 221u8, 193u8, 65u8, + 231u8, + ], + ) + } + #[doc = "Delete a drive completely"] + #[doc = ""] + #[doc = "Ends all storage agreements with prorated refunds, pays providers for"] + #[doc = "time served, removes the bucket from Layer 0, and removes the drive."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to delete"] + pub fn delete_drive( + &self, + drive_id: types::delete_drive::DriveId, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "DriveRegistry", + "delete_drive", + types::DeleteDrive { drive_id }, + [ + 231u8, 185u8, 99u8, 63u8, 40u8, 79u8, 201u8, 61u8, 57u8, 83u8, 119u8, + 252u8, 147u8, 18u8, 6u8, 106u8, 35u8, 27u8, 201u8, 107u8, 66u8, 48u8, + 245u8, 16u8, 42u8, 109u8, 116u8, 189u8, 0u8, 251u8, 1u8, 201u8, + ], + ) + } + #[doc = "Share a drive with another account by adding them as a member of"] + #[doc = "the underlying Layer 0 bucket."] + #[doc = ""] + #[doc = "The caller must be the drive owner or an Admin of the underlying bucket."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to share"] + #[doc = "- `member`: Account to add"] + #[doc = "- `role`: Role to assign (Admin, Writer, or Reader)"] + pub fn share_drive( + &self, + drive_id: types::share_drive::DriveId, + member: types::share_drive::Member, + role: types::share_drive::Role, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "DriveRegistry", + "share_drive", + types::ShareDrive { + drive_id, + member, + role, + }, + [ + 38u8, 24u8, 97u8, 20u8, 172u8, 114u8, 5u8, 151u8, 176u8, 238u8, 6u8, + 30u8, 57u8, 213u8, 239u8, 23u8, 12u8, 247u8, 171u8, 140u8, 252u8, + 215u8, 49u8, 44u8, 86u8, 80u8, 242u8, 201u8, 85u8, 25u8, 140u8, 254u8, + ], + ) + } + #[doc = "Remove a member's access to a shared drive."] + #[doc = ""] + #[doc = "The caller must be the drive owner or an Admin of the underlying bucket."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to unshare"] + #[doc = "- `member`: Account to remove"] + pub fn unshare_drive( + &self, + drive_id: types::unshare_drive::DriveId, + member: types::unshare_drive::Member, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "DriveRegistry", + "unshare_drive", + types::UnshareDrive { drive_id, member }, + [ + 9u8, 192u8, 13u8, 152u8, 223u8, 72u8, 95u8, 170u8, 107u8, 122u8, 196u8, + 96u8, 225u8, 163u8, 190u8, 196u8, 218u8, 36u8, 189u8, 132u8, 132u8, + 151u8, 76u8, 231u8, 4u8, 228u8, 38u8, 185u8, 67u8, 85u8, 147u8, 147u8, + ], + ) + } + } + } + #[doc = "Events"] + pub type Event = runtime_types::pallet_drive_registry::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A new drive was created"] + pub struct DriveCreated { + pub drive_id: drive_created::DriveId, + pub owner: drive_created::Owner, + pub bucket_id: drive_created::BucketId, + } + pub mod drive_created { + use super::runtime_types; + pub type DriveId = ::core::primitive::u64; + pub type Owner = ::subxt_core::utils::AccountId32; + pub type BucketId = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for DriveCreated { + const PALLET: &'static str = "DriveRegistry"; + const EVENT: &'static str = "DriveCreated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Drive was deleted"] + pub struct DriveDeleted { + pub drive_id: drive_deleted::DriveId, + pub owner: drive_deleted::Owner, + pub bucket_id: drive_deleted::BucketId, + pub refunded: drive_deleted::Refunded, + } + pub mod drive_deleted { + use super::runtime_types; + pub type DriveId = ::core::primitive::u64; + pub type Owner = ::subxt_core::utils::AccountId32; + pub type BucketId = ::core::primitive::u64; + pub type Refunded = ::core::primitive::u128; + } + impl ::subxt_core::events::StaticEvent for DriveDeleted { + const PALLET: &'static str = "DriveRegistry"; + const EVENT: &'static str = "DriveDeleted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Drive was shared with a member"] + pub struct DriveShared { + pub drive_id: drive_shared::DriveId, + pub member: drive_shared::Member, + pub role: drive_shared::Role, + } + pub mod drive_shared { + use super::runtime_types; + pub type DriveId = ::core::primitive::u64; + pub type Member = ::subxt_core::utils::AccountId32; + pub type Role = runtime_types::storage_primitives::Role; + } + impl ::subxt_core::events::StaticEvent for DriveShared { + const PALLET: &'static str = "DriveRegistry"; + const EVENT: &'static str = "DriveShared"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Member was removed from a shared drive"] + pub struct DriveUnshared { + pub drive_id: drive_unshared::DriveId, + pub member: drive_unshared::Member, + } + pub mod drive_unshared { + use super::runtime_types; + pub type DriveId = ::core::primitive::u64; + pub type Member = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for DriveUnshared { + const PALLET: &'static str = "DriveRegistry"; + const EVENT: &'static str = "DriveUnshared"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod bucket_to_drive { + use super::runtime_types; + pub type BucketToDrive = ::core::primitive::u64; + pub type Param0 = ::core::primitive::u64; + } + pub mod drives { + use super::runtime_types; + pub type Drives = runtime_types::file_system_primitives::DriveInfo< + ::subxt_core::utils::AccountId32, + ::core::primitive::u32, + >; + pub type Param0 = ::core::primitive::u64; + } + pub mod user_drives { + use super::runtime_types; + pub type UserDrives = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u64, + >; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod next_drive_id { + use super::runtime_types; + pub type NextDriveId = ::core::primitive::u64; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " Maps bucket ID to drive ID (1-to-1 mapping)"] + pub fn bucket_to_drive_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::bucket_to_drive::BucketToDrive, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "DriveRegistry", + "BucketToDrive", + (), + [ + 204u8, 134u8, 123u8, 65u8, 152u8, 15u8, 244u8, 67u8, 202u8, 197u8, + 71u8, 103u8, 137u8, 203u8, 159u8, 80u8, 206u8, 1u8, 243u8, 239u8, 96u8, + 179u8, 166u8, 112u8, 79u8, 147u8, 91u8, 118u8, 246u8, 66u8, 232u8, + 103u8, + ], + ) + } + #[doc = " Maps bucket ID to drive ID (1-to-1 mapping)"] + pub fn bucket_to_drive( + &self, + _0: types::bucket_to_drive::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::bucket_to_drive::Param0, + >, + types::bucket_to_drive::BucketToDrive, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "DriveRegistry", + "BucketToDrive", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 204u8, 134u8, 123u8, 65u8, 152u8, 15u8, 244u8, 67u8, 202u8, 197u8, + 71u8, 103u8, 137u8, 203u8, 159u8, 80u8, 206u8, 1u8, 243u8, 239u8, 96u8, + 179u8, 166u8, 112u8, 79u8, 147u8, 91u8, 118u8, 246u8, 66u8, 232u8, + 103u8, + ], + ) + } + #[doc = " Drive information storage"] + pub fn drives_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::drives::Drives, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "DriveRegistry", + "Drives", + (), + [ + 118u8, 245u8, 23u8, 196u8, 39u8, 151u8, 130u8, 104u8, 115u8, 208u8, + 121u8, 116u8, 165u8, 205u8, 99u8, 134u8, 136u8, 241u8, 7u8, 86u8, + 178u8, 131u8, 36u8, 204u8, 245u8, 213u8, 224u8, 53u8, 123u8, 254u8, + 107u8, 166u8, + ], + ) + } + #[doc = " Drive information storage"] + pub fn drives( + &self, + _0: types::drives::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::drives::Drives, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "DriveRegistry", + "Drives", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 118u8, 245u8, 23u8, 196u8, 39u8, 151u8, 130u8, 104u8, 115u8, 208u8, + 121u8, 116u8, 165u8, 205u8, 99u8, 134u8, 136u8, 241u8, 7u8, 86u8, + 178u8, 131u8, 36u8, 204u8, 245u8, 213u8, 224u8, 53u8, 123u8, 254u8, + 107u8, 166u8, + ], + ) + } + #[doc = " User's drives (account -> list of drive IDs)"] + pub fn user_drives_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::user_drives::UserDrives, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "DriveRegistry", + "UserDrives", + (), + [ + 254u8, 85u8, 72u8, 141u8, 88u8, 71u8, 137u8, 231u8, 110u8, 238u8, 83u8, + 255u8, 109u8, 15u8, 182u8, 146u8, 113u8, 22u8, 120u8, 87u8, 113u8, + 54u8, 137u8, 192u8, 108u8, 88u8, 81u8, 152u8, 43u8, 84u8, 40u8, 228u8, + ], + ) + } + #[doc = " User's drives (account -> list of drive IDs)"] + pub fn user_drives( + &self, + _0: types::user_drives::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::user_drives::UserDrives, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "DriveRegistry", + "UserDrives", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 254u8, 85u8, 72u8, 141u8, 88u8, 71u8, 137u8, 231u8, 110u8, 238u8, 83u8, + 255u8, 109u8, 15u8, 182u8, 146u8, 113u8, 22u8, 120u8, 87u8, 113u8, + 54u8, 137u8, 192u8, 108u8, 88u8, 81u8, 152u8, 43u8, 84u8, 40u8, 228u8, + ], + ) + } + #[doc = " Next drive ID counter"] + pub fn next_drive_id( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::next_drive_id::NextDriveId, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "DriveRegistry", + "NextDriveId", + (), + [ + 148u8, 242u8, 220u8, 56u8, 229u8, 36u8, 252u8, 53u8, 36u8, 47u8, 186u8, + 246u8, 200u8, 77u8, 241u8, 119u8, 97u8, 46u8, 39u8, 193u8, 73u8, 101u8, + 186u8, 53u8, 119u8, 7u8, 38u8, 245u8, 27u8, 250u8, 140u8, 83u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Maximum number of drives per user"] + pub fn max_drives_per_user( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "DriveRegistry", + "MaxDrivesPerUser", + [ + 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 length of drive name"] + pub fn max_drive_name_length( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "DriveRegistry", + "MaxDriveNameLength", + [ + 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 s3_registry { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_s3_registry::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_s3_registry::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Create a new S3 bucket."] + #[doc = ""] + #[doc = "This automatically creates an underlying Layer 0 bucket and links it"] + #[doc = "to the S3 bucket. The caller becomes the owner of both buckets."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `name`: S3 bucket name (3-63 chars, lowercase alphanumeric + hyphens)"] + #[doc = "- `provider`: Explicit provider account that signed the terms."] + #[doc = "- `terms`: Provider-signed agreement terms."] + #[doc = "- `sig`: Provider signature over the SCALE-encoded terms."] + pub struct CreateS3Bucket { + pub name: create_s3_bucket::Name, + pub provider: create_s3_bucket::Provider, + pub terms: create_s3_bucket::Terms, + pub sig: create_s3_bucket::Sig, + } + pub mod create_s3_bucket { + use super::runtime_types; + pub type Name = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Provider = ::subxt_core::utils::AccountId32; + pub type Terms = + runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >; + pub type Sig = runtime_types::sp_runtime::MultiSignature; + } + impl ::subxt_core::blocks::StaticExtrinsic for CreateS3Bucket { + const PALLET: &'static str = "S3Registry"; + const CALL: &'static str = "create_s3_bucket"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Delete an S3 bucket."] + #[doc = ""] + #[doc = "The bucket must be empty and caller must be the owner."] + pub struct DeleteS3Bucket { + pub s3_bucket_id: delete_s3_bucket::S3BucketId, + } + pub mod delete_s3_bucket { + use super::runtime_types; + pub type S3BucketId = ::core::primitive::u64; + } + impl ::subxt_core::blocks::StaticExtrinsic for DeleteS3Bucket { + const PALLET: &'static str = "S3Registry"; + const CALL: &'static str = "delete_s3_bucket"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Store or update object metadata."] + pub struct PutObjectMetadata { + pub s3_bucket_id: put_object_metadata::S3BucketId, + pub key: put_object_metadata::Key, + pub cid: put_object_metadata::Cid, + pub size: put_object_metadata::Size, + pub content_type: put_object_metadata::ContentType, + pub user_metadata: put_object_metadata::UserMetadata, + } + pub mod put_object_metadata { + use super::runtime_types; + pub type S3BucketId = ::core::primitive::u64; + pub type Key = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Cid = ::subxt_core::utils::H256; + pub type Size = ::core::primitive::u64; + pub type ContentType = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type UserMetadata = ::subxt_core::alloc::vec::Vec<( + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + )>; + } + impl ::subxt_core::blocks::StaticExtrinsic for PutObjectMetadata { + const PALLET: &'static str = "S3Registry"; + const CALL: &'static str = "put_object_metadata"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Delete object metadata."] + pub struct DeleteObjectMetadata { + pub s3_bucket_id: delete_object_metadata::S3BucketId, + pub key: delete_object_metadata::Key, + } + pub mod delete_object_metadata { + use super::runtime_types; + pub type S3BucketId = ::core::primitive::u64; + pub type Key = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for DeleteObjectMetadata { + const PALLET: &'static str = "S3Registry"; + const CALL: &'static str = "delete_object_metadata"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Copy object metadata from one location to another."] + pub struct CopyObjectMetadata { + pub src_bucket_id: copy_object_metadata::SrcBucketId, + pub src_key: copy_object_metadata::SrcKey, + pub dst_bucket_id: copy_object_metadata::DstBucketId, + pub dst_key: copy_object_metadata::DstKey, + } + pub mod copy_object_metadata { + use super::runtime_types; + pub type SrcBucketId = ::core::primitive::u64; + pub type SrcKey = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type DstBucketId = ::core::primitive::u64; + pub type DstKey = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for CopyObjectMetadata { + const PALLET: &'static str = "S3Registry"; + const CALL: &'static str = "copy_object_metadata"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Create a new S3 bucket."] + #[doc = ""] + #[doc = "This automatically creates an underlying Layer 0 bucket and links it"] + #[doc = "to the S3 bucket. The caller becomes the owner of both buckets."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `name`: S3 bucket name (3-63 chars, lowercase alphanumeric + hyphens)"] + #[doc = "- `provider`: Explicit provider account that signed the terms."] + #[doc = "- `terms`: Provider-signed agreement terms."] + #[doc = "- `sig`: Provider signature over the SCALE-encoded terms."] + pub fn create_s3_bucket( + &self, + name: types::create_s3_bucket::Name, + provider: types::create_s3_bucket::Provider, + terms: types::create_s3_bucket::Terms, + sig: types::create_s3_bucket::Sig, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "S3Registry", + "create_s3_bucket", + types::CreateS3Bucket { + name, + provider, + terms, + sig, + }, + [ + 143u8, 80u8, 3u8, 139u8, 89u8, 2u8, 104u8, 137u8, 71u8, 137u8, 151u8, + 165u8, 106u8, 178u8, 202u8, 0u8, 108u8, 179u8, 95u8, 188u8, 160u8, + 60u8, 31u8, 178u8, 27u8, 107u8, 194u8, 193u8, 166u8, 61u8, 73u8, 51u8, + ], + ) + } + #[doc = "Delete an S3 bucket."] + #[doc = ""] + #[doc = "The bucket must be empty and caller must be the owner."] + pub fn delete_s3_bucket( + &self, + s3_bucket_id: types::delete_s3_bucket::S3BucketId, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "S3Registry", + "delete_s3_bucket", + types::DeleteS3Bucket { s3_bucket_id }, + [ + 33u8, 44u8, 195u8, 154u8, 43u8, 151u8, 128u8, 19u8, 66u8, 173u8, 10u8, + 165u8, 185u8, 31u8, 113u8, 90u8, 254u8, 196u8, 56u8, 180u8, 174u8, + 61u8, 167u8, 91u8, 153u8, 124u8, 123u8, 217u8, 248u8, 134u8, 25u8, + 11u8, + ], + ) + } + #[doc = "Store or update object metadata."] + pub fn put_object_metadata( + &self, + s3_bucket_id: types::put_object_metadata::S3BucketId, + key: types::put_object_metadata::Key, + cid: types::put_object_metadata::Cid, + size: types::put_object_metadata::Size, + content_type: types::put_object_metadata::ContentType, + user_metadata: types::put_object_metadata::UserMetadata, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "S3Registry", + "put_object_metadata", + types::PutObjectMetadata { + s3_bucket_id, + key, + cid, + size, + content_type, + user_metadata, + }, + [ + 197u8, 83u8, 30u8, 163u8, 178u8, 9u8, 170u8, 167u8, 88u8, 224u8, 41u8, + 184u8, 182u8, 191u8, 199u8, 225u8, 50u8, 216u8, 227u8, 114u8, 182u8, + 152u8, 181u8, 50u8, 220u8, 233u8, 245u8, 115u8, 212u8, 248u8, 143u8, + 184u8, + ], + ) + } + #[doc = "Delete object metadata."] + pub fn delete_object_metadata( + &self, + s3_bucket_id: types::delete_object_metadata::S3BucketId, + key: types::delete_object_metadata::Key, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "S3Registry", + "delete_object_metadata", + types::DeleteObjectMetadata { s3_bucket_id, key }, + [ + 251u8, 20u8, 134u8, 84u8, 158u8, 249u8, 168u8, 44u8, 126u8, 187u8, + 96u8, 127u8, 205u8, 38u8, 91u8, 176u8, 91u8, 106u8, 193u8, 248u8, 20u8, + 153u8, 196u8, 125u8, 241u8, 34u8, 160u8, 126u8, 169u8, 165u8, 254u8, + 122u8, + ], + ) + } + #[doc = "Copy object metadata from one location to another."] + pub fn copy_object_metadata( + &self, + src_bucket_id: types::copy_object_metadata::SrcBucketId, + src_key: types::copy_object_metadata::SrcKey, + dst_bucket_id: types::copy_object_metadata::DstBucketId, + dst_key: types::copy_object_metadata::DstKey, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "S3Registry", + "copy_object_metadata", + types::CopyObjectMetadata { + src_bucket_id, + src_key, + dst_bucket_id, + dst_key, + }, + [ + 195u8, 211u8, 103u8, 47u8, 220u8, 87u8, 75u8, 203u8, 9u8, 99u8, 240u8, + 118u8, 126u8, 220u8, 45u8, 196u8, 247u8, 114u8, 17u8, 189u8, 16u8, + 145u8, 0u8, 234u8, 111u8, 83u8, 230u8, 24u8, 169u8, 121u8, 124u8, 57u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_s3_registry::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "S3 bucket created."] + pub struct S3BucketCreated { + pub s3_bucket_id: s3_bucket_created::S3BucketId, + pub name: s3_bucket_created::Name, + pub layer0_bucket_id: s3_bucket_created::Layer0BucketId, + pub owner: s3_bucket_created::Owner, + } + pub mod s3_bucket_created { + use super::runtime_types; + pub type S3BucketId = ::core::primitive::u64; + pub type Name = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Layer0BucketId = ::core::primitive::u64; + pub type Owner = ::subxt_core::utils::AccountId32; + } + impl ::subxt_core::events::StaticEvent for S3BucketCreated { + const PALLET: &'static str = "S3Registry"; + const EVENT: &'static str = "S3BucketCreated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "S3 bucket deleted."] + pub struct S3BucketDeleted { + pub s3_bucket_id: s3_bucket_deleted::S3BucketId, + } + pub mod s3_bucket_deleted { + use super::runtime_types; + pub type S3BucketId = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for S3BucketDeleted { + const PALLET: &'static str = "S3Registry"; + const EVENT: &'static str = "S3BucketDeleted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Object metadata stored."] + pub struct ObjectPut { + pub s3_bucket_id: object_put::S3BucketId, + pub key: object_put::Key, + pub cid: object_put::Cid, + pub size: object_put::Size, + } + pub mod object_put { + use super::runtime_types; + pub type S3BucketId = ::core::primitive::u64; + pub type Key = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Cid = ::subxt_core::utils::H256; + pub type Size = ::core::primitive::u64; + } + impl ::subxt_core::events::StaticEvent for ObjectPut { + const PALLET: &'static str = "S3Registry"; + const EVENT: &'static str = "ObjectPut"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Object deleted."] + pub struct ObjectDeleted { + pub s3_bucket_id: object_deleted::S3BucketId, + pub key: object_deleted::Key, + } + pub mod object_deleted { + use super::runtime_types; + pub type S3BucketId = ::core::primitive::u64; + pub type Key = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::events::StaticEvent for ObjectDeleted { + const PALLET: &'static str = "S3Registry"; + const EVENT: &'static str = "ObjectDeleted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Object copied."] + pub struct ObjectCopied { + pub src_bucket_id: object_copied::SrcBucketId, + pub src_key: object_copied::SrcKey, + pub dst_bucket_id: object_copied::DstBucketId, + pub dst_key: object_copied::DstKey, + } + pub mod object_copied { + use super::runtime_types; + pub type SrcBucketId = ::core::primitive::u64; + pub type SrcKey = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type DstBucketId = ::core::primitive::u64; + pub type DstKey = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::events::StaticEvent for ObjectCopied { + const PALLET: &'static str = "S3Registry"; + const EVENT: &'static str = "ObjectCopied"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod s3_buckets { + use super::runtime_types; + pub type S3Buckets = runtime_types::s3_primitives::S3BucketInfo< + ::subxt_core::utils::AccountId32, + ::core::primitive::u32, + >; + pub type Param0 = ::core::primitive::u64; + } + pub mod bucket_name_to_id { + use super::runtime_types; + pub type BucketNameToId = ::core::primitive::u64; + pub type Param0 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + pub mod user_buckets { + use super::runtime_types; + pub type UserBuckets = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u64, + >; + pub type Param0 = ::subxt_core::utils::AccountId32; + } + pub mod objects { + use super::runtime_types; + pub type Objects = runtime_types::s3_primitives::ObjectMetadata; + pub type Param0 = ::core::primitive::u64; + pub type Param1 = runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + } + pub mod next_s3_bucket_id { + use super::runtime_types; + pub type NextS3BucketId = ::core::primitive::u64; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " S3 bucket registry: S3BucketId -> S3BucketInfo"] + pub fn s3_buckets_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::s3_buckets::S3Buckets, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "S3Buckets", + (), + [ + 180u8, 216u8, 77u8, 83u8, 130u8, 127u8, 29u8, 250u8, 114u8, 192u8, + 238u8, 112u8, 42u8, 65u8, 247u8, 32u8, 74u8, 143u8, 153u8, 255u8, 92u8, + 137u8, 142u8, 251u8, 216u8, 18u8, 95u8, 105u8, 237u8, 158u8, 40u8, + 12u8, + ], + ) + } + #[doc = " S3 bucket registry: S3BucketId -> S3BucketInfo"] + pub fn s3_buckets( + &self, + _0: types::s3_buckets::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::s3_buckets::S3Buckets, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "S3Buckets", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 180u8, 216u8, 77u8, 83u8, 130u8, 127u8, 29u8, 250u8, 114u8, 192u8, + 238u8, 112u8, 42u8, 65u8, 247u8, 32u8, 74u8, 143u8, 153u8, 255u8, 92u8, + 137u8, 142u8, 251u8, 216u8, 18u8, 95u8, 105u8, 237u8, 158u8, 40u8, + 12u8, + ], + ) + } + #[doc = " Bucket name to ID mapping for uniqueness and lookup."] + pub fn bucket_name_to_id_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::bucket_name_to_id::BucketNameToId, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "BucketNameToId", + (), + [ + 5u8, 57u8, 231u8, 43u8, 37u8, 101u8, 221u8, 242u8, 20u8, 175u8, 40u8, + 217u8, 184u8, 120u8, 46u8, 111u8, 220u8, 71u8, 50u8, 66u8, 231u8, 58u8, + 117u8, 178u8, 129u8, 167u8, 32u8, 15u8, 29u8, 109u8, 255u8, 79u8, + ], + ) + } + #[doc = " Bucket name to ID mapping for uniqueness and lookup."] + pub fn bucket_name_to_id( + &self, + _0: types::bucket_name_to_id::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::bucket_name_to_id::Param0, + >, + types::bucket_name_to_id::BucketNameToId, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "BucketNameToId", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 5u8, 57u8, 231u8, 43u8, 37u8, 101u8, 221u8, 242u8, 20u8, 175u8, 40u8, + 217u8, 184u8, 120u8, 46u8, 111u8, 220u8, 71u8, 50u8, 66u8, 231u8, 58u8, + 117u8, 178u8, 129u8, 167u8, 32u8, 15u8, 29u8, 109u8, 255u8, 79u8, + ], + ) + } + #[doc = " User's S3 buckets."] + pub fn user_buckets_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::user_buckets::UserBuckets, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "UserBuckets", + (), + [ + 162u8, 241u8, 83u8, 81u8, 16u8, 184u8, 157u8, 225u8, 73u8, 217u8, + 221u8, 152u8, 41u8, 69u8, 90u8, 233u8, 155u8, 232u8, 141u8, 80u8, + 234u8, 219u8, 63u8, 214u8, 94u8, 18u8, 52u8, 225u8, 62u8, 126u8, 246u8, + 11u8, + ], + ) + } + #[doc = " User's S3 buckets."] + pub fn user_buckets( + &self, + _0: types::user_buckets::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::user_buckets::UserBuckets, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "UserBuckets", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 162u8, 241u8, 83u8, 81u8, 16u8, 184u8, 157u8, 225u8, 73u8, 217u8, + 221u8, 152u8, 41u8, 69u8, 90u8, 233u8, 155u8, 232u8, 141u8, 80u8, + 234u8, 219u8, 63u8, 214u8, 94u8, 18u8, 52u8, 225u8, 62u8, 126u8, 246u8, + 11u8, + ], + ) + } + #[doc = " Object metadata: (S3BucketId, ObjectKey) -> ObjectMetadata"] + pub fn objects_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::objects::Objects, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "Objects", + (), + [ + 252u8, 164u8, 143u8, 41u8, 121u8, 102u8, 20u8, 26u8, 59u8, 104u8, 69u8, + 208u8, 24u8, 37u8, 136u8, 138u8, 212u8, 75u8, 192u8, 29u8, 213u8, + 124u8, 36u8, 26u8, 65u8, 121u8, 92u8, 87u8, 244u8, 206u8, 72u8, 90u8, + ], + ) + } + #[doc = " Object metadata: (S3BucketId, ObjectKey) -> ObjectMetadata"] + pub fn objects_iter1( + &self, + _0: types::objects::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::objects::Objects, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "Objects", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 252u8, 164u8, 143u8, 41u8, 121u8, 102u8, 20u8, 26u8, 59u8, 104u8, 69u8, + 208u8, 24u8, 37u8, 136u8, 138u8, 212u8, 75u8, 192u8, 29u8, 213u8, + 124u8, 36u8, 26u8, 65u8, 121u8, 92u8, 87u8, 244u8, 206u8, 72u8, 90u8, + ], + ) + } + #[doc = " Object metadata: (S3BucketId, ObjectKey) -> ObjectMetadata"] + pub fn objects( + &self, + _0: types::objects::Param0, + _1: types::objects::Param1, + ) -> ::subxt_core::storage::address::StaticAddress< + ( + ::subxt_core::storage::address::StaticStorageKey, + ::subxt_core::storage::address::StaticStorageKey, + ), + types::objects::Objects, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "Objects", + ( + ::subxt_core::storage::address::StaticStorageKey::new(_0), + ::subxt_core::storage::address::StaticStorageKey::new(_1), + ), + [ + 252u8, 164u8, 143u8, 41u8, 121u8, 102u8, 20u8, 26u8, 59u8, 104u8, 69u8, + 208u8, 24u8, 37u8, 136u8, 138u8, 212u8, 75u8, 192u8, 29u8, 213u8, + 124u8, 36u8, 26u8, 65u8, 121u8, 92u8, 87u8, 244u8, 206u8, 72u8, 90u8, + ], + ) + } + #[doc = " Next S3 bucket ID (auto-increment)."] + pub fn next_s3_bucket_id( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::next_s3_bucket_id::NextS3BucketId, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "S3Registry", + "NextS3BucketId", + (), + [ + 64u8, 11u8, 207u8, 32u8, 115u8, 87u8, 83u8, 98u8, 24u8, 229u8, 92u8, + 208u8, 124u8, 221u8, 53u8, 166u8, 40u8, 65u8, 69u8, 204u8, 15u8, 91u8, + 7u8, 172u8, 216u8, 202u8, 231u8, 179u8, 83u8, 179u8, 98u8, 226u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Maximum number of buckets per user."] + pub fn max_buckets_per_user( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "S3Registry", + "MaxBucketsPerUser", + [ + 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 objects per bucket."] + pub fn max_objects_per_bucket( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "S3Registry", + "MaxObjectsPerBucket", + [ + 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 revive { + use super::root_mod; + use super::runtime_types; + #[doc = "The `Error` enum of this pallet."] + pub type Error = runtime_types::pallet_revive::pallet::Error; + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub type Call = runtime_types::pallet_revive::pallet::Call; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A raw EVM transaction, typically dispatched by an Ethereum JSON-RPC server."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `payload`: The encoded [`crate::evm::TransactionSigned`]."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "This call cannot be dispatched directly; attempting to do so will result in a failed"] + #[doc = "transaction. It serves as a wrapper for an Ethereum transaction. When submitted, the"] + #[doc = "runtime converts it into a [`sp_runtime::generic::CheckedExtrinsic`] by recovering the"] + #[doc = "signer and validating the transaction."] + pub struct EthTransact { + pub payload: eth_transact::Payload, + } + pub mod eth_transact { + use super::runtime_types; + pub type Payload = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for EthTransact { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "eth_transact"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Makes a call to an account, optionally transferring some balance."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `dest`: Address of the contract to call."] + #[doc = "* `value`: The balance to transfer from the `origin` to `dest`."] + #[doc = "* `weight_limit`: The weight limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged from the"] + #[doc = " caller to pay for the storage consumed."] + #[doc = "* `data`: The input data to pass to the contract."] + #[doc = ""] + #[doc = "* If the account is a smart-contract account, the associated code will be"] + #[doc = "executed and any value will be transferred."] + #[doc = "* If the account is a regular account, any value will be transferred."] + #[doc = "* If no account exists and the call value is not less than `existential_deposit`,"] + #[doc = "a regular account will be created and any value will be transferred."] + pub struct Call { + pub dest: call::Dest, + #[codec(compact)] + pub value: call::Value, + pub weight_limit: call::WeightLimit, + #[codec(compact)] + pub storage_deposit_limit: call::StorageDepositLimit, + pub data: call::Data, + } + pub mod call { + use super::runtime_types; + pub type Dest = ::subxt_core::utils::H160; + pub type Value = ::core::primitive::u128; + pub type WeightLimit = runtime_types::sp_weights::weight_v2::Weight; + pub type StorageDepositLimit = ::core::primitive::u128; + pub type Data = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for Call { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "call"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Instantiates a contract from a previously deployed vm binary."] + #[doc = ""] + #[doc = "This function is identical to [`Self::instantiate_with_code`] but without the"] + #[doc = "code deployment step. Instead, the `code_hash` of an on-chain deployed vm binary"] + #[doc = "must be supplied."] + pub struct Instantiate { + #[codec(compact)] + pub value: instantiate::Value, + pub weight_limit: instantiate::WeightLimit, + #[codec(compact)] + pub storage_deposit_limit: instantiate::StorageDepositLimit, + pub code_hash: instantiate::CodeHash, + pub data: instantiate::Data, + pub salt: instantiate::Salt, + } + pub mod instantiate { + use super::runtime_types; + pub type Value = ::core::primitive::u128; + pub type WeightLimit = runtime_types::sp_weights::weight_v2::Weight; + pub type StorageDepositLimit = ::core::primitive::u128; + pub type CodeHash = ::subxt_core::utils::H256; + pub type Data = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Salt = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt_core::blocks::StaticExtrinsic for Instantiate { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "instantiate"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Instantiates a new contract from the supplied `code` optionally transferring"] + #[doc = "some balance."] + #[doc = ""] + #[doc = "This dispatchable has the same effect as calling [`Self::upload_code`] +"] + #[doc = "[`Self::instantiate`]. Bundling them together provides efficiency gains. Please"] + #[doc = "also check the documentation of [`Self::upload_code`]."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The weight limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged/reserved"] + #[doc = " from the caller to pay for the storage consumed."] + #[doc = "* `code`: The contract code to deploy in raw bytes."] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `salt`: Used for the address derivation. If `Some` is supplied then `CREATE2`"] + #[doc = "\tsemantics are used. If `None` then `CRATE1` is used."] + #[doc = ""] + #[doc = ""] + #[doc = "Instantiation is executed as follows:"] + #[doc = ""] + #[doc = "- The supplied `code` is deployed, and a `code_hash` is created for that code."] + #[doc = "- If the `code_hash` already exists on the chain the underlying `code` will be shared."] + #[doc = "- The destination address is computed based on the sender, code_hash and the salt."] + #[doc = "- The smart-contract account is created at the computed address."] + #[doc = "- The `value` is transferred to the new account."] + #[doc = "- The `deploy` function is executed in the context of the newly-created account."] + pub struct InstantiateWithCode { + #[codec(compact)] + pub value: instantiate_with_code::Value, + pub weight_limit: instantiate_with_code::WeightLimit, + #[codec(compact)] + pub storage_deposit_limit: instantiate_with_code::StorageDepositLimit, + pub code: instantiate_with_code::Code, + pub data: instantiate_with_code::Data, + pub salt: instantiate_with_code::Salt, + } + pub mod instantiate_with_code { + use super::runtime_types; + pub type Value = ::core::primitive::u128; + pub type WeightLimit = runtime_types::sp_weights::weight_v2::Weight; + pub type StorageDepositLimit = ::core::primitive::u128; + pub type Code = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Data = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Salt = ::core::option::Option<[::core::primitive::u8; 32usize]>; + } + impl ::subxt_core::blocks::StaticExtrinsic for InstantiateWithCode { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "instantiate_with_code"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Same as [`Self::instantiate_with_code`], but intended to be dispatched **only**"] + #[doc = "by an EVM transaction through the EVM compatibility layer."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The gas limit used to derive the transaction weight for transaction"] + #[doc = " payment"] + #[doc = "* `eth_gas_limit`: The Ethereum gas limit governing the resource usage of the execution"] + #[doc = "* `code`: The contract code to deploy in raw bytes."] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `transaction_encoded`: The RLP encoding of the signed Ethereum transaction,"] + #[doc = " represented as [crate::evm::TransactionSigned], provided by the Ethereum wallet. This"] + #[doc = " is used for building the Ethereum transaction root."] + #[doc = "* effective_gas_price: the price of a unit of gas"] + #[doc = "* encoded len: the byte code size of the `eth_transact` extrinsic"] + #[doc = ""] + #[doc = "Calling this dispatchable ensures that the origin's nonce is bumped only once,"] + #[doc = "via the `CheckNonce` transaction extension. In contrast, [`Self::instantiate_with_code`]"] + #[doc = "also bumps the nonce after contract instantiation, since it may be invoked multiple"] + #[doc = "times within a batch call transaction."] + pub struct EthInstantiateWithCode { + pub value: eth_instantiate_with_code::Value, + pub weight_limit: eth_instantiate_with_code::WeightLimit, + pub eth_gas_limit: eth_instantiate_with_code::EthGasLimit, + pub code: eth_instantiate_with_code::Code, + pub data: eth_instantiate_with_code::Data, + pub transaction_encoded: eth_instantiate_with_code::TransactionEncoded, + pub effective_gas_price: eth_instantiate_with_code::EffectiveGasPrice, + pub encoded_len: eth_instantiate_with_code::EncodedLen, + } + pub mod eth_instantiate_with_code { + use super::runtime_types; + pub type Value = runtime_types::primitive_types::U256; + pub type WeightLimit = runtime_types::sp_weights::weight_v2::Weight; + pub type EthGasLimit = runtime_types::primitive_types::U256; + pub type Code = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Data = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type TransactionEncoded = + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type EffectiveGasPrice = runtime_types::primitive_types::U256; + pub type EncodedLen = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for EthInstantiateWithCode { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "eth_instantiate_with_code"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Same as [`Self::call`], but intended to be dispatched **only**"] + #[doc = "by an EVM transaction through the EVM compatibility layer."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `dest`: The Ethereum address of the account to be called"] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The gas limit used to derive the transaction weight for transaction"] + #[doc = " payment"] + #[doc = "* `eth_gas_limit`: The Ethereum gas limit governing the resource usage of the execution"] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `transaction_encoded`: The RLP encoding of the signed Ethereum transaction,"] + #[doc = " represented as [crate::evm::TransactionSigned], provided by the Ethereum wallet. This"] + #[doc = " is used for building the Ethereum transaction root."] + #[doc = "* effective_gas_price: the price of a unit of gas"] + #[doc = "* encoded len: the byte code size of the `eth_transact` extrinsic"] + pub struct EthCall { + pub dest: eth_call::Dest, + pub value: eth_call::Value, + pub weight_limit: eth_call::WeightLimit, + pub eth_gas_limit: eth_call::EthGasLimit, + pub data: eth_call::Data, + pub transaction_encoded: eth_call::TransactionEncoded, + pub effective_gas_price: eth_call::EffectiveGasPrice, + pub encoded_len: eth_call::EncodedLen, + } + pub mod eth_call { + use super::runtime_types; + pub type Dest = ::subxt_core::utils::H160; + pub type Value = runtime_types::primitive_types::U256; + pub type WeightLimit = runtime_types::sp_weights::weight_v2::Weight; + pub type EthGasLimit = runtime_types::primitive_types::U256; + pub type Data = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type TransactionEncoded = + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type EffectiveGasPrice = runtime_types::primitive_types::U256; + pub type EncodedLen = ::core::primitive::u32; + } + impl ::subxt_core::blocks::StaticExtrinsic for EthCall { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "eth_call"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Executes a Substrate runtime call from an Ethereum transaction."] + #[doc = ""] + #[doc = "This dispatchable is intended to be called **only** through the EVM compatibility"] + #[doc = "layer. The provided call will be dispatched using `RawOrigin::Signed`."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `origin`: Must be an [`Origin::EthTransaction`] origin."] + #[doc = "* `call`: The Substrate runtime call to execute."] + #[doc = "* `transaction_encoded`: The RLP encoding of the Ethereum transaction,"] + pub struct EthSubstrateCall { + pub call: ::subxt_core::alloc::boxed::Box, + pub transaction_encoded: eth_substrate_call::TransactionEncoded, + } + pub mod eth_substrate_call { + use super::runtime_types; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + pub type TransactionEncoded = + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + } + impl ::subxt_core::blocks::StaticExtrinsic for EthSubstrateCall { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "eth_substrate_call"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Upload new `code` without instantiating a contract from it."] + #[doc = ""] + #[doc = "If the code does not already exist a deposit is reserved from the caller"] + #[doc = "The size of the reserve depends on the size of the supplied `code`."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "Anyone can instantiate a contract from any uploaded code and thus prevent its removal."] + #[doc = "To avoid this situation a constructor could employ access control so that it can"] + #[doc = "only be instantiated by permissioned entities. The same is true when uploading"] + #[doc = "through [`Self::instantiate_with_code`]."] + #[doc = ""] + #[doc = "If the refcount of the code reaches zero after terminating the last contract that"] + #[doc = "references this code, the code will be removed automatically."] + pub struct UploadCode { + pub code: upload_code::Code, + #[codec(compact)] + pub storage_deposit_limit: upload_code::StorageDepositLimit, + } + pub mod upload_code { + use super::runtime_types; + pub type Code = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type StorageDepositLimit = ::core::primitive::u128; + } + impl ::subxt_core::blocks::StaticExtrinsic for UploadCode { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "upload_code"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Remove the code stored under `code_hash` and refund the deposit to its owner."] + #[doc = ""] + #[doc = "A code can only be removed by its original uploader (its owner) and only if it is"] + #[doc = "not used by any contract."] + pub struct RemoveCode { + pub code_hash: remove_code::CodeHash, + } + pub mod remove_code { + use super::runtime_types; + pub type CodeHash = ::subxt_core::utils::H256; + } + impl ::subxt_core::blocks::StaticExtrinsic for RemoveCode { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "remove_code"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Privileged function that changes the code of an existing contract."] + #[doc = ""] + #[doc = "This takes care of updating refcounts and all other necessary operations. Returns"] + #[doc = "an error if either the `code_hash` or `dest` do not exist."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "This does **not** change the address of the contract in question. This means"] + #[doc = "that the contract address is no longer derived from its code hash after calling"] + #[doc = "this dispatchable."] + pub struct SetCode { + pub dest: set_code::Dest, + pub code_hash: set_code::CodeHash, + } + pub mod set_code { + use super::runtime_types; + pub type Dest = ::subxt_core::utils::H160; + pub type CodeHash = ::subxt_core::utils::H256; + } + impl ::subxt_core::blocks::StaticExtrinsic for SetCode { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "set_code"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Register the callers account id so that it can be used in contract interactions."] + #[doc = ""] + #[doc = "This will error if the origin is already mapped or is a eth native `Address20`. It will"] + #[doc = "take a deposit that can be released by calling [`Self::unmap_account`]."] + pub struct MapAccount; + impl ::subxt_core::blocks::StaticExtrinsic for MapAccount { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "map_account"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Unregister the callers account id in order to free the deposit."] + #[doc = ""] + #[doc = "There is no reason to ever call this function other than freeing up the deposit."] + #[doc = "This is only useful when the account should no longer be used."] + pub struct UnmapAccount; + impl ::subxt_core::blocks::StaticExtrinsic for UnmapAccount { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "unmap_account"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Dispatch an `call` with the origin set to the callers fallback address."] + #[doc = ""] + #[doc = "Every `AccountId32` can control its corresponding fallback account. The fallback account"] + #[doc = "is the `AccountId20` with the last 12 bytes set to `0xEE`. This is essentially a"] + #[doc = "recovery function in case an `AccountId20` was used without creating a mapping first."] + pub struct DispatchAsFallbackAccount { + pub call: ::subxt_core::alloc::boxed::Box, + } + pub mod dispatch_as_fallback_account { + use super::runtime_types; + pub type Call = runtime_types::storage_paseo_runtime::RuntimeCall; + } + impl ::subxt_core::blocks::StaticExtrinsic for DispatchAsFallbackAccount { + const PALLET: &'static str = "Revive"; + const CALL: &'static str = "dispatch_as_fallback_account"; + } + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "A raw EVM transaction, typically dispatched by an Ethereum JSON-RPC server."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `payload`: The encoded [`crate::evm::TransactionSigned`]."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "This call cannot be dispatched directly; attempting to do so will result in a failed"] + #[doc = "transaction. It serves as a wrapper for an Ethereum transaction. When submitted, the"] + #[doc = "runtime converts it into a [`sp_runtime::generic::CheckedExtrinsic`] by recovering the"] + #[doc = "signer and validating the transaction."] + pub fn eth_transact( + &self, + payload: types::eth_transact::Payload, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "eth_transact", + types::EthTransact { payload }, + [ + 71u8, 255u8, 105u8, 93u8, 160u8, 242u8, 81u8, 57u8, 30u8, 23u8, 99u8, + 8u8, 90u8, 118u8, 70u8, 125u8, 107u8, 227u8, 165u8, 190u8, 141u8, + 154u8, 149u8, 179u8, 51u8, 4u8, 178u8, 157u8, 31u8, 135u8, 100u8, + 123u8, + ], + ) + } + #[doc = "Makes a call to an account, optionally transferring some balance."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `dest`: Address of the contract to call."] + #[doc = "* `value`: The balance to transfer from the `origin` to `dest`."] + #[doc = "* `weight_limit`: The weight limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged from the"] + #[doc = " caller to pay for the storage consumed."] + #[doc = "* `data`: The input data to pass to the contract."] + #[doc = ""] + #[doc = "* If the account is a smart-contract account, the associated code will be"] + #[doc = "executed and any value will be transferred."] + #[doc = "* If the account is a regular account, any value will be transferred."] + #[doc = "* If no account exists and the call value is not less than `existential_deposit`,"] + #[doc = "a regular account will be created and any value will be transferred."] + pub fn call( + &self, + dest: types::call::Dest, + value: types::call::Value, + weight_limit: types::call::WeightLimit, + storage_deposit_limit: types::call::StorageDepositLimit, + data: types::call::Data, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "call", + types::Call { + dest, + value, + weight_limit, + storage_deposit_limit, + data, + }, + [ + 220u8, 73u8, 155u8, 222u8, 57u8, 40u8, 248u8, 146u8, 231u8, 34u8, + 145u8, 24u8, 80u8, 135u8, 55u8, 69u8, 117u8, 241u8, 2u8, 212u8, 13u8, + 238u8, 35u8, 168u8, 10u8, 0u8, 117u8, 199u8, 100u8, 105u8, 91u8, 37u8, + ], + ) + } + #[doc = "Instantiates a contract from a previously deployed vm binary."] + #[doc = ""] + #[doc = "This function is identical to [`Self::instantiate_with_code`] but without the"] + #[doc = "code deployment step. Instead, the `code_hash` of an on-chain deployed vm binary"] + #[doc = "must be supplied."] + pub fn instantiate( + &self, + value: types::instantiate::Value, + weight_limit: types::instantiate::WeightLimit, + storage_deposit_limit: types::instantiate::StorageDepositLimit, + code_hash: types::instantiate::CodeHash, + data: types::instantiate::Data, + salt: types::instantiate::Salt, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "instantiate", + types::Instantiate { + value, + weight_limit, + storage_deposit_limit, + code_hash, + data, + salt, + }, + [ + 161u8, 84u8, 77u8, 240u8, 34u8, 24u8, 186u8, 80u8, 181u8, 187u8, 8u8, + 77u8, 115u8, 175u8, 195u8, 68u8, 170u8, 166u8, 142u8, 32u8, 34u8, + 100u8, 124u8, 98u8, 31u8, 64u8, 190u8, 80u8, 26u8, 208u8, 189u8, 129u8, + ], + ) + } + #[doc = "Instantiates a new contract from the supplied `code` optionally transferring"] + #[doc = "some balance."] + #[doc = ""] + #[doc = "This dispatchable has the same effect as calling [`Self::upload_code`] +"] + #[doc = "[`Self::instantiate`]. Bundling them together provides efficiency gains. Please"] + #[doc = "also check the documentation of [`Self::upload_code`]."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The weight limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged/reserved"] + #[doc = " from the caller to pay for the storage consumed."] + #[doc = "* `code`: The contract code to deploy in raw bytes."] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `salt`: Used for the address derivation. If `Some` is supplied then `CREATE2`"] + #[doc = "\tsemantics are used. If `None` then `CRATE1` is used."] + #[doc = ""] + #[doc = ""] + #[doc = "Instantiation is executed as follows:"] + #[doc = ""] + #[doc = "- The supplied `code` is deployed, and a `code_hash` is created for that code."] + #[doc = "- If the `code_hash` already exists on the chain the underlying `code` will be shared."] + #[doc = "- The destination address is computed based on the sender, code_hash and the salt."] + #[doc = "- The smart-contract account is created at the computed address."] + #[doc = "- The `value` is transferred to the new account."] + #[doc = "- The `deploy` function is executed in the context of the newly-created account."] + pub fn instantiate_with_code( + &self, + value: types::instantiate_with_code::Value, + weight_limit: types::instantiate_with_code::WeightLimit, + storage_deposit_limit: types::instantiate_with_code::StorageDepositLimit, + code: types::instantiate_with_code::Code, + data: types::instantiate_with_code::Data, + salt: types::instantiate_with_code::Salt, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "instantiate_with_code", + types::InstantiateWithCode { + value, + weight_limit, + storage_deposit_limit, + code, + data, + salt, + }, + [ + 64u8, 213u8, 61u8, 126u8, 98u8, 48u8, 139u8, 75u8, 76u8, 202u8, 215u8, + 26u8, 210u8, 240u8, 112u8, 69u8, 98u8, 1u8, 188u8, 192u8, 50u8, 252u8, + 81u8, 82u8, 2u8, 29u8, 240u8, 135u8, 200u8, 139u8, 5u8, 35u8, + ], + ) + } + #[doc = "Same as [`Self::instantiate_with_code`], but intended to be dispatched **only**"] + #[doc = "by an EVM transaction through the EVM compatibility layer."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The gas limit used to derive the transaction weight for transaction"] + #[doc = " payment"] + #[doc = "* `eth_gas_limit`: The Ethereum gas limit governing the resource usage of the execution"] + #[doc = "* `code`: The contract code to deploy in raw bytes."] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `transaction_encoded`: The RLP encoding of the signed Ethereum transaction,"] + #[doc = " represented as [crate::evm::TransactionSigned], provided by the Ethereum wallet. This"] + #[doc = " is used for building the Ethereum transaction root."] + #[doc = "* effective_gas_price: the price of a unit of gas"] + #[doc = "* encoded len: the byte code size of the `eth_transact` extrinsic"] + #[doc = ""] + #[doc = "Calling this dispatchable ensures that the origin's nonce is bumped only once,"] + #[doc = "via the `CheckNonce` transaction extension. In contrast, [`Self::instantiate_with_code`]"] + #[doc = "also bumps the nonce after contract instantiation, since it may be invoked multiple"] + #[doc = "times within a batch call transaction."] + pub fn eth_instantiate_with_code( + &self, + value: types::eth_instantiate_with_code::Value, + weight_limit: types::eth_instantiate_with_code::WeightLimit, + eth_gas_limit: types::eth_instantiate_with_code::EthGasLimit, + code: types::eth_instantiate_with_code::Code, + data: types::eth_instantiate_with_code::Data, + transaction_encoded: types::eth_instantiate_with_code::TransactionEncoded, + effective_gas_price: types::eth_instantiate_with_code::EffectiveGasPrice, + encoded_len: types::eth_instantiate_with_code::EncodedLen, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "eth_instantiate_with_code", + types::EthInstantiateWithCode { + value, + weight_limit, + eth_gas_limit, + code, + data, + transaction_encoded, + effective_gas_price, + encoded_len, + }, + [ + 147u8, 61u8, 42u8, 184u8, 121u8, 163u8, 179u8, 218u8, 191u8, 138u8, + 109u8, 111u8, 146u8, 77u8, 216u8, 65u8, 253u8, 194u8, 57u8, 165u8, + 167u8, 157u8, 125u8, 27u8, 161u8, 248u8, 145u8, 236u8, 152u8, 66u8, + 39u8, 212u8, + ], + ) + } + #[doc = "Same as [`Self::call`], but intended to be dispatched **only**"] + #[doc = "by an EVM transaction through the EVM compatibility layer."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `dest`: The Ethereum address of the account to be called"] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The gas limit used to derive the transaction weight for transaction"] + #[doc = " payment"] + #[doc = "* `eth_gas_limit`: The Ethereum gas limit governing the resource usage of the execution"] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `transaction_encoded`: The RLP encoding of the signed Ethereum transaction,"] + #[doc = " represented as [crate::evm::TransactionSigned], provided by the Ethereum wallet. This"] + #[doc = " is used for building the Ethereum transaction root."] + #[doc = "* effective_gas_price: the price of a unit of gas"] + #[doc = "* encoded len: the byte code size of the `eth_transact` extrinsic"] + pub fn eth_call( + &self, + dest: types::eth_call::Dest, + value: types::eth_call::Value, + weight_limit: types::eth_call::WeightLimit, + eth_gas_limit: types::eth_call::EthGasLimit, + data: types::eth_call::Data, + transaction_encoded: types::eth_call::TransactionEncoded, + effective_gas_price: types::eth_call::EffectiveGasPrice, + encoded_len: types::eth_call::EncodedLen, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "eth_call", + types::EthCall { + dest, + value, + weight_limit, + eth_gas_limit, + data, + transaction_encoded, + effective_gas_price, + encoded_len, + }, + [ + 97u8, 28u8, 122u8, 24u8, 13u8, 232u8, 162u8, 111u8, 248u8, 56u8, 22u8, + 226u8, 81u8, 141u8, 101u8, 71u8, 200u8, 149u8, 254u8, 189u8, 106u8, + 122u8, 171u8, 223u8, 72u8, 16u8, 254u8, 92u8, 139u8, 188u8, 227u8, + 76u8, + ], + ) + } + #[doc = "Executes a Substrate runtime call from an Ethereum transaction."] + #[doc = ""] + #[doc = "This dispatchable is intended to be called **only** through the EVM compatibility"] + #[doc = "layer. The provided call will be dispatched using `RawOrigin::Signed`."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `origin`: Must be an [`Origin::EthTransaction`] origin."] + #[doc = "* `call`: The Substrate runtime call to execute."] + #[doc = "* `transaction_encoded`: The RLP encoding of the Ethereum transaction,"] + pub fn eth_substrate_call( + &self, + call: types::eth_substrate_call::Call, + transaction_encoded: types::eth_substrate_call::TransactionEncoded, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "eth_substrate_call", + types::EthSubstrateCall { + call: ::subxt_core::alloc::boxed::Box::new(call), + transaction_encoded, + }, + [ + 88u8, 99u8, 10u8, 165u8, 109u8, 99u8, 79u8, 179u8, 17u8, 183u8, 144u8, + 218u8, 193u8, 191u8, 150u8, 78u8, 146u8, 109u8, 73u8, 6u8, 15u8, 185u8, + 253u8, 5u8, 33u8, 112u8, 177u8, 63u8, 24u8, 137u8, 153u8, 25u8, + ], + ) + } + #[doc = "Upload new `code` without instantiating a contract from it."] + #[doc = ""] + #[doc = "If the code does not already exist a deposit is reserved from the caller"] + #[doc = "The size of the reserve depends on the size of the supplied `code`."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "Anyone can instantiate a contract from any uploaded code and thus prevent its removal."] + #[doc = "To avoid this situation a constructor could employ access control so that it can"] + #[doc = "only be instantiated by permissioned entities. The same is true when uploading"] + #[doc = "through [`Self::instantiate_with_code`]."] + #[doc = ""] + #[doc = "If the refcount of the code reaches zero after terminating the last contract that"] + #[doc = "references this code, the code will be removed automatically."] + pub fn upload_code( + &self, + code: types::upload_code::Code, + storage_deposit_limit: types::upload_code::StorageDepositLimit, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "upload_code", + types::UploadCode { + code, + storage_deposit_limit, + }, + [ + 182u8, 173u8, 213u8, 243u8, 185u8, 24u8, 210u8, 158u8, 192u8, 18u8, + 44u8, 122u8, 122u8, 0u8, 27u8, 135u8, 243u8, 39u8, 92u8, 9u8, 126u8, + 118u8, 142u8, 67u8, 199u8, 193u8, 79u8, 158u8, 5u8, 85u8, 212u8, 197u8, + ], + ) + } + #[doc = "Remove the code stored under `code_hash` and refund the deposit to its owner."] + #[doc = ""] + #[doc = "A code can only be removed by its original uploader (its owner) and only if it is"] + #[doc = "not used by any contract."] + pub fn remove_code( + &self, + code_hash: types::remove_code::CodeHash, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "remove_code", + types::RemoveCode { code_hash }, + [ + 99u8, 184u8, 12u8, 208u8, 123u8, 158u8, 140u8, 21u8, 190u8, 152u8, + 95u8, 79u8, 217u8, 131u8, 161u8, 160u8, 21u8, 56u8, 167u8, 27u8, 90u8, + 255u8, 75u8, 0u8, 133u8, 111u8, 119u8, 217u8, 157u8, 67u8, 238u8, 69u8, + ], + ) + } + #[doc = "Privileged function that changes the code of an existing contract."] + #[doc = ""] + #[doc = "This takes care of updating refcounts and all other necessary operations. Returns"] + #[doc = "an error if either the `code_hash` or `dest` do not exist."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "This does **not** change the address of the contract in question. This means"] + #[doc = "that the contract address is no longer derived from its code hash after calling"] + #[doc = "this dispatchable."] + pub fn set_code( + &self, + dest: types::set_code::Dest, + code_hash: types::set_code::CodeHash, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "set_code", + types::SetCode { dest, code_hash }, + [ + 236u8, 114u8, 172u8, 72u8, 26u8, 62u8, 29u8, 23u8, 174u8, 105u8, 122u8, + 119u8, 190u8, 251u8, 95u8, 246u8, 60u8, 10u8, 114u8, 207u8, 169u8, + 224u8, 216u8, 124u8, 235u8, 100u8, 221u8, 175u8, 244u8, 144u8, 212u8, + 163u8, + ], + ) + } + #[doc = "Register the callers account id so that it can be used in contract interactions."] + #[doc = ""] + #[doc = "This will error if the origin is already mapped or is a eth native `Address20`. It will"] + #[doc = "take a deposit that can be released by calling [`Self::unmap_account`]."] + pub fn map_account( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "map_account", + types::MapAccount {}, + [ + 118u8, 67u8, 192u8, 50u8, 244u8, 150u8, 157u8, 208u8, 4u8, 79u8, 104u8, + 132u8, 202u8, 217u8, 191u8, 44u8, 155u8, 85u8, 142u8, 104u8, 64u8, + 179u8, 88u8, 92u8, 248u8, 74u8, 203u8, 3u8, 223u8, 95u8, 176u8, 193u8, + ], + ) + } + #[doc = "Unregister the callers account id in order to free the deposit."] + #[doc = ""] + #[doc = "There is no reason to ever call this function other than freeing up the deposit."] + #[doc = "This is only useful when the account should no longer be used."] + pub fn unmap_account( + &self, + ) -> ::subxt_core::tx::payload::StaticPayload { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "unmap_account", + types::UnmapAccount {}, + [ + 47u8, 37u8, 220u8, 42u8, 17u8, 57u8, 52u8, 115u8, 159u8, 84u8, 132u8, + 167u8, 96u8, 115u8, 107u8, 158u8, 93u8, 109u8, 227u8, 252u8, 157u8, + 218u8, 40u8, 57u8, 142u8, 23u8, 23u8, 53u8, 219u8, 209u8, 16u8, 137u8, + ], + ) + } + #[doc = "Dispatch an `call` with the origin set to the callers fallback address."] + #[doc = ""] + #[doc = "Every `AccountId32` can control its corresponding fallback account. The fallback account"] + #[doc = "is the `AccountId20` with the last 12 bytes set to `0xEE`. This is essentially a"] + #[doc = "recovery function in case an `AccountId20` was used without creating a mapping first."] + pub fn dispatch_as_fallback_account( + &self, + call: types::dispatch_as_fallback_account::Call, + ) -> ::subxt_core::tx::payload::StaticPayload + { + ::subxt_core::tx::payload::StaticPayload::new_static( + "Revive", + "dispatch_as_fallback_account", + types::DispatchAsFallbackAccount { + call: ::subxt_core::alloc::boxed::Box::new(call), + }, + [ + 65u8, 37u8, 143u8, 233u8, 70u8, 66u8, 49u8, 11u8, 108u8, 89u8, 245u8, + 50u8, 26u8, 201u8, 191u8, 132u8, 104u8, 20u8, 133u8, 153u8, 5u8, 210u8, + 217u8, 20u8, 233u8, 228u8, 37u8, 109u8, 246u8, 148u8, 94u8, 3u8, + ], + ) + } + } + } + #[doc = "The `Event` enum of this pallet"] + pub type Event = runtime_types::pallet_revive::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "A custom event emitted by the contract."] + pub struct ContractEmitted { + pub contract: contract_emitted::Contract, + pub data: contract_emitted::Data, + pub topics: contract_emitted::Topics, + } + pub mod contract_emitted { + use super::runtime_types; + pub type Contract = ::subxt_core::utils::H160; + pub type Data = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Topics = ::subxt_core::alloc::vec::Vec<::subxt_core::utils::H256>; + } + impl ::subxt_core::events::StaticEvent for ContractEmitted { + const PALLET: &'static str = "Revive"; + const EVENT: &'static str = "ContractEmitted"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contract deployed by deployer at the specified address."] + pub struct Instantiated { + pub deployer: instantiated::Deployer, + pub contract: instantiated::Contract, + } + pub mod instantiated { + use super::runtime_types; + pub type Deployer = ::subxt_core::utils::H160; + pub type Contract = ::subxt_core::utils::H160; + } + impl ::subxt_core::events::StaticEvent for Instantiated { + const PALLET: &'static str = "Revive"; + const EVENT: &'static str = "Instantiated"; + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Emitted when an Ethereum transaction reverts."] + #[doc = ""] + #[doc = "Ethereum transactions always complete successfully at the extrinsic level,"] + #[doc = "as even reverted calls must store their `ReceiptInfo`."] + #[doc = "To distinguish reverted calls from successful ones, this event is emitted"] + #[doc = "for failed Ethereum transactions."] + pub struct EthExtrinsicRevert { + pub dispatch_error: eth_extrinsic_revert::DispatchError, + } + pub mod eth_extrinsic_revert { + use super::runtime_types; + pub type DispatchError = runtime_types::sp_runtime::DispatchError; + } + impl ::subxt_core::events::StaticEvent for EthExtrinsicRevert { + const PALLET: &'static str = "Revive"; + const EVENT: &'static str = "EthExtrinsicRevert"; + } + } + pub mod storage { + use super::runtime_types; + pub mod types { + use super::runtime_types; + pub mod pristine_code { + use super::runtime_types; + pub type PristineCode = ::subxt_core::alloc::vec::Vec<::core::primitive::u8>; + pub type Param0 = ::subxt_core::utils::H256; + } + pub mod code_info_of { + use super::runtime_types; + pub type CodeInfoOf = runtime_types::pallet_revive::vm::CodeInfo; + pub type Param0 = ::subxt_core::utils::H256; + } + pub mod account_info_of { + use super::runtime_types; + pub type AccountInfoOf = runtime_types::pallet_revive::storage::AccountInfo; + pub type Param0 = ::subxt_core::utils::H160; + } + pub mod immutable_data_of { + use super::runtime_types; + pub type ImmutableDataOf = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub type Param0 = ::subxt_core::utils::H160; + } + pub mod deletion_queue { + use super::runtime_types; + pub type DeletionQueue = + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; + pub type Param0 = ::core::primitive::u32; + } + pub mod deletion_queue_counter { + use super::runtime_types; + pub type DeletionQueueCounter = + runtime_types::pallet_revive::storage::DeletionQueueManager; + } + pub mod original_account { + use super::runtime_types; + pub type OriginalAccount = ::subxt_core::utils::AccountId32; + pub type Param0 = ::subxt_core::utils::H160; + } + pub mod ethereum_block { + use super::runtime_types; + pub type EthereumBlock = + runtime_types::pallet_revive::evm::api::rpc_types_gen::Block; + } + pub mod block_hash { + use super::runtime_types; + pub type BlockHash = ::subxt_core::utils::H256; + pub type Param0 = ::core::primitive::u32; + } + pub mod receipt_info_data { + use super::runtime_types; + pub type ReceiptInfoData = ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_revive::evm::block_hash::ReceiptGasInfo, + >; + } + pub mod eth_block_builder_ir { + use super::runtime_types; + pub type EthBlockBuilderIr = runtime_types :: pallet_revive :: evm :: block_hash :: block_builder :: EthereumBlockBuilderIR ; + } + pub mod eth_block_builder_first_values { + use super::runtime_types; + pub type EthBlockBuilderFirstValues = ::core::option::Option<( + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + )>; + } + pub mod debug_settings_of { + use super::runtime_types; + pub type DebugSettingsOf = runtime_types::pallet_revive::debug::DebugSettings; + } + } + pub struct StorageApi; + impl StorageApi { + #[doc = " A mapping from a contract's code hash to its code."] + #[doc = " The code's size is bounded by [`crate::limits::BLOB_BYTES`] for PVM and"] + #[doc = " [`revm::primitives::eip170::MAX_CODE_SIZE`] for EVM bytecode."] + pub fn pristine_code_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::pristine_code::PristineCode, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "PristineCode", + (), + [ + 52u8, 32u8, 125u8, 198u8, 11u8, 126u8, 0u8, 12u8, 67u8, 214u8, 56u8, + 84u8, 225u8, 3u8, 79u8, 45u8, 165u8, 20u8, 195u8, 58u8, 40u8, 173u8, + 41u8, 40u8, 82u8, 1u8, 52u8, 34u8, 65u8, 170u8, 48u8, 86u8, + ], + ) + } + #[doc = " A mapping from a contract's code hash to its code."] + #[doc = " The code's size is bounded by [`crate::limits::BLOB_BYTES`] for PVM and"] + #[doc = " [`revm::primitives::eip170::MAX_CODE_SIZE`] for EVM bytecode."] + pub fn pristine_code( + &self, + _0: types::pristine_code::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::pristine_code::PristineCode, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "PristineCode", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 52u8, 32u8, 125u8, 198u8, 11u8, 126u8, 0u8, 12u8, 67u8, 214u8, 56u8, + 84u8, 225u8, 3u8, 79u8, 45u8, 165u8, 20u8, 195u8, 58u8, 40u8, 173u8, + 41u8, 40u8, 82u8, 1u8, 52u8, 34u8, 65u8, 170u8, 48u8, 86u8, + ], + ) + } + #[doc = " A mapping from a contract's code hash to its code info."] + pub fn code_info_of_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::code_info_of::CodeInfoOf, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "CodeInfoOf", + (), + [ + 237u8, 16u8, 208u8, 243u8, 205u8, 219u8, 201u8, 184u8, 108u8, 109u8, + 139u8, 57u8, 4u8, 223u8, 106u8, 173u8, 239u8, 138u8, 41u8, 242u8, + 226u8, 250u8, 36u8, 113u8, 61u8, 144u8, 142u8, 185u8, 4u8, 80u8, 90u8, + 156u8, + ], + ) + } + #[doc = " A mapping from a contract's code hash to its code info."] + pub fn code_info_of( + &self, + _0: types::code_info_of::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::code_info_of::CodeInfoOf, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "CodeInfoOf", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 237u8, 16u8, 208u8, 243u8, 205u8, 219u8, 201u8, 184u8, 108u8, 109u8, + 139u8, 57u8, 4u8, 223u8, 106u8, 173u8, 239u8, 138u8, 41u8, 242u8, + 226u8, 250u8, 36u8, 113u8, 61u8, 144u8, 142u8, 185u8, 4u8, 80u8, 90u8, + 156u8, + ], + ) + } + #[doc = " The data associated to a contract or externally owned account."] + pub fn account_info_of_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::account_info_of::AccountInfoOf, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "AccountInfoOf", + (), + [ + 61u8, 219u8, 72u8, 206u8, 252u8, 27u8, 236u8, 216u8, 193u8, 239u8, + 191u8, 190u8, 187u8, 223u8, 81u8, 149u8, 24u8, 240u8, 88u8, 110u8, 7u8, + 203u8, 53u8, 35u8, 23u8, 34u8, 24u8, 232u8, 152u8, 242u8, 37u8, 174u8, + ], + ) + } + #[doc = " The data associated to a contract or externally owned account."] + pub fn account_info_of( + &self, + _0: types::account_info_of::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::account_info_of::Param0, + >, + types::account_info_of::AccountInfoOf, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "AccountInfoOf", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 61u8, 219u8, 72u8, 206u8, 252u8, 27u8, 236u8, 216u8, 193u8, 239u8, + 191u8, 190u8, 187u8, 223u8, 81u8, 149u8, 24u8, 240u8, 88u8, 110u8, 7u8, + 203u8, 53u8, 35u8, 23u8, 34u8, 24u8, 232u8, 152u8, 242u8, 37u8, 174u8, + ], + ) + } + #[doc = " The immutable data associated with a given account."] + pub fn immutable_data_of_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::immutable_data_of::ImmutableDataOf, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "ImmutableDataOf", + (), + [ + 54u8, 33u8, 11u8, 108u8, 31u8, 14u8, 104u8, 207u8, 207u8, 21u8, 21u8, + 60u8, 165u8, 51u8, 73u8, 121u8, 219u8, 151u8, 211u8, 101u8, 59u8, 42u8, + 34u8, 81u8, 224u8, 184u8, 133u8, 158u8, 30u8, 188u8, 132u8, 134u8, + ], + ) + } + #[doc = " The immutable data associated with a given account."] + pub fn immutable_data_of( + &self, + _0: types::immutable_data_of::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::immutable_data_of::Param0, + >, + types::immutable_data_of::ImmutableDataOf, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "ImmutableDataOf", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 54u8, 33u8, 11u8, 108u8, 31u8, 14u8, 104u8, 207u8, 207u8, 21u8, 21u8, + 60u8, 165u8, 51u8, 73u8, 121u8, 219u8, 151u8, 211u8, 101u8, 59u8, 42u8, + 34u8, 81u8, 224u8, 184u8, 133u8, 158u8, 30u8, 188u8, 132u8, 134u8, + ], + ) + } + #[doc = " Evicted contracts that await child trie deletion."] + #[doc = ""] + #[doc = " Child trie deletion is a heavy operation depending on the amount of storage items"] + #[doc = " stored in said trie. Therefore this operation is performed lazily in `on_idle`."] + pub fn deletion_queue_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::deletion_queue::DeletionQueue, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "DeletionQueue", + (), + [ + 233u8, 193u8, 191u8, 44u8, 151u8, 46u8, 124u8, 188u8, 132u8, 227u8, + 107u8, 210u8, 37u8, 110u8, 172u8, 95u8, 12u8, 114u8, 63u8, 83u8, 60u8, + 163u8, 58u8, 174u8, 160u8, 47u8, 198u8, 156u8, 216u8, 182u8, 65u8, + 229u8, + ], + ) + } + #[doc = " Evicted contracts that await child trie deletion."] + #[doc = ""] + #[doc = " Child trie deletion is a heavy operation depending on the amount of storage items"] + #[doc = " stored in said trie. Therefore this operation is performed lazily in `on_idle`."] + pub fn deletion_queue( + &self, + _0: types::deletion_queue::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::deletion_queue::DeletionQueue, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "DeletionQueue", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 233u8, 193u8, 191u8, 44u8, 151u8, 46u8, 124u8, 188u8, 132u8, 227u8, + 107u8, 210u8, 37u8, 110u8, 172u8, 95u8, 12u8, 114u8, 63u8, 83u8, 60u8, + 163u8, 58u8, 174u8, 160u8, 47u8, 198u8, 156u8, 216u8, 182u8, 65u8, + 229u8, + ], + ) + } + #[doc = " A pair of monotonic counters used to track the latest contract marked for deletion"] + #[doc = " and the latest deleted contract in queue."] + pub fn deletion_queue_counter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::deletion_queue_counter::DeletionQueueCounter, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "DeletionQueueCounter", + (), + [ + 124u8, 63u8, 32u8, 109u8, 8u8, 113u8, 105u8, 172u8, 87u8, 88u8, 244u8, + 191u8, 252u8, 196u8, 10u8, 137u8, 101u8, 87u8, 124u8, 220u8, 178u8, + 155u8, 163u8, 214u8, 116u8, 121u8, 129u8, 129u8, 173u8, 76u8, 188u8, + 41u8, + ], + ) + } + #[doc = " Map a Ethereum address to its original `AccountId32`."] + #[doc = ""] + #[doc = " When deriving a `H160` from an `AccountId32` we use a hash function. In order to"] + #[doc = " reconstruct the original account we need to store the reverse mapping here."] + #[doc = " Register your `AccountId32` using [`Pallet::map_account`] in order to"] + #[doc = " use it with this pallet."] + pub fn original_account_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::original_account::OriginalAccount, + (), + (), + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "OriginalAccount", + (), + [ + 177u8, 223u8, 177u8, 166u8, 174u8, 227u8, 217u8, 9u8, 200u8, 30u8, + 35u8, 79u8, 106u8, 136u8, 115u8, 209u8, 99u8, 202u8, 14u8, 30u8, 133u8, + 233u8, 133u8, 156u8, 108u8, 235u8, 101u8, 0u8, 26u8, 82u8, 14u8, 7u8, + ], + ) + } + #[doc = " Map a Ethereum address to its original `AccountId32`."] + #[doc = ""] + #[doc = " When deriving a `H160` from an `AccountId32` we use a hash function. In order to"] + #[doc = " reconstruct the original account we need to store the reverse mapping here."] + #[doc = " Register your `AccountId32` using [`Pallet::map_account`] in order to"] + #[doc = " use it with this pallet."] + pub fn original_account( + &self, + _0: types::original_account::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey< + types::original_account::Param0, + >, + types::original_account::OriginalAccount, + ::subxt_core::utils::Yes, + (), + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "OriginalAccount", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 177u8, 223u8, 177u8, 166u8, 174u8, 227u8, 217u8, 9u8, 200u8, 30u8, + 35u8, 79u8, 106u8, 136u8, 115u8, 209u8, 99u8, 202u8, 14u8, 30u8, 133u8, + 233u8, 133u8, 156u8, 108u8, 235u8, 101u8, 0u8, 26u8, 82u8, 14u8, 7u8, + ], + ) + } + #[doc = " The current Ethereum block that is stored in the `on_finalize` method."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " This could be further optimized into the future to store only the minimum"] + #[doc = " information needed to reconstruct the Ethereum block at the RPC level."] + #[doc = ""] + #[doc = " Since the block is convenient to have around, and the extra details are capped"] + #[doc = " by a few hashes and the vector of transaction hashes, we store the block here."] + pub fn ethereum_block( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::ethereum_block::EthereumBlock, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "EthereumBlock", + (), + [ + 231u8, 138u8, 1u8, 222u8, 29u8, 130u8, 139u8, 177u8, 176u8, 27u8, 56u8, + 95u8, 120u8, 125u8, 88u8, 97u8, 14u8, 141u8, 29u8, 127u8, 230u8, 51u8, + 14u8, 120u8, 40u8, 38u8, 175u8, 150u8, 108u8, 19u8, 230u8, 41u8, + ], + ) + } + #[doc = " Mapping for block number and hashes."] + #[doc = ""] + #[doc = " The maximum number of elements stored is capped by the block hash count `BLOCK_HASH_COUNT`."] + pub fn block_hash_iter( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::block_hash::BlockHash, + (), + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "BlockHash", + (), + [ + 196u8, 207u8, 47u8, 146u8, 139u8, 135u8, 242u8, 41u8, 59u8, 196u8, + 249u8, 52u8, 10u8, 102u8, 122u8, 212u8, 186u8, 189u8, 235u8, 37u8, + 50u8, 15u8, 55u8, 74u8, 205u8, 116u8, 239u8, 134u8, 207u8, 0u8, 144u8, + 176u8, + ], + ) + } + #[doc = " Mapping for block number and hashes."] + #[doc = ""] + #[doc = " The maximum number of elements stored is capped by the block hash count `BLOCK_HASH_COUNT`."] + pub fn block_hash( + &self, + _0: types::block_hash::Param0, + ) -> ::subxt_core::storage::address::StaticAddress< + ::subxt_core::storage::address::StaticStorageKey, + types::block_hash::BlockHash, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "BlockHash", + ::subxt_core::storage::address::StaticStorageKey::new(_0), + [ + 196u8, 207u8, 47u8, 146u8, 139u8, 135u8, 242u8, 41u8, 59u8, 196u8, + 249u8, 52u8, 10u8, 102u8, 122u8, 212u8, 186u8, 189u8, 235u8, 37u8, + 50u8, 15u8, 55u8, 74u8, 205u8, 116u8, 239u8, 134u8, 207u8, 0u8, 144u8, + 176u8, + ], + ) + } + #[doc = " The details needed to reconstruct the receipt info offchain."] + #[doc = ""] + #[doc = " This contains valuable information about the gas used by the transaction."] + #[doc = ""] + #[doc = " NOTE: The item is unbound and should therefore never be read on chain."] + #[doc = " It could otherwise inflate the PoV size of a block."] + pub fn receipt_info_data( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::receipt_info_data::ReceiptInfoData, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "ReceiptInfoData", + (), + [ + 133u8, 228u8, 217u8, 3u8, 238u8, 71u8, 198u8, 187u8, 219u8, 56u8, 29u8, + 95u8, 229u8, 74u8, 205u8, 135u8, 96u8, 196u8, 109u8, 164u8, 122u8, + 195u8, 51u8, 0u8, 41u8, 47u8, 210u8, 174u8, 173u8, 53u8, 31u8, 6u8, + ], + ) + } + #[doc = " Incremental ethereum block builder."] + pub fn eth_block_builder_ir( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::eth_block_builder_ir::EthBlockBuilderIr, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "EthBlockBuilderIR", + (), + [ + 176u8, 183u8, 47u8, 163u8, 175u8, 235u8, 170u8, 220u8, 4u8, 241u8, + 183u8, 235u8, 78u8, 133u8, 230u8, 196u8, 67u8, 89u8, 89u8, 162u8, + 151u8, 159u8, 187u8, 225u8, 75u8, 11u8, 84u8, 16u8, 43u8, 129u8, 33u8, + 66u8, + ], + ) + } + #[doc = " The first transaction and receipt of the ethereum block."] + #[doc = ""] + #[doc = " These values are moved out of the `EthBlockBuilderIR` to avoid serializing and"] + #[doc = " deserializing them on every transaction. Instead, they are loaded when needed."] + pub fn eth_block_builder_first_values( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::eth_block_builder_first_values::EthBlockBuilderFirstValues, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "EthBlockBuilderFirstValues", + (), + [ + 93u8, 153u8, 20u8, 7u8, 159u8, 33u8, 247u8, 240u8, 7u8, 9u8, 97u8, + 90u8, 105u8, 229u8, 242u8, 102u8, 52u8, 196u8, 161u8, 86u8, 0u8, 229u8, + 113u8, 221u8, 96u8, 235u8, 200u8, 12u8, 120u8, 105u8, 244u8, 210u8, + ], + ) + } + #[doc = " Debugging settings that can be configured when DebugEnabled config is true."] + pub fn debug_settings_of( + &self, + ) -> ::subxt_core::storage::address::StaticAddress< + (), + types::debug_settings_of::DebugSettingsOf, + ::subxt_core::utils::Yes, + ::subxt_core::utils::Yes, + (), + > { + ::subxt_core::storage::address::StaticAddress::new_static( + "Revive", + "DebugSettingsOf", + (), + [ + 182u8, 98u8, 8u8, 132u8, 54u8, 92u8, 124u8, 71u8, 230u8, 246u8, 16u8, + 62u8, 192u8, 49u8, 193u8, 22u8, 174u8, 15u8, 168u8, 60u8, 212u8, 13u8, + 63u8, 19u8, 42u8, 104u8, 140u8, 240u8, 196u8, 61u8, 44u8, 197u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The amount of balance a caller has to pay for each byte of storage."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " It is safe to change this value on a live chain as all refunds are pro rata."] + pub fn deposit_per_byte( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "DepositPerByte", + [ + 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 balance a caller has to pay for each storage item."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " It is safe to change this value on a live chain as all refunds are pro rata."] + pub fn deposit_per_item( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "DepositPerItem", + [ + 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 balance a caller has to pay for each child trie storage item."] + #[doc = ""] + #[doc = " Those are the items created by a contract. In Solidity each value is a single"] + #[doc = " storage item. This is why we need to set a lower value here than for the main"] + #[doc = " trie items. Otherwise the storage deposit is too high."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " It is safe to change this value on a live chain as all refunds are pro rata."] + pub fn deposit_per_child_trie_item( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u128> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "DepositPerChildTrieItem", + [ + 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 percentage of the storage deposit that should be held for using a code hash."] + #[doc = " Instantiating a contract, protects the code from being removed. In order to prevent"] + #[doc = " abuse these actions are protected with a percentage of the code deposit."] + pub fn code_hash_lockup_deposit_percent( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::per_things::Perbill, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "CodeHashLockupDepositPercent", + [ + 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 = " Allow EVM bytecode to be uploaded and instantiated."] + pub fn allow_evm_bytecode( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::bool> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "AllowEVMBytecode", + [ + 165u8, 28u8, 112u8, 190u8, 18u8, 129u8, 182u8, 206u8, 237u8, 1u8, 68u8, + 252u8, 125u8, 234u8, 185u8, 50u8, 149u8, 164u8, 47u8, 126u8, 134u8, + 100u8, 14u8, 86u8, 209u8, 39u8, 20u8, 4u8, 233u8, 115u8, 102u8, 131u8, + ], + ) + } + #[doc = " The [EIP-155](https://eips.ethereum.org/EIPS/eip-155) chain ID."] + #[doc = ""] + #[doc = " This is a unique identifier assigned to each blockchain network,"] + #[doc = " preventing replay attacks."] + pub fn chain_id( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u64> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "ChainId", + [ + 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 = " The ratio between the decimal representation of the native token and the ETH token."] + pub fn native_to_eth_ratio( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "NativeToEthRatio", + [ + 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 fraction the maximum extrinsic weight `eth_transact` extrinsics are capped to."] + #[doc = ""] + #[doc = " This is not a security measure but a requirement due to how we map gas to `(Weight,"] + #[doc = " StorageDeposit)`. The mapping might derive a `Weight` that is too large to fit into an"] + #[doc = " extrinsic. In this case we cap it to the limit specified here."] + #[doc = ""] + #[doc = " `eth_transact` transactions that use more weight than specified will fail with an out of"] + #[doc = " gas error during execution. Larger fractions will allow more transactions to run."] + #[doc = " Smaller values waste less block space: Choose as small as possible and as large as"] + #[doc = " necessary."] + #[doc = ""] + #[doc = " Default: `0.5`."] + pub fn max_eth_extrinsic_weight( + &self, + ) -> ::subxt_core::constants::address::StaticAddress< + runtime_types::sp_arithmetic::fixed_point::FixedU128, + > { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "MaxEthExtrinsicWeight", + [ + 62u8, 145u8, 102u8, 227u8, 159u8, 92u8, 27u8, 54u8, 159u8, 228u8, + 193u8, 99u8, 75u8, 196u8, 26u8, 250u8, 229u8, 230u8, 88u8, 109u8, + 246u8, 100u8, 152u8, 158u8, 14u8, 25u8, 224u8, 173u8, 224u8, 41u8, + 105u8, 231u8, + ], + ) + } + #[doc = " Allows debug-mode configuration, such as enabling unlimited contract size."] + pub fn debug_enabled( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::bool> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "DebugEnabled", + [ + 165u8, 28u8, 112u8, 190u8, 18u8, 129u8, 182u8, 206u8, 237u8, 1u8, 68u8, + 252u8, 125u8, 234u8, 185u8, 50u8, 149u8, 164u8, 47u8, 126u8, 134u8, + 100u8, 14u8, 86u8, 209u8, 39u8, 20u8, 4u8, 233u8, 115u8, 102u8, 131u8, + ], + ) + } + #[doc = " This determines the relative scale of our gas price and gas estimates."] + #[doc = ""] + #[doc = " By default, the gas price (in wei) is `FeeInfo::next_fee_multiplier()` multiplied by"] + #[doc = " `NativeToEthRatio`. `GasScale` allows to scale this value: the actual gas price is the"] + #[doc = " default gas price multiplied by `GasScale`."] + #[doc = ""] + #[doc = " As a consequence, gas cost (gas estimates and actual gas usage during transaction) is"] + #[doc = " scaled down by the same factor. Thus, the total transaction cost is not affected by"] + #[doc = " `GasScale` –\u{a0}apart from rounding differences: the transaction cost is always a multiple"] + #[doc = " of the gas price and is derived by rounded up, so that with higher `GasScales` this can"] + #[doc = " lead to higher gas cost as the rounding difference would be larger."] + #[doc = ""] + #[doc = " The main purpose of changing the `GasScale` is to tune the gas cost so that it is closer"] + #[doc = " to standard EVM gas cost and contracts will not run out of gas when tools or code"] + #[doc = " assume hard coded gas limits."] + #[doc = ""] + #[doc = " Requirement: `GasScale` must not be 0"] + pub fn gas_scale( + &self, + ) -> ::subxt_core::constants::address::StaticAddress<::core::primitive::u32> + { + ::subxt_core::constants::address::StaticAddress::new_static( + "Revive", + "GasScale", + [ + 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 runtime_types { + use super::runtime_types; + pub mod bounded_collections { + use super::runtime_types; + pub mod bounded_btree_set { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BoundedBTreeSet<_0>(pub ::subxt_core::alloc::vec::Vec<_0>); + } + pub mod bounded_vec { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BoundedVec<_0>(pub ::subxt_core::alloc::vec::Vec<_0>); + } + pub mod weak_bounded_vec { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct WeakBoundedVec<_0>(pub ::subxt_core::alloc::vec::Vec<_0>); + } + } + pub mod cumulus_pallet_parachain_system { + use super::runtime_types; + pub mod block_weight { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum BlockWeightMode { + #[codec(index = 0)] + FullCore { context: ::core::primitive::u32 }, + #[codec(index = 1)] + PotentialFullCore { + context: ::core::primitive::u32, + first_transaction_index: ::core::option::Option<::core::primitive::u32>, + target_weight: runtime_types::sp_weights::weight_v2::Weight, + }, + #[codec(index = 2)] + FractionOfCore { + context: ::core::primitive::u32, + first_transaction_index: ::core::option::Option<::core::primitive::u32>, + }, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + # [codec (index = 0)] # [doc = "Set the current validation data."] # [doc = ""] # [doc = "This should be invoked exactly once per block. It will panic at the finalization"] # [doc = "phase if the call was not invoked."] # [doc = ""] # [doc = "The dispatch origin for this call must be `Inherent`"] # [doc = ""] # [doc = "As a side effect, this function upgrades the current validation function"] # [doc = "if the appropriate time has come."] set_validation_data { data : runtime_types :: cumulus_pallet_parachain_system :: parachain_inherent :: BasicParachainInherentData , inbound_messages_data : runtime_types :: cumulus_pallet_parachain_system :: parachain_inherent :: InboundMessagesData , } , # [codec (index = 1)] sudo_send_upward_message { message : :: subxt_core :: alloc :: vec :: Vec < :: core :: primitive :: u8 > , } , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Attempt to upgrade validation function while existing upgrade pending."] + OverlappingUpgrades, + #[codec(index = 1)] + #[doc = "Polkadot currently prohibits this parachain from upgrading its validation function."] + ProhibitedByPolkadot, + #[codec(index = 2)] + #[doc = "The supplied validation function has compiled into a blob larger than Polkadot is"] + #[doc = "willing to run."] + TooBig, + #[codec(index = 3)] + #[doc = "The inherent which supplies the validation data did not run this block."] + ValidationDataNotAvailable, + #[codec(index = 4)] + #[doc = "The inherent which supplies the host configuration did not run this block."] + HostConfigurationNotAvailable, + #[codec(index = 5)] + #[doc = "No validation function upgrade is currently scheduled."] + NotScheduled, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "The validation function has been scheduled to apply."] + ValidationFunctionStored, + #[codec(index = 1)] + #[doc = "The validation function was applied as of the contained relay chain block number."] + ValidationFunctionApplied { + relay_chain_block_num: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "The relay-chain aborted the upgrade process."] + ValidationFunctionDiscarded, + #[codec(index = 3)] + #[doc = "Some downward messages have been received and will be processed."] + DownwardMessagesReceived { count: ::core::primitive::u32 }, + #[codec(index = 4)] + #[doc = "Downward messages were processed using the given weight."] + DownwardMessagesProcessed { + weight_used: runtime_types::sp_weights::weight_v2::Weight, + dmq_head: ::subxt_core::utils::H256, + }, + #[codec(index = 5)] + #[doc = "An upward message was sent to the relay chain."] + UpwardMessageSent { + message_hash: ::core::option::Option<[::core::primitive::u8; 32usize]>, + }, + } + } + pub mod parachain_inherent { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AbridgedInboundMessagesCollection1<_0> { + pub full_messages: ::subxt_core::alloc::vec::Vec<_0>, + pub hashed_messages: ::subxt_core::alloc::vec::Vec< + runtime_types::cumulus_primitives_parachain_inherent::HashedMessage, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AbridgedInboundMessagesCollection2<_0> { + pub full_messages: ::subxt_core::alloc::vec::Vec<_0>, + pub hashed_messages: ::subxt_core::alloc::vec::Vec<( + runtime_types::polkadot_parachain_primitives::primitives::Id, + runtime_types::cumulus_primitives_parachain_inherent::HashedMessage, + )>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BasicParachainInherentData { + pub validation_data: + runtime_types::polkadot_primitives::v9::PersistedValidationData< + ::subxt_core::utils::H256, + ::core::primitive::u32, + >, + pub relay_chain_state: runtime_types::sp_trie::storage_proof::StorageProof, + pub relay_parent_descendants: ::subxt_core::alloc::vec::Vec< + runtime_types::sp_runtime::generic::header::Header<::core::primitive::u32>, + >, + pub collator_peer_id: ::core::option::Option< + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InboundMessageId { + pub sent_at: ::core::primitive::u32, + pub reverse_idx: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InboundMessagesData { pub downward_messages : runtime_types :: cumulus_pallet_parachain_system :: parachain_inherent :: AbridgedInboundMessagesCollection1 < runtime_types :: polkadot_core_primitives :: InboundDownwardMessage < :: core :: primitive :: u32 > > , pub horizontal_messages : runtime_types :: cumulus_pallet_parachain_system :: parachain_inherent :: AbridgedInboundMessagesCollection2 < (runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: polkadot_core_primitives :: InboundHrmpMessage < :: core :: primitive :: u32 > ,) > , } + } + pub mod relay_state_snapshot { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MessagingStateSnapshot { pub dmq_mqc_head : :: subxt_core :: utils :: H256 , pub relay_dispatch_queue_remaining_capacity : runtime_types :: cumulus_pallet_parachain_system :: relay_state_snapshot :: RelayDispatchQueueRemainingCapacity , pub ingress_channels : :: subxt_core :: alloc :: vec :: Vec < (runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: polkadot_primitives :: v9 :: AbridgedHrmpChannel ,) > , pub egress_channels : :: subxt_core :: alloc :: vec :: Vec < (runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: polkadot_primitives :: v9 :: AbridgedHrmpChannel ,) > , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct RelayDispatchQueueRemainingCapacity { + pub remaining_count: ::core::primitive::u32, + pub remaining_size: ::core::primitive::u32, + } + } + pub mod unincluded_segment { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Ancestor < _0 > { pub used_bandwidth : runtime_types :: cumulus_pallet_parachain_system :: unincluded_segment :: UsedBandwidth , pub para_head_hash : :: core :: option :: Option < _0 > , pub consumed_go_ahead_signal : :: core :: option :: Option < runtime_types :: polkadot_primitives :: v9 :: UpgradeGoAhead > , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct HrmpChannelUpdate { + pub msg_count: ::core::primitive::u32, + pub total_bytes: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct SegmentTracker < _0 > { pub used_bandwidth : runtime_types :: cumulus_pallet_parachain_system :: unincluded_segment :: UsedBandwidth , pub hrmp_watermark : :: core :: option :: Option < :: core :: primitive :: u32 > , pub consumed_go_ahead_signal : :: core :: option :: Option < runtime_types :: polkadot_primitives :: v9 :: UpgradeGoAhead > , # [codec (skip)] pub __ignore : :: core :: marker :: PhantomData < _0 > } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct UsedBandwidth { pub ump_msg_count : :: core :: primitive :: u32 , pub ump_total_bytes : :: core :: primitive :: u32 , pub hrmp_outgoing : :: subxt_core :: utils :: KeyedVec < runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: cumulus_pallet_parachain_system :: unincluded_segment :: HrmpChannelUpdate > , } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PoVMessages { + pub relay_storage_root_or_hash: ::subxt_core::utils::H256, + pub core_selector: ::core::primitive::u8, + pub bundle_index: ::core::primitive::u8, + pub ump_msg_count: ::core::primitive::u32, + pub hrmp_outbound_count: ::core::primitive::u32, + } + } + pub mod cumulus_pallet_weight_reclaim { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct StorageWeightReclaim<_1>(pub _1); + } + pub mod cumulus_pallet_xcm { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call {} + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Downward message is invalid XCM."] + #[doc = "\\[ id \\]"] + InvalidFormat([::core::primitive::u8; 32usize]), + #[codec(index = 1)] + #[doc = "Downward message is unsupported version of XCM."] + #[doc = "\\[ id \\]"] + UnsupportedVersion([::core::primitive::u8; 32usize]), + #[codec(index = 2)] + #[doc = "Downward message executed with the given outcome."] + #[doc = "\\[ id, outcome \\]"] + ExecutedDownward( + [::core::primitive::u8; 32usize], + runtime_types::staging_xcm::v5::traits::Outcome, + ), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Origin { + #[codec(index = 0)] + Relay, + #[codec(index = 1)] + SiblingParachain(runtime_types::polkadot_parachain_primitives::primitives::Id), + } + } + } + pub mod cumulus_pallet_xcmp_queue { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 1)] + #[doc = "Suspends all XCM executions for the XCMP queue, regardless of the sender's origin."] + #[doc = ""] + #[doc = "- `origin`: Must pass `ControllerOrigin`."] + suspend_xcm_execution, + #[codec(index = 2)] + #[doc = "Resumes all XCM executions for the XCMP queue."] + #[doc = ""] + #[doc = "Note that this function doesn't change the status of the in/out bound channels."] + #[doc = ""] + #[doc = "- `origin`: Must pass `ControllerOrigin`."] + resume_xcm_execution, + #[codec(index = 3)] + #[doc = "Overwrites the number of pages which must be in the queue for the other side to be"] + #[doc = "told to suspend their sending."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.suspend_value`"] + update_suspend_threshold { new: ::core::primitive::u32 }, + #[codec(index = 4)] + #[doc = "Overwrites the number of pages which must be in the queue after which we drop any"] + #[doc = "further messages from the channel."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.drop_threshold`"] + update_drop_threshold { new: ::core::primitive::u32 }, + #[codec(index = 5)] + #[doc = "Overwrites the number of pages which the queue must be reduced to before it signals"] + #[doc = "that message sending may recommence after it has been suspended."] + #[doc = ""] + #[doc = "- `origin`: Must pass `Root`."] + #[doc = "- `new`: Desired value for `QueueConfigData.resume_threshold`"] + update_resume_threshold { new: ::core::primitive::u32 }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Setting the queue config failed since one of its values was invalid."] + BadQueueConfig, + #[codec(index = 1)] + #[doc = "The execution is already suspended."] + AlreadySuspended, + #[codec(index = 2)] + #[doc = "The execution is already resumed."] + AlreadyResumed, + #[codec(index = 3)] + #[doc = "There are too many active outbound channels."] + TooManyActiveOutboundChannels, + #[codec(index = 4)] + #[doc = "The message is too big."] + TooBig, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "An HRMP message was sent to a sibling parachain."] + XcmpMessageSent { + message_hash: [::core::primitive::u8; 32usize], + }, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OutboundChannelDetails { + pub recipient: runtime_types::polkadot_parachain_primitives::primitives::Id, + pub state: runtime_types::cumulus_pallet_xcmp_queue::OutboundState, + pub signals_exist: ::core::primitive::bool, + pub first_index: ::core::primitive::u16, + pub last_index: ::core::primitive::u16, + pub flags: runtime_types::cumulus_pallet_xcmp_queue::OutboundChannelFlags, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OutboundChannelFlags { + pub bits: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum OutboundState { + #[codec(index = 0)] + Ok, + #[codec(index = 1)] + Suspended, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueueConfigData { + pub suspend_threshold: ::core::primitive::u32, + pub drop_threshold: ::core::primitive::u32, + pub resume_threshold: ::core::primitive::u32, + } + } + pub mod cumulus_primitives_core { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AggregateMessageOrigin { + #[codec(index = 0)] + Here, + #[codec(index = 1)] + Parent, + #[codec(index = 2)] + Sibling(runtime_types::polkadot_parachain_primitives::primitives::Id), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CollationInfo { + pub upward_messages: ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + pub horizontal_messages: ::subxt_core::alloc::vec::Vec< + runtime_types::polkadot_core_primitives::OutboundHrmpMessage< + runtime_types::polkadot_parachain_primitives::primitives::Id, + >, + >, + pub new_validation_code: ::core::option::Option< + runtime_types::polkadot_parachain_primitives::primitives::ValidationCode, + >, + pub processed_downward_messages: ::core::primitive::u32, + pub hrmp_watermark: ::core::primitive::u32, + pub head_data: runtime_types::polkadot_parachain_primitives::primitives::HeadData, + } + } + pub mod cumulus_primitives_parachain_inherent { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct HashedMessage { + pub sent_at: ::core::primitive::u32, + pub msg_hash: ::subxt_core::utils::H256, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MessageQueueChain(pub ::subxt_core::utils::H256); + } + pub mod file_system_primitives { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DriveInfo<_0, _1> { + pub owner: _0, + pub bucket_id: ::core::primitive::u64, + pub created_at: _1, + pub name: ::core::option::Option< + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + pub max_capacity: ::core::primitive::u64, + pub storage_period: _1, + pub expires_at: _1, + } + } + pub mod frame_metadata_hash_extension { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckMetadataHash { + pub mode: runtime_types::frame_metadata_hash_extension::Mode, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Mode { + #[codec(index = 0)] + Disabled, + #[codec(index = 1)] + Enabled, + } + } + pub mod frame_support { + use super::runtime_types; + pub mod dispatch { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum DispatchClass { + #[codec(index = 0)] + Normal, + #[codec(index = 1)] + Operational, + #[codec(index = 2)] + Mandatory, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Pays { + #[codec(index = 0)] + Yes, + #[codec(index = 1)] + No, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PerDispatchClass<_0> { + pub normal: _0, + pub operational: _0, + pub mandatory: _0, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PostDispatchInfo { + pub actual_weight: + ::core::option::Option, + pub pays_fee: runtime_types::frame_support::dispatch::Pays, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum RawOrigin<_0> { + #[codec(index = 0)] + Root, + #[codec(index = 1)] + Signed(_0), + #[codec(index = 2)] + None, + #[codec(index = 3)] + Authorized, + } + } + pub mod traits { + use super::runtime_types; + pub mod messages { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum ProcessMessageError { + #[codec(index = 0)] + BadFormat, + #[codec(index = 1)] + Corrupt, + #[codec(index = 2)] + Unsupported, + #[codec(index = 3)] + Overweight(runtime_types::sp_weights::weight_v2::Weight), + #[codec(index = 4)] + Yield, + #[codec(index = 5)] + StackLimitReached, + } + } + pub mod storage { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct NoDrop<_0>(pub _0); + } + pub mod tokens { + use super::runtime_types; + pub mod fungible { + use super::runtime_types; + pub mod imbalance { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Imbalance<_0> { + pub amount: _0, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct HoldConsideration(pub ::core::primitive::u128); + } + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum BalanceStatus { + #[codec(index = 0)] + Free, + #[codec(index = 1)] + Reserved, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct IdAmount<_0, _1> { + pub id: _0, + pub amount: _1, + } + } + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PalletId(pub [::core::primitive::u8; 8usize]); + } + pub mod frame_system { + use super::runtime_types; + pub mod extensions { + use super::runtime_types; + pub mod check_genesis { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckGenesis; + } + pub mod check_mortality { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckMortality(pub runtime_types::sp_runtime::generic::era::Era); + } + pub mod check_non_zero_sender { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckNonZeroSender; + } + pub mod check_nonce { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); + } + pub mod check_spec_version { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckSpecVersion; + } + pub mod check_tx_version { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckTxVersion; + } + pub mod check_weight { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckWeight; + } + } + pub mod limits { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BlockLength { + pub max: runtime_types::frame_support::dispatch::PerDispatchClass< + ::core::primitive::u32, + >, + pub max_header_size: ::core::option::Option<::core::primitive::u32>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BlockWeights { + pub base_block: runtime_types::sp_weights::weight_v2::Weight, + pub max_block: runtime_types::sp_weights::weight_v2::Weight, + pub per_class: runtime_types::frame_support::dispatch::PerDispatchClass< + runtime_types::frame_system::limits::WeightsPerClass, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct WeightsPerClass { + pub base_extrinsic: runtime_types::sp_weights::weight_v2::Weight, + pub max_extrinsic: + ::core::option::Option, + pub max_total: + ::core::option::Option, + pub reserved: + ::core::option::Option, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "Can be executed by every `origin`."] + remark { + remark: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + set_heap_pages { pages: ::core::primitive::u64 }, + #[codec(index = 2)] + #[doc = "Set the new runtime code."] + set_code { + code: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 3)] + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "Note that runtime upgrades will not run if this is called with a not-increasing spec"] + #[doc = "version!"] + set_code_without_checks { + code: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Set some items of storage."] + set_storage { + items: ::subxt_core::alloc::vec::Vec<( + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + )>, + }, + #[codec(index = 5)] + #[doc = "Kill some items from storage."] + kill_storage { + keys: ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + }, + #[codec(index = 6)] + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + kill_prefix { + prefix: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + subkeys: ::core::primitive::u32, + }, + #[codec(index = 7)] + #[doc = "Make some on-chain remark and emit event."] + remark_with_event { + remark: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 9)] + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "This call requires Root origin."] + authorize_upgrade { + code_hash: ::subxt_core::utils::H256, + }, + #[codec(index = 10)] + #[doc = "Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied"] + #[doc = "later."] + #[doc = ""] + #[doc = "WARNING: This authorizes an upgrade that will take place without any safety checks, for"] + #[doc = "example that the spec name remains the same and that the version number increases. Not"] + #[doc = "recommended for normal use. Use `authorize_upgrade` instead."] + #[doc = ""] + #[doc = "This call requires Root origin."] + authorize_upgrade_without_checks { + code_hash: ::subxt_core::utils::H256, + }, + #[codec(index = 11)] + #[doc = "Provide the preimage (runtime binary) `code` for an upgrade that has been authorized."] + #[doc = ""] + #[doc = "If the authorization required a version check, this call will ensure the spec name"] + #[doc = "remains unchanged and that the spec version has increased."] + #[doc = ""] + #[doc = "Depending on the runtime's `OnSetCode` configuration, this function may directly apply"] + #[doc = "the new `code` in the same block or attempt to schedule the upgrade."] + #[doc = ""] + #[doc = "All origins are allowed."] + apply_authorized_upgrade { + code: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Error for the System pallet"] + pub enum Error { + #[codec(index = 0)] + #[doc = "The name of specification does not match between the current runtime"] + #[doc = "and the new runtime."] + InvalidSpecName, + #[codec(index = 1)] + #[doc = "The specification version is not allowed to decrease between the current runtime"] + #[doc = "and the new runtime."] + SpecVersionNeedsToIncrease, + #[codec(index = 2)] + #[doc = "Failed to extract the runtime version from the new runtime."] + #[doc = ""] + #[doc = "Either calling `Core_version` or decoding `RuntimeVersion` failed."] + FailedToExtractRuntimeVersion, + #[codec(index = 3)] + #[doc = "Suicide called when the account has non-default composite data."] + NonDefaultComposite, + #[codec(index = 4)] + #[doc = "There is a non-zero reference count preventing the account from being purged."] + NonZeroRefCount, + #[codec(index = 5)] + #[doc = "The origin filter prevent the call to be dispatched."] + CallFiltered, + #[codec(index = 6)] + #[doc = "A multi-block migration is ongoing and prevents the current code from being replaced."] + MultiBlockMigrationsOngoing, + #[codec(index = 7)] + #[doc = "No upgrade authorized."] + NothingAuthorized, + #[codec(index = 8)] + #[doc = "The submitted code is not authorized."] + Unauthorized, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Event for the System pallet."] + pub enum Event { + #[codec(index = 0)] + #[doc = "An extrinsic completed successfully."] + ExtrinsicSuccess { + dispatch_info: runtime_types::frame_system::DispatchEventInfo, + }, + #[codec(index = 1)] + #[doc = "An extrinsic failed."] + ExtrinsicFailed { + dispatch_error: runtime_types::sp_runtime::DispatchError, + dispatch_info: runtime_types::frame_system::DispatchEventInfo, + }, + #[codec(index = 2)] + #[doc = "`:code` was updated."] + CodeUpdated, + #[codec(index = 3)] + #[doc = "A new account was created."] + NewAccount { + account: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 4)] + #[doc = "An account was reaped."] + KilledAccount { + account: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 5)] + #[doc = "On on-chain remark happened."] + Remarked { + sender: ::subxt_core::utils::AccountId32, + hash: ::subxt_core::utils::H256, + }, + #[codec(index = 6)] + #[doc = "An upgrade was authorized."] + UpgradeAuthorized { + code_hash: ::subxt_core::utils::H256, + check_version: ::core::primitive::bool, + }, + #[codec(index = 7)] + #[doc = "An invalid authorized upgrade was rejected while trying to apply it."] + RejectedInvalidAuthorizedUpgrade { + code_hash: ::subxt_core::utils::H256, + error: runtime_types::sp_runtime::DispatchError, + }, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AccountInfo<_0, _1> { + pub nonce: _0, + pub consumers: ::core::primitive::u32, + pub providers: ::core::primitive::u32, + pub sufficients: ::core::primitive::u32, + pub data: _1, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CodeUpgradeAuthorization { + pub code_hash: ::subxt_core::utils::H256, + pub check_version: ::core::primitive::bool, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DispatchEventInfo { + pub weight: runtime_types::sp_weights::weight_v2::Weight, + pub class: runtime_types::frame_support::dispatch::DispatchClass, + pub pays_fee: runtime_types::frame_support::dispatch::Pays, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct EventRecord<_0, _1> { + pub phase: runtime_types::frame_system::Phase, + pub event: _0, + pub topics: ::subxt_core::alloc::vec::Vec<_1>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct LastRuntimeUpgradeInfo { + #[codec(compact)] + pub spec_version: ::core::primitive::u32, + pub spec_name: ::subxt_core::alloc::string::String, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Phase { + #[codec(index = 0)] + ApplyExtrinsic(::core::primitive::u32), + #[codec(index = 1)] + Finalization, + #[codec(index = 2)] + Initialization, + } + } + pub mod pallet_balances { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer_allow_death` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + transfer_allow_death { + dest: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Exactly as `transfer_allow_death`, except the origin must be root and the source account"] + #[doc = "may be specified."] + force_transfer { + source: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + dest: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Same as the [`transfer_allow_death`] call, but with a check that the transfer will not"] + #[doc = "kill the origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer_allow_death`] instead."] + #[doc = ""] + #[doc = "[`transfer_allow_death`]: struct.Pallet.html#method.transfer"] + transfer_keep_alive { + dest: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true)."] + transfer_all { + dest: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + keep_alive: ::core::primitive::bool, + }, + #[codec(index = 5)] + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + force_unreserve { + who: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + amount: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "Upgrade a specified account."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `who`: The account to be upgraded."] + #[doc = ""] + #[doc = "This will waive the transaction fee if at least all but 10% of the accounts needed to"] + #[doc = "be upgraded. (We let some not have to be upgraded just in order to allow for the"] + #[doc = "possibility of churn)."] + upgrade_accounts { + who: ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>, + }, + #[codec(index = 8)] + #[doc = "Set the regular balance of a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + force_set_balance { + who: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + #[codec(compact)] + new_free: ::core::primitive::u128, + }, + #[codec(index = 9)] + #[doc = "Adjust the total issuance in a saturating way."] + #[doc = ""] + #[doc = "Can only be called by root and always needs a positive `delta`."] + #[doc = ""] + #[doc = "# Example"] + force_adjust_total_issuance { + direction: runtime_types::pallet_balances::types::AdjustmentDirection, + #[codec(compact)] + delta: ::core::primitive::u128, + }, + #[codec(index = 10)] + #[doc = "Burn the specified liquid free balance from the origin account."] + #[doc = ""] + #[doc = "If the origin's account ends up below the existential deposit as a result"] + #[doc = "of the burn and `keep_alive` is false, the account will be reaped."] + #[doc = ""] + #[doc = "Unlike sending funds to a _burn_ address, which merely makes the funds inaccessible,"] + #[doc = "this `burn` operation will reduce total issuance by the amount _burned_."] + burn { + #[codec(compact)] + value: ::core::primitive::u128, + keep_alive: ::core::primitive::bool, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Vesting balance too high to send value."] + VestingBalance, + #[codec(index = 1)] + #[doc = "Account liquidity restrictions prevent withdrawal."] + LiquidityRestrictions, + #[codec(index = 2)] + #[doc = "Balance too low to send value."] + InsufficientBalance, + #[codec(index = 3)] + #[doc = "Value too low to create account due to existential deposit."] + ExistentialDeposit, + #[codec(index = 4)] + #[doc = "Transfer/payment would kill account."] + Expendability, + #[codec(index = 5)] + #[doc = "A vesting schedule already exists for this account."] + ExistingVestingSchedule, + #[codec(index = 6)] + #[doc = "Beneficiary account must pre-exist."] + DeadAccount, + #[codec(index = 7)] + #[doc = "Number of named reserves exceed `MaxReserves`."] + TooManyReserves, + #[codec(index = 8)] + #[doc = "Number of holds exceed `VariantCountOf`."] + TooManyHolds, + #[codec(index = 9)] + #[doc = "Number of freezes exceed `MaxFreezes`."] + TooManyFreezes, + #[codec(index = 10)] + #[doc = "The issuance cannot be modified since it is already deactivated."] + IssuanceDeactivated, + #[codec(index = 11)] + #[doc = "The delta cannot be zero."] + DeltaZero, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "An account was created with some free balance."] + Endowed { + account: ::subxt_core::utils::AccountId32, + free_balance: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] + #[doc = "resulting in an outright loss."] + DustLost { + account: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Transfer succeeded."] + Transfer { + from: ::subxt_core::utils::AccountId32, + to: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "A balance was set by root."] + BalanceSet { + who: ::subxt_core::utils::AccountId32, + free: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Some balance was reserved (moved from free to reserved)."] + Reserved { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "Some balance was unreserved (moved from reserved to free)."] + Unreserved { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "Some balance was moved from the reserve of the first account to the second account."] + #[doc = "Final argument indicates the destination balance type."] + ReserveRepatriated { + from: ::subxt_core::utils::AccountId32, + to: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + destination_status: + runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + }, + #[codec(index = 7)] + #[doc = "Some amount was deposited (e.g. for transaction fees)."] + Deposit { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 8)] + #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] + Withdraw { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 9)] + #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] + Slashed { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 10)] + #[doc = "Some amount was minted into an account."] + Minted { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 11)] + #[doc = "Some credit was balanced and added to the TotalIssuance."] + MintedCredit { amount: ::core::primitive::u128 }, + #[codec(index = 12)] + #[doc = "Some amount was burned from an account."] + Burned { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 13)] + #[doc = "Some debt has been dropped from the Total Issuance."] + BurnedDebt { amount: ::core::primitive::u128 }, + #[codec(index = 14)] + #[doc = "Some amount was suspended from an account (it can be restored later)."] + Suspended { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 15)] + #[doc = "Some amount was restored into an account."] + Restored { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 16)] + #[doc = "An account was upgraded."] + Upgraded { + who: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 17)] + #[doc = "Total issuance was increased by `amount`, creating a credit to be balanced."] + Issued { amount: ::core::primitive::u128 }, + #[codec(index = 18)] + #[doc = "Total issuance was decreased by `amount`, creating a debt to be balanced."] + Rescinded { amount: ::core::primitive::u128 }, + #[codec(index = 19)] + #[doc = "Some balance was locked."] + Locked { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 20)] + #[doc = "Some balance was unlocked."] + Unlocked { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 21)] + #[doc = "Some balance was frozen."] + Frozen { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 22)] + #[doc = "Some balance was thawed."] + Thawed { + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 23)] + #[doc = "The `TotalIssuance` was forcefully changed."] + TotalIssuanceForced { + old: ::core::primitive::u128, + new: ::core::primitive::u128, + }, + #[codec(index = 24)] + #[doc = "Some balance was placed on hold."] + Held { + reason: runtime_types::storage_paseo_runtime::RuntimeHoldReason, + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 25)] + #[doc = "Held balance was burned from an account."] + BurnedHeld { + reason: runtime_types::storage_paseo_runtime::RuntimeHoldReason, + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 26)] + #[doc = "A transfer of `amount` on hold from `source` to `dest` was initiated."] + TransferOnHold { + reason: runtime_types::storage_paseo_runtime::RuntimeHoldReason, + source: ::subxt_core::utils::AccountId32, + dest: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 27)] + #[doc = "The `transferred` balance is placed on hold at the `dest` account."] + TransferAndHold { + reason: runtime_types::storage_paseo_runtime::RuntimeHoldReason, + source: ::subxt_core::utils::AccountId32, + dest: ::subxt_core::utils::AccountId32, + transferred: ::core::primitive::u128, + }, + #[codec(index = 28)] + #[doc = "Some balance was released from hold."] + Released { + reason: runtime_types::storage_paseo_runtime::RuntimeHoldReason, + who: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 29)] + #[doc = "An unexpected/defensive event was triggered."] + Unexpected(runtime_types::pallet_balances::pallet::UnexpectedKind), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum UnexpectedKind { + #[codec(index = 0)] + BalanceUpdated, + #[codec(index = 1)] + FailedToMutateAccount, + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AccountData<_0> { + pub free: _0, + pub reserved: _0, + pub frozen: _0, + pub flags: runtime_types::pallet_balances::types::ExtraFlags, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AdjustmentDirection { + #[codec(index = 0)] + Increase, + #[codec(index = 1)] + Decrease, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BalanceLock<_0> { + pub id: [::core::primitive::u8; 8usize], + pub amount: _0, + pub reasons: runtime_types::pallet_balances::types::Reasons, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ExtraFlags(pub ::core::primitive::u128); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Reasons { + #[codec(index = 0)] + Fee, + #[codec(index = 1)] + Misc, + #[codec(index = 2)] + All, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ReserveData<_0, _1> { + pub id: _0, + pub amount: _1, + } + } + } + pub mod pallet_collator_selection { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Set the list of invulnerable (fixed) collators. These collators must do some"] + #[doc = "preparation, namely to have registered session keys."] + #[doc = ""] + #[doc = "The call will remove any accounts that have not registered keys from the set. That is,"] + #[doc = "it is non-atomic; the caller accepts all `AccountId`s passed in `new` _individually_ as"] + #[doc = "acceptable Invulnerables, and is not proposing a _set_ of new Invulnerables."] + #[doc = ""] + #[doc = "This call does not maintain mutual exclusivity of `Invulnerables` and `Candidates`. It"] + #[doc = "is recommended to use a batch of `add_invulnerable` and `remove_invulnerable` instead. A"] + #[doc = "`batch_all` can also be used to enforce atomicity. If any candidates are included in"] + #[doc = "`new`, they should be removed with `remove_invulnerable_candidate` after execution."] + #[doc = ""] + #[doc = "Must be called by the `UpdateOrigin`."] + set_invulnerables { + new: ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>, + }, + #[codec(index = 1)] + #[doc = "Set the ideal number of non-invulnerable collators. If lowering this number, then the"] + #[doc = "number of running collators could be higher than this figure. Aside from that edge case,"] + #[doc = "there should be no other way to have more candidates than the desired number."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + set_desired_candidates { max: ::core::primitive::u32 }, + #[codec(index = 2)] + #[doc = "Set the candidacy bond amount."] + #[doc = ""] + #[doc = "If the candidacy bond is increased by this call, all current candidates which have a"] + #[doc = "deposit lower than the new bond will be kicked from the list and get their deposits"] + #[doc = "back."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + set_candidacy_bond { bond: ::core::primitive::u128 }, + #[codec(index = 3)] + #[doc = "Register this account as a collator candidate. The account must (a) already have"] + #[doc = "registered session keys and (b) be able to reserve the `CandidacyBond`."] + #[doc = ""] + #[doc = "This call is not available to `Invulnerable` collators."] + register_as_candidate, + #[codec(index = 4)] + #[doc = "Deregister `origin` as a collator candidate. Note that the collator can only leave on"] + #[doc = "session change. The `CandidacyBond` will be unreserved immediately."] + #[doc = ""] + #[doc = "This call will fail if the total number of candidates would drop below"] + #[doc = "`MinEligibleCollators`."] + leave_intent, + #[codec(index = 5)] + #[doc = "Add a new account `who` to the list of `Invulnerables` collators. `who` must have"] + #[doc = "registered session keys. If `who` is a candidate, they will be removed."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + add_invulnerable { + who: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 6)] + #[doc = "Remove an account `who` from the list of `Invulnerables` collators. `Invulnerables` must"] + #[doc = "be sorted."] + #[doc = ""] + #[doc = "The origin for this call must be the `UpdateOrigin`."] + remove_invulnerable { + who: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 7)] + #[doc = "Update the candidacy bond of collator candidate `origin` to a new amount `new_deposit`."] + #[doc = ""] + #[doc = "Setting a `new_deposit` that is lower than the current deposit while `origin` is"] + #[doc = "occupying a top-`DesiredCandidates` slot is not allowed."] + #[doc = ""] + #[doc = "This call will fail if `origin` is not a collator candidate, the updated bond is lower"] + #[doc = "than the minimum candidacy bond, and/or the amount cannot be reserved."] + update_bond { + new_deposit: ::core::primitive::u128, + }, + #[codec(index = 8)] + #[doc = "The caller `origin` replaces a candidate `target` in the collator candidate list by"] + #[doc = "reserving `deposit`. The amount `deposit` reserved by the caller must be greater than"] + #[doc = "the existing bond of the target it is trying to replace."] + #[doc = ""] + #[doc = "This call will fail if the caller is already a collator candidate or invulnerable, the"] + #[doc = "caller does not have registered session keys, the target is not a collator candidate,"] + #[doc = "and/or the `deposit` amount cannot be reserved."] + take_candidate_slot { + deposit: ::core::primitive::u128, + target: ::subxt_core::utils::AccountId32, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CandidateInfo<_0, _1> { + pub who: _0, + pub deposit: _1, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "The pallet has too many candidates."] + TooManyCandidates, + #[codec(index = 1)] + #[doc = "Leaving would result in too few candidates."] + TooFewEligibleCollators, + #[codec(index = 2)] + #[doc = "Account is already a candidate."] + AlreadyCandidate, + #[codec(index = 3)] + #[doc = "Account is not a candidate."] + NotCandidate, + #[codec(index = 4)] + #[doc = "There are too many Invulnerables."] + TooManyInvulnerables, + #[codec(index = 5)] + #[doc = "Account is already an Invulnerable."] + AlreadyInvulnerable, + #[codec(index = 6)] + #[doc = "Account is not an Invulnerable."] + NotInvulnerable, + #[codec(index = 7)] + #[doc = "Account has no associated validator ID."] + NoAssociatedValidatorId, + #[codec(index = 8)] + #[doc = "Validator ID is not yet registered."] + ValidatorNotRegistered, + #[codec(index = 9)] + #[doc = "Could not insert in the candidate list."] + InsertToCandidateListFailed, + #[codec(index = 10)] + #[doc = "Could not remove from the candidate list."] + RemoveFromCandidateListFailed, + #[codec(index = 11)] + #[doc = "New deposit amount would be below the minimum candidacy bond."] + DepositTooLow, + #[codec(index = 12)] + #[doc = "Could not update the candidate list."] + UpdateCandidateListFailed, + #[codec(index = 13)] + #[doc = "Deposit amount is too low to take the target's slot in the candidate list."] + InsufficientBond, + #[codec(index = 14)] + #[doc = "The target account to be replaced in the candidate list is not a candidate."] + TargetIsNotCandidate, + #[codec(index = 15)] + #[doc = "The updated deposit amount is equal to the amount already reserved."] + IdenticalDeposit, + #[codec(index = 16)] + #[doc = "Cannot lower candidacy bond while occupying a future collator slot in the list."] + InvalidUnreserve, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "New Invulnerables were set."] + NewInvulnerables { + invulnerables: + ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>, + }, + #[codec(index = 1)] + #[doc = "A new Invulnerable was added."] + InvulnerableAdded { + account_id: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 2)] + #[doc = "An Invulnerable was removed."] + InvulnerableRemoved { + account_id: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 3)] + #[doc = "The number of desired candidates was set."] + NewDesiredCandidates { + desired_candidates: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "The candidacy bond was set."] + NewCandidacyBond { + bond_amount: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "A new candidate joined."] + CandidateAdded { + account_id: ::subxt_core::utils::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "Bond of a candidate updated."] + CandidateBondUpdated { + account_id: ::subxt_core::utils::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 7)] + #[doc = "A candidate was removed."] + CandidateRemoved { + account_id: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 8)] + #[doc = "An account was replaced in the candidate list by another one."] + CandidateReplaced { + old: ::subxt_core::utils::AccountId32, + new: ::subxt_core::utils::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 9)] + #[doc = "An account was unable to be added to the Invulnerables because they did not have keys"] + #[doc = "registered. Other Invulnerables may have been set."] + InvalidInvulnerableSkipped { + account_id: ::subxt_core::utils::AccountId32, + }, + } + } + } + pub mod pallet_drive_registry { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Create a new drive with automatic bucket creation"] + #[doc = ""] + #[doc = "Atomically opens the Layer 0 bucket + primary storage agreement"] + #[doc = "(via `establish_storage_agreement_internal`) and records the"] + #[doc = "drive metadata on top. The caller obtains `terms` and `sig`"] + #[doc = "off-chain from the provider; Layer 0 enforces signature, replay"] + #[doc = "window, and capacity/stake/duration/price checks — those errors"] + #[doc = "surface directly so the caller can react to them."] + #[doc = ""] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `name`: Optional human-readable name for the drive"] + #[doc = "- `provider`: Provider account that signed the terms."] + #[doc = "- `terms`: Provider-signed agreement terms."] + #[doc = "- `sig`: Provider signature over the SCALE-encoded terms."] + create_drive { + name: ::core::option::Option< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + provider: ::subxt_core::utils::AccountId32, + terms: runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + sig: runtime_types::sp_runtime::MultiSignature, + }, + #[codec(index = 2)] + #[doc = "Delete a drive completely"] + #[doc = ""] + #[doc = "Ends all storage agreements with prorated refunds, pays providers for"] + #[doc = "time served, removes the bucket from Layer 0, and removes the drive."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to delete"] + delete_drive { drive_id: ::core::primitive::u64 }, + #[codec(index = 3)] + #[doc = "Share a drive with another account by adding them as a member of"] + #[doc = "the underlying Layer 0 bucket."] + #[doc = ""] + #[doc = "The caller must be the drive owner or an Admin of the underlying bucket."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to share"] + #[doc = "- `member`: Account to add"] + #[doc = "- `role`: Role to assign (Admin, Writer, or Reader)"] + share_drive { + drive_id: ::core::primitive::u64, + member: ::subxt_core::utils::AccountId32, + role: runtime_types::storage_primitives::Role, + }, + #[codec(index = 4)] + #[doc = "Remove a member's access to a shared drive."] + #[doc = ""] + #[doc = "The caller must be the drive owner or an Admin of the underlying bucket."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `drive_id`: The drive to unshare"] + #[doc = "- `member`: Account to remove"] + unshare_drive { + drive_id: ::core::primitive::u64, + member: ::subxt_core::utils::AccountId32, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Errors"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Drive does not exist"] + DriveNotFound, + #[codec(index = 1)] + #[doc = "Not the owner of the drive"] + NotDriveOwner, + #[codec(index = 2)] + #[doc = "Maximum number of drives per user exceeded"] + TooManyDrives, + #[codec(index = 3)] + #[doc = "Drive name too long"] + DriveNameTooLong, + #[codec(index = 4)] + #[doc = "Drive ID overflow"] + DriveIdOverflow, + #[codec(index = 5)] + #[doc = "Failed to cleanup bucket in Layer 0"] + BucketCleanupFailed, + #[codec(index = 6)] + #[doc = "Not authorized to share this drive (must be owner or bucket admin)"] + NotAuthorizedToShare, + #[codec(index = 7)] + #[doc = "Failed to update bucket membership in Layer 0"] + MembershipUpdateFailed, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Events"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new drive was created"] + DriveCreated { + drive_id: ::core::primitive::u64, + owner: ::subxt_core::utils::AccountId32, + bucket_id: ::core::primitive::u64, + }, + #[codec(index = 1)] + #[doc = "Drive was deleted"] + DriveDeleted { + drive_id: ::core::primitive::u64, + owner: ::subxt_core::utils::AccountId32, + bucket_id: ::core::primitive::u64, + refunded: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Drive was shared with a member"] + DriveShared { + drive_id: ::core::primitive::u64, + member: ::subxt_core::utils::AccountId32, + role: runtime_types::storage_primitives::Role, + }, + #[codec(index = 3)] + #[doc = "Member was removed from a shared drive"] + DriveUnshared { + drive_id: ::core::primitive::u64, + member: ::subxt_core::utils::AccountId32, + }, + } + } + } + pub mod pallet_message_queue { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Remove a page which has no more messages remaining to be processed or is stale."] + reap_page { + message_origin: + runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + page_index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "Execute an overweight message."] + #[doc = ""] + #[doc = "Temporary processing errors will be propagated whereas permanent errors are treated"] + #[doc = "as success condition."] + #[doc = ""] + #[doc = "- `origin`: Must be `Signed`."] + #[doc = "- `message_origin`: The origin from which the message to be executed arrived."] + #[doc = "- `page`: The page in the queue in which the message to be executed is sitting."] + #[doc = "- `index`: The index into the queue of the message to be executed."] + #[doc = "- `weight_limit`: The maximum amount of weight allowed to be consumed in the execution"] + #[doc = " of the message."] + #[doc = ""] + #[doc = "Benchmark complexity considerations: O(index + weight_limit)."] + execute_overweight { + message_origin: + runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + page: ::core::primitive::u32, + index: ::core::primitive::u32, + weight_limit: runtime_types::sp_weights::weight_v2::Weight, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Page is not reapable because it has items remaining to be processed and is not old"] + #[doc = "enough."] + NotReapable, + #[codec(index = 1)] + #[doc = "Page to be reaped does not exist."] + NoPage, + #[codec(index = 2)] + #[doc = "The referenced message could not be found."] + NoMessage, + #[codec(index = 3)] + #[doc = "The message was already processed and cannot be processed again."] + AlreadyProcessed, + #[codec(index = 4)] + #[doc = "The message is queued for future execution."] + Queued, + #[codec(index = 5)] + #[doc = "There is temporarily not enough weight to continue servicing messages."] + InsufficientWeight, + #[codec(index = 6)] + #[doc = "This message is temporarily unprocessable."] + #[doc = ""] + #[doc = "Such errors are expected, but not guaranteed, to resolve themselves eventually through"] + #[doc = "retrying."] + TemporarilyUnprocessable, + #[codec(index = 7)] + #[doc = "The queue is paused and no message can be executed from it."] + #[doc = ""] + #[doc = "This can change at any time and may resolve in the future by re-trying."] + QueuePaused, + #[codec(index = 8)] + #[doc = "Another call is in progress and needs to finish before this call can happen."] + RecursiveDisallowed, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Message discarded due to an error in the `MessageProcessor` (usually a format error)."] + ProcessingFailed { + id: ::subxt_core::utils::H256, + origin: runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + error: runtime_types::frame_support::traits::messages::ProcessMessageError, + }, + #[codec(index = 1)] + #[doc = "Message is processed."] + Processed { + id: ::subxt_core::utils::H256, + origin: runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + weight_used: runtime_types::sp_weights::weight_v2::Weight, + success: ::core::primitive::bool, + }, + #[codec(index = 2)] + #[doc = "Message placed in overweight queue."] + OverweightEnqueued { + id: [::core::primitive::u8; 32usize], + origin: runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + page_index: ::core::primitive::u32, + message_index: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "This page was reaped."] + PageReaped { + origin: runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + index: ::core::primitive::u32, + }, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BookState<_0> { + pub begin: ::core::primitive::u32, + pub end: ::core::primitive::u32, + pub count: ::core::primitive::u32, + pub ready_neighbours: + ::core::option::Option>, + pub message_count: ::core::primitive::u64, + pub size: ::core::primitive::u64, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Neighbours<_0> { + pub prev: _0, + pub next: _0, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Page<_0> { + pub remaining: _0, + pub remaining_size: _0, + pub first_index: _0, + pub first: _0, + pub last: _0, + pub heap: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + } + pub mod pallet_revive { + use super::runtime_types; + pub mod debug { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DebugSettings { + pub allow_unlimited_contract_size: ::core::primitive::bool, + pub bypass_eip_3607: ::core::primitive::bool, + pub pvm_logs: ::core::primitive::bool, + pub disable_execution_tracing: ::core::primitive::bool, + } + } + pub mod evm { + use super::runtime_types; + pub mod api { + use super::runtime_types; + pub mod byte { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Byte(pub ::core::primitive::u8); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Bytes(pub ::subxt_core::alloc::vec::Vec<::core::primitive::u8>); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Bytes256(pub [::core::primitive::u8; 256usize]); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Bytes8(pub [::core::primitive::u8; 8usize]); + } + pub mod debug_rpc_types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CallLog { + pub address: ::subxt_core::utils::H160, + pub topics: ::subxt_core::alloc::vec::Vec<::subxt_core::utils::H256>, + pub data: runtime_types::pallet_revive::evm::api::byte::Bytes, + pub position: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CallTrace { + pub from: ::subxt_core::utils::H160, + pub gas: ::core::primitive::u64, + pub gas_used: ::core::primitive::u64, + pub to: ::subxt_core::utils::H160, + pub input: runtime_types::pallet_revive::evm::api::byte::Bytes, + pub output: runtime_types::pallet_revive::evm::api::byte::Bytes, + pub error: ::core::option::Option<::subxt_core::alloc::string::String>, + pub revert_reason: + ::core::option::Option<::subxt_core::alloc::string::String>, + pub calls: ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_revive::evm::api::debug_rpc_types::CallTrace, + >, + pub logs: ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_revive::evm::api::debug_rpc_types::CallLog, + >, + pub value: ::core::option::Option, + pub call_type: + runtime_types::pallet_revive::evm::api::debug_rpc_types::CallType, + pub child_call_count: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CallTracerConfig { + pub with_logs: ::core::primitive::bool, + pub only_top_call: ::core::primitive::bool, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum CallType { + #[codec(index = 0)] + Call, + #[codec(index = 1)] + StaticCall, + #[codec(index = 2)] + DelegateCall, + #[codec(index = 3)] + Create, + #[codec(index = 4)] + Create2, + #[codec(index = 5)] + Selfdestruct, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ExecutionStep { # [codec (compact)] pub gas : :: core :: primitive :: u64 , # [codec (compact)] pub gas_cost : :: core :: primitive :: u64 , pub weight_cost : runtime_types :: sp_weights :: weight_v2 :: Weight , pub depth : :: core :: primitive :: u16 , pub return_data : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes , pub error : :: core :: option :: Option < :: subxt_core :: alloc :: string :: String > , pub kind : runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: ExecutionStepKind , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum ExecutionStepKind { + #[codec(index = 0)] + EVMOpcode { + #[codec(compact)] + pc: ::core::primitive::u32, + op: ::core::primitive::u8, + stack: ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_revive::evm::api::byte::Bytes, + >, + memory: ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_revive::evm::api::byte::Bytes, + >, + storage: ::core::option::Option< + ::subxt_core::utils::KeyedVec< + runtime_types::pallet_revive::evm::api::byte::Bytes, + runtime_types::pallet_revive::evm::api::byte::Bytes, + >, + >, + }, + #[codec(index = 1)] + PVMSyscall { + op: ::core::primitive::u8, + args: ::subxt_core::alloc::vec::Vec<::core::primitive::u64>, + returned: ::core::option::Option<::core::primitive::u64>, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ExecutionTrace { pub gas : :: core :: primitive :: u64 , pub weight_consumed : runtime_types :: sp_weights :: weight_v2 :: Weight , pub base_call_weight : runtime_types :: sp_weights :: weight_v2 :: Weight , pub failed : :: core :: primitive :: bool , pub return_value : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes , pub struct_logs : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: ExecutionStep > , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ExecutionTracerConfig { + pub enable_memory: ::core::primitive::bool, + pub disable_stack: ::core::primitive::bool, + pub disable_storage: ::core::primitive::bool, + pub enable_return_data: ::core::primitive::bool, + pub disable_syscall_details: ::core::primitive::bool, + pub limit: ::core::option::Option<::core::primitive::u64>, + pub memory_word_limit: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum PrestateTrace { + # [codec (index = 0)] Prestate (:: subxt_core :: utils :: KeyedVec < :: subxt_core :: utils :: H160 , runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: PrestateTraceInfo > ,) , # [codec (index = 1)] DiffMode { pre : :: subxt_core :: utils :: KeyedVec < :: subxt_core :: utils :: H160 , runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: PrestateTraceInfo > , post : :: subxt_core :: utils :: KeyedVec < :: subxt_core :: utils :: H160 , runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: PrestateTraceInfo > , } , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PrestateTraceInfo { + pub balance: + ::core::option::Option, + pub nonce: ::core::option::Option<::core::primitive::u32>, + pub code: ::core::option::Option< + runtime_types::pallet_revive::evm::api::byte::Bytes, + >, + pub storage: ::subxt_core::utils::KeyedVec< + runtime_types::pallet_revive::evm::api::byte::Bytes, + ::core::option::Option< + runtime_types::pallet_revive::evm::api::byte::Bytes, + >, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PrestateTracerConfig { + pub diff_mode: ::core::primitive::bool, + pub disable_storage: ::core::primitive::bool, + pub disable_code: ::core::primitive::bool, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Trace { + # [codec (index = 0)] Call (runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: CallTrace ,) , # [codec (index = 1)] Prestate (runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: PrestateTrace ,) , # [codec (index = 2)] Execution (runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: ExecutionTrace ,) , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum TracerType { + # [codec (index = 0)] CallTracer (:: core :: option :: Option < runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: CallTracerConfig > ,) , # [codec (index = 1)] PrestateTracer (:: core :: option :: Option < runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: PrestateTracerConfig > ,) , # [codec (index = 2)] ExecutionTracer (:: core :: option :: Option < runtime_types :: pallet_revive :: evm :: api :: debug_rpc_types :: ExecutionTracerConfig > ,) , } + } + pub mod rpc_types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DryRunConfig<_0> { + pub timestamp_override: ::core::option::Option<_0>, + pub reserved: ::core::option::Option<()>, + } + } + pub mod rpc_types_gen { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AccessListEntry { + pub address: ::subxt_core::utils::H160, + pub storage_keys: + ::subxt_core::alloc::vec::Vec<::subxt_core::utils::H256>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AuthorizationListEntry { + pub chain_id: runtime_types::primitive_types::U256, + pub address: ::subxt_core::utils::H160, + pub nonce: runtime_types::primitive_types::U256, + pub y_parity: runtime_types::primitive_types::U256, + pub r: runtime_types::primitive_types::U256, + pub s: runtime_types::primitive_types::U256, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Block { pub base_fee_per_gas : runtime_types :: primitive_types :: U256 , pub blob_gas_used : runtime_types :: primitive_types :: U256 , pub difficulty : runtime_types :: primitive_types :: U256 , pub excess_blob_gas : runtime_types :: primitive_types :: U256 , pub extra_data : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes , pub gas_limit : runtime_types :: primitive_types :: U256 , pub gas_used : runtime_types :: primitive_types :: U256 , pub hash : :: subxt_core :: utils :: H256 , pub logs_bloom : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes256 , pub miner : :: subxt_core :: utils :: H160 , pub mix_hash : :: subxt_core :: utils :: H256 , pub nonce : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes8 , pub number : runtime_types :: primitive_types :: U256 , pub parent_beacon_block_root : :: core :: option :: Option < :: subxt_core :: utils :: H256 > , pub parent_hash : :: subxt_core :: utils :: H256 , pub receipts_root : :: subxt_core :: utils :: H256 , pub requests_hash : :: core :: option :: Option < :: subxt_core :: utils :: H256 > , pub sha_3_uncles : :: subxt_core :: utils :: H256 , pub size : runtime_types :: primitive_types :: U256 , pub state_root : :: subxt_core :: utils :: H256 , pub timestamp : runtime_types :: primitive_types :: U256 , pub total_difficulty : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub transactions : runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: HashesOrTransactionInfos , pub transactions_root : :: subxt_core :: utils :: H256 , pub uncles : :: subxt_core :: alloc :: vec :: Vec < :: subxt_core :: utils :: H256 > , pub withdrawals : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Withdrawal > , pub withdrawals_root : :: subxt_core :: utils :: H256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct GenericTransaction { pub access_list : :: core :: option :: Option < :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: AccessListEntry > > , pub authorization_list : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: AuthorizationListEntry > , pub blob_versioned_hashes : :: subxt_core :: alloc :: vec :: Vec < :: subxt_core :: utils :: H256 > , pub blobs : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes > , pub chain_id : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub from : :: core :: option :: Option < :: subxt_core :: utils :: H160 > , pub gas : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub gas_price : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub input : runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: InputOrData , pub max_fee_per_blob_gas : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub max_fee_per_gas : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub max_priority_fee_per_gas : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub nonce : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub to : :: core :: option :: Option < :: subxt_core :: utils :: H160 > , pub r#type : :: core :: option :: Option < runtime_types :: pallet_revive :: evm :: api :: byte :: Byte > , pub value : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum HashesOrTransactionInfos { + # [codec (index = 0)] Hashes (:: subxt_core :: alloc :: vec :: Vec < :: subxt_core :: utils :: H256 > ,) , # [codec (index = 1)] TransactionInfos (:: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: TransactionInfo > ,) , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InputOrData { + pub input: ::core::option::Option< + runtime_types::pallet_revive::evm::api::byte::Bytes, + >, + pub data: ::core::option::Option< + runtime_types::pallet_revive::evm::api::byte::Bytes, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Transaction1559Signed { pub transaction_1559_unsigned : runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Transaction1559Unsigned , pub r : runtime_types :: primitive_types :: U256 , pub s : runtime_types :: primitive_types :: U256 , pub v : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub y_parity : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Transaction1559Unsigned { pub access_list : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: AccessListEntry > , pub chain_id : runtime_types :: primitive_types :: U256 , pub gas : runtime_types :: primitive_types :: U256 , pub gas_price : runtime_types :: primitive_types :: U256 , pub input : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes , pub max_fee_per_gas : runtime_types :: primitive_types :: U256 , pub max_priority_fee_per_gas : runtime_types :: primitive_types :: U256 , pub nonce : runtime_types :: primitive_types :: U256 , pub to : :: core :: option :: Option < :: subxt_core :: utils :: H160 > , pub r#type : :: core :: primitive :: u8 , pub value : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Transaction2930Signed { pub transaction_2930_unsigned : runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Transaction2930Unsigned , pub r : runtime_types :: primitive_types :: U256 , pub s : runtime_types :: primitive_types :: U256 , pub v : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub y_parity : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Transaction2930Unsigned { pub access_list : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: AccessListEntry > , pub chain_id : runtime_types :: primitive_types :: U256 , pub gas : runtime_types :: primitive_types :: U256 , pub gas_price : runtime_types :: primitive_types :: U256 , pub input : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes , pub nonce : runtime_types :: primitive_types :: U256 , pub to : :: core :: option :: Option < :: subxt_core :: utils :: H160 > , pub r#type : :: core :: primitive :: u8 , pub value : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Transaction4844Signed { pub transaction_4844_unsigned : runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Transaction4844Unsigned , pub r : runtime_types :: primitive_types :: U256 , pub s : runtime_types :: primitive_types :: U256 , pub y_parity : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Transaction4844Unsigned { pub access_list : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: AccessListEntry > , pub blob_versioned_hashes : :: subxt_core :: alloc :: vec :: Vec < :: subxt_core :: utils :: H256 > , pub chain_id : runtime_types :: primitive_types :: U256 , pub gas : runtime_types :: primitive_types :: U256 , pub input : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes , pub max_fee_per_blob_gas : runtime_types :: primitive_types :: U256 , pub max_fee_per_gas : runtime_types :: primitive_types :: U256 , pub max_priority_fee_per_gas : runtime_types :: primitive_types :: U256 , pub nonce : runtime_types :: primitive_types :: U256 , pub to : :: subxt_core :: utils :: H160 , pub r#type : :: core :: primitive :: u8 , pub value : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Transaction7702Signed { pub transaction_7702_unsigned : runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Transaction7702Unsigned , pub r : runtime_types :: primitive_types :: U256 , pub s : runtime_types :: primitive_types :: U256 , pub v : :: core :: option :: Option < runtime_types :: primitive_types :: U256 > , pub y_parity : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Transaction7702Unsigned { pub access_list : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: AccessListEntry > , pub authorization_list : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: AuthorizationListEntry > , pub chain_id : runtime_types :: primitive_types :: U256 , pub gas : runtime_types :: primitive_types :: U256 , pub input : runtime_types :: pallet_revive :: evm :: api :: byte :: Bytes , pub max_fee_per_gas : runtime_types :: primitive_types :: U256 , pub max_priority_fee_per_gas : runtime_types :: primitive_types :: U256 , pub nonce : runtime_types :: primitive_types :: U256 , pub to : :: subxt_core :: utils :: H160 , pub r#type : :: core :: primitive :: u8 , pub value : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct TransactionInfo { pub block_hash : :: subxt_core :: utils :: H256 , pub block_number : runtime_types :: primitive_types :: U256 , pub from : :: subxt_core :: utils :: H160 , pub hash : :: subxt_core :: utils :: H256 , pub transaction_index : runtime_types :: primitive_types :: U256 , pub transaction_signed : runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: TransactionSigned , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct TransactionLegacySigned { pub transaction_legacy_unsigned : runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: TransactionLegacyUnsigned , pub r : runtime_types :: primitive_types :: U256 , pub s : runtime_types :: primitive_types :: U256 , pub v : runtime_types :: primitive_types :: U256 , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct TransactionLegacyUnsigned { + pub chain_id: + ::core::option::Option, + pub gas: runtime_types::primitive_types::U256, + pub gas_price: runtime_types::primitive_types::U256, + pub input: runtime_types::pallet_revive::evm::api::byte::Bytes, + pub nonce: runtime_types::primitive_types::U256, + pub to: ::core::option::Option<::subxt_core::utils::H160>, + pub r#type: ::core::primitive::u8, + pub value: runtime_types::primitive_types::U256, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum TransactionSigned { + # [codec (index = 0)] Transaction7702Signed (runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Transaction7702Signed ,) , # [codec (index = 1)] Transaction4844Signed (runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Transaction4844Signed ,) , # [codec (index = 2)] Transaction1559Signed (runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Transaction1559Signed ,) , # [codec (index = 3)] Transaction2930Signed (runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: Transaction2930Signed ,) , # [codec (index = 4)] TransactionLegacySigned (runtime_types :: pallet_revive :: evm :: api :: rpc_types_gen :: TransactionLegacySigned ,) , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Withdrawal { + pub address: ::subxt_core::utils::H160, + pub amount: runtime_types::primitive_types::U256, + pub index: runtime_types::primitive_types::U256, + pub validator_index: runtime_types::primitive_types::U256, + } + } + } + pub mod block_hash { + use super::runtime_types; + pub mod block_builder { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct EthereumBlockBuilderIR { pub transaction_root_builder : runtime_types :: pallet_revive :: evm :: block_hash :: hash_builder :: IncrementalHashBuilderIR , pub receipts_root_builder : runtime_types :: pallet_revive :: evm :: block_hash :: hash_builder :: IncrementalHashBuilderIR , pub base_fee_per_gas : runtime_types :: primitive_types :: U256 , pub block_gas_limit : runtime_types :: primitive_types :: U256 , pub gas_used : runtime_types :: primitive_types :: U256 , pub logs_bloom : [:: core :: primitive :: u8 ; 256usize] , pub tx_hashes : :: subxt_core :: alloc :: vec :: Vec < :: subxt_core :: utils :: H256 > , pub gas_info : :: subxt_core :: alloc :: vec :: Vec < runtime_types :: pallet_revive :: evm :: block_hash :: ReceiptGasInfo > , } + } + pub mod hash_builder { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct IncrementalHashBuilderIR { + pub key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub value_type: ::core::primitive::u8, + pub builder_value: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub stack: ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + pub state_masks: ::subxt_core::alloc::vec::Vec<::core::primitive::u16>, + pub tree_masks: ::subxt_core::alloc::vec::Vec<::core::primitive::u16>, + pub hash_masks: ::subxt_core::alloc::vec::Vec<::core::primitive::u16>, + pub stored_in_database: ::core::primitive::bool, + pub rlp_buf: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub index: ::core::primitive::u64, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ReceiptGasInfo { + pub gas_used: runtime_types::primitive_types::U256, + pub effective_gas_price: runtime_types::primitive_types::U256, + } + } + pub mod tx_extension { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct SetOrigin; + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "A raw EVM transaction, typically dispatched by an Ethereum JSON-RPC server."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `payload`: The encoded [`crate::evm::TransactionSigned`]."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "This call cannot be dispatched directly; attempting to do so will result in a failed"] + #[doc = "transaction. It serves as a wrapper for an Ethereum transaction. When submitted, the"] + #[doc = "runtime converts it into a [`sp_runtime::generic::CheckedExtrinsic`] by recovering the"] + #[doc = "signer and validating the transaction."] + eth_transact { + payload: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Makes a call to an account, optionally transferring some balance."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `dest`: Address of the contract to call."] + #[doc = "* `value`: The balance to transfer from the `origin` to `dest`."] + #[doc = "* `weight_limit`: The weight limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged from the"] + #[doc = " caller to pay for the storage consumed."] + #[doc = "* `data`: The input data to pass to the contract."] + #[doc = ""] + #[doc = "* If the account is a smart-contract account, the associated code will be"] + #[doc = "executed and any value will be transferred."] + #[doc = "* If the account is a regular account, any value will be transferred."] + #[doc = "* If no account exists and the call value is not less than `existential_deposit`,"] + #[doc = "a regular account will be created and any value will be transferred."] + call { + dest: ::subxt_core::utils::H160, + #[codec(compact)] + value: ::core::primitive::u128, + weight_limit: runtime_types::sp_weights::weight_v2::Weight, + #[codec(compact)] + storage_deposit_limit: ::core::primitive::u128, + data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 2)] + #[doc = "Instantiates a contract from a previously deployed vm binary."] + #[doc = ""] + #[doc = "This function is identical to [`Self::instantiate_with_code`] but without the"] + #[doc = "code deployment step. Instead, the `code_hash` of an on-chain deployed vm binary"] + #[doc = "must be supplied."] + instantiate { + #[codec(compact)] + value: ::core::primitive::u128, + weight_limit: runtime_types::sp_weights::weight_v2::Weight, + #[codec(compact)] + storage_deposit_limit: ::core::primitive::u128, + code_hash: ::subxt_core::utils::H256, + data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + salt: ::core::option::Option<[::core::primitive::u8; 32usize]>, + }, + #[codec(index = 3)] + #[doc = "Instantiates a new contract from the supplied `code` optionally transferring"] + #[doc = "some balance."] + #[doc = ""] + #[doc = "This dispatchable has the same effect as calling [`Self::upload_code`] +"] + #[doc = "[`Self::instantiate`]. Bundling them together provides efficiency gains. Please"] + #[doc = "also check the documentation of [`Self::upload_code`]."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The weight limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged/reserved"] + #[doc = " from the caller to pay for the storage consumed."] + #[doc = "* `code`: The contract code to deploy in raw bytes."] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `salt`: Used for the address derivation. If `Some` is supplied then `CREATE2`"] + #[doc = "\tsemantics are used. If `None` then `CRATE1` is used."] + #[doc = ""] + #[doc = ""] + #[doc = "Instantiation is executed as follows:"] + #[doc = ""] + #[doc = "- The supplied `code` is deployed, and a `code_hash` is created for that code."] + #[doc = "- If the `code_hash` already exists on the chain the underlying `code` will be shared."] + #[doc = "- The destination address is computed based on the sender, code_hash and the salt."] + #[doc = "- The smart-contract account is created at the computed address."] + #[doc = "- The `value` is transferred to the new account."] + #[doc = "- The `deploy` function is executed in the context of the newly-created account."] + instantiate_with_code { + #[codec(compact)] + value: ::core::primitive::u128, + weight_limit: runtime_types::sp_weights::weight_v2::Weight, + #[codec(compact)] + storage_deposit_limit: ::core::primitive::u128, + code: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + salt: ::core::option::Option<[::core::primitive::u8; 32usize]>, + }, + #[codec(index = 10)] + #[doc = "Same as [`Self::instantiate_with_code`], but intended to be dispatched **only**"] + #[doc = "by an EVM transaction through the EVM compatibility layer."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The gas limit used to derive the transaction weight for transaction"] + #[doc = " payment"] + #[doc = "* `eth_gas_limit`: The Ethereum gas limit governing the resource usage of the execution"] + #[doc = "* `code`: The contract code to deploy in raw bytes."] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `transaction_encoded`: The RLP encoding of the signed Ethereum transaction,"] + #[doc = " represented as [crate::evm::TransactionSigned], provided by the Ethereum wallet. This"] + #[doc = " is used for building the Ethereum transaction root."] + #[doc = "* effective_gas_price: the price of a unit of gas"] + #[doc = "* encoded len: the byte code size of the `eth_transact` extrinsic"] + #[doc = ""] + #[doc = "Calling this dispatchable ensures that the origin's nonce is bumped only once,"] + #[doc = "via the `CheckNonce` transaction extension. In contrast, [`Self::instantiate_with_code`]"] + #[doc = "also bumps the nonce after contract instantiation, since it may be invoked multiple"] + #[doc = "times within a batch call transaction."] + eth_instantiate_with_code { + value: runtime_types::primitive_types::U256, + weight_limit: runtime_types::sp_weights::weight_v2::Weight, + eth_gas_limit: runtime_types::primitive_types::U256, + code: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + transaction_encoded: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + effective_gas_price: runtime_types::primitive_types::U256, + encoded_len: ::core::primitive::u32, + }, + #[codec(index = 11)] + #[doc = "Same as [`Self::call`], but intended to be dispatched **only**"] + #[doc = "by an EVM transaction through the EVM compatibility layer."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `dest`: The Ethereum address of the account to be called"] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `weight_limit`: The gas limit used to derive the transaction weight for transaction"] + #[doc = " payment"] + #[doc = "* `eth_gas_limit`: The Ethereum gas limit governing the resource usage of the execution"] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `transaction_encoded`: The RLP encoding of the signed Ethereum transaction,"] + #[doc = " represented as [crate::evm::TransactionSigned], provided by the Ethereum wallet. This"] + #[doc = " is used for building the Ethereum transaction root."] + #[doc = "* effective_gas_price: the price of a unit of gas"] + #[doc = "* encoded len: the byte code size of the `eth_transact` extrinsic"] + eth_call { + dest: ::subxt_core::utils::H160, + value: runtime_types::primitive_types::U256, + weight_limit: runtime_types::sp_weights::weight_v2::Weight, + eth_gas_limit: runtime_types::primitive_types::U256, + data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + transaction_encoded: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + effective_gas_price: runtime_types::primitive_types::U256, + encoded_len: ::core::primitive::u32, + }, + #[codec(index = 12)] + #[doc = "Executes a Substrate runtime call from an Ethereum transaction."] + #[doc = ""] + #[doc = "This dispatchable is intended to be called **only** through the EVM compatibility"] + #[doc = "layer. The provided call will be dispatched using `RawOrigin::Signed`."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `origin`: Must be an [`Origin::EthTransaction`] origin."] + #[doc = "* `call`: The Substrate runtime call to execute."] + #[doc = "* `transaction_encoded`: The RLP encoding of the Ethereum transaction,"] + eth_substrate_call { + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + transaction_encoded: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Upload new `code` without instantiating a contract from it."] + #[doc = ""] + #[doc = "If the code does not already exist a deposit is reserved from the caller"] + #[doc = "The size of the reserve depends on the size of the supplied `code`."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "Anyone can instantiate a contract from any uploaded code and thus prevent its removal."] + #[doc = "To avoid this situation a constructor could employ access control so that it can"] + #[doc = "only be instantiated by permissioned entities. The same is true when uploading"] + #[doc = "through [`Self::instantiate_with_code`]."] + #[doc = ""] + #[doc = "If the refcount of the code reaches zero after terminating the last contract that"] + #[doc = "references this code, the code will be removed automatically."] + upload_code { + code: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + #[codec(compact)] + storage_deposit_limit: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "Remove the code stored under `code_hash` and refund the deposit to its owner."] + #[doc = ""] + #[doc = "A code can only be removed by its original uploader (its owner) and only if it is"] + #[doc = "not used by any contract."] + remove_code { + code_hash: ::subxt_core::utils::H256, + }, + #[codec(index = 6)] + #[doc = "Privileged function that changes the code of an existing contract."] + #[doc = ""] + #[doc = "This takes care of updating refcounts and all other necessary operations. Returns"] + #[doc = "an error if either the `code_hash` or `dest` do not exist."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "This does **not** change the address of the contract in question. This means"] + #[doc = "that the contract address is no longer derived from its code hash after calling"] + #[doc = "this dispatchable."] + set_code { + dest: ::subxt_core::utils::H160, + code_hash: ::subxt_core::utils::H256, + }, + #[codec(index = 7)] + #[doc = "Register the callers account id so that it can be used in contract interactions."] + #[doc = ""] + #[doc = "This will error if the origin is already mapped or is a eth native `Address20`. It will"] + #[doc = "take a deposit that can be released by calling [`Self::unmap_account`]."] + map_account, + #[codec(index = 8)] + #[doc = "Unregister the callers account id in order to free the deposit."] + #[doc = ""] + #[doc = "There is no reason to ever call this function other than freeing up the deposit."] + #[doc = "This is only useful when the account should no longer be used."] + unmap_account, + #[codec(index = 9)] + #[doc = "Dispatch an `call` with the origin set to the callers fallback address."] + #[doc = ""] + #[doc = "Every `AccountId32` can control its corresponding fallback account. The fallback account"] + #[doc = "is the `AccountId20` with the last 12 bytes set to `0xEE`. This is essentially a"] + #[doc = "recovery function in case an `AccountId20` was used without creating a mapping first."] + dispatch_as_fallback_account { + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 1)] + #[doc = "Invalid schedule supplied, e.g. with zero weight of a basic operation."] + InvalidSchedule, + #[codec(index = 2)] + #[doc = "Invalid combination of flags supplied to `seal_call` or `seal_delegate_call`."] + InvalidCallFlags, + #[codec(index = 3)] + #[doc = "The executed contract exhausted its gas limit."] + OutOfGas, + #[codec(index = 4)] + #[doc = "Performing the requested transfer failed. Probably because there isn't enough"] + #[doc = "free balance in the sender's account."] + TransferFailed, + #[codec(index = 5)] + #[doc = "Performing a call was denied because the calling depth reached the limit"] + #[doc = "of what is specified in the schedule."] + MaxCallDepthReached, + #[codec(index = 6)] + #[doc = "No contract was found at the specified address."] + ContractNotFound, + #[codec(index = 7)] + #[doc = "No code could be found at the supplied code hash."] + CodeNotFound, + #[codec(index = 8)] + #[doc = "No code info could be found at the supplied code hash."] + CodeInfoNotFound, + #[codec(index = 9)] + #[doc = "A buffer outside of sandbox memory was passed to a contract API function."] + OutOfBounds, + #[codec(index = 10)] + #[doc = "Input passed to a contract API function failed to decode as expected type."] + DecodingFailed, + #[codec(index = 11)] + #[doc = "Contract trapped during execution."] + ContractTrapped, + #[codec(index = 12)] + #[doc = "Event body or storage item exceeds [`limits::STORAGE_BYTES`]."] + ValueTooLarge, + #[codec(index = 13)] + #[doc = "Termination of a contract is not allowed while the contract is already"] + #[doc = "on the call stack. Can be triggered by `seal_terminate`."] + TerminatedWhileReentrant, + #[codec(index = 14)] + #[doc = "`seal_call` forwarded this contracts input. It therefore is no longer available."] + InputForwarded, + #[codec(index = 15)] + #[doc = "The amount of topics passed to `seal_deposit_events` exceeds the limit."] + TooManyTopics, + #[codec(index = 18)] + #[doc = "A contract with the same AccountId already exists."] + DuplicateContract, + #[codec(index = 19)] + #[doc = "A contract self destructed in its constructor."] + #[doc = ""] + #[doc = "This can be triggered by a call to `seal_terminate`."] + TerminatedInConstructor, + #[codec(index = 20)] + #[doc = "A call tried to invoke a contract that is flagged as non-reentrant."] + ReentranceDenied, + #[codec(index = 21)] + #[doc = "A contract called into the runtime which then called back into this pallet."] + ReenteredPallet, + #[codec(index = 22)] + #[doc = "A contract attempted to invoke a state modifying API while being in read-only mode."] + StateChangeDenied, + #[codec(index = 23)] + #[doc = "Origin doesn't have enough balance to pay the required storage deposits."] + StorageDepositNotEnoughFunds, + #[codec(index = 24)] + #[doc = "More storage was created than allowed by the storage deposit limit."] + StorageDepositLimitExhausted, + #[codec(index = 25)] + #[doc = "Code removal was denied because the code is still in use by at least one contract."] + CodeInUse, + #[codec(index = 26)] + #[doc = "The contract ran to completion but decided to revert its storage changes."] + #[doc = "Please note that this error is only returned from extrinsics. When called directly"] + #[doc = "or via RPC an `Ok` will be returned. In this case the caller needs to inspect the flags"] + #[doc = "to determine whether a reversion has taken place."] + ContractReverted, + #[codec(index = 27)] + #[doc = "The contract failed to compile or is missing the correct entry points."] + #[doc = ""] + #[doc = "A more detailed error can be found on the node console if debug messages are enabled"] + #[doc = "by supplying `-lruntime::revive=debug`."] + CodeRejected, + #[codec(index = 28)] + #[doc = "The code blob supplied is larger than [`limits::code::BLOB_BYTES`]."] + BlobTooLarge, + #[codec(index = 29)] + #[doc = "The contract declares too much memory (ro + rw + stack)."] + StaticMemoryTooLarge, + #[codec(index = 30)] + #[doc = "The program contains a basic block that is larger than allowed."] + BasicBlockTooLarge, + #[codec(index = 31)] + #[doc = "The program contains an invalid instruction."] + InvalidInstruction, + #[codec(index = 32)] + #[doc = "The contract has reached its maximum number of delegate dependencies."] + MaxDelegateDependenciesReached, + #[codec(index = 33)] + #[doc = "The dependency was not found in the contract's delegate dependencies."] + DelegateDependencyNotFound, + #[codec(index = 34)] + #[doc = "The contract already depends on the given delegate dependency."] + DelegateDependencyAlreadyExists, + #[codec(index = 35)] + #[doc = "Can not add a delegate dependency to the code hash of the contract itself."] + CannotAddSelfAsDelegateDependency, + #[codec(index = 36)] + #[doc = "Can not add more data to transient storage."] + OutOfTransientStorage, + #[codec(index = 37)] + #[doc = "The contract tried to call a syscall which does not exist (at its current api level)."] + InvalidSyscall, + #[codec(index = 38)] + #[doc = "Invalid storage flags were passed to one of the storage syscalls."] + InvalidStorageFlags, + #[codec(index = 39)] + #[doc = "PolkaVM failed during code execution. Probably due to a malformed program."] + ExecutionFailed, + #[codec(index = 40)] + #[doc = "Failed to convert a U256 to a Balance."] + BalanceConversionFailed, + #[codec(index = 42)] + #[doc = "Immutable data can only be set during deploys and only be read during calls."] + #[doc = "Additionally, it is only valid to set the data once and it must not be empty."] + InvalidImmutableAccess, + #[codec(index = 43)] + #[doc = "An `AccountID32` account tried to interact with the pallet without having a mapping."] + #[doc = ""] + #[doc = "Call [`Pallet::map_account`] in order to create a mapping for the account."] + AccountUnmapped, + #[codec(index = 44)] + #[doc = "Tried to map an account that is already mapped."] + AccountAlreadyMapped, + #[codec(index = 45)] + #[doc = "The transaction used to dry-run a contract is invalid."] + InvalidGenericTransaction, + #[codec(index = 46)] + #[doc = "The refcount of a code either over or underflowed."] + RefcountOverOrUnderflow, + #[codec(index = 47)] + #[doc = "Unsupported precompile address."] + UnsupportedPrecompileAddress, + #[codec(index = 48)] + #[doc = "The calldata exceeds [`limits::CALLDATA_BYTES`]."] + CallDataTooLarge, + #[codec(index = 49)] + #[doc = "The return data exceeds [`limits::CALLDATA_BYTES`]."] + ReturnDataTooLarge, + #[codec(index = 50)] + #[doc = "Invalid jump destination. Dynamic jumps points to invalid not jumpdest opcode."] + InvalidJump, + #[codec(index = 51)] + #[doc = "Attempting to pop a value from an empty stack."] + StackUnderflow, + #[codec(index = 52)] + #[doc = "Attempting to push a value onto a full stack."] + StackOverflow, + #[codec(index = 53)] + #[doc = "Too much deposit was drawn from the shared txfee and deposit credit."] + #[doc = ""] + #[doc = "This happens if the passed `gas` inside the ethereum transaction is too low."] + TxFeeOverdraw, + #[codec(index = 54)] + #[doc = "When calling an EVM constructor `data` has to be empty."] + #[doc = ""] + #[doc = "EVM constructors do not accept data. Their input data is part of the code blob itself."] + EvmConstructorNonEmptyData, + #[codec(index = 55)] + #[doc = "Tried to construct an EVM contract via code hash."] + #[doc = ""] + #[doc = "EVM contracts can only be instantiated via code upload as no initcode is"] + #[doc = "stored on-chain."] + EvmConstructedFromHash, + #[codec(index = 56)] + #[doc = "The contract does not have enough balance to refund the storage deposit."] + #[doc = ""] + #[doc = "This is a bug and should never happen. It means the accounting got out of sync."] + StorageRefundNotEnoughFunds, + #[codec(index = 57)] + #[doc = "This means there are locks on the contracts storage deposit that prevents refunding it."] + #[doc = ""] + #[doc = "This would be the case if the contract used its storage deposits for governance"] + #[doc = "or other pallets that allow creating locks over held balance."] + StorageRefundLocked, + #[codec(index = 64)] + #[doc = "Called a pre-compile that is not allowed to be delegate called."] + #[doc = ""] + #[doc = "Some pre-compile functions will trap the caller context if being delegate"] + #[doc = "called or if their caller was being delegate called."] + PrecompileDelegateDenied, + #[codec(index = 65)] + #[doc = "ECDSA public key recovery failed. Most probably wrong recovery id or signature."] + EcdsaRecoveryFailed, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A custom event emitted by the contract."] + ContractEmitted { + contract: ::subxt_core::utils::H160, + data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + topics: ::subxt_core::alloc::vec::Vec<::subxt_core::utils::H256>, + }, + #[codec(index = 1)] + #[doc = "Contract deployed by deployer at the specified address."] + Instantiated { + deployer: ::subxt_core::utils::H160, + contract: ::subxt_core::utils::H160, + }, + #[codec(index = 2)] + #[doc = "Emitted when an Ethereum transaction reverts."] + #[doc = ""] + #[doc = "Ethereum transactions always complete successfully at the extrinsic level,"] + #[doc = "as even reverted calls must store their `ReceiptInfo`."] + #[doc = "To distinguish reverted calls from successful ones, this event is emitted"] + #[doc = "for failed Ethereum transactions."] + EthExtrinsicRevert { + dispatch_error: runtime_types::sp_runtime::DispatchError, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum HoldReason { + #[codec(index = 0)] + CodeUploadDepositReserve, + #[codec(index = 1)] + StorageDepositReserve, + #[codec(index = 2)] + AddressMapping, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Origin<_0> { + #[codec(index = 0)] + EthTransaction(::subxt_core::utils::AccountId32), + __Ignore(::core::marker::PhantomData<_0>), + } + } + pub mod primitives { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum BalanceConversionError { + #[codec(index = 0)] + Value, + #[codec(index = 1)] + Dust, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Code { + #[codec(index = 0)] + Upload(::subxt_core::alloc::vec::Vec<::core::primitive::u8>), + #[codec(index = 1)] + Existing(::subxt_core::utils::H256), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CodeUploadReturnValue<_0> { + pub code_hash: ::subxt_core::utils::H256, + pub deposit: _0, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum ContractAccessError { + #[codec(index = 0)] + DoesntExist, + #[codec(index = 1)] + KeyDecodingFailed, + #[codec(index = 2)] + StorageWriteFailed(runtime_types::sp_runtime::DispatchError), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ContractResult<_0, _1> { + pub weight_consumed: runtime_types::sp_weights::weight_v2::Weight, + pub weight_required: runtime_types::sp_weights::weight_v2::Weight, + pub storage_deposit: + runtime_types::pallet_revive::primitives::StorageDeposit<_1>, + pub max_storage_deposit: + runtime_types::pallet_revive::primitives::StorageDeposit<_1>, + pub gas_consumed: _1, + pub result: + ::core::result::Result<_0, runtime_types::sp_runtime::DispatchError>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum EthTransactError { + #[codec(index = 0)] + Data(::subxt_core::alloc::vec::Vec<::core::primitive::u8>), + #[codec(index = 1)] + Message(::subxt_core::alloc::string::String), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct EthTransactInfo<_0> { + pub weight_required: runtime_types::sp_weights::weight_v2::Weight, + pub storage_deposit: _0, + pub max_storage_deposit: _0, + pub eth_gas: runtime_types::primitive_types::U256, + pub data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ExecReturnValue { + pub flags: runtime_types::pallet_revive_uapi::flags::ReturnFlags, + pub data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InstantiateReturnValue { + pub result: runtime_types::pallet_revive::primitives::ExecReturnValue, + pub addr: ::subxt_core::utils::H160, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum StorageDeposit<_0> { + #[codec(index = 0)] + Refund(_0), + #[codec(index = 1)] + Charge(_0), + } + } + pub mod storage { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AccountInfo { + pub account_type: runtime_types::pallet_revive::storage::AccountType, + pub dust: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AccountType { + #[codec(index = 0)] + Contract(runtime_types::pallet_revive::storage::ContractInfo), + #[codec(index = 1)] + EOA, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ContractInfo { + pub trie_id: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub code_hash: ::subxt_core::utils::H256, + pub storage_bytes: ::core::primitive::u32, + pub storage_items: ::core::primitive::u32, + pub storage_byte_deposit: ::core::primitive::u128, + pub storage_item_deposit: ::core::primitive::u128, + pub storage_base_deposit: ::core::primitive::u128, + pub immutable_data_len: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DeletionQueueManager { + pub insert_counter: ::core::primitive::u32, + pub delete_counter: ::core::primitive::u32, + } + } + pub mod vm { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum BytecodeType { + #[codec(index = 0)] + Pvm, + #[codec(index = 1)] + Evm, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CodeInfo { + pub owner: ::subxt_core::utils::AccountId32, + #[codec(compact)] + pub deposit: ::core::primitive::u128, + #[codec(compact)] + pub refcount: ::core::primitive::u64, + pub code_len: ::core::primitive::u32, + pub code_type: runtime_types::pallet_revive::vm::BytecodeType, + pub behaviour_version: ::core::primitive::u32, + } + } + } + pub mod pallet_revive_uapi { + use super::runtime_types; + pub mod flags { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ReturnFlags { + pub bits: ::core::primitive::u32, + } + } + } + pub mod pallet_s3_registry { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Create a new S3 bucket."] + #[doc = ""] + #[doc = "This automatically creates an underlying Layer 0 bucket and links it"] + #[doc = "to the S3 bucket. The caller becomes the owner of both buckets."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `name`: S3 bucket name (3-63 chars, lowercase alphanumeric + hyphens)"] + #[doc = "- `provider`: Explicit provider account that signed the terms."] + #[doc = "- `terms`: Provider-signed agreement terms."] + #[doc = "- `sig`: Provider signature over the SCALE-encoded terms."] + create_s3_bucket { + name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + provider: ::subxt_core::utils::AccountId32, + terms: runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + sig: runtime_types::sp_runtime::MultiSignature, + }, + #[codec(index = 1)] + #[doc = "Delete an S3 bucket."] + #[doc = ""] + #[doc = "The bucket must be empty and caller must be the owner."] + delete_s3_bucket { + s3_bucket_id: ::core::primitive::u64, + }, + #[codec(index = 2)] + #[doc = "Store or update object metadata."] + put_object_metadata { + s3_bucket_id: ::core::primitive::u64, + key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + cid: ::subxt_core::utils::H256, + size: ::core::primitive::u64, + content_type: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + user_metadata: ::subxt_core::alloc::vec::Vec<( + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + )>, + }, + #[codec(index = 3)] + #[doc = "Delete object metadata."] + delete_object_metadata { + s3_bucket_id: ::core::primitive::u64, + key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Copy object metadata from one location to another."] + copy_object_metadata { + src_bucket_id: ::core::primitive::u64, + src_key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + dst_bucket_id: ::core::primitive::u64, + dst_key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Bucket name already exists."] + BucketNameExists, + #[codec(index = 1)] + #[doc = "Invalid bucket name format."] + InvalidBucketName, + #[codec(index = 2)] + #[doc = "Bucket not found."] + BucketNotFound, + #[codec(index = 3)] + #[doc = "Not the bucket owner/admin."] + NotBucketOwner, + #[codec(index = 4)] + #[doc = "Too many buckets for user."] + TooManyBuckets, + #[codec(index = 5)] + #[doc = "Object not found."] + ObjectNotFound, + #[codec(index = 6)] + #[doc = "Invalid object key format."] + InvalidObjectKey, + #[codec(index = 7)] + #[doc = "Bucket is not empty."] + BucketNotEmpty, + #[codec(index = 8)] + #[doc = "Too many objects in bucket."] + TooManyObjects, + #[codec(index = 9)] + #[doc = "Object key too long."] + ObjectKeyTooLong, + #[codec(index = 10)] + #[doc = "Content type too long."] + ContentTypeTooLong, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "S3 bucket created."] + S3BucketCreated { + s3_bucket_id: ::core::primitive::u64, + name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + layer0_bucket_id: ::core::primitive::u64, + owner: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 1)] + #[doc = "S3 bucket deleted."] + S3BucketDeleted { + s3_bucket_id: ::core::primitive::u64, + }, + #[codec(index = 2)] + #[doc = "Object metadata stored."] + ObjectPut { + s3_bucket_id: ::core::primitive::u64, + key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + cid: ::subxt_core::utils::H256, + size: ::core::primitive::u64, + }, + #[codec(index = 3)] + #[doc = "Object deleted."] + ObjectDeleted { + s3_bucket_id: ::core::primitive::u64, + key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Object copied."] + ObjectCopied { + src_bucket_id: ::core::primitive::u64, + src_key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + dst_bucket_id: ::core::primitive::u64, + dst_key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + } + } + } + pub mod pallet_session { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = ""] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "- `origin`: The dispatch origin of this function must be signed."] + #[doc = "- `keys`: The new session keys to set. These are the public keys of all sessions keys"] + #[doc = " setup in the runtime."] + #[doc = "- `proof`: The proof that `origin` has access to the private keys of `keys`. See"] + #[doc = " [`impl_opaque_keys`](sp_runtime::impl_opaque_keys) for more information about the"] + #[doc = " proof format."] + set_keys { + keys: runtime_types::storage_paseo_runtime::SessionKeys, + proof: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + purge_keys, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Error for the session pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Invalid ownership proof."] + InvalidProof, + #[codec(index = 1)] + #[doc = "No associated validator ID for account."] + NoAssociatedValidatorId, + #[codec(index = 2)] + #[doc = "Registered duplicate key."] + DuplicatedKey, + #[codec(index = 3)] + #[doc = "No keys are associated with this account."] + NoKeys, + #[codec(index = 4)] + #[doc = "Key setting account is not live, so it's impossible to associate keys."] + NoAccount, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "New session has happened. Note that the argument is the session index, not the"] + #[doc = "block number as the type might suggest."] + NewSession { + session_index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "The `NewSession` event in the current block also implies a new validator set to be"] + #[doc = "queued."] + NewQueued, + #[codec(index = 2)] + #[doc = "Validator has been disabled."] + ValidatorDisabled { + validator: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 3)] + #[doc = "Validator has been re-enabled."] + ValidatorReenabled { + validator: ::subxt_core::utils::AccountId32, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum HoldReason { + #[codec(index = 0)] + Keys, + } + } + } + pub mod pallet_storage_provider { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Bucket { + pub members: runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::pallet_storage_provider::pallet::Member, + >, + pub frozen_start_seq: ::core::option::Option<::core::primitive::u64>, + pub min_providers: ::core::primitive::u32, + pub primary_providers: + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::subxt_core::utils::AccountId32, + >, + pub snapshot: ::core::option::Option< + runtime_types::storage_primitives::BucketSnapshot<::core::primitive::u32>, + >, + pub historical_roots: + [(::core::primitive::u32, ::subxt_core::utils::H256); 6usize], + pub total_snapshots: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Register as a storage provider."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `multiaddr`: Network address for clients to connect"] + #[doc = "- `public_key`: Public key for signature verification (raw bytes, 32-64 bytes)"] + #[doc = "- `stake`: Initial stake to lock"] + register_provider { + multiaddr: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + public_key: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + stake: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Add stake to an existing provider registration."] + add_stake { amount: ::core::primitive::u128 }, + #[codec(index = 2)] + #[doc = "Announce intent to deregister."] + #[doc = ""] + #[doc = "This is the first step of a two-step exit:"] + #[doc = ""] + #[doc = "1. `deregister_provider` (this call) — marks the provider as"] + #[doc = " leaving, freezes them from accepting new agreements or"] + #[doc = " extensions, and stamps `deregister_at = now + DeregisterAnnouncementPeriod`."] + #[doc = " Stake stays reserved; the provider remains on-chain and fully"] + #[doc = " slashable for any pending or freshly-created challenge."] + #[doc = "2. `complete_deregister` — callable once `deregister_at` has"] + #[doc = " elapsed (by which point any challenge created up to the"] + #[doc = " announcement block has already matured, because the period"] + #[doc = " must be `> ChallengeTimeout`)."] + #[doc = ""] + #[doc = "The two-step flow closes the slashing race where a provider"] + #[doc = "could withdraw stake between the end of their last agreement"] + #[doc = "and the deadline of a challenge created against it."] + deregister_provider, + #[codec(index = 6)] + #[doc = "Finalise a previously-announced deregistration."] + #[doc = ""] + #[doc = "Callable by the provider once `DeregisterAnnouncementPeriod` has"] + #[doc = "elapsed since their `deregister_provider` call. Drains any"] + #[doc = "pending `CheckpointRewards` into the provider's free balance,"] + #[doc = "unreserves the remaining stake, and removes the provider record."] + #[doc = ""] + #[doc = "Still requires `committed_bytes == 0` — if the provider somehow"] + #[doc = "re-acquired commitments mid-window (they cannot today, since"] + #[doc = "announce forces `accepting_primary = false` and"] + #[doc = "`update_provider_settings` is blocked during the window) the"] + #[doc = "caller must wait for those agreements to end first."] + complete_deregister, + #[codec(index = 7)] + #[doc = "Cancel a previously-announced deregistration."] + #[doc = ""] + #[doc = "Restores `accepting_primary` / `accepting_extensions` to `true`"] + #[doc = "(mirroring what `deregister_provider` forced to `false` on"] + #[doc = "announce) and clears `deregister_at`. If the provider wants"] + #[doc = "different post-cancel settings they can call"] + #[doc = "`update_provider_settings` afterwards."] + cancel_deregister, + #[codec(index = 3)] + #[doc = "Update provider settings."] + update_provider_settings { + settings: runtime_types::pallet_storage_provider::pallet::ProviderSettings, + }, + #[codec(index = 5)] + #[doc = "Update the provider's multiaddr (network endpoint)."] + update_provider_multiaddr { + multiaddr: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + }, + #[codec(index = 4)] + #[doc = "Block or unblock extensions for a specific bucket."] + set_extensions_blocked { + bucket_id: ::core::primitive::u64, + blocked: ::core::primitive::bool, + }, + #[codec(index = 17)] + #[doc = "Redeem provider-signed terms: create a bucket + primary agreement"] + #[doc = "in a single call."] + #[doc = ""] + #[doc = "The provider signs a SCALE-encoded [`AgreementTermsOf`] off-chain;"] + #[doc = "the owner submits it here. The pallet verifies the signature,"] + #[doc = "rejects replays via the provider's sliding nonce window, then runs"] + #[doc = "the standard provider/capacity/stake checks and opens the"] + #[doc = "agreement."] + establish_storage_agreement { + provider: ::subxt_core::utils::AccountId32, + terms: runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + sig: runtime_types::sp_runtime::MultiSignature, + }, + #[codec(index = 11)] + #[doc = "Set minimum providers required for checkpoint."] + set_min_providers { + bucket_id: ::core::primitive::u64, + min_providers: ::core::primitive::u32, + }, + #[codec(index = 12)] + #[doc = "Freeze bucket - make append-only (irreversible)."] + freeze_bucket { bucket_id: ::core::primitive::u64 }, + #[codec(index = 13)] + #[doc = "Add or update a member's role."] + set_member { + bucket_id: ::core::primitive::u64, + member: ::subxt_core::utils::AccountId32, + role: runtime_types::storage_primitives::Role, + }, + #[codec(index = 14)] + #[doc = "Remove member from bucket."] + remove_member { + bucket_id: ::core::primitive::u64, + member: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 15)] + #[doc = "Remove a slashed provider from a bucket (permissionless)."] + #[doc = ""] + #[doc = "Anyone can call this to clean up slashed providers."] + #[doc = "The provider must have zero stake (indicating they were slashed)."] + #[doc = "Returns payment to agreement owner and removes the provider from the bucket."] + remove_slashed { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 20)] + #[doc = "Redeem provider-signed terms for a replica storage agreement."] + #[doc = ""] + #[doc = "The provider signs a SCALE-encoded [`AgreementTermsOf`] with"] + #[doc = "`replica_params: Some(_)` off-chain; the owner submits it here."] + #[doc = "The pallet verifies the signature, rejects replays via the"] + #[doc = "provider's sliding nonce window, then runs the standard"] + #[doc = "provider/capacity/stake checks and opens the replica agreement on"] + #[doc = "an existing bucket."] + establish_replica_agreement { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + terms: runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + sig: runtime_types::sp_runtime::MultiSignature, + }, + #[codec(index = 25)] + #[doc = "End agreement with pay/burn decision."] + end_agreement { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + action: runtime_types::storage_primitives::EndAction, + }, + #[codec(index = 26)] + #[doc = "Claim payment for expired agreement (provider only)."] + claim_expired_agreement { bucket_id: ::core::primitive::u64 }, + #[codec(index = 28)] + #[doc = "Top up quota for an existing agreement (owner only)."] + #[doc = ""] + #[doc = "Increases max_bytes, does not change duration."] + #[doc = "Actual payment = provider.price_per_byte * additional_bytes * remaining_duration."] + top_up_agreement { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + additional_bytes: ::core::primitive::u64, + max_payment: ::core::primitive::u128, + }, + #[codec(index = 27)] + #[doc = "Extend agreement duration (immediate, no provider approval needed)."] + #[doc = ""] + #[doc = "This:"] + #[doc = "1. Settles current period: releases payment to provider for elapsed time"] + #[doc = "2. Calculates and locks new payment for extension at current provider prices"] + #[doc = "3. Updates end date to now + additional_duration"] + #[doc = "4. Updates agreement.price_per_byte (and sync_price for replicas) to current prices"] + #[doc = ""] + #[doc = "Price change rules:"] + #[doc = "- If provider's current price <= agreement's locked price: anyone can extend"] + #[doc = "- If provider's current price > agreement's locked price: only owner can extend"] + #[doc = ""] + #[doc = "This enables permissionless persistence for frozen buckets while protecting"] + #[doc = "owners from unwanted price increases."] + extend_agreement { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + additional_duration: ::core::primitive::u32, + max_payment: ::core::primitive::u128, + }, + #[codec(index = 30)] + #[doc = "Submit a new checkpoint with provider signatures."] + checkpoint { + bucket_id: ::core::primitive::u64, + commitment: runtime_types::storage_primitives::Commitment, + nonce: ::core::primitive::u64, + signatures: runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::subxt_core::utils::AccountId32, + runtime_types::sp_runtime::MultiSignature, + )>, + }, + #[codec(index = 31)] + #[doc = "Add additional provider signatures to existing checkpoint."] + #[doc = ""] + #[doc = "Allows late-signing providers to add their signatures to the current"] + #[doc = "snapshot. Useful when a provider signs off-chain commitments later."] + extend_checkpoint { + bucket_id: ::core::primitive::u64, + additional_signatures: + runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::subxt_core::utils::AccountId32, + runtime_types::sp_runtime::MultiSignature, + )>, + }, + #[codec(index = 32)] + #[doc = "Submit a provider-initiated checkpoint."] + #[doc = ""] + #[doc = "Providers autonomously coordinate checkpoints without requiring"] + #[doc = "clients to be online. Uses deterministic leader election with"] + #[doc = "fallback to any primary provider after grace period."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `bucket_id`: The bucket to checkpoint"] + #[doc = "- `mmr_root`: MMR root that providers agreed on"] + #[doc = "- `start_seq`: Starting sequence number"] + #[doc = "- `leaf_count`: Number of leaves in the MMR"] + #[doc = "- `window`: Checkpoint window number (prevents replay)"] + #[doc = "- `signatures`: Provider signatures over the checkpoint proposal"] + provider_checkpoint { + bucket_id: ::core::primitive::u64, + commitment: runtime_types::storage_primitives::Commitment, + window: ::core::primitive::u64, + signatures: runtime_types::bounded_collections::bounded_vec::BoundedVec<( + ::subxt_core::utils::AccountId32, + runtime_types::sp_runtime::MultiSignature, + )>, + }, + #[codec(index = 33)] + #[doc = "Configure checkpoint window settings for a bucket."] + #[doc = ""] + #[doc = "Only bucket admin can configure. Setting enabled=false disables"] + #[doc = "provider-initiated checkpoints (client-initiated still work)."] + configure_checkpoint_window { + bucket_id: ::core::primitive::u64, + interval: ::core::primitive::u32, + grace_period: ::core::primitive::u32, + enabled: ::core::primitive::bool, + }, + #[codec(index = 34)] + #[doc = "Report a missed checkpoint window and penalize the leader."] + #[doc = ""] + #[doc = "Can only be called after the checkpoint window has fully passed"] + #[doc = "(beyond grace period) and no checkpoint was submitted."] + #[doc = "Reporter receives a portion of the penalty."] + report_missed_checkpoint { + bucket_id: ::core::primitive::u64, + window: ::core::primitive::u64, + }, + #[codec(index = 35)] + #[doc = "Claim accumulated checkpoint rewards."] + #[doc = ""] + #[doc = "Providers accumulate rewards for submitting checkpoints."] + #[doc = "This transfers accumulated rewards to the provider."] + claim_checkpoint_rewards { bucket_id: ::core::primitive::u64 }, + #[codec(index = 36)] + #[doc = "Fund the checkpoint reward pool for a bucket."] + #[doc = ""] + #[doc = "Anyone can fund the pool. Funds are used to reward providers"] + #[doc = "for submitting checkpoints."] + fund_checkpoint_pool { + bucket_id: ::core::primitive::u64, + amount: ::core::primitive::u128, + }, + #[codec(index = 40)] + #[doc = "Challenge on-chain checkpoint (no signatures needed)."] + #[doc = ""] + #[doc = "Provider must be in current snapshot's provider list."] + #[doc = ""] + #[doc = "NOTE: May race with new checkpoints in hot buckets. If the provider is"] + #[doc = "no longer in the snapshot when the transaction executes, this fails."] + #[doc = "For hot buckets, prefer challenge_offchain with the signature you have."] + challenge_checkpoint { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + target: runtime_types::storage_primitives::ChunkLocation, + }, + #[codec(index = 42)] + #[doc = "Challenge off-chain commitment (requires provider signature)."] + #[doc = ""] + #[doc = "Works regardless of current snapshot state - the signature proves"] + #[doc = "the provider committed to this data."] + #[doc = ""] + #[doc = "Preferred for hot buckets where snapshots change frequently."] + challenge_offchain { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + commitment: runtime_types::storage_primitives::Commitment, + target: runtime_types::storage_primitives::ChunkLocation, + nonce: ::core::primitive::u64, + provider_signature: runtime_types::sp_runtime::MultiSignature, + }, + #[codec(index = 43)] + #[doc = "Challenge a replica based on their on-chain sync confirmation."] + #[doc = ""] + #[doc = "Uses the replica's last_synced_root stored in their agreement."] + #[doc = "No signature needed - the chain already has their commitment."] + challenge_replica { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + target: runtime_types::storage_primitives::ChunkLocation, + }, + #[codec(index = 41)] + #[doc = "Respond to a challenge."] + respond_to_challenge { + challenge_id: + runtime_types::storage_primitives::ChallengeId<::core::primitive::u32>, + response: runtime_types::pallet_storage_provider::pallet::ChallengeResponse, + }, + #[codec(index = 50)] + #[doc = "Replica confirms sync to MMR roots."] + confirm_replica_sync { + bucket_id: ::core::primitive::u64, + roots: [::core::option::Option<::subxt_core::utils::H256>; 7usize], + signature: runtime_types::sp_runtime::MultiSignature, + }, + #[codec(index = 51)] + #[doc = "Top up a replica's sync balance."] + top_up_replica_sync_balance { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Challenge { + pub bucket_id: ::core::primitive::u64, + pub provider: ::subxt_core::utils::AccountId32, + pub challenger: ::subxt_core::utils::AccountId32, + pub mmr_root: ::subxt_core::utils::H256, + pub start_seq: ::core::primitive::u64, + pub target: runtime_types::storage_primitives::ChunkLocation, + pub deposit: ::core::primitive::u128, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum ChallengeResponse { + #[codec(index = 0)] + Proof { + chunk_data: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + mmr_proof: runtime_types::storage_primitives::MmrProof, + chunk_proof: runtime_types::storage_primitives::MerkleProof, + }, + #[codec(index = 1)] + Deleted { + new_mmr_root: ::subxt_core::utils::H256, + new_start_seq: ::core::primitive::u64, + nonce: ::core::primitive::u64, + admin: ::subxt_core::utils::AccountId32, + admin_signature: runtime_types::sp_runtime::MultiSignature, + }, + #[codec(index = 2)] + Superseded, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + ProviderAlreadyRegistered, + #[codec(index = 1)] + ProviderNotFound, + #[codec(index = 2)] + InsufficientStake, + #[codec(index = 3)] + InsufficientStakeForBytes, + #[codec(index = 4)] + ProviderHasActiveAgreements, + #[codec(index = 5)] + ProviderNotAcceptingPrimary, + #[codec(index = 6)] + ProviderNotAcceptingReplicas, + #[codec(index = 7)] + ProviderNotAcceptingExtensions, + #[codec(index = 8)] + ProviderNotSlashed, + #[codec(index = 9)] + #[doc = "Cannot set max_capacity below current committed_bytes."] + CapacityBelowCommitted, + #[codec(index = 10)] + #[doc = "Provider capacity exceeded on accept (committed + request > max_capacity)."] + CapacityExceeded, + #[codec(index = 11)] + #[doc = "Stake insufficient to back declared capacity."] + InsufficientStakeForCapacity, + #[codec(index = 12)] + #[doc = "Provider settings specify `min_duration > max_duration"] + MinDurationExceedsMaxDuration, + #[codec(index = 13)] + #[doc = "Provider has already announced a deregistration; the action is"] + #[doc = "rejected until they complete or cancel it."] + DeregisterAnnounced, + #[codec(index = 14)] + #[doc = "Provider has no announced deregistration to complete or cancel."] + DeregisterNotAnnounced, + #[codec(index = 15)] + #[doc = "`complete_deregister` called before `DeregisterAnnouncementPeriod`"] + #[doc = "elapsed."] + DeregisterPeriodNotElapsed, + #[codec(index = 16)] + BucketNotFound, + #[codec(index = 17)] + BucketFrozen, + #[codec(index = 18)] + BucketNotFrozen, + #[codec(index = 19)] + NotBucketAdmin, + #[codec(index = 20)] + NotBucketMember, + #[codec(index = 21)] + NotBucketWriter, + #[codec(index = 22)] + MemberNotFound, + #[codec(index = 23)] + CannotDemoteAdmin, + #[codec(index = 24)] + LastAdminCannotBeRemoved, + #[codec(index = 25)] + MaxMembersReached, + #[codec(index = 26)] + MaxPrimaryProvidersReached, + #[codec(index = 27)] + MinProvidersNotMet, + #[codec(index = 28)] + InvalidMinProviders, + #[codec(index = 29)] + AgreementNotFound, + #[codec(index = 30)] + AgreementAlreadyExists, + #[codec(index = 31)] + AgreementExpired, + #[codec(index = 32)] + AgreementNotExpired, + #[codec(index = 33)] + AgreementExtensionsBlocked, + #[codec(index = 34)] + NotAgreementOwner, + #[codec(index = 35)] + DurationTooShort, + #[codec(index = 36)] + DurationTooLong, + #[codec(index = 37)] + PaymentExceedsMax, + #[codec(index = 38)] + CannotTerminateReplica, + #[codec(index = 39)] + SettlementWindowPassed, + #[codec(index = 40)] + NotReplica, + #[codec(index = 41)] + SyncTooFrequent, + #[codec(index = 42)] + InvalidSyncRoot, + #[codec(index = 43)] + InsufficientSyncBalance, + #[codec(index = 44)] + ChallengeNotFound, + #[codec(index = 45)] + ChallengeAlreadyExists, + #[codec(index = 46)] + InvalidChallengeProof, + #[codec(index = 47)] + ChallengeExpired, + #[codec(index = 48)] + NotChallengeProvider, + #[codec(index = 49)] + ProviderNotInSnapshot, + #[codec(index = 50)] + LeafBeyondCanonical, + #[codec(index = 51)] + InvalidDeletionProof, + #[codec(index = 52)] + #[doc = "A provider with unresolved challenges (`PendingChallenges > 0`)"] + #[doc = "cannot complete deregistration — they are still slashable."] + ProviderHasPendingChallenges, + #[codec(index = 53)] + #[doc = "An agreement with an unresolved challenge against this"] + #[doc = "`(bucket, provider)` cannot be torn down until the challenge"] + #[doc = "resolves (defended, slashed, or timed out)."] + AgreementHasPendingChallenge, + #[codec(index = 54)] + #[doc = "`MaxChallengesPerDeadline` challenges have already been allocated"] + #[doc = "for the deadline this challenge would land on. Bounds the"] + #[doc = "`on_finalize` slash sweep so it stays within its reserved weight."] + TooManyChallengesThisBlock, + #[codec(index = 55)] + InvalidSignature, + #[codec(index = 56)] + NoSnapshot, + #[codec(index = 57)] + SnapshotViolatesFrozen, + #[codec(index = 58)] + InsufficientSignatures, + #[codec(index = 59)] + #[doc = "`CommitmentPayload::nonce` is older than `T::MaxNonceAge` blocks"] + #[doc = "behind the current block, or refers to a future block. Rejected"] + #[doc = "to prevent replay of captured signatures."] + CommitmentNonceTooOld, + #[codec(index = 60)] + ArithmeticOverflow, + #[codec(index = 61)] + InvalidMultiaddr, + #[codec(index = 62)] + InvalidPublicKey, + #[codec(index = 63)] + #[doc = "Provider-initiated checkpoints are disabled for this bucket."] + ProviderCheckpointsDisabled, + #[codec(index = 64)] + #[doc = "Caller is not the designated checkpoint leader for this window."] + NotCheckpointLeader, + #[codec(index = 65)] + #[doc = "Checkpoint window has not started yet."] + CheckpointWindowNotStarted, + #[codec(index = 66)] + #[doc = "Checkpoint has already been submitted for this window."] + CheckpointAlreadySubmitted, + #[codec(index = 67)] + #[doc = "Invalid checkpoint window number."] + InvalidCheckpointWindow, + #[codec(index = 68)] + #[doc = "Insufficient funds in checkpoint pool to pay reward."] + InsufficientCheckpointPool, + #[codec(index = 69)] + #[doc = "No missed checkpoint to report."] + NoMissedCheckpoint, + #[codec(index = 70)] + #[doc = "Cannot report miss while still within grace period."] + WithinGracePeriod, + #[codec(index = 71)] + #[doc = "No rewards to claim."] + NoRewardsToClaim, + #[codec(index = 72)] + #[doc = "Account is a member of too many buckets."] + TooManyBucketsForMember, + #[codec(index = 73)] + #[doc = "Provider signature over the SCALE-encoded terms is invalid."] + InvalidProviderSignature, + #[codec(index = 74)] + #[doc = "Signed terms have passed their `valid_until` block."] + TermsExpired, + #[codec(index = 75)] + #[doc = "Signed terms' `valid_until` extends beyond `now + RequestTimeout` —"] + #[doc = "the provider-signed validity window cap enforced on-chain."] + TermsValidityTooLong, + #[codec(index = 76)] + #[doc = "The terms' nonce has already been consumed inside the provider's"] + #[doc = "replay window."] + NonceAlreadyUsed, + #[codec(index = 77)] + #[doc = "The terms' nonce is older than the provider's replay window"] + #[doc = "(distance from `hsn` ≥ [`storage_primitives::REPLAY_WINDOW_BITS`])."] + NonceTooOld, + #[codec(index = 78)] + #[doc = "The terms' declared owner does not match the extrinsic origin."] + TermsOwnerMismatch, + #[codec(index = 79)] + #[doc = "Replica terms missing from a signed quote redeemed as a replica"] + #[doc = "agreement."] + MissingReplicaTerms, + #[codec(index = 80)] + #[doc = "The terms' bucket binding does not match the redeeming extrinsic:"] + #[doc = "primary terms must carry no bucket, replica terms must name the"] + #[doc = "targeted bucket."] + TermsBucketMismatch, + #[codec(index = 81)] + #[doc = "Storage agreement requested 0 byte"] + InvalidMaxBytesRequest, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + ProviderRegistered { + provider: ::subxt_core::utils::AccountId32, + stake: ::core::primitive::u128, + }, + #[codec(index = 1)] + ProviderDeregistered { + provider: ::subxt_core::utils::AccountId32, + stake_returned: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Provider has announced their intention to deregister. Stake stays"] + #[doc = "reserved and the provider remains on-chain (and slashable) until"] + #[doc = "`complete_after`, at which point they may call `complete_deregister`."] + DeregisterAnnounced { + provider: ::subxt_core::utils::AccountId32, + complete_after: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Provider cancelled a previously-announced deregistration."] + DeregisterCancelled { + provider: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 4)] + ProviderStakeAdded { + provider: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + total_stake: ::core::primitive::u128, + }, + #[codec(index = 5)] + ProviderSettingsUpdated { + provider: ::subxt_core::utils::AccountId32, + settings: runtime_types::pallet_storage_provider::pallet::ProviderSettings, + }, + #[codec(index = 6)] + ProviderMultiaddrUpdated { + provider: ::subxt_core::utils::AccountId32, + multiaddr: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + }, + #[codec(index = 7)] + ExtensionsBlocked { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + blocked: ::core::primitive::bool, + }, + #[codec(index = 8)] + BucketCreated { + bucket_id: ::core::primitive::u64, + admin: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 9)] + BucketFrozen { + bucket_id: ::core::primitive::u64, + frozen_start_seq: ::core::primitive::u64, + }, + #[codec(index = 10)] + BucketDeleted { bucket_id: ::core::primitive::u64 }, + #[codec(index = 11)] + MemberSet { + bucket_id: ::core::primitive::u64, + member: ::subxt_core::utils::AccountId32, + role: runtime_types::storage_primitives::Role, + }, + #[codec(index = 12)] + MemberRemoved { + bucket_id: ::core::primitive::u64, + member: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 13)] + BucketCheckpointed { + bucket_id: ::core::primitive::u64, + commitment: runtime_types::storage_primitives::Commitment, + providers: ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>, + }, + #[codec(index = 14)] + ProviderAddedToBucket { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 15)] + PrimaryProviderRemoved { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + reason: runtime_types::storage_primitives::RemovalReason, + }, + #[codec(index = 16)] + PrimaryAgreementEndedEarly { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + payment_to_provider: ::core::primitive::u128, + burned: ::core::primitive::u128, + }, + #[codec(index = 17)] + SlashedProviderRemoved { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + payment_returned_to_owner: ::core::primitive::u128, + }, + #[codec(index = 18)] + ReplicaSynced { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + mmr_root: ::subxt_core::utils::H256, + position_matched: ::core::primitive::u8, + sync_payment: ::core::primitive::u128, + }, + #[codec(index = 19)] + ReplicaSyncBalanceToppedUp { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + new_total: ::core::primitive::u128, + }, + #[codec(index = 20)] + AgreementAccepted { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + expires_at: ::core::primitive::u32, + }, + #[codec(index = 21)] + AgreementToppedUp { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + new_max_bytes: ::core::primitive::u64, + }, + #[codec(index = 22)] + AgreementExtended { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + new_expires_at: ::core::primitive::u32, + payment: ::core::primitive::u128, + }, + #[codec(index = 23)] + AgreementOwnershipTransferred { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + old_owner: ::subxt_core::utils::AccountId32, + new_owner: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 24)] + AgreementEnded { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + payment_to_provider: ::core::primitive::u128, + burned: ::core::primitive::u128, + }, + #[codec(index = 25)] + AgreementExpiredClaimed { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + payment_to_provider: ::core::primitive::u128, + }, + #[codec(index = 26)] + #[doc = "Owner redeemed provider-signed terms; bucket created and agreement"] + #[doc = "opened atomically."] + StorageAgreementEstablished { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + owner: ::subxt_core::utils::AccountId32, + terms: runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + expires_at: ::core::primitive::u32, + }, + #[codec(index = 27)] + #[doc = "Owner redeemed provider-signed replica terms; replica agreement"] + #[doc = "opened against an existing bucket."] + ReplicaAgreementEstablished { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + owner: ::subxt_core::utils::AccountId32, + terms: runtime_types::storage_primitives::agreement_term::AgreementTerms< + ::subxt_core::utils::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + expires_at: ::core::primitive::u32, + }, + #[codec(index = 28)] + ChallengeCreated { + challenge_id: + runtime_types::storage_primitives::ChallengeId<::core::primitive::u32>, + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + challenger: ::subxt_core::utils::AccountId32, + respond_by: ::core::primitive::u32, + }, + #[codec(index = 29)] + ChallengeDefended { + challenge_id: + runtime_types::storage_primitives::ChallengeId<::core::primitive::u32>, + provider: ::subxt_core::utils::AccountId32, + response_time_blocks: ::core::primitive::u32, + challenger_cost: ::core::primitive::u128, + provider_cost: ::core::primitive::u128, + }, + #[codec(index = 30)] + ChallengeSlashed { + challenge_id: + runtime_types::storage_primitives::ChallengeId<::core::primitive::u32>, + provider: ::subxt_core::utils::AccountId32, + slashed_amount: ::core::primitive::u128, + challenger_reward: ::core::primitive::u128, + reason: runtime_types::storage_primitives::SlashReason, + }, + #[codec(index = 31)] + ProviderCheckpointSubmitted { + bucket_id: ::core::primitive::u64, + mmr_root: ::subxt_core::utils::H256, + window: ::core::primitive::u64, + leader: ::subxt_core::utils::AccountId32, + signers: ::subxt_core::alloc::vec::Vec<::subxt_core::utils::AccountId32>, + reward: ::core::primitive::u128, + }, + #[codec(index = 32)] + CheckpointConfigUpdated { + bucket_id: ::core::primitive::u64, + interval: ::core::primitive::u32, + grace_period: ::core::primitive::u32, + enabled: ::core::primitive::bool, + }, + #[codec(index = 33)] + CheckpointMissPenalized { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + window: ::core::primitive::u64, + penalty: ::core::primitive::u128, + }, + #[codec(index = 34)] + CheckpointRewardClaimed { + bucket_id: ::core::primitive::u64, + provider: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 35)] + CheckpointPoolFunded { + bucket_id: ::core::primitive::u64, + funder: ::subxt_core::utils::AccountId32, + amount: ::core::primitive::u128, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Member { + pub account: ::subxt_core::utils::AccountId32, + pub role: runtime_types::storage_primitives::Role, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderInfo { + pub multiaddr: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub public_key: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub stake: ::core::primitive::u128, + pub committed_bytes: ::core::primitive::u64, + pub settings: runtime_types::pallet_storage_provider::pallet::ProviderSettings, + pub stats: runtime_types::pallet_storage_provider::pallet::ProviderStats, + pub deregister_at: ::core::option::Option<::core::primitive::u32>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderSettings { + pub min_duration: ::core::primitive::u32, + pub max_duration: ::core::primitive::u32, + pub price_per_byte: ::core::primitive::u128, + pub accepting_primary: ::core::primitive::bool, + pub replica_sync_price: ::core::option::Option<::core::primitive::u128>, + pub accepting_extensions: ::core::primitive::bool, + pub max_capacity: ::core::primitive::u64, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderStats { + pub registered_at: ::core::primitive::u32, + pub agreements_total: ::core::primitive::u32, + pub agreements_extended: ::core::primitive::u32, + pub agreements_not_extended: ::core::primitive::u32, + pub agreements_burned: ::core::primitive::u32, + pub total_bytes_committed: ::core::primitive::u64, + pub challenges_received: ::core::primitive::u32, + pub challenges_failed: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct StorageAgreement { + pub owner: ::subxt_core::utils::AccountId32, + pub max_bytes: ::core::primitive::u64, + pub payment_locked: ::core::primitive::u128, + pub price_per_byte: ::core::primitive::u128, + pub expires_at: ::core::primitive::u32, + pub extensions_blocked: ::core::primitive::bool, + pub role: runtime_types::storage_primitives::ProviderRole< + ::core::primitive::u128, + ::core::primitive::u32, + >, + pub started_at: ::core::primitive::u32, + } + } + pub mod runtime_api { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementResponse { + pub bucket_id: ::core::primitive::u64, + pub owner: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub provider: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub max_bytes: ::core::primitive::u64, + pub payment_locked: ::core::primitive::u128, + pub price_per_byte: ::core::primitive::u128, + pub expires_at: ::core::primitive::u32, + pub extensions_blocked: ::core::primitive::bool, + pub role: runtime_types::storage_primitives::ProviderRole< + ::core::primitive::u128, + ::core::primitive::u32, + >, + pub started_at: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketMemberResponse { + pub account: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub role: runtime_types::storage_primitives::Role, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketResponse { + pub bucket_id: ::core::primitive::u64, + pub members: ::subxt_core::alloc::vec::Vec< + runtime_types::pallet_storage_provider::runtime_api::BucketMemberResponse, + >, + pub frozen_start_seq: ::core::option::Option<::core::primitive::u64>, + pub min_providers: ::core::primitive::u32, + pub primary_providers: ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + pub snapshot: ::core::option::Option< + runtime_types::storage_primitives::BucketSnapshot<::core::primitive::u32>, + >, + pub total_snapshots: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChallengeResponse { + pub bucket_id: ::core::primitive::u64, + pub provider: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub challenger: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub mmr_root: ::subxt_core::utils::H256, + pub start_seq: ::core::primitive::u64, + pub leaf_index: ::core::primitive::u64, + pub chunk_index: ::core::primitive::u64, + pub deadline: ::core::primitive::u32, + pub index: ::core::primitive::u16, + pub deposit: ::core::primitive::u128, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MatchedProvider { + pub account: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub info: + runtime_types::pallet_storage_provider::runtime_api::ProviderInfoResponse, + pub match_score: ::core::primitive::u8, + pub available_capacity: ::core::option::Option<::core::primitive::u64>, + pub partial_reason: ::core::option::Option< + runtime_types::pallet_storage_provider::runtime_api::PartialMatchReason, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum PartialMatchReason { + #[codec(index = 0)] + PriceTooHigh, + #[codec(index = 1)] + InsufficientCapacity, + #[codec(index = 2)] + DurationMismatch, + #[codec(index = 3)] + NotAccepting, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ProviderInfoResponse { + pub multiaddr: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub public_key: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub stake: ::core::primitive::u128, + pub committed_bytes: ::core::primitive::u64, + pub min_duration: ::core::primitive::u32, + pub max_duration: ::core::primitive::u32, + pub price_per_byte: ::core::primitive::u128, + pub accepting_primary: ::core::primitive::bool, + pub replica_sync_price: ::core::option::Option<::core::primitive::u128>, + pub accepting_extensions: ::core::primitive::bool, + pub registered_at: ::core::primitive::u32, + pub agreements_total: ::core::primitive::u32, + pub agreements_extended: ::core::primitive::u32, + pub agreements_not_extended: ::core::primitive::u32, + pub agreements_burned: ::core::primitive::u32, + pub challenges_received: ::core::primitive::u32, + pub challenges_failed: ::core::primitive::u32, + pub max_capacity: ::core::primitive::u64, + pub available_capacity: ::core::option::Option<::core::primitive::u64>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct StorageRequirements { + pub bytes_needed: ::core::primitive::u64, + pub min_duration: ::core::primitive::u32, + pub max_price_per_byte: ::core::primitive::u128, + pub primary_only: ::core::primitive::bool, + } + } + } + pub mod pallet_sudo { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + sudo { + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + #[codec(index = 1)] + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Sudo user to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + sudo_unchecked_weight { + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + weight: runtime_types::sp_weights::weight_v2::Weight, + }, + #[codec(index = 2)] + #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] + #[doc = "key."] + set_key { + new: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + }, + #[codec(index = 3)] + #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] + #[doc = "a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + sudo_as { + who: + ::subxt_core::utils::MultiAddress<::subxt_core::utils::AccountId32, ()>, + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + #[codec(index = 4)] + #[doc = "Permanently removes the sudo key."] + #[doc = ""] + #[doc = "**This cannot be un-done.**"] + remove_key, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Error for the Sudo pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Sender must be the Sudo account."] + RequireSudo, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A sudo call just took place."] + Sudid { + sudo_result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 1)] + #[doc = "The sudo key has been updated."] + KeyChanged { + old: ::core::option::Option<::subxt_core::utils::AccountId32>, + new: ::subxt_core::utils::AccountId32, + }, + #[codec(index = 2)] + #[doc = "The key was permanently removed."] + KeyRemoved, + #[codec(index = 3)] + #[doc = "A [sudo_as](Pallet::sudo_as) call just took place."] + SudoAsDone { + sudo_result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + } + } + } + pub mod pallet_timestamp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "[`Config::MinimumPeriod`]."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _None_."] + #[doc = ""] + #[doc = "This dispatch class is _Mandatory_ to ensure it gets executed in the block. Be aware"] + #[doc = "that changing the complexity of this call could result exhausting the resources in a"] + #[doc = "block to execute any other calls."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)` because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + set { + #[codec(compact)] + now: ::core::primitive::u64, + }, + } + } + } + pub mod pallet_transaction_payment { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,"] + #[doc = "has been paid by `who`."] + TransactionFeePaid { + who: ::subxt_core::utils::AccountId32, + actual_fee: ::core::primitive::u128, + tip: ::core::primitive::u128, + }, + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct FeeDetails<_0> { + pub inclusion_fee: ::core::option::Option< + runtime_types::pallet_transaction_payment::types::InclusionFee<_0>, + >, + pub tip: _0, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InclusionFee<_0> { + pub base_fee: _0, + pub len_fee: _0, + pub adjusted_weight_fee: _0, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct RuntimeDispatchInfo<_0, _1> { + pub weight: _1, + pub class: runtime_types::frame_support::dispatch::DispatchClass, + pub partial_fee: _0, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChargeTransactionPayment(#[codec(compact)] pub ::core::primitive::u128); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Releases { + #[codec(index = 0)] + V1Ancient, + #[codec(index = 1)] + V2, + } + } + pub mod pallet_utility { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + #[codec(index = 0)] + #[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."] + batch { + calls: ::subxt_core::alloc::vec::Vec< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + #[codec(index = 1)] + #[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_."] + as_derivative { + index: ::core::primitive::u16, + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + #[codec(index = 2)] + #[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."] + batch_all { + calls: ::subxt_core::alloc::vec::Vec< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + #[codec(index = 3)] + #[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)."] + dispatch_as { + as_origin: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::OriginCaller, + >, + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + #[codec(index = 4)] + #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] + #[doc = ""] + #[doc = "May be called from any origin except `None`."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "## Complexity"] + #[doc = "- O(C) where C is the number of calls to be batched."] + force_batch { + calls: ::subxt_core::alloc::vec::Vec< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + #[codec(index = 5)] + #[doc = "Dispatch a function call with a specified weight."] + #[doc = ""] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Root origin to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + with_weight { + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + weight: runtime_types::sp_weights::weight_v2::Weight, + }, + #[codec(index = 6)] + #[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."] + if_else { + main: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + fallback: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + #[codec(index = 7)] + #[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_."] + dispatch_as_fallible { + as_origin: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::OriginCaller, + >, + call: ::subxt_core::alloc::boxed::Box< + runtime_types::storage_paseo_runtime::RuntimeCall, + >, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Too many calls batched."] + TooManyCalls, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] + #[doc = "well as the error."] + BatchInterrupted { + index: ::core::primitive::u32, + error: runtime_types::sp_runtime::DispatchError, + }, + #[codec(index = 1)] + #[doc = "Batch of dispatches completed fully with no error."] + BatchCompleted, + #[codec(index = 2)] + #[doc = "Batch of dispatches completed but has errors."] + BatchCompletedWithErrors, + #[codec(index = 3)] + #[doc = "A single item within a Batch of dispatches has completed with no error."] + ItemCompleted, + #[codec(index = 4)] + #[doc = "A single item within a Batch of dispatches has completed with error."] + ItemFailed { + error: runtime_types::sp_runtime::DispatchError, + }, + #[codec(index = 5)] + #[doc = "A call was dispatched."] + DispatchedAs { + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 6)] + #[doc = "Main call was dispatched."] + IfElseMainSuccess, + #[codec(index = 7)] + #[doc = "The fallback call was dispatched."] + IfElseFallbackCalled { + main_error: runtime_types::sp_runtime::DispatchError, + }, + } + } + } + pub mod pallet_xcm { + use super::runtime_types; + pub mod errors { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum ExecutionError { + #[codec(index = 0)] + Overflow, + #[codec(index = 1)] + Unimplemented, + #[codec(index = 2)] + UntrustedReserveLocation, + #[codec(index = 3)] + UntrustedTeleportLocation, + #[codec(index = 4)] + LocationFull, + #[codec(index = 5)] + LocationNotInvertible, + #[codec(index = 6)] + BadOrigin, + #[codec(index = 7)] + InvalidLocation, + #[codec(index = 8)] + AssetNotFound, + #[codec(index = 9)] + FailedToTransactAsset, + #[codec(index = 10)] + NotWithdrawable, + #[codec(index = 11)] + LocationCannotHold, + #[codec(index = 12)] + ExceedsMaxMessageSize, + #[codec(index = 13)] + DestinationUnsupported, + #[codec(index = 14)] + Transport, + #[codec(index = 15)] + Unroutable, + #[codec(index = 16)] + UnknownClaim, + #[codec(index = 17)] + FailedToDecode, + #[codec(index = 18)] + MaxWeightInvalid, + #[codec(index = 19)] + NotHoldingFees, + #[codec(index = 20)] + TooExpensive, + #[codec(index = 21)] + Trap, + #[codec(index = 22)] + ExpectationFalse, + #[codec(index = 23)] + PalletNotFound, + #[codec(index = 24)] + NameMismatch, + #[codec(index = 25)] + VersionIncompatible, + #[codec(index = 26)] + HoldingWouldOverflow, + #[codec(index = 27)] + ExportError, + #[codec(index = 28)] + ReanchorFailed, + #[codec(index = 29)] + NoDeal, + #[codec(index = 30)] + FeesNotMet, + #[codec(index = 31)] + LockError, + #[codec(index = 32)] + NoPermission, + #[codec(index = 33)] + Unanchored, + #[codec(index = 34)] + NotDepositable, + #[codec(index = 35)] + TooManyAssets, + #[codec(index = 36)] + UnhandledXcmVersion, + #[codec(index = 37)] + WeightLimitReached, + #[codec(index = 38)] + Barrier, + #[codec(index = 39)] + WeightNotComputable, + #[codec(index = 40)] + ExceedsStackLimit, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call { + # [codec (index = 0)] send { dest : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , message : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , } , # [codec (index = 1)] # [doc = "Teleport some assets from the local chain to some destination chain."] # [doc = ""] # [doc = "**This function is deprecated: Use `limited_teleport_assets` instead.**"] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] # [doc = "with all fees taken as needed from the asset."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` chain."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] teleport_assets { dest : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , } , # [codec (index = 2)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve."] # [doc = ""] # [doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] # [doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] # [doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] # [doc = " to mint and deposit reserve-based assets to `beneficiary`."] # [doc = ""] # [doc = "**This function is deprecated: Use `limited_reserve_transfer_assets` instead.**"] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`. The weight limit for fees is not provided and thus is unlimited,"] # [doc = "with all fees taken as needed from the asset."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] reserve_transfer_assets { dest : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , } , # [codec (index = 3)] # [doc = "Execute an XCM message from a local, signed, origin."] # [doc = ""] # [doc = "An event is deposited indicating whether `msg` could be executed completely or only"] # [doc = "partially."] # [doc = ""] # [doc = "No more than `max_weight` will be used in its attempted execution. If this is less than"] # [doc = "the maximum amount of weight that the message could take to be executed, then no"] # [doc = "execution attempt will be made."] execute { message : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , max_weight : runtime_types :: sp_weights :: weight_v2 :: Weight , } , # [codec (index = 4)] # [doc = "Extoll that a particular destination can be communicated with through a particular"] # [doc = "version of XCM."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The destination that is being described."] # [doc = "- `xcm_version`: The latest version of XCM that `location` supports."] force_xcm_version { location : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: staging_xcm :: v5 :: location :: Location > , version : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Set a safe XCM version (the version that XCM should be encoded with if the most recent"] # [doc = "version a destination can accept is unknown)."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `maybe_xcm_version`: The default XCM encoding version, or `None` to disable."] force_default_xcm_version { maybe_xcm_version : :: core :: option :: Option < :: core :: primitive :: u32 > , } , # [codec (index = 6)] # [doc = "Ask a location to notify us regarding their XCM version and any changes to it."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The location to which we should subscribe for XCM version notifications."] force_subscribe_version_notify { location : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 7)] # [doc = "Require that a particular destination should no longer notify us regarding any XCM"] # [doc = "version changes."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `location`: The location to which we are currently subscribed for XCM version"] # [doc = " notifications which we no longer desire."] force_unsubscribe_version_notify { location : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 8)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve."] # [doc = ""] # [doc = "`assets` must have same reserve location and may not be teleportable to `dest`."] # [doc = " - `assets` have local reserve: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `assets` have destination reserve: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `assets` have remote reserve: burn local assets, forward XCM to reserve chain to move"] # [doc = " reserves from this chain's SA to `dest` chain's SA, and forward another XCM to `dest`"] # [doc = " to mint and deposit reserve-based assets to `beneficiary`."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] limited_reserve_transfer_assets { dest : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 9)] # [doc = "Teleport some assets from the local chain to some destination chain."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item`, up to enough to pay for `weight_limit` of weight. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` chain."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] limited_teleport_assets { dest : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 10)] # [doc = "Set or unset the global suspension state of the XCM executor."] # [doc = ""] # [doc = "- `origin`: Must be an origin specified by AdminOrigin."] # [doc = "- `suspended`: `true` to suspend, `false` to resume."] force_suspension { suspended : :: core :: primitive :: bool , } , # [codec (index = 11)] # [doc = "Transfer some assets from the local chain to the destination chain through their local,"] # [doc = "destination or remote reserve, or through teleports."] # [doc = ""] # [doc = "Fee payment on the destination side is made from the asset in the `assets` vector of"] # [doc = "index `fee_asset_item` (hence referred to as `fees`), up to enough to pay for"] # [doc = "`weight_limit` of weight. If more weight is needed than `weight_limit`, then the"] # [doc = "operation will fail and the sent assets may be at risk."] # [doc = ""] # [doc = "`assets` (excluding `fees`) must have same reserve location or otherwise be teleportable"] # [doc = "to `dest`, no limitations imposed on `fees`."] # [doc = " - for local reserve: transfer assets to sovereign account of destination chain and"] # [doc = " forward a notification XCM to `dest` to mint and deposit reserve-based assets to"] # [doc = " `beneficiary`."] # [doc = " - for destination reserve: burn local assets and forward a notification to `dest` chain"] # [doc = " to withdraw the reserve assets from this chain's sovereign account and deposit them"] # [doc = " to `beneficiary`."] # [doc = " - for remote reserve: burn local assets, forward XCM to reserve chain to move reserves"] # [doc = " from this chain's SA to `dest` chain's SA, and forward another XCM to `dest` to mint"] # [doc = " and deposit reserve-based assets to `beneficiary`."] # [doc = " - for teleports: burn local assets and forward XCM to `dest` chain to mint/teleport"] # [doc = " assets and deposit them to `beneficiary`."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `X2(Parent,"] # [doc = " Parachain(..))` to send from parachain to parachain, or `X1(Parachain(..))` to send"] # [doc = " from relay to parachain."] # [doc = "- `beneficiary`: A beneficiary location for the assets in the context of `dest`. Will"] # [doc = " generally be an `AccountId32` value."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `fee_asset_item`: The index into `assets` of the item which should be used to pay"] # [doc = " fees."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] transfer_assets { dest : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , beneficiary : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , fee_asset_item : :: core :: primitive :: u32 , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 12)] # [doc = "Claims assets trapped on this pallet because of leftover assets during XCM execution."] # [doc = ""] # [doc = "- `origin`: Anyone can call this extrinsic."] # [doc = "- `assets`: The exact assets that were trapped. Use the version to specify what version"] # [doc = "was the latest when they were trapped."] # [doc = "- `beneficiary`: The location/account where the claimed assets will be deposited."] claim_assets { assets : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , beneficiary : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 13)] # [doc = "Transfer assets from the local chain to the destination chain using explicit transfer"] # [doc = "types for assets and fees."] # [doc = ""] # [doc = "`assets` must have same reserve location or may be teleportable to `dest`. Caller must"] # [doc = "provide the `assets_transfer_type` to be used for `assets`:"] # [doc = " - `TransferType::LocalReserve`: transfer assets to sovereign account of destination"] # [doc = " chain and forward a notification XCM to `dest` to mint and deposit reserve-based"] # [doc = " assets to `beneficiary`."] # [doc = " - `TransferType::DestinationReserve`: burn local assets and forward a notification to"] # [doc = " `dest` chain to withdraw the reserve assets from this chain's sovereign account and"] # [doc = " deposit them to `beneficiary`."] # [doc = " - `TransferType::RemoteReserve(reserve)`: burn local assets, forward XCM to `reserve`"] # [doc = " chain to move reserves from this chain's SA to `dest` chain's SA, and forward another"] # [doc = " XCM to `dest` to mint and deposit reserve-based assets to `beneficiary`. Typically"] # [doc = " the remote `reserve` is Asset Hub."] # [doc = " - `TransferType::Teleport`: burn local assets and forward XCM to `dest` chain to"] # [doc = " mint/teleport assets and deposit them to `beneficiary`."] # [doc = ""] # [doc = "On the destination chain, as well as any intermediary hops, `BuyExecution` is used to"] # [doc = "buy execution using transferred `assets` identified by `remote_fees_id`."] # [doc = "Make sure enough of the specified `remote_fees_id` asset is included in the given list"] # [doc = "of `assets`. `remote_fees_id` should be enough to pay for `weight_limit`. If more weight"] # [doc = "is needed than `weight_limit`, then the operation will fail and the sent assets may be"] # [doc = "at risk."] # [doc = ""] # [doc = "`remote_fees_id` may use different transfer type than rest of `assets` and can be"] # [doc = "specified through `fees_transfer_type`."] # [doc = ""] # [doc = "The caller needs to specify what should happen to the transferred assets once they reach"] # [doc = "the `dest` chain. This is done through the `custom_xcm_on_dest` parameter, which"] # [doc = "contains the instructions to execute on `dest` as a final step."] # [doc = " This is usually as simple as:"] # [doc = " `Xcm(vec![DepositAsset { assets: Wild(AllCounted(assets.len())), beneficiary }])`,"] # [doc = " but could be something more exotic like sending the `assets` even further."] # [doc = ""] # [doc = "- `origin`: Must be capable of withdrawing the `assets` and executing XCM."] # [doc = "- `dest`: Destination context for the assets. Will typically be `[Parent,"] # [doc = " Parachain(..)]` to send from parachain to parachain, or `[Parachain(..)]` to send from"] # [doc = " relay to parachain, or `(parents: 2, (GlobalConsensus(..), ..))` to send from"] # [doc = " parachain across a bridge to another ecosystem destination."] # [doc = "- `assets`: The assets to be withdrawn. This should include the assets used to pay the"] # [doc = " fee on the `dest` (and possibly reserve) chains."] # [doc = "- `assets_transfer_type`: The XCM `TransferType` used to transfer the `assets`."] # [doc = "- `remote_fees_id`: One of the included `assets` to be used to pay fees."] # [doc = "- `fees_transfer_type`: The XCM `TransferType` used to transfer the `fees` assets."] # [doc = "- `custom_xcm_on_dest`: The XCM to be executed on `dest` chain as the last step of the"] # [doc = " transfer, which also determines what happens to the assets on the destination chain."] # [doc = "- `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase."] transfer_assets_using_type_and_then { dest : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , assets : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssets > , assets_transfer_type : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: staging_xcm_executor :: traits :: asset_transfer :: TransferType > , remote_fees_id : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedAssetId > , fees_transfer_type : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: staging_xcm_executor :: traits :: asset_transfer :: TransferType > , custom_xcm_on_dest : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedXcm > , weight_limit : runtime_types :: xcm :: v3 :: WeightLimit , } , # [codec (index = 14)] # [doc = "Authorize another `aliaser` location to alias into the local `origin` making this call."] # [doc = "The `aliaser` is only authorized until the provided `expiry` block number."] # [doc = "The call can also be used for a previously authorized alias in order to update its"] # [doc = "`expiry` block number."] # [doc = ""] # [doc = "Usually useful to allow your local account to be aliased into from a remote location"] # [doc = "also under your control (like your account on another chain)."] # [doc = ""] # [doc = "WARNING: make sure the caller `origin` (you) trusts the `aliaser` location to act in"] # [doc = "their/your name. Once authorized using this call, the `aliaser` can freely impersonate"] # [doc = "`origin` in XCM programs executed on the local chain."] add_authorized_alias { aliaser : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , expires : :: core :: option :: Option < :: core :: primitive :: u64 > , } , # [codec (index = 15)] # [doc = "Remove a previously authorized `aliaser` from the list of locations that can alias into"] # [doc = "the local `origin` making this call."] remove_authorized_alias { aliaser : :: subxt_core :: alloc :: boxed :: Box < runtime_types :: xcm :: VersionedLocation > , } , # [codec (index = 16)] # [doc = "Remove all previously authorized `aliaser`s that can alias into the local `origin`"] # [doc = "making this call."] remove_all_authorized_aliases , } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Error` enum of this pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "The desired destination was unreachable, generally because there is a no way of routing"] + #[doc = "to it."] + Unreachable, + #[codec(index = 1)] + #[doc = "There was some other issue (i.e. not to do with routing) in sending the message."] + #[doc = "Perhaps a lack of space for buffering the message."] + SendFailure, + #[codec(index = 2)] + #[doc = "The message execution fails the filter."] + Filtered, + #[codec(index = 3)] + #[doc = "The message's weight could not be determined."] + UnweighableMessage, + #[codec(index = 4)] + #[doc = "The destination `Location` provided cannot be inverted."] + DestinationNotInvertible, + #[codec(index = 5)] + #[doc = "The assets to be sent are empty."] + Empty, + #[codec(index = 6)] + #[doc = "Could not re-anchor the assets to declare the fees for the destination chain."] + CannotReanchor, + #[codec(index = 7)] + #[doc = "Too many assets have been attempted for transfer."] + TooManyAssets, + #[codec(index = 8)] + #[doc = "Origin is invalid for sending."] + InvalidOrigin, + #[codec(index = 9)] + #[doc = "The version of the `Versioned` value used is not able to be interpreted."] + BadVersion, + #[codec(index = 10)] + #[doc = "The given location could not be used (e.g. because it cannot be expressed in the"] + #[doc = "desired version of XCM)."] + BadLocation, + #[codec(index = 11)] + #[doc = "The referenced subscription could not be found."] + NoSubscription, + #[codec(index = 12)] + #[doc = "The location is invalid since it already has a subscription from us."] + AlreadySubscribed, + #[codec(index = 13)] + #[doc = "Could not check-out the assets for teleportation to the destination chain."] + CannotCheckOutTeleport, + #[codec(index = 14)] + #[doc = "The owner does not own (all) of the asset that they wish to do the operation on."] + LowBalance, + #[codec(index = 15)] + #[doc = "The asset owner has too many locks on the asset."] + TooManyLocks, + #[codec(index = 16)] + #[doc = "The given account is not an identifiable sovereign account for any location."] + AccountNotSovereign, + #[codec(index = 17)] + #[doc = "The operation required fees to be paid which the initiator could not meet."] + FeesNotMet, + #[codec(index = 18)] + #[doc = "A remote lock with the corresponding data could not be found."] + LockNotFound, + #[codec(index = 19)] + #[doc = "The unlock operation cannot succeed because there are still consumers of the lock."] + InUse, + #[codec(index = 21)] + #[doc = "Invalid asset, reserve chain could not be determined for it."] + InvalidAssetUnknownReserve, + #[codec(index = 22)] + #[doc = "Invalid asset, do not support remote asset reserves with different fees reserves."] + InvalidAssetUnsupportedReserve, + #[codec(index = 23)] + #[doc = "Too many assets with different reserve locations have been attempted for transfer."] + TooManyReserves, + #[codec(index = 24)] + #[doc = "Local XCM execution incomplete."] + LocalExecutionIncomplete, + #[codec(index = 25)] + #[doc = "Too many locations authorized to alias origin."] + TooManyAuthorizedAliases, + #[codec(index = 26)] + #[doc = "Expiry block number is in the past."] + ExpiresInPast, + #[codec(index = 27)] + #[doc = "The alias to remove authorization for was not found."] + AliasNotFound, + #[codec(index = 28)] + #[doc = "Local XCM execution incomplete with the actual XCM error and the index of the"] + #[doc = "instruction that caused the error."] + LocalExecutionIncompleteWithError { + index: ::core::primitive::u8, + error: runtime_types::pallet_xcm::errors::ExecutionError, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "The `Event` enum of this pallet"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Execution of an XCM message was attempted."] + Attempted { + outcome: runtime_types::staging_xcm::v5::traits::Outcome, + }, + #[codec(index = 1)] + #[doc = "An XCM message was sent."] + Sent { + origin: runtime_types::staging_xcm::v5::location::Location, + destination: runtime_types::staging_xcm::v5::location::Location, + message: runtime_types::staging_xcm::v5::Xcm, + message_id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + #[doc = "An XCM message failed to send."] + SendFailed { + origin: runtime_types::staging_xcm::v5::location::Location, + destination: runtime_types::staging_xcm::v5::location::Location, + error: runtime_types::xcm::v3::traits::SendError, + message_id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 3)] + #[doc = "An XCM message failed to process."] + ProcessXcmError { + origin: runtime_types::staging_xcm::v5::location::Location, + error: runtime_types::xcm::v5::traits::Error, + message_id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 4)] + #[doc = "Query response received which does not match a registered query. This may be because a"] + #[doc = "matching query was never registered, it may be because it is a duplicate response, or"] + #[doc = "because the query timed out."] + UnexpectedResponse { + origin: runtime_types::staging_xcm::v5::location::Location, + query_id: ::core::primitive::u64, + }, + #[codec(index = 5)] + #[doc = "Query response has been received and is ready for taking with `take_response`. There is"] + #[doc = "no registered notification call."] + ResponseReady { + query_id: ::core::primitive::u64, + response: runtime_types::staging_xcm::v5::Response, + }, + #[codec(index = 6)] + #[doc = "Query response has been received and query is removed. The registered notification has"] + #[doc = "been dispatched and executed successfully."] + Notified { + query_id: ::core::primitive::u64, + pallet_index: ::core::primitive::u8, + call_index: ::core::primitive::u8, + }, + #[codec(index = 7)] + #[doc = "Query response has been received and query is removed. The registered notification"] + #[doc = "could not be dispatched because the dispatch weight is greater than the maximum weight"] + #[doc = "originally budgeted by this runtime for the query result."] + NotifyOverweight { + query_id: ::core::primitive::u64, + pallet_index: ::core::primitive::u8, + call_index: ::core::primitive::u8, + actual_weight: runtime_types::sp_weights::weight_v2::Weight, + max_budgeted_weight: runtime_types::sp_weights::weight_v2::Weight, + }, + #[codec(index = 8)] + #[doc = "Query response has been received and query is removed. There was a general error with"] + #[doc = "dispatching the notification call."] + NotifyDispatchError { + query_id: ::core::primitive::u64, + pallet_index: ::core::primitive::u8, + call_index: ::core::primitive::u8, + }, + #[codec(index = 9)] + #[doc = "Query response has been received and query is removed. The dispatch was unable to be"] + #[doc = "decoded into a `Call`; this might be due to dispatch function having a signature which"] + #[doc = "is not `(origin, QueryId, Response)`."] + NotifyDecodeFailed { + query_id: ::core::primitive::u64, + pallet_index: ::core::primitive::u8, + call_index: ::core::primitive::u8, + }, + #[codec(index = 10)] + #[doc = "Expected query response has been received but the origin location of the response does"] + #[doc = "not match that expected. The query remains registered for a later, valid, response to"] + #[doc = "be received and acted upon."] + InvalidResponder { + origin: runtime_types::staging_xcm::v5::location::Location, + query_id: ::core::primitive::u64, + expected_location: ::core::option::Option< + runtime_types::staging_xcm::v5::location::Location, + >, + }, + #[codec(index = 11)] + #[doc = "Expected query response has been received but the expected origin location placed in"] + #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] + #[doc = ""] + #[doc = "This is unexpected (since a location placed in storage in a previously executing"] + #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] + #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] + #[doc = "needed."] + InvalidResponderVersion { + origin: runtime_types::staging_xcm::v5::location::Location, + query_id: ::core::primitive::u64, + }, + #[codec(index = 12)] + #[doc = "Received query response has been read and removed."] + ResponseTaken { query_id: ::core::primitive::u64 }, + #[codec(index = 13)] + #[doc = "Some assets have been placed in an asset trap."] + AssetsTrapped { + hash: ::subxt_core::utils::H256, + origin: runtime_types::staging_xcm::v5::location::Location, + assets: runtime_types::xcm::VersionedAssets, + }, + #[codec(index = 14)] + #[doc = "An XCM version change notification message has been attempted to be sent."] + #[doc = ""] + #[doc = "The cost of sending it (borne by the chain) is included."] + VersionChangeNotified { + destination: runtime_types::staging_xcm::v5::location::Location, + result: ::core::primitive::u32, + cost: runtime_types::staging_xcm::v5::asset::Assets, + message_id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 15)] + #[doc = "The supported version of a location has been changed. This might be through an"] + #[doc = "automatic notification or a manual intervention."] + SupportedVersionChanged { + location: runtime_types::staging_xcm::v5::location::Location, + version: ::core::primitive::u32, + }, + #[codec(index = 16)] + #[doc = "A given location which had a version change subscription was dropped owing to an error"] + #[doc = "sending the notification to it."] + NotifyTargetSendFail { + location: runtime_types::staging_xcm::v5::location::Location, + query_id: ::core::primitive::u64, + error: runtime_types::xcm::v5::traits::Error, + }, + #[codec(index = 17)] + #[doc = "A given location which had a version change subscription was dropped owing to an error"] + #[doc = "migrating the location to our new XCM format."] + NotifyTargetMigrationFail { + location: runtime_types::xcm::VersionedLocation, + query_id: ::core::primitive::u64, + }, + #[codec(index = 18)] + #[doc = "Expected query response has been received but the expected querier location placed in"] + #[doc = "storage by this runtime previously cannot be decoded. The query remains registered."] + #[doc = ""] + #[doc = "This is unexpected (since a location placed in storage in a previously executing"] + #[doc = "runtime should be readable prior to query timeout) and dangerous since the possibly"] + #[doc = "valid response will be dropped. Manual governance intervention is probably going to be"] + #[doc = "needed."] + InvalidQuerierVersion { + origin: runtime_types::staging_xcm::v5::location::Location, + query_id: ::core::primitive::u64, + }, + #[codec(index = 19)] + #[doc = "Expected query response has been received but the querier location of the response does"] + #[doc = "not match the expected. The query remains registered for a later, valid, response to"] + #[doc = "be received and acted upon."] + InvalidQuerier { + origin: runtime_types::staging_xcm::v5::location::Location, + query_id: ::core::primitive::u64, + expected_querier: runtime_types::staging_xcm::v5::location::Location, + maybe_actual_querier: ::core::option::Option< + runtime_types::staging_xcm::v5::location::Location, + >, + }, + #[codec(index = 20)] + #[doc = "A remote has requested XCM version change notification from us and we have honored it."] + #[doc = "A version information message is sent to them and its cost is included."] + VersionNotifyStarted { + destination: runtime_types::staging_xcm::v5::location::Location, + cost: runtime_types::staging_xcm::v5::asset::Assets, + message_id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 21)] + #[doc = "We have requested that a remote chain send us XCM version change notifications."] + VersionNotifyRequested { + destination: runtime_types::staging_xcm::v5::location::Location, + cost: runtime_types::staging_xcm::v5::asset::Assets, + message_id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 22)] + #[doc = "We have requested that a remote chain stops sending us XCM version change"] + #[doc = "notifications."] + VersionNotifyUnrequested { + destination: runtime_types::staging_xcm::v5::location::Location, + cost: runtime_types::staging_xcm::v5::asset::Assets, + message_id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 23)] + #[doc = "Fees were paid from a location for an operation (often for using `SendXcm`)."] + FeesPaid { + paying: runtime_types::staging_xcm::v5::location::Location, + fees: runtime_types::staging_xcm::v5::asset::Assets, + }, + #[codec(index = 24)] + #[doc = "Some assets have been claimed from an asset trap"] + AssetsClaimed { + hash: ::subxt_core::utils::H256, + origin: runtime_types::staging_xcm::v5::location::Location, + assets: runtime_types::xcm::VersionedAssets, + }, + #[codec(index = 25)] + #[doc = "A XCM version migration finished."] + VersionMigrationFinished { version: ::core::primitive::u32 }, + #[codec(index = 26)] + #[doc = "An `aliaser` location was authorized by `target` to alias it, authorization valid until"] + #[doc = "`expiry` block number."] + AliasAuthorized { + aliaser: runtime_types::staging_xcm::v5::location::Location, + target: runtime_types::staging_xcm::v5::location::Location, + expiry: ::core::option::Option<::core::primitive::u64>, + }, + #[codec(index = 27)] + #[doc = "`target` removed alias authorization for `aliaser`."] + AliasAuthorizationRemoved { + aliaser: runtime_types::staging_xcm::v5::location::Location, + target: runtime_types::staging_xcm::v5::location::Location, + }, + #[codec(index = 28)] + #[doc = "`target` removed all alias authorizations."] + AliasesAuthorizationsRemoved { + target: runtime_types::staging_xcm::v5::location::Location, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum HoldReason { + #[codec(index = 0)] + AuthorizeAlias, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MaxAuthorizedAliases; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Origin { + #[codec(index = 0)] + Xcm(runtime_types::staging_xcm::v5::location::Location), + #[codec(index = 1)] + Response(runtime_types::staging_xcm::v5::location::Location), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum QueryStatus<_0> { + #[codec(index = 0)] + Pending { + responder: runtime_types::xcm::VersionedLocation, + maybe_match_querier: + ::core::option::Option, + maybe_notify: + ::core::option::Option<(::core::primitive::u8, ::core::primitive::u8)>, + timeout: _0, + }, + #[codec(index = 1)] + VersionNotifier { + origin: runtime_types::xcm::VersionedLocation, + is_active: ::core::primitive::bool, + }, + #[codec(index = 2)] + Ready { + response: runtime_types::xcm::VersionedResponse, + at: _0, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct RemoteLockedFungibleRecord<_0> { + pub amount: ::core::primitive::u128, + pub owner: runtime_types::xcm::VersionedLocation, + pub locker: runtime_types::xcm::VersionedLocation, + pub consumers: runtime_types::bounded_collections::bounded_vec::BoundedVec<( + _0, + ::core::primitive::u128, + )>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum VersionMigrationStage { + #[codec(index = 0)] + MigrateSupportedVersion, + #[codec(index = 1)] + MigrateVersionNotifiers, + #[codec(index = 2)] + NotifyCurrentTargets( + ::core::option::Option< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + ), + #[codec(index = 3)] + MigrateAndNotifyOldTargets, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AuthorizedAliasesEntry<_0, _1> { + pub aliasers: runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::xcm_runtime_apis::authorized_aliases::OriginAliaser, + >, + pub ticket: _0, + #[codec(skip)] + pub __ignore: ::core::marker::PhantomData<_1>, + } + } + pub mod polkadot_core_primitives { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InboundDownwardMessage<_0> { + pub sent_at: _0, + pub msg: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InboundHrmpMessage<_0> { + pub sent_at: _0, + pub data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OutboundHrmpMessage<_0> { + pub recipient: _0, + pub data: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + } + } + pub mod polkadot_parachain_primitives { + use super::runtime_types; + pub mod primitives { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct HeadData(pub ::subxt_core::alloc::vec::Vec<::core::primitive::u8>); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Id(pub ::core::primitive::u32); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ValidationCode(pub ::subxt_core::alloc::vec::Vec<::core::primitive::u8>); + } + } + pub mod polkadot_primitives { + use super::runtime_types; + pub mod v9 { + use super::runtime_types; + pub mod async_backing { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AsyncBackingParams { + pub max_candidate_depth: ::core::primitive::u32, + pub allowed_ancestry_len: ::core::primitive::u32, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AbridgedHostConfiguration { + pub max_code_size: ::core::primitive::u32, + pub max_head_data_size: ::core::primitive::u32, + pub max_upward_queue_count: ::core::primitive::u32, + pub max_upward_queue_size: ::core::primitive::u32, + pub max_upward_message_size: ::core::primitive::u32, + pub max_upward_message_num_per_candidate: ::core::primitive::u32, + pub hrmp_max_message_num_per_candidate: ::core::primitive::u32, + pub validation_upgrade_cooldown: ::core::primitive::u32, + pub validation_upgrade_delay: ::core::primitive::u32, + pub async_backing_params: + runtime_types::polkadot_primitives::v9::async_backing::AsyncBackingParams, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AbridgedHrmpChannel { + pub max_capacity: ::core::primitive::u32, + pub max_total_size: ::core::primitive::u32, + pub max_message_size: ::core::primitive::u32, + pub msg_count: ::core::primitive::u32, + pub total_size: ::core::primitive::u32, + pub mqc_head: ::core::option::Option<::subxt_core::utils::H256>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PersistedValidationData<_0, _1> { + pub parent_head: + runtime_types::polkadot_parachain_primitives::primitives::HeadData, + pub relay_parent_number: _1, + pub relay_parent_storage_root: _0, + pub max_pov_size: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum UpgradeGoAhead { + #[codec(index = 0)] + Abort, + #[codec(index = 1)] + GoAhead, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum UpgradeRestriction { + #[codec(index = 0)] + Present, + } + } + } + pub mod primitive_types { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct U256(pub [::core::primitive::u64; 4usize]); + } + pub mod s3_primitives { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MetadataEntry { + pub key: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub value: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ObjectMetadata { + pub cid: ::subxt_core::utils::H256, + pub size: ::core::primitive::u64, + pub last_modified: ::core::primitive::u64, + pub content_type: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub etag: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub user_metadata: runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::s3_primitives::MetadataEntry, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct S3BucketInfo<_0, _1> { + pub s3_bucket_id: ::core::primitive::u64, + pub name: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub layer0_bucket_id: ::core::primitive::u64, + pub owner: _0, + pub created_at: _1, + pub object_count: ::core::primitive::u64, + pub total_size: ::core::primitive::u64, + } + } + pub mod sp_arithmetic { + use super::runtime_types; + pub mod fixed_point { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct FixedU128(pub ::core::primitive::u128); + } + pub mod per_things { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Perbill(pub ::core::primitive::u32); + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum ArithmeticError { + #[codec(index = 0)] + Underflow, + #[codec(index = 1)] + Overflow, + #[codec(index = 2)] + DivisionByZero, + } + } + pub mod sp_consensus_aura { + use super::runtime_types; + pub mod sr25519 { + use super::runtime_types; + pub mod app_sr25519 { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Public(pub [::core::primitive::u8; 32usize]); + } + } + } + pub mod sp_consensus_slots { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Slot(pub ::core::primitive::u64); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct SlotDuration(pub ::core::primitive::u64); + } + pub mod sp_core { + use super::runtime_types; + pub mod crypto { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OpaqueMetadata(pub ::subxt_core::alloc::vec::Vec<::core::primitive::u8>); + } + pub mod sp_inherents { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckInherentsResult { + pub okay: ::core::primitive::bool, + pub fatal_error: ::core::primitive::bool, + pub errors: runtime_types::sp_inherents::InherentData, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InherentData { + pub data: ::subxt_core::utils::KeyedVec< + [::core::primitive::u8; 8usize], + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + } + } + pub mod sp_runtime { + use super::runtime_types; + pub mod generic { + use super::runtime_types; + pub mod block { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Block<_0, _1> { + pub header: _0, + pub extrinsics: ::subxt_core::alloc::vec::Vec<_1>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct LazyBlock<_0, _1> { + pub header: _0, + pub extrinsics: ::subxt_core::alloc::vec::Vec< + runtime_types::sp_runtime::OpaqueExtrinsic, + >, + #[codec(skip)] + pub __ignore: ::core::marker::PhantomData<_1>, + } + } + pub mod digest { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Digest { + pub logs: ::subxt_core::alloc::vec::Vec< + runtime_types::sp_runtime::generic::digest::DigestItem, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum DigestItem { + #[codec(index = 6)] + PreRuntime( + [::core::primitive::u8; 4usize], + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 4)] + Consensus( + [::core::primitive::u8; 4usize], + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 5)] + Seal( + [::core::primitive::u8; 4usize], + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 0)] + Other(::subxt_core::alloc::vec::Vec<::core::primitive::u8>), + #[codec(index = 8)] + RuntimeEnvironmentUpdated, + } + } + pub mod era { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Era { + #[codec(index = 0)] + Immortal, + #[codec(index = 1)] + Mortal1(::core::primitive::u8), + #[codec(index = 2)] + Mortal2(::core::primitive::u8), + #[codec(index = 3)] + Mortal3(::core::primitive::u8), + #[codec(index = 4)] + Mortal4(::core::primitive::u8), + #[codec(index = 5)] + Mortal5(::core::primitive::u8), + #[codec(index = 6)] + Mortal6(::core::primitive::u8), + #[codec(index = 7)] + Mortal7(::core::primitive::u8), + #[codec(index = 8)] + Mortal8(::core::primitive::u8), + #[codec(index = 9)] + Mortal9(::core::primitive::u8), + #[codec(index = 10)] + Mortal10(::core::primitive::u8), + #[codec(index = 11)] + Mortal11(::core::primitive::u8), + #[codec(index = 12)] + Mortal12(::core::primitive::u8), + #[codec(index = 13)] + Mortal13(::core::primitive::u8), + #[codec(index = 14)] + Mortal14(::core::primitive::u8), + #[codec(index = 15)] + Mortal15(::core::primitive::u8), + #[codec(index = 16)] + Mortal16(::core::primitive::u8), + #[codec(index = 17)] + Mortal17(::core::primitive::u8), + #[codec(index = 18)] + Mortal18(::core::primitive::u8), + #[codec(index = 19)] + Mortal19(::core::primitive::u8), + #[codec(index = 20)] + Mortal20(::core::primitive::u8), + #[codec(index = 21)] + Mortal21(::core::primitive::u8), + #[codec(index = 22)] + Mortal22(::core::primitive::u8), + #[codec(index = 23)] + Mortal23(::core::primitive::u8), + #[codec(index = 24)] + Mortal24(::core::primitive::u8), + #[codec(index = 25)] + Mortal25(::core::primitive::u8), + #[codec(index = 26)] + Mortal26(::core::primitive::u8), + #[codec(index = 27)] + Mortal27(::core::primitive::u8), + #[codec(index = 28)] + Mortal28(::core::primitive::u8), + #[codec(index = 29)] + Mortal29(::core::primitive::u8), + #[codec(index = 30)] + Mortal30(::core::primitive::u8), + #[codec(index = 31)] + Mortal31(::core::primitive::u8), + #[codec(index = 32)] + Mortal32(::core::primitive::u8), + #[codec(index = 33)] + Mortal33(::core::primitive::u8), + #[codec(index = 34)] + Mortal34(::core::primitive::u8), + #[codec(index = 35)] + Mortal35(::core::primitive::u8), + #[codec(index = 36)] + Mortal36(::core::primitive::u8), + #[codec(index = 37)] + Mortal37(::core::primitive::u8), + #[codec(index = 38)] + Mortal38(::core::primitive::u8), + #[codec(index = 39)] + Mortal39(::core::primitive::u8), + #[codec(index = 40)] + Mortal40(::core::primitive::u8), + #[codec(index = 41)] + Mortal41(::core::primitive::u8), + #[codec(index = 42)] + Mortal42(::core::primitive::u8), + #[codec(index = 43)] + Mortal43(::core::primitive::u8), + #[codec(index = 44)] + Mortal44(::core::primitive::u8), + #[codec(index = 45)] + Mortal45(::core::primitive::u8), + #[codec(index = 46)] + Mortal46(::core::primitive::u8), + #[codec(index = 47)] + Mortal47(::core::primitive::u8), + #[codec(index = 48)] + Mortal48(::core::primitive::u8), + #[codec(index = 49)] + Mortal49(::core::primitive::u8), + #[codec(index = 50)] + Mortal50(::core::primitive::u8), + #[codec(index = 51)] + Mortal51(::core::primitive::u8), + #[codec(index = 52)] + Mortal52(::core::primitive::u8), + #[codec(index = 53)] + Mortal53(::core::primitive::u8), + #[codec(index = 54)] + Mortal54(::core::primitive::u8), + #[codec(index = 55)] + Mortal55(::core::primitive::u8), + #[codec(index = 56)] + Mortal56(::core::primitive::u8), + #[codec(index = 57)] + Mortal57(::core::primitive::u8), + #[codec(index = 58)] + Mortal58(::core::primitive::u8), + #[codec(index = 59)] + Mortal59(::core::primitive::u8), + #[codec(index = 60)] + Mortal60(::core::primitive::u8), + #[codec(index = 61)] + Mortal61(::core::primitive::u8), + #[codec(index = 62)] + Mortal62(::core::primitive::u8), + #[codec(index = 63)] + Mortal63(::core::primitive::u8), + #[codec(index = 64)] + Mortal64(::core::primitive::u8), + #[codec(index = 65)] + Mortal65(::core::primitive::u8), + #[codec(index = 66)] + Mortal66(::core::primitive::u8), + #[codec(index = 67)] + Mortal67(::core::primitive::u8), + #[codec(index = 68)] + Mortal68(::core::primitive::u8), + #[codec(index = 69)] + Mortal69(::core::primitive::u8), + #[codec(index = 70)] + Mortal70(::core::primitive::u8), + #[codec(index = 71)] + Mortal71(::core::primitive::u8), + #[codec(index = 72)] + Mortal72(::core::primitive::u8), + #[codec(index = 73)] + Mortal73(::core::primitive::u8), + #[codec(index = 74)] + Mortal74(::core::primitive::u8), + #[codec(index = 75)] + Mortal75(::core::primitive::u8), + #[codec(index = 76)] + Mortal76(::core::primitive::u8), + #[codec(index = 77)] + Mortal77(::core::primitive::u8), + #[codec(index = 78)] + Mortal78(::core::primitive::u8), + #[codec(index = 79)] + Mortal79(::core::primitive::u8), + #[codec(index = 80)] + Mortal80(::core::primitive::u8), + #[codec(index = 81)] + Mortal81(::core::primitive::u8), + #[codec(index = 82)] + Mortal82(::core::primitive::u8), + #[codec(index = 83)] + Mortal83(::core::primitive::u8), + #[codec(index = 84)] + Mortal84(::core::primitive::u8), + #[codec(index = 85)] + Mortal85(::core::primitive::u8), + #[codec(index = 86)] + Mortal86(::core::primitive::u8), + #[codec(index = 87)] + Mortal87(::core::primitive::u8), + #[codec(index = 88)] + Mortal88(::core::primitive::u8), + #[codec(index = 89)] + Mortal89(::core::primitive::u8), + #[codec(index = 90)] + Mortal90(::core::primitive::u8), + #[codec(index = 91)] + Mortal91(::core::primitive::u8), + #[codec(index = 92)] + Mortal92(::core::primitive::u8), + #[codec(index = 93)] + Mortal93(::core::primitive::u8), + #[codec(index = 94)] + Mortal94(::core::primitive::u8), + #[codec(index = 95)] + Mortal95(::core::primitive::u8), + #[codec(index = 96)] + Mortal96(::core::primitive::u8), + #[codec(index = 97)] + Mortal97(::core::primitive::u8), + #[codec(index = 98)] + Mortal98(::core::primitive::u8), + #[codec(index = 99)] + Mortal99(::core::primitive::u8), + #[codec(index = 100)] + Mortal100(::core::primitive::u8), + #[codec(index = 101)] + Mortal101(::core::primitive::u8), + #[codec(index = 102)] + Mortal102(::core::primitive::u8), + #[codec(index = 103)] + Mortal103(::core::primitive::u8), + #[codec(index = 104)] + Mortal104(::core::primitive::u8), + #[codec(index = 105)] + Mortal105(::core::primitive::u8), + #[codec(index = 106)] + Mortal106(::core::primitive::u8), + #[codec(index = 107)] + Mortal107(::core::primitive::u8), + #[codec(index = 108)] + Mortal108(::core::primitive::u8), + #[codec(index = 109)] + Mortal109(::core::primitive::u8), + #[codec(index = 110)] + Mortal110(::core::primitive::u8), + #[codec(index = 111)] + Mortal111(::core::primitive::u8), + #[codec(index = 112)] + Mortal112(::core::primitive::u8), + #[codec(index = 113)] + Mortal113(::core::primitive::u8), + #[codec(index = 114)] + Mortal114(::core::primitive::u8), + #[codec(index = 115)] + Mortal115(::core::primitive::u8), + #[codec(index = 116)] + Mortal116(::core::primitive::u8), + #[codec(index = 117)] + Mortal117(::core::primitive::u8), + #[codec(index = 118)] + Mortal118(::core::primitive::u8), + #[codec(index = 119)] + Mortal119(::core::primitive::u8), + #[codec(index = 120)] + Mortal120(::core::primitive::u8), + #[codec(index = 121)] + Mortal121(::core::primitive::u8), + #[codec(index = 122)] + Mortal122(::core::primitive::u8), + #[codec(index = 123)] + Mortal123(::core::primitive::u8), + #[codec(index = 124)] + Mortal124(::core::primitive::u8), + #[codec(index = 125)] + Mortal125(::core::primitive::u8), + #[codec(index = 126)] + Mortal126(::core::primitive::u8), + #[codec(index = 127)] + Mortal127(::core::primitive::u8), + #[codec(index = 128)] + Mortal128(::core::primitive::u8), + #[codec(index = 129)] + Mortal129(::core::primitive::u8), + #[codec(index = 130)] + Mortal130(::core::primitive::u8), + #[codec(index = 131)] + Mortal131(::core::primitive::u8), + #[codec(index = 132)] + Mortal132(::core::primitive::u8), + #[codec(index = 133)] + Mortal133(::core::primitive::u8), + #[codec(index = 134)] + Mortal134(::core::primitive::u8), + #[codec(index = 135)] + Mortal135(::core::primitive::u8), + #[codec(index = 136)] + Mortal136(::core::primitive::u8), + #[codec(index = 137)] + Mortal137(::core::primitive::u8), + #[codec(index = 138)] + Mortal138(::core::primitive::u8), + #[codec(index = 139)] + Mortal139(::core::primitive::u8), + #[codec(index = 140)] + Mortal140(::core::primitive::u8), + #[codec(index = 141)] + Mortal141(::core::primitive::u8), + #[codec(index = 142)] + Mortal142(::core::primitive::u8), + #[codec(index = 143)] + Mortal143(::core::primitive::u8), + #[codec(index = 144)] + Mortal144(::core::primitive::u8), + #[codec(index = 145)] + Mortal145(::core::primitive::u8), + #[codec(index = 146)] + Mortal146(::core::primitive::u8), + #[codec(index = 147)] + Mortal147(::core::primitive::u8), + #[codec(index = 148)] + Mortal148(::core::primitive::u8), + #[codec(index = 149)] + Mortal149(::core::primitive::u8), + #[codec(index = 150)] + Mortal150(::core::primitive::u8), + #[codec(index = 151)] + Mortal151(::core::primitive::u8), + #[codec(index = 152)] + Mortal152(::core::primitive::u8), + #[codec(index = 153)] + Mortal153(::core::primitive::u8), + #[codec(index = 154)] + Mortal154(::core::primitive::u8), + #[codec(index = 155)] + Mortal155(::core::primitive::u8), + #[codec(index = 156)] + Mortal156(::core::primitive::u8), + #[codec(index = 157)] + Mortal157(::core::primitive::u8), + #[codec(index = 158)] + Mortal158(::core::primitive::u8), + #[codec(index = 159)] + Mortal159(::core::primitive::u8), + #[codec(index = 160)] + Mortal160(::core::primitive::u8), + #[codec(index = 161)] + Mortal161(::core::primitive::u8), + #[codec(index = 162)] + Mortal162(::core::primitive::u8), + #[codec(index = 163)] + Mortal163(::core::primitive::u8), + #[codec(index = 164)] + Mortal164(::core::primitive::u8), + #[codec(index = 165)] + Mortal165(::core::primitive::u8), + #[codec(index = 166)] + Mortal166(::core::primitive::u8), + #[codec(index = 167)] + Mortal167(::core::primitive::u8), + #[codec(index = 168)] + Mortal168(::core::primitive::u8), + #[codec(index = 169)] + Mortal169(::core::primitive::u8), + #[codec(index = 170)] + Mortal170(::core::primitive::u8), + #[codec(index = 171)] + Mortal171(::core::primitive::u8), + #[codec(index = 172)] + Mortal172(::core::primitive::u8), + #[codec(index = 173)] + Mortal173(::core::primitive::u8), + #[codec(index = 174)] + Mortal174(::core::primitive::u8), + #[codec(index = 175)] + Mortal175(::core::primitive::u8), + #[codec(index = 176)] + Mortal176(::core::primitive::u8), + #[codec(index = 177)] + Mortal177(::core::primitive::u8), + #[codec(index = 178)] + Mortal178(::core::primitive::u8), + #[codec(index = 179)] + Mortal179(::core::primitive::u8), + #[codec(index = 180)] + Mortal180(::core::primitive::u8), + #[codec(index = 181)] + Mortal181(::core::primitive::u8), + #[codec(index = 182)] + Mortal182(::core::primitive::u8), + #[codec(index = 183)] + Mortal183(::core::primitive::u8), + #[codec(index = 184)] + Mortal184(::core::primitive::u8), + #[codec(index = 185)] + Mortal185(::core::primitive::u8), + #[codec(index = 186)] + Mortal186(::core::primitive::u8), + #[codec(index = 187)] + Mortal187(::core::primitive::u8), + #[codec(index = 188)] + Mortal188(::core::primitive::u8), + #[codec(index = 189)] + Mortal189(::core::primitive::u8), + #[codec(index = 190)] + Mortal190(::core::primitive::u8), + #[codec(index = 191)] + Mortal191(::core::primitive::u8), + #[codec(index = 192)] + Mortal192(::core::primitive::u8), + #[codec(index = 193)] + Mortal193(::core::primitive::u8), + #[codec(index = 194)] + Mortal194(::core::primitive::u8), + #[codec(index = 195)] + Mortal195(::core::primitive::u8), + #[codec(index = 196)] + Mortal196(::core::primitive::u8), + #[codec(index = 197)] + Mortal197(::core::primitive::u8), + #[codec(index = 198)] + Mortal198(::core::primitive::u8), + #[codec(index = 199)] + Mortal199(::core::primitive::u8), + #[codec(index = 200)] + Mortal200(::core::primitive::u8), + #[codec(index = 201)] + Mortal201(::core::primitive::u8), + #[codec(index = 202)] + Mortal202(::core::primitive::u8), + #[codec(index = 203)] + Mortal203(::core::primitive::u8), + #[codec(index = 204)] + Mortal204(::core::primitive::u8), + #[codec(index = 205)] + Mortal205(::core::primitive::u8), + #[codec(index = 206)] + Mortal206(::core::primitive::u8), + #[codec(index = 207)] + Mortal207(::core::primitive::u8), + #[codec(index = 208)] + Mortal208(::core::primitive::u8), + #[codec(index = 209)] + Mortal209(::core::primitive::u8), + #[codec(index = 210)] + Mortal210(::core::primitive::u8), + #[codec(index = 211)] + Mortal211(::core::primitive::u8), + #[codec(index = 212)] + Mortal212(::core::primitive::u8), + #[codec(index = 213)] + Mortal213(::core::primitive::u8), + #[codec(index = 214)] + Mortal214(::core::primitive::u8), + #[codec(index = 215)] + Mortal215(::core::primitive::u8), + #[codec(index = 216)] + Mortal216(::core::primitive::u8), + #[codec(index = 217)] + Mortal217(::core::primitive::u8), + #[codec(index = 218)] + Mortal218(::core::primitive::u8), + #[codec(index = 219)] + Mortal219(::core::primitive::u8), + #[codec(index = 220)] + Mortal220(::core::primitive::u8), + #[codec(index = 221)] + Mortal221(::core::primitive::u8), + #[codec(index = 222)] + Mortal222(::core::primitive::u8), + #[codec(index = 223)] + Mortal223(::core::primitive::u8), + #[codec(index = 224)] + Mortal224(::core::primitive::u8), + #[codec(index = 225)] + Mortal225(::core::primitive::u8), + #[codec(index = 226)] + Mortal226(::core::primitive::u8), + #[codec(index = 227)] + Mortal227(::core::primitive::u8), + #[codec(index = 228)] + Mortal228(::core::primitive::u8), + #[codec(index = 229)] + Mortal229(::core::primitive::u8), + #[codec(index = 230)] + Mortal230(::core::primitive::u8), + #[codec(index = 231)] + Mortal231(::core::primitive::u8), + #[codec(index = 232)] + Mortal232(::core::primitive::u8), + #[codec(index = 233)] + Mortal233(::core::primitive::u8), + #[codec(index = 234)] + Mortal234(::core::primitive::u8), + #[codec(index = 235)] + Mortal235(::core::primitive::u8), + #[codec(index = 236)] + Mortal236(::core::primitive::u8), + #[codec(index = 237)] + Mortal237(::core::primitive::u8), + #[codec(index = 238)] + Mortal238(::core::primitive::u8), + #[codec(index = 239)] + Mortal239(::core::primitive::u8), + #[codec(index = 240)] + Mortal240(::core::primitive::u8), + #[codec(index = 241)] + Mortal241(::core::primitive::u8), + #[codec(index = 242)] + Mortal242(::core::primitive::u8), + #[codec(index = 243)] + Mortal243(::core::primitive::u8), + #[codec(index = 244)] + Mortal244(::core::primitive::u8), + #[codec(index = 245)] + Mortal245(::core::primitive::u8), + #[codec(index = 246)] + Mortal246(::core::primitive::u8), + #[codec(index = 247)] + Mortal247(::core::primitive::u8), + #[codec(index = 248)] + Mortal248(::core::primitive::u8), + #[codec(index = 249)] + Mortal249(::core::primitive::u8), + #[codec(index = 250)] + Mortal250(::core::primitive::u8), + #[codec(index = 251)] + Mortal251(::core::primitive::u8), + #[codec(index = 252)] + Mortal252(::core::primitive::u8), + #[codec(index = 253)] + Mortal253(::core::primitive::u8), + #[codec(index = 254)] + Mortal254(::core::primitive::u8), + #[codec(index = 255)] + Mortal255(::core::primitive::u8), + } + } + pub mod header { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Header<_0> { + pub parent_hash: ::subxt_core::utils::H256, + #[codec(compact)] + pub number: _0, + pub state_root: ::subxt_core::utils::H256, + pub extrinsics_root: ::subxt_core::utils::H256, + pub digest: runtime_types::sp_runtime::generic::digest::Digest, + } + } + } + pub mod proving_trie { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum TrieError { + #[codec(index = 0)] + InvalidStateRoot, + #[codec(index = 1)] + IncompleteDatabase, + #[codec(index = 2)] + ValueAtIncompleteKey, + #[codec(index = 3)] + DecoderError, + #[codec(index = 4)] + InvalidHash, + #[codec(index = 5)] + DuplicateKey, + #[codec(index = 6)] + ExtraneousNode, + #[codec(index = 7)] + ExtraneousValue, + #[codec(index = 8)] + ExtraneousHashReference, + #[codec(index = 9)] + InvalidChildReference, + #[codec(index = 10)] + ValueMismatch, + #[codec(index = 11)] + IncompleteProof, + #[codec(index = 12)] + RootMismatch, + #[codec(index = 13)] + DecodeError, + } + } + pub mod traits { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BlakeTwo256; + } + pub mod transaction_validity { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum InvalidTransaction { + #[codec(index = 0)] + Call, + #[codec(index = 1)] + Payment, + #[codec(index = 2)] + Future, + #[codec(index = 3)] + Stale, + #[codec(index = 4)] + BadProof, + #[codec(index = 5)] + AncientBirthBlock, + #[codec(index = 6)] + ExhaustsResources, + #[codec(index = 7)] + Custom(::core::primitive::u8), + #[codec(index = 8)] + BadMandatory, + #[codec(index = 9)] + MandatoryValidation, + #[codec(index = 10)] + BadSigner, + #[codec(index = 11)] + IndeterminateImplicit, + #[codec(index = 12)] + UnknownOrigin, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum TransactionSource { + #[codec(index = 0)] + InBlock, + #[codec(index = 1)] + Local, + #[codec(index = 2)] + External, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum TransactionValidityError { + #[codec(index = 0)] + Invalid(runtime_types::sp_runtime::transaction_validity::InvalidTransaction), + #[codec(index = 1)] + Unknown(runtime_types::sp_runtime::transaction_validity::UnknownTransaction), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum UnknownTransaction { + #[codec(index = 0)] + CannotLookup, + #[codec(index = 1)] + NoUnsignedValidator, + #[codec(index = 2)] + Custom(::core::primitive::u8), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ValidTransaction { + pub priority: ::core::primitive::u64, + pub requires: ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + pub provides: ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + pub longevity: ::core::primitive::u64, + pub propagate: ::core::primitive::bool, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum DispatchError { + #[codec(index = 0)] + Other, + #[codec(index = 1)] + CannotLookup, + #[codec(index = 2)] + BadOrigin, + #[codec(index = 3)] + Module(runtime_types::sp_runtime::ModuleError), + #[codec(index = 4)] + ConsumerRemaining, + #[codec(index = 5)] + NoProviders, + #[codec(index = 6)] + TooManyConsumers, + #[codec(index = 7)] + Token(runtime_types::sp_runtime::TokenError), + #[codec(index = 8)] + Arithmetic(runtime_types::sp_arithmetic::ArithmeticError), + #[codec(index = 9)] + Transactional(runtime_types::sp_runtime::TransactionalError), + #[codec(index = 10)] + Exhausted, + #[codec(index = 11)] + Corruption, + #[codec(index = 12)] + Unavailable, + #[codec(index = 13)] + RootNotAllowed, + #[codec(index = 14)] + Trie(runtime_types::sp_runtime::proving_trie::TrieError), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DispatchErrorWithPostInfo<_0> { + pub post_info: _0, + pub error: runtime_types::sp_runtime::DispatchError, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum ExtrinsicInclusionMode { + #[codec(index = 0)] + AllExtrinsics, + #[codec(index = 1)] + OnlyInherents, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ModuleError { + pub index: ::core::primitive::u8, + pub error: [::core::primitive::u8; 4usize], + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + codec :: Decode, + codec :: Encode, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum MultiSignature { + #[codec(index = 0)] + Ed25519([::core::primitive::u8; 64usize]), + #[codec(index = 1)] + Sr25519([::core::primitive::u8; 64usize]), + #[codec(index = 2)] + Ecdsa([::core::primitive::u8; 65usize]), + #[codec(index = 3)] + Eth([::core::primitive::u8; 65usize]), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OpaqueExtrinsic(pub ::subxt_core::alloc::vec::Vec<::core::primitive::u8>); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum TokenError { + #[codec(index = 0)] + FundsUnavailable, + #[codec(index = 1)] + OnlyProvider, + #[codec(index = 2)] + BelowMinimum, + #[codec(index = 3)] + CannotCreate, + #[codec(index = 4)] + UnknownAsset, + #[codec(index = 5)] + Frozen, + #[codec(index = 6)] + Unsupported, + #[codec(index = 7)] + CannotCreateHold, + #[codec(index = 8)] + NotExpendable, + #[codec(index = 9)] + Blocked, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum TransactionalError { + #[codec(index = 0)] + LimitReached, + #[codec(index = 1)] + NoLayer, + } + } + pub mod sp_session { + use super::runtime_types; + pub mod runtime_api { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OpaqueGeneratedSessionKeys { + pub keys: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub proof: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + } + } + } + pub mod sp_staking { + use super::runtime_types; + pub mod offence { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OffenceSeverity(pub runtime_types::sp_arithmetic::per_things::Perbill); + } + } + pub mod sp_trie { + use super::runtime_types; + pub mod storage_proof { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct StorageProof { + pub trie_nodes: ::subxt_core::alloc::vec::Vec< + ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + >, + } + } + } + pub mod sp_version { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct RuntimeVersion { + pub spec_name: ::subxt_core::alloc::string::String, + pub impl_name: ::subxt_core::alloc::string::String, + pub authoring_version: ::core::primitive::u32, + pub spec_version: ::core::primitive::u32, + pub impl_version: ::core::primitive::u32, + pub apis: ::subxt_core::alloc::vec::Vec<( + [::core::primitive::u8; 8usize], + ::core::primitive::u32, + )>, + pub transaction_version: ::core::primitive::u32, + pub system_version: ::core::primitive::u8, + } + } + pub mod sp_weights { + use super::runtime_types; + pub mod weight_v2 { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Weight { + #[codec(compact)] + pub ref_time: ::core::primitive::u64, + #[codec(compact)] + pub proof_size: ::core::primitive::u64, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct RuntimeDbWeight { + pub read: ::core::primitive::u64, + pub write: ::core::primitive::u64, + } + } + pub mod staging_parachain_info { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] + pub enum Call {} + } + } + pub mod staging_xcm { + use super::runtime_types; + pub mod v3 { + use super::runtime_types; + pub mod multilocation { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MultiLocation { + pub parents: ::core::primitive::u8, + pub interior: runtime_types::xcm::v3::junctions::Junctions, + } + } + } + pub mod v4 { + use super::runtime_types; + pub mod asset { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Asset { + pub id: runtime_types::staging_xcm::v4::asset::AssetId, + pub fun: runtime_types::staging_xcm::v4::asset::Fungibility, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AssetFilter { + #[codec(index = 0)] + Definite(runtime_types::staging_xcm::v4::asset::Assets), + #[codec(index = 1)] + Wild(runtime_types::staging_xcm::v4::asset::WildAsset), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AssetId(pub runtime_types::staging_xcm::v4::location::Location); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AssetInstance { + #[codec(index = 0)] + Undefined, + #[codec(index = 1)] + Index(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 2)] + Array4([::core::primitive::u8; 4usize]), + #[codec(index = 3)] + Array8([::core::primitive::u8; 8usize]), + #[codec(index = 4)] + Array16([::core::primitive::u8; 16usize]), + #[codec(index = 5)] + Array32([::core::primitive::u8; 32usize]), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Assets( + pub ::subxt_core::alloc::vec::Vec< + runtime_types::staging_xcm::v4::asset::Asset, + >, + ); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Fungibility { + #[codec(index = 0)] + Fungible(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 1)] + NonFungible(runtime_types::staging_xcm::v4::asset::AssetInstance), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum WildAsset { + #[codec(index = 0)] + All, + #[codec(index = 1)] + AllOf { + id: runtime_types::staging_xcm::v4::asset::AssetId, + fun: runtime_types::staging_xcm::v4::asset::WildFungibility, + }, + #[codec(index = 2)] + AllCounted(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 3)] + AllOfCounted { + id: runtime_types::staging_xcm::v4::asset::AssetId, + fun: runtime_types::staging_xcm::v4::asset::WildFungibility, + #[codec(compact)] + count: ::core::primitive::u32, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum WildFungibility { + #[codec(index = 0)] + Fungible, + #[codec(index = 1)] + NonFungible, + } + } + pub mod junction { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Junction { + #[codec(index = 0)] + Parachain(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 1)] + AccountId32 { + network: ::core::option::Option< + runtime_types::staging_xcm::v4::junction::NetworkId, + >, + id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + AccountIndex64 { + network: ::core::option::Option< + runtime_types::staging_xcm::v4::junction::NetworkId, + >, + #[codec(compact)] + index: ::core::primitive::u64, + }, + #[codec(index = 3)] + AccountKey20 { + network: ::core::option::Option< + runtime_types::staging_xcm::v4::junction::NetworkId, + >, + key: [::core::primitive::u8; 20usize], + }, + #[codec(index = 4)] + PalletInstance(::core::primitive::u8), + #[codec(index = 5)] + GeneralIndex(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 6)] + GeneralKey { + length: ::core::primitive::u8, + data: [::core::primitive::u8; 32usize], + }, + #[codec(index = 7)] + OnlyChild, + #[codec(index = 8)] + Plurality { + id: runtime_types::xcm::v3::junction::BodyId, + part: runtime_types::xcm::v3::junction::BodyPart, + }, + #[codec(index = 9)] + GlobalConsensus(runtime_types::staging_xcm::v4::junction::NetworkId), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum NetworkId { + #[codec(index = 0)] + ByGenesis([::core::primitive::u8; 32usize]), + #[codec(index = 1)] + ByFork { + block_number: ::core::primitive::u64, + block_hash: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + Polkadot, + #[codec(index = 3)] + Kusama, + #[codec(index = 4)] + Westend, + #[codec(index = 5)] + Rococo, + #[codec(index = 6)] + Wococo, + #[codec(index = 7)] + Ethereum { + #[codec(compact)] + chain_id: ::core::primitive::u64, + }, + #[codec(index = 8)] + BitcoinCore, + #[codec(index = 9)] + BitcoinCash, + #[codec(index = 10)] + PolkadotBulletin, + } + } + pub mod junctions { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Junctions { + #[codec(index = 0)] + Here, + #[codec(index = 1)] + X1([runtime_types::staging_xcm::v4::junction::Junction; 1usize]), + #[codec(index = 2)] + X2([runtime_types::staging_xcm::v4::junction::Junction; 2usize]), + #[codec(index = 3)] + X3([runtime_types::staging_xcm::v4::junction::Junction; 3usize]), + #[codec(index = 4)] + X4([runtime_types::staging_xcm::v4::junction::Junction; 4usize]), + #[codec(index = 5)] + X5([runtime_types::staging_xcm::v4::junction::Junction; 5usize]), + #[codec(index = 6)] + X6([runtime_types::staging_xcm::v4::junction::Junction; 6usize]), + #[codec(index = 7)] + X7([runtime_types::staging_xcm::v4::junction::Junction; 7usize]), + #[codec(index = 8)] + X8([runtime_types::staging_xcm::v4::junction::Junction; 8usize]), + } + } + pub mod location { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Location { + pub parents: ::core::primitive::u8, + pub interior: runtime_types::staging_xcm::v4::junctions::Junctions, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Instruction { + #[codec(index = 0)] + WithdrawAsset(runtime_types::staging_xcm::v4::asset::Assets), + #[codec(index = 1)] + ReserveAssetDeposited(runtime_types::staging_xcm::v4::asset::Assets), + #[codec(index = 2)] + ReceiveTeleportedAsset(runtime_types::staging_xcm::v4::asset::Assets), + #[codec(index = 3)] + QueryResponse { + #[codec(compact)] + query_id: ::core::primitive::u64, + response: runtime_types::staging_xcm::v4::Response, + max_weight: runtime_types::sp_weights::weight_v2::Weight, + querier: ::core::option::Option< + runtime_types::staging_xcm::v4::location::Location, + >, + }, + #[codec(index = 4)] + TransferAsset { + assets: runtime_types::staging_xcm::v4::asset::Assets, + beneficiary: runtime_types::staging_xcm::v4::location::Location, + }, + #[codec(index = 5)] + TransferReserveAsset { + assets: runtime_types::staging_xcm::v4::asset::Assets, + dest: runtime_types::staging_xcm::v4::location::Location, + xcm: runtime_types::staging_xcm::v4::Xcm, + }, + #[codec(index = 6)] + Transact { + origin_kind: runtime_types::xcm::v3::OriginKind, + require_weight_at_most: runtime_types::sp_weights::weight_v2::Weight, + call: runtime_types::xcm::double_encoded::DoubleEncoded, + }, + #[codec(index = 7)] + HrmpNewChannelOpenRequest { + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + max_message_size: ::core::primitive::u32, + #[codec(compact)] + max_capacity: ::core::primitive::u32, + }, + #[codec(index = 8)] + HrmpChannelAccepted { + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 9)] + HrmpChannelClosing { + #[codec(compact)] + initiator: ::core::primitive::u32, + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 10)] + ClearOrigin, + #[codec(index = 11)] + DescendOrigin(runtime_types::staging_xcm::v4::junctions::Junctions), + #[codec(index = 12)] + ReportError(runtime_types::staging_xcm::v4::QueryResponseInfo), + #[codec(index = 13)] + DepositAsset { + assets: runtime_types::staging_xcm::v4::asset::AssetFilter, + beneficiary: runtime_types::staging_xcm::v4::location::Location, + }, + #[codec(index = 14)] + DepositReserveAsset { + assets: runtime_types::staging_xcm::v4::asset::AssetFilter, + dest: runtime_types::staging_xcm::v4::location::Location, + xcm: runtime_types::staging_xcm::v4::Xcm, + }, + #[codec(index = 15)] + ExchangeAsset { + give: runtime_types::staging_xcm::v4::asset::AssetFilter, + want: runtime_types::staging_xcm::v4::asset::Assets, + maximal: ::core::primitive::bool, + }, + #[codec(index = 16)] + InitiateReserveWithdraw { + assets: runtime_types::staging_xcm::v4::asset::AssetFilter, + reserve: runtime_types::staging_xcm::v4::location::Location, + xcm: runtime_types::staging_xcm::v4::Xcm, + }, + #[codec(index = 17)] + InitiateTeleport { + assets: runtime_types::staging_xcm::v4::asset::AssetFilter, + dest: runtime_types::staging_xcm::v4::location::Location, + xcm: runtime_types::staging_xcm::v4::Xcm, + }, + #[codec(index = 18)] + ReportHolding { + response_info: runtime_types::staging_xcm::v4::QueryResponseInfo, + assets: runtime_types::staging_xcm::v4::asset::AssetFilter, + }, + #[codec(index = 19)] + BuyExecution { + fees: runtime_types::staging_xcm::v4::asset::Asset, + weight_limit: runtime_types::xcm::v3::WeightLimit, + }, + #[codec(index = 20)] + RefundSurplus, + #[codec(index = 21)] + SetErrorHandler(runtime_types::staging_xcm::v4::Xcm), + #[codec(index = 22)] + SetAppendix(runtime_types::staging_xcm::v4::Xcm), + #[codec(index = 23)] + ClearError, + #[codec(index = 24)] + ClaimAsset { + assets: runtime_types::staging_xcm::v4::asset::Assets, + ticket: runtime_types::staging_xcm::v4::location::Location, + }, + #[codec(index = 25)] + Trap(#[codec(compact)] ::core::primitive::u64), + #[codec(index = 26)] + SubscribeVersion { + #[codec(compact)] + query_id: ::core::primitive::u64, + max_response_weight: runtime_types::sp_weights::weight_v2::Weight, + }, + #[codec(index = 27)] + UnsubscribeVersion, + #[codec(index = 28)] + BurnAsset(runtime_types::staging_xcm::v4::asset::Assets), + #[codec(index = 29)] + ExpectAsset(runtime_types::staging_xcm::v4::asset::Assets), + #[codec(index = 30)] + ExpectOrigin( + ::core::option::Option, + ), + #[codec(index = 31)] + ExpectError( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v3::traits::Error, + )>, + ), + #[codec(index = 32)] + ExpectTransactStatus(runtime_types::xcm::v3::MaybeErrorCode), + #[codec(index = 33)] + QueryPallet { + module_name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + response_info: runtime_types::staging_xcm::v4::QueryResponseInfo, + }, + #[codec(index = 34)] + ExpectPallet { + #[codec(compact)] + index: ::core::primitive::u32, + name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + #[codec(compact)] + crate_major: ::core::primitive::u32, + #[codec(compact)] + min_crate_minor: ::core::primitive::u32, + }, + #[codec(index = 35)] + ReportTransactStatus(runtime_types::staging_xcm::v4::QueryResponseInfo), + #[codec(index = 36)] + ClearTransactStatus, + #[codec(index = 37)] + UniversalOrigin(runtime_types::staging_xcm::v4::junction::Junction), + #[codec(index = 38)] + ExportMessage { + network: runtime_types::staging_xcm::v4::junction::NetworkId, + destination: runtime_types::staging_xcm::v4::junctions::Junctions, + xcm: runtime_types::staging_xcm::v4::Xcm, + }, + #[codec(index = 39)] + LockAsset { + asset: runtime_types::staging_xcm::v4::asset::Asset, + unlocker: runtime_types::staging_xcm::v4::location::Location, + }, + #[codec(index = 40)] + UnlockAsset { + asset: runtime_types::staging_xcm::v4::asset::Asset, + target: runtime_types::staging_xcm::v4::location::Location, + }, + #[codec(index = 41)] + NoteUnlockable { + asset: runtime_types::staging_xcm::v4::asset::Asset, + owner: runtime_types::staging_xcm::v4::location::Location, + }, + #[codec(index = 42)] + RequestUnlock { + asset: runtime_types::staging_xcm::v4::asset::Asset, + locker: runtime_types::staging_xcm::v4::location::Location, + }, + #[codec(index = 43)] + SetFeesMode { + jit_withdraw: ::core::primitive::bool, + }, + #[codec(index = 44)] + SetTopic([::core::primitive::u8; 32usize]), + #[codec(index = 45)] + ClearTopic, + #[codec(index = 46)] + AliasOrigin(runtime_types::staging_xcm::v4::location::Location), + #[codec(index = 47)] + UnpaidExecution { + weight_limit: runtime_types::xcm::v3::WeightLimit, + check_origin: ::core::option::Option< + runtime_types::staging_xcm::v4::location::Location, + >, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PalletInfo { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub name: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub module_name: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + #[codec(compact)] + pub major: ::core::primitive::u32, + #[codec(compact)] + pub minor: ::core::primitive::u32, + #[codec(compact)] + pub patch: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryResponseInfo { + pub destination: runtime_types::staging_xcm::v4::location::Location, + #[codec(compact)] + pub query_id: ::core::primitive::u64, + pub max_weight: runtime_types::sp_weights::weight_v2::Weight, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Response { + #[codec(index = 0)] + Null, + #[codec(index = 1)] + Assets(runtime_types::staging_xcm::v4::asset::Assets), + #[codec(index = 2)] + ExecutionResult( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v3::traits::Error, + )>, + ), + #[codec(index = 3)] + Version(::core::primitive::u32), + #[codec(index = 4)] + PalletsInfo( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::staging_xcm::v4::PalletInfo, + >, + ), + #[codec(index = 5)] + DispatchResult(runtime_types::xcm::v3::MaybeErrorCode), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Xcm( + pub ::subxt_core::alloc::vec::Vec, + ); + } + pub mod v5 { + use super::runtime_types; + pub mod asset { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Asset { + pub id: runtime_types::staging_xcm::v5::asset::AssetId, + pub fun: runtime_types::staging_xcm::v5::asset::Fungibility, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AssetFilter { + #[codec(index = 0)] + Definite(runtime_types::staging_xcm::v5::asset::Assets), + #[codec(index = 1)] + Wild(runtime_types::staging_xcm::v5::asset::WildAsset), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AssetId(pub runtime_types::staging_xcm::v5::location::Location); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AssetInstance { + #[codec(index = 0)] + Undefined, + #[codec(index = 1)] + Index(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 2)] + Array4([::core::primitive::u8; 4usize]), + #[codec(index = 3)] + Array8([::core::primitive::u8; 8usize]), + #[codec(index = 4)] + Array16([::core::primitive::u8; 16usize]), + #[codec(index = 5)] + Array32([::core::primitive::u8; 32usize]), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AssetTransferFilter { + #[codec(index = 0)] + Teleport(runtime_types::staging_xcm::v5::asset::AssetFilter), + #[codec(index = 1)] + ReserveDeposit(runtime_types::staging_xcm::v5::asset::AssetFilter), + #[codec(index = 2)] + ReserveWithdraw(runtime_types::staging_xcm::v5::asset::AssetFilter), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Assets( + pub ::subxt_core::alloc::vec::Vec< + runtime_types::staging_xcm::v5::asset::Asset, + >, + ); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Fungibility { + #[codec(index = 0)] + Fungible(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 1)] + NonFungible(runtime_types::staging_xcm::v5::asset::AssetInstance), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum WildAsset { + #[codec(index = 0)] + All, + #[codec(index = 1)] + AllOf { + id: runtime_types::staging_xcm::v5::asset::AssetId, + fun: runtime_types::staging_xcm::v5::asset::WildFungibility, + }, + #[codec(index = 2)] + AllCounted(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 3)] + AllOfCounted { + id: runtime_types::staging_xcm::v5::asset::AssetId, + fun: runtime_types::staging_xcm::v5::asset::WildFungibility, + #[codec(compact)] + count: ::core::primitive::u32, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum WildFungibility { + #[codec(index = 0)] + Fungible, + #[codec(index = 1)] + NonFungible, + } + } + pub mod junction { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Junction { + #[codec(index = 0)] + Parachain(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 1)] + AccountId32 { + network: ::core::option::Option< + runtime_types::staging_xcm::v5::junction::NetworkId, + >, + id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + AccountIndex64 { + network: ::core::option::Option< + runtime_types::staging_xcm::v5::junction::NetworkId, + >, + #[codec(compact)] + index: ::core::primitive::u64, + }, + #[codec(index = 3)] + AccountKey20 { + network: ::core::option::Option< + runtime_types::staging_xcm::v5::junction::NetworkId, + >, + key: [::core::primitive::u8; 20usize], + }, + #[codec(index = 4)] + PalletInstance(::core::primitive::u8), + #[codec(index = 5)] + GeneralIndex(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 6)] + GeneralKey { + length: ::core::primitive::u8, + data: [::core::primitive::u8; 32usize], + }, + #[codec(index = 7)] + OnlyChild, + #[codec(index = 8)] + Plurality { + id: runtime_types::xcm::v3::junction::BodyId, + part: runtime_types::xcm::v3::junction::BodyPart, + }, + #[codec(index = 9)] + GlobalConsensus(runtime_types::staging_xcm::v5::junction::NetworkId), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum NetworkId { + #[codec(index = 0)] + ByGenesis([::core::primitive::u8; 32usize]), + #[codec(index = 1)] + ByFork { + block_number: ::core::primitive::u64, + block_hash: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + Polkadot, + #[codec(index = 3)] + Kusama, + #[codec(index = 7)] + Ethereum { + #[codec(compact)] + chain_id: ::core::primitive::u64, + }, + #[codec(index = 8)] + BitcoinCore, + #[codec(index = 9)] + BitcoinCash, + #[codec(index = 10)] + PolkadotBulletin, + } + } + pub mod junctions { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Junctions { + #[codec(index = 0)] + Here, + #[codec(index = 1)] + X1([runtime_types::staging_xcm::v5::junction::Junction; 1usize]), + #[codec(index = 2)] + X2([runtime_types::staging_xcm::v5::junction::Junction; 2usize]), + #[codec(index = 3)] + X3([runtime_types::staging_xcm::v5::junction::Junction; 3usize]), + #[codec(index = 4)] + X4([runtime_types::staging_xcm::v5::junction::Junction; 4usize]), + #[codec(index = 5)] + X5([runtime_types::staging_xcm::v5::junction::Junction; 5usize]), + #[codec(index = 6)] + X6([runtime_types::staging_xcm::v5::junction::Junction; 6usize]), + #[codec(index = 7)] + X7([runtime_types::staging_xcm::v5::junction::Junction; 7usize]), + #[codec(index = 8)] + X8([runtime_types::staging_xcm::v5::junction::Junction; 8usize]), + } + } + pub mod location { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Location { + pub parents: ::core::primitive::u8, + pub interior: runtime_types::staging_xcm::v5::junctions::Junctions, + } + } + pub mod traits { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct InstructionError { + pub index: ::core::primitive::u8, + pub error: runtime_types::xcm::v5::traits::Error, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Outcome { + #[codec(index = 0)] + Complete { + used: runtime_types::sp_weights::weight_v2::Weight, + }, + #[codec(index = 1)] + Incomplete { + used: runtime_types::sp_weights::weight_v2::Weight, + error: runtime_types::staging_xcm::v5::traits::InstructionError, + }, + #[codec(index = 2)] + Error(runtime_types::staging_xcm::v5::traits::InstructionError), + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Hint { + #[codec(index = 0)] + AssetClaimer { + location: runtime_types::staging_xcm::v5::location::Location, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Instruction { + #[codec(index = 0)] + WithdrawAsset(runtime_types::staging_xcm::v5::asset::Assets), + #[codec(index = 1)] + ReserveAssetDeposited(runtime_types::staging_xcm::v5::asset::Assets), + #[codec(index = 2)] + ReceiveTeleportedAsset(runtime_types::staging_xcm::v5::asset::Assets), + #[codec(index = 3)] + QueryResponse { + #[codec(compact)] + query_id: ::core::primitive::u64, + response: runtime_types::staging_xcm::v5::Response, + max_weight: runtime_types::sp_weights::weight_v2::Weight, + querier: ::core::option::Option< + runtime_types::staging_xcm::v5::location::Location, + >, + }, + #[codec(index = 4)] + TransferAsset { + assets: runtime_types::staging_xcm::v5::asset::Assets, + beneficiary: runtime_types::staging_xcm::v5::location::Location, + }, + #[codec(index = 5)] + TransferReserveAsset { + assets: runtime_types::staging_xcm::v5::asset::Assets, + dest: runtime_types::staging_xcm::v5::location::Location, + xcm: runtime_types::staging_xcm::v5::Xcm, + }, + #[codec(index = 6)] + Transact { + origin_kind: runtime_types::xcm::v3::OriginKind, + fallback_max_weight: + ::core::option::Option, + call: runtime_types::xcm::double_encoded::DoubleEncoded, + }, + #[codec(index = 7)] + HrmpNewChannelOpenRequest { + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + max_message_size: ::core::primitive::u32, + #[codec(compact)] + max_capacity: ::core::primitive::u32, + }, + #[codec(index = 8)] + HrmpChannelAccepted { + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 9)] + HrmpChannelClosing { + #[codec(compact)] + initiator: ::core::primitive::u32, + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 10)] + ClearOrigin, + #[codec(index = 11)] + DescendOrigin(runtime_types::staging_xcm::v5::junctions::Junctions), + #[codec(index = 12)] + ReportError(runtime_types::staging_xcm::v5::QueryResponseInfo), + #[codec(index = 13)] + DepositAsset { + assets: runtime_types::staging_xcm::v5::asset::AssetFilter, + beneficiary: runtime_types::staging_xcm::v5::location::Location, + }, + #[codec(index = 14)] + DepositReserveAsset { + assets: runtime_types::staging_xcm::v5::asset::AssetFilter, + dest: runtime_types::staging_xcm::v5::location::Location, + xcm: runtime_types::staging_xcm::v5::Xcm, + }, + #[codec(index = 15)] + ExchangeAsset { + give: runtime_types::staging_xcm::v5::asset::AssetFilter, + want: runtime_types::staging_xcm::v5::asset::Assets, + maximal: ::core::primitive::bool, + }, + #[codec(index = 16)] + InitiateReserveWithdraw { + assets: runtime_types::staging_xcm::v5::asset::AssetFilter, + reserve: runtime_types::staging_xcm::v5::location::Location, + xcm: runtime_types::staging_xcm::v5::Xcm, + }, + #[codec(index = 17)] + InitiateTeleport { + assets: runtime_types::staging_xcm::v5::asset::AssetFilter, + dest: runtime_types::staging_xcm::v5::location::Location, + xcm: runtime_types::staging_xcm::v5::Xcm, + }, + #[codec(index = 18)] + ReportHolding { + response_info: runtime_types::staging_xcm::v5::QueryResponseInfo, + assets: runtime_types::staging_xcm::v5::asset::AssetFilter, + }, + #[codec(index = 19)] + BuyExecution { + fees: runtime_types::staging_xcm::v5::asset::Asset, + weight_limit: runtime_types::xcm::v3::WeightLimit, + }, + #[codec(index = 20)] + RefundSurplus, + #[codec(index = 21)] + SetErrorHandler(runtime_types::staging_xcm::v5::Xcm), + #[codec(index = 22)] + SetAppendix(runtime_types::staging_xcm::v5::Xcm), + #[codec(index = 23)] + ClearError, + #[codec(index = 24)] + ClaimAsset { + assets: runtime_types::staging_xcm::v5::asset::Assets, + ticket: runtime_types::staging_xcm::v5::location::Location, + }, + #[codec(index = 25)] + Trap(#[codec(compact)] ::core::primitive::u64), + #[codec(index = 26)] + SubscribeVersion { + #[codec(compact)] + query_id: ::core::primitive::u64, + max_response_weight: runtime_types::sp_weights::weight_v2::Weight, + }, + #[codec(index = 27)] + UnsubscribeVersion, + #[codec(index = 28)] + BurnAsset(runtime_types::staging_xcm::v5::asset::Assets), + #[codec(index = 29)] + ExpectAsset(runtime_types::staging_xcm::v5::asset::Assets), + #[codec(index = 30)] + ExpectOrigin( + ::core::option::Option, + ), + #[codec(index = 31)] + ExpectError( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v5::traits::Error, + )>, + ), + #[codec(index = 32)] + ExpectTransactStatus(runtime_types::xcm::v3::MaybeErrorCode), + #[codec(index = 33)] + QueryPallet { + module_name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + response_info: runtime_types::staging_xcm::v5::QueryResponseInfo, + }, + #[codec(index = 34)] + ExpectPallet { + #[codec(compact)] + index: ::core::primitive::u32, + name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + #[codec(compact)] + crate_major: ::core::primitive::u32, + #[codec(compact)] + min_crate_minor: ::core::primitive::u32, + }, + #[codec(index = 35)] + ReportTransactStatus(runtime_types::staging_xcm::v5::QueryResponseInfo), + #[codec(index = 36)] + ClearTransactStatus, + #[codec(index = 37)] + UniversalOrigin(runtime_types::staging_xcm::v5::junction::Junction), + #[codec(index = 38)] + ExportMessage { + network: runtime_types::staging_xcm::v5::junction::NetworkId, + destination: runtime_types::staging_xcm::v5::junctions::Junctions, + xcm: runtime_types::staging_xcm::v5::Xcm, + }, + #[codec(index = 39)] + LockAsset { + asset: runtime_types::staging_xcm::v5::asset::Asset, + unlocker: runtime_types::staging_xcm::v5::location::Location, + }, + #[codec(index = 40)] + UnlockAsset { + asset: runtime_types::staging_xcm::v5::asset::Asset, + target: runtime_types::staging_xcm::v5::location::Location, + }, + #[codec(index = 41)] + NoteUnlockable { + asset: runtime_types::staging_xcm::v5::asset::Asset, + owner: runtime_types::staging_xcm::v5::location::Location, + }, + #[codec(index = 42)] + RequestUnlock { + asset: runtime_types::staging_xcm::v5::asset::Asset, + locker: runtime_types::staging_xcm::v5::location::Location, + }, + #[codec(index = 43)] + SetFeesMode { + jit_withdraw: ::core::primitive::bool, + }, + #[codec(index = 44)] + SetTopic([::core::primitive::u8; 32usize]), + #[codec(index = 45)] + ClearTopic, + #[codec(index = 46)] + AliasOrigin(runtime_types::staging_xcm::v5::location::Location), + #[codec(index = 47)] + UnpaidExecution { + weight_limit: runtime_types::xcm::v3::WeightLimit, + check_origin: ::core::option::Option< + runtime_types::staging_xcm::v5::location::Location, + >, + }, + #[codec(index = 48)] + PayFees { + asset: runtime_types::staging_xcm::v5::asset::Asset, + }, + #[codec(index = 49)] + InitiateTransfer { + destination: runtime_types::staging_xcm::v5::location::Location, + remote_fees: ::core::option::Option< + runtime_types::staging_xcm::v5::asset::AssetTransferFilter, + >, + preserve_origin: ::core::primitive::bool, + assets: runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::staging_xcm::v5::asset::AssetTransferFilter, + >, + remote_xcm: runtime_types::staging_xcm::v5::Xcm, + }, + #[codec(index = 50)] + ExecuteWithOrigin { + descendant_origin: ::core::option::Option< + runtime_types::staging_xcm::v5::junctions::Junctions, + >, + xcm: runtime_types::staging_xcm::v5::Xcm, + }, + #[codec(index = 51)] + SetHints { + hints: runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::staging_xcm::v5::Hint, + >, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PalletInfo { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub name: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub module_name: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + #[codec(compact)] + pub major: ::core::primitive::u32, + #[codec(compact)] + pub minor: ::core::primitive::u32, + #[codec(compact)] + pub patch: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryResponseInfo { + pub destination: runtime_types::staging_xcm::v5::location::Location, + #[codec(compact)] + pub query_id: ::core::primitive::u64, + pub max_weight: runtime_types::sp_weights::weight_v2::Weight, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Response { + #[codec(index = 0)] + Null, + #[codec(index = 1)] + Assets(runtime_types::staging_xcm::v5::asset::Assets), + #[codec(index = 2)] + ExecutionResult( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v5::traits::Error, + )>, + ), + #[codec(index = 3)] + Version(::core::primitive::u32), + #[codec(index = 4)] + PalletsInfo( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::staging_xcm::v5::PalletInfo, + >, + ), + #[codec(index = 5)] + DispatchResult(runtime_types::xcm::v3::MaybeErrorCode), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Xcm( + pub ::subxt_core::alloc::vec::Vec, + ); + } + } + pub mod staging_xcm_executor { + use super::runtime_types; + pub mod traits { + use super::runtime_types; + pub mod asset_transfer { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum TransferType { + #[codec(index = 0)] + Teleport, + #[codec(index = 1)] + LocalReserve, + #[codec(index = 2)] + DestinationReserve, + #[codec(index = 3)] + RemoteReserve(runtime_types::xcm::VersionedLocation), + } + } + } + } + pub mod storage_paseo_runtime { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum OriginCaller { + #[codec(index = 0)] + system( + runtime_types::frame_support::dispatch::RawOrigin< + ::subxt_core::utils::AccountId32, + >, + ), + #[codec(index = 31)] + PolkadotXcm(runtime_types::pallet_xcm::pallet::Origin), + #[codec(index = 32)] + CumulusXcm(runtime_types::cumulus_pallet_xcm::pallet::Origin), + #[codec(index = 60)] + Revive( + runtime_types::pallet_revive::pallet::Origin< + runtime_types::storage_paseo_runtime::Runtime, + >, + ), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Runtime; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum RuntimeCall { + #[codec(index = 0)] + System(runtime_types::frame_system::pallet::Call), + #[codec(index = 1)] + ParachainSystem(runtime_types::cumulus_pallet_parachain_system::pallet::Call), + #[codec(index = 2)] + Timestamp(runtime_types::pallet_timestamp::pallet::Call), + #[codec(index = 3)] + ParachainInfo(runtime_types::staging_parachain_info::pallet::Call), + #[codec(index = 10)] + Balances(runtime_types::pallet_balances::pallet::Call), + #[codec(index = 15)] + Sudo(runtime_types::pallet_sudo::pallet::Call), + #[codec(index = 21)] + CollatorSelection(runtime_types::pallet_collator_selection::pallet::Call), + #[codec(index = 22)] + Session(runtime_types::pallet_session::pallet::Call), + #[codec(index = 30)] + XcmpQueue(runtime_types::cumulus_pallet_xcmp_queue::pallet::Call), + #[codec(index = 31)] + PolkadotXcm(runtime_types::pallet_xcm::pallet::Call), + #[codec(index = 32)] + CumulusXcm(runtime_types::cumulus_pallet_xcm::pallet::Call), + #[codec(index = 33)] + MessageQueue(runtime_types::pallet_message_queue::pallet::Call), + #[codec(index = 34)] + Utility(runtime_types::pallet_utility::pallet::Call), + #[codec(index = 50)] + StorageProvider(runtime_types::pallet_storage_provider::pallet::Call), + #[codec(index = 51)] + DriveRegistry(runtime_types::pallet_drive_registry::pallet::Call), + #[codec(index = 52)] + S3Registry(runtime_types::pallet_s3_registry::pallet::Call), + #[codec(index = 60)] + Revive(runtime_types::pallet_revive::pallet::Call), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum RuntimeError { + #[codec(index = 0)] + System(runtime_types::frame_system::pallet::Error), + #[codec(index = 1)] + ParachainSystem(runtime_types::cumulus_pallet_parachain_system::pallet::Error), + #[codec(index = 10)] + Balances(runtime_types::pallet_balances::pallet::Error), + #[codec(index = 15)] + Sudo(runtime_types::pallet_sudo::pallet::Error), + #[codec(index = 21)] + CollatorSelection(runtime_types::pallet_collator_selection::pallet::Error), + #[codec(index = 22)] + Session(runtime_types::pallet_session::pallet::Error), + #[codec(index = 30)] + XcmpQueue(runtime_types::cumulus_pallet_xcmp_queue::pallet::Error), + #[codec(index = 31)] + PolkadotXcm(runtime_types::pallet_xcm::pallet::Error), + #[codec(index = 33)] + MessageQueue(runtime_types::pallet_message_queue::pallet::Error), + #[codec(index = 34)] + Utility(runtime_types::pallet_utility::pallet::Error), + #[codec(index = 50)] + StorageProvider(runtime_types::pallet_storage_provider::pallet::Error), + #[codec(index = 51)] + DriveRegistry(runtime_types::pallet_drive_registry::pallet::Error), + #[codec(index = 52)] + S3Registry(runtime_types::pallet_s3_registry::pallet::Error), + #[codec(index = 60)] + Revive(runtime_types::pallet_revive::pallet::Error), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum RuntimeEvent { + #[codec(index = 0)] + System(runtime_types::frame_system::pallet::Event), + #[codec(index = 1)] + ParachainSystem(runtime_types::cumulus_pallet_parachain_system::pallet::Event), + #[codec(index = 10)] + Balances(runtime_types::pallet_balances::pallet::Event), + #[codec(index = 11)] + TransactionPayment(runtime_types::pallet_transaction_payment::pallet::Event), + #[codec(index = 15)] + Sudo(runtime_types::pallet_sudo::pallet::Event), + #[codec(index = 21)] + CollatorSelection(runtime_types::pallet_collator_selection::pallet::Event), + #[codec(index = 22)] + Session(runtime_types::pallet_session::pallet::Event), + #[codec(index = 30)] + XcmpQueue(runtime_types::cumulus_pallet_xcmp_queue::pallet::Event), + #[codec(index = 31)] + PolkadotXcm(runtime_types::pallet_xcm::pallet::Event), + #[codec(index = 32)] + CumulusXcm(runtime_types::cumulus_pallet_xcm::pallet::Event), + #[codec(index = 33)] + MessageQueue(runtime_types::pallet_message_queue::pallet::Event), + #[codec(index = 34)] + Utility(runtime_types::pallet_utility::pallet::Event), + #[codec(index = 50)] + StorageProvider(runtime_types::pallet_storage_provider::pallet::Event), + #[codec(index = 51)] + DriveRegistry(runtime_types::pallet_drive_registry::pallet::Event), + #[codec(index = 52)] + S3Registry(runtime_types::pallet_s3_registry::pallet::Event), + #[codec(index = 60)] + Revive(runtime_types::pallet_revive::pallet::Event), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum RuntimeFreezeReason {} + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum RuntimeHoldReason { + #[codec(index = 22)] + Session(runtime_types::pallet_session::pallet::HoldReason), + #[codec(index = 31)] + PolkadotXcm(runtime_types::pallet_xcm::pallet::HoldReason), + #[codec(index = 60)] + Revive(runtime_types::pallet_revive::pallet::HoldReason), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct SessionKeys { + pub aura: runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public, + } + } + pub mod storage_primitives { + use super::runtime_types; + pub mod agreement_term { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct AgreementTerms<_0, _1, _2> { + pub owner: _0, + pub max_bytes: ::core::primitive::u64, + pub duration: _2, + pub price_per_byte: _1, + pub valid_until: _2, + pub nonce: ::core::primitive::u64, + pub bucket_id: ::core::option::Option<::core::primitive::u64>, + pub replica_params: ::core::option::Option< + runtime_types::storage_primitives::agreement_term::ReplicaTerms<_1, _2>, + >, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ReplicaTerms<_0, _1> { + pub sync_balance: _0, + pub min_sync_interval: _1, + pub sync_price: _0, + } + } + pub mod provider_replay_state { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ReplayWindow { + pub hsn: ::core::primitive::u64, + pub bitmap: [::core::primitive::u8; 128usize], + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct BucketSnapshot<_0> { + pub commitment: runtime_types::storage_primitives::Commitment, + pub checkpoint_block: _0, + pub primary_signers: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + pub commitment_nonce: ::core::primitive::u64, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChallengeId<_0> { + pub deadline: _0, + pub index: ::core::primitive::u16, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChallengerStatRecord { + pub total_challenges: ::core::primitive::u32, + pub successful_challenges: ::core::primitive::u32, + pub failed_challenges: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CheckpointWindowConfig<_0> { + pub interval: _0, + pub grace_period: _0, + pub enabled: ::core::primitive::bool, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ChunkLocation { + pub leaf_index: ::core::primitive::u64, + pub chunk_index: ::core::primitive::u64, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Commitment { + pub mmr_root: ::subxt_core::utils::H256, + pub start_seq: ::core::primitive::u64, + pub leaf_count: ::core::primitive::u64, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum EndAction { + #[codec(index = 0)] + Pay, + #[codec(index = 1)] + Burn { burn_percent: ::core::primitive::u8 }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MerkleProof { + pub siblings: ::subxt_core::alloc::vec::Vec<::subxt_core::utils::H256>, + pub path: ::subxt_core::alloc::vec::Vec<::core::primitive::bool>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MmrLeaf { + pub data_root: ::subxt_core::utils::H256, + pub data_size: ::core::primitive::u64, + pub total_size: ::core::primitive::u64, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MmrProof { + pub peaks: ::subxt_core::alloc::vec::Vec<::subxt_core::utils::H256>, + pub leaf: runtime_types::storage_primitives::MmrLeaf, + pub leaf_proof: runtime_types::storage_primitives::MerkleProof, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum ProviderRole<_0, _1> { + #[codec(index = 0)] + Primary, + #[codec(index = 1)] + Replica { + sync_balance: _0, + sync_price: _0, + min_sync_interval: _1, + last_sync: ::core::option::Option< + runtime_types::storage_primitives::ReplicaSyncRecord<_1>, + >, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum RemovalReason { + #[codec(index = 0)] + Slashed, + #[codec(index = 1)] + AdminTerminated, + #[codec(index = 2)] + Expired, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct ReplicaSyncRecord<_0> { + pub commitment: runtime_types::storage_primitives::Commitment, + pub block: _0, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Role { + #[codec(index = 0)] + Admin, + #[codec(index = 1)] + Writer, + #[codec(index = 2)] + Reader, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum SlashReason { + #[codec(index = 0)] + Timeout, + #[codec(index = 1)] + InvalidProof, + #[codec(index = 2)] + InvalidDeletionClaim, + #[codec(index = 3)] + InvalidSupersededClaim, + } + } + pub mod xcm { + use super::runtime_types; + pub mod double_encoded { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct DoubleEncoded { + pub encoded: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + } + } + pub mod v3 { + use super::runtime_types; + pub mod junction { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum BodyId { + #[codec(index = 0)] + Unit, + #[codec(index = 1)] + Moniker([::core::primitive::u8; 4usize]), + #[codec(index = 2)] + Index(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 3)] + Executive, + #[codec(index = 4)] + Technical, + #[codec(index = 5)] + Legislative, + #[codec(index = 6)] + Judicial, + #[codec(index = 7)] + Defense, + #[codec(index = 8)] + Administration, + #[codec(index = 9)] + Treasury, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum BodyPart { + #[codec(index = 0)] + Voice, + #[codec(index = 1)] + Members { + #[codec(compact)] + count: ::core::primitive::u32, + }, + #[codec(index = 2)] + Fraction { + #[codec(compact)] + nom: ::core::primitive::u32, + #[codec(compact)] + denom: ::core::primitive::u32, + }, + #[codec(index = 3)] + AtLeastProportion { + #[codec(compact)] + nom: ::core::primitive::u32, + #[codec(compact)] + denom: ::core::primitive::u32, + }, + #[codec(index = 4)] + MoreThanProportion { + #[codec(compact)] + nom: ::core::primitive::u32, + #[codec(compact)] + denom: ::core::primitive::u32, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Junction { + #[codec(index = 0)] + Parachain(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 1)] + AccountId32 { + network: + ::core::option::Option, + id: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + AccountIndex64 { + network: + ::core::option::Option, + #[codec(compact)] + index: ::core::primitive::u64, + }, + #[codec(index = 3)] + AccountKey20 { + network: + ::core::option::Option, + key: [::core::primitive::u8; 20usize], + }, + #[codec(index = 4)] + PalletInstance(::core::primitive::u8), + #[codec(index = 5)] + GeneralIndex(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 6)] + GeneralKey { + length: ::core::primitive::u8, + data: [::core::primitive::u8; 32usize], + }, + #[codec(index = 7)] + OnlyChild, + #[codec(index = 8)] + Plurality { + id: runtime_types::xcm::v3::junction::BodyId, + part: runtime_types::xcm::v3::junction::BodyPart, + }, + #[codec(index = 9)] + GlobalConsensus(runtime_types::xcm::v3::junction::NetworkId), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum NetworkId { + #[codec(index = 0)] + ByGenesis([::core::primitive::u8; 32usize]), + #[codec(index = 1)] + ByFork { + block_number: ::core::primitive::u64, + block_hash: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + Polkadot, + #[codec(index = 3)] + Kusama, + #[codec(index = 4)] + Westend, + #[codec(index = 5)] + Rococo, + #[codec(index = 6)] + Wococo, + #[codec(index = 7)] + Ethereum { + #[codec(compact)] + chain_id: ::core::primitive::u64, + }, + #[codec(index = 8)] + BitcoinCore, + #[codec(index = 9)] + BitcoinCash, + #[codec(index = 10)] + PolkadotBulletin, + } + } + pub mod junctions { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Junctions { + #[codec(index = 0)] + Here, + #[codec(index = 1)] + X1(runtime_types::xcm::v3::junction::Junction), + #[codec(index = 2)] + X2( + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + ), + #[codec(index = 3)] + X3( + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + ), + #[codec(index = 4)] + X4( + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + ), + #[codec(index = 5)] + X5( + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + ), + #[codec(index = 6)] + X6( + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + ), + #[codec(index = 7)] + X7( + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + ), + #[codec(index = 8)] + X8( + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + runtime_types::xcm::v3::junction::Junction, + ), + } + } + pub mod multiasset { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AssetId { + #[codec(index = 0)] + Concrete(runtime_types::staging_xcm::v3::multilocation::MultiLocation), + #[codec(index = 1)] + Abstract([::core::primitive::u8; 32usize]), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum AssetInstance { + #[codec(index = 0)] + Undefined, + #[codec(index = 1)] + Index(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 2)] + Array4([::core::primitive::u8; 4usize]), + #[codec(index = 3)] + Array8([::core::primitive::u8; 8usize]), + #[codec(index = 4)] + Array16([::core::primitive::u8; 16usize]), + #[codec(index = 5)] + Array32([::core::primitive::u8; 32usize]), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Fungibility { + #[codec(index = 0)] + Fungible(#[codec(compact)] ::core::primitive::u128), + #[codec(index = 1)] + NonFungible(runtime_types::xcm::v3::multiasset::AssetInstance), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MultiAsset { + pub id: runtime_types::xcm::v3::multiasset::AssetId, + pub fun: runtime_types::xcm::v3::multiasset::Fungibility, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum MultiAssetFilter { + #[codec(index = 0)] + Definite(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 1)] + Wild(runtime_types::xcm::v3::multiasset::WildMultiAsset), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct MultiAssets( + pub ::subxt_core::alloc::vec::Vec< + runtime_types::xcm::v3::multiasset::MultiAsset, + >, + ); + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum WildFungibility { + #[codec(index = 0)] + Fungible, + #[codec(index = 1)] + NonFungible, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum WildMultiAsset { + #[codec(index = 0)] + All, + #[codec(index = 1)] + AllOf { + id: runtime_types::xcm::v3::multiasset::AssetId, + fun: runtime_types::xcm::v3::multiasset::WildFungibility, + }, + #[codec(index = 2)] + AllCounted(#[codec(compact)] ::core::primitive::u32), + #[codec(index = 3)] + AllOfCounted { + id: runtime_types::xcm::v3::multiasset::AssetId, + fun: runtime_types::xcm::v3::multiasset::WildFungibility, + #[codec(compact)] + count: ::core::primitive::u32, + }, + } + } + pub mod traits { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Error { + #[codec(index = 0)] + Overflow, + #[codec(index = 1)] + Unimplemented, + #[codec(index = 2)] + UntrustedReserveLocation, + #[codec(index = 3)] + UntrustedTeleportLocation, + #[codec(index = 4)] + LocationFull, + #[codec(index = 5)] + LocationNotInvertible, + #[codec(index = 6)] + BadOrigin, + #[codec(index = 7)] + InvalidLocation, + #[codec(index = 8)] + AssetNotFound, + #[codec(index = 9)] + FailedToTransactAsset, + #[codec(index = 10)] + NotWithdrawable, + #[codec(index = 11)] + LocationCannotHold, + #[codec(index = 12)] + ExceedsMaxMessageSize, + #[codec(index = 13)] + DestinationUnsupported, + #[codec(index = 14)] + Transport, + #[codec(index = 15)] + Unroutable, + #[codec(index = 16)] + UnknownClaim, + #[codec(index = 17)] + FailedToDecode, + #[codec(index = 18)] + MaxWeightInvalid, + #[codec(index = 19)] + NotHoldingFees, + #[codec(index = 20)] + TooExpensive, + #[codec(index = 21)] + Trap(::core::primitive::u64), + #[codec(index = 22)] + ExpectationFalse, + #[codec(index = 23)] + PalletNotFound, + #[codec(index = 24)] + NameMismatch, + #[codec(index = 25)] + VersionIncompatible, + #[codec(index = 26)] + HoldingWouldOverflow, + #[codec(index = 27)] + ExportError, + #[codec(index = 28)] + ReanchorFailed, + #[codec(index = 29)] + NoDeal, + #[codec(index = 30)] + FeesNotMet, + #[codec(index = 31)] + LockError, + #[codec(index = 32)] + NoPermission, + #[codec(index = 33)] + Unanchored, + #[codec(index = 34)] + NotDepositable, + #[codec(index = 35)] + UnhandledXcmVersion, + #[codec(index = 36)] + WeightLimitReached(runtime_types::sp_weights::weight_v2::Weight), + #[codec(index = 37)] + Barrier, + #[codec(index = 38)] + WeightNotComputable, + #[codec(index = 39)] + ExceedsStackLimit, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum SendError { + #[codec(index = 0)] + NotApplicable, + #[codec(index = 1)] + Transport, + #[codec(index = 2)] + Unroutable, + #[codec(index = 3)] + DestinationUnsupported, + #[codec(index = 4)] + ExceedsMaxMessageSize, + #[codec(index = 5)] + MissingArgument, + #[codec(index = 6)] + Fees, + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Instruction { + #[codec(index = 0)] + WithdrawAsset(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 1)] + ReserveAssetDeposited(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 2)] + ReceiveTeleportedAsset(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 3)] + QueryResponse { + #[codec(compact)] + query_id: ::core::primitive::u64, + response: runtime_types::xcm::v3::Response, + max_weight: runtime_types::sp_weights::weight_v2::Weight, + querier: ::core::option::Option< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, + >, + }, + #[codec(index = 4)] + TransferAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssets, + beneficiary: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 5)] + TransferReserveAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssets, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 6)] + Transact { + origin_kind: runtime_types::xcm::v3::OriginKind, + require_weight_at_most: runtime_types::sp_weights::weight_v2::Weight, + call: runtime_types::xcm::double_encoded::DoubleEncoded, + }, + #[codec(index = 7)] + HrmpNewChannelOpenRequest { + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + max_message_size: ::core::primitive::u32, + #[codec(compact)] + max_capacity: ::core::primitive::u32, + }, + #[codec(index = 8)] + HrmpChannelAccepted { + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 9)] + HrmpChannelClosing { + #[codec(compact)] + initiator: ::core::primitive::u32, + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 10)] + ClearOrigin, + #[codec(index = 11)] + DescendOrigin(runtime_types::xcm::v3::junctions::Junctions), + #[codec(index = 12)] + ReportError(runtime_types::xcm::v3::QueryResponseInfo), + #[codec(index = 13)] + DepositAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + beneficiary: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 14)] + DepositReserveAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 15)] + ExchangeAsset { + give: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + want: runtime_types::xcm::v3::multiasset::MultiAssets, + maximal: ::core::primitive::bool, + }, + #[codec(index = 16)] + InitiateReserveWithdraw { + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + reserve: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 17)] + InitiateTeleport { + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 18)] + ReportHolding { + response_info: runtime_types::xcm::v3::QueryResponseInfo, + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + }, + #[codec(index = 19)] + BuyExecution { + fees: runtime_types::xcm::v3::multiasset::MultiAsset, + weight_limit: runtime_types::xcm::v3::WeightLimit, + }, + #[codec(index = 20)] + RefundSurplus, + #[codec(index = 21)] + SetErrorHandler(runtime_types::xcm::v3::Xcm), + #[codec(index = 22)] + SetAppendix(runtime_types::xcm::v3::Xcm), + #[codec(index = 23)] + ClearError, + #[codec(index = 24)] + ClaimAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssets, + ticket: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 25)] + Trap(#[codec(compact)] ::core::primitive::u64), + #[codec(index = 26)] + SubscribeVersion { + #[codec(compact)] + query_id: ::core::primitive::u64, + max_response_weight: runtime_types::sp_weights::weight_v2::Weight, + }, + #[codec(index = 27)] + UnsubscribeVersion, + #[codec(index = 28)] + BurnAsset(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 29)] + ExpectAsset(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 30)] + ExpectOrigin( + ::core::option::Option< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, + >, + ), + #[codec(index = 31)] + ExpectError( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v3::traits::Error, + )>, + ), + #[codec(index = 32)] + ExpectTransactStatus(runtime_types::xcm::v3::MaybeErrorCode), + #[codec(index = 33)] + QueryPallet { + module_name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + response_info: runtime_types::xcm::v3::QueryResponseInfo, + }, + #[codec(index = 34)] + ExpectPallet { + #[codec(compact)] + index: ::core::primitive::u32, + name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + module_name: ::subxt_core::alloc::vec::Vec<::core::primitive::u8>, + #[codec(compact)] + crate_major: ::core::primitive::u32, + #[codec(compact)] + min_crate_minor: ::core::primitive::u32, + }, + #[codec(index = 35)] + ReportTransactStatus(runtime_types::xcm::v3::QueryResponseInfo), + #[codec(index = 36)] + ClearTransactStatus, + #[codec(index = 37)] + UniversalOrigin(runtime_types::xcm::v3::junction::Junction), + #[codec(index = 38)] + ExportMessage { + network: runtime_types::xcm::v3::junction::NetworkId, + destination: runtime_types::xcm::v3::junctions::Junctions, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 39)] + LockAsset { + asset: runtime_types::xcm::v3::multiasset::MultiAsset, + unlocker: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 40)] + UnlockAsset { + asset: runtime_types::xcm::v3::multiasset::MultiAsset, + target: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 41)] + NoteUnlockable { + asset: runtime_types::xcm::v3::multiasset::MultiAsset, + owner: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 42)] + RequestUnlock { + asset: runtime_types::xcm::v3::multiasset::MultiAsset, + locker: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 43)] + SetFeesMode { + jit_withdraw: ::core::primitive::bool, + }, + #[codec(index = 44)] + SetTopic([::core::primitive::u8; 32usize]), + #[codec(index = 45)] + ClearTopic, + #[codec(index = 46)] + AliasOrigin(runtime_types::staging_xcm::v3::multilocation::MultiLocation), + #[codec(index = 47)] + UnpaidExecution { + weight_limit: runtime_types::xcm::v3::WeightLimit, + check_origin: ::core::option::Option< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, + >, + }, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum MaybeErrorCode { + #[codec(index = 0)] + Success, + #[codec(index = 1)] + Error( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ), + #[codec(index = 2)] + TruncatedError( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum OriginKind { + #[codec(index = 0)] + Native, + #[codec(index = 1)] + SovereignAccount, + #[codec(index = 2)] + Superuser, + #[codec(index = 3)] + Xcm, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct PalletInfo { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub name: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub module_name: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + #[codec(compact)] + pub major: ::core::primitive::u32, + #[codec(compact)] + pub minor: ::core::primitive::u32, + #[codec(compact)] + pub patch: ::core::primitive::u32, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct QueryResponseInfo { + pub destination: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + #[codec(compact)] + pub query_id: ::core::primitive::u64, + pub max_weight: runtime_types::sp_weights::weight_v2::Weight, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Response { + #[codec(index = 0)] + Null, + #[codec(index = 1)] + Assets(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 2)] + ExecutionResult( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v3::traits::Error, + )>, + ), + #[codec(index = 3)] + Version(::core::primitive::u32), + #[codec(index = 4)] + PalletsInfo( + runtime_types::bounded_collections::bounded_vec::BoundedVec< + runtime_types::xcm::v3::PalletInfo, + >, + ), + #[codec(index = 5)] + DispatchResult(runtime_types::xcm::v3::MaybeErrorCode), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum WeightLimit { + #[codec(index = 0)] + Unlimited, + #[codec(index = 1)] + Limited(runtime_types::sp_weights::weight_v2::Weight), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct Xcm( + pub ::subxt_core::alloc::vec::Vec, + ); + } + pub mod v5 { + use super::runtime_types; + pub mod traits { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Error { + #[codec(index = 0)] + Overflow, + #[codec(index = 1)] + Unimplemented, + #[codec(index = 2)] + UntrustedReserveLocation, + #[codec(index = 3)] + UntrustedTeleportLocation, + #[codec(index = 4)] + LocationFull, + #[codec(index = 5)] + LocationNotInvertible, + #[codec(index = 6)] + BadOrigin, + #[codec(index = 7)] + InvalidLocation, + #[codec(index = 8)] + AssetNotFound, + #[codec(index = 9)] + FailedToTransactAsset, + #[codec(index = 10)] + NotWithdrawable, + #[codec(index = 11)] + LocationCannotHold, + #[codec(index = 12)] + ExceedsMaxMessageSize, + #[codec(index = 13)] + DestinationUnsupported, + #[codec(index = 14)] + Transport, + #[codec(index = 15)] + Unroutable, + #[codec(index = 16)] + UnknownClaim, + #[codec(index = 17)] + FailedToDecode, + #[codec(index = 18)] + MaxWeightInvalid, + #[codec(index = 19)] + NotHoldingFees, + #[codec(index = 20)] + TooExpensive, + #[codec(index = 21)] + Trap(::core::primitive::u64), + #[codec(index = 22)] + ExpectationFalse, + #[codec(index = 23)] + PalletNotFound, + #[codec(index = 24)] + NameMismatch, + #[codec(index = 25)] + VersionIncompatible, + #[codec(index = 26)] + HoldingWouldOverflow, + #[codec(index = 27)] + ExportError, + #[codec(index = 28)] + ReanchorFailed, + #[codec(index = 29)] + NoDeal, + #[codec(index = 30)] + FeesNotMet, + #[codec(index = 31)] + LockError, + #[codec(index = 32)] + NoPermission, + #[codec(index = 33)] + Unanchored, + #[codec(index = 34)] + NotDepositable, + #[codec(index = 35)] + TooManyAssets, + #[codec(index = 36)] + UnhandledXcmVersion, + #[codec(index = 37)] + WeightLimitReached(runtime_types::sp_weights::weight_v2::Weight), + #[codec(index = 38)] + Barrier, + #[codec(index = 39)] + WeightNotComputable, + #[codec(index = 40)] + ExceedsStackLimit, + } + } + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum VersionedAsset { + #[codec(index = 3)] + V3(runtime_types::xcm::v3::multiasset::MultiAsset), + #[codec(index = 4)] + V4(runtime_types::staging_xcm::v4::asset::Asset), + #[codec(index = 5)] + V5(runtime_types::staging_xcm::v5::asset::Asset), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum VersionedAssetId { + #[codec(index = 3)] + V3(runtime_types::xcm::v3::multiasset::AssetId), + #[codec(index = 4)] + V4(runtime_types::staging_xcm::v4::asset::AssetId), + #[codec(index = 5)] + V5(runtime_types::staging_xcm::v5::asset::AssetId), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum VersionedAssets { + #[codec(index = 3)] + V3(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 4)] + V4(runtime_types::staging_xcm::v4::asset::Assets), + #[codec(index = 5)] + V5(runtime_types::staging_xcm::v5::asset::Assets), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum VersionedLocation { + #[codec(index = 3)] + V3(runtime_types::staging_xcm::v3::multilocation::MultiLocation), + #[codec(index = 4)] + V4(runtime_types::staging_xcm::v4::location::Location), + #[codec(index = 5)] + V5(runtime_types::staging_xcm::v5::location::Location), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum VersionedResponse { + #[codec(index = 3)] + V3(runtime_types::xcm::v3::Response), + #[codec(index = 4)] + V4(runtime_types::staging_xcm::v4::Response), + #[codec(index = 5)] + V5(runtime_types::staging_xcm::v5::Response), + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum VersionedXcm { + #[codec(index = 3)] + V3(runtime_types::xcm::v3::Xcm), + #[codec(index = 4)] + V4(runtime_types::staging_xcm::v4::Xcm), + #[codec(index = 5)] + V5(runtime_types::staging_xcm::v5::Xcm), + } + } + pub mod xcm_runtime_apis { + use super::runtime_types; + pub mod authorized_aliases { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Error { + #[codec(index = 0)] + LocationVersionConversionFailed, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct OriginAliaser { + pub location: runtime_types::xcm::VersionedLocation, + pub expiry: ::core::option::Option<::core::primitive::u64>, + } + } + pub mod conversions { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Error { + #[codec(index = 0)] + Unsupported, + #[codec(index = 1)] + VersionedConversionFailed, + } + } + pub mod dry_run { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct CallDryRunEffects<_0> { + pub execution_result: ::core::result::Result< + runtime_types::frame_support::dispatch::PostDispatchInfo, + runtime_types::sp_runtime::DispatchErrorWithPostInfo< + runtime_types::frame_support::dispatch::PostDispatchInfo, + >, + >, + pub emitted_events: ::subxt_core::alloc::vec::Vec<_0>, + pub local_xcm: ::core::option::Option, + pub forwarded_xcms: ::subxt_core::alloc::vec::Vec<( + runtime_types::xcm::VersionedLocation, + ::subxt_core::alloc::vec::Vec, + )>, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Error { + #[codec(index = 0)] + Unimplemented, + #[codec(index = 1)] + VersionedConversionFailed, + } + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub struct XcmDryRunEffects<_0> { + pub execution_result: runtime_types::staging_xcm::v5::traits::Outcome, + pub emitted_events: ::subxt_core::alloc::vec::Vec<_0>, + pub forwarded_xcms: ::subxt_core::alloc::vec::Vec<( + runtime_types::xcm::VersionedLocation, + ::subxt_core::alloc::vec::Vec, + )>, + } + } + pub mod fees { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Error { + #[codec(index = 0)] + Unimplemented, + #[codec(index = 1)] + VersionedConversionFailed, + #[codec(index = 2)] + WeightNotComputable, + #[codec(index = 3)] + UnhandledXcmVersion, + #[codec(index = 4)] + AssetNotFound, + #[codec(index = 5)] + Unroutable, + } + } + pub mod trusted_query { + use super::runtime_types; + #[derive( + :: subxt_core :: ext :: scale_decode :: DecodeAsType, + :: subxt_core :: ext :: scale_encode :: EncodeAsType, + Clone, + Debug, + Eq, + PartialEq, + )] + #[decode_as_type(crate_path = ":: subxt_core :: ext :: scale_decode")] + #[encode_as_type(crate_path = ":: subxt_core :: ext :: scale_encode")] + pub enum Error { + #[codec(index = 0)] + VersionedAssetConversionFailed, + #[codec(index = 1)] + VersionedLocationConversionFailed, + } + } + } + } +}