Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 2 additions & 0 deletions crates/polymesh-api-client-extras/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
9 changes: 9 additions & 0 deletions crates/polymesh-api-client-extras/src/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,22 @@ impl PolymeshHelper {
Ok(did)
}

#[cfg(not(feature = "polymesh_v8"))]
pub async fn get_account_info(
&self,
account: AccountId,
) -> Result<AccountInfo<u32, AccountData>> {
Ok(self.api.query().system().account(account).await?)
}

#[cfg(feature = "polymesh_v8")]
pub async fn get_account_info(
&self,
account: AccountId,
) -> Result<AccountInfo<u32, AccountData<u128>>> {
Ok(self.api.query().system().account(account).await?)
}

pub async fn get_account_balance(&self, account: AccountId) -> Result<u128> {
self
.get_account_info(account)
Expand Down
Binary file added specs/polymesh_dev_spec_7003000.meta
Binary file not shown.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down