Trait cfg_traits::PoolMetadata
source · pub trait PoolMetadata<Balance, VersionedMultiLocation> {
type AssetMetadata;
type CustomMetadata;
type PoolMetadata;
type PoolId: Parameter + Member + Debug + Copy + Default + TypeInfo + Encode + Decode + MaxEncodedLen;
type TrancheId: Parameter + Member + Debug + Copy + Default + TypeInfo + MaxEncodedLen;
// Required methods
fn get_pool_metadata(
pool_id: Self::PoolId
) -> Result<Self::PoolMetadata, DispatchError>;
fn set_pool_metadata(
pool_id: Self::PoolId,
metadata: Vec<u8>
) -> DispatchResult;
fn get_tranche_token_metadata(
pool_id: Self::PoolId,
tranche: Self::TrancheId
) -> Result<Self::AssetMetadata, DispatchError>;
fn create_tranche_token_metadata(
pool_id: Self::PoolId,
tranche: Self::TrancheId,
metadata: Self::AssetMetadata
) -> DispatchResult;
fn update_tranche_token_metadata(
pool_id: Self::PoolId,
tranche: Self::TrancheId,
decimals: Option<u32>,
name: Option<Vec<u8>>,
symbol: Option<Vec<u8>>,
existential_deposit: Option<Balance>,
location: Option<Option<VersionedMultiLocation>>,
additional: Option<Self::CustomMetadata>
) -> DispatchResult;
}
Expand description
A trait that supports retrieval and mutation of pool and tranche token metadata.
Required Associated Types§
type AssetMetadata
type CustomMetadata
type PoolMetadata
type PoolId: Parameter + Member + Debug + Copy + Default + TypeInfo + Encode + Decode + MaxEncodedLen
type TrancheId: Parameter + Member + Debug + Copy + Default + TypeInfo + MaxEncodedLen
Required Methods§
sourcefn get_pool_metadata(
pool_id: Self::PoolId
) -> Result<Self::PoolMetadata, DispatchError>
fn get_pool_metadata( pool_id: Self::PoolId ) -> Result<Self::PoolMetadata, DispatchError>
Get the metadata of the given pool.
sourcefn set_pool_metadata(pool_id: Self::PoolId, metadata: Vec<u8>) -> DispatchResult
fn set_pool_metadata(pool_id: Self::PoolId, metadata: Vec<u8>) -> DispatchResult
Set the metadata of the given pool.
sourcefn get_tranche_token_metadata(
pool_id: Self::PoolId,
tranche: Self::TrancheId
) -> Result<Self::AssetMetadata, DispatchError>
fn get_tranche_token_metadata( pool_id: Self::PoolId, tranche: Self::TrancheId ) -> Result<Self::AssetMetadata, DispatchError>
Get the metadata of the given pair of pool and tranche id.
sourcefn create_tranche_token_metadata(
pool_id: Self::PoolId,
tranche: Self::TrancheId,
metadata: Self::AssetMetadata
) -> DispatchResult
fn create_tranche_token_metadata( pool_id: Self::PoolId, tranche: Self::TrancheId, metadata: Self::AssetMetadata ) -> DispatchResult
Register the metadata for the currency derived from the given pair of pool id and tranche.
sourcefn update_tranche_token_metadata(
pool_id: Self::PoolId,
tranche: Self::TrancheId,
decimals: Option<u32>,
name: Option<Vec<u8>>,
symbol: Option<Vec<u8>>,
existential_deposit: Option<Balance>,
location: Option<Option<VersionedMultiLocation>>,
additional: Option<Self::CustomMetadata>
) -> DispatchResult
fn update_tranche_token_metadata( pool_id: Self::PoolId, tranche: Self::TrancheId, decimals: Option<u32>, name: Option<Vec<u8>>, symbol: Option<Vec<u8>>, existential_deposit: Option<Balance>, location: Option<Option<VersionedMultiLocation>>, additional: Option<Self::CustomMetadata> ) -> DispatchResult
Update the metadata of the given pair of pool and tranche id.
Object Safety§
This trait is not object safe.