api.client.Staking - PolymeshAssociation/polymesh-sdk GitHub Wiki
@polymeshassociation/polymesh-sdk / api/client/Staking
api/client/Staking
Classes
Staking
Defined in: api/client/Staking.ts:42
Handles Staking related functionality
Methods
bond()
bond(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/client/Staking.ts:108
Bond POLYX for staking
Parameters
| Parameter | Type |
|---|---|
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,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/client/Staking.ts:115
Bond extra POLYX for staking
Parameters
| Parameter | Type |
|---|---|
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: api/client/Staking.ts:203
Retrieve the current staking era information
Returns
Promise<StakingEraInfo>
Promise that resolves to the current era information
Call Signature
eraInfo(
callback):Promise<UnsubCallback>
Defined in: api/client/Staking.ts:214
Retrieve the current staking era information (with subscription support)
Parameters
| Parameter | Type | Description |
|---|---|---|
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?):Promise<ResultSet<StakingCommission>>
Defined in: api/client/Staking.ts:155
Return information about nomination targets
Parameters
| Parameter | Type |
|---|---|
paginationOpts? |
PaginationOptions |
Returns
Promise<ResultSet<StakingCommission>>
Note
supports pagination
nominate()
nominate(
args,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/client/Staking.ts:134
Nominate validators for the bonded POLYX
Parameters
| Parameter | Type |
|---|---|
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(
opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/client/Staking.ts:141
Allow for a stash account to update its controller so the stash becomes its own controller
Parameters
| Parameter | Type |
|---|---|
opts? |
ProcedureOpts |
Returns
Promise<GenericPolymeshTransaction<void, void>>
Note
the transaction must be signed by a stash account
Note
this method is of type NoArgsProcedureMethod, 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,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/client/Staking.ts:148
Allow for a stash account to update where it's staking rewards are deposited
Parameters
| Parameter | Type |
|---|---|
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,opts?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/client/Staking.ts:120
Unbond POLYX for staking. The unbonded amount can be withdrawn after the lockup period
Parameters
| Parameter | Type |
|---|---|
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?):Promise<GenericPolymeshTransaction<void,void>>
Defined in: api/client/Staking.ts:127
Withdraw unbonded POLYX to free it for the stash account
Parameters
| Parameter | Type |
|---|---|
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