From 12c35f84927ab15ed7b644522cc0a853235f0c51 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Fri, 8 Mar 2024 11:54:01 -0500 Subject: [PATCH 1/6] Fix api.derive.staking.eraExposure --- .../api-derive/src/staking/erasExposure.ts | 55 +++++++++++++++---- packages/api-derive/src/staking/types.ts | 10 +++- 2 files changed, 53 insertions(+), 12 deletions(-) diff --git a/packages/api-derive/src/staking/erasExposure.ts b/packages/api-derive/src/staking/erasExposure.ts index e066699f001a..8864aee19491 100644 --- a/packages/api-derive/src/staking/erasExposure.ts +++ b/packages/api-derive/src/staking/erasExposure.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import type { Observable } from 'rxjs'; -import type { StorageKey } from '@polkadot/types'; -import type { AccountId, EraIndex } from '@polkadot/types/interfaces'; -import type { PalletStakingExposure } from '@polkadot/types/lookup'; -import type { DeriveApi, DeriveEraExposure, DeriveEraNominatorExposure, DeriveEraValidatorExposure } from '../types.js'; +import type { Option, StorageKey, u32 } from '@polkadot/types'; +import type { AccountId, AccountId32, EraIndex } from '@polkadot/types/interfaces'; +import type { PalletStakingExposure, SpStakingExposurePage } from '@polkadot/types/lookup'; +import type { DeriveApi, DeriveEraExposurePaged, DeriveEraNominatorExposure, DeriveEraValidatorExposure, DeriveEraValidatorExposurePaged } from '../types.js'; import { map, of } from 'rxjs'; @@ -14,10 +14,12 @@ import { getEraCache, setEraCache } from './cache.js'; import { combineEras, erasHistoricApply, singleEra } from './util.js'; type KeysAndExposures = [StorageKey<[EraIndex, AccountId]>, PalletStakingExposure][]; +type KeysAndExposuresPaged = [StorageKey<[u32, AccountId32, u32]>, Option][]; const CACHE_KEY = 'eraExposure'; -function mapStakers (era: EraIndex, stakers: KeysAndExposures): DeriveEraExposure { +// Legacy usage for erasStakersClipped. Giving support for compatibility. +function mapStakersClipped (era: EraIndex, stakers: KeysAndExposures): DeriveEraExposurePaged { const nominators: DeriveEraNominatorExposure = {}; const validators: DeriveEraValidatorExposure = {}; @@ -37,15 +39,46 @@ function mapStakers (era: EraIndex, stakers: KeysAndExposures): DeriveEraExposur return { era, nominators, validators }; } -export function _eraExposure (instanceId: string, api: DeriveApi): (era: EraIndex, withActive?: boolean) => Observable { - return memo(instanceId, (era: EraIndex, withActive = false): Observable => { - const [cacheKey, cached] = getEraCache(CACHE_KEY, era, withActive); +function mapStakersPaged (era: EraIndex, stakers: KeysAndExposuresPaged): DeriveEraExposurePaged { + const nominators: DeriveEraNominatorExposure = {}; + const validators: DeriveEraValidatorExposurePaged = {}; + + stakers.forEach(([key, exposureOpt]): void => { + if (exposureOpt.isSome) { + const validatorId = key.args[1].toString(); + const exposure = exposureOpt.unwrap(); + + validators[validatorId] = exposure; + + exposure.others.forEach(({ who }, validatorIndex): void => { + const nominatorId = who.toString(); + + nominators[nominatorId] = nominators[nominatorId] || []; + nominators[nominatorId].push({ validatorId, validatorIndex }); + }); + } + }); + + return { era, nominators, validators }; +} + +/** + * erasStakersClipped will be deprecated and replaced with erasStakersPaged. Therefore support is given for both + * storage queries until erasStakersClipped has been completely out of use. + */ +export function _eraExposure (instanceId: string, api: DeriveApi): (era: EraIndex, withActive?: boolean) => Observable { + return memo(instanceId, (era: EraIndex, withActive = false): Observable => { + const [cacheKey, cached] = getEraCache(CACHE_KEY, era, withActive); return cached ? of(cached) - : api.query.staking.erasStakersClipped.entries(era).pipe( - map((r) => setEraCache(cacheKey, withActive, mapStakers(era, r))) - ); + : api.query.staking.erasStakersPaged + ? api.query.staking.erasStakersPaged.entries>(era).pipe( + map((r) => setEraCache(cacheKey, withActive, mapStakersPaged(era, r))) + ) + : api.query.staking.erasStakersClipped.entries(era).pipe( + map((r) => setEraCache(cacheKey, withActive, mapStakersClipped(era, r))) + ); }); } diff --git a/packages/api-derive/src/staking/types.ts b/packages/api-derive/src/staking/types.ts index f486e4249505..8b21aa494de6 100644 --- a/packages/api-derive/src/staking/types.ts +++ b/packages/api-derive/src/staking/types.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { AccountId, Balance, EraIndex, RewardPoint } from '@polkadot/types/interfaces'; -import type { PalletStakingExposure, PalletStakingRewardDestination, PalletStakingStakingLedger, PalletStakingValidatorPrefs } from '@polkadot/types/lookup'; +import type { PalletStakingExposure, PalletStakingRewardDestination, PalletStakingStakingLedger, PalletStakingValidatorPrefs, SpStakingExposurePage } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; import type { DeriveSessionIndexes } from '../session/types.js'; @@ -55,12 +55,20 @@ export type DeriveEraNominatorExposure = Record; +export type DeriveEraValidatorExposurePaged = Record; + export interface DeriveEraExposure { era: EraIndex; nominators: DeriveEraNominatorExposure; validators: DeriveEraValidatorExposure; } +export interface DeriveEraExposurePaged { + era: EraIndex; + nominators: DeriveEraNominatorExposure; + validators: DeriveEraValidatorExposurePaged; +} + export interface DeriveStakerExposure { era: EraIndex; isEmpty: boolean; From 420181581211370923c252fe65df7a5b9d861123 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Fri, 8 Mar 2024 12:24:44 -0500 Subject: [PATCH 2/6] small type changes --- packages/api-derive/src/staking/stakerExposure.ts | 4 ++-- packages/api-derive/src/staking/stakerRewards.ts | 8 ++++---- packages/api-derive/src/staking/types.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/api-derive/src/staking/stakerExposure.ts b/packages/api-derive/src/staking/stakerExposure.ts index 2cf0c932b26b..df3eb06d733b 100644 --- a/packages/api-derive/src/staking/stakerExposure.ts +++ b/packages/api-derive/src/staking/stakerExposure.ts @@ -4,7 +4,7 @@ import type { Observable } from 'rxjs'; import type { EraIndex } from '@polkadot/types/interfaces'; import type { DeriveApi } from '../types.js'; -import type { DeriveEraValidatorExposure, DeriveStakerExposure } from './types.js'; +import type { DeriveEraValidatorExposurePaged, DeriveStakerExposure } from './types.js'; import { map, switchMap } from 'rxjs'; @@ -19,7 +19,7 @@ export function _stakerExposures (instanceId: string, api: DeriveApi): (accountI stakerIds.map((stakerId) => exposures.map(({ era, nominators: allNominators, validators: allValidators }): DeriveStakerExposure => { const isValidator = !!allValidators[stakerId]; - const validators: DeriveEraValidatorExposure = {}; + const validators: DeriveEraValidatorExposurePaged = {}; const nominating = allNominators[stakerId] || []; if (isValidator) { diff --git a/packages/api-derive/src/staking/stakerRewards.ts b/packages/api-derive/src/staking/stakerRewards.ts index c439843a4eea..c01b1112d987 100644 --- a/packages/api-derive/src/staking/stakerRewards.ts +++ b/packages/api-derive/src/staking/stakerRewards.ts @@ -4,7 +4,7 @@ import type { Observable } from 'rxjs'; import type { u32, Vec } from '@polkadot/types'; import type { AccountId, EraIndex } from '@polkadot/types/interfaces'; -import type { PalletStakingStakingLedger } from '@polkadot/types/lookup'; +import type { PalletStakingExposure, PalletStakingStakingLedger } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; import type { DeriveApi, DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPoints, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types.js'; import type { DeriveStakingQuery } from './types.js'; @@ -38,7 +38,7 @@ function parseRewards (api: DeriveApi, stashId: AccountId, [erasPoints, erasPref Object.entries(eraValidators).forEach(([validatorId, exposure]): void => { const valPoints = allValPoints[validatorId] || BN_ZERO; const valComm = allValPrefs[validatorId]?.commission.unwrap() || BN_ZERO; - const expTotal = exposure.total?.unwrap() || BN_ZERO; + const expTotal = ((exposure as PalletStakingExposure).total && (exposure as PalletStakingExposure).total?.unwrap()) || BN_ZERO; let avail = BN_ZERO; let value: BN | undefined; @@ -48,8 +48,8 @@ function parseRewards (api: DeriveApi, stashId: AccountId, [erasPoints, erasPref const valCut = valComm.mul(avail).div(BN_BILLION); let staked: BN; - if (validatorId === stakerId) { - staked = exposure.own.unwrap(); + if (validatorId === stakerId && (exposure as PalletStakingExposure).own) { + staked = (exposure as PalletStakingExposure).own.unwrap(); } else { const stakerExp = exposure.others.find(({ who }) => who.eq(stakerId)); diff --git a/packages/api-derive/src/staking/types.ts b/packages/api-derive/src/staking/types.ts index 8b21aa494de6..b84cd9fecfcb 100644 --- a/packages/api-derive/src/staking/types.ts +++ b/packages/api-derive/src/staking/types.ts @@ -74,7 +74,7 @@ export interface DeriveStakerExposure { isEmpty: boolean; isValidator: boolean; nominating: DeriveEraExposureNominating[]; - validators: DeriveEraValidatorExposure; + validators: DeriveEraValidatorExposurePaged; } export interface DeriveStakerPrefs { From ba9dc6441b745030e8786cbfeba30470d4a4b936 Mon Sep 17 00:00:00 2001 From: tarikgul Date: Fri, 8 Mar 2024 12:40:29 -0500 Subject: [PATCH 3/6] linter suggestion --- packages/api-derive/src/staking/stakerRewards.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api-derive/src/staking/stakerRewards.ts b/packages/api-derive/src/staking/stakerRewards.ts index c01b1112d987..9ac26f15ff95 100644 --- a/packages/api-derive/src/staking/stakerRewards.ts +++ b/packages/api-derive/src/staking/stakerRewards.ts @@ -38,7 +38,7 @@ function parseRewards (api: DeriveApi, stashId: AccountId, [erasPoints, erasPref Object.entries(eraValidators).forEach(([validatorId, exposure]): void => { const valPoints = allValPoints[validatorId] || BN_ZERO; const valComm = allValPrefs[validatorId]?.commission.unwrap() || BN_ZERO; - const expTotal = ((exposure as PalletStakingExposure).total && (exposure as PalletStakingExposure).total?.unwrap()) || BN_ZERO; + const expTotal = (exposure as PalletStakingExposure).total ? (exposure as PalletStakingExposure).total?.unwrap() : BN_ZERO; let avail = BN_ZERO; let value: BN | undefined; From 8289e181cc69a9747d4c2c0e0d2b0b1972e3cac5 Mon Sep 17 00:00:00 2001 From: Tarik Gul <47201679+TarikGul@users.noreply.github.com> Date: Mon, 11 Mar 2024 08:58:13 -0400 Subject: [PATCH 4/6] 10.12.2 (#5814) --- CHANGELOG.md | 11 ++ package.json | 2 +- packages/api-augment/package.json | 12 +-- packages/api-base/package.json | 6 +- packages/api-contract/package.json | 16 +-- packages/api-derive/package.json | 24 ++--- packages/api/package.json | 28 ++--- packages/rpc-augment/package.json | 8 +- packages/rpc-core/package.json | 10 +- packages/rpc-provider/package.json | 6 +- packages/typegen/package.json | 20 ++-- packages/types-augment/package.json | 6 +- packages/types-codec/package.json | 8 +- packages/types-create/package.json | 6 +- packages/types-known/package.json | 10 +- packages/types-support/package.json | 2 +- packages/types/package.json | 10 +- yarn.lock | 158 ++++++++++++++-------------- 18 files changed, 177 insertions(+), 166 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf600c9db7d..fac5dd42e350 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # CHANGELOG +## 10.12.2 Mar 11, 2024 + +Contributed: + +- fix cache key (rpc-provider) (Thanks to https://github.com/ermalkaleci) + +Changes: + +- Update to latest Substrate metadata + + ## 10.12.1 Mar 4, 2024 Contributed: diff --git a/package.json b/package.json index 7e19116c2319..fa0ed42804bf 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ }, "sideEffects": false, "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "versions": { "git": "10.12.2-2-x", "npm": "10.12.1" diff --git a/packages/api-augment/package.json b/packages/api-augment/package.json index 10befda80b7b..c81194bf6ba4 100644 --- a/packages/api-augment/package.json +++ b/packages/api-augment/package.json @@ -18,14 +18,14 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/api-base": "10.12.2-2-x", - "@polkadot/rpc-augment": "10.12.2-2-x", - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-augment": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", + "@polkadot/api-base": "10.12.2", + "@polkadot/rpc-augment": "10.12.2", + "@polkadot/types": "10.12.2", + "@polkadot/types-augment": "10.12.2", + "@polkadot/types-codec": "10.12.2", "@polkadot/util": "^12.6.2", "tslib": "^2.6.2" } diff --git a/packages/api-base/package.json b/packages/api-base/package.json index 903958c0698d..ab7da544e1c1 100644 --- a/packages/api-base/package.json +++ b/packages/api-base/package.json @@ -18,11 +18,11 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/rpc-core": "10.12.2-2-x", - "@polkadot/types": "10.12.2-2-x", + "@polkadot/rpc-core": "10.12.2", + "@polkadot/types": "10.12.2", "@polkadot/util": "^12.6.2", "rxjs": "^7.8.1", "tslib": "^2.6.2" diff --git a/packages/api-contract/package.json b/packages/api-contract/package.json index b142a4c9c26c..f512fe7e5d2a 100644 --- a/packages/api-contract/package.json +++ b/packages/api-contract/package.json @@ -18,22 +18,22 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/api": "10.12.2-2-x", - "@polkadot/api-augment": "10.12.2-2-x", - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", - "@polkadot/types-create": "10.12.2-2-x", + "@polkadot/api": "10.12.2", + "@polkadot/api-augment": "10.12.2", + "@polkadot/types": "10.12.2", + "@polkadot/types-codec": "10.12.2", + "@polkadot/types-create": "10.12.2", "@polkadot/util": "^12.6.2", "@polkadot/util-crypto": "^12.6.2", "rxjs": "^7.8.1", "tslib": "^2.6.2" }, "devDependencies": { - "@polkadot/api-augment": "10.12.2-2-x", + "@polkadot/api-augment": "10.12.2", "@polkadot/keyring": "^12.6.2", - "@polkadot/types-support": "10.12.2-2-x" + "@polkadot/types-support": "10.12.2" } } diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index bd6571d81d5f..611b3b2afec5 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -18,25 +18,25 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/api": "10.12.2-2-x", - "@polkadot/api-augment": "10.12.2-2-x", - "@polkadot/api-base": "10.12.2-2-x", - "@polkadot/rpc-core": "10.12.2-2-x", - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", + "@polkadot/api": "10.12.2", + "@polkadot/api-augment": "10.12.2", + "@polkadot/api-base": "10.12.2", + "@polkadot/rpc-core": "10.12.2", + "@polkadot/types": "10.12.2", + "@polkadot/types-codec": "10.12.2", "@polkadot/util": "^12.6.2", "@polkadot/util-crypto": "^12.6.2", "rxjs": "^7.8.1", "tslib": "^2.6.2" }, "devDependencies": { - "@polkadot/api": "10.12.2-2-x", - "@polkadot/api-augment": "10.12.2-2-x", - "@polkadot/rpc-augment": "10.12.2-2-x", - "@polkadot/rpc-provider": "10.12.2-2-x", - "@polkadot/types-support": "10.12.2-2-x" + "@polkadot/api": "10.12.2", + "@polkadot/api-augment": "10.12.2", + "@polkadot/rpc-augment": "10.12.2", + "@polkadot/rpc-provider": "10.12.2", + "@polkadot/types-support": "10.12.2" } } diff --git a/packages/api/package.json b/packages/api/package.json index adf54bac4d41..4738c781dbbd 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -18,21 +18,21 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/api-augment": "10.12.2-2-x", - "@polkadot/api-base": "10.12.2-2-x", - "@polkadot/api-derive": "10.12.2-2-x", + "@polkadot/api-augment": "10.12.2", + "@polkadot/api-base": "10.12.2", + "@polkadot/api-derive": "10.12.2", "@polkadot/keyring": "^12.6.2", - "@polkadot/rpc-augment": "10.12.2-2-x", - "@polkadot/rpc-core": "10.12.2-2-x", - "@polkadot/rpc-provider": "10.12.2-2-x", - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-augment": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", - "@polkadot/types-create": "10.12.2-2-x", - "@polkadot/types-known": "10.12.2-2-x", + "@polkadot/rpc-augment": "10.12.2", + "@polkadot/rpc-core": "10.12.2", + "@polkadot/rpc-provider": "10.12.2", + "@polkadot/types": "10.12.2", + "@polkadot/types-augment": "10.12.2", + "@polkadot/types-codec": "10.12.2", + "@polkadot/types-create": "10.12.2", + "@polkadot/types-known": "10.12.2", "@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": "10.12.2-2-x", - "@polkadot/types-support": "10.12.2-2-x" + "@polkadot/api-augment": "10.12.2", + "@polkadot/types-support": "10.12.2" } } diff --git a/packages/rpc-augment/package.json b/packages/rpc-augment/package.json index 415e292dd3fa..fcb11bcc6638 100644 --- a/packages/rpc-augment/package.json +++ b/packages/rpc-augment/package.json @@ -18,12 +18,12 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/rpc-core": "10.12.2-2-x", - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", + "@polkadot/rpc-core": "10.12.2", + "@polkadot/types": "10.12.2", + "@polkadot/types-codec": "10.12.2", "@polkadot/util": "^12.6.2", "tslib": "^2.6.2" } diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index 55911186c971..41ab2bd92a5b 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -18,18 +18,18 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/rpc-augment": "10.12.2-2-x", - "@polkadot/rpc-provider": "10.12.2-2-x", - "@polkadot/types": "10.12.2-2-x", + "@polkadot/rpc-augment": "10.12.2", + "@polkadot/rpc-provider": "10.12.2", + "@polkadot/types": "10.12.2", "@polkadot/util": "^12.6.2", "rxjs": "^7.8.1", "tslib": "^2.6.2" }, "devDependencies": { "@polkadot/keyring": "^12.6.2", - "@polkadot/rpc-augment": "10.12.2-2-x" + "@polkadot/rpc-augment": "10.12.2" } } diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index 1521f9b8a1b5..584a5681e71b 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -18,12 +18,12 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { "@polkadot/keyring": "^12.6.2", - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-support": "10.12.2-2-x", + "@polkadot/types": "10.12.2", + "@polkadot/types-support": "10.12.2", "@polkadot/util": "^12.6.2", "@polkadot/util-crypto": "^12.6.2", "@polkadot/x-fetch": "^12.6.2", diff --git a/packages/typegen/package.json b/packages/typegen/package.json index 3ed7fbc31709..20899684dbbe 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -18,7 +18,7 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "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": "10.12.2-2-x", - "@polkadot/api-augment": "10.12.2-2-x", - "@polkadot/rpc-augment": "10.12.2-2-x", - "@polkadot/rpc-provider": "10.12.2-2-x", - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-augment": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", - "@polkadot/types-create": "10.12.2-2-x", - "@polkadot/types-support": "10.12.2-2-x", + "@polkadot/api": "10.12.2", + "@polkadot/api-augment": "10.12.2", + "@polkadot/rpc-augment": "10.12.2", + "@polkadot/rpc-provider": "10.12.2", + "@polkadot/types": "10.12.2", + "@polkadot/types-augment": "10.12.2", + "@polkadot/types-codec": "10.12.2", + "@polkadot/types-create": "10.12.2", + "@polkadot/types-support": "10.12.2", "@polkadot/util": "^12.6.2", "@polkadot/util-crypto": "^12.6.2", "@polkadot/x-ws": "^12.6.2", diff --git a/packages/types-augment/package.json b/packages/types-augment/package.json index e55183688de8..029f1a803000 100644 --- a/packages/types-augment/package.json +++ b/packages/types-augment/package.json @@ -18,11 +18,11 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", + "@polkadot/types": "10.12.2", + "@polkadot/types-codec": "10.12.2", "@polkadot/util": "^12.6.2", "tslib": "^2.6.2" } diff --git a/packages/types-codec/package.json b/packages/types-codec/package.json index 8667f0009e22..b05ae28c98a7 100644 --- a/packages/types-codec/package.json +++ b/packages/types-codec/package.json @@ -18,7 +18,7 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { "@polkadot/util": "^12.6.2", @@ -26,9 +26,9 @@ "tslib": "^2.6.2" }, "devDependencies": { - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-augment": "10.12.2-2-x", - "@polkadot/types-support": "10.12.2-2-x", + "@polkadot/types": "10.12.2", + "@polkadot/types-augment": "10.12.2", + "@polkadot/types-support": "10.12.2", "@polkadot/util-crypto": "^12.6.2" } } diff --git a/packages/types-create/package.json b/packages/types-create/package.json index 31446f037921..9ef1d638ec8c 100644 --- a/packages/types-create/package.json +++ b/packages/types-create/package.json @@ -18,14 +18,14 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { - "@polkadot/types-codec": "10.12.2-2-x", + "@polkadot/types-codec": "10.12.2", "@polkadot/util": "^12.6.2", "tslib": "^2.6.2" }, "devDependencies": { - "@polkadot/types": "10.12.2-2-x" + "@polkadot/types": "10.12.2" } } diff --git a/packages/types-known/package.json b/packages/types-known/package.json index a9e6a41c6dec..9fc6974e587e 100644 --- a/packages/types-known/package.json +++ b/packages/types-known/package.json @@ -18,17 +18,17 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { "@polkadot/networks": "^12.6.2", - "@polkadot/types": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", - "@polkadot/types-create": "10.12.2-2-x", + "@polkadot/types": "10.12.2", + "@polkadot/types-codec": "10.12.2", + "@polkadot/types-create": "10.12.2", "@polkadot/util": "^12.6.2", "tslib": "^2.6.2" }, "devDependencies": { - "@polkadot/api": "10.12.2-2-x" + "@polkadot/api": "10.12.2" } } diff --git a/packages/types-support/package.json b/packages/types-support/package.json index 5e6a21e1318f..09ecd877cb60 100644 --- a/packages/types-support/package.json +++ b/packages/types-support/package.json @@ -18,7 +18,7 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { "@polkadot/util": "^12.6.2", diff --git a/packages/types/package.json b/packages/types/package.json index c7808c0d4c1d..88ef61250904 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -18,13 +18,13 @@ "./packageDetect.cjs" ], "type": "module", - "version": "10.12.2-2-x", + "version": "10.12.2", "main": "index.js", "dependencies": { "@polkadot/keyring": "^12.6.2", - "@polkadot/types-augment": "10.12.2-2-x", - "@polkadot/types-codec": "10.12.2-2-x", - "@polkadot/types-create": "10.12.2-2-x", + "@polkadot/types-augment": "10.12.2", + "@polkadot/types-codec": "10.12.2", + "@polkadot/types-create": "10.12.2", "@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": "10.12.2-2-x" + "@polkadot/types-support": "10.12.2" } } diff --git a/yarn.lock b/yarn.lock index c520003e6895..4131a91fddc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -444,26 +444,26 @@ __metadata: languageName: node linkType: hard -"@polkadot/api-augment@npm:10.12.2-2-x, @polkadot/api-augment@workspace:packages/api-augment": +"@polkadot/api-augment@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/rpc-augment": "npm:10.12.2-2-x" - "@polkadot/types": "npm:10.12.2-2-x" - "@polkadot/types-augment": "npm:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" + "@polkadot/api-base": "npm:10.12.2" + "@polkadot/rpc-augment": "npm:10.12.2" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-augment": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" "@polkadot/util": "npm:^12.6.2" tslib: "npm:^2.6.2" languageName: unknown linkType: soft -"@polkadot/api-base@npm:10.12.2-2-x, @polkadot/api-base@workspace:packages/api-base": +"@polkadot/api-base@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/types": "npm:10.12.2-2-x" + "@polkadot/rpc-core": "npm:10.12.2" + "@polkadot/types": "npm:10.12.2" "@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:10.12.2-2-x" - "@polkadot/api-augment": "npm:10.12.2-2-x" + "@polkadot/api": "npm:10.12.2" + "@polkadot/api-augment": "npm:10.12.2" "@polkadot/keyring": "npm:^12.6.2" - "@polkadot/types": "npm:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" - "@polkadot/types-create": "npm:10.12.2-2-x" - "@polkadot/types-support": "npm:10.12.2-2-x" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" + "@polkadot/types-create": "npm:10.12.2" + "@polkadot/types-support": "npm:10.12.2" "@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:10.12.2-2-x, @polkadot/api-derive@workspace:packages/api-derive": +"@polkadot/api-derive@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/api-augment": "npm:10.12.2-2-x" - "@polkadot/api-base": "npm:10.12.2-2-x" - "@polkadot/rpc-augment": "npm:10.12.2-2-x" - "@polkadot/rpc-core": "npm:10.12.2-2-x" - "@polkadot/rpc-provider": "npm:10.12.2-2-x" - "@polkadot/types": "npm:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" - "@polkadot/types-support": "npm:10.12.2-2-x" + "@polkadot/api": "npm:10.12.2" + "@polkadot/api-augment": "npm:10.12.2" + "@polkadot/api-base": "npm:10.12.2" + "@polkadot/rpc-augment": "npm:10.12.2" + "@polkadot/rpc-core": "npm:10.12.2" + "@polkadot/rpc-provider": "npm:10.12.2" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" + "@polkadot/types-support": "npm:10.12.2" "@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:10.12.2-2-x, @polkadot/api@workspace:packages/api": +"@polkadot/api@npm:10.12.2, @polkadot/api@workspace:packages/api": version: 0.0.0-use.local resolution: "@polkadot/api@workspace:packages/api" dependencies: - "@polkadot/api-augment": "npm:10.12.2-2-x" - "@polkadot/api-base": "npm:10.12.2-2-x" - "@polkadot/api-derive": "npm:10.12.2-2-x" + "@polkadot/api-augment": "npm:10.12.2" + "@polkadot/api-base": "npm:10.12.2" + "@polkadot/api-derive": "npm:10.12.2" "@polkadot/keyring": "npm:^12.6.2" - "@polkadot/rpc-augment": "npm:10.12.2-2-x" - "@polkadot/rpc-core": "npm:10.12.2-2-x" - "@polkadot/rpc-provider": "npm:10.12.2-2-x" - "@polkadot/types": "npm:10.12.2-2-x" - "@polkadot/types-augment": "npm:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" - "@polkadot/types-create": "npm:10.12.2-2-x" - "@polkadot/types-known": "npm:10.12.2-2-x" - "@polkadot/types-support": "npm:10.12.2-2-x" + "@polkadot/rpc-augment": "npm:10.12.2" + "@polkadot/rpc-core": "npm:10.12.2" + "@polkadot/rpc-provider": "npm:10.12.2" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-augment": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" + "@polkadot/types-create": "npm:10.12.2" + "@polkadot/types-known": "npm:10.12.2" + "@polkadot/types-support": "npm:10.12.2" "@polkadot/util": "npm:^12.6.2" "@polkadot/util-crypto": "npm:^12.6.2" eventemitter3: "npm:^5.0.1" @@ -654,39 +654,39 @@ __metadata: languageName: node linkType: hard -"@polkadot/rpc-augment@npm:10.12.2-2-x, @polkadot/rpc-augment@workspace:packages/rpc-augment": +"@polkadot/rpc-augment@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/types": "npm:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" + "@polkadot/rpc-core": "npm:10.12.2" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" "@polkadot/util": "npm:^12.6.2" tslib: "npm:^2.6.2" languageName: unknown linkType: soft -"@polkadot/rpc-core@npm:10.12.2-2-x, @polkadot/rpc-core@workspace:packages/rpc-core": +"@polkadot/rpc-core@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/rpc-provider": "npm:10.12.2-2-x" - "@polkadot/types": "npm:10.12.2-2-x" + "@polkadot/rpc-augment": "npm:10.12.2" + "@polkadot/rpc-provider": "npm:10.12.2" + "@polkadot/types": "npm:10.12.2" "@polkadot/util": "npm:^12.6.2" rxjs: "npm:^7.8.1" tslib: "npm:^2.6.2" languageName: unknown linkType: soft -"@polkadot/rpc-provider@npm:10.12.2-2-x, @polkadot/rpc-provider@workspace:packages/rpc-provider": +"@polkadot/rpc-provider@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/types-support": "npm:10.12.2-2-x" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-support": "npm:10.12.2" "@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:10.12.2-2-x" - "@polkadot/api-augment": "npm:10.12.2-2-x" - "@polkadot/rpc-augment": "npm:10.12.2-2-x" - "@polkadot/rpc-provider": "npm:10.12.2-2-x" - "@polkadot/types": "npm:10.12.2-2-x" - "@polkadot/types-augment": "npm:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" - "@polkadot/types-create": "npm:10.12.2-2-x" - "@polkadot/types-support": "npm:10.12.2-2-x" + "@polkadot/api": "npm:10.12.2" + "@polkadot/api-augment": "npm:10.12.2" + "@polkadot/rpc-augment": "npm:10.12.2" + "@polkadot/rpc-provider": "npm:10.12.2" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-augment": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" + "@polkadot/types-create": "npm:10.12.2" + "@polkadot/types-support": "npm:10.12.2" "@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:10.12.2-2-x, @polkadot/types-augment@workspace:packages/types-augment": +"@polkadot/types-augment@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" "@polkadot/util": "npm:^12.6.2" tslib: "npm:^2.6.2" languageName: unknown linkType: soft -"@polkadot/types-codec@npm:10.12.2-2-x, @polkadot/types-codec@workspace:packages/types-codec": +"@polkadot/types-codec@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/types-augment": "npm:10.12.2-2-x" - "@polkadot/types-support": "npm:10.12.2-2-x" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-augment": "npm:10.12.2" + "@polkadot/types-support": "npm:10.12.2" "@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:10.12.2-2-x, @polkadot/types-create@workspace:packages/types-create": +"@polkadot/types-create@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" "@polkadot/util": "npm:^12.6.2" tslib: "npm:^2.6.2" languageName: unknown linkType: soft -"@polkadot/types-known@npm:10.12.2-2-x, @polkadot/types-known@workspace:packages/types-known": +"@polkadot/types-known@npm:10.12.2, @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:10.12.2-2-x" + "@polkadot/api": "npm:10.12.2" "@polkadot/networks": "npm:^12.6.2" - "@polkadot/types": "npm:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" - "@polkadot/types-create": "npm:10.12.2-2-x" + "@polkadot/types": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" + "@polkadot/types-create": "npm:10.12.2" "@polkadot/util": "npm:^12.6.2" tslib: "npm:^2.6.2" languageName: unknown linkType: soft -"@polkadot/types-support@npm:10.12.2-2-x, @polkadot/types-support@workspace:packages/types-support": +"@polkadot/types-support@npm:10.12.2, @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:10.12.2-2-x, @polkadot/types@workspace:packages/types": +"@polkadot/types@npm:10.12.2, @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:10.12.2-2-x" - "@polkadot/types-codec": "npm:10.12.2-2-x" - "@polkadot/types-create": "npm:10.12.2-2-x" - "@polkadot/types-support": "npm:10.12.2-2-x" + "@polkadot/types-augment": "npm:10.12.2" + "@polkadot/types-codec": "npm:10.12.2" + "@polkadot/types-create": "npm:10.12.2" + "@polkadot/types-support": "npm:10.12.2" "@polkadot/util": "npm:^12.6.2" "@polkadot/util-crypto": "npm:^12.6.2" rxjs: "npm:^7.8.1" From da289238b03866c03d70bb8617a610d11bdeeb59 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 13:05:36 +0000 Subject: [PATCH 5/6] [CI Skip] release/stable 10.12.2 skip-checks: true --- CONTRIBUTORS | 2 +- package.json | 4 ++-- packages/api-augment/src/packageInfo.ts | 2 +- packages/api-base/src/packageInfo.ts | 2 +- packages/api-contract/src/packageInfo.ts | 2 +- packages/api-derive/src/packageInfo.ts | 2 +- packages/api/src/packageInfo.ts | 2 +- packages/rpc-augment/src/packageInfo.ts | 2 +- packages/rpc-core/src/packageInfo.ts | 2 +- packages/rpc-provider/src/packageInfo.ts | 2 +- packages/typegen/src/packageInfo.ts | 2 +- packages/types-augment/src/packageInfo.ts | 2 +- packages/types-codec/src/packageInfo.ts | 2 +- packages/types-create/src/packageInfo.ts | 2 +- packages/types-known/src/packageInfo.ts | 2 +- packages/types-support/src/packageInfo.ts | 2 +- packages/types/src/packageInfo.ts | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 3d1f1677729b..e82c0368bd38 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -8,7 +8,7 @@ 14 Nikos Kontakis Bump substrate connect to 0.7.16 (#5307) 11 Ian He HttpProvider support clone() (#3949) 10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954) - 9 Tarik Gul Update docs in types-support for retrieving metadata for typegen (#5809) + 10 Tarik Gul 10.12.2 (#5814) 6 Andreea Eftene Update check for contract instantiation (#5699) 5 Chevdor Fix metadata package link (#3458) 5 Jake Naviasky Fixing approvalFlagsToBools. (#1250) diff --git a/package.json b/package.json index fa0ed42804bf..b77f586af287 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "type": "module", "version": "10.12.2", "versions": { - "git": "10.12.2-2-x", - "npm": "10.12.1" + "git": "10.12.2", + "npm": "10.12.2" }, "workspaces": [ "packages/*" diff --git a/packages/api-augment/src/packageInfo.ts b/packages/api-augment/src/packageInfo.ts index 5e8871172274..fd4cb0c1b905 100644 --- a/packages/api-augment/src/packageInfo.ts +++ b/packages/api-augment/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/api-base/src/packageInfo.ts b/packages/api-base/src/packageInfo.ts index 2063f4cfbd85..0878182465f5 100644 --- a/packages/api-base/src/packageInfo.ts +++ b/packages/api-base/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/api-contract/src/packageInfo.ts b/packages/api-contract/src/packageInfo.ts index 5651dbcf7cc2..e4e03aee61cb 100644 --- a/packages/api-contract/src/packageInfo.ts +++ b/packages/api-contract/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/api-derive/src/packageInfo.ts b/packages/api-derive/src/packageInfo.ts index d5fdfe3f1480..6ecc8470d5ee 100644 --- a/packages/api-derive/src/packageInfo.ts +++ b/packages/api-derive/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/api/src/packageInfo.ts b/packages/api/src/packageInfo.ts index 24d27c511053..b057766ce14c 100644 --- a/packages/api/src/packageInfo.ts +++ b/packages/api/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/rpc-augment/src/packageInfo.ts b/packages/rpc-augment/src/packageInfo.ts index dba33fc6c7d9..fdc905c000ec 100644 --- a/packages/rpc-augment/src/packageInfo.ts +++ b/packages/rpc-augment/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/rpc-core/src/packageInfo.ts b/packages/rpc-core/src/packageInfo.ts index 5426868915be..7c2f2514ce88 100644 --- a/packages/rpc-core/src/packageInfo.ts +++ b/packages/rpc-core/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/rpc-provider/src/packageInfo.ts b/packages/rpc-provider/src/packageInfo.ts index 9e32245d776b..d231c70dd655 100644 --- a/packages/rpc-provider/src/packageInfo.ts +++ b/packages/rpc-provider/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/typegen/src/packageInfo.ts b/packages/typegen/src/packageInfo.ts index 4bcf2fa0c618..f4aba85ab2fe 100644 --- a/packages/typegen/src/packageInfo.ts +++ b/packages/typegen/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/types-augment/src/packageInfo.ts b/packages/types-augment/src/packageInfo.ts index ac47bb27799d..fa327d5eb08c 100644 --- a/packages/types-augment/src/packageInfo.ts +++ b/packages/types-augment/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/types-codec/src/packageInfo.ts b/packages/types-codec/src/packageInfo.ts index 25f710728039..f11cf310e790 100644 --- a/packages/types-codec/src/packageInfo.ts +++ b/packages/types-codec/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/types-create/src/packageInfo.ts b/packages/types-create/src/packageInfo.ts index aa4dfe9935bd..b2a69d69a8a6 100644 --- a/packages/types-create/src/packageInfo.ts +++ b/packages/types-create/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/types-known/src/packageInfo.ts b/packages/types-known/src/packageInfo.ts index c377f71b3b0e..04da1def20e1 100644 --- a/packages/types-known/src/packageInfo.ts +++ b/packages/types-known/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/types-support/src/packageInfo.ts b/packages/types-support/src/packageInfo.ts index 6c613049abd9..4a7ebc15f479 100644 --- a/packages/types-support/src/packageInfo.ts +++ b/packages/types-support/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '10.12.2' }; diff --git a/packages/types/src/packageInfo.ts b/packages/types/src/packageInfo.ts index 0f06663804c9..40c94862d822 100644 --- a/packages/types/src/packageInfo.ts +++ b/packages/types/src/packageInfo.ts @@ -3,4 +3,4 @@ // Do not edit, auto-generated by @polkadot/dev -export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '10.12.2-2-x' }; +export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '10.12.2' }; From ac7103d7243542241e71b6c9aab8cef33d9f536b Mon Sep 17 00:00:00 2001 From: tarikgul Date: Mon, 11 Mar 2024 19:52:11 -0400 Subject: [PATCH 6/6] add compatibility --- .../api-derive/src/staking/stakerRewards.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/api-derive/src/staking/stakerRewards.ts b/packages/api-derive/src/staking/stakerRewards.ts index 9ac26f15ff95..29ccdd1570fe 100644 --- a/packages/api-derive/src/staking/stakerRewards.ts +++ b/packages/api-derive/src/staking/stakerRewards.ts @@ -4,7 +4,7 @@ import type { Observable } from 'rxjs'; import type { u32, Vec } from '@polkadot/types'; import type { AccountId, EraIndex } from '@polkadot/types/interfaces'; -import type { PalletStakingExposure, PalletStakingStakingLedger } from '@polkadot/types/lookup'; +import type { PalletStakingExposure, PalletStakingStakingLedger, SpStakingExposurePage } from '@polkadot/types/lookup'; import type { BN } from '@polkadot/util'; import type { DeriveApi, DeriveEraPoints, DeriveEraPrefs, DeriveEraRewards, DeriveEraValPoints, DeriveEraValPrefs, DeriveStakerExposure, DeriveStakerReward, DeriveStakerRewardValidator } from '../types.js'; import type { DeriveStakingQuery } from './types.js'; @@ -38,7 +38,11 @@ function parseRewards (api: DeriveApi, stashId: AccountId, [erasPoints, erasPref Object.entries(eraValidators).forEach(([validatorId, exposure]): void => { const valPoints = allValPoints[validatorId] || BN_ZERO; const valComm = allValPrefs[validatorId]?.commission.unwrap() || BN_ZERO; - const expTotal = (exposure as PalletStakingExposure).total ? (exposure as PalletStakingExposure).total?.unwrap() : BN_ZERO; + const expTotal = (exposure as PalletStakingExposure).total + ? (exposure as PalletStakingExposure).total?.unwrap() + : (exposure as SpStakingExposurePage).pageTotal + ? (exposure as SpStakingExposurePage).pageTotal?.unwrap() + : BN_ZERO; let avail = BN_ZERO; let value: BN | undefined; @@ -48,8 +52,14 @@ function parseRewards (api: DeriveApi, stashId: AccountId, [erasPoints, erasPref const valCut = valComm.mul(avail).div(BN_BILLION); let staked: BN; - if (validatorId === stakerId && (exposure as PalletStakingExposure).own) { - staked = (exposure as PalletStakingExposure).own.unwrap(); + if (validatorId === stakerId) { + if ((exposure as PalletStakingExposure).own) { + staked = (exposure as PalletStakingExposure).own.unwrap(); + } else { + const expAccount = exposure.others.find(({ who }) => who.toString() === validatorId); + + staked = expAccount ? expAccount.value.unwrap() : BN_ZERO; + } } else { const stakerExp = exposure.others.find(({ who }) => who.eq(stakerId));