Compare commits

...
40 Commits
Author SHA1 Message Date
github-actions[bot] ac07123e54 [CI Skip] release/stable 10.9.1
skip-checks: true
2023-06-12 04:41:46 +00:00
Jaco a9865bb60a 10.9.1 (#5672)
* 10.9.1

* Bump static metadata
2023-06-12 07:31:48 +03:00
github-actions[bot] 62741a10dd [CI Skip] bump/beta 10.8.2-0-x
skip-checks: true
2023-06-11 07:08:56 +00:00
Jaco c277b3d865 Adjust object index typings (#5671)
* Adjust object index typings

* CHANGELOG

* Remove dot-notation overrides

* Align overrides

* Ordering

* Revert lint formatting changes

* Bump common
2023-06-11 09:58:20 +03:00
github-actions[bot] edde226740 [CI Skip] release/stable 10.8.1
skip-checks: true
2023-06-05 05:01:50 +00:00
Jaco 88a9316dbd 10.8.1 (#5669) 2023-06-05 07:52:47 +03:00
github-actions[bot] 23b7ff1794 [CI Skip] bump/beta 10.7.4-5-x
skip-checks: true
2023-06-04 15:10:27 +00:00
Jaco f1fda12353 Bump metadata (#5668) 2023-06-04 18:01:24 +03:00
github-actions[bot] e2e0e38d35 [CI Skip] bump/beta 10.7.4-4-x
skip-checks: true
2023-06-04 14:54:03 +00:00
Jaco 74279380e3 Bump common (#5667) 2023-06-04 17:42:28 +03:00
github-actions[bot] e0c5f7cab0 [CI Skip] bump/beta 10.7.4-3-x
skip-checks: true
2023-06-02 10:34:14 +00:00
Jaco 7a088f9ce7 Bump deps (w/ TS 5.1) (#5666) 2023-06-02 13:22:58 +03:00
github-actions[bot] d9ea5ee921 [CI Skip] bump/beta 10.7.4-2-x
skip-checks: true
2023-06-01 05:35:21 +00:00
Jaco 4b8792fe7c Remove (some) eslint overrides (#5663) 2023-06-01 08:26:29 +03:00
github-actions[bot] 5cc25fb40c [CI Skip] bump/beta 10.7.4-1-x
skip-checks: true
2023-05-30 05:48:23 +00:00
Jaco 2494801d50 Rework contract ABI environment option (#5661) 2023-05-30 08:39:29 +03:00
github-actions[bot] dbcb39734a [CI Skip] bump/beta 10.7.4-0-x
skip-checks: true
2023-05-29 17:30:12 +00:00
Andreea Eftene 0be50b285b Add suport for latest ink! metadata (#5650)
* add v5

* add environment

* tov5

* use correct version

* decode env types

* fix tests

* remove unnecesary checks

* update fixtures

* add maxEventTopics

* get type defs for environment

* fix conversion to v4
2023-05-29 20:19:55 +03:00
github-actions[bot] 2f07e1c45f [CI Skip] release/stable 10.7.3
skip-checks: true
2023-05-28 08:05:22 +00:00
Jaco 39eff81207 10.7.3 (#5660) 2023-05-28 10:56:30 +03:00
github-actions[bot] 19f3c5b16b [CI Skip] bump/beta 10.7.3-1-x
skip-checks: true
2023-05-26 05:13:37 +00:00
Jaco cdd74ea084 .paymentInfo never mutates the existing signature (#5659) 2023-05-26 08:02:18 +03:00
github-actions[bot] 54c96ed975 [CI Skip] bump/beta 10.7.3-0-x
skip-checks: true
2023-05-25 07:41:17 +00:00
Jaco 4e507246e3 jg-bump-deps (#5656) 2023-05-25 10:30:06 +03:00
github-actions[bot] d0e0008399 [CI Skip] release/stable 10.7.2
skip-checks: true
2023-05-21 10:24:18 +00:00
Jaco a6eeba83c1 10.7.2 (#5652) 2023-05-21 13:13:34 +03:00
github-actions[bot] 541eceae82 [CI Skip] bump/beta 10.7.2-3-x
skip-checks: true
2023-05-21 09:48:40 +00:00
Jaco 3d0a1701fa Bump dev & adjust duplicated exports (#5651) 2023-05-21 12:40:07 +03:00
github-actions[bot] 0e46592f4d [CI Skip] bump/beta 10.7.2-2-x
skip-checks: true
2023-05-20 07:55:15 +00:00
polymath-eric a561253de9 Allow unset external signer (#5649) 2023-05-20 10:46:06 +03:00
github-actions[bot] 0c6a4754f0 [CI Skip] bump/beta 10.7.2-1-x
skip-checks: true
2023-05-18 09:08:21 +00:00
Jaco 60dd4e9699 Adjust tsconfig usage (w/ latest dev) (#5648) 2023-05-18 11:59:11 +03:00
github-actions[bot] f10f79c0ac [CI Skip] bump/beta 10.7.2-0-x
skip-checks: true
2023-05-18 05:51:41 +00:00
Jaco 8394c71cfa Bump dev deps (#5647)
* Bump dev deps

* Adjust

* Actual bump, fix tsconfig for typegen
2023-05-18 08:42:41 +03:00
github-actions[bot] dd0bd21d88 [CI Skip] release/stable 10.7.1
skip-checks: true
2023-05-13 09:56:51 +00:00
Jaco 58875b8125 10.7.1 (#5645) 2023-05-13 12:44:17 +03:00
github-actions[bot] 7e0586794a [CI Skip] bump/beta 10.6.2-1-x
skip-checks: true
2023-05-13 08:52:44 +00:00
Jaco d800886ee0 Bump util (#5644) 2023-05-13 11:43:50 +03:00
github-actions[bot] 0bdfc37096 [CI Skip] bump/beta 10.6.2-0-x
skip-checks: true
2023-05-13 08:05:11 +00:00
Jaco db3b3f606b Bump static metadata (#5643) 2023-05-13 10:53:47 +03:00
214 changed files with 20018 additions and 31217 deletions
-25
View File
@@ -1,25 +0,0 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
const base = require('@polkadot/dev/config/eslint.cjs');
module.exports = {
...base,
ignorePatterns: [
...base.ignorePatterns,
'/scripts'
],
parserOptions: {
...base.parserOptions,
project: [
'./tsconfig.eslint.json'
]
},
rules: {
...base.rules,
// add override for any (a metric ton of them, initial conversion)
'@typescript-eslint/no-explicit-any': 'off',
// this seems very broken atm, false positives
'@typescript-eslint/unbound-method': 'off'
}
};
+1 -1
View File
@@ -21,5 +21,5 @@ jobs:
- name: ${{ matrix.step }} - name: ${{ matrix.step }}
if: always() if: always()
run: | run: |
yarn install --immutable | grep -v 'YN0013' yarn install --immutable
yarn ${{ matrix.step }} yarn ${{ matrix.step }}
+1 -1
View File
@@ -27,5 +27,5 @@ jobs:
node-version: 'lts/*' node-version: 'lts/*'
- name: ${{ matrix.step }} - name: ${{ matrix.step }}
run: | run: |
yarn install --immutable | grep -v 'YN0013' yarn install --immutable
yarn ${{ matrix.step }} yarn ${{ matrix.step }}
+5
View File
@@ -2,6 +2,11 @@ enableImmutableInstalls: false
enableProgressBars: false enableProgressBars: false
logFilters:
# Discard any "cannot be found in cache" messages
- code: YN0013
level: discard
nodeLinker: node-modules nodeLinker: node-modules
plugins: plugins:
+46
View File
@@ -1,5 +1,51 @@
# CHANGELOG # CHANGELOG
## 10.9.1 Jun 12, 2023
Changes:
- Adjust object index access for stricter tsconfig settings
- Update to latest Polkadot, Kusama & Substrate metadata
## 10.8.1 Jun 5, 2023
Contributed:
- Added support for extended Contracts ABI V4 definitions (Thanks to https://github.com/statictype)
Changes:
- Update to latest Polkadot, Kusama & Substrate metadata
- Cleanup (some) linting overrides
## 10.7.3 May 28, 2023
Changes:
- Ensure that `.paymentInfo` never mutates the underlying/existing signature
## 10.7.2 May 21, 2023
Contributed:
- Allow `api.setSigner(...)` to clear existing (Thanks to https://github.com/polymath-eric)
Changes:
- Adjust `@polkadot/types-create` exports with no duplicates
## 10.7.1 May 13, 2023
Changes:
- Update to latest Polkadot, Kusama & Substrate metadata
- Add `module` to `package.json` export map (ESM-only)
## 10.6.1 May 7, 2023 ## 10.6.1 May 7, 2023
Contributed: Contributed:
+3 -2
View File
@@ -1,4 +1,4 @@
3457 Jaco 10.6.1 (#5635) 3475 Jaco 10.9.1 (#5672)
83 Amaury Martiny StatementKind: Regular and Saft (#2303) 83 Amaury Martiny StatementKind: Regular and Saft (#2303)
37 Keith Ingram Update contract types and rpc (#4541) 37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709) 35 Stefanie Doll Updated child storage parameters (#1709)
@@ -8,13 +8,13 @@
14 Nikos Kontakis Bump substrate connect to 0.7.16 (#5307) 14 Nikos Kontakis Bump substrate connect to 0.7.16 (#5307)
11 Ian He HttpProvider support clone() (#3949) 11 Ian He HttpProvider support clone() (#3949)
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954) 10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
5 Andreea Eftene Add suport for latest ink! metadata (#5650)
5 Chevdor Fix metadata package link (#3458) 5 Chevdor Fix metadata package link (#3458)
5 Jake Naviasky Fixing approvalFlagsToBools. (#1250) 5 Jake Naviasky Fixing approvalFlagsToBools. (#1250)
5 Julien Eluard General WsProvider extensibility improvements (#5467) 5 Julien Eluard General WsProvider extensibility improvements (#5467)
4 Alex D Use derive customAccount and customLocks for balance overrides (#3248) 4 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
4 Alex Wang fix issue that creates duplicate providers (#983) 4 Alex Wang fix issue that creates duplicate providers (#983)
4 Alexander Popiak Add asset id in signing (#4009) 4 Alexander Popiak Add asset id in signing (#4009)
4 Andreea Eftene add type overrides (#5506)
4 Joshy Orndorff spelling; efect -> effect (#2295) 4 Joshy Orndorff spelling; efect -> effect (#2295)
4 Nantian fix bigint type (#3869) 4 Nantian fix bigint type (#3869)
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574) 4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
@@ -98,6 +98,7 @@
1 Paul M Fox Basic BTreeMaps codec support (#1474) 1 Paul M Fox Basic BTreeMaps codec support (#1474)
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424) 1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
1 Pierre Krieger Update substrate/connect to 0.7.6 (#4940) 1 Pierre Krieger Update substrate/connect to 0.7.6 (#4940)
1 polymath-eric Allow unset external signer (#5649)
1 Qinxuan Chen Add fp_account::AccountId20 mapping (#5551) 1 Qinxuan Chen Add fp_account::AccountId20 mapping (#5551)
1 qiuhao update DeriveCustom type (#2581) 1 qiuhao update DeriveCustom type (#2581)
1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505) 1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
+23
View File
@@ -0,0 +1,23 @@
// Copyright 2017-2023 @polkadot/dev authors & contributors
// SPDX-License-Identifier: Apache-2.0
import baseConfig from '@polkadot/dev/config/eslint';
export default [
{
ignores: [
// see the tsconfig.eslint.json for explanation
'packages/api-augment/src/kusama/*.ts',
'packages/api-augment/src/polkadot/*.ts'
]
},
...baseConfig,
{
rules: {
// add override for any (a metric ton of them, initial conversion)
'@typescript-eslint/no-explicit-any': 'off',
// we generally use this in isFunction, not via calling
'@typescript-eslint/unbound-method': 'off'
}
}
];
+5 -5
View File
@@ -14,10 +14,10 @@
}, },
"sideEffects": false, "sideEffects": false,
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"versions": { "versions": {
"git": "10.6.1", "git": "10.9.1",
"npm": "10.6.1" "npm": "10.9.1"
}, },
"workspaces": [ "workspaces": [
"packages/*" "packages/*"
@@ -40,9 +40,9 @@
"test:one": "polkadot-dev-run-test --env node" "test:one": "polkadot-dev-run-test --env node"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/dev": "^0.73.11", "@polkadot/dev": "^0.75.19",
"@polkadot/typegen": "workspace:packages/typegen", "@polkadot/typegen": "workspace:packages/typegen",
"@types/node": "^20.1.0" "@types/node": "^20.2.5"
}, },
"resolutions": { "resolutions": {
"typescript": "^5.0.4" "typescript": "^5.0.4"
+8 -8
View File
@@ -18,15 +18,15 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@polkadot/api-base": "10.6.1", "@polkadot/api-base": "10.9.1",
"@polkadot/rpc-augment": "10.6.1", "@polkadot/rpc-augment": "10.9.1",
"@polkadot/types": "10.6.1", "@polkadot/types": "10.9.1",
"@polkadot/types-augment": "10.6.1", "@polkadot/types-augment": "10.9.1",
"@polkadot/types-codec": "10.6.1", "@polkadot/types-codec": "10.9.1",
"@polkadot/util": "^12.1.2", "@polkadot/util": "^12.3.1",
"tslib": "^2.5.0" "tslib": "^2.5.3"
} }
} }
+29 -5
View File
@@ -9,7 +9,7 @@ import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types';
import type { Bytes, Option, Vec, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Bytes, Option, Vec, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec, ITuple } from '@polkadot/types-codec/types'; import type { Codec, ITuple } from '@polkadot/types-codec/types';
import type { Perbill, Permill, Perquintill } from '@polkadot/types/interfaces/runtime'; import type { Perbill, Permill, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, KusamaRuntimeRuntimeHoldReason, PalletReferendaTrackInfo, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight } from '@polkadot/types/lookup'; import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletReferendaTrackInfo, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>; export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
@@ -408,6 +408,34 @@ declare module '@polkadot/api-base/types/consts' {
**/ **/
[key: string]: Codec; [key: string]: Codec;
}; };
messageQueue: {
/**
* The size of the page; this implies the maximum message size which can be sent.
*
* A good value depends on the expected message sizes, their weights, the weight that is
* available for processing them and the maximal needed message size. The maximal message
* size is slightly lower than this as defined by [`MaxMessageLenOf`].
**/
heapSize: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of stale pages (i.e. of overweight messages) allowed before culling
* can happen. Once there are more stale pages than this, then historical pages may be
* dropped, even if they contain unprocessed overweight messages.
**/
maxStale: u32 & AugmentedConst<ApiType>;
/**
* The amount of weight (if any) which should be provided to the message queue for
* servicing enqueued items.
*
* This may be legitimately `None` in the case that you will call
* `ServiceQueues::service_queues` manually.
**/
serviceWeight: Option<SpWeightsWeightV2Weight> & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
multisig: { multisig: {
/** /**
* The base amount of currency needed to reserve for creating a multisig execution or to * The base amount of currency needed to reserve for creating a multisig execution or to
@@ -445,10 +473,6 @@ declare module '@polkadot/api-base/types/consts' {
* Must be no greater than `MaxQueueLen`. * Must be no greater than `MaxQueueLen`.
**/ **/
fifoQueueLen: u32 & AugmentedConst<ApiType>; fifoQueueLen: u32 & AugmentedConst<ApiType>;
/**
* The identifier of the hold reason.
**/
holdReason: KusamaRuntimeRuntimeHoldReason & AugmentedConst<ApiType>;
/** /**
* The number of blocks between consecutive attempts to dequeue bids and create receipts. * The number of blocks between consecutive attempts to dequeue bids and create receipts.
* *
+38 -19
View File
@@ -806,6 +806,44 @@ declare module '@polkadot/api-base/types/errors' {
**/ **/
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
}; };
messageQueue: {
/**
* The message was already processed and cannot be processed again.
**/
AlreadyProcessed: AugmentedError<ApiType>;
/**
* There is temporarily not enough weight to continue servicing messages.
**/
InsufficientWeight: AugmentedError<ApiType>;
/**
* The referenced message could not be found.
**/
NoMessage: AugmentedError<ApiType>;
/**
* Page to be reaped does not exist.
**/
NoPage: AugmentedError<ApiType>;
/**
* Page is not reapable because it has items remaining to be processed and is not old
* enough.
**/
NotReapable: AugmentedError<ApiType>;
/**
* The message is queued for future execution.
**/
Queued: AugmentedError<ApiType>;
/**
* This message is temporarily unprocessable.
*
* Such errors are expected, but not guaranteed, to resolve themselves eventually through
* retrying.
**/
TemporarilyUnprocessable: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
multisig: { multisig: {
/** /**
* Call is already approved by this signatory. * Call is already approved by this signatory.
@@ -1296,11 +1334,6 @@ declare module '@polkadot/api-base/types/errors' {
* Para is not registered in our system. * Para is not registered in our system.
**/ **/
NotRegistered: AugmentedError<ApiType>; NotRegistered: AugmentedError<ApiType>;
/**
* The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism
* is disabled.
**/
PvfCheckDisabled: AugmentedError<ApiType>;
/** /**
* The given validator already has cast a vote. * The given validator already has cast a vote.
**/ **/
@@ -1977,20 +2010,6 @@ declare module '@polkadot/api-base/types/errors' {
**/ **/
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
}; };
ump: {
/**
* The message index given is unknown.
**/
UnknownMessageIndex: AugmentedError<ApiType>;
/**
* The amount of weight given is possibly not enough for executing the message.
**/
WeightOverLimit: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
utility: { utility: {
/** /**
* Too many calls batched. * Too many calls batched.
+51 -118
View File
@@ -10,7 +10,7 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
import type { ITuple } from '@polkadot/types-codec/types'; import type { ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth'; import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, H256, Perbill, Perquintill } from '@polkadot/types/interfaces/runtime'; import type { AccountId32, H256, Perbill, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, KusamaRuntimeProxyType, PalletConvictionVotingTally, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsPoolState, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight, XcmV3MultiLocation, XcmV3MultiassetMultiAssets, XcmV3Response, XcmV3TraitsError, XcmV3TraitsOutcome, XcmV3Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, KusamaRuntimeProxyType, PalletConvictionVotingTally, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsPoolState, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight, XcmV3MultiLocation, XcmV3MultiassetMultiAssets, XcmV3Response, XcmV3TraitsError, XcmV3TraitsOutcome, XcmV3Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>; export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;
@@ -556,6 +556,28 @@ declare module '@polkadot/api-base/types/events' {
**/ **/
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
}; };
messageQueue: {
/**
* Message placed in overweight queue.
**/
OverweightEnqueued: AugmentedEvent<ApiType, [id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, pageIndex: u32, messageIndex: u32], { id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, pageIndex: u32, messageIndex: u32 }>;
/**
* This page was reaped.
**/
PageReaped: AugmentedEvent<ApiType, [origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, index: u32], { origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, index: u32 }>;
/**
* Message is processed.
**/
Processed: AugmentedEvent<ApiType, [id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, weightUsed: SpWeightsWeightV2Weight, success: bool], { id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, weightUsed: SpWeightsWeightV2Weight, success: bool }>;
/**
* Message discarded due to an error in the `MessageProcessor` (usually a format error).
**/
ProcessingFailed: AugmentedEvent<ApiType, [id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, error: FrameSupportMessagesProcessMessageError], { id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, error: FrameSupportMessagesProcessMessageError }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
multisig: { multisig: {
/** /**
* A multisig operation has been approved by someone. * A multisig operation has been approved by someone.
@@ -813,6 +835,10 @@ declare module '@polkadot/api-base/types/events' {
* A candidate timed out. `[candidate, head_data]` * A candidate timed out. `[candidate, head_data]`
**/ **/
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV4CandidateReceipt, Bytes, u32]>; CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV4CandidateReceipt, Bytes, u32]>;
/**
* Some upward messages have been received and will be processed.
**/
UpwardMessagesReceived: AugmentedEvent<ApiType, [from: u32, count: u32], { from: u32, count: u32 }>;
/** /**
* Generic event * Generic event
**/ **/
@@ -1320,53 +1346,6 @@ declare module '@polkadot/api-base/types/events' {
**/ **/
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
}; };
ump: {
/**
* Upward message executed with the given outcome.
* \[ id, outcome \]
**/
ExecutedUpward: AugmentedEvent<ApiType, [U8aFixed, XcmV3TraitsOutcome]>;
/**
* Upward message is invalid XCM.
* \[ id \]
**/
InvalidFormat: AugmentedEvent<ApiType, [U8aFixed]>;
/**
* The weight budget was exceeded for an individual upward message.
*
* This message can be later dispatched manually using `service_overweight` dispatchable
* using the assigned `overweight_index`.
*
* \[ para, id, overweight_index, required \]
**/
OverweightEnqueued: AugmentedEvent<ApiType, [u32, U8aFixed, u64, SpWeightsWeightV2Weight]>;
/**
* Upward message from the overweight queue was executed with the given actual weight
* used.
*
* \[ overweight_index, used \]
**/
OverweightServiced: AugmentedEvent<ApiType, [u64, SpWeightsWeightV2Weight]>;
/**
* Upward message is unsupported version of XCM.
* \[ id \]
**/
UnsupportedVersion: AugmentedEvent<ApiType, [U8aFixed]>;
/**
* Some upward messages have been received and will be processed.
* \[ para, count, size \]
**/
UpwardMessagesReceived: AugmentedEvent<ApiType, [u32, u32, u32]>;
/**
* The weight limit for handling upward messages was reached.
* \[ id, remaining, required \]
**/
WeightExhausted: AugmentedEvent<ApiType, [U8aFixed, SpWeightsWeightV2Weight, SpWeightsWeightV2Weight]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
utility: { utility: {
/** /**
* Batch of dispatches completed fully with no error. * Batch of dispatches completed fully with no error.
@@ -1439,36 +1418,26 @@ declare module '@polkadot/api-base/types/events' {
xcmPallet: { xcmPallet: {
/** /**
* Some assets have been claimed from an asset trap * Some assets have been claimed from an asset trap
*
* \[ hash, origin, assets \]
**/ **/
AssetsClaimed: AugmentedEvent<ApiType, [H256, XcmV3MultiLocation, XcmVersionedMultiAssets]>; AssetsClaimed: AugmentedEvent<ApiType, [hash_: H256, origin: XcmV3MultiLocation, assets: XcmVersionedMultiAssets], { hash_: H256, origin: XcmV3MultiLocation, assets: XcmVersionedMultiAssets }>;
/** /**
* Some assets have been placed in an asset trap. * Some assets have been placed in an asset trap.
*
* \[ hash, origin, assets \]
**/ **/
AssetsTrapped: AugmentedEvent<ApiType, [H256, XcmV3MultiLocation, XcmVersionedMultiAssets]>; AssetsTrapped: AugmentedEvent<ApiType, [hash_: H256, origin: XcmV3MultiLocation, assets: XcmVersionedMultiAssets], { hash_: H256, origin: XcmV3MultiLocation, assets: XcmVersionedMultiAssets }>;
/** /**
* Execution of an XCM message was attempted. * Execution of an XCM message was attempted.
*
* \[ outcome \]
**/ **/
Attempted: AugmentedEvent<ApiType, [XcmV3TraitsOutcome]>; Attempted: AugmentedEvent<ApiType, [outcome: XcmV3TraitsOutcome], { outcome: XcmV3TraitsOutcome }>;
/** /**
* Fees were paid from a location for an operation (often for using `SendXcm`). * Fees were paid from a location for an operation (often for using `SendXcm`).
*
* \[ paying location, fees \]
**/ **/
FeesPaid: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>; FeesPaid: AugmentedEvent<ApiType, [paying: XcmV3MultiLocation, fees: XcmV3MultiassetMultiAssets], { paying: XcmV3MultiLocation, fees: XcmV3MultiassetMultiAssets }>;
/** /**
* Expected query response has been received but the querier location of the response does * Expected query response has been received but the querier location of the response does
* not match the expected. The query remains registered for a later, valid, response to * not match the expected. The query remains registered for a later, valid, response to
* be received and acted upon. * be received and acted upon.
*
* \[ origin location, id, expected querier, maybe actual querier \]
**/ **/
InvalidQuerier: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64, XcmV3MultiLocation, Option<XcmV3MultiLocation>]>; InvalidQuerier: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64, expectedQuerier: XcmV3MultiLocation, maybeActualQuerier: Option<XcmV3MultiLocation>], { origin: XcmV3MultiLocation, queryId: u64, expectedQuerier: XcmV3MultiLocation, maybeActualQuerier: Option<XcmV3MultiLocation> }>;
/** /**
* Expected query response has been received but the expected querier location placed in * Expected query response has been received but the expected querier location placed in
* storage by this runtime previously cannot be decoded. The query remains registered. * storage by this runtime previously cannot be decoded. The query remains registered.
@@ -1477,18 +1446,14 @@ declare module '@polkadot/api-base/types/events' {
* runtime should be readable prior to query timeout) and dangerous since the possibly * runtime should be readable prior to query timeout) and dangerous since the possibly
* valid response will be dropped. Manual governance intervention is probably going to be * valid response will be dropped. Manual governance intervention is probably going to be
* needed. * needed.
*
* \[ origin location, id \]
**/ **/
InvalidQuerierVersion: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64]>; InvalidQuerierVersion: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64], { origin: XcmV3MultiLocation, queryId: u64 }>;
/** /**
* Expected query response has been received but the origin location of the response does * Expected query response has been received but the origin location of the response does
* not match that expected. The query remains registered for a later, valid, response to * not match that expected. The query remains registered for a later, valid, response to
* be received and acted upon. * be received and acted upon.
*
* \[ origin location, id, expected location \]
**/ **/
InvalidResponder: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64, Option<XcmV3MultiLocation>]>; InvalidResponder: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64, expectedLocation: Option<XcmV3MultiLocation>], { origin: XcmV3MultiLocation, queryId: u64, expectedLocation: Option<XcmV3MultiLocation> }>;
/** /**
* Expected query response has been received but the expected origin location placed in * Expected query response has been received but the expected origin location placed in
* storage by this runtime previously cannot be decoded. The query remains registered. * storage by this runtime previously cannot be decoded. The query remains registered.
@@ -1497,115 +1462,83 @@ declare module '@polkadot/api-base/types/events' {
* runtime should be readable prior to query timeout) and dangerous since the possibly * runtime should be readable prior to query timeout) and dangerous since the possibly
* valid response will be dropped. Manual governance intervention is probably going to be * valid response will be dropped. Manual governance intervention is probably going to be
* needed. * needed.
*
* \[ origin location, id \]
**/ **/
InvalidResponderVersion: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64]>; InvalidResponderVersion: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64], { origin: XcmV3MultiLocation, queryId: u64 }>;
/** /**
* Query response has been received and query is removed. The registered notification has * Query response has been received and query is removed. The registered notification has
* been dispatched and executed successfully. * been dispatched and executed successfully.
*
* \[ id, pallet index, call index \]
**/ **/
Notified: AugmentedEvent<ApiType, [u64, u8, u8]>; Notified: AugmentedEvent<ApiType, [queryId: u64, palletIndex: u8, callIndex: u8], { queryId: u64, palletIndex: u8, callIndex: u8 }>;
/** /**
* Query response has been received and query is removed. The dispatch was unable to be * Query response has been received and query is removed. The dispatch was unable to be
* decoded into a `Call`; this might be due to dispatch function having a signature which * decoded into a `Call`; this might be due to dispatch function having a signature which
* is not `(origin, QueryId, Response)`. * is not `(origin, QueryId, Response)`.
*
* \[ id, pallet index, call index \]
**/ **/
NotifyDecodeFailed: AugmentedEvent<ApiType, [u64, u8, u8]>; NotifyDecodeFailed: AugmentedEvent<ApiType, [queryId: u64, palletIndex: u8, callIndex: u8], { queryId: u64, palletIndex: u8, callIndex: u8 }>;
/** /**
* Query response has been received and query is removed. There was a general error with * Query response has been received and query is removed. There was a general error with
* dispatching the notification call. * dispatching the notification call.
*
* \[ id, pallet index, call index \]
**/ **/
NotifyDispatchError: AugmentedEvent<ApiType, [u64, u8, u8]>; NotifyDispatchError: AugmentedEvent<ApiType, [queryId: u64, palletIndex: u8, callIndex: u8], { queryId: u64, palletIndex: u8, callIndex: u8 }>;
/** /**
* Query response has been received and query is removed. The registered notification could * Query response has been received and query is removed. The registered notification could
* not be dispatched because the dispatch weight is greater than the maximum weight * not be dispatched because the dispatch weight is greater than the maximum weight
* originally budgeted by this runtime for the query result. * originally budgeted by this runtime for the query result.
*
* \[ id, pallet index, call index, actual weight, max budgeted weight \]
**/ **/
NotifyOverweight: AugmentedEvent<ApiType, [u64, u8, u8, SpWeightsWeightV2Weight, SpWeightsWeightV2Weight]>; NotifyOverweight: AugmentedEvent<ApiType, [queryId: u64, palletIndex: u8, callIndex: u8, actualWeight: SpWeightsWeightV2Weight, maxBudgetedWeight: SpWeightsWeightV2Weight], { queryId: u64, palletIndex: u8, callIndex: u8, actualWeight: SpWeightsWeightV2Weight, maxBudgetedWeight: SpWeightsWeightV2Weight }>;
/** /**
* A given location which had a version change subscription was dropped owing to an error * A given location which had a version change subscription was dropped owing to an error
* migrating the location to our new XCM format. * migrating the location to our new XCM format.
*
* \[ location, query ID \]
**/ **/
NotifyTargetMigrationFail: AugmentedEvent<ApiType, [XcmVersionedMultiLocation, u64]>; NotifyTargetMigrationFail: AugmentedEvent<ApiType, [location: XcmVersionedMultiLocation, queryId: u64], { location: XcmVersionedMultiLocation, queryId: u64 }>;
/** /**
* A given location which had a version change subscription was dropped owing to an error * A given location which had a version change subscription was dropped owing to an error
* sending the notification to it. * sending the notification to it.
*
* \[ location, query ID, error \]
**/ **/
NotifyTargetSendFail: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64, XcmV3TraitsError]>; NotifyTargetSendFail: AugmentedEvent<ApiType, [location: XcmV3MultiLocation, queryId: u64, error: XcmV3TraitsError], { location: XcmV3MultiLocation, queryId: u64, error: XcmV3TraitsError }>;
/** /**
* Query response has been received and is ready for taking with `take_response`. There is * Query response has been received and is ready for taking with `take_response`. There is
* no registered notification call. * no registered notification call.
*
* \[ id, response \]
**/ **/
ResponseReady: AugmentedEvent<ApiType, [u64, XcmV3Response]>; ResponseReady: AugmentedEvent<ApiType, [queryId: u64, response: XcmV3Response], { queryId: u64, response: XcmV3Response }>;
/** /**
* Received query response has been read and removed. * Received query response has been read and removed.
*
* \[ id \]
**/ **/
ResponseTaken: AugmentedEvent<ApiType, [u64]>; ResponseTaken: AugmentedEvent<ApiType, [queryId: u64], { queryId: u64 }>;
/** /**
* A XCM message was sent. * A XCM message was sent.
*
* \[ origin, destination, message \]
**/ **/
Sent: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiLocation, XcmV3Xcm]>; Sent: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, destination: XcmV3MultiLocation, message: XcmV3Xcm, messageId: U8aFixed], { origin: XcmV3MultiLocation, destination: XcmV3MultiLocation, message: XcmV3Xcm, messageId: U8aFixed }>;
/** /**
* The supported version of a location has been changed. This might be through an * The supported version of a location has been changed. This might be through an
* automatic notification or a manual intervention. * automatic notification or a manual intervention.
*
* \[ location, XCM version \]
**/ **/
SupportedVersionChanged: AugmentedEvent<ApiType, [XcmV3MultiLocation, u32]>; SupportedVersionChanged: AugmentedEvent<ApiType, [location: XcmV3MultiLocation, version: u32], { location: XcmV3MultiLocation, version: u32 }>;
/** /**
* Query response received which does not match a registered query. This may be because a * Query response received which does not match a registered query. This may be because a
* matching query was never registered, it may be because it is a duplicate response, or * matching query was never registered, it may be because it is a duplicate response, or
* because the query timed out. * because the query timed out.
*
* \[ origin location, id \]
**/ **/
UnexpectedResponse: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64]>; UnexpectedResponse: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64], { origin: XcmV3MultiLocation, queryId: u64 }>;
/** /**
* An XCM version change notification message has been attempted to be sent. * An XCM version change notification message has been attempted to be sent.
* *
* The cost of sending it (borne by the chain) is included. * The cost of sending it (borne by the chain) is included.
*
* \[ destination, result, cost \]
**/ **/
VersionChangeNotified: AugmentedEvent<ApiType, [XcmV3MultiLocation, u32, XcmV3MultiassetMultiAssets]>; VersionChangeNotified: AugmentedEvent<ApiType, [destination: XcmV3MultiLocation, result: u32, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed], { destination: XcmV3MultiLocation, result: u32, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed }>;
/** /**
* We have requested that a remote chain sends us XCM version change notifications. * We have requested that a remote chain send us XCM version change notifications.
*
* \[ destination location, cost \]
**/ **/
VersionNotifyRequested: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>; VersionNotifyRequested: AugmentedEvent<ApiType, [destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed], { destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed }>;
/** /**
* A remote has requested XCM version change notification from us and we have honored it. * A remote has requested XCM version change notification from us and we have honored it.
* A version information message is sent to them and its cost is included. * A version information message is sent to them and its cost is included.
*
* \[ destination location, cost \]
**/ **/
VersionNotifyStarted: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>; VersionNotifyStarted: AugmentedEvent<ApiType, [destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed], { destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed }>;
/** /**
* We have requested that a remote chain stops sending us XCM version change notifications. * We have requested that a remote chain stops sending us XCM version change notifications.
*
* \[ destination location, cost \]
**/ **/
VersionNotifyUnrequested: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>; VersionNotifyUnrequested: AugmentedEvent<ApiType, [destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed], { destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed }>;
/** /**
* Generic event * Generic event
**/ **/
+31 -68
View File
@@ -11,7 +11,7 @@ import type { BTreeSet, Bytes, Null, Option, Struct, U8aFixed, Vec, WrapperOpaqu
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth'; import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime'; import type { AccountId32, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeRuntimeHoldReason, KusamaRuntimeSessionKeys, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletConvictionVotingVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4AssignmentAppPublic, PolkadotPrimitivesV4CandidateCommitments, PolkadotPrimitivesV4CoreOccupied, PolkadotPrimitivesV4DisputeState, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4ScrapedOnChainVotes, PolkadotPrimitivesV4SessionInfo, PolkadotPrimitivesV4UpgradeGoAhead, PolkadotPrimitivesV4UpgradeRestriction, PolkadotPrimitivesV4ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsDisputesSlashingPendingSlashes, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; import type { FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KusamaRuntimeRuntimeHoldReason, KusamaRuntimeSessionKeys, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletConvictionVotingVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMessageQueueBookState, PalletMessageQueuePage, PalletMultisigMultisig, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4AssignmentAppPublic, PolkadotPrimitivesV4CandidateCommitments, PolkadotPrimitivesV4CoreOccupied, PolkadotPrimitivesV4DisputeState, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4ScrapedOnChainVotes, PolkadotPrimitivesV4SessionInfo, PolkadotPrimitivesV4UpgradeGoAhead, PolkadotPrimitivesV4UpgradeRestriction, PolkadotPrimitivesV4ValidatorAppPublic, PolkadotPrimitivesVstagingSlashingPendingSlashes, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types'; import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>; export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -482,22 +482,24 @@ declare module '@polkadot/api-base/types/storage' {
/** /**
* Number of eras to check per block. * Number of eras to check per block.
* *
* If set to 0, this pallet does absolutely nothing. * If set to 0, this pallet does absolutely nothing. Cannot be set to more than
* [`Config::MaxErasToCheckPerBlock`].
* *
* Based on the amount of weight available at `on_idle`, up to this many eras of a single * Based on the amount of weight available at [`Pallet::on_idle`], up to this many eras are
* nominator might be checked. * checked. The checking is represented by updating [`UnstakeRequest::checked`], which is
* stored in [`Head`].
**/ **/
erasToCheckPerBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>; erasToCheckPerBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* The current "head of the queue" being unstaked. * The current "head of the queue" being unstaked.
*
* The head in itself can be a batch of up to [`Config::BatchSize`] stakers.
**/ **/
head: AugmentedQuery<ApiType, () => Observable<Option<PalletFastUnstakeUnstakeRequest>>, []> & QueryableStorageEntry<ApiType, []>; head: AugmentedQuery<ApiType, () => Observable<Option<PalletFastUnstakeUnstakeRequest>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* The map of all accounts wishing to be unstaked. * The map of all accounts wishing to be unstaked.
* *
* Keeps track of `AccountId` wishing to unstake and it's corresponding deposit. * Keeps track of `AccountId` wishing to unstake and it's corresponding deposit.
*
* TWOX-NOTE: SAFE since `AccountId` is a secure hash.
**/ **/
queue: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>; queue: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/** /**
@@ -793,6 +795,24 @@ declare module '@polkadot/api-base/types/storage' {
**/ **/
[key: string]: QueryableStorageEntry<ApiType>; [key: string]: QueryableStorageEntry<ApiType>;
}; };
messageQueue: {
/**
* The index of the first and last (non-empty) pages.
**/
bookStateFor: AugmentedQuery<ApiType, (arg: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin | { Ump: any } | string | Uint8Array) => Observable<PalletMessageQueueBookState>, [PolkadotRuntimeParachainsInclusionAggregateMessageOrigin]> & QueryableStorageEntry<ApiType, [PolkadotRuntimeParachainsInclusionAggregateMessageOrigin]>;
/**
* The map of page indices to pages.
**/
pages: AugmentedQuery<ApiType, (arg1: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin | { Ump: any } | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletMessageQueuePage>>, [PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, u32]> & QueryableStorageEntry<ApiType, [PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, u32]>;
/**
* The origin at which we should begin servicing.
**/
serviceHead: AugmentedQuery<ApiType, () => Observable<Option<PolkadotRuntimeParachainsInclusionAggregateMessageOrigin>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
multisig: { multisig: {
/** /**
* The set of open multisig operations. * The set of open multisig operations.
@@ -864,7 +884,10 @@ declare module '@polkadot/api-base/types/storage' {
/** /**
* Holds on account balances. * Holds on account balances.
**/ **/
holds: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<PalletBalancesIdAmount>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>; holds: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<{
readonly id: KusamaRuntimeRuntimeHoldReason;
readonly amount: u128;
} & Struct>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/** /**
* The total units of outstanding deactivated balance in the system. * The total units of outstanding deactivated balance in the system.
**/ **/
@@ -1316,7 +1339,7 @@ declare module '@polkadot/api-base/types/storage' {
/** /**
* Validators pending dispute slashes. * Validators pending dispute slashes.
**/ **/
unappliedSlashes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotRuntimeParachainsDisputesSlashingPendingSlashes>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>; unappliedSlashes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesVstagingSlashingPendingSlashes>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
/** /**
* `ValidatorSetCount` per session. * `ValidatorSetCount` per session.
**/ **/
@@ -1951,66 +1974,6 @@ declare module '@polkadot/api-base/types/storage' {
**/ **/
[key: string]: QueryableStorageEntry<ApiType>; [key: string]: QueryableStorageEntry<ApiType>;
}; };
ump: {
/**
* Counter for the related counted storage map
**/
counterForOverweight: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The ordered list of `ParaId`s that have a `RelayDispatchQueue` entry.
*
* Invariant:
* - The set of items from this vector should be exactly the set of the keys in
* `RelayDispatchQueues` and `RelayDispatchQueueSize`.
**/
needsDispatch: AugmentedQuery<ApiType, () => Observable<Vec<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* This is the para that gets will get dispatched first during the next upward dispatchable queue
* execution round.
*
* Invariant:
* - If `Some(para)`, then `para` must be present in `NeedsDispatch`.
**/
nextDispatchRoundStartWith: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The messages that exceeded max individual message weight budget.
*
* These messages stay there until manually dispatched.
**/
overweight: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[u32, Bytes]>>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
/**
* The number of overweight messages ever recorded in `Overweight` (and thus the lowest free
* index).
**/
overweightCount: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The messages waiting to be handled by the relay-chain originating from a certain parachain.
*
* Note that some upward messages might have been already processed by the inclusion logic. E.g.
* channel management messages.
*
* The messages are processed in FIFO order.
**/
relayDispatchQueues: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`.
*
* First item in the tuple is the count of messages and second
* is the total length (in bytes) of the message payloads.
*
* Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of
* messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of
* loading the whole message queue if only the total size and count are required.
*
* Invariant:
* - The set of keys should exactly match the set of keys of `RelayDispatchQueues`.
**/
relayDispatchQueueSize: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[u32, u32]>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
vesting: { vesting: {
/** /**
* Storage version of the pallet. * Storage version of the pallet.
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.6.1' }; export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.9.1' };
@@ -455,6 +455,34 @@ declare module '@polkadot/api-base/types/consts' {
**/ **/
[key: string]: Codec; [key: string]: Codec;
}; };
messageQueue: {
/**
* The size of the page; this implies the maximum message size which can be sent.
*
* A good value depends on the expected message sizes, their weights, the weight that is
* available for processing them and the maximal needed message size. The maximal message
* size is slightly lower than this as defined by [`MaxMessageLenOf`].
**/
heapSize: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of stale pages (i.e. of overweight messages) allowed before culling
* can happen. Once there are more stale pages than this, then historical pages may be
* dropped, even if they contain unprocessed overweight messages.
**/
maxStale: u32 & AugmentedConst<ApiType>;
/**
* The amount of weight (if any) which should be provided to the message queue for
* servicing enqueued items.
*
* This may be legitimately `None` in the case that you will call
* `ServiceQueues::service_queues` manually.
**/
serviceWeight: Option<SpWeightsWeightV2Weight> & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
multisig: { multisig: {
/** /**
* The base amount of currency needed to reserve for creating a multisig execution or to * The base amount of currency needed to reserve for creating a multisig execution or to
+38 -19
View File
@@ -855,6 +855,44 @@ declare module '@polkadot/api-base/types/errors' {
**/ **/
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
}; };
messageQueue: {
/**
* The message was already processed and cannot be processed again.
**/
AlreadyProcessed: AugmentedError<ApiType>;
/**
* There is temporarily not enough weight to continue servicing messages.
**/
InsufficientWeight: AugmentedError<ApiType>;
/**
* The referenced message could not be found.
**/
NoMessage: AugmentedError<ApiType>;
/**
* Page to be reaped does not exist.
**/
NoPage: AugmentedError<ApiType>;
/**
* Page is not reapable because it has items remaining to be processed and is not old
* enough.
**/
NotReapable: AugmentedError<ApiType>;
/**
* The message is queued for future execution.
**/
Queued: AugmentedError<ApiType>;
/**
* This message is temporarily unprocessable.
*
* Such errors are expected, but not guaranteed, to resolve themselves eventually through
* retrying.
**/
TemporarilyUnprocessable: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
multisig: { multisig: {
/** /**
* Call is already approved by this signatory. * Call is already approved by this signatory.
@@ -1232,11 +1270,6 @@ declare module '@polkadot/api-base/types/errors' {
* Para is not registered in our system. * Para is not registered in our system.
**/ **/
NotRegistered: AugmentedError<ApiType>; NotRegistered: AugmentedError<ApiType>;
/**
* The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism
* is disabled.
**/
PvfCheckDisabled: AugmentedError<ApiType>;
/** /**
* The given validator already has cast a vote. * The given validator already has cast a vote.
**/ **/
@@ -1933,20 +1966,6 @@ declare module '@polkadot/api-base/types/errors' {
**/ **/
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
}; };
ump: {
/**
* The message index given is unknown.
**/
UnknownMessageIndex: AugmentedError<ApiType>;
/**
* The amount of weight given is possibly not enough for executing the message.
**/
WeightOverLimit: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
utility: { utility: {
/** /**
* Too many calls batched. * Too many calls batched.
+51 -118
View File
@@ -10,7 +10,7 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
import type { ITuple } from '@polkadot/types-codec/types'; import type { ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth'; import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, H256, Perbill } from '@polkadot/types/interfaces/runtime'; import type { AccountId32, H256, Perbill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, PalletConvictionVotingTally, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsPoolState, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, PolkadotRuntimeProxyType, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight, XcmV3MultiLocation, XcmV3MultiassetMultiAssets, XcmV3Response, XcmV3TraitsError, XcmV3TraitsOutcome, XcmV3Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, PalletConvictionVotingTally, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsPoolState, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4CandidateReceipt, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, PolkadotRuntimeProxyType, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight, XcmV3MultiLocation, XcmV3MultiassetMultiAssets, XcmV3Response, XcmV3TraitsError, XcmV3TraitsOutcome, XcmV3Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>; export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;
@@ -579,6 +579,28 @@ declare module '@polkadot/api-base/types/events' {
**/ **/
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
}; };
messageQueue: {
/**
* Message placed in overweight queue.
**/
OverweightEnqueued: AugmentedEvent<ApiType, [id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, pageIndex: u32, messageIndex: u32], { id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, pageIndex: u32, messageIndex: u32 }>;
/**
* This page was reaped.
**/
PageReaped: AugmentedEvent<ApiType, [origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, index: u32], { origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, index: u32 }>;
/**
* Message is processed.
**/
Processed: AugmentedEvent<ApiType, [id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, weightUsed: SpWeightsWeightV2Weight, success: bool], { id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, weightUsed: SpWeightsWeightV2Weight, success: bool }>;
/**
* Message discarded due to an error in the `MessageProcessor` (usually a format error).
**/
ProcessingFailed: AugmentedEvent<ApiType, [id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, error: FrameSupportMessagesProcessMessageError], { id: U8aFixed, origin: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, error: FrameSupportMessagesProcessMessageError }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
multisig: { multisig: {
/** /**
* A multisig operation has been approved by someone. * A multisig operation has been approved by someone.
@@ -710,6 +732,10 @@ declare module '@polkadot/api-base/types/events' {
* A candidate timed out. `[candidate, head_data]` * A candidate timed out. `[candidate, head_data]`
**/ **/
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV4CandidateReceipt, Bytes, u32]>; CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV4CandidateReceipt, Bytes, u32]>;
/**
* Some upward messages have been received and will be processed.
**/
UpwardMessagesReceived: AugmentedEvent<ApiType, [from: u32, count: u32], { from: u32, count: u32 }>;
/** /**
* Generic event * Generic event
**/ **/
@@ -1245,53 +1271,6 @@ declare module '@polkadot/api-base/types/events' {
**/ **/
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
}; };
ump: {
/**
* Upward message executed with the given outcome.
* \[ id, outcome \]
**/
ExecutedUpward: AugmentedEvent<ApiType, [U8aFixed, XcmV3TraitsOutcome]>;
/**
* Upward message is invalid XCM.
* \[ id \]
**/
InvalidFormat: AugmentedEvent<ApiType, [U8aFixed]>;
/**
* The weight budget was exceeded for an individual upward message.
*
* This message can be later dispatched manually using `service_overweight` dispatchable
* using the assigned `overweight_index`.
*
* \[ para, id, overweight_index, required \]
**/
OverweightEnqueued: AugmentedEvent<ApiType, [u32, U8aFixed, u64, SpWeightsWeightV2Weight]>;
/**
* Upward message from the overweight queue was executed with the given actual weight
* used.
*
* \[ overweight_index, used \]
**/
OverweightServiced: AugmentedEvent<ApiType, [u64, SpWeightsWeightV2Weight]>;
/**
* Upward message is unsupported version of XCM.
* \[ id \]
**/
UnsupportedVersion: AugmentedEvent<ApiType, [U8aFixed]>;
/**
* Some upward messages have been received and will be processed.
* \[ para, count, size \]
**/
UpwardMessagesReceived: AugmentedEvent<ApiType, [u32, u32, u32]>;
/**
* The weight limit for handling upward messages was reached.
* \[ id, remaining, required \]
**/
WeightExhausted: AugmentedEvent<ApiType, [U8aFixed, SpWeightsWeightV2Weight, SpWeightsWeightV2Weight]>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
utility: { utility: {
/** /**
* Batch of dispatches completed fully with no error. * Batch of dispatches completed fully with no error.
@@ -1364,36 +1343,26 @@ declare module '@polkadot/api-base/types/events' {
xcmPallet: { xcmPallet: {
/** /**
* Some assets have been claimed from an asset trap * Some assets have been claimed from an asset trap
*
* \[ hash, origin, assets \]
**/ **/
AssetsClaimed: AugmentedEvent<ApiType, [H256, XcmV3MultiLocation, XcmVersionedMultiAssets]>; AssetsClaimed: AugmentedEvent<ApiType, [hash_: H256, origin: XcmV3MultiLocation, assets: XcmVersionedMultiAssets], { hash_: H256, origin: XcmV3MultiLocation, assets: XcmVersionedMultiAssets }>;
/** /**
* Some assets have been placed in an asset trap. * Some assets have been placed in an asset trap.
*
* \[ hash, origin, assets \]
**/ **/
AssetsTrapped: AugmentedEvent<ApiType, [H256, XcmV3MultiLocation, XcmVersionedMultiAssets]>; AssetsTrapped: AugmentedEvent<ApiType, [hash_: H256, origin: XcmV3MultiLocation, assets: XcmVersionedMultiAssets], { hash_: H256, origin: XcmV3MultiLocation, assets: XcmVersionedMultiAssets }>;
/** /**
* Execution of an XCM message was attempted. * Execution of an XCM message was attempted.
*
* \[ outcome \]
**/ **/
Attempted: AugmentedEvent<ApiType, [XcmV3TraitsOutcome]>; Attempted: AugmentedEvent<ApiType, [outcome: XcmV3TraitsOutcome], { outcome: XcmV3TraitsOutcome }>;
/** /**
* Fees were paid from a location for an operation (often for using `SendXcm`). * Fees were paid from a location for an operation (often for using `SendXcm`).
*
* \[ paying location, fees \]
**/ **/
FeesPaid: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>; FeesPaid: AugmentedEvent<ApiType, [paying: XcmV3MultiLocation, fees: XcmV3MultiassetMultiAssets], { paying: XcmV3MultiLocation, fees: XcmV3MultiassetMultiAssets }>;
/** /**
* Expected query response has been received but the querier location of the response does * Expected query response has been received but the querier location of the response does
* not match the expected. The query remains registered for a later, valid, response to * not match the expected. The query remains registered for a later, valid, response to
* be received and acted upon. * be received and acted upon.
*
* \[ origin location, id, expected querier, maybe actual querier \]
**/ **/
InvalidQuerier: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64, XcmV3MultiLocation, Option<XcmV3MultiLocation>]>; InvalidQuerier: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64, expectedQuerier: XcmV3MultiLocation, maybeActualQuerier: Option<XcmV3MultiLocation>], { origin: XcmV3MultiLocation, queryId: u64, expectedQuerier: XcmV3MultiLocation, maybeActualQuerier: Option<XcmV3MultiLocation> }>;
/** /**
* Expected query response has been received but the expected querier location placed in * Expected query response has been received but the expected querier location placed in
* storage by this runtime previously cannot be decoded. The query remains registered. * storage by this runtime previously cannot be decoded. The query remains registered.
@@ -1402,18 +1371,14 @@ declare module '@polkadot/api-base/types/events' {
* runtime should be readable prior to query timeout) and dangerous since the possibly * runtime should be readable prior to query timeout) and dangerous since the possibly
* valid response will be dropped. Manual governance intervention is probably going to be * valid response will be dropped. Manual governance intervention is probably going to be
* needed. * needed.
*
* \[ origin location, id \]
**/ **/
InvalidQuerierVersion: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64]>; InvalidQuerierVersion: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64], { origin: XcmV3MultiLocation, queryId: u64 }>;
/** /**
* Expected query response has been received but the origin location of the response does * Expected query response has been received but the origin location of the response does
* not match that expected. The query remains registered for a later, valid, response to * not match that expected. The query remains registered for a later, valid, response to
* be received and acted upon. * be received and acted upon.
*
* \[ origin location, id, expected location \]
**/ **/
InvalidResponder: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64, Option<XcmV3MultiLocation>]>; InvalidResponder: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64, expectedLocation: Option<XcmV3MultiLocation>], { origin: XcmV3MultiLocation, queryId: u64, expectedLocation: Option<XcmV3MultiLocation> }>;
/** /**
* Expected query response has been received but the expected origin location placed in * Expected query response has been received but the expected origin location placed in
* storage by this runtime previously cannot be decoded. The query remains registered. * storage by this runtime previously cannot be decoded. The query remains registered.
@@ -1422,115 +1387,83 @@ declare module '@polkadot/api-base/types/events' {
* runtime should be readable prior to query timeout) and dangerous since the possibly * runtime should be readable prior to query timeout) and dangerous since the possibly
* valid response will be dropped. Manual governance intervention is probably going to be * valid response will be dropped. Manual governance intervention is probably going to be
* needed. * needed.
*
* \[ origin location, id \]
**/ **/
InvalidResponderVersion: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64]>; InvalidResponderVersion: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64], { origin: XcmV3MultiLocation, queryId: u64 }>;
/** /**
* Query response has been received and query is removed. The registered notification has * Query response has been received and query is removed. The registered notification has
* been dispatched and executed successfully. * been dispatched and executed successfully.
*
* \[ id, pallet index, call index \]
**/ **/
Notified: AugmentedEvent<ApiType, [u64, u8, u8]>; Notified: AugmentedEvent<ApiType, [queryId: u64, palletIndex: u8, callIndex: u8], { queryId: u64, palletIndex: u8, callIndex: u8 }>;
/** /**
* Query response has been received and query is removed. The dispatch was unable to be * Query response has been received and query is removed. The dispatch was unable to be
* decoded into a `Call`; this might be due to dispatch function having a signature which * decoded into a `Call`; this might be due to dispatch function having a signature which
* is not `(origin, QueryId, Response)`. * is not `(origin, QueryId, Response)`.
*
* \[ id, pallet index, call index \]
**/ **/
NotifyDecodeFailed: AugmentedEvent<ApiType, [u64, u8, u8]>; NotifyDecodeFailed: AugmentedEvent<ApiType, [queryId: u64, palletIndex: u8, callIndex: u8], { queryId: u64, palletIndex: u8, callIndex: u8 }>;
/** /**
* Query response has been received and query is removed. There was a general error with * Query response has been received and query is removed. There was a general error with
* dispatching the notification call. * dispatching the notification call.
*
* \[ id, pallet index, call index \]
**/ **/
NotifyDispatchError: AugmentedEvent<ApiType, [u64, u8, u8]>; NotifyDispatchError: AugmentedEvent<ApiType, [queryId: u64, palletIndex: u8, callIndex: u8], { queryId: u64, palletIndex: u8, callIndex: u8 }>;
/** /**
* Query response has been received and query is removed. The registered notification could * Query response has been received and query is removed. The registered notification could
* not be dispatched because the dispatch weight is greater than the maximum weight * not be dispatched because the dispatch weight is greater than the maximum weight
* originally budgeted by this runtime for the query result. * originally budgeted by this runtime for the query result.
*
* \[ id, pallet index, call index, actual weight, max budgeted weight \]
**/ **/
NotifyOverweight: AugmentedEvent<ApiType, [u64, u8, u8, SpWeightsWeightV2Weight, SpWeightsWeightV2Weight]>; NotifyOverweight: AugmentedEvent<ApiType, [queryId: u64, palletIndex: u8, callIndex: u8, actualWeight: SpWeightsWeightV2Weight, maxBudgetedWeight: SpWeightsWeightV2Weight], { queryId: u64, palletIndex: u8, callIndex: u8, actualWeight: SpWeightsWeightV2Weight, maxBudgetedWeight: SpWeightsWeightV2Weight }>;
/** /**
* A given location which had a version change subscription was dropped owing to an error * A given location which had a version change subscription was dropped owing to an error
* migrating the location to our new XCM format. * migrating the location to our new XCM format.
*
* \[ location, query ID \]
**/ **/
NotifyTargetMigrationFail: AugmentedEvent<ApiType, [XcmVersionedMultiLocation, u64]>; NotifyTargetMigrationFail: AugmentedEvent<ApiType, [location: XcmVersionedMultiLocation, queryId: u64], { location: XcmVersionedMultiLocation, queryId: u64 }>;
/** /**
* A given location which had a version change subscription was dropped owing to an error * A given location which had a version change subscription was dropped owing to an error
* sending the notification to it. * sending the notification to it.
*
* \[ location, query ID, error \]
**/ **/
NotifyTargetSendFail: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64, XcmV3TraitsError]>; NotifyTargetSendFail: AugmentedEvent<ApiType, [location: XcmV3MultiLocation, queryId: u64, error: XcmV3TraitsError], { location: XcmV3MultiLocation, queryId: u64, error: XcmV3TraitsError }>;
/** /**
* Query response has been received and is ready for taking with `take_response`. There is * Query response has been received and is ready for taking with `take_response`. There is
* no registered notification call. * no registered notification call.
*
* \[ id, response \]
**/ **/
ResponseReady: AugmentedEvent<ApiType, [u64, XcmV3Response]>; ResponseReady: AugmentedEvent<ApiType, [queryId: u64, response: XcmV3Response], { queryId: u64, response: XcmV3Response }>;
/** /**
* Received query response has been read and removed. * Received query response has been read and removed.
*
* \[ id \]
**/ **/
ResponseTaken: AugmentedEvent<ApiType, [u64]>; ResponseTaken: AugmentedEvent<ApiType, [queryId: u64], { queryId: u64 }>;
/** /**
* A XCM message was sent. * A XCM message was sent.
*
* \[ origin, destination, message \]
**/ **/
Sent: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiLocation, XcmV3Xcm]>; Sent: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, destination: XcmV3MultiLocation, message: XcmV3Xcm, messageId: U8aFixed], { origin: XcmV3MultiLocation, destination: XcmV3MultiLocation, message: XcmV3Xcm, messageId: U8aFixed }>;
/** /**
* The supported version of a location has been changed. This might be through an * The supported version of a location has been changed. This might be through an
* automatic notification or a manual intervention. * automatic notification or a manual intervention.
*
* \[ location, XCM version \]
**/ **/
SupportedVersionChanged: AugmentedEvent<ApiType, [XcmV3MultiLocation, u32]>; SupportedVersionChanged: AugmentedEvent<ApiType, [location: XcmV3MultiLocation, version: u32], { location: XcmV3MultiLocation, version: u32 }>;
/** /**
* Query response received which does not match a registered query. This may be because a * Query response received which does not match a registered query. This may be because a
* matching query was never registered, it may be because it is a duplicate response, or * matching query was never registered, it may be because it is a duplicate response, or
* because the query timed out. * because the query timed out.
*
* \[ origin location, id \]
**/ **/
UnexpectedResponse: AugmentedEvent<ApiType, [XcmV3MultiLocation, u64]>; UnexpectedResponse: AugmentedEvent<ApiType, [origin: XcmV3MultiLocation, queryId: u64], { origin: XcmV3MultiLocation, queryId: u64 }>;
/** /**
* An XCM version change notification message has been attempted to be sent. * An XCM version change notification message has been attempted to be sent.
* *
* The cost of sending it (borne by the chain) is included. * The cost of sending it (borne by the chain) is included.
*
* \[ destination, result, cost \]
**/ **/
VersionChangeNotified: AugmentedEvent<ApiType, [XcmV3MultiLocation, u32, XcmV3MultiassetMultiAssets]>; VersionChangeNotified: AugmentedEvent<ApiType, [destination: XcmV3MultiLocation, result: u32, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed], { destination: XcmV3MultiLocation, result: u32, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed }>;
/** /**
* We have requested that a remote chain sends us XCM version change notifications. * We have requested that a remote chain send us XCM version change notifications.
*
* \[ destination location, cost \]
**/ **/
VersionNotifyRequested: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>; VersionNotifyRequested: AugmentedEvent<ApiType, [destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed], { destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed }>;
/** /**
* A remote has requested XCM version change notification from us and we have honored it. * A remote has requested XCM version change notification from us and we have honored it.
* A version information message is sent to them and its cost is included. * A version information message is sent to them and its cost is included.
*
* \[ destination location, cost \]
**/ **/
VersionNotifyStarted: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>; VersionNotifyStarted: AugmentedEvent<ApiType, [destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed], { destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed }>;
/** /**
* We have requested that a remote chain stops sending us XCM version change notifications. * We have requested that a remote chain stops sending us XCM version change notifications.
*
* \[ destination location, cost \]
**/ **/
VersionNotifyUnrequested: AugmentedEvent<ApiType, [XcmV3MultiLocation, XcmV3MultiassetMultiAssets]>; VersionNotifyUnrequested: AugmentedEvent<ApiType, [destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed], { destination: XcmV3MultiLocation, cost: XcmV3MultiassetMultiAssets, messageId: U8aFixed }>;
/** /**
* Generic event * Generic event
**/ **/
+32 -69
View File
@@ -7,11 +7,11 @@ import '@polkadot/api-base/types/storage';
import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types'; import type { ApiTypes, AugmentedQuery, QueryableStorageEntry } from '@polkadot/api-base/types';
import type { Data } from '@polkadot/types'; import type { Data } from '@polkadot/types';
import type { BTreeSet, Bytes, Null, Option, U8aFixed, Vec, WrapperOpaque, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; import type { BTreeSet, Bytes, Null, Option, Struct, U8aFixed, Vec, WrapperOpaque, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth'; import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime'; import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletConvictionVotingVoteVoting, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletReferendaReferendumInfo, PalletSchedulerScheduled, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4AssignmentAppPublic, PolkadotPrimitivesV4CandidateCommitments, PolkadotPrimitivesV4CoreOccupied, PolkadotPrimitivesV4DisputeState, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4ScrapedOnChainVotes, PolkadotPrimitivesV4SessionInfo, PolkadotPrimitivesV4UpgradeGoAhead, PolkadotPrimitivesV4UpgradeRestriction, PolkadotPrimitivesV4ValidatorAppPublic, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsDisputesSlashingPendingSlashes, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; import type { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletConvictionVotingVoteVoting, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletMessageQueueBookState, PalletMessageQueuePage, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletReferendaReferendumInfo, PalletSchedulerScheduled, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTreasuryProposal, PalletVestingReleases, PalletVestingVestingInfo, PalletXcmQueryStatus, PalletXcmRemoteLockedFungibleRecord, PalletXcmVersionMigrationStage, PolkadotCorePrimitivesInboundDownwardMessage, PolkadotCorePrimitivesInboundHrmpMessage, PolkadotParachainPrimitivesHrmpChannelId, PolkadotPrimitivesV4AssignmentAppPublic, PolkadotPrimitivesV4CandidateCommitments, PolkadotPrimitivesV4CoreOccupied, PolkadotPrimitivesV4DisputeState, PolkadotPrimitivesV4ExecutorParams, PolkadotPrimitivesV4ScrapedOnChainVotes, PolkadotPrimitivesV4SessionInfo, PolkadotPrimitivesV4UpgradeGoAhead, PolkadotPrimitivesV4UpgradeRestriction, PolkadotPrimitivesV4ValidatorAppPublic, PolkadotPrimitivesVstagingSlashingPendingSlashes, PolkadotRuntimeCommonClaimsStatementKind, PolkadotRuntimeCommonCrowdloanFundInfo, PolkadotRuntimeCommonParasRegistrarParaInfo, PolkadotRuntimeParachainsConfigurationHostConfiguration, PolkadotRuntimeParachainsHrmpHrmpChannel, PolkadotRuntimeParachainsHrmpHrmpOpenChannelRequest, PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, PolkadotRuntimeParachainsInclusionAvailabilityBitfieldRecord, PolkadotRuntimeParachainsInclusionCandidatePendingAvailability, PolkadotRuntimeParachainsInitializerBufferedSessionChange, PolkadotRuntimeParachainsParasParaGenesisArgs, PolkadotRuntimeParachainsParasParaLifecycle, PolkadotRuntimeParachainsParasParaPastCodeMeta, PolkadotRuntimeParachainsParasPvfCheckActiveVoteState, PolkadotRuntimeParachainsSchedulerCoreAssignment, PolkadotRuntimeParachainsSchedulerParathreadClaimQueue, PolkadotRuntimeRuntimeHoldReason, PolkadotRuntimeSessionKeys, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails, SpWeightsWeightV2Weight, XcmVersionedAssetId, XcmVersionedMultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types'; import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>; export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -206,7 +206,10 @@ declare module '@polkadot/api-base/types/storage' {
/** /**
* Holds on account balances. * Holds on account balances.
**/ **/
holds: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<PalletBalancesIdAmount>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>; holds: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<{
readonly id: PolkadotRuntimeRuntimeHoldReason;
readonly amount: u128;
} & Struct>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/** /**
* The total units of outstanding deactivated balance in the system. * The total units of outstanding deactivated balance in the system.
**/ **/
@@ -581,22 +584,24 @@ declare module '@polkadot/api-base/types/storage' {
/** /**
* Number of eras to check per block. * Number of eras to check per block.
* *
* If set to 0, this pallet does absolutely nothing. * If set to 0, this pallet does absolutely nothing. Cannot be set to more than
* [`Config::MaxErasToCheckPerBlock`].
* *
* Based on the amount of weight available at `on_idle`, up to this many eras of a single * Based on the amount of weight available at [`Pallet::on_idle`], up to this many eras are
* nominator might be checked. * checked. The checking is represented by updating [`UnstakeRequest::checked`], which is
* stored in [`Head`].
**/ **/
erasToCheckPerBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>; erasToCheckPerBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* The current "head of the queue" being unstaked. * The current "head of the queue" being unstaked.
*
* The head in itself can be a batch of up to [`Config::BatchSize`] stakers.
**/ **/
head: AugmentedQuery<ApiType, () => Observable<Option<PalletFastUnstakeUnstakeRequest>>, []> & QueryableStorageEntry<ApiType, []>; head: AugmentedQuery<ApiType, () => Observable<Option<PalletFastUnstakeUnstakeRequest>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* The map of all accounts wishing to be unstaked. * The map of all accounts wishing to be unstaked.
* *
* Keeps track of `AccountId` wishing to unstake and it's corresponding deposit. * Keeps track of `AccountId` wishing to unstake and it's corresponding deposit.
*
* TWOX-NOTE: SAFE since `AccountId` is a secure hash.
**/ **/
queue: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>; queue: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/** /**
@@ -829,6 +834,24 @@ declare module '@polkadot/api-base/types/storage' {
**/ **/
[key: string]: QueryableStorageEntry<ApiType>; [key: string]: QueryableStorageEntry<ApiType>;
}; };
messageQueue: {
/**
* The index of the first and last (non-empty) pages.
**/
bookStateFor: AugmentedQuery<ApiType, (arg: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin | { Ump: any } | string | Uint8Array) => Observable<PalletMessageQueueBookState>, [PolkadotRuntimeParachainsInclusionAggregateMessageOrigin]> & QueryableStorageEntry<ApiType, [PolkadotRuntimeParachainsInclusionAggregateMessageOrigin]>;
/**
* The map of page indices to pages.
**/
pages: AugmentedQuery<ApiType, (arg1: PolkadotRuntimeParachainsInclusionAggregateMessageOrigin | { Ump: any } | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletMessageQueuePage>>, [PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, u32]> & QueryableStorageEntry<ApiType, [PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, u32]>;
/**
* The origin at which we should begin servicing.
**/
serviceHead: AugmentedQuery<ApiType, () => Observable<Option<PolkadotRuntimeParachainsInclusionAggregateMessageOrigin>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
multisig: { multisig: {
/** /**
* The set of open multisig operations. * The set of open multisig operations.
@@ -1268,7 +1291,7 @@ declare module '@polkadot/api-base/types/storage' {
/** /**
* Validators pending dispute slashes. * Validators pending dispute slashes.
**/ **/
unappliedSlashes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotRuntimeParachainsDisputesSlashingPendingSlashes>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>; unappliedSlashes: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: H256 | string | Uint8Array) => Observable<Option<PolkadotPrimitivesVstagingSlashingPendingSlashes>>, [u32, H256]> & QueryableStorageEntry<ApiType, [u32, H256]>;
/** /**
* `ValidatorSetCount` per session. * `ValidatorSetCount` per session.
**/ **/
@@ -1908,66 +1931,6 @@ declare module '@polkadot/api-base/types/storage' {
**/ **/
[key: string]: QueryableStorageEntry<ApiType>; [key: string]: QueryableStorageEntry<ApiType>;
}; };
ump: {
/**
* Counter for the related counted storage map
**/
counterForOverweight: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The ordered list of `ParaId`s that have a `RelayDispatchQueue` entry.
*
* Invariant:
* - The set of items from this vector should be exactly the set of the keys in
* `RelayDispatchQueues` and `RelayDispatchQueueSize`.
**/
needsDispatch: AugmentedQuery<ApiType, () => Observable<Vec<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* This is the para that gets will get dispatched first during the next upward dispatchable queue
* execution round.
*
* Invariant:
* - If `Some(para)`, then `para` must be present in `NeedsDispatch`.
**/
nextDispatchRoundStartWith: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The messages that exceeded max individual message weight budget.
*
* These messages stay there until manually dispatched.
**/
overweight: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[u32, Bytes]>>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
/**
* The number of overweight messages ever recorded in `Overweight` (and thus the lowest free
* index).
**/
overweightCount: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The messages waiting to be handled by the relay-chain originating from a certain parachain.
*
* Note that some upward messages might have been already processed by the inclusion logic. E.g.
* channel management messages.
*
* The messages are processed in FIFO order.
**/
relayDispatchQueues: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Size of the dispatch queues. Caches sizes of the queues in `RelayDispatchQueue`.
*
* First item in the tuple is the count of messages and second
* is the total length (in bytes) of the message payloads.
*
* Note that this is an auxiliary mapping: it's possible to tell the byte size and the number of
* messages only looking at `RelayDispatchQueues`. This mapping is separate to avoid the cost of
* loading the whole message queue if only the total size and count are required.
*
* Invariant:
* - The set of keys should exactly match the set of keys of `RelayDispatchQueues`.
**/
relayDispatchQueueSize: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[u32, u32]>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
vesting: { vesting: {
/** /**
* Storage version of the pallet. * Storage version of the pallet.
File diff suppressed because it is too large Load Diff
+101 -6
View File
@@ -6,10 +6,10 @@
import '@polkadot/api-base/types/consts'; import '@polkadot/api-base/types/consts';
import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types'; import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types';
import type { Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec, ITuple } from '@polkadot/types-codec/types'; import type { Codec, ITuple } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill, Perquintill } from '@polkadot/types/interfaces/runtime'; import type { Perbill, Percent, Permill, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, KitchensinkRuntimeHoldReason, PalletContractsSchedule, PalletReferendaTrackInfo, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight } from '@polkadot/types/lookup'; import type { FrameSupportPalletId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, PalletReferendaTrackInfo, SpVersionRuntimeVersion, SpWeightsRuntimeDbWeight, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>; export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
@@ -51,6 +51,40 @@ declare module '@polkadot/api-base/types/consts' {
**/ **/
[key: string]: Codec; [key: string]: Codec;
}; };
assetConversion: {
/**
* A setting to allow creating pools with both non-native assets.
**/
allowMultiAssetPools: bool & AugmentedConst<ApiType>;
/**
* A fee to withdraw the liquidity.
**/
liquidityWithdrawalFee: Permill & AugmentedConst<ApiType>;
/**
* A % the liquidity providers will take of every swap. Represents 10ths of a percent.
**/
lpFee: u32 & AugmentedConst<ApiType>;
/**
* The max number of hops in a swap.
**/
maxSwapPathLength: u32 & AugmentedConst<ApiType>;
/**
* The minimum LP token amount that could be minted. Ameliorates rounding errors.
**/
mintMinLiquidity: u128 & AugmentedConst<ApiType>;
/**
* The pallet's id, used for deriving its sovereign account ID.
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* A one-time fee to setup the pool.
**/
poolSetupFee: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
assets: { assets: {
/** /**
* The amount of funds that must be reserved when creating a new approval. * The amount of funds that must be reserved when creating a new approval.
@@ -692,6 +726,33 @@ declare module '@polkadot/api-base/types/consts' {
**/ **/
[key: string]: Codec; [key: string]: Codec;
}; };
nftFractionalization: {
/**
* The deposit paid by the user locking an NFT. The deposit is returned to the original NFT
* owner when the asset is unified and the NFT is unlocked.
**/
deposit: u128 & AugmentedConst<ApiType>;
/**
* The newly created asset's name.
**/
newAssetName: Bytes & AugmentedConst<ApiType>;
/**
* The newly created asset's symbol.
**/
newAssetSymbol: Bytes & AugmentedConst<ApiType>;
/**
* The pallet's id, used for deriving its sovereign account ID.
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* The maximum length of a name or symbol stored on-chain.
**/
stringLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
nfts: { nfts: {
/** /**
* The maximum approvals an item could have. * The maximum approvals an item could have.
@@ -767,10 +828,6 @@ declare module '@polkadot/api-base/types/consts' {
* Must be no greater than `MaxQueueLen`. * Must be no greater than `MaxQueueLen`.
**/ **/
fifoQueueLen: u32 & AugmentedConst<ApiType>; fifoQueueLen: u32 & AugmentedConst<ApiType>;
/**
* The identifier of the hold reason.
**/
holdReason: KitchensinkRuntimeHoldReason & AugmentedConst<ApiType>;
/** /**
* The number of blocks between consecutive attempts to dequeue bids and create receipts. * The number of blocks between consecutive attempts to dequeue bids and create receipts.
* *
@@ -847,6 +904,44 @@ declare module '@polkadot/api-base/types/consts' {
**/ **/
[key: string]: Codec; [key: string]: Codec;
}; };
poolAssets: {
/**
* The amount of funds that must be reserved when creating a new approval.
**/
approvalDeposit: u128 & AugmentedConst<ApiType>;
/**
* The amount of funds that must be reserved for a non-provider asset account to be
* maintained.
**/
assetAccountDeposit: u128 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved for an asset.
**/
assetDeposit: u128 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved when adding metadata to your asset.
**/
metadataDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The additional funds that must be reserved for the number of bytes you store in your
* metadata.
**/
metadataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* Max number of items to destroy per `destroy_accounts` and `destroy_approvals` call.
*
* Must be configured to result in a weight that makes each call fit in a block.
**/
removeItemsLimit: u32 & AugmentedConst<ApiType>;
/**
* The maximum length of a name or symbol stored on-chain.
**/
stringLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
proxy: { proxy: {
/** /**
* The base amount of currency needed to reserve for creating an announcement. * The base amount of currency needed to reserve for creating an announcement.
@@ -160,6 +160,106 @@ declare module '@polkadot/api-base/types/errors' {
**/ **/
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
}; };
assetConversion: {
/**
* Provided amount should be greater than or equal to the existential deposit/asset's
* minimal amount.
**/
AmountLessThanMinimal: AugmentedError<ApiType>;
/**
* Desired amount can't be equal to the pool reserve.
**/
AmountOutTooHigh: AugmentedError<ApiType>;
/**
* The minimal amount requirement for the first token in the pair wasn't met.
**/
AssetOneDepositDidNotMeetMinimum: AugmentedError<ApiType>;
/**
* The minimal amount requirement for the first token in the pair wasn't met.
**/
AssetOneWithdrawalDidNotMeetMinimum: AugmentedError<ApiType>;
/**
* The minimal amount requirement for the second token in the pair wasn't met.
**/
AssetTwoDepositDidNotMeetMinimum: AugmentedError<ApiType>;
/**
* The minimal amount requirement for the second token in the pair wasn't met.
**/
AssetTwoWithdrawalDidNotMeetMinimum: AugmentedError<ApiType>;
/**
* Provided assets are equal.
**/
EqualAssets: AugmentedError<ApiType>;
/**
* Insufficient liquidity in the pool.
**/
InsufficientLiquidity: AugmentedError<ApiType>;
/**
* Insufficient liquidity minted.
**/
InsufficientLiquidityMinted: AugmentedError<ApiType>;
/**
* The provided path must consists of 2 assets at least.
**/
InvalidPath: AugmentedError<ApiType>;
/**
* The provided path must consists of unique assets.
**/
NonUniquePath: AugmentedError<ApiType>;
/**
* Optimal calculated amount is less than desired.
**/
OptimalAmountLessThanDesired: AugmentedError<ApiType>;
/**
* An overflow happened.
**/
Overflow: AugmentedError<ApiType>;
/**
* It was not possible to calculate path data.
**/
PathError: AugmentedError<ApiType>;
/**
* Pool already exists.
**/
PoolExists: AugmentedError<ApiType>;
/**
* Only pools with native on one side are valid.
**/
PoolMustContainNativeCurrency: AugmentedError<ApiType>;
/**
* The pool doesn't exist.
**/
PoolNotFound: AugmentedError<ApiType>;
/**
* Provided maximum amount is not sufficient for swap.
**/
ProvidedMaximumNotSufficientForSwap: AugmentedError<ApiType>;
/**
* Calculated amount out is less than provided minimum amount.
**/
ProvidedMinimumNotSufficientForSwap: AugmentedError<ApiType>;
/**
* Reserve needs to always be greater than or equal to the existential deposit/asset's
* minimal amount.
**/
ReserveLeftLessThanMinimal: AugmentedError<ApiType>;
/**
* Desired amount can't be zero.
**/
WrongDesiredAmount: AugmentedError<ApiType>;
/**
* Amount can't be zero.
**/
ZeroAmount: AugmentedError<ApiType>;
/**
* Requested liquidity can't be zero.
**/
ZeroLiquidity: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
assetRate: { assetRate: {
/** /**
* The given asset ID already has an assigned conversion rate and cannot be re-created. * The given asset ID already has an assigned conversion rate and cannot be re-created.
@@ -469,12 +569,20 @@ declare module '@polkadot/api-base/types/errors' {
* of what is specified in the schedule. * of what is specified in the schedule.
**/ **/
MaxCallDepthReached: AugmentedError<ApiType>; MaxCallDepthReached: AugmentedError<ApiType>;
/**
* A pending migration needs to complete before the extrinsic can be called.
**/
MigrationInProgress: AugmentedError<ApiType>;
/** /**
* The chain does not provide a chain extension. Calling the chain extension results * The chain does not provide a chain extension. Calling the chain extension results
* in this error. Note that this usually shouldn't happen as deploying such contracts * in this error. Note that this usually shouldn't happen as deploying such contracts
* is rejected. * is rejected.
**/ **/
NoChainExtension: AugmentedError<ApiType>; NoChainExtension: AugmentedError<ApiType>;
/**
* Migrate dispatch call was attempted but no migration was performed.
**/
NoMigrationPerformed: AugmentedError<ApiType>;
/** /**
* A buffer outside of sandbox memory was passed to a contract API function. * A buffer outside of sandbox memory was passed to a contract API function.
**/ **/
@@ -1251,6 +1359,28 @@ declare module '@polkadot/api-base/types/errors' {
**/ **/
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
}; };
nftFractionalization: {
/**
* Asset ID does not correspond to locked NFT.
**/
IncorrectAssetId: AugmentedError<ApiType>;
/**
* NFT doesn't exist.
**/
NftNotFound: AugmentedError<ApiType>;
/**
* NFT has not yet been fractionalised.
**/
NftNotFractionalized: AugmentedError<ApiType>;
/**
* The signing account has no permission to do the operation.
**/
NoPermission: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
nfts: { nfts: {
/** /**
* The provided Item was already used for claiming. * The provided Item was already used for claiming.
@@ -1400,6 +1530,10 @@ declare module '@polkadot/api-base/types/errors' {
* Swap doesn't exist. * Swap doesn't exist.
**/ **/
UnknownSwap: AugmentedError<ApiType>; UnknownSwap: AugmentedError<ApiType>;
/**
* The witness data should be provided.
**/
WitnessRequired: AugmentedError<ApiType>;
/** /**
* The delegate turned out to be different to what was expected. * The delegate turned out to be different to what was expected.
**/ **/
@@ -1634,6 +1768,95 @@ declare module '@polkadot/api-base/types/errors' {
**/ **/
[key: string]: AugmentedError<ApiType>; [key: string]: AugmentedError<ApiType>;
}; };
poolAssets: {
/**
* The asset-account already exists.
**/
AlreadyExists: AugmentedError<ApiType>;
/**
* The asset is not live, and likely being destroyed.
**/
AssetNotLive: AugmentedError<ApiType>;
/**
* Invalid metadata given.
**/
BadMetadata: AugmentedError<ApiType>;
/**
* Invalid witness data given.
**/
BadWitness: AugmentedError<ApiType>;
/**
* Account balance must be greater than or equal to the transfer amount.
**/
BalanceLow: AugmentedError<ApiType>;
/**
* Callback action resulted in error
**/
CallbackFailed: AugmentedError<ApiType>;
/**
* The origin account is frozen.
**/
Frozen: AugmentedError<ApiType>;
/**
* The asset status is not the expected status.
**/
IncorrectStatus: AugmentedError<ApiType>;
/**
* The asset ID is already taken.
**/
InUse: AugmentedError<ApiType>;
/**
* The asset is a live asset and is actively being used. Usually emit for operations such
* as `start_destroy` which require the asset to be in a destroying state.
**/
LiveAsset: AugmentedError<ApiType>;
/**
* Minimum balance should be non-zero.
**/
MinBalanceZero: AugmentedError<ApiType>;
/**
* The account to alter does not exist.
**/
NoAccount: AugmentedError<ApiType>;
/**
* The asset-account doesn't have an associated deposit.
**/
NoDeposit: AugmentedError<ApiType>;
/**
* The signing account has no permission to do the operation.
**/
NoPermission: AugmentedError<ApiType>;
/**
* The asset should be frozen before the given operation.
**/
NotFrozen: AugmentedError<ApiType>;
/**
* No approval exists that would allow the transfer.
**/
Unapproved: AugmentedError<ApiType>;
/**
* Unable to increment the consumer reference counters on the account. Either no provider
* reference exists to allow a non-zero balance of a non-self-sufficient asset, or one
* fewer then the maximum number of consumers has been reached.
**/
UnavailableConsumer: AugmentedError<ApiType>;
/**
* The given asset ID is unknown.
**/
Unknown: AugmentedError<ApiType>;
/**
* The operation would result in funds being burned.
**/
WouldBurn: AugmentedError<ApiType>;
/**
* The source account would not survive the transfer and it needs to stay alive.
**/
WouldDie: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
preimage: { preimage: {
/** /**
* Preimage has already been noted on-chain. * Preimage has already been noted on-chain.
+160 -13
View File
@@ -8,8 +8,8 @@ import '@polkadot/api-base/types/events';
import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types'; import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types'; import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H256, Perbill, Perquintill } from '@polkadot/types/interfaces/runtime'; import type { AccountId32, H256, Perbill, Permill, Perquintill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, KitchensinkRuntimeProxyType, PalletAllianceCid, PalletAllianceUnscrupulousItem, PalletContractsOrigin, PalletConvictionVotingTally, PalletCoreFellowshipParamsType, PalletCoreFellowshipWish, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNftsAttributeNamespace, PalletNftsPalletAttributes, PalletNftsPriceWithDirection, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsPoolState, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PalletStateTrieMigrationError, PalletStateTrieMigrationMigrationCompute, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpStatementStoreStatement, SpWeightsWeightV2Weight } from '@polkadot/types/lookup'; import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, KitchensinkRuntimeProxyType, PalletAllianceCid, PalletAllianceUnscrupulousItem, PalletAssetConversionNativeOrAssetId, PalletContractsOrigin, PalletConvictionVotingTally, PalletCoreFellowshipParamsType, PalletCoreFellowshipWish, PalletDemocracyMetadataOwner, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletImOnlineSr25519AppSr25519Public, PalletMultisigTimepoint, PalletNftsAttributeNamespace, PalletNftsPalletAttributes, PalletNftsPriceWithDirection, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsPoolState, PalletRankedCollectiveTally, PalletRankedCollectiveVoteRecord, PalletStakingExposure, PalletStakingForcing, PalletStakingValidatorPrefs, PalletStateTrieMigrationError, PalletStateTrieMigrationMigrationCompute, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpStatementStoreStatement, SpWeightsWeightV2Weight } from '@polkadot/types/lookup';
export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>; export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;
@@ -109,6 +109,33 @@ declare module '@polkadot/api-base/types/events' {
**/ **/
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
}; };
assetConversion: {
/**
* A successful call of the `AddLiquidity` extrinsic will create this event.
**/
LiquidityAdded: AugmentedEvent<ApiType, [who: AccountId32, mintTo: AccountId32, poolId: ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]>, amount1Provided: u128, amount2Provided: u128, lpToken: u32, lpTokenMinted: u128], { who: AccountId32, mintTo: AccountId32, poolId: ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]>, amount1Provided: u128, amount2Provided: u128, lpToken: u32, lpTokenMinted: u128 }>;
/**
* A successful call of the `RemoveLiquidity` extrinsic will create this event.
**/
LiquidityRemoved: AugmentedEvent<ApiType, [who: AccountId32, withdrawTo: AccountId32, poolId: ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]>, amount1: u128, amount2: u128, lpToken: u32, lpTokenBurned: u128, withdrawalFee: Permill], { who: AccountId32, withdrawTo: AccountId32, poolId: ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]>, amount1: u128, amount2: u128, lpToken: u32, lpTokenBurned: u128, withdrawalFee: Permill }>;
/**
* A successful call of the `CretaPool` extrinsic will create this event.
**/
PoolCreated: AugmentedEvent<ApiType, [creator: AccountId32, poolId: ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]>, lpToken: u32], { creator: AccountId32, poolId: ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]>, lpToken: u32 }>;
/**
* Assets have been converted from one to another. Both `SwapExactTokenForToken`
* and `SwapTokenForExactToken` will generate this event.
**/
SwapExecuted: AugmentedEvent<ApiType, [who: AccountId32, sendTo: AccountId32, path: Vec<PalletAssetConversionNativeOrAssetId>, amountIn: u128, amountOut: u128], { who: AccountId32, sendTo: AccountId32, path: Vec<PalletAssetConversionNativeOrAssetId>, amountIn: u128, amountOut: u128 }>;
/**
* An amount has been transferred from one account to another.
**/
Transfer: AugmentedEvent<ApiType, [from: AccountId32, to: AccountId32, asset: PalletAssetConversionNativeOrAssetId, amount: u128], { from: AccountId32, to: AccountId32, asset: PalletAssetConversionNativeOrAssetId, amount: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
assetRate: { assetRate: {
AssetRateCreated: AugmentedEvent<ApiType, [assetId: u32, rate: u128], { assetId: u32, rate: u128 }>; AssetRateCreated: AugmentedEvent<ApiType, [assetId: u32, rate: u128], { assetId: u32, rate: u128 }>;
AssetRateRemoved: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>; AssetRateRemoved: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
@@ -151,6 +178,10 @@ declare module '@polkadot/api-base/types/events' {
* Some asset `asset_id` was thawed. * Some asset `asset_id` was thawed.
**/ **/
AssetThawed: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>; AssetThawed: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
/**
* Some account `who` was blocked.
**/
Blocked: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32], { assetId: u32, who: AccountId32 }>;
/** /**
* Some assets were destroyed. * Some assets were destroyed.
**/ **/
@@ -199,6 +230,10 @@ declare module '@polkadot/api-base/types/events' {
* Some account `who` was thawed. * Some account `who` was thawed.
**/ **/
Thawed: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32], { assetId: u32, who: AccountId32 }>; Thawed: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32], { assetId: u32, who: AccountId32 }>;
/**
* Some account `who` was created with a deposit from `depositor`.
**/
Touched: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32, depositor: AccountId32], { assetId: u32, who: AccountId32, depositor: AccountId32 }>;
/** /**
* Some assets were transferred. * Some assets were transferred.
**/ **/
@@ -711,15 +746,15 @@ declare module '@polkadot/api-base/types/events' {
}; };
glutton: { glutton: {
/** /**
* The computation limit has been updated by root. * The computation limit has been updated.
**/ **/
ComputationLimitSet: AugmentedEvent<ApiType, [compute: Perbill], { compute: Perbill }>; ComputationLimitSet: AugmentedEvent<ApiType, [compute: Perbill], { compute: Perbill }>;
/** /**
* The pallet has been (re)initialized by root. * The pallet has been (re)initialized.
**/ **/
PalletInitialized: AugmentedEvent<ApiType, [reinit: bool], { reinit: bool }>; PalletInitialized: AugmentedEvent<ApiType, [reinit: bool], { reinit: bool }>;
/** /**
* The storage limit has been updated by root. * The storage limit has been updated.
**/ **/
StorageLimitSet: AugmentedEvent<ApiType, [storage: Perbill], { storage: Perbill }>; StorageLimitSet: AugmentedEvent<ApiType, [storage: Perbill], { storage: Perbill }>;
/** /**
@@ -851,15 +886,10 @@ declare module '@polkadot/api-base/types/events' {
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
}; };
messageQueue: { messageQueue: {
/**
* Message discarded due to an inability to decode the item. Usually caused by state
* corruption.
**/
Discarded: AugmentedEvent<ApiType, [hash_: H256], { hash_: H256 }>;
/** /**
* Message placed in overweight queue. * Message placed in overweight queue.
**/ **/
OverweightEnqueued: AugmentedEvent<ApiType, [hash_: H256, origin: u32, pageIndex: u32, messageIndex: u32], { hash_: H256, origin: u32, pageIndex: u32, messageIndex: u32 }>; OverweightEnqueued: AugmentedEvent<ApiType, [id: U8aFixed, origin: u32, pageIndex: u32, messageIndex: u32], { id: U8aFixed, origin: u32, pageIndex: u32, messageIndex: u32 }>;
/** /**
* This page was reaped. * This page was reaped.
**/ **/
@@ -867,11 +897,11 @@ declare module '@polkadot/api-base/types/events' {
/** /**
* Message is processed. * Message is processed.
**/ **/
Processed: AugmentedEvent<ApiType, [hash_: H256, origin: u32, weightUsed: SpWeightsWeightV2Weight, success: bool], { hash_: H256, origin: u32, weightUsed: SpWeightsWeightV2Weight, success: bool }>; Processed: AugmentedEvent<ApiType, [id: U8aFixed, origin: u32, weightUsed: SpWeightsWeightV2Weight, success: bool], { id: U8aFixed, origin: u32, weightUsed: SpWeightsWeightV2Weight, success: bool }>;
/** /**
* Message discarded due to an error in the `MessageProcessor` (usually a format error). * Message discarded due to an error in the `MessageProcessor` (usually a format error).
**/ **/
ProcessingFailed: AugmentedEvent<ApiType, [hash_: H256, origin: u32, error: FrameSupportMessagesProcessMessageError], { hash_: H256, origin: u32, error: FrameSupportMessagesProcessMessageError }>; ProcessingFailed: AugmentedEvent<ApiType, [id: U8aFixed, origin: u32, error: FrameSupportMessagesProcessMessageError], { id: U8aFixed, origin: u32, error: FrameSupportMessagesProcessMessageError }>;
/** /**
* Generic event * Generic event
**/ **/
@@ -899,6 +929,20 @@ declare module '@polkadot/api-base/types/events' {
**/ **/
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
}; };
nftFractionalization: {
/**
* An NFT was successfully fractionalized.
**/
NftFractionalized: AugmentedEvent<ApiType, [nftCollection: u32, nft: u32, fractions: u128, asset: u32, beneficiary: AccountId32], { nftCollection: u32, nft: u32, fractions: u128, asset: u32, beneficiary: AccountId32 }>;
/**
* An NFT was successfully returned back.
**/
NftUnified: AugmentedEvent<ApiType, [nftCollection: u32, nft: u32, asset: u32, beneficiary: AccountId32], { nftCollection: u32, nft: u32, asset: u32, beneficiary: AccountId32 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
nfts: { nfts: {
/** /**
* All approvals of an item got cancelled. * All approvals of an item got cancelled.
@@ -1190,6 +1234,109 @@ declare module '@polkadot/api-base/types/events' {
**/ **/
[key: string]: AugmentedEvent<ApiType>; [key: string]: AugmentedEvent<ApiType>;
}; };
poolAssets: {
/**
* Accounts were destroyed for given asset.
**/
AccountsDestroyed: AugmentedEvent<ApiType, [assetId: u32, accountsDestroyed: u32, accountsRemaining: u32], { assetId: u32, accountsDestroyed: u32, accountsRemaining: u32 }>;
/**
* An approval for account `delegate` was cancelled by `owner`.
**/
ApprovalCancelled: AugmentedEvent<ApiType, [assetId: u32, owner: AccountId32, delegate: AccountId32], { assetId: u32, owner: AccountId32, delegate: AccountId32 }>;
/**
* Approvals were destroyed for given asset.
**/
ApprovalsDestroyed: AugmentedEvent<ApiType, [assetId: u32, approvalsDestroyed: u32, approvalsRemaining: u32], { assetId: u32, approvalsDestroyed: u32, approvalsRemaining: u32 }>;
/**
* (Additional) funds have been approved for transfer to a destination account.
**/
ApprovedTransfer: AugmentedEvent<ApiType, [assetId: u32, source: AccountId32, delegate: AccountId32, amount: u128], { assetId: u32, source: AccountId32, delegate: AccountId32, amount: u128 }>;
/**
* Some asset `asset_id` was frozen.
**/
AssetFrozen: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
/**
* The min_balance of an asset has been updated by the asset owner.
**/
AssetMinBalanceChanged: AugmentedEvent<ApiType, [assetId: u32, newMinBalance: u128], { assetId: u32, newMinBalance: u128 }>;
/**
* An asset has had its attributes changed by the `Force` origin.
**/
AssetStatusChanged: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
/**
* Some asset `asset_id` was thawed.
**/
AssetThawed: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
/**
* Some account `who` was blocked.
**/
Blocked: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32], { assetId: u32, who: AccountId32 }>;
/**
* Some assets were destroyed.
**/
Burned: AugmentedEvent<ApiType, [assetId: u32, owner: AccountId32, balance: u128], { assetId: u32, owner: AccountId32, balance: u128 }>;
/**
* Some asset class was created.
**/
Created: AugmentedEvent<ApiType, [assetId: u32, creator: AccountId32, owner: AccountId32], { assetId: u32, creator: AccountId32, owner: AccountId32 }>;
/**
* An asset class was destroyed.
**/
Destroyed: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
/**
* An asset class is in the process of being destroyed.
**/
DestructionStarted: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
/**
* Some asset class was force-created.
**/
ForceCreated: AugmentedEvent<ApiType, [assetId: u32, owner: AccountId32], { assetId: u32, owner: AccountId32 }>;
/**
* Some account `who` was frozen.
**/
Frozen: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32], { assetId: u32, who: AccountId32 }>;
/**
* Some assets were issued.
**/
Issued: AugmentedEvent<ApiType, [assetId: u32, owner: AccountId32, amount: u128], { assetId: u32, owner: AccountId32, amount: u128 }>;
/**
* Metadata has been cleared for an asset.
**/
MetadataCleared: AugmentedEvent<ApiType, [assetId: u32], { assetId: u32 }>;
/**
* New metadata has been set for an asset.
**/
MetadataSet: AugmentedEvent<ApiType, [assetId: u32, name: Bytes, symbol_: Bytes, decimals: u8, isFrozen: bool], { assetId: u32, name: Bytes, symbol: Bytes, decimals: u8, isFrozen: bool }>;
/**
* The owner changed.
**/
OwnerChanged: AugmentedEvent<ApiType, [assetId: u32, owner: AccountId32], { assetId: u32, owner: AccountId32 }>;
/**
* The management team changed.
**/
TeamChanged: AugmentedEvent<ApiType, [assetId: u32, issuer: AccountId32, admin: AccountId32, freezer: AccountId32], { assetId: u32, issuer: AccountId32, admin: AccountId32, freezer: AccountId32 }>;
/**
* Some account `who` was thawed.
**/
Thawed: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32], { assetId: u32, who: AccountId32 }>;
/**
* Some account `who` was created with a deposit from `depositor`.
**/
Touched: AugmentedEvent<ApiType, [assetId: u32, who: AccountId32, depositor: AccountId32], { assetId: u32, who: AccountId32, depositor: AccountId32 }>;
/**
* Some assets were transferred.
**/
Transferred: AugmentedEvent<ApiType, [assetId: u32, from: AccountId32, to: AccountId32, amount: u128], { assetId: u32, from: AccountId32, to: AccountId32, amount: u128 }>;
/**
* An `amount` was transferred in its entirety from `owner` to `destination` by
* the approved `delegate`.
**/
TransferredApproved: AugmentedEvent<ApiType, [assetId: u32, owner: AccountId32, delegate: AccountId32, destination: AccountId32, amount: u128], { assetId: u32, owner: AccountId32, delegate: AccountId32, destination: AccountId32, amount: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
pov: { pov: {
TestEvent: AugmentedEvent<ApiType, []>; TestEvent: AugmentedEvent<ApiType, []>;
/** /**
+60 -7
View File
@@ -10,7 +10,7 @@ import type { Data } from '@polkadot/types';
import type { BTreeSet, Bytes, Null, Option, Struct, U8aFixed, Vec, WrapperOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { BTreeSet, Bytes, Null, Option, Struct, U8aFixed, Vec, WrapperOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime'; import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KitchensinkRuntimeHoldReason, KitchensinkRuntimeSessionKeys, PalletAllianceCid, PalletAllianceMemberRole, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageContractInfo, PalletContractsStorageDeletionQueueManager, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletCoreFellowshipMemberStatus, PalletCoreFellowshipParamsType, PalletCoreFellowshipWish, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMessageQueueBookState, PalletMessageQueuePage, PalletMultisigMultisig, PalletNftsAttributeDeposit, PalletNftsAttributeNamespace, PalletNftsCollectionConfig, PalletNftsCollectionDetails, PalletNftsCollectionMetadata, PalletNftsItemConfig, PalletNftsItemDetails, PalletNftsItemMetadata, PalletNftsPendingSwap, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSalaryClaimantStatus, PalletSalaryStatusType, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata, PalletUniquesItemDetails, PalletUniquesItemMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup'; import type { FrameSupportDispatchPerDispatchClassWeight, FrameSupportPreimagesBounded, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, KitchensinkRuntimeRuntimeHoldReason, KitchensinkRuntimeSessionKeys, PalletAllianceCid, PalletAllianceMemberRole, PalletAssetConversionNativeOrAssetId, PalletAssetConversionPoolInfo, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesIdAmount, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageContractInfo, PalletContractsStorageDeletionQueueManager, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletCoreFellowshipMemberStatus, PalletCoreFellowshipParamsType, PalletCoreFellowshipWish, PalletDemocracyMetadataOwner, PalletDemocracyReferendumInfo, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletFastUnstakeUnstakeRequest, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMessageQueueBookState, PalletMessageQueuePage, PalletMultisigMultisig, PalletNftFractionalizationDetails, PalletNftsAttributeDeposit, PalletNftsAttributeNamespace, PalletNftsCollectionConfig, PalletNftsCollectionDetails, PalletNftsCollectionMetadata, PalletNftsItemConfig, PalletNftsItemDetails, PalletNftsItemMetadata, PalletNftsPendingSwap, PalletNisBid, PalletNisReceiptRecord, PalletNisSummaryRecord, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsClaimPermission, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSalaryClaimantStatus, PalletSalaryStatusType, PalletSchedulerScheduled, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata, PalletUniquesItemDetails, PalletUniquesItemMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types'; import type { Observable } from '@polkadot/types/types';
export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>; export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
@@ -85,6 +85,22 @@ declare module '@polkadot/api-base/types/storage' {
**/ **/
[key: string]: QueryableStorageEntry<ApiType>; [key: string]: QueryableStorageEntry<ApiType>;
}; };
assetConversion: {
/**
* Stores the `PoolAssetId` that is going to be used for the next lp token.
* This gets incremented whenever a new lp pool is created.
**/
nextPoolAssetId: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Map from `PoolAssetId` to `PoolInfo`. This establishes whether a pool has been officially
* created rather than people sending tokens directly to a pool's public account.
**/
pools: AugmentedQuery<ApiType, (arg: ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]> | [PalletAssetConversionNativeOrAssetId | { Native: any } | { Asset: any } | string | Uint8Array, PalletAssetConversionNativeOrAssetId | { Native: any } | { Asset: any } | string | Uint8Array]) => Observable<Option<PalletAssetConversionPoolInfo>>, [ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]>]> & QueryableStorageEntry<ApiType, [ITuple<[PalletAssetConversionNativeOrAssetId, PalletAssetConversionNativeOrAssetId]>]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
assetRate: { assetRate: {
/** /**
* Maps an asset to its fixed point representation in the native balance. * Maps an asset to its fixed point representation in the native balance.
@@ -294,7 +310,7 @@ declare module '@polkadot/api-base/types/storage' {
* Holds on account balances. * Holds on account balances.
**/ **/
holds: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<{ holds: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<{
readonly id: KitchensinkRuntimeHoldReason; readonly id: KitchensinkRuntimeRuntimeHoldReason;
readonly amount: u128; readonly amount: u128;
} & Struct>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>; } & Struct>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/** /**
@@ -391,6 +407,7 @@ declare module '@polkadot/api-base/types/storage' {
* and the latest deleted contract in queue. * and the latest deleted contract in queue.
**/ **/
deletionQueueCounter: AugmentedQuery<ApiType, () => Observable<PalletContractsStorageDeletionQueueManager>, []> & QueryableStorageEntry<ApiType, []>; deletionQueueCounter: AugmentedQuery<ApiType, () => Observable<PalletContractsStorageDeletionQueueManager>, []> & QueryableStorageEntry<ApiType, []>;
migrationInProgress: AugmentedQuery<ApiType, () => Observable<Option<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* This is a **monotonic** counter incremented on contract instantiation. * This is a **monotonic** counter incremented on contract instantiation.
* *
@@ -693,22 +710,24 @@ declare module '@polkadot/api-base/types/storage' {
/** /**
* Number of eras to check per block. * Number of eras to check per block.
* *
* If set to 0, this pallet does absolutely nothing. * If set to 0, this pallet does absolutely nothing. Cannot be set to more than
* [`Config::MaxErasToCheckPerBlock`].
* *
* Based on the amount of weight available at `on_idle`, up to this many eras of a single * Based on the amount of weight available at [`Pallet::on_idle`], up to this many eras are
* nominator might be checked. * checked. The checking is represented by updating [`UnstakeRequest::checked`], which is
* stored in [`Head`].
**/ **/
erasToCheckPerBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>; erasToCheckPerBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* The current "head of the queue" being unstaked. * The current "head of the queue" being unstaked.
*
* The head in itself can be a batch of up to [`Config::BatchSize`] stakers.
**/ **/
head: AugmentedQuery<ApiType, () => Observable<Option<PalletFastUnstakeUnstakeRequest>>, []> & QueryableStorageEntry<ApiType, []>; head: AugmentedQuery<ApiType, () => Observable<Option<PalletFastUnstakeUnstakeRequest>>, []> & QueryableStorageEntry<ApiType, []>;
/** /**
* The map of all accounts wishing to be unstaked. * The map of all accounts wishing to be unstaked.
* *
* Keeps track of `AccountId` wishing to unstake and it's corresponding deposit. * Keeps track of `AccountId` wishing to unstake and it's corresponding deposit.
*
* TWOX-NOTE: SAFE since `AccountId` is a secure hash.
**/ **/
queue: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>; queue: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/** /**
@@ -943,6 +962,16 @@ declare module '@polkadot/api-base/types/storage' {
**/ **/
[key: string]: QueryableStorageEntry<ApiType>; [key: string]: QueryableStorageEntry<ApiType>;
}; };
nftFractionalization: {
/**
* Keeps track of the corresponding NFT ID, asset ID and amount minted.
**/
nftToAsset: AugmentedQuery<ApiType, (arg: ITuple<[u32, u32]> | [u32 | AnyNumber | Uint8Array, u32 | AnyNumber | Uint8Array]) => Observable<Option<PalletNftFractionalizationDetails>>, [ITuple<[u32, u32]>]> & QueryableStorageEntry<ApiType, [ITuple<[u32, u32]>]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
nfts: { nfts: {
/** /**
* The items held by any given account; set out this way so that items owned by a single * The items held by any given account; set out this way so that items owned by a single
@@ -1157,6 +1186,30 @@ declare module '@polkadot/api-base/types/storage' {
**/ **/
[key: string]: QueryableStorageEntry<ApiType>; [key: string]: QueryableStorageEntry<ApiType>;
}; };
poolAssets: {
/**
* The holdings of a specific account for a specific asset.
**/
account: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<PalletAssetsAssetAccount>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
/**
* Approved balance transfers. First balance is the amount approved for transfer. Second
* is the amount of `T::Currency` reserved for storing this.
* First key is the asset ID, second key is the owner and third key is the delegate.
**/
approvals: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array, arg3: AccountId32 | string | Uint8Array) => Observable<Option<PalletAssetsApproval>>, [u32, AccountId32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32, AccountId32]>;
/**
* Details of an asset.
**/
asset: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletAssetsAssetDetails>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Metadata of an asset.
**/
metadata: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<PalletAssetsAssetMetadata>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
pov: { pov: {
/** /**
* A value with a MEL bound of 32 byte. * A value with a MEL bound of 32 byte.
File diff suppressed because it is too large Load Diff
+1
View File
@@ -7,6 +7,7 @@
}, },
"exclude": [ "exclude": [
"**/*.spec.ts", "**/*.spec.ts",
"**/mod.ts",
"**/kusama/*.ts", "**/kusama/*.ts",
"**/polkadot/*.ts" "**/polkadot/*.ts"
], ],
@@ -1,22 +0,0 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/kusama/*.spec.ts"
],
"references": [
{ "path": "../api-augment/tsconfig.build.json" },
{ "path": "../api-augment/tsconfig.kusama.json" },
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" },
{ "path": "../types-support/tsconfig.build.json" }
]
}
+5 -5
View File
@@ -18,13 +18,13 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@polkadot/rpc-core": "10.6.1", "@polkadot/rpc-core": "10.9.1",
"@polkadot/types": "10.6.1", "@polkadot/types": "10.9.1",
"@polkadot/util": "^12.1.2", "@polkadot/util": "^12.3.1",
"rxjs": "^7.8.1", "rxjs": "^7.8.1",
"tslib": "^2.5.0" "tslib": "^2.5.3"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.6.1' }; export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.9.1' };
+3
View File
@@ -5,6 +5,9 @@
"outDir": "./build", "outDir": "./build",
"rootDir": "./src" "rootDir": "./src"
}, },
"exclude": [
"**/mod.ts"
],
"references": [ "references": [
{ "path": "../rpc-core/tsconfig.build.json" }, { "path": "../rpc-core/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" } { "path": "../types/tsconfig.build.json" }
+11 -10
View File
@@ -18,20 +18,21 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@polkadot/api": "10.6.1", "@polkadot/api": "10.9.1",
"@polkadot/types": "10.6.1", "@polkadot/api-augment": "10.9.1",
"@polkadot/types-codec": "10.6.1", "@polkadot/types": "10.9.1",
"@polkadot/types-create": "10.6.1", "@polkadot/types-codec": "10.9.1",
"@polkadot/util": "^12.1.2", "@polkadot/types-create": "10.9.1",
"@polkadot/util-crypto": "^12.1.2", "@polkadot/util": "^12.3.1",
"@polkadot/util-crypto": "^12.3.1",
"rxjs": "^7.8.1", "rxjs": "^7.8.1",
"tslib": "^2.5.0" "tslib": "^2.5.3"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/api-augment": "10.6.1", "@polkadot/api-augment": "10.9.1",
"@polkadot/keyring": "^12.1.2" "@polkadot/keyring": "^12.3.1"
} }
} }
+3 -3
View File
@@ -101,7 +101,7 @@ describe('Abi', (): void => {
JSON.parse(fs.readFileSync(cmpFile, 'utf-8')) JSON.parse(fs.readFileSync(cmpFile, 'utf-8'))
); );
} catch (error) { } catch (error) {
if (process.env.GITHUB_REPOSITORY) { if (process.env['GITHUB_REPOSITORY']) {
console.error(registryJson); console.error(registryJson);
throw error; throw error;
@@ -114,8 +114,8 @@ describe('Abi', (): void => {
}); });
it('has the correct hash for the source', (): void => { it('has the correct hash for the source', (): void => {
const abi = new Abi(abis.ink_v0_flipperBundle); const abi = new Abi(abis['ink_v0_flipperBundle']);
const bundle = abis.ink_v0_flipperBundle as unknown as JSONAbi; const bundle = abis['ink_v0_flipperBundle'] as unknown as JSONAbi;
// manual // manual
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm)); expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
+64 -16
View File
@@ -2,16 +2,22 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { Bytes } from '@polkadot/types'; import type { Bytes } from '@polkadot/types';
import type { ChainProperties, ContractConstructorSpecLatest, ContractEventSpecLatest, ContractMessageParamSpecLatest, ContractMessageSpecLatest, ContractMetadata, ContractMetadataLatest, ContractProjectInfo } from '@polkadot/types/interfaces'; import type { ChainProperties, ContractConstructorSpecLatest, ContractEventSpecLatest, ContractMessageParamSpecLatest, ContractMessageSpecLatest, ContractMetadata, ContractMetadataLatest, ContractProjectInfo, ContractTypeSpec } from '@polkadot/types/interfaces';
import type { Codec, Registry } from '@polkadot/types/types'; import type { Codec, Registry, TypeDef } from '@polkadot/types/types';
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types.js'; import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types.js';
import { TypeRegistry } from '@polkadot/types'; import { Option, TypeRegistry } from '@polkadot/types';
import { TypeDefInfo } from '@polkadot/types-create'; import { TypeDefInfo } from '@polkadot/types-create';
import { assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util'; import { assertReturn, compactAddLength, compactStripLength, isBn, isNumber, isObject, isString, isUndefined, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
import { convertVersions, enumVersions } from './toLatest.js'; import { convertVersions, enumVersions } from './toLatest.js';
interface AbiJson {
version?: string;
[key: string]: unknown;
}
const l = logger('Abi'); const l = logger('Abi');
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance']; const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
@@ -26,12 +32,12 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`); return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
} }
function getLatestMeta (registry: Registry, json: Record<string, unknown>): ContractMetadataLatest { function getLatestMeta (registry: Registry, json: AbiJson): ContractMetadataLatest {
// this is for V1, V2, V3 // this is for V1, V2, V3
const vx = enumVersions.find((v) => isObject(json[v])); const vx = enumVersions.find((v) => isObject(json[v]));
// this was added in V4 // this was added in V4
const jsonVersion = json.version as string; const jsonVersion = json.version;
if (!vx && jsonVersion && !enumVersions.find((v) => v === `V${jsonVersion}`)) { if (!vx && jsonVersion && !enumVersions.find((v) => v === `V${jsonVersion}`)) {
throw new Error(`Unable to handle version ${jsonVersion}`); throw new Error(`Unable to handle version ${jsonVersion}`);
@@ -56,7 +62,7 @@ function getLatestMeta (registry: Registry, json: Record<string, unknown>): Cont
function parseJson (json: Record<string, unknown>, chainProperties?: ChainProperties): [Record<string, unknown>, Registry, ContractMetadataLatest, ContractProjectInfo] { function parseJson (json: Record<string, unknown>, chainProperties?: ChainProperties): [Record<string, unknown>, Registry, ContractMetadataLatest, ContractProjectInfo] {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
const info = registry.createType('ContractProjectInfo', json) as unknown as ContractProjectInfo; const info = registry.createType('ContractProjectInfo', json) as unknown as ContractProjectInfo;
const latest = getLatestMeta(registry, json); const latest = getLatestMeta(registry, json as unknown as AbiJson);
const lookup = registry.createType('PortableRegistry', { types: latest.types }, true); const lookup = registry.createType('PortableRegistry', { types: latest.types }, true);
// attach the lookup to the registry - now the types are known // attach the lookup to the registry - now the types are known
@@ -74,6 +80,22 @@ function parseJson (json: Record<string, unknown>, chainProperties?: ChainProper
return [json, registry, latest, info]; return [json, registry, latest, info];
} }
/**
* @internal
* Determines if the given input value is a ContractTypeSpec
*/
function isTypeSpec (value: Codec): value is ContractTypeSpec {
return !!value && value instanceof Map && !isUndefined((value as ContractTypeSpec).type) && !isUndefined((value as ContractTypeSpec).displayName);
}
/**
* @internal
* Determines if the given input value is an Option
*/
function isOption (value: Codec): value is Option<Codec> {
return !!value && value instanceof Option;
}
export class Abi { export class Abi {
readonly events: AbiEvent[]; readonly events: AbiEvent[];
readonly constructors: AbiConstructor[]; readonly constructors: AbiConstructor[];
@@ -82,6 +104,7 @@ export class Abi {
readonly messages: AbiMessage[]; readonly messages: AbiMessage[];
readonly metadata: ContractMetadataLatest; readonly metadata: ContractMetadataLatest;
readonly registry: Registry; readonly registry: Registry;
readonly environment: Map<string, TypeDef | Codec> = new Map();
constructor (abiJson: Record<string, unknown> | string, chainProperties?: ChainProperties) { constructor (abiJson: Record<string, unknown> | string, chainProperties?: ChainProperties) {
[this.json, this.registry, this.metadata, this.info] = parseJson( [this.json, this.registry, this.metadata, this.info] = parseJson(
@@ -93,23 +116,47 @@ export class Abi {
this.constructors = this.metadata.spec.constructors.map((spec: ContractConstructorSpecLatest, index) => this.constructors = this.metadata.spec.constructors.map((spec: ContractConstructorSpecLatest, index) =>
this.#createMessage(spec, index, { this.#createMessage(spec, index, {
isConstructor: true, isConstructor: true,
isPayable: spec.payable.isTrue isDefault: spec.default.isTrue,
isPayable: spec.payable.isTrue,
returnType: spec.returnType.isSome
? this.registry.lookup.getTypeDef(spec.returnType.unwrap().type)
: null
}) })
); );
this.events = this.metadata.spec.events.map((spec: ContractEventSpecLatest, index) => this.events = this.metadata.spec.events.map((spec: ContractEventSpecLatest, index) =>
this.#createEvent(spec, index) this.#createEvent(spec, index)
); );
this.messages = this.metadata.spec.messages.map((spec: ContractMessageSpecLatest, index): AbiMessage => { this.messages = this.metadata.spec.messages.map((spec: ContractMessageSpecLatest, index): AbiMessage =>
const typeSpec = spec.returnType.unwrapOr(null); this.#createMessage(spec, index, {
isDefault: spec.default.isTrue,
return this.#createMessage(spec, index, {
isMutating: spec.mutates.isTrue, isMutating: spec.mutates.isTrue,
isPayable: spec.payable.isTrue, isPayable: spec.payable.isTrue,
returnType: typeSpec returnType: spec.returnType.isSome
? this.registry.lookup.getTypeDef(typeSpec.type) ? this.registry.lookup.getTypeDef(spec.returnType.unwrap().type)
: null : null
}); })
}); );
// NOTE See the rationale for having Option<...> values in the actual
// ContractEnvironmentV4 structure definition in interfaces/contractsAbi
// (Due to conversions, the fields may not exist)
for (const [key, opt] of this.metadata.spec.environment.entries()) {
if (isOption(opt)) {
if (opt.isSome) {
const value = opt.unwrap();
if (isBn(value)) {
this.environment.set(key, value);
} else if (isTypeSpec(value)) {
this.environment.set(key, this.registry.lookup.getTypeDef(value.type));
} else {
throw new Error(`Invalid environment definition for ${key}:: Expected either Number or ContractTypeSpec`);
}
}
} else {
throw new Error(`Expected Option<*> definition for ${key} in ContractEnvironment`);
}
}
} }
/** /**
@@ -215,6 +262,7 @@ export class Abi {
}), }),
identifier, identifier,
index, index,
isDefault: spec.default.isTrue,
method: stringCamelCase(identifier), method: stringCamelCase(identifier),
path: identifier.split('::').map((s) => stringCamelCase(s)), path: identifier.split('::').map((s) => stringCamelCase(s)),
selector: spec.selector, selector: spec.selector,
@@ -10,7 +10,7 @@ import { v0ToLatest, v1ToLatest, v2ToLatest, v3ToLatest, v4ToLatest } from './to
describe('v0ToLatest', (): void => { describe('v0ToLatest', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V0: abis.ink_v0_erc20 }); const contract = registry.createType('ContractMetadata', { V0: abis['ink_v0_erc20'] });
const latest = v0ToLatest(registry, contract.asV0); const latest = v0ToLatest(registry, contract.asV0);
it('has the correct constructors', (): void => { it('has the correct constructors', (): void => {
@@ -52,7 +52,7 @@ describe('v0ToLatest', (): void => {
describe('v1ToLatest', (): void => { describe('v1ToLatest', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V1: abis.ink_v1_flipper.V1 }); const contract = registry.createType('ContractMetadata', { V1: abis['ink_v1_flipper']['V1'] });
const latest = v1ToLatest(registry, contract.asV1); const latest = v1ToLatest(registry, contract.asV1);
it('has the correct constructors', (): void => { it('has the correct constructors', (): void => {
@@ -68,7 +68,7 @@ describe('v1ToLatest', (): void => {
}); });
it('has the correct messages with namespaced method name', (): void => { it('has the correct messages with namespaced method name', (): void => {
const contract = registry.createType('ContractMetadata', { V1: abis.ink_v1_psp22.V1 }); const contract = registry.createType('ContractMetadata', { V1: abis['ink_v1_psp22']['V1'] });
const latest = v1ToLatest(registry, contract.asV1); const latest = v1ToLatest(registry, contract.asV1);
expect( expect(
@@ -87,7 +87,7 @@ describe('v1ToLatest', (): void => {
describe('v2ToLatest', (): void => { describe('v2ToLatest', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V2: abis.ink_v2_flipper.V2 }); const contract = registry.createType('ContractMetadata', { V2: abis['ink_v2_flipper']['V2'] });
const latest = v2ToLatest(registry, contract.asV2); const latest = v2ToLatest(registry, contract.asV2);
it('has the correct constructor flag', (): void => { it('has the correct constructor flag', (): void => {
@@ -99,7 +99,7 @@ describe('v2ToLatest', (): void => {
describe('v3ToLatest', (): void => { describe('v3ToLatest', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V3: abis.ink_v3_flipper.V3 }); const contract = registry.createType('ContractMetadata', { V3: abis['ink_v3_flipper']['V3'] });
const latest = v3ToLatest(registry, contract.asV3); const latest = v3ToLatest(registry, contract.asV3);
it('has the correct constructor flags', (): void => { it('has the correct constructor flags', (): void => {
@@ -112,7 +112,7 @@ describe('v3ToLatest', (): void => {
}); });
it('has the correct messages', (): void => { it('has the correct messages', (): void => {
const contract = registry.createType('ContractMetadata', { V3: abis.ink_v3_traitErc20.V3 }); const contract = registry.createType('ContractMetadata', { V3: abis['ink_v3_traitErc20']['V3'] });
const latest = v3ToLatest(registry, contract.asV3); const latest = v3ToLatest(registry, contract.asV3);
expect( expect(
@@ -125,7 +125,7 @@ describe('v3ToLatest', (): void => {
describe('v4ToLatest', (): void => { describe('v4ToLatest', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V4: abis.ink_v4_flipperContract }); const contract = registry.createType('ContractMetadata', { V4: abis['ink_v4_flipperContract'] });
const latest = v4ToLatest(registry, contract.asV4); const latest = v4ToLatest(registry, contract.asV4);
it('has the correct constructor flags', (): void => { it('has the correct constructor flags', (): void => {
+13 -2
View File
@@ -4,6 +4,17 @@
import type { ContractMetadataV3, ContractMetadataV4 } from '@polkadot/types/interfaces'; import type { ContractMetadataV3, ContractMetadataV4 } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types'; import type { Registry } from '@polkadot/types/types';
export function v3ToV4 (_registry: Registry, v3: ContractMetadataV3): ContractMetadataV4 { import { objectSpread } from '@polkadot/util';
return v3;
export function v3ToV4 (registry: Registry, v3: ContractMetadataV3): ContractMetadataV4 {
return registry.createType('ContractMetadataV4', objectSpread({}, v3, {
spec: objectSpread({}, v3.spec, {
constructors: v3.spec.constructors.map((c) =>
registry.createType('ContractConstructorSpecV4', objectSpread({}, c))
),
messages: v3.spec.messages.map((m) =>
registry.createType('ContractMessageSpecV3', objectSpread({}, m))
)
})
}));
} }
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2023 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/api-augment';
+1 -1
View File
@@ -97,7 +97,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
: convertWeight( : convertWeight(
this.api.consts.system.blockWeights this.api.consts.system.blockWeights
? (this.api.consts.system.blockWeights as unknown as { maxBlock: WeightV2 }).maxBlock ? (this.api.consts.system.blockWeights as unknown as { maxBlock: WeightV2 }).maxBlock
: this.api.consts.system.maximumBlockWeight as Weight : this.api.consts.system['maximumBlockWeight'] as Weight
).v1Weight.muln(64).div(BN_HUNDRED) ).v1Weight.muln(64).div(BN_HUNDRED)
); );
}; };
@@ -5,7 +5,7 @@
import '@polkadot/api-augment'; import '@polkadot/api-augment';
import type { TestKeyringMap } from '@polkadot/keyring/testingPairs'; import type { TestKeyringMapSubstrate } from '@polkadot/keyring/testingPairs';
import { ApiPromise } from '@polkadot/api'; import { ApiPromise } from '@polkadot/api';
import { BlueprintPromise, ContractPromise } from '@polkadot/api-contract'; import { BlueprintPromise, ContractPromise } from '@polkadot/api-contract';
@@ -13,21 +13,21 @@ import { createTestPairs } from '@polkadot/keyring/testingPairs';
import abiIncrementer from './test/contracts/ink/v0/incrementer.json' assert { type: 'json' }; import abiIncrementer from './test/contracts/ink/v0/incrementer.json' assert { type: 'json' };
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<void> { async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
const blueprint = new BlueprintPromise(api, abiIncrementer as Record<string, unknown>, '0x1234'); const blueprint = new BlueprintPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
await blueprint.tx.new({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob); await blueprint.tx['new']({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob);
await blueprint.tx.new({ gasLimit: 456, value: 123 }, 42).signAndSend(pairs.bob); await blueprint.tx['new']({ gasLimit: 456, value: 123 }, 42).signAndSend(pairs.bob);
} }
async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise<void> { async function checkContract (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
const contract = new ContractPromise(api, abiIncrementer as Record<string, unknown>, '0x1234'); const contract = new ContractPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
// queries // queries
await contract.query.get(pairs.alice.address, {}); await contract.query['get'](pairs.alice.address, {});
// execute // execute
await contract.tx.inc({ gasLimit: 1234 }, 123).signAndSend(pairs.eve); await contract.tx['inc']({ gasLimit: 1234 }, 123).signAndSend(pairs.eve);
} }
async function main (): Promise<void> { async function main (): Promise<void> {
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.6.1' }; export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.9.1' };
@@ -5,5 +5,151 @@
"type": "bool", "type": "bool",
"docs": [], "docs": [],
"namespace": "" "namespace": ""
},
{
"info": "Result",
"lookupIndex": 1,
"type": "Result<Null, InkPrimitivesLangError>",
"docs": [],
"namespace": "Result",
"sub": [
{
"name": "Ok",
"info": "Null",
"lookupIndex": 2,
"type": "Null",
"docs": [],
"namespace": ""
},
{
"name": "Error",
"docs": [],
"info": "Si",
"lookupIndex": 3,
"lookupName": "InkPrimitivesLangError",
"type": "Lookup3"
}
]
},
{
"info": "Null",
"lookupIndex": 2,
"type": "Null",
"docs": [],
"namespace": ""
},
{
"info": "Enum",
"lookupIndex": 3,
"lookupName": "InkPrimitivesLangError",
"type": "{\"_enum\":[\"__Unused0\",\"CouldNotReadInput\"]}",
"docs": [],
"namespace": "ink_primitives::LangError",
"sub": [
{
"index": 0,
"info": "Null",
"name": "__Unused0",
"type": "Null"
},
{
"info": "Null",
"type": "Null",
"index": 1,
"name": "CouldNotReadInput"
}
]
},
{
"info": "Result",
"lookupIndex": 4,
"type": "Result<bool, InkPrimitivesLangError>",
"docs": [],
"namespace": "Result",
"sub": [
{
"name": "Ok",
"info": "Plain",
"lookupIndex": 0,
"type": "bool",
"docs": [],
"namespace": ""
},
{
"name": "Error",
"docs": [],
"info": "Si",
"lookupIndex": 3,
"lookupName": "InkPrimitivesLangError",
"type": "Lookup3"
}
]
},
{
"info": "Plain",
"lookupIndex": 5,
"type": "AccountId",
"docs": [],
"namespace": "ink_primitives::types::AccountId",
"lookupNameRoot": "InkPrimitivesAccountId"
},
{
"info": "VecFixed",
"lookupIndex": 6,
"type": "[u8;32]",
"docs": [],
"namespace": "",
"length": 32,
"sub": {
"info": "Plain",
"lookupIndex": 7,
"type": "u8",
"docs": [],
"namespace": ""
}
},
{
"info": "Plain",
"lookupIndex": 7,
"type": "u8",
"docs": [],
"namespace": ""
},
{
"info": "Plain",
"lookupIndex": 8,
"type": "u128",
"docs": [],
"namespace": ""
},
{
"info": "Plain",
"lookupIndex": 9,
"type": "Hash",
"docs": [],
"namespace": "ink_primitives::types::Hash",
"lookupNameRoot": "InkPrimitivesHash"
},
{
"info": "Plain",
"lookupIndex": 10,
"type": "u64",
"docs": [],
"namespace": ""
},
{
"info": "Plain",
"lookupIndex": 11,
"type": "u32",
"docs": [],
"namespace": ""
},
{
"info": "Plain",
"lookupIndex": 12,
"type": "NoChainExtension",
"docs": [],
"namespace": "ink_env::types::NoChainExtension",
"lookupNameRoot": "InkEnvNoChainExtension"
} }
] ]
@@ -5,5 +5,151 @@
"type": "bool", "type": "bool",
"docs": [], "docs": [],
"namespace": "" "namespace": ""
},
{
"info": "Result",
"lookupIndex": 1,
"type": "Result<Null, InkPrimitivesLangError>",
"docs": [],
"namespace": "Result",
"sub": [
{
"name": "Ok",
"info": "Null",
"lookupIndex": 2,
"type": "Null",
"docs": [],
"namespace": ""
},
{
"name": "Error",
"docs": [],
"info": "Si",
"lookupIndex": 3,
"lookupName": "InkPrimitivesLangError",
"type": "Lookup3"
}
]
},
{
"info": "Null",
"lookupIndex": 2,
"type": "Null",
"docs": [],
"namespace": ""
},
{
"info": "Enum",
"lookupIndex": 3,
"lookupName": "InkPrimitivesLangError",
"type": "{\"_enum\":[\"__Unused0\",\"CouldNotReadInput\"]}",
"docs": [],
"namespace": "ink_primitives::LangError",
"sub": [
{
"index": 0,
"info": "Null",
"name": "__Unused0",
"type": "Null"
},
{
"info": "Null",
"type": "Null",
"index": 1,
"name": "CouldNotReadInput"
}
]
},
{
"info": "Result",
"lookupIndex": 4,
"type": "Result<bool, InkPrimitivesLangError>",
"docs": [],
"namespace": "Result",
"sub": [
{
"name": "Ok",
"info": "Plain",
"lookupIndex": 0,
"type": "bool",
"docs": [],
"namespace": ""
},
{
"name": "Error",
"docs": [],
"info": "Si",
"lookupIndex": 3,
"lookupName": "InkPrimitivesLangError",
"type": "Lookup3"
}
]
},
{
"info": "Plain",
"lookupIndex": 5,
"type": "AccountId",
"docs": [],
"namespace": "ink_primitives::types::AccountId",
"lookupNameRoot": "InkPrimitivesAccountId"
},
{
"info": "VecFixed",
"lookupIndex": 6,
"type": "[u8;32]",
"docs": [],
"namespace": "",
"length": 32,
"sub": {
"info": "Plain",
"lookupIndex": 7,
"type": "u8",
"docs": [],
"namespace": ""
}
},
{
"info": "Plain",
"lookupIndex": 7,
"type": "u8",
"docs": [],
"namespace": ""
},
{
"info": "Plain",
"lookupIndex": 8,
"type": "u128",
"docs": [],
"namespace": ""
},
{
"info": "Plain",
"lookupIndex": 9,
"type": "Hash",
"docs": [],
"namespace": "ink_primitives::types::Hash",
"lookupNameRoot": "InkPrimitivesHash"
},
{
"info": "Plain",
"lookupIndex": 10,
"type": "u64",
"docs": [],
"namespace": ""
},
{
"info": "Plain",
"lookupIndex": 11,
"type": "u32",
"docs": [],
"namespace": ""
},
{
"info": "Plain",
"lookupIndex": 12,
"type": "NoChainExtension",
"docs": [],
"namespace": "ink_env::types::NoChainExtension",
"lookupNameRoot": "InkEnvNoChainExtension"
} }
] ]
@@ -7,10 +7,14 @@ import user from './user/index.js';
const all: Record<string, Record<string, unknown>> = {}; const all: Record<string, Record<string, unknown>> = {};
Object.entries({ ink, solang, user }).forEach(([type, abis]) => Object
Object.entries(abis).forEach(([name, abi]): void => { .entries({ ink, solang, user })
all[`${type}_${name}`] = abi; .forEach(([type, abis]) =>
}) Object
); .entries(abis)
.forEach(([name, abi]): void => {
all[`${type}_${name}`] = abi;
})
);
export default all; export default all;
File diff suppressed because one or more lines are too long
@@ -1,12 +1,21 @@
{ {
"source": { "source": {
"hash": "0xf051c631190ac47f82e280ba763df932210f6e2447978e24cbe0dcc6d6903c7a", "hash": "0xa5b19cb655755feba8e34ab5b413ac6593ecc7e24e19af485a4d30036be9d577",
"language": "ink! 4.0.0-alpha.1", "language": "ink! 4.2.0",
"compiler": "rustc 1.63.0" "compiler": "rustc 1.69.0",
"build_info": {
"build_mode": "Debug",
"cargo_contract_version": "2.2.1",
"rust_toolchain": "stable-x86_64-apple-darwin",
"wasm_opt_settings": {
"keep_debug_symbols": false,
"optimization_passes": "Z"
}
}
}, },
"contract": { "contract": {
"name": "flipper", "name": "flipper",
"version": "4.0.0-alpha.1", "version": "4.2.0",
"authors": [ "authors": [
"Parity Technologies <admin@parity.io>" "Parity Technologies <admin@parity.io>"
] ]
@@ -25,39 +34,109 @@
} }
} }
], ],
"default": false,
"docs": [ "docs": [
"Creates a new flipper smart contract initialized with the given value." "Creates a new flipper smart contract initialized with the given value."
], ],
"label": "new", "label": "new",
"payable": false, "payable": false,
"returnType": {
"displayName": [
"ink_primitives",
"ConstructorResult"
],
"type": 1
},
"selector": "0x9bae9d5e" "selector": "0x9bae9d5e"
}, },
{ {
"args": [], "args": [],
"default": false,
"docs": [ "docs": [
"Creates a new flipper smart contract initialized to `false`." "Creates a new flipper smart contract initialized to `false`."
], ],
"label": "default", "label": "new_default",
"payable": false, "payable": false,
"selector": "0xed4b9d1b" "returnType": {
"displayName": [
"ink_primitives",
"ConstructorResult"
],
"type": 1
},
"selector": "0x61ef7e3e"
} }
], ],
"docs": [], "docs": [],
"environment": {
"accountId": {
"displayName": [
"AccountId"
],
"type": 5
},
"balance": {
"displayName": [
"Balance"
],
"type": 8
},
"blockNumber": {
"displayName": [
"BlockNumber"
],
"type": 11
},
"chainExtension": {
"displayName": [
"ChainExtension"
],
"type": 12
},
"hash": {
"displayName": [
"Hash"
],
"type": 9
},
"maxEventTopics": 4,
"timestamp": {
"displayName": [
"Timestamp"
],
"type": 10
}
},
"events": [], "events": [],
"lang_error": {
"displayName": [
"ink",
"LangError"
],
"type": 3
},
"messages": [ "messages": [
{ {
"args": [], "args": [],
"default": false,
"docs": [ "docs": [
" Flips the current value of the Flipper's boolean." " Flips the current value of the Flipper's boolean."
], ],
"label": "flip", "label": "flip",
"mutates": true, "mutates": true,
"payable": false, "payable": false,
"returnType": null, "returnType": {
"displayName": [
"ink",
"MessageResult"
],
"type": 1
},
"selector": "0x633aa551" "selector": "0x633aa551"
}, },
{ {
"args": [], "args": [],
"default": false,
"docs": [ "docs": [
" Returns the current value of the Flipper's boolean." " Returns the current value of the Flipper's boolean."
], ],
@@ -66,27 +145,34 @@
"payable": false, "payable": false,
"returnType": { "returnType": {
"displayName": [ "displayName": [
"bool" "ink",
"MessageResult"
], ],
"type": 0 "type": 4
}, },
"selector": "0x2f865bd9" "selector": "0x2f865bd9"
} }
] ]
}, },
"storage": { "storage": {
"struct": { "root": {
"fields": [ "layout": {
{ "struct": {
"layout": { "fields": [
"cell": { {
"key": "0x0000000000000000000000000000000000000000000000000000000000000000", "layout": {
"ty": 0 "leaf": {
"key": "0x00000000",
"ty": 0
}
},
"name": "value"
} }
}, ],
"name": "value" "name": "Flipper"
} }
] },
"root_key": "0x00000000"
} }
}, },
"types": [ "types": [
@@ -97,6 +183,213 @@
"primitive": "bool" "primitive": "bool"
} }
} }
},
{
"id": 1,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 2
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 3
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 2
},
{
"name": "E",
"type": 3
}
],
"path": [
"Result"
]
}
},
{
"id": 2,
"type": {
"def": {
"tuple": []
}
}
},
{
"id": 3,
"type": {
"def": {
"variant": {
"variants": [
{
"index": 1,
"name": "CouldNotReadInput"
}
]
}
},
"path": [
"ink_primitives",
"LangError"
]
}
},
{
"id": 4,
"type": {
"def": {
"variant": {
"variants": [
{
"fields": [
{
"type": 0
}
],
"index": 0,
"name": "Ok"
},
{
"fields": [
{
"type": 3
}
],
"index": 1,
"name": "Err"
}
]
}
},
"params": [
{
"name": "T",
"type": 0
},
{
"name": "E",
"type": 3
}
],
"path": [
"Result"
]
}
},
{
"id": 5,
"type": {
"def": {
"composite": {
"fields": [
{
"type": 6,
"typeName": "[u8; 32]"
}
]
}
},
"path": [
"ink_primitives",
"types",
"AccountId"
]
}
},
{
"id": 6,
"type": {
"def": {
"array": {
"len": 32,
"type": 7
}
}
}
},
{
"id": 7,
"type": {
"def": {
"primitive": "u8"
}
}
},
{
"id": 8,
"type": {
"def": {
"primitive": "u128"
}
}
},
{
"id": 9,
"type": {
"def": {
"composite": {
"fields": [
{
"type": 6,
"typeName": "[u8; 32]"
}
]
}
},
"path": [
"ink_primitives",
"types",
"Hash"
]
}
},
{
"id": 10,
"type": {
"def": {
"primitive": "u64"
}
}
},
{
"id": 11,
"type": {
"def": {
"primitive": "u32"
}
}
},
{
"id": 12,
"type": {
"def": {
"variant": {}
},
"path": [
"ink_env",
"types",
"NoChainExtension"
]
}
} }
], ],
"version": "4" "version": "4"
+1
View File
@@ -37,6 +37,7 @@ export interface AbiMessage {
identifier: string; identifier: string;
index: number; index: number;
isConstructor?: boolean; isConstructor?: boolean;
isDefault?: boolean;
isMutating?: boolean; isMutating?: boolean;
isPayable?: boolean; isPayable?: boolean;
method: string; method: string;
+4 -4
View File
@@ -6,15 +6,15 @@
"rootDir": "./src" "rootDir": "./src"
}, },
"exclude": [ "exclude": [
"**/test/**/*.json", "**/test/**/*",
"**/test/**/*.ts",
"**/test/**/*.wasm",
"**/checkTypes.manual.ts",
"**/*.spec.ts", "**/*.spec.ts",
"**/checkTypes.manual.ts",
"**/mod.ts",
"mock.ts" "mock.ts"
], ],
"references": [ "references": [
{ "path": "../api/tsconfig.build.json" }, { "path": "../api/tsconfig.build.json" },
{ "path": "../api-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" },
{ "path": "../types-codec/tsconfig.build.json" }, { "path": "../types-codec/tsconfig.build.json" },
{ "path": "../types-create/tsconfig.build.json" } { "path": "../types-create/tsconfig.build.json" }
+15 -15
View File
@@ -18,25 +18,25 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@polkadot/api": "10.6.1", "@polkadot/api": "10.9.1",
"@polkadot/api-augment": "10.6.1", "@polkadot/api-augment": "10.9.1",
"@polkadot/api-base": "10.6.1", "@polkadot/api-base": "10.9.1",
"@polkadot/rpc-core": "10.6.1", "@polkadot/rpc-core": "10.9.1",
"@polkadot/types": "10.6.1", "@polkadot/types": "10.9.1",
"@polkadot/types-codec": "10.6.1", "@polkadot/types-codec": "10.9.1",
"@polkadot/util": "^12.1.2", "@polkadot/util": "^12.3.1",
"@polkadot/util-crypto": "^12.1.2", "@polkadot/util-crypto": "^12.3.1",
"rxjs": "^7.8.1", "rxjs": "^7.8.1",
"tslib": "^2.5.0" "tslib": "^2.5.3"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/api": "10.6.1", "@polkadot/api": "10.9.1",
"@polkadot/api-augment": "10.6.1", "@polkadot/api-augment": "10.9.1",
"@polkadot/rpc-augment": "10.6.1", "@polkadot/rpc-augment": "10.9.1",
"@polkadot/rpc-provider": "10.6.1", "@polkadot/rpc-provider": "10.9.1",
"@polkadot/types-support": "10.6.1" "@polkadot/types-support": "10.9.1"
} }
} }
+1 -1
View File
@@ -39,7 +39,7 @@ export function _flags (instanceId: string, api: DeriveApi): () => Observable<Fl
return memo(instanceId, (): Observable<FlagsIntermediate> => { return memo(instanceId, (): Observable<FlagsIntermediate> => {
const results: unknown[] = [undefined, [], [], [], undefined]; const results: unknown[] = [undefined, [], [], [], undefined];
const calls = [ const calls = [
(api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections)?.members, (api.query.elections || api.query['phragmenElection'] || api.query['electionsPhragmen'])?.members,
api.query.council?.members, api.query.council?.members,
api.query.technicalCommittee?.members, api.query.technicalCommittee?.members,
api.query.society?.members, api.query.society?.members,
+3 -3
View File
@@ -15,13 +15,13 @@ import { memo } from '../util/index.js';
function retrieveNick (api: DeriveApi, accountId?: AccountId): Observable<string | undefined> { function retrieveNick (api: DeriveApi, accountId?: AccountId): Observable<string | undefined> {
return (( return ((
accountId && api.query.nicks?.nameOf accountId && api.query['nicks']?.['nameOf']
? api.query.nicks.nameOf(accountId) ? api.query['nicks']['nameOf'](accountId)
: of(undefined) : of(undefined)
) as Observable<Option<ITuple<[Bytes, Balance]>> | undefined>).pipe( ) as Observable<Option<ITuple<[Bytes, Balance]>> | undefined>).pipe(
map((nameOf): string | undefined => map((nameOf): string | undefined =>
nameOf?.isSome nameOf?.isSome
? u8aToString(nameOf.unwrap()[0]).substring(0, (api.consts.nicks.maxLength as u32).toNumber()) ? u8aToString(nameOf.unwrap()[0]).substring(0, (api.consts['nicks']['maxLength'] as u32).toNumber())
: undefined : undefined
) )
); );
+5 -7
View File
@@ -1,16 +1,14 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors // Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import type { QueryableStorage } from '@polkadot/api-base/types';
import type { DeriveApi } from '../types.js'; import type { DeriveApi } from '../types.js';
export function getQueryInterface (api: DeriveApi): QueryableStorage<'rxjs'>['voterBagsList'] { export function getQueryInterface (api: DeriveApi): DeriveApi['query']['voterList'] {
return ( return (
// latest substrate (latest always first) // latest substrate & polkadot
api.query.voterBagsList || api.query.voterList ||
// previous substrate // previous substrate
api.query.bagsList || api.query['voterBagsList'] ||
// latest polkadot api.query['bagsList']
api.query.voterList
); );
} }
+8 -8
View File
@@ -50,9 +50,9 @@ function calcBalances (api: DeriveApi, [accountId, [accountNonce, [primary, ...a
// old // old
function queryBalancesFree (api: DeriveApi, accountId: AccountId): Observable<Result> { function queryBalancesFree (api: DeriveApi, accountId: AccountId): Observable<Result> {
return combineLatest([ return combineLatest([
api.query.balances.freeBalance<Balance>(accountId), api.query.balances['freeBalance']<Balance>(accountId),
api.query.balances.reservedBalance<Balance>(accountId), api.query.balances['reservedBalance']<Balance>(accountId),
api.query.system.accountNonce<Index>(accountId) api.query.system['accountNonce']<Index>(accountId)
]).pipe( ]).pipe(
map(([freeBalance, reservedBalance, accountNonce]): Result => [ map(([freeBalance, reservedBalance, accountNonce]): Result => [
accountNonce, accountNonce,
@@ -71,8 +71,8 @@ function queryNonceOnly (api: DeriveApi, accountId: AccountId): Observable<Resul
? api.query.system.account(accountId).pipe( ? api.query.system.account(accountId).pipe(
map(({ nonce }) => fill(nonce)) map(({ nonce }) => fill(nonce))
) )
: isFunction(api.query.system.accountNonce) : isFunction(api.query.system['accountNonce'])
? api.query.system.accountNonce<Index>(accountId).pipe( ? api.query.system['accountNonce']<Index>(accountId).pipe(
map((nonce) => fill(nonce)) map((nonce) => fill(nonce))
) )
: of(fill(api.registry.createType('Index'))); : of(fill(api.registry.createType('Index')));
@@ -80,7 +80,7 @@ function queryNonceOnly (api: DeriveApi, accountId: AccountId): Observable<Resul
function queryBalancesAccount (api: DeriveApi, accountId: AccountId, modules: string[] = ['balances']): Observable<Result> { function queryBalancesAccount (api: DeriveApi, accountId: AccountId, modules: string[] = ['balances']): Observable<Result> {
const balances = modules const balances = modules
.map((m): QueryableStorageEntry<'rxjs'> => (api.derive as DeriveCustomAccount)[m]?.customAccount || api.query[m]?.account) .map((m): QueryableStorageEntry<'rxjs'> => (api.derive as DeriveCustomAccount)[m]?.customAccount || api.query[m as 'balances']?.account)
.filter((q) => isFunction(q)); .filter((q) => isFunction(q));
const extract = (nonce: Index, data: AccountData[]): Result => [ const extract = (nonce: Index, data: AccountData[]): Result => [
@@ -98,7 +98,7 @@ function queryBalancesAccount (api: DeriveApi, accountId: AccountId, modules: st
map(([{ nonce }, ...balances]) => extract(nonce, balances as unknown as AccountData[])) map(([{ nonce }, ...balances]) => extract(nonce, balances as unknown as AccountData[]))
) )
: combineLatest([ : combineLatest([
api.query.system.accountNonce<Index>(accountId), api.query.system['accountNonce']<Index>(accountId),
...balances.map((c) => c(accountId)) ...balances.map((c) => c(accountId))
]).pipe( ]).pipe(
map(([nonce, ...balances]) => extract(nonce, balances as unknown as AccountData[])) map(([nonce, ...balances]) => extract(nonce, balances as unknown as AccountData[]))
@@ -164,7 +164,7 @@ export function account (instanceId: string, api: DeriveApi): (address: AccountI
? querySystemAccount(api, accountId) ? querySystemAccount(api, accountId)
: isFunction(api.query.balances?.account) : isFunction(api.query.balances?.account)
? queryBalancesAccount(api, accountId) ? queryBalancesAccount(api, accountId)
: isFunction(api.query.balances?.freeBalance) : isFunction(api.query.balances?.['freeBalance'])
? queryBalancesFree(api, accountId) ? queryBalancesFree(api, accountId)
: queryNonceOnly(api, accountId) : queryNonceOnly(api, accountId)
]) ])
+1 -1
View File
@@ -116,7 +116,7 @@ function calcBalances (api: DeriveApi, result: Result): DeriveBalancesAll {
function queryOld (api: DeriveApi, accountId: AccountId | string): Observable<ResultBalance> { function queryOld (api: DeriveApi, accountId: AccountId | string): Observable<ResultBalance> {
return combineLatest([ return combineLatest([
api.query.balances.locks(accountId), api.query.balances.locks(accountId),
api.query.balances.vesting<Option<VestingSchedule>>(accountId) api.query.balances['vesting']<Option<VestingSchedule>>(accountId)
]).pipe( ]).pipe(
map(([locks, optVesting]): ResultBalance => { map(([locks, optVesting]): ResultBalance => {
let vestingNew = null; let vestingNew = null;
+4 -4
View File
@@ -42,11 +42,11 @@ function getAuthorDetailsWithAt (header: Header, queryAt: QueryableStorage<'rxjs
if (loggedAuthor) { if (loggedAuthor) {
// use the author mapping pallet, if available (ie: moonbeam, moonriver), to map session (nimbus) key to author (collator/validator) key // use the author mapping pallet, if available (ie: moonbeam, moonriver), to map session (nimbus) key to author (collator/validator) key
if (queryAt.authorMapping?.mappingWithDeposit) { if (queryAt['authorMapping']?.['mappingWithDeposit']) {
return combineLatest([ return combineLatest([
of(header), of(header),
validators, validators,
queryAt.authorMapping.mappingWithDeposit<OptionMapping>(loggedAuthor).pipe( queryAt['authorMapping']['mappingWithDeposit']<OptionMapping>(loggedAuthor).pipe(
map((o) => map((o) =>
o.unwrapOr({ account: null }).account o.unwrapOr({ account: null }).account
) )
@@ -55,13 +55,13 @@ function getAuthorDetailsWithAt (header: Header, queryAt: QueryableStorage<'rxjs
} }
// fall back to session and parachain staking pallets, if available (ie: manta, calamari), to map session (nimbus) key to author (collator) key // fall back to session and parachain staking pallets, if available (ie: manta, calamari), to map session (nimbus) key to author (collator) key
if (queryAt.parachainStaking?.selectedCandidates && queryAt.session?.nextKeys) { if (queryAt['parachainStaking']?.['selectedCandidates'] && queryAt.session?.nextKeys) {
const loggedHex = loggedAuthor.toHex(); const loggedHex = loggedAuthor.toHex();
return combineLatest([ return combineLatest([
of(header), of(header),
validators, validators,
queryAt.parachainStaking.selectedCandidates<Vec<AccountId>>().pipe( queryAt['parachainStaking']['selectedCandidates']<Vec<AccountId>>().pipe(
mergeMap((selectedCandidates) => mergeMap((selectedCandidates) =>
combineLatest([ combineLatest([
of(selectedCandidates), of(selectedCandidates),
+10 -10
View File
@@ -15,18 +15,18 @@ type ResultV2 = [BN, BN, BN, BN, BN, BN, BN, BN, BN, BN];
function queryConstants (api: DeriveApi): Observable<ResultV2> { function queryConstants (api: DeriveApi): Observable<ResultV2> {
return of([ return of([
// deprecated // deprecated
api.consts.contracts.callBaseFee || api.registry.createType('Balance'), api.consts.contracts['callBaseFee'] || api.registry.createType('Balance'),
api.consts.contracts.contractFee || api.registry.createType('Balance'), api.consts.contracts['contractFee'] || api.registry.createType('Balance'),
api.consts.contracts.creationFee || api.registry.createType('Balance'), api.consts.contracts['creationFee'] || api.registry.createType('Balance'),
api.consts.contracts.transactionBaseFee || api.registry.createType('Balance'), api.consts.contracts['transactionBaseFee'] || api.registry.createType('Balance'),
api.consts.contracts.transactionByteFee || api.registry.createType('Balance'), api.consts.contracts['transactionByteFee'] || api.registry.createType('Balance'),
api.consts.contracts.transferFee || api.registry.createType('Balance'), api.consts.contracts['transferFee'] || api.registry.createType('Balance'),
// current // current
api.consts.contracts.rentByteFee, api.consts.contracts['rentByteFee'] || api.registry.createType('Balance'),
api.consts.contracts.rentDepositOffset, api.consts.contracts['rentDepositOffset'] || api.registry.createType('Balance'),
api.consts.contracts.surchargeReward, api.consts.contracts['surchargeReward'] || api.registry.createType('Balance'),
api.consts.contracts.tombstoneDeposit api.consts.contracts['tombstoneDeposit'] || api.registry.createType('Balance')
]) as unknown as Observable<ResultV2>; ]) as unknown as Observable<ResultV2>;
} }
+7 -7
View File
@@ -21,22 +21,22 @@ function isVoter (value: VoteEntry): value is PalletElectionsPhragmenVoter {
} }
function retrieveStakeOf (elections: QueryableModuleStorage<'rxjs'>): Observable<[AccountId, Balance][]> { function retrieveStakeOf (elections: QueryableModuleStorage<'rxjs'>): Observable<[AccountId, Balance][]> {
return elections.stakeOf.entries<Balance, [AccountId]>().pipe( return elections['stakeOf'].entries<Balance, [AccountId]>().pipe(
map((entries) => map((entries) =>
entries.map(([{ args: [accountId] }, stake]) => [accountId, stake]) entries.map(([{ args: [accountId] }, stake]) => [accountId, stake])
) )
); );
} }
function retrieveVoteOf (elections: QueryableModuleStorage<'rxjs'>): Observable<[AccountId, AccountId[]][]> { function retrieveVoteOf (elections: DeriveApi['query']['elections']): Observable<[AccountId, AccountId[]][]> {
return elections.votesOf.entries<Vec<AccountId>, [AccountId]>().pipe( return elections['votesOf'].entries<Vec<AccountId>, [AccountId]>().pipe(
map((entries) => map((entries) =>
entries.map(([{ args: [accountId] }, votes]) => [accountId, votes]) entries.map(([{ args: [accountId] }, votes]) => [accountId, votes])
) )
); );
} }
function retrievePrev (api: DeriveApi, elections: QueryableModuleStorage<'rxjs'>): Observable<DeriveCouncilVotes> { function retrievePrev (api: DeriveApi, elections: DeriveApi['query']['elections']): Observable<DeriveCouncilVotes> {
return combineLatest([ return combineLatest([
retrieveStakeOf(elections), retrieveStakeOf(elections),
retrieveVoteOf(elections) retrieveVoteOf(elections)
@@ -63,7 +63,7 @@ function retrievePrev (api: DeriveApi, elections: QueryableModuleStorage<'rxjs'>
); );
} }
function retrieveCurrent (elections: QueryableModuleStorage<'rxjs'>): Observable<DeriveCouncilVotes> { function retrieveCurrent (elections: DeriveApi['query']['elections']): Observable<DeriveCouncilVotes> {
return elections.voting.entries<VoteEntry, [AccountId]>().pipe( return elections.voting.entries<VoteEntry, [AccountId]>().pipe(
map((entries): DeriveCouncilVotes => map((entries): DeriveCouncilVotes =>
entries.map(([{ args: [accountId] }, value]): [AccountId, DeriveCouncilVote] => [ entries.map(([{ args: [accountId] }, value]): [AccountId, DeriveCouncilVote] => [
@@ -77,11 +77,11 @@ function retrieveCurrent (elections: QueryableModuleStorage<'rxjs'>): Observable
} }
export function votes (instanceId: string, api: DeriveApi): () => Observable<DeriveCouncilVotes> { export function votes (instanceId: string, api: DeriveApi): () => Observable<DeriveCouncilVotes> {
const elections = api.query.phragmenElection || api.query.electionsPhragmen || api.query.elections; const elections = api.query.elections || api.query['phragmenElection'] || api.query['electionsPhragmen'];
return memo(instanceId, (): Observable<DeriveCouncilVotes> => return memo(instanceId, (): Observable<DeriveCouncilVotes> =>
elections elections
? elections.stakeOf ? elections['stakeOf']
? retrievePrev(api, elections) ? retrievePrev(api, elections)
: retrieveCurrent(elections) : retrieveCurrent(elections)
: of([]) : of([])
@@ -35,7 +35,7 @@ function createChildKey (info: AllInfo): string {
export function childKey (instanceId: string, api: DeriveApi): (paraId: string | number | BN) => Observable<string | null> { export function childKey (instanceId: string, api: DeriveApi): (paraId: string | number | BN) => Observable<string | null> {
return memo(instanceId, (paraId: string | number | BN): Observable<string | null> => return memo(instanceId, (paraId: string | number | BN): Observable<string | null> =>
api.query.crowdloan.funds<Option<PolkadotRuntimeCommonCrowdloanFundInfo>>(paraId).pipe( api.query['crowdloan']['funds']<Option<PolkadotRuntimeCommonCrowdloanFundInfo>>(paraId).pipe(
map((optInfo) => map((optInfo) =>
optInfo.isSome optInfo.isSome
? createChildKey(optInfo.unwrap()) ? createChildKey(optInfo.unwrap())
@@ -53,7 +53,7 @@ function isBounded (call: FrameSupportPreimagesBounded | FrameSupportScheduleMay
} }
function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> { function queryQueue (api: DeriveApi): Observable<DeriveDispatch[]> {
return api.query.democracy.dispatchQueue<Vec<ITuple<[BlockNumber, Hash, ReferendumIndex]>>>().pipe( return api.query.democracy['dispatchQueue']<Vec<ITuple<[BlockNumber, Hash, ReferendumIndex]>>>().pipe(
switchMap((dispatches) => switchMap((dispatches) =>
combineLatest([ combineLatest([
of(dispatches), of(dispatches),
@@ -142,7 +142,7 @@ export function dispatchQueue (instanceId: string, api: DeriveApi): () => Observ
return memo(instanceId, (): Observable<DeriveDispatch[]> => return memo(instanceId, (): Observable<DeriveDispatch[]> =>
isFunction(api.query.scheduler?.agenda) isFunction(api.query.scheduler?.agenda)
? queryScheduler(api) ? queryScheduler(api)
: api.query.democracy.dispatchQueue : api.query.democracy['dispatchQueue']
? queryQueue(api) ? queryQueue(api)
: of([]) : of([])
); );
@@ -20,7 +20,7 @@ type PreimageInfo = [Bytes, AccountId, Balance, BlockNumber];
type OldPreimage = ITuple<PreimageInfo>; type OldPreimage = ITuple<PreimageInfo>;
function isDemocracyPreimage (api: DeriveApi, imageOpt: Option<OldPreimage> | Option<PreimageStatus>): imageOpt is Option<PreimageStatus> { function isDemocracyPreimage (api: DeriveApi, imageOpt: Option<OldPreimage> | Option<PreimageStatus>): imageOpt is Option<PreimageStatus> {
return !!imageOpt && !api.query.democracy.dispatchQueue; return !!imageOpt && !api.query.democracy['dispatchQueue'];
} }
function constructProposal (api: DeriveApi, [bytes, proposer, balance, at]: PreimageInfo): DeriveProposalImage { function constructProposal (api: DeriveApi, [bytes, proposer, balance, at]: PreimageInfo): DeriveProposalImage {
@@ -79,7 +79,7 @@ function parseImage (api: DeriveApi, [proposalHash, status, bytes]: [HexString,
function getDemocracyImages (api: DeriveApi, bounded: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]): Observable<(DeriveProposalImage | undefined)[]> { function getDemocracyImages (api: DeriveApi, bounded: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]): Observable<(DeriveProposalImage | undefined)[]> {
const hashes = bounded.map((b) => getImageHashBounded(b)); const hashes = bounded.map((b) => getImageHashBounded(b));
return api.query.democracy.preimages.multi<Option<PreimageStatus>>(hashes).pipe( return api.query.democracy['preimages'].multi<Option<PreimageStatus>>(hashes).pipe(
map((images): (DeriveProposalImage | undefined)[] => map((images): (DeriveProposalImage | undefined)[] =>
images.map((imageOpt) => parseDemocracy(api, imageOpt)) images.map((imageOpt) => parseDemocracy(api, imageOpt))
) )
@@ -127,7 +127,7 @@ function getImages (api: DeriveApi, bounded: (FrameSupportPreimagesBounded | Uin
export function preimages (instanceId: string, api: DeriveApi): (hashes: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]) => Observable<(DeriveProposalImage | undefined)[]> { export function preimages (instanceId: string, api: DeriveApi): (hashes: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]) => Observable<(DeriveProposalImage | undefined)[]> {
return memo(instanceId, (hashes: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]): Observable<(DeriveProposalImage | undefined)[]> => return memo(instanceId, (hashes: (Hash | Uint8Array | string | FrameSupportPreimagesBounded)[]): Observable<(DeriveProposalImage | undefined)[]> =>
hashes.length hashes.length
? isFunction(api.query.democracy.preimages) ? isFunction(api.query.democracy['preimages'])
? getDemocracyImages(api, hashes) ? getDemocracyImages(api, hashes)
: isFunction(api.query.preimage.preimageFor) : isFunction(api.query.preimage.preimageFor)
? getImages(api, hashes) ? getImages(api, hashes)
@@ -23,7 +23,6 @@ type Result = [Proposals, (DeriveProposalImage | undefined)[], Depositors[]];
function isNewDepositors (depositors: ITuple<[Vec<AccountId>, Balance]> | ITuple<[Balance, Vec<AccountId>]>): depositors is ITuple<[Vec<AccountId>, Balance]> { function isNewDepositors (depositors: ITuple<[Vec<AccountId>, Balance]> | ITuple<[Balance, Vec<AccountId>]>): depositors is ITuple<[Vec<AccountId>, Balance]> {
// Detect balance... // Detect balance...
// eslint-disable-next-line @typescript-eslint/unbound-method
return isFunction((depositors[1] as Balance).mul); return isFunction((depositors[1] as Balance).mul);
} }
@@ -20,12 +20,12 @@ type VotingDirect = PalletDemocracyVoteVoting['asDirect'];
type VotingDirectVote = VotingDirect['votes'][0]; type VotingDirectVote = VotingDirect['votes'][0];
function votesPrev (api: DeriveApi, referendumId: BN): Observable<DeriveReferendumVote[]> { function votesPrev (api: DeriveApi, referendumId: BN): Observable<DeriveReferendumVote[]> {
return api.query.democracy.votersFor<Vec<AccountId>>(referendumId).pipe( return api.query.democracy['votersFor']<Vec<AccountId>>(referendumId).pipe(
switchMap((votersFor): Observable<[Vec<AccountId>, Vote[], DeriveBalancesAccount[]]> => switchMap((votersFor): Observable<[Vec<AccountId>, Vote[], DeriveBalancesAccount[]]> =>
combineLatest([ combineLatest([
of(votersFor), of(votersFor),
votersFor.length votersFor.length
? api.query.democracy.voteOf.multi<Vote>( ? api.query.democracy['voteOf'].multi<Vote>(
votersFor.map((accountId): [BN | number, AccountId] => votersFor.map((accountId): [BN | number, AccountId] =>
[referendumId, accountId] [referendumId, accountId]
) )
+12 -10
View File
@@ -47,20 +47,22 @@ function sortAccounts ([, balanceA]: [AccountId32, Balance], [, balanceB]: [Acco
function getConstants (api: DeriveApi, elections: string | null): Partial<DeriveElectionsInfo> { function getConstants (api: DeriveApi, elections: string | null): Partial<DeriveElectionsInfo> {
return elections return elections
? { ? {
candidacyBond: api.consts[elections].candidacyBond as Balance, candidacyBond: api.consts[elections as 'elections'].candidacyBond as Balance,
desiredRunnersUp: api.consts[elections].desiredRunnersUp as u32, desiredRunnersUp: api.consts[elections as 'elections'].desiredRunnersUp as u32,
desiredSeats: api.consts[elections].desiredMembers as u32, desiredSeats: api.consts[elections as 'elections'].desiredMembers as u32,
termDuration: api.consts[elections].termDuration as BlockNumber, termDuration: api.consts[elections as 'elections'].termDuration as BlockNumber,
votingBond: api.consts[elections].votingBond as Balance votingBond: api.consts[elections as 'elections']['votingBond'] as Balance,
votingBondBase: api.consts[elections as 'elections'].votingBondBase as Balance,
votingBondFactor: api.consts[elections as 'elections'].votingBondFactor as Balance
} }
: {}; : {};
} }
function getModules (api: DeriveApi): [string, string | null] { function getModules (api: DeriveApi): [string, string | null] {
const [council] = api.registry.getModuleInstances(api.runtimeVersion.specName, 'council') || ['council']; const [council] = api.registry.getModuleInstances(api.runtimeVersion.specName, 'council') || ['council'];
const elections = api.query.phragmenElection const elections = api.query['phragmenElection']
? 'phragmenElection' ? 'phragmenElection'
: api.query.electionsPhragmen : api.query['electionsPhragmen']
? 'electionsPhragmen' ? 'electionsPhragmen'
: api.query.elections : api.query.elections
? 'elections' ? 'elections'
@@ -72,9 +74,9 @@ function getModules (api: DeriveApi): [string, string | null] {
function queryAll (api: DeriveApi, council: string, elections: string): Observable<[AccountId32[], Candidate[], Member[], Member[]]> { function queryAll (api: DeriveApi, council: string, elections: string): Observable<[AccountId32[], Candidate[], Member[], Member[]]> {
return api.queryMulti<[Vec<AccountId32>, Vec<Candidate>, Vec<Member>, Vec<Member>]>([ return api.queryMulti<[Vec<AccountId32>, Vec<Candidate>, Vec<Member>, Vec<Member>]>([
api.query[council as 'council'].members, api.query[council as 'council'].members,
api.query[elections as 'phragmenElection'].candidates, api.query[elections as 'elections'].candidates,
api.query[elections as 'phragmenElection'].members, api.query[elections as 'elections'].members,
api.query[elections as 'phragmenElection'].runnersUp api.query[elections as 'elections'].runnersUp
]); ]);
} }
@@ -17,4 +17,6 @@ export interface DeriveElectionsInfo {
voteCount?: VoteIndex; voteCount?: VoteIndex;
voterCount?: SetIndex; voterCount?: SetIndex;
votingBond?: Balance; votingBond?: Balance;
votingBondBase?: Balance;
votingBondFactor?: Balance;
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.6.1' }; export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.9.1' };
+9 -9
View File
@@ -75,16 +75,16 @@ function parse (id: ParaId, [active, retryQueue, selectedThreads, didUpdate, inf
export function info (instanceId: string, api: DeriveApi): (id: ParaId | number) => Observable<DeriveParachainFull | null> { export function info (instanceId: string, api: DeriveApi): (id: ParaId | number) => Observable<DeriveParachainFull | null> {
return memo(instanceId, (id: ParaId | number): Observable<DeriveParachainFull | null> => return memo(instanceId, (id: ParaId | number): Observable<DeriveParachainFull | null> =>
api.query.registrar && api.query.parachains api.query['registrar'] && api.query['parachains']
? api.queryMulti<Result>([ ? api.queryMulti<Result>([
api.query.registrar.active, api.query['registrar']['active'],
api.query.registrar.retryQueue, api.query['registrar']['retryQueue'],
api.query.registrar.selectedThreads, api.query['registrar']['selectedThreads'],
api.query.parachains.didUpdate, api.query['parachains']['didUpdate'],
[api.query.registrar.paras, id], [api.query['registrar']['paras'], id],
[api.query.registrar.pendingSwap, id], [api.query['registrar']['pendingSwap'], id],
[api.query.parachains.heads, id], [api.query['parachains']['heads'], id],
[api.query.parachains.relayDispatchQueue, id] [api.query['parachains']['relayDispatchQueue'], id]
]) ])
.pipe( .pipe(
map((result: Result): DeriveParachainFull | null => map((result: Result): DeriveParachainFull | null =>
@@ -16,12 +16,12 @@ import { didUpdateToBool } from './util.js';
type Result = [ type Result = [
ParaId[], ParaId[],
DidUpdate, DidUpdate,
RelayDispatchQueueSize[],
ParaInfoResult[], ParaInfoResult[],
PendingSwap[], PendingSwap[]
RelayDispatchQueueSize[]
]; ];
function parse ([ids, didUpdate, infos, pendingSwaps, relayDispatchQueueSizes]: Result): DeriveParachain[] { function parse ([ids, didUpdate, relayDispatchQueueSizes, infos, pendingSwaps]: Result): DeriveParachain[] {
return ids.map((id, index): DeriveParachain => ({ return ids.map((id, index): DeriveParachain => ({
didUpdate: didUpdateToBool(didUpdate, id), didUpdate: didUpdateToBool(didUpdate, id),
id, id,
@@ -33,15 +33,15 @@ function parse ([ids, didUpdate, infos, pendingSwaps, relayDispatchQueueSizes]:
export function overview (instanceId: string, api: DeriveApi): () => Observable<DeriveParachain[]> { export function overview (instanceId: string, api: DeriveApi): () => Observable<DeriveParachain[]> {
return memo(instanceId, (): Observable<DeriveParachain[]> => return memo(instanceId, (): Observable<DeriveParachain[]> =>
api.query.registrar?.parachains && api.query.parachains api.query['registrar']?.['parachains'] && api.query['parachains']
? api.query.registrar.parachains<ParaId[]>().pipe( ? api.query['registrar']['parachains']<ParaId[]>().pipe(
switchMap((paraIds) => switchMap((paraIds) =>
combineLatest([ combineLatest([
of(paraIds), of(paraIds),
api.query.parachains.didUpdate<DidUpdate>(), api.query['parachains']['didUpdate']<DidUpdate>(),
api.query.registrar.paras.multi<ParaInfoResult>(paraIds), api.query['parachains']['relayDispatchQueueSize'].multi<RelayDispatchQueueSize>(paraIds),
api.query.registrar.pendingSwap.multi<PendingSwap>(paraIds), api.query['registrar']['paras'].multi<ParaInfoResult>(paraIds),
api.query.parachains.relayDispatchQueueSize.multi<RelayDispatchQueueSize>(paraIds) api.query['registrar']['pendingSwap'].multi<PendingSwap>(paraIds)
]) ])
), ),
map(parse) map(parse)
@@ -19,7 +19,7 @@ export function erasHistoric (instanceId: string, api: DeriveApi): (withActive?:
api.query.staking.activeEra(), api.query.staking.activeEra(),
api.consts.staking.historyDepth api.consts.staking.historyDepth
? of(api.consts.staking.historyDepth) ? of(api.consts.staking.historyDepth)
: api.query.staking.historyDepth<u32>() : api.query.staking['historyDepth']<u32>()
]).pipe( ]).pipe(
map(([activeEraOpt, historyDepth]): EraIndex[] => { map(([activeEraOpt, historyDepth]): EraIndex[] => {
const result: EraIndex[] = []; const result: EraIndex[] = [];
+2 -2
View File
@@ -38,8 +38,8 @@ export function keysMulti (instanceId: string, api: DeriveApi): (stashIds: (Uint
switchMap((queuedKeys) => switchMap((queuedKeys) =>
combineLatest([ combineLatest([
of(queuedKeys), of(queuedKeys),
api.consts.session?.dedupKeyPrefix api.consts['session']?.['dedupKeyPrefix']
? api.query.session.nextKeys.multi(stashIds.map((s) => [api.consts.session.dedupKeyPrefix, s])) ? api.query.session.nextKeys.multi(stashIds.map((s) => [api.consts['session']['dedupKeyPrefix'], s]))
: combineLatest(stashIds.map((s) => api.query.session.nextKeys(s))) : combineLatest(stashIds.map((s) => api.query.session.nextKeys(s)))
]) ])
), ),
@@ -18,7 +18,7 @@ export function nextElected (instanceId: string, api: DeriveApi): () => Observab
switchMap(({ currentEra }) => api.query.staking.erasStakers.keys(currentEra)), switchMap(({ currentEra }) => api.query.staking.erasStakers.keys(currentEra)),
map((keys) => keys.map(({ args: [, accountId] }) => accountId)) map((keys) => keys.map(({ args: [, accountId] }) => accountId))
) )
: api.query.staking.currentElected<AccountId[]>() : api.query.staking['currentElected']<AccountId[]>()
); );
} }
@@ -3,7 +3,7 @@
import type { ApiPromise } from '@polkadot/api'; import type { ApiPromise } from '@polkadot/api';
import type { Bounty, BountyIndex } from '@polkadot/types/interfaces'; import type { Bounty, BountyIndex } from '@polkadot/types/interfaces';
import type { Codec, Constructor, InterfaceTypes, Registry } from '@polkadot/types/types'; import type { Codec, CodecClass, InterfaceTypes, Registry } from '@polkadot/types/types';
import { Option, StorageKey } from '@polkadot/types'; import { Option, StorageKey } from '@polkadot/types';
@@ -29,7 +29,7 @@ export class BountyFactory {
this.#registry.createType('Bounty'); this.#registry.createType('Bounty');
public optionOf = <T extends Codec>(value: T): Option<T> => { public optionOf = <T extends Codec>(value: T): Option<T> => {
const typeName = this.#registry.getClassName(value.constructor as Constructor<T>); const typeName = this.#registry.getClassName(value.constructor as CodecClass<T>);
return new Option<T>(this.#registry, typeName as keyof InterfaceTypes, value); return new Option<T>(this.#registry, typeName as keyof InterfaceTypes, value);
}; };
+1
View File
@@ -8,6 +8,7 @@
"exclude": [ "exclude": [
"**/test/*", "**/test/*",
"**/checkTypes.manual.ts", "**/checkTypes.manual.ts",
"**/mod.ts",
"**/*.spec.ts" "**/*.spec.ts"
], ],
"references": [ "references": [
+18 -18
View File
@@ -18,29 +18,29 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@polkadot/api-augment": "10.6.1", "@polkadot/api-augment": "10.9.1",
"@polkadot/api-base": "10.6.1", "@polkadot/api-base": "10.9.1",
"@polkadot/api-derive": "10.6.1", "@polkadot/api-derive": "10.9.1",
"@polkadot/keyring": "^12.1.2", "@polkadot/keyring": "^12.3.1",
"@polkadot/rpc-augment": "10.6.1", "@polkadot/rpc-augment": "10.9.1",
"@polkadot/rpc-core": "10.6.1", "@polkadot/rpc-core": "10.9.1",
"@polkadot/rpc-provider": "10.6.1", "@polkadot/rpc-provider": "10.9.1",
"@polkadot/types": "10.6.1", "@polkadot/types": "10.9.1",
"@polkadot/types-augment": "10.6.1", "@polkadot/types-augment": "10.9.1",
"@polkadot/types-codec": "10.6.1", "@polkadot/types-codec": "10.9.1",
"@polkadot/types-create": "10.6.1", "@polkadot/types-create": "10.9.1",
"@polkadot/types-known": "10.6.1", "@polkadot/types-known": "10.9.1",
"@polkadot/util": "^12.1.2", "@polkadot/util": "^12.3.1",
"@polkadot/util-crypto": "^12.1.2", "@polkadot/util-crypto": "^12.3.1",
"eventemitter3": "^5.0.1", "eventemitter3": "^5.0.1",
"rxjs": "^7.8.1", "rxjs": "^7.8.1",
"tslib": "^2.5.0" "tslib": "^2.5.3"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/api-augment": "10.6.1", "@polkadot/api-augment": "10.9.1",
"@polkadot/types-support": "10.6.1" "@polkadot/types-support": "10.9.1"
} }
} }
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2023 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/api-augment';
+4 -1
View File
@@ -404,7 +404,10 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
const decorateFn = (section: string, method: string): unknown => { const decorateFn = (section: string, method: string): unknown => {
const source = rpc[section as 'chain'][method as 'getHeader']; const source = rpc[section as 'chain'][method as 'getHeader'];
const fn = decorateMethod(source, { methodName: method }) as Record<string, unknown>; const fn = decorateMethod(source, { methodName: method }) as {
meta: unknown;
raw: unknown;
};
fn.meta = source.meta; fn.meta = source.meta;
fn.raw = decorateMethod(source.raw, { methodName: method }) as unknown; fn.raw = decorateMethod(source.raw, { methodName: method }) as unknown;
+1 -1
View File
@@ -58,7 +58,7 @@ export abstract class ApiBase<ApiType extends ApiTypes> extends Getters<ApiType>
/** /**
* @description Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair * @description Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
*/ */
public setSigner (signer: Signer): void { public setSigner (signer: Signer | undefined): void {
this._rx.signer = signer; this._rx.signer = signer;
} }
+16 -16
View File
@@ -6,7 +6,7 @@
import '@polkadot/api-augment'; import '@polkadot/api-augment';
import type { HeaderExtended } from '@polkadot/api-derive/types'; import type { HeaderExtended } from '@polkadot/api-derive/types';
import type { TestKeyringMap } from '@polkadot/keyring/testingPairs'; import type { TestKeyringMapSubstrate } from '@polkadot/keyring/testingPairs';
import type { StorageKey } from '@polkadot/types'; import type { StorageKey } from '@polkadot/types';
import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces'; import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces';
import type { FrameSystemAccountInfo } from '@polkadot/types/lookup'; import type { FrameSystemAccountInfo } from '@polkadot/types/lookup';
@@ -35,7 +35,7 @@ async function calls (api: ApiPromise): Promise<void> {
function consts (api: ApiPromise): void { function consts (api: ApiPromise): void {
// constants has actual value & metadata // constants has actual value & metadata
console.log( console.log(
api.consts.foo.bar, api.consts['notIn']['augmentation'],
api.consts.balances.existentialDeposit.toNumber(), api.consts.balances.existentialDeposit.toNumber(),
api.consts.balances.existentialDeposit.meta.docs.map((s) => s.toString()).join(''), api.consts.balances.existentialDeposit.meta.docs.map((s) => s.toString()).join(''),
api.consts.system.blockWeights.maxBlock.refTime.toNumber() api.consts.system.blockWeights.maxBlock.refTime.toNumber()
@@ -59,10 +59,10 @@ function errors (api: ApiPromise): void {
console.log(api.errors.vesting.AmountLow.is(someError)); console.log(api.errors.vesting.AmountLow.is(someError));
// non-existing error, existing module // non-existing error, existing module
console.log(api.errors.vesting.Something.is(someError)); console.log(api.errors.vesting['NonAugmented'].is(someError));
// something random // something random
console.log(api.errors.something.Random.is(someError)); console.log(api.errors['thisIsNot']['Augmented'].is(someError));
} }
function events (api: ApiPromise): void { function events (api: ApiPromise): void {
@@ -97,20 +97,20 @@ function events (api: ApiPromise): void {
} }
// something random, just codec[] // something random, just codec[]
if (api.events.something.Random.is(event)) { if (api.events['not']['Augmented'].is(event)) {
const [a, b] = event.data; const [a, b] = event.data;
console.log(a.toHuman(), b.toHuman()); console.log(a.toHuman(), b.toHuman());
} }
} }
async function query (api: ApiPromise, pairs: TestKeyringMap): Promise<void> { async function query (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
const intentions = await api.query.staking.bonded(); const intentions = await api.query.staking.bonded();
console.log('intentions:', intentions); console.log('intentions:', intentions);
// api.query.*.* is well-typed // api.query.*.* is well-typed
const bar = await api.query.foo.bar(); // bar is Codec (unknown module) const bar = await api.query['notIn']['augmentation'](); // bar is Codec (unknown module)
const bal = await api.query.balances.totalIssuance(); // bal is Balance const bal = await api.query.balances.totalIssuance(); // bal is Balance
const bal2 = await api.query.balances.totalIssuance('WRONG_ARG'); // bal2 is Codec (wrong args) const bal2 = await api.query.balances.totalIssuance('WRONG_ARG'); // bal2 is Codec (wrong args)
const override = await api.query.balances.totalIssuance<Header>(); // override is still available const override = await api.query.balances.totalIssuance<Header>(); // override is still available
@@ -119,7 +119,7 @@ async function query (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
const oldBal = await api.query.balances.totalIssuance.at('abcd'); const oldBal = await api.query.balances.totalIssuance.at('abcd');
// For older queries we can cast with `<Balance>` (newer chain have multi typed) // For older queries we can cast with `<Balance>` (newer chain have multi typed)
const multia = await api.query.balances.freeBalance.multi<Balance>([pairs.alice.address, pairs.bob.address]); const multia = await api.query.balances['freeBalance'].multi<Balance>([pairs.alice.address, pairs.bob.address]);
const multib = await api.query.system.account.multi([pairs.alice.address, pairs.bob.address]); const multib = await api.query.system.account.multi([pairs.alice.address, pairs.bob.address]);
await api.query.system.account(pairs.alice.address); await api.query.system.account(pairs.alice.address);
@@ -157,7 +157,7 @@ async function queryExtra (api: ApiPromise): Promise<void> {
await api.query.assets.approvals.keys(123, 'blah'); await api.query.assets.approvals.keys(123, 'blah');
await api.query.assets.account.keys(123); await api.query.assets.account.keys(123);
await api.query.assets.account.entries(123); await api.query.assets.account.entries(123);
await api.query.assets.blah.keys(); await api.query.assets['notAugmented'].keys();
// is // is
const key = {} as StorageKey; const key = {} as StorageKey;
@@ -170,7 +170,7 @@ async function queryExtra (api: ApiPromise): Promise<void> {
} }
} }
async function queryMulti (api: ApiPromise, pairs: TestKeyringMap): Promise<void> { async function queryMulti (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
// check multi for unsub // check multi for unsub
const multiUnsub = await api.queryMulti([ const multiUnsub = await api.queryMulti([
[api.query.staking.validators], [api.query.staking.validators],
@@ -185,7 +185,7 @@ async function queryMulti (api: ApiPromise, pairs: TestKeyringMap): Promise<void
const multiRes = await api.queryMulti([ const multiRes = await api.queryMulti([
[api.query.system.account, pairs.eve.address], [api.query.system.account, pairs.eve.address],
// older chains only // older chains only
[api.query.system.accountNonce, pairs.eve.address] [api.query.system['accountNonce'], pairs.eve.address]
]); ]);
console.log(multiRes); console.log(multiRes);
@@ -241,7 +241,7 @@ function types (api: ApiPromise): void {
console.log(balance, gas, compact, gasUnsafe, overriddenUnsafe, u32.toNumber(), f32.toNumber(), api.createType('AccountData'), raw.subarray(0, 10)); console.log(balance, gas, compact, gasUnsafe, overriddenUnsafe, u32.toNumber(), f32.toNumber(), api.createType('AccountData'), raw.subarray(0, 10));
} }
async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> { async function tx (api: ApiPromise, pairs: TestKeyringMapSubstrate): Promise<void> {
// transfer, also allows for bigint inputs here // transfer, also allows for bigint inputs here
const transfer = api.tx.balances.transfer(pairs.bob.address, BigInt(123456789)); const transfer = api.tx.balances.transfer(pairs.bob.address, BigInt(123456789));
@@ -251,7 +251,7 @@ async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
console.log('hash:', (await transfer.signAndSend(pairs.alice)).toHex()); console.log('hash:', (await transfer.signAndSend(pairs.alice)).toHex());
// passing options, but waiting for hash // passing options, but waiting for hash
const nonce = await api.query.system.accountNonce<Index>(pairs.alice.address); const nonce = await api.query.system['accountNonce']<Index>(pairs.alice.address);
(await api.tx.balances (await api.tx.balances
.transfer(pairs.bob.address, 12345) .transfer(pairs.bob.address, 12345)
@@ -264,7 +264,7 @@ async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
.signAndSend(pairs.alice, ({ status }: SubmittableResult) => console.log(status.type)); .signAndSend(pairs.alice, ({ status }: SubmittableResult) => console.log(status.type));
// with options and the callback // with options and the callback
const nonce2 = await api.query.system.accountNonce(pairs.alice.address); const nonce2 = await api.query.system['accountNonce'](pairs.alice.address);
const unsub2 = await api.tx.balances const unsub2 = await api.tx.balances
.transfer(pairs.bob.address, 12345) .transfer(pairs.bob.address, 12345)
.signAndSend(pairs.alice, { nonce: nonce2 }, ({ status }: SubmittableResult): void => { .signAndSend(pairs.alice, { nonce: nonce2 }, ({ status }: SubmittableResult): void => {
@@ -280,7 +280,7 @@ async function tx (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
await second.signAndSend('123', (result) => console.log(result)); await second.signAndSend('123', (result) => console.log(result));
// it handles enum inputs correctly // it handles enum inputs correctly
await api.tx.democracy.proxyVote(123, { Split: { nay: 456, yay: 123 } }).signAndSend(pairs.alice); await api.tx.democracy['proxyVote'](123, { Split: { nay: 456, yay: 123 } }).signAndSend(pairs.alice);
// is // is
if (api.tx.balances.transfer.is(second)) { if (api.tx.balances.transfer.is(second)) {
@@ -295,7 +295,7 @@ async function at (api: ApiPromise): Promise<void> {
const apiAt = await api.at('0x1234'); const apiAt = await api.at('0x1234');
// get old balances // get old balances
console.log(await apiAt.query.balances.freeBalance('0x1234')); console.log(await apiAt.query.balances['freeBalance']('0x1234'));
// get some constants // get some constants
console.log(apiAt.consts.balances.existentialDeposit); console.log(apiAt.consts.balances.existentialDeposit);
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.6.1' }; export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.9.1' };
+2 -1
View File
@@ -21,7 +21,7 @@ describe('Combinator', (): void => {
fns = []; fns = [];
}); });
it('it triggers on all values', async (): Promise<void> => { it('triggers on all values', async (): Promise<void> => {
await new Promise<boolean>((resolve) => { await new Promise<boolean>((resolve) => {
let count = 0; let count = 0;
const combinator = new Combinator( const combinator = new Combinator(
@@ -90,6 +90,7 @@ describe('Combinator', (): void => {
}); });
}); });
// eslint-disable-next-line jest/expect-expect
it('unsubscribes as required', async (): Promise<void> => { it('unsubscribes as required', async (): Promise<void> => {
await new Promise<void>((resolve) => { await new Promise<void>((resolve) => {
// eslint-disable-next-line @typescript-eslint/require-await // eslint-disable-next-line @typescript-eslint/require-await
+1
View File
@@ -87,6 +87,7 @@ describe('ApiPromise', (): void => {
await api.disconnect(); await api.disconnect();
}); });
// eslint-disable-next-line jest/expect-expect
it('Create API instance will error on failure to await ready', async (): Promise<void> => { it('Create API instance will error on failure to await ready', async (): Promise<void> => {
class ErrorApiPromise extends ApiPromise { class ErrorApiPromise extends ApiPromise {
constructor () { constructor () {
+7 -5
View File
@@ -5,7 +5,7 @@
import type { Observable } from 'rxjs'; import type { Observable } from 'rxjs';
import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo, SignerPayload } from '@polkadot/types/interfaces'; import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo, SignerPayload } from '@polkadot/types/interfaces';
import type { Callback, Codec, Constructor, ISubmittableResult, SignatureOptions } from '@polkadot/types/types'; import type { Callback, Codec, CodecClass, ISubmittableResult, SignatureOptions } from '@polkadot/types/types';
import type { Registry } from '@polkadot/types-codec/types'; import type { Registry } from '@polkadot/types-codec/types';
import type { ApiBase } from '../base/index.js'; import type { ApiBase } from '../base/index.js';
import type { ApiInterfaceRx, ApiTypes, PromiseOrObs, SignerResult } from '../types/index.js'; import type { ApiInterfaceRx, ApiTypes, PromiseOrObs, SignerResult } from '../types/index.js';
@@ -83,7 +83,7 @@ function optionsOrNonce (partialOptions: Partial<SignerOptions> = {}): Partial<S
: partialOptions; : partialOptions;
} }
export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHash, decorateMethod }: SubmittableOptions<ApiType>): Constructor<SubmittableExtrinsic<ApiType>> { export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHash, decorateMethod }: SubmittableOptions<ApiType>): CodecClass<SubmittableExtrinsic<ApiType>> {
// an instance of the base extrinsic for us to extend // an instance of the base extrinsic for us to extend
const ExtrinsicBase = api.registry.createClass('Extrinsic'); const ExtrinsicBase = api.registry.createClass('Extrinsic');
@@ -160,9 +160,11 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
// setup our options (same way as in signAndSend) // setup our options (same way as in signAndSend)
const eraOptions = makeEraOptions(api, this.registry, allOptions, signingInfo); const eraOptions = makeEraOptions(api, this.registry, allOptions, signingInfo);
const signOptions = makeSignOptions(api, eraOptions, {}); const signOptions = makeSignOptions(api, eraOptions, {});
const u8a = this.isSigned
? api.tx(this).signFake(address, signOptions).toU8a() // 1. Don't use the internal objects inside the new tx (hence toU8a)
: this.signFake(address, signOptions).toU8a(); // 2. Don't override the data from existing signed extrinsics
// 3. Ensure that this object stays intact, with no new sign after operation
const u8a = api.tx(this.toU8a()).signFake(address, signOptions).toU8a();
return api.call.transactionPaymentApi.queryInfo(u8a, u8a.length); return api.call.transactionPaymentApi.queryInfo(u8a, u8a.length);
}) })
+7
View File
@@ -25,12 +25,19 @@ export type { Signer, SignerResult } from '@polkadot/types/types';
export { ApiBase } from '../base/index.js'; export { ApiBase } from '../base/index.js';
// all starred // all starred
// eslint-disable-next-line import/export
export * from '@polkadot/api/types/calls'; export * from '@polkadot/api/types/calls';
// eslint-disable-next-line import/export
export * from '@polkadot/api/types/consts'; export * from '@polkadot/api/types/consts';
// eslint-disable-next-line import/export
export * from '@polkadot/api/types/errors'; export * from '@polkadot/api/types/errors';
// eslint-disable-next-line import/export
export * from '@polkadot/api/types/events'; export * from '@polkadot/api/types/events';
// eslint-disable-next-line import/export
export * from '@polkadot/api/types/storage'; export * from '@polkadot/api/types/storage';
// eslint-disable-next-line import/export
export * from '@polkadot/api/types/submittable'; export * from '@polkadot/api/types/submittable';
// eslint-disable-next-line import/export
export * from '@polkadot/api-base/types'; export * from '@polkadot/api-base/types';
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic // A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
+14 -14
View File
@@ -18,55 +18,55 @@ describe('extractStorageArgs', (): void => {
it('validates no-arg plain', (): void => { it('validates no-arg plain', (): void => {
expect( expect(
extractStorageArgs(registry, storage.timestamp.now, []) extractStorageArgs(registry, storage['timestamp']['now'], [])
).toEqual([storage.timestamp.now, []]); ).toEqual([storage['timestamp']['now'], []]);
}); });
it('validates no-arg plain (with undefined, undefined)', (): void => { it('validates no-arg plain (with undefined, undefined)', (): void => {
expect( expect(
extractStorageArgs(registry, storage.timestamp.now, [undefined, undefined]) extractStorageArgs(registry, storage['timestamp']['now'], [undefined, undefined])
).toEqual([storage.timestamp.now, []]); ).toEqual([storage['timestamp']['now'], []]);
}); });
it('validates no-arg plain (failing when there are args)', (): void => { it('validates no-arg plain (failing when there are args)', (): void => {
expect( expect(
() => extractStorageArgs(registry, storage.timestamp.now, [123, 456]) () => extractStorageArgs(registry, storage['timestamp']['now'], [123, 456])
).toThrow('timestamp.now() does not take any arguments, 2 found'); ).toThrow('timestamp.now() does not take any arguments, 2 found');
}); });
it('validates map, 1 arg', (): void => { it('validates map, 1 arg', (): void => {
expect( expect(
extractStorageArgs(registry, storage.staking.payee, ['abc']) extractStorageArgs(registry, storage['staking']['payee'], ['abc'])
).toEqual([storage.staking.payee, ['abc']]); ).toEqual([storage['staking']['payee'], ['abc']]);
}); });
it('validates map, 1 arg (failing with no args)', (): void => { it('validates map, 1 arg (failing with no args)', (): void => {
expect( expect(
() => extractStorageArgs(registry, storage.staking.payee, []) () => extractStorageArgs(registry, storage['staking']['payee'], [])
).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 0 found'); ).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 0 found');
}); });
it('validates map, 1 arg (failing with no args)', (): void => { it('validates map, 1 arg (failing with more args)', (): void => {
expect( expect(
() => extractStorageArgs(registry, storage.staking.payee, ['abc', 'def']) () => extractStorageArgs(registry, storage['staking']['payee'], ['abc', 'def'])
).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 2 found'); ).toThrow('staking.payee(AccountId32) is a map, requiring 1 arguments, 2 found');
}); });
it('validates doublemap, 2 args', (): void => { it('validates doublemap, 2 args', (): void => {
expect( expect(
extractStorageArgs(registry, storage.staking.erasStakers, [1, '0x1234']) extractStorageArgs(registry, storage['staking']['erasStakers'], [1, '0x1234'])
).toEqual([storage.staking.erasStakers, [1, '0x1234']]); ).toEqual([storage['staking']['erasStakers'], [1, '0x1234']]);
}); });
it('validates doublemap, 2 args (failing with no args)', (): void => { it('validates doublemap, 2 args (failing with no args)', (): void => {
expect( expect(
() => extractStorageArgs(registry, storage.staking.erasStakers, []) () => extractStorageArgs(registry, storage['staking']['erasStakers'], [])
).toThrow('staking.erasStakers(u32, AccountId32) is a map, requiring 2 arguments, 0 found'); ).toThrow('staking.erasStakers(u32, AccountId32) is a map, requiring 2 arguments, 0 found');
}); });
it('validates doublemap, 2 args (failing with 1 arg)', (): void => { it('validates doublemap, 2 args (failing with 1 arg)', (): void => {
expect( expect(
() => extractStorageArgs(registry, storage.staking.erasStakers, [123]) () => extractStorageArgs(registry, storage['staking']['erasStakers'], [123])
).toThrow('staking.erasStakers(u32, AccountId32) is a map, requiring 2 arguments, 1 found'); ).toThrow('staking.erasStakers(u32, AccountId32) is a map, requiring 2 arguments, 1 found');
}); });
}); });
+2
View File
@@ -7,10 +7,12 @@
}, },
"exclude": [ "exclude": [
"**/checkTypes.manual.ts", "**/checkTypes.manual.ts",
"**/mod.ts",
"**/*.spec.ts", "**/*.spec.ts",
"**/test/**/*" "**/test/**/*"
], ],
"references": [ "references": [
{ "path": "../api-augment/tsconfig.build.json" },
{ "path": "../api-base/tsconfig.build.json" }, { "path": "../api-base/tsconfig.build.json" },
{ "path": "../api-derive/tsconfig.build.json" }, { "path": "../api-derive/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" }, { "path": "../rpc-augment/tsconfig.build.json" },
+6 -6
View File
@@ -18,13 +18,13 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@polkadot/rpc-core": "10.6.1", "@polkadot/rpc-core": "10.9.1",
"@polkadot/types": "10.6.1", "@polkadot/types": "10.9.1",
"@polkadot/types-codec": "10.6.1", "@polkadot/types-codec": "10.9.1",
"@polkadot/util": "^12.1.2", "@polkadot/util": "^12.3.1",
"tslib": "^2.5.0" "tslib": "^2.5.3"
} }
} }
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.6.1' }; export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.9.1' };
+3
View File
@@ -5,6 +5,9 @@
"outDir": "./build", "outDir": "./build",
"rootDir": "./src" "rootDir": "./src"
}, },
"exclude": [
"**/mod.ts"
],
"references": [ "references": [
{ "path": "../rpc-core/tsconfig.build.json" }, { "path": "../rpc-core/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" },
+8 -8
View File
@@ -18,18 +18,18 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@polkadot/rpc-augment": "10.6.1", "@polkadot/rpc-augment": "10.9.1",
"@polkadot/rpc-provider": "10.6.1", "@polkadot/rpc-provider": "10.9.1",
"@polkadot/types": "10.6.1", "@polkadot/types": "10.9.1",
"@polkadot/util": "^12.1.2", "@polkadot/util": "^12.3.1",
"rxjs": "^7.8.1", "rxjs": "^7.8.1",
"tslib": "^2.5.0" "tslib": "^2.5.3"
}, },
"devDependencies": { "devDependencies": {
"@polkadot/keyring": "^12.1.2", "@polkadot/keyring": "^12.3.1",
"@polkadot/rpc-augment": "10.6.1" "@polkadot/rpc-augment": "10.9.1"
} }
} }
+1 -1
View File
@@ -35,7 +35,7 @@ describe('Api', (): void => {
} }
}); });
expect(isFunction((rpc as unknown as Record<string, Record<string, boolean>>).testing.foo)).toBe(true); expect(isFunction((rpc as unknown as { testing: { foo: boolean } }).testing.foo)).toBe(true);
expect(rpc.sections.includes('testing')).toBe(true); expect(rpc.sections.includes('testing')).toBe(true);
expect(rpc.mapping.get('testing_foo')).toEqual({ expect(rpc.mapping.get('testing_foo')).toEqual({
description: 'foo', description: 'foo',
+1 -1
View File
@@ -13,7 +13,7 @@ import { RpcCore } from './index.js';
describe('methodSend', (): void => { describe('methodSend', (): void => {
const registry = new TypeRegistry(); const registry = new TypeRegistry();
let rpc: RpcCore; let rpc: RpcCore;
let methods: Record<string, DefinitionRpc>; let methods: { blah: DefinitionRpc; bleh: DefinitionRpc };
let provider: ProviderInterface; let provider: ProviderInterface;
beforeEach((): void => { beforeEach((): void => {
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev // Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.6.1' }; export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.9.1' };
+1 -1
View File
@@ -28,7 +28,7 @@ describe('replay', (): void => {
await new Promise<boolean>((resolve) => { await new Promise<boolean>((resolve) => {
rpc.system.chain().subscribe((value: any): void => { rpc.system.chain().subscribe((value: any): void => {
if (value) { if (value) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access, jest/no-conditional-expect
expect(value.toString()).toEqual('mockChain'); // Defined in MockProvider expect(value.toString()).toEqual('mockChain'); // Defined in MockProvider
resolve(true); resolve(true);
} }
+1
View File
@@ -7,6 +7,7 @@
}, },
"exclude": [ "exclude": [
"**/checkTypes.manual.ts", "**/checkTypes.manual.ts",
"**/mod.ts",
"**/*.spec.ts" "**/*.spec.ts"
], ],
"references": [ "references": [
+10 -10
View File
@@ -18,21 +18,21 @@
"./detectPackage.cjs" "./detectPackage.cjs"
], ],
"type": "module", "type": "module",
"version": "10.6.1", "version": "10.9.1",
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@polkadot/keyring": "^12.1.2", "@polkadot/keyring": "^12.3.1",
"@polkadot/types": "10.6.1", "@polkadot/types": "10.9.1",
"@polkadot/types-support": "10.6.1", "@polkadot/types-support": "10.9.1",
"@polkadot/util": "^12.1.2", "@polkadot/util": "^12.3.1",
"@polkadot/util-crypto": "^12.1.2", "@polkadot/util-crypto": "^12.3.1",
"@polkadot/x-fetch": "^12.1.2", "@polkadot/x-fetch": "^12.3.1",
"@polkadot/x-global": "^12.1.2", "@polkadot/x-global": "^12.3.1",
"@polkadot/x-ws": "^12.1.2", "@polkadot/x-ws": "^12.3.1",
"eventemitter3": "^5.0.1", "eventemitter3": "^5.0.1",
"mock-socket": "^9.2.1", "mock-socket": "^9.2.1",
"nock": "^13.3.1", "nock": "^13.3.1",
"tslib": "^2.5.0" "tslib": "^2.5.3"
}, },
"devDependencies": { "devDependencies": {
"@substrate/connect": "0.7.26" "@substrate/connect": "0.7.26"
@@ -45,14 +45,17 @@ describe('Http', (): void => {
it('does not (yet) support subscribe', async (): Promise<void> => { it('does not (yet) support subscribe', async (): Promise<void> => {
await http.subscribe('', '', [], (cb): void => { await http.subscribe('', '', [], (cb): void => {
// eslint-disable-next-line jest/no-conditional-expect
expect(cb).toEqual(expect.anything()); expect(cb).toEqual(expect.anything());
}).catch((error): void => { }).catch((error): void => {
// eslint-disable-next-line jest/no-conditional-expect
expect((error as Error).message).toMatch(/does not have subscriptions/); expect((error as Error).message).toMatch(/does not have subscriptions/);
}); });
}); });
it('does not (yet) support unsubscribe', async (): Promise<void> => { it('does not (yet) support unsubscribe', async (): Promise<void> => {
await http.unsubscribe('', '', 0).catch((error): void => { await http.unsubscribe('', '', 0).catch((error): void => {
// eslint-disable-next-line jest/no-conditional-expect
expect((error as Error).message).toMatch(/does not have subscriptions/); expect((error as Error).message).toMatch(/does not have subscriptions/);
}); });
}); });
+3 -1
View File
@@ -10,6 +10,7 @@ import { HttpProvider } from './index.js';
// Does not work with Node 18 (native fetch) // Does not work with Node 18 (native fetch)
// See https://github.com/nock/nock/issues/2397 // See https://github.com/nock/nock/issues/2397
// eslint-disable-next-line jest/no-disabled-tests
describe.skip('send', (): void => { describe.skip('send', (): void => {
let http: HttpProvider; let http: HttpProvider;
let mock: Mock; let mock: Mock;
@@ -35,7 +36,7 @@ describe.skip('send', (): void => {
return http return http
.send('test_body', ['param']) .send('test_body', ['param'])
.then((): void => { .then((): void => {
expect(mock.body.test_body).toEqual({ expect(mock.body['test_body']).toEqual({
id: 1, id: 1,
jsonrpc: '2.0', jsonrpc: '2.0',
method: 'test_body', method: 'test_body',
@@ -53,6 +54,7 @@ describe.skip('send', (): void => {
return http return http
.send('test_error', []) .send('test_error', [])
.catch((error): void => { .catch((error): void => {
// eslint-disable-next-line jest/no-conditional-expect
expect((error as Error).message).toMatch(/\[500\]/); expect((error as Error).message).toMatch(/\[500\]/);
}); });
}); });
+2 -2
View File
@@ -202,11 +202,11 @@ export class MockProvider implements ProviderInterface {
// increment the balances and nonce for each account // increment the balances and nonce for each account
keyring.getPairs().forEach(({ publicKey }, index): void => { keyring.getPairs().forEach(({ publicKey }, index): void => {
this.setStateBn(query.system.account(publicKey), newHead.number.toBn().addn(index)); this.setStateBn(query['system']['account'](publicKey), newHead.number.toBn().addn(index));
}); });
// set the timestamp for the current block // set the timestamp for the current block
this.setStateBn(query.timestamp.now(), Math.floor(Date.now() / 1000)); this.setStateBn(query['timestamp']['now'](), Math.floor(Date.now() / 1000));
this.updateSubs('chain_subscribeNewHead', newHead); this.updateSubs('chain_subscribeNewHead', newHead);
// We emit connected/disconnected at intervals // We emit connected/disconnected at intervals
+2 -1
View File
@@ -21,7 +21,8 @@ describe('on', (): void => {
await mock.disconnect(); await mock.disconnect();
}); });
it('it emits both connected and disconnected events', async (): Promise<void> => { // eslint-disable-next-line jest/expect-expect
it('emits both connected and disconnected events', async (): Promise<void> => {
const events: Record<string, boolean> = { connected: false, disconnected: false }; const events: Record<string, boolean> = { connected: false, disconnected: false };
await new Promise<boolean>((resolve) => { await new Promise<boolean>((resolve) => {
@@ -23,6 +23,7 @@ describe('send', (): void => {
return mock return mock
.send('something_invalid', []) .send('something_invalid', [])
.catch((error): void => { .catch((error): void => {
// eslint-disable-next-line jest/no-conditional-expect
expect((error as Error).message).toMatch(/Invalid method/); expect((error as Error).message).toMatch(/Invalid method/);
}); });
}); });
@@ -23,6 +23,7 @@ describe('subscribe', (): void => {
await mock await mock
.subscribe('test', 'test_notFound') .subscribe('test', 'test_notFound')
.catch((error): void => { .catch((error): void => {
// eslint-disable-next-line jest/no-conditional-expect
expect((error as Error).message).toMatch(/Invalid method 'test_notFound'/); expect((error as Error).message).toMatch(/Invalid method 'test_notFound'/);
}); });
}); });
@@ -41,12 +42,14 @@ describe('subscribe', (): void => {
await new Promise<boolean>((resolve) => { await new Promise<boolean>((resolve) => {
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, value: string): void => { mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, value: string): void => {
// eslint-disable-next-line jest/no-conditional-expect
expect(value).toEqual('testValue'); expect(value).toEqual('testValue');
resolve(true); resolve(true);
}).catch(console.error); }).catch(console.error);
}); });
}); });
// eslint-disable-next-line jest/expect-expect
it('calls back with new headers', async (): Promise<void> => { it('calls back with new headers', async (): Promise<void> => {
await new Promise<boolean>((resolve) => { await new Promise<boolean>((resolve) => {
mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, header: { number: number }): void => { mock.subscribe('chain_newHead', 'chain_subscribeNewHead', (_: any, header: { number: number }): void => {
@@ -57,6 +60,7 @@ describe('subscribe', (): void => {
}); });
}); });
// eslint-disable-next-line jest/expect-expect
it('handles errors within callbacks gracefully', async (): Promise<void> => { it('handles errors within callbacks gracefully', async (): Promise<void> => {
let hasThrown = false; let hasThrown = false;
+11 -2
View File
@@ -17,10 +17,19 @@ export interface Mock {
export type MockStateSubscriptionCallback = (error: Error | null, value: any) => void; export type MockStateSubscriptionCallback = (error: Error | null, value: any) => void;
export type MockStateSubscriptions = Record<string, { export interface MockStateSubscription {
callbacks: Record<number, MockStateSubscriptionCallback>; callbacks: Record<number, MockStateSubscriptionCallback>;
lastValue: any; lastValue: any;
}>; }
export interface MockStateSubscriptions {
// known
chain_subscribeNewHead: MockStateSubscription;
state_subscribeStorage: MockStateSubscription;
// others
[key: string]: MockStateSubscription;
}
export type MockStateDb = Record<string, Uint8Array>; export type MockStateDb = Record<string, Uint8Array>;

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