Compare commits

..
26 Commits
Author SHA1 Message Date
github-actions[bot] 2ef84c5dcd [CI Skip] release/stable 11.1.1
skip-checks: true
2024-05-21 18:41:45 +00:00
Tarik Gul 36c24826ec 11.1.1 (#5888) 2024-05-21 14:34:18 -04:00
github-actions[bot] 184f702efd [CI Skip] bump/beta 11.0.4-5-x
skip-checks: true
2024-05-20 16:38:58 +00:00
Tarik Gulandbee344 b392c19922 fix: CheckMetadataHash signedExtension support (#5882)
* CheckMetadataHash support

* lint

* updtated CheckGenesis

* linting

* added getters for metadataHash

* fixed metadataHash type

* fixed toHuman override

* updated SignerPayload

* updated mode to take AnyNumber

---------

Co-authored-by: bee344 <alberto.penayo@parity.io>
2024-05-20 13:31:23 -03:00
github-actions[bot] 38de00d8d8 [CI Skip] bump/beta 11.0.4-4-x
skip-checks: true
2024-05-17 20:29:41 +00:00
Tarik Gul f9c58203a0 Fix api.derive.accounts.{info && identity} (#5885)
* Fix api.derive.accounts.identity and all residual derives

* reorder types
2024-05-17 23:22:07 +03:00
github-actions[bot] baaa27ba9e [CI Skip] bump/beta 11.0.4-3-x
skip-checks: true
2024-05-15 01:53:00 +00:00
Alberto Nicolas Penayo 365fde895a fix: updated extrinsics' assetId toHuman (#5879) 2024-05-14 21:45:55 -04:00
github-actions[bot] b17a6d3920 [CI Skip] bump/beta 11.0.4-2-x
skip-checks: true
2024-05-14 01:05:48 +00:00
Tarik Gul 0d8df6380e Bump yarn to 4.2.2 (#5878) 2024-05-14 03:58:04 +03:00
github-actions[bot] 52cd797488 [CI Skip] bump/beta 11.0.4-1-x
skip-checks: true
2024-05-14 00:47:46 +00:00
Tarik Gul a71d401f1d Bump @polkadot/dev to 0.79.1 w/ topo sort (#5877) 2024-05-14 03:40:21 +03:00
github-actions[bot] 61b68393e7 [CI Skip] bump/beta 11.0.4-0-x
skip-checks: true
2024-05-10 18:53:21 +00:00
Tarik Gul 7d6933ed39 Dedupe nextElected accountIds (#5876)
* Dedupe nextElected accountIds

* remove consoles
2024-05-10 21:45:26 +03:00
github-actions[bot] 32a04fd24f [CI Skip] release/stable 11.0.3
skip-checks: true
2024-05-08 13:31:16 +00:00
Tarik Gul 009461f564 11.0.3 (#5873) 2024-05-08 16:23:44 +03:00
github-actions[bot] 00cb2ef875 [CI Skip] bump/beta 11.0.3-2-x
skip-checks: true
2024-05-08 12:49:12 +00:00
Tarik Gul fed0d5bf0d Update substrate to latest (#5872) 2024-05-08 15:41:42 +03:00
github-actions[bot] 53e9305f41 [CI Skip] bump/beta 11.0.3-1-x
skip-checks: true
2024-05-08 03:23:20 +00:00
Tarik Gul 2ca9da3304 Fix claimedRewards in staking.derives (#5870)
* Fix claimedRewards in staking.derives

* Cleanup

* few nits
2024-05-08 06:15:40 +03:00
github-actions[bot] 7a4d32710c [CI Skip] bump/beta 11.0.3-0-x
skip-checks: true
2024-05-06 16:26:34 +00:00
Tarik Gul 15c8859b06 ApiDerive.staking backwards compatibility. (#5868)
* Start of backwards compatibility for api.derive.staking

* Update nextElected to be compatible

* lint

* Comments

* remove clipped from query

* Ensure backwards compat for ownExposure

* Fix query
2024-05-06 19:18:58 +03:00
github-actions[bot] e0e9829417 [CI Skip] release/stable 11.0.2
skip-checks: true
2024-04-24 17:12:04 +00:00
Tarik Gul 00bc5c818b 11.0.2 (#5866) 2024-04-24 13:04:17 -04:00
github-actions[bot] f43600d773 [CI Skip] bump/beta 11.0.2-0-x
skip-checks: true
2024-04-24 16:38:09 +00:00
Tarik Gul fc112988f0 Fix type for TAssetConversion in Polkadot Asset hub (#5865) 2024-04-24 12:30:42 -04:00
64 changed files with 3922 additions and 3136 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.1.1.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
+28
View File
@@ -1,5 +1,33 @@
# CHANGELOG
## 11.1.1 May 21, 2024
Changes
- Dedupe nextElected accountIds in `api.derive.staking.nextElected`
- Bump @polkadot/dev to 0.79.1 w/ topo sort
- Bump yarn to 4.2.2
- fix: updated extrinsics' assetId `toHuman` (Thanks to https://github.com/bee344)
- fix `api.derive.accounts.{info && identity}`
- feat: Add support for `CheckMetadataHash` signedExtension (Thanks to https://github.com/bee344)
## 11.0.3 May 8, 2024
Changes
- Make `api.derive.staking.*` backwards compatible
- Fix `claimedRewards` regression in `api.derive.staking.queryMulti`
- Update Substrate to latest
## 11.0.2 Apr 24, 2024
Changes
- Fix type for TAssetConversion in Polkadot Asset hub
## 11.0.1 Apr 23, 2024
Breaking Changes:
+2 -2
View File
@@ -1,7 +1,7 @@
3512 Jaco Bump deps (#5785)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
49 Tarik Gul 11.1.1 (#5888)
37 Keith Ingram Update contract types and rpc (#4541)
37 Tarik Gul 11.0.1 (#5864)
35 Stefanie Doll Updated child storage parameters (#1709)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
19 Xiliang Chen no warm for unknown signed extensions (#5601)
@@ -21,6 +21,7 @@
4 Nantian fix bigint type (#3869)
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
4 Thibaut Sardan no subscription for http (#3127)
3 Alberto Nicolas Penayo fix: updated extrinsics' assetId toHuman (#5879)
3 André Silva add support for ValidationCodeHash (#3640)
3 Antoine Estienne Adapted to display moonbeam author (#3108)
3 Arjan Zijderveld Added `Emergency` to `ElectionPhase` (#3707)
@@ -33,7 +34,6 @@
3 Miguel Hervas Adding RT4 Types (#3007)
3 Shawn Tabrizi Add `isReadyOrError` when connecting to API (#2577)
3 YJ feat: Vote interface as U8a (#1061)
2 Alberto Nicolas Penayo updated remaining assetId for ChargeAssetTxPayment (#5763)
2 Alexander Krupenkin Add [u8; 33] type width for U8aFixed type (#2391)
2 Branan Riley Add proxy type for Centrifuge (#3940)
2 Caio Add `Range` and `RangeInclusive` types (#3791)
+5 -5
View File
@@ -6,7 +6,7 @@
},
"homepage": "https://github.com/polkadot-js/api#readme",
"license": "Apache-2.0",
"packageManager": "yarn@4.1.1",
"packageManager": "yarn@4.2.2",
"private": true,
"repository": {
"type": "git",
@@ -14,10 +14,10 @@
},
"sideEffects": false,
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"versions": {
"git": "11.0.1",
"npm": "11.0.1"
"git": "11.1.1",
"npm": "11.1.1"
},
"workspaces": [
"packages/*"
@@ -40,7 +40,7 @@
"test:one": "polkadot-dev-run-test --env node"
},
"devDependencies": {
"@polkadot/dev": "^0.78.9",
"@polkadot/dev": "^0.79.1",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/node": "^20.11.6"
},
+6 -6
View File
@@ -18,14 +18,14 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/api-base": "11.0.1",
"@polkadot/rpc-augment": "11.0.1",
"@polkadot/types": "11.0.1",
"@polkadot/types-augment": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/api-base": "11.1.1",
"@polkadot/rpc-augment": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-augment": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
}
+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: '11.0.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '11.1.1' };
@@ -265,6 +265,28 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
assetConversionMigration: {
/**
* Provided asset pair is not supported for pool.
**/
InvalidAssetPair: AugmentedError<ApiType>;
/**
* Indicates a partial transfer of balance to the new account during a migration.
**/
PartialTransfer: AugmentedError<ApiType>;
/**
* The pool doesn't exist.
**/
PoolNotFound: AugmentedError<ApiType>;
/**
* Pool's balance cannot be zero.
**/
ZeroBalance: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
assetRate: {
/**
* The given asset ID already has an assigned conversion rate and cannot be re-created.
@@ -547,6 +569,10 @@ declare module '@polkadot/api-base/types/errors' {
* The configuration could not be applied because it is invalid.
**/
InvalidConfig: AugmentedError<ApiType>;
/**
* The revenue must be claimed for 1 or more timeslices.
**/
NoClaimTimeslices: AugmentedError<ApiType>;
/**
* The history item does not exist.
**/
@@ -2813,6 +2839,10 @@ declare module '@polkadot/api-base/types/errors' {
* Not a controller account.
**/
NotController: AugmentedError<ApiType>;
/**
* Not enough funds available to withdraw.
**/
NotEnoughFunds: AugmentedError<ApiType>;
/**
* Items are not sorted and unique.
**/
@@ -2825,6 +2855,10 @@ declare module '@polkadot/api-base/types/errors' {
* Can not rebond without unlocking chunks.
**/
NoUnlockChunk: AugmentedError<ApiType>;
/**
* Provided reward destination is not allowed.
**/
RewardDestinationRestricted: AugmentedError<ApiType>;
/**
* There are too many nominators in the system. Governance needs to adjust the staking
* settings to keep things safe for the runtime.
+15 -1
View File
@@ -131,6 +131,20 @@ declare module '@polkadot/api-base/types/events' {
* and `SwapTokenForExactToken` will generate this event.
**/
SwapExecuted: AugmentedEvent<ApiType, [who: AccountId32, sendTo: AccountId32, amountIn: u128, amountOut: u128, path: Vec<ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, u128]>>], { who: AccountId32, sendTo: AccountId32, amountIn: u128, amountOut: u128, path: Vec<ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, u128]>> }>;
/**
* Pool has been touched in order to fulfill operational requirements.
**/
Touched: AugmentedEvent<ApiType, [poolId: ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>, who: AccountId32], { poolId: ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>, who: AccountId32 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
assetConversionMigration: {
/**
* Indicates that a pool has been migrated to the new account ID.
**/
MigratedToNewAccount: AugmentedEvent<ApiType, [poolId: ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>, priorAccount: AccountId32, newAccount: AccountId32], { poolId: ITuple<[FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>, priorAccount: AccountId32, newAccount: AccountId32 }>;
/**
* Generic event
**/
@@ -533,7 +547,7 @@ declare module '@polkadot/api-base/types/events' {
/**
* Ownership of a Region has been transferred.
**/
Transferred: AugmentedEvent<ApiType, [regionId: PalletBrokerRegionId, duration: u32, oldOwner: AccountId32, owner: AccountId32], { regionId: PalletBrokerRegionId, duration: u32, oldOwner: AccountId32, owner: AccountId32 }>;
Transferred: AugmentedEvent<ApiType, [regionId: PalletBrokerRegionId, duration: u32, oldOwner: Option<AccountId32>, owner: Option<AccountId32>], { regionId: PalletBrokerRegionId, duration: u32, oldOwner: Option<AccountId32>, owner: Option<AccountId32> }>;
/**
* Generic event
**/
+25 -2
View File
@@ -425,7 +425,7 @@ declare module '@polkadot/api-base/types/storage' {
**/
leases: AugmentedQuery<ApiType, () => Observable<Vec<PalletBrokerLeaseRecordItem>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current (unassigned) Regions.
* The current (unassigned or provisionally assigend) Regions.
**/
regions: AugmentedQuery<ApiType, (arg: PalletBrokerRegionId | { begin?: any; core?: any; mask?: any } | string | Uint8Array) => Observable<Option<PalletBrokerRegionRecord>>, [PalletBrokerRegionId]> & QueryableStorageEntry<ApiType, [PalletBrokerRegionId]>;
/**
@@ -1399,11 +1399,21 @@ declare module '@polkadot/api-base/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
palletExampleMbms: {
/**
* Define a storage item to illustrate multi-block migrations.
**/
myMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u64>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
parameters: {
/**
* Stored parameters.
**/
parameters: AugmentedQuery<ApiType, (arg: KitchensinkRuntimeRuntimeParametersKey | { Storage: any } | { Contract: any } | string | Uint8Array) => Observable<Option<KitchensinkRuntimeRuntimeParametersValue>>, [KitchensinkRuntimeRuntimeParametersKey]> & QueryableStorageEntry<ApiType, [KitchensinkRuntimeRuntimeParametersKey]>;
parameters: AugmentedQuery<ApiType, (arg: KitchensinkRuntimeRuntimeParametersKey | { Storage: any } | { Contracts: any } | string | Uint8Array) => Observable<Option<KitchensinkRuntimeRuntimeParametersValue>>, [KitchensinkRuntimeRuntimeParametersKey]> & QueryableStorageEntry<ApiType, [KitchensinkRuntimeRuntimeParametersKey]>;
/**
* Generic query
**/
@@ -1861,6 +1871,10 @@ declare module '@polkadot/api-base/types/storage' {
* Counter for the related counted storage map
**/
counterForValidators: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Counter for the related counted storage map
**/
counterForVirtualStakers: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current era index.
*
@@ -2094,6 +2108,15 @@ declare module '@polkadot/api-base/types/storage' {
* and slash value of the era.
**/
validatorSlashInEra: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<ITuple<[Perbill, u128]>>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
/**
* Stakers whose funds are managed by other pallets.
*
* This pallet does not apply any locks on them, therefore they are only virtually bonded. They
* are expected to be keyless accounts and hence should not be allowed to mutate their ledger
* directly via this pallet. Instead, these accounts are managed by other pallets and accessed
* via low level apis. We keep track of them to do minimal integrity checks.
**/
virtualStakers: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<Null>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Generic query
**/
+40 -10
View File
@@ -274,6 +274,33 @@ declare module '@polkadot/api-base/types/submittable' {
* for a quote.
**/
swapTokensForExactTokens: AugmentedSubmittable<(path: Vec<FrameSupportTokensFungibleUnionOfNativeOrWithId> | (FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array)[], amountOut: u128 | AnyNumber | Uint8Array, amountInMax: u128 | AnyNumber | Uint8Array, sendTo: AccountId32 | string | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Vec<FrameSupportTokensFungibleUnionOfNativeOrWithId>, u128, u128, AccountId32, bool]>;
/**
* Touch an existing pool to fulfill prerequisites before providing liquidity, such as
* ensuring that the pool's accounts are in place. It is typically useful when a pool
* creator removes the pool's accounts and does not provide a liquidity. This action may
* involve holding assets from the caller as a deposit for creating the pool's accounts.
*
* The origin must be Signed.
*
* - `asset1`: The asset ID of an existing pool with a pair (asset1, asset2).
* - `asset2`: The asset ID of an existing pool with a pair (asset1, asset2).
*
* Emits `Touched` event when successful.
**/
touch: AugmentedSubmittable<(asset1: FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array, asset2: FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
assetConversionMigration: {
/**
* Migrates an existing pool to a new account ID derivation method for a given asset pair.
* If the migration is successful, transaction fees are refunded to the caller.
*
* Must be signed.
**/
migrateToNewAccount: AugmentedSubmittable<(asset1: FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array, asset2: FrameSupportTokensFungibleUnionOfNativeOrWithId | { Native: any } | { WithId: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [FrameSupportTokensFungibleUnionOfNativeOrWithId, FrameSupportTokensFungibleUnionOfNativeOrWithId]>;
/**
* Generic tx
**/
@@ -1109,13 +1136,12 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* Claim the revenue owed from inclusion in the Instantaneous Coretime Pool.
*
* - `origin`: Must be a Signed origin of the account which owns the Region `region_id`.
* - `origin`: Must be a Signed origin.
* - `region_id`: The Region which was assigned to the Pool.
* - `max_timeslices`: The maximum number of timeslices which should be processed. This may
* effect the weight of the call but should be ideally made equivalent to the length of
* the Region `region_id`. If it is less than this, then further dispatches will be
* required with the `region_id` which makes up any remainders of the region to be
* collected.
* - `max_timeslices`: The maximum number of timeslices which should be processed. This
* must be greater than 0. This may affect the weight of the call but should be ideally
* made equivalent to the length of the Region `region_id`. If less, further dispatches
* will be required with the same `region_id` to claim revenue for the remainder.
**/
claimRevenue: AugmentedSubmittable<(regionId: PalletBrokerRegionId | { begin?: any; core?: any; mask?: any } | string | Uint8Array, maxTimeslices: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletBrokerRegionId, u32]>;
/**
@@ -1240,9 +1266,13 @@ declare module '@polkadot/api-base/types/submittable' {
*
* - `origin`: Must be Root or pass `AdminOrigin`.
* - `initial_price`: The price of Bulk Coretime in the first sale.
* - `core_count`: The number of cores which can be allocated.
* - `extra_cores`: Number of extra cores that should be requested on top of the cores
* required for `Reservations` and `Leases`.
*
* This will call [`Self::request_core_count`] internally to set the correct core count on
* the relay chain.
**/
startSales: AugmentedSubmittable<(initialPrice: u128 | AnyNumber | Uint8Array, coreCount: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u16]>;
startSales: AugmentedSubmittable<(initialPrice: u128 | AnyNumber | Uint8Array, extraCores: u16 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u16]>;
swapLeases: AugmentedSubmittable<(id: u32 | AnyNumber | Uint8Array, other: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
/**
* Transfer a Bulk Coretime Region to a new owner.
@@ -3965,7 +3995,7 @@ declare module '@polkadot/api-base/types/submittable' {
setCommissionMax: AugmentedSubmittable<(poolId: u32 | AnyNumber | Uint8Array, maxCommission: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Perbill]>;
/**
* Update configurations for the nomination pools. The origin for this call must be
* Root.
* [`Config::AdminOrigin`].
*
* # Arguments
*
@@ -4075,7 +4105,7 @@ declare module '@polkadot/api-base/types/submittable' {
* The dispatch origin of this call must be `AdminOrigin` for the given `key`. Values be
* deleted by setting them to `None`.
**/
setParameter: AugmentedSubmittable<(keyValue: KitchensinkRuntimeRuntimeParameters | { Storage: any } | { Contract: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [KitchensinkRuntimeRuntimeParameters]>;
setParameter: AugmentedSubmittable<(keyValue: KitchensinkRuntimeRuntimeParameters | { Storage: any } | { Contracts: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [KitchensinkRuntimeRuntimeParameters]>;
/**
* Generic tx
**/
+3 -3
View File
@@ -18,11 +18,11 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "11.0.1",
"@polkadot/types": "11.0.1",
"@polkadot/rpc-core": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/util": "^12.6.2",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
+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: '11.0.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '11.1.1' };
+3 -1
View File
@@ -3,7 +3,7 @@
import type { Observable } from 'rxjs';
import type { AccountId, Address, ApplyExtrinsicResult, BlockNumber, Call, DispatchError, DispatchInfo, EventRecord, Extrinsic, ExtrinsicStatus, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces';
import type { AnyFunction, AnyNumber, AnyTuple, Callback, CallBase, Codec, IExtrinsicEra, IKeyringPair, ISubmittableResult, Signer } from '@polkadot/types/types';
import type { AnyFunction, AnyNumber, AnyTuple, AnyU8a, Callback, CallBase, Codec, IExtrinsicEra, IKeyringPair, ISubmittableResult, Signer } from '@polkadot/types/types';
import type { ApiTypes, EmptyBase, PromiseOrObs } from './base.js';
export type AugmentedSubmittable<T extends AnyFunction, A extends AnyTuple = AnyTuple> = T & CallBase<A>;
@@ -17,6 +17,8 @@ export interface SignerOptions {
signer?: Signer;
tip?: AnyNumber;
assetId?: AnyNumber | object;
mode?: AnyNumber;
metadataHash?: AnyU8a;
}
export type SubmittableDryRunResult<ApiType extends ApiTypes> =
+8 -8
View File
@@ -18,22 +18,22 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/api": "11.0.1",
"@polkadot/api-augment": "11.0.1",
"@polkadot/types": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/types-create": "11.0.1",
"@polkadot/api": "11.1.1",
"@polkadot/api-augment": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/types-create": "11.1.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/api-augment": "11.0.1",
"@polkadot/api-augment": "11.1.1",
"@polkadot/keyring": "^12.6.2",
"@polkadot/types-support": "11.0.1"
"@polkadot/types-support": "11.1.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: '11.0.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '11.1.1' };
+12 -12
View File
@@ -18,25 +18,25 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/api": "11.0.1",
"@polkadot/api-augment": "11.0.1",
"@polkadot/api-base": "11.0.1",
"@polkadot/rpc-core": "11.0.1",
"@polkadot/types": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/api": "11.1.1",
"@polkadot/api-augment": "11.1.1",
"@polkadot/api-base": "11.1.1",
"@polkadot/rpc-core": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/api": "11.0.1",
"@polkadot/api-augment": "11.0.1",
"@polkadot/rpc-augment": "11.0.1",
"@polkadot/rpc-provider": "11.0.1",
"@polkadot/types-support": "11.0.1"
"@polkadot/api": "11.1.1",
"@polkadot/api-augment": "11.1.1",
"@polkadot/rpc-augment": "11.1.1",
"@polkadot/rpc-provider": "11.1.1",
"@polkadot/types-support": "11.1.1"
}
}
+23 -3
View File
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Bytes, Data } from '@polkadot/types';
import type { AccountId } from '@polkadot/types/interfaces';
import type { Bytes, Data, Struct } from '@polkadot/types';
import type { AccountId, H160 } from '@polkadot/types/interfaces';
import type { PalletIdentityLegacyIdentityInfo, PalletIdentityRegistration } from '@polkadot/types/lookup';
import type { Option } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
@@ -17,9 +17,26 @@ import { firstMemo, memo } from '../util/index.js';
type IdentityInfoAdditional = PalletIdentityLegacyIdentityInfo['additional'][0];
interface PeopleIdentityInfo extends Struct {
display: Data;
legal: Data;
web: Data;
matrix: Data;
email: Data;
pgpFingerprint: Option<H160>;
image: Data;
twitter: Data;
github: Data;
discord: Data;
}
const UNDEF_HEX = { toHex: () => undefined };
function dataAsString (data: Data): string | undefined {
if (!data) {
return data;
}
return data.isRaw
? u8aToString(data.asRaw.toU8a(true))
: data.isNone
@@ -58,13 +75,16 @@ function extractIdentity (identityOfOpt?: Option<ITuple<[PalletIdentityRegistrat
const topDisplay = dataAsString(info.display);
return {
discord: dataAsString((info as unknown as PeopleIdentityInfo).discord),
display: (superOf && dataAsString(superOf[1])) || topDisplay,
displayParent: superOf && topDisplay,
email: dataAsString(info.email),
github: dataAsString((info as unknown as PeopleIdentityInfo).github),
image: dataAsString(info.image),
judgements,
legal: dataAsString(info.legal),
other: extractOther(info.additional),
matrix: dataAsString((info as unknown as PeopleIdentityInfo).matrix),
other: info.additional ? extractOther(info.additional) : {},
parent: superOf?.[0],
pgp: info.pgpFingerprint.unwrapOr(UNDEF_HEX).toHex(),
riot: dataAsString(info.riot),
@@ -8,11 +8,14 @@ export type AccountIdAndIndex = [AccountId | undefined, AccountIndex | undefined
export type AccountIndexes = Record<string, AccountIndex>;
export interface DeriveAccountRegistration {
discord?: string | undefined;
display?: string | undefined;
displayParent?: string | undefined;
email?: string | undefined;
github?: string | undefined;
image?: string | undefined;
legal?: string | undefined;
matrix?: string | undefined;
other?: Record<string, string> | undefined;
parent?: AccountId | undefined;
pgp?: string | undefined;
+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: '11.0.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '11.1.1' };
+19 -5
View File
@@ -4,7 +4,7 @@
import type { Observable } from 'rxjs';
import type { Option, u32 } from '@polkadot/types';
import type { EraIndex } from '@polkadot/types/interfaces';
import type { SpStakingExposurePage } from '@polkadot/types/lookup';
import type { SpStakingExposure, SpStakingExposurePage, SpStakingPagedExposureMetadata } from '@polkadot/types/lookup';
import type { AnyNumber } from '@polkadot/types-codec/types';
import type { DeriveApi, DeriveOwnExposure } from '../types.js';
@@ -15,13 +15,27 @@ import { erasHistoricApplyAccount } from './util.js';
export function _ownExposures (instanceId: string, api: DeriveApi): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean, page: u32 | AnyNumber) => Observable<DeriveOwnExposure[]> {
return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean, page: u32 | AnyNumber): Observable<DeriveOwnExposure[]> => {
const emptyStakingExposure = api.registry.createType<SpStakingExposure>('Exposure');
// The reason we don't explicitly make the actual types is for compatibility. If the chain doesn't have the noted type it will fail
// on construction. Therefore we just make an empty option.
const emptyOptionPage = api.registry.createType<Option<SpStakingExposurePage>>('Option<Null>');
const emptyOptionMeta = api.registry.createType<Option<SpStakingPagedExposureMetadata>>('Option<Null>');
return eras.length
? combineLatest([
// Backwards and forward compat for historical integrity when using `erasHistoricApplyAccount`
combineLatest(eras.map((e) => api.query.staking.erasStakersClipped(e, accountId))),
combineLatest(eras.map((e) => api.query.staking.erasStakers(e, accountId))),
combineLatest(eras.map((e) => api.query.staking.erasStakersPaged<Option<SpStakingExposurePage>>(e, accountId, page))),
combineLatest(eras.map((e) => api.query.staking.erasStakersOverview(e, accountId)))
api.query.staking.erasStakersClipped
? combineLatest(eras.map((e) => api.query.staking.erasStakersClipped(e, accountId)))
: of(eras.map((_) => emptyStakingExposure)),
api.query.staking.erasStakers
? combineLatest(eras.map((e) => api.query.staking.erasStakers(e, accountId)))
: of(eras.map((_) => emptyStakingExposure)),
api.query.staking.erasStakersPaged
? combineLatest(eras.map((e) => api.query.staking.erasStakersPaged<Option<SpStakingExposurePage>>(e, accountId, page)))
: of(eras.map((_) => emptyOptionPage)),
api.query.staking.erasStakersOverview
? combineLatest(eras.map((e) => api.query.staking.erasStakersOverview(e, accountId)))
: of(eras.map((_) => emptyOptionMeta))
]).pipe(
map(([clp, exp, paged, expMeta]): DeriveOwnExposure[] =>
eras.map((era, index) => ({ clipped: clp[index], era, exposure: exp[index], exposureMeta: expMeta[index], exposurePaged: paged[index] }))
+76 -32
View File
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { Option, u32, Vec } from '@polkadot/types';
import type { Option, StorageKey, u32, Vec } from '@polkadot/types';
import type { AccountId, EraIndex } from '@polkadot/types/interfaces';
import type { PalletStakingNominations, PalletStakingRewardDestination, PalletStakingStakingLedger, PalletStakingValidatorPrefs, SpStakingExposurePage, SpStakingPagedExposureMetadata } from '@polkadot/types/lookup';
import type { PalletStakingNominations, PalletStakingRewardDestination, PalletStakingStakingLedger, PalletStakingValidatorPrefs, SpStakingExposure, SpStakingExposurePage, SpStakingPagedExposureMetadata } from '@polkadot/types/lookup';
import type { AnyNumber } from '@polkadot/types-codec/types';
import type { DeriveApi, DeriveStakingQuery, StakingQueryFlags } from '../types.js';
@@ -24,11 +24,64 @@ function filterClaimedRewards (api: DeriveApi, cl: number[]): Vec<u32> {
return api.registry.createType('Vec<u32>', cl.filter((c) => c !== -1));
}
function parseDetails (api: DeriveApi, stashId: AccountId, controllerIdOpt: Option<AccountId> | null, nominatorsOpt: Option<PalletStakingNominations>, rewardDestinationOpts: Option<PalletStakingRewardDestination> | PalletStakingRewardDestination, validatorPrefs: PalletStakingValidatorPrefs, exposure: Option<SpStakingExposurePage>, stakingLedgerOpt: Option<PalletStakingStakingLedger>, exposureMeta: Option<SpStakingPagedExposureMetadata>, claimedRewards: number[]): DeriveStakingQuery {
function filterRewards (stashIds: AccountId[], eras: number[], claimedRewards: [StorageKey<[u32, AccountId]>, Vec<u32>][], stakersOverview: [StorageKey<[u32, AccountId]>, Option<SpStakingPagedExposureMetadata>][]): number[][] {
const claimedData: Record<string, Map<number, u32[]>> = {};
const overviewData: Record<string, Map<number, u32>> = {};
const ids = stashIds.map((i) => i.toString());
claimedRewards.forEach(([keys, rewards]) => {
const id = keys.args[1].toString();
const era = keys.args[0].toNumber();
if (ids.includes(id)) {
if (claimedData[id]) {
claimedData[id].set(era, rewards.toArray());
} else {
claimedData[id] = new Map();
claimedData[id].set(era, rewards.toArray());
}
}
});
stakersOverview.forEach(([keys, overview]) => {
const id = keys.args[1].toString();
const era = keys.args[0].toNumber();
if (ids.includes(id) && overview.isSome) {
if (overviewData[id]) {
overviewData[id].set(era, overview.unwrap().pageCount);
} else {
overviewData[id] = new Map();
overviewData[id].set(era, overview.unwrap().pageCount);
}
}
});
return stashIds.map((id) => {
const rewardsPerEra = claimedData[id.toString()];
const overviewPerEra = overviewData[id.toString()];
return eras.map((era) => {
if (rewardsPerEra && rewardsPerEra.has(era) && overviewPerEra && overviewPerEra.has(era)) {
const rewards = rewardsPerEra.get(era) as unknown as u32[];
const pageCount = overviewPerEra.get(era) as unknown as u32;
return rewards.length === pageCount.toNumber()
? era
: -1;
}
return -1;
});
});
}
function parseDetails (api: DeriveApi, stashId: AccountId, controllerIdOpt: Option<AccountId> | null, nominatorsOpt: Option<PalletStakingNominations>, rewardDestinationOpts: Option<PalletStakingRewardDestination> | PalletStakingRewardDestination, validatorPrefs: PalletStakingValidatorPrefs, exposure: Option<SpStakingExposurePage>, stakingLedgerOpt: Option<PalletStakingStakingLedger>, exposureMeta: Option<SpStakingPagedExposureMetadata>, claimedRewards: number[], exposureEraStakers: SpStakingExposure): DeriveStakingQuery {
return {
accountId: stashId,
claimedRewardsEras: filterClaimedRewards(api, claimedRewards),
controllerId: controllerIdOpt?.unwrapOr(null) || null,
exposureEraStakers,
exposureMeta,
exposurePaged: exposure,
nominators: nominatorsOpt.isSome
@@ -64,12 +117,15 @@ function getLedgers (api: DeriveApi, optIds: (Option<AccountId> | null)[], { wit
);
}
function getStashInfo (api: DeriveApi, stashIds: AccountId[], activeEra: EraIndex, { withClaimedRewardsEras, withController, withDestination, withExposure, withExposureMeta, withLedger, withNominations, withPrefs }: StakingQueryFlags, page: u32 | AnyNumber): Observable<[(Option<AccountId> | null)[], Option<PalletStakingNominations>[], Option<PalletStakingRewardDestination>[], PalletStakingValidatorPrefs[], Option<SpStakingExposurePage>[], Option<SpStakingPagedExposureMetadata>[], number[][]]> {
function getStashInfo (api: DeriveApi, stashIds: AccountId[], activeEra: EraIndex, { withClaimedRewardsEras, withController, withDestination, withExposure, withExposureErasStakersLegacy, withExposureMeta, withLedger, withNominations, withPrefs }: StakingQueryFlags, page: u32 | AnyNumber): Observable<[(Option<AccountId> | null)[], Option<PalletStakingNominations>[], Option<PalletStakingRewardDestination>[], PalletStakingValidatorPrefs[], Option<SpStakingExposurePage>[], Option<SpStakingPagedExposureMetadata>[], number[][], SpStakingExposure[]]> {
const emptyNoms = api.registry.createType<Option<PalletStakingNominations>>('Option<Nominations>');
const emptyRewa = api.registry.createType<Option<PalletStakingRewardDestination>>('RewardDestination');
const emptyExpo = api.registry.createType<Option<SpStakingExposurePage>>('Option<SpStakingExposurePage>');
const emptyExpoEraStakers = api.registry.createType<SpStakingExposure>('Exposure');
const emptyPrefs = api.registry.createType<PalletStakingValidatorPrefs>('ValidatorPrefs');
const emptyExpoMeta = api.registry.createType<Option<SpStakingPagedExposureMetadata>>('Option<SpStakingPagedExposureMetadata>');
// The reason we don't explicitly make the actual types is for compatibility. If the chain doesn't have the noted type it will fail
// on construction. Therefore we just make an empty option.
const emptyExpo = api.registry.createType<Option<SpStakingExposurePage>>('Option<Null>');
const emptyExpoMeta = api.registry.createType<Option<SpStakingPagedExposureMetadata>>('Option<Null>');
const emptyClaimedRewards = [-1];
const depth = Number(api.consts.staking.historyDepth.toNumber());
@@ -94,45 +150,33 @@ function getStashInfo (api: DeriveApi, stashIds: AccountId[], activeEra: EraInde
withPrefs
? combineLatest(stashIds.map((s) => api.query.staking.validators(s)))
: of(stashIds.map(() => emptyPrefs)),
withExposure
withExposure && api.query.staking.erasStakersPaged
? combineLatest(stashIds.map((s) => api.query.staking.erasStakersPaged<Option<SpStakingExposurePage>>(activeEra, s, page)))
: of(stashIds.map(() => emptyExpo)),
withExposureMeta
withExposureMeta && api.query.staking.erasStakersOverview
? combineLatest(stashIds.map((s) => api.query.staking.erasStakersOverview(activeEra, s)))
: of(stashIds.map(() => emptyExpoMeta)),
withClaimedRewardsEras
? combineLatest(stashIds.map((s) =>
combineLatest([
combineLatest(eras.map((e) => api.query.staking.claimedRewards(e, s))),
combineLatest(eras.map((e) => api.query.staking.erasStakersOverview(e, s)))
]))
).pipe(
map((r) => {
return r.map(([stashClaimedEras, overview]) => {
// stashClaimedEras length will match the length of eras
return stashClaimedEras.map((claimedReward, idx) => {
const o = overview[idx].isSome && overview[idx].unwrap();
if (claimedReward.length === (o && o.pageCount.toNumber())) {
return eras[idx];
}
return -1;
});
});
})
withClaimedRewardsEras && api.query.staking.claimedRewards
? combineLatest([
api.query.staking.claimedRewards.entries<Vec<u32>>(),
api.query.staking.erasStakersOverview.entries<Option<SpStakingPagedExposureMetadata>>()
]).pipe(
map(([rewardsStorageVec, overviewStorageVec]) => filterRewards(stashIds, eras, rewardsStorageVec, overviewStorageVec))
)
: of(stashIds.map(() => emptyClaimedRewards))
: of(stashIds.map(() => emptyClaimedRewards)),
withExposureErasStakersLegacy && api.query.staking.erasStakers
? combineLatest(stashIds.map((s) => api.query.staking.erasStakers(activeEra, s)))
: of(stashIds.map(() => emptyExpoEraStakers))
]);
}
function getBatch (api: DeriveApi, activeEra: EraIndex, stashIds: AccountId[], flags: StakingQueryFlags, page: u32 | AnyNumber): Observable<DeriveStakingQuery[]> {
return getStashInfo(api, stashIds, activeEra, flags, page).pipe(
switchMap(([controllerIdOpt, nominatorsOpt, rewardDestination, validatorPrefs, exposure, exposureMeta, claimedRewardsEras]): Observable<DeriveStakingQuery[]> =>
switchMap(([controllerIdOpt, nominatorsOpt, rewardDestination, validatorPrefs, exposure, exposureMeta, claimedRewardsEras, exposureEraStakers]): Observable<DeriveStakingQuery[]> =>
getLedgers(api, controllerIdOpt, flags).pipe(
map((stakingLedgerOpts) =>
stashIds.map((stashId, index) =>
parseDetails(api, stashId, controllerIdOpt[index], nominatorsOpt[index], rewardDestination[index], validatorPrefs[index], exposure[index], stakingLedgerOpts[index], exposureMeta[index], claimedRewardsEras[index])
parseDetails(api, stashId, controllerIdOpt[index], nominatorsOpt[index], rewardDestination[index], validatorPrefs[index], exposure[index], stakingLedgerOpts[index], exposureMeta[index], claimedRewardsEras[index], exposureEraStakers[index])
)
)
)
@@ -170,7 +170,7 @@ export function _stakerRewardsEras (instanceId: string, api: DeriveApi): (eras:
export function _stakerRewards (instanceId: string, api: DeriveApi): (accountIds: (Uint8Array | string)[], eras: EraIndex[], withActive?: boolean) => Observable<DeriveStakerReward[][]> {
return memo(instanceId, (accountIds: (Uint8Array | string)[], eras: EraIndex[], withActive = false): Observable<DeriveStakerReward[][]> =>
combineLatest([
api.derive.staking.queryMulti(accountIds, { withLedger: true }),
api.derive.staking.queryMulti(accountIds, { withClaimedRewardsEras: true, withLedger: true }),
api.derive.staking._stakerExposures(accountIds, eras, withActive),
api.derive.staking._stakerRewardsEras(eras, withActive)
]).pipe(
+3
View File
@@ -118,6 +118,8 @@ export interface DeriveStakingValidators {
export interface DeriveStakingStash {
controllerId: AccountId | null;
// Legacy Support for erasStakers
exposureEraStakers: SpStakingExposure;
exposurePaged: Option<SpStakingExposurePage>;
exposureMeta: Option<SpStakingPagedExposureMetadata>;
nominators: AccountId[];
@@ -162,6 +164,7 @@ export interface StakingQueryFlags {
withController?: boolean;
withDestination?: boolean;
withExposure?: boolean;
withExposureErasStakersLegacy?: boolean,
withLedger?: boolean;
withNominations?: boolean;
withPrefs?: boolean;
+12 -2
View File
@@ -11,14 +11,24 @@ import { memo } from '../util/index.js';
export function nextElected (instanceId: string, api: DeriveApi): () => Observable<AccountId[]> {
return memo(instanceId, (): Observable<AccountId[]> =>
// Compatibility for future generation changes in staking.
api.query.staking.erasStakersPaged
? api.derive.session.indexes().pipe(
// only populate for next era in the last session, so track both here - entries are not
// subscriptions, so we need a trigger - currentIndex acts as that trigger to refresh
switchMap(({ currentEra }) => api.query.staking.erasStakersPaged.keys(currentEra)),
map((keys) => keys.map(({ args: [, accountId] }) => accountId))
// Dedupe any duplicates
map((keys) => [...new Set(keys.map(({ args: [, accountId] }) => accountId.toString()))].map((a) => api.registry.createType('AccountId', a)))
)
: api.query.staking['currentElected']<AccountId[]>()
: api.query.staking.erasStakers
? api.derive.session.indexes().pipe(
// only populate for next era in the last session, so track both here - entries are not
// subscriptions, so we need a trigger - currentIndex acts as that trigger to refresh
switchMap(({ currentEra }) => api.query.staking.erasStakers.keys(currentEra)),
// Dedupe any duplicates
map((keys) => [...new Set(keys.map(({ args: [, accountId] }) => accountId.toString()))].map((a) => api.registry.createType('AccountId', a)))
)
: api.query.staking['currentElected']<AccountId[]>()
);
}
+14 -14
View File
@@ -18,21 +18,21 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/api-augment": "11.0.1",
"@polkadot/api-base": "11.0.1",
"@polkadot/api-derive": "11.0.1",
"@polkadot/api-augment": "11.1.1",
"@polkadot/api-base": "11.1.1",
"@polkadot/api-derive": "11.1.1",
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-augment": "11.0.1",
"@polkadot/rpc-core": "11.0.1",
"@polkadot/rpc-provider": "11.0.1",
"@polkadot/types": "11.0.1",
"@polkadot/types-augment": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/types-create": "11.0.1",
"@polkadot/types-known": "11.0.1",
"@polkadot/rpc-augment": "11.1.1",
"@polkadot/rpc-core": "11.1.1",
"@polkadot/rpc-provider": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-augment": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/types-create": "11.1.1",
"@polkadot/types-known": "11.1.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"eventemitter3": "^5.0.1",
@@ -40,7 +40,7 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/api-augment": "11.0.1",
"@polkadot/types-support": "11.0.1"
"@polkadot/api-augment": "11.1.1",
"@polkadot/types-support": "11.1.1"
}
}
+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: '11.0.1' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '11.1.1' };
+4 -4
View File
@@ -18,12 +18,12 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "11.0.1",
"@polkadot/types": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/rpc-core": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
}
+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: '11.0.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '11.1.1' };
+5 -5
View File
@@ -18,18 +18,18 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-augment": "11.0.1",
"@polkadot/rpc-provider": "11.0.1",
"@polkadot/types": "11.0.1",
"@polkadot/rpc-augment": "11.1.1",
"@polkadot/rpc-provider": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/util": "^12.6.2",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-augment": "11.0.1"
"@polkadot/rpc-augment": "11.1.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: '11.0.1' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '11.1.1' };
+3 -3
View File
@@ -18,12 +18,12 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/types": "11.0.1",
"@polkadot/types-support": "11.0.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-support": "11.1.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/x-fetch": "^12.6.2",
+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: '11.0.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '11.1.1' };
+10 -10
View File
@@ -18,7 +18,7 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
@@ -28,15 +28,15 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
},
"dependencies": {
"@polkadot/api": "11.0.1",
"@polkadot/api-augment": "11.0.1",
"@polkadot/rpc-augment": "11.0.1",
"@polkadot/rpc-provider": "11.0.1",
"@polkadot/types": "11.0.1",
"@polkadot/types-augment": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/types-create": "11.0.1",
"@polkadot/types-support": "11.0.1",
"@polkadot/api": "11.1.1",
"@polkadot/api-augment": "11.1.1",
"@polkadot/rpc-augment": "11.1.1",
"@polkadot/rpc-provider": "11.1.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-augment": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/types-create": "11.1.1",
"@polkadot/types-support": "11.1.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/x-ws": "^12.6.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: '11.0.1' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '11.1.1' };
+3 -3
View File
@@ -18,11 +18,11 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/types": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '11.0.1' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '11.1.1' };
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -18,7 +18,7 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/util": "^12.6.2",
@@ -26,9 +26,9 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/types": "11.0.1",
"@polkadot/types-augment": "11.0.1",
"@polkadot/types-support": "11.0.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-augment": "11.1.1",
"@polkadot/types-support": "11.1.1",
"@polkadot/util-crypto": "^12.6.2"
}
}
+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: '11.0.1' };
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '11.1.1' };
+3 -3
View File
@@ -18,14 +18,14 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/types-codec": "11.0.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/types": "11.0.1"
"@polkadot/types": "11.1.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: '11.0.1' };
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '11.1.1' };
+5 -5
View File
@@ -18,17 +18,17 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/networks": "^12.6.2",
"@polkadot/types": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/types-create": "11.0.1",
"@polkadot/types": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/types-create": "11.1.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/api": "11.0.1"
"@polkadot/api": "11.1.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: '11.0.1' };
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '11.1.1' };
+7 -1
View File
@@ -47,11 +47,17 @@ export const versioned: OverrideVersionedType[] = [
},
{
// metadata V14
minmax: [500, undefined],
minmax: [500, 1001003],
types: {
Weight: 'WeightV1',
TAssetConversion: 'Option<AssetId>'
}
},
{
minmax: [1002000, undefined],
types: {
Weight: 'WeightV1'
}
}
// ,
// {
+1 -1
View File
@@ -18,7 +18,7 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/util": "^12.6.2",
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -21,15 +21,15 @@ export default {
"beefy_getFinalizedHead",
"beefy_subscribeJustifications",
"beefy_unsubscribeJustifications",
"chainHead_unstable_body",
"chainHead_unstable_call",
"chainHead_unstable_continue",
"chainHead_unstable_follow",
"chainHead_unstable_header",
"chainHead_unstable_stopOperation",
"chainHead_unstable_storage",
"chainHead_unstable_unfollow",
"chainHead_unstable_unpin",
"chainHead_v1_body",
"chainHead_v1_call",
"chainHead_v1_continue",
"chainHead_v1_follow",
"chainHead_v1_header",
"chainHead_v1_stopOperation",
"chainHead_v1_storage",
"chainHead_v1_unfollow",
"chainHead_v1_unpin",
"chainSpec_v1_chainName",
"chainSpec_v1_genesisHash",
"chainSpec_v1_properties",
@@ -125,10 +125,10 @@ export default {
"system_syncState",
"system_unstable_networkState",
"system_version",
"transactionWatch_unstable_submitAndWatch",
"transactionWatch_unstable_unwatch",
"transaction_unstable_broadcast",
"transaction_unstable_stop",
"transactionWatch_v1_submitAndWatch",
"transactionWatch_v1_unwatch",
"transaction_v1_broadcast",
"transaction_v1_stop",
"unsubscribe_newHead"
]
};
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '11.0.1' };
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '11.1.1' };
+5 -5
View File
@@ -18,13 +18,13 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.0.1",
"version": "11.1.1",
"main": "index.js",
"dependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/types-augment": "11.0.1",
"@polkadot/types-codec": "11.0.1",
"@polkadot/types-create": "11.0.1",
"@polkadot/types-augment": "11.1.1",
"@polkadot/types-codec": "11.1.1",
"@polkadot/types-create": "11.1.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"rxjs": "^7.8.1",
@@ -32,6 +32,6 @@
},
"devDependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/types-support": "11.0.1"
"@polkadot/types-support": "11.1.1"
}
}
+11 -3
View File
@@ -5,7 +5,7 @@ import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, IMethod, Inspect, IOption } fr
import type { HexString } from '@polkadot/util/types';
import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics/index.js';
import type { FunctionMetadataLatest } from '../interfaces/metadata/index.js';
import type { Address, Call, CodecHash } from '../interfaces/runtime/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';
@@ -195,10 +195,17 @@ abstract class ExtrinsicBase<A extends AnyTuple> extends AbstractBase<ExtrinsicV
/**
* @description Forward compat
*/
public get assetId (): IOption<INumber> | IOption<MultiLocation> {
public get assetId (): IOption<INumber | MultiLocation> {
return this.inner.signature.assetId;
}
/**
* @description Forward compat
*/
public get metadataHash (): IOption<Hash> {
return this.inner.signature.metadataHash;
}
/**
* @description Returns the raw transaction version (not flagged with signing information)
*/
@@ -324,8 +331,9 @@ export class GenericExtrinsic<A extends AnyTuple = AnyTuple> extends ExtrinsicBa
},
this.isSigned
? {
assetId: this.assetId.toHuman(isExpanded, disableAscii),
assetId: this.assetId ? this.assetId.toHuman(isExpanded, disableAscii) : null,
era: this.era.toHuman(isExpanded, disableAscii),
metadataHash: this.metadataHash ? this.metadataHash.toHex() : null,
nonce: this.nonce.toHuman(isExpanded, disableAscii),
signature: this.signature.toHex(),
signer: this.signer.toHuman(isExpanded, disableAscii),
@@ -6,7 +6,7 @@ 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 { MultiLocation } from '../interfaces/types.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';
@@ -113,10 +113,17 @@ export class GenericExtrinsicPayload extends AbstractBase<ExtrinsicPayloadVx> {
/**
* @description The (optional) asset id as a [[u32]] or [[MultiLocation]] for this payload
*/
public get assetId (): IOption<INumber | IOption<MultiLocation>> {
public get assetId (): IOption<INumber | MultiLocation> {
return this.inner.assetId;
}
/**
* @description The (optional) [[Hash]] of the genesis metadata for this payload
*/
public get metadataHash (): IOption<Hash> {
return this.inner.metadataHash;
}
/**
* @description Compares the value of the input to see if there is a match
*/
@@ -17,11 +17,15 @@ registry.setMetadata(metadata);
describe('SignerPayload', (): void => {
const TEST = {
address: '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFabHE',
// eslint-disable-next-line sort-keys
assetId: { parents: 0, interior: { x2: [{ palletInstance: 50 }, { generalIndex: 123 }] } },
blockHash: '0xde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7',
blockNumber: '0x00231d30',
era: '0x0703',
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
metadataHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
method: '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
mode: 1,
nonce: '0x00001234',
signedExtensions: ['CheckNonce', 'CheckWeight'],
specVersion: '0x00000006',
@@ -34,11 +38,15 @@ describe('SignerPayload', (): void => {
expect(
new SignerPayload(registry, {
address: '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFabHE',
// eslint-disable-next-line sort-keys
assetId: { parents: 0, interior: { x2: [{ palletInstance: 50 }, { generalIndex: 123 }] } },
blockHash: '0xde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7',
blockNumber: '0x231d30',
era: registry.createType('ExtrinsicEra', { current: 2301232, period: 200 }),
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
metadataHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
method: registry.createType('Call', '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c'),
mode: 1,
nonce: 0x1234,
signedExtensions: ['CheckNonce'],
tip: 0x5678,
@@ -46,11 +54,15 @@ describe('SignerPayload', (): void => {
}).toPayload()
).toEqual({
address: '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFabHE',
// eslint-disable-next-line sort-keys
assetId: { parents: 0, interior: { x2: [{ palletInstance: 50 }, { generalIndex: 123 }] } },
blockHash: '0xde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7',
blockNumber: '0x00231d30',
era: '0x0703',
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
metadataHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
method: '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
mode: 1,
nonce: '0x00001234',
signedExtensions: ['CheckNonce'],
specVersion: '0x00000000',
@@ -71,25 +83,14 @@ describe('SignerPayload', (): void => {
).toEqual(true);
expect(
// @ts-expect-error We don't have getters for this field
test.toPayload().assetId
).toEqual({
// eslint-disable-next-line sort-keys
parents: 0, interior: { x2: [{ palletInstance: 50 }, { generalIndex: 123 }] }
});
).toEqual({ parents: 0, interior: { x2: [{ palletInstance: 50 }, { generalIndex: 123 }] } });
expect(
// @ts-expect-error We don't have getters for this field
new SignerPayload(registry, { assetId: 0 }).toPayload().assetId
).toEqual({
// eslint-disable-next-line sort-keys
parents: 0, interior: { here: null }
});
expect(
// @ts-expect-error We don't have getters for this field
new SignerPayload(registry, TEST).toPayload().assetId
).toBeUndefined();
).toEqual({ parents: 0, interior: { here: null } });
});
it('re-constructs from JSON', (): void => {
@@ -126,11 +127,55 @@ describe('SignerPayload', (): void => {
expect(payload.blockHash.toHex()).toEqual(TEST.blockHash);
expect(payload.nonce.eq(TEST.nonce)).toBe(true);
expect(payload.tip.eq(TEST.tip)).toBe(true);
// @ts-expect-error assetId is of unknown type, so we don't know about "isSome"
expect(payload.inner?.get('assetId')?.isSome && payload.inner?.get('assetId')
expect(payload.assetId.isSome && payload.assetId
?.eq(registry.createType('MultiLocation', {
// eslint-disable-next-line sort-keys
parents: 0, interior: { X2: [{ palletInstance: 50 }, { generalIndex: 123 }] }
}))).toBe(true);
});
const TEST_WITHOUT_CHECK = {
address: '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFabHE',
blockHash: '0xde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7',
blockNumber: '0x00231d30',
era: '0x0703',
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
method: '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
nonce: '0x00001234',
signedExtensions: [],
specVersion: '0x00000006',
tip: '0x00000000000000000000000000005678',
transactionVersion: '0x00000007',
version: 4
};
const PAYLOAD_WITHOUT_CHECK = {
address: '5DTestUPts3kjeXSTMyerHihn1uwMfLj8vU8sqF7qYrFabHE',
assetId: null,
blockHash: '0xde8f69eeb5e065e18c6950ff708d7e551f68dc9bf59a07c52367c0280f805ec7',
blockNumber: '0x00231d30',
era: '0x0703',
genesisHash: '0xdcd1346701ca8396496e52aa2785b1748deb6db09551b72159dcb3e08991025b',
metadataHash: null,
method: '0x060000d7568e5f0a7eda67a82691ff379ac4bba4f9c9b859fe779b5d46363b61ad2db9e56c',
mode: 0,
nonce: '0x00001234',
signedExtensions: [],
specVersion: '0x00000006',
tip: '0x00000000000000000000000000005678',
transactionVersion: '0x00000007',
version: 4
};
it('can build SignerPayload without additional SignedExtensions', (): void => {
expect(
new SignerPayload(
registry,
{
...TEST_WITHOUT_CHECK,
runtimeVersion: { specVersion: 0x06, transactionVersion: 0x07 }
}
).toPayload()
).toEqual(PAYLOAD_WITHOUT_CHECK);
});
});
+18 -1
View File
@@ -12,11 +12,14 @@ import { objectProperty, objectSpread, u8aToHex } from '@polkadot/util';
export interface SignerPayloadType extends Codec {
address: Address;
assetId: IOption<INumber | MultiLocation>;
blockHash: Hash;
blockNumber: INumber;
era: ExtrinsicEra;
genesisHash: Hash;
metadataHash: IOption<Hash>;
method: Call;
mode: INumber;
nonce: ICompact<INumber>;
runtimeVersion: IRuntimeVersion;
signedExtensions: Vec<Text>;
@@ -26,11 +29,14 @@ export interface SignerPayloadType extends Codec {
const knownTypes: Record<string, string> = {
address: 'Address',
assetId: 'Option<TAssetConversion>',
blockHash: 'Hash',
blockNumber: 'BlockNumber',
era: 'ExtrinsicEra',
genesisHash: 'Hash',
metadataHash: 'Option<[u8;32]>',
method: 'Call',
mode: 'u8',
nonce: 'Compact<Index>',
runtimeVersion: 'RuntimeVersion',
signedExtensions: 'Vec<Text>',
@@ -104,7 +110,7 @@ export class GenericSignerPayload extends Struct implements ISignerPayload, Sign
return this.getT('tip');
}
get assetId (): IOption<INumber> | IOption<MultiLocation> {
get assetId (): IOption<INumber | MultiLocation> {
return this.getT('assetId');
}
@@ -112,6 +118,14 @@ export class GenericSignerPayload extends Struct implements ISignerPayload, Sign
return this.getT('version');
}
get mode (): INumber {
return this.getT('mode');
}
get metadataHash (): IOption<Hash> {
return this.getT('metadataHash');
}
/**
* @description Creates an representation of the structure as an ISignerPayload JSON
*/
@@ -139,11 +153,14 @@ export class GenericSignerPayload extends Struct implements ISignerPayload, Sign
// the known defaults as managed explicitly and has different
// formatting in cases, e.g. we mostly expose a hex format here
address: this.address.toString(),
assetId: this.assetId ? this.assetId.toJSON() : null,
blockHash: this.blockHash.toHex(),
blockNumber: this.blockNumber.toHex(),
era: this.era.toHex(),
genesisHash: this.genesisHash.toHex(),
metadataHash: this.metadataHash.isSome ? this.metadataHash.toHex() : null,
method: this.method.toHex(),
mode: this.mode.toNumber(),
nonce: this.nonce.toHex(),
signedExtensions: this.signedExtensions.map((e) => e.toString()),
specVersion: this.runtimeVersion.specVersion.toHex(),
@@ -5,6 +5,15 @@ import type { ExtDef, ExtInfo } from './types.js';
import { emptyCheck } from './emptyCheck.js';
const CheckMetadataHash: ExtInfo = {
extrinsic: {
mode: 'u8'
},
payload: {
metadataHash: 'Option<[u8;32]>'
}
};
const CheckMortality: ExtInfo = {
extrinsic: {
era: 'ExtrinsicEra'
@@ -31,6 +40,7 @@ export const substrate: ExtDef = {
genesisHash: 'Hash'
}
},
CheckMetadataHash,
CheckMortality,
CheckNonZeroSender: emptyCheck,
CheckNonce: {
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { SignOptions } from '@polkadot/keyring/types';
import type { MultiLocation } from '@polkadot/types/interfaces';
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';
@@ -105,10 +105,17 @@ export class GenericExtrinsicPayloadV4 extends Struct {
/**
* @description The (optional) asset id for this signature for chains that support transaction fees in assets
*/
public get assetId (): IOption<INumber | IOption<MultiLocation>> {
public get assetId (): IOption<INumber | MultiLocation> {
return this.getT('assetId');
}
/**
* @description The (optional) asset id for this signature for chains that support transaction fees in assets
*/
public get metadataHash (): IOption<Hash> {
return this.getT('metadataHash');
}
/**
* @description Sign the payload with the keypair
*/
@@ -4,7 +4,7 @@
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 } from '../../interfaces/runtime/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';
@@ -122,10 +122,17 @@ export class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSig
/**
* @description The [[u32]] or [[MultiLocation]] assetId
*/
public get assetId (): IOption<INumber> | IOption<MultiLocation> {
public get assetId (): IOption<INumber | MultiLocation> {
return this.getT('assetId');
}
/**
* @description The [[Hash]] for the metadata
*/
public get metadataHash (): IOption<Hash> {
return this.getT('metadataHash');
}
protected _injectSignature (signer: Address, signature: ExtrinsicSignature, payload: GenericExtrinsicPayloadV4): IExtrinsicSignature {
// use the fields exposed to guide the getters
for (let i = 0, count = this.#signKeys.length; i < count; i++) {
+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: '11.0.1' };
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '11.1.1' };
+19
View File
@@ -35,6 +35,11 @@ export interface SignerPayloadJSON {
*/
address: string;
/**
* @description The id of the asset used to pay fees, in hex
*/
assetId?: number | object;
/**
* @description The checkpoint hash of the block, in hex
*/
@@ -55,11 +60,21 @@ export interface SignerPayloadJSON {
*/
genesisHash: HexString;
/**
* @description The metadataHash for the CheckMetadataHash SignedExtension, as hex
*/
metadataHash?: HexString;
/**
* @description The encoded method (with arguments) in hex
*/
method: string;
/**
* @description The mode for the CheckMetadataHash SignedExtension, in hex
*/
mode?: number;
/**
* @description The nonce for this transaction, in hex
*/
@@ -164,6 +179,8 @@ export interface SignatureOptions {
signer?: Signer;
tip?: AnyNumber;
assetId?: AnyNumber | object;
mode?: AnyNumber;
metadataHash?: Uint8Array | string;
}
interface ExtrinsicSignatureBase {
@@ -185,6 +202,8 @@ export interface ExtrinsicPayloadValue {
tip: AnyNumber;
transactionVersion: AnyNumber;
assetId?: AnyNumber | object;
mode?: AnyNumber;
metadataHash?: AnyU8a;
}
export interface IExtrinsicSignature extends ExtrinsicSignatureBase, Codec {
+94 -94
View File
@@ -444,26 +444,26 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/api-augment@npm:11.0.1, @polkadot/api-augment@workspace:packages/api-augment":
"@polkadot/api-augment@npm:11.1.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:11.0.1"
"@polkadot/rpc-augment": "npm:11.0.1"
"@polkadot/types": "npm:11.0.1"
"@polkadot/types-augment": "npm:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/api-base": "npm:11.1.1"
"@polkadot/rpc-augment": "npm:11.1.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-augment": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/api-base@npm:11.0.1, @polkadot/api-base@workspace:packages/api-base":
"@polkadot/api-base@npm:11.1.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:11.0.1"
"@polkadot/types": "npm:11.0.1"
"@polkadot/rpc-core": "npm:11.1.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.6.2"
@@ -474,13 +474,13 @@ __metadata:
version: 0.0.0-use.local
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
dependencies:
"@polkadot/api": "npm:11.0.1"
"@polkadot/api-augment": "npm:11.0.1"
"@polkadot/api": "npm:11.1.1"
"@polkadot/api-augment": "npm:11.1.1"
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/types": "npm:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/types-create": "npm:11.0.1"
"@polkadot/types-support": "npm:11.0.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/types-create": "npm:11.1.1"
"@polkadot/types-support": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
@@ -488,19 +488,19 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/api-derive@npm:11.0.1, @polkadot/api-derive@workspace:packages/api-derive":
"@polkadot/api-derive@npm:11.1.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:11.0.1"
"@polkadot/api-augment": "npm:11.0.1"
"@polkadot/api-base": "npm:11.0.1"
"@polkadot/rpc-augment": "npm:11.0.1"
"@polkadot/rpc-core": "npm:11.0.1"
"@polkadot/rpc-provider": "npm:11.0.1"
"@polkadot/types": "npm:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/types-support": "npm:11.0.1"
"@polkadot/api": "npm:11.1.1"
"@polkadot/api-augment": "npm:11.1.1"
"@polkadot/api-base": "npm:11.1.1"
"@polkadot/rpc-augment": "npm:11.1.1"
"@polkadot/rpc-core": "npm:11.1.1"
"@polkadot/rpc-provider": "npm:11.1.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/types-support": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
@@ -508,23 +508,23 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/api@npm:11.0.1, @polkadot/api@workspace:packages/api":
"@polkadot/api@npm:11.1.1, @polkadot/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@polkadot/api@workspace:packages/api"
dependencies:
"@polkadot/api-augment": "npm:11.0.1"
"@polkadot/api-base": "npm:11.0.1"
"@polkadot/api-derive": "npm:11.0.1"
"@polkadot/api-augment": "npm:11.1.1"
"@polkadot/api-base": "npm:11.1.1"
"@polkadot/api-derive": "npm:11.1.1"
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/rpc-augment": "npm:11.0.1"
"@polkadot/rpc-core": "npm:11.0.1"
"@polkadot/rpc-provider": "npm:11.0.1"
"@polkadot/types": "npm:11.0.1"
"@polkadot/types-augment": "npm:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/types-create": "npm:11.0.1"
"@polkadot/types-known": "npm:11.0.1"
"@polkadot/types-support": "npm:11.0.1"
"@polkadot/rpc-augment": "npm:11.1.1"
"@polkadot/rpc-core": "npm:11.1.1"
"@polkadot/rpc-provider": "npm:11.1.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-augment": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/types-create": "npm:11.1.1"
"@polkadot/types-known": "npm:11.1.1"
"@polkadot/types-support": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
eventemitter3: "npm:^5.0.1"
@@ -533,34 +533,34 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/dev-test@npm:^0.78.9":
version: 0.78.9
resolution: "@polkadot/dev-test@npm:0.78.9"
"@polkadot/dev-test@npm:^0.79.1":
version: 0.79.1
resolution: "@polkadot/dev-test@npm:0.79.1"
dependencies:
jsdom: "npm:^24.0.0"
tslib: "npm:^2.6.2"
checksum: 10/84d70e797a2d8c5cce12db044308548151cf4289e94ec9569f3852d7cf7ea545abaa595018e4cb14f57bab6c1b050792ed2b788c8d985ae8c594ae9b964a20ac
checksum: 10/36bd5fcdf2e444cdd8054567d3d9ab6b53657df0b42e7e0e79097458172b3e60dcf13daa524874d718334d590f008813141a2752099d302c314f762ad30b4890
languageName: node
linkType: hard
"@polkadot/dev-ts@npm:^0.78.9":
version: 0.78.9
resolution: "@polkadot/dev-ts@npm:0.78.9"
"@polkadot/dev-ts@npm:^0.79.1":
version: 0.79.1
resolution: "@polkadot/dev-ts@npm:0.79.1"
dependencies:
json5: "npm:^2.2.3"
tslib: "npm:^2.6.2"
typescript: "npm:^5.3.3"
checksum: 10/04294e766f492e4eb0447e6516487be4643da8b70054ad925f360b8110c2549e0e55821e8ebaa9141cf7795fe1ea814fb6151a6c0d1967377704ab90974a9825
checksum: 10/027a6570d19a54328e6ebca0ffe2cf532c6faebd75702abb3531a8b53168d1f35e0259b15e41760f601a912516ff46bd522f82127a0d475fb6c88e293e5449a5
languageName: node
linkType: hard
"@polkadot/dev@npm:^0.78.9":
version: 0.78.9
resolution: "@polkadot/dev@npm:0.78.9"
"@polkadot/dev@npm:^0.79.1":
version: 0.79.1
resolution: "@polkadot/dev@npm:0.79.1"
dependencies:
"@eslint/js": "npm:^8.56.0"
"@polkadot/dev-test": "npm:^0.78.9"
"@polkadot/dev-ts": "npm:^0.78.9"
"@polkadot/dev-test": "npm:^0.79.1"
"@polkadot/dev-ts": "npm:^0.79.1"
"@rollup/plugin-alias": "npm:^5.1.0"
"@rollup/plugin-commonjs": "npm:^25.0.7"
"@rollup/plugin-dynamic-import-vars": "npm:^2.1.2"
@@ -625,7 +625,7 @@ __metadata:
polkadot-exec-rollup: scripts/polkadot-exec-rollup.mjs
polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs
polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs
checksum: 10/0658fda631302a895e1fdf0a4cf60baba0fd52e78ebed4df5e3c2555ad6dd78e9982e9514ca54e8f5a0d85a6d7049c9684136012c8751ae30ec095d3fad72d00
checksum: 10/2a7bbd5da088a091c64d5e6b1e9215d0a82058702bc93bca43b2be941af0eb1de515356df9609cb179e0729dfe287dfea935e243afb71cf10cc055877c6edd6e
languageName: node
linkType: hard
@@ -654,39 +654,39 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/rpc-augment@npm:11.0.1, @polkadot/rpc-augment@workspace:packages/rpc-augment":
"@polkadot/rpc-augment@npm:11.1.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:11.0.1"
"@polkadot/types": "npm:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/rpc-core": "npm:11.1.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/rpc-core@npm:11.0.1, @polkadot/rpc-core@workspace:packages/rpc-core":
"@polkadot/rpc-core@npm:11.1.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:^12.6.2"
"@polkadot/rpc-augment": "npm:11.0.1"
"@polkadot/rpc-provider": "npm:11.0.1"
"@polkadot/types": "npm:11.0.1"
"@polkadot/rpc-augment": "npm:11.1.1"
"@polkadot/rpc-provider": "npm:11.1.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/rpc-provider@npm:11.0.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
"@polkadot/rpc-provider@npm:11.1.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:^12.6.2"
"@polkadot/types": "npm:11.0.1"
"@polkadot/types-support": "npm:11.0.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-support": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
"@polkadot/x-fetch": "npm:^12.6.2"
@@ -707,15 +707,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "@polkadot/typegen@workspace:packages/typegen"
dependencies:
"@polkadot/api": "npm:11.0.1"
"@polkadot/api-augment": "npm:11.0.1"
"@polkadot/rpc-augment": "npm:11.0.1"
"@polkadot/rpc-provider": "npm:11.0.1"
"@polkadot/types": "npm:11.0.1"
"@polkadot/types-augment": "npm:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/types-create": "npm:11.0.1"
"@polkadot/types-support": "npm:11.0.1"
"@polkadot/api": "npm:11.1.1"
"@polkadot/api-augment": "npm:11.1.1"
"@polkadot/rpc-augment": "npm:11.1.1"
"@polkadot/rpc-provider": "npm:11.1.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-augment": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/types-create": "npm:11.1.1"
"@polkadot/types-support": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
"@polkadot/x-ws": "npm:^12.6.2"
@@ -732,24 +732,24 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-augment@npm:11.0.1, @polkadot/types-augment@workspace:packages/types-augment":
"@polkadot/types-augment@npm:11.1.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:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/types-codec@npm:11.0.1, @polkadot/types-codec@workspace:packages/types-codec":
"@polkadot/types-codec@npm:11.1.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:11.0.1"
"@polkadot/types-augment": "npm:11.0.1"
"@polkadot/types-support": "npm:11.0.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-augment": "npm:11.1.1"
"@polkadot/types-support": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
"@polkadot/x-bigint": "npm:^12.6.2"
@@ -757,32 +757,32 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-create@npm:11.0.1, @polkadot/types-create@workspace:packages/types-create":
"@polkadot/types-create@npm:11.1.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:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/types-known@npm:11.0.1, @polkadot/types-known@workspace:packages/types-known":
"@polkadot/types-known@npm:11.1.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:11.0.1"
"@polkadot/api": "npm:11.1.1"
"@polkadot/networks": "npm:^12.6.2"
"@polkadot/types": "npm:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/types-create": "npm:11.0.1"
"@polkadot/types": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/types-create": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/types-support@npm:11.0.1, @polkadot/types-support@workspace:packages/types-support":
"@polkadot/types-support@npm:11.1.1, @polkadot/types-support@workspace:packages/types-support":
version: 0.0.0-use.local
resolution: "@polkadot/types-support@workspace:packages/types-support"
dependencies:
@@ -791,15 +791,15 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types@npm:11.0.1, @polkadot/types@workspace:packages/types":
"@polkadot/types@npm:11.1.1, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types"
dependencies:
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/types-augment": "npm:11.0.1"
"@polkadot/types-codec": "npm:11.0.1"
"@polkadot/types-create": "npm:11.0.1"
"@polkadot/types-support": "npm:11.0.1"
"@polkadot/types-augment": "npm:11.1.1"
"@polkadot/types-codec": "npm:11.1.1"
"@polkadot/types-create": "npm:11.1.1"
"@polkadot/types-support": "npm:11.1.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
@@ -7942,7 +7942,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "root-workspace-0b6124@workspace:."
dependencies:
"@polkadot/dev": "npm:^0.78.9"
"@polkadot/dev": "npm:^0.79.1"
"@polkadot/typegen": "workspace:packages/typegen"
"@types/node": "npm:^20.11.6"
languageName: unknown