Skip to main content
Version: 30.0.x

Class: Staking

Defined in: src/api/client/Staking.ts:43

Handles Staking related functionality

Methods​

bond()​

bond(args: BondPolyxParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/client/Staking.ts:108

Bond POLYX for staking

Parameters​

ParameterType

args

BondPolyxParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

the signing account cannot be a stash

Note​

this method is of type ProcedureMethod, which means you can call bond.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


bondExtra()​

bondExtra(args: UpdatePolyxBondParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/client/Staking.ts:115

Bond extra POLYX for staking

Parameters​

ParameterType

args

UpdatePolyxBondParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

this transaction must be signed by a stash

Note​

this method is of type ProcedureMethod, which means you can call bondExtra.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


eraInfo()​

Call Signature​

eraInfo(): Promise<StakingEraInfo>

Defined in: src/api/client/Staking.ts:204

Retrieve the current staking era information

Returns​

Promise<StakingEraInfo>

Promise that resolves to the current era information

Call Signature​

eraInfo(callback: SubCallback<StakingEraInfo>): Promise<UnsubCallback>

Defined in: src/api/client/Staking.ts:215

Retrieve the current staking era information (with subscription support)

Parameters​
ParameterTypeDescription

callback

SubCallback<StakingEraInfo>

Callback function that receives era information updates

Returns​

Promise<UnsubCallback>

Promise that resolves to an unsubscribe function

Note​

can be subscribed to, if connected to node using a web socket


getValidators()​

getValidators(paginationOpts?: PaginationOptions): Promise<ResultSet<StakingCommission>>

Defined in: src/api/client/Staking.ts:156

Return information about nomination targets

Parameters​

ParameterType

paginationOpts?

PaginationOptions

Returns​

Promise<ResultSet<StakingCommission>>

Note​

supports pagination


nominate()​

nominate(args: NominateValidatorsParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/client/Staking.ts:134

Nominate validators for the bonded POLYX

Parameters​

ParameterType

args

NominateValidatorsParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

this transaction must be signed by a controller

Note​

this method is of type ProcedureMethod, which means you can call nominate.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


setController()​

setController(args: SetStakingControllerParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/client/Staking.ts:142

Allow for a stash account to update its controller

Parameters​

ParameterType

args

SetStakingControllerParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

the transaction must be signed by a stash account

Note​

Polymesh v8 makes it so the stash will become its own controller account

Note​

this method is of type ProcedureMethod, which means you can call setController.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


setPayee()​

setPayee(args: SetStakingPayeeParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/client/Staking.ts:149

Allow for a stash account to update where it's staking rewards are deposited

Parameters​

ParameterType

args

SetStakingPayeeParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

the transaction must be signed by a controller account

Note​

this method is of type ProcedureMethod, which means you can call setPayee.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


unbond()​

unbond(args: UpdatePolyxBondParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/client/Staking.ts:120

Unbond POLYX for staking. The unbonded amount can be withdrawn after the lockup period

Parameters​

ParameterType

args

UpdatePolyxBondParams

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

this method is of type ProcedureMethod, which means you can call unbond.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it


withdraw()​

withdraw(opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/client/Staking.ts:127

Withdraw unbonded POLYX to free it for the stash account

Parameters​

ParameterType

opts?

ProcedureOpts

Returns​

Promise<GenericPolymeshTransaction<void, void>>

Note​

this transaction must be signed by a controller

Note​

this method is of type NoArgsProcedureMethod, which means you can call withdraw.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it