diff --git a/package.json b/package.json index 5edbf99e3ff6..6ef961701cb9 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "packages/*" ], "resolutions": { - "@polkadot/api": "^0.97.0-beta.16", - "@polkadot/api-contract": "^0.97.0-beta.16", + "@polkadot/api": "^0.97.0-beta.19", + "@polkadot/api-contract": "^0.97.0-beta.19", "@polkadot/keyring": "^1.7.0-beta.7", - "@polkadot/types": "^0.97.0-beta.16", + "@polkadot/types": "^0.97.0-beta.19", "@polkadot/util": "^1.7.0-beta.7", "@polkadot/util-crypto": "^1.7.0-beta.7", "babel-core": "^7.0.0-bridge.0", diff --git a/packages/app-accounts/package.json b/packages/app-accounts/package.json index 0eb697688a11..f86cc91516b0 100644 --- a/packages/app-accounts/package.json +++ b/packages/app-accounts/package.json @@ -12,7 +12,7 @@ "dependencies": { "@babel/runtime": "^7.7.2", "@polkadot/react-components": "^0.37.0-beta.109", - "@polkadot/react-qr": "^0.47.0-beta.6", + "@polkadot/react-qr": "^0.47.0-beta.7", "@types/file-saver": "^2.0.0", "@types/yargs": "^13.0.2", "babel-plugin-module-resolver": "^3.1.1", diff --git a/packages/app-claims/src/util.ts b/packages/app-claims/src/util.ts index 2e1bffe2c64f..d6b4b89fb79f 100644 --- a/packages/app-claims/src/util.ts +++ b/packages/app-claims/src/util.ts @@ -6,6 +6,7 @@ import { EthereumAddress, EcdsaSignature } from '@polkadot/types/interfaces'; import secp256k1 from 'secp256k1/elliptic'; +import { registry } from '@polkadot/react-api'; import { createType } from '@polkadot/types'; import { assert, hexToU8a, stringToU8a, u8aToBuffer, u8aConcat } from '@polkadot/util'; import { keccakAsHex, keccakAsU8a } from '@polkadot/util-crypto'; @@ -96,8 +97,8 @@ export function recoverFromJSON (signatureJson: string | null): RecoveredSignatu return { error: null, - ethereumAddress: createType('EthereumAddress', recoverAddress(msg, parts)), - signature: createType('EcdsaSignature', u8aConcat(parts.signature, new Uint8Array([parts.recovery]))) + ethereumAddress: createType(registry, 'EthereumAddress', recoverAddress(msg, parts)), + signature: createType(registry, 'EcdsaSignature', u8aConcat(parts.signature, new Uint8Array([parts.recovery]))) }; } catch (error) { console.error(error); diff --git a/packages/app-contracts/package.json b/packages/app-contracts/package.json index 8543177753f9..ae58981e1c56 100644 --- a/packages/app-contracts/package.json +++ b/packages/app-contracts/package.json @@ -11,7 +11,7 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.7.2", - "@polkadot/api-contract": "^0.97.0-beta.16", + "@polkadot/api-contract": "^0.97.0-beta.19", "@polkadot/react-components": "^0.37.0-beta.109" } } diff --git a/packages/app-contracts/src/ABI.tsx b/packages/app-contracts/src/ABI.tsx index 8c0f3345d22b..2a75f5f96be3 100644 --- a/packages/app-contracts/src/ABI.tsx +++ b/packages/app-contracts/src/ABI.tsx @@ -7,6 +7,7 @@ import { I18nProps } from '@polkadot/react-components/types'; import React from 'react'; import styled from 'styled-components'; import { Abi } from '@polkadot/api-contract'; +import { registry } from '@polkadot/react-api'; import { InputFile, Labelled, Messages } from '@polkadot/react-components'; import { u8aToString } from '@polkadot/util'; @@ -154,7 +155,7 @@ class ABI extends React.PureComponent { throw new Error(t('You are using an ABI with an outdated format. Please generate a new one.')); } - const contractAbi = new Abi(abi); + const contractAbi = new Abi(registry, abi); this.setState({ contractAbi, diff --git a/packages/app-contracts/src/Codes/Add.tsx b/packages/app-contracts/src/Codes/Add.tsx index 0a6dfdb27861..e17eb6b3152c 100644 --- a/packages/app-contracts/src/Codes/Add.tsx +++ b/packages/app-contracts/src/Codes/Add.tsx @@ -4,6 +4,7 @@ import React from 'react'; import { createType } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { Button, Input } from '@polkadot/react-components'; import ContractModal, { ContractModalProps as Props, ContractModalState } from '../Modal'; @@ -93,7 +94,7 @@ class Add extends ContractModal { this.setState({ isBusy: true }, (): void => { store - .saveCode(createType('Hash', codeHash), { abi, name, tags }) + .saveCode(createType(registry, 'Hash', codeHash), { abi, name, tags }) .then((): void => { this.setState( { isBusy: false }, diff --git a/packages/app-contracts/src/store.ts b/packages/app-contracts/src/store.ts index faf6a5c119ba..39e30128f8e2 100644 --- a/packages/app-contracts/src/store.ts +++ b/packages/app-contracts/src/store.ts @@ -8,8 +8,8 @@ import { CodeJson, CodeStored } from './types'; import EventEmitter from 'eventemitter3'; import store from 'store'; import { Abi } from '@polkadot/api-contract'; +import { api, registry } from '@polkadot/react-api'; import { createType } from '@polkadot/types'; -import { api } from '@polkadot/react-api'; const KEY_CODE = 'code:'; @@ -30,7 +30,7 @@ class Store extends EventEmitter { // eslint-disable-next-line @typescript-eslint/require-await public async saveCode (codeHash: string | Hash, partial: Partial): Promise { - const hex = (typeof codeHash === 'string' ? createType('Hash', codeHash) : codeHash).toHex(); + const hex = (typeof codeHash === 'string' ? createType(registry, 'Hash', codeHash) : codeHash).toHex(); const existing = this.getCode(hex); @@ -78,7 +78,7 @@ class Store extends EventEmitter { this.allCode[json.codeHash] = { json, contractAbi: abi - ? new Abi(abi) + ? new Abi(registry, abi) : undefined }; diff --git a/packages/app-council/src/Motions/Propose.tsx b/packages/app-council/src/Motions/Propose.tsx index 13ece235acf8..ecdd529d51d5 100644 --- a/packages/app-council/src/Motions/Propose.tsx +++ b/packages/app-council/src/Motions/Propose.tsx @@ -7,10 +7,10 @@ import { Call, Proposal } from '@polkadot/types/interfaces'; import BN from 'bn.js'; import React from 'react'; -import { createType } from '@polkadot/types'; +import { withCalls, withMulti, registry } from '@polkadot/react-api'; import { Button, Extrinsic, InputNumber } from '@polkadot/react-components'; import TxModal, { TxModalState, TxModalProps } from '@polkadot/react-components/TxModal'; -import { withCalls, withMulti } from '@polkadot/react-api'; +import { createType } from '@polkadot/types'; import translate from '../translate'; @@ -54,7 +54,7 @@ class Propose extends TxModal { return [ threshold, - ...(method ? [createType('Proposal', method)] : []) + ...(method ? [createType(registry, 'Proposal', method)] : []) ]; } diff --git a/packages/app-council/src/Overview/Vote.tsx b/packages/app-council/src/Overview/Vote.tsx index 7ca1dab78924..9830bd3aaf30 100644 --- a/packages/app-council/src/Overview/Vote.tsx +++ b/packages/app-council/src/Overview/Vote.tsx @@ -12,7 +12,7 @@ import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; import { createType } from '@polkadot/types'; -import { withCalls, withMulti } from '@polkadot/react-api'; +import { registry, withCalls, withMulti } from '@polkadot/react-api'; import { AddressMini, Button, Toggle } from '@polkadot/react-components'; import TxModal, { TxModalState, TxModalProps } from '@polkadot/react-components/TxModal'; @@ -141,7 +141,7 @@ class Vote extends TxModal { approvals ? approvals.slice(0, 1 + approvals.lastIndexOf(true)) : [], - createType('VoteIndex', voteCount), + createType(registry, 'VoteIndex', voteCount), voterPositions && accountId && voterPositions[accountId] ? voterPositions[accountId].setIndex : nextVoterSet || null diff --git a/packages/app-council/src/Overview/index.tsx b/packages/app-council/src/Overview/index.tsx index e8f16b050c59..ef8e3abb497e 100644 --- a/packages/app-council/src/Overview/index.tsx +++ b/packages/app-council/src/Overview/index.tsx @@ -7,7 +7,7 @@ import { BlockNumber } from '@polkadot/types/interfaces'; import { ComponentProps } from './types'; import React from 'react'; -import { withCalls } from '@polkadot/react-api'; +import { withCalls, registry } from '@polkadot/react-api'; import { Button } from '@polkadot/react-components'; import { createType } from '@polkadot/types'; @@ -22,11 +22,11 @@ interface Props extends ComponentProps { const NULL_INFO: DerivedElectionsInfo = { candidates: [], - candidateCount: createType('u32'), - desiredSeats: createType('u32'), + candidateCount: createType(registry, 'u32'), + desiredSeats: createType(registry, 'u32'), members: [], runnersUp: [], - termDuration: createType('BlockNumber') + termDuration: createType(registry, 'BlockNumber') }; function Overview ({ bestNumber, electionsInfo = NULL_INFO }: Props): React.ReactElement { diff --git a/packages/app-democracy/src/Overview/Propose.tsx b/packages/app-democracy/src/Overview/Propose.tsx index 09ca196080ef..c93924aff72f 100644 --- a/packages/app-democracy/src/Overview/Propose.tsx +++ b/packages/app-democracy/src/Overview/Propose.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { createType } from '@polkadot/types'; import { Button, Extrinsic, InputBalance } from '@polkadot/react-components'; import TxModal, { TxModalState, TxModalProps } from '@polkadot/react-components/TxModal'; -import { withApi, withMulti } from '@polkadot/react-api'; +import { registry, withApi, withMulti } from '@polkadot/react-api'; import translate from '../translate'; @@ -36,7 +36,7 @@ class Propose extends TxModal { protected txParams = (): [Call, BN] => { const { value, method } = this.state; - return [createType('Proposal', method || undefined), value]; + return [createType(registry, 'Proposal', method || undefined), value]; } protected isDisabled = (): boolean => { diff --git a/packages/app-explorer/src/BlockInfo/Extrinsics.tsx b/packages/app-explorer/src/BlockInfo/Extrinsics.tsx index 19e5f2e0368a..d6d4340480c2 100644 --- a/packages/app-explorer/src/BlockInfo/Extrinsics.tsx +++ b/packages/app-explorer/src/BlockInfo/Extrinsics.tsx @@ -7,7 +7,7 @@ import { I18nProps } from '@polkadot/react-components/types'; import React from 'react'; import styled from 'styled-components'; -import { GenericCall } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { AddressMini, Call, Column, LinkPolkascan } from '@polkadot/react-components'; import { formatNumber } from '@polkadot/util'; @@ -41,7 +41,7 @@ function renderExtrinsic (props: Props): (_: Extrinsic, __: number) => React.Rea const { blockNumber, t } = props; return function ExplorerExtrinsic (extrinsic: Extrinsic, index: number): React.ReactNode { - const { meta, method, section } = GenericCall.findFunction(extrinsic.callIndex); + const { meta, method, section } = registry.findMetaCall(extrinsic.callIndex); const isMortal = extrinsic.era.isMortalEra; let eraEnd; let eraStart; diff --git a/packages/app-settings/src/Developer.tsx b/packages/app-settings/src/Developer.tsx index b60fe27e867c..e83bbe3339a5 100644 --- a/packages/app-settings/src/Developer.tsx +++ b/packages/app-settings/src/Developer.tsx @@ -7,7 +7,7 @@ import { AppProps, I18nProps } from '@polkadot/react-components/types'; import React, { useEffect, useState } from 'react'; import store from 'store'; import styled from 'styled-components'; -import { getTypeRegistry } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { Button, Editor, InputFile } from '@polkadot/react-components'; import { isJsonObject, stringToU8a, u8aToString } from '@polkadot/util'; @@ -96,7 +96,7 @@ function Developer ({ className, onStatusChange, t }: Props): React.ReactElement }; const _saveDeveloper = (): void => { try { - getTypeRegistry().register(types); + registry.register(types); store.set('types', types); setIsTypesValid(true); onStatusChange({ diff --git a/packages/app-staking/src/useSessionRewards.tsx b/packages/app-staking/src/useSessionRewards.tsx index 41221c1cb55d..3cc928fea602 100644 --- a/packages/app-staking/src/useSessionRewards.tsx +++ b/packages/app-staking/src/useSessionRewards.tsx @@ -8,6 +8,7 @@ import { Slash, SessionRewards } from '@polkadot/react-hooks/types'; import BN from 'bn.js'; import { useEffect, useState } from 'react'; import { ApiPromise } from '@polkadot/api'; +import { registry } from '@polkadot/react-api'; import { useApi, useCacheKey } from '@polkadot/react-hooks'; import { createType } from '@polkadot/types'; import { bnMax, u8aToU8a } from '@polkadot/util'; @@ -28,14 +29,14 @@ interface Serialized { function fromJSON (sessions: Serialized[]): SessionRewards[] { return sessions.map(({ blockHash, blockNumber, isEventsEmpty, reward, sessionIndex, slashes }): SessionRewards => ({ - blockHash: createType('Hash', blockHash), - blockNumber: createType('BlockNumber', blockNumber), + blockHash: createType(registry, 'Hash', blockHash), + blockNumber: createType(registry, 'BlockNumber', blockNumber), isEventsEmpty, - reward: createType('Balance', reward), - sessionIndex: createType('SessionIndex', sessionIndex), + reward: createType(registry, 'Balance', reward), + sessionIndex: createType(registry, 'SessionIndex', sessionIndex), slashes: slashes.map(({ accountId, amount }): Slash => ({ - accountId: createType('AccountId', accountId), - amount: createType('Balance', amount) + accountId: createType(registry, 'AccountId', accountId), + amount: createType(registry, 'Balance', amount) })) })); } @@ -104,8 +105,8 @@ async function loadSome (api: ApiPromise, fromHash: Hash, toHash: Hash): Promise blockHash: headers[index].hash, blockNumber: headers[index].number.unwrap(), isEventsEmpty: events[index].length === 0, - reward: rewards[index] || createType('Balance'), - sessionIndex: createType('SessionIndex', u8aToU8a( + reward: rewards[index] || createType(registry, 'Balance'), + sessionIndex: createType(registry, 'SessionIndex', u8aToU8a( value.isSome ? value.unwrap() : new Uint8Array([]) )), slashes: slashes[index] @@ -124,8 +125,10 @@ export default function useSessionRewards (maxSessions: number): SessionRewards[ api.isReady.then(async (): Promise => { const maxSessionsStore = maxSessions + 1; // assuming first is a bust const sessionLength = api.consts.babe?.epochDuration || new BN(500); - const count = Math.min(sessionLength.muln(maxSessionsStore).divn(10).toNumber(), 10000); + const eraLength = api.consts.staking.sessionsPerEra.toNumber(); + const count = Math.min(sessionLength.muln(maxSessionsStore).divn(10).toNumber(), 7500); const bestHeader = await api.rpc.chain.getHeader(); + let retrieved = 0; let toHash = bestHeader.hash; let toNumber = bestHeader.number.unwrap().toBn(); let fromHash = api.genesisHash; @@ -136,6 +139,7 @@ export default function useSessionRewards (maxSessions: number): SessionRewards[ const newQueue = await loadSome(api, fromHash, toHash); + retrieved += newQueue.length; workQueue = mergeResults(workQueue, newQueue); toHash = fromHash; toNumber = fromNumber; @@ -146,7 +150,8 @@ export default function useSessionRewards (maxSessions: number): SessionRewards[ const lastNumber = workQueue[workQueue.length - 1]?.blockNumber; - if (!lastNumber || fromNumber.eqn(1) || ((workQueue.length >= maxSessionsStore) && fromNumber.lt(lastNumber))) { + // we always want to retrieve at least 1 era worth of information, or we are at the start + if (!lastNumber || fromNumber.eqn(1) || (retrieved > eraLength && (workQueue.length >= maxSessionsStore) && fromNumber.lt(lastNumber))) { break; } } diff --git a/packages/app-sudo/src/Sudo.tsx b/packages/app-sudo/src/Sudo.tsx index e919ec30cf18..e20b0fcc0cd3 100644 --- a/packages/app-sudo/src/Sudo.tsx +++ b/packages/app-sudo/src/Sudo.tsx @@ -10,7 +10,7 @@ import { ComponentProps } from './types'; import React from 'react'; import { createType } from '@polkadot/types'; import { Button, Icon, Extrinsic, TxButton, TxComponent } from '@polkadot/react-components'; -import { withApi, withMulti } from '@polkadot/react-api'; +import { registry, withApi, withMulti } from '@polkadot/react-api'; import translate from './translate'; @@ -50,7 +50,7 @@ class Propose extends TxComponent { icon='sign-in' tx='sudo.sudo' isDisabled={!method || !isValid} - params={method ? [createType('Proposal', method)] : []} + params={method ? [createType(registry, 'Proposal', method)] : []} ref={this.button} /> diff --git a/packages/apps/package.json b/packages/apps/package.json index 3babb26e3303..fabdc7e06f56 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -16,7 +16,7 @@ "@babel/runtime": "^7.7.2", "@polkadot/react-components": "^0.37.0-beta.109", "@polkadot/react-signer": "^0.37.0-beta.109", - "@polkadot/ui-assets": "^0.47.0-beta.6", + "@polkadot/ui-assets": "^0.47.0-beta.7", "query-string": "^6.8.3" } } diff --git a/packages/apps/src/index.tsx b/packages/apps/src/index.tsx index 9c184bfe07a0..2145ff4d173b 100644 --- a/packages/apps/src/index.tsx +++ b/packages/apps/src/index.tsx @@ -14,8 +14,7 @@ import ReactDOM from 'react-dom'; import { HashRouter } from 'react-router-dom'; import store from 'store'; import { ThemeProvider } from 'styled-components'; -import { getTypeRegistry } from '@polkadot/types'; -import { Api } from '@polkadot/react-api'; +import { Api, registry } from '@polkadot/react-api'; import { QueueConsumer } from '@polkadot/react-components/Status/Context'; import Queue from '@polkadot/react-components/Status/Queue'; import { BlockAuthors, Events } from '@polkadot/react-query'; @@ -46,7 +45,7 @@ try { const names = Object.keys(types); if (names.length) { - getTypeRegistry().register(types); + registry.register(types); console.log('Type registration:', names.join(', ')); } } catch (error) { diff --git a/packages/react-api/package.json b/packages/react-api/package.json index c2dc6f23e910..39a262f527e7 100644 --- a/packages/react-api/package.json +++ b/packages/react-api/package.json @@ -31,7 +31,7 @@ "homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme", "dependencies": { "@babel/runtime": "^7.7.2", - "@polkadot/api": "^0.97.0-beta.16", + "@polkadot/api": "^0.97.0-beta.19", "@polkadot/extension-dapp": "^0.14.0-beta.5", "edgeware-node-types": "^1.0.10", "rxjs-compat": "^6.5.3" diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index 82464f81ce6b..df667e334919 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -22,6 +22,7 @@ import addressDefaults from '@polkadot/util-crypto/address/defaults'; import typesChain from './overrides/chain'; import typesSpec from './overrides/spec'; import ApiContext from './ApiContext'; +import registry from './typeRegistry'; interface Props { children: React.ReactNode; @@ -42,8 +43,8 @@ interface InjectedAccountExt { }; } -const DEFAULT_DECIMALS = new U32(12); -const DEFAULT_SS58 = new U32(addressDefaults.prefix); +const DEFAULT_DECIMALS = new U32(registry, 12); +const DEFAULT_SS58 = new U32(registry, addressDefaults.prefix); const injectedPromise = web3Enable('polkadot-js/apps'); let api: ApiPromise; @@ -85,6 +86,7 @@ export default class Api extends React.PureComponent { private createApi (provider: ProviderInterface, signer: ApiSigner): ApiPromise { return new ApiPromise({ provider, + registry, signer, typesChain, typesSpec diff --git a/packages/react-api/src/index.ts b/packages/react-api/src/index.ts index 501442373791..6477f498674c 100644 --- a/packages/react-api/src/index.ts +++ b/packages/react-api/src/index.ts @@ -4,6 +4,7 @@ import Api, { api } from './Api'; import ApiContext from './ApiContext'; +import registry from './typeRegistry'; export * from './ledger'; export * from './with'; @@ -11,5 +12,6 @@ export * from './with'; export { api, Api, - ApiContext + ApiContext, + registry }; diff --git a/packages/react-api/src/overrides/spec/edgeware-node-types/dist/identity.ts b/packages/react-api/src/overrides/spec/edgeware-node-types/dist/identity.ts new file mode 100644 index 000000000000..3315442fb8c2 --- /dev/null +++ b/packages/react-api/src/overrides/spec/edgeware-node-types/dist/identity.ts @@ -0,0 +1,88 @@ +/* eslint-disable */ +import { Bytes, Text, u32, Null } from '@polkadot/types'; +import { Option, Struct, Enum } from '@polkadot/types/codec'; +import { Registry } from '@polkadot/types/types'; +import AccountId from '@polkadot/types/primitive/Generic/AccountId'; + +export class MetadataRecord extends Struct { + constructor (registry: Registry, value: any) { + super(registry, { + avatar: Text, + display_name: Text, + tagline: Text, + }, value); + } + get avatar (): Text { + return this.get('avatar') as Text; + } + get display_name (): Text { + return this.get('display_name') as Text; + } + get tagline (): Text { + return this.get('tagline') as Text; + } +} + +export class Registered extends Null { } +export class Attested extends Null { } +export class Verified extends Null { } + +export class IdentityStage extends Enum { + constructor (registry: Registry, value?: string, index?: number) { + super(registry, { + registered: Registered, + attested: Attested, + verified: Verified, + }, value, index); + } +} + +export class IdentityRecord extends Struct { + constructor (registry: Registry, value: any) { + super(registry, { + account: AccountId, + identity_type: Text, + identity: Bytes, + stage: IdentityStage, + expiration_time: u32, + proof: Option.with(Text), + metadata: Option.with(MetadataRecord), + }, value); + } + get account (): AccountId { + return this.get('account') as AccountId; + } + get identity (): Bytes { + return this.get('identity') as Bytes; + } + get stage (): IdentityStage { + return this.get('stage') as IdentityStage; + } + get expiration_time(): u32 { + return this.get('expiration_time') as u32; + } + get proof (): Option { + return this.get('proof') as Option; + } + get metadata (): Option { + return this.get('metadata') as Option; + } +} + +// Old types that aren't used anymore (kept for backwards compatability) +const ArchivedTypes = { + IdentityIndex: u32, + Claim: Bytes, +}; + +// Current types +const CurrentTypes = { + IdentityStage, + IdentityRecord, + MetadataRecord, + IdentityType: Text, + Attestation: Bytes, + Identity: Bytes, +}; + +export const IdentityTypes = { ...ArchivedTypes, ...CurrentTypes }; diff --git a/packages/react-api/src/overrides/spec/edgeware-node-types/dist/signaling.ts b/packages/react-api/src/overrides/spec/edgeware-node-types/dist/signaling.ts new file mode 100644 index 000000000000..ff4d7ef40ac1 --- /dev/null +++ b/packages/react-api/src/overrides/spec/edgeware-node-types/dist/signaling.ts @@ -0,0 +1,52 @@ +/* eslint-disable */ +import { u32, Text, u64, Bytes } from '@polkadot/types'; +import { Struct } from '@polkadot/types/codec'; +import { Registry } from '@polkadot/types/types'; +import { VotingTypes, VoteStage } from './voting'; +import AccountId from '@polkadot/types/primitive/Generic/AccountId'; + +export class ProposalRecord extends Struct { + constructor (registry: Registry, value: any) { + super(registry, { + index: u32, + author: AccountId, + stage: VoteStage, + transition_time: u32, + title: Text, + contents: Text, + vote_id: u64, + }, value); + } + get index (): u32 { + return this.get('index') as u32; + } + get author (): AccountId { + return this.get('author') as AccountId; + } + get stage (): VoteStage { + return this.get('stage') as VoteStage; + } + get transition_time (): u32 { + return this.get('transition_time') as u32; + } + get title () : Text { + return this.get('title') as Text; + } + get contents () : Text { + return this.get('contents') as Text; + } + get vote_id () : u64 { + return this.get('vote_id') as u64; + } +} + +export const SignalingTypes = { + PreVoting: VotingTypes.PreVoting, + Voting: VotingTypes.Voting, + Completed: VotingTypes.Completed, + Commit: VotingTypes.Commit, + VoteStage, + ProposalRecord, + ProposalContents: Bytes, + ProposalTitle: Bytes, +}; diff --git a/packages/react-api/src/overrides/spec/edgeware-node-types/dist/treasuryReward.ts b/packages/react-api/src/overrides/spec/edgeware-node-types/dist/treasuryReward.ts new file mode 100644 index 000000000000..7e88d6cb46ff --- /dev/null +++ b/packages/react-api/src/overrides/spec/edgeware-node-types/dist/treasuryReward.ts @@ -0,0 +1,8 @@ +/* eslint-disable */ +import { u128 } from '@polkadot/types'; + +export class Balance2 extends u128 { } + +export const TreasuryRewardTypes = { + Balance2 +}; diff --git a/packages/react-api/src/overrides/spec/edgeware-node-types/dist/voting.ts b/packages/react-api/src/overrides/spec/edgeware-node-types/dist/voting.ts new file mode 100644 index 000000000000..3643d4c6cae5 --- /dev/null +++ b/packages/react-api/src/overrides/spec/edgeware-node-types/dist/voting.ts @@ -0,0 +1,132 @@ +/* eslint-disable */ +import { Null, bool, u64, Enum, Struct, Vec, Tuple, Option, u128 } from '@polkadot/types'; +import U8aFixed from '@polkadot/types/codec/U8aFixed'; +import { AnyU8a, Registry } from '@polkadot/types/types'; +import AccountId from '@polkadot/types/primitive/Generic/AccountId'; + +export class PreVoting extends Null { } +export class Commit extends Null { } +export class Voting extends Null { } +export class Completed extends Null { } + +export class VoteStage extends Enum { + constructor (registry: Registry, value?: string, index?: number) { + super(registry, { + prevoting: PreVoting, + commit: Commit, + voting: Voting, + completed: Completed, + }, value, index); + } +} + +export class Binary extends Null { } +export class MultiOption extends Null { } +export class RankedChoice extends Null { } + +export class VoteType extends Enum { + constructor (registry: Registry, value?: string, index?: number) { + super(registry, { + binary: Binary, + multioption: MultiOption, + rankedchoice: RankedChoice, + }, value, index); + } +} + +export class OnePerson extends Null { } +export class OneCoin extends Null { } + +export class TallyType extends Enum { + constructor (registry: Registry, value?: string, index?: number) { + super(registry, { + oneperson: OnePerson, + onecoin: OneCoin, + }, value, index); + } +} + +export class VoteOutcome extends U8aFixed { + constructor (registry: Registry, value?: AnyU8a) { + super(registry, value, 256); + } +} + +export class Tally extends Option.with(Vec.with(Tuple.with([VoteOutcome, u128]))) { } + +export class VoteData extends Struct { + constructor (registry: Registry, value: any) { + super(registry, { + initiator: AccountId, + stage: VoteStage, + vote_type: VoteType, + tally_type: TallyType, + is_commit_reveal: bool, + }, value); + } + get initiator (): AccountId { + return this.get('initiator') as AccountId; + } + get stage (): VoteStage { + return this.get('stage') as VoteStage; + } + get vote_type (): VoteType { + return this.get('vote_type') as VoteType; + } + get tally_type (): TallyType { + return this.get('tally_type') as TallyType; + } + get is_commit_reveal (): bool { + return this.get('is_commit_reveal') as bool; + } +} + +export class Commitments extends Vec.with(Tuple.with([AccountId, VoteOutcome])) { } +export class Reveals extends Vec.with(Tuple.with([AccountId, Vec.with(VoteOutcome)])) { } + +export class VoteRecord extends Struct { + constructor (registry: Registry, value: any) { + super(registry, { + id: u64, + commitments: Commitments, + reveals: Reveals, + data: VoteData, + outcomes: Vec.with(VoteOutcome), + }, value); + } + get id (): u64 { + return this.get('id') as u64; + } + get commitments (): Commitments { + return this.get('commits') as Commitments; + } + get reveals (): Reveals { + return this.get('reveals') as Reveals; + } + get data () : VoteData { + return this.get('data') as VoteData; + } + get outcomes () : Vec { + return this.get('outcomes') as Vec; + } +} + +export const VotingTypes = { + PreVoting, + Commit, + Voting, + Completed, + VoteStage, + Binary, + MultiOption, + VoteType, + OnePerson, + OneCoin, + TallyType, + VoteOutcome, + Tally, + VoteData, + VoteRecord, + 'voting::VoteType': VoteType, + 'voting::TallyType': TallyType, +}; diff --git a/packages/react-api/src/overrides/spec/edgeware.ts b/packages/react-api/src/overrides/spec/edgeware.ts index 4137ec49a4e9..2801c602d0cc 100644 --- a/packages/react-api/src/overrides/spec/edgeware.ts +++ b/packages/react-api/src/overrides/spec/edgeware.ts @@ -2,10 +2,10 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { IdentityTypes } from 'edgeware-node-types/dist/identity'; -import { SignalingTypes } from 'edgeware-node-types/dist/signaling'; -import { TreasuryRewardTypes } from 'edgeware-node-types/dist/treasuryReward'; -import { VotingTypes } from 'edgeware-node-types/dist/voting'; +import { IdentityTypes } from './edgeware-node-types/dist/identity'; +import { SignalingTypes } from './edgeware-node-types/dist/signaling'; +import { TreasuryRewardTypes } from './edgeware-node-types/dist/treasuryReward'; +import { VotingTypes } from './edgeware-node-types/dist/voting'; export default { ...IdentityTypes, diff --git a/packages/react-api/src/typeRegistry.ts b/packages/react-api/src/typeRegistry.ts new file mode 100644 index 000000000000..c25d35ab0f16 --- /dev/null +++ b/packages/react-api/src/typeRegistry.ts @@ -0,0 +1,9 @@ +// Copyright 2017-2019 @polkadot/react-api authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { TypeRegistry } from '@polkadot/types'; + +const registry = new TypeRegistry(); + +export default registry; diff --git a/packages/react-components/package.json b/packages/react-components/package.json index ddd8f2647acb..7b1b26c3ebea 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -13,10 +13,10 @@ "@babel/runtime": "^7.7.2", "@polkadot/keyring": "^1.7.0-beta.7", "@polkadot/react-api": "^0.37.0-beta.109", - "@polkadot/react-identicon": "^0.47.0-beta.6", + "@polkadot/react-identicon": "^0.47.0-beta.7", "@polkadot/react-query": "^0.37.0-beta.109", - "@polkadot/ui-keyring": "^0.47.0-beta.6", - "@polkadot/ui-settings": "^0.47.0-beta.6", + "@polkadot/ui-keyring": "^0.47.0-beta.7", + "@polkadot/ui-settings": "^0.47.0-beta.7", "@types/chart.js": "^2.8.10", "@types/i18next": "^13.0.0", "@types/react-copy-to-clipboard": "^4.3.0", diff --git a/packages/react-components/src/CodeRow.tsx b/packages/react-components/src/CodeRow.tsx index 62d503b7d586..8180278155d3 100644 --- a/packages/react-components/src/CodeRow.tsx +++ b/packages/react-components/src/CodeRow.tsx @@ -9,7 +9,7 @@ import { CodeStored } from '@polkadot/app-contracts/types'; import React from 'react'; import styled from 'styled-components'; import { createType } from '@polkadot/types'; -import { withMulti } from '@polkadot/react-api'; +import { registry, withMulti } from '@polkadot/react-api'; import { classes, toShortAddress } from '@polkadot/react-components/util'; import contracts from '@polkadot/app-contracts/store'; @@ -191,7 +191,7 @@ class CodeRow extends Row { // Save only if the name was changed or if it's no empty. if (trimmedName && codeHash) { - await contracts.saveCode(createType('Hash', codeHash), { name }); + await contracts.saveCode(createType(registry, 'Hash', codeHash), { name }); this.setState({ isEditingName: false }); } @@ -201,7 +201,7 @@ class CodeRow extends Row { const { codeHash, tags } = this.state; if (codeHash) { - await contracts.saveCode(createType('Hash', codeHash), { tags }); + await contracts.saveCode(createType(registry, 'Hash', codeHash), { tags }); this.setState({ isEditingTags: false }); } diff --git a/packages/react-components/src/Params/Proposal.tsx b/packages/react-components/src/Params/Proposal.tsx index a5b0015f91e5..f6ee995e4e8d 100644 --- a/packages/react-components/src/Params/Proposal.tsx +++ b/packages/react-components/src/Params/Proposal.tsx @@ -6,6 +6,7 @@ import { Props, RawParam } from '@polkadot/react-params/types'; import React from 'react'; import { createType } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { useApi } from '@polkadot/react-hooks'; import ExtrinsicDisplay from './Extrinsic'; @@ -15,7 +16,7 @@ function onChange ({ onChange }: Props): (_: RawParam) => void { let proposal = null; if (isValid && value) { - proposal = createType('Proposal', value); + proposal = createType(registry, 'Proposal', value); } onChange && onChange({ diff --git a/packages/react-components/src/ProposedAction.tsx b/packages/react-components/src/ProposedAction.tsx index 136a10885e88..87067ef1217a 100644 --- a/packages/react-components/src/ProposedAction.tsx +++ b/packages/react-components/src/ProposedAction.tsx @@ -7,7 +7,7 @@ import { Proposal } from '@polkadot/types/interfaces'; import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; -import { GenericCall } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { formatNumber } from '@polkadot/util'; import Call from './Call'; @@ -52,7 +52,7 @@ function ProposedAction (props: Props): React.ReactElement { ); } - const { meta, method, section } = GenericCall.findFunction(proposal.callIndex); + const { meta, method, section } = registry.findMetaCall(proposal.callIndex); const header = `#${idNumber}: ${section}.${method}`; const documentation = (meta && meta.documentation) diff --git a/packages/react-components/src/Status/Queue.tsx b/packages/react-components/src/Status/Queue.tsx index 8ba7f4c77c66..526d8ab615b6 100644 --- a/packages/react-components/src/Status/Queue.tsx +++ b/packages/react-components/src/Status/Queue.tsx @@ -2,17 +2,18 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { SignerPayloadJSON } from '@polkadot/types/types'; import { BareProps } from '../types'; import { ActionStatus, PartialQueueTxExtrinsic, PartialQueueTxRpc, QueueStatus, QueueTx, QueueTxExtrinsic, QueueTxRpc, QueueTxStatus, SignerCallback } from './types'; import React, { useRef, useState } from 'react'; +import { SubmittableResult } from '@polkadot/api'; +import { registry } from '@polkadot/react-api'; import jsonrpc from '@polkadot/jsonrpc'; import { createType } from '@polkadot/types'; import { QueueProvider } from './Context'; -import { SubmittableResult } from '@polkadot/api'; -import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { STATUS_COMPLETE } from './constants'; export interface Props extends BareProps { @@ -91,8 +92,8 @@ export default function Queue ({ children }: Props): React.ReactElement { addToTxQueue({ accountId: payload.address, // this is not great, but the Extrinsic we don't need a submittable - extrinsic: createType('Extrinsic', - { method: createType('Call', payload.method) }, + extrinsic: createType(registry, 'Extrinsic', + { method: createType(registry, 'Call', payload.method) }, { version: payload.version } ) as unknown as SubmittableExtrinsic, payload, diff --git a/packages/react-components/src/Status/QueueFunc.tsx b/packages/react-components/src/Status/QueueFunc.tsx index 20f0ee6a71a3..581745fc9b20 100644 --- a/packages/react-components/src/Status/QueueFunc.tsx +++ b/packages/react-components/src/Status/QueueFunc.tsx @@ -2,17 +2,18 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; import { SignerPayloadJSON } from '@polkadot/types/types'; import { BareProps } from '../types'; import { ActionStatus, PartialQueueTxExtrinsic, PartialQueueTxRpc, QueueStatus, QueueTx, QueueTxExtrinsic, QueueTxRpc, QueueTxStatus, SignerCallback } from './types'; import React, { useRef, useState } from 'react'; +import { SubmittableResult } from '@polkadot/api'; import jsonrpc from '@polkadot/jsonrpc'; +import { registry } from '@polkadot/react-api'; import { createType } from '@polkadot/types'; import { QueueProvider } from './Context'; -import { SubmittableResult } from '@polkadot/api'; -import { SubmittableExtrinsic } from '@polkadot/api/promise/types'; export interface Props extends BareProps { children: React.ReactNode; @@ -95,8 +96,8 @@ export default function Queue ({ children }: Props): React.ReactElement { _addToTxQueue.current({ accountId: payload.address, // this is not great, but the Extrinsic we don't need a submittable - extrinsic: createType('Extrinsic', - { method: createType('Call', payload.method) }, + extrinsic: createType(registry, 'Extrinsic', + { method: createType(registry, 'Call', payload.method) }, { version: payload.version } ) as unknown as SubmittableExtrinsic, payload, diff --git a/packages/react-components/src/Status/index.tsx b/packages/react-components/src/Status/index.tsx index ff8523072f85..63f12f1ad408 100644 --- a/packages/react-components/src/Status/index.tsx +++ b/packages/react-components/src/Status/index.tsx @@ -7,7 +7,7 @@ import { QueueStatus, QueueTx, QueueTxStatus } from './types'; import React from 'react'; import styled from 'styled-components'; -import { GenericCall } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import AddressMini from '../AddressMini'; import Button from '../Button'; @@ -104,7 +104,7 @@ function renderItem ({ id, extrinsic, error, removeItem, rpc, status }: QueueTx) let { method, section } = rpc; if (extrinsic) { - const found = GenericCall.findFunction(extrinsic.callIndex); + const found = registry.findMetaCall(extrinsic.callIndex); if (found.section !== 'unknown') { method = found.method; diff --git a/packages/react-components/src/util/getContractAbi.ts b/packages/react-components/src/util/getContractAbi.ts index 3590cf6cd3cb..1a160c2bbe6e 100644 --- a/packages/react-components/src/util/getContractAbi.ts +++ b/packages/react-components/src/util/getContractAbi.ts @@ -3,6 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import { Abi } from '@polkadot/api-contract'; +import { registry } from '@polkadot/react-api'; import getAddressMeta from './getAddressMeta'; @@ -16,7 +17,7 @@ export default function getContractAbi (address: string | null): Abi | null { try { const data = meta.contract && JSON.parse(meta.contract.abi); - abi = new Abi(data); + abi = new Abi(registry, data); } catch (error) { // invalid address, maybe } diff --git a/packages/react-components/src/util/isTreasuryProposalVote.ts b/packages/react-components/src/util/isTreasuryProposalVote.ts index 501328164786..7e489b0c2e02 100644 --- a/packages/react-components/src/util/isTreasuryProposalVote.ts +++ b/packages/react-components/src/util/isTreasuryProposalVote.ts @@ -3,14 +3,15 @@ // of the Apache-2.0 license. See the LICENSE file for details. import { Proposal } from '@polkadot/types/interfaces'; -import { GenericCall } from '@polkadot/types'; + +import { registry } from '@polkadot/react-api'; export default function isTreasuryProposalVote (proposal?: Proposal | null): boolean { if (!proposal) { return false; } - const { method, section } = GenericCall.findFunction(proposal.callIndex); + const { method, section } = registry.findMetaCall(proposal.callIndex); return section === 'treasury' && ['approveProposal', 'rejectProposal'].includes(method) && diff --git a/packages/react-params/src/Param/Amount.tsx b/packages/react-params/src/Param/Amount.tsx index b776f3cea546..8681ae08ca86 100644 --- a/packages/react-params/src/Param/Amount.tsx +++ b/packages/react-params/src/Param/Amount.tsx @@ -6,8 +6,9 @@ import { Props } from '../types'; import BN from 'bn.js'; import React from 'react'; -import { ClassOf } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { Input } from '@polkadot/react-components'; +import { ClassOf } from '@polkadot/types'; import { bnToBn, formatNumber } from '@polkadot/util'; import Bare from './Bare'; @@ -25,7 +26,7 @@ export default function Amount (props: Props): React.ReactElement { const { className, defaultValue: { value }, isDisabled, isError, label, onEnter, style, withLabel } = props; const defaultValue = isDisabled ? ( - value instanceof ClassOf('AccountIndex') + value instanceof ClassOf(registry, 'AccountIndex') ? value.toString() : formatNumber(value) ) diff --git a/packages/react-params/src/Param/Enum.tsx b/packages/react-params/src/Param/Enum.tsx index 2d7a61a20373..3865b7c88e13 100644 --- a/packages/react-params/src/Param/Enum.tsx +++ b/packages/react-params/src/Param/Enum.tsx @@ -6,8 +6,9 @@ import { TypeDef } from '@polkadot/types/types'; import { ParamDef, Props, RawParam } from '../types'; import React, { useEffect, useState } from 'react'; -import { Enum, createType, getTypeDef } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { Dropdown } from '@polkadot/react-components'; +import { Enum, createType, getTypeDef } from '@polkadot/types'; import Params from '../'; import Bare from './Bare'; @@ -25,7 +26,7 @@ export default function EnumParam (props: Props): React.ReactElement { const [{ options, subTypes }, setOptions] = useState<{ options: Option[]; subTypes: TypeDef[] }>({ options: [], subTypes: [] }); useEffect((): void => { - const rawType = createType(type.type as any).toRawType(); + const rawType = createType(registry, type.type as any).toRawType(); const typeDef = getTypeDef(rawType); const subTypes = typeDef.sub as TypeDef[]; diff --git a/packages/react-params/src/Param/Proposal.tsx b/packages/react-params/src/Param/Proposal.tsx index 59a18c936ead..6f239fe5d570 100644 --- a/packages/react-params/src/Param/Proposal.tsx +++ b/packages/react-params/src/Param/Proposal.tsx @@ -6,7 +6,7 @@ import { Extrinsic } from '@polkadot/types/interfaces'; import { Props } from '../types'; import React from 'react'; -import { GenericCall } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { Call, Static } from '@polkadot/react-components'; import { classes } from '@polkadot/react-components/util'; @@ -23,7 +23,7 @@ export default function Proposal (props: Props): React.ReactElement { } const proposal = value as Extrinsic; - const { method, section } = GenericCall.findFunction(proposal.callIndex); + const { method, section } = registry.findMetaCall(proposal.callIndex); return ( diff --git a/packages/react-params/src/Param/Struct.tsx b/packages/react-params/src/Param/Struct.tsx index 34f5b482c321..a4da4bd1e699 100644 --- a/packages/react-params/src/Param/Struct.tsx +++ b/packages/react-params/src/Param/Struct.tsx @@ -6,6 +6,7 @@ import { TypeDef } from '@polkadot/types/types'; import { ParamDef, Props, RawParam } from '../types'; import React, { useEffect, useState } from 'react'; +import { registry } from '@polkadot/react-api'; import { createType, getTypeDef } from '@polkadot/types'; import Params from '../'; @@ -17,7 +18,7 @@ export default function StructParam (props: Props): React.ReactElement { const [params, setParams] = useState([]); useEffect((): void => { - const rawType = createType(type.type as any).toRawType(); + const rawType = createType(registry, type.type as any).toRawType(); const typeDef = getTypeDef(rawType); setParams((typeDef.sub as TypeDef[]).map((type): ParamDef => ({ name: type.name, type }))); diff --git a/packages/react-params/src/Param/Tuple.tsx b/packages/react-params/src/Param/Tuple.tsx index 31f072aa7c1f..b31f5f5fa611 100644 --- a/packages/react-params/src/Param/Tuple.tsx +++ b/packages/react-params/src/Param/Tuple.tsx @@ -6,6 +6,7 @@ import { TypeDef } from '@polkadot/types/types'; import { ParamDef, Props, RawParam } from '../types'; import React, { useEffect, useState } from 'react'; +import { registry } from '@polkadot/react-api'; import { createType, getTypeDef } from '@polkadot/types'; import Params from '../'; @@ -17,7 +18,7 @@ export default function Tuple (props: Props): React.ReactElement { const { className, isDisabled, label, onChange, style, type, withLabel } = props; useEffect((): void => { - const rawType = createType(type.type as any).toRawType(); + const rawType = createType(registry, type.type as any).toRawType(); const typeDef = getTypeDef(rawType); setParams((typeDef.sub as TypeDef[]).map((type): ParamDef => ({ name: type.name, type }))); diff --git a/packages/react-params/src/Param/VoteThreshold.tsx b/packages/react-params/src/Param/VoteThreshold.tsx index dee874cc9ea8..9bbfaf08bd5f 100644 --- a/packages/react-params/src/Param/VoteThreshold.tsx +++ b/packages/react-params/src/Param/VoteThreshold.tsx @@ -6,6 +6,7 @@ import { Props } from '../types'; import React from 'react'; import { ClassOf } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { Dropdown } from '@polkadot/react-components'; import { bnToBn } from '@polkadot/util'; @@ -36,7 +37,7 @@ function onChange ({ onChange }: Props): (_: number) => void { export default function VoteThresholdParam (props: Props): React.ReactElement { const { className, defaultValue: { value }, isDisabled, isError, label, style, withLabel } = props; - const defaultValue = value instanceof ClassOf('VoteThreshold') + const defaultValue = value instanceof ClassOf(registry, 'VoteThreshold') ? value.toNumber() : bnToBn(value as number).toNumber(); diff --git a/packages/react-params/src/Param/findComponent.ts b/packages/react-params/src/Param/findComponent.ts index f36b999ac5e6..9035d24e4f0e 100644 --- a/packages/react-params/src/Param/findComponent.ts +++ b/packages/react-params/src/Param/findComponent.ts @@ -6,6 +6,7 @@ import { TypeDef, TypeDefInfo } from '@polkadot/types/types'; import { Props, ComponentMap } from '../types'; import BN from 'bn.js'; +import { registry } from '@polkadot/react-api'; import { createType, getTypeDef } from '@polkadot/types'; import Account from './Account'; @@ -110,7 +111,7 @@ export default function findComponent (def: TypeDef, overrides: ComponentMap = { if (!Component) { try { - const instance = createType(type as any); + const instance = createType(registry, type as any); const raw = getTypeDef(instance.toRawType()); Component = findOne(raw.type); diff --git a/packages/react-params/src/initValue.ts b/packages/react-params/src/initValue.ts index 8578f2f521c6..2e23a120f265 100644 --- a/packages/react-params/src/initValue.ts +++ b/packages/react-params/src/initValue.ts @@ -6,6 +6,7 @@ import { TypeDef, TypeDefInfo } from '@polkadot/types/types'; import { RawParamValue } from './types'; import BN from 'bn.js'; +import { registry } from '@polkadot/react-api'; import { Bytes, U8a, createType, getTypeDef } from '@polkadot/types'; export default function getInitValue (def: TypeDef): RawParamValue | RawParamValue[] { @@ -76,17 +77,17 @@ export default function getInitValue (def: TypeDef): RawParamValue | RawParamVal return 0; case 'Bytes': - return new Bytes(); + return new Bytes(registry); case 'CodeHash': case 'Hash': - return createType('Hash'); + return createType(registry, 'Hash'); case 'H256': - return createType('H256'); + return createType(registry, 'H256'); case 'H512': - return createType('H512'); + return createType(registry, 'H512'); case 'Data': case 'Keys': @@ -109,14 +110,14 @@ export default function getInitValue (def: TypeDef): RawParamValue | RawParamVal return undefined; case 'Extrinsic': - return new U8a(); + return new U8a(registry); case 'Null': return null; default: { try { - const instance = createType(type as any); + const instance = createType(registry, type as any); const raw = getTypeDef(instance.toRawType()); if (instance instanceof BN) { diff --git a/packages/react-signer/package.json b/packages/react-signer/package.json index 5615682310d9..83d27b5bac1e 100644 --- a/packages/react-signer/package.json +++ b/packages/react-signer/package.json @@ -12,6 +12,6 @@ "dependencies": { "@babel/runtime": "^7.7.2", "@polkadot/react-components": "^0.37.0-beta.109", - "@polkadot/react-qr": "^0.47.0-beta.6" + "@polkadot/react-qr": "^0.47.0-beta.7" } } diff --git a/packages/react-signer/src/ApiSigner.ts b/packages/react-signer/src/ApiSigner.ts index d7287902cda3..5500b9aceb65 100644 --- a/packages/react-signer/src/ApiSigner.ts +++ b/packages/react-signer/src/ApiSigner.ts @@ -8,6 +8,7 @@ import { QueueTxPayloadAdd, QueueTxMessageSetStatus, QueueTxStatus } from '@polk import { Hash } from '@polkadot/types/interfaces'; import { SignerPayloadJSON } from '@polkadot/types/types'; +import { registry } from '@polkadot/react-api'; import { ClassOf } from '@polkadot/types'; export default class ApiSigner implements Signer { @@ -33,7 +34,7 @@ export default class ApiSigner implements Signer { } public update (id: number, result: Hash | SubmittableResult): void { - if (result instanceof ClassOf('Hash')) { + if (result instanceof ClassOf(registry, 'Hash')) { this._queueSetTxStatus(id, 'sent', result.toHex()); } else { this._queueSetTxStatus(id, result.status.type.toLowerCase() as QueueTxStatus, status); diff --git a/packages/react-signer/src/Checks/constants.ts b/packages/react-signer/src/Checks/constants.ts index e3187aa57bd0..60c1986363ad 100644 --- a/packages/react-signer/src/Checks/constants.ts +++ b/packages/react-signer/src/Checks/constants.ts @@ -5,28 +5,29 @@ import { DerivedFees, DerivedBalances, DerivedContractFees } from '@polkadot/api-derive/types'; import BN from 'bn.js'; +import { registry } from '@polkadot/react-api'; import { createType } from '@polkadot/types'; const ZERO_BALANCE: DerivedBalances = { - accountId: createType('AccountId'), - accountNonce: createType('Index'), - availableBalance: createType('Balance'), - freeBalance: createType('Balance'), + accountId: createType(registry, 'AccountId'), + accountNonce: createType(registry, 'Index'), + availableBalance: createType(registry, 'Balance'), + freeBalance: createType(registry, 'Balance'), isVesting: false, - lockedBalance: createType('Balance'), + lockedBalance: createType(registry, 'Balance'), lockedBreakdown: [], - reservedBalance: createType('Balance'), - vestedBalance: createType('Balance'), - vestingTotal: createType('Balance'), - votingBalance: createType('Balance') + reservedBalance: createType(registry, 'Balance'), + vestedBalance: createType(registry, 'Balance'), + vestingTotal: createType(registry, 'Balance'), + votingBalance: createType(registry, 'Balance') }; const ZERO_FEES_BALANCES: DerivedFees = { - creationFee: createType('Balance'), - existentialDeposit: createType('Balance'), - transactionBaseFee: createType('Balance'), - transactionByteFee: createType('Balance'), - transferFee: createType('Balance') + creationFee: createType(registry, 'Balance'), + existentialDeposit: createType(registry, 'Balance'), + transactionBaseFee: createType(registry, 'Balance'), + transactionByteFee: createType(registry, 'Balance'), + transferFee: createType(registry, 'Balance') }; const ZERO_FEES = ZERO_FEES_BALANCES; diff --git a/packages/react-signer/src/LedgerSigner.ts b/packages/react-signer/src/LedgerSigner.ts index 8f4e84f95c14..2ba74c9c4bc5 100644 --- a/packages/react-signer/src/LedgerSigner.ts +++ b/packages/react-signer/src/LedgerSigner.ts @@ -5,12 +5,12 @@ import { Signer, SignerResult } from '@polkadot/api/types'; import { SignerPayloadJSON } from '@polkadot/types/types'; -import { getLedger } from '@polkadot/react-api'; +import { getLedger, registry } from '@polkadot/react-api'; import { createType } from '@polkadot/types'; export class LedgerSigner implements Signer { public async signPayload (payload: SignerPayloadJSON): Promise { - const raw = createType('ExtrinsicPayload', payload, { version: payload.version }); + const raw = createType(registry, 'ExtrinsicPayload', payload, { version: payload.version }); const { signature } = await getLedger().sign(raw.toU8a(true)); return { id: 0, signature }; diff --git a/packages/react-signer/src/Modal.tsx b/packages/react-signer/src/Modal.tsx index 7a70c257820b..47ab6734de82 100644 --- a/packages/react-signer/src/Modal.tsx +++ b/packages/react-signer/src/Modal.tsx @@ -18,7 +18,7 @@ import { SubmittableResult } from '@polkadot/api'; import { web3FromSource } from '@polkadot/extension-dapp'; import { createType } from '@polkadot/types'; import { Button, InputBalance, Modal, Toggle } from '@polkadot/react-components'; -import { withApi, withMulti, withObservable } from '@polkadot/react-api'; +import { registry, withApi, withMulti, withObservable } from '@polkadot/react-api'; import keyring from '@polkadot/ui-keyring'; import { assert, isFunction } from '@polkadot/util'; import { format } from '@polkadot/util/logger'; @@ -85,7 +85,7 @@ function extractExternal (accountId?: string | null): { isExternal: boolean; isH async function makeExtrinsicSignature (payload: SignerPayloadJSON, { id, signerCb }: QueueTx, pair: KeyringPair): Promise { console.log('makeExtrinsicSignature: payload ::', JSON.stringify(payload)); - const result = createType('ExtrinsicPayload', payload, { version: payload.version }).sign(pair); + const result = createType(registry, 'ExtrinsicPayload', payload, { version: payload.version }).sign(pair); if (isFunction(signerCb)) { signerCb(id, { id, ...result }); @@ -425,7 +425,7 @@ class Signer extends React.PureComponent { this.setState({ isQrVisible: true, qrAddress: payload.address, - qrPayload: createType('ExtrinsicPayload', payload, { version: payload.version }).toU8a(), + qrPayload: createType(registry, 'ExtrinsicPayload', payload, { version: payload.version }).toU8a(), qrResolve: resolve, qrReject: reject }); diff --git a/packages/react-signer/src/Transaction.tsx b/packages/react-signer/src/Transaction.tsx index 5fefe1a42e72..bc458628f8db 100644 --- a/packages/react-signer/src/Transaction.tsx +++ b/packages/react-signer/src/Transaction.tsx @@ -7,7 +7,7 @@ import { QueueTx } from '@polkadot/react-components/Status/types'; import BN from 'bn.js'; import React from 'react'; -import { GenericCall } from '@polkadot/types'; +import { registry } from '@polkadot/react-api'; import { Call, InputAddress, Modal } from '@polkadot/react-components'; import Checks from './Checks'; @@ -26,7 +26,7 @@ function Transaction ({ children, hideDetails, isSendable, value: { accountId, e return null; } - const { meta, method, section } = GenericCall.findFunction(extrinsic.callIndex); + const { meta, method, section } = registry.findMetaCall(extrinsic.callIndex); return ( <> diff --git a/yarn.lock b/yarn.lock index 2fd357a2ea5c..edcb23999e06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2029,35 +2029,35 @@ dependencies: "@types/node" ">= 8" -"@polkadot/api-contract@^0.97.0-beta.16": - version "0.97.0-beta.16" - resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-0.97.0-beta.16.tgz#197db6025e400ccbeed8719dfeaacbb92421e4aa" - integrity sha512-lTBYwONrR8SSusEWHo6BE/nA0DAQIFcIPuZjXXRrDzDoBMEY2uSY7pt4p4S8eB3x8qRnd25ceKWGob7NToOXEA== +"@polkadot/api-contract@^0.97.0-beta.19": + version "0.97.0-beta.19" + resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-0.97.0-beta.19.tgz#0c51b210b923db9aba9736a0ab4290b920ed549e" + integrity sha512-CCwmZA/6fWV5OHWSdopRkTWAnBg7A3zDZhN0TSRLGTlv/txlLqQDm7xxblCaOLS3rd8We4adcixQRSmtDUSqFQ== dependencies: "@babel/runtime" "^7.7.2" - "@polkadot/types" "^0.97.0-beta.16" + "@polkadot/types" "^0.97.0-beta.19" -"@polkadot/api-derive@^0.97.0-beta.16": - version "0.97.0-beta.16" - resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-0.97.0-beta.16.tgz#101088ffe8742f6333a3e7b5a09bbceacd7d3e94" - integrity sha512-Jwawmz33bKdyS7hXZkRKzclfaImiRy87J6qEre0r5NPyfSKdE+0ilAOUkdbnspbX0395mf3KQQbAAIOSVbF1nQ== +"@polkadot/api-derive@^0.97.0-beta.19": + version "0.97.0-beta.19" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-0.97.0-beta.19.tgz#db605d0186b643a58e5a659774d8a0819bc722f7" + integrity sha512-XtuLOozj62uIGnVo3nuoCcELSJdhJ9nYHSvUJiCsrdfKYCuUuQm485KkBpFIZCjV4jMJG+FuijNkBYMzeOyBvg== dependencies: "@babel/runtime" "^7.7.2" - "@polkadot/api" "^0.97.0-beta.16" - "@polkadot/types" "^0.97.0-beta.16" + "@polkadot/api" "^0.97.0-beta.19" + "@polkadot/types" "^0.97.0-beta.19" -"@polkadot/api@^0.97.0-beta.16": - version "0.97.0-beta.16" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.97.0-beta.16.tgz#34bb23c937a81fb53c60777ef19918c7aeada282" - integrity sha512-xRLU3kjXLJsW/oY8wmWCrdhPJhNt0IKEdfvzU0mPDwR8/sc6S2F7jUHJlvnRcdFmkGdiKZB1xI/pUEwzavqWfg== +"@polkadot/api@^0.97.0-beta.19": + version "0.97.0-beta.19" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.97.0-beta.19.tgz#fd48f72efaca49244383d97f3b8ccbbba10ecacb" + integrity sha512-cVZ7OsgPO9Cket61W4hipo/SnLZicvp8R9dyvv+rPVTb3RrTio3W4TzuLfcgnxVLLUk1XGGLALGqsObNaV2/7A== dependencies: "@babel/runtime" "^7.7.2" - "@polkadot/api-derive" "^0.97.0-beta.16" + "@polkadot/api-derive" "^0.97.0-beta.19" "@polkadot/keyring" "^1.7.0-beta.7" - "@polkadot/metadata" "^0.97.0-beta.16" - "@polkadot/rpc-core" "^0.97.0-beta.16" - "@polkadot/rpc-provider" "^0.97.0-beta.16" - "@polkadot/types" "^0.97.0-beta.16" + "@polkadot/metadata" "^0.97.0-beta.19" + "@polkadot/rpc-core" "^0.97.0-beta.19" + "@polkadot/rpc-provider" "^0.97.0-beta.19" + "@polkadot/types" "^0.97.0-beta.19" "@polkadot/util-crypto" "^1.7.0-beta.7" "@polkadot/dev-react@^0.32.0-beta.14": @@ -2160,10 +2160,10 @@ dependencies: "@babel/runtime" "^7.7.2" -"@polkadot/jsonrpc@^0.97.0-beta.16": - version "0.97.0-beta.16" - resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.97.0-beta.16.tgz#6f6f3f59860dd6d8250fc9f7e27cbf2ada3fcdbd" - integrity sha512-6V8vz848txVRRW3xEVlDwTtxttu+tbQVf/zlYivGWgawtrrHvmJuSlQ5v53lKG6xUEt8aJXLjYdcGEmOSSI+BQ== +"@polkadot/jsonrpc@^0.97.0-beta.19": + version "0.97.0-beta.19" + resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.97.0-beta.19.tgz#6ce60b54687649577e3a1b027c314e1e862b44eb" + integrity sha512-OHQkLlliLECwflWGHcny8QD7v/+b0boZdTjcZPVh5Y09L5AEeHqZFM11c+gMrlrWbND9nArLAtMU87kFZG1IrA== dependencies: "@babel/runtime" "^7.7.2" @@ -2176,24 +2176,24 @@ "@polkadot/util" "^1.7.0-beta.7" "@polkadot/util-crypto" "^1.7.0-beta.7" -"@polkadot/metadata@^0.97.0-beta.16": - version "0.97.0-beta.16" - resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-0.97.0-beta.16.tgz#3c15584f1fc9df71c0aac66c45895f37e11f5b80" - integrity sha512-GHjtM+tjNfetQRLCQxJfp6kydbSanCuDm3Z5bvcwpWC8XOl7MkA+CbEiuC4JN48hkprmMYSXBsd4F7y9VsGX5A== +"@polkadot/metadata@^0.97.0-beta.19": + version "0.97.0-beta.19" + resolved "https://registry.yarnpkg.com/@polkadot/metadata/-/metadata-0.97.0-beta.19.tgz#22a65c69261449d85f83febcfff58a6bfdd657e9" + integrity sha512-roMan92OdgbvLNGB8KqBw/mGT+KzflyLXY++FhL4TyTcOMUFF00URHfCR+pbcBn7vWxQmCgxFt8FjrLtPAGm9A== dependencies: "@babel/runtime" "^7.7.2" - "@polkadot/types" "^0.97.0-beta.16" + "@polkadot/types" "^0.97.0-beta.19" "@polkadot/util" "^1.7.0-beta.7" "@polkadot/util-crypto" "^1.7.0-beta.7" -"@polkadot/react-identicon@^0.47.0-beta.6": - version "0.47.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/react-identicon/-/react-identicon-0.47.0-beta.6.tgz#c17321a38465fe88ca4c2f602a16a54581f35ac8" - integrity sha512-4larvdYNETowpODzrakMrDU6p+tu7KH04IQcqjHOn3/A8p7+BugBmwTpVUSoc+n1p4fET6X0BYwWi1sc2Gn4sA== +"@polkadot/react-identicon@^0.47.0-beta.7": + version "0.47.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/react-identicon/-/react-identicon-0.47.0-beta.7.tgz#d203f4e785c15eae6585cf398d1edb2c05917f67" + integrity sha512-ZabcxseswfcanwELMMohw3ZMfYfwT201OCNurjixft3FOCiXi8enOQtj5w3wg6vQt54to2Oqo5JdgY/MUjNQig== dependencies: "@babel/runtime" "^7.7.2" - "@polkadot/ui-settings" "^0.47.0-beta.6" - "@polkadot/ui-shared" "^0.47.0-beta.6" + "@polkadot/ui-settings" "^0.47.0-beta.7" + "@polkadot/ui-shared" "^0.47.0-beta.7" "@types/color" "^3.0.0" "@types/react-copy-to-clipboard" "^4.3.0" color "^3.1.2" @@ -2201,35 +2201,35 @@ react-copy-to-clipboard "^5.0.2" styled-components "^4.4.1" -"@polkadot/react-qr@^0.47.0-beta.6": - version "0.47.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/react-qr/-/react-qr-0.47.0-beta.6.tgz#f4d76dd0844c001f0dcc8928a4c7db68d698d310" - integrity sha512-q5ZwFu+acKR/DoJaYQRCORzGs1mumK8+qfWP5RvS0EgUs1Jo4eb7M01haJ/CmD3FS0MNXVagp6sMD7XhyytMkQ== +"@polkadot/react-qr@^0.47.0-beta.7": + version "0.47.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/react-qr/-/react-qr-0.47.0-beta.7.tgz#fbceab697b0df292f7157b23cabdda3a91eef367" + integrity sha512-GEPXtANOGm4xXlay1WIBOE6zXtBL6Rt9S6AAR7FyLA5Cg3swnkLcxYSOL1UGOXfGNqdLqAeLnWz7DXHL5RjZAg== dependencies: "@babel/runtime" "^7.7.2" "@types/react-qr-reader" "^2.1.1" qrcode-generator "^1.4.4" react-qr-reader "^2.2.1" -"@polkadot/rpc-core@^0.97.0-beta.16": - version "0.97.0-beta.16" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-0.97.0-beta.16.tgz#c8d7b4ee971898be25521586561a3b7d855e50d4" - integrity sha512-R2Oafk374qYIvlHe98NpJeXrS4rAn+qXmfunEG6LqZ5/JJuaC0Uq9E0P9CFZBTrH/dn27slD3NSrHzhsfZ5OuA== +"@polkadot/rpc-core@^0.97.0-beta.19": + version "0.97.0-beta.19" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-0.97.0-beta.19.tgz#ace134272e2a45afa97c86a6ab3169abff887e45" + integrity sha512-aok6nJfPaRWEk5uBaHsPvPJjBla5UyEqSGurtkIPf2uOet4BVm2+pLFAYmZQAzONOOpQH5liqDIC7sMsSx+QnQ== dependencies: "@babel/runtime" "^7.7.2" - "@polkadot/jsonrpc" "^0.97.0-beta.16" - "@polkadot/rpc-provider" "^0.97.0-beta.16" - "@polkadot/types" "^0.97.0-beta.16" + "@polkadot/jsonrpc" "^0.97.0-beta.19" + "@polkadot/rpc-provider" "^0.97.0-beta.19" + "@polkadot/types" "^0.97.0-beta.19" "@polkadot/util" "^1.7.0-beta.7" rxjs "^6.5.3" -"@polkadot/rpc-provider@^0.97.0-beta.16": - version "0.97.0-beta.16" - resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-0.97.0-beta.16.tgz#27652df7a64e50ef0e683f3e90c92d5ab44aad13" - integrity sha512-dHbiA1vnXp9GMh8yNvXrmRu5Jvjy8JMxIOJUt2M8F4jfNc7ZL/UivUhq0Jb2+vlt6iHhWuJFtE8idFgu7/yBjw== +"@polkadot/rpc-provider@^0.97.0-beta.19": + version "0.97.0-beta.19" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-0.97.0-beta.19.tgz#bfb70141927a16fae4f11c432b5025669e67089b" + integrity sha512-IKR1JmjBgwLHaLUKCST0jpCSAkPFk8ZEl0p3uHRCXTSUYD9GC1JUB4dDKK15NRvsG5n8L22WY2BA+/Jb+DdlZw== dependencies: "@babel/runtime" "^7.7.2" - "@polkadot/metadata" "^0.97.0-beta.16" + "@polkadot/metadata" "^0.97.0-beta.19" "@polkadot/util" "^1.7.0-beta.7" "@polkadot/util-crypto" "^1.7.0-beta.7" eventemitter3 "^4.0.0" @@ -2243,10 +2243,10 @@ dependencies: "@types/chrome" "^0.0.91" -"@polkadot/types@^0.97.0-beta.16": - version "0.97.0-beta.16" - resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-0.97.0-beta.16.tgz#3078347a026ab601bae87877e644a51c204ae70c" - integrity sha512-uyouW6X9hAPDvfAS6+eSMdByv792csdeOyu7FaMqiQoacJ1gcrvcgPtE6kyv2PQitWxtC8aI2Z1qtFQgudScyg== +"@polkadot/types@^0.97.0-beta.19": + version "0.97.0-beta.19" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-0.97.0-beta.19.tgz#061abd3e3a17a2e8d9e0002f48cd74e1e1d3909a" + integrity sha512-CDJoHhIcX7U+o2ZUBn8xtkMyEBXxuIeVTTo9bFPDBNgw7rEXPdNg4C4xiS9f5UHFsUxdnYsCflRzeInOdoIEiw== dependencies: "@babel/runtime" "^7.7.2" "@polkadot/util" "^1.7.0-beta.7" @@ -2254,17 +2254,17 @@ "@types/memoizee" "^0.4.3" memoizee "^0.4.14" -"@polkadot/ui-assets@^0.47.0-beta.6": - version "0.47.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/ui-assets/-/ui-assets-0.47.0-beta.6.tgz#30e1c0381c88cf547ffe0179cdc6921a40889e7d" - integrity sha512-B4L7A3PCyb/aVzcbq+7ozCOx1Q+WAGVkUi8gKO2Wq7h/Xb/JlsAuysAL+Sn9WpOVZdN+JW7e+wv1OsV5EHD4wQ== +"@polkadot/ui-assets@^0.47.0-beta.7": + version "0.47.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/ui-assets/-/ui-assets-0.47.0-beta.7.tgz#92d15b10c58ea9689566bbd59f177ea5c6cd95a4" + integrity sha512-FOQcKHuo98/21z/zvLLxKN3Np7QBIFoBTXwm0sUyBIC8UxpTFiJPOVWehiNp5usCIyAXg8mrJy/6FtPS7B6f1Q== dependencies: "@babel/runtime" "^7.7.2" -"@polkadot/ui-keyring@^0.47.0-beta.6": - version "0.47.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/ui-keyring/-/ui-keyring-0.47.0-beta.6.tgz#1891d962a68c2c943311aeaad7d73ada83c25894" - integrity sha512-d1oSi9k11Cld4Ckdp3anpKnijShIdZzmN7g3RWaeTI6J8LLxAw9TpAK0JWWTnLU3UTNTPcX1LiGoqPeyc/dp3g== +"@polkadot/ui-keyring@^0.47.0-beta.7": + version "0.47.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/ui-keyring/-/ui-keyring-0.47.0-beta.7.tgz#59fd57808556737b544d1825a906b17b7200e0df" + integrity sha512-c9uaRArOKyhYCkyNTv3gy8ZRTUCXMf69jX+JDvJt760IDPl55ChVIOIrrbuKduUNnnBsrtp7vYMiOon8xLNxFg== dependencies: "@babel/runtime" "^7.7.2" "@ledgerhq/hw-transport-u2f" "^4.73.7" @@ -2280,19 +2280,19 @@ optionalDependencies: "@ledgerhq/hw-transport-node-hid" "^4.73.7" -"@polkadot/ui-settings@^0.47.0-beta.6": - version "0.47.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/ui-settings/-/ui-settings-0.47.0-beta.6.tgz#daddb974daec76d212b4fa05a3f6056ade5afdbc" - integrity sha512-/RocydiLh2poZOqdhPFjWugftKnqVfW9IFfAS7biuSMa7vquFBfu16Iyo9Bsafv9ZjEpKEzN0QFdvmMCoMx7xQ== +"@polkadot/ui-settings@^0.47.0-beta.7": + version "0.47.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/ui-settings/-/ui-settings-0.47.0-beta.7.tgz#a7e341980827acdba1c5580c2a2f2b2f5c146ea1" + integrity sha512-tKGuYrru5N0SY/uq/Q1vgAEyDVgOpRbVrjX03CBUAmXf/A5cHAjXH+5pi9FsXdcRKKKqZTJ4IWjELdSBAVaPuA== dependencies: "@babel/runtime" "^7.7.2" "@types/store" "^2.0.2" store "^2.0.12" -"@polkadot/ui-shared@^0.47.0-beta.6": - version "0.47.0-beta.6" - resolved "https://registry.yarnpkg.com/@polkadot/ui-shared/-/ui-shared-0.47.0-beta.6.tgz#5474d28a84685adabe0df7014b0a1c07eb73c1a9" - integrity sha512-3kwWgf8HLXsukYYoSKLWcfkGYpMZb1kQSBuSTn1TdjGH0VCf+nqr0QcIVdsVppUN0x8ttRa0LvevbjPaQZIT5Q== +"@polkadot/ui-shared@^0.47.0-beta.7": + version "0.47.0-beta.7" + resolved "https://registry.yarnpkg.com/@polkadot/ui-shared/-/ui-shared-0.47.0-beta.7.tgz#2b40d810952b57e5edeae51c17cfac2583729b0b" + integrity sha512-6Mc6FKVZGaOKPSq4ji20hkSRF/0t+vFHU4CJU8vijZD5E7d7nmigKvqqDPDiPRCsBINyJ60nIT5l6f0vBZAFew== dependencies: "@babel/runtime" "^7.7.2" "@types/color" "^3.0.0"