Skip to content

Commit

Permalink
Update all PJS deps (#11051)
Browse files Browse the repository at this point in the history
* Update all PJS deps

* Fix type issue with candidate

* Fix compatibility with new CJS and ESM targettting
  • Loading branch information
TarikGul authored Nov 4, 2024
1 parent dde8de4 commit f403bd4
Show file tree
Hide file tree
Showing 17 changed files with 546 additions and 523 deletions.
54 changes: 27 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
22 changes: 11 additions & 11 deletions packages/apps-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions packages/apps-config/src/api/spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,18 @@ 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,
neatcoin,
neuroweb,
nexus: hyperbridge,
nftmart,
'node-moonbeam': moonbeam,
'node-moonbeam': moonbeam as OverrideBundleDefinition,
'node-polkadex': polkadex,
'nodle-chain': nodle,
oak,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/api/spec/polymesh-mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion packages/apps-config/src/api/spec/polymesh-testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
8 changes: 4 additions & 4 deletions packages/page-accounts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/page-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions packages/page-parachains/src/Overview/useEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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()] = {
Expand Down
8 changes: 4 additions & 4 deletions packages/react-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
14 changes: 7 additions & 7 deletions packages/react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions packages/react-hooks/src/useOwnEraRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down
4 changes: 2 additions & 2 deletions packages/react-signer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion packages/test-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
9 changes: 7 additions & 2 deletions packages/test-support/src/api/createAugmentedApi.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
7 changes: 6 additions & 1 deletion packages/test-support/src/creation/balance.ts
Original file line number Diff line number Diff line change
@@ -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);
}
Loading

0 comments on commit f403bd4

Please sign in to comment.