pub trait PoolXykPallet<AccountId, AssetId> {
    type PoolProvidersOutput: IntoIterator<Item = (AccountId, Balance)>;
    type PoolPropertiesOutput: IntoIterator<Item = (AssetId, AssetId, (AccountId, AccountId))>;

    // Required methods
    fn pool_providers(pool_account: &AccountId) -> Self::PoolProvidersOutput;
    fn total_issuance(
        pool_account: &AccountId
    ) -> Result<Balance, DispatchError>;
    fn all_properties() -> Self::PoolPropertiesOutput;

    // Provided methods
    fn properties_of_pool(
        _base_asset_id: AssetId,
        _target_asset_id: AssetId
    ) -> Option<(AccountId, AccountId)> { ... }
    fn balance_of_pool_provider(
        _pool_account: AccountId,
        _liquidity_provider_account: AccountId
    ) -> Option<Balance> { ... }
    fn transfer_lp_tokens(
        _pool_account: AccountId,
        _asset_a: AssetId,
        _asset_b: AssetId,
        _base_account_id: AccountId,
        _target_account_id: AccountId,
        _pool_tokens: Balance
    ) -> Result<(), DispatchError> { ... }
}

Required Associated Types§

Required Methods§

Provided Methods§

source

fn properties_of_pool( _base_asset_id: AssetId, _target_asset_id: AssetId ) -> Option<(AccountId, AccountId)>

source

fn balance_of_pool_provider( _pool_account: AccountId, _liquidity_provider_account: AccountId ) -> Option<Balance>

source

fn transfer_lp_tokens( _pool_account: AccountId, _asset_a: AssetId, _asset_b: AssetId, _base_account_id: AccountId, _target_account_id: AccountId, _pool_tokens: Balance ) -> Result<(), DispatchError>

Implementors§