@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/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ApiOptions } from '@polkadot/api/types';
|
|
2
2
|
import { ISubmittableResult } from '@polkadot/types/types';
|
|
3
3
|
import BigNumber from 'bignumber.js';
|
|
4
|
-
import {
|
|
4
|
+
import { InstructionsOrderBy } from '../../middleware/types';
|
|
5
|
+
import { Account, Asset, Identity, InstructionStatusEnum, TxTag } from '../../types';
|
|
5
6
|
export { InstructionStatusEnum };
|
|
6
7
|
export interface ExtrinsicData {
|
|
7
8
|
blockHash: string;
|
|
@@ -66,6 +67,12 @@ export declare enum ErrorCode {
|
|
|
66
67
|
* Please report it to the Polymesh team
|
|
67
68
|
*/
|
|
68
69
|
TransactionReverted = "TransactionReverted",
|
|
70
|
+
/**
|
|
71
|
+
* the SDK stopped waiting for the transaction before it reached a conclusion. This is **not**
|
|
72
|
+
* a failure: the transaction may well have been broadcast, and may still be included in a
|
|
73
|
+
* block. Nothing about it was cancelled — only the waiting stopped
|
|
74
|
+
*/
|
|
75
|
+
TransactionTimeout = "TransactionTimeout",
|
|
69
76
|
/**
|
|
70
77
|
* error that should cause termination of the calling application
|
|
71
78
|
*/
|
|
@@ -130,7 +137,11 @@ export declare enum ErrorCode {
|
|
|
130
137
|
}
|
|
131
138
|
export interface MiddlewareConfig {
|
|
132
139
|
link: string;
|
|
133
|
-
|
|
140
|
+
/**
|
|
141
|
+
* API key for the middleware, sent as the `x-api-key` header. Optional: an indexer that
|
|
142
|
+
* requires no authentication needs none, and the header is omitted rather than sent empty
|
|
143
|
+
*/
|
|
144
|
+
key?: string;
|
|
134
145
|
}
|
|
135
146
|
export interface PolkadotConfig {
|
|
136
147
|
/**
|
|
@@ -156,6 +167,17 @@ export interface PolkadotConfig {
|
|
|
156
167
|
* set to `true` to disable polkadot start up warnings
|
|
157
168
|
*/
|
|
158
169
|
noInitWarn?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* set to `false` to stop `ApiPromise` waiting on the WASM crypto backend before becoming ready
|
|
172
|
+
*
|
|
173
|
+
* @note runtimes that forbid WASM compilation (e.g. Cloudflare Workers) otherwise hang on
|
|
174
|
+
* connect, since `cryptoWaitReady()` resolves to `false` instead of rejecting
|
|
175
|
+
*
|
|
176
|
+
* @note this also leaves the backend uninitialized, since `cryptoWaitReady()` is what
|
|
177
|
+
* initializes it. Read only usage is unaffected, but `sr25519` has no JS fallback, so a
|
|
178
|
+
* signing manager using it must call `cryptoWaitReady()` itself (`LocalSigningManager` does)
|
|
179
|
+
*/
|
|
180
|
+
initWasm?: boolean;
|
|
159
181
|
/**
|
|
160
182
|
* allows for types to be provided for multiple chain specs at once
|
|
161
183
|
*
|
|
@@ -242,21 +264,38 @@ export interface HistoricalInstructionFilters {
|
|
|
242
264
|
* The number of results to skip
|
|
243
265
|
*/
|
|
244
266
|
start?: BigNumber;
|
|
267
|
+
/**
|
|
268
|
+
* The ordering of the results. Defaults to oldest first
|
|
269
|
+
*/
|
|
270
|
+
orderBy?: InstructionsOrderBy | InstructionsOrderBy[];
|
|
245
271
|
}
|
|
246
272
|
/**
|
|
247
273
|
* A conglomeration of staking storage related to the active era
|
|
248
274
|
*/
|
|
249
275
|
export interface StakingEraInfo {
|
|
250
276
|
/**
|
|
251
|
-
* The
|
|
277
|
+
* The era whose validator set is in force, and whose rewards and slashes are being processed
|
|
278
|
+
*
|
|
279
|
+
* @note this is the era to use for anything describing what the chain is doing *now*. It lags
|
|
280
|
+
* {@link StakingEraInfo.currentEra | currentEra} between an election and the session rotation
|
|
281
|
+
* that brings the newly elected set into force
|
|
252
282
|
*/
|
|
253
283
|
activeEra: BigNumber;
|
|
254
284
|
/**
|
|
255
|
-
* The
|
|
285
|
+
* The moment the active era began, as milliseconds since the Unix epoch
|
|
286
|
+
*
|
|
287
|
+
* @note this is `0` where the chain holds no start for the active era. The chain creates the
|
|
288
|
+
* active era at session rotation and records its start on the following block, so the gap is
|
|
289
|
+
* brief — but it recurs at every era change, not only before the first era
|
|
256
290
|
*/
|
|
257
291
|
activeEraStart: BigNumber;
|
|
258
292
|
/**
|
|
259
|
-
* The
|
|
293
|
+
* The latest era the chain has *planned*
|
|
294
|
+
*
|
|
295
|
+
* @note a validator set has been elected for this era, but the Session pallet may not have
|
|
296
|
+
* brought it into force yet, so this runs ahead of
|
|
297
|
+
* {@link StakingEraInfo.activeEra | activeEra} between the election and the rotation. The two
|
|
298
|
+
* are equal the rest of the time, and `currentEra` is never behind
|
|
260
299
|
*/
|
|
261
300
|
currentEra: BigNumber;
|
|
262
301
|
/**
|
|
@@ -268,4 +307,241 @@ export interface StakingEraInfo {
|
|
|
268
307
|
*/
|
|
269
308
|
totalStaked: BigNumber;
|
|
270
309
|
}
|
|
310
|
+
export interface StakingConstants {
|
|
311
|
+
/**
|
|
312
|
+
* The number of sessions in an era
|
|
313
|
+
*/
|
|
314
|
+
sessionsPerEra: BigNumber;
|
|
315
|
+
/**
|
|
316
|
+
* The number of slots in a session
|
|
317
|
+
*/
|
|
318
|
+
slotsPerSession: BigNumber;
|
|
319
|
+
/**
|
|
320
|
+
* The average time the chain is expected to take to produce a block, in milliseconds
|
|
321
|
+
*/
|
|
322
|
+
expectedBlockTime: BigNumber;
|
|
323
|
+
/**
|
|
324
|
+
* How long an era is expected to last, in milliseconds
|
|
325
|
+
*
|
|
326
|
+
* @note this is `expectedBlockTime * slotsPerSession * sessionsPerEra`. It is what an era is
|
|
327
|
+
* expected to take, not what any particular era took — the chain pays rewards against the
|
|
328
|
+
* duration an era actually ran for
|
|
329
|
+
*/
|
|
330
|
+
eraDuration: BigNumber;
|
|
331
|
+
/**
|
|
332
|
+
* How many eras are expected in a year
|
|
333
|
+
*
|
|
334
|
+
* @note the year here is the Julian year of 365.25 days, which is what the chain's reward
|
|
335
|
+
* calculation uses
|
|
336
|
+
*/
|
|
337
|
+
erasPerYear: BigNumber;
|
|
338
|
+
/**
|
|
339
|
+
* The number of eras that must pass before unbonded POLYX can be withdrawn
|
|
340
|
+
*/
|
|
341
|
+
bondingDuration: BigNumber;
|
|
342
|
+
/**
|
|
343
|
+
* How many past eras the chain keeps data for
|
|
344
|
+
*
|
|
345
|
+
* @note the per-era reads return `null` for anything older than this many eras before the active
|
|
346
|
+
* one, because the chain has pruned it
|
|
347
|
+
*/
|
|
348
|
+
historyDepth: BigNumber;
|
|
349
|
+
/**
|
|
350
|
+
* The amount of POLYX issued per year once total issuance reaches
|
|
351
|
+
* {@link StakingConstants.maxVariableInflationTotalIssuance}
|
|
352
|
+
*/
|
|
353
|
+
fixedYearlyReward: BigNumber;
|
|
354
|
+
/**
|
|
355
|
+
* The total issuance at which rewards stop following the inflation curve and become
|
|
356
|
+
* {@link StakingConstants.fixedYearlyReward}
|
|
357
|
+
*/
|
|
358
|
+
maxVariableInflationTotalIssuance: BigNumber;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* The phase of the validator election
|
|
362
|
+
*/
|
|
363
|
+
export declare enum ElectionPhase {
|
|
364
|
+
/**
|
|
365
|
+
* No election is in progress
|
|
366
|
+
*/
|
|
367
|
+
Off = "Off",
|
|
368
|
+
/**
|
|
369
|
+
* Signed solutions are being accepted
|
|
370
|
+
*/
|
|
371
|
+
Signed = "Signed",
|
|
372
|
+
/**
|
|
373
|
+
* Unsigned solutions are being accepted
|
|
374
|
+
*/
|
|
375
|
+
Unsigned = "Unsigned",
|
|
376
|
+
/**
|
|
377
|
+
* The election failed and is being resolved by governance
|
|
378
|
+
*/
|
|
379
|
+
Emergency = "Emergency"
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* When the next validator election opens and closes
|
|
383
|
+
*
|
|
384
|
+
* @note the election closes at the session rotation one session before the era ends, not at the
|
|
385
|
+
* era boundary, so it can be far closer than the era's own countdown suggests. The blocks are
|
|
386
|
+
* **projections** — the chain schedules the election in slots, and a slot that produces no block
|
|
387
|
+
* moves the block it lands on
|
|
388
|
+
*/
|
|
389
|
+
export interface ElectionSchedule {
|
|
390
|
+
/**
|
|
391
|
+
* The block the election is expected to open on
|
|
392
|
+
*
|
|
393
|
+
* @note in the past once the election is open
|
|
394
|
+
*/
|
|
395
|
+
opensAt: BigNumber;
|
|
396
|
+
/**
|
|
397
|
+
* The block the election is expected to close on, which is when the next era's validator set is
|
|
398
|
+
* decided
|
|
399
|
+
*/
|
|
400
|
+
closesAt: BigNumber;
|
|
401
|
+
/**
|
|
402
|
+
* Projected milliseconds until the election opens
|
|
403
|
+
*
|
|
404
|
+
* @note `0` once it has opened
|
|
405
|
+
*/
|
|
406
|
+
opensIn: BigNumber;
|
|
407
|
+
/**
|
|
408
|
+
* Projected milliseconds until the election closes
|
|
409
|
+
*/
|
|
410
|
+
closesIn: BigNumber;
|
|
411
|
+
}
|
|
412
|
+
export interface EraRewardPoints {
|
|
413
|
+
/**
|
|
414
|
+
* The total points awarded across all validators in the era
|
|
415
|
+
*/
|
|
416
|
+
total: BigNumber;
|
|
417
|
+
/**
|
|
418
|
+
* The points awarded to each validator that authored at least one block in the era
|
|
419
|
+
*/
|
|
420
|
+
individual: {
|
|
421
|
+
account: Account;
|
|
422
|
+
points: BigNumber;
|
|
423
|
+
}[];
|
|
424
|
+
}
|
|
425
|
+
export interface EraExposure {
|
|
426
|
+
/**
|
|
427
|
+
* The total POLYX backing the validator, its own stake included
|
|
428
|
+
*/
|
|
429
|
+
total: BigNumber;
|
|
430
|
+
/**
|
|
431
|
+
* The POLYX the validator bonded itself
|
|
432
|
+
*/
|
|
433
|
+
own: BigNumber;
|
|
434
|
+
/**
|
|
435
|
+
* How many Accounts nominated the validator in this era
|
|
436
|
+
*/
|
|
437
|
+
nominatorCount: BigNumber;
|
|
438
|
+
/**
|
|
439
|
+
* How many pages the nominators are split across
|
|
440
|
+
*
|
|
441
|
+
* @note nominators are paged so a payout fits in a block. Use
|
|
442
|
+
* {@link api/client/Staking!Staking.getEraNominators | getEraNominators} to read one page
|
|
443
|
+
*/
|
|
444
|
+
pageCount: BigNumber;
|
|
445
|
+
}
|
|
446
|
+
export interface EraNominators {
|
|
447
|
+
/**
|
|
448
|
+
* The total POLYX nominated on this page
|
|
449
|
+
*/
|
|
450
|
+
pageTotal: BigNumber;
|
|
451
|
+
/**
|
|
452
|
+
* The nominators on this page and what each of them staked
|
|
453
|
+
*/
|
|
454
|
+
nominators: {
|
|
455
|
+
account: Account;
|
|
456
|
+
value: BigNumber;
|
|
457
|
+
}[];
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* How far through a period the chain is
|
|
461
|
+
*
|
|
462
|
+
* @note `elapsed`, `total` and `progress` are **exact** — they are counted in slots, which is how
|
|
463
|
+
* the chain itself measures a period. `remaining` and `end` are **projections** from
|
|
464
|
+
* {@link StakingConstants.expectedBlockTime}, so they move as block production drifts. Render a
|
|
465
|
+
* bar from `progress` and a countdown from `remaining`
|
|
466
|
+
*/
|
|
467
|
+
export interface PeriodProgress {
|
|
468
|
+
/**
|
|
469
|
+
* Slots elapsed so far
|
|
470
|
+
*/
|
|
471
|
+
elapsed: BigNumber;
|
|
472
|
+
/**
|
|
473
|
+
* Slots in the whole period
|
|
474
|
+
*/
|
|
475
|
+
total: BigNumber;
|
|
476
|
+
/**
|
|
477
|
+
* How far through the period the chain is, from 0 to 1
|
|
478
|
+
*
|
|
479
|
+
* @note clamped to 1. A period that has run past its expected length has not ended — the chain
|
|
480
|
+
* rolls it over when it rolls over
|
|
481
|
+
*/
|
|
482
|
+
progress: BigNumber;
|
|
483
|
+
/**
|
|
484
|
+
* Projected milliseconds until the period ends
|
|
485
|
+
*
|
|
486
|
+
* @note `0` once the period has run past its expected length
|
|
487
|
+
*/
|
|
488
|
+
remaining: BigNumber;
|
|
489
|
+
/**
|
|
490
|
+
* Projected moment the period ends
|
|
491
|
+
*/
|
|
492
|
+
end: Date;
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* A live view of where the chain is in the staking cycle
|
|
496
|
+
*
|
|
497
|
+
* @note an era is divided into sessions (BABE calls them epochs), and both advance every block.
|
|
498
|
+
* Subscribe with {@link api/client/Staking!Staking.eraProgress | eraProgress} to drive a progress
|
|
499
|
+
* bar without polling
|
|
500
|
+
*/
|
|
501
|
+
export interface EraProgress {
|
|
502
|
+
era: {
|
|
503
|
+
/**
|
|
504
|
+
* The active era — the one whose validator set is in force and whose rewards are being
|
|
505
|
+
* processed
|
|
506
|
+
*/
|
|
507
|
+
index: BigNumber;
|
|
508
|
+
/**
|
|
509
|
+
* The latest era the chain has *planned*
|
|
510
|
+
*
|
|
511
|
+
* @note runs ahead of `index` between an election and the session rotation that brings the
|
|
512
|
+
* newly elected set into force, and equals it the rest of the time
|
|
513
|
+
*/
|
|
514
|
+
planned: BigNumber;
|
|
515
|
+
/**
|
|
516
|
+
* When the active era began
|
|
517
|
+
*
|
|
518
|
+
* @note `null` in the brief window between the chain creating the era at session rotation and
|
|
519
|
+
* recording its start on the following block. Progress is unaffected — it is counted in
|
|
520
|
+
* slots, which are always available
|
|
521
|
+
*/
|
|
522
|
+
start: Date | null;
|
|
523
|
+
/**
|
|
524
|
+
* How far through the active era the chain is
|
|
525
|
+
*/
|
|
526
|
+
progress: PeriodProgress;
|
|
527
|
+
};
|
|
528
|
+
session: {
|
|
529
|
+
/**
|
|
530
|
+
* The absolute session index, counting from genesis
|
|
531
|
+
*/
|
|
532
|
+
index: BigNumber;
|
|
533
|
+
/**
|
|
534
|
+
* Which session of the active era this is, counting from 1
|
|
535
|
+
*/
|
|
536
|
+
inEra: BigNumber;
|
|
537
|
+
/**
|
|
538
|
+
* How many sessions there are in an era
|
|
539
|
+
*/
|
|
540
|
+
perEra: BigNumber;
|
|
541
|
+
/**
|
|
542
|
+
* How far through the current session the chain is
|
|
543
|
+
*/
|
|
544
|
+
progress: PeriodProgress;
|
|
545
|
+
};
|
|
546
|
+
}
|
|
271
547
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,SAAS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W,aAAa;IAC5B;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,KAAK,EAAE,SAAS,CAAC;KAClB,EAAE,CAAC;CACL;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;OAIG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,GAAG,EAAE,IAAI,CAAC;CACX;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE;QACH;;;WAGG;QACH,KAAK,EAAE,SAAS,CAAC;QAEjB;;;;;WAKG;QACH,OAAO,EAAE,SAAS,CAAC;QAEnB;;;;;;WAMG;QACH,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;QAEnB;;WAEG;QACH,QAAQ,EAAE,cAAc,CAAC;KAC1B,CAAC;IAEF,OAAO,EAAE;QACP;;WAEG;QACH,KAAK,EAAE,SAAS,CAAC;QAEjB;;WAEG;QACH,KAAK,EAAE,SAAS,CAAC;QAEjB;;WAEG;QACH,MAAM,EAAE,SAAS,CAAC;QAElB;;WAEG;QACH,QAAQ,EAAE,cAAc,CAAC;KAC1B,CAAC;CACH"}
|
package/api/client/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorCode = exports.InstructionStatusEnum = void 0;
|
|
3
|
+
exports.ElectionPhase = exports.ErrorCode = exports.InstructionStatusEnum = void 0;
|
|
4
4
|
const types_1 = require("../../types");
|
|
5
5
|
Object.defineProperty(exports, "InstructionStatusEnum", { enumerable: true, get: function () { return types_1.InstructionStatusEnum; } });
|
|
6
6
|
/**
|
|
@@ -22,6 +22,12 @@ var ErrorCode;
|
|
|
22
22
|
* Please report it to the Polymesh team
|
|
23
23
|
*/
|
|
24
24
|
ErrorCode["TransactionReverted"] = "TransactionReverted";
|
|
25
|
+
/**
|
|
26
|
+
* the SDK stopped waiting for the transaction before it reached a conclusion. This is **not**
|
|
27
|
+
* a failure: the transaction may well have been broadcast, and may still be included in a
|
|
28
|
+
* block. Nothing about it was cancelled — only the waiting stopped
|
|
29
|
+
*/
|
|
30
|
+
ErrorCode["TransactionTimeout"] = "TransactionTimeout";
|
|
25
31
|
/**
|
|
26
32
|
* error that should cause termination of the calling application
|
|
27
33
|
*/
|
|
@@ -84,4 +90,26 @@ var ErrorCode;
|
|
|
84
90
|
*/
|
|
85
91
|
ErrorCode["NotSupported"] = "NotSupported";
|
|
86
92
|
})(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
|
|
93
|
+
/**
|
|
94
|
+
* The phase of the validator election
|
|
95
|
+
*/
|
|
96
|
+
var ElectionPhase;
|
|
97
|
+
(function (ElectionPhase) {
|
|
98
|
+
/**
|
|
99
|
+
* No election is in progress
|
|
100
|
+
*/
|
|
101
|
+
ElectionPhase["Off"] = "Off";
|
|
102
|
+
/**
|
|
103
|
+
* Signed solutions are being accepted
|
|
104
|
+
*/
|
|
105
|
+
ElectionPhase["Signed"] = "Signed";
|
|
106
|
+
/**
|
|
107
|
+
* Unsigned solutions are being accepted
|
|
108
|
+
*/
|
|
109
|
+
ElectionPhase["Unsigned"] = "Unsigned";
|
|
110
|
+
/**
|
|
111
|
+
* The election failed and is being resolved by governance
|
|
112
|
+
*/
|
|
113
|
+
ElectionPhase["Emergency"] = "Emergency";
|
|
114
|
+
})(ElectionPhase || (exports.ElectionPhase = ElectionPhase = {}));
|
|
87
115
|
//# sourceMappingURL=types.js.map
|
package/api/client/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/client/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/client/types.ts"],"names":[],"mappings":";;;AAKA,mCAAiF;AAExE,sGAF0B,6BAAqB,OAE1B;AAoD9B;;GAEG;AACH,IAAY,SAkFX;AAlFD,WAAY,SAAS;IACnB;;OAEG;IACH,sDAAyC,CAAA;IACzC;;OAEG;IACH,oEAAuD,CAAA;IACvD;;;;OAIG;IACH,wDAA2C,CAAA;IAC3C;;;;OAIG;IACH,sDAAyC,CAAA;IACzC;;OAEG;IACH,sCAAyB,CAAA;IACzB;;;OAGG;IACH,gDAAmC,CAAA;IACnC;;OAEG;IACH,4CAA+B,CAAA;IAC/B;;OAEG;IACH,gDAAmC,CAAA;IACnC;;;OAGG;IACH,gDAAmC,CAAA;IACnC;;;OAGG;IACH,0CAA6B,CAAA;IAC7B;;;OAGG;IACH,4CAA+B,CAAA;IAC/B;;;;;OAKG;IACH,oDAAuC,CAAA;IACvC;;;OAGG;IACH,wCAA2B,CAAA;IAC3B;;OAEG;IACH,wDAA2C,CAAA;IAC3C;;;OAGG;IACH,gDAAmC,CAAA;IACnC;;OAEG;IACH,gCAAmB,CAAA;IACnB;;OAEG;IACH,0CAA6B,CAAA;AAC/B,CAAC,EAlFW,SAAS,yBAAT,SAAS,QAkFpB;AAmPD;;GAEG;AACH,IAAY,aAiBX;AAjBD,WAAY,aAAa;IACvB;;OAEG;IACH,4BAAW,CAAA;IACX;;OAEG;IACH,kCAAiB,CAAA;IACjB;;OAEG;IACH,sCAAqB,CAAA;IACrB;;OAEG;IACH,wCAAuB,CAAA;AACzB,CAAC,EAjBW,aAAa,6BAAb,aAAa,QAiBxB"}
|
|
@@ -2,6 +2,7 @@ import BigNumber from 'bignumber.js';
|
|
|
2
2
|
import { UniqueIdentifiers } from '../../../../api/entities/Account';
|
|
3
3
|
import { MultiSigProposal } from '../../../../api/entities/MultiSigProposal';
|
|
4
4
|
import { Account, Context, Identity } from '../../../../internal';
|
|
5
|
+
import { MultiSigProposalsOrderBy } from '../../../../middleware/types';
|
|
5
6
|
import { HistoricalMultiSigProposal, ModifyMultiSigParams, MultiSigDetails, NoArgsProcedureMethod, ProcedureMethod, ResultSet, SetMultiSigAdminParams } from '../../../../types';
|
|
6
7
|
/**
|
|
7
8
|
* Represents a MultiSig Account. A MultiSig Account is composed of one or more signing Accounts. In order to submit a transaction, a specific amount of those signing Accounts must approve it first
|
|
@@ -29,12 +30,17 @@ export declare class MultiSig extends Account {
|
|
|
29
30
|
getProposals(): Promise<MultiSigProposal[]>;
|
|
30
31
|
/**
|
|
31
32
|
* Return a set of {@link MultiSigProposal} for this MultiSig Account
|
|
33
|
+
* @param opts.orderBy - how to order the results: one key, or several to decide the rows a
|
|
34
|
+
* single key leaves tied. The read's own unique key is appended to whatever is passed, so
|
|
35
|
+
* that paging cannot repeat or skip a row
|
|
36
|
+
*
|
|
32
37
|
*
|
|
33
38
|
* @note uses the middlewareV2
|
|
34
39
|
*/
|
|
35
40
|
getHistoricalProposals(opts?: {
|
|
36
41
|
size?: BigNumber;
|
|
37
42
|
start?: BigNumber;
|
|
43
|
+
orderBy?: MultiSigProposalsOrderBy | MultiSigProposalsOrderBy[];
|
|
38
44
|
}): Promise<ResultSet<HistoricalMultiSigProposal>>;
|
|
39
45
|
/**
|
|
40
46
|
* Returns the Identity of the MultiSig admin. This Identity can add or remove signers directly without creating a MultiSigProposal first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Account/MultiSig/index.ts"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EAIT,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"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M,EAAE,eAAe,CAC5B,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,oBAAoB,CAAC,EAC5D,IAAI,CACL,CAAC;IAEF;;;OAGG;IACI,QAAQ,EAAE,eAAe,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAE/D;;;;;OAKG;IACI,WAAW,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC;CACjD"}
|
|
@@ -117,14 +117,18 @@ class MultiSig extends internal_1.Account {
|
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
* Return a set of {@link MultiSigProposal} for this MultiSig Account
|
|
120
|
+
* @param opts.orderBy - how to order the results: one key, or several to decide the rows a
|
|
121
|
+
* single key leaves tied. The read's own unique key is appended to whatever is passed, so
|
|
122
|
+
* that paging cannot repeat or skip a row
|
|
123
|
+
*
|
|
120
124
|
*
|
|
121
125
|
* @note uses the middlewareV2
|
|
122
126
|
*/
|
|
123
127
|
getHistoricalProposals(opts) {
|
|
124
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
129
|
const { context, address } = this;
|
|
126
|
-
const { size, start } = opts !== null && opts !== void 0 ? opts : {};
|
|
127
|
-
const { data: { multiSigProposals: { nodes, totalCount }, }, } = yield context.queryMiddleware((0, multisigs_1.multiSigProposalsQuery)(address, size, start));
|
|
130
|
+
const { size, start, orderBy } = opts !== null && opts !== void 0 ? opts : {};
|
|
131
|
+
const { data: { multiSigProposals: { nodes, totalCount }, }, } = yield context.queryMiddleware((0, multisigs_1.multiSigProposalsQuery)({ multisigId: address }, size, start, orderBy));
|
|
128
132
|
const getTxTagAndArgs = (proposal) => ({
|
|
129
133
|
txTag: (0, conversion_1.extrinsicIdentifierToTxTag)({
|
|
130
134
|
moduleId: proposal.module.toLowerCase(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/entities/Account/MultiSig/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,gEAAqC;AAGrC,sEAAmE;AACnE,wEAAqE;AACrE,yCAOoB;AACpB,8DAAwE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/entities/Account/MultiSig/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,gEAAqC;AAGrC,sEAAmE;AACnE,wEAAqE;AACrE,yCAOoB;AACpB,8DAAwE;AASxE,mCAaiB;AAEjB,mDAS4B;AAC5B,+CAA2E;AAE3E;;GAEG;AACH,MAAa,QAAS,SAAQ,kBAAO;IACnC;;OAEG;IACH,YAAmB,WAA8B,EAAE,OAAgB;QACjE,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAE5B,IAAI,CAAC,MAAM,GAAG,IAAA,gCAAqB,EACjC;YACE,mBAAmB,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,yBAAc,kBAAI,QAAQ,EAAE,IAAI,IAAK,UAAU,EAAG;SACvF,EACD,OAAO,CACR,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,IAAA,gCAAqB,EACnC,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,mCAAgB,kBAAI,QAAQ,EAAE,IAAI,IAAK,SAAS,EAAG,EAAE,EAC1F,OAAO,CACR,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,IAAA,gCAAqB,EACtC;YACE,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,8BAAmB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YACpE,QAAQ,EAAE,IAAI;SACf,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;OAEG;IACU,OAAO;;YAClB,MAAM,EACJ,OAAO,EAAE,EACP,WAAW,EAAE,EACX,KAAK,EAAE,EAAE,QAAQ,EAAE,GACpB,GACF,EACD,OAAO,EACP,OAAO,GACR,GAAG,IAAI,CAAC;YAET,MAAM,UAAU,GAAG,IAAA,8BAAiB,EAAC,OAAO,EAAE,OAAO,CAA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3 +1,4 @@
|
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
|
1
2
|
import { Account, Namespace } from '../../../../internal';
|
|
2
3
|
import { StakingCommission, StakingLedger, StakingNomination, StakingPayee, SubCallback, UnsubCallback } from '../../../../types';
|
|
3
4
|
/**
|
|
@@ -60,8 +61,31 @@ export declare class Staking extends Namespace<Account> {
|
|
|
60
61
|
/**
|
|
61
62
|
* Fetch the commission settings for this validator account
|
|
62
63
|
*
|
|
63
|
-
* @
|
|
64
|
+
* @param args.era - read the commission the Account was elected for in a past era, rather than
|
|
65
|
+
* the one it is currently advertising. Defaults to the current settings
|
|
66
|
+
*
|
|
67
|
+
* @returns The commission details, or `null` if the Account is not seeking nominations as a
|
|
68
|
+
* validator — or, when an `era` is given, was not in that era's validator set
|
|
69
|
+
*
|
|
70
|
+
* @note the two are different questions. Without an `era` this reads what the Account is
|
|
71
|
+
* advertising *now*, which it can change at any time. With one it reads what it was actually
|
|
72
|
+
* elected on, which is fixed for that era and is what its rewards were calculated against
|
|
73
|
+
*/
|
|
74
|
+
getCommission(args?: {
|
|
75
|
+
era?: BigNumber;
|
|
76
|
+
}): Promise<StakingCommission | null>;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch how many validators this Account may nominate
|
|
79
|
+
*
|
|
80
|
+
* @param args.bonded - the total POLYX that will be bonded, for bonding and nominating in one
|
|
81
|
+
* batch. Defaults to what the Account has bonded now, or to the chain's minimum nominator bond
|
|
82
|
+
* where it has none
|
|
83
|
+
*
|
|
84
|
+
* @note the chain derives the cap from the amount bonded, so it is read rather than assumed. On
|
|
85
|
+
* Polymesh v8 it is always 16 whatever the bond, but that is a runtime setting and can change
|
|
64
86
|
*/
|
|
65
|
-
|
|
87
|
+
getNominationQuota(args?: {
|
|
88
|
+
bonded?: BigNumber;
|
|
89
|
+
}): Promise<BigNumber>;
|
|
66
90
|
}
|
|
67
91
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Account/Staking/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/entities/Account/Staking/index.ts"],"names":[],"mappings":"AAGA,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AAcjB;;GAEG;AACH,qBAAa,OAAQ,SAAQ,SAAS,CAAC,OAAO,CAAC;IAC7C;;;;OAIG;IACU,SAAS,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAmBvD;;;;OAIG;IACU,QAAQ,IAAI,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAErD;;;;;;;OAOG;IACU,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IAsDzF;;;;OAIG;IACU,aAAa,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAE/D;;;;;;;OAOG;IACU,aAAa,CACxB,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,GAC9C,OAAO,CAAC,aAAa,CAAC;IA0CzB;;;;;OAKG;IACU,aAAa,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAErD;;;;;;;;OAQG;IACU,aAAa,CAAC,QAAQ,EAAE,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;IA2CzF;;;;;;;;;;;;OAYG;IACU,aAAa,CAAC,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IA6BzF;;;;;;;;;OASG;IACU,kBAAkB,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,CAAC;CAoBnF"}
|
|
@@ -117,13 +117,24 @@ class Staking extends internal_1.Namespace {
|
|
|
117
117
|
/**
|
|
118
118
|
* Fetch the commission settings for this validator account
|
|
119
119
|
*
|
|
120
|
-
* @
|
|
120
|
+
* @param args.era - read the commission the Account was elected for in a past era, rather than
|
|
121
|
+
* the one it is currently advertising. Defaults to the current settings
|
|
122
|
+
*
|
|
123
|
+
* @returns The commission details, or `null` if the Account is not seeking nominations as a
|
|
124
|
+
* validator — or, when an `era` is given, was not in that era's validator set
|
|
125
|
+
*
|
|
126
|
+
* @note the two are different questions. Without an `era` this reads what the Account is
|
|
127
|
+
* advertising *now*, which it can change at any time. With one it reads what it was actually
|
|
128
|
+
* elected on, which is fixed for that era and is what its rewards were calculated against
|
|
121
129
|
*/
|
|
122
|
-
getCommission() {
|
|
130
|
+
getCommission(args) {
|
|
123
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
132
|
const { context, context: { polymeshApi: { query }, }, parent: { address }, } = this;
|
|
125
133
|
const rawAddress = (0, conversion_1.stringToAccountId)(address, context);
|
|
126
|
-
const
|
|
134
|
+
const era = args === null || args === void 0 ? void 0 : args.era;
|
|
135
|
+
const rawValidator = era
|
|
136
|
+
? yield query.staking.erasValidatorPrefs((0, conversion_1.bigNumberToU32)(era, context), rawAddress)
|
|
137
|
+
: yield query.staking.validators(rawAddress);
|
|
127
138
|
if (rawValidator.isEmpty) {
|
|
128
139
|
return null;
|
|
129
140
|
}
|
|
@@ -131,6 +142,28 @@ class Staking extends internal_1.Namespace {
|
|
|
131
142
|
return Object.assign({ account: this.parent }, commission);
|
|
132
143
|
});
|
|
133
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Fetch how many validators this Account may nominate
|
|
147
|
+
*
|
|
148
|
+
* @param args.bonded - the total POLYX that will be bonded, for bonding and nominating in one
|
|
149
|
+
* batch. Defaults to what the Account has bonded now, or to the chain's minimum nominator bond
|
|
150
|
+
* where it has none
|
|
151
|
+
*
|
|
152
|
+
* @note the chain derives the cap from the amount bonded, so it is read rather than assumed. On
|
|
153
|
+
* Polymesh v8 it is always 16 whatever the bond, but that is a runtime setting and can change
|
|
154
|
+
*/
|
|
155
|
+
getNominationQuota(args) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
const { context, context: { polymeshApi: { call, query }, }, } = this;
|
|
158
|
+
let bonded = args === null || args === void 0 ? void 0 : args.bonded;
|
|
159
|
+
if (!bonded) {
|
|
160
|
+
const ledger = yield this.getLedger();
|
|
161
|
+
bonded = ledger ? ledger.active : (0, conversion_1.balanceToBigNumber)(yield query.staking.minNominatorBond());
|
|
162
|
+
}
|
|
163
|
+
const rawQuota = yield call.stakingApi.nominationsQuota((0, conversion_1.bigNumberToBalance)(bonded, context));
|
|
164
|
+
return (0, conversion_1.u32ToBigNumber)(rawQuota);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
134
167
|
}
|
|
135
168
|
exports.Staking = Staking;
|
|
136
169
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/entities/Account/Staking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/entities/Account/Staking/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,yCAAgD;AAShD,mDAW4B;AAE5B;;GAEG;AACH,MAAa,OAAQ,SAAQ,oBAAkB;IAC7C;;;;OAIG;IACU,SAAS;;YACpB,MAAM,EACJ,OAAO,EACP,OAAO,EAAE,EACP,WAAW,EAAE,EAAE,KAAK,EAAE,GACvB,GACF,GAAG,IAAI,CAAC;YAET,MAAM,UAAU,GAAG,IAAA,8BAAiB,EAAC,IAAI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