mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Return account's asset balances (#13352)
* Runtime method to get user's assets balances * Fix test (typo) * Update frame/assets/src/functions.rs * Remove instance param * Update frame/assets/src/functions.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Remove instance param * Refactor * Chore * Update doc --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -105,6 +105,9 @@ use sp_runtime::generic::Era;
|
||||
/// Generated voter bag information.
|
||||
mod voter_bags;
|
||||
|
||||
/// Runtime API definition for assets.
|
||||
pub mod assets_api;
|
||||
|
||||
// Make the WASM binary available.
|
||||
#[cfg(feature = "std")]
|
||||
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
|
||||
@@ -2072,6 +2075,18 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
|
||||
impl assets_api::AssetsApi<
|
||||
Block,
|
||||
AccountId,
|
||||
Balance,
|
||||
u32,
|
||||
> for Runtime
|
||||
{
|
||||
fn account_balances(account: AccountId) -> Vec<(u32, Balance)> {
|
||||
Assets::account_balances(account)
|
||||
}
|
||||
}
|
||||
|
||||
impl pallet_contracts::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash> for Runtime
|
||||
{
|
||||
fn call(
|
||||
|
||||
Reference in New Issue
Block a user