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§
sourcefn pending_rewards(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
who: AccountId,
) -> Result<Balance, ApiError>
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.
sourcefn points_to_balance(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
pool_id: PoolId,
points: Balance,
) -> Result<Balance, ApiError>
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.
sourcefn balance_to_points(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
pool_id: PoolId,
new_funds: 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>
Returns the equivalent points of new_funds
for a given pool.
sourcefn pool_pending_slash(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
pool_id: PoolId,
) -> Result<Balance, ApiError>
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.
sourcefn member_pending_slash(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
member: AccountId,
) -> Result<Balance, ApiError>
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.
sourcefn pool_needs_delegate_migration(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
pool_id: PoolId,
) -> Result<bool, ApiError>
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.
sourcefn member_needs_delegate_migration(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
member: AccountId,
) -> Result<bool, ApiError>
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.
sourcefn member_total_balance(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
who: AccountId,
) -> Result<Balance, ApiError>
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.
sourcefn pool_balance(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
pool_id: PoolId,
) -> Result<Balance, ApiError>
fn pool_balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, pool_id: PoolId, ) -> Result<Balance, ApiError>
Total balance contributed to the pool.
sourcefn pool_accounts(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
pool_id: PoolId,
) -> Result<(AccountId, AccountId), ApiError>
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.