referrerpolicy=no-referrer-when-downgrade
pub trait NominationPoolsApi<Block: BlockT, AccountId, Balance>: Core<Block>
where AccountId: Codec, Balance: Codec,
{ // Provided methods fn pending_rewards( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, who: AccountId, ) -> Result<Balance, ApiError> { ... } fn points_to_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, points: Balance, ) -> Result<Balance, ApiError> { ... } fn balance_to_points( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, new_funds: Balance, ) -> Result<Balance, ApiError> { ... } fn pool_pending_slash( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<Balance, ApiError> { ... } fn member_pending_slash( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, member: AccountId, ) -> Result<Balance, ApiError> { ... } fn pool_needs_delegate_migration( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<bool, ApiError> { ... } fn member_needs_delegate_migration( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, member: AccountId, ) -> Result<bool, ApiError> { ... } fn member_total_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, who: AccountId, ) -> Result<Balance, ApiError> { ... } fn pool_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<Balance, ApiError> { ... } fn pool_accounts( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<(AccountId, AccountId), ApiError> { ... } }
Expand description

Runtime api for accessing information about nomination pools.

Provided Methods§

source

fn pending_rewards( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, who: AccountId, ) -> Result<Balance, ApiError>

Returns the pending rewards for the member that the AccountId was given for.

source

fn points_to_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, points: Balance, ) -> Result<Balance, ApiError>

Returns the equivalent balance of points for a given pool.

source

fn balance_to_points( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, new_funds: Balance, ) -> Result<Balance, ApiError>

Returns the equivalent points of new_funds for a given pool.

source

fn pool_pending_slash( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<Balance, ApiError>

Returns the pending slash for a given pool.

source

fn member_pending_slash( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, member: AccountId, ) -> Result<Balance, ApiError>

Returns the pending slash for a given pool member.

If pending slash of the member exceeds ExistentialDeposit, it can be reported on chain.

source

fn pool_needs_delegate_migration( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<bool, ApiError>

Returns true if the pool with pool_id needs migration.

This can happen when the pallet-nomination-pools has switched to using strategy DelegateStake but the pool still has funds that were staked using the older strategy TransferStake. Use migrate_pool_to_delegate_stake to migrate the pool.

source

fn member_needs_delegate_migration( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, member: AccountId, ) -> Result<bool, ApiError>

Returns true if the delegated funds of the pool member needs migration.

Once a pool has successfully migrated to the strategy DelegateStake, the funds of the member can be migrated from pool account to the member’s account. Use migrate_delegation to migrate the funds of the pool member.

source

fn member_total_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, who: AccountId, ) -> Result<Balance, ApiError>

Returns the total contribution of a pool member including any balance that is unbonding.

source

fn pool_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<Balance, ApiError>

Total balance contributed to the pool.

source

fn pool_accounts( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<(AccountId, AccountId), ApiError>

Returns the bonded account and reward account associated with the pool_id.

Trait Implementations§

source§

impl<Block: BlockT, AccountId, Balance> RuntimeApiInfo for dyn NominationPoolsApi<Block, AccountId, Balance>

source§

const ID: [u8; 8] = _

The identifier of the runtime api.
source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§