Adjust UI to cater for latest API (#5945)
* Adjust UI to cater for latest API * Bump deps * berry 3.0.1 * types-support import * Add @polkadot/types-support
This commit is contained in:
parent
e1f5673747
commit
39c559f99b
591
.yarn/releases/yarn-3.0.0-rc.2.cjs
vendored
591
.yarn/releases/yarn-3.0.0-rc.2.cjs
vendored
File diff suppressed because one or more lines are too long
631
.yarn/releases/yarn-3.0.1.cjs
vendored
Executable file
631
.yarn/releases/yarn-3.0.1.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
@ -10,4 +10,4 @@ plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
|
||||
spec: "@yarnpkg/plugin-version"
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.0.0-rc.2.cjs
|
||||
yarnPath: .yarn/releases/yarn-3.0.1.cjs
|
||||
|
||||
25
package.json
25
package.json
@ -12,15 +12,17 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^5.3.1",
|
||||
"@polkadot/api-contract": "^5.3.1",
|
||||
"@polkadot/hw-ledger": "^7.1.1",
|
||||
"@polkadot/keyring": "^7.1.1",
|
||||
"@polkadot/networks": "^7.1.1",
|
||||
"@polkadot/phishing": "^0.6.248",
|
||||
"@polkadot/types": "^5.3.1",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"@polkadot/util-crypto": "^7.1.1",
|
||||
"@polkadot/api": "^5.4.2-6",
|
||||
"@polkadot/api-contract": "^5.4.2-6",
|
||||
"@polkadot/hw-ledger": "^7.1.3-3",
|
||||
"@polkadot/keyring": "^7.1.3-3",
|
||||
"@polkadot/networks": "^7.1.3-3",
|
||||
"@polkadot/phishing": "^0.6.253",
|
||||
"@polkadot/types": "^5.4.2-6",
|
||||
"@polkadot/types-known": "^5.4.2-6",
|
||||
"@polkadot/types-support": "^5.4.2-6",
|
||||
"@polkadot/util": "^7.1.3-3",
|
||||
"@polkadot/util-crypto": "^7.1.3-3",
|
||||
"@polkadot/wasm-crypto": "^4.1.2",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"styled-components": "^5.2.0",
|
||||
@ -72,7 +74,7 @@
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@crustio/crust-pin": "^0.0.1",
|
||||
"@pinata/sdk": "^1.1.23",
|
||||
"@polkadot/dev": "^0.62.57",
|
||||
"@polkadot/dev": "^0.62.59",
|
||||
"@polkadot/ts": "^0.4.4",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"@types/chart.js": "^2.9.34",
|
||||
@ -102,5 +104,6 @@
|
||||
"stylelint-config-styled-components": "^0.1.1",
|
||||
"webpack": "^5.42.0",
|
||||
"webpack-cli": "^4.7.2"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@3.0.1"
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
"@kiltprotocol/type-definitions": "0.1.10",
|
||||
"@laminar/type-definitions": "0.3.1",
|
||||
"@phala/typedefs": "0.2.14",
|
||||
"@polkadot/networks": "^7.1.1",
|
||||
"@polkadot/networks": "^7.1.3-3",
|
||||
"@polymathnetwork/polymesh-types": "0.0.2",
|
||||
"@snowfork/snowbridge-types": "0.2.5",
|
||||
"@sora-substrate/type-definitions": "1.4.1",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.14.8",
|
||||
"@babel/polyfill": "^7.12.1",
|
||||
"@polkadot/dev": "^0.62.57",
|
||||
"@polkadot/dev": "^0.62.59",
|
||||
"@polkadot/react-components": "^0.95.2-10",
|
||||
"electron-log": "^4.3.5",
|
||||
"electron-updater": "^4.3.10"
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/apps-config": "^0.95.2-10",
|
||||
"@polkadot/apps-routing": "^0.95.2-10",
|
||||
"@polkadot/dev": "^0.62.57",
|
||||
"@polkadot/dev": "^0.62.59",
|
||||
"@polkadot/react-api": "^0.95.2-10",
|
||||
"@polkadot/react-components": "^0.95.2-10",
|
||||
"@polkadot/react-hooks": "^0.95.2-10",
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/phishing": "^0.6.248",
|
||||
"@polkadot/phishing": "^0.6.253",
|
||||
"@polkadot/react-components": "^0.95.2-10",
|
||||
"@polkadot/vanitygen": "^0.44.1",
|
||||
"detect-browser": "^5.2.0",
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/api-contract": "^5.3.1"
|
||||
"@polkadot/api-contract": "^5.4.2-6"
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/api": "^5.3.1",
|
||||
"@polkadot/api": "^5.4.2-6",
|
||||
"@polkadot/extension-dapp": "^0.39.2",
|
||||
"@substrate/connect": "^0.3.16",
|
||||
"fflate": "^0.7.1",
|
||||
|
||||
@ -9,15 +9,15 @@
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.35",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||
"@polkadot/keyring": "^7.1.1",
|
||||
"@polkadot/keyring": "^7.1.3-3",
|
||||
"@polkadot/react-api": "^0.95.2-10",
|
||||
"@polkadot/react-identicon": "^0.84.3",
|
||||
"@polkadot/react-qr": "^0.84.3",
|
||||
"@polkadot/react-identicon": "^0.84.4-1",
|
||||
"@polkadot/react-qr": "^0.84.4-1",
|
||||
"@polkadot/react-query": "^0.95.2-10",
|
||||
"@polkadot/ui-keyring": "^0.84.3",
|
||||
"@polkadot/ui-settings": "^0.84.3",
|
||||
"@polkadot/util": "^7.1.1",
|
||||
"@polkadot/util-crypto": "^7.1.1",
|
||||
"@polkadot/ui-keyring": "^0.84.4-1",
|
||||
"@polkadot/ui-settings": "^0.84.4-1",
|
||||
"@polkadot/util": "^7.1.3-3",
|
||||
"@polkadot/util-crypto": "^7.1.3-3",
|
||||
"chart.js": "^2.9.4",
|
||||
"codeflask": "^1.4.1",
|
||||
"i18next": "^19.9.2",
|
||||
|
||||
@ -7,7 +7,6 @@ import type { Props } from '../types';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
|
||||
import { Input, InputNumber } from '@polkadot/react-components';
|
||||
import { ClassOf } from '@polkadot/types/create';
|
||||
import { bnToBn, formatNumber, isUndefined } from '@polkadot/util';
|
||||
|
||||
import Bare from './Bare';
|
||||
@ -15,7 +14,7 @@ import Bare from './Bare';
|
||||
function Amount ({ className = '', defaultValue: { value }, isDisabled, isError, label, onChange, onEnter, registry, type, withLabel }: Props): React.ReactElement<Props> {
|
||||
const defaultValue = useMemo(
|
||||
() => isDisabled
|
||||
? value instanceof ClassOf(registry, 'AccountIndex')
|
||||
? value instanceof registry.createClass('AccountIndex')
|
||||
? value.toString()
|
||||
: formatNumber(value as number)
|
||||
: bnToBn((value as number) || 0).toString(),
|
||||
|
||||
@ -6,7 +6,6 @@ import type { Props } from '../types';
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
import { Dropdown } from '@polkadot/react-components';
|
||||
import { ClassOf } from '@polkadot/types/create';
|
||||
import { bnToBn } from '@polkadot/util';
|
||||
|
||||
import Bare from './Bare';
|
||||
@ -35,7 +34,7 @@ function VoteThresholdParam ({ className = '', defaultValue: { value }, isDisabl
|
||||
[onChange]
|
||||
);
|
||||
|
||||
const defaultValue = value instanceof ClassOf(registry, 'VoteThreshold')
|
||||
const defaultValue = value instanceof registry.createClass('VoteThreshold')
|
||||
? value.toNumber()
|
||||
: bnToBn(value as number).toNumber();
|
||||
|
||||
|
||||
@ -7,8 +7,6 @@ import type { QueueTxMessageSetStatus, QueueTxPayloadAdd, QueueTxStatus } from '
|
||||
import type { Hash } from '@polkadot/types/interfaces';
|
||||
import type { Registry, SignerPayloadJSON } from '@polkadot/types/types';
|
||||
|
||||
import { ClassOf } from '@polkadot/types/create';
|
||||
|
||||
export default class ApiSigner implements Signer {
|
||||
readonly #queuePayload: QueueTxPayloadAdd;
|
||||
readonly #queueSetTxStatus: QueueTxMessageSetStatus;
|
||||
@ -33,7 +31,7 @@ export default class ApiSigner implements Signer {
|
||||
}
|
||||
|
||||
public update (id: number, result: Hash | SubmittableResult): void {
|
||||
if (result instanceof ClassOf(this.#registry, 'Hash')) {
|
||||
if (result instanceof this.#registry.createClass('Hash')) {
|
||||
this.#queueSetTxStatus(id, 'sent', result.toHex());
|
||||
} else {
|
||||
this.#queueSetTxStatus(id, result.status.type.toLowerCase() as QueueTxStatus, status);
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
"testcontainers": "^7.18.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types-support": "^5.4.2-6",
|
||||
"@testing-library/jest-dom": "^5.14.1",
|
||||
"tsconfig-paths": "^3.10.1"
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
import { ApiPromise, WsProvider } from '@polkadot/api';
|
||||
import { Metadata, TypeRegistry } from '@polkadot/types';
|
||||
import metaStatic from '@polkadot/types/metadata/static-substrate';
|
||||
import metaStatic from '@polkadot/types-support/metadata/static-substrate';
|
||||
|
||||
export function createAugmentedApi (): ApiPromise {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user