@polymeshassociation/polymesh-sdk 31.0.0 → 31.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +6 -132
- package/api/client/AccountManagement.d.ts +48 -0
- package/api/client/AccountManagement.d.ts.map +1 -1
- package/api/client/AccountManagement.js +38 -0
- package/api/client/AccountManagement.js.map +1 -1
- package/api/client/Assets.d.ts.map +1 -1
- package/api/client/Assets.js +4 -5
- package/api/client/Assets.js.map +1 -1
- package/api/client/Claims.d.ts +5 -0
- package/api/client/Claims.d.ts.map +1 -1
- package/api/client/Claims.js +5 -2
- package/api/client/Claims.js.map +1 -1
- package/api/client/Network.d.ts +104 -3
- package/api/client/Network.d.ts.map +1 -1
- package/api/client/Network.js +162 -14
- package/api/client/Network.js.map +1 -1
- package/api/client/Polymesh.d.ts.map +1 -1
- package/api/client/Polymesh.js +5 -6
- package/api/client/Polymesh.js.map +1 -1
- package/api/client/Staking.d.ts +206 -5
- package/api/client/Staking.d.ts.map +1 -1
- package/api/client/Staking.js +443 -1
- package/api/client/Staking.js.map +1 -1
- package/api/client/types.d.ts +281 -5
- package/api/client/types.d.ts.map +1 -1
- package/api/client/types.js +29 -1
- package/api/client/types.js.map +1 -1
- package/api/entities/Account/MultiSig/index.d.ts +6 -0
- package/api/entities/Account/MultiSig/index.d.ts.map +1 -1
- package/api/entities/Account/MultiSig/index.js +6 -2
- package/api/entities/Account/MultiSig/index.js.map +1 -1
- package/api/entities/Account/Staking/index.d.ts +26 -2
- package/api/entities/Account/Staking/index.d.ts.map +1 -1
- package/api/entities/Account/Staking/index.js +36 -3
- package/api/entities/Account/Staking/index.js.map +1 -1
- package/api/entities/Account/index.d.ts +42 -3
- package/api/entities/Account/index.d.ts.map +1 -1
- package/api/entities/Account/index.js +94 -1
- package/api/entities/Account/index.js.map +1 -1
- package/api/entities/Account/types.d.ts +61 -2
- package/api/entities/Account/types.d.ts.map +1 -1
- package/api/entities/Account/types.js +25 -1
- package/api/entities/Account/types.js.map +1 -1
- package/api/entities/Asset/Base/BaseAsset.js +1 -1
- package/api/entities/Asset/Base/BaseAsset.js.map +1 -1
- package/api/entities/Asset/Fungible/index.d.ts +6 -0
- package/api/entities/Asset/Fungible/index.d.ts.map +1 -1
- package/api/entities/Asset/Fungible/index.js +6 -2
- package/api/entities/Asset/Fungible/index.js.map +1 -1
- package/api/entities/Asset/NonFungible/Nft.js +1 -1
- package/api/entities/Asset/NonFungible/Nft.js.map +1 -1
- package/api/entities/Asset/NonFungible/NftCollection.d.ts +6 -0
- package/api/entities/Asset/NonFungible/NftCollection.d.ts.map +1 -1
- package/api/entities/Asset/NonFungible/NftCollection.js +8 -4
- package/api/entities/Asset/NonFungible/NftCollection.js.map +1 -1
- package/api/entities/Asset/types.d.ts +11 -0
- package/api/entities/Asset/types.d.ts.map +1 -1
- package/api/entities/Asset/types.js.map +1 -1
- package/api/entities/AuthorizationRequest.js +1 -1
- package/api/entities/AuthorizationRequest.js.map +1 -1
- package/api/entities/Checkpoint.js +1 -1
- package/api/entities/Checkpoint.js.map +1 -1
- package/api/entities/CheckpointSchedule/index.js +1 -1
- package/api/entities/CheckpointSchedule/index.js.map +1 -1
- package/api/entities/CorporateActionBase/index.js +1 -1
- package/api/entities/CorporateActionBase/index.js.map +1 -1
- package/api/entities/CustomPermissionGroup.js +1 -1
- package/api/entities/CustomPermissionGroup.js.map +1 -1
- package/api/entities/DividendDistribution/index.d.ts +6 -0
- package/api/entities/DividendDistribution/index.d.ts.map +1 -1
- package/api/entities/DividendDistribution/index.js +6 -2
- package/api/entities/DividendDistribution/index.js.map +1 -1
- package/api/entities/Identity/AssetPermissions.d.ts +5 -1
- package/api/entities/Identity/AssetPermissions.d.ts.map +1 -1
- package/api/entities/Identity/AssetPermissions.js +5 -2
- package/api/entities/Identity/AssetPermissions.js.map +1 -1
- package/api/entities/Identity/IdentityAuthorizations.d.ts +5 -0
- package/api/entities/Identity/IdentityAuthorizations.d.ts.map +1 -1
- package/api/entities/Identity/IdentityAuthorizations.js +5 -0
- package/api/entities/Identity/IdentityAuthorizations.js.map +1 -1
- package/api/entities/Identity/Portfolios.js +1 -1
- package/api/entities/Identity/Portfolios.js.map +1 -1
- package/api/entities/Identity/index.d.ts +50 -1
- package/api/entities/Identity/index.d.ts.map +1 -1
- package/api/entities/Identity/index.js +76 -9
- package/api/entities/Identity/index.js.map +1 -1
- package/api/entities/Instruction/index.js +1 -1
- package/api/entities/Instruction/index.js.map +1 -1
- package/api/entities/MetadataEntry/index.js +1 -1
- package/api/entities/MetadataEntry/index.js.map +1 -1
- package/api/entities/NumberedPortfolio.d.ts +4 -0
- package/api/entities/NumberedPortfolio.d.ts.map +1 -1
- package/api/entities/NumberedPortfolio.js +1 -1
- package/api/entities/NumberedPortfolio.js.map +1 -1
- package/api/entities/Offering/index.d.ts +5 -0
- package/api/entities/Offering/index.d.ts.map +1 -1
- package/api/entities/Offering/index.js +6 -3
- package/api/entities/Offering/index.js.map +1 -1
- package/api/entities/Portfolio/index.d.ts +22 -0
- package/api/entities/Portfolio/index.d.ts.map +1 -1
- package/api/entities/Portfolio/index.js +99 -21
- package/api/entities/Portfolio/index.js.map +1 -1
- package/api/entities/Venue/index.d.ts +3 -0
- package/api/entities/Venue/index.d.ts.map +1 -1
- package/api/entities/Venue/index.js +4 -1
- package/api/entities/Venue/index.js.map +1 -1
- package/api/entities/common/namespaces/Authorizations.d.ts +16 -2
- package/api/entities/common/namespaces/Authorizations.d.ts.map +1 -1
- package/api/entities/common/namespaces/Authorizations.js +16 -4
- package/api/entities/common/namespaces/Authorizations.js.map +1 -1
- package/api/procedures/acceptPrimaryKeyRotation.js +1 -1
- package/api/procedures/acceptPrimaryKeyRotation.js.map +1 -1
- package/api/procedures/bondPolyx.d.ts +14 -2
- package/api/procedures/bondPolyx.d.ts.map +1 -1
- package/api/procedures/bondPolyx.js +39 -8
- package/api/procedures/bondPolyx.js.map +1 -1
- package/api/procedures/chillStaking.d.ts +36 -0
- package/api/procedures/chillStaking.d.ts.map +1 -0
- package/api/procedures/chillStaking.js +72 -0
- package/api/procedures/chillStaking.js.map +1 -0
- package/api/procedures/claimDividends.d.ts.map +1 -1
- package/api/procedures/claimDividends.js +11 -1
- package/api/procedures/claimDividends.js.map +1 -1
- package/api/procedures/configureDividendDistribution.js +2 -2
- package/api/procedures/configureDividendDistribution.js.map +1 -1
- package/api/procedures/issueNft.d.ts +1 -0
- package/api/procedures/issueNft.d.ts.map +1 -1
- package/api/procedures/issueNft.js +24 -6
- package/api/procedures/issueNft.js.map +1 -1
- package/api/procedures/modifyAsset.js +1 -1
- package/api/procedures/modifyAsset.js.map +1 -1
- package/api/procedures/moveFunds.js +2 -2
- package/api/procedures/moveFunds.js.map +1 -1
- package/api/procedures/nominateValidators.d.ts +6 -1
- package/api/procedures/nominateValidators.d.ts.map +1 -1
- package/api/procedures/nominateValidators.js +45 -6
- package/api/procedures/nominateValidators.js.map +1 -1
- package/api/procedures/redeemNft.js +1 -1
- package/api/procedures/redeemNft.js.map +1 -1
- package/api/procedures/redeemTokens.js +1 -1
- package/api/procedures/redeemTokens.js.map +1 -1
- package/api/procedures/removeAssetRequirement.js +1 -1
- package/api/procedures/removeAssetRequirement.js.map +1 -1
- package/api/procedures/removeCheckpointSchedule.js +1 -1
- package/api/procedures/removeCheckpointSchedule.js.map +1 -1
- package/api/procedures/removeCorporateAction.js +3 -3
- package/api/procedures/removeCorporateAction.js.map +1 -1
- package/api/procedures/setCustodian.d.ts +5 -1
- package/api/procedures/setCustodian.d.ts.map +1 -1
- package/api/procedures/setCustodian.js +2 -6
- package/api/procedures/setCustodian.js.map +1 -1
- package/api/procedures/setStakingController.d.ts +9 -1
- package/api/procedures/setStakingController.d.ts.map +1 -1
- package/api/procedures/setStakingController.js +10 -6
- package/api/procedures/setStakingController.js.map +1 -1
- package/api/procedures/setStakingPayee.d.ts +9 -1
- package/api/procedures/setStakingPayee.d.ts.map +1 -1
- package/api/procedures/setStakingPayee.js +10 -6
- package/api/procedures/setStakingPayee.js.map +1 -1
- package/api/procedures/toggleEvmAccountMapping.d.ts +18 -0
- package/api/procedures/toggleEvmAccountMapping.d.ts.map +1 -0
- package/api/procedures/toggleEvmAccountMapping.js +80 -0
- package/api/procedures/toggleEvmAccountMapping.js.map +1 -0
- package/api/procedures/types.d.ts +52 -1
- package/api/procedures/types.d.ts.map +1 -1
- package/api/procedures/types.js.map +1 -1
- package/api/procedures/updateBondedPolyx.d.ts +13 -2
- package/api/procedures/updateBondedPolyx.d.ts.map +1 -1
- package/api/procedures/updateBondedPolyx.js +109 -46
- package/api/procedures/updateBondedPolyx.js.map +1 -1
- package/api/procedures/withdrawUnbondedPolyx.d.ts +11 -2
- package/api/procedures/withdrawUnbondedPolyx.d.ts.map +1 -1
- package/api/procedures/withdrawUnbondedPolyx.js +19 -15
- package/api/procedures/withdrawUnbondedPolyx.js.map +1 -1
- package/base/Context.d.ts +37 -1
- package/base/Context.d.ts.map +1 -1
- package/base/Context.js +68 -3
- package/base/Context.js.map +1 -1
- package/base/PolymeshTransactionBase.d.ts +199 -3
- package/base/PolymeshTransactionBase.d.ts.map +1 -1
- package/base/PolymeshTransactionBase.js +595 -137
- package/base/PolymeshTransactionBase.js.map +1 -1
- package/base/Procedure.d.ts.map +1 -1
- package/base/Procedure.js +2 -0
- package/base/Procedure.js.map +1 -1
- package/base/ethTransaction.d.ts +222 -0
- package/base/ethTransaction.d.ts.map +1 -0
- package/base/ethTransaction.js +317 -0
- package/base/ethTransaction.js.map +1 -0
- package/base/types.d.ts +66 -1
- package/base/types.d.ts.map +1 -1
- package/base/types.js.map +1 -1
- package/base/utils.d.ts +60 -11
- package/base/utils.d.ts.map +1 -1
- package/base/utils.js +328 -45
- package/base/utils.js.map +1 -1
- package/internal.d.ts +2 -0
- package/internal.d.ts.map +1 -1
- package/internal.js +6 -2
- package/internal.js.map +1 -1
- package/middleware/queries/assets.d.ts +13 -5
- package/middleware/queries/assets.d.ts.map +1 -1
- package/middleware/queries/assets.js +60 -27
- package/middleware/queries/assets.js.map +1 -1
- package/middleware/queries/authorizations.d.ts +2 -2
- package/middleware/queries/authorizations.d.ts.map +1 -1
- package/middleware/queries/authorizations.js +4 -3
- package/middleware/queries/authorizations.js.map +1 -1
- package/middleware/queries/claims.d.ts +4 -4
- package/middleware/queries/claims.d.ts.map +1 -1
- package/middleware/queries/claims.js +18 -6
- package/middleware/queries/claims.js.map +1 -1
- package/middleware/queries/common.d.ts +41 -1
- package/middleware/queries/common.d.ts.map +1 -1
- package/middleware/queries/common.js +51 -9
- package/middleware/queries/common.js.map +1 -1
- package/middleware/queries/distributions.d.ts +2 -2
- package/middleware/queries/distributions.d.ts.map +1 -1
- package/middleware/queries/distributions.js +10 -3
- package/middleware/queries/distributions.js.map +1 -1
- package/middleware/queries/events.d.ts +2 -2
- package/middleware/queries/events.d.ts.map +1 -1
- package/middleware/queries/events.js +4 -3
- package/middleware/queries/events.js.map +1 -1
- package/middleware/queries/externalAgents.d.ts +2 -2
- package/middleware/queries/externalAgents.d.ts.map +1 -1
- package/middleware/queries/externalAgents.js +4 -3
- package/middleware/queries/externalAgents.js.map +1 -1
- package/middleware/queries/extrinsics.d.ts +1 -1
- package/middleware/queries/extrinsics.d.ts.map +1 -1
- package/middleware/queries/extrinsics.js +14 -8
- package/middleware/queries/extrinsics.js.map +1 -1
- package/middleware/queries/multisigs.d.ts +2 -6
- package/middleware/queries/multisigs.d.ts.map +1 -1
- package/middleware/queries/multisigs.js +10 -4
- package/middleware/queries/multisigs.js.map +1 -1
- package/middleware/queries/polyxTransactions.d.ts +2 -1
- package/middleware/queries/polyxTransactions.d.ts.map +1 -1
- package/middleware/queries/polyxTransactions.js +5 -3
- package/middleware/queries/polyxTransactions.js.map +1 -1
- package/middleware/queries/settlements.d.ts +7 -7
- package/middleware/queries/settlements.d.ts.map +1 -1
- package/middleware/queries/settlements.js +23 -14
- package/middleware/queries/settlements.js.map +1 -1
- package/middleware/queries/stos.d.ts +2 -2
- package/middleware/queries/stos.d.ts.map +1 -1
- package/middleware/queries/stos.js +9 -5
- package/middleware/queries/stos.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-31.1.0-beta.10.tgz +0 -0
- package/package.json +2 -3
- package/types/internal.d.ts +38 -1
- package/types/internal.d.ts.map +1 -1
- package/types/internal.js.map +1 -1
- package/utils/constants.d.ts +23 -0
- package/utils/constants.d.ts.map +1 -1
- package/utils/constants.js +24 -1
- package/utils/constants.js.map +1 -1
- package/utils/eth.d.ts +63 -0
- package/utils/eth.d.ts.map +1 -0
- package/utils/eth.js +209 -0
- package/utils/eth.js.map +1 -0
- package/utils/internal.d.ts +30 -2
- package/utils/internal.d.ts.map +1 -1
- package/utils/internal.js +86 -6
- package/utils/internal.js.map +1 -1
- package/utils/typeguards.d.ts +10 -0
- package/utils/typeguards.d.ts.map +1 -1
- package/utils/typeguards.js +11 -0
- package/utils/typeguards.js.map +1 -1
- package/npm-package/polymeshassociation-polymesh-sdk-31.0.0.tgz +0 -0
package/api/client/Staking.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
2
|
+
import { Account, Context } from '../../internal';
|
|
3
|
+
import { BondPolyxParams, ElectionPhase, ElectionSchedule, EraExposure, EraNominators, EraProgress, EraRewardPoints, NoArgsProcedureMethod, NominateValidatorsParams, PaginationOptions, ProcedureMethod, ResultSet, SetStakingPayeeParams, StakingCommission, StakingConstants, StakingEraInfo, SubCallback, UnsubCallback, UpdatePolyxBondParams } from '../../types';
|
|
3
4
|
/**
|
|
4
5
|
* Handles Staking related functionality
|
|
5
6
|
*/
|
|
@@ -12,7 +13,9 @@ export declare class Staking {
|
|
|
12
13
|
/**
|
|
13
14
|
* Bond POLYX for staking
|
|
14
15
|
*
|
|
15
|
-
* @note the signing
|
|
16
|
+
* @note the signing Account cannot already be a stash — use
|
|
17
|
+
* {@link api/client/Staking!Staking.bondExtra | bondExtra} to add to a bond it already has —
|
|
18
|
+
* nor a controller for another stash, since one Account cannot be both
|
|
16
19
|
*/
|
|
17
20
|
bond: ProcedureMethod<BondPolyxParams, void>;
|
|
18
21
|
/**
|
|
@@ -23,8 +26,28 @@ export declare class Staking {
|
|
|
23
26
|
bondExtra: ProcedureMethod<UpdatePolyxBondParams, void>;
|
|
24
27
|
/**
|
|
25
28
|
* Unbond POLYX for staking. The unbonded amount can be withdrawn after the lockup period
|
|
29
|
+
*
|
|
30
|
+
* @note the chain chills a stash that unbonds its whole ledger. Since this refuses an amount
|
|
31
|
+
* larger than the active bond, that is the case where nothing is already unlocking and the
|
|
32
|
+
* whole of it is unbonded — the stash stops nominating or validating as well
|
|
26
33
|
*/
|
|
27
34
|
unbond: ProcedureMethod<UpdatePolyxBondParams, void>;
|
|
35
|
+
/**
|
|
36
|
+
* Rebond POLYX that is currently unbonding, without waiting for the lockup period to elapse
|
|
37
|
+
*
|
|
38
|
+
* @note this transaction must be signed by a controller
|
|
39
|
+
*
|
|
40
|
+
* @note the chain takes the amount from the most recently unbonded POLYX first, so a partial
|
|
41
|
+
* rebond leaves the lots closest to maturing where they are
|
|
42
|
+
*/
|
|
43
|
+
rebond: ProcedureMethod<UpdatePolyxBondParams, void>;
|
|
44
|
+
/**
|
|
45
|
+
* Stop nominating validators, without unbonding any POLYX
|
|
46
|
+
*
|
|
47
|
+
* @note the bonded POLYX stays bonded. Use `unbond` to begin withdrawing it
|
|
48
|
+
* @note this transaction must be signed by a controller
|
|
49
|
+
*/
|
|
50
|
+
chill: NoArgsProcedureMethod<void>;
|
|
28
51
|
/**
|
|
29
52
|
* Withdraw unbonded POLYX to free it for the stash account
|
|
30
53
|
*
|
|
@@ -56,9 +79,37 @@ export declare class Staking {
|
|
|
56
79
|
*/
|
|
57
80
|
getValidators(paginationOpts?: PaginationOptions): Promise<ResultSet<StakingCommission>>;
|
|
58
81
|
/**
|
|
59
|
-
* Retrieve the
|
|
82
|
+
* Retrieve the validators whose set is actually in force for the active era
|
|
83
|
+
*
|
|
84
|
+
* @returns the elected validators, in the chain's own order
|
|
60
85
|
*
|
|
61
|
-
* @
|
|
86
|
+
* @note this is a different question from
|
|
87
|
+
* {@link api/client/Staking!Staking.getValidators | getValidators}, which lists every Account
|
|
88
|
+
* *declaring intent* to validate. Those declaring intent but not elected are the waiting set —
|
|
89
|
+
* subtract this result from `getValidators` to get it
|
|
90
|
+
* @note bounded by {@link api/client/Staking!Staking.getValidatorCount | getValidatorCount}, so
|
|
91
|
+
* unlike the intent list this needs no pagination
|
|
92
|
+
*/
|
|
93
|
+
getActiveValidators(): Promise<Account[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Retrieve how many validators the chain aims to elect each era
|
|
96
|
+
*
|
|
97
|
+
* @note this is the target the election is run against, not how many are currently in force —
|
|
98
|
+
* read {@link api/client/Staking!Staking.getActiveValidators | getActiveValidators} for that.
|
|
99
|
+
* The two differ when fewer Accounts declare intent than there are slots
|
|
100
|
+
*/
|
|
101
|
+
getValidatorCount(): Promise<BigNumber>;
|
|
102
|
+
/**
|
|
103
|
+
* Retrieve information about the staking eras the chain is tracking
|
|
104
|
+
*
|
|
105
|
+
* @returns Promise that resolves to the era information
|
|
106
|
+
*
|
|
107
|
+
* @note the chain tracks **two** era numbers and they are not interchangeable. `currentEra` is
|
|
108
|
+
* the latest era the chain has *planned* — a validator set has been elected for it, but the
|
|
109
|
+
* Session pallet may not have brought it into force. `activeEra` is the era whose validator set
|
|
110
|
+
* is in force and whose rewards and slashes are being processed. `currentEra` runs ahead of
|
|
111
|
+
* `activeEra` between an election and the session rotation that follows it, and the two are
|
|
112
|
+
* equal the rest of the time. Anything describing what the chain is doing now wants `activeEra`
|
|
62
113
|
*/
|
|
63
114
|
eraInfo(): Promise<StakingEraInfo>;
|
|
64
115
|
/**
|
|
@@ -71,5 +122,155 @@ export declare class Staking {
|
|
|
71
122
|
* @note can be subscribed to, if connected to node using a web socket
|
|
72
123
|
*/
|
|
73
124
|
eraInfo(callback: SubCallback<StakingEraInfo>): Promise<UnsubCallback>;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieve the chain constants that govern staking
|
|
127
|
+
*
|
|
128
|
+
* @note these come from the chain's metadata, so this makes no query
|
|
129
|
+
*/
|
|
130
|
+
getConstants(): StakingConstants;
|
|
131
|
+
/**
|
|
132
|
+
* Retrieve how far through the staking cycle the chain is — which era and session are in force,
|
|
133
|
+
* and how far through each of them the chain has got
|
|
134
|
+
*
|
|
135
|
+
* @throws if there is no active era
|
|
136
|
+
*
|
|
137
|
+
* @note progress is counted in **slots**, which is how the chain measures a period, so
|
|
138
|
+
* `progress` is exact. The `remaining` and `end` projections come from `expectedBlockTime` and
|
|
139
|
+
* move as block production drifts
|
|
140
|
+
*/
|
|
141
|
+
eraProgress(): Promise<EraProgress>;
|
|
142
|
+
/**
|
|
143
|
+
* Retrieve how far through the staking cycle the chain is, and subscribe to its advance
|
|
144
|
+
*
|
|
145
|
+
* @param callback - called on every block, since the slot the progress is counted in advances
|
|
146
|
+
* with each one. This is what drives a progress bar without polling
|
|
147
|
+
*
|
|
148
|
+
* @returns Promise that resolves to an unsubscribe function
|
|
149
|
+
*
|
|
150
|
+
* @note can be subscribed to, if connected to node using a web socket
|
|
151
|
+
*/
|
|
152
|
+
eraProgress(callback: SubCallback<EraProgress>): Promise<UnsubCallback>;
|
|
153
|
+
/**
|
|
154
|
+
* Retrieve the reward points earned by each validator in an era
|
|
155
|
+
*
|
|
156
|
+
* @param era - defaults to the active era
|
|
157
|
+
*
|
|
158
|
+
* @note points are how the era's reward is split between validators. A validator that authored no
|
|
159
|
+
* blocks in the era is absent rather than present with zero
|
|
160
|
+
*/
|
|
161
|
+
getEraRewardPoints(era?: BigNumber): Promise<EraRewardPoints>;
|
|
162
|
+
/**
|
|
163
|
+
* Retrieve the reward points earned by each validator in an era, and subscribe to them
|
|
164
|
+
*
|
|
165
|
+
* @param callback - called as points are credited. Points accrue block by block as validators
|
|
166
|
+
* author, so for the active era this is a live leaderboard
|
|
167
|
+
*
|
|
168
|
+
* @returns Promise that resolves to an unsubscribe function
|
|
169
|
+
*
|
|
170
|
+
* @note only the active era changes. Subscribing to a past era is allowed and simply calls back
|
|
171
|
+
* once, since the chain has finished writing it
|
|
172
|
+
* @note can be subscribed to, if connected to node using a web socket
|
|
173
|
+
*/
|
|
174
|
+
getEraRewardPoints(callback: SubCallback<EraRewardPoints>): Promise<UnsubCallback>;
|
|
175
|
+
/**
|
|
176
|
+
* Retrieve the reward points earned by each validator in a specific era, and subscribe to them
|
|
177
|
+
*
|
|
178
|
+
* @returns Promise that resolves to an unsubscribe function
|
|
179
|
+
*
|
|
180
|
+
* @note can be subscribed to, if connected to node using a web socket
|
|
181
|
+
*/
|
|
182
|
+
getEraRewardPoints(era: BigNumber, callback: SubCallback<EraRewardPoints>): Promise<UnsubCallback>;
|
|
183
|
+
/**
|
|
184
|
+
* Retrieve the total POLYX paid out to validators and their nominators for an era
|
|
185
|
+
*
|
|
186
|
+
* @param era - defaults to the active era
|
|
187
|
+
*
|
|
188
|
+
* @returns `null` for an era the chain has not paid out, i.e. one still running or older than the
|
|
189
|
+
* history depth
|
|
190
|
+
*/
|
|
191
|
+
getEraValidatorReward(era?: BigNumber): Promise<BigNumber | null>;
|
|
192
|
+
/**
|
|
193
|
+
* Retrieve the session an era started at
|
|
194
|
+
*
|
|
195
|
+
* @param era - defaults to the active era
|
|
196
|
+
*
|
|
197
|
+
* @returns `null` for an era outside the chain's history depth
|
|
198
|
+
*/
|
|
199
|
+
getEraStartSession(era?: BigNumber): Promise<BigNumber | null>;
|
|
200
|
+
/**
|
|
201
|
+
* Retrieve how much POLYX was backing a validator in an era, and how it was split
|
|
202
|
+
*
|
|
203
|
+
* @param args.validator - the validator's Account or address
|
|
204
|
+
* @param args.era - defaults to the active era
|
|
205
|
+
*
|
|
206
|
+
* @returns `null` if the Account was not in the era's validator set
|
|
207
|
+
*/
|
|
208
|
+
getEraExposure(args: {
|
|
209
|
+
validator: Account | string;
|
|
210
|
+
era?: BigNumber;
|
|
211
|
+
}): Promise<EraExposure | null>;
|
|
212
|
+
/**
|
|
213
|
+
* Retrieve one page of the nominators backing a validator in an era
|
|
214
|
+
*
|
|
215
|
+
* @param args.validator - the validator's Account or address
|
|
216
|
+
* @param args.page - defaults to the first page. Read `pageCount` from
|
|
217
|
+
* {@link api/client/Staking!Staking.getEraExposure | getEraExposure} for how many there are
|
|
218
|
+
* @param args.era - defaults to the active era
|
|
219
|
+
*
|
|
220
|
+
* @returns `null` if the page does not exist
|
|
221
|
+
*
|
|
222
|
+
* @note nominators are paged by the chain so that a payout fits in a block, which is why this is
|
|
223
|
+
* not returned as part of the exposure
|
|
224
|
+
*/
|
|
225
|
+
getEraNominators(args: {
|
|
226
|
+
validator: Account | string;
|
|
227
|
+
page?: BigNumber;
|
|
228
|
+
era?: BigNumber;
|
|
229
|
+
}): Promise<EraNominators | null>;
|
|
230
|
+
/**
|
|
231
|
+
* Retrieve when the next validator election opens and closes
|
|
232
|
+
*
|
|
233
|
+
* @throws if there is no active era
|
|
234
|
+
*
|
|
235
|
+
* @note this is the figure that says whether a nomination made now takes effect this era or the
|
|
236
|
+
* next. It is not the era's own countdown: the election closes a session before the era ends,
|
|
237
|
+
* so it can be minutes away while the era still has hours left
|
|
238
|
+
*/
|
|
239
|
+
getElectionSchedule(): Promise<ElectionSchedule>;
|
|
240
|
+
/**
|
|
241
|
+
* Retrieve when the next validator election opens and closes, and subscribe to it
|
|
242
|
+
*
|
|
243
|
+
* @param callback - called on every block, since the projections advance with each one
|
|
244
|
+
*
|
|
245
|
+
* @returns Promise that resolves to an unsubscribe function
|
|
246
|
+
*
|
|
247
|
+
* @note can be subscribed to, if connected to node using a web socket
|
|
248
|
+
*/
|
|
249
|
+
getElectionSchedule(callback: SubCallback<ElectionSchedule>): Promise<UnsubCallback>;
|
|
250
|
+
/**
|
|
251
|
+
* Retrieve the current phase of the validator election
|
|
252
|
+
*
|
|
253
|
+
* @note staking transactions behave differently while an election is open, so a UI should say
|
|
254
|
+
* when the phase is anything other than `Off`
|
|
255
|
+
*/
|
|
256
|
+
getElectionPhase(): Promise<ElectionPhase>;
|
|
257
|
+
/**
|
|
258
|
+
* Retrieve the current phase of the validator election, and subscribe to it
|
|
259
|
+
*
|
|
260
|
+
* @param callback - called whenever the phase changes, which happens several times an era
|
|
261
|
+
*
|
|
262
|
+
* @returns Promise that resolves to an unsubscribe function
|
|
263
|
+
*
|
|
264
|
+
* @note this is the read that most benefits from a subscription — a warning that only appears on
|
|
265
|
+
* the next poll appears after the user has already acted
|
|
266
|
+
* @note can be subscribed to, if connected to node using a web socket
|
|
267
|
+
*/
|
|
268
|
+
getElectionPhase(callback: SubCallback<ElectionPhase>): Promise<UnsubCallback>;
|
|
269
|
+
/**
|
|
270
|
+
* @hidden
|
|
271
|
+
*
|
|
272
|
+
* Resolve an optional era argument to the era to query, defaulting to the active one
|
|
273
|
+
*/
|
|
274
|
+
private asRawEra;
|
|
74
275
|
}
|
|
75
276
|
//# sourceMappingURL=Staking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Staking.d.ts","sourceRoot":"","sources":["../../../src/api/client/Staking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Staking.d.ts","sourceRoot":"","sources":["../../../src/api/client/Staking.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EACL,OAAO,EAGP,OAAO,EAOR,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,WAAW,EACX,eAAe,EAEf,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EAEjB,eAAe,EACf,SAAS,EACT,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,aAAa,EACb,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAyK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