mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 16:51:03 +00:00
Simple Trait to Inspect Metadata (#9893)
* simple trait to inspect metadata * import vec
This commit is contained in:
@@ -23,6 +23,7 @@ use super::{
|
||||
};
|
||||
use crate::dispatch::{DispatchError, DispatchResult};
|
||||
use sp_runtime::traits::Saturating;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
mod balanced;
|
||||
pub use balanced::{Balanced, Unbalanced};
|
||||
@@ -65,6 +66,18 @@ pub trait Inspect<AccountId> {
|
||||
) -> WithdrawConsequence<Self::Balance>;
|
||||
}
|
||||
|
||||
/// Trait for reading metadata from a fungible asset.
|
||||
pub trait InspectMetadata<AccountId>: Inspect<AccountId> {
|
||||
/// Return the name of an asset.
|
||||
fn name(asset: &Self::AssetId) -> Vec<u8>;
|
||||
|
||||
/// Return the symbol of an asset.
|
||||
fn symbol(asset: &Self::AssetId) -> Vec<u8>;
|
||||
|
||||
/// Return the decimals of an asset.
|
||||
fn decimals(asset: &Self::AssetId) -> u8;
|
||||
}
|
||||
|
||||
/// Trait for providing a set of named fungible assets which can be created and destroyed.
|
||||
pub trait Mutate<AccountId>: Inspect<AccountId> {
|
||||
/// Attempt to increase the `asset` balance of `who` by `amount`.
|
||||
|
||||
Reference in New Issue
Block a user