diff --git a/Cargo.toml b/Cargo.toml index 1005f88..fd5bfdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -100,6 +100,7 @@ tokio = { version = "1.19", features = ["rt"] } default = [ "std", "polymesh_v7", "rpc", "serde", "v14" ] polymesh_v7 = [] +polymesh_v8 = [] # Download the chain metadata from a RPC node. download_metadata = [ diff --git a/crates/polymesh-api-client-extras/Cargo.toml b/crates/polymesh-api-client-extras/Cargo.toml index d43c5bc..7daf415 100644 --- a/crates/polymesh-api-client-extras/Cargo.toml +++ b/crates/polymesh-api-client-extras/Cargo.toml @@ -25,6 +25,8 @@ default = [ "std", "serde", "polymesh_v7" ] polymesh_v7 = ["polymesh-api/polymesh_v7"] +polymesh_v8 = ["polymesh-api/polymesh_v8"] + serde = [ "polymesh-api/serde", ] diff --git a/crates/polymesh-api-client-extras/src/user.rs b/crates/polymesh-api-client-extras/src/user.rs index 1101e3a..9ef8e7b 100644 --- a/crates/polymesh-api-client-extras/src/user.rs +++ b/crates/polymesh-api-client-extras/src/user.rs @@ -185,6 +185,7 @@ impl PolymeshHelper { Ok(did) } + #[cfg(not(feature = "polymesh_v8"))] pub async fn get_account_info( &self, account: AccountId, @@ -192,6 +193,14 @@ impl PolymeshHelper { Ok(self.api.query().system().account(account).await?) } + #[cfg(feature = "polymesh_v8")] + pub async fn get_account_info( + &self, + account: AccountId, + ) -> Result>> { + Ok(self.api.query().system().account(account).await?) + } + pub async fn get_account_balance(&self, account: AccountId) -> Result { self .get_account_info(account) diff --git a/specs/polymesh_dev_spec_7003000.meta b/specs/polymesh_dev_spec_7003000.meta new file mode 100644 index 0000000..329b20b Binary files /dev/null and b/specs/polymesh_dev_spec_7003000.meta differ diff --git a/src/lib.rs b/src/lib.rs index d60f7b4..a39fbc5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,10 @@ extern crate alloc; use polymesh_api_codegen_macro::*; +#[cfg_attr( + all(not(feature = "download_metadata"), feature = "polymesh_v8"), + codegen_api(metadata_file = "specs/polymesh_dev_spec_7003000.meta") +)] #[cfg_attr( all(not(feature = "download_metadata"), feature = "polymesh_v7"), codegen_api(metadata_file = "specs/polymesh_dev_spec_7000005.meta")