Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb75b42273 | ||
|
|
949e429d04 | ||
|
|
0b1c20efd7 | ||
|
|
0536998766 | ||
|
|
22651eb4b8 | ||
|
|
48414bdb34 | ||
|
|
2ff6a85fb3 | ||
|
|
8be1f337a8 | ||
|
|
2c7056da25 | ||
|
|
b53c22d6d3 | ||
|
|
17f316b7c7 | ||
|
|
b44fcc90b2 | ||
|
|
b4e477a8c1 | ||
|
|
4b921c8a55 | ||
|
|
e53231b70a | ||
|
|
afd1db58ac | ||
|
|
63ba84a641 | ||
|
|
044aecbfc3 | ||
|
|
e573c26df3 | ||
|
|
31e7de31f3 | ||
|
|
7cd9c16eae | ||
|
|
2b1a7da446 | ||
|
|
9399c8d24f | ||
|
|
798e5fcc78 | ||
|
|
d8ad237b00 | ||
|
|
550cb10766 | ||
|
|
a44108c3f3 | ||
|
|
2f28ea0ea8 | ||
|
|
488d078b9c | ||
|
|
ba384cee78 | ||
|
|
4f95f33cbb | ||
|
|
368cb8314c | ||
|
|
c01896d24f | ||
|
|
983043bd1e | ||
|
|
9c2ed6297a | ||
|
|
8a7fee5903 | ||
|
|
b0e8a8512a | ||
|
|
f83d23d0f6 | ||
|
|
9dfb5cb237 | ||
|
|
8c87b16924 | ||
|
|
0d5dce002d | ||
|
|
4d0c777a8f | ||
|
|
d63108a4b4 | ||
|
|
5898ac335e | ||
|
|
f108d16d1b | ||
|
|
32f1495993 | ||
|
|
2527497e4a | ||
|
|
e50209da0d | ||
|
|
cccd512d70 |
+4
-2
@@ -1,4 +1,4 @@
|
||||
39
|
||||
40
|
||||
|
||||
1.4.2
|
||||
1.6.2
|
||||
@@ -47,4 +47,6 @@
|
||||
6.10.2
|
||||
6.10.3
|
||||
|
||||
7.0.2
|
||||
7.0.2
|
||||
|
||||
7.14.2
|
||||
@@ -1,5 +1,47 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 7.14.2 Mat 28, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
- Don't export `ScProvider` top-level in `@polkadot/rpc-provider`
|
||||
|
||||
|
||||
## 7.14.1 Mar 27, 2022
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add `ScProvider` for `@substrate/substrate-connect` (Thanks to https://github.com/josepot)
|
||||
- Add support for `BTree{Map, Set}` in typegen (Thanks to https://github.com/CertainLach)
|
||||
|
||||
Changes:
|
||||
|
||||
- Only explicitly support LSB on `BitVec` types
|
||||
- Change `toHuman()` on `BitVec` to output default LSB
|
||||
- Add `bytes{Sent, Recv}` to provider stats
|
||||
- Clear connection timout on provider `disconnect()`
|
||||
- Add support for `dev_getBlockStats` RPC
|
||||
|
||||
|
||||
## 7.13.1 Mar 19, 2022
|
||||
|
||||
**Important** This contains an upgraded version of `@polkadot/wasm-crypto`. For users of asm.js, e.g. React Native, there are some additional upgrade instructions in the release notes for this version https://github.com/polkadot-js/wasm/releases/tag/v5.0.1
|
||||
|
||||
Contributed:
|
||||
|
||||
- Expose custom RPC error details (Thanks to https://github.com/intendednull)
|
||||
- Improve custom RPC error typings (Thanks to https://github.com/MOZGIII)
|
||||
|
||||
Changes:
|
||||
|
||||
- Support for rejection of hanging RPC requests (30s timeout)
|
||||
- Add `.stats` to provider interfaces with running counters
|
||||
- Add support for `state_trieMigrationStatus` RPC
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
- Update to `@polkadot/util` 8.6.1
|
||||
- Additional workaround for Vite bundling
|
||||
|
||||
|
||||
## 7.12.1 Mar 13, 2022
|
||||
|
||||
Changes:
|
||||
|
||||
+5
-1
@@ -1,4 +1,4 @@
|
||||
2865 Jaco 7.12.1 (#4653)
|
||||
2885 Jaco Don't export `ScProvider` top-level in `@polkadot/rpc-provider` (#4694)
|
||||
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)
|
||||
@@ -33,6 +33,7 @@
|
||||
2 Jakub Pánik All heads subscription (#1899)
|
||||
2 James Lefrère Add `.eq()` usage to docs and fix docs typos (#1405)
|
||||
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
|
||||
2 MOZGIII Follow-up fix after #4665 (#4666)
|
||||
2 Nikos Kontakis Add auction in shared types (#4085)
|
||||
2 Paweł Nguyen Fix a minor typo in cookbook blocks docs (#2294)
|
||||
2 sung wu Update tx.md (#2485)
|
||||
@@ -64,6 +65,7 @@
|
||||
1 JesseAbram added 07 Example showing how to make a transfer with allowed block permissions folder in docs (#1062)
|
||||
1 Joey don't throw error at `onSocketClose` (#4363)
|
||||
1 Jordan Allow typegen for custom RPCs (#2876)
|
||||
1 Josep M Sobrepere Add smoldot rpc provider (#4672)
|
||||
1 JQQQ Allow rpc expose definition/ metadata (#3488)
|
||||
1 Kian Paimani Update definitions.ts (#2514)
|
||||
1 Krzysztof Jelski Derive for bounties and descriptions (#2925)
|
||||
@@ -78,6 +80,7 @@
|
||||
1 Nazar Mokrynskyi Performance tweaks (#4143)
|
||||
1 Nikhil Ranjan add vestingPerBlock and vestingEndBlock in DeriveBalancesAll when doing calcBalances (#2563)
|
||||
1 Nikolay Volf Fix typo (#1730)
|
||||
1 Noah Corona Add rpc error fields (#4637)
|
||||
1 Oleksandr Mykhailenko Add more complex namespaced contracts & test cases for them (#4472)
|
||||
1 Paul M Fox Basic BTreeMaps codec support (#1474)
|
||||
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
|
||||
@@ -91,6 +94,7 @@
|
||||
1 Sergei Pepyakin INK! -> ink! (#1347)
|
||||
1 WoeOm adapt Darwinia, Crab Network types (#3498)
|
||||
1 Xat_MassacrE Fix packages/types/src/codec/utils/encodeTypes.ts encodeSubTypes bug (#1544)
|
||||
1 Yaroslav Bolyukin Support BTreeMap/BTreeSet in typegen (#4682)
|
||||
1 yjh fix MetadataVersioned.asV12 (#2983)
|
||||
1 Yuri fixes #3693 Fix uniques return types (#3694)
|
||||
1 Zeke Mostov fix: Allow sudo for polkadot indexed proxy enum (#3286)
|
||||
@@ -14,17 +14,3 @@ If you are an existing user, please be sure to track the [CHANGELOG](CHANGELOG.m
|
||||
## tutorials
|
||||
|
||||
Looking for tutorials to get started? Look at [examples](https://polkadot.js.org/docs/api/examples/promise/) for guides on how to use the API to make queries and submit transactions.
|
||||
|
||||
## overview
|
||||
|
||||
The API is split up into a number of internal packages -
|
||||
|
||||
- [@polkadot/api](packages/api/) The API library, providing both Promise and RxJS Observable-based interfaces. This is the main user-facing entry point.
|
||||
- [@polkadot/api-derive](packages/api-derive/) Derived results that are injected into the API, allowing for combinations of various query results (only used internally and exposed on the Api instances via `api.derive.*`)
|
||||
- [@polkadot/metadata](packages/metadata/) Base extrinsic, storage and constant injectors for injection
|
||||
- [@polkadot/rpc-core](packages/rpc-core/) Wrapper around all [JSON-RPC methods](https://polkadot.js.org/docs/substrate/rpc) exposed by a Polkadot network client
|
||||
- [@polkadot/rpc-provider](packages/rpc-provider/) Providers for connecting to nodes, including WebSockets and Http
|
||||
|
||||
Type definitions for interfaces as exposed by Polkadot & Substrate clients -
|
||||
|
||||
- [@polkadot/types](packages/types/) Codecs for all Polkadot and Substrate primitives
|
||||
|
||||
@@ -15,5 +15,8 @@ module.exports = {
|
||||
// eslint-disable-next-line sort-keys
|
||||
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
|
||||
},
|
||||
"transformIgnorePatterns": [
|
||||
'/node_modules/(?!@polkadot|@substrate/connect|@babel/runtime/helpers/esm/)'
|
||||
],
|
||||
testTimeout: 30000
|
||||
};
|
||||
|
||||
+6
-6
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "commonjs",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -31,15 +31,15 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.5",
|
||||
"@babel/register": "^7.17.0",
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/dev": "^0.65.88",
|
||||
"@babel/core": "^7.17.8",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/dev": "^0.65.101",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^27.4.1",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"typescript": "^4.6.2"
|
||||
"typescript": "^4.6.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api-base": "7.12.1",
|
||||
"@polkadot/rpc-augment": "7.12.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-augment": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1"
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/api-base": "7.14.2",
|
||||
"@polkadot/rpc-augment": "7.14.2",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-augment": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "7.12.1"
|
||||
"@polkadot/types-support": "7.14.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,23 +67,23 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
/**
|
||||
* The list of thresholds separating the various bags.
|
||||
*
|
||||
* Ids are separated into unsorted bags according to their vote weight. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
|
||||
* Ids are separated into unsorted bags according to their score. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
|
||||
* is less than or equal to its upper threshold.
|
||||
*
|
||||
* When ids are iterated, higher bags are iterated completely before lower bags. This means
|
||||
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
|
||||
* weight, but peer ids within a particular bag are sorted in insertion order.
|
||||
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
|
||||
* score, but peer ids within a particular bag are sorted in insertion order.
|
||||
*
|
||||
* # Expressing the constant
|
||||
*
|
||||
* This constant must be sorted in strictly increasing order. Duplicate items are not
|
||||
* permitted.
|
||||
*
|
||||
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
|
||||
* There is an implied upper limit of `Score::MAX`; that value does not need to be
|
||||
* specified within the bag. For any two threshold lists, if one ends with
|
||||
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
|
||||
* will behave identically.
|
||||
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
|
||||
* lists will behave identically.
|
||||
*
|
||||
* # Calculation
|
||||
*
|
||||
@@ -101,8 +101,8 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* the procedure given above, then the constant ratio is equal to 2.
|
||||
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is approximately equal to 1.248.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
|
||||
* into bag 0, an id with weight 2 will fall into bag 1, etc.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
|
||||
* into bag 0, an id with score 2 will fall into bag 1, etc.
|
||||
*
|
||||
* # Migration
|
||||
*
|
||||
@@ -171,6 +171,25 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* Percentage of child-bounty value to be reserved as curator deposit
|
||||
* when curator fee is zero.
|
||||
**/
|
||||
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Minimum value for a child-bounty.
|
||||
**/
|
||||
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum number of child-bounties that can be added to a parent bounty.
|
||||
**/
|
||||
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
claims: {
|
||||
prefix: Bytes & AugmentedConst<ApiType>;
|
||||
/**
|
||||
|
||||
@@ -97,7 +97,7 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
IdNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An Id does not have a greater vote weight than another Id.
|
||||
* An Id does not have a greater score than another Id.
|
||||
**/
|
||||
NotHeavier: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -198,6 +198,24 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* The bounty balance is not enough to add new child-bounty.
|
||||
**/
|
||||
InsufficientBountyBalance: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The parent bounty is not in active state.
|
||||
**/
|
||||
ParentBountyNotActive: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Number of child-bounties exceeds limit `MaxActiveChildBountyCount`.
|
||||
**/
|
||||
TooManyChildBounties: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
claims: {
|
||||
/**
|
||||
* Invalid Ethereum signature.
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, KusamaRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV1CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, KusamaRuntimeProxyType, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/events' {
|
||||
export interface AugmentedEvents<ApiType extends ApiTypes> {
|
||||
@@ -143,6 +143,28 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* A child-bounty is added.
|
||||
**/
|
||||
Added: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* A child-bounty is awarded to a beneficiary.
|
||||
**/
|
||||
Awarded: AugmentedEvent<ApiType, [u32, u32, AccountId32]>;
|
||||
/**
|
||||
* A child-bounty is cancelled.
|
||||
**/
|
||||
Canceled: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* A child-bounty is claimed by beneficiary.
|
||||
**/
|
||||
Claimed: AugmentedEvent<ApiType, [u32, u32, u128, AccountId32]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
claims: {
|
||||
/**
|
||||
* Someone claimed some DOTs. `[who, ethereum_address, amount]`
|
||||
@@ -539,15 +561,15 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A candidate was backed. `[candidate, head_data]`
|
||||
**/
|
||||
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32, u32]>;
|
||||
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32, u32]>;
|
||||
/**
|
||||
* A candidate was included. `[candidate, head_data]`
|
||||
**/
|
||||
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32, u32]>;
|
||||
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32, u32]>;
|
||||
/**
|
||||
* A candidate timed out. `[candidate, head_data]`
|
||||
**/
|
||||
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32]>;
|
||||
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1DisputeState, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeSessionKeys, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
@@ -257,6 +257,33 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* Child-bounties that have been added.
|
||||
**/
|
||||
childBounties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletChildBountiesChildBounty>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* Number of total child bounties.
|
||||
**/
|
||||
childBountyCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The description of each child-bounty.
|
||||
**/
|
||||
childBountyDescriptions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The cumulative child-bounty curator fee for each parent bounty.
|
||||
**/
|
||||
childrenCuratorFees: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Number of child-bounties per parent bounty.
|
||||
* Map of parent bounty index to number of child bounties.
|
||||
**/
|
||||
parentChildBounties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
claims: {
|
||||
claims: AugmentedQuery<ApiType, (arg: EthereumAddress | string | Uint8Array) => Observable<Option<u128>>, [EthereumAddress]> & QueryableStorageEntry<ApiType, [EthereumAddress]>;
|
||||
/**
|
||||
@@ -828,7 +855,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
/**
|
||||
* The commitments of candidates pending availability, by `ParaId`.
|
||||
**/
|
||||
pendingAvailabilityCommitments: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1CandidateCommitments>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
pendingAvailabilityCommitments: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2CandidateCommitments>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -847,7 +874,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
/**
|
||||
* Scraped on chain data for extracting resolved disputes as well as backing votes.
|
||||
**/
|
||||
onChainVotes: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV1ScrapedOnChainVotes>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
onChainVotes: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2ScrapedOnChainVotes>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -965,7 +992,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* NOTE that this field is used by parachains via merkle storage proofs, therefore changing
|
||||
* the format will require migration of parachains.
|
||||
**/
|
||||
upgradeGoAheadSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1UpgradeGoAhead>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
upgradeGoAheadSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2UpgradeGoAhead>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* This is used by the relay-chain to communicate that there are restrictions for performing
|
||||
* an upgrade for this parachain.
|
||||
@@ -977,7 +1004,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* NOTE that this field is used by parachains via merkle storage proofs, therefore changing
|
||||
* the format will require migration of parachains.
|
||||
**/
|
||||
upgradeRestrictionSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1UpgradeRestriction>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
upgradeRestrictionSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2UpgradeRestriction>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -994,7 +1021,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* * The number of parachains and parathread multiplexers
|
||||
* * The number of validators divided by `configuration.max_validators_per_core`.
|
||||
**/
|
||||
availabilityCores: AugmentedQuery<ApiType, () => Observable<Vec<Option<PolkadotPrimitivesV1CoreOccupied>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
availabilityCores: AugmentedQuery<ApiType, () => Observable<Vec<Option<PolkadotPrimitivesV2CoreOccupied>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* An index used to ensure that only one claim on a parathread exists in the queue or is
|
||||
* currently being handled by an occupied core.
|
||||
@@ -1045,7 +1072,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
/**
|
||||
* All ongoing or concluded disputes for the last several sessions.
|
||||
**/
|
||||
disputes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesV1DisputeState>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
|
||||
disputes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesV2DisputeState>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
|
||||
/**
|
||||
* Whether the chain is frozen. Starts as `None`. When this is `Some`,
|
||||
* the chain will not accept any new parachain blocks for backing or inclusion,
|
||||
@@ -1082,7 +1109,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Note that this API is private due to it being prone to 'off-by-one' at session boundaries.
|
||||
* When in doubt, use `Sessions` API instead.
|
||||
**/
|
||||
assignmentKeysUnsafe: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV1AssignmentAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
assignmentKeysUnsafe: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV2AssignmentAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The earliest session for which previous session info is stored.
|
||||
**/
|
||||
@@ -1108,7 +1135,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* The parachain attestation keys of the validators actively participating in parachain consensus.
|
||||
* This should be the same length as `ActiveValidatorIndices`.
|
||||
**/
|
||||
activeValidatorKeys: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV0ValidatorAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
activeValidatorKeys: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV2ValidatorAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The current session index.
|
||||
**/
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u1
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleMaybeHashed, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppSignature, PolkadotPrimitivesV1InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleMaybeHashed, KusamaRuntimeOriginCaller, KusamaRuntimeProxyType, KusamaRuntimeSessionKeys, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
@@ -100,12 +100,12 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Only works if
|
||||
* - both nodes are within the same bag,
|
||||
* - and `origin` has a greater `VoteWeight` than `lighter`.
|
||||
* - and `origin` has a greater `Score` than `lighter`.
|
||||
**/
|
||||
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
|
||||
* changed its weight that it should properly fall into a different bag than its current
|
||||
* changed its score that it should properly fall into a different bag than its current
|
||||
* one.
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
@@ -334,6 +334,175 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* Accept the curator role for the child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be the curator of this
|
||||
* child-bounty.
|
||||
*
|
||||
* A deposit will be reserved from the curator and refund upon
|
||||
* successful payout or cancellation.
|
||||
*
|
||||
* Fee for curator is deducted from curator fee of parent bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in "CuratorProposed" state, for processing the
|
||||
* call. And state of child-bounty is moved to "Active" on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
acceptCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be the curator of parent
|
||||
* bounty and the parent bounty must be in "active" state.
|
||||
*
|
||||
* Child-bounty gets added successfully & fund gets transferred from
|
||||
* parent bounty to child-bounty account, if parent bounty has enough
|
||||
* funds, else the call fails.
|
||||
*
|
||||
* Upper bound to maximum number of active child-bounties that can be
|
||||
* added are managed via runtime trait config
|
||||
* [`Config::MaxActiveChildBountyCount`].
|
||||
*
|
||||
* If the call is success, the status of child-bounty is updated to
|
||||
* "Added".
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty for which child-bounty is being added.
|
||||
* - `value`: Value for executing the proposal.
|
||||
* - `description`: Text description for the child-bounty.
|
||||
**/
|
||||
addChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u128>, Bytes]>;
|
||||
/**
|
||||
* Award child-bounty to a beneficiary.
|
||||
*
|
||||
* The beneficiary will be able to claim the funds after a delay.
|
||||
*
|
||||
* The dispatch origin for this call must be the master curator or
|
||||
* curator of this child-bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in active state, for processing the call. And
|
||||
* state of child-bounty is moved to "PendingPayout" on successful call
|
||||
* completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
* - `beneficiary`: Beneficiary account.
|
||||
**/
|
||||
awardChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
|
||||
/**
|
||||
* Claim the payout from an awarded child-bounty after payout delay.
|
||||
*
|
||||
* The dispatch origin for this call may be any signed origin.
|
||||
*
|
||||
* Call works independent of parent bounty state, No need for parent
|
||||
* bounty to be in active state.
|
||||
*
|
||||
* The Beneficiary is paid out with agreed bounty value. Curator fee is
|
||||
* paid & curator deposit is unreserved.
|
||||
*
|
||||
* Child-bounty must be in "PendingPayout" state, for processing the
|
||||
* call. And instance of child-bounty is removed from the state on
|
||||
* successful call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
claimChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Cancel a proposed or active child-bounty. Child-bounty account funds
|
||||
* are transferred to parent bounty account. The child-bounty curator
|
||||
* deposit may be unreserved if possible.
|
||||
*
|
||||
* The dispatch origin for this call must be either parent curator or
|
||||
* `T::RejectOrigin`.
|
||||
*
|
||||
* If the state of child-bounty is `Active`, curator deposit is
|
||||
* unreserved.
|
||||
*
|
||||
* If the state of child-bounty is `PendingPayout`, call fails &
|
||||
* returns `PendingPayout` error.
|
||||
*
|
||||
* For the origin other than T::RejectOrigin, parent bounty must be in
|
||||
* active state, for this child-bounty call to work. For origin
|
||||
* T::RejectOrigin execution is forced.
|
||||
*
|
||||
* Instance of child-bounty is removed from the state on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
closeChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Propose curator for funded child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be curator of parent bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in "Added" state, for processing the call. And
|
||||
* state of child-bounty is moved to "CuratorProposed" on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
* - `curator`: Address of child-bounty curator.
|
||||
* - `fee`: payment fee to child-bounty curator for execution.
|
||||
**/
|
||||
proposeCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, curator: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, fee: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Unassign curator from a child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call can be either `RejectOrigin`, or
|
||||
* the curator of the parent bounty, or any signed origin.
|
||||
*
|
||||
* For the origin other than T::RejectOrigin and the child-bounty
|
||||
* curator, parent-bounty must be in active state, for this call to
|
||||
* work. We allow child-bounty curator and T::RejectOrigin to execute
|
||||
* this call irrespective of the parent-bounty state.
|
||||
*
|
||||
* If this function is called by the `RejectOrigin` or the
|
||||
* parent-bounty curator, we assume that the child-bounty curator is
|
||||
* malicious or inactive. As a result, child-bounty curator deposit is
|
||||
* slashed.
|
||||
*
|
||||
* If the origin is the child-bounty curator, we take this as a sign
|
||||
* that they are unable to do their job, and are willingly giving up.
|
||||
* We could slash the deposit, but for now we allow them to unreserve
|
||||
* their deposit and exit without issue. (We may want to change this if
|
||||
* it is abused.)
|
||||
*
|
||||
* Finally, the origin can be anyone iff the child-bounty curator is
|
||||
* "inactive". Expiry update due of parent bounty is used to estimate
|
||||
* inactive state of child-bounty curator.
|
||||
*
|
||||
* This allows anyone in the community to call out that a child-bounty
|
||||
* curator is not doing their due diligence, and we should pick a new
|
||||
* one. In this case the child-bounty curator deposit is slashed.
|
||||
*
|
||||
* State of child-bounty is moved to Added state on successful call
|
||||
* completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
unassignCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
claims: {
|
||||
/**
|
||||
* Attest to a statement, needed to finalize the claims process.
|
||||
@@ -1978,7 +2147,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
/**
|
||||
* Enter the paras inherent. This will process bitfields and backed candidates.
|
||||
**/
|
||||
enter: AugmentedSubmittable<(data: PolkadotPrimitivesV1InherentData | { bitfields?: any; backedCandidates?: any; disputes?: any; parentHeader?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV1InherentData]>;
|
||||
enter: AugmentedSubmittable<(data: PolkadotPrimitivesV2InherentData | { bitfields?: any; backedCandidates?: any; disputes?: any; parentHeader?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2InherentData]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -2027,7 +2196,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and
|
||||
* enacts the results if that was the last vote before achieving the supermajority.
|
||||
**/
|
||||
includePvfCheckStatement: AugmentedSubmittable<(stmt: PolkadotPrimitivesV2PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: PolkadotPrimitivesV0ValidatorAppSignature | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV0ValidatorAppSignature]>;
|
||||
includePvfCheckStatement: AugmentedSubmittable<(stmt: PolkadotPrimitivesV2PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: PolkadotPrimitivesV2ValidatorAppSignature | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature]>;
|
||||
/**
|
||||
* Remove the validation code from the storage iff the reference count is 0.
|
||||
*
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -67,23 +67,23 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
/**
|
||||
* The list of thresholds separating the various bags.
|
||||
*
|
||||
* Ids are separated into unsorted bags according to their vote weight. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
|
||||
* Ids are separated into unsorted bags according to their score. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
|
||||
* is less than or equal to its upper threshold.
|
||||
*
|
||||
* When ids are iterated, higher bags are iterated completely before lower bags. This means
|
||||
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
|
||||
* weight, but peer ids within a particular bag are sorted in insertion order.
|
||||
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
|
||||
* score, but peer ids within a particular bag are sorted in insertion order.
|
||||
*
|
||||
* # Expressing the constant
|
||||
*
|
||||
* This constant must be sorted in strictly increasing order. Duplicate items are not
|
||||
* permitted.
|
||||
*
|
||||
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
|
||||
* There is an implied upper limit of `Score::MAX`; that value does not need to be
|
||||
* specified within the bag. For any two threshold lists, if one ends with
|
||||
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
|
||||
* will behave identically.
|
||||
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
|
||||
* lists will behave identically.
|
||||
*
|
||||
* # Calculation
|
||||
*
|
||||
@@ -101,8 +101,8 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* the procedure given above, then the constant ratio is equal to 2.
|
||||
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is approximately equal to 1.248.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
|
||||
* into bag 0, an id with weight 2 will fall into bag 1, etc.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
|
||||
* into bag 0, an id with score 2 will fall into bag 1, etc.
|
||||
*
|
||||
* # Migration
|
||||
*
|
||||
@@ -171,6 +171,25 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* Percentage of child-bounty value to be reserved as curator deposit
|
||||
* when curator fee is zero.
|
||||
**/
|
||||
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Minimum value for a child-bounty.
|
||||
**/
|
||||
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum number of child-bounties that can be added to a parent bounty.
|
||||
**/
|
||||
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
claims: {
|
||||
prefix: Bytes & AugmentedConst<ApiType>;
|
||||
/**
|
||||
|
||||
@@ -97,7 +97,7 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
IdNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An Id does not have a greater vote weight than another Id.
|
||||
* An Id does not have a greater score than another Id.
|
||||
**/
|
||||
NotHeavier: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -198,6 +198,24 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* The bounty balance is not enough to add new child-bounty.
|
||||
**/
|
||||
InsufficientBountyBalance: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The parent bounty is not in active state.
|
||||
**/
|
||||
ParentBountyNotActive: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Number of child-bounties exceeds limit `MaxActiveChildBountyCount`.
|
||||
**/
|
||||
TooManyChildBounties: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
claims: {
|
||||
/**
|
||||
* Invalid Ethereum signature.
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, H256 } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV1CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, PolkadotRuntimeProxyType, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleLookupError, FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletStakingExposure, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, PolkadotRuntimeProxyType, SpFinalityGrandpaAppPublic, SpRuntimeDispatchError, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/events' {
|
||||
export interface AugmentedEvents<ApiType extends ApiTypes> {
|
||||
@@ -143,6 +143,28 @@ declare module '@polkadot/api-base/types/events' {
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* A child-bounty is added.
|
||||
**/
|
||||
Added: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* A child-bounty is awarded to a beneficiary.
|
||||
**/
|
||||
Awarded: AugmentedEvent<ApiType, [u32, u32, AccountId32]>;
|
||||
/**
|
||||
* A child-bounty is cancelled.
|
||||
**/
|
||||
Canceled: AugmentedEvent<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* A child-bounty is claimed by beneficiary.
|
||||
**/
|
||||
Claimed: AugmentedEvent<ApiType, [u32, u32, u128, AccountId32]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
[key: string]: AugmentedEvent<ApiType>;
|
||||
};
|
||||
claims: {
|
||||
/**
|
||||
* Someone claimed some DOTs. `[who, ethereum_address, amount]`
|
||||
@@ -517,15 +539,15 @@ declare module '@polkadot/api-base/types/events' {
|
||||
/**
|
||||
* A candidate was backed. `[candidate, head_data]`
|
||||
**/
|
||||
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32, u32]>;
|
||||
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32, u32]>;
|
||||
/**
|
||||
* A candidate was included. `[candidate, head_data]`
|
||||
**/
|
||||
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32, u32]>;
|
||||
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32, u32]>;
|
||||
/**
|
||||
* A candidate timed out. `[candidate, head_data]`
|
||||
**/
|
||||
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV1CandidateReceipt, Bytes, u32]>;
|
||||
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV2CandidateReceipt, Bytes, u32]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, W
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppPublic, PolkadotPrimitivesV1AssignmentAppPublic, PolkadotPrimitivesV1CandidateCommitments, PolkadotPrimitivesV1CoreOccupied, PolkadotPrimitivesV1DisputeState, PolkadotPrimitivesV1ScrapedOnChainVotes, PolkadotPrimitivesV1UpgradeGoAhead, PolkadotPrimitivesV1UpgradeRestriction, PolkadotPrimitivesV2SessionInfo, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletSchedulerScheduledV3, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2AssignmentAppPublic, PolkadotPrimitivesV2CandidateCommitments, PolkadotPrimitivesV2CoreOccupied, PolkadotPrimitivesV2DisputeState, PolkadotPrimitivesV2ScrapedOnChainVotes, PolkadotPrimitivesV2SessionInfo, PolkadotPrimitivesV2UpgradeGoAhead, PolkadotPrimitivesV2UpgradeRestriction, PolkadotPrimitivesV2ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsConfigurationMigrationV1HostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
@@ -257,6 +257,33 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* Child-bounties that have been added.
|
||||
**/
|
||||
childBounties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletChildBountiesChildBounty>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* Number of total child bounties.
|
||||
**/
|
||||
childBountyCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The description of each child-bounty.
|
||||
**/
|
||||
childBountyDescriptions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The cumulative child-bounty curator fee for each parent bounty.
|
||||
**/
|
||||
childrenCuratorFees: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Number of child-bounties per parent bounty.
|
||||
* Map of parent bounty index to number of child bounties.
|
||||
**/
|
||||
parentChildBounties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
claims: {
|
||||
claims: AugmentedQuery<ApiType, (arg: EthereumAddress | string | Uint8Array) => Observable<Option<u128>>, [EthereumAddress]> & QueryableStorageEntry<ApiType, [EthereumAddress]>;
|
||||
/**
|
||||
@@ -802,7 +829,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
/**
|
||||
* The commitments of candidates pending availability, by `ParaId`.
|
||||
**/
|
||||
pendingAvailabilityCommitments: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1CandidateCommitments>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
pendingAvailabilityCommitments: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2CandidateCommitments>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -821,7 +848,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
/**
|
||||
* Scraped on chain data for extracting resolved disputes as well as backing votes.
|
||||
**/
|
||||
onChainVotes: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV1ScrapedOnChainVotes>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
onChainVotes: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2ScrapedOnChainVotes>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -939,7 +966,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* NOTE that this field is used by parachains via merkle storage proofs, therefore changing
|
||||
* the format will require migration of parachains.
|
||||
**/
|
||||
upgradeGoAheadSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1UpgradeGoAhead>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
upgradeGoAheadSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2UpgradeGoAhead>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* This is used by the relay-chain to communicate that there are restrictions for performing
|
||||
* an upgrade for this parachain.
|
||||
@@ -951,7 +978,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* NOTE that this field is used by parachains via merkle storage proofs, therefore changing
|
||||
* the format will require migration of parachains.
|
||||
**/
|
||||
upgradeRestrictionSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV1UpgradeRestriction>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
upgradeRestrictionSignal: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PolkadotPrimitivesV2UpgradeRestriction>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -968,7 +995,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* * The number of parachains and parathread multiplexers
|
||||
* * The number of validators divided by `configuration.max_validators_per_core`.
|
||||
**/
|
||||
availabilityCores: AugmentedQuery<ApiType, () => Observable<Vec<Option<PolkadotPrimitivesV1CoreOccupied>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
availabilityCores: AugmentedQuery<ApiType, () => Observable<Vec<Option<PolkadotPrimitivesV2CoreOccupied>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* An index used to ensure that only one claim on a parathread exists in the queue or is
|
||||
* currently being handled by an occupied core.
|
||||
@@ -1019,7 +1046,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
/**
|
||||
* All ongoing or concluded disputes for the last several sessions.
|
||||
**/
|
||||
disputes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesV1DisputeState>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
|
||||
disputes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesV2DisputeState>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
|
||||
/**
|
||||
* Whether the chain is frozen. Starts as `None`. When this is `Some`,
|
||||
* the chain will not accept any new parachain blocks for backing or inclusion,
|
||||
@@ -1056,7 +1083,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Note that this API is private due to it being prone to 'off-by-one' at session boundaries.
|
||||
* When in doubt, use `Sessions` API instead.
|
||||
**/
|
||||
assignmentKeysUnsafe: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV1AssignmentAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
assignmentKeysUnsafe: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV2AssignmentAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The earliest session for which previous session info is stored.
|
||||
**/
|
||||
@@ -1082,7 +1109,7 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* The parachain attestation keys of the validators actively participating in parachain consensus.
|
||||
* This should be the same length as `ActiveValidatorIndices`.
|
||||
**/
|
||||
activeValidatorKeys: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV0ValidatorAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
activeValidatorKeys: AugmentedQuery<ApiType, () => Observable<Vec<PolkadotPrimitivesV2ValidatorAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The current session index.
|
||||
**/
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u1
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
|
||||
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleMaybeHashed, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV0ValidatorAppSignature, PolkadotPrimitivesV1InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeOriginCaller, PolkadotRuntimeProxyType, PolkadotRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleMaybeHashed, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletVestingVestingInfo, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV2InherentData, PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature, PolkadotRuntimeCommonClaimsEcdsaSignature, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeOriginCaller, PolkadotRuntimeProxyType, PolkadotRuntimeSessionKeys, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpRuntimeMultiSignature, SpRuntimeMultiSigner, SpSessionMembershipProof, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
@@ -100,12 +100,12 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Only works if
|
||||
* - both nodes are within the same bag,
|
||||
* - and `origin` has a greater `VoteWeight` than `lighter`.
|
||||
* - and `origin` has a greater `Score` than `lighter`.
|
||||
**/
|
||||
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
|
||||
* changed its weight that it should properly fall into a different bag than its current
|
||||
* changed its score that it should properly fall into a different bag than its current
|
||||
* one.
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
@@ -334,6 +334,175 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* Accept the curator role for the child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be the curator of this
|
||||
* child-bounty.
|
||||
*
|
||||
* A deposit will be reserved from the curator and refund upon
|
||||
* successful payout or cancellation.
|
||||
*
|
||||
* Fee for curator is deducted from curator fee of parent bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in "CuratorProposed" state, for processing the
|
||||
* call. And state of child-bounty is moved to "Active" on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
acceptCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be the curator of parent
|
||||
* bounty and the parent bounty must be in "active" state.
|
||||
*
|
||||
* Child-bounty gets added successfully & fund gets transferred from
|
||||
* parent bounty to child-bounty account, if parent bounty has enough
|
||||
* funds, else the call fails.
|
||||
*
|
||||
* Upper bound to maximum number of active child-bounties that can be
|
||||
* added are managed via runtime trait config
|
||||
* [`Config::MaxActiveChildBountyCount`].
|
||||
*
|
||||
* If the call is success, the status of child-bounty is updated to
|
||||
* "Added".
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty for which child-bounty is being added.
|
||||
* - `value`: Value for executing the proposal.
|
||||
* - `description`: Text description for the child-bounty.
|
||||
**/
|
||||
addChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u128>, Bytes]>;
|
||||
/**
|
||||
* Award child-bounty to a beneficiary.
|
||||
*
|
||||
* The beneficiary will be able to claim the funds after a delay.
|
||||
*
|
||||
* The dispatch origin for this call must be the master curator or
|
||||
* curator of this child-bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in active state, for processing the call. And
|
||||
* state of child-bounty is moved to "PendingPayout" on successful call
|
||||
* completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
* - `beneficiary`: Beneficiary account.
|
||||
**/
|
||||
awardChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
|
||||
/**
|
||||
* Claim the payout from an awarded child-bounty after payout delay.
|
||||
*
|
||||
* The dispatch origin for this call may be any signed origin.
|
||||
*
|
||||
* Call works independent of parent bounty state, No need for parent
|
||||
* bounty to be in active state.
|
||||
*
|
||||
* The Beneficiary is paid out with agreed bounty value. Curator fee is
|
||||
* paid & curator deposit is unreserved.
|
||||
*
|
||||
* Child-bounty must be in "PendingPayout" state, for processing the
|
||||
* call. And instance of child-bounty is removed from the state on
|
||||
* successful call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
claimChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Cancel a proposed or active child-bounty. Child-bounty account funds
|
||||
* are transferred to parent bounty account. The child-bounty curator
|
||||
* deposit may be unreserved if possible.
|
||||
*
|
||||
* The dispatch origin for this call must be either parent curator or
|
||||
* `T::RejectOrigin`.
|
||||
*
|
||||
* If the state of child-bounty is `Active`, curator deposit is
|
||||
* unreserved.
|
||||
*
|
||||
* If the state of child-bounty is `PendingPayout`, call fails &
|
||||
* returns `PendingPayout` error.
|
||||
*
|
||||
* For the origin other than T::RejectOrigin, parent bounty must be in
|
||||
* active state, for this child-bounty call to work. For origin
|
||||
* T::RejectOrigin execution is forced.
|
||||
*
|
||||
* Instance of child-bounty is removed from the state on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
closeChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Propose curator for funded child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be curator of parent bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in "Added" state, for processing the call. And
|
||||
* state of child-bounty is moved to "CuratorProposed" on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
* - `curator`: Address of child-bounty curator.
|
||||
* - `fee`: payment fee to child-bounty curator for execution.
|
||||
**/
|
||||
proposeCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, curator: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, fee: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Unassign curator from a child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call can be either `RejectOrigin`, or
|
||||
* the curator of the parent bounty, or any signed origin.
|
||||
*
|
||||
* For the origin other than T::RejectOrigin and the child-bounty
|
||||
* curator, parent-bounty must be in active state, for this call to
|
||||
* work. We allow child-bounty curator and T::RejectOrigin to execute
|
||||
* this call irrespective of the parent-bounty state.
|
||||
*
|
||||
* If this function is called by the `RejectOrigin` or the
|
||||
* parent-bounty curator, we assume that the child-bounty curator is
|
||||
* malicious or inactive. As a result, child-bounty curator deposit is
|
||||
* slashed.
|
||||
*
|
||||
* If the origin is the child-bounty curator, we take this as a sign
|
||||
* that they are unable to do their job, and are willingly giving up.
|
||||
* We could slash the deposit, but for now we allow them to unreserve
|
||||
* their deposit and exit without issue. (We may want to change this if
|
||||
* it is abused.)
|
||||
*
|
||||
* Finally, the origin can be anyone iff the child-bounty curator is
|
||||
* "inactive". Expiry update due of parent bounty is used to estimate
|
||||
* inactive state of child-bounty curator.
|
||||
*
|
||||
* This allows anyone in the community to call out that a child-bounty
|
||||
* curator is not doing their due diligence, and we should pick a new
|
||||
* one. In this case the child-bounty curator deposit is slashed.
|
||||
*
|
||||
* State of child-bounty is moved to Added state on successful call
|
||||
* completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
unassignCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
claims: {
|
||||
/**
|
||||
* Attest to a statement, needed to finalize the claims process.
|
||||
@@ -1927,7 +2096,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
/**
|
||||
* Enter the paras inherent. This will process bitfields and backed candidates.
|
||||
**/
|
||||
enter: AugmentedSubmittable<(data: PolkadotPrimitivesV1InherentData | { bitfields?: any; backedCandidates?: any; disputes?: any; parentHeader?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV1InherentData]>;
|
||||
enter: AugmentedSubmittable<(data: PolkadotPrimitivesV2InherentData | { bitfields?: any; backedCandidates?: any; disputes?: any; parentHeader?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2InherentData]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -1976,7 +2145,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Includes a statement for a PVF pre-checking vote. Potentially, finalizes the vote and
|
||||
* enacts the results if that was the last vote before achieving the supermajority.
|
||||
**/
|
||||
includePvfCheckStatement: AugmentedSubmittable<(stmt: PolkadotPrimitivesV2PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: PolkadotPrimitivesV0ValidatorAppSignature | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV0ValidatorAppSignature]>;
|
||||
includePvfCheckStatement: AugmentedSubmittable<(stmt: PolkadotPrimitivesV2PvfCheckStatement | { accept?: any; subject?: any; sessionIndex?: any; validatorIndex?: any } | string | Uint8Array, signature: PolkadotPrimitivesV2ValidatorAppSignature | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PolkadotPrimitivesV2PvfCheckStatement, PolkadotPrimitivesV2ValidatorAppSignature]>;
|
||||
/**
|
||||
* Remove the validation code from the storage iff the reference count is 0.
|
||||
*
|
||||
|
||||
@@ -81,23 +81,23 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
/**
|
||||
* The list of thresholds separating the various bags.
|
||||
*
|
||||
* Ids are separated into unsorted bags according to their vote weight. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
|
||||
* Ids are separated into unsorted bags according to their score. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
|
||||
* is less than or equal to its upper threshold.
|
||||
*
|
||||
* When ids are iterated, higher bags are iterated completely before lower bags. This means
|
||||
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
|
||||
* weight, but peer ids within a particular bag are sorted in insertion order.
|
||||
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
|
||||
* score, but peer ids within a particular bag are sorted in insertion order.
|
||||
*
|
||||
* # Expressing the constant
|
||||
*
|
||||
* This constant must be sorted in strictly increasing order. Duplicate items are not
|
||||
* permitted.
|
||||
*
|
||||
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
|
||||
* There is an implied upper limit of `Score::MAX`; that value does not need to be
|
||||
* specified within the bag. For any two threshold lists, if one ends with
|
||||
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
|
||||
* will behave identically.
|
||||
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
|
||||
* lists will behave identically.
|
||||
*
|
||||
* # Calculation
|
||||
*
|
||||
@@ -115,8 +115,8 @@ declare module '@polkadot/api-base/types/consts' {
|
||||
* the procedure given above, then the constant ratio is equal to 2.
|
||||
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is approximately equal to 1.248.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
|
||||
* into bag 0, an id with weight 2 will fall into bag 1, etc.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
|
||||
* into bag 0, an id with score 2 will fall into bag 1, etc.
|
||||
*
|
||||
* # Migration
|
||||
*
|
||||
|
||||
@@ -131,7 +131,7 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
**/
|
||||
IdNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An Id does not have a greater vote weight than another Id.
|
||||
* An Id does not have a greater score than another Id.
|
||||
**/
|
||||
NotHeavier: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1172,7 +1172,7 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
/**
|
||||
* Referendum's decision deposit is already paid.
|
||||
**/
|
||||
HaveDeposit: AugmentedError<ApiType>;
|
||||
HasDeposit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The deposit cannot be refunded since none was made.
|
||||
**/
|
||||
@@ -1695,6 +1695,10 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* The signing account has no permission to do the operation.
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The named owner has not signed ownership of the class is acceptable.
|
||||
**/
|
||||
Unaccepted: AugmentedError<ApiType>;
|
||||
/**
|
||||
* No approval exists that would allow the transfer.
|
||||
**/
|
||||
|
||||
@@ -1209,6 +1209,10 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* The owner changed.
|
||||
**/
|
||||
OwnerChanged: AugmentedEvent<ApiType, [u32, AccountId32]>;
|
||||
/**
|
||||
* Ownership acceptance has changed for an account.
|
||||
**/
|
||||
OwnershipAcceptanceChanged: AugmentedEvent<ApiType, [AccountId32, Option<u32>]>;
|
||||
/**
|
||||
* Metadata has been cleared for an asset instance.
|
||||
**/
|
||||
|
||||
@@ -293,10 +293,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
contracts: {
|
||||
/**
|
||||
* The subtrie counter.
|
||||
**/
|
||||
accountCounter: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A mapping between an original code hash and instrumented wasm code, ready for execution.
|
||||
**/
|
||||
@@ -314,6 +310,31 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* stored in said trie. Therefore this operation is performed lazily in `on_initialize`.
|
||||
**/
|
||||
deletionQueue: AugmentedQuery<ApiType, () => Observable<Vec<PalletContractsStorageDeletedContract>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* This is a **monotonic** counter incremented on contract instantiation.
|
||||
*
|
||||
* This is used in order to generate unique trie ids for contracts.
|
||||
* The trie id of a new contract is calculated from hash(account_id, nonce).
|
||||
* The nonce is required because otherwise the following sequence would lead to
|
||||
* a possible collision of storage:
|
||||
*
|
||||
* 1. Create a new contract.
|
||||
* 2. Terminate the contract.
|
||||
* 3. Immediately recreate the contract with the same account_id.
|
||||
*
|
||||
* This is bad because the contents of a trie are deleted lazily and there might be
|
||||
* storage of the old instantiation still in it when the new contract is created. Please
|
||||
* note that we can't replace the counter by the block number because the sequence above
|
||||
* can happen in the same block. We also can't keep the account counter in memory only
|
||||
* because storage is the only way to communicate across different extrinsics in the
|
||||
* same block.
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* Do not use it to determine the number of contracts. It won't be decremented if
|
||||
* a contract is destroyed.
|
||||
**/
|
||||
nonce: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A mapping between an original code hash and its owner information.
|
||||
**/
|
||||
@@ -862,8 +883,6 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
referendumCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Information concerning any given referendum.
|
||||
*
|
||||
* TWOX-NOTE: SAFE as indexes are not under an attacker’s control.
|
||||
**/
|
||||
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfo>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
@@ -1533,6 +1552,10 @@ declare module '@polkadot/api-base/types/storage' {
|
||||
* Metadata of an asset instance.
|
||||
**/
|
||||
instanceMetadataOf: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesInstanceMetadata>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* The class, if any, of which an account is willing to take ownership.
|
||||
**/
|
||||
ownershipAcceptance: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Data } from '@polkadot/types';
|
||||
import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletReferendaAtOrAfter, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
|
||||
import type { FrameSupportScheduleDispatchTime, FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletConvictionVotingConviction, PalletConvictionVotingVoteAccountVote, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingPalletConfigOpPerbill, PalletStakingPalletConfigOpPercent, PalletStakingPalletConfigOpU128, PalletStakingPalletConfigOpU32, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsElectionScore, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api-base/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
@@ -494,12 +494,12 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Only works if
|
||||
* - both nodes are within the same bag,
|
||||
* - and `origin` has a greater `VoteWeight` than `lighter`.
|
||||
* - and `origin` has a greater `Score` than `lighter`.
|
||||
**/
|
||||
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
|
||||
* changed its weight that it should properly fall into a different bag than its current
|
||||
* changed its score that it should properly fall into a different bag than its current
|
||||
* one.
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
@@ -2948,7 +2948,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Emits `Submitted`.
|
||||
**/
|
||||
submit: AugmentedSubmittable<(proposalOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, proposalHash: H256 | string | Uint8Array, enactmentMoment: PalletReferendaAtOrAfter | { At: any } | { After: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, H256, PalletReferendaAtOrAfter]>;
|
||||
submit: AugmentedSubmittable<(proposalOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, proposalHash: H256 | string | Uint8Array, enactmentMoment: FrameSupportScheduleDispatchTime | { At: any } | { After: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, H256, FrameSupportScheduleDispatchTime]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -3788,7 +3788,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* recommended way of doing this is to pass a `limit` that only bounds `count`, as the
|
||||
* `size` limit can always be overwritten.
|
||||
**/
|
||||
continueMigrate: AugmentedSubmittable<(limits: PalletStateTrieMigrationMigrationLimits | { size_?: any; item?: any } | string | Uint8Array, realSizeUpper: u32 | AnyNumber | Uint8Array, witnessTask: PalletStateTrieMigrationMigrationTask | { lastTop?: any; lastChild?: any; prevTickChild?: any; size_?: any; topItems?: any; childItems?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStateTrieMigrationMigrationLimits, u32, PalletStateTrieMigrationMigrationTask]>;
|
||||
continueMigrate: AugmentedSubmittable<(limits: PalletStateTrieMigrationMigrationLimits | { size_?: any; item?: any } | string | Uint8Array, realSizeUpper: u32 | AnyNumber | Uint8Array, witnessTask: PalletStateTrieMigrationMigrationTask | { progressTop?: any; progressChild?: any; size_?: any; topItems?: any; childItems?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStateTrieMigrationMigrationLimits, u32, PalletStateTrieMigrationMigrationTask]>;
|
||||
/**
|
||||
* Control the automatic migration.
|
||||
*
|
||||
@@ -4405,7 +4405,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
approveTransfer: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
|
||||
approveTransfer: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
/**
|
||||
* Destroy a single asset instance.
|
||||
*
|
||||
@@ -4421,7 +4421,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Weight: `O(1)`
|
||||
* Modes: `check_owner.is_some()`.
|
||||
**/
|
||||
burn: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, checkOwner: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, Option<MultiAddress>]>;
|
||||
burn: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, checkOwner: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
|
||||
/**
|
||||
* Cancel the prior approval for the transfer of an asset by a delegate.
|
||||
*
|
||||
@@ -4440,7 +4440,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
cancelApproval: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, maybeCheckDelegate: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, Option<MultiAddress>]>;
|
||||
cancelApproval: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, maybeCheckDelegate: Option<MultiAddress> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Option<MultiAddress>]>;
|
||||
/**
|
||||
* Clear an attribute for an asset class or instance.
|
||||
*
|
||||
@@ -4457,7 +4457,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
clearAttribute: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Option<u32>, Bytes]>;
|
||||
clearAttribute: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<u32>, Bytes]>;
|
||||
/**
|
||||
* Clear the metadata for an asset class.
|
||||
*
|
||||
@@ -4472,7 +4472,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
clearClassMetadata: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
|
||||
clearClassMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Clear the metadata for an asset instance.
|
||||
*
|
||||
@@ -4488,7 +4488,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
clearMetadata: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
clearMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Issue a new class of non-fungible assets from a public origin.
|
||||
*
|
||||
@@ -4507,7 +4507,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
create: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress]>;
|
||||
create: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
|
||||
/**
|
||||
* Destroy a class of fungible assets.
|
||||
*
|
||||
@@ -4525,7 +4525,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - `m = witness.instance_metadatas`
|
||||
* - `a = witness.attributes`
|
||||
**/
|
||||
destroy: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, witness: PalletUniquesDestroyWitness | { instances?: any; instanceMetadatas?: any; attributes?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, PalletUniquesDestroyWitness]>;
|
||||
destroy: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, witness: PalletUniquesDestroyWitness | { instances?: any; instanceMetadatas?: any; attributes?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletUniquesDestroyWitness]>;
|
||||
/**
|
||||
* Alter the attributes of a given asset.
|
||||
*
|
||||
@@ -4545,7 +4545,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceAssetStatus: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, MultiAddress, MultiAddress, bool, bool]>;
|
||||
forceAssetStatus: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, MultiAddress, MultiAddress, MultiAddress, bool, bool]>;
|
||||
/**
|
||||
* Issue a new class of non-fungible assets from a privileged origin.
|
||||
*
|
||||
@@ -4564,7 +4564,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceCreate: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, bool]>;
|
||||
forceCreate: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freeHolding: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, bool]>;
|
||||
/**
|
||||
* Disallow further unprivileged transfer of an asset instance.
|
||||
*
|
||||
@@ -4577,7 +4577,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
freeze: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
freeze: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Disallow further unprivileged transfers for a whole asset class.
|
||||
*
|
||||
@@ -4589,7 +4589,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
freezeClass: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
|
||||
freezeClass: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Mint an asset instance of a particular class.
|
||||
*
|
||||
@@ -4603,7 +4603,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
mint: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
|
||||
mint: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
/**
|
||||
* Reevaluate the deposits on some assets.
|
||||
*
|
||||
@@ -4623,7 +4623,20 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(instances.len())`
|
||||
**/
|
||||
redeposit: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instances: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Vec<u32>]>;
|
||||
redeposit: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instances: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [u32, Vec<u32>]>;
|
||||
/**
|
||||
* Set (or reset) the acceptance of ownership for a particular account.
|
||||
*
|
||||
* Origin must be `Signed` and if `maybe_class` is `Some`, then the signer must have a
|
||||
* provider reference.
|
||||
*
|
||||
* - `maybe_class`: The identifier of the asset class whose ownership the signer is willing
|
||||
* to accept, or if `None`, an indication that the signer is willing to accept no
|
||||
* ownership transferal.
|
||||
*
|
||||
* Emits `OwnershipAcceptanceChanged`.
|
||||
**/
|
||||
setAcceptOwnership: AugmentedSubmittable<(maybeClass: Option<u32> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
|
||||
/**
|
||||
* Set an attribute for an asset class or instance.
|
||||
*
|
||||
@@ -4643,7 +4656,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setAttribute: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Option<u32>, Bytes, Bytes]>;
|
||||
setAttribute: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, maybeInstance: Option<u32> | null | object | string | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<u32>, Bytes, Bytes]>;
|
||||
/**
|
||||
* Set the metadata for an asset class.
|
||||
*
|
||||
@@ -4662,7 +4675,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setClassMetadata: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Bytes, bool]>;
|
||||
setClassMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Bytes, bool]>;
|
||||
/**
|
||||
* Set the metadata for an asset instance.
|
||||
*
|
||||
@@ -4682,7 +4695,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setMetadata: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, Bytes, bool]>;
|
||||
setMetadata: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, Bytes, bool]>;
|
||||
/**
|
||||
* Change the Issuer, Admin and Freezer of an asset class.
|
||||
*
|
||||
@@ -4697,7 +4710,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
setTeam: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, MultiAddress]>;
|
||||
setTeam: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress, MultiAddress, MultiAddress]>;
|
||||
/**
|
||||
* Re-allow unprivileged transfer of an asset instance.
|
||||
*
|
||||
@@ -4710,7 +4723,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
thaw: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
thaw: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Re-allow unprivileged transfers for a whole asset class.
|
||||
*
|
||||
@@ -4722,7 +4735,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
thawClass: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
|
||||
thawClass: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
|
||||
/**
|
||||
* Move an asset from the sender account to another.
|
||||
*
|
||||
@@ -4740,20 +4753,21 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
transfer: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, instance: Compact<u32> | AnyNumber | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
|
||||
transfer: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, instance: u32 | AnyNumber | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32, MultiAddress]>;
|
||||
/**
|
||||
* Change the Owner of an asset class.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Owner of the asset `class`.
|
||||
*
|
||||
* - `class`: The asset class whose owner should be changed.
|
||||
* - `owner`: The new Owner of this asset class.
|
||||
* - `owner`: The new Owner of this asset class. They must have called
|
||||
* `set_accept_ownership` with `class` in order for this operation to succeed.
|
||||
*
|
||||
* Emits `OwnerChanged`.
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
transferOwnership: AugmentedSubmittable<(clazz: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress]>;
|
||||
transferOwnership: AugmentedSubmittable<(clazz: u32 | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, MultiAddress]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/rpc-core": "7.12.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/rpc-core": "7.14.2",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api": "7.12.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/types-create": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1",
|
||||
"@polkadot/util-crypto": "^8.5.1",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/api": "7.14.2",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/types-create": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1",
|
||||
"@polkadot/util-crypto": "^8.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "7.12.1",
|
||||
"@polkadot/keyring": "^8.5.1"
|
||||
"@polkadot/api-augment": "7.14.2",
|
||||
"@polkadot/keyring": "^8.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api": "7.12.1",
|
||||
"@polkadot/api-augment": "7.12.1",
|
||||
"@polkadot/api-base": "7.12.1",
|
||||
"@polkadot/rpc-core": "7.12.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1",
|
||||
"@polkadot/util-crypto": "^8.5.1",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/api": "7.14.2",
|
||||
"@polkadot/api-augment": "7.14.2",
|
||||
"@polkadot/api-base": "7.14.2",
|
||||
"@polkadot/rpc-core": "7.14.2",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1",
|
||||
"@polkadot/util-crypto": "^8.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "7.12.1",
|
||||
"@polkadot/api-augment": "7.12.1",
|
||||
"@polkadot/rpc-augment": "7.12.1",
|
||||
"@polkadot/rpc-provider": "7.12.1",
|
||||
"@polkadot/types-support": "7.12.1"
|
||||
"@polkadot/api": "7.14.2",
|
||||
"@polkadot/api-augment": "7.14.2",
|
||||
"@polkadot/rpc-augment": "7.14.2",
|
||||
"@polkadot/rpc-provider": "7.14.2",
|
||||
"@polkadot/types-support": "7.14.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
+18
-18
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api-augment": "7.12.1",
|
||||
"@polkadot/api-base": "7.12.1",
|
||||
"@polkadot/api-derive": "7.12.1",
|
||||
"@polkadot/keyring": "^8.5.1",
|
||||
"@polkadot/rpc-augment": "7.12.1",
|
||||
"@polkadot/rpc-core": "7.12.1",
|
||||
"@polkadot/rpc-provider": "7.12.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-augment": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/types-create": "7.12.1",
|
||||
"@polkadot/types-known": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1",
|
||||
"@polkadot/util-crypto": "^8.5.1",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/api-augment": "7.14.2",
|
||||
"@polkadot/api-base": "7.14.2",
|
||||
"@polkadot/api-derive": "7.14.2",
|
||||
"@polkadot/keyring": "^8.7.1",
|
||||
"@polkadot/rpc-augment": "7.14.2",
|
||||
"@polkadot/rpc-core": "7.14.2",
|
||||
"@polkadot/rpc-provider": "7.14.2",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-augment": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/types-create": "7.14.2",
|
||||
"@polkadot/types-known": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1",
|
||||
"@polkadot/util-crypto": "^8.7.1",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "7.12.1",
|
||||
"@polkadot/types-support": "7.12.1"
|
||||
"@polkadot/api-augment": "7.14.2",
|
||||
"@polkadot/types-support": "7.14.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/rpc-core": "7.12.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1"
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/rpc-core": "7.14.2",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import type { BlockHash } from '@polkadot/types/interfaces/chain';
|
||||
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
|
||||
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
|
||||
import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts';
|
||||
import type { BlockStats } from '@polkadot/types/interfaces/dev';
|
||||
import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
|
||||
import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
|
||||
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
@@ -21,7 +22,7 @@ import type { StorageKind } from '@polkadot/types/interfaces/offchain';
|
||||
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
|
||||
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
|
||||
import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
|
||||
import type { ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
|
||||
import type { MigrationStatusResult, ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state';
|
||||
import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';
|
||||
import type { IExtrinsic, Observable } from '@polkadot/types/types';
|
||||
|
||||
@@ -155,6 +156,12 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
|
||||
**/
|
||||
uploadCode: AugmentedRpc<(uploadRequest: CodeUploadRequest | { origin?: any; code?: any; storageDepositLimit?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<CodeUploadResult>>;
|
||||
};
|
||||
dev: {
|
||||
/**
|
||||
* Reexecute the specified `block_hash` and gather statistics while doing so
|
||||
**/
|
||||
getBlockStats: AugmentedRpc<(at: Hash | string | Uint8Array) => Observable<Option<BlockStats>>>;
|
||||
};
|
||||
engine: {
|
||||
/**
|
||||
* Instructs the manual-seal authorship task to create a new block
|
||||
@@ -472,6 +479,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
|
||||
* Provides a way to trace the re-execution of a single block
|
||||
**/
|
||||
traceBlock: AugmentedRpc<(block: Hash | string | Uint8Array, targets: Option<Text> | null | object | string | Uint8Array, storageKeys: Option<Text> | null | object | string | Uint8Array, methods: Option<Text> | null | object | string | Uint8Array) => Observable<TraceBlockResponse>>;
|
||||
/**
|
||||
* Check current migration state
|
||||
**/
|
||||
trieMigrationStatus: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<MigrationStatusResult>>;
|
||||
};
|
||||
syncstate: {
|
||||
/**
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/rpc-augment": "7.12.1",
|
||||
"@polkadot/rpc-provider": "7.12.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/rpc-augment": "7.14.2",
|
||||
"@polkadot/rpc-provider": "7.14.2",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^8.5.1",
|
||||
"@polkadot/rpc-augment": "7.12.1"
|
||||
"@polkadot/keyring": "^8.7.1",
|
||||
"@polkadot/rpc-augment": "7.14.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -36,7 +36,9 @@ describe('replay', (): void => {
|
||||
const observable = rpc.system.chain();
|
||||
let a: any | undefined;
|
||||
|
||||
observable.subscribe((value?: unknown): void => { a = value; });
|
||||
observable.subscribe((value?: unknown): void => {
|
||||
a = value;
|
||||
});
|
||||
|
||||
setTimeout((): void => {
|
||||
// Subscribe again to the same observable, it should fire value immediately
|
||||
|
||||
@@ -14,7 +14,9 @@ describe('drr', (): void => {
|
||||
it('should not fire twice the same value', (done): void => {
|
||||
let count = 0;
|
||||
|
||||
const sub = of(1, 1).pipe(drr({ delay: 500 })).subscribe((): void => { ++count; });
|
||||
const sub = of(1, 1).pipe(drr({ delay: 500 })).subscribe((): void => {
|
||||
++count;
|
||||
});
|
||||
|
||||
setTimeout((): void => {
|
||||
expect(count).toBe(1);
|
||||
|
||||
@@ -4,9 +4,9 @@ Generic transport providers to handle the transport of method calls to and from
|
||||
|
||||
## Provider Selection
|
||||
|
||||
There are two flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets. It is generally recommended to use the [[WsProvider]] since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client.
|
||||
There are three flavours of the providers provided, one allowing for using HTTP as a transport mechanism, the other using WebSockets, and the third one uses substrate light-client through @substrate/connect. It is generally recommended to use the [[WsProvider]] since in addition to standard calls, it allows for subscriptions where all changes to state can be pushed from the node to the client.
|
||||
|
||||
Both providers are usable (as is the API), in both browser-based and Node.js environments. Polyfills for unsupported functionality are automatically applied based on feature-detection.
|
||||
All providers are usable (as is the API), in both browser-based and Node.js environments. Polyfills for unsupported functionality are automatically applied based on feature-detection.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -39,3 +39,24 @@ const version = await provider.send('chain_getBlockHash', []);
|
||||
|
||||
console.log('latest block Hash', hash);
|
||||
```
|
||||
|
||||
@substrate/connect Initialization -
|
||||
|
||||
Instantiating a Provider for the Polkadot Relay Chain:
|
||||
```javascript
|
||||
import { ScProvider } from '@polkadot/rpc-provider';
|
||||
|
||||
const provider = new ScProvider(SupportedChains.polkadot);
|
||||
await provider.connect();
|
||||
const version = await provider.send('chain_getBlockHash', []);
|
||||
```
|
||||
|
||||
Instantiating a Provider for a Polkadot parachain:
|
||||
```javascript
|
||||
import { ScProvider } from '@polkadot/rpc-provider';
|
||||
|
||||
const polkadotProvider = new ScProvider(SupportedChains.polkadot);
|
||||
const parachainProvider = new ScProvider(parachainSpec, polkadotProvider);
|
||||
await parachainProvider.connect();
|
||||
const version = await parachainProvider.send('chain_getBlockHash', []);
|
||||
```
|
||||
|
||||
@@ -20,18 +20,19 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/keyring": "^8.5.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-support": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1",
|
||||
"@polkadot/util-crypto": "^8.5.1",
|
||||
"@polkadot/x-fetch": "^8.5.1",
|
||||
"@polkadot/x-global": "^8.5.1",
|
||||
"@polkadot/x-ws": "^8.5.1",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/keyring": "^8.7.1",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-support": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1",
|
||||
"@polkadot/util-crypto": "^8.7.1",
|
||||
"@polkadot/x-fetch": "^8.7.1",
|
||||
"@polkadot/x-global": "^8.7.1",
|
||||
"@polkadot/x-ws": "^8.7.1",
|
||||
"@substrate/connect": "0.7.0-alpha.0",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"mock-socket": "^9.1.2",
|
||||
"nock": "^13.2.4"
|
||||
|
||||
@@ -4,3 +4,6 @@
|
||||
export { HttpProvider } from './http';
|
||||
export { packageInfo } from './packageInfo';
|
||||
export { WsProvider } from './ws';
|
||||
|
||||
// ESM-only, only export top-level when we have dual versions
|
||||
// export { ScProvider } from './substrate-connect';
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { isError } from '@polkadot/util/is/error';
|
||||
|
||||
import RpcError from './error';
|
||||
|
||||
describe('RpcError', (): void => {
|
||||
describe('constructor', (): void => {
|
||||
it('constructs an Error that is still an Error', (): void => {
|
||||
expect(
|
||||
isError(
|
||||
new RpcError()
|
||||
)
|
||||
).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('static', (): void => {
|
||||
it('exposes the .CODES as a static', (): void => {
|
||||
expect(
|
||||
Object.keys(RpcError.CODES)
|
||||
).not.toEqual(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('constructor properties', (): void => {
|
||||
it('sets the .message property', (): void => {
|
||||
expect(
|
||||
new RpcError('test message').message
|
||||
).toEqual('test message');
|
||||
});
|
||||
|
||||
it("sets the .message to '' when not set", (): void => {
|
||||
expect(
|
||||
new RpcError().message
|
||||
).toEqual('');
|
||||
});
|
||||
|
||||
it('sets the .code property', (): void => {
|
||||
expect(
|
||||
new RpcError('test message', 1234).code
|
||||
).toEqual(1234);
|
||||
});
|
||||
|
||||
it('sets the .code to UKNOWN when not set', (): void => {
|
||||
expect(
|
||||
new RpcError('test message').code
|
||||
).toEqual(RpcError.CODES.UNKNOWN);
|
||||
});
|
||||
|
||||
it('sets the .data property', (): void => {
|
||||
const data = 'here';
|
||||
|
||||
expect(
|
||||
new RpcError('test message', 1234, data).data
|
||||
).toEqual(data);
|
||||
});
|
||||
|
||||
it('sets the .data property to generic value', (): void => {
|
||||
const data = { custom: 'value' } as const;
|
||||
|
||||
expect(
|
||||
new RpcError('test message', 1234, data).data
|
||||
).toEqual(data);
|
||||
});
|
||||
});
|
||||
|
||||
describe('stack traces', (): void => {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
let captureStackTrace: (targetObject: Record<string, any>, constructorOpt?: Function | undefined) => void;
|
||||
|
||||
beforeEach((): void => {
|
||||
captureStackTrace = Error.captureStackTrace;
|
||||
|
||||
Error.captureStackTrace = function (error): void {
|
||||
Object.defineProperty(error, 'stack', {
|
||||
configurable: true,
|
||||
get: function getStack (): string {
|
||||
const value = 'some stack returned';
|
||||
|
||||
Object.defineProperty(this, 'stack', { value });
|
||||
|
||||
return value;
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
afterEach((): void => {
|
||||
Error.captureStackTrace = captureStackTrace;
|
||||
});
|
||||
|
||||
it('captures via captureStackTrace when available', (): void => {
|
||||
expect(
|
||||
new RpcError().stack
|
||||
).toEqual('some stack returned');
|
||||
});
|
||||
|
||||
it('captures via stack when captureStackTrace not available', (): void => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
Error.captureStackTrace = null as any;
|
||||
|
||||
expect(
|
||||
new RpcError().stack.length
|
||||
).not.toEqual(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { isFunction } from '@polkadot/util/is/function';
|
||||
|
||||
import { RpcErrorInterface } from '../types';
|
||||
|
||||
const UNKNOWN = -99999;
|
||||
|
||||
function extend<Data, K extends keyof RpcError<Data>> (that: RpcError<Data>, name: K, value: RpcError<Data>[K]): void {
|
||||
Object.defineProperty(that, name, {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @name RpcError
|
||||
* @summary Extension to the basic JS Error.
|
||||
* @description
|
||||
* The built-in JavaScript Error class is extended by adding a code to allow for Error categorization. In addition to the normal `stack`, `message`, the numeric `code` and `data` (any types) parameters are available on the object.
|
||||
* @example
|
||||
* <BR>
|
||||
*
|
||||
* ```javascript
|
||||
* const { RpcError } from '@polkadot/util');
|
||||
*
|
||||
* throw new RpcError('some message', RpcError.CODES.METHOD_NOT_FOUND); // => error.code = -32601
|
||||
* ```
|
||||
*/
|
||||
export default class RpcError<Data = never> extends Error implements RpcErrorInterface<Data> {
|
||||
public code!: number;
|
||||
|
||||
public data?: Data;
|
||||
|
||||
public override message!: string;
|
||||
|
||||
public override name!: string;
|
||||
|
||||
public override stack!: string;
|
||||
|
||||
public constructor (message = '', code: number = UNKNOWN, data?: Data) {
|
||||
super();
|
||||
|
||||
extend(this, 'message', String(message));
|
||||
extend(this, 'name', this.constructor.name);
|
||||
extend(this, 'data', data);
|
||||
extend(this, 'code', code);
|
||||
|
||||
if (isFunction(Error.captureStackTrace)) {
|
||||
Error.captureStackTrace(this, this.constructor);
|
||||
} else {
|
||||
const { stack } = new Error(message);
|
||||
|
||||
stack && extend(this, 'stack', stack);
|
||||
}
|
||||
}
|
||||
|
||||
public static CODES = {
|
||||
ASSERT: -90009,
|
||||
INVALID_JSONRPC: -99998,
|
||||
METHOD_NOT_FOUND: -32601, // Rust client
|
||||
UNKNOWN
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import type { JsonRpcRequest, JsonRpcResponse, JsonRpcResponseBaseError } from '
|
||||
|
||||
import { assert, isNumber, isString, isUndefined, stringify } from '@polkadot/util';
|
||||
|
||||
import RpcError from './error';
|
||||
|
||||
function formatErrorData (data?: string | number): string {
|
||||
if (isUndefined(data)) {
|
||||
return '';
|
||||
@@ -68,8 +70,9 @@ export class RpcCoder {
|
||||
private _checkError (error?: JsonRpcResponseBaseError): void {
|
||||
if (error) {
|
||||
const { code, data, message } = error;
|
||||
const fmtMessage = `${code}: ${message}${formatErrorData(data)}`;
|
||||
|
||||
throw new Error(`${code}: ${message}${formatErrorData(data)}`);
|
||||
throw new RpcError(fmtMessage, code, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types';
|
||||
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types';
|
||||
|
||||
import { assert, logger } from '@polkadot/util';
|
||||
import { fetch } from '@polkadot/x-fetch';
|
||||
@@ -43,6 +43,8 @@ export class HttpProvider implements ProviderInterface {
|
||||
|
||||
readonly #headers: Record<string, string>;
|
||||
|
||||
readonly #stats: ProviderStats;
|
||||
|
||||
/**
|
||||
* @param {string} endpoint The endpoint url starting with http://
|
||||
*/
|
||||
@@ -52,6 +54,10 @@ export class HttpProvider implements ProviderInterface {
|
||||
this.#coder = new RpcCoder();
|
||||
this.#endpoint = endpoint;
|
||||
this.#headers = headers;
|
||||
this.#stats = {
|
||||
active: { requests: 0, subscriptions: 0 },
|
||||
total: { bytesRecv: 0, bytesSent: 0, cached: 0, requests: 0, subscriptions: 0, timeout: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,6 +88,13 @@ export class HttpProvider implements ProviderInterface {
|
||||
// noop
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the connection stats
|
||||
*/
|
||||
public get stats (): ProviderStats {
|
||||
return this.#stats;
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Whether the node is connected or not.
|
||||
* @return {boolean} true if connected
|
||||
@@ -107,6 +120,8 @@ export class HttpProvider implements ProviderInterface {
|
||||
* @summary Send HTTP POST Request with Body to configured HTTP Endpoint.
|
||||
*/
|
||||
public async send <T> (method: string, params: unknown[], isCacheable?: boolean): Promise<T> {
|
||||
this.#stats.total.requests++;
|
||||
|
||||
const body = this.#coder.encodeJson(method, params);
|
||||
let resultPromise: Promise<T> | null = isCacheable
|
||||
? this.#callCache.get(body) as Promise<T>
|
||||
@@ -118,28 +133,45 @@ export class HttpProvider implements ProviderInterface {
|
||||
if (isCacheable) {
|
||||
this.#callCache.set(body, resultPromise);
|
||||
}
|
||||
} else {
|
||||
this.#stats.total.cached++;
|
||||
}
|
||||
|
||||
return resultPromise;
|
||||
}
|
||||
|
||||
async #send <T> (body: string): Promise<T> {
|
||||
const response = await fetch(this.#endpoint, {
|
||||
body,
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Length': `${body.length}`,
|
||||
'Content-Type': 'application/json',
|
||||
...this.#headers
|
||||
},
|
||||
method: 'POST'
|
||||
});
|
||||
this.#stats.active.requests++;
|
||||
this.#stats.total.bytesSent += body.length;
|
||||
|
||||
assert(response.ok, () => `[${response.status}]: ${response.statusText}`);
|
||||
try {
|
||||
const response = await fetch(this.#endpoint, {
|
||||
body,
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Length': `${body.length}`,
|
||||
'Content-Type': 'application/json',
|
||||
...this.#headers
|
||||
},
|
||||
method: 'POST'
|
||||
});
|
||||
|
||||
const result = (await response.json()) as JsonRpcResponse;
|
||||
assert(response.ok, () => `[${response.status}]: ${response.statusText}`);
|
||||
|
||||
return this.#coder.decodeResponse(result) as T;
|
||||
const result = await response.text();
|
||||
|
||||
this.#stats.total.bytesRecv += result.length;
|
||||
|
||||
const decoded = this.#coder.decodeResponse(JSON.parse(result) as JsonRpcResponse) as T;
|
||||
|
||||
this.#stats.active.requests--;
|
||||
|
||||
return decoded;
|
||||
} catch (e) {
|
||||
this.#stats.active.requests--;
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -0,0 +1,347 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { assert } from '@polkadot/util';
|
||||
|
||||
export interface SmoldotHealth {
|
||||
isSyncing: boolean
|
||||
peers: number
|
||||
shouldHavePeers: boolean
|
||||
}
|
||||
|
||||
export interface HealthChecker {
|
||||
setSendJsonRpc(sendRequest: (request: string) => void): void
|
||||
start(healthCallback: (health: SmoldotHealth) => void): void
|
||||
stop(): void
|
||||
sendJsonRpc(request: string): void
|
||||
responsePassThrough(response: string): string | null
|
||||
}
|
||||
|
||||
/*
|
||||
* Creates a new health checker.
|
||||
*
|
||||
* The role of the health checker is to report to the user the health of a smoldot chain.
|
||||
*
|
||||
* In order to use it, start by creating a health checker, and call `setSendJsonRpc` to set the
|
||||
* way to send a JSON-RPC request to a chain. The health checker is disabled by default. Use
|
||||
* `start()` in order to start the health checks. The `start()` function must be passed a callback called
|
||||
* when an update to the health of the node is available.
|
||||
*
|
||||
* In order to send a JSON-RPC request to the chain, you **must** use the `sendJsonRpc` function
|
||||
* of the health checker. The health checker rewrites the `id` of the requests it receives.
|
||||
*
|
||||
* When the chain send a JSON-RPC response, it must be passed to `responsePassThrough()`. This
|
||||
* function intercepts the responses destined to the requests that have been emitted by the health
|
||||
* checker and returns `null`. If the response doesn't concern the health checker, the response is
|
||||
* simply returned by the function.
|
||||
*
|
||||
* # How it works
|
||||
*
|
||||
* The health checker periodically calls the `system_health` JSON-RPC call in order to determine
|
||||
* the health of the chain.
|
||||
*
|
||||
* In addition to this, as long as the health check reports that `isSyncing` is `true`, the
|
||||
* health checker also maintains a subscription to new best blocks using `chain_subscribeNewHeads`.
|
||||
* Whenever a new block is notified, a health check is performed immediately in order to determine
|
||||
* whether `isSyncing` has changed to `false`.
|
||||
*
|
||||
* Thanks to this subscription, the latency of the report of the switch from `isSyncing: true` to
|
||||
* `isSyncing: false` is very low.
|
||||
*
|
||||
*/
|
||||
export function healthChecker (): HealthChecker {
|
||||
// `null` if health checker is not started.
|
||||
let checker: null | InnerChecker = null;
|
||||
let sendJsonRpc: null | ((request: string) => void) = null;
|
||||
|
||||
return {
|
||||
responsePassThrough: (jsonRpcResponse) => {
|
||||
if (checker === null) {
|
||||
return jsonRpcResponse;
|
||||
}
|
||||
|
||||
return checker.responsePassThrough(jsonRpcResponse);
|
||||
},
|
||||
sendJsonRpc: (request) => {
|
||||
assert(
|
||||
sendJsonRpc,
|
||||
'setSendJsonRpc must be called before sending requests'
|
||||
);
|
||||
|
||||
if (checker === null) {
|
||||
sendJsonRpc(request);
|
||||
} else {
|
||||
checker.sendJsonRpc(request);
|
||||
}
|
||||
},
|
||||
setSendJsonRpc: (cb) => {
|
||||
sendJsonRpc = cb;
|
||||
},
|
||||
start: (healthCallback) => {
|
||||
assert(
|
||||
checker === null,
|
||||
"Can't start the health checker multiple times in parallel"
|
||||
);
|
||||
assert(
|
||||
sendJsonRpc,
|
||||
'setSendJsonRpc must be called before starting the health checks'
|
||||
);
|
||||
checker = new InnerChecker(healthCallback, sendJsonRpc);
|
||||
checker.update(true);
|
||||
},
|
||||
stop: () => {
|
||||
if (checker === null) {
|
||||
return;
|
||||
} // Already stopped.
|
||||
|
||||
checker.destroy();
|
||||
checker = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class InnerChecker {
|
||||
#healthCallback: (health: SmoldotHealth) => void;
|
||||
#currentHealthCheckId: string | null = null;
|
||||
#currentHealthTimeout: ReturnType<typeof setTimeout> | null = null;
|
||||
#currentSubunsubRequestId: string | null = null;
|
||||
#currentSubscriptionId: string | null = null;
|
||||
#requestToSmoldot: (request: string) => void;
|
||||
#isSyncing = false;
|
||||
#nextRequestId = 0;
|
||||
|
||||
constructor (
|
||||
healthCallback: (health: SmoldotHealth) => void,
|
||||
requestToSmoldot: (request: string) => void
|
||||
) {
|
||||
this.#healthCallback = healthCallback;
|
||||
this.#requestToSmoldot = requestToSmoldot;
|
||||
}
|
||||
|
||||
sendJsonRpc = (request: string): void => {
|
||||
// Replace the `id` in the request to prefix the request ID with `extern:`.
|
||||
let parsedRequest: {id: string | number};
|
||||
|
||||
try {
|
||||
parsedRequest = JSON.parse(request) as {id: string | number};
|
||||
} catch (err) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (parsedRequest.id) {
|
||||
const newId = 'extern:' + JSON.stringify(parsedRequest.id);
|
||||
|
||||
parsedRequest.id = newId;
|
||||
}
|
||||
|
||||
this.#requestToSmoldot(JSON.stringify(parsedRequest));
|
||||
};
|
||||
|
||||
responsePassThrough = (jsonRpcResponse: string): string | null => {
|
||||
let parsedResponse: {id: string, result?: SmoldotHealth, params?: { subscription: string }};
|
||||
|
||||
try {
|
||||
parsedResponse = JSON.parse(jsonRpcResponse) as {id: string, result: undefined | SmoldotHealth};
|
||||
} catch (err) {
|
||||
return jsonRpcResponse;
|
||||
}
|
||||
|
||||
// Check whether response is a response to `system_health`.
|
||||
if (parsedResponse.id && this.#currentHealthCheckId === parsedResponse.id) {
|
||||
this.#currentHealthCheckId = null;
|
||||
|
||||
// Check whether query was successful. It is possible for queries to fail for
|
||||
// various reasons, such as the client being overloaded.
|
||||
if (!parsedResponse.result) {
|
||||
this.update(false);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
this.#healthCallback(parsedResponse.result);
|
||||
this.#isSyncing = parsedResponse.result.isSyncing;
|
||||
this.update(false);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check whether response is a response to the subscription or unsubscription.
|
||||
if (
|
||||
parsedResponse.id &&
|
||||
this.#currentSubunsubRequestId === parsedResponse.id
|
||||
) {
|
||||
this.#currentSubunsubRequestId = null;
|
||||
|
||||
// Check whether query was successful. It is possible for queries to fail for
|
||||
// various reasons, such as the client being overloaded.
|
||||
if (!parsedResponse.result) {
|
||||
this.update(false);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.#currentSubscriptionId) {
|
||||
this.#currentSubscriptionId = null;
|
||||
} else {
|
||||
this.#currentSubscriptionId = parsedResponse.result as unknown as string;
|
||||
}
|
||||
|
||||
this.update(false);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check whether response is a notification to a subscription.
|
||||
if (
|
||||
parsedResponse.params &&
|
||||
this.#currentSubscriptionId &&
|
||||
parsedResponse.params.subscription === this.#currentSubscriptionId
|
||||
) {
|
||||
// Note that after a successful subscription, a notification containing
|
||||
// the current best block is always returned. Considering that a
|
||||
// subscription is performed in response to a health check, calling
|
||||
// `startHealthCheck()` here will lead to a second health check.
|
||||
// It might seem redundant to perform two health checks in a quick
|
||||
// succession, but doing so doesn't lead to any problem, and it is
|
||||
// actually possible for the health to have changed in between as the
|
||||
// current best block might have been updated during the subscription
|
||||
// request.
|
||||
this.update(true);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Response doesn't concern us.
|
||||
if (parsedResponse.id) {
|
||||
const id: string = parsedResponse.id;
|
||||
|
||||
// Need to remove the `extern:` prefix.
|
||||
assert(id.startsWith('extern:'), 'State inconsistency in health checker');
|
||||
|
||||
const newId = JSON.parse(id.slice('extern:'.length)) as string;
|
||||
|
||||
parsedResponse.id = newId;
|
||||
}
|
||||
|
||||
return JSON.stringify(parsedResponse);
|
||||
};
|
||||
|
||||
update = (startNow: boolean): void => {
|
||||
// If `startNow`, clear `#currentHealthTimeout` so that it is set below.
|
||||
if (startNow && this.#currentHealthTimeout) {
|
||||
clearTimeout(this.#currentHealthTimeout);
|
||||
this.#currentHealthTimeout = null;
|
||||
}
|
||||
|
||||
if (!this.#currentHealthTimeout) {
|
||||
const startHealthRequest = () => {
|
||||
this.#currentHealthTimeout = null;
|
||||
|
||||
// No matter what, don't start a health request if there is already one in progress.
|
||||
// This is sane to do because receiving a response to a health request calls `update()`.
|
||||
if (this.#currentHealthCheckId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Actual request starting.
|
||||
this.#currentHealthCheckId = 'health-checker:'.concat(
|
||||
this.#nextRequestId.toString()
|
||||
);
|
||||
this.#nextRequestId += 1;
|
||||
this.#requestToSmoldot(
|
||||
JSON.stringify({
|
||||
id: this.#currentHealthCheckId,
|
||||
jsonrpc: '2.0',
|
||||
method: 'system_health',
|
||||
params: []
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
if (startNow) {
|
||||
startHealthRequest();
|
||||
} else {
|
||||
this.#currentHealthTimeout = setTimeout(startHealthRequest, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
this.#isSyncing &&
|
||||
!this.#currentSubscriptionId &&
|
||||
!this.#currentSubunsubRequestId
|
||||
) {
|
||||
this.startSubscription();
|
||||
}
|
||||
|
||||
if (
|
||||
!this.#isSyncing &&
|
||||
this.#currentSubscriptionId &&
|
||||
!this.#currentSubunsubRequestId
|
||||
) {
|
||||
this.endSubscription();
|
||||
}
|
||||
};
|
||||
|
||||
startSubscription = (): void => {
|
||||
assert(
|
||||
!this.#currentSubunsubRequestId && !this.#currentSubscriptionId,
|
||||
'Internal error in health checker'
|
||||
);
|
||||
|
||||
this.#currentSubunsubRequestId = 'health-checker:'.concat(
|
||||
this.#nextRequestId.toString()
|
||||
);
|
||||
this.#nextRequestId += 1;
|
||||
this.#requestToSmoldot(
|
||||
JSON.stringify({
|
||||
id: this.#currentSubunsubRequestId,
|
||||
jsonrpc: '2.0',
|
||||
method: 'chain_subscribeNewHeads',
|
||||
params: []
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
endSubscription = (): void => {
|
||||
assert(
|
||||
!this.#currentSubunsubRequestId && this.#currentSubscriptionId,
|
||||
'Internal error in health checker'
|
||||
);
|
||||
|
||||
this.#currentSubunsubRequestId = 'health-checker:'.concat(
|
||||
this.#nextRequestId.toString()
|
||||
);
|
||||
this.#nextRequestId += 1;
|
||||
this.#requestToSmoldot(
|
||||
JSON.stringify({
|
||||
id: this.#currentSubunsubRequestId,
|
||||
jsonrpc: '2.0',
|
||||
method: 'chain_unsubscribeNewHeads',
|
||||
params: [this.#currentSubscriptionId]
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
destroy = (): void => {
|
||||
if (this.#currentHealthTimeout) {
|
||||
clearTimeout(this.#currentHealthTimeout);
|
||||
this.#currentHealthTimeout = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export class HealthCheckError extends Error {
|
||||
readonly #cause: unknown;
|
||||
|
||||
getCause (): unknown {
|
||||
return this.#cause;
|
||||
}
|
||||
|
||||
constructor (
|
||||
response: unknown,
|
||||
message = 'Got error response asking for system health'
|
||||
) {
|
||||
super(message);
|
||||
this.#cause = response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,647 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
/* eslint-disable promise/param-names */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||
/* eslint-disable @typescript-eslint/no-floating-promises */
|
||||
/* eslint-disable @typescript-eslint/restrict-template-expressions */
|
||||
/* eslint-disable @typescript-eslint/ban-types */
|
||||
|
||||
import type { Chain, JsonRpcCallback } from '@substrate/connect';
|
||||
import type { HealthChecker, SmoldotHealth } from './Health';
|
||||
import type { ScProviderClass } from './ScProvider';
|
||||
|
||||
import { jest } from '@jest/globals';
|
||||
|
||||
const wait = (ms: number) => new Promise((res) => setTimeout(res, ms));
|
||||
|
||||
type MockedHealthChecker = HealthChecker & {
|
||||
_isActive: () => boolean
|
||||
_triggerHealthUpdate: (update: SmoldotHealth) => void
|
||||
}
|
||||
|
||||
const healthCheckerMock = (): MockedHealthChecker => {
|
||||
let cb: (health: SmoldotHealth) => void = () => {};
|
||||
|
||||
let sendJsonRpc: (request: string) => void = () => {};
|
||||
|
||||
let isActive = false;
|
||||
|
||||
return {
|
||||
setSendJsonRpc: (cb) => {
|
||||
sendJsonRpc = cb;
|
||||
},
|
||||
start: (x) => {
|
||||
isActive = true;
|
||||
cb = x;
|
||||
},
|
||||
stop: () => {
|
||||
isActive = false;
|
||||
},
|
||||
sendJsonRpc: (...args) => sendJsonRpc(...args),
|
||||
responsePassThrough: (response) => response,
|
||||
_isActive: () => isActive,
|
||||
_triggerHealthUpdate: (update: SmoldotHealth) => {
|
||||
cb(update);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const healthCheckerFactory = () => {
|
||||
const _healthCheckers: MockedHealthChecker[] = [];
|
||||
|
||||
return {
|
||||
healthChecker: () => {
|
||||
const result = healthCheckerMock();
|
||||
|
||||
_healthCheckers.push(result);
|
||||
|
||||
return result;
|
||||
},
|
||||
_healthCheckers,
|
||||
_latestHealthChecker: () => _healthCheckers.slice(-1)[0]
|
||||
};
|
||||
};
|
||||
|
||||
jest.mock('./Health', () => healthCheckerFactory());
|
||||
|
||||
type MockChain = 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: JsonRpcCallback): MockChain => {
|
||||
const _receivedRequests: string[] = [];
|
||||
let _isTerminated = false;
|
||||
|
||||
let terminateInterceptor: Function = Function.prototype;
|
||||
let sendJsonRpcInterceptor: Function = Function.prototype;
|
||||
|
||||
return {
|
||||
_spec: () => spec,
|
||||
_recevedRequests: () => _receivedRequests,
|
||||
_isTerminated: () => _isTerminated,
|
||||
_triggerCallback: (response) => {
|
||||
callback(
|
||||
typeof response === 'string' ? response : JSON.stringify(response)
|
||||
);
|
||||
},
|
||||
_setSendJsonRpcInterceptor: (fn) => {
|
||||
sendJsonRpcInterceptor = fn;
|
||||
},
|
||||
_setTerminateInterceptor: (fn) => {
|
||||
terminateInterceptor = fn;
|
||||
},
|
||||
sendJsonRpc: (rpc) => {
|
||||
sendJsonRpcInterceptor(rpc);
|
||||
_receivedRequests.push(rpc);
|
||||
},
|
||||
remove: () => {
|
||||
terminateInterceptor();
|
||||
_isTerminated = true;
|
||||
},
|
||||
_getLatestRequest: () => _receivedRequests[_receivedRequests.length - 1]
|
||||
};
|
||||
};
|
||||
|
||||
const getFakeClient = () => {
|
||||
const chains: MockChain[] = [];
|
||||
let addChainInterceptor: Promise<void> = Promise.resolve();
|
||||
let addWellKnownChainInterceptor: Promise<void> = Promise.resolve();
|
||||
|
||||
return {
|
||||
_chains: () => chains,
|
||||
_setAddChainInterceptor: (interceptor: Promise<void>) => {
|
||||
addChainInterceptor = interceptor;
|
||||
},
|
||||
_setAddWellKnownChainInterceptor: (interceptor: Promise<void>) => {
|
||||
addWellKnownChainInterceptor = interceptor;
|
||||
},
|
||||
addChain: (chainSpec: string, cb: JsonRpcCallback): Promise<MockChain> =>
|
||||
addChainInterceptor.then(() => {
|
||||
const result = getFakeChain(chainSpec, cb);
|
||||
|
||||
chains.push(result);
|
||||
|
||||
return result;
|
||||
}),
|
||||
addWellKnownChain: (
|
||||
wellKnownChain: string,
|
||||
cb: JsonRpcCallback
|
||||
): Promise<MockChain> =>
|
||||
addWellKnownChainInterceptor.then(() => {
|
||||
const result = getFakeChain(wellKnownChain, cb);
|
||||
|
||||
chains.push(result);
|
||||
|
||||
return result;
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
enum WellKnownChain {
|
||||
polkadot = 'polkadot',
|
||||
ksmcc3 = 'ksmcc3',
|
||||
rococo_v2_1 = 'rococo_v2_1',
|
||||
westend2 = 'westend2'
|
||||
}
|
||||
|
||||
const connectorFactory = () => {
|
||||
const clients: ReturnType<typeof getFakeClient>[] = [];
|
||||
const latestClient = () => clients[clients.length - 1];
|
||||
|
||||
return {
|
||||
WellKnownChain,
|
||||
createScClient: () => {
|
||||
const result = getFakeClient();
|
||||
|
||||
clients.push(result);
|
||||
|
||||
return result;
|
||||
},
|
||||
_clients: () => clients,
|
||||
latestClient,
|
||||
latestChain: () =>
|
||||
latestClient()._chains()[latestClient()._chains().length - 1]
|
||||
};
|
||||
};
|
||||
|
||||
jest.mock('@substrate/connect', () => connectorFactory());
|
||||
|
||||
let ScProvider: ScProviderClass;
|
||||
let mockedConnector: ReturnType<typeof connectorFactory>;
|
||||
let mockedHealthChecker: ReturnType<typeof healthCheckerFactory>;
|
||||
const getCurrentHealthChecker = () => mockedHealthChecker._latestHealthChecker();
|
||||
|
||||
const setChainSyncyingStatus = (isSyncing: boolean) => {
|
||||
getCurrentHealthChecker()._triggerHealthUpdate({
|
||||
isSyncing,
|
||||
peers: 1,
|
||||
shouldHavePeers: true
|
||||
});
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
({ ScProvider } = await import('./ScProvider'));
|
||||
mockedConnector = (await import(
|
||||
'@substrate/connect'
|
||||
)) as unknown as ReturnType<typeof connectorFactory>;
|
||||
mockedHealthChecker = await (import('./Health') as any);
|
||||
});
|
||||
|
||||
describe('ScProvider', () => {
|
||||
describe('on', () => {
|
||||
it('emits `connected` as soon as the chain is not syncing', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
const onConnected = jest.fn();
|
||||
|
||||
provider.on('connected', onConnected);
|
||||
|
||||
expect(onConnected).not.toHaveBeenCalled();
|
||||
setChainSyncyingStatus(false);
|
||||
expect(onConnected).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('stops receiving notifications after unsubscribing', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
const onConnected = jest.fn();
|
||||
|
||||
provider.on('connected', onConnected)();
|
||||
expect(onConnected).not.toHaveBeenCalled();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
expect(onConnected).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('synchronously emits connected if the Provider is already `connected`', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
const onConnected = jest.fn();
|
||||
|
||||
provider.on('connected', onConnected);
|
||||
expect(onConnected).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('emits `disconnected` once the chain goes back to syncing', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
const onConnected = jest.fn();
|
||||
|
||||
provider.on('connected', onConnected);
|
||||
const onDisconnected = jest.fn();
|
||||
|
||||
provider.on('disconnected', onDisconnected);
|
||||
|
||||
expect(onConnected).toHaveBeenCalled();
|
||||
expect(onDisconnected).not.toHaveBeenCalled();
|
||||
|
||||
onConnected.mockRestore();
|
||||
setChainSyncyingStatus(true);
|
||||
|
||||
expect(onConnected).not.toHaveBeenCalled();
|
||||
expect(onDisconnected).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('hasSubscriptions', () => {
|
||||
it('supports subscriptions', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
expect(provider.hasSubscriptions).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('clone', () => {
|
||||
it('can not be clonned', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
expect(() => provider.clone()).toThrowError();
|
||||
});
|
||||
});
|
||||
|
||||
describe('connect', () => {
|
||||
it('does not create a new chain when trying to re-connect while the current chain is syncing', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
await provider.connect();
|
||||
expect(chain).toBe(mockedConnector.latestChain());
|
||||
});
|
||||
|
||||
it('throws when trying to connect on an already connected Provider', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
await expect(provider.connect()).rejects.toThrowError(
|
||||
'Already connected!'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('disconnect', () => {
|
||||
it('removes the chain and cleans up', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
await provider.disconnect();
|
||||
|
||||
expect(chain._isTerminated()).toBe(true);
|
||||
});
|
||||
|
||||
it('does not throw when disconnecting on an already disconnected Provider', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
await provider.disconnect();
|
||||
await expect(provider.disconnect()).resolves.not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('send', () => {
|
||||
it('throws when trying to send a request while the Provider is not connected', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
await expect(provider.send('', [])).rejects.toThrow();
|
||||
});
|
||||
|
||||
it('receives responses to its requests', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
const responsePromise = provider.send('getData', ['foo']);
|
||||
|
||||
await wait(0);
|
||||
expect(chain._getLatestRequest()).toEqual(
|
||||
'{"id":1,"jsonrpc":"2.0","method":"getData","params":["foo"]}'
|
||||
);
|
||||
|
||||
const result = { foo: 'foo' };
|
||||
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
id: 1,
|
||||
result
|
||||
});
|
||||
|
||||
const response = await responsePromise;
|
||||
|
||||
expect(response).toEqual(result);
|
||||
});
|
||||
|
||||
it("rejects when the response can't be deserialized", async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
setTimeout(() => {
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
id: 1
|
||||
});
|
||||
}, 0);
|
||||
|
||||
await expect(provider.send('getData', ['foo'])).rejects.toThrow();
|
||||
});
|
||||
|
||||
it('rejects when the smoldot chain has crashed', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
await wait(0);
|
||||
|
||||
chain._setSendJsonRpcInterceptor(() => {
|
||||
throw new Error('boom!');
|
||||
});
|
||||
|
||||
await expect(provider.send('getData', ['foo'])).rejects.toThrowError(
|
||||
'Disconnected'
|
||||
);
|
||||
expect(provider.isConnected).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('subscribe', () => {
|
||||
it('subscribes and recives messages until it unsubscribes', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
const unsubscribeToken = 'unsubscribeToken';
|
||||
|
||||
setTimeout(() => {
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
id: 1,
|
||||
result: unsubscribeToken
|
||||
});
|
||||
}, 0);
|
||||
|
||||
const cb = jest.fn();
|
||||
const token = await provider.subscribe(
|
||||
'foo',
|
||||
'chain_subscribeNewHeads',
|
||||
['baz'],
|
||||
cb
|
||||
);
|
||||
|
||||
expect(token).toBe(unsubscribeToken);
|
||||
expect(cb).not.toHaveBeenCalled();
|
||||
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
method: 'foo',
|
||||
params: {
|
||||
result: 1,
|
||||
subscription: token
|
||||
}
|
||||
});
|
||||
expect(cb).toHaveBeenCalledTimes(1);
|
||||
expect(cb).toHaveBeenLastCalledWith(null, 1);
|
||||
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
method: 'foo',
|
||||
params: {
|
||||
result: 2,
|
||||
subscription: token
|
||||
}
|
||||
});
|
||||
expect(cb).toHaveBeenCalledTimes(2);
|
||||
expect(cb).toHaveBeenLastCalledWith(null, 2);
|
||||
|
||||
provider.unsubscribe('foo', 'chain_unsubscribeNewHeads', unsubscribeToken);
|
||||
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
method: 'foo',
|
||||
params: {
|
||||
result: 3,
|
||||
subscription: token
|
||||
}
|
||||
});
|
||||
expect(cb).toHaveBeenCalledTimes(2);
|
||||
expect(cb).toHaveBeenLastCalledWith(null, 2);
|
||||
});
|
||||
|
||||
it('ignores subscription messages that were received before the subscription token', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
const unsubscribeToken = 'unsubscribeToken';
|
||||
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
method: 'foo',
|
||||
params: {
|
||||
result: 1,
|
||||
subscription: unsubscribeToken
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
id: 1,
|
||||
result: unsubscribeToken
|
||||
});
|
||||
}, 0);
|
||||
|
||||
const cb = jest.fn();
|
||||
const token = await provider.subscribe(
|
||||
'foo',
|
||||
'chain_subscribeNewHeads',
|
||||
['baz'],
|
||||
cb
|
||||
);
|
||||
|
||||
expect(token).toBe(unsubscribeToken);
|
||||
expect(cb).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('emits the error when the message has an error', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
await wait(0);
|
||||
|
||||
const unsubscribeToken = 'unsubscribeToken';
|
||||
|
||||
setTimeout(() => {
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
id: 1,
|
||||
result: unsubscribeToken
|
||||
});
|
||||
}, 0);
|
||||
|
||||
const cb = jest.fn();
|
||||
const token = await provider.subscribe(
|
||||
'foo',
|
||||
'chain_subscribeNewHeads',
|
||||
['baz'],
|
||||
cb
|
||||
);
|
||||
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
method: 'foo',
|
||||
params: {
|
||||
error: 'boom',
|
||||
subscription: unsubscribeToken
|
||||
}
|
||||
});
|
||||
|
||||
expect(token).toBe(unsubscribeToken);
|
||||
expect(cb).toHaveBeenCalledTimes(1);
|
||||
expect(cb.mock.lastCall![0]).toBeInstanceOf(Error);
|
||||
expect(cb.mock.lastCall![1]).toBe(undefined);
|
||||
});
|
||||
|
||||
it('errors when subscribing to an unsupported method', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
await wait(0);
|
||||
|
||||
await expect(
|
||||
provider.subscribe('foo', 'bar', ['baz'], () => {})
|
||||
).rejects.toThrowError('Unsupported subscribe method: bar');
|
||||
});
|
||||
});
|
||||
|
||||
describe('unsubscribe', () => {
|
||||
it('rejects when trying to unsubscribe from un unexisting subscription', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
await expect(provider.unsubscribe('', '', '')).rejects.toThrowError(
|
||||
'Unable to find active subscription=::'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('cleans up the stale subscriptions once it reconnects', async () => {
|
||||
const provider = new ScProvider('');
|
||||
|
||||
await provider.connect();
|
||||
const chain = mockedConnector.latestChain();
|
||||
|
||||
// setting the syncing status of the chain to fals so that the Provider
|
||||
// gets `connected`
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
// while connected we create a subscription
|
||||
const unsubscribeToken = 'unsubscribeToken';
|
||||
|
||||
setTimeout(() => {
|
||||
chain._triggerCallback({
|
||||
jsonrpc: '2.0',
|
||||
id: 1,
|
||||
result: unsubscribeToken
|
||||
});
|
||||
}, 0);
|
||||
|
||||
const cb = jest.fn();
|
||||
const token = await provider.subscribe(
|
||||
'foo',
|
||||
'chain_subscribeNewHeads',
|
||||
['baz'],
|
||||
cb
|
||||
);
|
||||
|
||||
// setting the syncing status of the chain to fals so that the Provider
|
||||
// gets `disconnected`
|
||||
setChainSyncyingStatus(true);
|
||||
|
||||
// let's wait some time in order to ensure that the stale unsubscription
|
||||
// messages are not sent until the chain syncing status changes back to false
|
||||
await wait(200);
|
||||
|
||||
// before we let the healthChecker know that the chain is no longer syncing,
|
||||
// let's make sure that the chain has received the correct request, and
|
||||
// most importantly that it has not received a request for unsubscribing
|
||||
// from the stale subscription, since that request should happen once the
|
||||
// chain is no longer syncing
|
||||
expect(chain._recevedRequests()).toEqual([
|
||||
'{"id":1,"jsonrpc":"2.0","method":"chain_subscribeNewHeads","params":["baz"]}'
|
||||
]);
|
||||
|
||||
// lets change the sync status back to false
|
||||
setChainSyncyingStatus(false);
|
||||
|
||||
// let's wait one tick to ensure that the microtasks got processed
|
||||
await wait(0);
|
||||
|
||||
// let's make sure that we have now sent the request for killing the
|
||||
// stale subscription
|
||||
expect(chain._recevedRequests()).toEqual([
|
||||
'{"id":1,"jsonrpc":"2.0","method":"chain_subscribeNewHeads","params":["baz"]}',
|
||||
`{"id":2,"jsonrpc":"2.0","method":"chain_unsubscribeNewHeads","params":["${token}"]}`
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,345 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types';
|
||||
|
||||
import { Chain, createScClient, ScClient, WellKnownChain } from '@substrate/connect';
|
||||
import EventEmitter from 'eventemitter3';
|
||||
|
||||
import { assert, isError } from '@polkadot/util';
|
||||
|
||||
import { RpcCoder } from '../coder';
|
||||
import { healthChecker } from './Health';
|
||||
|
||||
type ResponseCallback = (response: string | Error) => void
|
||||
|
||||
// These methods have been taken from:
|
||||
// https://github.com/paritytech/smoldot/blob/17425040ddda47d539556eeaf62b88c4240d1d42/src/json_rpc/methods.rs#L338-L462
|
||||
// It's important to take into account that smoldot is adding support to the new
|
||||
// json-rpc-interface https://paritytech.github.io/json-rpc-interface-spec/
|
||||
// However, at the moment this list only includes methods that belong to the "old" API
|
||||
const subscriptionUnsubscriptionMethods = new Map<string, string>([
|
||||
['author_submitAndWatchExtrinsic', 'author_unwatchExtrinsic'],
|
||||
['chain_subscribeAllHeads', 'chain_unsubscribeAllHeads'],
|
||||
['chain_subscribeFinalizedHeads', 'chain_unsubscribeFinalizedHeads'],
|
||||
['chain_subscribeFinalisedHeads', 'chain_subscribeFinalisedHeads'],
|
||||
['chain_subscribeNewHeads', 'chain_unsubscribeNewHeads'],
|
||||
['chain_subscribeNewHead', 'chain_unsubscribeNewHead'],
|
||||
['chain_subscribeRuntimeVersion', 'chain_unsubscribeRuntimeVersion'],
|
||||
['subscribe_newHead', 'unsubscribe_newHead'],
|
||||
['state_subscribeRuntimeVersion', 'state_unsubscribeRuntimeVersion'],
|
||||
['state_subscribeStorage', 'state_unsubscribeStorage']
|
||||
]);
|
||||
|
||||
const wellKnownChains = new Set(Object.values(WellKnownChain));
|
||||
const scClients = new WeakMap<ScProvider, ScClient>();
|
||||
|
||||
export class ScProvider implements ProviderInterface {
|
||||
readonly #coder: RpcCoder = new RpcCoder();
|
||||
readonly #spec: string | WellKnownChain;
|
||||
readonly #sharedSandbox?: ScProvider;
|
||||
readonly #subscriptions: Map<
|
||||
string,
|
||||
[ResponseCallback, { unsubscribeMethod: string; id: string | number }]
|
||||
> = new Map();
|
||||
|
||||
readonly #requests: Map<number, ResponseCallback> = new Map();
|
||||
readonly #eventemitter: EventEmitter = new EventEmitter();
|
||||
#chain: Promise<Chain> | null = null;
|
||||
#isChainReady = false;
|
||||
|
||||
public constructor (spec: string | WellKnownChain, sharedSandbox?: ScProvider) {
|
||||
this.#spec = spec;
|
||||
this.#sharedSandbox = sharedSandbox;
|
||||
}
|
||||
|
||||
public get hasSubscriptions (): boolean {
|
||||
// Indicates that subscriptions are supported
|
||||
return true;
|
||||
}
|
||||
|
||||
public get isConnected (): boolean {
|
||||
return !!this.#chain && this.#isChainReady;
|
||||
}
|
||||
|
||||
public clone (): ProviderInterface {
|
||||
throw new Error('clone() is not supported.');
|
||||
}
|
||||
|
||||
async connect (): Promise<void> {
|
||||
assert(!this.isConnected, 'Already connected!');
|
||||
|
||||
// it could happen that after emitting `disconnected` due to the fact taht
|
||||
// smoldot is syncing, the consumer tries to reconnect after a certain amount
|
||||
// of time... In which case we want to make sure that we don't create a new
|
||||
// chain.
|
||||
if (this.#chain) {
|
||||
await this.#chain;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.#sharedSandbox && !this.#sharedSandbox.isConnected) {
|
||||
await this.#sharedSandbox.connect();
|
||||
}
|
||||
|
||||
const client = this.#sharedSandbox
|
||||
? scClients.get(this.#sharedSandbox)
|
||||
: createScClient();
|
||||
|
||||
assert(client, 'Unkown ScProvider!');
|
||||
scClients.set(this, client);
|
||||
|
||||
const hc = healthChecker();
|
||||
|
||||
const onResponse = (res: string): void => {
|
||||
const hcRes = hc.responsePassThrough(res);
|
||||
|
||||
if (!hcRes) {
|
||||
return;
|
||||
}
|
||||
|
||||
const response = JSON.parse(hcRes) as JsonRpcResponse;
|
||||
let decodedResponse: string | Error;
|
||||
|
||||
try {
|
||||
decodedResponse = this.#coder.decodeResponse(response) as string;
|
||||
} catch (e) {
|
||||
decodedResponse = e as Error;
|
||||
}
|
||||
|
||||
// It's not a subscription message, but rather a standar RPC response
|
||||
if (response.params?.subscription === undefined || !response.method) {
|
||||
return this.#requests.get(response.id)?.(decodedResponse);
|
||||
}
|
||||
|
||||
// We are dealing with a subscription message
|
||||
const subscriptionId = `${response.method}::${response.params.subscription}`;
|
||||
|
||||
const callback = this.#subscriptions.get(subscriptionId)?.[0];
|
||||
|
||||
callback?.(decodedResponse);
|
||||
};
|
||||
|
||||
const addChain = wellKnownChains.has(this.#spec as WellKnownChain)
|
||||
? client.addWellKnownChain
|
||||
: client.addChain;
|
||||
|
||||
this.#chain = addChain(this.#spec as WellKnownChain, onResponse).then((chain) => {
|
||||
hc.setSendJsonRpc(chain.sendJsonRpc);
|
||||
|
||||
this.#isChainReady = false;
|
||||
|
||||
const cleanup = () => {
|
||||
// If there are any callbacks left, we have to reject/error them.
|
||||
// Otherwise, that would cause a memory leak.
|
||||
const disconnectionError = new Error('Disconnected');
|
||||
|
||||
this.#requests.forEach((cb) => cb(disconnectionError));
|
||||
this.#subscriptions.forEach(([cb]) => cb(disconnectionError));
|
||||
this.#subscriptions.clear();
|
||||
};
|
||||
|
||||
const staleSubscriptions: {
|
||||
unsubscribeMethod: string
|
||||
id: number | string
|
||||
}[] = [];
|
||||
|
||||
const killStaleSubscriptions = () => {
|
||||
if (staleSubscriptions.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const { id, unsubscribeMethod } = staleSubscriptions.pop()!;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
Promise.race([
|
||||
this.send(unsubscribeMethod, [id]).catch(Function.prototype as () => void),
|
||||
new Promise((resolve) => setTimeout(resolve, 500))
|
||||
]).then(killStaleSubscriptions);
|
||||
};
|
||||
|
||||
hc.start((health) => {
|
||||
const isReady =
|
||||
!health.isSyncing && (health.peers > 0 || !health.shouldHavePeers);
|
||||
|
||||
// if it's the same as before, then nothing has changed and we are done
|
||||
if (this.#isChainReady === isReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.#isChainReady = isReady;
|
||||
|
||||
if (!isReady) {
|
||||
// If we've reached this point, that means that the chain used to be "ready"
|
||||
// and now we are about to emit `disconnected`.
|
||||
//
|
||||
// This will cause the PolkadotJs API think that the connection is
|
||||
// actually dead. In reality the smoldot chain is not dead, of course.
|
||||
// However, we have to cleanup all the existing callbacks because when
|
||||
// the smoldot chain stops syncing, then we will emit `connected` and
|
||||
// the PolkadotJs API will try to re-create the previous
|
||||
// subscriptions and requests. Although, now is not a good moment
|
||||
// to be sending unsubscription messages to the smoldot chain, we
|
||||
// should wait until is no longer syncing to send the unsubscription
|
||||
// messages from the stale subscriptions of the previous connection.
|
||||
//
|
||||
// That's why -before we perform the cleanup of `this.#subscriptions`-
|
||||
// we keep the necessary information that we will need later on to
|
||||
// kill the stale subscriptions.
|
||||
[...this.#subscriptions.values()].forEach((s) => {
|
||||
staleSubscriptions.push(s[1]);
|
||||
});
|
||||
cleanup();
|
||||
} else {
|
||||
killStaleSubscriptions();
|
||||
}
|
||||
|
||||
this.#eventemitter.emit(isReady ? 'connected' : 'disconnected');
|
||||
});
|
||||
|
||||
return {
|
||||
...chain,
|
||||
remove: () => {
|
||||
hc.stop();
|
||||
chain.remove();
|
||||
cleanup();
|
||||
},
|
||||
sendJsonRpc: hc.sendJsonRpc.bind(hc)
|
||||
};
|
||||
});
|
||||
|
||||
try {
|
||||
await this.#chain;
|
||||
} catch (e) {
|
||||
this.#chain = null;
|
||||
this.#eventemitter.emit('error', e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
async disconnect (): Promise<void> {
|
||||
if (!this.#chain) {
|
||||
return;
|
||||
}
|
||||
|
||||
const chain = await this.#chain;
|
||||
|
||||
this.#chain = null;
|
||||
this.#isChainReady = false;
|
||||
|
||||
try {
|
||||
chain.remove();
|
||||
} catch (_) {}
|
||||
|
||||
this.#eventemitter.emit('disconnected');
|
||||
}
|
||||
|
||||
public on (
|
||||
type: ProviderInterfaceEmitted,
|
||||
sub: ProviderInterfaceEmitCb
|
||||
): () => void {
|
||||
// It's possible. Although, quite unlikely, that by the time that polkadot
|
||||
// subscribes to the `connected` event, the Provider is already connected.
|
||||
// In that case, we must emit to let the consumer know that we are connected.
|
||||
if (type === 'connected' && this.isConnected) {
|
||||
sub();
|
||||
}
|
||||
|
||||
this.#eventemitter.on(type, sub);
|
||||
|
||||
return (): void => {
|
||||
this.#eventemitter.removeListener(type, sub);
|
||||
};
|
||||
}
|
||||
|
||||
public async send<T = any> (method: string, params: unknown[]): Promise<T> {
|
||||
assert(this.isConnected, 'Provider is not connected');
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const chain = await this.#chain!;
|
||||
const json = this.#coder.encodeJson(method, params);
|
||||
const id = this.#coder.getId();
|
||||
|
||||
const result = new Promise<T>((resolve, reject): void => {
|
||||
this.#requests.set(id, (response) => {
|
||||
(isError(response) ? reject : resolve)(response as unknown as T);
|
||||
});
|
||||
|
||||
try {
|
||||
chain.sendJsonRpc(json);
|
||||
} catch (e) {
|
||||
this.#chain = null;
|
||||
|
||||
try {
|
||||
chain.remove();
|
||||
} catch (_) {}
|
||||
|
||||
this.#eventemitter.emit('error', e);
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
return await result;
|
||||
} finally {
|
||||
// let's ensure that once the Promise is resolved/rejected, then we remove
|
||||
// remove its entry from the internal #requests
|
||||
this.#requests.delete(id);
|
||||
}
|
||||
}
|
||||
|
||||
public async subscribe (
|
||||
type: string,
|
||||
method: string,
|
||||
params: any[],
|
||||
callback: ProviderInterfaceCallback
|
||||
): Promise<number | string> {
|
||||
assert(
|
||||
subscriptionUnsubscriptionMethods.has(method),
|
||||
`Unsupported subscribe method: ${method}`
|
||||
);
|
||||
|
||||
const id = await this.send<number | string>(method, params);
|
||||
const subscriptionId = `${type}::${id}`;
|
||||
|
||||
const cb = (response: Error | string) => {
|
||||
if (response instanceof Error) {
|
||||
callback(response, undefined);
|
||||
} else {
|
||||
callback(null, response);
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const unsubscribeMethod = subscriptionUnsubscriptionMethods.get(method)!;
|
||||
|
||||
this.#subscriptions.set(subscriptionId, [cb, { id, unsubscribeMethod }]);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
public unsubscribe (
|
||||
type: string,
|
||||
method: string,
|
||||
id: number | string
|
||||
): Promise<boolean> {
|
||||
assert(
|
||||
this.isConnected,
|
||||
'Provider is not connected'
|
||||
);
|
||||
|
||||
const subscriptionId = `${type}::${id}`;
|
||||
|
||||
if (!this.#subscriptions.has(subscriptionId)) {
|
||||
return Promise.reject(
|
||||
new Error(`Unable to find active subscription=${subscriptionId}`)
|
||||
);
|
||||
}
|
||||
|
||||
this.#subscriptions.delete(subscriptionId);
|
||||
|
||||
return this.send(method, [id]);
|
||||
}
|
||||
}
|
||||
export type ScProviderClass = typeof ScProvider
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2022 @polkadot/rpc-provider authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from './ScProvider';
|
||||
@@ -17,6 +17,13 @@ export interface JsonRpcResponseBaseError {
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface RpcErrorInterface<Data> {
|
||||
code: number;
|
||||
data?: Data;
|
||||
message: string;
|
||||
stack: string;
|
||||
}
|
||||
|
||||
interface JsonRpcResponseSingle {
|
||||
error?: JsonRpcResponseBaseError;
|
||||
result?: unknown;
|
||||
@@ -44,6 +51,7 @@ export type ProviderInterfaceEmitCb = (value?: any) => any;
|
||||
export interface ProviderInterface {
|
||||
readonly hasSubscriptions: boolean;
|
||||
readonly isConnected: boolean;
|
||||
readonly stats?: ProviderStats;
|
||||
|
||||
clone (): ProviderInterface;
|
||||
connect (): Promise<void>;
|
||||
@@ -53,3 +61,18 @@ export interface ProviderInterface {
|
||||
subscribe (type: string, method: string, params: unknown[], cb: ProviderInterfaceCallback): Promise<number | string>;
|
||||
unsubscribe (type: string, method: string, id: number | string): Promise<boolean>;
|
||||
}
|
||||
|
||||
export interface ProviderStats {
|
||||
active: {
|
||||
requests: number;
|
||||
subscriptions: number;
|
||||
};
|
||||
total: {
|
||||
bytesRecv: number;
|
||||
bytesSent: number;
|
||||
cached: number;
|
||||
requests: number;
|
||||
subscriptions: number;
|
||||
timeout: number;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted } from '../types';
|
||||
import type { JsonRpcResponse, ProviderInterface, ProviderInterfaceCallback, ProviderInterfaceEmitCb, ProviderInterfaceEmitted, ProviderStats } from '../types';
|
||||
|
||||
import EventEmitter from 'eventemitter3';
|
||||
|
||||
@@ -25,6 +25,7 @@ interface WsStateAwaiting {
|
||||
callback: ProviderInterfaceCallback;
|
||||
method: string;
|
||||
params: unknown[];
|
||||
start: number;
|
||||
subscription?: SubscriptionHandler;
|
||||
}
|
||||
|
||||
@@ -39,7 +40,11 @@ const ALIASES: { [index: string]: string } = {
|
||||
chain_unsubscribeFinalisedHeads: 'chain_unsubscribeFinalizedHeads'
|
||||
};
|
||||
|
||||
const RETRY_DELAY = 2500;
|
||||
const RETRY_DELAY = 2_500;
|
||||
|
||||
const TIMEOUT_S = 30;
|
||||
const TIMEOUT_MS = TIMEOUT_S * 1000;
|
||||
const TIMEOUT_INTERVAL = 5_000;
|
||||
|
||||
const MEGABYTE = 1024 * 1024;
|
||||
|
||||
@@ -90,6 +95,8 @@ export class WsProvider implements ProviderInterface {
|
||||
|
||||
readonly #isReadyPromise: Promise<WsProvider>;
|
||||
|
||||
readonly #stats: ProviderStats;
|
||||
|
||||
readonly #waitingForId: Record<string, JsonRpcResponse> = {};
|
||||
|
||||
#autoConnectMs: number;
|
||||
@@ -100,6 +107,8 @@ export class WsProvider implements ProviderInterface {
|
||||
|
||||
#subscriptions: Record<string, WsStateSubscription> = {};
|
||||
|
||||
#timeoutId?: NodeJS.Timeout | null = null;
|
||||
|
||||
#websocket: WebSocket | null;
|
||||
|
||||
/**
|
||||
@@ -124,6 +133,10 @@ export class WsProvider implements ProviderInterface {
|
||||
this.#endpoints = endpoints;
|
||||
this.#headers = headers;
|
||||
this.#websocket = null;
|
||||
this.#stats = {
|
||||
active: { requests: 0, subscriptions: 0 },
|
||||
total: { bytesRecv: 0, bytesSent: 0, cached: 0, requests: 0, subscriptions: 0, timeout: 0 }
|
||||
};
|
||||
|
||||
if (autoConnectMs > 0) {
|
||||
this.connectWithRetry().catch((): void => {
|
||||
@@ -195,6 +208,9 @@ export class WsProvider implements ProviderInterface {
|
||||
this.#websocket.onerror = this.#onSocketError;
|
||||
this.#websocket.onmessage = this.#onSocketMessage;
|
||||
this.#websocket.onopen = this.#onSocketOpen;
|
||||
|
||||
// timeout any handlers that have not had a response
|
||||
this.#timeoutId = setInterval(() => this.#timeout(), TIMEOUT_INTERVAL);
|
||||
} catch (error) {
|
||||
l.error(error);
|
||||
|
||||
@@ -243,6 +259,19 @@ export class WsProvider implements ProviderInterface {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Returns the connection stats
|
||||
*/
|
||||
public get stats (): ProviderStats {
|
||||
return {
|
||||
active: {
|
||||
requests: Object.keys(this.#handlers).length,
|
||||
subscriptions: Object.keys(this.#subscriptions).length
|
||||
},
|
||||
total: this.#stats.total
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Listens on events after having subscribed using the [[subscribe]] function.
|
||||
* @param {ProviderInterfaceEmitted} type Event
|
||||
@@ -264,6 +293,8 @@ 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.#stats.total.requests++;
|
||||
|
||||
const body = this.#coder.encodeJson(method, params);
|
||||
let resultPromise: Promise<T> | null = isCacheable
|
||||
? this.#callCache.get(body) as Promise<T>
|
||||
@@ -275,6 +306,8 @@ export class WsProvider implements ProviderInterface {
|
||||
if (isCacheable) {
|
||||
this.#callCache.set(body, resultPromise);
|
||||
}
|
||||
} else {
|
||||
this.#stats.total.cached++;
|
||||
}
|
||||
|
||||
return resultPromise;
|
||||
@@ -299,9 +332,10 @@ export class WsProvider implements ProviderInterface {
|
||||
callback,
|
||||
method,
|
||||
params,
|
||||
start: Date.now(),
|
||||
subscription
|
||||
};
|
||||
|
||||
this.#stats.total.bytesSent += json.length;
|
||||
this.#websocket.send(json);
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
@@ -328,6 +362,8 @@ export class WsProvider implements ProviderInterface {
|
||||
* ```
|
||||
*/
|
||||
public subscribe (type: string, method: string, params: unknown[], callback: ProviderInterfaceCallback): Promise<number | string> {
|
||||
this.#stats.total.subscriptions++;
|
||||
|
||||
// subscriptions are not cached, LRU applies to .at(<blockHash>) only
|
||||
return this.send<number | string>(method, params, false, { callback, type });
|
||||
}
|
||||
@@ -380,6 +416,11 @@ export class WsProvider implements ProviderInterface {
|
||||
this.#websocket = null;
|
||||
}
|
||||
|
||||
if (this.#timeoutId) {
|
||||
clearInterval(this.#timeoutId);
|
||||
this.#timeoutId = null;
|
||||
}
|
||||
|
||||
this.#emit('disconnected');
|
||||
|
||||
// reject all hanging requests
|
||||
@@ -410,6 +451,8 @@ export class WsProvider implements ProviderInterface {
|
||||
#onSocketMessage = (message: MessageEvent<string>): void => {
|
||||
l.debug(() => ['received', message.data]);
|
||||
|
||||
this.#stats.total.bytesRecv += message.data.length;
|
||||
|
||||
const response = JSON.parse(message.data) as JsonRpcResponse;
|
||||
|
||||
return isUndefined(response.method)
|
||||
@@ -515,4 +558,24 @@ export class WsProvider implements ProviderInterface {
|
||||
}
|
||||
})).catch(l.error);
|
||||
};
|
||||
|
||||
#timeout = (): void => {
|
||||
const now = Date.now();
|
||||
const ids = Object.keys(this.#handlers);
|
||||
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
const handler = this.#handlers[ids[i]];
|
||||
|
||||
if ((now - handler.start) > TIMEOUT_MS) {
|
||||
try {
|
||||
handler.callback(new Error(`No response received from RPC endpoint in ${TIMEOUT_S}s`), undefined);
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
|
||||
this.#stats.total.timeout++;
|
||||
delete this.#handlers[ids[i]];
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
@@ -30,26 +30,26 @@
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.17.5",
|
||||
"@babel/register": "^7.17.0",
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/api": "7.12.1",
|
||||
"@polkadot/api-augment": "7.12.1",
|
||||
"@polkadot/rpc-augment": "7.12.1",
|
||||
"@polkadot/rpc-provider": "7.12.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-augment": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/types-create": "7.12.1",
|
||||
"@polkadot/types-support": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1",
|
||||
"@polkadot/x-ws": "^8.5.1",
|
||||
"@babel/core": "^7.17.8",
|
||||
"@babel/register": "^7.17.7",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/api": "7.14.2",
|
||||
"@polkadot/api-augment": "7.14.2",
|
||||
"@polkadot/rpc-augment": "7.14.2",
|
||||
"@polkadot/rpc-provider": "7.14.2",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-augment": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/types-create": "7.14.2",
|
||||
"@polkadot/types-support": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1",
|
||||
"@polkadot/x-ws": "^8.7.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^17.3.1"
|
||||
"yargs": "^17.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/websocket": "^1.0.5",
|
||||
"@types/yargs": "^17.0.9"
|
||||
"@types/yargs": "^17.0.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,6 +77,8 @@ function tsEnum (registry: Registry, definitions: Record<string, ModuleTypes>, {
|
||||
case TypeDefInfo.Struct:
|
||||
case TypeDefInfo.Tuple:
|
||||
case TypeDefInfo.Vec:
|
||||
case TypeDefInfo.BTreeMap:
|
||||
case TypeDefInfo.BTreeSet:
|
||||
case TypeDefInfo.Option:
|
||||
case TypeDefInfo.VecFixed:
|
||||
case TypeDefInfo.WrapperKeepOpaque:
|
||||
@@ -125,6 +127,8 @@ function tsResultGetter (registry: Registry, definitions: Record<string, ModuleT
|
||||
case TypeDefInfo.Si:
|
||||
case TypeDefInfo.Tuple:
|
||||
case TypeDefInfo.Vec:
|
||||
case TypeDefInfo.BTreeMap:
|
||||
case TypeDefInfo.BTreeSet:
|
||||
case TypeDefInfo.WrapperKeepOpaque:
|
||||
case TypeDefInfo.WrapperOpaque:
|
||||
return `${isGetter}${asGetter}`;
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1"
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,18 +11,18 @@ export default {
|
||||
_enum: ['Any', 'NonTransfer', 'Governance', 'Staking', 'IdentityJudgement', 'CancelProxy', 'Auction', 'Society']
|
||||
},
|
||||
/**
|
||||
* Lookup251: kusama_runtime::SessionKeys
|
||||
* Lookup252: kusama_runtime::SessionKeys
|
||||
**/
|
||||
KusamaRuntimeSessionKeys: {
|
||||
grandpa: 'SpFinalityGrandpaAppPublic',
|
||||
babe: 'SpConsensusBabeAppPublic',
|
||||
imOnline: 'PalletImOnlineSr25519AppSr25519Public',
|
||||
paraValidator: 'PolkadotPrimitivesV0ValidatorAppPublic',
|
||||
paraAssignment: 'PolkadotPrimitivesV1AssignmentAppPublic',
|
||||
paraValidator: 'PolkadotPrimitivesV2ValidatorAppPublic',
|
||||
paraAssignment: 'PolkadotPrimitivesV2AssignmentAppPublic',
|
||||
authorityDiscovery: 'SpAuthorityDiscoveryAppPublic'
|
||||
},
|
||||
/**
|
||||
* Lookup325: kusama_runtime::OriginCaller
|
||||
* Lookup326: kusama_runtime::OriginCaller
|
||||
**/
|
||||
KusamaRuntimeOriginCaller: {
|
||||
_enum: {
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup390: kusama_runtime::NposCompactSolution24
|
||||
* Lookup392: kusama_runtime::NposCompactSolution24
|
||||
**/
|
||||
KusamaRuntimeNposCompactSolution24: {
|
||||
votes1: 'Vec<(Compact<u32>,Compact<u16>)>',
|
||||
@@ -158,7 +158,7 @@ export default {
|
||||
votes24: 'Vec<(Compact<u32>,[(Compact<u16>,Compact<PerU16>);23],Compact<u16>)>'
|
||||
},
|
||||
/**
|
||||
* Lookup742: kusama_runtime::Runtime
|
||||
* Lookup747: kusama_runtime::Runtime
|
||||
**/
|
||||
KusamaRuntimeRuntime: 'Null'
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,17 +19,17 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Any' | 'NonTransfer' | 'Governance' | 'Staking' | 'IdentityJudgement' | 'CancelProxy' | 'Auction' | 'Society';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeSessionKeys (251) */
|
||||
/** @name KusamaRuntimeSessionKeys (252) */
|
||||
export interface KusamaRuntimeSessionKeys extends Struct {
|
||||
readonly grandpa: SpFinalityGrandpaAppPublic;
|
||||
readonly babe: SpConsensusBabeAppPublic;
|
||||
readonly imOnline: PalletImOnlineSr25519AppSr25519Public;
|
||||
readonly paraValidator: PolkadotPrimitivesV0ValidatorAppPublic;
|
||||
readonly paraAssignment: PolkadotPrimitivesV1AssignmentAppPublic;
|
||||
readonly paraValidator: PolkadotPrimitivesV2ValidatorAppPublic;
|
||||
readonly paraAssignment: PolkadotPrimitivesV2AssignmentAppPublic;
|
||||
readonly authorityDiscovery: SpAuthorityDiscoveryAppPublic;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeOriginCaller (325) */
|
||||
/** @name KusamaRuntimeOriginCaller (326) */
|
||||
export interface KusamaRuntimeOriginCaller extends Enum {
|
||||
readonly isSystem: boolean;
|
||||
readonly asSystem: FrameSupportDispatchRawOrigin;
|
||||
@@ -45,7 +45,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'System' | 'Void' | 'Council' | 'TechnicalCommittee' | 'ParachainsOrigin' | 'XcmPallet';
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (390) */
|
||||
/** @name KusamaRuntimeNposCompactSolution24 (392) */
|
||||
export interface KusamaRuntimeNposCompactSolution24 extends Struct {
|
||||
readonly votes1: Vec<ITuple<[Compact<u32>, Compact<u16>]>>;
|
||||
readonly votes2: Vec<ITuple<[Compact<u32>, ITuple<[Compact<u16>, Compact<PerU16>]>, Compact<u16>]>>;
|
||||
@@ -73,7 +73,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly votes24: Vec<ITuple<[Compact<u32>, Vec<ITuple<[Compact<u16>, Compact<PerU16>]>>, Compact<u16>]>>;
|
||||
}
|
||||
|
||||
/** @name KusamaRuntimeRuntime (742) */
|
||||
/** @name KusamaRuntimeRuntime (747) */
|
||||
export type KusamaRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -22,6 +22,7 @@ import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, Contract
|
||||
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
|
||||
import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
|
||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||
import type { BlockStats } from '@polkadot/types/interfaces/dev';
|
||||
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
|
||||
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
|
||||
import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
|
||||
@@ -50,7 +51,7 @@ import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, Sch
|
||||
import type { BeefyKey, FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys10, SessionKeys10B, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys6B, SessionKeys7, SessionKeys7B, SessionKeys8, SessionKeys8B, SessionKeys9, SessionKeys9B, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
|
||||
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactAssignmentsTo265, CompactAssignmentsWith16, CompactAssignmentsWith24, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, RawSolutionTo265, RawSolutionWith16, RawSolutionWith24, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SignedSubmission, SignedSubmissionOf, SignedSubmissionTo276, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, SubmissionIndicesOf, Supports, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
|
||||
import type { ApiId, BlockTrace, BlockTraceEvent, BlockTraceEventData, BlockTraceSpan, KeyValueOption, MigrationStatusResult, ReadProof, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial, SpecVersion, StorageChangeSet, TraceBlockResponse, TraceError } from '@polkadot/types/interfaces/state';
|
||||
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
|
||||
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithRefCountU8, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, ArithmeticError, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TokenError, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
|
||||
import type { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
|
||||
@@ -152,6 +153,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
BlockNumber: BlockNumber;
|
||||
BlockNumberFor: BlockNumberFor;
|
||||
BlockNumberOf: BlockNumberOf;
|
||||
BlockStats: BlockStats;
|
||||
BlockTrace: BlockTrace;
|
||||
BlockTraceEvent: BlockTraceEvent;
|
||||
BlockTraceEventData: BlockTraceEventData;
|
||||
@@ -591,6 +593,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
MetadataV13: MetadataV13;
|
||||
MetadataV14: MetadataV14;
|
||||
MetadataV9: MetadataV9;
|
||||
MigrationStatusResult: MigrationStatusResult;
|
||||
MmrLeafProof: MmrLeafProof;
|
||||
MmrRootHash: MmrRootHash;
|
||||
ModuleConstantMetadataV10: ModuleConstantMetadataV10;
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -20,16 +20,16 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/util": "^8.5.1"
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/util": "^8.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-augment": "7.12.1",
|
||||
"@polkadot/types-support": "7.12.1",
|
||||
"@polkadot/util-crypto": "^8.5.1"
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-augment": "7.14.2",
|
||||
"@polkadot/types-support": "7.14.2",
|
||||
"@polkadot/util-crypto": "^8.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,24 +11,41 @@ const TESTS = ['0x00', '0x0817', '0x0837', '0x087b', '0x0c33'];
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
describe('BitVec', (): void => {
|
||||
TESTS.forEach((test): void => {
|
||||
describe(test, (): void => {
|
||||
const input = hexToU8a(test);
|
||||
describe('decoding known', (): void => {
|
||||
TESTS.forEach((test): void => {
|
||||
describe(test, (): void => {
|
||||
const input = hexToU8a(test);
|
||||
const bitvec = new BitVec(registry, input);
|
||||
|
||||
it('has the right encodedLength', (): void => {
|
||||
expect(
|
||||
new BitVec(registry, input).encodedLength
|
||||
).toEqual((test.length - 2) / 2);
|
||||
});
|
||||
it('has the right encodedLength', (): void => {
|
||||
expect(
|
||||
bitvec.encodedLength
|
||||
).toEqual((test.length - 2) / 2);
|
||||
});
|
||||
|
||||
it('re-encodes to the same input value', (): void => {
|
||||
expect(
|
||||
new BitVec(registry, input).toU8a()
|
||||
).toEqual(input);
|
||||
it('re-encodes to the same input value', (): void => {
|
||||
expect(
|
||||
bitvec.toU8a()
|
||||
).toEqual(input);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('toHuman() ordering', (): void => {
|
||||
it('defaults to Lsb', (): void => {
|
||||
expect(
|
||||
new BitVec(registry, '0x0100010500').toHuman()
|
||||
).toEqual('0b10000000_00000000_10000000_10100000_00000000');
|
||||
});
|
||||
|
||||
it('can output to Msb', (): void => {
|
||||
expect(
|
||||
new BitVec(registry, '0x0100010500', true).toHuman()
|
||||
).toEqual('0b00000001_00000000_00000001_00000101_00000000');
|
||||
});
|
||||
});
|
||||
|
||||
it('has a sane inspect', (): void => {
|
||||
expect(
|
||||
new BitVec(registry, '0x0837').inspect()
|
||||
|
||||
@@ -41,13 +41,18 @@ function decodeBitVec (value?: AnyU8a): [number, Uint8Array] {
|
||||
*/
|
||||
export class BitVec extends Raw {
|
||||
readonly #decodedLength: number;
|
||||
readonly #isMsb?: boolean;
|
||||
|
||||
constructor (registry: Registry, value?: AnyU8a) {
|
||||
// In lieu of having the Msb/Lsb identifiers passed through, we default to assuming
|
||||
// we are dealing with Lsb, which is the default (as of writing) BitVec format used
|
||||
// in the Polkadot code (this only affects the toHuman displays)
|
||||
constructor (registry: Registry, value?: AnyU8a, isMsb = false) {
|
||||
const [decodedLength, u8a] = decodeBitVec(value);
|
||||
|
||||
super(registry, u8a);
|
||||
|
||||
this.#decodedLength = decodedLength;
|
||||
this.#isMsb = isMsb;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +72,12 @@ export class BitVec extends Raw {
|
||||
}
|
||||
|
||||
public override toHuman (): string {
|
||||
return `0b${[...this.toU8a(true)].map((d) => `00000000${d.toString(2)}`.slice(-8)).join('_')}`;
|
||||
return `0b${
|
||||
[...this.toU8a(true)]
|
||||
.map((d) => `00000000${d.toString(2)}`.slice(-8))
|
||||
.map((s) => this.#isMsb ? s : s.split('').reverse().join(''))
|
||||
.join('_')
|
||||
}`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,7 +23,9 @@ describe('Text', (): void => {
|
||||
testDecode('Raw', new Raw(registry, Uint8Array.from([102, 111, 111])), 'foo', 'toHuman'); // no length
|
||||
testDecode('Bytes', new Bytes(registry, Uint8Array.from([12, 102, 111, 111])), 'foo'); // length-aware encoding
|
||||
testDecode('Bytes', new Bytes(registry, Uint8Array.from([12, 102, 111, 111])), 'foo', 'toHuman'); // length-aware encoding
|
||||
testDecode('object with `toString()`', { toString (): string { return 'foo'; } }, 'foo');
|
||||
testDecode('object with `toString()`', { toString (): string {
|
||||
return 'foo';
|
||||
} }, 'foo');
|
||||
testDecode('hex input value', new Text(registry, '0x12345678'), '0x12345678', 'toHex');
|
||||
testDecode('null', null, '');
|
||||
});
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1"
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "7.12.1"
|
||||
"@polkadot/types": "7.14.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/networks": "^8.5.1",
|
||||
"@polkadot/types": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/types-create": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1"
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/networks": "^8.7.1",
|
||||
"@polkadot/types": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/types-create": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/util": "^8.5.1"
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/util": "^8.7.1"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
+10
-10
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.12.1",
|
||||
"version": "7.14.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.17.2",
|
||||
"@polkadot/keyring": "^8.5.1",
|
||||
"@polkadot/types-augment": "7.12.1",
|
||||
"@polkadot/types-codec": "7.12.1",
|
||||
"@polkadot/types-create": "7.12.1",
|
||||
"@polkadot/util": "^8.5.1",
|
||||
"@polkadot/util-crypto": "^8.5.1",
|
||||
"@babel/runtime": "^7.17.8",
|
||||
"@polkadot/keyring": "^8.7.1",
|
||||
"@polkadot/types-augment": "7.14.2",
|
||||
"@polkadot/types-codec": "7.14.2",
|
||||
"@polkadot/types-create": "7.14.2",
|
||||
"@polkadot/util": "^8.7.1",
|
||||
"@polkadot/util-crypto": "^8.7.1",
|
||||
"rxjs": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^8.5.1",
|
||||
"@polkadot/types-support": "7.12.1"
|
||||
"@polkadot/keyring": "^8.7.1",
|
||||
"@polkadot/types-support": "7.14.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ export { default as collective } from './collective/definitions';
|
||||
export { default as consensus } from './consensus/definitions';
|
||||
export { default as contracts } from './contracts/definitions';
|
||||
export { default as democracy } from './democracy/definitions';
|
||||
export { default as dev } from './dev/definitions';
|
||||
export { default as elections } from './elections/definitions';
|
||||
export { default as engine } from './engine/definitions';
|
||||
export { default as evm } from './evm/definitions';
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
export default {
|
||||
rpc: {
|
||||
getBlockStats: {
|
||||
description: 'Reexecute the specified `block_hash` and gather statistics while doing so',
|
||||
params: [
|
||||
{
|
||||
name: 'at',
|
||||
type: 'Hash',
|
||||
isHistoric: true
|
||||
}
|
||||
],
|
||||
type: 'Option<BlockStats>'
|
||||
}
|
||||
},
|
||||
types: {
|
||||
BlockStats: {
|
||||
witnessLen: 'u64',
|
||||
witnessCompactLen: 'u64',
|
||||
blockLen: 'u64',
|
||||
blockNumExtrinsics: 'u64'
|
||||
}
|
||||
}
|
||||
} as Definitions;
|
||||
@@ -0,0 +1,4 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
export * from './types';
|
||||
@@ -0,0 +1,14 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Struct, u64 } from '@polkadot/types-codec';
|
||||
|
||||
/** @name BlockStats */
|
||||
export interface BlockStats extends Struct {
|
||||
readonly witnessLen: u64;
|
||||
readonly witnessCompactLen: u64;
|
||||
readonly blockLen: u64;
|
||||
readonly blockNumExtrinsics: u64;
|
||||
}
|
||||
|
||||
export type PHANTOM_DEV = 'dev';
|
||||
@@ -394,6 +394,18 @@ export default {
|
||||
}
|
||||
],
|
||||
type: 'TraceBlockResponse'
|
||||
},
|
||||
trieMigrationStatus: {
|
||||
description: 'Check current migration state',
|
||||
params: [
|
||||
{
|
||||
name: 'at',
|
||||
type: 'BlockHash',
|
||||
isHistoric: true,
|
||||
isOptional: true
|
||||
}
|
||||
],
|
||||
type: 'MigrationStatusResult'
|
||||
}
|
||||
},
|
||||
types: {
|
||||
@@ -422,6 +434,10 @@ export default {
|
||||
wasm: 'bool'
|
||||
},
|
||||
KeyValueOption: '(StorageKey, Option<StorageData>)',
|
||||
MigrationStatusResult: {
|
||||
topRemainingToMigrate: 'u64',
|
||||
childRemainingToMigrate: 'u64'
|
||||
},
|
||||
ReadProof: {
|
||||
at: 'Hash',
|
||||
proof: 'Vec<Bytes>'
|
||||
|
||||
@@ -43,6 +43,12 @@ export interface BlockTraceSpan extends Struct {
|
||||
/** @name KeyValueOption */
|
||||
export interface KeyValueOption extends ITuple<[StorageKey, Option<StorageData>]> {}
|
||||
|
||||
/** @name MigrationStatusResult */
|
||||
export interface MigrationStatusResult extends Struct {
|
||||
readonly topRemainingToMigrate: u64;
|
||||
readonly childRemainingToMigrate: u64;
|
||||
}
|
||||
|
||||
/** @name ReadProof */
|
||||
export interface ReadProof extends Struct {
|
||||
readonly at: Hash;
|
||||
|
||||
@@ -20,6 +20,7 @@ export * from './contractsAbi/types';
|
||||
export * from './crowdloan/types';
|
||||
export * from './cumulus/types';
|
||||
export * from './democracy/types';
|
||||
export * from './dev/types';
|
||||
export * from './elections/types';
|
||||
export * from './engine/types';
|
||||
export * from './eth/types';
|
||||
|
||||
@@ -46,6 +46,11 @@ const PATHS_SET = splitNamespace([
|
||||
'pallet_identity::types::BitFlags'
|
||||
]);
|
||||
|
||||
// These are the set namespaces for BitVec definitions (the last 2 appear in types as well)
|
||||
const BITVEC_NS_LSB = ['bitvec::order::Lsb0', 'BitOrderLsb0'];
|
||||
const BITVEC_NS_MSB = ['bitvec::order::Msb0', 'BitOrderMsb0'];
|
||||
const BITVEC_NS = [...BITVEC_NS_LSB, ...BITVEC_NS_MSB];
|
||||
|
||||
// These we never use these as top-level names, they are wrappers
|
||||
const WRAPPERS = ['BoundedBTreeMap', 'BoundedVec', 'Box', 'BTreeMap', 'Cow', 'Result', 'Option', 'WeakBoundedVec', 'WrapperKeepOpaque', 'WrapperOpaque'];
|
||||
|
||||
@@ -518,14 +523,14 @@ export class PortableRegistry extends Struct implements ILookup {
|
||||
// the order. With that in-mind, we apply a detection for LSb0/Msb and set accordingly
|
||||
const a = this.#createSiDef(bitOrderType);
|
||||
const b = this.#createSiDef(bitStoreType);
|
||||
const [bitOrder, bitStore] = ['bitvec::order::Lsb0', 'bitvec::order::Msb0'].includes(a.namespace || '')
|
||||
const [bitOrder, bitStore] = BITVEC_NS.includes(a.namespace || '')
|
||||
? [a, b]
|
||||
: [b, a];
|
||||
|
||||
// NOTE: Currently the BitVec type is one-way only, i.e. we only use it to decode, not
|
||||
// re-encode stuff. As such we ignore the msb/lsb identifier given by bitOrderType, or rather
|
||||
// we don't pass it though at all
|
||||
assert(['bitvec::order::Lsb0', 'bitvec::order::Msb0'].includes(bitOrder.namespace || ''), () => `Unexpected bitOrder found as ${bitOrder.namespace || '<unknown>'}`);
|
||||
// we don't pass it though at all, however we only currently cater for the default Lsb
|
||||
assert(BITVEC_NS_LSB.includes(bitOrder.namespace || ''), () => `Unexpected bitOrder found as ${bitOrder.namespace || '<unknown>'}`);
|
||||
assert(bitStore.info === TypeDefInfo.Plain && bitStore.type === 'u8', () => `Only u8 bitStore is currently supported, found ${bitStore.type}`);
|
||||
|
||||
return {
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '7.12.1' };
|
||||
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '7.14.2' };
|
||||
|
||||
Reference in New Issue
Block a user