* Bump API

* Adjust for networks
This commit is contained in:
Jaco Greeff 2021-02-08 09:13:22 +01:00 committed by GitHub
parent 0fdb6d95ce
commit 90ec5de731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 1176 additions and 1091 deletions

View File

@ -12,17 +12,17 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^3.7.4-6",
"@polkadot/api-contract": "^3.7.4-6",
"@polkadot/hw-ledger": "^5.5.3-1",
"@polkadot/keyring": "^5.5.3-1",
"@polkadot/networks": "^5.5.3-1",
"@polkadot/phishing": "^0.4.24",
"@polkadot/types": "^3.7.4-6",
"@polkadot/util": "^5.5.3-1",
"@polkadot/util-crypto": "^5.5.3-1",
"@polkadot/api": "^3.8.1",
"@polkadot/api-contract": "^3.8.1",
"@polkadot/hw-ledger": "^5.6.1",
"@polkadot/keyring": "^5.6.1",
"@polkadot/networks": "^5.6.1",
"@polkadot/phishing": "^0.4.26",
"@polkadot/types": "^3.8.1",
"@polkadot/util": "^5.6.1",
"@polkadot/util-crypto": "^5.6.1",
"@polkadot/wasm-crypto": "^3.2.2",
"@polkadot/x-rxjs": "^5.5.3-1",
"@polkadot/x-rxjs": "^5.6.1",
"babel-core": "^7.0.0-bridge.0",
"styled-components": "^5.2.0",
"typescript": "^4.1.3"
@ -68,7 +68,7 @@
"@babel/register": "^7.12.10",
"@babel/runtime": "^7.12.5",
"@pinata/sdk": "^1.1.11",
"@polkadot/dev": "^0.61.24",
"@polkadot/dev": "^0.61.25",
"@polkadot/ts": "^0.3.59",
"@types/bn.js": "^4.11.6",
"@types/chart.js": "^2.9.30",

View File

@ -14,7 +14,7 @@
"@edgeware/node-types": "^3.3.1",
"@interlay/polkabtc-types": "^0.3.4",
"@laminar/type-definitions": "^0.2.0-beta.143",
"@polkadot/networks": "^5.5.3-1",
"@polkadot/networks": "^5.6.1",
"@sora-substrate/type-definitions": "^0.3.7",
"@subsocial/types": "^0.4.29",
"moonbeam-types-bundle": "^1.1.4"

View File

@ -2,10 +2,19 @@
// SPDX-License-Identifier: Apache-2.0
import type { TFunction } from 'i18next';
import type { Network } from '@polkadot/networks/types';
import type { Option } from './types';
import known from '@polkadot/networks';
interface NetworkNamed extends Network {
network: string;
}
const networks = known
.filter((n): n is NetworkNamed => !!n.network)
.map(({ displayName, network, prefix }) => ({ info: network, text: displayName, value: prefix }));
// Definitions here are with the following values -
// info: the name of a logo as defined in ../logos, specifically in namedLogos
// text: The text you wish to display in the dropdown
@ -18,10 +27,6 @@ export function createSs58 (t: TFunction): Option[] {
text: t('ss58.default', 'Default for the connected node', { ns: 'apps-config' }),
value: -1
},
...known.map(({ displayName, network, prefix }): Option => ({
info: network,
text: displayName,
value: prefix
}))
...networks
];
}

View File

@ -6,7 +6,7 @@
"dependencies": {
"@babel/core": "^7.12.10",
"@babel/polyfill": "^7.12.1",
"@polkadot/dev": "^0.61.24",
"@polkadot/dev": "^0.61.25",
"@polkadot/react-components": "^0.78.2-42",
"electron-log": "^4.3.1",
"electron-updater": "^4.3.7"

View File

@ -16,7 +16,7 @@
"@babel/runtime": "^7.12.5",
"@polkadot/apps-config": "^0.78.2-42",
"@polkadot/apps-routing": "^0.78.2-42",
"@polkadot/dev": "^0.61.24",
"@polkadot/dev": "^0.61.25",
"@polkadot/react-api": "^0.78.2-42",
"@polkadot/react-components": "^0.78.2-42",
"@polkadot/react-hooks": "^0.78.2-42",

View File

@ -10,9 +10,9 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/phishing": "^0.4.24",
"@polkadot/phishing": "^0.4.26",
"@polkadot/react-components": "^0.78.2-42",
"@polkadot/vanitygen": "^0.27.1",
"@polkadot/vanitygen": "^0.28.1",
"detect-browser": "^5.2.0",
"file-saver": "^2.0.5"
},

View File

@ -10,6 +10,6 @@
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api-contract": "^3.7.4-6"
"@polkadot/api-contract": "^3.8.1"
}
}

View File

@ -15,9 +15,9 @@
"homepage": "https://github.com/polkadot-js/apps/tree/master/packages/react-api#readme",
"dependencies": {
"@babel/runtime": "^7.12.5",
"@polkadot/api": "^3.7.4-6",
"@polkadot/api": "^3.8.1",
"@polkadot/extension-dapp": "^0.36.2-17",
"@polkadot/x-rxjs": "^5.5.3-1",
"@polkadot/x-rxjs": "^5.6.1",
"fflate": "^0.6.1"
}
}

View File

@ -12,15 +12,15 @@
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/react-fontawesome": "^0.1.14",
"@polkadot/keyring": "^5.5.3-1",
"@polkadot/keyring": "^5.6.1",
"@polkadot/react-api": "^0.78.2-42",
"@polkadot/react-identicon": "^0.68.1",
"@polkadot/react-qr": "^0.68.1",
"@polkadot/react-identicon": "^0.69.1",
"@polkadot/react-qr": "^0.69.1",
"@polkadot/react-query": "^0.78.2-42",
"@polkadot/ui-keyring": "^0.68.1",
"@polkadot/ui-settings": "^0.68.1",
"@polkadot/util": "^5.5.3-1",
"@polkadot/util-crypto": "^5.5.3-1",
"@polkadot/ui-keyring": "^0.69.1",
"@polkadot/ui-settings": "^0.69.1",
"@polkadot/util": "^5.6.1",
"@polkadot/util-crypto": "^5.6.1",
"chart.js": "^2.9.4",
"codeflask": "^1.4.1",
"i18next": "^19.8.5",

View File

@ -3,6 +3,7 @@
import type { ApiPromise } from '@polkadot/api';
import type { LedgerTypes } from '@polkadot/hw-ledger/types';
import type { Network } from '@polkadot/networks/types';
import { useCallback, useMemo } from 'react';
@ -22,14 +23,18 @@ interface State extends StateBase {
getLedger: () => Ledger;
}
interface NetworkNamed extends Network {
network: string;
}
const EMPTY_STATE: StateBase = {
isLedgerCapable: false,
isLedgerEnabled: false
};
const hasWebUsb = !!(window as unknown as { USB?: unknown }).USB;
const ledgerChains = networks.filter((n): n is NetworkNamed => !!(n.hasLedgerSupport && n.network));
let ledger: Ledger | null = null;
const ledgerChains = networks.filter((network) => network.hasLedgerSupport);
function retrieveLedger (api: ApiPromise): Ledger {
if (!ledger) {

2193
yarn.lock

File diff suppressed because it is too large Load Diff