Compare commits

..
23 Commits
Author SHA1 Message Date
github-actions[bot] c054f96c80 [CI Skip] release/stable 14.0.1
skip-checks: true
2024-10-02 20:49:29 +00:00
Tarik Gul 11c1b998be 14.0.1 (#5995) 2024-10-02 23:41:55 +03:00
Tarik Gul fdebf8b74b 14.0.1 (#5994) 2024-10-02 23:22:35 +03:00
github-actions[bot] 7c91ee5ccc [CI Skip] bump/beta 13.2.2-1-x
skip-checks: true
2024-10-02 19:25:09 +00:00
Tarik Gulandbee344 c146727510 TransactionExtension, ExtrinsicV5 (#5976)
* TransactionExtension Start

* Add V5_VERSION logic to necessary classes

* Fix latest version to 5

* Add v5 dir

* Add v5 types to interfaces

* Cleanup paths

* Update ExtrinsicSignature V5

* Cleanup v5 folders

* nits

* signed works

* general works?

* Clean linter, and imports

* fix typing

* Change sign in v5 to hash all payloads

* remove SignV5Options

* Remove SignatureV5Options

* Change versioning

* added bitmasks

* cleanup

* change version to constant

* Add tests

* Decouple payload v5 from v4

* Add helper fn to get signed extension version from the registry

* Add version to encoding

* Cleanup tests

* renamed getSignedExtensionVersion to getTransactionExtensionVersion

* removed this.type for v5

* undo this.type removal

* replaced signedExtensionVersion by transactionExtensionVersion for v5 in ExtrinsicSignature

* unfinished Preamble Class

* Revert "unfinished Preamble Class"

This reverts commit 0b1c350fcc97e6f724ed84f66742be472c5daa71.

* Added test for decoding

* Fix test

* preamble typo

* updated GeneralExtrinsic [WIP]

* added generalExtrinsic

* General Extrinsic

* linting and renaming

* renaming

* Extend the v5 signed extrinsic test

* Unmask preamble

* Set payload to GeneralExtrinsicPayload

* Add test for GeneralExtrinsicPayload

* Start GeneralExtrinsicEncoded tests

* Add GeneralExt as a replacement class

* Export GeneralExt

* Fix nits

* Start decodeu8a

* GeneralExt tests

* GeneralExt fix

* updated decodeu8a

* Fix decoding

* Add error handling for invalid version

* remove fluff

* Fix version in GeneralExtrinsic

* fixes

* add parent class methods as errors

* Reorg some types

* Add test for GeneralExtrinsic

* Fix compatibility with GeneralExtrinsic

* fix structure of GeneralExtrinsic

* Add another test

* cleanup

* Fix decoding bug for bare

* fix change from bare to signed

* linting

* Fix encodinglength

* Set default to preamble to bre

* Fix tests

* fixed version setting

* Add test

---------

Co-authored-by: bee344 <alberto.penayo@parity.io>
2024-10-02 15:17:32 -04:00
github-actions[bot] 096da21c76 [CI Skip] bump/beta 13.2.2-0-x
skip-checks: true
2024-10-01 12:34:42 +00:00
Daria d3c16b5cb4 choosing AccountId20 type if the address is 20 bytes (#5991) 2024-10-01 20:27:19 +08:00
github-actions[bot] 87b4cecc1b [CI Skip] release/stable 13.2.1
skip-checks: true
2024-09-23 13:32:34 +00:00
Tarik Gul d79a5301fb 13.2.1 (#5989) 2024-09-23 09:25:08 -04:00
github-actions[bot] 7481983e44 [CI Skip] bump/beta 13.1.2-1-x
skip-checks: true
2024-09-23 13:03:06 +00:00
Tarik Gul 47291533e6 Fix logging for older runtimes for runtimeapi decoration (#5988) 2024-09-23 15:55:26 +03:00
github-actions[bot] a15d0dd0df [CI Skip] bump/beta 13.1.2-0-x
skip-checks: true
2024-09-19 12:36:04 +00:00
Tarik Gul 1dca21d607 Generate Runtime Apis Dynamically (#5986)
* Generate Runtime Apis Dynamically

* Add inline docs
2024-09-19 15:28:41 +03:00
github-actions[bot] b19d5d4dbc [CI Skip] release/stable 13.1.1
skip-checks: true
2024-09-18 01:04:12 +00:00
Tarik Gul c6c9a1259c 13.1.1 (#5985) 2024-09-18 03:56:41 +03:00
github-actions[bot] 8b1191a17f [CI Skip] bump/beta 13.0.2-3-x
skip-checks: true
2024-09-17 18:10:38 +00:00
Tarik Gul 94a900583f Bump yarn to 4.5.0 (#5983) 2024-09-17 21:03:21 +03:00
github-actions[bot] 0581fc71ce [CI Skip] bump/beta 13.0.2-2-x
skip-checks: true
2024-09-17 13:34:54 +00:00
Tarik Gul 73a5566ded Initialize the API with metadata V15 (#5941)
* Initialize the API with metadata V15

* cleanup consoles

* lint

* add check for hash

* Fix error messaging, and check for correct metdataapi version

* Add support for at

* Apply fixed

* Change compariosn

* fix comparison again

* adjustments

* Fix metadata decoding with raw types

* Fix errors to log in debug mode

* Add check for supported versions

* Fix imports

* Fix registry assignment
2024-09-17 16:27:19 +03:00
github-actions[bot] ce6e1e8825 [CI Skip] bump/beta 13.0.2-1-x
skip-checks: true
2024-09-16 22:02:00 +00:00
Cameron Marshall b04e7b0cee implement xcm dry run api (#5970)
* add definitions for xcm dry run api

* replace ITuple with Tuple

* replace ITuple with tuple syntax

* update types for xcm v3 and v4

* remove console log

* revert enum ts error logging

* fix dry run call param type name

* lint
2024-09-16 17:54:45 -04:00
github-actions[bot] 50332dab75 [CI Skip] bump/beta 13.0.2-0-x
skip-checks: true
2024-09-16 13:59:47 +00:00
Tarik Gul e615f855d1 Upgrade common to 13.1.1 (#5982) 2024-09-16 16:52:28 +03:00
76 changed files with 4229 additions and 738 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -12,4 +12,4 @@ logFilters:
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.4.1.cjs
yarnPath: .yarn/releases/yarn-4.5.0.cjs
+31
View File
@@ -1,5 +1,36 @@
# CHANGELOG
## 14.0.1 Oct 2, 2024
Changes:
- TransactionExtension, ExtrinsicV5
- This is a very large feature that gives support for Extrinsic V5. This is not a breaking change, but because of the impact it has it is a Major bump.
- This PR acts as a forward compatible feature that still focuses on v4, but allows for the use of v5 when:
a: The metadata extrinsic version is set to 5
b: The extrinsic version is set to 5 when manually constructing transactions.
- The PR allows the decoding of all v4, and v5 extrinsics including {bare, signed, general} transactions.
- Address parsing issues for H160 accounts in api.derive.accounts.{*} ([#5991](https://github.com/polkadot-js/api/pull/5991))
## 13.2.1 Sep 23, 2024
Changes:
- Generate Runtime Apis Dynamically ([#5986](https://github.com/polkadot-js/api/pull/5986))
- Fix logging for older runtimes for runtime-api decoration ([#5988](https://github.com/polkadot-js/api/pull/5988))
## 13.1.1 Sep 17, 2024
Changes:
- Upgrade polkadot/common to 13.1.1 ([#5982](https://github.com/polkadot-js/api/pull/5982))
- Implement xcm dryRunApi ([#5970](https://github.com/polkadot-js/api/pull/5970))
- Initialize the API with metadata V15 ([#5941](https://github.com/polkadot-js/api/pull/5941))
- Bump yarn to 4.5.0 ([#5983](https://github.com/polkadot-js/api/pull/5983))
## 13.0.1 Sep 10, 2024
Breaking Changes:
+3 -1
View File
@@ -1,5 +1,5 @@
3512 Jaco Bump deps (#5785)
99 Tarik Gul 13.0.1 (#5979)
109 Tarik Gul 14.0.1 (#5995)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709)
@@ -59,12 +59,14 @@
1 Aleš Ferlan fix: use H160 for address in getTransactionCount (#5472)
1 Brad Larson [NEW] Support for custom headers with providers (#2423)
1 Btwiuse Arch Add side effect check workaround (#4994) (#5009)
1 Cameron Marshall implement xcm dry run api (#5970)
1 chriswmercer little readme tweak (#279)
1 codingsh #2182 - add: search for docs (#2232)
1 coolcorexix Investigate 4559 v2 (#4608)
1 Dan Forbes Add WeightToFeeCoefficient type (#2296)
1 Daniel Maricic Fixed typo in README (#2402)
1 Daniel Savu fix: Generate custom type definitions (#4224)
1 Daria choosing AccountId20 type if the address is 20 bytes (#5991)
1 David Don't log full error (#2952)
1 David Duong Avoid reserved words during named enum fields augmentation (#5203)
1 Denis Tsai realign AccountKey20Junction to polkadot xcm's Junction enum (#3770)
+4 -4
View File
@@ -6,7 +6,7 @@
},
"homepage": "https://github.com/polkadot-js/api#readme",
"license": "Apache-2.0",
"packageManager": "yarn@4.4.1",
"packageManager": "yarn@4.5.0",
"private": true,
"repository": {
"type": "git",
@@ -14,10 +14,10 @@
},
"sideEffects": false,
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"versions": {
"git": "13.0.1",
"npm": "13.0.1"
"git": "14.0.1",
"npm": "14.0.1"
},
"workspaces": [
"packages/*"
+7 -7
View File
@@ -18,15 +18,15 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/api-base": "13.0.1",
"@polkadot/rpc-augment": "13.0.1",
"@polkadot/types": "13.0.1",
"@polkadot/types-augment": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/api-base": "14.0.1",
"@polkadot/rpc-augment": "14.0.1",
"@polkadot/types": "14.0.1",
"@polkadot/types-augment": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/util": "^13.1.1",
"tslib": "^2.7.0"
}
}
+18 -1
View File
@@ -13,6 +13,7 @@ import type { BeefyAuthoritySet, BeefyEquivocationProof, BeefyNextAuthoritySet,
import type { CheckInherentsResult, InherentData } from '@polkadot/types/interfaces/blockbuilder';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
import type { CallDryRunEffects, XcmDryRunApiError, XcmDryRunEffects } from '@polkadot/types/interfaces/dryRunApi';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { GenesisBuildErr } from '@polkadot/types/interfaces/genesisBuilder';
import type { AuthorityList, GrandpaEquivocationProof, SetId } from '@polkadot/types/interfaces/grandpa';
@@ -21,12 +22,13 @@ import type { MmrBatchProof, MmrEncodableOpaqueLeaf, MmrError } from '@polkadot/
import type { NpPoolId } from '@polkadot/types/interfaces/nompools';
import type { ApprovalVotingParams, AsyncBackingParams, BackingState, CandidateCommitments, CandidateEvent, CandidateHash, CommittedCandidateReceipt, CoreIndex, CoreState, DisputeProof, DisputeState, ExecutorParams, GroupRotationInfo, InboundDownwardMessage, InboundHrmpMessage, NodeFeatures, OccupiedCoreAssumption, ParaId, ParaValidatorIndex, PendingSlashes, PersistedValidationData, PvfCheckStatement, ScrapedOnChainVotes, SessionInfo, ValidationCode, ValidationCodeHash, ValidatorSignature } from '@polkadot/types/interfaces/parachains';
import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
import type { AccountId, Balance, Block, BlockNumber, Call, ExtrinsicInclusionMode, Hash, Header, Index, KeyTypeId, Slot, ValidatorId, Weight, WeightV2 } from '@polkadot/types/interfaces/runtime';
import type { AccountId, Balance, Block, BlockNumber, Call, ExtrinsicInclusionMode, Hash, Header, Index, KeyTypeId, OriginCaller, RuntimeCall, Slot, ValidatorId, Weight, WeightV2 } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { ValidatorIndex } from '@polkadot/types/interfaces/staking';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
import type { ApplyExtrinsicResult } from '@polkadot/types/interfaces/system';
import type { TransactionSource, TransactionValidity } from '@polkadot/types/interfaces/txqueue';
import type { VersionedMultiLocation, VersionedXcm } from '@polkadot/types/interfaces/xcm';
import type { XcmPaymentApiError } from '@polkadot/types/interfaces/xcmPaymentApi';
import type { Error } from '@polkadot/types/interfaces/xcmRuntimeApi';
import type { XcmVersionedAssetId, XcmVersionedLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
@@ -170,6 +172,21 @@ declare module '@polkadot/api-base/types/calls' {
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0x91b1c8b16328eb92/1 */
dryRunApi: {
/**
* Dry run call
**/
dryRunCall: AugmentedCall<ApiType, (origin: OriginCaller | { System: any } | string | Uint8Array, call: RuntimeCall | IMethod | string | Uint8Array) => Observable<Result<CallDryRunEffects, XcmDryRunApiError>>>;
/**
* Dry run XCM program
**/
dryRunXcm: AugmentedCall<ApiType, (originLocation: VersionedMultiLocation | { V0: any } | { V1: any } | { V2: any } | { V3: any } | { V4: any } | string | Uint8Array, xcm: VersionedXcm | { V0: any } | { V1: any } | { V2: any } | { V3: any } | { V4: any } | string | Uint8Array) => Observable<Result<XcmDryRunEffects, XcmDryRunApiError>>>;
/**
* Generic call
**/
[key: string]: DecoratedCallBase<ApiType>;
};
/** 0xfbc577b9d747efd6/1 */
genesisBuilder: {
/**
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '14.0.1' };
+4 -4
View File
@@ -18,12 +18,12 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "13.0.1",
"@polkadot/types": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/rpc-core": "14.0.1",
"@polkadot/types": "14.0.1",
"@polkadot/util": "^13.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.7.0"
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '14.0.1' };
+11 -11
View File
@@ -18,22 +18,22 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/api": "13.0.1",
"@polkadot/api-augment": "13.0.1",
"@polkadot/types": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/types-create": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/util-crypto": "^13.0.2",
"@polkadot/api": "14.0.1",
"@polkadot/api-augment": "14.0.1",
"@polkadot/types": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/types-create": "14.0.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.7.0"
},
"devDependencies": {
"@polkadot/api-augment": "13.0.1",
"@polkadot/keyring": "^13.0.2",
"@polkadot/types-support": "13.0.1"
"@polkadot/api-augment": "14.0.1",
"@polkadot/keyring": "^13.1.1",
"@polkadot/types-support": "14.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '14.0.1' };
+14 -14
View File
@@ -18,25 +18,25 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/api": "13.0.1",
"@polkadot/api-augment": "13.0.1",
"@polkadot/api-base": "13.0.1",
"@polkadot/rpc-core": "13.0.1",
"@polkadot/types": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/util-crypto": "^13.0.2",
"@polkadot/api": "14.0.1",
"@polkadot/api-augment": "14.0.1",
"@polkadot/api-base": "14.0.1",
"@polkadot/rpc-core": "14.0.1",
"@polkadot/types": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.7.0"
},
"devDependencies": {
"@polkadot/api": "13.0.1",
"@polkadot/api-augment": "13.0.1",
"@polkadot/rpc-augment": "13.0.1",
"@polkadot/rpc-provider": "13.0.1",
"@polkadot/types-support": "13.0.1"
"@polkadot/api": "14.0.1",
"@polkadot/api-augment": "14.0.1",
"@polkadot/rpc-augment": "14.0.1",
"@polkadot/rpc-provider": "14.0.1",
"@polkadot/types-support": "14.0.1"
}
}
@@ -24,7 +24,7 @@ export function accountId (instanceId: string, api: DeriveApi): (address?: Addre
: decodeAddress((address || '').toString());
if (decoded.length > 8) {
return of(api.registry.createType('AccountId', decoded));
return of(api.registry.createType(decoded.length === 20 ? 'AccountId20' : 'AccountId', decoded));
}
const accountIndex = api.registry.createType('AccountIndex', decoded);
@@ -34,7 +34,7 @@ export function idAndIndex (instanceId: string, api: DeriveApi): (address?: Addr
: decodeAddress((address || '').toString());
if (decoded.length > 8) {
const accountId = api.registry.createType('AccountId', decoded);
const accountId = api.registry.createType(decoded.length === 20 ? 'AccountId20' : 'AccountId', decoded);
return api.derive.accounts.idToIndex(accountId).pipe(
map((accountIndex): AccountIdAndIndex => [accountId, accountIndex])
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '14.0.1' };
+17 -17
View File
@@ -18,29 +18,29 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/api-augment": "13.0.1",
"@polkadot/api-base": "13.0.1",
"@polkadot/api-derive": "13.0.1",
"@polkadot/keyring": "^13.0.2",
"@polkadot/rpc-augment": "13.0.1",
"@polkadot/rpc-core": "13.0.1",
"@polkadot/rpc-provider": "13.0.1",
"@polkadot/types": "13.0.1",
"@polkadot/types-augment": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/types-create": "13.0.1",
"@polkadot/types-known": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/util-crypto": "^13.0.2",
"@polkadot/api-augment": "14.0.1",
"@polkadot/api-base": "14.0.1",
"@polkadot/api-derive": "14.0.1",
"@polkadot/keyring": "^13.1.1",
"@polkadot/rpc-augment": "14.0.1",
"@polkadot/rpc-core": "14.0.1",
"@polkadot/rpc-provider": "14.0.1",
"@polkadot/types": "14.0.1",
"@polkadot/types-augment": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/types-create": "14.0.1",
"@polkadot/types-known": "14.0.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"eventemitter3": "^5.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.7.0"
},
"devDependencies": {
"@polkadot/api-augment": "13.0.1",
"@polkadot/types-support": "13.0.1"
"@polkadot/api-augment": "14.0.1",
"@polkadot/types-support": "14.0.1"
}
}
+103 -41
View File
@@ -4,11 +4,11 @@
import type { Observable } from 'rxjs';
import type { AugmentedCall, DeriveCustom, QueryableCalls } from '@polkadot/api-base/types';
import type { RpcInterface } from '@polkadot/rpc-core/types';
import type { Metadata, StorageKey, Text, u64 } from '@polkadot/types';
import type { Call, Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { Metadata, StorageKey, Text, u64, Vec } from '@polkadot/types';
import type { Call, Hash, RuntimeApiMethodMetadataV15, RuntimeVersion } from '@polkadot/types/interfaces';
import type { DecoratedMeta } from '@polkadot/types/metadata/decorate/types';
import type { StorageEntry } from '@polkadot/types/primitive/types';
import type { AnyFunction, AnyJson, AnyTuple, CallFunction, Codec, DefinitionCallNamed, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, DefinitionsCallEntry, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types';
import type { AnyFunction, AnyJson, AnyTuple, CallFunction, Codec, DefinitionCall, DefinitionCallNamed, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, DefinitionsCallEntry, DetectCodec, IMethod, IStorageKey, Registry, RegistryError, RegistryTypes } from '@polkadot/types/types';
import type { HexString } from '@polkadot/util/types';
import type { SubmittableExtrinsic } from '../submittable/types.js';
import type { ApiDecoration, ApiInterfaceRx, ApiOptions, ApiTypes, AugmentedQuery, DecoratedErrors, DecoratedEvents, DecoratedRpc, DecorateMethod, GenericStorageEntryFunction, PaginationOptions, QueryableConsts, QueryableStorage, QueryableStorageEntry, QueryableStorageEntryAt, QueryableStorageMulti, QueryableStorageMultiArg, SubmittableExtrinsicFunction, SubmittableExtrinsics } from '../types/index.js';
@@ -492,64 +492,126 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
return Object.entries(result);
}
// pre-metadata decoration
// Helper for _getRuntimeDefsViaMetadata
protected _getMethods (registry: Registry, methods: Vec<RuntimeApiMethodMetadataV15>) {
const result: Record<string, DefinitionCall> = {};
methods.forEach((m) => {
const { docs, inputs, name, output } = m;
result[name.toString()] = {
description: docs.map((d) => d.toString()).join(),
params: inputs.map(({ name, type }) => {
return { name: name.toString(), type: registry.lookup.getName(type) || registry.lookup.getTypeDef(type).type };
}),
type: registry.lookup.getName(output) || registry.lookup.getTypeDef(output).type
};
});
return result;
}
// Maintains the same structure as `_getRuntimeDefs` in order to make conversion easier.
protected _getRuntimeDefsViaMetadata (registry: Registry): [string, DefinitionsCallEntry[]][] {
const result: DefinitionsCall = {};
const { apis } = registry.metadata;
for (let i = 0, count = apis.length; i < count; i++) {
const { methods, name } = apis[i];
result[name.toString()] = [{
methods: this._getMethods(registry, methods),
// We set the version to 0 here since it will not be relevant when we are grabbing the runtime apis
// from the Metadata.
version: 0
}];
}
return Object.entries(result);
}
// When the calls are available in the metadata, it will generate them based off of the metadata.
// When they are not available it will use the hardcoded calls generated in the static types.
protected _decorateCalls<ApiType extends ApiTypes> ({ registry, runtimeVersion: { apis, specName, specVersion } }: VersionedRegistry<any>, decorateMethod: DecorateMethod<ApiType>, blockHash?: Uint8Array | string | null): QueryableCalls<ApiType> {
const result = {} as QueryableCalls<ApiType>;
const named: Record<string, Record<string, DefinitionCallNamed>> = {};
const hashes: Record<HexString, boolean> = {};
const sections = this._getRuntimeDefs(registry, specName, this._runtimeChain);
const isApiInMetadata = registry.metadata.apis.length > 0;
const sections = isApiInMetadata ? this._getRuntimeDefsViaMetadata(registry) : this._getRuntimeDefs(registry, specName, this._runtimeChain);
const older: string[] = [];
const implName = `${specName.toString()}/${specVersion.toString()}`;
const hasLogged = this.#runtimeLog[implName] || false;
this.#runtimeLog[implName] = true;
for (let i = 0, scount = sections.length; i < scount; i++) {
const [_section, secs] = sections[i];
const sectionHash = blake2AsHex(_section, 64);
const rtApi = apis.find(([a]) => a.eq(sectionHash));
if (isApiInMetadata) {
for (let i = 0, scount = sections.length; i < scount; i++) {
const [_section, secs] = sections[i];
const sec = secs[0];
const sectionHash = blake2AsHex(_section, 64);
hashes[sectionHash] = true;
const section = stringCamelCase(_section);
const methods = Object.entries(sec.methods);
if (rtApi) {
const all = secs.map(({ version }) => version).sort();
const sec = secs.find(({ version }) => rtApi[1].eq(version));
if (!named[section]) {
named[section] = {};
}
if (sec) {
const section = stringCamelCase(_section);
const methods = Object.entries(sec.methods);
for (let m = 0, mcount = methods.length; m < mcount; m++) {
const [_method, def] = methods[m];
const method = stringCamelCase(_method);
if (methods.length) {
if (!named[section]) {
named[section] = {};
}
for (let m = 0, mcount = methods.length; m < mcount; m++) {
const [_method, def] = methods[m];
const method = stringCamelCase(_method);
named[section][method] = objectSpread({ method, name: `${_section}_${_method}`, section, sectionHash }, def);
}
}
} else {
older.push(`${_section}/${rtApi[1].toString()} (${all.join('/')} known)`);
named[section][method] = objectSpread({ method, name: `${_section}_${_method}`, section, sectionHash }, def);
}
}
}
} else {
for (let i = 0, scount = sections.length; i < scount; i++) {
const [_section, secs] = sections[i];
const sectionHash = blake2AsHex(_section, 64);
const rtApi = apis.find(([a]) => a.eq(sectionHash));
// find the runtimes that we don't have hashes for
const notFound = apis
.map(([a, v]): [HexString, string] => [a.toHex(), v.toString()])
.filter(([a]) => !hashes[a])
.map(([a, v]) => `${this._runtimeMap[a] || a}/${v}`);
hashes[sectionHash] = true;
if (!this._options.noInitWarn && !hasLogged) {
if (older.length) {
l.warn(`${implName}: Not decorating runtime apis without matching versions: ${older.join(', ')}`);
if (rtApi) {
const all = secs.map(({ version }) => version).sort();
const sec = secs.find(({ version }) => rtApi[1].eq(version));
if (sec) {
const section = stringCamelCase(_section);
const methods = Object.entries(sec.methods);
if (methods.length) {
if (!named[section]) {
named[section] = {};
}
for (let m = 0, mcount = methods.length; m < mcount; m++) {
const [_method, def] = methods[m];
const method = stringCamelCase(_method);
named[section][method] = objectSpread({ method, name: `${_section}_${_method}`, section, sectionHash }, def);
}
}
} else {
older.push(`${_section}/${rtApi[1].toString()} (${all.join('/')} known)`);
}
}
}
if (notFound.length) {
l.warn(`${implName}: Not decorating unknown runtime apis: ${notFound.join(', ')}`);
// find the runtimes that we don't have hashes for
const notFound = apis
.map(([a, v]): [HexString, string] => [a.toHex(), v.toString()])
.filter(([a]) => !hashes[a])
.map(([a, v]) => `${this._runtimeMap[a] || a}/${v}`);
if (!this._options.noInitWarn && !hasLogged) {
if (older.length) {
l.warn(`${implName}: Not decorating runtime apis without matching versions: ${older.join(', ')}`);
}
if (notFound.length) {
l.warn(`${implName}: Not decorating unknown runtime apis: ${notFound.join(', ')}`);
}
}
}
+76 -16
View File
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable, Subscription } from 'rxjs';
import type { Text } from '@polkadot/types';
import type { Bytes, Text, u32, Vec } from '@polkadot/types';
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { ChainProperties, Hash, HeaderPartial, RuntimeVersion, RuntimeVersionPartial } from '@polkadot/types/interfaces';
import type { BlockHash, ChainProperties, Hash, HeaderPartial, RuntimeVersion, RuntimeVersionApi, RuntimeVersionPartial } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { HexString } from '@polkadot/util/types';
@@ -16,12 +16,13 @@ import { firstValueFrom, map, of, switchMap } from 'rxjs';
import { Metadata, TypeRegistry } from '@polkadot/types';
import { getSpecAlias, getSpecExtensions, getSpecHasher, getSpecRpc, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known';
import { assertReturn, BN_ZERO, isUndefined, logger, noop, objectSpread, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util';
import { cryptoWaitReady } from '@polkadot/util-crypto';
import { blake2AsHex, cryptoWaitReady } from '@polkadot/util-crypto';
import { Decorate } from './Decorate.js';
const KEEPALIVE_INTERVAL = 10000;
const WITH_VERSION_SHORTCUT = false;
const SUPPORTED_METADATA_VERSIONS = [15, 14];
const l = logger('api/init');
@@ -125,9 +126,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
private async _createBlockRegistry (blockHash: Uint8Array, header: HeaderPartial, version: RuntimeVersionPartial): Promise<VersionedRegistry<ApiType>> {
const registry = new TypeRegistry(blockHash);
const metadata = new Metadata(registry,
await firstValueFrom(this._rpcCore.state.getMetadata.raw<HexString>(header.parentHash))
);
const metadata = await this._retrieveMetadata(version.apis, header.parentHash, registry);
const runtimeChain = this._runtimeChain;
if (!runtimeChain) {
@@ -330,15 +329,12 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
}
private async _metaFromChain (optMetadata?: Record<string, HexString>): Promise<[Hash, Metadata]> {
const [genesisHash, runtimeVersion, chain, chainProps, rpcMethods, chainMetadata] = await Promise.all([
const [genesisHash, runtimeVersion, chain, chainProps, rpcMethods] = await Promise.all([
firstValueFrom(this._rpcCore.chain.getBlockHash(0)),
firstValueFrom(this._rpcCore.state.getRuntimeVersion()),
firstValueFrom(this._rpcCore.system.chain()),
firstValueFrom(this._rpcCore.system.properties()),
firstValueFrom(this._rpcCore.rpc.methods()),
optMetadata
? Promise.resolve(null)
: firstValueFrom(this._rpcCore.state.getMetadata())
firstValueFrom(this._rpcCore.rpc.methods())
]);
// set our chain version & genesisHash as returned
@@ -348,11 +344,9 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
// retrieve metadata, either from chain or as pass-in via options
const metadataKey = `${genesisHash.toHex() || '0x'}-${runtimeVersion.specVersion.toString()}`;
const metadata = chainMetadata || (
optMetadata?.[metadataKey]
? new Metadata(this.registry, optMetadata[metadataKey])
: await firstValueFrom(this._rpcCore.state.getMetadata())
);
const metadata = optMetadata?.[metadataKey]
? new Metadata(this.registry, optMetadata[metadataKey])
: await this._retrieveMetadata(runtimeVersion.apis);
// initializes the registry & RPC
this._initRegistry(this.registry, chain, runtimeVersion, metadata, chainProps);
@@ -392,6 +386,72 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
return true;
}
/**
* @internal
*
* Tries to use runtime api calls to retrieve metadata. This ensures the api initializes with the latest metadata.
* If the runtime call is not there it will use the rpc method.
*/
private async _retrieveMetadata (apis: Vec<RuntimeVersionApi>, at?: BlockHash | string | Uint8Array, registry?: TypeRegistry): Promise<Metadata> {
let metadataVersion: u32 | null = null;
const metadataApi = apis.find(([a]) => a.eq(blake2AsHex('Metadata', 64)));
const typeRegistry = registry || this.registry;
// This chain does not have support for the metadataApi, or does not have the required version.
if (!metadataApi || metadataApi[1].toNumber() < 2) {
l.warn('MetadataApi not available, rpc::state::get_metadata will be used.');
return at
? new Metadata(typeRegistry, await firstValueFrom(this._rpcCore.state.getMetadata.raw<HexString>(at)))
: await firstValueFrom(this._rpcCore.state.getMetadata());
}
try {
const metadataVersionsAsBytes = at
? await firstValueFrom(this._rpcCore.state.call.raw('Metadata_metadata_versions', '0x', at))
: await firstValueFrom(this._rpcCore.state.call('Metadata_metadata_versions', '0x'));
const versions = typeRegistry.createType('Vec<u32>', metadataVersionsAsBytes);
metadataVersion = versions.reduce((largest, current) => current.gt(largest) ? current : largest);
} catch (e) {
l.debug((e as Error).message);
l.warn('error with state_call::Metadata_metadata_versions, rpc::state::get_metadata will be used');
}
// When the metadata version does not align with the latest supported versions we ensure not to call the metadata runtime call.
// I noticed on some previous runtimes that have support for `Metadata_metadata_at_version` that very irregular versions were being returned.
// This was evident with runtime 1000000 - it return a very large number. This ensures we always stick within what is supported.
if (metadataVersion && !SUPPORTED_METADATA_VERSIONS.includes(metadataVersion.toNumber())) {
metadataVersion = null;
}
if (metadataVersion) {
try {
const metadataBytes = at
? await firstValueFrom(this._rpcCore.state.call.raw<Bytes>('Metadata_metadata_at_version', u8aToHex(metadataVersion.toU8a()), at))
: await firstValueFrom(this._rpcCore.state.call('Metadata_metadata_at_version', u8aToHex(metadataVersion.toU8a())));
// When the metadata is called with `at` it is required to use `.raw`. Therefore since the length prefix is not present the
// need to create a `Raw` type is necessary before creating the `OpaqueMetadata` type or else there will be a magic number
// mismatch
const rawMeta = at
? typeRegistry.createType('Raw', metadataBytes).toU8a()
: metadataBytes;
const opaqueMetadata = typeRegistry.createType('Option<OpaqueMetadata>', rawMeta).unwrapOr(null);
if (opaqueMetadata) {
return new Metadata(typeRegistry, opaqueMetadata.toHex());
}
} catch (e) {
l.debug((e as Error).message);
l.warn('error with state_call::Metadata_metadata_at_version, rpc::state::get_metadata will be used');
}
}
return at
? new Metadata(typeRegistry, await firstValueFrom(this._rpcCore.state.getMetadata.raw<HexString>(at)))
: await firstValueFrom(this._rpcCore.state.getMetadata());
}
private _subscribeHealth (): void {
this._unsubscribeHealth();
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '14.0.1' };
+5 -5
View File
@@ -18,13 +18,13 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "13.0.1",
"@polkadot/types": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/rpc-core": "14.0.1",
"@polkadot/types": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/util": "^13.1.1",
"tslib": "^2.7.0"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '14.0.1' };
+7 -7
View File
@@ -18,18 +18,18 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-augment": "13.0.1",
"@polkadot/rpc-provider": "13.0.1",
"@polkadot/types": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/rpc-augment": "14.0.1",
"@polkadot/rpc-provider": "14.0.1",
"@polkadot/types": "14.0.1",
"@polkadot/util": "^13.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.7.0"
},
"devDependencies": {
"@polkadot/keyring": "^13.0.2",
"@polkadot/rpc-augment": "13.0.1"
"@polkadot/keyring": "^13.1.1",
"@polkadot/rpc-augment": "14.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '14.0.1' };
+9 -9
View File
@@ -18,17 +18,17 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/keyring": "^13.0.2",
"@polkadot/types": "13.0.1",
"@polkadot/types-support": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/util-crypto": "^13.0.2",
"@polkadot/x-fetch": "^13.0.2",
"@polkadot/x-global": "^13.0.2",
"@polkadot/x-ws": "^13.0.2",
"@polkadot/keyring": "^13.1.1",
"@polkadot/types": "14.0.1",
"@polkadot/types-support": "14.0.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/x-fetch": "^13.1.1",
"@polkadot/x-global": "^13.1.1",
"@polkadot/x-ws": "^13.1.1",
"eventemitter3": "^5.0.1",
"mock-socket": "^9.3.1",
"nock": "^13.5.4",
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '14.0.1' };
+13 -13
View File
@@ -18,7 +18,7 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
@@ -28,18 +28,18 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
},
"dependencies": {
"@polkadot/api": "13.0.1",
"@polkadot/api-augment": "13.0.1",
"@polkadot/rpc-augment": "13.0.1",
"@polkadot/rpc-provider": "13.0.1",
"@polkadot/types": "13.0.1",
"@polkadot/types-augment": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/types-create": "13.0.1",
"@polkadot/types-support": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/util-crypto": "^13.0.2",
"@polkadot/x-ws": "^13.0.2",
"@polkadot/api": "14.0.1",
"@polkadot/api-augment": "14.0.1",
"@polkadot/rpc-augment": "14.0.1",
"@polkadot/rpc-provider": "14.0.1",
"@polkadot/types": "14.0.1",
"@polkadot/types-augment": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/types-create": "14.0.1",
"@polkadot/types-support": "14.0.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/x-ws": "^13.1.1",
"handlebars": "^4.7.8",
"tslib": "^2.7.0",
"yargs": "^17.7.2"
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '14.0.1' };
+4 -4
View File
@@ -18,12 +18,12 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/types": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/types": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/util": "^13.1.1",
"tslib": "^2.7.0"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '14.0.1' };
@@ -30,11 +30,12 @@ import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot
import type { CollationInfo, CollationInfoV1, ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
import type { BlockStats } from '@polkadot/types/interfaces/dev';
import type { CallDryRunEffects, DispatchResultWithPostInfo, PostDispatchInfo, XcmDryRunApiError, XcmDryRunEffects } from '@polkadot/types/interfaces/dryRunApi';
import type { ApprovalFlag, DefunctVoter, Renouncing, SetIndex, Vote, VoteIndex, VoteThreshold, VoterInfo } from '@polkadot/types/interfaces/elections';
import type { CreatedBlock, ImportedAux } from '@polkadot/types/interfaces/engine';
import type { BlockV0, BlockV1, BlockV2, EIP1559Transaction, EIP2930Transaction, EthAccessList, EthAccessListItem, EthAccount, EthAddress, EthBlock, EthBloom, EthCallRequest, EthFeeHistory, EthFilter, EthFilterAddress, EthFilterChanges, EthFilterTopic, EthFilterTopicEntry, EthFilterTopicInner, EthHeader, EthLog, EthReceipt, EthReceiptV0, EthReceiptV3, EthRichBlock, EthRichHeader, EthStorageProof, EthSubKind, EthSubParams, EthSubResult, EthSyncInfo, EthSyncStatus, EthTransaction, EthTransactionAction, EthTransactionCondition, EthTransactionRequest, EthTransactionSignature, EthTransactionStatus, EthWork, EthereumAccountId, EthereumAddress, EthereumLookupSource, EthereumSignature, LegacyTransaction, TransactionV0, TransactionV1, TransactionV2 } from '@polkadot/types/interfaces/eth';
import type { EvmAccount, EvmCallInfo, EvmCallInfoV2, EvmCreateInfo, EvmCreateInfoV2, EvmLog, EvmVicinity, EvmWeightInfo, ExitError, ExitFatal, ExitReason, ExitRevert, ExitSucceed } from '@polkadot/types/interfaces/evm';
import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicUnknown, ExtrinsicV4, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
import type { AnySignature, EcdsaSignature, Ed25519Signature, Era, Extrinsic, ExtrinsicEra, ExtrinsicPayload, ExtrinsicPayloadUnknown, ExtrinsicPayloadV4, ExtrinsicPayloadV5, ExtrinsicSignature, ExtrinsicSignatureV4, ExtrinsicSignatureV5, ExtrinsicUnknown, ExtrinsicV4, ExtrinsicV5, ImmortalEra, MortalEra, MultiSignature, Signature, SignerPayload, Sr25519Signature } from '@polkadot/types/interfaces/extrinsics';
import type { FungiblesAccessError } from '@polkadot/types/interfaces/fungibles';
import type { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV1 } from '@polkadot/types/interfaces/genericAsset';
import type { GenesisBuildErr } from '@polkadot/types/interfaces/genesisBuilder';
@@ -73,7 +74,7 @@ import type { TransactionSource, TransactionValidity, ValidTransaction } from '@
import type { ClassDetails, ClassId, ClassMetadata, DepositBalance, DepositBalanceOf, DestroyWitness, InstanceDetails, InstanceId, InstanceMetadata } from '@polkadot/types/interfaces/uniques';
import type { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
import type { VestingInfo } from '@polkadot/types/interfaces/vesting';
import type { AssetInstance, AssetInstanceV0, AssetInstanceV1, AssetInstanceV2, BodyId, BodyPart, DoubleEncodedCall, Fungibility, FungibilityV0, FungibilityV1, FungibilityV2, InboundStatus, InstructionV2, InteriorMultiLocation, Junction, JunctionV0, JunctionV1, JunctionV2, Junctions, JunctionsV1, JunctionsV2, MultiAsset, MultiAssetFilter, MultiAssetFilterV1, MultiAssetFilterV2, MultiAssetV0, MultiAssetV1, MultiAssetV2, MultiAssets, MultiAssetsV1, MultiAssetsV2, MultiLocation, MultiLocationV0, MultiLocationV1, MultiLocationV2, NetworkId, OriginKindV0, OriginKindV1, OriginKindV2, OutboundStatus, Outcome, QueryId, QueryStatus, QueueConfigData, Response, ResponseV0, ResponseV1, ResponseV2, ResponseV2Error, ResponseV2Result, VersionMigrationStage, VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation, VersionedResponse, VersionedXcm, WeightLimitV2, WildFungibility, WildFungibilityV0, WildFungibilityV1, WildFungibilityV2, WildMultiAsset, WildMultiAssetV1, WildMultiAssetV2, Xcm, XcmAssetId, XcmError, XcmErrorV0, XcmErrorV1, XcmErrorV2, XcmOrder, XcmOrderV0, XcmOrderV1, XcmOrderV2, XcmOrigin, XcmOriginKind, XcmV0, XcmV1, XcmV2, XcmVersion, XcmpMessageFormat } from '@polkadot/types/interfaces/xcm';
import type { AssetIdV2, AssetIdV3, AssetIdV4, AssetInstance, AssetInstanceV0, AssetInstanceV1, AssetInstanceV2, AssetInstanceV3, AssetInstanceV4, BodyId, BodyIdV2, BodyIdV3, BodyPart, BodyPartV2, BodyPartV3, DoubleEncodedCall, Fungibility, FungibilityV0, FungibilityV1, FungibilityV2, FungibilityV3, FungibilityV4, InboundStatus, InstructionV2, InstructionV3, InstructionV4, InteriorMultiLocation, InteriorMultiLocationV2, InteriorMultiLocationV3, Junction, JunctionV0, JunctionV1, JunctionV2, JunctionV3, JunctionV4, Junctions, JunctionsV1, JunctionsV2, JunctionsV3, JunctionsV4, MaxPalletNameLen, MaxPalletsInfo, MaybeErrorCodeV3, MultiAsset, MultiAssetFilter, MultiAssetFilterV1, MultiAssetFilterV2, MultiAssetFilterV3, MultiAssetFilterV4, MultiAssetV0, MultiAssetV1, MultiAssetV2, MultiAssetV3, MultiAssetV4, MultiAssets, MultiAssetsV1, MultiAssetsV2, MultiAssetsV3, MultiAssetsV4, MultiLocation, MultiLocationV0, MultiLocationV1, MultiLocationV2, MultiLocationV3, MultiLocationV4, NetworkId, NetworkIdV2, NetworkIdV3, NetworkIdV4, OriginKindV0, OriginKindV1, OriginKindV2, OriginKindV3, OriginKindV4, OutboundStatus, Outcome, OutcomeV4, PalletInfoV3, PalletInfoV4, QueryId, QueryResponseInfoV3, QueryResponseInfoV4, QueryStatus, QueueConfigData, Response, ResponseV0, ResponseV1, ResponseV2, ResponseV2Error, ResponseV3, ResponseV3Error, ResponseV3Result, ResponseV4, UncheckedFungibilityV4, VersionMigrationStage, VersionV3, VersionV4, VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation, VersionedResponse, VersionedXcm, WeightLimitV2, WeightLimitV3, WildFungibility, WildFungibilityV0, WildFungibilityV1, WildFungibilityV2, WildFungibilityV3, WildFungibilityV4, WildMultiAsset, WildMultiAssetV1, WildMultiAssetV2, WildMultiAssetV3, WildMultiAssetV4, Xcm, XcmAssetId, XcmError, XcmErrorV0, XcmErrorV1, XcmErrorV2, XcmErrorV3, XcmErrorV4, XcmOrderV0, XcmOrderV1, XcmOrigin, XcmOriginKind, XcmV0, XcmV1, XcmV2, XcmV3, XcmV4, XcmVersion, XcmpMessageFormat } from '@polkadot/types/interfaces/xcm';
import type { XcmPaymentApiError } from '@polkadot/types/interfaces/xcmPaymentApi';
import type { Error } from '@polkadot/types/interfaces/xcmRuntimeApi';
@@ -122,10 +123,15 @@ declare module '@polkadot/types/types/registry' {
AssetDestroyWitness: AssetDestroyWitness;
AssetDetails: AssetDetails;
AssetId: AssetId;
AssetIdV2: AssetIdV2;
AssetIdV3: AssetIdV3;
AssetIdV4: AssetIdV4;
AssetInstance: AssetInstance;
AssetInstanceV0: AssetInstanceV0;
AssetInstanceV1: AssetInstanceV1;
AssetInstanceV2: AssetInstanceV2;
AssetInstanceV3: AssetInstanceV3;
AssetInstanceV4: AssetInstanceV4;
AssetMetadata: AssetMetadata;
AssetOptions: AssetOptions;
AssignmentId: AssignmentId;
@@ -198,7 +204,11 @@ declare module '@polkadot/types/types/registry' {
BlockV2: BlockV2;
BlockWeights: BlockWeights;
BodyId: BodyId;
BodyIdV2: BodyIdV2;
BodyIdV3: BodyIdV3;
BodyPart: BodyPart;
BodyPartV2: BodyPartV2;
BodyPartV3: BodyPartV3;
bool: bool;
Bool: Bool;
Bounty: Bounty;
@@ -214,6 +224,7 @@ declare module '@polkadot/types/types/registry' {
BufferedSessionChange: BufferedSessionChange;
Bytes: Bytes;
Call: Call;
CallDryRunEffects: CallDryRunEffects;
CallHash: CallHash;
CallHashOf: CallHashOf;
CallIndex: CallIndex;
@@ -373,6 +384,7 @@ declare module '@polkadot/types/types/registry' {
DispatchResult: DispatchResult;
DispatchResultOf: DispatchResultOf;
DispatchResultTo198: DispatchResultTo198;
DispatchResultWithPostInfo: DispatchResultWithPostInfo;
DisputeLocation: DisputeLocation;
DisputeProof: DisputeProof;
DisputeResult: DisputeResult;
@@ -492,12 +504,15 @@ declare module '@polkadot/types/types/registry' {
ExtrinsicPayload: ExtrinsicPayload;
ExtrinsicPayloadUnknown: ExtrinsicPayloadUnknown;
ExtrinsicPayloadV4: ExtrinsicPayloadV4;
ExtrinsicPayloadV5: ExtrinsicPayloadV5;
ExtrinsicSignature: ExtrinsicSignature;
ExtrinsicSignatureV4: ExtrinsicSignatureV4;
ExtrinsicSignatureV5: ExtrinsicSignatureV5;
ExtrinsicStatus: ExtrinsicStatus;
ExtrinsicsWeight: ExtrinsicsWeight;
ExtrinsicUnknown: ExtrinsicUnknown;
ExtrinsicV4: ExtrinsicV4;
ExtrinsicV5: ExtrinsicV5;
f32: f32;
F32: F32;
f64: f64;
@@ -533,6 +548,8 @@ declare module '@polkadot/types/types/registry' {
FungibilityV0: FungibilityV0;
FungibilityV1: FungibilityV1;
FungibilityV2: FungibilityV2;
FungibilityV3: FungibilityV3;
FungibilityV4: FungibilityV4;
FungiblesAccessError: FungiblesAccessError;
Gas: Gas;
GenesisBuildErr: GenesisBuildErr;
@@ -619,8 +636,12 @@ declare module '@polkadot/types/types/registry' {
InstantiateReturnValueOk: InstantiateReturnValueOk;
InstantiateReturnValueTo267: InstantiateReturnValueTo267;
InstructionV2: InstructionV2;
InstructionV3: InstructionV3;
InstructionV4: InstructionV4;
InstructionWeights: InstructionWeights;
InteriorMultiLocation: InteriorMultiLocation;
InteriorMultiLocationV2: InteriorMultiLocationV2;
InteriorMultiLocationV3: InteriorMultiLocationV3;
InvalidDisputeStatementKind: InvalidDisputeStatementKind;
InvalidTransaction: InvalidTransaction;
isize: isize;
@@ -630,9 +651,13 @@ declare module '@polkadot/types/types/registry' {
Junctions: Junctions;
JunctionsV1: JunctionsV1;
JunctionsV2: JunctionsV2;
JunctionsV3: JunctionsV3;
JunctionsV4: JunctionsV4;
JunctionV0: JunctionV0;
JunctionV1: JunctionV1;
JunctionV2: JunctionV2;
JunctionV3: JunctionV3;
JunctionV4: JunctionV4;
Justification: Justification;
JustificationNotification: JustificationNotification;
Justifications: Justifications;
@@ -657,6 +682,9 @@ declare module '@polkadot/types/types/registry' {
LookupSource: LookupSource;
LookupTarget: LookupTarget;
LotteryConfig: LotteryConfig;
MaxPalletNameLen: MaxPalletNameLen;
MaxPalletsInfo: MaxPalletsInfo;
MaybeErrorCodeV3: MaybeErrorCodeV3;
MaybeRandomness: MaybeRandomness;
MaybeVrf: MaybeVrf;
MemberCount: MemberCount;
@@ -713,22 +741,33 @@ declare module '@polkadot/types/types/registry' {
MultiAssetFilter: MultiAssetFilter;
MultiAssetFilterV1: MultiAssetFilterV1;
MultiAssetFilterV2: MultiAssetFilterV2;
MultiAssetFilterV3: MultiAssetFilterV3;
MultiAssetFilterV4: MultiAssetFilterV4;
MultiAssets: MultiAssets;
MultiAssetsV1: MultiAssetsV1;
MultiAssetsV2: MultiAssetsV2;
MultiAssetsV3: MultiAssetsV3;
MultiAssetsV4: MultiAssetsV4;
MultiAssetV0: MultiAssetV0;
MultiAssetV1: MultiAssetV1;
MultiAssetV2: MultiAssetV2;
MultiAssetV3: MultiAssetV3;
MultiAssetV4: MultiAssetV4;
MultiDisputeStatementSet: MultiDisputeStatementSet;
MultiLocation: MultiLocation;
MultiLocationV0: MultiLocationV0;
MultiLocationV1: MultiLocationV1;
MultiLocationV2: MultiLocationV2;
MultiLocationV3: MultiLocationV3;
MultiLocationV4: MultiLocationV4;
Multiplier: Multiplier;
Multisig: Multisig;
MultiSignature: MultiSignature;
MultiSigner: MultiSigner;
NetworkId: NetworkId;
NetworkIdV2: NetworkIdV2;
NetworkIdV3: NetworkIdV3;
NetworkIdV4: NetworkIdV4;
NetworkState: NetworkState;
NetworkStatePeerset: NetworkStatePeerset;
NetworkStatePeersetInfo: NetworkStatePeersetInfo;
@@ -772,6 +811,8 @@ declare module '@polkadot/types/types/registry' {
OriginKindV0: OriginKindV0;
OriginKindV1: OriginKindV1;
OriginKindV2: OriginKindV2;
OriginKindV3: OriginKindV3;
OriginKindV4: OriginKindV4;
OutboundHrmpChannelLimitations: OutboundHrmpChannelLimitations;
OutboundHrmpMessage: OutboundHrmpMessage;
OutboundLaneData: OutboundLaneData;
@@ -779,6 +820,7 @@ declare module '@polkadot/types/types/registry' {
OutboundPayload: OutboundPayload;
OutboundStatus: OutboundStatus;
Outcome: Outcome;
OutcomeV4: OutcomeV4;
OuterEnums15: OuterEnums15;
OverweightIndex: OverweightIndex;
Owner: Owner;
@@ -793,6 +835,8 @@ declare module '@polkadot/types/types/registry' {
PalletEventMetadataLatest: PalletEventMetadataLatest;
PalletEventMetadataV14: PalletEventMetadataV14;
PalletId: PalletId;
PalletInfoV3: PalletInfoV3;
PalletInfoV4: PalletInfoV4;
PalletMetadataLatest: PalletMetadataLatest;
PalletMetadataV14: PalletMetadataV14;
PalletMetadataV15: PalletMetadataV15;
@@ -845,6 +889,7 @@ declare module '@polkadot/types/types/registry' {
Points: Points;
PortableType: PortableType;
PortableTypeV14: PortableTypeV14;
PostDispatchInfo: PostDispatchInfo;
Precommits: Precommits;
PrefabWasmModule: PrefabWasmModule;
PrefixedStorageKey: PrefixedStorageKey;
@@ -865,6 +910,8 @@ declare module '@polkadot/types/types/registry' {
PvfExecTimeoutKind: PvfExecTimeoutKind;
PvfPrepTimeoutKind: PvfPrepTimeoutKind;
QueryId: QueryId;
QueryResponseInfoV3: QueryResponseInfoV3;
QueryResponseInfoV4: QueryResponseInfoV4;
QueryStatus: QueryStatus;
QueueConfigData: QueueConfigData;
QueuedParathread: QueuedParathread;
@@ -922,7 +969,10 @@ declare module '@polkadot/types/types/registry' {
ResponseV1: ResponseV1;
ResponseV2: ResponseV2;
ResponseV2Error: ResponseV2Error;
ResponseV2Result: ResponseV2Result;
ResponseV3: ResponseV3;
ResponseV3Error: ResponseV3Error;
ResponseV3Result: ResponseV3Result;
ResponseV4: ResponseV4;
Retriable: Retriable;
RewardDestination: RewardDestination;
RewardPoint: RewardPoint;
@@ -1159,6 +1209,7 @@ declare module '@polkadot/types/types/registry' {
U8: U8;
UnappliedSlash: UnappliedSlash;
UnappliedSlashOther: UnappliedSlashOther;
UncheckedFungibilityV4: UncheckedFungibilityV4;
UncleEntryItem: UncleEntryItem;
UnknownTransaction: UnknownTransaction;
UnlockChunk: UnlockChunk;
@@ -1197,6 +1248,8 @@ declare module '@polkadot/types/types/registry' {
VersionedResponse: VersionedResponse;
VersionedXcm: VersionedXcm;
VersionMigrationStage: VersionMigrationStage;
VersionV3: VersionV3;
VersionV4: VersionV4;
VestingInfo: VestingInfo;
VestingSchedule: VestingSchedule;
Vote: Vote;
@@ -1217,6 +1270,7 @@ declare module '@polkadot/types/types/registry' {
VrfProof: VrfProof;
Weight: Weight;
WeightLimitV2: WeightLimitV2;
WeightLimitV3: WeightLimitV3;
WeightMultiplier: WeightMultiplier;
WeightPerClass: WeightPerClass;
WeightToFeeCoefficient: WeightToFeeCoefficient;
@@ -1227,9 +1281,13 @@ declare module '@polkadot/types/types/registry' {
WildFungibilityV0: WildFungibilityV0;
WildFungibilityV1: WildFungibilityV1;
WildFungibilityV2: WildFungibilityV2;
WildFungibilityV3: WildFungibilityV3;
WildFungibilityV4: WildFungibilityV4;
WildMultiAsset: WildMultiAsset;
WildMultiAssetV1: WildMultiAssetV1;
WildMultiAssetV2: WildMultiAssetV2;
WildMultiAssetV3: WildMultiAssetV3;
WildMultiAssetV4: WildMultiAssetV4;
WinnersData: WinnersData;
WinnersData10: WinnersData10;
WinnersDataTuple: WinnersDataTuple;
@@ -1240,14 +1298,16 @@ declare module '@polkadot/types/types/registry' {
WithdrawReasons: WithdrawReasons;
Xcm: Xcm;
XcmAssetId: XcmAssetId;
XcmDryRunApiError: XcmDryRunApiError;
XcmDryRunEffects: XcmDryRunEffects;
XcmError: XcmError;
XcmErrorV0: XcmErrorV0;
XcmErrorV1: XcmErrorV1;
XcmErrorV2: XcmErrorV2;
XcmOrder: XcmOrder;
XcmErrorV3: XcmErrorV3;
XcmErrorV4: XcmErrorV4;
XcmOrderV0: XcmOrderV0;
XcmOrderV1: XcmOrderV1;
XcmOrderV2: XcmOrderV2;
XcmOrigin: XcmOrigin;
XcmOriginKind: XcmOriginKind;
XcmPaymentApiError: XcmPaymentApiError;
@@ -1255,6 +1315,8 @@ declare module '@polkadot/types/types/registry' {
XcmV0: XcmV0;
XcmV1: XcmV1;
XcmV2: XcmV2;
XcmV3: XcmV3;
XcmV4: XcmV4;
XcmVersion: XcmVersion;
} // InterfaceTypes
} // declare module
+7 -7
View File
@@ -18,17 +18,17 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/util": "^13.0.2",
"@polkadot/x-bigint": "^13.0.2",
"@polkadot/util": "^13.1.1",
"@polkadot/x-bigint": "^13.1.1",
"tslib": "^2.7.0"
},
"devDependencies": {
"@polkadot/types": "13.0.1",
"@polkadot/types-augment": "13.0.1",
"@polkadot/types-support": "13.0.1",
"@polkadot/util-crypto": "^13.0.2"
"@polkadot/types": "14.0.1",
"@polkadot/types-augment": "14.0.1",
"@polkadot/types-support": "14.0.1",
"@polkadot/util-crypto": "^13.1.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '14.0.1' };
@@ -71,6 +71,7 @@ export interface Registry {
getClassName (clazz: CodecClass): string | undefined;
getOrThrow <T extends Codec = Codec, K extends string = string> (name: K, msg?: string): CodecClass<T>;
getOrUnknown <T extends Codec = Codec, K extends string = string> (name: K): CodecClass<T>;
getTransactionExtensionVersion (): number;
getSignedExtensionExtra (): Record<string, string>;
getSignedExtensionTypes (): Record<string, string>;
+4 -4
View File
@@ -18,14 +18,14 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/types-codec": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/types-codec": "14.0.1",
"@polkadot/util": "^13.1.1",
"tslib": "^2.7.0"
},
"devDependencies": {
"@polkadot/types": "13.0.1"
"@polkadot/types": "14.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '14.0.1' };
+2 -2
View File
@@ -3,9 +3,9 @@
import { objectSpread } from '@polkadot/util';
export const XCM_MAPPINGS = ['AssetInstance', 'Fungibility', 'Junction', 'Junctions', 'MultiAsset', 'MultiAssetFilter', 'MultiLocation', 'Response', 'WildFungibility', 'WildMultiAsset', 'Xcm', 'XcmError', 'XcmOrder'];
export const XCM_MAPPINGS = ['AssetInstance', 'Fungibility', 'Junction', 'Junctions', 'MultiAsset', 'MultiAssetFilter', 'MultiLocation', 'Response', 'WildFungibility', 'WildMultiAsset', 'Xcm', 'XcmError'];
export function mapXcmTypes (version: 'V0' | 'V1' | 'V2'): Record<string, string> {
export function mapXcmTypes (version: 'V0' | 'V1' | 'V2' | 'V3' | 'V4'): Record<string, string> {
return XCM_MAPPINGS.reduce<Record<string, string>>((all, key) =>
objectSpread(all, { [key]: `${key}${version}` }), {}
);
+7 -7
View File
@@ -18,17 +18,17 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/networks": "^13.0.2",
"@polkadot/types": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/types-create": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/networks": "^13.1.1",
"@polkadot/types": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/types-create": "14.0.1",
"@polkadot/util": "^13.1.1",
"tslib": "^2.7.0"
},
"devDependencies": {
"@polkadot/api": "13.0.1"
"@polkadot/api": "14.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '14.0.1' };
+2 -2
View File
@@ -18,10 +18,10 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/util": "^13.0.2",
"@polkadot/util": "^13.1.1",
"tslib": "^2.7.0"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '14.0.1' };
+9 -9
View File
@@ -18,20 +18,20 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "13.0.1",
"version": "14.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/keyring": "^13.0.2",
"@polkadot/types-augment": "13.0.1",
"@polkadot/types-codec": "13.0.1",
"@polkadot/types-create": "13.0.1",
"@polkadot/util": "^13.0.2",
"@polkadot/util-crypto": "^13.0.2",
"@polkadot/keyring": "^13.1.1",
"@polkadot/types-augment": "14.0.1",
"@polkadot/types-codec": "14.0.1",
"@polkadot/types-create": "14.0.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"rxjs": "^7.8.1",
"tslib": "^2.7.0"
},
"devDependencies": {
"@polkadot/keyring": "^13.0.2",
"@polkadot/types-support": "13.0.1"
"@polkadot/keyring": "^13.1.1",
"@polkadot/types-support": "14.0.1"
}
}
+5
View File
@@ -441,6 +441,11 @@ export class TypeRegistry implements Registry {
return this.get<T, K>(name, true) as unknown as CodecClass<R>;
}
// Only used in extrinsic version 5
public getTransactionExtensionVersion (): number {
return 0;
}
public getSignedExtensionExtra (): Record<string, string> {
return expandExtensionTypes(this.#signedExtensions, 'payload', this.#userExtensions);
}
@@ -48,4 +48,81 @@ describe('Extrinsic', (): void => {
expect(extrinsic.toPrimitive()).toEqual({ method: { args: { dest: { id: '5DiuK2zR4asj2CEh77SKtUgTswTLkD8eiAKrByg5G3wL5w9b' }, value: 104560923320000 }, callIndex: '0x0600' }, signature: { era: { mortalEra: [1024, 186] }, nonce: 68, signature: { ed25519: '0xd99ffe3e610ad234e1414bda5831395a6df9098bf80b01561ce89a5065ae89d5c10e1619c6c99131b0bea4fb73ef04d07c07770e2ae9df5c325c331769ccb300' }, signer: { id: '5Hn8KKEp8qruCGWaN9MEsjTs4FXB4wv9xn7g1RWkNeKKNXCr' }, tip: 30000000000 } });
});
});
describe('V5', () => {
// Ensure it does not have its registry modified by the fallback extensions.
const registry = new TypeRegistry();
const metadata = new Metadata(registry, rpcMetadata);
registry.setMetadata(metadata);
describe('SignedExtrinsic', () => {
it('Should work when the version and preamble is passed in', () => {
const extrinsic = new Extrinsic(
registry,
'0x51028500d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d011e0b7d9438899333c50121f8e10144952d51c3bb8d0ea11dd1f24940d8ff615ad351d95ed9f41f078748ed7cf182864a20b38eebfaef6629433365eb90c0148c007502000000000603008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a480b00a0724e1809',
{ preamble: 'signed', version: 5 }
);
expect(extrinsic.signer.toString()).toEqual('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
expect(extrinsic.era.toHuman()).toEqual({ MortalEra: { period: '64', phase: '39' } });
expect(extrinsic.nonce.toNumber()).toEqual(0);
expect(extrinsic.tip.toHuman()).toEqual('0');
expect(extrinsic.callIndex).toEqual(new Uint8Array([6, 3]));
expect(extrinsic.args[0].toHex()).toEqual('0x008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48');
expect(extrinsic.args[1].toHuman()).toEqual('10,000,000,000,000');
});
it('Should work when the version and preamble is not passed in', () => {
const extrinsic = new Extrinsic(
registry,
'0x51028500d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d011e0b7d9438899333c50121f8e10144952d51c3bb8d0ea11dd1f24940d8ff615ad351d95ed9f41f078748ed7cf182864a20b38eebfaef6629433365eb90c0148c007502000000000603008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a480b00a0724e1809'
);
expect(extrinsic.version).toEqual(133);
expect(extrinsic.signer.toString()).toEqual('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY');
expect(extrinsic.era.toHuman()).toEqual({ MortalEra: { period: '64', phase: '39' } });
expect(extrinsic.nonce.toNumber()).toEqual(0);
expect(extrinsic.tip.toHuman()).toEqual('0');
expect(extrinsic.callIndex).toEqual(new Uint8Array([6, 3]));
expect(extrinsic.args[0].toHex()).toEqual('0x008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48');
expect(extrinsic.args[1].toHuman()).toEqual('10,000,000,000,000');
});
});
describe('GeneralExtrinsic', () => {
it('Should work when the version and preamble is passed in', () => {
const extrinsic = new Extrinsic(
registry,
'0xc44500650000000000060000d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0700e40b5402',
{ preamble: 'general', version: 5 }
);
expect(extrinsic.version).toEqual(69);
// expect(extrinsic.transactionExtensionVersion.toNumber()).toEqual(0);
expect(extrinsic.method.toHuman()).toEqual({ args: { dest: { Id: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' }, value: '10,000,000,000' }, method: 'transferAllowDeath', section: 'balances' });
expect(extrinsic.era.toHuman()).toEqual({ MortalEra: { period: '64', phase: '6' } });
expect(extrinsic.tip.toNumber()).toEqual(0);
expect(extrinsic.mode.toNumber()).toEqual(0);
expect(extrinsic.assetId.toHuman()).toEqual(null);
expect(extrinsic.nonce.toNumber()).toEqual(0);
});
it('Should work when there is no version and preamble is passed in', () => {
const extrinsic = new Extrinsic(
registry,
'0xc44500650000000000060000d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0700e40b5402'
);
expect(extrinsic.version).toEqual(69);
// expect(extrinsic.transactionExtensionVersion.toNumber()).toEqual(0);
expect(extrinsic.method.toHuman()).toEqual({ args: { dest: { Id: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' }, value: '10,000,000,000' }, method: 'transferAllowDeath', section: 'balances' });
expect(extrinsic.era.toHuman()).toEqual({ MortalEra: { period: '64', phase: '6' } });
expect(extrinsic.tip.toNumber()).toEqual(0);
expect(extrinsic.mode.toNumber()).toEqual(0);
expect(extrinsic.assetId.toHuman()).toEqual(null);
expect(extrinsic.nonce.toNumber()).toEqual(0);
});
});
});
});
+102 -34
View File
@@ -3,48 +3,71 @@
import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, IMethod, Inspect, IOption } from '@polkadot/types-codec/types';
import type { HexString } from '@polkadot/util/types';
import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics/index.js';
import type { GeneralExtrinsic } from '../index.types.js';
import type { EcdsaSignature, Ed25519Signature, ExtrinsicSignatureV5, ExtrinsicUnknown, ExtrinsicV5, Sr25519Signature } from '../interfaces/extrinsics/index.js';
import type { FunctionMetadataLatest } from '../interfaces/metadata/index.js';
import type { Address, Call, CodecHash, Hash } from '../interfaces/runtime/index.js';
import type { MultiLocation } from '../interfaces/types.js';
import type { CallBase, ExtrinsicPayloadValue, ICompact, IExtrinsic, IKeyringPair, INumber, Registry, SignatureOptions } from '../types/index.js';
import type { GenericExtrinsicEra } from './ExtrinsicEra.js';
import type { ExtrinsicValueV4 } from './v4/Extrinsic.js';
import type { Preamble } from './types.js';
import type { ExtrinsicValueV5 } from './v5/Extrinsic.js';
import { AbstractBase } from '@polkadot/types-codec';
import { compactAddLength, compactFromU8a, compactToU8a, isHex, isU8a, objectProperty, objectSpread, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
import { EXTRINSIC_VERSION as LATEST_EXTRINSIC_VERSION } from './v4/Extrinsic.js';
import { BIT_SIGNED, BIT_UNSIGNED, DEFAULT_VERSION, UNMASK_VERSION } from './constants.js';
import { BARE_EXTRINSIC, BIT_SIGNED, BIT_UNSIGNED, DEFAULT_PREAMBLE, GENERAL_EXTRINSIC, LATEST_EXTRINSIC_VERSION, LOWEST_SUPPORTED_EXTRINSIC_FORMAT_VERSION, SIGNED_EXTRINSIC, TYPE_MASK, VERSION_MASK } from './constants.js';
interface CreateOptions {
version?: number;
preamble?: Preamble;
}
// NOTE The following 2 types, as well as the VERSION structure and the latest export
// is to be changed with the addition of a new extrinsic version
type ExtrinsicVx = ExtrinsicV4;
type ExtrinsicValue = ExtrinsicValueV4;
type ExtrinsicVx = ExtrinsicV5 | GeneralExtrinsic;
type ExtrinsicValue = ExtrinsicValueV5;
const VERSIONS = [
'ExtrinsicUnknown', // v0 is unknown
'ExtrinsicUnknown',
'ExtrinsicUnknown',
'ExtrinsicUnknown',
'ExtrinsicV4'
'ExtrinsicV4',
'ExtrinsicV5'
];
const PREAMBLE = {
bare: 'ExtrinsicV5',
general: 'GeneralExtrinsic',
signed: 'ExtrinsicV5'
};
const PreambleMask = {
bare: BARE_EXTRINSIC,
general: GENERAL_EXTRINSIC,
signed: SIGNED_EXTRINSIC
};
const preambleUnMask: Record<string, Preamble> = {
0: 'bare',
// eslint-disable-next-line sort-keys
64: 'general',
// eslint-disable-next-line sort-keys
128: 'signed'
};
export { LATEST_EXTRINSIC_VERSION };
/** @internal */
function newFromValue (registry: Registry, value: any, version: number): ExtrinsicVx | ExtrinsicUnknown {
function newFromValue (registry: Registry, value: any, version: number, preamble: Preamble): ExtrinsicVx | ExtrinsicUnknown {
if (value instanceof GenericExtrinsic) {
return value.unwrap();
}
const isSigned = (version & BIT_SIGNED) === BIT_SIGNED;
const type = VERSIONS[version & UNMASK_VERSION] || VERSIONS[0];
const type = (version & VERSION_MASK) === 5 ? PREAMBLE[preamble] : VERSIONS[version & VERSION_MASK] || VERSIONS[0];
// we cast here since the VERSION definition is incredibly broad - we don't have a
// slice for "only add extrinsic types", and more string definitions become unwieldy
@@ -52,20 +75,20 @@ function newFromValue (registry: Registry, value: any, version: number): Extrins
}
/** @internal */
function decodeExtrinsic (registry: Registry, value?: GenericExtrinsic | ExtrinsicValue | AnyU8a | Call, version: number = DEFAULT_VERSION): ExtrinsicVx | ExtrinsicUnknown {
function decodeExtrinsic (registry: Registry, value?: GenericExtrinsic | ExtrinsicValue | AnyU8a | Call, version: number = LOWEST_SUPPORTED_EXTRINSIC_FORMAT_VERSION, preamble: Preamble = DEFAULT_PREAMBLE): ExtrinsicVx | ExtrinsicUnknown {
if (isU8a(value) || Array.isArray(value) || isHex(value)) {
return decodeU8a(registry, u8aToU8a(value), version);
return decodeU8a(registry, u8aToU8a(value), version, preamble);
} else if (value instanceof registry.createClassUnsafe('Call')) {
return newFromValue(registry, { method: value }, version);
return newFromValue(registry, { method: value }, version, preamble);
}
return newFromValue(registry, value, version);
return newFromValue(registry, value, version, preamble);
}
/** @internal */
function decodeU8a (registry: Registry, value: Uint8Array, version: number): ExtrinsicVx | ExtrinsicUnknown {
function decodeU8a (registry: Registry, value: Uint8Array, version: number, preamble: Preamble): ExtrinsicVx | ExtrinsicUnknown {
if (!value.length) {
return newFromValue(registry, new Uint8Array(), version);
return newFromValue(registry, new Uint8Array(), version, preamble);
}
const [offset, length] = compactFromU8a(value);
@@ -76,22 +99,41 @@ function decodeU8a (registry: Registry, value: Uint8Array, version: number): Ext
}
const data = value.subarray(offset, total);
const unmaskedPreamble = data[0] & TYPE_MASK;
return newFromValue(registry, data.subarray(1), data[0]);
if (preambleUnMask[`${unmaskedPreamble}`] === 'general') {
// NOTE: GeneralExtrinsic needs to have the full data to validate the preamble and version
return newFromValue(registry, value, data[0], preambleUnMask[`${unmaskedPreamble}`] || preamble);
} else {
return newFromValue(registry, data.subarray(1), data[0], preambleUnMask[`${unmaskedPreamble}`] || preamble);
}
}
abstract class ExtrinsicBase<A extends AnyTuple> extends AbstractBase<ExtrinsicVx | ExtrinsicUnknown> {
constructor (registry: Registry, value: ExtrinsicV4 | ExtrinsicUnknown, initialU8aLength?: number) {
readonly #preamble: Preamble;
constructor (registry: Registry, value: ExtrinsicVx | ExtrinsicUnknown, initialU8aLength?: number, preamble?: Preamble) {
super(registry, value, initialU8aLength);
const signKeys = Object.keys(registry.getSignedExtensionTypes());
const getter = (key: string) => this.inner.signature[key as 'signer'];
// This is on the abstract class, ensuring that hasOwnProperty operates
// correctly, i.e. it needs to be on the base class exposing it
for (let i = 0, count = signKeys.length; i < count; i++) {
objectProperty(this, signKeys[i], getter);
if (this.version === 5 && preamble !== 'general') {
const getter = (key: string) => (this.inner.signature as unknown as ExtrinsicSignatureV5)[key as 'signer'];
// This is on the abstract class, ensuring that hasOwnProperty operates
// correctly, i.e. it needs to be on the base class exposing it
for (let i = 0, count = signKeys.length; i < count; i++) {
objectProperty(this, signKeys[i], getter);
}
}
const unmaskedPreamble = this.type & TYPE_MASK;
this.#preamble = preamble || preambleUnMask[`${unmaskedPreamble}`];
}
public isGeneral () {
return this.#preamble === 'general';
}
/**
@@ -126,7 +168,9 @@ abstract class ExtrinsicBase<A extends AnyTuple> extends AbstractBase<ExtrinsicV
* @description The era for this extrinsic
*/
public get era (): GenericExtrinsicEra {
return this.inner.signature.era;
return this.isGeneral()
? (this.inner as unknown as GeneralExtrinsic).era
: (this.inner.signature as unknown as ExtrinsicSignatureV5).era;
}
/**
@@ -140,7 +184,9 @@ abstract class ExtrinsicBase<A extends AnyTuple> extends AbstractBase<ExtrinsicV
* @description `true` id the extrinsic is signed
*/
public get isSigned (): boolean {
return this.inner.signature.isSigned;
return this.isGeneral()
? false
: (this.inner.signature as unknown as ExtrinsicSignatureV5).isSigned;
}
/**
@@ -168,49 +214,67 @@ abstract class ExtrinsicBase<A extends AnyTuple> extends AbstractBase<ExtrinsicV
* @description The nonce for this extrinsic
*/
public get nonce (): ICompact<INumber> {
return this.inner.signature.nonce;
return this.isGeneral()
? (this.inner as unknown as GeneralExtrinsic).nonce
: (this.inner.signature as unknown as ExtrinsicSignatureV5).nonce;
}
/**
* @description The actual [[EcdsaSignature]], [[Ed25519Signature]] or [[Sr25519Signature]]
*/
public get signature (): EcdsaSignature | Ed25519Signature | Sr25519Signature {
return this.inner.signature.signature;
if (this.isGeneral()) {
throw new Error('Extrinsic: GeneralExtrinsic does not have signature implemented');
}
return (this.inner.signature as unknown as ExtrinsicSignatureV5).signature;
}
/**
* @description The [[Address]] that signed
*/
public get signer (): Address {
return this.inner.signature.signer;
if (this.isGeneral()) {
throw new Error('Extrinsic: GeneralExtrinsic does not have signer implemented');
}
return (this.inner.signature as unknown as ExtrinsicSignatureV5).signer;
}
/**
* @description Forwards compat
*/
public get tip (): ICompact<INumber> {
return this.inner.signature.tip;
return this.isGeneral()
? (this.inner as unknown as GeneralExtrinsic).tip
: (this.inner.signature as unknown as ExtrinsicSignatureV5).tip;
}
/**
* @description Forward compat
*/
public get assetId (): IOption<INumber | MultiLocation> {
return this.inner.signature.assetId;
return this.isGeneral()
? (this.inner as unknown as GeneralExtrinsic).assetId
: (this.inner.signature as unknown as ExtrinsicSignatureV5).assetId;
}
/**
* @description Forward compat
*/
public get metadataHash (): IOption<Hash> {
return this.inner.signature.metadataHash;
return this.isGeneral()
? (this.inner as unknown as GeneralExtrinsic).metadataHash
: (this.inner.signature as unknown as ExtrinsicSignatureV5).metadataHash;
}
/**
* @description Forward compat
*/
public get mode (): INumber {
return this.inner.signature.mode;
return this.isGeneral()
? (this.inner as unknown as GeneralExtrinsic).mode
: (this.inner.signature as unknown as ExtrinsicSignatureV5).mode;
}
/**
@@ -228,7 +292,11 @@ abstract class ExtrinsicBase<A extends AnyTuple> extends AbstractBase<ExtrinsicV
* @description Returns the encoded version flag
*/
public get version (): number {
return this.type | (this.isSigned ? BIT_SIGNED : BIT_UNSIGNED);
if (this.type <= LOWEST_SUPPORTED_EXTRINSIC_FORMAT_VERSION) {
return this.type | (this.isSigned ? BIT_SIGNED : BIT_UNSIGNED);
} else {
return this.type | (this.isSigned ? PreambleMask.signed : this.isGeneral() ? PreambleMask.general : PreambleMask.bare);
}
}
/**
@@ -260,8 +328,8 @@ export class GenericExtrinsic<A extends AnyTuple = AnyTuple> extends ExtrinsicBa
static LATEST_EXTRINSIC_VERSION = LATEST_EXTRINSIC_VERSION;
constructor (registry: Registry, value?: GenericExtrinsic | ExtrinsicValue | AnyU8a | Call, { version }: CreateOptions = {}) {
super(registry, decodeExtrinsic(registry, value, version));
constructor (registry: Registry, value?: GenericExtrinsic | ExtrinsicValue | AnyU8a | Call, { preamble, version }: CreateOptions = {}) {
super(registry, decodeExtrinsic(registry, value, version || registry.metadata.extrinsic.version?.toNumber(), preamble), undefined, preamble);
}
/**
@@ -5,37 +5,49 @@ import type { Bytes } from '@polkadot/types-codec';
import type { AnyJson, BareOpts, Registry } from '@polkadot/types-codec/types';
import type { HexString } from '@polkadot/util/types';
import type { BlockHash } from '../interfaces/chain/index.js';
import type { ExtrinsicPayloadV4 } from '../interfaces/extrinsics/index.js';
import type { ExtrinsicPayloadV5 } from '../interfaces/extrinsics/index.js';
import type { Hash, MultiLocation } from '../interfaces/types.js';
import type { ExtrinsicPayloadValue, ICompact, IKeyringPair, INumber, IOption } from '../types/index.js';
import type { GenericExtrinsicEra } from './ExtrinsicEra.js';
import type { Preamble } from './types.js';
import { AbstractBase } from '@polkadot/types-codec';
import { hexToU8a, isHex, u8aToHex } from '@polkadot/util';
import { DEFAULT_VERSION } from './constants.js';
import { DEFAULT_PREAMBLE, LATEST_EXTRINSIC_VERSION } from './constants.js';
interface ExtrinsicPayloadOptions {
version?: number;
preamble?: Preamble;
}
// all our known types that can be returned
type ExtrinsicPayloadVx = ExtrinsicPayloadV4;
type ExtrinsicPayloadVx = ExtrinsicPayloadV5;
const VERSIONS = [
'ExtrinsicPayloadUnknown', // v0 is unknown
'ExtrinsicPayloadUnknown',
'ExtrinsicPayloadUnknown',
'ExtrinsicPayloadUnknown',
'ExtrinsicPayloadV4'
'ExtrinsicPayloadV4',
'ExtrinsicPayloadV5'
];
const PREAMBLES = {
bare: 'ExtrinsicPayloadV5',
// Not supported yet
general: 'ExtrinsicPayloadV5',
signed: 'ExtrinsicPayloadV5'
};
/** @internal */
function decodeExtrinsicPayload (registry: Registry, value?: GenericExtrinsicPayload | ExtrinsicPayloadValue | Uint8Array | string, version: number = DEFAULT_VERSION): ExtrinsicPayloadVx {
function decodeExtrinsicPayload (registry: Registry, value?: GenericExtrinsicPayload | ExtrinsicPayloadValue | Uint8Array | string, version = LATEST_EXTRINSIC_VERSION, preamble: Preamble = DEFAULT_PREAMBLE): ExtrinsicPayloadVx {
if (value instanceof GenericExtrinsicPayload) {
return value.unwrap();
}
const extVersion = version === 5 ? PREAMBLES[preamble] : VERSIONS[version] || VERSIONS[0];
/**
* HACK: In order to change the assetId from `number | object` to HexString (While maintaining the true type ie Option<TAssetConversion>),
* to allow for easier generalization of the SignerPayloadJSON interface the below check is necessary. The ExtrinsicPayloadV4 class does not like
@@ -51,10 +63,10 @@ function decodeExtrinsicPayload (registry: Registry, value?: GenericExtrinsicPay
assetId: registry.createType('TAssetConversion', hexToU8a((value as ExtrinsicPayloadValue).assetId)).toJSON()
};
return registry.createTypeUnsafe(VERSIONS[version] || VERSIONS[0], [adjustedPayload, { version }]);
return registry.createTypeUnsafe(extVersion, [adjustedPayload, { version }]);
}
return registry.createTypeUnsafe(VERSIONS[version] || VERSIONS[0], [value, { version }]);
return registry.createTypeUnsafe(extVersion, [value, { version }]);
}
/**
@@ -64,8 +76,8 @@ function decodeExtrinsicPayload (registry: Registry, value?: GenericExtrinsicPay
* on the contents included
*/
export class GenericExtrinsicPayload extends AbstractBase<ExtrinsicPayloadVx> {
constructor (registry: Registry, value?: Partial<ExtrinsicPayloadValue> | Uint8Array | string, { version }: ExtrinsicPayloadOptions = {}) {
super(registry, decodeExtrinsicPayload(registry, value as ExtrinsicPayloadValue, version));
constructor (registry: Registry, value?: Partial<ExtrinsicPayloadValue> | Uint8Array | string, { preamble, version }: ExtrinsicPayloadOptions = {}) {
super(registry, decodeExtrinsicPayload(registry, value as ExtrinsicPayloadValue, version, preamble));
}
/**
+17 -2
View File
@@ -7,8 +7,23 @@ export const BIT_UNSIGNED = 0;
export const EMPTY_U8A = new Uint8Array();
export const DEFAULT_VERSION = 4;
export const IMMORTAL_ERA = new Uint8Array([0]);
export const UNMASK_VERSION = 0b01111111;
export const DEFAULT_PREAMBLE = 'bare';
// Latest extrinsic version is v5, which has backwards compatibility for v4 signed extrinsics
export const LATEST_EXTRINSIC_VERSION = 5;
export const VERSION_MASK = 0b00111111;
export const TYPE_MASK = 0b11000000;
export const BARE_EXTRINSIC = 0b00000000;
export const SIGNED_EXTRINSIC = 0b10000000;
export const GENERAL_EXTRINSIC = 0b01000000;
export const LOWEST_SUPPORTED_EXTRINSIC_FORMAT_VERSION = 4;
+1
View File
@@ -11,3 +11,4 @@ export { GenericSignerPayload } from './SignerPayload.js';
// all starred
export * from './v4/index.js';
export * from './v5/index.js';
+2
View File
@@ -21,3 +21,5 @@ export interface ExtrinsicExtraValue {
nonce?: AnyNumber;
tip?: AnyNumber;
}
export type Preamble = 'signed' | 'bare' | 'general';
+13
View File
@@ -13,3 +13,16 @@ export function sign (registry: Registry, signerPair: IKeyringPair, u8a: Uint8Ar
return signerPair.sign(encoded, options);
}
// a helper function for both types of payloads, Raw and metadata-known
export function signV5 (registry: Registry, signerPair: IKeyringPair, u8a: Uint8Array, options?: SignOptions): Uint8Array {
const encoded = registry.hash(u8a);
return signerPair.sign(encoded, options);
}
export function signGeneral (registry: Registry, u8a: Uint8Array): Uint8Array {
const encoded = registry.hash(u8a);
return encoded;
}
@@ -0,0 +1,87 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { createTestPairs } from '@polkadot/keyring/testingPairs';
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { BN } from '@polkadot/util';
import { TypeRegistry } from '../../create/index.js';
import { decorateExtrinsics, Metadata } from '../../metadata/index.js';
import { GenericExtrinsicV5 as Extrinsic } from './index.js';
const registry = new TypeRegistry();
const metadata = new Metadata(registry, rpcMetadata);
const keyring = createTestPairs({ type: 'ed25519' }, false);
registry.setMetadata(metadata);
const tx = decorateExtrinsics(registry, metadata.asLatest, metadata.version);
describe('ExtrinsicV5', (): void => {
it('constructs a sane Uint8Array (default)', (): void => {
const xt = new Extrinsic(registry);
// expect(`${xt.method.section}${xt.method.method}`).toEqual('system.fillBlock');
expect(`${xt.method.section}.${xt.method.method}`).toEqual('system.remark');
expect(xt.toU8a()).toEqual(new Uint8Array([
0, 0, // index
// 0, 0, 0, 0 // fillBlock, Perbill
0 // remark, Vec<u8>
]));
});
it('creates a unsigned extrinsic', (): void => {
expect(
new Extrinsic(
registry,
tx['balances']['transferAllowDeath'](keyring.bob.publicKey, 6969n)
).toHex()
).toEqual(
'0x' +
'0600' + // balance.transferAllowDeath
'00' +
'd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9' +
'e56c'
);
});
it('creates a signed extrinsic', (): void => {
expect(
new Extrinsic(
registry,
tx['balances']['transferAllowDeath'](keyring.bob.publicKey, 6969n)
).sign(keyring.alice, {
blockHash: '0xec7afaf1cca720ce88c1d1b689d81f0583cc15a97d621cf046dd9abf605ef22f',
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
mode: 0,
nonce: 1,
runtimeVersion: {
apis: [],
authoringVersion: new BN(123),
implName: 'test',
implVersion: new BN(123),
specName: 'test',
specVersion: new BN(123),
transactionVersion: new BN(123)
},
tip: 2
}).toHex()
).toEqual(
'0x' +
'00' +
'd172a74cda4c865912c32ba0a80a57ae69abae410e5ccb59dee84e2f4432db4f' +
'00' + // ed25519
'84181ebef350cc212e70e042b6ebcd33ca955bf9497711a64aa7c64e2b8c2732' +
'ab837715364eab7be5cc76f74eefa36d3ba9ee698264ed28a286c8360fc9aa0c' +
'00' + // TransactionExtension version
'0004080000' + // era. nonce, tip, mode
'0600' +
'00' +
'd7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9' +
'e56c'
);
});
});
@@ -0,0 +1,116 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { HexString } from '@polkadot/util/types';
import type { ExtrinsicSignatureV5 } from '../../interfaces/extrinsics/index.js';
import type { Address, Call } from '../../interfaces/runtime/index.js';
import type { ExtrinsicPayloadValue, IExtrinsicV5Impl, IKeyringPair, Registry, SignatureOptions } from '../../types/index.js';
import type { ExtrinsicOptions, Preamble } from '../types.js';
import { Struct } from '@polkadot/types-codec';
import { isU8a } from '@polkadot/util';
export const EXTRINSIC_VERSION = 5;
export interface ExtrinsicValueV5 {
method?: Call;
signature?: ExtrinsicSignatureV5;
}
/**
* @name GenericExtrinsicV5
* @description
* The fourth generation of compact extrinsics
*/
export class GenericExtrinsicV5 extends Struct implements IExtrinsicV5Impl {
constructor (registry: Registry, value?: Uint8Array | ExtrinsicValueV5 | Call, { isSigned }: Partial<ExtrinsicOptions> = {}) {
super(registry, {
signature: 'ExtrinsicSignatureV5',
// eslint-disable-next-line sort-keys
method: 'Call'
}, GenericExtrinsicV5.decodeExtrinsic(registry, value, isSigned));
}
/** @internal */
public static decodeExtrinsic (registry: Registry, value?: Call | Uint8Array | ExtrinsicValueV5, isSigned = false): ExtrinsicValueV5 {
if (value instanceof GenericExtrinsicV5) {
return value;
} else if (value instanceof registry.createClassUnsafe<Call>('Call')) {
return { method: value };
} else if (isU8a(value)) {
// here we decode manually since we need to pull through the version information
const signature = registry.createTypeUnsafe<ExtrinsicSignatureV5>('ExtrinsicSignatureV5', [value, { isSigned }]);
// We add 2 here since the length of the TransactionExtension Version needs to be accounted for
const method = registry.createTypeUnsafe<Call>('Call', [value.subarray(signature.encodedLength)]);
return {
method,
signature
};
}
return value || {};
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
public override get encodedLength (): number {
return this.toU8a().length;
}
/**
* @description The [[Call]] this extrinsic wraps
*/
public get method (): Call {
return this.getT('method');
}
/**
* @description The [[ExtrinsicSignatureV5]]
*/
public get signature (): ExtrinsicSignatureV5 {
return this.getT('signature');
}
/**
* @description The version for the signature
*/
public get version (): number {
return EXTRINSIC_VERSION;
}
/**
* @description The [[Preamble]] for the extrinsic
*/
public get preamble (): Preamble {
return this.getT('preamble');
}
/**
* @description Add an [[ExtrinsicSignatureV5]] to the extrinsic (already generated)
*/
public addSignature (signer: Address | Uint8Array | string, signature: Uint8Array | HexString, payload: ExtrinsicPayloadValue | Uint8Array | HexString): GenericExtrinsicV5 {
this.signature.addSignature(signer, signature, payload);
return this;
}
/**
* @description Sign the extrinsic with a specific keypair
*/
public sign (account: IKeyringPair, options: SignatureOptions): GenericExtrinsicV5 {
this.signature.sign(this.method, account, options);
return this;
}
/**
* @describe Adds a fake signature to the extrinsic
*/
public signFake (signer: Address | Uint8Array | string, options: SignatureOptions): GenericExtrinsicV5 {
this.signature.signFake(this.method, signer, options);
return this;
}
}
@@ -0,0 +1,39 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../../create/index.js';
import { decorateExtrinsics, Metadata } from '../../metadata/index.js';
import { GenericExtrinsicPayloadV5 as ExtrinsicPayload } from './index.js';
const registry = new TypeRegistry();
const metadata = new Metadata(registry, rpcMetadata);
registry.setMetadata(metadata);
const tx = decorateExtrinsics(registry, metadata.asLatest, metadata.version);
describe('ExtrinsicPayload', (): void => {
it('has a sane inspect', (): void => {
// we don't expect this to fail, however it is actually a good
// reference for the ordering in base Substrate
expect(new ExtrinsicPayload(registry, { method: tx['timestamp']['set'](0).toHex() } as never).inspect()).toEqual({
inner: [
{ name: 'method', outer: [new Uint8Array([3, 0, 0])] },
{ inner: undefined, name: 'era', outer: [new Uint8Array([0]), new Uint8Array([0])] },
{ name: 'nonce', outer: [new Uint8Array([0])] },
{ name: 'tip', outer: [new Uint8Array([0])] },
{ name: 'assetId', outer: [new Uint8Array([0])] },
{ name: 'mode', outer: [new Uint8Array([0])] },
{ name: 'specVersion', outer: [new Uint8Array([0, 0, 0, 0])] },
{ name: 'transactionVersion', outer: [new Uint8Array([0, 0, 0, 0])] },
{ name: 'genesisHash', outer: [new Uint8Array(32)] },
{ name: 'blockHash', outer: [new Uint8Array(32)] },
{ name: 'metadataHash', outer: [new Uint8Array([0])] }
]
});
});
});
@@ -0,0 +1,130 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { SignOptions } from '@polkadot/keyring/types';
import type { Hash, MultiLocation } from '@polkadot/types/interfaces';
import type { Bytes } from '@polkadot/types-codec';
import type { Inspect, Registry } from '@polkadot/types-codec/types';
import type { HexString } from '@polkadot/util/types';
import type { BlockHash } from '../../interfaces/chain/index.js';
import type { ExtrinsicEra } from '../../interfaces/extrinsics/index.js';
import type { ExtrinsicPayloadValue, ICompact, IKeyringPair, INumber, IOption } from '../../types/index.js';
import { Enum, Struct } from '@polkadot/types-codec';
import { objectSpread } from '@polkadot/util';
import { signV5 } from '../util.js';
/**
* @name GenericExtrinsicPayloadV5
* @description
* A signing payload for an [[Extrinsic]]. For the final encoding, it is
* variable length based on the contents included
*/
export class GenericExtrinsicPayloadV5 extends Struct {
#signOptions: SignOptions;
constructor (registry: Registry, value?: ExtrinsicPayloadValue | Uint8Array | HexString) {
super(registry, objectSpread(
{ method: 'Bytes' },
registry.getSignedExtensionTypes(),
registry.getSignedExtensionExtra()
), value);
// Do detection for the type of extrinsic, in the case of MultiSignature
// this is an enum, in the case of AnySignature, this is a Hash only
// (which may be 64 or 65 bytes)
this.#signOptions = {
withType: registry.createTypeUnsafe('ExtrinsicSignature', []) instanceof Enum
};
}
/**
* @description Returns a breakdown of the hex encoding for this Codec
*/
public override inspect (): Inspect {
return super.inspect({ method: true });
}
/**
* @description The block [[BlockHash]] the signature applies to (mortal/immortal)
*/
public get blockHash (): BlockHash {
return this.getT('blockHash');
}
/**
* @description The [[ExtrinsicEra]]
*/
public get era (): ExtrinsicEra {
return this.getT('era');
}
/**
* @description The genesis [[BlockHash]] the signature applies to (mortal/immortal)
*/
public get genesisHash (): BlockHash {
return this.getT('genesisHash');
}
/**
* @description The [[Bytes]] contained in the payload
*/
public get method (): Bytes {
return this.getT('method');
}
/**
* @description The [[Index]]
*/
public get nonce (): ICompact<INumber> {
return this.getT('nonce');
}
/**
* @description The specVersion for this signature
*/
public get specVersion (): INumber {
return this.getT('specVersion');
}
/**
* @description The tip [[Balance]]
*/
public get tip (): ICompact<INumber> {
return this.getT('tip');
}
/**
* @description The transactionVersion for this signature
*/
public get transactionVersion (): INumber {
return this.getT('transactionVersion');
}
/**
* @description The (optional) asset id for this signature for chains that support transaction fees in assets
*/
public get assetId (): IOption<INumber | MultiLocation> {
return this.getT('assetId');
}
/**
* @description The (optional) metadataHash proof for the CheckMetadataHash TransactionExtension
*/
public get metadataHash (): IOption<Hash> {
return this.getT('metadataHash');
}
/**
* @description Sign the payload with the keypair
*/
public sign (signerPair: IKeyringPair): Uint8Array {
// NOTE The `toU8a({ method: true })` argument is absolutely critical, we
// don't want the method (Bytes) to have the length prefix included. This
// means that the data-as-signed is un-decodable, but is also doesn't need
// the extra information, only the pure data (and is not decoded) ...
// The same applies to V1..V3, if we have a V6, carry this comment
return signV5(this.registry, signerPair, this.toU8a({ method: true }), this.#signOptions);
}
}
@@ -0,0 +1,165 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import { createTestPairs } from '@polkadot/keyring/testingPairs';
import metadataStatic from '@polkadot/types-support/metadata/static-substrate';
import { BN_ZERO } from '@polkadot/util';
import { TypeRegistry } from '../../create/index.js';
import { Metadata } from '../../metadata/index.js';
import { GenericExtrinsicSignatureV5 as ExtrinsicSignature } from './index.js';
const signOptions = {
blockHash: '0x1234567890123456789012345678901234567890123456789012345678901234',
genesisHash: '0x1234567890123456789012345678901234567890123456789012345678901234',
nonce: '0x69',
runtimeVersion: {
apis: [],
authoringVersion: BN_ZERO,
implName: String('test'),
implVersion: BN_ZERO,
specName: String('test'),
specVersion: BN_ZERO,
transactionVersion: BN_ZERO
}
};
describe('ExtrinsicSignatureV4', (): void => {
const pairs = createTestPairs({ type: 'ed25519' });
it('encodes to a sane Uint8Array (default)', (): void => {
const registry = new TypeRegistry();
const u8a = new Uint8Array([
// signer as an AccountIndex
0x01, 0x08, // 4 << 2
// signature type
0x01,
// signature
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x00, // TransactionExtension version
// extra stuff
0x00, // immortal,
0x04, // nonce, compact
0x08 // tip, compact
]);
expect(
new ExtrinsicSignature(registry, u8a, { isSigned: true }).toU8a()
).toEqual(u8a);
});
it('fake signs default', (): void => {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
expect(
new ExtrinsicSignature(registry).signFake(
registry.createType('Call'),
pairs.alice.publicKey,
signOptions
).toHex()
).toEqual(
'0x' +
'00' + // MultiAddress
'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
'01' +
'0101010101010101010101010101010101010101010101010101010101010101' +
'0101010101010101010101010101010101010101010101010101010101010101' +
'00' + // TransactionExtension version
'00a5010000' +
'00' // Mode
);
});
it('fake signs default (AccountId address)', (): void => {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
registry.register({
Address: 'AccountId',
ExtrinsicSignature: 'AnySignature'
});
expect(
new ExtrinsicSignature(registry).signFake(
registry.createType('Call'),
pairs.alice.address,
signOptions
).toHex()
).toEqual(
'0x' +
// Address = AccountId, no prefix
'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
// This is a prefix-less signature, anySignture as opposed to Multi above
'0101010101010101010101010101010101010101010101010101010101010101' +
'0101010101010101010101010101010101010101010101010101010101010101' +
'00' + // TransactionExtension version
'00a5010000' +
'00' // mode
);
});
it('fake signs with non-enum signature', (): void => {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
registry.register({
Address: 'AccountId',
ExtrinsicSignature: '[u8;65]'
});
expect(
new ExtrinsicSignature(registry).signFake(
registry.createType('Call'),
pairs.alice.address,
signOptions
).toHex()
).toEqual(
'0x' +
// Address = AccountId, no prefix
'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
// 65 bytes here
'01' +
'0101010101010101010101010101010101010101010101010101010101010101' +
'0101010101010101010101010101010101010101010101010101010101010101' +
'00' + // TransactionExtension version
'00a5010000' +
'00' // mode
);
});
it('injects a signature', (): void => {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
expect(
new ExtrinsicSignature(registry).addSignature(
pairs.alice.publicKey,
new Uint8Array(65).fill(1),
new Uint8Array(0)
).toHex()
).toEqual(
'0x' +
'00' + // MultiAddress
'd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' +
'01' +
'0101010101010101010101010101010101010101010101010101010101010101' +
'0101010101010101010101010101010101010101010101010101010101010101' +
'00' + // TransactionExtension version
'00000000' +
'00' // mode
);
});
});
@@ -0,0 +1,241 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { MultiLocation } from '@polkadot/types/interfaces';
import type { HexString } from '@polkadot/util/types';
import type { EcdsaSignature, Ed25519Signature, ExtrinsicEra, ExtrinsicSignature, Sr25519Signature } from '../../interfaces/extrinsics/index.js';
import type { Address, Call, Hash } from '../../interfaces/runtime/index.js';
import type { ExtrinsicPayloadValue, ICompact, IExtrinsicSignature, IKeyringPair, INumber, IOption, Registry, SignatureOptions } from '../../types/index.js';
import type { ExtrinsicSignatureOptions } from '../types.js';
import { Struct } from '@polkadot/types-codec';
import { isU8a, isUndefined, objectProperties, objectSpread, stringify, u8aToHex } from '@polkadot/util';
import { EMPTY_U8A, IMMORTAL_ERA } from '../constants.js';
import { GenericExtrinsicPayloadV5 } from './ExtrinsicPayload.js';
// Ensure we have enough data for all types of signatures
const FAKE_SIGNATURE = new Uint8Array(256).fill(1);
function toAddress (registry: Registry, address: Address | Uint8Array | string): Address {
return registry.createTypeUnsafe('Address', [isU8a(address) ? u8aToHex(address) : address]);
}
/**
* @name GenericExtrinsicSignatureV5
* @description
* A container for the [[Signature]] associated with a specific [[Extrinsic]]
*/
export class GenericExtrinsicSignatureV5 extends Struct implements IExtrinsicSignature {
#signKeys: string[];
#transactionExtensionVersion: number;
constructor (registry: Registry, value?: GenericExtrinsicSignatureV5 | Uint8Array, { isSigned }: ExtrinsicSignatureOptions = {}) {
const signTypes = registry.getSignedExtensionTypes();
const signedVersion = registry.getTransactionExtensionVersion();
super(
registry,
objectSpread(
// eslint-disable-next-line sort-keys
{ signer: 'Address', signature: 'ExtrinsicSignature', transactionExtensionVersion: 'u8' },
signTypes
),
GenericExtrinsicSignatureV5.decodeExtrinsicSignature(value, isSigned)
);
this.#transactionExtensionVersion = signedVersion;
this.#signKeys = Object.keys(signTypes);
objectProperties(this, this.#signKeys, (k) => this.get(k));
}
/** @internal */
public static decodeExtrinsicSignature (value?: GenericExtrinsicSignatureV5 | Uint8Array, isSigned = false): GenericExtrinsicSignatureV5 | Uint8Array {
if (!value) {
return EMPTY_U8A;
} else if (value instanceof GenericExtrinsicSignatureV5) {
return value;
}
return isSigned
? value
: EMPTY_U8A;
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
public override get encodedLength (): number {
return this.isSigned
? super.encodedLength
: 0;
}
/**
* @description `true` if the signature is valid
*/
public get isSigned (): boolean {
return !this.signature.isEmpty;
}
/**
* @description The [[ExtrinsicEra]] (mortal or immortal) this signature applies to
*/
public get era (): ExtrinsicEra {
return this.getT('era');
}
/**
* @description The [[Index]] for the signature
*/
public get nonce (): ICompact<INumber> {
return this.getT('nonce');
}
/**
* @description The actual [[EcdsaSignature]], [[Ed25519Signature]] or [[Sr25519Signature]]
*/
public get signature (): EcdsaSignature | Ed25519Signature | Sr25519Signature {
// the second case here is when we don't have an enum signature, treat as raw
return (this.multiSignature.value || this.multiSignature) as Sr25519Signature;
}
/**
* @description The raw [[ExtrinsicSignature]]
*/
public get multiSignature (): ExtrinsicSignature {
return this.getT('signature');
}
/**
* @description The [[Address]] that signed
*/
public get signer (): Address {
return this.getT('signer');
}
/**
* @description The [[Balance]] tip
*/
public get tip (): ICompact<INumber> {
return this.getT('tip');
}
/**
* @description The [[u32]] or [[MultiLocation]] assetId
*/
public get assetId (): IOption<INumber | MultiLocation> {
return this.getT('assetId');
}
/**
* @description the [[u32]] mode
*/
public get mode (): INumber {
return this.getT('mode');
}
/**
* @description The (optional) [[Hash]] for the metadata proof
*/
public get metadataHash (): IOption<Hash> {
return this.getT('metadataHash');
}
/**
* @description The [[u8]] for the TransactionExtension version
*/
public get transactionExtensionVersion (): INumber {
return this.getT('transactionExtensionVersion');
}
protected _injectSignature (signer: Address, signature: ExtrinsicSignature, payload: GenericExtrinsicPayloadV5): IExtrinsicSignature {
// use the fields exposed to guide the getters
for (let i = 0, count = this.#signKeys.length; i < count; i++) {
const k = this.#signKeys[i];
const v = payload.get(k);
if (k === 'transactionExtensionVersion') {
this.set(k, this.registry.createType('u8', this.#transactionExtensionVersion));
} else if (!isUndefined(v)) {
this.set(k, v);
}
}
// additional fields (exposed in struct itself)
this.set('signer', signer);
this.set('signature', signature);
return this;
}
/**
* @description Adds a raw signature
*/
public addSignature (signer: Address | Uint8Array | string, signature: Uint8Array | HexString, payload: ExtrinsicPayloadValue | Uint8Array | HexString): IExtrinsicSignature {
return this._injectSignature(
toAddress(this.registry, signer),
this.registry.createTypeUnsafe('ExtrinsicSignature', [signature]),
new GenericExtrinsicPayloadV5(this.registry, payload)
);
}
/**
* @description Creates a payload from the supplied options
*/
public createPayload (method: Call, options: SignatureOptions): GenericExtrinsicPayloadV5 {
const { era, runtimeVersion: { specVersion, transactionVersion } } = options;
return new GenericExtrinsicPayloadV5(this.registry, objectSpread<ExtrinsicPayloadValue>({}, options, {
era: era || IMMORTAL_ERA,
method: method.toHex(),
specVersion,
transactionVersion
}));
}
/**
* @description Generate a payload and applies the signature from a keypair
*/
public sign (method: Call, account: IKeyringPair, options: SignatureOptions): IExtrinsicSignature {
if (!account?.addressRaw) {
throw new Error(`Expected a valid keypair for signing, found ${stringify(account)}`);
}
const payload = this.createPayload(method, options);
return this._injectSignature(
toAddress(this.registry, account.addressRaw),
this.registry.createTypeUnsafe('ExtrinsicSignature', [payload.sign(account)]),
payload
);
}
/**
* @description Generate a payload and applies a fake signature
*/
public signFake (method: Call, address: Address | Uint8Array | string, options: SignatureOptions): IExtrinsicSignature {
if (!address) {
throw new Error(`Expected a valid address for signing, found ${stringify(address)}`);
}
const payload = this.createPayload(method, options);
return this._injectSignature(
toAddress(this.registry, address),
this.registry.createTypeUnsafe('ExtrinsicSignature', [FAKE_SIGNATURE]),
payload
);
}
/**
* @description Encodes the value as a Uint8Array as per the SCALE specifications
* @param isBare true when the value has none of the type-specific prefixes (internal)
*/
public override toU8a (isBare?: boolean): Uint8Array {
return this.isSigned
? super.toU8a(isBare)
: EMPTY_U8A;
}
}
@@ -0,0 +1,47 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev-test/globals.d.ts" />
import rpcMetadata from '@polkadot/types-support/metadata/static-substrate';
import { TypeRegistry } from '../../create/index.js';
import { Metadata } from '../../metadata/index.js';
import { GeneralExtrinsic } from './GeneralExtrinsic.js';
const registry = new TypeRegistry();
const metadata = new Metadata(registry, rpcMetadata);
registry.setMetadata(metadata);
describe('GeneralExt', (): void => {
const extrinsic = '0xc44500650000000000060000d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0700e40b5402';
it('Can decode a general extrinsic', (): void => {
const genExt = new GeneralExtrinsic(registry, extrinsic);
expect(genExt.version).toEqual(5);
expect(genExt.transactionExtensionVersion.toNumber()).toEqual(0);
expect(genExt.method.toHuman()).toEqual({ args: { dest: { Id: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY' }, value: '10,000,000,000' }, method: 'transferAllowDeath', section: 'balances' });
expect(genExt.era.toHuman()).toEqual({ MortalEra: { period: '64', phase: '6' } });
expect(genExt.tip.toNumber()).toEqual(0);
expect(genExt.mode.toNumber()).toEqual(0);
expect(genExt.assetId.toHuman()).toEqual(null);
expect(genExt.nonce.toNumber()).toEqual(0);
});
it('Can encode a general extrinsic', (): void => {
const payload = {
era: '0x6500',
method: '0x060000d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d0700e40b5402',
nonce: '0x00000000',
tip: '0x00000000000000000000000000000000',
transactionVersion: '0x00000002'
};
const genExt = new GeneralExtrinsic(registry, {
payload
});
expect(genExt.toHex()).toEqual(extrinsic);
});
});
@@ -0,0 +1,208 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Call, ExtrinsicEra, Hash, MultiLocation } from '@polkadot/types/interfaces';
import type { AnyNumber, AnyU8a, ICompact, IExtrinsicEra, INumber, IOption, Registry } from '@polkadot/types/types';
import type { AnyTuple, IMethod } from '@polkadot/types-codec/types';
import type { HexString } from '@polkadot/util/types';
import { Struct } from '@polkadot/types-codec';
import { compactAddLength, compactFromU8a, isHex, isObject, isU8a, objectSpread, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
import { EMPTY_U8A, UNMASK_VERSION } from '../constants.js';
interface TransactionExtensionValues {
era: AnyU8a | IExtrinsicEra;
nonce: AnyNumber;
tip: AnyNumber;
transactionVersion: AnyNumber;
assetId?: HexString;
mode?: AnyNumber;
metadataHash?: AnyU8a;
}
interface GeneralExtrinsicPayloadValues extends TransactionExtensionValues {
method: AnyU8a | IMethod<AnyTuple>;
}
interface GeneralExtrinsicValue {
payload?: GeneralExtrinsicPayloadValues;
transactionExtensionVersion?: number;
}
function decodeU8a (u8a: Uint8Array) {
if (!u8a.length) {
return new Uint8Array();
}
const [offset, length] = compactFromU8a(u8a);
const total = offset + length.toNumber();
if (total > u8a.length) {
throw new Error(`Extrinsic: length less than remainder, expected at least ${total}, found ${u8a.length}`);
}
const data = u8a.subarray(offset, total);
// 69 denotes 0b01000101 which is the version and preamble for this Extrinsic
if (data[0] !== 69) {
throw new Error(`Extrinsic: incorrect version for General Transactions, expected 5, found ${data[0] & UNMASK_VERSION}`);
}
return data.subarray(1);
}
export class GeneralExtrinsic extends Struct {
#version: number;
#preamble: number;
constructor (registry: Registry, value?: GeneralExtrinsicValue | Uint8Array | HexString, opt?: { version: number }) {
const extTypes = registry.getSignedExtensionTypes();
super(registry, objectSpread(
{
transactionExtensionVersion: 'u8'
},
extTypes,
{
method: 'Call'
}
), GeneralExtrinsic.decodeExtrinsic(registry, value));
this.#version = opt?.version || 0b00000101;
this.#preamble = 0b01000000;
}
public static decodeExtrinsic (registry: Registry, value?: GeneralExtrinsicValue | Uint8Array | HexString) {
if (!value) {
return EMPTY_U8A;
} else if (value instanceof GeneralExtrinsic) {
return value;
} else if (isU8a(value) || Array.isArray(value) || isHex(value)) {
return decodeU8a(u8aToU8a(value));
} else if (isObject(value)) {
const { payload, transactionExtensionVersion } = value;
return objectSpread(payload || {}, {
transactionExtensionVersion: transactionExtensionVersion || registry.getTransactionExtensionVersion()
});
}
return {};
}
/**
* @description The length of the value when encoded as a Uint8Array
*/
public override get encodedLength (): number {
return super.encodedLength;
}
/**
* @description The [[ExtrinsicEra]]
*/
public get era (): ExtrinsicEra {
return this.getT('era');
}
/**
* @description The [[Index]]
*/
public get nonce (): ICompact<INumber> {
return this.getT('nonce');
}
/**
* @description The tip [[Balance]]
*/
public get tip (): ICompact<INumber> {
return this.getT('tip');
}
/**
* @description The (optional) asset id for this signature for chains that support transaction fees in assets
*/
public get assetId (): IOption<INumber | MultiLocation> {
return this.getT('assetId');
}
/**
* @description The mode used for the CheckMetadataHash TransactionExtension
*/
public get mode (): INumber {
return this.getT('mode');
}
/**
* @description The (optional) [[Hash]] for the metadata proof
*/
public get metadataHash (): IOption<Hash> {
return this.getT('metadataHash');
}
/**
* @description The version of the TransactionExtensions used in this extrinsic
*/
public get transactionExtensionVersion (): INumber {
return this.getT('transactionExtensionVersion');
}
/**
* @description The [[Call]] this extrinsic wraps
*/
public get method (): Call {
return this.getT('method');
}
/**
* @description The extrinsic's version
*/
public get version () {
return this.#version;
}
/**
* @description The [[Preamble]] for the extrinsic
*/
public get preamble () {
return this.#preamble;
}
public override toHex (isBare?: boolean): HexString {
return u8aToHex(this.toU8a(isBare));
}
public override toU8a (isBare?: boolean): Uint8Array {
return isBare
? this.encode()
: compactAddLength(this.encode());
}
public override toRawType () {
return 'GeneralExt';
}
/**
*
* @description Returns an encoded GeneralExtrinsic
*/
public encode () {
return u8aConcat(new Uint8Array([this.version | this.preamble]), super.toU8a());
}
public signFake () {
throw new Error('Extrinsic: Type GeneralExtrinsic does not have signFake implemented');
}
public addSignature () {
throw new Error('Extrinsic: Type GeneralExtrinsic does not have addSignature implemented');
}
public sign () {
throw new Error('Extrinsic: Type GeneralExtrinsic does not have sign implemented');
}
public signature () {
throw new Error('Extrinsic: Type GeneralExtrinsic does not have the signature getter');
}
}
+7
View File
@@ -0,0 +1,7 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { GenericExtrinsicV5 } from './Extrinsic.js';
export { GenericExtrinsicPayloadV5 } from './ExtrinsicPayload.js';
export { GenericExtrinsicSignatureV5 } from './ExtrinsicSignature.js';
export { GeneralExtrinsic } from './GeneralExtrinsic.js';
@@ -122,7 +122,7 @@ describe('runtime definitions', (): void => {
for (const { methods, version } of versions) {
describe(`version ${version}`, (): void => {
const methodsEntries = Object.entries<DefinitionCall>(methods);
const skipInspectTypes = ['StagingXcmV3MultiLocation', 'StagingXcmV4Location', 'Result<Vec<XcmV3MultiAsset>, FungiblesAccessError>', 'Result<XcmVersionedAssets, FungiblesAccessError>', 'XcmVersionedLocation', 'XcmVersionedAssetId', 'XcmVersionedXcm', 'Result<Vec<XcmVersionedAssetId>, XcmPaymentApiError>'];
const skipInspectTypes = ['StagingXcmV3MultiLocation', 'StagingXcmV4Location', 'Result<Vec<XcmV3MultiAsset>, FungiblesAccessError>', 'Result<XcmVersionedAssets, FungiblesAccessError>', 'XcmVersionedLocation', 'XcmVersionedAssetId', 'XcmVersionedXcm', 'Result<Vec<XcmVersionedAssetId>, XcmPaymentApiError>', 'VersionedMultiLocation', 'VersionedXcm', 'PostDispatchInfo', 'DispatchResultWithPostInfo', 'CallDryRunEffects', 'XcmDryRunEffects', 'XcmDryRunApiError', 'Result<CallDryRunEffects, XcmDryRunApiError>', 'Result<XcmDryRunEffects, XcmDryRunApiError>'];
for (const [key, { params, type }] of methodsEntries) {
describe(`${key}`, (): void => {
@@ -66,6 +66,7 @@ export { default as poll } from './poll/definitions.js';
export { default as purchase } from './purchase/definitions.js';
// XCM related types
export { default as dryRunApi } from './dryRunApi/definitions.js';
export { default as xcm } from './xcm/definitions.js';
export { default as xcmPaymentApi } from './xcmPaymentApi/definitions.js';
export { default as xcmRuntimeApi } from './xcmRuntimeApi/definitions.js';
@@ -0,0 +1,38 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { Definitions } from '../../types/index.js';
import { runtime } from './runtime.js';
export default {
rpc: {},
runtime,
types: {
PostDispatchInfo: {
actualWeight: 'Option<Weight>',
paysFee: 'Pays'
},
DispatchResultWithPostInfo: 'Result<PostDispatchInfo, DispatchError>',
CallDryRunEffects: {
executionResult: 'DispatchResultWithPostInfo',
emittedEvents: 'Vec<Event>',
localXcm: 'Option<VersionedXcm>',
forwardedXcms: 'Vec<(VersionedMultiLocation, Vec<VersionedXcm>)>'
},
XcmDryRunEffects: {
executionResult: 'OutcomeV4',
emittedEvents: 'Vec<Event>',
forwardedXcms: 'Vec<(VersionedMultiLocation, Vec<VersionedXcm>)>'
},
XcmDryRunApiError: {
_enum: [
'Unimplemented',
'VersionedConversionFailed'
]
}
}
} as Definitions;
@@ -0,0 +1,4 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
export * from './types.js';
@@ -0,0 +1,42 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DefinitionsCall } from '../../types/index.js';
export const runtime: DefinitionsCall = {
DryRunApi: [
{
methods: {
dry_run_call: {
description: 'Dry run call',
params: [
{
name: 'origin',
type: 'OriginCaller'
},
{
name: 'call',
type: 'RuntimeCall'
}
],
type: 'Result<CallDryRunEffects, XcmDryRunApiError>'
},
dry_run_xcm: {
description: 'Dry run XCM program',
params: [
{
name: 'originLocation',
type: 'VersionedMultiLocation'
},
{
name: 'xcm',
type: 'VersionedXcm'
}
],
type: 'Result<XcmDryRunEffects, XcmDryRunApiError>'
}
},
version: 1
}
]
};
@@ -0,0 +1,46 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { Enum, Option, Result, Struct, Vec } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { Pays, Weight } from '@polkadot/types/interfaces/runtime';
import type { DispatchError, Event } from '@polkadot/types/interfaces/system';
import type { OutcomeV4, VersionedMultiLocation, VersionedXcm } from '@polkadot/types/interfaces/xcm';
/** @name CallDryRunEffects */
export interface CallDryRunEffects extends Struct {
readonly executionResult: DispatchResultWithPostInfo;
readonly emittedEvents: Vec<Event>;
readonly localXcm: Option<VersionedXcm>;
readonly forwardedXcms: Vec<ITuple<[VersionedMultiLocation, Vec<VersionedXcm>]>>;
}
/** @name DispatchResultWithPostInfo */
export interface DispatchResultWithPostInfo extends Result<PostDispatchInfo, DispatchError> {
readonly isErr: boolean;
readonly asErr: DispatchError;
readonly isOk: boolean;
readonly asOk: PostDispatchInfo;
}
/** @name PostDispatchInfo */
export interface PostDispatchInfo extends Struct {
readonly actualWeight: Option<Weight>;
readonly paysFee: Pays;
}
/** @name XcmDryRunApiError */
export interface XcmDryRunApiError extends Enum {
readonly isUnimplemented: boolean;
readonly isVersionedConversionFailed: boolean;
readonly type: 'Unimplemented' | 'VersionedConversionFailed';
}
/** @name XcmDryRunEffects */
export interface XcmDryRunEffects extends Struct {
readonly executionResult: OutcomeV4;
readonly emittedEvents: Vec<Event>;
readonly forwardedXcms: Vec<ITuple<[VersionedMultiLocation, Vec<VersionedXcm>]>>;
}
export type PHANTOM_DRYRUNAPI = 'dryRunApi';
@@ -18,6 +18,9 @@ export default {
ExtrinsicSignatureV4: 'GenericExtrinsicSignatureV4',
ExtrinsicUnknown: 'GenericExtrinsicUnknown',
ExtrinsicPayloadUnknown: 'GenericExtrinsicPayloadUnknown',
ExtrinsicV5: 'GenericExtrinsicV5',
ExtrinsicPayloadV5: 'GenericExtrinsicPayloadV5',
ExtrinsicSignatureV5: 'GenericExtrinsicSignatureV5',
// eras
Era: 'ExtrinsicEra',
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericExtrinsicPayloadUnknown, GenericExtrinsicPayloadV4, GenericExtrinsicSignatureV4, GenericExtrinsicUnknown, GenericExtrinsicV4, GenericImmortalEra, GenericMortalEra, GenericSignerPayload } from '@polkadot/types';
import type { GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericExtrinsicPayloadUnknown, GenericExtrinsicPayloadV4, GenericExtrinsicPayloadV5, GenericExtrinsicSignatureV4, GenericExtrinsicSignatureV5, GenericExtrinsicUnknown, GenericExtrinsicV4, GenericExtrinsicV5, GenericImmortalEra, GenericMortalEra, GenericSignerPayload } from '@polkadot/types';
import type { Enum, U8aFixed } from '@polkadot/types-codec';
import type { H512 } from '@polkadot/types/interfaces/runtime';
@@ -32,18 +32,27 @@ export interface ExtrinsicPayloadUnknown extends GenericExtrinsicPayloadUnknown
/** @name ExtrinsicPayloadV4 */
export interface ExtrinsicPayloadV4 extends GenericExtrinsicPayloadV4 {}
/** @name ExtrinsicPayloadV5 */
export interface ExtrinsicPayloadV5 extends GenericExtrinsicPayloadV5 {}
/** @name ExtrinsicSignature */
export interface ExtrinsicSignature extends MultiSignature {}
/** @name ExtrinsicSignatureV4 */
export interface ExtrinsicSignatureV4 extends GenericExtrinsicSignatureV4 {}
/** @name ExtrinsicSignatureV5 */
export interface ExtrinsicSignatureV5 extends GenericExtrinsicSignatureV5 {}
/** @name ExtrinsicUnknown */
export interface ExtrinsicUnknown extends GenericExtrinsicUnknown {}
/** @name ExtrinsicV4 */
export interface ExtrinsicV4 extends GenericExtrinsicV4 {}
/** @name ExtrinsicV5 */
export interface ExtrinsicV5 extends GenericExtrinsicV5 {}
/** @name ImmortalEra */
export interface ImmortalEra extends GenericImmortalEra {}
+1
View File
@@ -25,6 +25,7 @@ export * from './cumulus/types.js';
export * from './democracy/types.js';
export * from './dev/types.js';
export * from './discovery/types.js';
export * from './dryRunApi/types.js';
export * from './elections/types.js';
export * from './engine/types.js';
export * from './eth/types.js';
@@ -11,8 +11,10 @@ import { mapXcmTypes } from '@polkadot/types-create';
import { v0 } from './v0.js';
import { v1 } from './v1.js';
import { v2 } from './v2.js';
import { v3 } from './v3.js';
import { v4 } from './v4.js';
const XCM_LATEST = 'V2';
const XCM_LATEST = 'V4';
const xcm = {
XcmOrigin: {
@@ -87,9 +89,11 @@ export default {
...v0,
...v1,
...v2,
...v3,
...v4,
...mapXcmTypes(XCM_LATEST),
DoubleEncodedCall: {
encoded: 'Vec<u8>'
encoded: 'Bytes'
},
XcmOriginKind: {
_enum: ['Native', 'SovereignAccount', 'Superuser', 'Xcm']
@@ -134,33 +138,43 @@ export default {
_enum: {
V0: 'MultiAssetV0',
V1: 'MultiAssetV1',
V2: 'MultiAssetV2'
V2: 'MultiAssetV2',
V3: 'MultiAssetV3',
V4: 'MultiAssetV4'
}
},
VersionedMultiAssets: {
_enum: {
V0: 'Vec<MultiAssetV0>',
V1: 'MultiAssetsV1',
V2: 'MultiAssetsV2'
V2: 'MultiAssetsV2',
V3: 'MultiAssetsV3',
V4: 'MultiAssetsV4'
}
},
VersionedMultiLocation: {
_enum: {
V0: 'MultiLocationV0',
V1: 'MultiLocationV1',
V2: 'MultiLocationV2'
V2: 'MultiLocationV2',
V3: 'MultiLocationV3',
V4: 'MultiLocationV4'
}
},
VersionedResponse: {
V0: 'ResponseV0',
V1: 'ResponseV1',
V2: 'ResponseV2'
V2: 'ResponseV2',
V3: 'ResponseV3',
V4: 'ResponseV4'
},
VersionedXcm: {
_enum: {
V0: 'XcmV0',
V1: 'XcmV1',
V2: 'XcmV2'
V2: 'XcmV2',
V3: 'XcmV3',
V4: 'XcmV4'
}
},
XcmVersion: 'u32'
File diff suppressed because it is too large Load Diff
+172 -45
View File
@@ -7,25 +7,148 @@
import type { DefinitionsTypes } from '../../types/index.js';
export const v2: DefinitionsTypes = {
AssetInstanceV2: 'AssetInstanceV1',
FungibilityV2: 'FungibilityV1',
JunctionV2: 'JunctionV1',
JunctionsV2: 'JunctionsV1',
MultiAssetsV2: 'MultiAssetsV1',
MultiAssetV2: 'MultiAssetV1',
MultiAssetFilterV2: 'MultiAssetFilterV1',
MultiLocationV2: 'MultiLocationV1',
OriginKindV2: 'OriginKindV1',
WildFungibilityV2: 'WildFungibilityV1',
AssetIdV2: {
_enum: {
Concrete: 'MultiLocationV2',
Abstract: 'Bytes'
}
},
AssetInstanceV2: {
_enum: {
Undefined: 'Null',
Index: 'Compact<u128>',
Array4: '[u8;4]',
Array8: '[u8;8]',
Array16: '[u8;16]',
Array32: '[u8;32]',
Blob: 'Bytes'
}
},
BodyIdV2: {
_enum: {
Unit: 'Null',
Named: 'Bytes',
Index: 'Compact<u32>',
Executive: 'Null',
Technical: 'Null',
Legislative: 'Null',
Judicial: 'Null',
Defense: 'Null',
Administration: 'Null',
Treasury: 'Null'
}
},
BodyPartV2: {
_enum: {
Voice: 'Null',
Members: {
count: 'Compact<u32>'
},
Fraction: {
nom: 'Compact<u32>',
denom: 'Compact<u32>'
},
AtLeastProportion: {
nom: 'Compact<u32>',
denom: 'Compact<u32>'
},
MoreThanProportion: {
nom: 'Compact<u32>',
denom: 'Compact<u32>'
}
}
},
NetworkIdV2: {
_enum: {
Any: 'Null',
Named: 'Bytes',
Polkadot: 'Null',
Kusama: 'Null'
}
},
JunctionV2: {
_enum: {
Parachain: 'Compact<u32>',
AccountId32: {
network: 'NetworkIdV2',
id: '[u8; 32]'
},
AccountIndex64: {
network: 'NetworkIdV2',
index: 'Compact<u64>'
},
AccountKey20: {
network: 'NetworkIdV2',
key: '[u8; 20]'
},
PalletInstance: 'u8',
GeneralIndex: 'Compact<u128>',
GeneralKey: 'Bytes',
OnlyChild: 'Null',
Plurality: {
id: 'BodyIdV2',
part: 'BodyPartV2'
}
}
},
JunctionsV2: {
_enum: {
Here: 'Null',
X1: 'JunctionV2',
X2: '(JunctionV2, JunctionV2)',
X3: '(JunctionV2, JunctionV2, JunctionV2)',
X4: '(JunctionV2, JunctionV2, JunctionV2, JunctionV2)',
X5: '(JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2)',
X6: '(JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2)',
X7: '(JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2)',
X8: '(JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2, JunctionV2)'
}
},
FungibilityV2: {
_enum: {
Fungible: 'Compact<u128>',
NonFungible: 'AssetInstanceV2'
}
},
InteriorMultiLocationV2: 'JunctionsV2',
MultiAssetV2: {
id: 'AssetIdV2',
fun: 'FungibilityV2'
},
MultiAssetsV2: 'Vec<MultiAssetV2>',
MultiAssetFilterV2: {
_enum: {
Definite: 'MultiAssetsV2',
Wild: 'WildMultiAssetV2'
}
},
MultiLocationV2: {
parents: 'u8',
interior: 'JunctionsV2'
},
OriginKindV2: {
_enum: {
Native: 'Null',
SovereignAccount: 'Null',
Superuser: 'Null',
Xcm: 'Null'
}
},
WildFungibilityV2: {
_enum: {
Fungible: 'Null',
NonFungible: 'Null'
}
},
ResponseV2: {
_enum: {
Null: 'Null',
Assets: 'MultiAssetsV2',
ExecutionResult: 'ResponseV2Result'
ExecutionResult: 'Option<(u32, XcmErrorV2)>',
Version: 'u32'
}
},
ResponseV2Error: '(u32, XcmErrorV2)',
ResponseV2Result: 'Result<Null, ResponseV2Error>',
WeightLimitV2: {
_enum: {
Unlimited: 'Null',
@@ -52,8 +175,8 @@ export const v2: DefinitionsTypes = {
xcm: 'XcmV2'
},
Transact: {
originType: 'OriginKindV2',
requireWeightAtMost: 'u64',
originType: 'XcmOriginKind',
requireWeightAtMost: 'Compact<u64>',
call: 'DoubleEncodedCall'
},
HrmpNewChannelOpenRequest: {
@@ -70,7 +193,7 @@ export const v2: DefinitionsTypes = {
recipient: 'Compact<u32>'
},
ClearOrigin: 'Null',
DescendOrigin: 'InteriorMultiLocation',
DescendOrigin: 'InteriorMultiLocationV2',
ReportError: {
queryId: 'Compact<u64>',
dest: 'MultiLocationV2',
@@ -78,12 +201,12 @@ export const v2: DefinitionsTypes = {
},
DepositAsset: {
assets: 'MultiAssetFilterV2',
maxAssets: 'u32',
maxAssets: 'Compact<u32>',
beneficiary: 'MultiLocationV2'
},
DepositReserveAsset: {
assets: 'MultiAssetFilterV2',
maxAssets: 'u32',
maxAssets: 'Compact<u32>',
dest: 'MultiLocationV2',
xcm: 'XcmV2'
},
@@ -102,65 +225,69 @@ export const v2: DefinitionsTypes = {
xcm: 'XcmV2'
},
QueryHolding: {
query_id: 'Compact<u64>',
queryId: 'Compact<u64>',
dest: 'MultiLocationV2',
assets: 'MultiAssetFilterV2',
maxResponse_Weight: 'Compact<u64>'
maxResponseWeight: 'Compact<u64>'
},
BuyExecution: {
fees: 'MultiAssetV2',
weightLimit: 'WeightLimitV2'
},
RefundSurplus: 'Null',
SetErrorHandler: 'XcmV2',
SetAppendix: 'XcmV2',
SetErrorHandler: 'XcmV2<RuntimeCall>',
SetAppendix: 'XcmV2<RuntimeCall>',
ClearError: 'Null',
ClaimAsset: {
assets: 'MultiAssetsV2',
ticket: 'MultiLocationV2'
},
Trap: 'u64'
Trap: 'Compact<u64>',
SubscribeVersion: {
queryId: 'Compact<u64>',
maxResponseWeight: 'Compact<u64>'
},
UnsubscribeVersion: 'Null'
}
},
WildMultiAssetV2: {
_enum: {
All: 'Null',
AllOf: {
id: 'AssetIdV2',
fun: 'WildFungibilityV2'
}
}
},
WildMultiAssetV2: 'WildMultiAssetV1',
XcmV2: 'Vec<InstructionV2>',
XcmErrorV2: {
_enum: {
Undefined: 'Null',
Overflow: 'Null',
Unimplemented: 'Null',
UnhandledXcmVersion: 'Null',
UnhandledXcmMessage: 'Null',
UnhandledEffect: 'Null',
EscalationOfPrivilege: 'Null',
UntrustedReserveLocation: 'Null',
UntrustedTeleportLocation: 'Null',
DestinationBufferOverflow: 'Null',
MultiLocationFull: 'Null',
MultiLocationNotInvertible: 'Null',
FailedToDecode: 'Null',
BadOrigin: 'Null',
ExceedsMaxMessageSize: 'Null',
InvalidLocation: 'Null',
AssetNotFound: 'Null',
FailedToTransactAsset: 'Null',
WeightLimitReached: 'Weight',
Wildcard: 'Null',
TooMuchWeightRequired: 'Null',
NotHoldingFees: 'Null',
WeightNotComputable: 'Null',
Barrier: 'Null',
NotWithdrawable: 'Null',
LocationCannotHold: 'Null',
TooExpensive: 'Null',
AssetNotFound: 'Null',
ExceedsMaxMessageSize: 'Null',
DestinationUnsupported: 'Null',
RecursionLimitReached: 'Null',
Transport: 'Null',
Unroutable: 'Null',
UnknownWeightRequired: 'Null',
Trap: 'u64',
UnknownClaim: 'Null',
InvalidLocation: 'Null'
FailedToDecode: 'Null',
MaxWeightInvalid: 'Null',
NotHoldingFees: 'Null',
TooExpensive: 'Null',
Trap: 'u64',
UnhandledXcmVersion: 'Null',
WeightLimitReached: 'Weight',
Barrier: 'Null',
WeightNotComputable: 'Null'
}
},
XcmOrderV2: 'XcmOrderV1'
}
};
+386
View File
@@ -0,0 +1,386 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { DefinitionsTypes } from '../../types/index.js';
export const v3: DefinitionsTypes = {
AssetIdV3: {
_enum: {
Concrete: 'MultiLocationV3',
Abstract: 'Bytes'
}
},
BodyIdV3: {
_enum: {
Unit: 'Null',
Moniker: '[u8;4]',
Index: 'Compact<u32>',
Executive: 'Null',
Technical: 'Null',
Legislative: 'Null',
Judicial: 'Null',
Defense: 'Null',
Administration: 'Null',
Treasury: 'Null'
}
},
BodyPartV3: {
_enum: {
Voice: 'Null',
Members: {
count: 'Compact<u32>'
},
Fraction: {
nom: 'Compact<u32>',
denom: 'Compact<u32>'
},
AtLeastProportion: {
nom: 'Compact<u32>',
denom: 'Compact<u32>'
},
MoreThanProportion: {
nom: 'Compact<u32>',
denom: 'Compact<u32>'
}
}
},
AssetInstanceV3: {
_enum: {
Undefined: 'Null',
Index: 'Compact<u128>',
Array4: '[u8;4]',
Array8: '[u8;8]',
Array16: '[u8;16]',
Array32: '[u8;32]'
}
},
FungibilityV3: {
_enum: {
Fungible: 'Compact<u128>',
NonFungible: 'AssetInstanceV3'
}
},
InteriorMultiLocationV3: 'JunctionsV3',
JunctionV3: {
_enum: {
Parachain: 'Compact<u32>',
AccountId32: {
network: 'Option<NetworkIdV3>',
id: '[u8;32]'
},
AccountIndex64: {
network: 'Option<NetworkIdV3>',
index: 'Compact<u64>'
},
AccountKey20: {
network: 'Option<NetworkIdV3>',
key: '[u8;20]'
},
PalletInstance: 'u8',
GeneralIndex: 'Compact<u128>',
GeneralKey: {
length: 'u8',
data: '[u8;32]'
},
OnlyChild: 'Null',
Plurality: {
id: 'BodyIdV3',
part: 'BodyPartV3'
},
GlobalConsensus: 'NetworkIdV3'
}
},
JunctionsV3: {
_enum: {
Here: 'Null',
X1: 'JunctionV3',
X2: '(JunctionV3, JunctionV3)',
X3: '(JunctionV3, JunctionV3, JunctionV3)',
X4: '(JunctionV3, JunctionV3, JunctionV3, JunctionV3)',
X5: '(JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3)',
X6: '(JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3)',
X7: '(JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3)',
X8: '(JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3, JunctionV3)'
}
},
MaybeErrorCodeV3: {
_enum: {
Success: 'Null',
Error: 'Bytes',
TruncatedError: 'Bytes'
}
},
MaxPalletsInfo: 'u32',
MultiAssetV3: {
id: 'AssetIdV3',
fun: 'FungibilityV3'
},
MultiAssetsV3: 'Vec<MultiAssetV3>',
MultiAssetFilterV3: {
_enum: {
Definite: 'MultiAssetsV3',
Wild: 'WildMultiAssetV3'
}
},
MultiLocationV3: {
parents: 'u8',
interior: 'JunctionsV3'
},
MaxPalletNameLen: 'u32',
NetworkIdV3: {
_enum: {
ByGenesis: '[u8;32]',
ByFork: {
blockNumber: 'u64',
blockHash: '[u8;32]'
},
Polkadot: 'Null',
Kusama: 'Null',
Westend: 'Null',
Rococo: 'Null',
Wococo: 'Null',
Ethereum: {
chainId: 'Compact<u64>'
},
BitcoinCore: 'Null',
BitcoinCash: 'Null',
PolkadotBulletin: 'Null'
}
},
OriginKindV3: 'OriginKindV2',
PalletInfoV3: {
index: 'Compact<u32>',
name: 'Bytes',
moduleName: 'Bytes',
major: 'Compact<u32>',
minor: 'Compact<u32>',
patch: 'Compact<u32>'
},
WildFungibilityV3: 'WildFungibilityV2',
QueryResponseInfoV3: {
destination: 'MultiLocationV3',
queryId: 'Compact<u64>',
maxWeight: 'WeightV2'
},
ResponseV3: {
_enum: {
Null: 'Null',
Assets: 'MultiAssetsV3',
ExecutionResult: 'Option<(u32,XcmErrorV3)>',
Version: 'u32',
PalletsInfo: 'Vec<PalletInfoV3>',
DispatchResult: 'MaybeErrorCodeV3'
}
},
XcmErrorV3: {
_enum: {
Overflow: 'Null',
Unimplemented: 'Null',
UntrustedReserveLocation: 'Null',
UntrustedTeleportLocation: 'Null',
LocationFull: 'Null',
LocationNotInvertible: 'Null',
BadOrigin: 'Null',
InvalidLocation: 'Null',
AssetNotFound: 'Null',
FailedToTransactAsset: 'Null',
NotWithdrawable: 'Null',
LocationCannotHold: 'Null',
ExceedsMaxMessageSize: 'Null',
DestinationUnsupported: 'Null',
Transport: 'Null',
Unroutable: 'Null',
UnknownClaim: 'Null',
FailedToDecode: 'Null',
MaxWeightInvalid: 'Null',
NotHoldingFees: 'Null',
TooExpensive: 'Null',
Trap: 'u64',
ExpectationFalse: 'Null',
PalletNotFound: 'Null',
NameMismatch: 'Null',
VersionIncompatible: 'Null',
HoldingWouldOverflow: 'Null',
ExportError: 'Null',
ReanchorFailed: 'Null',
NoDeal: 'Null',
FeesNotMet: 'Null',
LockError: 'Null',
NoPermission: 'Null',
Unanchored: 'Null',
NotDepositable: 'Null',
UnhandledXcmVersion: 'Null',
WeightLimitReached: 'WeightV2',
Barrier: 'Null',
ExceedsStackLimit: 'Null'
}
},
ResponseV3Error: '(u32, XcmErrorV3)',
ResponseV3Result: 'Option<(u32, ResponseV3Error)>',
WeightLimitV3: {
_enum: {
Unlimited: 'Null',
Limited: 'WeightV2'
}
},
InstructionV3: {
_enum: {
WithdrawAsset: 'MultiAssetsV3',
ReserveAssetDeposited: 'MultiAssetsV3',
ReceiveTeleportedAsset: 'MultiAssetsV3',
QueryResponse: {
queryId: 'Compact<u64>',
response: 'ResponseV3',
maxWeight: 'WeightV2',
querier: 'Option<MultiLocationV3>'
},
TransferAsset: {
assets: 'MultiAssetsV3',
beneficiary: 'MultiLocationV3'
},
TransferReserveAsset: {
assets: 'MultiAssetsV3',
dest: 'MultiLocationV3',
xcm: 'XcmV3'
},
Transact: {
originKind: 'XcmOriginKind',
requireWeightAtMost: 'WeightV2',
call: 'DoubleEncodedCall'
},
HrmpNewChannelOpenRequest: {
sender: 'Compact<u32>',
maxMessageSize: 'Compact<u32>',
maxCapacity: 'Compact<u32>'
},
HrmpChannelAccepted: {
recipient: 'Compact<u32>'
},
HrmpChannelClosing: {
initiator: 'Compact<u32>',
sender: 'Compact<u32>',
recipient: 'Compact<u32>'
},
ClearOrigin: 'Null',
DescendOrigin: 'JunctionsV3',
ReportError: 'QueryResponseInfoV3',
DepositAsset: {
assets: 'MultiAssetFilterV3',
beneficiary: 'MultiLocationV3'
},
DepositReserveAsset: {
assets: 'MultiAssetFilterV3',
dest: 'MultiLocationV3',
xcm: 'XcmV3'
},
ExchangeAsset: {
give: 'MultiAssetFilterV3',
want: 'MultiAssetsV3',
maximal: 'bool'
},
InitiateReserveWithdraw: {
assets: 'MultiAssetFilterV3',
reserve: 'MultiLocationV3',
xcm: 'XcmV3'
},
InitiateTeleport: {
assets: 'MultiAssetFilterV3',
dest: 'MultiLocationV3',
xcm: 'XcmV3'
},
ReportHolding: {
responseInfo: 'QueryResponseInfoV3',
assets: 'MultiAssetFilterV3'
},
BuyExecution: {
fees: 'MultiAssetV3',
weightLimit: 'WeightLimitV3'
},
RefundSurplus: 'Null',
SetErrorHandler: 'XcmV3<RuntimeCall>',
SetAppendix: 'XcmV3<RuntimeCall>',
ClearError: 'Null',
ClaimAsset: {
assets: 'MultiAssetsV3',
ticket: 'MultiLocationV3'
},
Trap: 'Compact<u64>',
SubscribeVersion: {
queryId: 'Compact<u64>',
maxResponseWeight: 'WeightV2'
},
UnsubscribeVersion: 'Null',
BurnAsset: 'MultiAssetsV3',
ExpectAsset: 'MultiAssetsV3',
ExpectOrigin: 'Option<MultiLocationV3>',
ExpectError: 'Option<(u32, XcmErrorV3)>',
ExpectTransactStatus: 'MaybeErrorCodeV3',
QueryPallet: {
moduleName: 'Vec<u8>',
responseInfo: 'QueryResponseInfoV3'
},
ExpectPallet: {
index: 'Compact<u32>',
name: 'Vec<u8>',
moduleName: 'Vec<u8>',
crateMajor: 'Compact<u32>',
minCrateMinor: 'Compact<u32>'
},
ReportTransactStatus: 'QueryResponseInfoV3',
ClearTransactStatus: 'Null',
UniversalOrigin: 'JunctionV3',
ExportMessage: {
network: 'NetworkIdV3',
destination: 'JunctionsV3',
xcm: 'XcmV3'
},
LockAsset: {
asset: 'MultiAssetV3',
unlocker: 'MultiLocationV3'
},
UnlockAsset: {
asset: 'MultiAssetV3',
target: 'MultiLocationV3'
},
NoteUnlockable: {
asset: 'MultiAssetV3',
owner: 'MultiLocationV3'
},
RequestUnlock: {
asset: 'MultiAssetV3',
locker: 'MultiLocationV3'
},
SetFeesMode: {
jitWithdraw: 'bool'
},
SetTopic: '[u8; 32]',
ClearTopic: 'Null',
AliasOrigin: 'MultiLocationV3',
UnpaidExecution: {
weightLimit: 'WeightLimitV3',
checkOrigin: 'Option<MultiLocationV3>'
}
}
},
WildMultiAssetV3: {
_enum: {
All: 'Null',
AllOf: {
id: 'AssetIdV3',
fun: 'WildFungibilityV2'
},
AllCounted: 'Compact<u32>',
AllOfCounted: {
id: 'AssetIdV3',
fun: 'WildFungibilityV2',
count: 'Compact<u32>'
}
}
},
VersionV3: 'u32',
XcmV3: 'Vec<InstructionV3>'
};
+281
View File
@@ -0,0 +1,281 @@
// Copyright 2017-2024 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
// order important in structs... :)
/* eslint-disable sort-keys */
import type { DefinitionsTypes } from '../../types/index.js';
export const v4: DefinitionsTypes = {
AssetIdV4: 'MultiLocationV4',
AssetInstanceV4: {
_enum: {
Undefined: 'Null',
Index: 'Compact<u128>',
Array4: '[u8;4]',
Array8: '[u8;8]',
Array16: '[u8;16]',
Array32: '[u8;32]'
}
},
FungibilityV4: {
_enum: {
Fungible: 'Compact<u128>',
NonFungible: 'AssetInstanceV4'
}
},
UncheckedFungibilityV4: {
_enum: {
Fungible: 'Compact<u128>',
NonFungible: 'AssetInstanceV4'
}
},
JunctionV4: {
_enum: {
Parachain: 'Compact<u32>',
AccountId32: {
network: 'Option<NetworkIdV4>',
id: '[u8;32]'
},
AccountIndex64: {
network: 'Option<NetworkIdV4>',
index: 'Compact<u64>'
},
AccountKey20: {
network: 'Option<NetworkIdV4>',
key: '[u8;20]'
},
PalletInstance: 'u8',
GeneralIndex: 'Compact<u128>',
GeneralKey: {
length: 'u8',
data: '[u8;32]'
},
OnlyChild: 'Null',
Plurality: {
id: 'BodyIdV3',
part: 'BodyPartV3'
},
GlobalConsensus: 'NetworkIdV4'
}
},
JunctionsV4: {
_enum: {
Here: 'Null',
X1: '[JunctionV4;1]',
X2: '[JunctionV4;2]',
X3: '[JunctionV4;3]',
X4: '[JunctionV4;4]',
X5: '[JunctionV4;5]',
X6: '[JunctionV4;6]',
X7: '[JunctionV4;7]',
X8: '[JunctionV4;8]'
}
},
MaxPalletsInfo: 'u32',
NetworkIdV4: 'NetworkIdV3',
MultiAssetV4: {
id: 'AssetIdV4',
fun: 'FungibilityV4'
},
MultiAssetsV4: 'Vec<MultiAssetV4>',
MultiAssetFilterV4: {
_enum: {
Definite: 'MultiAssetsV4',
Wild: 'WildMultiAssetV4'
}
},
MultiLocationV4: {
parents: 'u8',
interior: 'JunctionsV4'
},
OriginKindV4: 'XcmOriginKind',
PalletInfoV4: 'PalletInfoV3',
WildFungibilityV4: 'WildFungibilityV2',
QueryResponseInfoV4: {
destination: 'MultiLocationV4',
queryId: 'Compact<u64>',
maxWeight: 'WeightV2'
},
ResponseV4: {
_enum: {
Null: 'Null',
Assets: 'MultiAssetsV4',
ExecutionResult: 'Option<(u32, XcmErrorV3)>',
Version: 'u32',
PalletsInfo: 'Vec<PalletInfoV4>',
DispatchResult: 'MaybeErrorCodeV3'
}
},
InstructionV4: {
_enum: {
WithdrawAsset: 'MultiAssetsV4',
ReserveAssetDeposited: 'MultiAssetsV4',
ReceiveTeleportedAsset: 'MultiAssetsV4',
QueryResponse: {
queryId: 'Compact<u64>',
response: 'ResponseV4',
maxWeight: 'WeightV2',
querier: 'Option<MultiLocationV4>'
},
TransferAsset: {
assets: 'MultiAssetsV4',
beneficiary: 'MultiLocationV4'
},
TransferReserveAsset: {
assets: 'MultiAssetsV4',
dest: 'MultiLocationV4',
xcm: 'XcmV4'
},
Transact: {
originKind: 'OriginKindV4',
requireWeightAtMost: 'WeightV2',
call: 'DoubleEncodedCall'
},
HrmpNewChannelOpenRequest: {
sender: 'Compact<u32>',
maxMessageSize: 'Compact<u32>',
maxCapacity: 'Compact<u32>'
},
HrmpChannelAccepted: {
recipient: 'Compact<u32>'
},
HrmpChannelClosing: {
initiator: 'Compact<u32>',
sender: 'Compact<u32>',
recipient: 'Compact<u32>'
},
ClearOrigin: 'Null',
DescendOrigin: 'JunctionsV4',
ReportError: 'QueryResponseInfoV4',
DepositAsset: {
assets: 'MultiAssetFilterV4',
beneficiary: 'MultiLocationV4'
},
DepositReserveAsset: {
assets: 'MultiAssetFilterV4',
dest: 'MultiLocationV4',
xcm: 'XcmV4'
},
ExchangeAsset: {
give: 'MultiAssetFilterV4',
want: 'MultiAssetsV4',
maximal: 'bool'
},
InitiateReserveWithdraw: {
assets: 'MultiAssetFilterV4',
reserve: 'MultiLocationV4',
xcm: 'XcmV4'
},
InitiateTeleport: {
assets: 'MultiAssetFilterV4',
dest: 'MultiLocationV4',
xcm: 'XcmV4'
},
ReportHolding: {
responseInfo: 'QueryResponseInfoV4',
assets: 'MultiAssetFilterV4'
},
BuyExecution: {
fees: 'MultiAssetV4',
weightLimit: 'WeightLimitV3'
},
RefundSurplus: 'Null',
SetErrorHandler: 'XcmV4',
SetAppendix: 'XcmV4',
ClearError: 'Null',
ClaimAsset: {
assets: 'MultiAssetsV4',
ticket: 'MultiLocationV4'
},
Trap: 'Compact<u64>',
SubscribeVersion: {
queryId: 'Compact<u64>',
maxResponseWeight: 'WeightV2'
},
UnsubscribeVersion: 'Null',
BurnAsset: 'MultiAssetsV4',
ExpectAsset: 'MultiAssetsV4',
ExpectOrigin: 'Option<MultiLocationV4>',
ExpectError: 'Option<(u32, XcmErrorV3)>',
ExpectTransactStatus: 'MaybeErrorCodeV3',
QueryPallet: {
moduleName: 'Vec<u8>',
responseInfo: 'QueryResponseInfoV4'
},
ExpectPallet: {
index: 'Compact<u32>',
name: 'Vec<u8>',
moduleName: 'Vec<u8>',
crateMajor: 'Compact<u32>',
minCrateMinor: 'Compact<u32>'
},
ReportTransactStatus: 'QueryResponseInfoV4',
ClearTransactStatus: 'Null',
UniversalOrigin: 'JunctionV4',
ExportMessage: {
network: 'NetworkIdV4',
destination: 'JunctionsV4',
xcm: 'XcmV4'
},
LockAsset: {
asset: 'MultiAssetV4',
unlocker: 'MultiLocationV4'
},
UnlockAsset: {
asset: 'MultiAssetV4',
target: 'MultiLocationV4'
},
NoteUnlockable: {
asset: 'MultiAssetV4',
owner: 'MultiLocationV4'
},
RequestUnlock: {
asset: 'MultiAssetV4',
locker: 'MultiLocationV4'
},
SetFeesMode: {
jitWithdraw: 'bool'
},
SetTopic: '[u8;32]',
ClearTopic: 'Null',
AliasOrigin: 'MultiLocationV4',
UnpaidExecution: {
weightLimit: 'WeightLimitV3',
checkOrigin: 'Option<MultiLocationV4>'
}
}
},
OutcomeV4: {
_enum: {
Complete: {
used: 'WeightV2'
},
Incomplete: {
used: 'WeightV2',
error: 'XcmErrorV3'
},
Error: {
error: 'XcmErrorV3'
}
}
},
WildMultiAssetV4: {
_enum: {
All: 'Null',
AllOf: {
id: 'AssetIdV4',
fun: 'WildFungibilityV4'
},
AllCounted: 'Compact<u32>',
AllOfCounted: {
id: 'AssetIdV4',
fun: 'WildFungibilityV4',
count: 'Compact<u32>'
}
}
},
VersionV4: 'u32',
XcmV4: 'Vec<InstructionV4>',
XcmErrorV4: 'XcmErrorV3'
};
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '13.0.1' };
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '14.0.1' };
+6
View File
@@ -247,6 +247,12 @@ export interface IExtrinsicImpl extends IExtrinsicSignable<IExtrinsicImpl> {
readonly version: number;
}
export interface IExtrinsicV5Impl extends IExtrinsicSignable<IExtrinsicV5Impl> {
readonly method: Call;
readonly signature: IExtrinsicSignature;
readonly version: number;
}
export interface IExtrinsic<A extends AnyTuple = AnyTuple> extends IExtrinsicSignable<IExtrinsic<A>>, ExtrinsicSignatureBase, IMethod<A> {
readonly length: number;
readonly method: IMethod<A>;
+198 -198
View File
@@ -447,27 +447,27 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/api-augment@npm:13.0.1, @polkadot/api-augment@workspace:packages/api-augment":
"@polkadot/api-augment@npm:14.0.1, @polkadot/api-augment@workspace:packages/api-augment":
version: 0.0.0-use.local
resolution: "@polkadot/api-augment@workspace:packages/api-augment"
dependencies:
"@polkadot/api-base": "npm:13.0.1"
"@polkadot/rpc-augment": "npm:13.0.1"
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-augment": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/api-base": "npm:14.0.1"
"@polkadot/rpc-augment": "npm:14.0.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-augment": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/api-base@npm:13.0.1, @polkadot/api-base@workspace:packages/api-base":
"@polkadot/api-base@npm:14.0.1, @polkadot/api-base@workspace:packages/api-base":
version: 0.0.0-use.local
resolution: "@polkadot/api-base@workspace:packages/api-base"
dependencies:
"@polkadot/rpc-core": "npm:13.0.1"
"@polkadot/types": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/rpc-core": "npm:14.0.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.7.0"
languageName: unknown
@@ -477,59 +477,59 @@ __metadata:
version: 0.0.0-use.local
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
dependencies:
"@polkadot/api": "npm:13.0.1"
"@polkadot/api-augment": "npm:13.0.1"
"@polkadot/keyring": "npm:^13.0.2"
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/types-create": "npm:13.0.1"
"@polkadot/types-support": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/util-crypto": "npm:^13.0.2"
"@polkadot/api": "npm:14.0.1"
"@polkadot/api-augment": "npm:14.0.1"
"@polkadot/keyring": "npm:^13.1.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/types-create": "npm:14.0.1"
"@polkadot/types-support": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
"@polkadot/util-crypto": "npm:^13.1.1"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/api-derive@npm:13.0.1, @polkadot/api-derive@workspace:packages/api-derive":
"@polkadot/api-derive@npm:14.0.1, @polkadot/api-derive@workspace:packages/api-derive":
version: 0.0.0-use.local
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
dependencies:
"@polkadot/api": "npm:13.0.1"
"@polkadot/api-augment": "npm:13.0.1"
"@polkadot/api-base": "npm:13.0.1"
"@polkadot/rpc-augment": "npm:13.0.1"
"@polkadot/rpc-core": "npm:13.0.1"
"@polkadot/rpc-provider": "npm:13.0.1"
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/types-support": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/util-crypto": "npm:^13.0.2"
"@polkadot/api": "npm:14.0.1"
"@polkadot/api-augment": "npm:14.0.1"
"@polkadot/api-base": "npm:14.0.1"
"@polkadot/rpc-augment": "npm:14.0.1"
"@polkadot/rpc-core": "npm:14.0.1"
"@polkadot/rpc-provider": "npm:14.0.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/types-support": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
"@polkadot/util-crypto": "npm:^13.1.1"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/api@npm:13.0.1, @polkadot/api@workspace:packages/api":
"@polkadot/api@npm:14.0.1, @polkadot/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@polkadot/api@workspace:packages/api"
dependencies:
"@polkadot/api-augment": "npm:13.0.1"
"@polkadot/api-base": "npm:13.0.1"
"@polkadot/api-derive": "npm:13.0.1"
"@polkadot/keyring": "npm:^13.0.2"
"@polkadot/rpc-augment": "npm:13.0.1"
"@polkadot/rpc-core": "npm:13.0.1"
"@polkadot/rpc-provider": "npm:13.0.1"
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-augment": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/types-create": "npm:13.0.1"
"@polkadot/types-known": "npm:13.0.1"
"@polkadot/types-support": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/util-crypto": "npm:^13.0.2"
"@polkadot/api-augment": "npm:14.0.1"
"@polkadot/api-base": "npm:14.0.1"
"@polkadot/api-derive": "npm:14.0.1"
"@polkadot/keyring": "npm:^13.1.1"
"@polkadot/rpc-augment": "npm:14.0.1"
"@polkadot/rpc-core": "npm:14.0.1"
"@polkadot/rpc-provider": "npm:14.0.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-augment": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/types-create": "npm:14.0.1"
"@polkadot/types-known": "npm:14.0.1"
"@polkadot/types-support": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
"@polkadot/util-crypto": "npm:^13.1.1"
eventemitter3: "npm:^5.0.1"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.7.0"
@@ -632,69 +632,69 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/keyring@npm:^13.0.2":
version: 13.0.2
resolution: "@polkadot/keyring@npm:13.0.2"
"@polkadot/keyring@npm:^13.1.1":
version: 13.1.1
resolution: "@polkadot/keyring@npm:13.1.1"
dependencies:
"@polkadot/util": "npm:13.0.2"
"@polkadot/util-crypto": "npm:13.0.2"
tslib: "npm:^2.6.2"
"@polkadot/util": "npm:13.1.1"
"@polkadot/util-crypto": "npm:13.1.1"
tslib: "npm:^2.7.0"
peerDependencies:
"@polkadot/util": 13.0.2
"@polkadot/util-crypto": 13.0.2
checksum: 10/7d94566cf61396a8890abe5d59b8fdd6d763a9eb3f9a42b8e2faab950fa0e13ac043b6898ea467694c098bac72c5bf3d44cc9da1fb1511ba1424c740f638ad48
"@polkadot/util": 13.1.1
"@polkadot/util-crypto": 13.1.1
checksum: 10/ec0498d7b65815d416afe8004ef5b642e4cd767546ffb38d87eb799f246829dd4594a40a8c116bdc338cdc7c17908bd1aa9cdae21b8b16ef0d4f2af0a4bba00d
languageName: node
linkType: hard
"@polkadot/networks@npm:13.0.2, @polkadot/networks@npm:^13.0.2":
version: 13.0.2
resolution: "@polkadot/networks@npm:13.0.2"
"@polkadot/networks@npm:13.1.1, @polkadot/networks@npm:^13.1.1":
version: 13.1.1
resolution: "@polkadot/networks@npm:13.1.1"
dependencies:
"@polkadot/util": "npm:13.0.2"
"@substrate/ss58-registry": "npm:^1.46.0"
tslib: "npm:^2.6.2"
checksum: 10/00722e54b9869a6186b1974fad7eb35af6a1fb13ad6bd82d79c972250e874994977ed6fdc1c5f1eb0465974ab628de7251502f162c179d40f872c49b54ab5e7d
"@polkadot/util": "npm:13.1.1"
"@substrate/ss58-registry": "npm:^1.50.0"
tslib: "npm:^2.7.0"
checksum: 10/50df885cba557e703a52a419135b869fb2dcc0f772649761ac2f4c9ee2444aae80842c1a24383857527f293c765c867ae75891f199d3885e43fd6e3feb1f7d8b
languageName: node
linkType: hard
"@polkadot/rpc-augment@npm:13.0.1, @polkadot/rpc-augment@workspace:packages/rpc-augment":
"@polkadot/rpc-augment@npm:14.0.1, @polkadot/rpc-augment@workspace:packages/rpc-augment":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-augment@workspace:packages/rpc-augment"
dependencies:
"@polkadot/rpc-core": "npm:13.0.1"
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/rpc-core": "npm:14.0.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/rpc-core@npm:13.0.1, @polkadot/rpc-core@workspace:packages/rpc-core":
"@polkadot/rpc-core@npm:14.0.1, @polkadot/rpc-core@workspace:packages/rpc-core":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
dependencies:
"@polkadot/keyring": "npm:^13.0.2"
"@polkadot/rpc-augment": "npm:13.0.1"
"@polkadot/rpc-provider": "npm:13.0.1"
"@polkadot/types": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/keyring": "npm:^13.1.1"
"@polkadot/rpc-augment": "npm:14.0.1"
"@polkadot/rpc-provider": "npm:14.0.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/rpc-provider@npm:13.0.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
"@polkadot/rpc-provider@npm:14.0.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
dependencies:
"@polkadot/keyring": "npm:^13.0.2"
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-support": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/util-crypto": "npm:^13.0.2"
"@polkadot/x-fetch": "npm:^13.0.2"
"@polkadot/x-global": "npm:^13.0.2"
"@polkadot/x-ws": "npm:^13.0.2"
"@polkadot/keyring": "npm:^13.1.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-support": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
"@polkadot/util-crypto": "npm:^13.1.1"
"@polkadot/x-fetch": "npm:^13.1.1"
"@polkadot/x-global": "npm:^13.1.1"
"@polkadot/x-ws": "npm:^13.1.1"
"@substrate/connect": "npm:0.8.11"
eventemitter3: "npm:^5.0.1"
mock-socket: "npm:^9.3.1"
@@ -710,18 +710,18 @@ __metadata:
version: 0.0.0-use.local
resolution: "@polkadot/typegen@workspace:packages/typegen"
dependencies:
"@polkadot/api": "npm:13.0.1"
"@polkadot/api-augment": "npm:13.0.1"
"@polkadot/rpc-augment": "npm:13.0.1"
"@polkadot/rpc-provider": "npm:13.0.1"
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-augment": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/types-create": "npm:13.0.1"
"@polkadot/types-support": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/util-crypto": "npm:^13.0.2"
"@polkadot/x-ws": "npm:^13.0.2"
"@polkadot/api": "npm:14.0.1"
"@polkadot/api-augment": "npm:14.0.1"
"@polkadot/rpc-augment": "npm:14.0.1"
"@polkadot/rpc-provider": "npm:14.0.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-augment": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/types-create": "npm:14.0.1"
"@polkadot/types-support": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
"@polkadot/util-crypto": "npm:^13.1.1"
"@polkadot/x-ws": "npm:^13.1.1"
"@types/yargs": "npm:^17.0.33"
handlebars: "npm:^4.7.8"
tslib: "npm:^2.7.0"
@@ -735,113 +735,113 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-augment@npm:13.0.1, @polkadot/types-augment@workspace:packages/types-augment":
"@polkadot/types-augment@npm:14.0.1, @polkadot/types-augment@workspace:packages/types-augment":
version: 0.0.0-use.local
resolution: "@polkadot/types-augment@workspace:packages/types-augment"
dependencies:
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/types-codec@npm:13.0.1, @polkadot/types-codec@workspace:packages/types-codec":
"@polkadot/types-codec@npm:14.0.1, @polkadot/types-codec@workspace:packages/types-codec":
version: 0.0.0-use.local
resolution: "@polkadot/types-codec@workspace:packages/types-codec"
dependencies:
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-augment": "npm:13.0.1"
"@polkadot/types-support": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/util-crypto": "npm:^13.0.2"
"@polkadot/x-bigint": "npm:^13.0.2"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-augment": "npm:14.0.1"
"@polkadot/types-support": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
"@polkadot/util-crypto": "npm:^13.1.1"
"@polkadot/x-bigint": "npm:^13.1.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/types-create@npm:13.0.1, @polkadot/types-create@workspace:packages/types-create":
"@polkadot/types-create@npm:14.0.1, @polkadot/types-create@workspace:packages/types-create":
version: 0.0.0-use.local
resolution: "@polkadot/types-create@workspace:packages/types-create"
dependencies:
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/types-known@npm:13.0.1, @polkadot/types-known@workspace:packages/types-known":
"@polkadot/types-known@npm:14.0.1, @polkadot/types-known@workspace:packages/types-known":
version: 0.0.0-use.local
resolution: "@polkadot/types-known@workspace:packages/types-known"
dependencies:
"@polkadot/api": "npm:13.0.1"
"@polkadot/networks": "npm:^13.0.2"
"@polkadot/types": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/types-create": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/api": "npm:14.0.1"
"@polkadot/networks": "npm:^13.1.1"
"@polkadot/types": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/types-create": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/types-support@npm:13.0.1, @polkadot/types-support@workspace:packages/types-support":
"@polkadot/types-support@npm:14.0.1, @polkadot/types-support@workspace:packages/types-support":
version: 0.0.0-use.local
resolution: "@polkadot/types-support@workspace:packages/types-support"
dependencies:
"@polkadot/util": "npm:^13.0.2"
"@polkadot/util": "npm:^13.1.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/types@npm:13.0.1, @polkadot/types@workspace:packages/types":
"@polkadot/types@npm:14.0.1, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types"
dependencies:
"@polkadot/keyring": "npm:^13.0.2"
"@polkadot/types-augment": "npm:13.0.1"
"@polkadot/types-codec": "npm:13.0.1"
"@polkadot/types-create": "npm:13.0.1"
"@polkadot/types-support": "npm:13.0.1"
"@polkadot/util": "npm:^13.0.2"
"@polkadot/util-crypto": "npm:^13.0.2"
"@polkadot/keyring": "npm:^13.1.1"
"@polkadot/types-augment": "npm:14.0.1"
"@polkadot/types-codec": "npm:14.0.1"
"@polkadot/types-create": "npm:14.0.1"
"@polkadot/types-support": "npm:14.0.1"
"@polkadot/util": "npm:^13.1.1"
"@polkadot/util-crypto": "npm:^13.1.1"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.7.0"
languageName: unknown
linkType: soft
"@polkadot/util-crypto@npm:13.0.2, @polkadot/util-crypto@npm:^13.0.2":
version: 13.0.2
resolution: "@polkadot/util-crypto@npm:13.0.2"
"@polkadot/util-crypto@npm:13.1.1, @polkadot/util-crypto@npm:^13.1.1":
version: 13.1.1
resolution: "@polkadot/util-crypto@npm:13.1.1"
dependencies:
"@noble/curves": "npm:^1.3.0"
"@noble/hashes": "npm:^1.3.3"
"@polkadot/networks": "npm:13.0.2"
"@polkadot/util": "npm:13.0.2"
"@polkadot/networks": "npm:13.1.1"
"@polkadot/util": "npm:13.1.1"
"@polkadot/wasm-crypto": "npm:^7.3.2"
"@polkadot/wasm-util": "npm:^7.3.2"
"@polkadot/x-bigint": "npm:13.0.2"
"@polkadot/x-randomvalues": "npm:13.0.2"
"@scure/base": "npm:^1.1.5"
tslib: "npm:^2.6.2"
"@polkadot/x-bigint": "npm:13.1.1"
"@polkadot/x-randomvalues": "npm:13.1.1"
"@scure/base": "npm:^1.1.7"
tslib: "npm:^2.7.0"
peerDependencies:
"@polkadot/util": 13.0.2
checksum: 10/333db21d1708158dc83905c32437ba201c97ba4274c2970f0bdfa9384f70f9bedbbe4e3032ce67d6f73bd0b755a4ab4d67b89f483b6bfc76305a67a867230915
"@polkadot/util": 13.1.1
checksum: 10/6f78ed75e4d2ab0dd0f5778640b6f6856702064ab2804c629ce97102389abc981d35cdec6ae63a814fa12b6d9deb5fe024f41bb54fe0e5cea3daa010455594ea
languageName: node
linkType: hard
"@polkadot/util@npm:13.0.2, @polkadot/util@npm:^13.0.2":
version: 13.0.2
resolution: "@polkadot/util@npm:13.0.2"
"@polkadot/util@npm:13.1.1, @polkadot/util@npm:^13.1.1":
version: 13.1.1
resolution: "@polkadot/util@npm:13.1.1"
dependencies:
"@polkadot/x-bigint": "npm:13.0.2"
"@polkadot/x-global": "npm:13.0.2"
"@polkadot/x-textdecoder": "npm:13.0.2"
"@polkadot/x-textencoder": "npm:13.0.2"
"@polkadot/x-bigint": "npm:13.1.1"
"@polkadot/x-global": "npm:13.1.1"
"@polkadot/x-textdecoder": "npm:13.1.1"
"@polkadot/x-textencoder": "npm:13.1.1"
"@types/bn.js": "npm:^5.1.5"
bn.js: "npm:^5.2.1"
tslib: "npm:^2.6.2"
checksum: 10/9e83f0843c3da9ffa7b6bc95a73e96ca4754d45cb9cc4418461e1ca38f00c54cb0e61873bb6f09f40c51e435025cfc282577b906a23b36eb6b0eb5af8668fad8
tslib: "npm:^2.7.0"
checksum: 10/ec1db22e6e33d2a5d4197290805e4f7300c3aa847e9607f667c0bb967ecc359751b216581930878e74d22329ede3b8170c724008e336a50ce4bc1183ce3f9e25
languageName: node
linkType: hard
@@ -925,77 +925,77 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/x-bigint@npm:13.0.2, @polkadot/x-bigint@npm:^13.0.2":
version: 13.0.2
resolution: "@polkadot/x-bigint@npm:13.0.2"
"@polkadot/x-bigint@npm:13.1.1, @polkadot/x-bigint@npm:^13.1.1":
version: 13.1.1
resolution: "@polkadot/x-bigint@npm:13.1.1"
dependencies:
"@polkadot/x-global": "npm:13.0.2"
tslib: "npm:^2.6.2"
checksum: 10/6c8d198f8982ae9de78a301e1beb0d38e627ba3c6aac149a385c5f753f39dc7201761bc02ce45881b50e7cf50a883edc8f179abc50532b2b094538c388bbc146
"@polkadot/x-global": "npm:13.1.1"
tslib: "npm:^2.7.0"
checksum: 10/2b4b75bea7b5babde955ec3b3a282cef88ca16ba3243d3415202a5d2c038543ba70ef74af7a7ad846df534466fb14408d2d6ff0313614a1578b6b9f71ac7224f
languageName: node
linkType: hard
"@polkadot/x-fetch@npm:^13.0.2":
version: 13.0.2
resolution: "@polkadot/x-fetch@npm:13.0.2"
"@polkadot/x-fetch@npm:^13.1.1":
version: 13.1.1
resolution: "@polkadot/x-fetch@npm:13.1.1"
dependencies:
"@polkadot/x-global": "npm:13.0.2"
"@polkadot/x-global": "npm:13.1.1"
node-fetch: "npm:^3.3.2"
tslib: "npm:^2.6.2"
checksum: 10/b4cf06f5219dab2b8b94af7913a3346fa46d1179b47c809f0cabecf07b068f9cd3e6f395c943c59b71341b92d61808df7bc05e23e4a30088349c77ed6b4ec11f
tslib: "npm:^2.7.0"
checksum: 10/11fedc3623e8126d3a2cab54c7e2d031e119f4d4bfba0f04a75e1f387ca1f56b096b7e028ecbee3edd0ea08ffd2d3614630624d5547302674fe0f62b675c1ca8
languageName: node
linkType: hard
"@polkadot/x-global@npm:13.0.2, @polkadot/x-global@npm:^13.0.2":
version: 13.0.2
resolution: "@polkadot/x-global@npm:13.0.2"
"@polkadot/x-global@npm:13.1.1, @polkadot/x-global@npm:^13.1.1":
version: 13.1.1
resolution: "@polkadot/x-global@npm:13.1.1"
dependencies:
tslib: "npm:^2.6.2"
checksum: 10/e21fa675a0f0e017bcd7e39638b1ddcaf7adc6a457ffcc431aef6c5bc2ae9ad721e97a97f6b1b4b5b4499297be0357887040540085765b31fb837fa91a71055b
tslib: "npm:^2.7.0"
checksum: 10/6dc239d357cb4037decd8b9a1b016a072145b969300d62dc5ee0186fc0f102eafd0b2b84be83092874de547d75f87e1f5c99399e0f6f1516d64ef49f387ad156
languageName: node
linkType: hard
"@polkadot/x-randomvalues@npm:13.0.2":
version: 13.0.2
resolution: "@polkadot/x-randomvalues@npm:13.0.2"
"@polkadot/x-randomvalues@npm:13.1.1":
version: 13.1.1
resolution: "@polkadot/x-randomvalues@npm:13.1.1"
dependencies:
"@polkadot/x-global": "npm:13.0.2"
tslib: "npm:^2.6.2"
"@polkadot/x-global": "npm:13.1.1"
tslib: "npm:^2.7.0"
peerDependencies:
"@polkadot/util": 13.0.2
"@polkadot/util": 13.1.1
"@polkadot/wasm-util": "*"
checksum: 10/bcfe394658d21f40b1169c063b9123b1d8044bc081785b7532c4851b9161b6192ca30edb502f3ead3d3bfffe7776b2cb091c15b6566c301516f355c70b69d211
checksum: 10/fe8bd72bced3fe31118e6f6ca2cce69ac2412068de7f8db8de83cc9bb736b77fa639f6aea4297bb9b63c91383fe72fa5904c0a8ab26b1fead8219534721d9658
languageName: node
linkType: hard
"@polkadot/x-textdecoder@npm:13.0.2":
version: 13.0.2
resolution: "@polkadot/x-textdecoder@npm:13.0.2"
"@polkadot/x-textdecoder@npm:13.1.1":
version: 13.1.1
resolution: "@polkadot/x-textdecoder@npm:13.1.1"
dependencies:
"@polkadot/x-global": "npm:13.0.2"
tslib: "npm:^2.6.2"
checksum: 10/31f378a8d9b3f3963b94fd87320100a754d1381eaf4687f58d28f9de0df24acc99d80ce707ff0d2d0b4ca3477d12ac8506f7cc502fde2b08fb30867f7a7553c1
"@polkadot/x-global": "npm:13.1.1"
tslib: "npm:^2.7.0"
checksum: 10/0ddddc3534587855b29fd2fc0137dc80d4d75d084965ce7494dfabc53ae78b59cfc6601c052a97e88c804357a94f8ba3a19bd7bac19ee557f353294f83d77d5b
languageName: node
linkType: hard
"@polkadot/x-textencoder@npm:13.0.2":
version: 13.0.2
resolution: "@polkadot/x-textencoder@npm:13.0.2"
"@polkadot/x-textencoder@npm:13.1.1":
version: 13.1.1
resolution: "@polkadot/x-textencoder@npm:13.1.1"
dependencies:
"@polkadot/x-global": "npm:13.0.2"
tslib: "npm:^2.6.2"
checksum: 10/f3e2379901b68176398efc5be1e8304ceda28b3f4bf6b0da0b837b13478257967108552eae3250a43d634253bdb46e907146244ff41908a5a39f99852fb5a252
"@polkadot/x-global": "npm:13.1.1"
tslib: "npm:^2.7.0"
checksum: 10/d298528f55425d55c59f2827d4aa9e16c1d3c5e085751f635631bf07c0c43882eeb75729776a99fc5ebdc2c2c76d97e7e8dbe762b49050549a4ddd0a312954d8
languageName: node
linkType: hard
"@polkadot/x-ws@npm:^13.0.2":
version: 13.0.2
resolution: "@polkadot/x-ws@npm:13.0.2"
"@polkadot/x-ws@npm:^13.1.1":
version: 13.1.1
resolution: "@polkadot/x-ws@npm:13.1.1"
dependencies:
"@polkadot/x-global": "npm:13.0.2"
tslib: "npm:^2.6.2"
"@polkadot/x-global": "npm:13.1.1"
tslib: "npm:^2.7.0"
ws: "npm:^8.16.0"
checksum: 10/627d7bb8fb115a66fafb11e8f96c2559f793ea936fd88be2aee3f304c5f08c6133073fd762a7a9ae793e2f83ad122c5dace1509831ee1e694b7bf67d5a56e89a
checksum: 10/cdcb4cd760358e19db3246c8fb7e990ae3c88c43fb8a57902dbfa3e48118c7f6ec23d6c87874e134575d121b45a4754196c2f98bac577d8464ec90ce8537b343
languageName: node
linkType: hard
@@ -1206,10 +1206,10 @@ __metadata:
languageName: node
linkType: hard
"@scure/base@npm:^1.1.1, @scure/base@npm:^1.1.5":
version: 1.1.5
resolution: "@scure/base@npm:1.1.5"
checksum: 10/543fa9991c6378b6a0d5ab7f1e27b30bb9c1e860d3ac81119b4213cfdf0ad7b61be004e06506e89de7ce0cec9391c17f5c082bb34c3b617a2ee6a04129f52481
"@scure/base@npm:^1.1.1, @scure/base@npm:^1.1.7":
version: 1.1.8
resolution: "@scure/base@npm:1.1.8"
checksum: 10/5b764c0e98610bc4993479965db718457d91b68d3c6f1339e3cc74e53fc6b0ae0428d1d64d29a0de0cee9d966034674d4464fdbd2d1dbef27013927b2fe05c45
languageName: node
linkType: hard
@@ -1263,10 +1263,10 @@ __metadata:
languageName: node
linkType: hard
"@substrate/ss58-registry@npm:^1.46.0":
version: 1.49.0
resolution: "@substrate/ss58-registry@npm:1.49.0"
checksum: 10/6214c8f8586aefbb67b70bd2f02a9d133cfb15f360d691f1164c192036b59d1e282495e884b7da80a32e54eed1bd2bcc421f571e548a29410a5a50be7b2daa10
"@substrate/ss58-registry@npm:^1.50.0":
version: 1.50.0
resolution: "@substrate/ss58-registry@npm:1.50.0"
checksum: 10/66c096c9027ea4dba748c551e410d21014828311454443f62b0d4d6bdd5f5881fef027c9ed1bf84dc706d33c04242e5ecc09276ae4a52a34f3d818db519b633b
languageName: node
linkType: hard