Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f8e4ce133 | ||
|
|
39c99083bc | ||
|
|
46aa427f98 | ||
|
|
6336fc0787 | ||
|
|
b0532be7df | ||
|
|
e7a5b015e9 | ||
|
|
2f07f18a5a | ||
|
|
c92d5b7eb0 | ||
|
|
e340a99eda | ||
|
|
f169ca08a8 | ||
|
|
898d1593f3 | ||
|
|
2c8d9563c4 | ||
|
|
804c0c4887 | ||
|
|
3b991ce8c7 | ||
|
|
e66cc0fb45 | ||
|
|
61daa0f2c8 | ||
|
|
7af315f278 | ||
|
|
e55661ca34 | ||
|
|
097a1748fd | ||
|
|
9c587d378e | ||
|
|
02f99356aa | ||
|
|
cacacec130 | ||
|
|
6d095a042f | ||
|
|
b022ad3154 | ||
|
|
e0129aa02e | ||
|
|
dfc200a25a | ||
|
|
85fdbed227 | ||
|
|
04a23c0f60 | ||
|
|
0bf9eb2f3a | ||
|
|
f13462f7cf | ||
|
|
0754bc45d3 | ||
|
|
e314f51813 | ||
|
|
5148bc42ae | ||
|
|
b43c848817 | ||
|
|
abd2b58b52 | ||
|
|
2ce1decd99 | ||
|
|
f8112735af | ||
|
|
455a8d2a91 | ||
|
|
ca692cc7c0 | ||
|
|
f5f5b540af | ||
|
|
8b3b1b4611 | ||
|
|
21cb76e517 | ||
|
|
d774a3c2ab | ||
|
|
0c08e8ba9e | ||
|
|
c2549ec166 | ||
|
|
d27fce3b29 | ||
|
|
849588e305 | ||
|
|
4f3fedc27e | ||
|
|
57a5892f99 | ||
|
|
f5499ca4ed | ||
|
|
37ae595f03 | ||
|
|
868a4a2964 | ||
|
|
3656480cff | ||
|
|
37cf4b5e88 | ||
|
|
75a4e7b5d7 | ||
|
|
12d6cf8a5b | ||
|
|
aa7e5ea601 | ||
|
|
9f5232019e | ||
|
|
3063763a18 | ||
|
|
b76f9e7e21 |
@@ -7,6 +7,8 @@ on:
|
||||
jobs:
|
||||
lock:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
YARN_ENABLE_SCRIPTS: false
|
||||
steps:
|
||||
- uses: dessant/lock-threads@v2
|
||||
with:
|
||||
|
||||
@@ -8,6 +8,8 @@ jobs:
|
||||
step: ['lint', 'test', 'build']
|
||||
name: ${{ matrix.step }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
YARN_ENABLE_SCRIPTS: false
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: ${{ matrix.step }}
|
||||
|
||||
@@ -12,17 +12,18 @@ jobs:
|
||||
step: ['build:release']
|
||||
name: ${{ matrix.step }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
YARN_ENABLE_SCRIPTS: false
|
||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GH_PAT }}
|
||||
- name: ${{ matrix.step }}
|
||||
env:
|
||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
yarn install --immutable | grep -v 'YN0013'
|
||||
yarn ${{ matrix.step }}
|
||||
|
||||
@@ -9,6 +9,8 @@ jobs:
|
||||
check:
|
||||
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
YARN_ENABLE_SCRIPTS: false
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: returntocorp/semgrep-action@v1
|
||||
|
||||
@@ -6,6 +6,8 @@ on:
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
YARN_ENABLE_SCRIPTS: false
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
with:
|
||||
|
||||
@@ -1,5 +1,40 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 7.8.1 Feb 14, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add `isHistoric` flag to ETH RPCs (Thanks to https://github.com/stwiname)
|
||||
- Align contract instantiate types with Substrate (Thanks to https://github.com/kwingram25)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust map header output type with lookup id
|
||||
- Re-enable all `BitVec` tests for `toU8a`
|
||||
- Expose `txIndex` as event index on extrinsic results
|
||||
- Allow inspection of Codec encoding (experimental)
|
||||
- Allow inspection of storage key encoding (experimental)
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
- Update `@polkadot/util` to 8.4.1
|
||||
|
||||
|
||||
## 7.7.1 Feb 6, 2022
|
||||
|
||||
Upgrade priority: Low. Recommended for users with long-running scripts.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Fix rpc-provider LRU memory leak (Thanks to https://github.com/gdethier)
|
||||
|
||||
Changes:
|
||||
|
||||
- Don't warn on `Lookup*` types missing (these are resolvable)
|
||||
- Don't clear injected `PortableRegistry` types on runtime upgrade
|
||||
- Clear warning for `Call`/`Event` on non-meta v14 runtimes
|
||||
- Add `beefy_getFinalizedHead` RPC support
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
|
||||
|
||||
## 7.6.1 Jan 30, 2022
|
||||
|
||||
Upgdare priority: Low. Recommended for users with long-running scripts and those chains based around the latest Substrate master versions.
|
||||
|
||||
+4
-2
@@ -1,6 +1,6 @@
|
||||
2795 Jaco 7.6.1 (#4515)
|
||||
2821 Jaco 7.8.1 (#4564)
|
||||
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
|
||||
36 Keith Ingram Storage deposit limit changes (#4370)
|
||||
37 Keith Ingram Update contract types and rpc (#4541)
|
||||
35 Stefanie Doll Updated child storage parameters (#1709)
|
||||
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
|
||||
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
|
||||
@@ -34,6 +34,7 @@
|
||||
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
|
||||
2 Nikos Kontakis Add auction in shared types (#4085)
|
||||
2 Paweł Nguyen Fix a minor typo in cookbook blocks docs (#2294)
|
||||
2 Scott Twiname Fix `isHistorical` to `isHistoric` (#4540)
|
||||
2 sung wu Update tx.md (#2485)
|
||||
2 Veliko Abi constructor takes different parameters (#3347)
|
||||
2 Wei Tang Use /usr/bin/env bash instead of /bin/bash (#2053)
|
||||
@@ -52,6 +53,7 @@
|
||||
1 Dylan Galea Updated users of the polkadot-js/api (#2027)
|
||||
1 flex Change BeefySignedCommitment signatures type to EcdsaSignature (#4204)
|
||||
1 Furqan A fix: fixed 404 to the docs from the api readme (#3985)
|
||||
1 Gérard Dethier Fix LRUCache memory leak. (#4520)
|
||||
1 Gerben van de Wiel Adding some extra notes on changes in the specname (#2329)
|
||||
1 HackFisher fix OutboundLaneData types (#3992)
|
||||
1 Hoani Bryson Multiple Endpoint support for WsProvider (#2234)
|
||||
|
||||
+5
-5
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "commonjs",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -31,10 +31,10 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.12",
|
||||
"@babel/register": "^7.16.9",
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/dev": "^0.65.46",
|
||||
"@babel/core": "^7.17.2",
|
||||
"@babel/register": "^7.17.0",
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/dev": "^0.65.56",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^27.4.0",
|
||||
"copyfiles": "^2.4.1"
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api-base": "7.6.1",
|
||||
"@polkadot/rpc-augment": "7.6.1",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-augment": "7.6.1",
|
||||
"@polkadot/types-codec": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3"
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api-base": "7.8.1",
|
||||
"@polkadot/rpc-augment": "7.8.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-augment": "7.8.1",
|
||||
"@polkadot/types-codec": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,8 +592,13 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
friendDepositFactor: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum amount of friends allowed in a recovery configuration.
|
||||
*
|
||||
* NOTE: The threshold programmed in this Pallet uses u16, so it does
|
||||
* not really make sense to have a limit here greater than u16::MAX.
|
||||
* But also, that is a lot more than you should probably set this value
|
||||
* to anyway...
|
||||
**/
|
||||
maxFriends: u16 & AugmentedConst<ApiType>;
|
||||
maxFriends: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The base amount of currency needed to reserve for starting a recovery.
|
||||
*
|
||||
@@ -703,7 +708,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* Number of eras that staked funds must remain bonded for.
|
||||
**/
|
||||
bondingDuration: u32 & AugmentedConst<ApiType>;
|
||||
maxNominations: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of nominators rewarded for each validator.
|
||||
*
|
||||
@@ -847,6 +851,8 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
burn: Permill & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of approvals that can wait in the spending queue.
|
||||
*
|
||||
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
|
||||
**/
|
||||
maxApprovals: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
|
||||
@@ -185,6 +185,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Require bounty curator.
|
||||
**/
|
||||
RequireCurator: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many approvals are already queued.
|
||||
**/
|
||||
TooManyQueued: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The bounty status is unexpected.
|
||||
**/
|
||||
@@ -503,6 +507,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The call is not allowed at this point.
|
||||
**/
|
||||
CallNotAllowed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The fallback failed
|
||||
**/
|
||||
FallbackFailed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* `Self::insert_submission` returned an invalid index.
|
||||
**/
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1DisputeState, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1DisputeState, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
@@ -185,8 +185,29 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* The balance of an account.
|
||||
* The Balances pallet example of storing the balance of an account.
|
||||
*
|
||||
* # Example
|
||||
*
|
||||
* ```nocompile
|
||||
* impl pallet_balances::Config for Runtime {
|
||||
* type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* You can also store the balance of an account in the `System` pallet.
|
||||
*
|
||||
* # Example
|
||||
*
|
||||
* ```nocompile
|
||||
* impl pallet_balances::Config for Runtime {
|
||||
* type AccountStore = System
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* But this comes with tradeoffs, storing account balances in the system pallet stores
|
||||
* `frame_system` data alongside the account data contrary to storing account balances in the
|
||||
* `Balances` pallet, which uses a `StorageMap` to store balances data only.
|
||||
* NOTE: This is only used in the case that this pallet is used to store balances.
|
||||
**/
|
||||
account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
@@ -364,13 +385,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* proposal.
|
||||
**/
|
||||
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Accounts for which there are locks in action which may be removed at some point in the
|
||||
* future. The value is the block number at which the lock expires and may be removed.
|
||||
*
|
||||
* TWOX-NOTE: OK ― `AccountId` is a secure hash.
|
||||
**/
|
||||
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* The lowest referendum index representing an unbaked referendum. Equal to
|
||||
* `ReferendumCount` if there isn't a unbaked referendum.
|
||||
@@ -1222,12 +1236,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Lookup from identity to the block number and index of the task.
|
||||
**/
|
||||
lookup: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [Bytes]> & QueryableStorageEntry<ApiType, [Bytes]>;
|
||||
/**
|
||||
* Storage version of the pallet.
|
||||
*
|
||||
* New networks start with last version.
|
||||
**/
|
||||
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletSchedulerReleases>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -1533,7 +1541,22 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
minValidatorBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The map from nominator stash key to the set of stash keys of all validators to nominate.
|
||||
* The map from nominator stash key to their nomination preferences, namely the validators that
|
||||
* they wish to support.
|
||||
*
|
||||
* Note that the keys of this storage map might become non-decodable in case the
|
||||
* [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators
|
||||
* are still existent in storage, their key is correct and retrievable (i.e. `contains_key`
|
||||
* indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable
|
||||
* nominators will effectively not-exist, until they re-submit their preferences such that it
|
||||
* is within the bounds of the newly set `Config::MaxNominations`.
|
||||
*
|
||||
* This implies that `::iter_keys().count()` and `::iter().count()` might return different
|
||||
* values for this map. Moreover, the main `::count()` is aligned with the former, namely the
|
||||
* number of keys that exist.
|
||||
*
|
||||
* Lastly, if any of the nominators become non-decodable, they can be chilled immediately via
|
||||
* [`Call::chill_other`] dispatchable by anyone.
|
||||
**/
|
||||
nominators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletStakingNominations>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
|
||||
@@ -1198,6 +1198,13 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
electionProviderMultiPhase: {
|
||||
/**
|
||||
* Trigger the governance fallback.
|
||||
*
|
||||
* This can only be called when [`Phase::Emergency`] is enabled, as an alternative to
|
||||
* calling [`Call::set_emergency_election_result`].
|
||||
**/
|
||||
governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option<u32> | null | object | string | Uint8Array, maybeMaxTargets: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>, Option<u32>]>;
|
||||
/**
|
||||
* Set a solution in the queue, to be handed out to the client of this pallet in the next
|
||||
* call to `ElectionProvider::elect`.
|
||||
@@ -3149,14 +3156,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Can be called by the `T::SlashCancelOrigin`.
|
||||
*
|
||||
* Parameters: era and indices of the slashes for that era to kill.
|
||||
*
|
||||
* # <weight>
|
||||
* Complexity: O(U + S)
|
||||
* with U unapplied slashes weighted with U=1000
|
||||
* and S is the number of slash indices to be canceled.
|
||||
* - Read: Unapplied Slashes
|
||||
* - Write: Unapplied Slashes
|
||||
* # </weight>
|
||||
**/
|
||||
cancelDeferredSlash: AugmentedSubmittable<(era: u32 | AnyNumber | Uint8Array, slashIndices: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
|
||||
/**
|
||||
@@ -3185,6 +3184,11 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* If the caller is different than the controller being targeted, the following conditions
|
||||
* must be met:
|
||||
*
|
||||
* * `controller` must belong to a nominator who has become non-decodable,
|
||||
*
|
||||
* Or:
|
||||
*
|
||||
* * A `ChillThreshold` must be set and checked which defines how close to the max
|
||||
* nominators or validators we must reach before users can start chilling one-another.
|
||||
* * A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine
|
||||
@@ -3197,6 +3201,12 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* who do not satisfy these requirements.
|
||||
**/
|
||||
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Force a validator to have at least the minimum commission. This will not affect a
|
||||
* validator who already has a commission greater than or equal to the minimum. Any account
|
||||
* can call this.
|
||||
**/
|
||||
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Force there to be a new era at the end of the next session. After this, it will be
|
||||
* reset to normal (non-forced) behaviour.
|
||||
@@ -3226,11 +3236,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* The election process starts multiple blocks before the end of the era.
|
||||
* If this is called just before a new era is triggered, the election process may not
|
||||
* have enough blocks to get a result.
|
||||
*
|
||||
* # <weight>
|
||||
* - Weight: O(1)
|
||||
* - Write: ForceEra
|
||||
* # </weight>
|
||||
**/
|
||||
forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
|
||||
/**
|
||||
@@ -3255,13 +3260,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Force a current staker to become completely unstaked, immediately.
|
||||
*
|
||||
* The dispatch origin must be Root.
|
||||
*
|
||||
* # <weight>
|
||||
* O(S) where S is the number of slashing spans to be removed
|
||||
* Reads: Bonded, Slashing Spans, Account, Locks
|
||||
* Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
|
||||
* Account, Locks Writes Each: SpanSlash * S
|
||||
* # </weight>
|
||||
**/
|
||||
forceUnstake: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
|
||||
/**
|
||||
@@ -3297,7 +3295,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* # <weight>
|
||||
* - The transaction's complexity is proportional to the size of `targets` (N)
|
||||
* which is capped at CompactAssignments::LIMIT (MAX_NOMINATIONS).
|
||||
* which is capped at CompactAssignments::LIMIT (T::MaxNominations).
|
||||
* - Both the reads and writes follow a similar pattern.
|
||||
* # </weight>
|
||||
**/
|
||||
@@ -3411,11 +3409,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Set the validators who cannot be slashed (if any).
|
||||
*
|
||||
* The dispatch origin must be Root.
|
||||
*
|
||||
* # <weight>
|
||||
* - O(V)
|
||||
* - Write: Invulnerables
|
||||
* # </weight>
|
||||
**/
|
||||
setInvulnerables: AugmentedSubmittable<(invulnerables: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
|
||||
/**
|
||||
@@ -3547,11 +3540,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Make some on-chain remark and emit event.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(b)` where b is the length of the remark.
|
||||
* - 1 event.
|
||||
* # </weight>
|
||||
**/
|
||||
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -575,7 +575,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* Number of eras that staked funds must remain bonded for.
|
||||
**/
|
||||
bondingDuration: u32 & AugmentedConst<ApiType>;
|
||||
maxNominations: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of nominators rewarded for each validator.
|
||||
*
|
||||
@@ -719,6 +718,8 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
burn: Permill & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of approvals that can wait in the spending queue.
|
||||
*
|
||||
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
|
||||
**/
|
||||
maxApprovals: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
|
||||
@@ -185,6 +185,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Require bounty curator.
|
||||
**/
|
||||
RequireCurator: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many approvals are already queued.
|
||||
**/
|
||||
TooManyQueued: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The bounty status is unexpected.
|
||||
**/
|
||||
@@ -503,6 +507,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The call is not allowed at this point.
|
||||
**/
|
||||
CallNotAllowed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The fallback failed
|
||||
**/
|
||||
FallbackFailed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* `Self::insert_submission` returned an invalid index.
|
||||
**/
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerReleases, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
@@ -185,8 +185,29 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* The balance of an account.
|
||||
* The Balances pallet example of storing the balance of an account.
|
||||
*
|
||||
* # Example
|
||||
*
|
||||
* ```nocompile
|
||||
* impl pallet_balances::Config for Runtime {
|
||||
* type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* You can also store the balance of an account in the `System` pallet.
|
||||
*
|
||||
* # Example
|
||||
*
|
||||
* ```nocompile
|
||||
* impl pallet_balances::Config for Runtime {
|
||||
* type AccountStore = System
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* But this comes with tradeoffs, storing account balances in the system pallet stores
|
||||
* `frame_system` data alongside the account data contrary to storing account balances in the
|
||||
* `Balances` pallet, which uses a `StorageMap` to store balances data only.
|
||||
* NOTE: This is only used in the case that this pallet is used to store balances.
|
||||
**/
|
||||
account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
@@ -364,13 +385,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* proposal.
|
||||
**/
|
||||
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Accounts for which there are locks in action which may be removed at some point in the
|
||||
* future. The value is the block number at which the lock expires and may be removed.
|
||||
*
|
||||
* TWOX-NOTE: OK ― `AccountId` is a secure hash.
|
||||
**/
|
||||
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* The lowest referendum index representing an unbaked referendum. Equal to
|
||||
* `ReferendumCount` if there isn't a unbaked referendum.
|
||||
@@ -1138,12 +1152,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Lookup from identity to the block number and index of the task.
|
||||
**/
|
||||
lookup: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [Bytes]> & QueryableStorageEntry<ApiType, [Bytes]>;
|
||||
/**
|
||||
* Storage version of the pallet.
|
||||
*
|
||||
* New networks start with last version.
|
||||
**/
|
||||
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletSchedulerReleases>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -1378,7 +1386,22 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
minValidatorBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The map from nominator stash key to the set of stash keys of all validators to nominate.
|
||||
* The map from nominator stash key to their nomination preferences, namely the validators that
|
||||
* they wish to support.
|
||||
*
|
||||
* Note that the keys of this storage map might become non-decodable in case the
|
||||
* [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators
|
||||
* are still existent in storage, their key is correct and retrievable (i.e. `contains_key`
|
||||
* indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable
|
||||
* nominators will effectively not-exist, until they re-submit their preferences such that it
|
||||
* is within the bounds of the newly set `Config::MaxNominations`.
|
||||
*
|
||||
* This implies that `::iter_keys().count()` and `::iter().count()` might return different
|
||||
* values for this map. Moreover, the main `::count()` is aligned with the former, namely the
|
||||
* number of keys that exist.
|
||||
*
|
||||
* Lastly, if any of the nominators become non-decodable, they can be chilled immediately via
|
||||
* [`Call::chill_other`] dispatchable by anyone.
|
||||
**/
|
||||
nominators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletStakingNominations>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
|
||||
@@ -1198,6 +1198,13 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
electionProviderMultiPhase: {
|
||||
/**
|
||||
* Trigger the governance fallback.
|
||||
*
|
||||
* This can only be called when [`Phase::Emergency`] is enabled, as an alternative to
|
||||
* calling [`Call::set_emergency_election_result`].
|
||||
**/
|
||||
governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option<u32> | null | object | string | Uint8Array, maybeMaxTargets: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>, Option<u32>]>;
|
||||
/**
|
||||
* Set a solution in the queue, to be handed out to the client of this pallet in the next
|
||||
* call to `ElectionProvider::elect`.
|
||||
@@ -2560,14 +2567,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Can be called by the `T::SlashCancelOrigin`.
|
||||
*
|
||||
* Parameters: era and indices of the slashes for that era to kill.
|
||||
*
|
||||
* # <weight>
|
||||
* Complexity: O(U + S)
|
||||
* with U unapplied slashes weighted with U=1000
|
||||
* and S is the number of slash indices to be canceled.
|
||||
* - Read: Unapplied Slashes
|
||||
* - Write: Unapplied Slashes
|
||||
* # </weight>
|
||||
**/
|
||||
cancelDeferredSlash: AugmentedSubmittable<(era: u32 | AnyNumber | Uint8Array, slashIndices: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
|
||||
/**
|
||||
@@ -2596,6 +2595,11 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* If the caller is different than the controller being targeted, the following conditions
|
||||
* must be met:
|
||||
*
|
||||
* * `controller` must belong to a nominator who has become non-decodable,
|
||||
*
|
||||
* Or:
|
||||
*
|
||||
* * A `ChillThreshold` must be set and checked which defines how close to the max
|
||||
* nominators or validators we must reach before users can start chilling one-another.
|
||||
* * A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine
|
||||
@@ -2608,6 +2612,12 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* who do not satisfy these requirements.
|
||||
**/
|
||||
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Force a validator to have at least the minimum commission. This will not affect a
|
||||
* validator who already has a commission greater than or equal to the minimum. Any account
|
||||
* can call this.
|
||||
**/
|
||||
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Force there to be a new era at the end of the next session. After this, it will be
|
||||
* reset to normal (non-forced) behaviour.
|
||||
@@ -2637,11 +2647,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* The election process starts multiple blocks before the end of the era.
|
||||
* If this is called just before a new era is triggered, the election process may not
|
||||
* have enough blocks to get a result.
|
||||
*
|
||||
* # <weight>
|
||||
* - Weight: O(1)
|
||||
* - Write: ForceEra
|
||||
* # </weight>
|
||||
**/
|
||||
forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
|
||||
/**
|
||||
@@ -2666,13 +2671,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Force a current staker to become completely unstaked, immediately.
|
||||
*
|
||||
* The dispatch origin must be Root.
|
||||
*
|
||||
* # <weight>
|
||||
* O(S) where S is the number of slashing spans to be removed
|
||||
* Reads: Bonded, Slashing Spans, Account, Locks
|
||||
* Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
|
||||
* Account, Locks Writes Each: SpanSlash * S
|
||||
* # </weight>
|
||||
**/
|
||||
forceUnstake: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
|
||||
/**
|
||||
@@ -2708,7 +2706,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* # <weight>
|
||||
* - The transaction's complexity is proportional to the size of `targets` (N)
|
||||
* which is capped at CompactAssignments::LIMIT (MAX_NOMINATIONS).
|
||||
* which is capped at CompactAssignments::LIMIT (T::MaxNominations).
|
||||
* - Both the reads and writes follow a similar pattern.
|
||||
* # </weight>
|
||||
**/
|
||||
@@ -2822,11 +2820,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Set the validators who cannot be slashed (if any).
|
||||
*
|
||||
* The dispatch origin must be Root.
|
||||
*
|
||||
* # <weight>
|
||||
* - O(V)
|
||||
* - Write: Invulnerables
|
||||
* # </weight>
|
||||
**/
|
||||
setInvulnerables: AugmentedSubmittable<(invulnerables: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
|
||||
/**
|
||||
@@ -2958,11 +2951,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Make some on-chain remark and emit event.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(b)` where b is the length of the remark.
|
||||
* - 1 event.
|
||||
* # </weight>
|
||||
**/
|
||||
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
|
||||
@@ -257,6 +257,26 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
convictionVoting: {
|
||||
/**
|
||||
* The maximum number of concurrent votes an account may have.
|
||||
*
|
||||
* Also used to compute weight, an overly large value can
|
||||
* lead to extrinsic with large weight estimation: see `delegate` for instance.
|
||||
**/
|
||||
maxVotes: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The minimum period of vote locking.
|
||||
*
|
||||
* It should be no shorter than enactment period to ensure that in the case of an approval,
|
||||
* those successful voters are locked into the consequences that their votes entail.
|
||||
**/
|
||||
voteLockingPeriod: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
democracy: {
|
||||
/**
|
||||
* Period in blocks where an external proposal may not be re-submitted after being vetoed.
|
||||
@@ -665,8 +685,13 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
friendDepositFactor: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum amount of friends allowed in a recovery configuration.
|
||||
*
|
||||
* NOTE: The threshold programmed in this Pallet uses u16, so it does
|
||||
* not really make sense to have a limit here greater than u16::MAX.
|
||||
* But also, that is a lot more than you should probably set this value
|
||||
* to anyway...
|
||||
**/
|
||||
maxFriends: u16 & AugmentedConst<ApiType>;
|
||||
maxFriends: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The base amount of currency needed to reserve for starting a recovery.
|
||||
*
|
||||
@@ -682,6 +707,31 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
referenda: {
|
||||
/**
|
||||
* Quantization level for the referendum wakeup scheduler. A higher number will result in
|
||||
* fewer storage reads/writes needed for smaller voters, but also result in delays to the
|
||||
* automatic referendum status changes. Explicit servicing instructions are unaffected.
|
||||
**/
|
||||
alarmInterval: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum size of the referendum queue for a single track.
|
||||
**/
|
||||
maxQueued: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The minimum amount to be used as a deposit for a public referendum proposal.
|
||||
**/
|
||||
submissionDeposit: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The number of blocks after submission that a referendum must begin being decided by.
|
||||
* Once this passes, then anyone may cancel the referendum.
|
||||
**/
|
||||
undecidingTimeout: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
scheduler: {
|
||||
/**
|
||||
* The maximum weight that may be scheduled per block for any dispatchables of less
|
||||
@@ -747,7 +797,6 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* Number of eras that staked funds must remain bonded for.
|
||||
**/
|
||||
bondingDuration: u32 & AugmentedConst<ApiType>;
|
||||
maxNominations: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of nominators rewarded for each validator.
|
||||
*
|
||||
@@ -891,6 +940,8 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
burn: Permill & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of approvals that can wait in the spending queue.
|
||||
*
|
||||
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
|
||||
**/
|
||||
maxApprovals: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
|
||||
@@ -219,6 +219,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Require bounty curator.
|
||||
**/
|
||||
RequireCurator: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too many approvals are already queued.
|
||||
**/
|
||||
TooManyQueued: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The bounty status is unexpected.
|
||||
**/
|
||||
@@ -309,6 +313,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* `seal_call` forwarded this contracts input. It therefore is no longer available.
|
||||
**/
|
||||
InputForwarded: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Invalid combination of flags supplied to `seal_call` or `seal_delegate_call`.
|
||||
**/
|
||||
InvalidCallFlags: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A new schedule must have a greater version than the current one.
|
||||
**/
|
||||
@@ -381,6 +389,61 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
convictionVoting: {
|
||||
/**
|
||||
* The account is already delegating.
|
||||
**/
|
||||
AlreadyDelegating: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The account currently has votes attached to it and the operation cannot succeed until
|
||||
* these are removed, either through `unvote` or `reap_vote`.
|
||||
**/
|
||||
AlreadyVoting: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The class ID supplied is invalid.
|
||||
**/
|
||||
BadClass: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The class must be supplied since it is not easily determinable from the state.
|
||||
**/
|
||||
ClassNeeded: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Too high a balance was provided that the account cannot afford.
|
||||
**/
|
||||
InsufficientFunds: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Maximum number of votes reached.
|
||||
**/
|
||||
MaxVotesReached: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Delegation to oneself makes no sense.
|
||||
**/
|
||||
Nonsense: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The actor has no permission to conduct the action.
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The actor has no permission to conduct the action right now but will do in the future.
|
||||
**/
|
||||
NoPermissionYet: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The account is not currently delegating.
|
||||
**/
|
||||
NotDelegating: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Poll is not ongoing.
|
||||
**/
|
||||
NotOngoing: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given account did not vote on the poll.
|
||||
**/
|
||||
NotVoter: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
council: {
|
||||
/**
|
||||
* Members are already initialized!
|
||||
@@ -551,6 +614,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The call is not allowed at this point.
|
||||
**/
|
||||
CallNotAllowed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The fallback failed
|
||||
**/
|
||||
FallbackFailed: AugmentedError<ApiType>;
|
||||
/**
|
||||
* `Self::insert_submission` returned an invalid index.
|
||||
**/
|
||||
@@ -1089,6 +1156,56 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
referenda: {
|
||||
/**
|
||||
* The referendum index provided is invalid in this context.
|
||||
**/
|
||||
BadReferendum: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The track identifier given was invalid.
|
||||
**/
|
||||
BadTrack: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There are already a full complement of referendums in progress for this track.
|
||||
**/
|
||||
Full: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Referendum's decision deposit is already paid.
|
||||
**/
|
||||
HaveDeposit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The deposit cannot be refunded since none was made.
|
||||
**/
|
||||
NoDeposit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The deposit refunder is not the depositor.
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* There was nothing to do in the advancement.
|
||||
**/
|
||||
NothingToDo: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Referendum is not ongoing.
|
||||
**/
|
||||
NotOngoing: AugmentedError<ApiType>;
|
||||
/**
|
||||
* No track exists for the proposal origin.
|
||||
**/
|
||||
NoTrack: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The queue of the track is empty.
|
||||
**/
|
||||
QueueEmpty: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Any deposit cannot be refunded until after the decision is over.
|
||||
**/
|
||||
Unfinished: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
scheduler: {
|
||||
/**
|
||||
* Failed to schedule a call
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, NodeRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, NodeRuntimeProxyType, PalletConvictionVotingTally, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/events' {
|
||||
export interface AugmentedEvents<ApiType extends ApiTypes> {
|
||||
@@ -233,6 +233,20 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
convictionVoting: {
|
||||
/**
|
||||
* An account has delegated their vote to another account. \[who, target\]
|
||||
**/
|
||||
Delegated: AugmentedEvent<ApiType, [AccountId32, AccountId32]>;
|
||||
/**
|
||||
* An \[account\] has cancelled a previous delegation operation.
|
||||
**/
|
||||
Undelegated: AugmentedEvent<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
council: {
|
||||
/**
|
||||
* A motion was approved by the required threshold.
|
||||
@@ -680,6 +694,58 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
referenda: {
|
||||
/**
|
||||
* A referendum has been approved and its proposal has been scheduled.
|
||||
**/
|
||||
Approved: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* A referendum has been cancelled.
|
||||
**/
|
||||
Cancelled: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
|
||||
ConfirmAborted: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* A referendum has ended its confirmation phase and is ready for approval.
|
||||
**/
|
||||
Confirmed: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
|
||||
ConfirmStarted: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* The decision deposit has been placed.
|
||||
**/
|
||||
DecisionDepositPlaced: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
|
||||
/**
|
||||
* The decision deposit has been refunded.
|
||||
**/
|
||||
DecisionDepositRefunded: AugmentedEvent<ApiType, [u32, AccountId32, u128]>;
|
||||
/**
|
||||
* A referendum has moved into the deciding phase.
|
||||
**/
|
||||
DecisionStarted: AugmentedEvent<ApiType, [u32, u8, H256, PalletConvictionVotingTally]>;
|
||||
/**
|
||||
* A deposit has been slashaed.
|
||||
**/
|
||||
DepositSlashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
|
||||
/**
|
||||
* A referendum has been killed.
|
||||
**/
|
||||
Killed: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
|
||||
/**
|
||||
* A proposal has been rejected by referendum.
|
||||
**/
|
||||
Rejected: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
|
||||
/**
|
||||
* A referendum has being submitted.
|
||||
**/
|
||||
Submitted: AugmentedEvent<ApiType, [u32, u8, H256]>;
|
||||
/**
|
||||
* A referendum has been timed out without being decided.
|
||||
**/
|
||||
TimedOut: AugmentedEvent<ApiType, [u32, PalletConvictionVotingTally]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
scheduler: {
|
||||
/**
|
||||
* The call for the provided hash was not found so the task has been aborted.
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
|
||||
import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, WrapperOpaque, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfo, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
@@ -327,6 +327,23 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
convictionVoting: {
|
||||
/**
|
||||
* The voting classes which have a non-zero lock requirement and the lock amounts which they
|
||||
* require. The actual amount locked on behalf of this pallet should always be the maximum of
|
||||
* this list.
|
||||
**/
|
||||
classLocksFor: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<ITuple<[u8, u128]>>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* All voting for a particular voter in a particular voting class. We store the balance for the
|
||||
* number of votes that we have recorded.
|
||||
**/
|
||||
votingFor: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u8 | AnyNumber | Uint8Array) => Observable<PalletConvictionVotingVoteVoting>, [AccountId32, u8]> & QueryableStorageEntry<ApiType, [AccountId32, u8]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
council: {
|
||||
/**
|
||||
* The current members of the collective. This is stored sorted (just by value).
|
||||
@@ -378,13 +395,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* proposal.
|
||||
**/
|
||||
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Accounts for which there are locks in action which may be removed at some point in the
|
||||
* future. The value is the block number at which the lock expires and may be removed.
|
||||
*
|
||||
* TWOX-NOTE: OK ― `AccountId` is a secure hash.
|
||||
**/
|
||||
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* The lowest referendum index representing an unbaked referendum. Equal to
|
||||
* `ReferendumCount` if there isn't a unbaked referendum.
|
||||
@@ -841,6 +851,33 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
referenda: {
|
||||
/**
|
||||
* The number of referenda being decided currently.
|
||||
**/
|
||||
decidingCount: AugmentedQuery<ApiType, (arg: u8 | AnyNumber | Uint8Array) => Observable<u32>, [u8]> & QueryableStorageEntry<ApiType, [u8]>;
|
||||
/**
|
||||
* The next free referendum index, aka the number of referenda started so far.
|
||||
**/
|
||||
referendumCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Information concerning any given referendum.
|
||||
*
|
||||
* TWOX-NOTE: SAFE as indexes are not under an attacker’s control.
|
||||
**/
|
||||
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfo>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The sorted list of referenda ready to be decided but not yet being decided, ordered by
|
||||
* conviction-weighted approvals.
|
||||
*
|
||||
* This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`.
|
||||
**/
|
||||
trackQueue: AugmentedQuery<ApiType, (arg: u8 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>, [u8]> & QueryableStorageEntry<ApiType, [u8]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
scheduler: {
|
||||
/**
|
||||
* Items to be executed, indexed by the block number that they should be executed on.
|
||||
@@ -850,12 +887,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Lookup from identity to the block number and index of the task.
|
||||
**/
|
||||
lookup: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [Bytes]> & QueryableStorageEntry<ApiType, [Bytes]>;
|
||||
/**
|
||||
* Storage version of the pallet.
|
||||
*
|
||||
* New networks start with last version.
|
||||
**/
|
||||
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletSchedulerReleases>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -1136,7 +1167,22 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
minValidatorBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The map from nominator stash key to the set of stash keys of all validators to nominate.
|
||||
* The map from nominator stash key to their nomination preferences, namely the validators that
|
||||
* they wish to support.
|
||||
*
|
||||
* Note that the keys of this storage map might become non-decodable in case the
|
||||
* [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators
|
||||
* are still existent in storage, their key is correct and retrievable (i.e. `contains_key`
|
||||
* indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable
|
||||
* nominators will effectively not-exist, until they re-submit their preferences such that it
|
||||
* is within the bounds of the newly set `Config::MaxNominations`.
|
||||
*
|
||||
* This implies that `::iter_keys().count()` and `::iter().count()` might return different
|
||||
* values for this map. Moreover, the main `::count()` is aligned with the former, namely the
|
||||
* number of keys that exist.
|
||||
*
|
||||
* Lastly, if any of the nominators become non-decodable, they can be chilled immediately via
|
||||
* [`Call::chill_other`] dispatchable by anyone.
|
||||
**/
|
||||
nominators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletStakingNominations>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
|
||||
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletReferendaAtOrAfter, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
@@ -985,6 +985,130 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
convictionVoting: {
|
||||
/**
|
||||
* Delegate the voting power (with some given conviction) of the sending account for a
|
||||
* particular class of polls.
|
||||
*
|
||||
* The balance delegated is locked for as long as it's delegated, and thereafter for the
|
||||
* time appropriate for the conviction's lock period.
|
||||
*
|
||||
* The dispatch origin of this call must be _Signed_, and the signing account must either:
|
||||
* - be delegating already; or
|
||||
* - have no voting activity (if there is, then it will need to be removed/consolidated
|
||||
* through `reap_vote` or `unvote`).
|
||||
*
|
||||
* - `to`: The account whose voting the `target` account's voting power will follow.
|
||||
* - `class`: The class of polls to delegate. To delegate multiple classes, multiple calls
|
||||
* to this function are required.
|
||||
* - `conviction`: The conviction that will be attached to the delegated votes. When the
|
||||
* account is undelegated, the funds will be locked for the corresponding period.
|
||||
* - `balance`: The amount of the account's balance to be used in delegating. This must not
|
||||
* be more than the account's current balance.
|
||||
*
|
||||
* Emits `Delegated`.
|
||||
*
|
||||
* Weight: `O(R)` where R is the number of polls the voter delegating to has
|
||||
* voted on. Weight is initially charged as if maximum votes, but is refunded later.
|
||||
**/
|
||||
delegate: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array, to: AccountId32 | string | Uint8Array, conviction: PalletConvictionVotingConviction | 'None' | 'Locked1x' | 'Locked2x' | 'Locked3x' | 'Locked4x' | 'Locked5x' | 'Locked6x' | number | Uint8Array, balance: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8, AccountId32, PalletConvictionVotingConviction, u128]>;
|
||||
/**
|
||||
* Remove a vote for a poll.
|
||||
*
|
||||
* If the `target` is equal to the signer, then this function is exactly equivalent to
|
||||
* `remove_vote`. If not equal to the signer, then the vote must have expired,
|
||||
* either because the poll was cancelled, because the voter lost the poll or
|
||||
* because the conviction period is over.
|
||||
*
|
||||
* The dispatch origin of this call must be _Signed_.
|
||||
*
|
||||
* - `target`: The account of the vote to be removed; this account must have voted for poll
|
||||
* `index`.
|
||||
* - `index`: The index of poll of the vote to be removed.
|
||||
* - `class`: The class of the poll.
|
||||
*
|
||||
* Weight: `O(R + log R)` where R is the number of polls that `target` has voted on.
|
||||
* Weight is calculated for the maximum number of vote.
|
||||
**/
|
||||
removeOtherVote: AugmentedSubmittable<(target: AccountId32 | string | Uint8Array, clazz: u8 | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u8, u32]>;
|
||||
/**
|
||||
* Remove a vote for a poll.
|
||||
*
|
||||
* If:
|
||||
* - the poll was cancelled, or
|
||||
* - the poll is ongoing, or
|
||||
* - the poll has ended such that
|
||||
* - the vote of the account was in opposition to the result; or
|
||||
* - there was no conviction to the account's vote; or
|
||||
* - the account made a split vote
|
||||
* ...then the vote is removed cleanly and a following call to `unlock` may result in more
|
||||
* funds being available.
|
||||
*
|
||||
* If, however, the poll has ended and:
|
||||
* - it finished corresponding to the vote of the account, and
|
||||
* - the account made a standard vote with conviction, and
|
||||
* - the lock period of the conviction is not over
|
||||
* ...then the lock will be aggregated into the overall account's lock, which may involve
|
||||
* *overlocking* (where the two locks are combined into a single lock that is the maximum
|
||||
* of both the amount locked and the time is it locked for).
|
||||
*
|
||||
* The dispatch origin of this call must be _Signed_, and the signer must have a vote
|
||||
* registered for poll `index`.
|
||||
*
|
||||
* - `index`: The index of poll of the vote to be removed.
|
||||
* - `class`: Optional parameter, if given it indicates the class of the poll. For polls
|
||||
* which have finished or are cancelled, this must be `Some`.
|
||||
*
|
||||
* Weight: `O(R + log R)` where R is the number of polls that `target` has voted on.
|
||||
* Weight is calculated for the maximum number of vote.
|
||||
**/
|
||||
removeVote: AugmentedSubmittable<(clazz: Option<u8> | null | object | string | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u8>, u32]>;
|
||||
/**
|
||||
* Undelegate the voting power of the sending account for a particular class of polls.
|
||||
*
|
||||
* Tokens may be unlocked following once an amount of time consistent with the lock period
|
||||
* of the conviction with which the delegation was issued.
|
||||
*
|
||||
* The dispatch origin of this call must be _Signed_ and the signing account must be
|
||||
* currently delegating.
|
||||
*
|
||||
* - `class`: The class of polls to remove the delegation from.
|
||||
*
|
||||
* Emits `Undelegated`.
|
||||
*
|
||||
* Weight: `O(R)` where R is the number of polls the voter delegating to has
|
||||
* voted on. Weight is initially charged as if maximum votes, but is refunded later.
|
||||
**/
|
||||
undelegate: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8]>;
|
||||
/**
|
||||
* Remove the lock caused prior voting/delegating which has expired within a particluar
|
||||
* class.
|
||||
*
|
||||
* The dispatch origin of this call must be _Signed_.
|
||||
*
|
||||
* - `class`: The class of polls to unlock.
|
||||
* - `target`: The account to remove the lock on.
|
||||
*
|
||||
* Weight: `O(R)` with R number of vote of target.
|
||||
**/
|
||||
unlock: AugmentedSubmittable<(clazz: u8 | AnyNumber | Uint8Array, target: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8, AccountId32]>;
|
||||
/**
|
||||
* Vote in a poll. If `vote.is_aye()`, the vote is to enact the proposal;
|
||||
* otherwise it is a vote to keep the status quo.
|
||||
*
|
||||
* The dispatch origin of this call must be _Signed_.
|
||||
*
|
||||
* - `poll_index`: The index of the poll to vote for.
|
||||
* - `vote`: The vote configuration.
|
||||
*
|
||||
* Weight: `O(R)` where R is the number of polls the voter has voted on.
|
||||
**/
|
||||
vote: AugmentedSubmittable<(pollIndex: Compact<u32> | AnyNumber | Uint8Array, vote: PalletConvictionVotingVoteAccountVote | { Standard: any } | { Split: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, PalletConvictionVotingVoteAccountVote]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
council: {
|
||||
/**
|
||||
* Close a vote that is either approved, disapproved or whose voting period has ended.
|
||||
@@ -1477,6 +1601,13 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
electionProviderMultiPhase: {
|
||||
/**
|
||||
* Trigger the governance fallback.
|
||||
*
|
||||
* This can only be called when [`Phase::Emergency`] is enabled, as an alternative to
|
||||
* calling [`Call::set_emergency_election_result`].
|
||||
**/
|
||||
governanceFallback: AugmentedSubmittable<(maybeMaxVoters: Option<u32> | null | object | string | Uint8Array, maybeMaxTargets: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>, Option<u32>]>;
|
||||
/**
|
||||
* Set a solution in the queue, to be handed out to the client of this pallet in the next
|
||||
* call to `ElectionProvider::elect`.
|
||||
@@ -2751,6 +2882,82 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
referenda: {
|
||||
/**
|
||||
* Cancel an ongoing referendum.
|
||||
*
|
||||
* - `origin`: must be the `CancelOrigin`.
|
||||
* - `index`: The index of the referendum to be cancelled.
|
||||
*
|
||||
* Emits `Cancelled`.
|
||||
**/
|
||||
cancel: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Cancel an ongoing referendum and slash the deposits.
|
||||
*
|
||||
* - `origin`: must be the `KillOrigin`.
|
||||
* - `index`: The index of the referendum to be cancelled.
|
||||
*
|
||||
* Emits `Killed` and `DepositSlashed`.
|
||||
**/
|
||||
kill: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Advance a referendum onto its next logical state. Only used internally.
|
||||
*
|
||||
* - `origin`: must be `Root`.
|
||||
* - `index`: the referendum to be advanced.
|
||||
**/
|
||||
nudgeReferendum: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Advance a track onto its next logical state. Only used internally.
|
||||
*
|
||||
* - `origin`: must be `Root`.
|
||||
* - `track`: the track to be advanced.
|
||||
*
|
||||
* Action item for when there is now one fewer referendum in the deciding phase and the
|
||||
* `DecidingCount` is not yet updated. This means that we should either:
|
||||
* - begin deciding another referendum (and leave `DecidingCount` alone); or
|
||||
* - decrement `DecidingCount`.
|
||||
**/
|
||||
oneFewerDeciding: AugmentedSubmittable<(track: u8 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u8]>;
|
||||
/**
|
||||
* Post the Decision Deposit for a referendum.
|
||||
*
|
||||
* - `origin`: must be `Signed` and the account must have funds available for the
|
||||
* referendum's track's Decision Deposit.
|
||||
* - `index`: The index of the submitted referendum whose Decision Deposit is yet to be
|
||||
* posted.
|
||||
*
|
||||
* Emits `DecisionDepositPlaced`.
|
||||
**/
|
||||
placeDecisionDeposit: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Refund the Decision Deposit for a closed referendum back to the depositor.
|
||||
*
|
||||
* - `origin`: must be `Signed` or `Root`.
|
||||
* - `index`: The index of a closed referendum whose Decision Deposit has not yet been
|
||||
* refunded.
|
||||
*
|
||||
* Emits `DecisionDepositRefunded`.
|
||||
**/
|
||||
refundDecisionDeposit: AugmentedSubmittable<(index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Propose a referendum on a privileged action.
|
||||
*
|
||||
* - `origin`: must be `Signed` and the account must have `SubmissionDeposit` funds
|
||||
* available.
|
||||
* - `proposal_origin`: The origin from which the proposal should be executed.
|
||||
* - `proposal_hash`: The hash of the proposal preimage.
|
||||
* - `enactment_moment`: The moment that the proposal should be enacted.
|
||||
*
|
||||
* Emits `Submitted`.
|
||||
**/
|
||||
submit: AugmentedSubmittable<(proposalOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, proposalHash: H256 | string | Uint8Array, enactmentMoment: PalletReferendaAtOrAfter | { At: any } | { After: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, H256, PalletReferendaAtOrAfter]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
scheduler: {
|
||||
/**
|
||||
* Cancel an anonymously scheduled task.
|
||||
@@ -3203,14 +3410,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Can be called by the `T::SlashCancelOrigin`.
|
||||
*
|
||||
* Parameters: era and indices of the slashes for that era to kill.
|
||||
*
|
||||
* # <weight>
|
||||
* Complexity: O(U + S)
|
||||
* with U unapplied slashes weighted with U=1000
|
||||
* and S is the number of slash indices to be canceled.
|
||||
* - Read: Unapplied Slashes
|
||||
* - Write: Unapplied Slashes
|
||||
* # </weight>
|
||||
**/
|
||||
cancelDeferredSlash: AugmentedSubmittable<(era: u32 | AnyNumber | Uint8Array, slashIndices: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
|
||||
/**
|
||||
@@ -3239,6 +3438,11 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* If the caller is different than the controller being targeted, the following conditions
|
||||
* must be met:
|
||||
*
|
||||
* * `controller` must belong to a nominator who has become non-decodable,
|
||||
*
|
||||
* Or:
|
||||
*
|
||||
* * A `ChillThreshold` must be set and checked which defines how close to the max
|
||||
* nominators or validators we must reach before users can start chilling one-another.
|
||||
* * A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine
|
||||
@@ -3251,6 +3455,12 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* who do not satisfy these requirements.
|
||||
**/
|
||||
chillOther: AugmentedSubmittable<(controller: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Force a validator to have at least the minimum commission. This will not affect a
|
||||
* validator who already has a commission greater than or equal to the minimum. Any account
|
||||
* can call this.
|
||||
**/
|
||||
forceApplyMinCommission: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Force there to be a new era at the end of the next session. After this, it will be
|
||||
* reset to normal (non-forced) behaviour.
|
||||
@@ -3280,11 +3490,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* The election process starts multiple blocks before the end of the era.
|
||||
* If this is called just before a new era is triggered, the election process may not
|
||||
* have enough blocks to get a result.
|
||||
*
|
||||
* # <weight>
|
||||
* - Weight: O(1)
|
||||
* - Write: ForceEra
|
||||
* # </weight>
|
||||
**/
|
||||
forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
|
||||
/**
|
||||
@@ -3309,13 +3514,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Force a current staker to become completely unstaked, immediately.
|
||||
*
|
||||
* The dispatch origin must be Root.
|
||||
*
|
||||
* # <weight>
|
||||
* O(S) where S is the number of slashing spans to be removed
|
||||
* Reads: Bonded, Slashing Spans, Account, Locks
|
||||
* Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
|
||||
* Account, Locks Writes Each: SpanSlash * S
|
||||
* # </weight>
|
||||
**/
|
||||
forceUnstake: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
|
||||
/**
|
||||
@@ -3351,7 +3549,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* # <weight>
|
||||
* - The transaction's complexity is proportional to the size of `targets` (N)
|
||||
* which is capped at CompactAssignments::LIMIT (MAX_NOMINATIONS).
|
||||
* which is capped at CompactAssignments::LIMIT (T::MaxNominations).
|
||||
* - Both the reads and writes follow a similar pattern.
|
||||
* # </weight>
|
||||
**/
|
||||
@@ -3465,11 +3663,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Set the validators who cannot be slashed (if any).
|
||||
*
|
||||
* The dispatch origin must be Root.
|
||||
*
|
||||
* # <weight>
|
||||
* - O(V)
|
||||
* - Write: Invulnerables
|
||||
* # </weight>
|
||||
**/
|
||||
setInvulnerables: AugmentedSubmittable<(invulnerables: Vec<AccountId32> | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<AccountId32>]>;
|
||||
/**
|
||||
@@ -3660,11 +3853,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Make some on-chain remark and emit event.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(b)` where b is the length of the remark.
|
||||
* - 1 event.
|
||||
* # </weight>
|
||||
**/
|
||||
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
@@ -4206,21 +4394,18 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
cancelApproval: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, maybeCheckDelegate: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, Option<MultiAddress>]>;
|
||||
/**
|
||||
* Set an attribute for an asset class or instance.
|
||||
* Clear an attribute for an asset class or instance.
|
||||
*
|
||||
* Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
|
||||
* asset `class`.
|
||||
*
|
||||
* If the origin is Signed, then funds of signer are reserved according to the formula:
|
||||
* `MetadataDepositBase + DepositPerByte * (key.len + value.len)` taking into
|
||||
* account any already reserved funds.
|
||||
* Any deposit is freed for the asset class owner.
|
||||
*
|
||||
* - `class`: The identifier of the asset class whose instance's metadata to set.
|
||||
* - `instance`: The identifier of the asset instance whose metadata to set.
|
||||
* - `class`: The identifier of the asset class whose instance's metadata to clear.
|
||||
* - `maybe_instance`: The identifier of the asset instance whose metadata to clear.
|
||||
* - `key`: The key of the attribute.
|
||||
* - `value`: The value to which to set the attribute.
|
||||
*
|
||||
* Emits `AttributeSet`.
|
||||
* Emits `AttributeCleared`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/rpc-core": "7.6.1",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"rxjs": "^7.5.2"
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/rpc-core": "7.8.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1",
|
||||
"rxjs": "^7.5.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -66,6 +66,7 @@ export interface SubmittableResultValue {
|
||||
internalError?: Error;
|
||||
status: ExtrinsicStatus;
|
||||
txHash: Hash;
|
||||
txIndex?: number;
|
||||
}
|
||||
|
||||
export interface SubmittableExtrinsic<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> extends Extrinsic {
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api": "7.6.1",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-codec": "7.6.1",
|
||||
"@polkadot/types-create": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"rxjs": "^7.5.2"
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api": "7.8.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-codec": "7.8.1",
|
||||
"@polkadot/types-create": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1",
|
||||
"@polkadot/util-crypto": "^8.4.1",
|
||||
"rxjs": "^7.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "7.6.1",
|
||||
"@polkadot/keyring": "^8.3.3"
|
||||
"@polkadot/api-augment": "7.8.1",
|
||||
"@polkadot/keyring": "^8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api": "7.6.1",
|
||||
"@polkadot/api-augment": "7.6.1",
|
||||
"@polkadot/api-base": "7.6.1",
|
||||
"@polkadot/rpc-core": "7.6.1",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-codec": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"rxjs": "^7.5.2"
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api": "7.8.1",
|
||||
"@polkadot/api-augment": "7.8.1",
|
||||
"@polkadot/api-base": "7.8.1",
|
||||
"@polkadot/rpc-core": "7.8.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-codec": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1",
|
||||
"@polkadot/util-crypto": "^8.4.1",
|
||||
"rxjs": "^7.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "7.6.1",
|
||||
"@polkadot/api-augment": "7.6.1",
|
||||
"@polkadot/rpc-augment": "7.6.1",
|
||||
"@polkadot/rpc-provider": "7.6.1",
|
||||
"@polkadot/types-support": "7.6.1"
|
||||
"@polkadot/api": "7.8.1",
|
||||
"@polkadot/api-augment": "7.8.1",
|
||||
"@polkadot/rpc-augment": "7.8.1",
|
||||
"@polkadot/rpc-provider": "7.8.1",
|
||||
"@polkadot/types-support": "7.8.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
+19
-19
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api-augment": "7.6.1",
|
||||
"@polkadot/api-base": "7.6.1",
|
||||
"@polkadot/api-derive": "7.6.1",
|
||||
"@polkadot/keyring": "^8.3.3",
|
||||
"@polkadot/rpc-augment": "7.6.1",
|
||||
"@polkadot/rpc-core": "7.6.1",
|
||||
"@polkadot/rpc-provider": "7.6.1",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-augment": "7.6.1",
|
||||
"@polkadot/types-codec": "7.6.1",
|
||||
"@polkadot/types-create": "7.6.1",
|
||||
"@polkadot/types-known": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api-augment": "7.8.1",
|
||||
"@polkadot/api-base": "7.8.1",
|
||||
"@polkadot/api-derive": "7.8.1",
|
||||
"@polkadot/keyring": "^8.4.1",
|
||||
"@polkadot/rpc-augment": "7.8.1",
|
||||
"@polkadot/rpc-core": "7.8.1",
|
||||
"@polkadot/rpc-provider": "7.8.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-augment": "7.8.1",
|
||||
"@polkadot/types-codec": "7.8.1",
|
||||
"@polkadot/types-create": "7.8.1",
|
||||
"@polkadot/types-known": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1",
|
||||
"@polkadot/util-crypto": "^8.4.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.5.2"
|
||||
"rxjs": "^7.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "7.6.1",
|
||||
"@polkadot/types-support": "7.6.1"
|
||||
"@polkadot/api-augment": "7.8.1",
|
||||
"@polkadot/types-support": "7.8.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
} as ApiDecoration<ApiType>;
|
||||
}
|
||||
|
||||
if (!registry.decoratedMeta) {
|
||||
if (fromEmpty || !registry.decoratedMeta) {
|
||||
registry.decoratedMeta = expandMetadata(registry.registry, registry.metadata);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
* @description Decorates a registry based on the runtime version
|
||||
*/
|
||||
private _initRegistry (registry: Registry, chain: Text, version: { specName: Text, specVersion: BN }, metadata: Metadata, chainProps?: ChainProperties): void {
|
||||
registry.clearCache();
|
||||
registry.setChainProperties(chainProps || this.registry.getChainProperties());
|
||||
registry.setKnownTypes(this._options);
|
||||
registry.register(getSpecTypes(registry, chain, version.specName, version.specVersion));
|
||||
@@ -284,9 +285,8 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
|
||||
thisRegistry.metadata = metadata;
|
||||
thisRegistry.specVersion = version.specVersion;
|
||||
|
||||
// clear the registry types to ensure that we override correctly
|
||||
this._initRegistry(thisRegistry.registry.init(), this._runtimeChain as Text, version, metadata);
|
||||
this._injectMetadata(thisRegistry, false);
|
||||
this._initRegistry(this.registry, this._runtimeChain as Text, version, metadata);
|
||||
this._injectMetadata(thisRegistry, true);
|
||||
|
||||
return true;
|
||||
})
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -47,13 +47,16 @@ export class SubmittableResult implements ISubmittableResult {
|
||||
|
||||
public readonly txHash: Hash;
|
||||
|
||||
constructor ({ dispatchError, dispatchInfo, events, internalError, status, txHash }: SubmittableResultValue) {
|
||||
public readonly txIndex?: number;
|
||||
|
||||
constructor ({ dispatchError, dispatchInfo, events, internalError, status, txHash, txIndex }: SubmittableResultValue) {
|
||||
this.dispatchError = dispatchError || extractError(events);
|
||||
this.dispatchInfo = dispatchInfo || extractInfo(events);
|
||||
this.events = events || [];
|
||||
this.internalError = internalError;
|
||||
this.status = status;
|
||||
this.txHash = txHash;
|
||||
this.txIndex = txIndex;
|
||||
}
|
||||
|
||||
public get isCompleted (): boolean {
|
||||
|
||||
@@ -248,7 +248,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
|
||||
return api.derive.tx.events(blockHash).pipe(
|
||||
map(({ block, events }): ISubmittableResult =>
|
||||
this.#transformResult(new SubmittableResult({
|
||||
events: filterEvents(txHash, block, events, status),
|
||||
...filterEvents(txHash, block, events, status),
|
||||
status,
|
||||
txHash
|
||||
}))
|
||||
|
||||
@@ -5,14 +5,17 @@ import type { EventRecord, ExtrinsicStatus, H256, SignedBlock } from '@polkadot/
|
||||
|
||||
import { l } from './logging';
|
||||
|
||||
export function filterEvents (txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): EventRecord[] | undefined {
|
||||
export function filterEvents (txHash: H256, { block: { extrinsics, header } }: SignedBlock, allEvents: EventRecord[], status: ExtrinsicStatus): { events?: EventRecord[], txIndex?: number } {
|
||||
// extrinsics to hashes
|
||||
for (const [index, x] of extrinsics.entries()) {
|
||||
for (const [txIndex, x] of extrinsics.entries()) {
|
||||
if (x.hash.eq(txHash)) {
|
||||
return allEvents.filter(({ phase }) =>
|
||||
// only ApplyExtrinsic has the extrinsic index
|
||||
phase.isApplyExtrinsic && phase.asApplyExtrinsic.eqn(index)
|
||||
);
|
||||
return {
|
||||
events: allEvents.filter(({ phase }) =>
|
||||
phase.isApplyExtrinsic &&
|
||||
phase.asApplyExtrinsic.eqn(txIndex)
|
||||
),
|
||||
txIndex
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,5 +27,5 @@ export function filterEvents (txHash: H256, { block: { extrinsics, header } }: S
|
||||
l.warn(`block ${header.hash.toHex()}: Unable to find extrinsic ${txHash.toHex()} inside ${allHashes.join(', ')}`);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/rpc-core": "7.6.1",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-codec": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3"
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/rpc-core": "7.8.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-codec": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
|
||||
epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;
|
||||
};
|
||||
beefy: {
|
||||
/**
|
||||
* Returns hash of the latest BEEFY finalized block as seen by this client.
|
||||
**/
|
||||
getFinalizedHead: AugmentedRpc<() => Observable<H256>>;
|
||||
/**
|
||||
* Returns the block most recently finalized by BEEFY, alongside side its justification.
|
||||
**/
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/rpc-augment": "7.6.1",
|
||||
"@polkadot/rpc-provider": "7.6.1",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"rxjs": "^7.5.2"
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/rpc-augment": "7.8.1",
|
||||
"@polkadot/rpc-provider": "7.8.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1",
|
||||
"rxjs": "^7.5.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^8.3.3",
|
||||
"@polkadot/rpc-augment": "7.6.1"
|
||||
"@polkadot/keyring": "^8.4.1",
|
||||
"@polkadot/rpc-augment": "7.8.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/keyring": "^8.3.3",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-support": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"@polkadot/x-fetch": "^8.3.3",
|
||||
"@polkadot/x-global": "^8.3.3",
|
||||
"@polkadot/x-ws": "^8.3.3",
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/keyring": "^8.4.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-support": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1",
|
||||
"@polkadot/util-crypto": "^8.4.1",
|
||||
"@polkadot/x-fetch": "^8.4.1",
|
||||
"@polkadot/x-global": "^8.4.1",
|
||||
"@polkadot/x-ws": "^8.4.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"mock-socket": "^9.1.2",
|
||||
"nock": "^13.2.2"
|
||||
"nock": "^13.2.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,6 +108,7 @@ export class LRUCache {
|
||||
this.#refs.delete(this.#tail.key);
|
||||
|
||||
this.#tail = this.#tail.prev;
|
||||
this.#tail.next = this.#head;
|
||||
} else {
|
||||
this.#length += 1;
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
@@ -30,20 +30,20 @@
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.16.12",
|
||||
"@babel/register": "^7.16.9",
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api": "7.6.1",
|
||||
"@polkadot/api-augment": "7.6.1",
|
||||
"@polkadot/rpc-augment": "7.6.1",
|
||||
"@polkadot/rpc-provider": "7.6.1",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-augment": "7.6.1",
|
||||
"@polkadot/types-codec": "7.6.1",
|
||||
"@polkadot/types-create": "7.6.1",
|
||||
"@polkadot/types-support": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/x-ws": "^8.3.3",
|
||||
"@babel/core": "^7.17.2",
|
||||
"@babel/register": "^7.17.0",
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api": "7.8.1",
|
||||
"@polkadot/api-augment": "7.8.1",
|
||||
"@polkadot/rpc-augment": "7.8.1",
|
||||
"@polkadot/rpc-provider": "7.8.1",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-augment": "7.8.1",
|
||||
"@polkadot/types-codec": "7.8.1",
|
||||
"@polkadot/types-create": "7.8.1",
|
||||
"@polkadot/types-support": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1",
|
||||
"@polkadot/x-ws": "^8.4.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^17.3.1"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -183,7 +183,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
|
||||
},
|
||||
|
||||
[TypeDefInfo.Si]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return formatType(registry, definitions, (registry).lookup.getTypeDef(typeDef.type), imports, withShortcut);
|
||||
return formatType(registry, definitions, registry.lookup.getTypeDef(typeDef.type), imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Struct]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-codec": "7.6.1",
|
||||
"@polkadot/util": "^8.3.3"
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-codec": "7.8.1",
|
||||
"@polkadot/util": "^8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
export default {
|
||||
/**
|
||||
* Lookup74: kusama_runtime::ProxyType
|
||||
* Lookup75: kusama_runtime::ProxyType
|
||||
**/
|
||||
KusamaRuntimeProxyType: {
|
||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction']
|
||||
},
|
||||
/**
|
||||
* Lookup104: polkadot_runtime_parachains::disputes::pallet::Event<T>
|
||||
* Lookup105: polkadot_runtime_parachains::disputes::pallet::Event<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesPalletEvent: {
|
||||
_enum: {
|
||||
@@ -22,19 +22,19 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup106: polkadot_runtime_parachains::disputes::DisputeLocation
|
||||
* Lookup107: polkadot_runtime_parachains::disputes::DisputeLocation
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesDisputeLocation: {
|
||||
_enum: ['Local', 'Remote']
|
||||
},
|
||||
/**
|
||||
* Lookup107: polkadot_runtime_parachains::disputes::DisputeResult
|
||||
* Lookup108: polkadot_runtime_parachains::disputes::DisputeResult
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesDisputeResult: {
|
||||
_enum: ['Valid', 'Invalid']
|
||||
},
|
||||
/**
|
||||
* Lookup246: kusama_runtime::SessionKeys
|
||||
* Lookup248: kusama_runtime::SessionKeys
|
||||
**/
|
||||
KusamaRuntimeSessionKeys: {
|
||||
grandpa: 'SpFinalityGrandpaAppPublic',
|
||||
@@ -45,11 +45,11 @@ export default {
|
||||
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
|
||||
},
|
||||
/**
|
||||
* Lookup319: kusama_runtime::OriginCaller
|
||||
* Lookup321: kusama_runtime::OriginCaller
|
||||
**/
|
||||
KusamaRuntimeOriginCaller: {
|
||||
_enum: {
|
||||
system: 'FrameSystemRawOrigin',
|
||||
system: 'FrameSupportDispatchRawOrigin',
|
||||
__Unused1: 'Null',
|
||||
__Unused2: 'Null',
|
||||
__Unused3: 'Null',
|
||||
@@ -152,7 +152,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup384: kusama_runtime::NposCompactSolution24
|
||||
* Lookup386: kusama_runtime::NposCompactSolution24
|
||||
**/
|
||||
KusamaRuntimeNposCompactSolution24: {
|
||||
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
|
||||
@@ -181,13 +181,13 @@ export default {
|
||||
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
|
||||
},
|
||||
/**
|
||||
* Lookup504: polkadot_runtime_parachains::disputes::pallet::Call<T>
|
||||
* Lookup506: polkadot_runtime_parachains::disputes::pallet::Call<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesPalletCall: {
|
||||
_enum: ['force_unfreeze']
|
||||
},
|
||||
/**
|
||||
* Lookup697: polkadot_primitives::v1::DisputeState<N>
|
||||
* Lookup702: polkadot_primitives::v1::DisputeState<N>
|
||||
**/
|
||||
PolkadotPrimitivesV1DisputeState: {
|
||||
validatorsFor: 'BitVec',
|
||||
@@ -196,13 +196,13 @@ export default {
|
||||
concludedAt: 'Option<u32>'
|
||||
},
|
||||
/**
|
||||
* Lookup698: polkadot_runtime_parachains::disputes::pallet::Error<T>
|
||||
* Lookup703: polkadot_runtime_parachains::disputes::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsDisputesPalletError: {
|
||||
_enum: ['DuplicateDisputeStatementSets', 'AncientDisputeStatement', 'ValidatorIndexOutOfBounds', 'InvalidSignature', 'DuplicateStatement', 'PotentialSpam', 'SingleSidedDispute']
|
||||
},
|
||||
/**
|
||||
* Lookup733: kusama_runtime::Runtime
|
||||
* Lookup738: kusama_runtime::Runtime
|
||||
**/
|
||||
KusamaRuntimeRuntime: 'Null'
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ declare module '@polkadot/types/lookup' {
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { H256, PerU16 } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name KusamaRuntimeProxyType (74) */
|
||||
/** @name KusamaRuntimeProxyType (75) */
|
||||
export interface KusamaRuntimeProxyType extends Enum {
|
||||
readonly isAny: boolean;
|
||||
readonly isNonTransfer: boolean;
|
||||
@@ -18,7 +18,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletEvent (104) */
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletEvent (105) */
|
||||
export interface PolkadotRuntimeParachainsDisputesPalletEvent extends Enum {
|
||||
readonly isDisputeInitiated: boolean;
|
||||
readonly asDisputeInitiated: ITuple<[H256, PolkadotRuntimeParachainsDisputesDisputeLocation]>;
|
||||
@@ -31,21 +31,21 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'DisputeInitiated' | 'DisputeConcluded' | 'DisputeTimedOut' | 'Revert';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesDisputeLocation (106) */
|
||||
/** @name PolkadotRuntimeParachainsDisputesDisputeLocation (107) */
|
||||
export interface PolkadotRuntimeParachainsDisputesDisputeLocation extends Enum {
|
||||
readonly isLocal: boolean;
|
||||
readonly isRemote: boolean;
|
||||
readonly type: 'Local' | 'Remote';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesDisputeResult (107) */
|
||||
/** @name PolkadotRuntimeParachainsDisputesDisputeResult (108) */
|
||||
export interface PolkadotRuntimeParachainsDisputesDisputeResult extends Enum {
|
||||
readonly isValid: boolean;
|
||||
readonly isInvalid: boolean;
|
||||
readonly type: 'Valid' | 'Invalid';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeSessionKeys (246) */
|
||||
/** @name KusamaRuntimeSessionKeys (248) */
|
||||
export interface KusamaRuntimeSessionKeys extends Struct {
|
||||
readonly grandpa: SpFinalityGrandpaAppPublic;
|
||||
readonly babe: SpConsensusBabeAppPublic;
|
||||
@@ -55,10 +55,10 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeOriginCaller (319) */
|
||||
/** @name KusamaRuntimeOriginCaller (321) */
|
||||
export interface KusamaRuntimeOriginCaller extends Enum {
|
||||
readonly isSystem: boolean;
|
||||
readonly asSystem: FrameSystemRawOrigin;
|
||||
readonly asSystem: FrameSupportDispatchRawOrigin;
|
||||
readonly isVoid: boolean;
|
||||
readonly isCouncil: boolean;
|
||||
readonly asCouncil: PalletCollectiveRawOrigin;
|
||||
@@ -71,7 +71,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (384) */
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (386) */
|
||||
export interface KusamaRuntimeNposCompactSolution24 extends Struct {
|
||||
readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>;
|
||||
readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>;
|
||||
@@ -99,13 +99,13 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletCall (504) */
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletCall (506) */
|
||||
export interface PolkadotRuntimeParachainsDisputesPalletCall extends Enum {
|
||||
readonly isForceUnfreeze: boolean;
|
||||
readonly type: 'ForceUnfreeze';
|
||||
}
|
||||
|
||||
/** @name PolkadotPrimitivesV1DisputeState (697) */
|
||||
/** @name PolkadotPrimitivesV1DisputeState (702) */
|
||||
export interface PolkadotPrimitivesV1DisputeState extends Struct {
|
||||
readonly validatorsFor: BitVec;
|
||||
readonly validatorsAgainst: BitVec;
|
||||
@@ -113,7 +113,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly concludedAt: Option<u32>;
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletError (698) */
|
||||
/** @name PolkadotRuntimeParachainsDisputesPalletError (703) */
|
||||
export interface PolkadotRuntimeParachainsDisputesPalletError extends Enum {
|
||||
readonly isDuplicateDisputeStatementSets: boolean;
|
||||
readonly isAncientDisputeStatement: boolean;
|
||||
@@ -125,7 +125,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'DuplicateDisputeStatementSets' | 'AncientDisputeStatement' | 'ValidatorIndexOutOfBounds' | 'InvalidSignature' | 'DuplicateStatement' | 'PotentialSpam' | 'SingleSidedDispute';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeRuntime (733) */
|
||||
/** @name KusamaRuntimeRuntime (738) */
|
||||
export type KusamaRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '7.6.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '7.8.1' };
|
||||
|
||||
@@ -17,7 +17,7 @@ import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
|
||||
import type { StatementKind } from '@polkadot/types/interfaces/claims';
|
||||
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
|
||||
import type { AliveContractInfo, CodeHash, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateReturnValue, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { AliveContractInfo, CodeHash, CodeSource, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractInstantiateResultTo299, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateRequestV1, InstantiateRequestV2, InstantiateReturnValue, InstantiateReturnValueOk, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
|
||||
import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
|
||||
@@ -197,6 +197,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ClassMetadata: ClassMetadata;
|
||||
CodecHash: CodecHash;
|
||||
CodeHash: CodeHash;
|
||||
CodeSource: CodeSource;
|
||||
CodeUploadRequest: CodeUploadRequest;
|
||||
CodeUploadResult: CodeUploadResult;
|
||||
CodeUploadResultValue: CodeUploadResultValue;
|
||||
@@ -249,6 +250,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ContractInfo: ContractInfo;
|
||||
ContractInstantiateResult: ContractInstantiateResult;
|
||||
ContractInstantiateResultTo267: ContractInstantiateResultTo267;
|
||||
ContractInstantiateResultTo299: ContractInstantiateResultTo299;
|
||||
ContractLayoutArray: ContractLayoutArray;
|
||||
ContractLayoutCell: ContractLayoutCell;
|
||||
ContractLayoutEnum: ContractLayoutEnum;
|
||||
@@ -525,7 +527,10 @@ declare module '@polkadot/types/types/registry' {
|
||||
InstanceId: InstanceId;
|
||||
InstanceMetadata: InstanceMetadata;
|
||||
InstantiateRequest: InstantiateRequest;
|
||||
InstantiateRequestV1: InstantiateRequestV1;
|
||||
InstantiateRequestV2: InstantiateRequestV2;
|
||||
InstantiateReturnValue: InstantiateReturnValue;
|
||||
InstantiateReturnValueOk: InstantiateReturnValueOk;
|
||||
InstantiateReturnValueTo267: InstantiateReturnValueTo267;
|
||||
InstructionV2: InstructionV2;
|
||||
InstructionWeights: InstructionWeights;
|
||||
|
||||
@@ -20,16 +20,16 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.6.1",
|
||||
"version": "7.8.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/util": "^8.3.3"
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/util": "^8.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "7.6.1",
|
||||
"@polkadot/types-augment": "7.6.1",
|
||||
"@polkadot/types-support": "7.6.1",
|
||||
"@polkadot/util-crypto": "^8.3.3"
|
||||
"@polkadot/types": "7.8.1",
|
||||
"@polkadot/types-augment": "7.8.1",
|
||||
"@polkadot/types-support": "7.8.1",
|
||||
"@polkadot/util-crypto": "^8.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, IU8a, IVec, Registry } from '../types';
|
||||
import type { AnyJson, Codec, Inspect, IU8a, IVec, Registry } from '../types';
|
||||
|
||||
import { compactToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
@@ -78,6 +78,26 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
return compareArray(this, other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
return {
|
||||
inner: this.inspectInner(),
|
||||
outer: [compactToU8a(this.length)]
|
||||
};
|
||||
}
|
||||
|
||||
inspectInner (): Inspect[] {
|
||||
const inner = new Array<Inspect>(this.length);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
inner[i] = this[i].inspect();
|
||||
}
|
||||
|
||||
return inner;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Converts the Object to an standard JavaScript Array
|
||||
*/
|
||||
@@ -141,18 +161,21 @@ export abstract class AbstractArray<T extends Codec> extends Array<T> implements
|
||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||
*/
|
||||
public toU8a (isBare?: boolean): Uint8Array {
|
||||
const encoded = this.toU8aInner();
|
||||
|
||||
return isBare
|
||||
? u8aConcat(...encoded)
|
||||
: u8aConcat(compactToU8a(this.length), ...encoded);
|
||||
}
|
||||
|
||||
public toU8aInner (isBare?: boolean): Uint8Array[] {
|
||||
const encoded = new Array<Uint8Array>(this.length);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
encoded[i] = this[i].toU8a(isBare);
|
||||
}
|
||||
|
||||
return isBare
|
||||
? u8aConcat(...encoded)
|
||||
: u8aConcat(
|
||||
compactToU8a(this.length),
|
||||
...encoded
|
||||
);
|
||||
return encoded;
|
||||
}
|
||||
|
||||
// Below are methods that we override. When we do a `new Vec(...).map()`,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyNumber, INumber, IU8a, Registry, UIntBitLength } from '../types';
|
||||
import type { AnyNumber, Inspect, INumber, IU8a, Registry, UIntBitLength } from '../types';
|
||||
|
||||
import { assert, BN, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isBn, isHex, isNumber, isString, isU8a, u8aToBn } from '@polkadot/util';
|
||||
|
||||
@@ -122,6 +122,15 @@ export abstract class AbstractInt extends BN implements INumber {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
return {
|
||||
outer: [this.toU8a()]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description True if this value is the max of the type
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, BareOpts, Codec, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, BareOpts, Codec, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
/**
|
||||
* @name Base
|
||||
@@ -59,6 +59,13 @@ export abstract class Base<T extends Codec> implements Codec {
|
||||
return this.#raw.eq(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
return this.#raw.inspect();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
||||
*/
|
||||
|
||||
@@ -79,5 +79,13 @@ describe('Compact', (): void => {
|
||||
(new (Compact.with('u128'))(registry, 12345678987654321n).toBigInt() + 1n) === 12345678987654322n
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new (Compact.with(U32))(registry, 0xffff).inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([254, 255, 3, 0])]
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, AnyNumber, CodecClass, ICompact, INumber, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, AnyNumber, CodecClass, ICompact, Inspect, INumber, IU8a, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util';
|
||||
|
||||
@@ -100,6 +100,15 @@ export class Compact<T extends INumber> implements ICompact<T> {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
return {
|
||||
outer: [this.toU8a()]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a BigInt representation of the number
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, Codec, CodecClass, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
/**
|
||||
* @name DoNotConstruct
|
||||
@@ -56,6 +56,10 @@ export class DoNotConstruct implements Codec {
|
||||
throw this.#neverError;
|
||||
}
|
||||
|
||||
inspect (): Inspect {
|
||||
throw this.#neverError;
|
||||
}
|
||||
|
||||
toHex (): HexString {
|
||||
throw this.#neverError;
|
||||
}
|
||||
|
||||
@@ -289,6 +289,18 @@ describe('Enum', (): void => {
|
||||
expect(test.isNone).toBe(true);
|
||||
expect(test.index).toEqual(1);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new Enum(
|
||||
registry,
|
||||
{ Text, U32 },
|
||||
'0x0134120000'
|
||||
).inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([0x01]), new Uint8Array([0x34, 0x12, 0x00, 0x00])]
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, IEnum, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, Codec, CodecClass, IEnum, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, isHex, isNumber, isObject, isString, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -320,6 +320,22 @@ export class Enum implements IEnum {
|
||||
return this.value.eq(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
if (this.isBasic) {
|
||||
return { outer: [new Uint8Array([this.index])] };
|
||||
}
|
||||
|
||||
const { inner, outer = [] } = this.#raw.inspect();
|
||||
|
||||
return {
|
||||
inner,
|
||||
outer: [new Uint8Array([this.index]), ...outer]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value
|
||||
*/
|
||||
|
||||
@@ -52,6 +52,14 @@ describe('Int', (): void => {
|
||||
).toEqual(-123);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new Int(registry, '0x12', 16).inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([0x12, 0x00])]
|
||||
});
|
||||
});
|
||||
|
||||
describe('static with', (): void => {
|
||||
it('allows default toRawType', (): void => {
|
||||
expect(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { Codec, IU8a, Registry } from '../types';
|
||||
import type { Codec, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { isNull } from '@polkadot/util';
|
||||
|
||||
@@ -51,6 +51,13 @@ export class Null implements Codec {
|
||||
return other instanceof Null || isNull(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value
|
||||
*/
|
||||
|
||||
@@ -153,5 +153,13 @@ describe('Option', (): void => {
|
||||
it('unwrapOrDefault to specified if non-empty', (): void => {
|
||||
expect(new Option(registry, U32, '1234').unwrapOrDefault().toNumber()).toEqual(1234);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new Option(registry, U32, '1234').inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([0x01]), new Uint8Array([210, 4, 0, 0])]
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, IOption, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, Codec, CodecClass, Inspect, IOption, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, isCodec, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot/util';
|
||||
|
||||
@@ -137,6 +137,22 @@ export class Option<T extends Codec> implements IOption<T> {
|
||||
return this.value.eq(other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
if (this.isNone) {
|
||||
return { outer: [new Uint8Array([0])] };
|
||||
}
|
||||
|
||||
const { inner, outer = [] } = this.#raw.inspect();
|
||||
|
||||
return {
|
||||
inner,
|
||||
outer: [new Uint8Array([1]), ...outer]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value
|
||||
*/
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { AnyTupleValue, CodecTo } from '@polkadot/types-codec/types';
|
||||
import { Metadata, TypeRegistry } from '@polkadot/types';
|
||||
import { Text, Tuple, U32, U128 } from '@polkadot/types-codec';
|
||||
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
|
||||
import { stringToU8a } from '@polkadot/util';
|
||||
|
||||
describe('Tuple', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
@@ -119,6 +120,17 @@ describe('Tuple', (): void => {
|
||||
it('compares against inputs (mismatch)', (): void => {
|
||||
expect(tuple.eq(['bazzing', 72])).toBe(false);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
tuple.inspect()
|
||||
).toEqual({
|
||||
inner: [
|
||||
{ outer: [new Uint8Array([7 << 2]), stringToU8a('bazzing')] },
|
||||
{ outer: [new Uint8Array([69, 0, 0, 0])] }
|
||||
]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('toRawType', (): void => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AnyTupleValue, Codec, CodecClass, ITuple, Registry } from '../types';
|
||||
import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types';
|
||||
|
||||
import { isFunction, isHex, isString, isU8a, stringify, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -100,6 +100,15 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
|
||||
: Object.keys(this.#Types);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
override inspect (): Inspect {
|
||||
return {
|
||||
inner: this.inspectInner()
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
@@ -128,12 +137,6 @@ export class Tuple extends AbstractArray<Codec> implements ITuple<Codec[]> {
|
||||
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
||||
*/
|
||||
public override toU8a (isBare?: boolean): Uint8Array {
|
||||
const encoded = new Array<Uint8Array>(this.length);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
encoded[i] = this[i].toU8a(isBare);
|
||||
}
|
||||
|
||||
return u8aConcat(...encoded);
|
||||
return u8aConcat(...this.toU8aInner(isBare));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,6 +123,14 @@ describe('UInt', (): void => {
|
||||
expect(new UInt(registry, '0x1234567890abcdef', 64).toJSON()).toEqual('0x1234567890abcdef');
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new UInt(registry, '0x12', 16).inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([0x12, 0x00])]
|
||||
});
|
||||
});
|
||||
|
||||
describe('eq', (): void => {
|
||||
const test = new UInt(registry, 12345);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { Codec, CodecTo, ITuple } from '@polkadot/types-codec/types';
|
||||
import { createTypeUnsafe, GenericAccountId as AccountId, Metadata, TypeRegistry } from '@polkadot/types';
|
||||
import { Text, Vec } from '@polkadot/types-codec';
|
||||
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
|
||||
import { randomAsU8a } from '@polkadot/util-crypto';
|
||||
import { decodeAddress, randomAsU8a } from '@polkadot/util-crypto';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
const metadata = new Metadata(registry, rpcMetadata);
|
||||
@@ -175,5 +175,19 @@ describe('Vec', (): void => {
|
||||
expect(vec).toHaveLength(10);
|
||||
expect(vec.slice(2, 7)).toHaveLength(5);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
const addrs = [
|
||||
'5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw', '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty', '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'
|
||||
];
|
||||
const vec = registry.createType('Vec<AccountId>', addrs);
|
||||
|
||||
expect(vec.inspect()).toEqual({
|
||||
inner: addrs.map((a) => ({
|
||||
outer: [decodeAddress(a)]
|
||||
})),
|
||||
outer: [new Uint8Array([3 << 2])]
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { Text, u16, VecFixed } from '@polkadot/types-codec';
|
||||
import { stringToU8a } from '@polkadot/util';
|
||||
|
||||
describe('VecFixed', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
@@ -33,7 +34,7 @@ describe('VecFixed', (): void => {
|
||||
let test: VecFixed<Text>;
|
||||
|
||||
beforeEach((): void => {
|
||||
test = new (VecFixed.with(Text, 5))(registry, ['1', '2', '3', undefined, '5']);
|
||||
test = new (VecFixed.with(Text, 5))(registry, ['1', '2', '3', undefined, '56']);
|
||||
});
|
||||
|
||||
it('has a sane string types', (): void => {
|
||||
@@ -43,7 +44,7 @@ describe('VecFixed', (): void => {
|
||||
|
||||
it('has a correct toHex', (): void => {
|
||||
// each entry length 1 << 2, char as hex (0x31 === `1`), one empty
|
||||
expect(test.toHex()).toEqual('0x043104320433000435');
|
||||
expect(test.toHex()).toEqual('0x04310432043300083536');
|
||||
});
|
||||
|
||||
it('has empty Uint8Array when length is 0', (): void => {
|
||||
@@ -59,5 +60,17 @@ describe('VecFixed', (): void => {
|
||||
expect(test.encodedLength).toEqual(1 + 5);
|
||||
expect(test.toU8a()).toEqual(new Uint8Array([20, 104, 101, 108, 108, 111]));
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(test.inspect()).toEqual({
|
||||
inner: [
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('1')] },
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('2')] },
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('3')] },
|
||||
{ outer: [new Uint8Array([0])] },
|
||||
{ outer: [new Uint8Array([2 << 2]), stringToU8a('56')] }
|
||||
]
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { Codec, CodecClass, Registry } from '../types';
|
||||
import type { Codec, CodecClass, Inspect, Registry } from '../types';
|
||||
|
||||
import { assert, isU8a, u8aConcat } from '@polkadot/util';
|
||||
|
||||
@@ -70,14 +70,19 @@ export class VecFixed<T extends Codec> extends AbstractArray<T> {
|
||||
return total;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
override inspect (): Inspect {
|
||||
return {
|
||||
inner: this.inspectInner()
|
||||
};
|
||||
}
|
||||
|
||||
public override toU8a (): Uint8Array {
|
||||
// we override, we don't add the length prefix for ourselves, and at the same time we
|
||||
// ignore isBare on entries, since they should be properly encoded at all times
|
||||
const encoded = new Array<Uint8Array>(this.length);
|
||||
|
||||
for (let i = 0; i < this.length; i++) {
|
||||
encoded[i] = this[i].toU8a();
|
||||
}
|
||||
const encoded = this.toU8aInner();
|
||||
|
||||
return encoded.length
|
||||
? u8aConcat(...encoded)
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { CodecClass, ITuple } from '@polkadot/types-codec/types';
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { BTreeMap, Enum, I32, Struct, Text, Tuple, U32 } from '@polkadot/types-codec';
|
||||
import { stringToU8a } from '@polkadot/util';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -187,4 +188,24 @@ describe('BTreeMap', (): void => {
|
||||
expect(new (BTreeMap.with(Text, Struct.with({ a: U32, b: Text })))(registry).toRawType())
|
||||
.toBe('BTreeMap<Text,{"a":"u32","b":"Text"}>');
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new (BTreeMap.with(Text, Text))(registry, new Map([
|
||||
[new Text(registry, '1'), new Text(registry, 'foo')],
|
||||
[new Text(registry, '2'), new Text(registry, 'bar')],
|
||||
[new Text(registry, '3'), new Text(registry, 'baz')]
|
||||
])).inspect()
|
||||
).toEqual({
|
||||
inner: [
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('1')] },
|
||||
{ outer: [new Uint8Array([3 << 2]), stringToU8a('foo')] },
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('2')] },
|
||||
{ outer: [new Uint8Array([3 << 2]), stringToU8a('bar')] },
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('3')] },
|
||||
{ outer: [new Uint8Array([3 << 2]), stringToU8a('baz')] }
|
||||
],
|
||||
outer: [new Uint8Array([3 << 2])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -180,4 +180,18 @@ describe('BTreeSet', (): void => {
|
||||
expect(new (BTreeSet.with(Struct.with({ a: U32, b: Text })))(registry).toRawType())
|
||||
.toBe('BTreeSet<{"a":"u32","b":"Text"}>');
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new (BTreeSet.with(U32))(registry, [1, 2, 3, 4]).inspect()
|
||||
).toEqual({
|
||||
inner: [
|
||||
{ outer: [new Uint8Array([1, 0, 0, 0])] },
|
||||
{ outer: [new Uint8Array([2, 0, 0, 0])] },
|
||||
{ outer: [new Uint8Array([3, 0, 0, 0])] },
|
||||
{ outer: [new Uint8Array([4, 0, 0, 0])] }
|
||||
],
|
||||
outer: [new Uint8Array([4 << 2])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, ISet, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, Codec, CodecClass, Inspect, ISet, IU8a, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isHex, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -138,6 +138,22 @@ export class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V>
|
||||
return compareSet(this, other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
const inner = new Array<Inspect>();
|
||||
|
||||
for (const v of this.values()) {
|
||||
inner.push(v.inspect());
|
||||
}
|
||||
|
||||
return {
|
||||
inner,
|
||||
outer: [compactToU8a(this.size)]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
||||
*/
|
||||
|
||||
@@ -21,12 +21,19 @@ describe('BitVec', (): void => {
|
||||
).toEqual((test.length - 2) / 2);
|
||||
});
|
||||
|
||||
// FIXME These do not align at all
|
||||
it.skip('re-encodes to the same input value', (): void => {
|
||||
it('re-encodes to the same input value', (): void => {
|
||||
expect(
|
||||
new BitVec(registry, input).toU8a()
|
||||
).toEqual(input);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new BitVec(registry, '0x0837').inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([0]), new Uint8Array([0x08, 0x37])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AnyU8a, Registry } from '../types';
|
||||
import type { AnyU8a, Inspect, Registry } from '../types';
|
||||
|
||||
import { assert, compactFromU8a, compactToU8a, isString, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -57,6 +57,15 @@ export class BitVec extends Raw {
|
||||
return this.length + compactToU8a(this.#decodedLength).length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
override inspect (): Inspect {
|
||||
return {
|
||||
outer: [compactToU8a(this.#decodedLength), super.toU8a()]
|
||||
};
|
||||
}
|
||||
|
||||
public override toHuman (): string {
|
||||
return `0b${[...this.toU8a(true)].map((d) => `00000000${d.toString(2)}`.slice(-8)).join('_')}`;
|
||||
}
|
||||
|
||||
@@ -62,4 +62,12 @@ describe('Bytes', (): void => {
|
||||
).toEqual(HEX);
|
||||
});
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new Bytes(registry, '0x12345678').inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([4 << 2]), new Uint8Array([0x12, 0x34, 0x56, 0x78])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AnyU8a, Registry } from '../types';
|
||||
import type { AnyU8a, Inspect, Registry } from '../types';
|
||||
|
||||
import { assert, compactAddLength, compactFromU8a, compactToU8a, isString, isU8a, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -60,6 +60,19 @@ export class Bytes extends Raw {
|
||||
return this.length + compactToU8a(this.length).length;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
override inspect (): Inspect {
|
||||
const clength = compactToU8a(this.length);
|
||||
|
||||
return {
|
||||
outer: this.length
|
||||
? [clength, super.toU8a()]
|
||||
: [clength]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the base runtime type name for this instance
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { HashMap, Struct, Text, U32 } from '@polkadot/types-codec';
|
||||
import { stringToU8a } from '@polkadot/util';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
@@ -13,4 +14,21 @@ describe('HashMap', (): void => {
|
||||
expect(new (HashMap.with(Text, Struct.with({ a: U32, b: Text })))(registry).toRawType())
|
||||
.toBe('HashMap<Text,{"a":"u32","b":"Text"}>');
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new (HashMap.with(Text, Text))(registry, new Map([
|
||||
[new Text(registry, '1'), new Text(registry, 'foo')],
|
||||
[new Text(registry, '2'), new Text(registry, 'bar')]
|
||||
])).inspect()
|
||||
).toEqual({
|
||||
inner: [
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('1')] },
|
||||
{ outer: [new Uint8Array([3 << 2]), stringToU8a('foo')] },
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('2')] },
|
||||
{ outer: [new Uint8Array([3 << 2]), stringToU8a('bar')] }
|
||||
],
|
||||
outer: [new Uint8Array([2 << 2])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ import type { CodecTo } from '@polkadot/types-codec/types';
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { CodecMap, Text, U32 } from '@polkadot/types-codec';
|
||||
import { stringToU8a } from '@polkadot/util';
|
||||
|
||||
const registry = new TypeRegistry();
|
||||
const mockU32TextMap = new Map<Text, U32>();
|
||||
@@ -60,7 +61,7 @@ describe('CodecMap', (): void => {
|
||||
testEncode('toString', mockU32TextMapString);
|
||||
});
|
||||
|
||||
describe('encoding muple values', (): void => {
|
||||
describe('encoding multiple values', (): void => {
|
||||
const testEncode = (to: CodecTo, expected: any): void =>
|
||||
it(`can encode ${to}`, (): void => {
|
||||
const s = new CodecMap(registry, Text, U32, mockU32U32Map, 'BTreeMap');
|
||||
@@ -73,4 +74,21 @@ describe('CodecMap', (): void => {
|
||||
testEncode('toU8a', mockU32U32MapUint8Array);
|
||||
testEncode('toString', mockU32U32MapString);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new CodecMap(registry, Text, Text, new Map([
|
||||
[new Text(registry, '1'), new Text(registry, 'foo')],
|
||||
[new Text(registry, '2'), new Text(registry, 'bar')]
|
||||
])).inspect()
|
||||
).toEqual({
|
||||
inner: [
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('1')] },
|
||||
{ outer: [new Uint8Array([3 << 2]), stringToU8a('foo')] },
|
||||
{ outer: [new Uint8Array([1 << 2]), stringToU8a('2')] },
|
||||
{ outer: [new Uint8Array([3 << 2]), stringToU8a('bar')] }
|
||||
],
|
||||
outer: [new Uint8Array([2 << 2])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, IMap, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, Codec, CodecClass, IMap, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -125,7 +125,7 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
|
||||
let len = compactToU8a(this.size).length;
|
||||
|
||||
for (const [k, v] of this.entries()) {
|
||||
len += v.encodedLength + k.encodedLength;
|
||||
len += k.encodedLength + v.encodedLength;
|
||||
}
|
||||
|
||||
return len;
|
||||
@@ -152,6 +152,23 @@ export class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends
|
||||
return compareMap(this, other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
const inner = new Array<Inspect>();
|
||||
|
||||
for (const [k, v] of this.entries()) {
|
||||
inner.push(k.inspect());
|
||||
inner.push(v.inspect());
|
||||
}
|
||||
|
||||
return {
|
||||
inner,
|
||||
outer: [compactToU8a(this.size)]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
||||
*/
|
||||
|
||||
@@ -28,4 +28,13 @@ describe('Range', (): void => {
|
||||
it('has a sane toRawType representation', (): void => {
|
||||
expect(range.toRawType()).toEqual('Range<u32>');
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(range.inspect()).toEqual({
|
||||
inner: [
|
||||
{ outer: [new Uint8Array([1, 0, 0, 0])] },
|
||||
{ outer: [new Uint8Array([2, 0, 0, 0])] }
|
||||
]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -58,9 +58,15 @@ describe('U8aFixed', (): void => {
|
||||
).toEqual(new Uint8Array([1, 2, 3, 4]));
|
||||
});
|
||||
|
||||
it('hash a sane toRawType', (): void => {
|
||||
it('has a sane toRawType', (): void => {
|
||||
expect(u8a.toRawType()).toEqual('[u8;4]');
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(u8a.inspect()).toEqual({
|
||||
outer: [new Uint8Array([1, 2, 3, 4])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('static with', (): void => {
|
||||
|
||||
@@ -49,4 +49,21 @@ describe('WrapperKeepOpaque', (): void => {
|
||||
|
||||
expect(u32.unwrap().toNumber()).toEqual(1234567);
|
||||
});
|
||||
|
||||
it('has a sane inspect (non-decodable)', (): void => {
|
||||
expect(
|
||||
new ClazzUSize(registry, u8au32).inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([4 << 2]), new Uint8Array([0x87, 0xd6, 0x12, 0x00])]
|
||||
});
|
||||
});
|
||||
|
||||
it('has a sane inspect (decodable)', (): void => {
|
||||
expect(
|
||||
new ClazzU32(registry, u8au32).inspect()
|
||||
).toEqual({
|
||||
inner: [{ outer: [new Uint8Array([0x87, 0xd6, 0x12, 0x00])] }],
|
||||
outer: [new Uint8Array([4 << 2])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AnyJson, AnyU8a, Codec, CodecClass, Registry } from '../types';
|
||||
import type { AnyJson, AnyU8a, Codec, CodecClass, Inspect, Registry } from '../types';
|
||||
|
||||
import { assertReturn, compactAddLength, compactStripLength, isHex, isU8a } from '@polkadot/util';
|
||||
import { assertReturn, compactAddLength, compactStripLength, compactToU8a, isHex, isU8a } from '@polkadot/util';
|
||||
|
||||
import { Raw } from '../native/Raw';
|
||||
import { typeToConstructor } from '../utils';
|
||||
@@ -63,6 +63,20 @@ export class WrapperKeepOpaque<T extends Codec> extends Bytes {
|
||||
return !!this.#decoded;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
override inspect (): Inspect {
|
||||
return this.#decoded
|
||||
? {
|
||||
inner: [this.#decoded.inspect()],
|
||||
outer: [compactToU8a(this.length)]
|
||||
}
|
||||
: {
|
||||
outer: [compactToU8a(this.length), this.toU8a(true)]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
||||
*/
|
||||
|
||||
@@ -44,4 +44,13 @@ describe('WrapperOpaque', (): void => {
|
||||
new WrapperOpaque(registry, 'u32').toRawType()
|
||||
).toEqual('WrapperOpaque<u32>');
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new WrapperOpaque(registry, 'u32', '0x12345678').inspect()
|
||||
).toEqual({
|
||||
inner: [{ outer: [new Uint8Array([0x78, 0x56, 0x34, 0x12])] }],
|
||||
outer: [new Uint8Array([4 << 2])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -62,5 +62,11 @@ describe('Bool', (): void => {
|
||||
expect(new Bool(registry, false).isEmpty).toBe(true);
|
||||
expect(new Bool(registry, true).isEmpty).toBe(false);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(new Bool(registry, true).inspect()).toEqual({
|
||||
outer: [new Uint8Array([1])]
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { Codec, IU8a, Registry } from '../types';
|
||||
import type { Codec, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { isU8a, u8aToHex } from '@polkadot/util';
|
||||
|
||||
@@ -81,6 +81,15 @@ export class bool extends Boolean implements Codec {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
return {
|
||||
outer: [this.toU8a()]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value
|
||||
*/
|
||||
|
||||
@@ -73,5 +73,11 @@ describe('Date', (): void => {
|
||||
it('compares values (non-match)', (): void => {
|
||||
expect(new CodecDate(registry, 123).eq(456)).toBe(false);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(new CodecDate(registry, 3).inspect()).toEqual({
|
||||
outer: [new Uint8Array([3, 0, 0, 0, 0, 0, 0, 0])]
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyNumber, INumber, IU8a, Registry, UIntBitLength } from '../types';
|
||||
import type { AnyNumber, Inspect, INumber, IU8a, Registry, UIntBitLength } from '../types';
|
||||
|
||||
import { BN, bnToBn, bnToHex, bnToU8a, isString, isU8a, u8aToBn } from '@polkadot/util';
|
||||
|
||||
@@ -64,6 +64,13 @@ export class CodecDate extends Date implements INumber {
|
||||
return this.getTime() === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the number of bits in the value
|
||||
*/
|
||||
public bitLength (): UIntBitLength {
|
||||
return BITLENGTH;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Compares the value of the input to see if there is a match
|
||||
*/
|
||||
@@ -72,10 +79,12 @@ export class CodecDate extends Date implements INumber {
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the number of bits in the value
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
public bitLength (): UIntBitLength {
|
||||
return BITLENGTH;
|
||||
inspect (): Inspect {
|
||||
return {
|
||||
outer: [this.toU8a()]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, Codec, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { isFunction, objectProperties, stringify } from '@polkadot/util';
|
||||
|
||||
@@ -68,6 +68,13 @@ export class Json extends Map<string, any> implements Codec {
|
||||
return this.get(key) as unknown as T;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Unimplemented, will throw
|
||||
*/
|
||||
public inspect (): Inspect {
|
||||
throw new Error('Unimplemented');
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Unimplemented, will throw
|
||||
*/
|
||||
|
||||
@@ -89,5 +89,13 @@ describe('Raw', (): void => {
|
||||
() => new Raw(registry, '0x7f07b1f87709608bee603bbc79a0dfc29cd315c1351a83aa31adf7458d7d3003').toUtf8()
|
||||
).toThrow(/The character sequence is not a valid Utf8 string/);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new Raw(registry, [1, 2, 3, 4, 5]).inspect()
|
||||
).toEqual({
|
||||
outer: [new Uint8Array([1, 2, 3, 4, 5])]
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, AnyU8a, IU8a, Registry } from '../types';
|
||||
import type { AnyJson, AnyU8a, Inspect, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, isAscii, isUndefined, isUtf8, u8aToHex, u8aToString, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -91,6 +91,15 @@ export class Raw extends Uint8Array implements IU8a {
|
||||
return this.eq(u8aToU8a(other as string));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
return {
|
||||
outer: [this.toU8a()]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Create a new slice from the actual buffer. (compat)
|
||||
* @param start The position to start at
|
||||
|
||||
@@ -95,6 +95,12 @@ describe('Set', (): void => {
|
||||
set.eq('full')
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(set.inspect()).toEqual({
|
||||
outer: [new Uint8Array([SET_ROLES.full | SET_ROLES.authority])]
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('has a sane toRawType representation', (): void => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { CodecClass, ISet, IU8a, Registry } from '../types';
|
||||
import type { CodecClass, Inspect, ISet, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, BN, bnToBn, bnToU8a, isBn, isNumber, isString, isU8a, isUndefined, objectProperties, stringify, stringPascalCase, u8aToBn, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -184,6 +184,15 @@ export class CodecSet extends Set<string> implements ISet<string> {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a breakdown of the hex encoding for this Codec
|
||||
*/
|
||||
inspect (): Inspect {
|
||||
return {
|
||||
outer: [this.toU8a()]
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns a hex string representation of the value
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user