Compare commits

..
48 Commits
Author SHA1 Message Date
github-actions[bot] b9805cdc94 [CI Skip] release/stable 10.0.1
skip-checks: true
2023-03-05 08:50:27 +00:00
Jaco feb36d43a4 10.0.1 (#5518)
* 10.0.1

* Drop extra websocket dep

* Drop extra babel deps
2023-03-05 10:30:54 +02:00
github-actions[bot] 92c88d7c13 [CI Skip] bump/beta 9.14.3-11-x
skip-checks: true
2023-03-04 15:33:05 +00:00
Jaco 033fc4f480 Adjust x-ws usage (#5511) 2023-03-04 17:13:41 +02:00
Jaco 4ca9670e4e Bump deps (#5517)
* Bump deps

* Bump dev
2023-03-04 16:52:54 +02:00
github-actions[bot] 8fee66c0fa [CI Skip] bump/beta 9.14.3-10-x
skip-checks: true
2023-03-03 11:01:16 +00:00
Jaco 9a3b5d7a2c Ensure that provider disconnect clears all subscriptions (#5516)
* Ensure that provider disconnect clears all subscriptions

* Update CHANGELOG
2023-03-03 12:53:08 +02:00
github-actions[bot] f166431b02 [CI Skip] bump/beta 9.14.3-9-x
skip-checks: true
2023-03-03 09:32:25 +00:00
Jaco 088fdc6171 Bump dev & update gh workflows (#5515) 2023-03-03 11:24:27 +02:00
github-actions[bot] 910c77fd39 [CI Skip] bump/beta 9.14.3-8-x
skip-checks: true
2023-03-03 06:32:46 +00:00
Julien dacf2875b7 General WsProvider extensibility improvements (#5467)
* Make endpoints index selection extensible

* Expose endpoint

* Ensure events happen last

* Added endpoint stats
2023-03-03 08:23:25 +02:00
github-actions[bot] cbcc79972a [CI Skip] bump/beta 9.14.3-7-x
skip-checks: true
2023-03-01 11:24:48 +00:00
Jaco 0faddf1df6 Remove done callback usage from it(...) (#5514)
* Remove done callback usage from it(...)

* Bump deps

* continue-on-error: true
2023-03-01 13:13:38 +02:00
github-actions[bot] 697c8b8e7a [CI Skip] bump/beta 9.14.3-6-x
skip-checks: true
2023-02-28 09:01:36 +00:00
Jaco 99403b8246 Adjust loading of user-specified metadata (#5513) 2023-02-28 10:53:37 +02:00
github-actions[bot] 4b7e1003e0 [CI Skip] bump/beta 9.14.3-5-x
skip-checks: true
2023-02-27 15:02:40 +00:00
Jaco 5fd6d39aed Replace require(...) with import(...) in typegen (#5495)
* Replace require(...) with import(...) in typegen

* Update metadata

* Adjust & actual run

* Bump API

* Rebuild

* Bump build
2023-02-27 16:54:06 +02:00
github-actions[bot] cedb1afe6f [CI Skip] bump/beta 9.14.3-4-x
skip-checks: true
2023-02-27 09:48:05 +00:00
Jaco 4bff8e5158 Bump dev deps (#5510)
* Bump dev deps

* Bump dev
2023-02-27 11:39:47 +02:00
github-actions[bot] 474aedde34 [CI Skip] bump/beta 9.14.3-3-x
skip-checks: true
2023-02-25 09:56:39 +00:00
Jaco a8d7566186 Adjust tests for node:test env (#5509) 2023-02-25 11:48:26 +02:00
github-actions[bot] beb7b54e4a [CI Skip] bump/beta 9.14.3-2-x
skip-checks: true
2023-02-24 15:56:28 +00:00
Andreea Eftene d08cc74aad add type overrides (#5506) 2023-02-24 17:46:07 +02:00
github-actions[bot] 27e4279c55 [CI Skip] bump/beta 9.14.3-1-x
skip-checks: true
2023-02-22 07:26:08 +00:00
Jaco 6cd2f3b386 Bump deps (#5505)
* Bump deps

* Bump dev
2023-02-22 09:14:43 +02:00
github-actions[bot] 472c971c5b [CI Skip] bump/beta 9.14.3-0-x
skip-checks: true
2023-02-20 15:45:24 +00:00
Jaco d8756455c2 Bump dev deps (#5502) 2023-02-20 17:37:11 +02:00
github-actions[bot] 5aae48cc28 [CI Skip] release/stable 9.14.2
skip-checks: true
2023-02-19 11:19:41 +00:00
Jaco 4ab3b55383 9.14.2 (#5500) 2023-02-19 13:10:43 +02:00
github-actions[bot] 6ea6b90e03 [CI Skip] bump/beta 9.14.2-8-x
skip-checks: true
2023-02-19 10:45:23 +00:00
Jaco eb5c888cb8 Update metadata (#5499)
* Updata metadata

* Rebuild

* Adjust generation
2023-02-19 12:36:41 +02:00
github-actions[bot] cda07dfa0b [CI Skip] bump/beta 9.14.2-7-x
skip-checks: true
2023-02-18 10:50:26 +00:00
Jaco 4abae3200b Remove extraneous jest.mock usage (unused, no impact) (#5498) 2023-02-18 12:42:11 +02:00
github-actions[bot] b60895beb4 [CI Skip] bump/beta 9.14.2-6-x
skip-checks: true
2023-02-18 07:58:29 +00:00
Jaco 855d70a3b3 Remove __dirname usage in typegen (#5496) 2023-02-18 09:48:07 +02:00
github-actions[bot] 583d9bfe36 [CI Skip] bump/beta 9.14.2-5-x
skip-checks: true
2023-02-17 18:30:43 +00:00
Jaco d519611a25 Adjust test expectations (#5494) 2023-02-17 20:22:12 +02:00
github-actions[bot] 9a9bace8e8 [CI Skip] bump/beta 9.14.2-4-x
skip-checks: true
2023-02-17 10:08:40 +00:00
Jaco 40810f2fdb Cleanup tests (& fix ws.connect()) (#5493)
* Cleanup tests (& fix ws.connect())

* Await mock

* Adjust sc connect ordering
2023-02-17 11:57:34 +02:00
github-actions[bot] 361a77580e [CI Skip] bump/beta 9.14.2-3-x
skip-checks: true
2023-02-17 06:29:52 +00:00
Jaco ea45c7e689 Remove __dirname usages in tests (#5492) 2023-02-17 08:20:29 +02:00
github-actions[bot] cc1d51a6ca [CI Skip] bump/beta 9.14.2-2-x
skip-checks: true
2023-02-16 19:18:36 +00:00
Jaco b8233fb7b8 Adjust test expectations (#5490) 2023-02-16 21:10:17 +02:00
github-actions[bot] 5cbe80066d [CI Skip] bump/beta 9.14.2-1-x
skip-checks: true
2023-02-15 10:07:50 +00:00
Jaco 3f6c10256c Bump deps (#5486) 2023-02-15 11:56:46 +02:00
github-actions[bot] 609b2830b0 [CI Skip] bump/beta 9.14.2-0-x
skip-checks: true
2023-02-15 07:26:32 +00:00
Jaco b7bbd2d615 Fix CI release workflow (#5485) 2023-02-15 09:16:35 +02:00
Jaco 41d6429782 Use latest LTS for CI scripts (#5482) 2023-02-14 10:49:33 +02:00
227 changed files with 12325 additions and 14539 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
steps:
- uses: jacogr/action-merge@d2d64b4545acd93b0a9575177d3d215ae3f92029
with:
checks: build,lint,test
checks: pr (build),pr (lint),pr (test)
labels: -auto
strategy: squash
token: ${{ secrets.GH_PAT_BOT }}
+6 -3
View File
@@ -3,16 +3,19 @@ on: [pull_request]
jobs:
pr:
continue-on-error: true
strategy:
matrix:
step: ['lint', 'test', 'build', 'deno']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- uses: denoland/setup-deno@004814556e37c54a2f6e31384c9e18e983317366
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- uses: denoland/setup-deno@v1
with:
deno-version: vx.x.x
- name: ${{ matrix.step }}
+4 -2
View File
@@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
step: ['build:release']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
@@ -19,10 +18,13 @@ jobs:
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT_BOT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT_BOT }}
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: ${{ matrix.step }}
run: |
yarn install --immutable | grep -v 'YN0013'
+25
View File
@@ -1,5 +1,30 @@
# CHANGELOG
## 10.0.1 Mar 4, 2023
Contributed:
- Expose per-endpoint stats for providers (Thanks to https://github.com/jeluard)
- Adjust ink! primitive extraction for v4 (Thanks to https://github.com/statictype)
Changes:
- Ensure that provider disconnect clears all subscriptions
- Adjust typegen to internally use `import()` (catering for ESM provided types)
- Swap TS -> JS compiler to use tsc (from babel)
- Adjust all tests to use `node:test` runner (ESM variants)
- Update to latest Polkadot, Kusama & Substrate metadata
## 9.14.2 Feb 19, 2023
Changes:
- Don't allow `WsProvider.connect()` on an open connection (creates resource leaks)
- Adjust typegen to use metadata-defined aliases in query return decoration
- Update to latest Polkadot, Kusama & Substrate metadata
## 9.14.1 Feb 12, 2023
Changes:
+3 -3
View File
@@ -1,4 +1,4 @@
3363 Jaco 9.14.1 (#5481)
3386 Jaco 10.0.1 (#5518)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709)
@@ -10,16 +10,16 @@
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
5 Chevdor Fix metadata package link (#3458)
5 Jake Naviasky Fixing approvalFlagsToBools. (#1250)
5 Julien Eluard General WsProvider extensibility improvements (#5467)
4 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
4 Alex Wang fix issue that creates duplicate providers (#983)
4 Alexander Popiak Add asset id in signing (#4009)
4 Andreea Eftene add type overrides (#5506)
4 Joshy Orndorff spelling; efect -> effect (#2295)
4 Julien Eluard Clarified WsProvider constructor parameters documentation (#5404)
4 Nantian fix bigint type (#3869)
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
4 Thibaut Sardan no subscription for http (#3127)
3 André Silva add support for ValidationCodeHash (#3640)
3 Andreea Eftene Fix code source type (#5236)
3 Antoine Estienne Adapted to display moonbeam author (#3108)
3 Arjan Zijderveld Added `Emergency` to `ElectionPhase` (#3707)
3 Ewa Kowalska Handle no council for bounties proposals (#3062)
-19
View File
@@ -1,19 +0,0 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
const config = require('@polkadot/dev/config/jest.cjs');
module.exports = {
...config,
moduleNameMapper: {
'@polkadot/api-(augment|base|contract|derive)(.*)$': '<rootDir>/packages/api-$1/src/$2',
// eslint-disable-next-line sort-keys
'@polkadot/api(.*)$': '<rootDir>/packages/api/src/$1',
'@polkadot/rpc-(augment|core|provider)(.*)$': '<rootDir>/packages/rpc-$1/src/$2',
'@polkadot/typegen(.*)$': '<rootDir>/packages/typegen/src/$1',
'@polkadot/types-(augment|codec|create|known|support)(.*)$': '<rootDir>/packages/types-$1/src/$2',
// eslint-disable-next-line sort-keys
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
},
testTimeout: 30000
};
+15 -15
View File
@@ -11,38 +11,38 @@
},
"sideEffects": false,
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"versions": {
"git": "9.14.1",
"npm": "9.14.1"
"git": "10.0.1",
"npm": "10.0.1"
},
"workspaces": [
"packages/*"
],
"scripts": {
"build": "yarn build:interfaces && polkadot-dev-build-ts",
"build:extra": "(cd packages/typegen && copyfiles scripts/* build)",
"build:interfaces": "polkadot-types-internal-interfaces",
"build:metadata": "yarn build:interfaces && yarn test:one packages/types/src/metadata/v14",
"build:extra": "(cd packages/typegen && polkadot-dev-copy-dir scripts build/scripts)",
"build:interfaces": "node --loader @polkadot/dev/node/ts packages/typegen/scripts/polkadot-types-internal-interfaces.mjs",
"build:metadata": "yarn build:interfaces && polkadot-dev-run-test packages/types/src/metadata/v14",
"build:release": "polkadot-ci-ghact-build",
"build:rollup": "polkadot-exec-rollup --config",
"build:upgrades": "yarn test:one packages/types-known/src/upgrades/e2e",
"build:upgrades": "polkadot-dev-run-test upgrades/e2e",
"chain:info": "polkadot-types-chain-info",
"clean": "polkadot-dev-clean-build",
"deno": "yarn polkadot-dev-deno-map && yarn build && deno check --import-map=import_map.json mod.ts",
"lint": "polkadot-dev-run-lint",
"postinstall": "polkadot-dev-yarn-only",
"test": "NODE_OPTIONS=--experimental-vm-modules polkadot-dev-run-test --coverage --forceExit --runInBand --testPathIgnorePatterns e2e",
"test:one": "NODE_OPTIONS=--experimental-vm-modules polkadot-dev-run-test --detectOpenHandles --forceExit"
"test": "polkadot-dev-run-test --env node ^e2e",
"test:node": "polkadot-dev-run-test --env node ^e2e",
"test:one": "polkadot-dev-run-test --env node"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/register": "^7.18.9",
"@babel/runtime": "^7.20.13",
"@polkadot/dev": "^0.68.20",
"@babel/core": "^7.21.0",
"@babel/register": "^7.21.0",
"@babel/runtime": "^7.21.0",
"@polkadot/dev": "^0.69.27",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^29.4.0",
"copyfiles": "^2.4.1"
"@types/node": "^18.14.5"
},
"resolutions": {
"typescript": "^4.9.5"
+8 -8
View File
@@ -20,15 +20,15 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/api-base": "9.14.1",
"@polkadot/rpc-augment": "9.14.1",
"@polkadot/types": "9.14.1",
"@polkadot/types-augment": "9.14.1",
"@polkadot/types-codec": "9.14.1",
"@polkadot/util": "^10.4.1"
"@polkadot/api-base": "10.0.1",
"@polkadot/rpc-augment": "10.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/types-augment": "10.0.1",
"@polkadot/types-codec": "10.0.1",
"@polkadot/util": "^11.0.1",
"tslib": "^2.5.0"
}
}
@@ -1120,6 +1120,10 @@ declare module '@polkadot/api-base/types/errors' {
* pool at a time.
**/
AccountBelongsToOtherPool: AugmentedError<ApiType>;
/**
* Bonding extra is restricted to the exact pending reward amount.
**/
BondExtraRestricted: AugmentedError<ApiType>;
/**
* The pools state cannot be changed.
**/
+1 -1
View File
@@ -757,7 +757,7 @@ declare module '@polkadot/api-base/types/events' {
* The roles of a pool have been updated to the given new roles. Note that the depositor
* can never change.
**/
RolesUpdated: AugmentedEvent<ApiType, [root: Option<AccountId32>, stateToggler: Option<AccountId32>, nominator: Option<AccountId32>], { root: Option<AccountId32>, stateToggler: Option<AccountId32>, nominator: Option<AccountId32> }>;
RolesUpdated: AugmentedEvent<ApiType, [root: Option<AccountId32>, bouncer: Option<AccountId32>, nominator: Option<AccountId32>], { root: Option<AccountId32>, bouncer: Option<AccountId32>, nominator: Option<AccountId32> }>;
/**
* The state of a pool has changed
**/
+20 -1
View File
@@ -11,7 +11,7 @@ import type { BTreeSet, Bytes, Null, Option, U8aFixed, Vec, WrapperOpaque, bool,
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 { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletConvictionVotingVoteVoting, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletConvictionVotingVoteVoting, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotPrimitivesVstagingExecutorParams, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -151,6 +151,17 @@ declare module '@polkadot/api-base/types/storage' {
* epoch.
**/
segmentIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A list of the last 100 skipped epochs and the corresponding session index
* when the epoch was skipped.
*
* This is only used for validating equivocation proofs. An equivocation proof
* must contains a key-ownership proof for a given session, therefore we need a
* way to tie together sessions and epoch indices, i.e. we need to validate that
* a validator was the owner of a given key on a given session, and what the
* active epoch index was during that session.
**/
skippedEpochs: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[u64, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay.
**/
@@ -958,6 +969,10 @@ declare module '@polkadot/api-base/types/storage' {
* Storage for bonded pools.
**/
bondedPools: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsBondedPoolInner>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Map from a pool member account to their opted claim permission.
**/
claimPermissions: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletNominationPoolsClaimPermission>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Counter for the related counted storage map
**/
@@ -1342,6 +1357,10 @@ declare module '@polkadot/api-base/types/storage' {
* The earliest session for which previous session info is stored.
**/
earliestStoredSession: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Executor parameter set for a given session index
**/
sessionExecutorParams: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesVstagingExecutorParams>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Session information in a rolling window.
* Should have an entry in range `EarliestStoredSession..=CurrentSessionIndex`.
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.0.1' };
@@ -860,6 +860,10 @@ declare module '@polkadot/api-base/types/errors' {
* pool at a time.
**/
AccountBelongsToOtherPool: AugmentedError<ApiType>;
/**
* Bonding extra is restricted to the exact pending reward amount.
**/
BondExtraRestricted: AugmentedError<ApiType>;
/**
* The pools state cannot be changed.
**/
+1 -1
View File
@@ -574,7 +574,7 @@ declare module '@polkadot/api-base/types/events' {
* The roles of a pool have been updated to the given new roles. Note that the depositor
* can never change.
**/
RolesUpdated: AugmentedEvent<ApiType, [root: Option<AccountId32>, stateToggler: Option<AccountId32>, nominator: Option<AccountId32>], { root: Option<AccountId32>, stateToggler: Option<AccountId32>, nominator: Option<AccountId32> }>;
RolesUpdated: AugmentedEvent<ApiType, [root: Option<AccountId32>, bouncer: Option<AccountId32>, nominator: Option<AccountId32>], { root: Option<AccountId32>, bouncer: Option<AccountId32>, nominator: Option<AccountId32> }>;
/**
* The state of a pool has changed
**/
+20 -1
View File
@@ -11,7 +11,7 @@ import type { BTreeSet, Bytes, Null, Option, U8aFixed, Vec, WrapperOpaque, bool,
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 { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduled, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduled, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotPrimitivesVstagingExecutorParams, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -151,6 +151,17 @@ declare module '@polkadot/api-base/types/storage' {
* epoch.
**/
segmentIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A list of the last 100 skipped epochs and the corresponding session index
* when the epoch was skipped.
*
* This is only used for validating equivocation proofs. An equivocation proof
* must contains a key-ownership proof for a given session, therefore we need a
* way to tie together sessions and epoch indices, i.e. we need to validate that
* a validator was the owner of a given key on a given session, and what the
* active epoch index was during that session.
**/
skippedEpochs: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[u64, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay.
**/
@@ -802,6 +813,10 @@ declare module '@polkadot/api-base/types/storage' {
* Storage for bonded pools.
**/
bondedPools: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsBondedPoolInner>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Map from a pool member account to their opted claim permission.
**/
claimPermissions: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletNominationPoolsClaimPermission>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Counter for the related counted storage map
**/
@@ -1186,6 +1201,10 @@ declare module '@polkadot/api-base/types/storage' {
* The earliest session for which previous session info is stored.
**/
earliestStoredSession: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Executor parameter set for a given session index
**/
sessionExecutorParams: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesVstagingExecutorParams>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Session information in a rolling window.
* Should have an entry in range `EarliestStoredSession..=CurrentSessionIndex`.
File diff suppressed because it is too large Load Diff
@@ -703,6 +703,10 @@ declare module '@polkadot/api-base/types/consts' {
* The maximum length of an attribute key.
**/
keyLimit: u32 & AugmentedConst<ApiType>;
/**
* The max number of attributes a user could set per call.
**/
maxAttributesPerCall: u32 & AugmentedConst<ApiType>;
/**
* The max duration in blocks for deadlines.
**/
+43 -4
View File
@@ -414,10 +414,6 @@ declare module '@polkadot/api-base/types/errors' {
* Contract trapped during execution.
**/
ContractTrapped: AugmentedError<ApiType>;
/**
* The debug message specified to `seal_debug_message` does contain invalid UTF-8.
**/
DebugMessageInvalidUTF8: AugmentedError<ApiType>;
/**
* Input passed to a contract API function failed to decode as expected type.
**/
@@ -890,6 +886,18 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
glutton: {
/**
* The pallet was already initialized.
*
* Set `witness_count` to `Some` to bypass this error.
**/
AlreadyInitialized: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
grandpa: {
/**
* Attempt to signal GRANDPA change with one already pending.
@@ -1104,6 +1112,13 @@ declare module '@polkadot/api-base/types/errors' {
* The message is queued for future execution.
**/
Queued: AugmentedError<ApiType>;
/**
* This message is temporarily unprocessable.
*
* Such errors are expected, but not guaranteed, to resolve themselves eventually through
* retrying.
**/
TemporarilyUnprocessable: AugmentedError<ApiType>;
/**
* Generic error
**/
@@ -1212,6 +1227,10 @@ declare module '@polkadot/api-base/types/errors' {
* The provided data is incorrect.
**/
IncorrectData: AugmentedError<ApiType>;
/**
* The provided metadata might be too long.
**/
IncorrectMetadata: AugmentedError<ApiType>;
/**
* The item is locked (non-transferable).
**/
@@ -1236,6 +1255,10 @@ declare module '@polkadot/api-base/types/errors' {
* Item's metadata is locked.
**/
LockedItemMetadata: AugmentedError<ApiType>;
/**
* Can't set more attributes per one call.
**/
MaxAttributesLimitReached: AugmentedError<ApiType>;
/**
* The max supply is locked and can't be changed.
**/
@@ -1316,6 +1339,14 @@ declare module '@polkadot/api-base/types/errors' {
* The duration provided should be less than or equal to `MaxDeadlineDuration`.
**/
WrongDuration: AugmentedError<ApiType>;
/**
* The provided namespace isn't supported in this call.
**/
WrongNamespace: AugmentedError<ApiType>;
/**
* The extrinsic was sent by the wrong origin.
**/
WrongOrigin: AugmentedError<ApiType>;
/**
* The owner turned out to be different to what was expected.
**/
@@ -1324,6 +1355,10 @@ declare module '@polkadot/api-base/types/errors' {
* The provided setting can't be set.
**/
WrongSetting: AugmentedError<ApiType>;
/**
* The provided signature is incorrect.
**/
WrongSignature: AugmentedError<ApiType>;
/**
* Generic error
**/
@@ -1402,6 +1437,10 @@ declare module '@polkadot/api-base/types/errors' {
* pool at a time.
**/
AccountBelongsToOtherPool: AugmentedError<ApiType>;
/**
* Bonding extra is restricted to the exact pending reward amount.
**/
BondExtraRestricted: AugmentedError<ApiType>;
/**
* The pools state cannot be changed.
**/
+28 -6
View File
@@ -9,7 +9,7 @@ import type { ApiTypes, AugmentedEvent } 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, Perbill, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscAttributeNamespace, FrameSupportTokensMiscBalanceStatus, KitchensinkRuntimeProxyType, PalletAllianceCid, PalletAllianceUnscrupulousItem, PalletConvictionVotingTally, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMessageQueueMockHelpersMessageOrigin, PalletMultisigTimepoint, PalletNftsPriceWithDirection, PalletNominationPoolsPoolState, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PalletStateTrieMigrationError, PalletStateTrieMigrationMigrationCompute, SpFinalityGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscAttributeNamespace, FrameSupportTokensMiscBalanceStatus, KitchensinkRuntimeProxyType, PalletAllianceCid, PalletAllianceUnscrupulousItem, PalletConvictionVotingTally, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNftsPriceWithDirection, PalletNominationPoolsPoolState, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PalletStateTrieMigrationError, PalletStateTrieMigrationMigrationCompute, SpFinalityGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;
@@ -604,6 +604,24 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
glutton: {
/**
* The computation limit has been updated by root.
**/
ComputationLimitSet: AugmentedEvent<ApiType, [compute: Perbill], { compute: Perbill }>;
/**
* The pallet has been (re)initialized by root.
**/
PalletInitialized: AugmentedEvent<ApiType, [reinit: bool], { reinit: bool }>;
/**
* The storage limit has been updated by root.
**/
StorageLimitSet: AugmentedEvent<ApiType, [storage: Perbill], { storage: Perbill }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
grandpa: {
/**
* New authority set has been applied.
@@ -736,19 +754,19 @@ declare module '@polkadot/api-base/types/events' {
/**
* Message placed in overweight queue.
**/
OverweightEnqueued: AugmentedEvent<ApiType, [hash_: H256, origin: PalletMessageQueueMockHelpersMessageOrigin, pageIndex: u32, messageIndex: u32], { hash_: H256, origin: PalletMessageQueueMockHelpersMessageOrigin, pageIndex: u32, messageIndex: u32 }>;
OverweightEnqueued: AugmentedEvent<ApiType, [hash_: H256, origin: u32, pageIndex: u32, messageIndex: u32], { hash_: H256, origin: u32, pageIndex: u32, messageIndex: u32 }>;
/**
* This page was reaped.
**/
PageReaped: AugmentedEvent<ApiType, [origin: PalletMessageQueueMockHelpersMessageOrigin, index: u32], { origin: PalletMessageQueueMockHelpersMessageOrigin, index: u32 }>;
PageReaped: AugmentedEvent<ApiType, [origin: u32, index: u32], { origin: u32, index: u32 }>;
/**
* Message is processed.
**/
Processed: AugmentedEvent<ApiType, [hash_: H256, origin: PalletMessageQueueMockHelpersMessageOrigin, weightUsed: SpWeightsWeightV2Weight, success: bool], { hash_: H256, origin: PalletMessageQueueMockHelpersMessageOrigin, weightUsed: SpWeightsWeightV2Weight, success: bool }>;
Processed: AugmentedEvent<ApiType, [hash_: H256, origin: u32, weightUsed: SpWeightsWeightV2Weight, success: bool], { hash_: H256, origin: u32, weightUsed: SpWeightsWeightV2Weight, success: bool }>;
/**
* Message discarded due to an error in the `MessageProcessor` (usually a format error).
**/
ProcessingFailed: AugmentedEvent<ApiType, [hash_: H256, origin: PalletMessageQueueMockHelpersMessageOrigin, error: FrameSupportMessagesProcessMessageError], { hash_: H256, origin: PalletMessageQueueMockHelpersMessageOrigin, error: FrameSupportMessagesProcessMessageError }>;
ProcessingFailed: AugmentedEvent<ApiType, [hash_: H256, origin: u32, error: FrameSupportMessagesProcessMessageError], { hash_: H256, origin: u32, error: FrameSupportMessagesProcessMessageError }>;
/**
* Generic event
**/
@@ -890,6 +908,10 @@ declare module '@polkadot/api-base/types/events' {
* Ownership acceptance has changed for an account.
**/
OwnershipAcceptanceChanged: AugmentedEvent<ApiType, [who: AccountId32, maybeCollection: Option<u32>], { who: AccountId32, maybeCollection: Option<u32> }>;
/**
* New attributes have been set for an `item` of the `collection`.
**/
PreSignedAttributesSet: AugmentedEvent<ApiType, [collection: u32, item: u32, namespace: FrameSupportTokensMiscAttributeNamespace], { collection: u32, item: u32, namespace: FrameSupportTokensMiscAttributeNamespace }>;
/**
* The deposit for a set of `item`s within a `collection` has been updated.
**/
@@ -993,7 +1015,7 @@ declare module '@polkadot/api-base/types/events' {
* The roles of a pool have been updated to the given new roles. Note that the depositor
* can never change.
**/
RolesUpdated: AugmentedEvent<ApiType, [root: Option<AccountId32>, stateToggler: Option<AccountId32>, nominator: Option<AccountId32>], { root: Option<AccountId32>, stateToggler: Option<AccountId32>, nominator: Option<AccountId32> }>;
RolesUpdated: AugmentedEvent<ApiType, [root: Option<AccountId32>, bouncer: Option<AccountId32>, nominator: Option<AccountId32>], { root: Option<AccountId32>, bouncer: Option<AccountId32>, nominator: Option<AccountId32> }>;
/**
* The state of a pool has changed
**/
+50 -4
View File
@@ -10,7 +10,7 @@ import type { Data } from '@polkadot/types';
import type { BTreeSet, Bytes, Null, Option, U8aFixed, Vec, WrapperOpaque, bool, u128, u16, 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 { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSupportTokensMiscAttributeNamespace, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KitchensinkRuntimeSessionKeys, PalletAllianceCid, PalletAllianceMemberRole, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageContractInfo, PalletContractsStorageDeletedContract, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMessageQueueBookState, PalletMessageQueueMockHelpersMessageOrigin, PalletMessageQueuePage, PalletMultisigMultisig, PalletNftsAttributeDeposit, PalletNftsCollectionConfig, PalletNftsCollectionDetails, PalletNftsCollectionMetadata, PalletNftsItemConfig, PalletNftsItemDetails, PalletNftsItemMetadata, PalletNftsPendingSwap, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata, PalletUniquesItemDetails, PalletUniquesItemMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSupportTokensMiscAttributeNamespace, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KitchensinkRuntimeSessionKeys, PalletAllianceCid, PalletAllianceMemberRole, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageContractInfo, PalletContractsStorageDeletedContract, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMessageQueueBookState, PalletMessageQueuePage, PalletMultisigMultisig, PalletNftsAttributeDeposit, PalletNftsCollectionConfig, PalletNftsCollectionDetails, PalletNftsCollectionMetadata, PalletNftsItemConfig, PalletNftsItemDetails, PalletNftsItemMetadata, PalletNftsPendingSwap, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata, PalletUniquesItemDetails, PalletUniquesItemMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -226,6 +226,17 @@ declare module '@polkadot/api-base/types/storage' {
* epoch.
**/
segmentIndex: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A list of the last 100 skipped epochs and the corresponding session index
* when the epoch was skipped.
*
* This is only used for validating equivocation proofs. An equivocation proof
* must contains a key-ownership proof for a given session, therefore we need a
* way to tie together sessions and epoch indices, i.e. we need to validate that
* a validator was the owner of a given key on a given session, and what the
* active epoch index was during that session.
**/
skippedEpochs: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[u64, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay.
**/
@@ -657,6 +668,37 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
glutton: {
/**
* Storage value used to specify what percentage of the left over `ref_time`
* to consume during `on_idle`.
**/
compute: AugmentedQuery<ApiType, () => Observable<Perbill>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Storage value used the specify what percentage of left over `proof_size`
* to consume during `on_idle`.
**/
storage: AugmentedQuery<ApiType, () => Observable<Perbill>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Storage map used for wasting proof size.
*
* It contains no meaningful data - hence the name "Trash". The maximal number of entries is
* set to 65k, which is just below the next jump at 16^4. This is important to reduce the proof
* size benchmarking overestimate. The assumption here is that we won't have more than 65k *
* 1KiB = 65MiB of proof size wasting in practice. However, this limit is not enforced, so the
* pallet would also work out of the box with more entries, but its benchmarked proof weight
* would possibly be underestimated in that case.
**/
trashData: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<U8aFixed>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The current number of entries in `TrashData`.
**/
trashDataCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
grandpa: {
/**
* The number of changes (both in terms of keys and underlying economic responsibilities)
@@ -808,15 +850,15 @@ declare module '@polkadot/api-base/types/storage' {
/**
* The index of the first and last (non-empty) pages.
**/
bookStateFor: AugmentedQuery<ApiType, (arg: PalletMessageQueueMockHelpersMessageOrigin | { Here: any } | { There: any } | { Everywhere: any } | string | Uint8Array) => Observable<PalletMessageQueueBookState>, [PalletMessageQueueMockHelpersMessageOrigin]> & QueryableStorageEntry<ApiType, [PalletMessageQueueMockHelpersMessageOrigin]>;
bookStateFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<PalletMessageQueueBookState>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The map of page indices to pages.
**/
pages: AugmentedQuery<ApiType, (arg1: PalletMessageQueueMockHelpersMessageOrigin | { Here: any } | { There: any } | { Everywhere: any } | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletMessageQueuePage>>, [PalletMessageQueueMockHelpersMessageOrigin, u32]> & QueryableStorageEntry<ApiType, [PalletMessageQueueMockHelpersMessageOrigin, u32]>;
pages: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletMessageQueuePage>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
/**
* The origin at which we should begin servicing.
**/
serviceHead: AugmentedQuery<ApiType, () => Observable<Option<PalletMessageQueueMockHelpersMessageOrigin>>, []> & QueryableStorageEntry<ApiType, []>;
serviceHead: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -954,6 +996,10 @@ declare module '@polkadot/api-base/types/storage' {
* Storage for bonded pools.
**/
bondedPools: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsBondedPoolInner>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Map from a pool member account to their opted claim permission.
**/
claimPermissions: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletNominationPoolsClaimPermission>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Counter for the related counted storage map
**/
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/rpc-core": "9.14.1",
"@polkadot/types": "9.14.1",
"@polkadot/util": "^10.4.1",
"rxjs": "^7.8.0"
"@polkadot/rpc-core": "10.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/util": "^11.0.1",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.0.1' };
+11 -11
View File
@@ -20,20 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/api": "9.14.1",
"@polkadot/types": "9.14.1",
"@polkadot/types-codec": "9.14.1",
"@polkadot/types-create": "9.14.1",
"@polkadot/util": "^10.4.1",
"@polkadot/util-crypto": "^10.4.1",
"rxjs": "^7.8.0"
"@polkadot/api": "10.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/types-codec": "10.0.1",
"@polkadot/types-create": "10.0.1",
"@polkadot/util": "^11.0.1",
"@polkadot/util-crypto": "^11.0.1",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/api-augment": "9.14.1",
"@polkadot/keyring": "^10.4.1"
"@polkadot/api-augment": "10.0.1",
"@polkadot/keyring": "^11.0.1"
}
}
+19 -12
View File
@@ -1,10 +1,14 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { Registry } from '@polkadot/types/types';
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { TypeDefInfo } from '@polkadot/types/types';
import { blake2AsHex } from '@polkadot/util-crypto';
@@ -41,6 +45,9 @@ interface JSONAbi {
}
}
// FIXME When Jest is removed with ESM tests, this should be converted to use import.meta.url
const cmpPath = path.join(process.cwd(), 'packages/api-contract/src/test/compare');
function stringifyInfo (key: string, value: unknown): unknown {
return key === 'info'
? TypeDefInfo[value as number]
@@ -82,26 +89,26 @@ describe('Abi', (): void => {
});
describe('TypeDef', (): void => {
Object.keys(abis).forEach((abiName) => {
it(`initializes from a contract ABI (${abiName})`, (): void => {
const abi = new Abi(abis[abiName]);
const json = stringifyJson(abi.registry);
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
for (const [abiName, abiJson] of Object.entries(abis)) {
it(`initializes from a contract ABI: ${abiName}`, (): void => {
const abi = new Abi(abiJson);
const registryJson = stringifyJson(abi.registry);
const cmpFile = path.join(cmpPath, `${abiName}.test.json`);
const cmpText = fs.readFileSync(cmpFile, 'utf-8');
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
expect(JSON.parse(json)).toEqual(require(cmpPath));
expect(JSON.parse(registryJson)).toEqual(JSON.parse(cmpText));
} catch (error) {
if (process.env.GITHUB_REPOSITORY) {
console.error(json);
console.error(registryJson);
throw error;
}
fs.writeFileSync(cmpPath, json, { flag: 'w' });
fs.writeFileSync(cmpFile, registryJson, { flag: 'w' });
}
});
});
}
});
it('has the correct hash for the source', (): void => {
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { TypeRegistry } from '@polkadot/types';
import abis from '../test/contracts';
+1 -1
View File
@@ -11,7 +11,7 @@ import { v3ToV4 } from './toV4';
// The versions where an enum is used, aka V0 is missing
// (Order from newest, i.e. we expect more on newest vs oldest)
export const enumVersions = <const> ['V4', 'V3', 'V2', 'V1'];
export const enumVersions = ['V4', 'V3', 'V2', 'V1'] as const;
type Versions = typeof enumVersions[number] | 'V0';
+2 -2
View File
@@ -23,11 +23,11 @@ interface ArgsEntry <T extends WithArgs> extends NamedEntry {
args: GetArgsType<T>['args'][0][];
}
const ARG_TYPES = <const> {
const ARG_TYPES = {
ContractConstructorSpec: 'ContractMessageParamSpecV2',
ContractEventSpec: 'ContractEventParamSpecV2',
ContractMessageSpec: 'ContractMessageParamSpecV2'
};
} as const;
function v1ToV2Label (entry: NamedEntry): { label: Text } {
return objectSpread({}, entry, {
+8 -3
View File
@@ -1,8 +1,12 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import fs from 'fs';
import path from 'path';
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { toPromiseMethod } from '@polkadot/api';
@@ -12,7 +16,8 @@ import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json' a
import { Code } from './Code';
import { mockApi } from './mock';
const v0wasmFlipper = fs.readFileSync(path.join(__dirname, '../test/contracts/ink/v0/flipper.wasm'));
// FIXME When Jest is removed with ESM tests, this should be converted to use import.meta.url
const v0wasmFlipper = fs.readFileSync(path.join(process.cwd(), 'packages/api-contract/src/test/contracts/ink/v0/flipper.wasm'), 'utf-8');
describe('Code', (): void => {
it('can construct with an individual ABI/WASM combo', (): void => {
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.0.1' };
+16 -16
View File
@@ -20,25 +20,25 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/api": "9.14.1",
"@polkadot/api-augment": "9.14.1",
"@polkadot/api-base": "9.14.1",
"@polkadot/rpc-core": "9.14.1",
"@polkadot/types": "9.14.1",
"@polkadot/types-codec": "9.14.1",
"@polkadot/util": "^10.4.1",
"@polkadot/util-crypto": "^10.4.1",
"rxjs": "^7.8.0"
"@polkadot/api": "10.0.1",
"@polkadot/api-augment": "10.0.1",
"@polkadot/api-base": "10.0.1",
"@polkadot/rpc-core": "10.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/types-codec": "10.0.1",
"@polkadot/util": "^11.0.1",
"@polkadot/util-crypto": "^11.0.1",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/api": "9.14.1",
"@polkadot/api-augment": "9.14.1",
"@polkadot/rpc-augment": "9.14.1",
"@polkadot/rpc-provider": "9.14.1",
"@polkadot/types-support": "9.14.1"
"@polkadot/api": "10.0.1",
"@polkadot/api-augment": "10.0.1",
"@polkadot/rpc-augment": "10.0.1",
"@polkadot/rpc-provider": "10.0.1",
"@polkadot/types-support": "10.0.1"
}
}
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { SubmittableExtrinsic } from '@polkadot/api-base/types';
import type { Bytes, Option, StorageKey } from '@polkadot/types';
import type { Bounty, BountyIndex, Proposal, ProposalIndex } from '@polkadot/types/interfaces';
+15 -12
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/restrict-template-expressions */
@@ -27,19 +30,22 @@ const testFunction = (api: ApiRx): any => {
};
};
function waitReady (api: ApiRx): Promise<ApiRx> {
return new Promise<ApiRx>((resolve) =>
api.isReady.subscribe((api) => resolve(api))
);
}
describe('derive', (): void => {
const registry = new TypeRegistry();
describe('builtin', (): void => {
const api = new ApiRx({ provider: new MockProvider(registry), registry });
beforeAll((done): void => {
api.isReady.subscribe(() => done());
});
afterAll(async () => {
await api.disconnect();
beforeAll(async () => {
await waitReady(api);
});
afterAll(() => api.disconnect());
testFunction(api)('accounts', 'idAndIndex', []);
testFunction(api)('accounts', 'idToIndex', []);
@@ -81,13 +87,10 @@ describe('derive', (): void => {
throwOnConnect: true
});
beforeAll((done): void => {
api.isReady.subscribe(() => done());
});
afterAll(async () => {
await api.disconnect();
beforeAll(async () => {
await waitReady(api);
});
afterAll(() => api.disconnect());
// override
testFunction(api)('balances', 'fees', ['a', 'b']);
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.0.1' };
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { ApprovalFlag } from '@polkadot/types/interfaces';
import { TypeRegistry } from '@polkadot/types/create';
+19 -19
View File
@@ -20,29 +20,29 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/api-augment": "9.14.1",
"@polkadot/api-base": "9.14.1",
"@polkadot/api-derive": "9.14.1",
"@polkadot/keyring": "^10.4.1",
"@polkadot/rpc-augment": "9.14.1",
"@polkadot/rpc-core": "9.14.1",
"@polkadot/rpc-provider": "9.14.1",
"@polkadot/types": "9.14.1",
"@polkadot/types-augment": "9.14.1",
"@polkadot/types-codec": "9.14.1",
"@polkadot/types-create": "9.14.1",
"@polkadot/types-known": "9.14.1",
"@polkadot/util": "^10.4.1",
"@polkadot/util-crypto": "^10.4.1",
"@polkadot/api-augment": "10.0.1",
"@polkadot/api-base": "10.0.1",
"@polkadot/api-derive": "10.0.1",
"@polkadot/keyring": "^11.0.1",
"@polkadot/rpc-augment": "10.0.1",
"@polkadot/rpc-core": "10.0.1",
"@polkadot/rpc-provider": "10.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/types-augment": "10.0.1",
"@polkadot/types-codec": "10.0.1",
"@polkadot/types-create": "10.0.1",
"@polkadot/types-known": "10.0.1",
"@polkadot/util": "^11.0.1",
"@polkadot/util-crypto": "^11.0.1",
"eventemitter3": "^5.0.0",
"rxjs": "^7.8.0"
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/api-augment": "9.14.1",
"@polkadot/types-support": "9.14.1"
"@polkadot/api-augment": "10.0.1",
"@polkadot/types-support": "10.0.1"
}
}
+3 -1
View File
@@ -373,6 +373,8 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
}
private _subscribeHealth (): void {
this._unsubscribeHealth();
// Only enable the health keepalive on WS, not needed on HTTP
this.#healthTimer = this.hasSubscriptions
? setInterval((): void => {
@@ -428,7 +430,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
#onProviderDisconnect (): void {
this._isConnected.next(false);
this._unsubscribeHealth();
this._unsubscribe();
this.emit('disconnected');
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.0.1' };
+80 -69
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { UnsubscribePromise } from '../types';
import { Combinator } from './Combinator';
@@ -19,81 +22,89 @@ describe('Combinator', (): void => {
fns = [];
});
it('it triggers on all values', (done): void => {
let count = 0;
const combinator = new Combinator(
[storeFn],
(value: any[]): void => {
expect(value[0]).toEqual(`test${count}`);
it('it triggers on all values', async (): Promise<void> => {
await new Promise<boolean>((resolve) => {
let count = 0;
const combinator = new Combinator(
[storeFn],
(value: any[]): void => {
expect(value[0]).toEqual(`test${count}`);
count++;
count++;
if (count === 3) {
done();
if (count === 3) {
resolve(true);
}
}
}
);
);
fns[0]('test0');
fns[0]('test1');
fns[0]('test2');
fns[0]('test0');
fns[0]('test1');
fns[0]('test2');
expect(combinator).toBeDefined();
});
it('combines values from 2 sources, firing when it has all results', (done): void => {
const combinator = new Combinator(
[storeFn, storeFn],
(value: any[]): void => {
expect(value).toEqual(['test0', 'test1']);
done();
}
);
fns[0]('test0');
fns[1]('test1');
expect(combinator).toBeDefined();
});
it('combines values from 2 sources, allowing multiple updates', (done): void => {
let count = 0;
const combinator = new Combinator(
[storeFn, storeFn],
(value: any[]): void => {
expect(value).toEqual(
count === 0
? ['test0', 'test1']
: ['test2', 'test1']);
count++;
if (count === 2) {
done();
}
}
);
fns[0]('test0');
fns[1]('test1');
fns[0]('test2');
expect(combinator).toBeDefined();
});
it('unsubscribes as required', (done): void => {
// eslint-disable-next-line @typescript-eslint/require-await
const mocker = async (): Promise<any> => done;
const combinator = new Combinator([
mocker,
// eslint-disable-next-line @typescript-eslint/require-await
async (): UnsubscribePromise => (): void => undefined
// eslint-disable-next-line @typescript-eslint/no-unused-vars
], (value: any[]): void => {
// ignore
expect(combinator).toBeDefined();
});
});
combinator.unsubscribe();
it('combines values from 2 sources, firing when it has all results', async (): Promise<void> => {
await new Promise<boolean>((resolve) => {
const combinator = new Combinator(
[storeFn, storeFn],
(value: any[]): void => {
expect(value).toEqual(['test0', 'test1']);
resolve(true);
}
);
fns[0]('test0');
fns[1]('test1');
expect(combinator).toBeDefined();
});
});
it('combines values from 2 sources, allowing multiple updates', async (): Promise<void> => {
await new Promise<boolean>((resolve) => {
let count = 0;
const combinator = new Combinator(
[storeFn, storeFn],
(value: any[]): void => {
expect(value).toEqual(
count === 0
? ['test0', 'test1']
: ['test2', 'test1']);
count++;
if (count === 2) {
resolve(true);
}
}
);
fns[0]('test0');
fns[1]('test1');
fns[0]('test2');
expect(combinator).toBeDefined();
});
});
it('unsubscribes as required', async (): Promise<void> => {
await new Promise<void>((resolve) => {
// eslint-disable-next-line @typescript-eslint/require-await
const mocker = () => Promise.resolve(resolve);
const combinator = new Combinator([
mocker,
// eslint-disable-next-line @typescript-eslint/require-await
async (): UnsubscribePromise => (): void => undefined
// eslint-disable-next-line @typescript-eslint/no-unused-vars
], (value: any[]): void => {
// ignore
});
combinator.unsubscribe();
});
});
});
+4 -4
View File
@@ -1,11 +1,12 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { HexString } from '@polkadot/util/types';
import type { SubmittableExtrinsic } from '../types';
import { jest } from '@jest/globals';
import { createPair } from '@polkadot/keyring/pair';
import { createTestKeyring } from '@polkadot/keyring/testing';
import { MockProvider } from '@polkadot/rpc-provider/mock';
@@ -47,7 +48,6 @@ describe('ApiPromise', (): void => {
}
beforeEach((): void => {
jest.setTimeout(10000);
provider = new MockProvider(registry);
});
@@ -104,7 +104,7 @@ describe('ApiPromise', (): void => {
await api.disconnect();
fail('Expected an error but none occurred.');
throw new Error('Expected an error but none occurred.');
} catch {
// Pass
}
+7 -5
View File
@@ -1,18 +1,20 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { augmentObject } from './augmentObject';
describe('augmentObject', (): void => {
let spy: any;
let spy: ReturnType<typeof jest.spyOn>;
beforeEach((): void => {
spy = jest.spyOn(console, 'warn');
});
afterEach((): void => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
spy.mockClear();
spy.mockRestore();
});
it('logs added/removed sections and methods', (): void => {
@@ -24,12 +26,12 @@ describe('augmentObject', (): void => {
expect(spy).toHaveBeenCalledWith(
expect.anything(),
expect.stringContaining('API/AUGMENT'),
expect.stringMatching(/API\/AUGMENT/),
'api.test: Found 1 added and 1 removed modules:\n\t added: new\n\tremoved: baz'
);
expect(spy).toHaveBeenCalledWith(
expect.anything(),
expect.stringContaining('API/AUGMENT'),
expect.stringMatching(/API\/AUGMENT/),
'api.test: Found 2 added and 3 removed calls:\n\t added: bar.b, foo.d\n\tremoved: bar.a, bar.c, foo.c'
);
});
+3
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { decorateStorage, Metadata, TypeRegistry } from '@polkadot/types';
import metaStatic from '@polkadot/types-support/metadata/static-substrate';
+6 -6
View File
@@ -20,13 +20,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/rpc-core": "9.14.1",
"@polkadot/types": "9.14.1",
"@polkadot/types-codec": "9.14.1",
"@polkadot/util": "^10.4.1"
"@polkadot/rpc-core": "10.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/types-codec": "10.0.1",
"@polkadot/util": "^11.0.1",
"tslib": "^2.5.0"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.0.1' };
+9 -9
View File
@@ -20,18 +20,18 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/rpc-augment": "9.14.1",
"@polkadot/rpc-provider": "9.14.1",
"@polkadot/types": "9.14.1",
"@polkadot/util": "^10.4.1",
"rxjs": "^7.8.0"
"@polkadot/rpc-augment": "10.0.1",
"@polkadot/rpc-provider": "10.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/util": "^11.0.1",
"rxjs": "^7.8.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"@polkadot/keyring": "^10.4.1",
"@polkadot/rpc-augment": "9.14.1"
"@polkadot/keyring": "^11.0.1",
"@polkadot/rpc-augment": "10.0.1"
}
}
+29 -20
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { RpcInterface } from './types';
import { createTestPairs } from '@polkadot/keyring/testingPairs';
@@ -52,24 +55,26 @@ describe('Cached Observables', (): void => {
expect(observable2).not.toBe(observable1);
});
it('subscribes to the same one if within the period (unbsub delay)', (done): void => {
it('subscribes to the same one if within the period (unbsub delay)', async (): Promise<void> => {
const observable1 = rpc.chain.subscribeNewHeads();
const sub1 = observable1.subscribe();
sub1.unsubscribe();
setTimeout((): void => {
const observable2 = rpc.chain.subscribeNewHeads();
const sub2 = observable2.subscribe();
await new Promise<boolean>((resolve) => {
setTimeout((): void => {
const observable2 = rpc.chain.subscribeNewHeads();
const sub2 = observable2.subscribe();
expect(observable1).toBe(observable2);
expect(observable1).toBe(observable2);
sub2.unsubscribe();
done();
}, 500);
sub2.unsubscribe();
resolve(true);
}, 500);
});
});
it('clears cache if there are no more subscribers', (done): void => {
it('clears cache if there are no more subscribers', async (): Promise<void> => {
const observable1 = rpc.chain.subscribeNewHeads();
const observable2 = rpc.chain.subscribeNewHeads();
const sub1 = observable1.subscribe();
@@ -80,13 +85,15 @@ describe('Cached Observables', (): void => {
sub1.unsubscribe();
sub2.unsubscribe();
setTimeout((): void => {
// No more subscribers, now create a new observable
const observable3 = rpc.chain.subscribeNewHeads();
await new Promise<boolean>((resolve) => {
setTimeout((): void => {
// No more subscribers, now create a new observable
const observable3 = rpc.chain.subscribeNewHeads();
expect(observable3).not.toBe(observable1);
done();
}, 3500);
expect(observable3).not.toBe(observable1);
resolve(true);
}, 3500);
});
});
it('creates different observables for different methods but same arguments', (): void => {
@@ -104,7 +111,7 @@ describe('Cached Observables', (): void => {
expect(observable2).toBe(observable1);
});
it('creates multiple observables for subsequent one-shots delayed', (done): void => {
it('creates multiple observables for subsequent one-shots delayed', async (): Promise<void> => {
const observable1 = rpc.chain.getBlockHash(123);
const sub = observable1.subscribe((): void => {
@@ -113,9 +120,11 @@ describe('Cached Observables', (): void => {
expect(rpc.chain.getBlockHash(123)).toBe(observable1);
setTimeout((): void => {
expect(rpc.chain.getBlockHash(123)).not.toBe(observable1);
done();
}, 3500);
await new Promise<boolean>((resolve) => {
setTimeout((): void => {
expect(rpc.chain.getBlockHash(123)).not.toBe(observable1);
resolve(true);
}, 3500);
});
});
});
+3
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
import { MockProvider } from '@polkadot/rpc-provider/mock';
+22 -15
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
import type { DefinitionRpc } from '@polkadot/types/types';
@@ -39,31 +42,35 @@ describe('methodSend', (): void => {
rpc = new RpcCore('987', registry, provider);
});
it('checks for mismatched parameters', (done): void => {
it('checks for mismatched parameters', async (): Promise<void> => {
// private method
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
const method = (rpc as any)._createMethodSend('test', 'bleh', methods.bleh);
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
method(1).subscribe(
(): void => undefined,
(error: Error): void => {
expect(error.message).toMatch(/parameters, 1 found instead/);
done();
});
await new Promise<boolean>((resolve) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
method(1).subscribe(
(): void => undefined,
(error: Error): void => {
expect(error.message).toMatch(/parameters, 1 found instead/);
resolve(true);
});
});
});
it('calls the provider with the correct parameters', (done): void => {
it('calls the provider with the correct parameters', async (): Promise<void> => {
// private method
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
const method = (rpc as any)._createMethodSend('test', 'blah', methods.blah);
// Args are length-prefixed, because it's a Bytes
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
method(new Uint8Array([2 << 2, 0x12, 0x34])).subscribe((): void => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(provider.send).toHaveBeenCalledWith('test_blah', ['0x1234'], false);
done();
await new Promise<boolean>((resolve) => {
// Args are length-prefixed, because it's a Bytes
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
method(new Uint8Array([2 << 2, 0x12, 0x34])).subscribe((): void => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(provider.send).toHaveBeenCalledWith('test_blah', ['0x1234'], false);
resolve(true);
});
});
});
});
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.0.1' };
+33 -24
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { RpcInterface } from './types';
import { MockProvider } from '@polkadot/rpc-provider/mock';
@@ -22,17 +25,19 @@ describe('replay', (): void => {
await provider.disconnect();
});
it('returns the observable value', (done): void => {
rpc.system.chain().subscribe((value: any): void => {
if (value) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
expect(value.toString()).toEqual('mockChain'); // Defined in MockProvider
done();
}
it('returns the observable value', async (): Promise<void> => {
await new Promise<boolean>((resolve) => {
rpc.system.chain().subscribe((value: any): void => {
if (value) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
expect(value.toString()).toEqual('mockChain'); // Defined in MockProvider
resolve(true);
}
});
});
});
it('replay(1) works as expected', (done): void => {
it('replay(1) works as expected', async (): Promise<void> => {
const observable = rpc.system.chain();
let a: any | undefined;
@@ -40,28 +45,32 @@ describe('replay', (): void => {
a = value;
});
setTimeout((): void => {
// Subscribe again to the same observable, it should fire value immediately
observable.subscribe((value: any): void => {
expect(value).toEqual(a);
done();
});
}, 1000);
await new Promise<boolean>((resolve) => {
setTimeout((): void => {
// Subscribe again to the same observable, it should fire value immediately
observable.subscribe((value: any): void => {
expect(value).toEqual(a);
resolve(true);
});
}, 1000);
});
});
it('unsubscribes as required', (done): void => {
it('unsubscribes as required', async (): Promise<void> => {
// eslint-disable-next-line @typescript-eslint/unbound-method
rpc.provider.unsubscribe = jest.fn();
const subscription = rpc.chain.subscribeNewHeads().subscribe((): void => {
subscription.unsubscribe();
await new Promise<boolean>((resolve) => {
const subscription = rpc.chain.subscribeNewHeads().subscribe((): void => {
subscription.unsubscribe();
// There's a promise inside .unsubscribe(), wait a bit (> 2s)
setTimeout((): void => {
// eslint-disable-next-line @typescript-eslint/unbound-method
expect(rpc.provider.unsubscribe).toHaveBeenCalled();
done();
}, 3500);
// There's a promise inside .unsubscribe(), wait a bit (> 2s)
setTimeout((): void => {
// eslint-disable-next-line @typescript-eslint/unbound-method
expect(rpc.provider.unsubscribe).toHaveBeenCalled();
resolve(true);
}, 3500);
});
});
});
});
+27 -23
View File
@@ -1,47 +1,51 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { jest } from '@jest/globals';
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { of, timer } from 'rxjs';
import { drr } from '.';
describe('drr', (): void => {
beforeEach((): void => {
jest.setTimeout(15000);
});
it('should not fire twice the same value', (done): void => {
it('should not fire twice the same value', async (): Promise<void> => {
let count = 0;
const sub = of(1, 1).pipe(drr({ delay: 500 })).subscribe((): void => {
++count;
});
setTimeout((): void => {
expect(count).toBe(1);
sub.unsubscribe();
await new Promise<boolean>((resolve) => {
setTimeout((): void => {
expect(count).toBe(1);
sub.unsubscribe();
setTimeout(done, 2000);
}, 50);
setTimeout(() => {
resolve(true);
}, 2000);
}, 50);
});
});
it('should be a ReplaySubject(1)', (done): void => {
it('should be a ReplaySubject(1)', async (): Promise<void> => {
const obs = timer(0, 100).pipe(drr({ delay: 500 })); // Starts at 0, increments every 100ms
const sub = obs.subscribe(); // Fire the observable
// Subscribe another time after some time, i.e. after the observable has fired
setTimeout((): void => {
const sub = obs.subscribe((value): void => {
expect(value > 1).toBe(true);
await new Promise<boolean>((resolve) => {
// Subscribe another time after some time, i.e. after the observable has fired
setTimeout((): void => {
const sub = obs.subscribe((value): void => {
expect(value > 1).toBe(true);
setTimeout(done, 2000);
});
setTimeout(() => {
resolve(true);
}, 2000);
});
sub.unsubscribe();
}, 500);
sub.unsubscribe();
}, 500);
sub.unsubscribe();
});
});
});
+14 -14
View File
@@ -20,26 +20,26 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/keyring": "^10.4.1",
"@polkadot/types": "9.14.1",
"@polkadot/types-support": "9.14.1",
"@polkadot/util": "^10.4.1",
"@polkadot/util-crypto": "^10.4.1",
"@polkadot/x-fetch": "^10.4.1",
"@polkadot/x-global": "^10.4.1",
"@polkadot/x-ws": "^10.4.1",
"@polkadot/keyring": "^11.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/types-support": "10.0.1",
"@polkadot/util": "^11.0.1",
"@polkadot/util-crypto": "^11.0.1",
"@polkadot/x-fetch": "^11.0.1",
"@polkadot/x-global": "^11.0.1",
"@polkadot/x-ws": "^11.0.1",
"eventemitter3": "^5.0.0",
"mock-socket": "^9.2.0",
"nock": "^13.3.0"
"mock-socket": "^9.2.1",
"nock": "^13.3.0",
"tslib": "^2.5.0"
},
"devDependencies": {
"@substrate/connect": "0.7.19"
"@substrate/connect": "0.7.20"
},
"optionalDependencies": {
"@substrate/connect": "0.7.19"
"@substrate/connect": "0.7.20"
}
}
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { JsonRpcResponse } from '../types';
import { RpcCoder } from '.';
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { RpcCoder } from '.';
describe('encodeJson', (): void => {
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { RpcCoder } from '.';
describe('encodeObject', (): void => {
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { isError } from '@polkadot/util/is/error';
import RpcError from './error';
+7 -4
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { TEST_HTTP_URL } from '../mock/mockHttp';
import { HttpProvider } from './';
@@ -41,16 +44,16 @@ describe('Http', (): void => {
expect(http.isConnected).toEqual(true);
});
it('does not (yet) support subscribe', (): Promise<number | void> => {
return http.subscribe('', '', [], (cb): void => {
it('does not (yet) support subscribe', async (): Promise<void> => {
await http.subscribe('', '', [], (cb): void => {
expect(cb).toEqual(expect.anything());
}).catch((error): void => {
expect((error as Error).message).toMatch(/does not have subscriptions/);
});
});
it('does not (yet) support unsubscribe', (): Promise<boolean | void> => {
return http.unsubscribe('', '', 0).catch((error): void => {
it('does not (yet) support unsubscribe', async (): Promise<void> => {
await http.unsubscribe('', '', 0).catch((error): void => {
expect((error as Error).message).toMatch(/does not have subscriptions/);
});
});
+5 -2
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { Mock } from '../mock/types';
import { mockHttp, TEST_HTTP_URL } from '../mock/mockHttp';
@@ -16,9 +19,9 @@ describe.skip('send', (): void => {
http = new HttpProvider(TEST_HTTP_URL);
});
afterEach((): void => {
afterEach(async () => {
if (mock) {
mock.done();
await mock.done();
}
});
+3
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { LRUCache } from './lru';
describe('LRUCache', (): void => {
+1 -5
View File
@@ -69,11 +69,7 @@ export function mockWs (requests: Request[], wsUrl: string = TEST_WS_URL): Scope
let requestCount = 0;
const scope: Scope = {
body: {},
done: (): void => {
server.stop((): void => {
// ignore
});
},
done: () => new Promise<void>((resolve) => server.stop(resolve)),
requests: 0,
server
};
+16 -11
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { ProviderInterfaceEmitted } from '../types';
import { TypeRegistry } from '@polkadot/types/create';
@@ -19,20 +22,22 @@ describe('on', (): void => {
await mock.disconnect();
});
it('it emits both connected and disconnected events', (done): void => {
it('it emits both connected and disconnected events', async (): Promise<void> => {
const events: Record<string, boolean> = { connected: false, disconnected: false };
const handler = (type: ProviderInterfaceEmitted): void => {
mock.on(type, (): void => {
events[type] = true;
await new Promise<boolean>((resolve) => {
const handler = (type: ProviderInterfaceEmitted): void => {
mock.on(type, (): void => {
events[type] = true;
if (Object.values(events).filter((value): boolean => value).length === 2) {
done();
}
});
};
if (Object.values(events).filter((value): boolean => value).length === 2) {
resolve(true);
}
});
};
handler('connected');
handler('disconnected');
handler('connected');
handler('disconnected');
});
});
});
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { TypeRegistry } from '@polkadot/types/create';
import { MockProvider } from '.';
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { TypeRegistry } from '@polkadot/types/create';
import { MockProvider } from './';
@@ -17,53 +20,59 @@ describe('subscribe', (): void => {
await mock.disconnect();
});
it('fails on unknown methods', (): Promise<number | void> => {
return mock
it('fails on unknown methods', async (): Promise<void> => {
await mock
.subscribe('test', 'test_notFound')
.catch((error): void => {
expect((error as Error).message).toMatch(/Invalid method 'test_notFound'/);
});
});
it('returns a subscription id', (): Promise<void> => {
return mock
it('returns a subscription id', async (): Promise<void> => {
await mock
.subscribe('chain_newHead', 'chain_subscribeNewHead', (): void => undefined)
.then((id): void => {
expect(id).toEqual(1);
});
});
it('calls back with the last known value', (done): void => {
it('calls back with the last known value', async (): Promise<void> => {
mock.isUpdating = false;
mock.subscriptions.chain_subscribeNewHead.lastValue = 'testValue';
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, value: string): void => {
expect(value).toEqual('testValue');
done();
}).catch(console.error);
await new Promise<boolean>((resolve) => {
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, value: string): void => {
expect(value).toEqual('testValue');
resolve(true);
}).catch(console.error);
});
});
it('calls back with new headers', (done): void => {
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, header: { number: number }): void => {
if (header.number === 4) {
done();
}
}).catch(console.error);
it('calls back with new headers', async (): Promise<void> => {
await new Promise<boolean>((resolve) => {
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, header: { number: number }): void => {
if (header.number === 4) {
resolve(true);
}
}).catch(console.error);
});
});
it('handles errors withing callbacks gracefully', (done): void => {
it('handles errors within callbacks gracefully', async (): Promise<void> => {
let hasThrown = false;
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, header: { number: number }): void => {
if (!hasThrown) {
hasThrown = true;
await new Promise<boolean>((resolve) => {
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, header: { number: number }): void => {
if (!hasThrown) {
hasThrown = true;
throw new Error('testing');
}
throw new Error('testing');
}
if (header.number === 3) {
done();
}
}).catch(console.error);
if (header.number === 3) {
resolve(true);
}
}).catch(console.error);
});
});
});
+3 -5
View File
@@ -2,11 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
import type { Server } from 'mock-socket';
import type { Constructor } from '@polkadot/types/types';
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
export interface Global extends NodeJS.Global {
WebSocket: Constructor<WebSocket>;
export type Global = typeof globalThis & {
WebSocket: typeof WebSocket;
fetch: any;
}
@@ -14,7 +12,7 @@ export interface Mock {
body: Record<string, Record<string, unknown>>;
requests: number;
server: Server;
done: () => Record<string, unknown>;
done: () => Promise<void>;
}
export type MockStateSubscriptionCallback = (error: Error | null, value: any) => void;
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { TypeRegistry } from '@polkadot/types/create';
import { MockProvider } from '.';
@@ -24,8 +27,8 @@ describe('unsubscribe', (): void => {
await mock.disconnect();
});
it('fails on unknown ids', (): Promise<boolean> => {
return mock
it('fails on unknown ids', async (): Promise<void> => {
await mock
.unsubscribe('chain_newHead', 'chain_subscribeNewHead', 5)
.catch((error): boolean => {
expect((error as Error).message).toMatch(/Unable to find/);
@@ -34,12 +37,12 @@ describe('unsubscribe', (): void => {
});
});
it('unsubscribes successfully', (): Promise<boolean> => {
return mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id);
it('unsubscribes successfully', async (): Promise<void> => {
await mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id);
});
it('fails on double unsubscribe', (): Promise<boolean> => {
return mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id)
it('fails on double unsubscribe', async (): Promise<void> => {
await mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id)
.then((): Promise<boolean> =>
mock.unsubscribe('chain_newHead', 'chain_subscribeNewHead', id)
)
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.0.1' };
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
/* eslint-disable sort-keys */
/* eslint-disable promise/param-names */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
@@ -21,18 +24,33 @@
import type Sc from '@substrate/connect';
import type { HealthChecker, SmoldotHealth } from './types';
import { jest } from '@jest/globals';
import { ScProvider } from '.';
const wait = (ms: number) => new Promise((res) => setTimeout(res, ms));
type MockChain = Sc.Chain & {
_spec: () => string
_recevedRequests: () => string[]
_isTerminated: () => boolean
_triggerCallback: (response: string | {}) => void
_setTerminateInterceptor: (fn: () => void) => void
_setSendJsonRpcInterceptor: (fn: (rpc: string) => void) => void
_getLatestRequest: () => string
}
type MockedHealthChecker = HealthChecker & {
_isActive: () => boolean
_triggerHealthUpdate: (update: SmoldotHealth) => void
}
const healthCheckerMock = (): MockedHealthChecker => {
enum WellKnownChain {
polkadot = 'polkadot',
ksmcc3 = 'ksmcc3',
rococo_v2_2 = 'rococo_v2_2',
westend2 = 'westend2'
}
const wait = (ms: number) => new Promise((res) => setTimeout(res, ms));
function healthCheckerMock (): MockedHealthChecker {
let cb: (health: SmoldotHealth) => void = () => {};
let sendJsonRpc: (request: string) => void = () => {};
@@ -57,9 +75,9 @@ const healthCheckerMock = (): MockedHealthChecker => {
cb(update);
}
};
};
}
const healthCheckerFactory = () => {
function healthCheckerFactory () {
const _healthCheckers: MockedHealthChecker[] = [];
return {
@@ -73,21 +91,9 @@ const healthCheckerFactory = () => {
_healthCheckers,
_latestHealthChecker: () => _healthCheckers.slice(-1)[0]
};
};
jest.mock('./Health', () => healthCheckerFactory());
type MockChain = Sc.Chain & {
_spec: () => string
_recevedRequests: () => string[]
_isTerminated: () => boolean
_triggerCallback: (response: string | {}) => void
_setTerminateInterceptor: (fn: () => void) => void
_setSendJsonRpcInterceptor: (fn: (rpc: string) => void) => void
_getLatestRequest: () => string
}
const getFakeChain = (spec: string, callback: Sc.JsonRpcCallback): MockChain => {
function getFakeChain (spec: string, callback: Sc.JsonRpcCallback): MockChain {
const _receivedRequests: string[] = [];
let _isTerminated = false;
@@ -119,9 +125,9 @@ const getFakeChain = (spec: string, callback: Sc.JsonRpcCallback): MockChain =>
},
_getLatestRequest: () => _receivedRequests[_receivedRequests.length - 1]
};
};
}
const getFakeClient = () => {
function getFakeClient () {
const chains: MockChain[] = [];
let addChainInterceptor: Promise<void> = Promise.resolve();
let addWellKnownChainInterceptor: Promise<void> = Promise.resolve();
@@ -154,16 +160,9 @@ const getFakeClient = () => {
return result;
})
};
};
enum WellKnownChain {
polkadot = 'polkadot',
ksmcc3 = 'ksmcc3',
rococo_v2_2 = 'rococo_v2_2',
westend2 = 'westend2'
}
const connectorFactory = () => {
function connectorFactory () {
const clients: ReturnType<typeof getFakeClient>[] = [];
const latestClient = () => clients[clients.length - 1];
@@ -181,26 +180,26 @@ const connectorFactory = () => {
latestChain: () =>
latestClient()._chains()[latestClient()._chains().length - 1]
};
};
}
let mockSc: typeof Sc & { latestChain: () => MockChain };
let mockedHealthChecker: ReturnType<typeof healthCheckerFactory>;
const getCurrentHealthChecker = () => mockedHealthChecker._latestHealthChecker();
const setChainSyncyingStatus = (isSyncing: boolean) => {
function setChainSyncyingStatus (isSyncing: boolean) {
getCurrentHealthChecker()._triggerHealthUpdate({
isSyncing,
peers: 1,
shouldHavePeers: true
});
};
}
beforeAll(() => {
mockSc = connectorFactory() as unknown as typeof Sc & { latestChain: () => MockChain };
mockedHealthChecker = healthCheckerFactory();
});
let mockSc: typeof Sc & { latestChain: () => MockChain };
let mockedHealthChecker: ReturnType<typeof healthCheckerFactory>;
const getCurrentHealthChecker = () => mockedHealthChecker._latestHealthChecker();
describe('ScProvider', () => {
beforeAll(() => {
mockSc = connectorFactory() as unknown as typeof Sc & { latestChain: () => MockChain };
mockedHealthChecker = healthCheckerFactory();
});
describe('on', () => {
it('emits `connected` as soon as the chain is not syncing', async () => {
const provider = new ScProvider(mockSc, '');
@@ -251,16 +250,15 @@ describe('ScProvider', () => {
setChainSyncyingStatus(false);
const onConnected = jest.fn();
provider.on('connected', onConnected);
const onDisconnected = jest.fn();
provider.on('connected', onConnected);
provider.on('disconnected', onDisconnected);
expect(onConnected).toHaveBeenCalled();
expect(onDisconnected).not.toHaveBeenCalled();
onConnected.mockRestore();
onConnected.mockReset();
setChainSyncyingStatus(true);
expect(onConnected).not.toHaveBeenCalled();
@@ -284,7 +282,7 @@ describe('ScProvider', () => {
await provider.connect(undefined, mockedHealthChecker.healthChecker);
expect(() => provider.clone()).toThrowError();
expect(() => provider.clone()).toThrow();
});
});
@@ -306,9 +304,9 @@ describe('ScProvider', () => {
setChainSyncyingStatus(false);
await expect(provider.connect(undefined, mockedHealthChecker.healthChecker)).rejects.toThrowError(
'Already connected!'
);
await expect(
provider.connect(undefined, mockedHealthChecker.healthChecker)
).rejects.toThrow(/Already connected/);
});
});
@@ -328,9 +326,8 @@ describe('ScProvider', () => {
const provider = new ScProvider(mockSc, '');
await provider.connect(undefined, mockedHealthChecker.healthChecker);
await provider.disconnect();
await expect(provider.disconnect()).resolves.not.toThrow();
await provider.disconnect();
});
});
@@ -402,9 +399,9 @@ describe('ScProvider', () => {
throw new Error('boom!');
});
await expect(provider.send('getData', ['foo'])).rejects.toThrowError(
'Disconnected'
);
await expect(
provider.send('getData', ['foo'])
).rejects.toThrow(/Disconnected/);
expect(provider.isConnected).toBe(false);
});
});
@@ -551,8 +548,7 @@ describe('ScProvider', () => {
expect(token).toBe(unsubscribeToken);
expect(cb).toHaveBeenCalledTimes(1);
expect(cb.mock.lastCall![0]).toBeInstanceOf(Error);
expect(cb.mock.lastCall![1]).toBe(undefined);
expect(cb).toHaveBeenLastCalledWith(expect.any(Error), undefined);
});
it('errors when subscribing to an unsupported method', async () => {
@@ -561,11 +557,11 @@ describe('ScProvider', () => {
await provider.connect(undefined, mockedHealthChecker.healthChecker);
setChainSyncyingStatus(false);
await wait(0);
await wait(0);
await expect(
provider.subscribe('foo', 'bar', ['baz'], () => {})
).rejects.toThrowError('Unsupported subscribe method: bar');
).rejects.toThrow(/Unsupported subscribe method: bar/);
});
});
@@ -577,9 +573,9 @@ describe('ScProvider', () => {
setChainSyncyingStatus(false);
await expect(provider.unsubscribe('', '', '')).rejects.toThrowError(
'Unable to find active subscription=::'
);
await expect(
provider.unsubscribe('', '', '')
).rejects.toThrow(/Unable to find active subscription/);
});
});
+11 -9
View File
@@ -67,18 +67,20 @@ export interface ProviderInterface {
unsubscribe (type: string, method: string, id: number | string): Promise<boolean>;
}
export interface EndpointStats {
bytesRecv: number;
bytesSent: number;
cached: number;
errors: number;
requests: number;
subscriptions: number;
timeout: number;
}
export interface ProviderStats {
active: {
requests: number;
subscriptions: number;
};
total: {
bytesRecv: number;
bytesSent: number;
cached: number;
errors: number;
requests: number;
subscriptions: number;
timeout: number;
};
total: EndpointStats;
}
+55 -46
View File
@@ -1,99 +1,109 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Mock } from '../mock/types';
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { jest } from '@jest/globals';
import type { Mock } from '../mock/types';
import { mockWs } from '../mock/mockWs';
import { WsProvider } from './';
const TEST_WS_URL = 'ws://localhost-connect.spec.ts:9988';
function sleepMs (ms = 0): Promise<void> {
function sleep (ms = 100): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, ms));
}
describe('onConnect', (): void => {
let mocks: Mock[];
let provider: WsProvider | null;
beforeEach((): void => {
jest.setTimeout(30000);
mocks = [mockWs([], TEST_WS_URL)];
});
afterEach((): void => {
jest.setTimeout(5000);
mocks.forEach((m) => {
if (m) {
m.done();
}
});
afterEach(async () => {
if (provider) {
await provider.disconnect();
await sleep();
provider = null;
}
await Promise.all(mocks.map((m) => m.done()));
await sleep();
});
it('Does not connect when autoConnect is false', async () => {
const provider: WsProvider = new WsProvider(TEST_WS_URL, 0);
provider = new WsProvider(TEST_WS_URL, 0);
await sleep();
await sleepMs(100); // Hack to give the provider time to connect
expect(provider.isConnected).toBe(false);
await provider.connect();
await sleepMs(100); // Hack to give the provider time to connect
await sleep();
expect(provider.isConnected).toBe(true);
await provider.disconnect();
await sleep();
await sleepMs(100); // Hack to give the provider time to connect
expect(provider.isConnected).toBe(false);
});
it('Does connect when autoConnect is true', async () => {
const provider: WsProvider = new WsProvider(TEST_WS_URL, 1);
provider = new WsProvider(TEST_WS_URL, 1);
await sleep();
await sleepMs(100); // Hack to give the provider time to connect
expect(provider.isConnected).toBe(true);
await provider.disconnect();
});
it('Creates a new WebSocket instance by calling the connect() method', async () => {
const provider: WsProvider = new WsProvider(TEST_WS_URL, false);
provider = new WsProvider(TEST_WS_URL, false);
expect(provider.isConnected).toBe(false);
expect(mocks[0].server.clients().length).toBe(0);
await provider.connect();
await sleepMs(100); // Hack to give the provider time to connect
await sleep();
expect(provider.isConnected).toBe(true);
expect(mocks[0].server.clients()).toHaveLength(1);
await provider.disconnect();
});
it('Connects to first endpoint when an array is given', async () => {
const provider: WsProvider = new WsProvider([TEST_WS_URL], 1);
provider = new WsProvider([TEST_WS_URL], 1);
await provider.connect();
await sleepMs(100); // Hack to give the provider time to connect
await sleep();
expect(provider.isConnected).toBe(true);
expect(mocks[0].server.clients()).toHaveLength(1);
});
it('Does not allow connect() on already-connected', async () => {
provider = new WsProvider([TEST_WS_URL], 1);
await sleep();
expect(provider.isConnected).toBe(true);
await provider.disconnect();
await expect(
provider.connect()
).rejects.toThrow(/already connected/);
});
it('Connects to the second endpoint when the first is unreachable', async () => {
/* eslint-disable @typescript-eslint/no-empty-function */
jest.spyOn(console, 'error').mockImplementation((): void => {});
const endpoints: string[] = ['ws://localhost-unreachable-connect.spec.ts:9956', TEST_WS_URL];
const endpoints: string[] = ['ws://localhost-connect.spec.ts:9956', TEST_WS_URL];
const provider: WsProvider = new WsProvider(endpoints, 1);
provider = new WsProvider(endpoints, 1);
await sleepMs(100); // Hack to give the provider time to connect
await sleep();
expect(mocks[0].server.clients()).toHaveLength(1);
expect(provider.isConnected).toBe(true);
await provider.disconnect();
});
it('Connects to the second endpoint when the first is dropped', async () => {
@@ -101,22 +111,22 @@ describe('onConnect', (): void => {
mocks.push(mockWs([], endpoints[1]));
const provider: WsProvider = new WsProvider(endpoints, 1);
provider = new WsProvider(endpoints, 1);
await sleep();
await sleepMs(100); // Hack to give the provider time to connect
// Check that first server is connected
expect(mocks[0].server.clients()).toHaveLength(1);
expect(mocks[1].server.clients()).toHaveLength(0);
// Close connection from first server
mocks[0].server.clients()[0].close();
await sleepMs(100);
await sleep();
// Check that second server is connected
expect(mocks[1].server.clients()).toHaveLength(1);
expect(provider.isConnected).toBe(true);
await provider.disconnect();
});
it('Round-robin of endpoints on WsProvider', async () => {
@@ -138,22 +148,21 @@ describe('onConnect', (): void => {
mocks[3],
mocks[0]
];
const provider: WsProvider = new WsProvider(endpoints, 1);
for (let round = 0; round < 5; round++) {
provider = new WsProvider(endpoints, 1);
for (let round = 0; round < 2; round++) {
for (let mock = 0; mock < mocks.length; mock++) {
await sleepMs(100); // Hack to give the provider time to connect
await sleep();
// Check that first server is connected and the next one isn't
// Wwe are connected, the current mock has the connection and the next doesn't
expect(provider.isConnected).toBe(true);
expect(mocks[mock].server.clients()).toHaveLength(1);
expect(mockNext[mock].server.clients()).toHaveLength(0);
expect(provider.isConnected).toBe(true);
// Close connection from first server
mocks[mock].server.clients()[0].close();
}
}
await provider.disconnect();
});
});
+11 -13
View File
@@ -22,22 +22,20 @@ const known: Record<number, string> = {
1015: 'TLS Handshake'
};
function getUnmapped (code: number): string | void {
if (code <= 1999) {
return '(For WebSocket standard)';
} else if (code <= 2999) {
return '(For WebSocket extensions)';
} else if (code <= 3999) {
return '(For libraries and frameworks)';
} else if (code <= 4999) {
return '(For applications)';
}
}
export function getWSErrorString (code: number): string {
if (code >= 0 && code <= 999) {
return '(Unused)';
} else if (code >= 1016) {
if (code <= 1999) {
return '(For WebSocket standard)';
} else if (code <= 2999) {
return '(For WebSocket extensions)';
} else if (code <= 3999) {
return '(For libraries and frameworks)';
} else if (code <= 4999) {
return '(For applications)';
}
}
return known[code] || getUnmapped(code) || '(Unknown)';
return known[code] || '(Unknown)';
}
+7 -4
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { Request } from '../mock/mockWs';
import { mockWs } from '../mock/mockWs';
@@ -22,7 +25,7 @@ function createWs (requests: Request[], autoConnect = 1000, headers?: Record<str
describe('Ws', (): void => {
afterEach(async () => {
if (mock) {
mock.done();
await mock.done();
}
if (provider) {
@@ -58,7 +61,7 @@ describe('Endpoint Parsing', (): void => {
it('Throws when WsProvider endpoint is an invalid string', () => {
expect(
() => new WsProvider('http://127.0.0.1:9955', 0)
).toThrowError(/^Endpoint should start with /);
).toThrow(/^Endpoint should start with /);
});
it('Succeeds when WsProvider endpoint is a valid array', () => {
@@ -73,7 +76,7 @@ describe('Endpoint Parsing', (): void => {
expect(
() => new WsProvider(endpoints, 0)
).toThrowError('WsProvider requires at least one Endpoint');
).toThrow('WsProvider requires at least one Endpoint');
});
it('Throws when WsProvider endpoint is an invalid array', () => {
@@ -81,6 +84,6 @@ describe('Endpoint Parsing', (): void => {
expect(
() => new WsProvider(endpoints, 0)
).toThrowError(/^Endpoint should start with /);
).toThrow(/^Endpoint should start with /);
});
});
+47 -21
View File
@@ -3,7 +3,7 @@
/* eslint-disable camelcase */
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types';
import type { EndpointStats, JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types';
import EventEmitter from 'eventemitter3';
@@ -45,8 +45,6 @@ const RETRY_DELAY = 2_500;
const DEFAULT_TIMEOUT_MS = 60 * 1000;
const TIMEOUT_INTERVAL = 5_000;
const MEGABYTE = 1024 * 1024;
const l = logger('api-ws');
function eraseRecord<T> (record: Record<string, T>, cb?: (item: T) => void): void {
@@ -59,6 +57,10 @@ function eraseRecord<T> (record: Record<string, T>, cb?: (item: T) => void): voi
});
}
function defaultEndpointStats (): EndpointStats {
return { bytesRecv: 0, bytesSent: 0, cached: 0, errors: 0, requests: 0, subscriptions: 0, timeout: 0 };
}
/**
* # @polkadot/rpc-provider/ws
*
@@ -92,6 +94,7 @@ export class WsProvider implements ProviderInterface {
#autoConnectMs: number;
#endpointIndex: number;
#endpointStats: EndpointStats;
#isConnected = false;
#subscriptions: Record<string, WsStateSubscription> = {};
#timeoutId?: ReturnType<typeof setInterval> | null = null;
@@ -128,8 +131,9 @@ export class WsProvider implements ProviderInterface {
this.#websocket = null;
this.#stats = {
active: { requests: 0, subscriptions: 0 },
total: { bytesRecv: 0, bytesSent: 0, cached: 0, errors: 0, requests: 0, subscriptions: 0, timeout: 0 }
total: defaultEndpointStats()
};
this.#endpointStats = defaultEndpointStats();
this.#timeout = timeout || DEFAULT_TIMEOUT_MS;
if (autoConnectMs > 0) {
@@ -174,6 +178,10 @@ export class WsProvider implements ProviderInterface {
return this.#isReadyPromise;
}
public get endpoint (): string {
return this.#endpoints[this.#endpointIndex];
}
/**
* @description Returns a clone of the object
*/
@@ -181,6 +189,10 @@ export class WsProvider implements ProviderInterface {
return new WsProvider(this.#endpoints);
}
protected selectEndpointIndex (endpoints: string[]): number {
return (this.#endpointIndex + 1) % endpoints.length;
}
/**
* @summary Manually connect
* @description The [[WsProvider]] connects automatically by default, however if you decided otherwise, you may
@@ -188,23 +200,20 @@ export class WsProvider implements ProviderInterface {
*/
// eslint-disable-next-line @typescript-eslint/require-await
public async connect (): Promise<void> {
if (this.#websocket) {
throw new Error('WebSocket is already connected');
}
try {
this.#endpointIndex = (this.#endpointIndex + 1) % this.#endpoints.length;
this.#endpointIndex = this.selectEndpointIndex(this.#endpoints);
// the as typeof WebSocket here is Deno-specific - not available on the globalThis
this.#websocket = typeof xglobal.WebSocket !== 'undefined' && isChildClass(xglobal.WebSocket as typeof WebSocket, WebSocket)
? new WebSocket(this.#endpoints[this.#endpointIndex])
? new WebSocket(this.endpoint)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - WS may be an instance of w3cwebsocket, which supports headers
: new WebSocket(this.#endpoints[this.#endpointIndex], undefined, undefined, this.#headers, undefined, {
// default: true
fragmentOutgoingMessages: true,
// default: 16K (bump, the Node has issues with too many fragments, e.g. on setCode)
fragmentationThreshold: 1 * MEGABYTE,
// default: 1MiB (also align with maxReceivedMessageSize)
maxReceivedFrameSize: 24 * MEGABYTE,
// default: 8MB (however Polkadot api.query.staking.erasStakers.entries(356) is over that, 16M is ok there)
maxReceivedMessageSize: 24 * MEGABYTE
// @ts-ignore - WS may be an instance of ws, which supports options
: new WebSocket(this.endpoint, undefined, {
headers: this.#headers
});
if (this.#websocket) {
@@ -277,6 +286,10 @@ export class WsProvider implements ProviderInterface {
};
}
public get endpointStats (): EndpointStats {
return this.#endpointStats;
}
/**
* @summary Listens on events after having subscribed using the [[subscribe]] function.
* @param {ProviderInterfaceEmitted} type Event
@@ -298,6 +311,7 @@ export class WsProvider implements ProviderInterface {
* @param subscription Subscription details (internally used)
*/
public send <T = any> (method: string, params: unknown[], isCacheable?: boolean, subscription?: SubscriptionHandler): Promise<T> {
this.#endpointStats.requests++;
this.#stats.total.requests++;
const [id, body] = this.#coder.encodeJson(method, params);
@@ -312,6 +326,7 @@ export class WsProvider implements ProviderInterface {
this.#callCache.set(body, resultPromise);
}
} else {
this.#endpointStats.cached++;
this.#stats.total.cached++;
}
@@ -340,9 +355,11 @@ export class WsProvider implements ProviderInterface {
start: Date.now(),
subscription
};
this.#endpointStats.bytesSent += body.length;
this.#stats.total.bytesSent += body.length;
this.#websocket.send(body);
} catch (error) {
this.#endpointStats.errors++;
this.#stats.total.errors++;
reject(error);
@@ -369,6 +386,7 @@ export class WsProvider implements ProviderInterface {
* ```
*/
public subscribe (type: string, method: string, params: unknown[], callback: ProviderInterfaceCallback): Promise<number | string> {
this.#endpointStats.subscriptions++;
this.#stats.total.subscriptions++;
// subscriptions are not cached, LRU applies to .at(<blockHash>) only
@@ -407,7 +425,7 @@ export class WsProvider implements ProviderInterface {
};
#onSocketClose = (event: CloseEvent): void => {
const error = new Error(`disconnected from ${this.#endpoints[this.#endpointIndex]}: ${event.code}:: ${event.reason || getWSErrorString(event.code)}`);
const error = new Error(`disconnected from ${this.endpoint}: ${event.code}:: ${event.reason || getWSErrorString(event.code)}`);
if (this.#autoConnectMs > 0) {
l.error(error.message);
@@ -428,8 +446,6 @@ export class WsProvider implements ProviderInterface {
this.#timeoutId = null;
}
this.#emit('disconnected');
// reject all hanging requests
eraseRecord(this.#handlers, (h) => {
try {
@@ -441,6 +457,11 @@ export class WsProvider implements ProviderInterface {
});
eraseRecord(this.#waitingForId);
// Reset stats for active endpoint
this.#endpointStats = defaultEndpointStats();
this.#emit('disconnected');
if (this.#autoConnectMs > 0) {
setTimeout((): void => {
this.connectWithRetry().catch(() => {
@@ -458,6 +479,7 @@ export class WsProvider implements ProviderInterface {
#onSocketMessage = (message: MessageEvent<string>): void => {
l.debug(() => ['received', message.data]);
this.#endpointStats.bytesRecv += message.data.length;
this.#stats.total.bytesRecv += message.data.length;
const response = JSON.parse(message.data) as JsonRpcResponse;
@@ -498,6 +520,7 @@ export class WsProvider implements ProviderInterface {
}
}
} catch (error) {
this.#endpointStats.errors++;
this.#stats.total.errors++;
handler.callback(error as Error, undefined);
@@ -528,6 +551,7 @@ export class WsProvider implements ProviderInterface {
handler.callback(null, result);
} catch (error) {
this.#endpointStats.errors++;
this.#stats.total.errors++;
handler.callback(error as Error, undefined);
@@ -539,13 +563,14 @@ export class WsProvider implements ProviderInterface {
throw new Error('WebSocket cannot be null in onOpen');
}
l.debug(() => ['connected to', this.#endpoints[this.#endpointIndex]]);
l.debug(() => ['connected to', this.endpoint]);
this.#isConnected = true;
this.#emit('connected');
this.#resubscribe();
this.#emit('connected');
return true;
};
@@ -586,6 +611,7 @@ export class WsProvider implements ProviderInterface {
// ignore
}
this.#endpointStats.timeout++;
this.#stats.total.timeout++;
delete this.#handlers[ids[i]];
}
+5 -3
View File
@@ -1,7 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Constructor } from '@polkadot/types/types';
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { Request } from '../mock/mockWs';
import { mockWs } from '../mock/mockWs';
@@ -26,7 +28,7 @@ function createWs (autoConnect = 1000): Promise<WsProvider> {
}
describe('send', (): void => {
let globalWs: Constructor<WebSocket>;
let globalWs: typeof WebSocket;
beforeEach((): void => {
globalWs = global.WebSocket;
@@ -36,7 +38,7 @@ describe('send', (): void => {
global.WebSocket = globalWs;
if (mock) {
mock.done();
await mock.done();
}
if (provider) {
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { WsProvider } from './';
describe('state', (): void => {
@@ -1,7 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Constructor } from '@polkadot/types/types';
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { Request } from '../mock/mockWs';
import type { Global, Mock } from './../mock/types';
@@ -26,7 +28,7 @@ function createWs (autoConnect = 1000): Promise<WsProvider> {
}
describe('subscribe', (): void => {
let globalWs: Constructor<WebSocket>;
let globalWs: typeof WebSocket;
beforeEach((): void => {
globalWs = global.WebSocket;
@@ -36,7 +38,7 @@ describe('subscribe', (): void => {
global.WebSocket = globalWs;
if (mock) {
mock.done();
await mock.done();
}
if (provider) {
@@ -1,7 +1,9 @@
// Copyright 2017-2023 @polkadot/rpc-provider authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Constructor } from '@polkadot/types/types';
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import type { Request } from '../mock/mockWs';
import type { Global, Mock } from './../mock/types';
@@ -26,7 +28,7 @@ function createWs (autoConnect = 1000): Promise<WsProvider> {
}
describe('subscribe', (): void => {
let globalWs: Constructor<WebSocket>;
let globalWs: typeof WebSocket;
beforeEach((): void => {
globalWs = global.WebSocket;
@@ -36,7 +38,7 @@ describe('subscribe', (): void => {
global.WebSocket = globalWs;
if (mock) {
mock.done();
await mock.done();
}
if (provider) {
@@ -45,7 +47,7 @@ describe('subscribe', (): void => {
}
});
it('removes subscriptions', (): Promise<boolean> => {
it('removes subscriptions', async (): Promise<void> => {
createMock([
{
id: 1,
@@ -63,7 +65,7 @@ describe('subscribe', (): void => {
}
]);
return createWs().then((ws) =>
await createWs().then((ws) =>
ws
.subscribe('test', 'subscribe_test', [], (cb): void => {
expect(cb).toEqual(expect.anything());
+20 -23
View File
@@ -20,34 +20,31 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
"polkadot-types-from-chain": "./scripts/polkadot-types-from-chain.cjs",
"polkadot-types-from-defs": "./scripts/polkadot-types-from-defs.cjs",
"polkadot-types-internal-interfaces": "./scripts/polkadot-types-internal-interfaces.cjs",
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
"polkadot-types-from-chain": "./scripts/polkadot-types-from-chain.mjs",
"polkadot-types-from-defs": "./scripts/polkadot-types-from-defs.mjs",
"polkadot-types-internal-interfaces": "./scripts/polkadot-types-internal-interfaces.mjs",
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
},
"dependencies": {
"@babel/core": "^7.20.12",
"@babel/register": "^7.18.9",
"@babel/runtime": "^7.20.13",
"@polkadot/api": "9.14.1",
"@polkadot/api-augment": "9.14.1",
"@polkadot/rpc-augment": "9.14.1",
"@polkadot/rpc-provider": "9.14.1",
"@polkadot/types": "9.14.1",
"@polkadot/types-augment": "9.14.1",
"@polkadot/types-codec": "9.14.1",
"@polkadot/types-create": "9.14.1",
"@polkadot/types-support": "9.14.1",
"@polkadot/util": "^10.4.1",
"@polkadot/util-crypto": "^10.4.1",
"@polkadot/x-ws": "^10.4.1",
"@polkadot/api": "10.0.1",
"@polkadot/api-augment": "10.0.1",
"@polkadot/rpc-augment": "10.0.1",
"@polkadot/rpc-provider": "10.0.1",
"@polkadot/types": "10.0.1",
"@polkadot/types-augment": "10.0.1",
"@polkadot/types-codec": "10.0.1",
"@polkadot/types-create": "10.0.1",
"@polkadot/types-support": "10.0.1",
"@polkadot/util": "^11.0.1",
"@polkadot/util-crypto": "^11.0.1",
"@polkadot/x-ws": "^11.0.1",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.6.2"
"tslib": "^2.5.0",
"yargs": "^17.7.1"
},
"devDependencies": {
"@types/websocket": "^1.0.5",
-36
View File
@@ -1,36 +0,0 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = function (file) {
let main;
try {
main = require(`../cjs/${file}.js`).main;
} catch (error) {
// required for dev-only setups
process.env.JEST_WORKER_ID = '123';
// register aliases
require('@babel/register')({
extensions: ['.js', '.ts'],
plugins: [
['module-resolver', {
alias: {
'^@polkadot/api-(augment|base|derive)(.*)': './packages/api-\\1/src\\2',
// eslint-disable-next-line sort-keys
'^@polkadot/api(.*)': './packages/api/src/\\1',
'^@polkadot/rpc-(augment|core|provider)(.*)': './packages/rpc-\\1/src\\2',
'^@polkadot/types-(augment|codec|create|known|metadata|support)(.*)': './packages/types-\\1/src\\2',
// eslint-disable-next-line sort-keys
'^@polkadot/types(.*)': './packages/types/src\\1'
}
}]
]
});
// get ts source
main = require(`../src/${file}.ts`).main;
}
main();
};
@@ -2,4 +2,6 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
require('./execWithSrc.cjs')('fromChain');
import { main } from '@polkadot/typegen/extractChain';
main();
@@ -2,4 +2,6 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
require('./execWithSrc.cjs')('interfacesTs');
import { main } from '@polkadot/typegen/fromChain';
main();
@@ -2,4 +2,6 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
require('./execWithSrc.cjs')('fromDefs');
import { main } from '@polkadot/typegen/fromDefs';
main();
@@ -0,0 +1,7 @@
#!/usr/bin/env node
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { main } from '@polkadot/typegen/interfacesTs';
main();
@@ -1,5 +0,0 @@
#!/usr/bin/env node
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
require('./execWithSrc.cjs')('metadataMd');
@@ -2,4 +2,6 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
require('./execWithSrc.cjs')('extractChain');
import { main } from '@polkadot/typegen/metadataMd';
main();
+33 -16
View File
@@ -3,16 +3,17 @@
import type { HexString } from '@polkadot/util/types';
import fs from 'fs';
import path from 'path';
import yargs from 'yargs';
import { Definitions } from '@polkadot/types/types';
import { formatNumber } from '@polkadot/util';
import { Definitions, DefinitionsTypes } from '@polkadot/types/types';
import { formatNumber, isHex } from '@polkadot/util';
import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTx } from './generate';
import { assertDir, assertFile, getMetadataViaWs, HEADER, writeFile } from './util';
function generate (metaHex: HexString, pkg: string | undefined, output: string, isStrict?: boolean): void {
async function generate (metaHex: HexString, pkg: string | undefined, output: string, isStrict?: boolean): Promise<void> {
console.log(`Generating from metadata, ${formatNumber((metaHex.length - 2) / 2)} bytes`);
const outputPath = assertDir(path.join(process.cwd(), output));
@@ -21,9 +22,12 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string,
if (pkg) {
try {
const defPath = assertFile(path.join(outputPath, 'definitions.ts'));
const defCont = await import(defPath) as { module: any };
extraTypes = {
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-argument
[pkg]: require(assertFile(path.join(outputPath, 'definitions.ts'))) as Record<string, any>
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
[pkg]: defCont.module
};
} catch (error) {
console.error('ERROR: No custom definitions found:', (error as Error).message);
@@ -31,10 +35,12 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string,
}
try {
const lookPath = assertFile(path.join(outputPath, 'lookup.ts'));
const lookCont = await import(lookPath) as { module: { default: DefinitionsTypes } };
customLookupDefinitions = {
rpc: {},
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires
types: require(assertFile(path.join(outputPath, 'lookup.ts'))).default
types: lookCont.module.default
};
} catch (error) {
console.error('ERROR: No lookup definitions found:', (error as Error).message);
@@ -64,7 +70,7 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string,
type ArgV = { endpoint: string; output: string; package?: string; strict?: boolean };
export function main (): void {
async function mainPromise (): Promise<void> {
const { endpoint, output, package: pkg, strict: isStrict } = yargs.strict().options({
endpoint: {
description: 'The endpoint to connect to (e.g. wss://kusama-rpc.polkadot.io) or relative path to a file containing the JSON output of an RPC state_getMetadata call',
@@ -86,14 +92,25 @@ export function main (): void {
}
}).argv as ArgV;
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
getMetadataViaWs(endpoint)
.then((metadata) => generate(metadata, pkg, output, isStrict))
.catch(() => process.exit(1));
} else {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const metadata = (require(assertFile(path.join(process.cwd(), endpoint))) as Record<string, HexString>).result;
let metadata: HexString;
generate(metadata, pkg, output, isStrict);
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
metadata = await getMetadataViaWs(endpoint);
} else {
metadata = (
JSON.parse(
fs.readFileSync(assertFile(path.join(process.cwd(), endpoint)), 'utf-8')
) as { result: HexString }
).result;
if (!isHex(metadata)) {
throw new Error('Invalid metadata file');
}
}
await generate(metadata, pkg, output, isStrict);
}
export function main (): void {
mainPromise().catch(() => process.exit(1));
}
+25 -11
View File
@@ -3,10 +3,12 @@
import type { HexString } from '@polkadot/util/types';
import fs from 'fs';
import path from 'path';
import yargs from 'yargs';
import * as substrateDefs from '@polkadot/types/interfaces/definitions';
import { isHex } from '@polkadot/util';
import { generateInterfaceTypes } from './generate/interfaceRegistry';
import { generateTsDef } from './generate/tsDef';
@@ -15,7 +17,7 @@ import { assertDir, assertFile, getMetadataViaWs } from './util';
type ArgV = { input: string; package: string; endpoint?: string; };
export function main (): void {
async function mainPromise (): Promise<void> {
const { endpoint, input, package: pkg } = yargs.strict().options({
endpoint: {
description: 'The endpoint to connect to (e.g. wss://kusama-rpc.polkadot.io) or relative path to a file containing the JSON output of an RPC state_getMetadata call',
@@ -37,8 +39,9 @@ export function main (): void {
let userDefs: Record<string, any> = {};
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
userDefs = require(assertFile(path.join(inputPath, 'definitions.ts'))) as Record<string, any>;
userDefs = await import(
assertFile(path.join(inputPath, 'definitions.ts'))
) as Record<string, any>;
} catch (error) {
console.error('ERROR: Unable to load user definitions:', (error as Error).message);
}
@@ -70,15 +73,26 @@ export function main (): void {
generateInterfaceTypes(allDefs, path.join(inputPath, 'augment-types.ts'));
if (endpoint) {
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
getMetadataViaWs(endpoint)
.then((metadata) => generateDefaultLookup(inputPath, metadata))
.catch(() => process.exit(1));
} else {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const metaHex = (require(assertFile(path.join(process.cwd(), endpoint))) as Record<string, HexString>).result;
let metadata: HexString;
generateDefaultLookup(inputPath, metaHex);
if (endpoint.startsWith('wss://') || endpoint.startsWith('ws://')) {
metadata = await getMetadataViaWs(endpoint);
} else {
metadata = (
JSON.parse(
fs.readFileSync(assertFile(path.join(process.cwd(), endpoint)), 'utf-8')
) as { result: HexString }
).result;
if (!isHex(metadata)) {
throw new Error('Invalid metadata file');
}
}
generateDefaultLookup(inputPath, metadata);
}
}
export function main (): void {
mainPromise().catch(() => process.exit(1));
}
+2 -4
View File
@@ -50,16 +50,14 @@ function entrySignature (lookup: PortableRegistry, allDefs: Record<string, Modul
storageEntry.modifier.isOptional
? 'Option'
: null,
defValue.lookupName
? undefined
: defValue.type
defValue.lookupName || defValue.type
]);
return [
storageEntry.modifier.isOptional,
keyDefs.map((k) => formatType(registry, allDefs, k.lookupName || k.type, imports)).join(', '),
keyTypes.map((t, i) => `arg${keyTypes.length === 1 ? '' : (i + 1)}: ${t}`).join(', '),
formatType(registry, allDefs, outputType, imports)
outputType.lookupName || formatType(registry, allDefs, outputType, imports)
];
}
+1 -1
View File
@@ -5,7 +5,7 @@ import type { MetadataLatest, SiLookupTypeId } from '@polkadot/types/interfaces'
import type { PortableRegistry } from '@polkadot/types/metadata';
import type { Codec, DefinitionRpcParam } from '@polkadot/types/types';
import fs from 'fs';
import fs from 'node:fs';
import { Metadata, TypeRegistry, Vec } from '@polkadot/types';
import * as definitions from '@polkadot/types/interfaces/definitions';
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '9.14.1' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.0.1' };
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import fs from 'fs';
import fs from 'node:fs';
import { assert } from '@polkadot/util';
+4 -6
View File
@@ -1,13 +1,15 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { TypeRegistry } from '@polkadot/types/create';
import { getSimilarTypes } from './derived';
describe('getSimilarTypes', (): void => {
let registry: TypeRegistry;
const registry = new TypeRegistry();
const mockImports = {
codecTypes: {},
definitions: {},
@@ -22,10 +24,6 @@ describe('getSimilarTypes', (): void => {
typesTypes: {}
};
beforeAll((): void => {
registry = new TypeRegistry();
});
it('handles nested Tuples', (): void => {
expect(getSimilarTypes(registry, {}, '(AccountId, (Balance, u32), u64)', mockImports)).toEqual([
'ITuple<[AccountId, ITuple<[Balance, u32]>, u64]>',
+4 -3
View File
@@ -1,8 +1,9 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { packageInfo } from '../packageInfo';
@@ -25,7 +26,7 @@ export function writeFile (dest: string, generator: () => string, noLog?: boolea
export function readTemplate (template: string): string {
// Inside the api repo itself, it will be 'auto'
const rootDir = packageInfo.path === 'auto'
? path.join(__dirname, '..')
? path.join(process.cwd(), 'packages/typegen/src')
: packageInfo.path;
// NOTE With cjs in a subdir, search one lower as well
@@ -1,6 +1,9 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line spaced-comment
/// <reference types="@polkadot/dev/node/test/node" />
import { TypeRegistry } from '@polkadot/types';
import { formatType } from './formatting';
+5 -5
View File
@@ -20,12 +20,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "9.14.1",
"version": "10.0.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.20.13",
"@polkadot/types": "9.14.1",
"@polkadot/types-codec": "9.14.1",
"@polkadot/util": "^10.4.1"
"@polkadot/types": "10.0.1",
"@polkadot/types-codec": "10.0.1",
"@polkadot/util": "^11.0.1",
"tslib": "^2.5.0"
}
}
+1 -1
View File
@@ -164,7 +164,7 @@ export default {
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
},
/**
* Lookup871: kusama_runtime::Runtime
* Lookup880: kusama_runtime::Runtime
**/
KusamaRuntimeRuntime: 'Null'
};
+111 -93
View File
@@ -382,7 +382,10 @@ export default {
},
PalletInstance: 'u8',
GeneralIndex: 'Compact<u128>',
GeneralKey: '[u8;32]',
GeneralKey: {
length: 'u8',
data: '[u8;32]',
},
OnlyChild: 'Null',
Plurality: {
id: 'XcmV3JunctionBodyId',
@@ -1108,7 +1111,7 @@ export default {
votes16: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);15],Compact<u16>)>'
},
/**
* Lookup394: polkadot_runtime_parachains::configuration::pallet::Call<T>
* Lookup395: polkadot_runtime_parachains::configuration::pallet::Call<T>
**/
PolkadotRuntimeParachainsConfigurationPalletCall: {
_enum: {
@@ -1380,15 +1383,15 @@ export default {
}
},
/**
* Lookup395: polkadot_runtime_parachains::shared::pallet::Call<T>
* Lookup396: polkadot_runtime_parachains::shared::pallet::Call<T>
**/
PolkadotRuntimeParachainsSharedPalletCall: 'Null',
/**
* Lookup396: polkadot_runtime_parachains::inclusion::pallet::Call<T>
* Lookup397: polkadot_runtime_parachains::inclusion::pallet::Call<T>
**/
PolkadotRuntimeParachainsInclusionPalletCall: 'Null',
/**
* Lookup397: polkadot_runtime_parachains::paras_inherent::pallet::Call<T>
* Lookup398: polkadot_runtime_parachains::paras_inherent::pallet::Call<T>
**/
PolkadotRuntimeParachainsParasInherentPalletCall: {
_enum: {
@@ -1398,7 +1401,7 @@ export default {
}
},
/**
* Lookup398: polkadot_primitives::v2::InherentData<sp_runtime::generic::header::Header<Number, sp_runtime::traits::BlakeTwo256>>
* Lookup399: polkadot_primitives::v2::InherentData<sp_runtime::generic::header::Header<Number, sp_runtime::traits::BlakeTwo256>>
**/
PolkadotPrimitivesV2InherentData: {
bitfields: 'Vec<PolkadotPrimitivesV2SignedUncheckedSigned>',
@@ -1407,7 +1410,7 @@ export default {
parentHeader: 'SpRuntimeHeader'
},
/**
* Lookup400: polkadot_primitives::v2::signed::UncheckedSigned<polkadot_primitives::v2::AvailabilityBitfield, polkadot_primitives::v2::AvailabilityBitfield>
* Lookup401: polkadot_primitives::v2::signed::UncheckedSigned<polkadot_primitives::v2::AvailabilityBitfield, polkadot_primitives::v2::AvailabilityBitfield>
**/
PolkadotPrimitivesV2SignedUncheckedSigned: {
payload: 'BitVec',
@@ -1415,15 +1418,15 @@ export default {
signature: 'PolkadotPrimitivesV2ValidatorAppSignature'
},
/**
* Lookup403: bitvec::order::Lsb0
* Lookup404: bitvec::order::Lsb0
**/
BitvecOrderLsb0: 'Null',
/**
* Lookup405: polkadot_primitives::v2::validator_app::Signature
* Lookup406: polkadot_primitives::v2::validator_app::Signature
**/
PolkadotPrimitivesV2ValidatorAppSignature: 'SpCoreSr25519Signature',
/**
* Lookup407: polkadot_primitives::v2::BackedCandidate<primitive_types::H256>
* Lookup408: polkadot_primitives::v2::BackedCandidate<primitive_types::H256>
**/
PolkadotPrimitivesV2BackedCandidate: {
candidate: 'PolkadotPrimitivesV2CommittedCandidateReceipt',
@@ -1431,14 +1434,14 @@ export default {
validatorIndices: 'BitVec'
},
/**
* Lookup408: polkadot_primitives::v2::CommittedCandidateReceipt<primitive_types::H256>
* Lookup409: polkadot_primitives::v2::CommittedCandidateReceipt<primitive_types::H256>
**/
PolkadotPrimitivesV2CommittedCandidateReceipt: {
descriptor: 'PolkadotPrimitivesV2CandidateDescriptor',
commitments: 'PolkadotPrimitivesV2CandidateCommitments'
},
/**
* Lookup409: polkadot_primitives::v2::CandidateCommitments<N>
* Lookup410: polkadot_primitives::v2::CandidateCommitments<N>
**/
PolkadotPrimitivesV2CandidateCommitments: {
upwardMessages: 'Vec<Bytes>',
@@ -1449,14 +1452,14 @@ export default {
hrmpWatermark: 'u32'
},
/**
* Lookup411: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
* Lookup413: polkadot_core_primitives::OutboundHrmpMessage<polkadot_parachain::primitives::Id>
**/
PolkadotCorePrimitivesOutboundHrmpMessage: {
recipient: 'u32',
data: 'Bytes'
},
/**
* Lookup415: polkadot_primitives::v2::ValidityAttestation
* Lookup418: polkadot_primitives::v2::ValidityAttestation
**/
PolkadotPrimitivesV2ValidityAttestation: {
_enum: {
@@ -1466,7 +1469,7 @@ export default {
}
},
/**
* Lookup417: polkadot_primitives::v2::DisputeStatementSet
* Lookup420: polkadot_primitives::v2::DisputeStatementSet
**/
PolkadotPrimitivesV2DisputeStatementSet: {
candidateHash: 'H256',
@@ -1474,7 +1477,7 @@ export default {
statements: 'Vec<(PolkadotPrimitivesV2DisputeStatement,u32,PolkadotPrimitivesV2ValidatorAppSignature)>'
},
/**
* Lookup420: polkadot_primitives::v2::DisputeStatement
* Lookup423: polkadot_primitives::v2::DisputeStatement
**/
PolkadotPrimitivesV2DisputeStatement: {
_enum: {
@@ -1483,7 +1486,7 @@ export default {
}
},
/**
* Lookup421: polkadot_primitives::v2::ValidDisputeStatementKind
* Lookup424: polkadot_primitives::v2::ValidDisputeStatementKind
**/
PolkadotPrimitivesV2ValidDisputeStatementKind: {
_enum: {
@@ -1494,13 +1497,13 @@ export default {
}
},
/**
* Lookup422: polkadot_primitives::v2::InvalidDisputeStatementKind
* Lookup425: polkadot_primitives::v2::InvalidDisputeStatementKind
**/
PolkadotPrimitivesV2InvalidDisputeStatementKind: {
_enum: ['Explicit']
},
/**
* Lookup423: polkadot_runtime_parachains::paras::pallet::Call<T>
* Lookup426: polkadot_runtime_parachains::paras::pallet::Call<T>
**/
PolkadotRuntimeParachainsParasPalletCall: {
_enum: {
@@ -1537,7 +1540,7 @@ export default {
}
},
/**
* Lookup424: polkadot_primitives::v2::PvfCheckStatement
* Lookup427: polkadot_primitives::v2::PvfCheckStatement
**/
PolkadotPrimitivesV2PvfCheckStatement: {
accept: 'bool',
@@ -1546,7 +1549,7 @@ export default {
validatorIndex: 'u32'
},
/**
* Lookup425: polkadot_runtime_parachains::initializer::pallet::Call<T>
* Lookup428: polkadot_runtime_parachains::initializer::pallet::Call<T>
**/
PolkadotRuntimeParachainsInitializerPalletCall: {
_enum: {
@@ -1556,11 +1559,11 @@ export default {
}
},
/**
* Lookup426: polkadot_runtime_parachains::dmp::pallet::Call<T>
* Lookup429: polkadot_runtime_parachains::dmp::pallet::Call<T>
**/
PolkadotRuntimeParachainsDmpPalletCall: 'Null',
/**
* Lookup427: polkadot_runtime_parachains::ump::pallet::Call<T>
* Lookup430: polkadot_runtime_parachains::ump::pallet::Call<T>
**/
PolkadotRuntimeParachainsUmpPalletCall: {
_enum: {
@@ -1571,7 +1574,7 @@ export default {
}
},
/**
* Lookup428: polkadot_runtime_parachains::hrmp::pallet::Call<T>
* Lookup431: polkadot_runtime_parachains::hrmp::pallet::Call<T>
**/
PolkadotRuntimeParachainsHrmpPalletCall: {
_enum: {
@@ -1610,13 +1613,13 @@ export default {
}
},
/**
* Lookup429: polkadot_runtime_parachains::disputes::pallet::Call<T>
* Lookup432: polkadot_runtime_parachains::disputes::pallet::Call<T>
**/
PolkadotRuntimeParachainsDisputesPalletCall: {
_enum: ['force_unfreeze']
},
/**
* Lookup430: polkadot_runtime_common::paras_registrar::pallet::Call<T>
* Lookup433: polkadot_runtime_common::paras_registrar::pallet::Call<T>
**/
PolkadotRuntimeCommonParasRegistrarPalletCall: {
_enum: {
@@ -1657,7 +1660,7 @@ export default {
}
},
/**
* Lookup431: polkadot_runtime_common::slots::pallet::Call<T>
* Lookup434: polkadot_runtime_common::slots::pallet::Call<T>
**/
PolkadotRuntimeCommonSlotsPalletCall: {
_enum: {
@@ -1677,7 +1680,7 @@ export default {
}
},
/**
* Lookup432: polkadot_runtime_common::auctions::pallet::Call<T>
* Lookup435: polkadot_runtime_common::auctions::pallet::Call<T>
**/
PolkadotRuntimeCommonAuctionsPalletCall: {
_enum: {
@@ -1696,7 +1699,7 @@ export default {
}
},
/**
* Lookup434: polkadot_runtime_common::crowdloan::pallet::Call<T>
* Lookup437: polkadot_runtime_common::crowdloan::pallet::Call<T>
**/
PolkadotRuntimeCommonCrowdloanPalletCall: {
_enum: {
@@ -1745,7 +1748,7 @@ export default {
}
},
/**
* Lookup436: sp_runtime::MultiSigner
* Lookup439: sp_runtime::MultiSigner
**/
SpRuntimeMultiSigner: {
_enum: {
@@ -1755,11 +1758,11 @@ export default {
}
},
/**
* Lookup437: sp_core::ecdsa::Public
* Lookup440: sp_core::ecdsa::Public
**/
SpCoreEcdsaPublic: '[u8;33]',
/**
* Lookup442: pallet_xcm::pallet::Call<T>
* Lookup445: pallet_xcm::pallet::Call<T>
**/
PalletXcmCall: {
_enum: {
@@ -1813,7 +1816,7 @@ export default {
}
},
/**
* Lookup443: xcm::VersionedXcm<RuntimeCall>
* Lookup446: xcm::VersionedXcm<RuntimeCall>
**/
XcmVersionedXcm: {
_enum: {
@@ -1824,11 +1827,11 @@ export default {
}
},
/**
* Lookup444: xcm::v2::Xcm<RuntimeCall>
* Lookup447: xcm::v2::Xcm<RuntimeCall>
**/
XcmV2Xcm: 'Vec<XcmV2Instruction>',
/**
* Lookup446: xcm::v2::Instruction<RuntimeCall>
* Lookup449: xcm::v2::Instruction<RuntimeCall>
**/
XcmV2Instruction: {
_enum: {
@@ -1926,7 +1929,7 @@ export default {
}
},
/**
* Lookup447: xcm::v2::Response
* Lookup450: xcm::v2::Response
**/
XcmV2Response: {
_enum: {
@@ -1937,7 +1940,7 @@ export default {
}
},
/**
* Lookup450: xcm::v2::traits::Error
* Lookup453: xcm::v2::traits::Error
**/
XcmV2TraitsError: {
_enum: {
@@ -1970,7 +1973,7 @@ export default {
}
},
/**
* Lookup451: xcm::v2::multiasset::MultiAssetFilter
* Lookup454: xcm::v2::multiasset::MultiAssetFilter
**/
XcmV2MultiassetMultiAssetFilter: {
_enum: {
@@ -1979,7 +1982,7 @@ export default {
}
},
/**
* Lookup452: xcm::v2::multiasset::WildMultiAsset
* Lookup455: xcm::v2::multiasset::WildMultiAsset
**/
XcmV2MultiassetWildMultiAsset: {
_enum: {
@@ -1991,13 +1994,13 @@ export default {
}
},
/**
* Lookup453: xcm::v2::multiasset::WildFungibility
* Lookup456: xcm::v2::multiasset::WildFungibility
**/
XcmV2MultiassetWildFungibility: {
_enum: ['Fungible', 'NonFungible']
},
/**
* Lookup454: xcm::v2::WeightLimit
* Lookup457: xcm::v2::WeightLimit
**/
XcmV2WeightLimit: {
_enum: {
@@ -2006,13 +2009,13 @@ export default {
}
},
/**
* Lookup570: polkadot_runtime_common::claims::pallet::Error<T>
* Lookup576: polkadot_runtime_common::claims::pallet::Error<T>
**/
PolkadotRuntimeCommonClaimsPalletError: {
_enum: ['InvalidEthereumSignature', 'SignerHasNoClaim', 'SenderHasNoClaim', 'PotUnderflow', 'InvalidStatement', 'VestedBalanceExists']
},
/**
* Lookup645: polkadot_runtime_parachains::configuration::HostConfiguration<BlockNumber>
* Lookup651: polkadot_runtime_parachains::configuration::HostConfiguration<BlockNumber>
**/
PolkadotRuntimeParachainsConfigurationHostConfiguration: {
maxCodeSize: 'u32',
@@ -2059,20 +2062,20 @@ export default {
minimumValidationUpgradeDelay: 'u32'
},
/**
* Lookup648: polkadot_runtime_parachains::configuration::pallet::Error<T>
* Lookup654: polkadot_runtime_parachains::configuration::pallet::Error<T>
**/
PolkadotRuntimeParachainsConfigurationPalletError: {
_enum: ['InvalidNewValue']
},
/**
* Lookup651: polkadot_runtime_parachains::inclusion::AvailabilityBitfieldRecord<N>
* Lookup657: polkadot_runtime_parachains::inclusion::AvailabilityBitfieldRecord<N>
**/
PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord: {
bitfield: 'BitVec',
submittedAt: 'u32'
},
/**
* Lookup652: polkadot_runtime_parachains::inclusion::CandidatePendingAvailability<primitive_types::H256, N>
* Lookup658: polkadot_runtime_parachains::inclusion::CandidatePendingAvailability<primitive_types::H256, N>
**/
PolkadotRuntimeParachainsInclusionCandidatePendingAvailability: {
_alias: {
@@ -2088,13 +2091,13 @@ export default {
backingGroup: 'u32'
},
/**
* Lookup653: polkadot_runtime_parachains::inclusion::pallet::Error<T>
* Lookup659: polkadot_runtime_parachains::inclusion::pallet::Error<T>
**/
PolkadotRuntimeParachainsInclusionPalletError: {
_enum: ['UnsortedOrDuplicateValidatorIndices', 'UnsortedOrDuplicateDisputeStatementSet', 'UnsortedOrDuplicateBackedCandidates', 'UnexpectedRelayParent', 'WrongBitfieldSize', 'BitfieldAllZeros', 'BitfieldDuplicateOrUnordered', 'ValidatorIndexOutOfBounds', 'InvalidBitfieldSignature', 'UnscheduledCandidate', 'CandidateScheduledBeforeParaFree', 'WrongCollator', 'ScheduledOutOfOrder', 'HeadDataTooLarge', 'PrematureCodeUpgrade', 'NewCodeTooLarge', 'CandidateNotInParentContext', 'InvalidGroupIndex', 'InsufficientBacking', 'InvalidBacking', 'NotCollatorSigned', 'ValidationDataHashMismatch', 'IncorrectDownwardMessageHandling', 'InvalidUpwardMessages', 'HrmpWatermarkMishandling', 'InvalidOutboundHrmp', 'InvalidValidationCodeHash', 'ParaHeadMismatch', 'BitfieldReferencesFreedCore']
},
/**
* Lookup654: polkadot_primitives::v2::ScrapedOnChainVotes<primitive_types::H256>
* Lookup660: polkadot_primitives::v2::ScrapedOnChainVotes<primitive_types::H256>
**/
PolkadotPrimitivesV2ScrapedOnChainVotes: {
session: 'u32',
@@ -2102,38 +2105,38 @@ export default {
disputes: 'Vec<PolkadotPrimitivesV2DisputeStatementSet>'
},
/**
* Lookup659: polkadot_runtime_parachains::paras_inherent::pallet::Error<T>
* Lookup665: polkadot_runtime_parachains::paras_inherent::pallet::Error<T>
**/
PolkadotRuntimeParachainsParasInherentPalletError: {
_enum: ['TooManyInclusionInherents', 'InvalidParentHeader', 'CandidateConcludedInvalid', 'InherentOverweight', 'DisputeStatementsUnsortedOrDuplicates', 'DisputeInvalid']
},
/**
* Lookup661: polkadot_runtime_parachains::scheduler::ParathreadClaimQueue
* Lookup667: polkadot_runtime_parachains::scheduler::ParathreadClaimQueue
**/
PolkadotRuntimeParachainsSchedulerParathreadClaimQueue: {
queue: 'Vec<PolkadotRuntimeParachainsSchedulerQueuedParathread>',
nextCoreOffset: 'u32'
},
/**
* Lookup663: polkadot_runtime_parachains::scheduler::QueuedParathread
* Lookup669: polkadot_runtime_parachains::scheduler::QueuedParathread
**/
PolkadotRuntimeParachainsSchedulerQueuedParathread: {
claim: 'PolkadotPrimitivesV2ParathreadEntry',
coreOffset: 'u32'
},
/**
* Lookup664: polkadot_primitives::v2::ParathreadEntry
* Lookup670: polkadot_primitives::v2::ParathreadEntry
**/
PolkadotPrimitivesV2ParathreadEntry: {
claim: 'PolkadotPrimitivesV2ParathreadClaim',
retries: 'u32'
},
/**
* Lookup665: polkadot_primitives::v2::ParathreadClaim
* Lookup671: polkadot_primitives::v2::ParathreadClaim
**/
PolkadotPrimitivesV2ParathreadClaim: '(u32,PolkadotPrimitivesV2CollatorAppPublic)',
/**
* Lookup668: polkadot_primitives::v2::CoreOccupied
* Lookup674: polkadot_primitives::v2::CoreOccupied
**/
PolkadotPrimitivesV2CoreOccupied: {
_enum: {
@@ -2142,7 +2145,7 @@ export default {
}
},
/**
* Lookup671: polkadot_runtime_parachains::scheduler::CoreAssignment
* Lookup677: polkadot_runtime_parachains::scheduler::CoreAssignment
**/
PolkadotRuntimeParachainsSchedulerCoreAssignment: {
core: 'u32',
@@ -2151,7 +2154,7 @@ export default {
groupIdx: 'u32'
},
/**
* Lookup672: polkadot_runtime_parachains::scheduler::AssignmentKind
* Lookup678: polkadot_runtime_parachains::scheduler::AssignmentKind
**/
PolkadotRuntimeParachainsSchedulerAssignmentKind: {
_enum: {
@@ -2160,7 +2163,7 @@ export default {
}
},
/**
* Lookup673: polkadot_runtime_parachains::paras::PvfCheckActiveVoteState<BlockNumber>
* Lookup679: polkadot_runtime_parachains::paras::PvfCheckActiveVoteState<BlockNumber>
**/
PolkadotRuntimeParachainsParasPvfCheckActiveVoteState: {
votesAccept: 'BitVec',
@@ -2170,7 +2173,7 @@ export default {
causes: 'Vec<PolkadotRuntimeParachainsParasPvfCheckCause>'
},
/**
* Lookup675: polkadot_runtime_parachains::paras::PvfCheckCause<BlockNumber>
* Lookup681: polkadot_runtime_parachains::paras::PvfCheckCause<BlockNumber>
**/
PolkadotRuntimeParachainsParasPvfCheckCause: {
_enum: {
@@ -2182,39 +2185,39 @@ export default {
}
},
/**
* Lookup677: polkadot_runtime_parachains::paras::ParaLifecycle
* Lookup683: polkadot_runtime_parachains::paras::ParaLifecycle
**/
PolkadotRuntimeParachainsParasParaLifecycle: {
_enum: ['Onboarding', 'Parathread', 'Parachain', 'UpgradingParathread', 'DowngradingParachain', 'OffboardingParathread', 'OffboardingParachain']
},
/**
* Lookup679: polkadot_runtime_parachains::paras::ParaPastCodeMeta<N>
* Lookup685: polkadot_runtime_parachains::paras::ParaPastCodeMeta<N>
**/
PolkadotRuntimeParachainsParasParaPastCodeMeta: {
upgradeTimes: 'Vec<PolkadotRuntimeParachainsParasReplacementTimes>',
lastPruned: 'Option<u32>'
},
/**
* Lookup681: polkadot_runtime_parachains::paras::ReplacementTimes<N>
* Lookup687: polkadot_runtime_parachains::paras::ReplacementTimes<N>
**/
PolkadotRuntimeParachainsParasReplacementTimes: {
expectedAt: 'u32',
activatedAt: 'u32'
},
/**
* Lookup683: polkadot_primitives::v2::UpgradeGoAhead
* Lookup689: polkadot_primitives::v2::UpgradeGoAhead
**/
PolkadotPrimitivesV2UpgradeGoAhead: {
_enum: ['Abort', 'GoAhead']
},
/**
* Lookup684: polkadot_primitives::v2::UpgradeRestriction
* Lookup690: polkadot_primitives::v2::UpgradeRestriction
**/
PolkadotPrimitivesV2UpgradeRestriction: {
_enum: ['Present']
},
/**
* Lookup685: polkadot_runtime_parachains::paras::ParaGenesisArgs
* Lookup691: polkadot_runtime_parachains::paras::ParaGenesisArgs
**/
PolkadotRuntimeParachainsParasParaGenesisArgs: {
genesisHead: 'Bytes',
@@ -2222,13 +2225,13 @@ export default {
paraKind: 'bool'
},
/**
* Lookup686: polkadot_runtime_parachains::paras::pallet::Error<T>
* Lookup692: polkadot_runtime_parachains::paras::pallet::Error<T>
**/
PolkadotRuntimeParachainsParasPalletError: {
_enum: ['NotRegistered', 'CannotOnboard', 'CannotOffboard', 'CannotUpgrade', 'CannotDowngrade', 'PvfCheckStatementStale', 'PvfCheckStatementFuture', 'PvfCheckValidatorIndexOutOfBounds', 'PvfCheckInvalidSignature', 'PvfCheckDoubleVote', 'PvfCheckSubjectInvalid', 'PvfCheckDisabled', 'CannotUpgradeCode']
},
/**
* Lookup688: polkadot_runtime_parachains::initializer::BufferedSessionChange
* Lookup694: polkadot_runtime_parachains::initializer::BufferedSessionChange
**/
PolkadotRuntimeParachainsInitializerBufferedSessionChange: {
validators: 'Vec<PolkadotPrimitivesV2ValidatorAppPublic>',
@@ -2236,20 +2239,20 @@ export default {
sessionIndex: 'u32'
},
/**
* Lookup690: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
* Lookup696: polkadot_core_primitives::InboundDownwardMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundDownwardMessage: {
sentAt: 'u32',
msg: 'Bytes'
},
/**
* Lookup692: polkadot_runtime_parachains::ump::pallet::Error<T>
* Lookup698: polkadot_runtime_parachains::ump::pallet::Error<T>
**/
PolkadotRuntimeParachainsUmpPalletError: {
_enum: ['UnknownMessageIndex', 'WeightOverLimit']
},
/**
* Lookup693: polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest
* Lookup699: polkadot_runtime_parachains::hrmp::HrmpOpenChannelRequest
**/
PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest: {
confirmed: 'bool',
@@ -2260,7 +2263,7 @@ export default {
maxTotalSize: 'u32'
},
/**
* Lookup695: polkadot_runtime_parachains::hrmp::HrmpChannel
* Lookup701: polkadot_runtime_parachains::hrmp::HrmpChannel
**/
PolkadotRuntimeParachainsHrmpHrmpChannel: {
maxCapacity: 'u32',
@@ -2273,20 +2276,20 @@ export default {
recipientDeposit: 'u128'
},
/**
* Lookup697: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
* Lookup703: polkadot_core_primitives::InboundHrmpMessage<BlockNumber>
**/
PolkadotCorePrimitivesInboundHrmpMessage: {
sentAt: 'u32',
data: 'Bytes'
},
/**
* Lookup700: polkadot_runtime_parachains::hrmp::pallet::Error<T>
* Lookup706: polkadot_runtime_parachains::hrmp::pallet::Error<T>
**/
PolkadotRuntimeParachainsHrmpPalletError: {
_enum: ['OpenHrmpChannelToSelf', 'OpenHrmpChannelInvalidRecipient', 'OpenHrmpChannelZeroCapacity', 'OpenHrmpChannelCapacityExceedsLimit', 'OpenHrmpChannelZeroMessageSize', 'OpenHrmpChannelMessageSizeExceedsLimit', 'OpenHrmpChannelAlreadyExists', 'OpenHrmpChannelAlreadyRequested', 'OpenHrmpChannelLimitExceeded', 'AcceptHrmpChannelDoesntExist', 'AcceptHrmpChannelAlreadyConfirmed', 'AcceptHrmpChannelLimitExceeded', 'CloseHrmpChannelUnauthorized', 'CloseHrmpChannelDoesntExist', 'CloseHrmpChannelAlreadyUnderway', 'CancelHrmpOpenChannelUnauthorized', 'OpenHrmpChannelDoesntExist', 'OpenHrmpChannelAlreadyConfirmed', 'WrongWitness']
},
/**
* Lookup702: polkadot_primitives::v2::SessionInfo
* Lookup708: polkadot_primitives::v2::SessionInfo
**/
PolkadotPrimitivesV2SessionInfo: {
activeValidatorIndices: 'Vec<u32>',
@@ -2304,15 +2307,30 @@ export default {
neededApprovals: 'u32'
},
/**
* Lookup703: polkadot_primitives::v2::IndexedVec<polkadot_primitives::v2::ValidatorIndex, polkadot_primitives::v2::validator_app::Public>
* Lookup709: polkadot_primitives::v2::IndexedVec<polkadot_primitives::v2::ValidatorIndex, polkadot_primitives::v2::validator_app::Public>
**/
PolkadotPrimitivesV2IndexedVecValidatorIndex: 'Vec<PolkadotPrimitivesV2ValidatorAppPublic>',
/**
* Lookup705: polkadot_primitives::v2::IndexedVec<polkadot_primitives::v2::GroupIndex, V>
* Lookup711: polkadot_primitives::v2::IndexedVec<polkadot_primitives::v2::GroupIndex, V>
**/
PolkadotPrimitivesV2IndexedVecGroupIndex: 'Vec<Vec<u32>>',
/**
* Lookup707: polkadot_primitives::v2::DisputeState<N>
* Lookup712: polkadot_primitives::vstaging::executor_params::ExecutorParams
**/
PolkadotPrimitivesVstagingExecutorParams: 'Vec<PolkadotPrimitivesVstagingExecutorParamsExecutorParam>',
/**
* Lookup714: polkadot_primitives::vstaging::executor_params::ExecutorParam
**/
PolkadotPrimitivesVstagingExecutorParamsExecutorParam: {
_enum: {
MaxMemoryPages: 'u32',
StackLogicalMax: 'u32',
StackNativeMax: 'u32',
PrecheckingMaxMemory: 'u64'
}
},
/**
* Lookup716: polkadot_primitives::v2::DisputeState<N>
**/
PolkadotPrimitivesV2DisputeState: {
validatorsFor: 'BitVec',
@@ -2321,13 +2339,13 @@ export default {
concludedAt: 'Option<u32>'
},
/**
* Lookup709: polkadot_runtime_parachains::disputes::pallet::Error<T>
* Lookup718: polkadot_runtime_parachains::disputes::pallet::Error<T>
**/
PolkadotRuntimeParachainsDisputesPalletError: {
_enum: ['DuplicateDisputeStatementSets', 'AncientDisputeStatement', 'ValidatorIndexOutOfBounds', 'InvalidSignature', 'DuplicateStatement', 'SingleSidedDispute', 'MaliciousBacker', 'MissingBackingVotes', 'UnconfirmedDispute']
},
/**
* Lookup710: polkadot_runtime_common::paras_registrar::ParaInfo<sp_core::crypto::AccountId32, Balance>
* Lookup719: polkadot_runtime_common::paras_registrar::ParaInfo<sp_core::crypto::AccountId32, Balance>
**/
PolkadotRuntimeCommonParasRegistrarParaInfo: {
manager: 'AccountId32',
@@ -2335,25 +2353,25 @@ export default {
locked: 'bool'
},
/**
* Lookup711: polkadot_runtime_common::paras_registrar::pallet::Error<T>
* Lookup720: polkadot_runtime_common::paras_registrar::pallet::Error<T>
**/
PolkadotRuntimeCommonParasRegistrarPalletError: {
_enum: ['NotRegistered', 'AlreadyRegistered', 'NotOwner', 'CodeTooLarge', 'HeadDataTooLarge', 'NotParachain', 'NotParathread', 'CannotDeregister', 'CannotDowngrade', 'CannotUpgrade', 'ParaLocked', 'NotReserved', 'EmptyCode', 'CannotSwap']
},
/**
* Lookup713: polkadot_runtime_common::slots::pallet::Error<T>
* Lookup722: polkadot_runtime_common::slots::pallet::Error<T>
**/
PolkadotRuntimeCommonSlotsPalletError: {
_enum: ['ParaNotOnboarding', 'LeaseError']
},
/**
* Lookup718: polkadot_runtime_common::auctions::pallet::Error<T>
* Lookup727: polkadot_runtime_common::auctions::pallet::Error<T>
**/
PolkadotRuntimeCommonAuctionsPalletError: {
_enum: ['AuctionInProgress', 'LeasePeriodInPast', 'ParaNotRegistered', 'NotCurrentAuction', 'NotAuction', 'AuctionEnded', 'AlreadyLeasedOut']
},
/**
* Lookup719: polkadot_runtime_common::crowdloan::FundInfo<sp_core::crypto::AccountId32, Balance, BlockNumber, LeasePeriod>
* Lookup728: polkadot_runtime_common::crowdloan::FundInfo<sp_core::crypto::AccountId32, Balance, BlockNumber, LeasePeriod>
**/
PolkadotRuntimeCommonCrowdloanFundInfo: {
depositor: 'AccountId32',
@@ -2368,7 +2386,7 @@ export default {
fundIndex: 'u32'
},
/**
* Lookup720: polkadot_runtime_common::crowdloan::LastContribution<BlockNumber>
* Lookup729: polkadot_runtime_common::crowdloan::LastContribution<BlockNumber>
**/
PolkadotRuntimeCommonCrowdloanLastContribution: {
_enum: {
@@ -2378,13 +2396,13 @@ export default {
}
},
/**
* Lookup721: polkadot_runtime_common::crowdloan::pallet::Error<T>
* Lookup730: polkadot_runtime_common::crowdloan::pallet::Error<T>
**/
PolkadotRuntimeCommonCrowdloanPalletError: {
_enum: ['FirstPeriodInPast', 'FirstPeriodTooFarInFuture', 'LastPeriodBeforeFirstPeriod', 'LastPeriodTooFarInFuture', 'CannotEndInPast', 'EndTooFarInFuture', 'Overflow', 'ContributionTooSmall', 'InvalidParaId', 'CapExceeded', 'ContributionPeriodOver', 'InvalidOrigin', 'NotParachain', 'LeaseActive', 'BidOrLeaseActive', 'FundNotEnded', 'NoContributions', 'NotReadyToDissolve', 'InvalidSignature', 'MemoTooLarge', 'AlreadyInNewRaise', 'VrfDelayInProgress', 'NoLeasePeriod']
},
/**
* Lookup722: pallet_xcm::pallet::QueryStatus<BlockNumber>
* Lookup731: pallet_xcm::pallet::QueryStatus<BlockNumber>
**/
PalletXcmQueryStatus: {
_enum: {
@@ -2405,7 +2423,7 @@ export default {
}
},
/**
* Lookup726: xcm::VersionedResponse
* Lookup735: xcm::VersionedResponse
**/
XcmVersionedResponse: {
_enum: {
@@ -2414,7 +2432,7 @@ export default {
}
},
/**
* Lookup732: pallet_xcm::pallet::VersionMigrationStage
* Lookup741: pallet_xcm::pallet::VersionMigrationStage
**/
PalletXcmVersionMigrationStage: {
_enum: {
@@ -2425,7 +2443,7 @@ export default {
}
},
/**
* Lookup735: xcm::VersionedAssetId
* Lookup744: xcm::VersionedAssetId
**/
XcmVersionedAssetId: {
_enum: {
@@ -2433,7 +2451,7 @@ export default {
}
},
/**
* Lookup736: pallet_xcm::pallet::RemoteLockedFungibleRecord
* Lookup745: pallet_xcm::pallet::RemoteLockedFungibleRecord
**/
PalletXcmRemoteLockedFungibleRecord: {
amount: 'u128',
@@ -2442,21 +2460,21 @@ export default {
users: 'u32'
},
/**
* Lookup740: pallet_xcm::pallet::Error<T>
* Lookup749: pallet_xcm::pallet::Error<T>
**/
PalletXcmError: {
_enum: ['Unreachable', 'SendFailure', 'Filtered', 'UnweighableMessage', 'DestinationNotInvertible', 'Empty', 'CannotReanchor', 'TooManyAssets', 'InvalidOrigin', 'BadVersion', 'BadLocation', 'NoSubscription', 'AlreadySubscribed', 'InvalidAsset', 'LowBalance', 'TooManyLocks', 'AccountNotSovereign', 'FeesNotMet', 'LockNotFound', 'InUse']
},
/**
* Lookup751: pallet_transaction_payment::ChargeTransactionPayment<T>
* Lookup760: pallet_transaction_payment::ChargeTransactionPayment<T>
**/
PalletTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
* Lookup752: polkadot_runtime_common::claims::PrevalidateAttests<T>
* Lookup761: polkadot_runtime_common::claims::PrevalidateAttests<T>
**/
PolkadotRuntimeCommonClaimsPrevalidateAttests: 'Null',
/**
* Lookup753: polkadot_runtime::Runtime
* Lookup762: polkadot_runtime::Runtime
**/
PolkadotRuntimeRuntime: 'Null'
};
File diff suppressed because it is too large Load Diff
@@ -111,7 +111,7 @@ declare module '@polkadot/types/lookup' {
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
}
/** @name KusamaRuntimeRuntime (871) */
/** @name KusamaRuntimeRuntime (880) */
type KusamaRuntimeRuntime = Null;
} // declare module
@@ -453,7 +453,10 @@ declare module '@polkadot/types/lookup' {
readonly isGeneralIndex: boolean;
readonly asGeneralIndex: Compact<u128>;
readonly isGeneralKey: boolean;
readonly asGeneralKey: U8aFixed;
readonly asGeneralKey: {
readonly length: u8;
readonly data: U8aFixed;
} & Struct;
readonly isOnlyChild: boolean;
readonly isPlurality: boolean;
readonly asPlurality: {
@@ -1146,7 +1149,7 @@ declare module '@polkadot/types/lookup' {
readonly votes16: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
}
/** @name PolkadotRuntimeParachainsConfigurationPalletCall (394) */
/** @name PolkadotRuntimeParachainsConfigurationPalletCall (395) */
interface PolkadotRuntimeParachainsConfigurationPalletCall extends Enum {
readonly isSetValidationUpgradeCooldown: boolean;
readonly asSetValidationUpgradeCooldown: {
@@ -1327,13 +1330,13 @@ declare module '@polkadot/types/lookup' {
readonly type: 'SetValidationUpgradeCooldown' | 'SetValidationUpgradeDelay' | 'SetCodeRetentionPeriod' | 'SetMaxCodeSize' | 'SetMaxPovSize' | 'SetMaxHeadDataSize' | 'SetParathreadCores' | 'SetParathreadRetries' | 'SetGroupRotationFrequency' | 'SetChainAvailabilityPeriod' | 'SetThreadAvailabilityPeriod' | 'SetSchedulingLookahead' | 'SetMaxValidatorsPerCore' | 'SetMaxValidators' | 'SetDisputePeriod' | 'SetDisputePostConclusionAcceptancePeriod' | 'SetDisputeConclusionByTimeOutPeriod' | 'SetNoShowSlots' | 'SetNDelayTranches' | 'SetZerothDelayTrancheWidth' | 'SetNeededApprovals' | 'SetRelayVrfModuloSamples' | 'SetMaxUpwardQueueCount' | 'SetMaxUpwardQueueSize' | 'SetMaxDownwardMessageSize' | 'SetUmpServiceTotalWeight' | 'SetMaxUpwardMessageSize' | 'SetMaxUpwardMessageNumPerCandidate' | 'SetHrmpOpenRequestTtl' | 'SetHrmpSenderDeposit' | 'SetHrmpRecipientDeposit' | 'SetHrmpChannelMaxCapacity' | 'SetHrmpChannelMaxTotalSize' | 'SetHrmpMaxParachainInboundChannels' | 'SetHrmpMaxParathreadInboundChannels' | 'SetHrmpChannelMaxMessageSize' | 'SetHrmpMaxParachainOutboundChannels' | 'SetHrmpMaxParathreadOutboundChannels' | 'SetHrmpMaxMessageNumPerCandidate' | 'SetUmpMaxIndividualWeight' | 'SetPvfCheckingEnabled' | 'SetPvfVotingTtl' | 'SetMinimumValidationUpgradeDelay' | 'SetBypassConsistencyCheck';
}
/** @name PolkadotRuntimeParachainsSharedPalletCall (395) */
/** @name PolkadotRuntimeParachainsSharedPalletCall (396) */
type PolkadotRuntimeParachainsSharedPalletCall = Null;
/** @name PolkadotRuntimeParachainsInclusionPalletCall (396) */
/** @name PolkadotRuntimeParachainsInclusionPalletCall (397) */
type PolkadotRuntimeParachainsInclusionPalletCall = Null;
/** @name PolkadotRuntimeParachainsParasInherentPalletCall (397) */
/** @name PolkadotRuntimeParachainsParasInherentPalletCall (398) */
interface PolkadotRuntimeParachainsParasInherentPalletCall extends Enum {
readonly isEnter: boolean;
readonly asEnter: {
@@ -1342,7 +1345,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Enter';
}
/** @name PolkadotPrimitivesV2InherentData (398) */
/** @name PolkadotPrimitivesV2InherentData (399) */
interface PolkadotPrimitivesV2InherentData extends Struct {
readonly bitfields: Vec<PolkadotPrimitivesV2SignedUncheckedSigned>;
readonly backedCandidates: Vec<PolkadotPrimitivesV2BackedCandidate>;
@@ -1350,33 +1353,33 @@ declare module '@polkadot/types/lookup' {
readonly parentHeader: SpRuntimeHeader;
}
/** @name PolkadotPrimitivesV2SignedUncheckedSigned (400) */
/** @name PolkadotPrimitivesV2SignedUncheckedSigned (401) */
interface PolkadotPrimitivesV2SignedUncheckedSigned extends Struct {
readonly payload: BitVec;
readonly validatorIndex: u32;
readonly signature: PolkadotPrimitivesV2ValidatorAppSignature;
}
/** @name BitvecOrderLsb0 (403) */
/** @name BitvecOrderLsb0 (404) */
type BitvecOrderLsb0 = Null;
/** @name PolkadotPrimitivesV2ValidatorAppSignature (405) */
/** @name PolkadotPrimitivesV2ValidatorAppSignature (406) */
interface PolkadotPrimitivesV2ValidatorAppSignature extends SpCoreSr25519Signature {}
/** @name PolkadotPrimitivesV2BackedCandidate (407) */
/** @name PolkadotPrimitivesV2BackedCandidate (408) */
interface PolkadotPrimitivesV2BackedCandidate extends Struct {
readonly candidate: PolkadotPrimitivesV2CommittedCandidateReceipt;
readonly validityVotes: Vec<PolkadotPrimitivesV2ValidityAttestation>;
readonly validatorIndices: BitVec;
}
/** @name PolkadotPrimitivesV2CommittedCandidateReceipt (408) */
/** @name PolkadotPrimitivesV2CommittedCandidateReceipt (409) */
interface PolkadotPrimitivesV2CommittedCandidateReceipt extends Struct {
readonly descriptor: PolkadotPrimitivesV2CandidateDescriptor;
readonly commitments: PolkadotPrimitivesV2CandidateCommitments;
}
/** @name PolkadotPrimitivesV2CandidateCommitments (409) */
/** @name PolkadotPrimitivesV2CandidateCommitments (410) */
interface PolkadotPrimitivesV2CandidateCommitments extends Struct {
readonly upwardMessages: Vec<Bytes>;
readonly horizontalMessages: Vec<PolkadotCorePrimitivesOutboundHrmpMessage>;
@@ -1386,13 +1389,13 @@ declare module '@polkadot/types/lookup' {
readonly hrmpWatermark: u32;
}
/** @name PolkadotCorePrimitivesOutboundHrmpMessage (411) */
/** @name PolkadotCorePrimitivesOutboundHrmpMessage (413) */
interface PolkadotCorePrimitivesOutboundHrmpMessage extends Struct {
readonly recipient: u32;
readonly data: Bytes;
}
/** @name PolkadotPrimitivesV2ValidityAttestation (415) */
/** @name PolkadotPrimitivesV2ValidityAttestation (418) */
interface PolkadotPrimitivesV2ValidityAttestation extends Enum {
readonly isImplicit: boolean;
readonly asImplicit: PolkadotPrimitivesV2ValidatorAppSignature;
@@ -1401,14 +1404,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Implicit' | 'Explicit';
}
/** @name PolkadotPrimitivesV2DisputeStatementSet (417) */
/** @name PolkadotPrimitivesV2DisputeStatementSet (420) */
interface PolkadotPrimitivesV2DisputeStatementSet extends Struct {
readonly candidateHash: H256;
readonly session: u32;
readonly statements: Vec<ITuple<[PolkadotPrimitivesV2DisputeStatement, u32, PolkadotPrimitivesV2ValidatorAppSignature]>>;
}
/** @name PolkadotPrimitivesV2DisputeStatement (420) */
/** @name PolkadotPrimitivesV2DisputeStatement (423) */
interface PolkadotPrimitivesV2DisputeStatement extends Enum {
readonly isValid: boolean;
readonly asValid: PolkadotPrimitivesV2ValidDisputeStatementKind;
@@ -1417,7 +1420,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Valid' | 'Invalid';
}
/** @name PolkadotPrimitivesV2ValidDisputeStatementKind (421) */
/** @name PolkadotPrimitivesV2ValidDisputeStatementKind (424) */
interface PolkadotPrimitivesV2ValidDisputeStatementKind extends Enum {
readonly isExplicit: boolean;
readonly isBackingSeconded: boolean;
@@ -1428,13 +1431,13 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Explicit' | 'BackingSeconded' | 'BackingValid' | 'ApprovalChecking';
}
/** @name PolkadotPrimitivesV2InvalidDisputeStatementKind (422) */
/** @name PolkadotPrimitivesV2InvalidDisputeStatementKind (425) */
interface PolkadotPrimitivesV2InvalidDisputeStatementKind extends Enum {
readonly isExplicit: boolean;
readonly type: 'Explicit';
}
/** @name PolkadotRuntimeParachainsParasPalletCall (423) */
/** @name PolkadotRuntimeParachainsParasPalletCall (426) */
interface PolkadotRuntimeParachainsParasPalletCall extends Enum {
readonly isForceSetCurrentCode: boolean;
readonly asForceSetCurrentCode: {
@@ -1477,7 +1480,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'ForceSetCurrentCode' | 'ForceSetCurrentHead' | 'ForceScheduleCodeUpgrade' | 'ForceNoteNewHead' | 'ForceQueueAction' | 'AddTrustedValidationCode' | 'PokeUnusedValidationCode' | 'IncludePvfCheckStatement';
}
/** @name PolkadotPrimitivesV2PvfCheckStatement (424) */
/** @name PolkadotPrimitivesV2PvfCheckStatement (427) */
interface PolkadotPrimitivesV2PvfCheckStatement extends Struct {
readonly accept: bool;
readonly subject: H256;
@@ -1485,7 +1488,7 @@ declare module '@polkadot/types/lookup' {
readonly validatorIndex: u32;
}
/** @name PolkadotRuntimeParachainsInitializerPalletCall (425) */
/** @name PolkadotRuntimeParachainsInitializerPalletCall (428) */
interface PolkadotRuntimeParachainsInitializerPalletCall extends Enum {
readonly isForceApprove: boolean;
readonly asForceApprove: {
@@ -1494,10 +1497,10 @@ declare module '@polkadot/types/lookup' {
readonly type: 'ForceApprove';
}
/** @name PolkadotRuntimeParachainsDmpPalletCall (426) */
/** @name PolkadotRuntimeParachainsDmpPalletCall (429) */
type PolkadotRuntimeParachainsDmpPalletCall = Null;
/** @name PolkadotRuntimeParachainsUmpPalletCall (427) */
/** @name PolkadotRuntimeParachainsUmpPalletCall (430) */
interface PolkadotRuntimeParachainsUmpPalletCall extends Enum {
readonly isServiceOverweight: boolean;
readonly asServiceOverweight: {
@@ -1507,7 +1510,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'ServiceOverweight';
}
/** @name PolkadotRuntimeParachainsHrmpPalletCall (428) */
/** @name PolkadotRuntimeParachainsHrmpPalletCall (431) */
interface PolkadotRuntimeParachainsHrmpPalletCall extends Enum {
readonly isHrmpInitOpenChannel: boolean;
readonly asHrmpInitOpenChannel: {
@@ -1552,13 +1555,13 @@ declare module '@polkadot/types/lookup' {
readonly type: 'HrmpInitOpenChannel' | 'HrmpAcceptOpenChannel' | 'HrmpCloseChannel' | 'ForceCleanHrmp' | 'ForceProcessHrmpOpen' | 'ForceProcessHrmpClose' | 'HrmpCancelOpenRequest' | 'ForceOpenHrmpChannel';
}
/** @name PolkadotRuntimeParachainsDisputesPalletCall (429) */
/** @name PolkadotRuntimeParachainsDisputesPalletCall (432) */
interface PolkadotRuntimeParachainsDisputesPalletCall extends Enum {
readonly isForceUnfreeze: boolean;
readonly type: 'ForceUnfreeze';
}
/** @name PolkadotRuntimeCommonParasRegistrarPalletCall (430) */
/** @name PolkadotRuntimeCommonParasRegistrarPalletCall (433) */
interface PolkadotRuntimeCommonParasRegistrarPalletCall extends Enum {
readonly isRegister: boolean;
readonly asRegister: {
@@ -1605,7 +1608,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Register' | 'ForceRegister' | 'Deregister' | 'Swap' | 'RemoveLock' | 'Reserve' | 'AddLock' | 'ScheduleCodeUpgrade' | 'SetCurrentHead';
}
/** @name PolkadotRuntimeCommonSlotsPalletCall (431) */
/** @name PolkadotRuntimeCommonSlotsPalletCall (434) */
interface PolkadotRuntimeCommonSlotsPalletCall extends Enum {
readonly isForceLease: boolean;
readonly asForceLease: {
@@ -1626,7 +1629,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'ForceLease' | 'ClearAllLeases' | 'TriggerOnboard';
}
/** @name PolkadotRuntimeCommonAuctionsPalletCall (432) */
/** @name PolkadotRuntimeCommonAuctionsPalletCall (435) */
interface PolkadotRuntimeCommonAuctionsPalletCall extends Enum {
readonly isNewAuction: boolean;
readonly asNewAuction: {
@@ -1645,7 +1648,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'NewAuction' | 'Bid' | 'CancelAuction';
}
/** @name PolkadotRuntimeCommonCrowdloanPalletCall (434) */
/** @name PolkadotRuntimeCommonCrowdloanPalletCall (437) */
interface PolkadotRuntimeCommonCrowdloanPalletCall extends Enum {
readonly isCreate: boolean;
readonly asCreate: {
@@ -1701,7 +1704,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Create' | 'Contribute' | 'Withdraw' | 'Refund' | 'Dissolve' | 'Edit' | 'AddMemo' | 'Poke' | 'ContributeAll';
}
/** @name SpRuntimeMultiSigner (436) */
/** @name SpRuntimeMultiSigner (439) */
interface SpRuntimeMultiSigner extends Enum {
readonly isEd25519: boolean;
readonly asEd25519: SpCoreEd25519Public;
@@ -1712,10 +1715,10 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
}
/** @name SpCoreEcdsaPublic (437) */
/** @name SpCoreEcdsaPublic (440) */
interface SpCoreEcdsaPublic extends U8aFixed {}
/** @name PalletXcmCall (442) */
/** @name PalletXcmCall (445) */
interface PalletXcmCall extends Enum {
readonly isSend: boolean;
readonly asSend: {
@@ -1777,7 +1780,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Send' | 'TeleportAssets' | 'ReserveTransferAssets' | 'Execute' | 'ForceXcmVersion' | 'ForceDefaultXcmVersion' | 'ForceSubscribeVersionNotify' | 'ForceUnsubscribeVersionNotify' | 'LimitedReserveTransferAssets' | 'LimitedTeleportAssets';
}
/** @name XcmVersionedXcm (443) */
/** @name XcmVersionedXcm (446) */
interface XcmVersionedXcm extends Enum {
readonly isV2: boolean;
readonly asV2: XcmV2Xcm;
@@ -1786,10 +1789,10 @@ declare module '@polkadot/types/lookup' {
readonly type: 'V2' | 'V3';
}
/** @name XcmV2Xcm (444) */
/** @name XcmV2Xcm (447) */
interface XcmV2Xcm extends Vec<XcmV2Instruction> {}
/** @name XcmV2Instruction (446) */
/** @name XcmV2Instruction (449) */
interface XcmV2Instruction extends Enum {
readonly isWithdrawAsset: boolean;
readonly asWithdrawAsset: XcmV2MultiassetMultiAssets;
@@ -1909,7 +1912,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'WithdrawAsset' | 'ReserveAssetDeposited' | 'ReceiveTeleportedAsset' | 'QueryResponse' | 'TransferAsset' | 'TransferReserveAsset' | 'Transact' | 'HrmpNewChannelOpenRequest' | 'HrmpChannelAccepted' | 'HrmpChannelClosing' | 'ClearOrigin' | 'DescendOrigin' | 'ReportError' | 'DepositAsset' | 'DepositReserveAsset' | 'ExchangeAsset' | 'InitiateReserveWithdraw' | 'InitiateTeleport' | 'QueryHolding' | 'BuyExecution' | 'RefundSurplus' | 'SetErrorHandler' | 'SetAppendix' | 'ClearError' | 'ClaimAsset' | 'Trap' | 'SubscribeVersion' | 'UnsubscribeVersion';
}
/** @name XcmV2Response (447) */
/** @name XcmV2Response (450) */
interface XcmV2Response extends Enum {
readonly isNull: boolean;
readonly isAssets: boolean;
@@ -1921,7 +1924,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Null' | 'Assets' | 'ExecutionResult' | 'Version';
}
/** @name XcmV2TraitsError (450) */
/** @name XcmV2TraitsError (453) */
interface XcmV2TraitsError extends Enum {
readonly isOverflow: boolean;
readonly isUnimplemented: boolean;
@@ -1954,7 +1957,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Overflow' | 'Unimplemented' | 'UntrustedReserveLocation' | 'UntrustedTeleportLocation' | 'MultiLocationFull' | 'MultiLocationNotInvertible' | 'BadOrigin' | 'InvalidLocation' | 'AssetNotFound' | 'FailedToTransactAsset' | 'NotWithdrawable' | 'LocationCannotHold' | 'ExceedsMaxMessageSize' | 'DestinationUnsupported' | 'Transport' | 'Unroutable' | 'UnknownClaim' | 'FailedToDecode' | 'MaxWeightInvalid' | 'NotHoldingFees' | 'TooExpensive' | 'Trap' | 'UnhandledXcmVersion' | 'WeightLimitReached' | 'Barrier' | 'WeightNotComputable';
}
/** @name XcmV2MultiassetMultiAssetFilter (451) */
/** @name XcmV2MultiassetMultiAssetFilter (454) */
interface XcmV2MultiassetMultiAssetFilter extends Enum {
readonly isDefinite: boolean;
readonly asDefinite: XcmV2MultiassetMultiAssets;
@@ -1963,7 +1966,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Definite' | 'Wild';
}
/** @name XcmV2MultiassetWildMultiAsset (452) */
/** @name XcmV2MultiassetWildMultiAsset (455) */
interface XcmV2MultiassetWildMultiAsset extends Enum {
readonly isAll: boolean;
readonly isAllOf: boolean;
@@ -1974,14 +1977,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'All' | 'AllOf';
}
/** @name XcmV2MultiassetWildFungibility (453) */
/** @name XcmV2MultiassetWildFungibility (456) */
interface XcmV2MultiassetWildFungibility extends Enum {
readonly isFungible: boolean;
readonly isNonFungible: boolean;
readonly type: 'Fungible' | 'NonFungible';
}
/** @name XcmV2WeightLimit (454) */
/** @name XcmV2WeightLimit (457) */
interface XcmV2WeightLimit extends Enum {
readonly isUnlimited: boolean;
readonly isLimited: boolean;
@@ -1989,7 +1992,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Unlimited' | 'Limited';
}
/** @name PolkadotRuntimeCommonClaimsPalletError (570) */
/** @name PolkadotRuntimeCommonClaimsPalletError (576) */
interface PolkadotRuntimeCommonClaimsPalletError extends Enum {
readonly isInvalidEthereumSignature: boolean;
readonly isSignerHasNoClaim: boolean;
@@ -2000,7 +2003,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'InvalidEthereumSignature' | 'SignerHasNoClaim' | 'SenderHasNoClaim' | 'PotUnderflow' | 'InvalidStatement' | 'VestedBalanceExists';
}
/** @name PolkadotRuntimeParachainsConfigurationHostConfiguration (645) */
/** @name PolkadotRuntimeParachainsConfigurationHostConfiguration (651) */
interface PolkadotRuntimeParachainsConfigurationHostConfiguration extends Struct {
readonly maxCodeSize: u32;
readonly maxHeadDataSize: u32;
@@ -2046,19 +2049,19 @@ declare module '@polkadot/types/lookup' {
readonly minimumValidationUpgradeDelay: u32;
}
/** @name PolkadotRuntimeParachainsConfigurationPalletError (648) */
/** @name PolkadotRuntimeParachainsConfigurationPalletError (654) */
interface PolkadotRuntimeParachainsConfigurationPalletError extends Enum {
readonly isInvalidNewValue: boolean;
readonly type: 'InvalidNewValue';
}
/** @name PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord (651) */
/** @name PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord (657) */
interface PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord extends Struct {
readonly bitfield: BitVec;
readonly submittedAt: u32;
}
/** @name PolkadotRuntimeParachainsInclusionCandidatePendingAvailability (652) */
/** @name PolkadotRuntimeParachainsInclusionCandidatePendingAvailability (658) */
interface PolkadotRuntimeParachainsInclusionCandidatePendingAvailability extends Struct {
readonly core: u32;
readonly hash_: H256;
@@ -2070,7 +2073,7 @@ declare module '@polkadot/types/lookup' {
readonly backingGroup: u32;
}
/** @name PolkadotRuntimeParachainsInclusionPalletError (653) */
/** @name PolkadotRuntimeParachainsInclusionPalletError (659) */
interface PolkadotRuntimeParachainsInclusionPalletError extends Enum {
readonly isUnsortedOrDuplicateValidatorIndices: boolean;
readonly isUnsortedOrDuplicateDisputeStatementSet: boolean;
@@ -2104,14 +2107,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'UnsortedOrDuplicateValidatorIndices' | 'UnsortedOrDuplicateDisputeStatementSet' | 'UnsortedOrDuplicateBackedCandidates' | 'UnexpectedRelayParent' | 'WrongBitfieldSize' | 'BitfieldAllZeros' | 'BitfieldDuplicateOrUnordered' | 'ValidatorIndexOutOfBounds' | 'InvalidBitfieldSignature' | 'UnscheduledCandidate' | 'CandidateScheduledBeforeParaFree' | 'WrongCollator' | 'ScheduledOutOfOrder' | 'HeadDataTooLarge' | 'PrematureCodeUpgrade' | 'NewCodeTooLarge' | 'CandidateNotInParentContext' | 'InvalidGroupIndex' | 'InsufficientBacking' | 'InvalidBacking' | 'NotCollatorSigned' | 'ValidationDataHashMismatch' | 'IncorrectDownwardMessageHandling' | 'InvalidUpwardMessages' | 'HrmpWatermarkMishandling' | 'InvalidOutboundHrmp' | 'InvalidValidationCodeHash' | 'ParaHeadMismatch' | 'BitfieldReferencesFreedCore';
}
/** @name PolkadotPrimitivesV2ScrapedOnChainVotes (654) */
/** @name PolkadotPrimitivesV2ScrapedOnChainVotes (660) */
interface PolkadotPrimitivesV2ScrapedOnChainVotes extends Struct {
readonly session: u32;
readonly backingValidatorsPerCandidate: Vec<ITuple<[PolkadotPrimitivesV2CandidateReceipt, Vec<ITuple<[u32, PolkadotPrimitivesV2ValidityAttestation]>>]>>;
readonly disputes: Vec<PolkadotPrimitivesV2DisputeStatementSet>;
}
/** @name PolkadotRuntimeParachainsParasInherentPalletError (659) */
/** @name PolkadotRuntimeParachainsParasInherentPalletError (665) */
interface PolkadotRuntimeParachainsParasInherentPalletError extends Enum {
readonly isTooManyInclusionInherents: boolean;
readonly isInvalidParentHeader: boolean;
@@ -2122,28 +2125,28 @@ declare module '@polkadot/types/lookup' {
readonly type: 'TooManyInclusionInherents' | 'InvalidParentHeader' | 'CandidateConcludedInvalid' | 'InherentOverweight' | 'DisputeStatementsUnsortedOrDuplicates' | 'DisputeInvalid';
}
/** @name PolkadotRuntimeParachainsSchedulerParathreadClaimQueue (661) */
/** @name PolkadotRuntimeParachainsSchedulerParathreadClaimQueue (667) */
interface PolkadotRuntimeParachainsSchedulerParathreadClaimQueue extends Struct {
readonly queue: Vec<PolkadotRuntimeParachainsSchedulerQueuedParathread>;
readonly nextCoreOffset: u32;
}
/** @name PolkadotRuntimeParachainsSchedulerQueuedParathread (663) */
/** @name PolkadotRuntimeParachainsSchedulerQueuedParathread (669) */
interface PolkadotRuntimeParachainsSchedulerQueuedParathread extends Struct {
readonly claim: PolkadotPrimitivesV2ParathreadEntry;
readonly coreOffset: u32;
}
/** @name PolkadotPrimitivesV2ParathreadEntry (664) */
/** @name PolkadotPrimitivesV2ParathreadEntry (670) */
interface PolkadotPrimitivesV2ParathreadEntry extends Struct {
readonly claim: PolkadotPrimitivesV2ParathreadClaim;
readonly retries: u32;
}
/** @name PolkadotPrimitivesV2ParathreadClaim (665) */
/** @name PolkadotPrimitivesV2ParathreadClaim (671) */
interface PolkadotPrimitivesV2ParathreadClaim extends ITuple<[u32, PolkadotPrimitivesV2CollatorAppPublic]> {}
/** @name PolkadotPrimitivesV2CoreOccupied (668) */
/** @name PolkadotPrimitivesV2CoreOccupied (674) */
interface PolkadotPrimitivesV2CoreOccupied extends Enum {
readonly isParathread: boolean;
readonly asParathread: PolkadotPrimitivesV2ParathreadEntry;
@@ -2151,7 +2154,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Parathread' | 'Parachain';
}
/** @name PolkadotRuntimeParachainsSchedulerCoreAssignment (671) */
/** @name PolkadotRuntimeParachainsSchedulerCoreAssignment (677) */
interface PolkadotRuntimeParachainsSchedulerCoreAssignment extends Struct {
readonly core: u32;
readonly paraId: u32;
@@ -2159,7 +2162,7 @@ declare module '@polkadot/types/lookup' {
readonly groupIdx: u32;
}
/** @name PolkadotRuntimeParachainsSchedulerAssignmentKind (672) */
/** @name PolkadotRuntimeParachainsSchedulerAssignmentKind (678) */
interface PolkadotRuntimeParachainsSchedulerAssignmentKind extends Enum {
readonly isParachain: boolean;
readonly isParathread: boolean;
@@ -2167,7 +2170,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Parachain' | 'Parathread';
}
/** @name PolkadotRuntimeParachainsParasPvfCheckActiveVoteState (673) */
/** @name PolkadotRuntimeParachainsParasPvfCheckActiveVoteState (679) */
interface PolkadotRuntimeParachainsParasPvfCheckActiveVoteState extends Struct {
readonly votesAccept: BitVec;
readonly votesReject: BitVec;
@@ -2176,7 +2179,7 @@ declare module '@polkadot/types/lookup' {
readonly causes: Vec<PolkadotRuntimeParachainsParasPvfCheckCause>;
}
/** @name PolkadotRuntimeParachainsParasPvfCheckCause (675) */
/** @name PolkadotRuntimeParachainsParasPvfCheckCause (681) */
interface PolkadotRuntimeParachainsParasPvfCheckCause extends Enum {
readonly isOnboarding: boolean;
readonly asOnboarding: u32;
@@ -2188,7 +2191,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Onboarding' | 'Upgrade';
}
/** @name PolkadotRuntimeParachainsParasParaLifecycle (677) */
/** @name PolkadotRuntimeParachainsParasParaLifecycle (683) */
interface PolkadotRuntimeParachainsParasParaLifecycle extends Enum {
readonly isOnboarding: boolean;
readonly isParathread: boolean;
@@ -2200,39 +2203,39 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Onboarding' | 'Parathread' | 'Parachain' | 'UpgradingParathread' | 'DowngradingParachain' | 'OffboardingParathread' | 'OffboardingParachain';
}
/** @name PolkadotRuntimeParachainsParasParaPastCodeMeta (679) */
/** @name PolkadotRuntimeParachainsParasParaPastCodeMeta (685) */
interface PolkadotRuntimeParachainsParasParaPastCodeMeta extends Struct {
readonly upgradeTimes: Vec<PolkadotRuntimeParachainsParasReplacementTimes>;
readonly lastPruned: Option<u32>;
}
/** @name PolkadotRuntimeParachainsParasReplacementTimes (681) */
/** @name PolkadotRuntimeParachainsParasReplacementTimes (687) */
interface PolkadotRuntimeParachainsParasReplacementTimes extends Struct {
readonly expectedAt: u32;
readonly activatedAt: u32;
}
/** @name PolkadotPrimitivesV2UpgradeGoAhead (683) */
/** @name PolkadotPrimitivesV2UpgradeGoAhead (689) */
interface PolkadotPrimitivesV2UpgradeGoAhead extends Enum {
readonly isAbort: boolean;
readonly isGoAhead: boolean;
readonly type: 'Abort' | 'GoAhead';
}
/** @name PolkadotPrimitivesV2UpgradeRestriction (684) */
/** @name PolkadotPrimitivesV2UpgradeRestriction (690) */
interface PolkadotPrimitivesV2UpgradeRestriction extends Enum {
readonly isPresent: boolean;
readonly type: 'Present';
}
/** @name PolkadotRuntimeParachainsParasParaGenesisArgs (685) */
/** @name PolkadotRuntimeParachainsParasParaGenesisArgs (691) */
interface PolkadotRuntimeParachainsParasParaGenesisArgs extends Struct {
readonly genesisHead: Bytes;
readonly validationCode: Bytes;
readonly paraKind: bool;
}
/** @name PolkadotRuntimeParachainsParasPalletError (686) */
/** @name PolkadotRuntimeParachainsParasPalletError (692) */
interface PolkadotRuntimeParachainsParasPalletError extends Enum {
readonly isNotRegistered: boolean;
readonly isCannotOnboard: boolean;
@@ -2250,27 +2253,27 @@ declare module '@polkadot/types/lookup' {
readonly type: 'NotRegistered' | 'CannotOnboard' | 'CannotOffboard' | 'CannotUpgrade' | 'CannotDowngrade' | 'PvfCheckStatementStale' | 'PvfCheckStatementFuture' | 'PvfCheckValidatorIndexOutOfBounds' | 'PvfCheckInvalidSignature' | 'PvfCheckDoubleVote' | 'PvfCheckSubjectInvalid' | 'PvfCheckDisabled' | 'CannotUpgradeCode';
}
/** @name PolkadotRuntimeParachainsInitializerBufferedSessionChange (688) */
/** @name PolkadotRuntimeParachainsInitializerBufferedSessionChange (694) */
interface PolkadotRuntimeParachainsInitializerBufferedSessionChange extends Struct {
readonly validators: Vec<PolkadotPrimitivesV2ValidatorAppPublic>;
readonly queued: Vec<PolkadotPrimitivesV2ValidatorAppPublic>;
readonly sessionIndex: u32;
}
/** @name PolkadotCorePrimitivesInboundDownwardMessage (690) */
/** @name PolkadotCorePrimitivesInboundDownwardMessage (696) */
interface PolkadotCorePrimitivesInboundDownwardMessage extends Struct {
readonly sentAt: u32;
readonly msg: Bytes;
}
/** @name PolkadotRuntimeParachainsUmpPalletError (692) */
/** @name PolkadotRuntimeParachainsUmpPalletError (698) */
interface PolkadotRuntimeParachainsUmpPalletError extends Enum {
readonly isUnknownMessageIndex: boolean;
readonly isWeightOverLimit: boolean;
readonly type: 'UnknownMessageIndex' | 'WeightOverLimit';
}
/** @name PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest (693) */
/** @name PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest (699) */
interface PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest extends Struct {
readonly confirmed: bool;
readonly age: u32;
@@ -2280,7 +2283,7 @@ declare module '@polkadot/types/lookup' {
readonly maxTotalSize: u32;
}
/** @name PolkadotRuntimeParachainsHrmpHrmpChannel (695) */
/** @name PolkadotRuntimeParachainsHrmpHrmpChannel (701) */
interface PolkadotRuntimeParachainsHrmpHrmpChannel extends Struct {
readonly maxCapacity: u32;
readonly maxTotalSize: u32;
@@ -2292,13 +2295,13 @@ declare module '@polkadot/types/lookup' {
readonly recipientDeposit: u128;
}
/** @name PolkadotCorePrimitivesInboundHrmpMessage (697) */
/** @name PolkadotCorePrimitivesInboundHrmpMessage (703) */
interface PolkadotCorePrimitivesInboundHrmpMessage extends Struct {
readonly sentAt: u32;
readonly data: Bytes;
}
/** @name PolkadotRuntimeParachainsHrmpPalletError (700) */
/** @name PolkadotRuntimeParachainsHrmpPalletError (706) */
interface PolkadotRuntimeParachainsHrmpPalletError extends Enum {
readonly isOpenHrmpChannelToSelf: boolean;
readonly isOpenHrmpChannelInvalidRecipient: boolean;
@@ -2322,7 +2325,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'OpenHrmpChannelToSelf' | 'OpenHrmpChannelInvalidRecipient' | 'OpenHrmpChannelZeroCapacity' | 'OpenHrmpChannelCapacityExceedsLimit' | 'OpenHrmpChannelZeroMessageSize' | 'OpenHrmpChannelMessageSizeExceedsLimit' | 'OpenHrmpChannelAlreadyExists' | 'OpenHrmpChannelAlreadyRequested' | 'OpenHrmpChannelLimitExceeded' | 'AcceptHrmpChannelDoesntExist' | 'AcceptHrmpChannelAlreadyConfirmed' | 'AcceptHrmpChannelLimitExceeded' | 'CloseHrmpChannelUnauthorized' | 'CloseHrmpChannelDoesntExist' | 'CloseHrmpChannelAlreadyUnderway' | 'CancelHrmpOpenChannelUnauthorized' | 'OpenHrmpChannelDoesntExist' | 'OpenHrmpChannelAlreadyConfirmed' | 'WrongWitness';
}
/** @name PolkadotPrimitivesV2SessionInfo (702) */
/** @name PolkadotPrimitivesV2SessionInfo (708) */
interface PolkadotPrimitivesV2SessionInfo extends Struct {
readonly activeValidatorIndices: Vec<u32>;
readonly randomSeed: U8aFixed;
@@ -2339,13 +2342,29 @@ declare module '@polkadot/types/lookup' {
readonly neededApprovals: u32;
}
/** @name PolkadotPrimitivesV2IndexedVecValidatorIndex (703) */
/** @name PolkadotPrimitivesV2IndexedVecValidatorIndex (709) */
interface PolkadotPrimitivesV2IndexedVecValidatorIndex extends Vec<PolkadotPrimitivesV2ValidatorAppPublic> {}
/** @name PolkadotPrimitivesV2IndexedVecGroupIndex (705) */
/** @name PolkadotPrimitivesV2IndexedVecGroupIndex (711) */
interface PolkadotPrimitivesV2IndexedVecGroupIndex extends Vec<Vec<u32>> {}
/** @name PolkadotPrimitivesV2DisputeState (707) */
/** @name PolkadotPrimitivesVstagingExecutorParams (712) */
interface PolkadotPrimitivesVstagingExecutorParams extends Vec<PolkadotPrimitivesVstagingExecutorParamsExecutorParam> {}
/** @name PolkadotPrimitivesVstagingExecutorParamsExecutorParam (714) */
interface PolkadotPrimitivesVstagingExecutorParamsExecutorParam extends Enum {
readonly isMaxMemoryPages: boolean;
readonly asMaxMemoryPages: u32;
readonly isStackLogicalMax: boolean;
readonly asStackLogicalMax: u32;
readonly isStackNativeMax: boolean;
readonly asStackNativeMax: u32;
readonly isPrecheckingMaxMemory: boolean;
readonly asPrecheckingMaxMemory: u64;
readonly type: 'MaxMemoryPages' | 'StackLogicalMax' | 'StackNativeMax' | 'PrecheckingMaxMemory';
}
/** @name PolkadotPrimitivesV2DisputeState (716) */
interface PolkadotPrimitivesV2DisputeState extends Struct {
readonly validatorsFor: BitVec;
readonly validatorsAgainst: BitVec;
@@ -2353,7 +2372,7 @@ declare module '@polkadot/types/lookup' {
readonly concludedAt: Option<u32>;
}
/** @name PolkadotRuntimeParachainsDisputesPalletError (709) */
/** @name PolkadotRuntimeParachainsDisputesPalletError (718) */
interface PolkadotRuntimeParachainsDisputesPalletError extends Enum {
readonly isDuplicateDisputeStatementSets: boolean;
readonly isAncientDisputeStatement: boolean;
@@ -2367,14 +2386,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'DuplicateDisputeStatementSets' | 'AncientDisputeStatement' | 'ValidatorIndexOutOfBounds' | 'InvalidSignature' | 'DuplicateStatement' | 'SingleSidedDispute' | 'MaliciousBacker' | 'MissingBackingVotes' | 'UnconfirmedDispute';
}
/** @name PolkadotRuntimeCommonParasRegistrarParaInfo (710) */
/** @name PolkadotRuntimeCommonParasRegistrarParaInfo (719) */
interface PolkadotRuntimeCommonParasRegistrarParaInfo extends Struct {
readonly manager: AccountId32;
readonly deposit: u128;
readonly locked: bool;
}
/** @name PolkadotRuntimeCommonParasRegistrarPalletError (711) */
/** @name PolkadotRuntimeCommonParasRegistrarPalletError (720) */
interface PolkadotRuntimeCommonParasRegistrarPalletError extends Enum {
readonly isNotRegistered: boolean;
readonly isAlreadyRegistered: boolean;
@@ -2393,14 +2412,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'NotRegistered' | 'AlreadyRegistered' | 'NotOwner' | 'CodeTooLarge' | 'HeadDataTooLarge' | 'NotParachain' | 'NotParathread' | 'CannotDeregister' | 'CannotDowngrade' | 'CannotUpgrade' | 'ParaLocked' | 'NotReserved' | 'EmptyCode' | 'CannotSwap';
}
/** @name PolkadotRuntimeCommonSlotsPalletError (713) */
/** @name PolkadotRuntimeCommonSlotsPalletError (722) */
interface PolkadotRuntimeCommonSlotsPalletError extends Enum {
readonly isParaNotOnboarding: boolean;
readonly isLeaseError: boolean;
readonly type: 'ParaNotOnboarding' | 'LeaseError';
}
/** @name PolkadotRuntimeCommonAuctionsPalletError (718) */
/** @name PolkadotRuntimeCommonAuctionsPalletError (727) */
interface PolkadotRuntimeCommonAuctionsPalletError extends Enum {
readonly isAuctionInProgress: boolean;
readonly isLeasePeriodInPast: boolean;
@@ -2412,7 +2431,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'AuctionInProgress' | 'LeasePeriodInPast' | 'ParaNotRegistered' | 'NotCurrentAuction' | 'NotAuction' | 'AuctionEnded' | 'AlreadyLeasedOut';
}
/** @name PolkadotRuntimeCommonCrowdloanFundInfo (719) */
/** @name PolkadotRuntimeCommonCrowdloanFundInfo (728) */
interface PolkadotRuntimeCommonCrowdloanFundInfo extends Struct {
readonly depositor: AccountId32;
readonly verifier: Option<SpRuntimeMultiSigner>;
@@ -2426,7 +2445,7 @@ declare module '@polkadot/types/lookup' {
readonly fundIndex: u32;
}
/** @name PolkadotRuntimeCommonCrowdloanLastContribution (720) */
/** @name PolkadotRuntimeCommonCrowdloanLastContribution (729) */
interface PolkadotRuntimeCommonCrowdloanLastContribution extends Enum {
readonly isNever: boolean;
readonly isPreEnding: boolean;
@@ -2436,7 +2455,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Never' | 'PreEnding' | 'Ending';
}
/** @name PolkadotRuntimeCommonCrowdloanPalletError (721) */
/** @name PolkadotRuntimeCommonCrowdloanPalletError (730) */
interface PolkadotRuntimeCommonCrowdloanPalletError extends Enum {
readonly isFirstPeriodInPast: boolean;
readonly isFirstPeriodTooFarInFuture: boolean;
@@ -2464,7 +2483,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'FirstPeriodInPast' | 'FirstPeriodTooFarInFuture' | 'LastPeriodBeforeFirstPeriod' | 'LastPeriodTooFarInFuture' | 'CannotEndInPast' | 'EndTooFarInFuture' | 'Overflow' | 'ContributionTooSmall' | 'InvalidParaId' | 'CapExceeded' | 'ContributionPeriodOver' | 'InvalidOrigin' | 'NotParachain' | 'LeaseActive' | 'BidOrLeaseActive' | 'FundNotEnded' | 'NoContributions' | 'NotReadyToDissolve' | 'InvalidSignature' | 'MemoTooLarge' | 'AlreadyInNewRaise' | 'VrfDelayInProgress' | 'NoLeasePeriod';
}
/** @name PalletXcmQueryStatus (722) */
/** @name PalletXcmQueryStatus (731) */
interface PalletXcmQueryStatus extends Enum {
readonly isPending: boolean;
readonly asPending: {
@@ -2486,7 +2505,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Pending' | 'VersionNotifier' | 'Ready';
}
/** @name XcmVersionedResponse (726) */
/** @name XcmVersionedResponse (735) */
interface XcmVersionedResponse extends Enum {
readonly isV2: boolean;
readonly asV2: XcmV2Response;
@@ -2495,7 +2514,7 @@ declare module '@polkadot/types/lookup' {
readonly type: 'V2' | 'V3';
}
/** @name PalletXcmVersionMigrationStage (732) */
/** @name PalletXcmVersionMigrationStage (741) */
interface PalletXcmVersionMigrationStage extends Enum {
readonly isMigrateSupportedVersion: boolean;
readonly isMigrateVersionNotifiers: boolean;
@@ -2505,14 +2524,14 @@ declare module '@polkadot/types/lookup' {
readonly type: 'MigrateSupportedVersion' | 'MigrateVersionNotifiers' | 'NotifyCurrentTargets' | 'MigrateAndNotifyOldTargets';
}
/** @name XcmVersionedAssetId (735) */
/** @name XcmVersionedAssetId (744) */
interface XcmVersionedAssetId extends Enum {
readonly isV3: boolean;
readonly asV3: XcmV3MultiassetAssetId;
readonly type: 'V3';
}
/** @name PalletXcmRemoteLockedFungibleRecord (736) */
/** @name PalletXcmRemoteLockedFungibleRecord (745) */
interface PalletXcmRemoteLockedFungibleRecord extends Struct {
readonly amount: u128;
readonly owner: XcmVersionedMultiLocation;
@@ -2520,7 +2539,7 @@ declare module '@polkadot/types/lookup' {
readonly users: u32;
}
/** @name PalletXcmError (740) */
/** @name PalletXcmError (749) */
interface PalletXcmError extends Enum {
readonly isUnreachable: boolean;
readonly isSendFailure: boolean;
@@ -2545,13 +2564,13 @@ declare module '@polkadot/types/lookup' {
readonly type: 'Unreachable' | 'SendFailure' | 'Filtered' | 'UnweighableMessage' | 'DestinationNotInvertible' | 'Empty' | 'CannotReanchor' | 'TooManyAssets' | 'InvalidOrigin' | 'BadVersion' | 'BadLocation' | 'NoSubscription' | 'AlreadySubscribed' | 'InvalidAsset' | 'LowBalance' | 'TooManyLocks' | 'AccountNotSovereign' | 'FeesNotMet' | 'LockNotFound' | 'InUse';
}
/** @name PalletTransactionPaymentChargeTransactionPayment (751) */
/** @name PalletTransactionPaymentChargeTransactionPayment (760) */
interface PalletTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
/** @name PolkadotRuntimeCommonClaimsPrevalidateAttests (752) */
/** @name PolkadotRuntimeCommonClaimsPrevalidateAttests (761) */
type PolkadotRuntimeCommonClaimsPrevalidateAttests = Null;
/** @name PolkadotRuntimeRuntime (753) */
/** @name PolkadotRuntimeRuntime (762) */
type PolkadotRuntimeRuntime = Null;
} // declare module

Some files were not shown because too many files have changed in this diff Show More