Update all PJS deps (#11051)

* Update all PJS deps

* Fix type issue with candidate

* Fix compatibility with new CJS and ESM targettting
This commit is contained in:
Tarik Gul 2024-11-04 07:45:55 -08:00 committed by GitHub
parent dde8de404d
commit f403bd4cc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 555 additions and 532 deletions

View File

@ -91,34 +91,34 @@
"source-map-explorer": "^2.5.3"
},
"resolutions": {
"@polkadot/api": "^14.0.1",
"@polkadot/api-augment": "^14.0.1",
"@polkadot/api-base": "^14.0.1",
"@polkadot/api-contract": "^14.0.1",
"@polkadot/api-derive": "^14.0.1",
"@polkadot/hw-ledger": "^13.1.1",
"@polkadot/keyring": "^13.1.1",
"@polkadot/networks": "^13.1.1",
"@polkadot/phishing": "^0.23.6",
"@polkadot/rpc-augment": "^14.0.1",
"@polkadot/rpc-core": "^14.0.1",
"@polkadot/rpc-provider": "^14.0.1",
"@polkadot/types": "^14.0.1",
"@polkadot/types-augment": "^14.0.1",
"@polkadot/types-codec": "^14.0.1",
"@polkadot/types-create": "^14.0.1",
"@polkadot/types-known": "^14.0.1",
"@polkadot/types-support": "^14.0.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/api": "^14.2.1",
"@polkadot/api-augment": "^14.2.1",
"@polkadot/api-base": "^14.2.1",
"@polkadot/api-contract": "^14.2.1",
"@polkadot/api-derive": "^14.2.1",
"@polkadot/hw-ledger": "^13.2.1",
"@polkadot/keyring": "^13.2.1",
"@polkadot/networks": "^13.2.1",
"@polkadot/phishing": "^0.24.2",
"@polkadot/rpc-augment": "^14.2.1",
"@polkadot/rpc-core": "^14.2.1",
"@polkadot/rpc-provider": "^14.2.1",
"@polkadot/types": "^14.2.1",
"@polkadot/types-augment": "^14.2.1",
"@polkadot/types-codec": "^14.2.1",
"@polkadot/types-create": "^14.2.1",
"@polkadot/types-known": "^14.2.1",
"@polkadot/types-support": "^14.2.1",
"@polkadot/util": "^13.2.1",
"@polkadot/util-crypto": "^13.2.1",
"@polkadot/wasm-crypto": "^7.3.2",
"@polkadot/x-bigint": "^13.1.1",
"@polkadot/x-fetch": "^13.1.1",
"@polkadot/x-global": "^13.1.1",
"@polkadot/x-randomvalues": "^13.1.1",
"@polkadot/x-textdecoder": "^13.1.1",
"@polkadot/x-textencoder": "^13.1.1",
"@polkadot/x-ws": "^13.1.1",
"@polkadot/x-bigint": "^13.2.1",
"@polkadot/x-fetch": "^13.2.1",
"@polkadot/x-global": "^13.2.1",
"@polkadot/x-randomvalues": "^13.2.1",
"@polkadot/x-textdecoder": "^13.2.1",
"@polkadot/x-textencoder": "^13.2.1",
"@polkadot/x-ws": "^13.2.1",
"typescript": "^5.5.4"
}
}

View File

@ -37,17 +37,17 @@
"@peaqnetwork/type-definitions": "0.0.4",
"@pendulum-chain/type-definitions": "0.3.8",
"@phala/typedefs": "0.2.33",
"@polkadot/api": "^14.0.1",
"@polkadot/api-derive": "^14.0.1",
"@polkadot/networks": "^13.1.1",
"@polkadot/react-identicon": "^3.10.1",
"@polkadot/types": "^14.0.1",
"@polkadot/types-codec": "^13.2.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/wasm-util": "^7.3.2",
"@polkadot/x-fetch": "^13.1.1",
"@polkadot/x-ws": "^13.1.1",
"@polkadot/api": "^14.2.1",
"@polkadot/api-derive": "^14.2.1",
"@polkadot/networks": "^13.2.2",
"@polkadot/react-identicon": "^3.11.2",
"@polkadot/types": "^14.2.1",
"@polkadot/types-codec": "^14.2.1",
"@polkadot/util": "^13.2.2",
"@polkadot/util-crypto": "^13.2.2",
"@polkadot/wasm-util": "^7.4.1",
"@polkadot/x-fetch": "^13.2.2",
"@polkadot/x-ws": "^13.2.2",
"@polymeshassociation/polymesh-types": "5.7.0",
"@snowfork/snowbridge-types": "0.2.7",
"@sora-substrate/type-definitions": "1.27.7",

View File

@ -243,10 +243,10 @@ const spec: Record<string, OverrideBundleDefinition> = {
mathchain,
'mathchain-galois': galois,
messier: hyperbridge,
moonbase: moonbeam,
moonbeam,
moonriver: moonbeam,
moonshadow: moonbeam,
moonbase: moonbeam as OverrideBundleDefinition,
moonbeam: moonbeam as OverrideBundleDefinition,
moonriver: moonbeam as OverrideBundleDefinition,
moonshadow: moonbeam as OverrideBundleDefinition,
muse,
'mybank.network Testnet': mybank,
mythos,
@ -254,7 +254,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
neuroweb,
nexus: hyperbridge,
nftmart,
'node-moonbeam': moonbeam,
'node-moonbeam': moonbeam as OverrideBundleDefinition,
'node-polkadex': polkadex,
'nodle-chain': nodle,
oak,
@ -273,7 +273,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
'pioneer-runtime': bitcountryPioneer,
polymesh_mainnet: polymeshMainnet,
polymesh_testnet: polymeshTestnet,
'pontem-node': pontem,
'pontem-node': pontem as OverrideBundleDefinition,
prism,
'quantum-portal-network-parachain': ferrum,
quartz,
@ -284,7 +284,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
sapphire,
shibuya,
shiden,
snowbridge,
snowbridge: snowbridge as OverrideBundleDefinition,
'sora-substrate': soraSubstrate,
sora_ksm: soraSubstrate,
'spacewalk-standalone': pendulum,
@ -294,7 +294,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
steam: eave,
subdao,
subgame,
subsocial,
subsocial: subsocial as OverrideBundleDefinition,
subspace,
'substrate-contracts-node': substrateContractsNode,
subzero: zero,

View File

@ -5,6 +5,6 @@ import type { OverrideBundleDefinition } from '@polkadot/types/types';
import { typesBundle } from '@polymeshassociation/polymesh-types';
const definitions: OverrideBundleDefinition = typesBundle.spec.polymesh_mainnet;
const definitions: OverrideBundleDefinition = typesBundle.spec.polymesh_mainnet as OverrideBundleDefinition;
export default definitions;

View File

@ -5,6 +5,6 @@ import type { OverrideBundleDefinition } from '@polkadot/types/types';
import { typesBundle } from '@polymeshassociation/polymesh-types';
const definitions: OverrideBundleDefinition = typesBundle.spec.polymesh_testnet;
const definitions: OverrideBundleDefinition = typesBundle.spec.polymesh_testnet as OverrideBundleDefinition;
export default definitions;

View File

@ -16,12 +16,12 @@
"type": "module",
"version": "0.145.2-12-x",
"dependencies": {
"@polkadot/hw-ledger": "^13.1.1",
"@polkadot/phishing": "^0.23.7",
"@polkadot/hw-ledger": "^13.2.2",
"@polkadot/phishing": "^0.24.2",
"@polkadot/react-components": "^0.145.2-12-x",
"@polkadot/react-hooks": "^0.145.2-12-x",
"@polkadot/util": "^13.1.1",
"@polkadot/vanitygen": "^0.59.1",
"@polkadot/util": "^13.2.2",
"@polkadot/vanitygen": "^0.60.2",
"detect-browser": "^5.3.0",
"file-saver": "^2.0.5"
},

View File

@ -16,7 +16,7 @@
"type": "module",
"version": "0.145.2-12-x",
"dependencies": {
"@polkadot/api-contract": "14.0.1",
"@polkadot/api-contract": "14.2.1",
"eventemitter3": "^5.0.1"
},
"peerDependencies": {

View File

@ -4,7 +4,7 @@
import type { ApiPromise } from '@polkadot/api';
import type { SignedBlockExtended } from '@polkadot/api-derive/types';
import type { Event } from '@polkadot/types/interfaces';
import type { PolkadotPrimitivesV6CandidateReceipt } from '@polkadot/types/lookup';
import type { PolkadotPrimitivesV7CandidateReceipt } from '@polkadot/types/lookup';
import type { IEvent } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { EventMapInfo } from './types.js';
@ -26,7 +26,7 @@ const EMPTY_EVENTS: Result = { lastBacked: {}, lastIncluded: {}, lastTimeout: {}
function includeEntry (map: EventMap, event: Event, blockHash: string, blockNumber: BN): void {
try {
const { descriptor } = (event as unknown as IEvent<[PolkadotPrimitivesV6CandidateReceipt]>).data[0];
const { descriptor } = (event as unknown as IEvent<[PolkadotPrimitivesV7CandidateReceipt]>).data[0];
if (descriptor?.paraId) {
map[descriptor.paraId.toString()] = {

View File

@ -20,10 +20,10 @@
"path": false
},
"dependencies": {
"@polkadot/api": "^14.0.1",
"@polkadot/extension-compat-metamask": "^0.54.1",
"@polkadot/extension-dapp": "^0.54.1",
"@polkadot/rpc-provider": "^14.0.1",
"@polkadot/api": "^14.2.1",
"@polkadot/extension-compat-metamask": "^0.56.1",
"@polkadot/extension-dapp": "^0.56.1",
"@polkadot/rpc-provider": "^14.2.1",
"fflate": "^0.8.1",
"rxjs": "^7.8.1"
},

View File

@ -19,15 +19,15 @@
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@polkadot/keyring": "^13.1.1",
"@polkadot/keyring": "^13.2.2",
"@polkadot/react-api": "^0.145.2-12-x",
"@polkadot/react-identicon": "^3.10.1",
"@polkadot/react-qr": "^3.10.1",
"@polkadot/react-identicon": "^3.11.2",
"@polkadot/react-qr": "^3.11.2",
"@polkadot/react-query": "^0.145.2-12-x",
"@polkadot/ui-keyring": "^3.10.1",
"@polkadot/ui-settings": "^3.10.1",
"@polkadot/util": "^13.1.1",
"@polkadot/util-crypto": "^13.1.1",
"@polkadot/ui-keyring": "^3.11.2",
"@polkadot/ui-settings": "^3.11.2",
"@polkadot/util": "^13.2.2",
"@polkadot/util-crypto": "^13.2.2",
"chart.js": "^4.4.1",
"chartjs-plugin-annotation": "^3.0.1",
"chartjs-plugin-crosshair": "^2.0.0",

View File

@ -16,8 +16,8 @@
"type": "module",
"version": "0.145.2-12-x",
"dependencies": {
"@polkadot/hw-ledger": "^13.1.1",
"@polkadot/hw-ledger-transports": "^13.1.1",
"@polkadot/hw-ledger": "^13.2.2",
"@polkadot/hw-ledger-transports": "^13.2.2",
"is-ipfs": "^8.0.1"
},
"peerDependencies": {

View File

@ -87,6 +87,8 @@ function getValRewards (api: ApiPromise, validatorEras: ValidatorWithEras[], era
allRewards[stashId].push({
era,
eraReward: eraRewards.eraReward,
// Place holder for https://github.com/polkadot-js/apps/pull/11035
isClaimed: false,
isEmpty: false,
isValidator: true,
nominating: [],

View File

@ -16,8 +16,8 @@
"type": "module",
"version": "0.145.2-12-x",
"dependencies": {
"@polkadot-api/merkleize-metadata": "^1.1.7",
"@polkadot/hw-ledger": "^13.1.1",
"@polkadot-api/merkleize-metadata": "^1.1.9",
"@polkadot/hw-ledger": "^13.2.2",
"@polkadot/react-components": "^0.145.2-12-x"
},
"peerDependencies": {

View File

@ -20,7 +20,7 @@
"testcontainers": "^10.4.0"
},
"devDependencies": {
"@polkadot/types-support": "14.0.1",
"@polkadot/types-support": "14.2.1",
"@testing-library/jest-dom": "^5.17.0",
"tsconfig-paths": "^4.2.0"
},

View File

@ -1,17 +1,22 @@
// Copyright 2017-2024 @polkadot/test-support authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Registry } from '@polkadot/types/types';
import { ApiPromise, WsProvider } from '@polkadot/api';
import { Metadata, TypeRegistry } from '@polkadot/types';
import metaStatic from '@polkadot/types-support/metadata/static-substrate';
export function createAugmentedApi (): ApiPromise {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, metaStatic);
// FIXME - ref: https://github.com/polkadot-js/apps/pull/11051
// Adding support for CJS and ESM correctly has caused some build issues.
// This is a hacky type cast to allow the compiler to be happy.
const metadata = new Metadata(registry as unknown as Registry, metaStatic);
registry.setMetadata(metadata);
const api = new ApiPromise({ provider: new WsProvider('ws://', false), registry });
const api = new ApiPromise({ provider: new WsProvider('ws://', false), registry: registry as unknown as Registry });
// eslint-disable-next-line deprecation/deprecation
api.injectMetadata(metadata, true);

View File

@ -1,8 +1,13 @@
// Copyright 2017-2024 @polkadot/test-supports authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Registry } from '@polkadot/types/types';
import { TypeRegistry, u128 as U128 } from '@polkadot/types';
export function balanceOf (number: number | string): U128 {
return new U128(new TypeRegistry(), number);
// FIXME - ref: https://github.com/polkadot-js/apps/pull/11051
// Adding support for CJS and ESM correctly has caused some build issues.
// This is a hacky type cast to allow the compiler to be happy.
return new U128(new TypeRegistry() as unknown as Registry, number);
}

927
yarn.lock

File diff suppressed because it is too large Load Diff