diff --git a/packages/app-explorer/package.json b/packages/app-explorer/package.json index 79bfd49380..d6b3d7a8b5 100644 --- a/packages/app-explorer/package.json +++ b/packages/app-explorer/package.json @@ -12,10 +12,10 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.47", - "@polkadot/primitives": "^0.15.8", - "@polkadot/primitives-codec": "^0.15.8", - "@polkadot/primitives-json": "^0.15.8", + "@polkadot/primitives": "^0.16.5", + "@polkadot/primitives-codec": "^0.16.5", + "@polkadot/primitives-json": "^0.16.5", "@polkadot/ui-app": "^0.6.4", - "@polkadot/util-crypto": "^0.21.3" + "@polkadot/util-crypto": "^0.22.1" } } diff --git a/packages/app-explorer/src/BestHash.js b/packages/app-explorer/src/BestHash.js index 567080d7f0..e9ca0755fc 100644 --- a/packages/app-explorer/src/BestHash.js +++ b/packages/app-explorer/src/BestHash.js @@ -7,12 +7,12 @@ import type { Header } from '@polkadot/primitives/header'; import headerHash from '@polkadot/primitives-codec/header/hash'; import withApiDiv from '@polkadot/ui-react-rx/with/apiDiv'; -import u8aToHexShort from '@polkadot/util/u8a/toHexShort'; +import u8aToHex from '@polkadot/util/u8a/toHex'; export default withApiDiv({ name: 'newHead', section: 'chain' })( (value?: Header): ?string => { return value - ? u8aToHexShort(headerHash(value)) + ? u8aToHex(headerHash(value), 64) : value; }, { className: 'explorer--BestHash' } diff --git a/packages/app-extrinsics/package.json b/packages/app-extrinsics/package.json index 5171635ee0..d1fe075a11 100644 --- a/packages/app-extrinsics/package.json +++ b/packages/app-extrinsics/package.json @@ -12,8 +12,8 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.47", - "@polkadot/extrinsics": "^0.15.8", - "@polkadot/extrinsics-codec": "^0.15.8", + "@polkadot/extrinsics": "^0.16.5", + "@polkadot/extrinsics-codec": "^0.16.5", "@polkadot/ui-app": "^0.6.4", "@polkadot/ui-signer": "^0.6.4", "react-dropzone": "^4.2.9" diff --git a/packages/app-extrinsics/src/Extrinsic.js b/packages/app-extrinsics/src/Extrinsic.js index 28de6e6b30..667b3db3cf 100644 --- a/packages/app-extrinsics/src/Extrinsic.js +++ b/packages/app-extrinsics/src/Extrinsic.js @@ -3,7 +3,7 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { Extrinsic } from '@polkadot/extrinsics/types'; +import type { Extrinsic$Method } from '@polkadot/extrinsics/types'; import type { BareProps } from '@polkadot/ui-app/types'; import type { RawParam } from '@polkadot/ui-app/Params/types'; import type { EncodedMessage } from '@polkadot/ui-signer/types'; @@ -19,7 +19,7 @@ import isUndefined from '@polkadot/util/is/undefined'; import paramComponents from './Params'; type Props = BareProps & { - defaultValue: Extrinsic, + defaultValue: Extrinsic$Method, isError?: boolean, isPrivate?: boolean, labelMethod?: string, @@ -28,7 +28,7 @@ type Props = BareProps & { }; type State = { - extrinsic: Extrinsic, + extrinsic: Extrinsic$Method, values: Array }; @@ -92,7 +92,7 @@ export default class ExtrinsicDisplay extends React.PureComponent }); } - onChangeExtrinsic = (extrinsic: Extrinsic): void => { + onChangeExtrinsic = (extrinsic: Extrinsic$Method): void => { this.nextState({ extrinsic }); }; diff --git a/packages/app-extrinsics/src/Params/Call.js b/packages/app-extrinsics/src/Params/Call.js index 61d1c68fe0..58520c130e 100644 --- a/packages/app-extrinsics/src/Params/Call.js +++ b/packages/app-extrinsics/src/Params/Call.js @@ -11,7 +11,7 @@ import extrinsics from '@polkadot/extrinsics-substrate'; import Extrinsic from './Extrinsic'; -const defaultValue = extrinsics.staking.methods.public.transfer; +const defaultValue = extrinsics.staking.public.transfer; export default function Call ({ className, isDisabled, isError, label, onChange, style, withLabel }: Props): React$Node { return ( diff --git a/packages/app-extrinsics/src/Params/Extrinsic.js b/packages/app-extrinsics/src/Params/Extrinsic.js index 7be0377b81..bc3889775b 100644 --- a/packages/app-extrinsics/src/Params/Extrinsic.js +++ b/packages/app-extrinsics/src/Params/Extrinsic.js @@ -3,7 +3,7 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { Extrinsic } from '@polkadot/extrinsics/types'; +import type { Extrinsic$Method } from '@polkadot/extrinsics/types'; import type { I18nProps } from '@polkadot/ui-app/types'; import type { RawParam$OnChange } from '@polkadot/ui-app/Params/types'; import type { EncodedMessage } from '@polkadot/ui-signer/types'; @@ -14,7 +14,7 @@ import BaseExtrinsic from '../Extrinsic'; import translate from '../translate'; type Props = I18nProps & { - defaultValue: Extrinsic, + defaultValue: Extrinsic$Method, isDisabled: boolean, isError: boolean, isPrivate: boolean, @@ -23,7 +23,7 @@ type Props = I18nProps & { withLabel?: boolean, }; -class CExtrinsic extends React.PureComponent { +class Extrinsic extends React.PureComponent { render (): React$Node { const { className, defaultValue, isDisabled, isError, isPrivate, label, style, t, withLabel } = this.props; @@ -64,4 +64,4 @@ class CExtrinsic extends React.PureComponent { } } -export default translate(CExtrinsic); +export default translate(Extrinsic); diff --git a/packages/app-extrinsics/src/Params/Proposal.js b/packages/app-extrinsics/src/Params/Proposal.js index 666a7bbb87..c67b530b86 100644 --- a/packages/app-extrinsics/src/Params/Proposal.js +++ b/packages/app-extrinsics/src/Params/Proposal.js @@ -11,7 +11,7 @@ import extrinsics from '@polkadot/extrinsics-substrate'; import Extrinsic from './Extrinsic'; -const defaultValue = extrinsics.consensus.methods.private.setCode; +const defaultValue = extrinsics.consensus.private.setCode; export default function Proposal ({ className, isDisabled, isError, label, onChange, style, withLabel }: Props): React$Node { return ( diff --git a/packages/app-extrinsics/src/Selection.js b/packages/app-extrinsics/src/Selection.js index 725964c452..40fd449841 100644 --- a/packages/app-extrinsics/src/Selection.js +++ b/packages/app-extrinsics/src/Selection.js @@ -30,7 +30,7 @@ type State = { publicKey: Uint8Array }; -const defaultExtrinsic = extrinsics.staking.methods.public.transfer; +const defaultExtrinsic = extrinsics.staking.public.transfer; const defaultRpc = rpc.author.methods.submitExtrinsic; class Selection extends React.PureComponent { diff --git a/packages/app-rpc/src/Results.js b/packages/app-rpc/src/Results.js index 616447c2ca..8acd872a4e 100644 --- a/packages/app-rpc/src/Results.js +++ b/packages/app-rpc/src/Results.js @@ -12,6 +12,8 @@ import Output from '@polkadot/ui-app/Output'; import classes from '@polkadot/ui-app/util/classes'; import isUndefined from '@polkadot/util/is/undefined'; +import resultToText from './resultToText'; + type Props = BareProps & { queue: Array }; @@ -40,7 +42,7 @@ export default function Results ({ className, queue = [], style }: Props): React value={ error ? error.message - : result + : resultToText(result) } /> ))} diff --git a/packages/app-rpc/src/Selection.js b/packages/app-rpc/src/Selection.js index 5996f4be42..dc68462045 100644 --- a/packages/app-rpc/src/Selection.js +++ b/packages/app-rpc/src/Selection.js @@ -3,7 +3,7 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { InterfaceMethodDefinition } from '@polkadot/jsonrpc/types'; +import type { Interface$Method } from '@polkadot/jsonrpc/types'; import type { RawParam } from '@polkadot/ui-app/Params/types'; import type { I18nProps } from '@polkadot/ui-app/types'; import type { QueueTx$MessageAdd } from '@polkadot/ui-signer/types'; @@ -31,7 +31,7 @@ type State = { isValid: boolean, nonce: BN, publicKey?: Uint8Array | null, - rpc: InterfaceMethodDefinition, + rpc: Interface$Method, values: Array } @@ -116,7 +116,7 @@ class Selection extends React.PureComponent { this.nextState({ nonce, publicKey }); } - onChangeMethod = (rpc: InterfaceMethodDefinition): void => { + onChangeMethod = (rpc: Interface$Method): void => { this.nextState({ rpc }); } diff --git a/packages/app-rpc/src/resultToText.js b/packages/app-rpc/src/resultToText.js new file mode 100644 index 0000000000..6d4601feb3 --- /dev/null +++ b/packages/app-rpc/src/resultToText.js @@ -0,0 +1,49 @@ +// Copyright 2017-2018 Jaco Greeff +// This software may be modified and distributed under the terms +// of the ISC license. See the LICENSE file for details. +// @flow + +import bnToHex from '@polkadot/util/bn/toHex'; +import u8aToHex from '@polkadot/util/u8a/toHex'; +import isBn from '@polkadot/util/is/bn'; +import isObject from '@polkadot/util/is/object'; +import isU8a from '@polkadot/util/is/u8a'; + +function resultToText (result: mixed): mixed { + if (isU8a(result)) { + // $FlowFixMe type has been determined + return u8aToHex(result); + } + + if (isBn(result)) { + // $FlowFixMe type has been determined + return bnToHex(result); + } + + if (Array.isArray(result)) { + return result.map((value) => + resultToText(value) + ); + } + + if (isObject(result)) { + return JSON + .stringify( + // $FlowFixMe type has been determined + Object + .keys(result) + .reduce((map, key) => { + // $FlowFixMe type has been determined + map[key] = resultToText(result[key]); + + return map; + }, {}) + ) + .replace(/\\"/g, '"') + .replace(/":"/g, '": "'); + } + + return result; +} + +export default resultToText; diff --git a/packages/app-storage/src/Selection.js b/packages/app-storage/src/Selection.js index 650b943f5f..29852a57aa 100644 --- a/packages/app-storage/src/Selection.js +++ b/packages/app-storage/src/Selection.js @@ -3,7 +3,7 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { StorageDef$Key } from '@polkadot/storage/types'; +import type { Storage$Key } from '@polkadot/storage/types'; import type { I18nProps } from '@polkadot/ui-app/types'; import type { RawParams } from '@polkadot/ui-app/Params/types'; import type { StorageQuery } from './types'; @@ -26,7 +26,7 @@ type Props = I18nProps & { type State = { isValid: boolean, - key: StorageDef$Key, + key: Storage$Key, params: RawParams }; @@ -105,7 +105,7 @@ class Selection extends React.PureComponent { }); } - onChangeKey = (key: StorageDef$Key): void => { + onChangeKey = (key: Storage$Key): void => { this.nextState({ key }); } diff --git a/packages/app-storage/src/types.js b/packages/app-storage/src/types.js index a041b1fe62..8fd09d1b57 100644 --- a/packages/app-storage/src/types.js +++ b/packages/app-storage/src/types.js @@ -3,11 +3,11 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { StorageDef$Key } from '@polkadot/storage/types'; +import type { Storage$Key } from '@polkadot/storage/types'; export type StorageQuery = { id: number, - key: StorageDef$Key, + key: Storage$Key, // flowlint-next-line unclear-type:off params: Array } diff --git a/packages/apps/.env b/packages/apps/.env deleted file mode 100644 index 6f809cc254..0000000000 --- a/packages/apps/.env +++ /dev/null @@ -1 +0,0 @@ -SKIP_PREFLIGHT_CHECK=true diff --git a/packages/apps/README.md b/packages/apps/README.md index 9ae1cba167..6b2c62e013 100644 --- a/packages/apps/README.md +++ b/packages/apps/README.md @@ -1 +1 @@ -# @polkadot/portal +# @polkadot/apps diff --git a/packages/ui-app/package.json b/packages/ui-app/package.json index 55c24a8a97..c51f4ef513 100644 --- a/packages/ui-app/package.json +++ b/packages/ui-app/package.json @@ -12,14 +12,14 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.47", - "@polkadot/extrinsics-substrate": "^0.15.8", - "@polkadot/params": "^0.15.8", - "@polkadot/primitives": "^0.15.8", - "@polkadot/storage-substrate": "^0.15.8", + "@polkadot/extrinsics-substrate": "^0.16.5", + "@polkadot/params": "^0.16.5", + "@polkadot/primitives": "^0.16.5", + "@polkadot/storage-substrate": "^0.16.5", "@polkadot/ui-keyring": "^0.6.4", - "@polkadot/ui-react": "^0.13.4", - "@polkadot/ui-react-rx": "^0.13.4", - "@polkadot/util": "^0.21.3", + "@polkadot/ui-react": "^0.13.6", + "@polkadot/ui-react-rx": "^0.13.6", + "@polkadot/util": "^0.22.1", "i18next": "^11.1.1", "i18next-browser-languagedetector": "^2.2.0", "i18next-xhr-backend": "^1.5.1", diff --git a/packages/ui-app/src/InputExtrinsic/SelectMethod.js b/packages/ui-app/src/InputExtrinsic/SelectMethod.js index 4dc46b1b3c..9e73329caa 100644 --- a/packages/ui-app/src/InputExtrinsic/SelectMethod.js +++ b/packages/ui-app/src/InputExtrinsic/SelectMethod.js @@ -3,8 +3,9 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { Extrinsic } from '@polkadot/extrinsics/types'; +import type { Extrinsic$Method } from '@polkadot/extrinsics/types'; import type { I18nProps } from '../types'; +import type { DropdownOptions } from './types'; import React from 'react'; @@ -13,27 +14,24 @@ import extrinsics from '@polkadot/extrinsics-substrate'; import Dropdown from '../Dropdown'; import classes from '../util/classes'; import translate from '../translate'; -import createOptions from './options/method'; type Props = I18nProps & { isError?: boolean, label?: string, - onChange: (value: Extrinsic) => void, + onChange: (value: Extrinsic$Method) => void, + options: DropdownOptions, type: 'private' | 'public', - value: Extrinsic, + value: Extrinsic$Method, withLabel?: boolean }; -function SelectMethod ({ className, isError, label = '', onChange, style, t, type, value: { name, section }, withLabel }: Props): React$Node { - // $FlowFixMe string vs ... - if (!extrinsics[section]) { +function SelectMethod ({ className, isError, label = '', onChange, options, style, t, type, value: { name, section }, withLabel }: Props): React$Node { + if (!options.length) { return null; } - const methods = extrinsics[section].methods[type]; - const transform = (name: string): Extrinsic => - methods[name]; - const options = createOptions(section, type); + const transform = (name: string): Extrinsic$Method => + extrinsics[section][type][name]; return ( void, - type: 'private' | 'public', - value: Extrinsic, + onChange: (value: Extrinsic$Sections) => void, + options: DropdownOptions, + value: Extrinsic$Method, withLabel?: boolean }; -function SelectSection ({ className, defaultValue, isError, label = '', onChange, style, t, type, value: { section }, withLabel }: Props): React$Node { - const options = createOptions(type); - +function SelectSection ({ className, defaultValue, isError, label = '', onChange, options, style, t, value: { section }, withLabel }: Props): React$Node { return ( void, + onChange: (value: Extrinsic$Method) => void, withLabel?: boolean }; type State = { - value: Extrinsic + optionsMethod: DropdownOptions, + optionsSection: DropdownOptions, + type: 'private' | 'public', + value: Extrinsic$Method }; class InputExtrinsic extends React.PureComponent { @@ -39,15 +44,28 @@ class InputExtrinsic extends React.PureComponent { constructor (props: Props) { super(props); - this.state = { + this.state = ({ value: this.props.defaultValue + }: $Shape); + } + + static getDerivedStateFromProps ({ isPrivate = false }: Props, { type, value: { section } }: State): $Shape { + const newType = isPrivate ? 'private' : 'public'; + + if (newType === type) { + return null; + } + + return { + optionsMethod: methodOptions(section, newType), + optionsSection: sectionOptions(newType), + type: newType }; } render (): React$Node { - const { className, isPrivate = false, labelMethod, labelSection, style, withLabel } = this.props; - const { value } = this.state; - const type = isPrivate ? 'private' : 'public'; + const { className, labelMethod, labelSection, style, withLabel } = this.props; + const { optionsMethod, optionsSection, type, value } = this.state; return (
{ className='small' label={labelSection} onChange={this.onSectionChange} - type={type} + options={optionsSection} value={value} withLabel={withLabel} /> @@ -66,6 +84,7 @@ class InputExtrinsic extends React.PureComponent { className='large' label={labelMethod} onChange={this.onKeyChange} + options={optionsMethod} value={value} type={type} withLabel={withLabel} @@ -74,26 +93,32 @@ class InputExtrinsic extends React.PureComponent { ); } - onKeyChange = (value: Extrinsic): void => { + onKeyChange = (value: Extrinsic$Method): void => { const { onChange } = this.props; + const { value: { name, section } } = this.state; + + if (value.section === section && value.name === name) { + return; + } this.setState({ value }, () => onChange(value) ); } - onSectionChange = (section: ExtrinsicSectionName): void => { - const { isPrivate = false } = this.props; + onSectionChange = (newSection: Extrinsic$Sections): void => { + const { type, value: { section } } = this.state; - if (this.state.value.section === section) { + if (newSection === section) { return; } - const type = isPrivate ? 'private' : 'public'; - const options = methodOptions(section, type); - const value = map[section].methods[type][options[0].value]; + const optionsMethod = methodOptions(newSection, type); + const value = map[newSection][type][optionsMethod[0].value]; - this.onKeyChange(value); + this.setState({ optionsMethod }, () => + this.onKeyChange(value) + ); } } diff --git a/packages/ui-app/src/InputExtrinsic/options/method.js b/packages/ui-app/src/InputExtrinsic/options/method.js index 0c81a38241..14c7644c6e 100644 --- a/packages/ui-app/src/InputExtrinsic/options/method.js +++ b/packages/ui-app/src/InputExtrinsic/options/method.js @@ -3,21 +3,21 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { ExtrinsicSectionName } from '@polkadot/extrinsics/types'; +import type { Extrinsic$Sections } from '@polkadot/extrinsics/types'; +import type { DropdownOptions } from '../types'; import React from 'react'; import map from '@polkadot/extrinsics-substrate'; -// flowlint-next-line unclear-type:off -export default function createOptions (sectionName: any, type: 'private' | 'public'): Array { - const section = map[(sectionName: ExtrinsicSectionName)]; +export default function createOptions (sectionName: Extrinsic$Sections, type: 'private' | 'public'): DropdownOptions { + const section = map[sectionName]; if (!section) { return []; } - const methods = section.methods[type]; + const methods = section[type]; return Object .keys(methods) diff --git a/packages/ui-app/src/InputExtrinsic/options/section.js b/packages/ui-app/src/InputExtrinsic/options/section.js index dfeb3daa94..94a88a55cd 100644 --- a/packages/ui-app/src/InputExtrinsic/options/section.js +++ b/packages/ui-app/src/InputExtrinsic/options/section.js @@ -3,15 +3,16 @@ // of the ISC license. See the LICENSE file for details. // @flow +import type { DropdownOptions } from '../types'; + import map from '@polkadot/extrinsics-substrate'; -// flowlint-next-line unclear-type:off -export default function createOptions (type: 'private' | 'public'): Array { +export default function createOptions (type: 'private' | 'public'): DropdownOptions { return Object .keys(map) .sort() .filter((name) => { - const methods = map[name].methods[type]; + const methods = map[name][type]; return Object.keys(methods).length !== 0; }) diff --git a/packages/ui-app/src/InputExtrinsic/types.js b/packages/ui-app/src/InputExtrinsic/types.js new file mode 100644 index 0000000000..eae6af8dc5 --- /dev/null +++ b/packages/ui-app/src/InputExtrinsic/types.js @@ -0,0 +1,13 @@ +// Copyright 2017-2018 Jaco Greeff +// This software may be modified and distributed under the terms +// of the ISC license. See the LICENSE file for details. +// @flow + +export type DropdownOption = { + className?: string, + key?: string, + text: string | React$Node, + value: string +}; + +export type DropdownOptions = Array; diff --git a/packages/ui-app/src/InputRpc/SelectMethod.js b/packages/ui-app/src/InputRpc/SelectMethod.js index ec9dcdf47f..d8a1842c74 100644 --- a/packages/ui-app/src/InputRpc/SelectMethod.js +++ b/packages/ui-app/src/InputRpc/SelectMethod.js @@ -3,7 +3,8 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { InterfaceMethodDefinition } from '@polkadot/jsonrpc/types'; +import type { Interface$Method, Interface$Sections } from '@polkadot/jsonrpc/types'; +import type { DropdownOptions } from '../InputExtrinsic/types'; import type { I18nProps } from '../types'; import React from 'react'; @@ -17,10 +18,9 @@ import translate from '../translate'; type Props = I18nProps & { isError?: boolean, label?: string, - onChange: (value: InterfaceMethodDefinition) => void, - // flowlint-next-line unclear-type:off - options: Array, - value: InterfaceMethodDefinition, + onChange: (value: Interface$Method) => void, + options: DropdownOptions, + value: Interface$Method, withLabel?: boolean }; @@ -29,8 +29,7 @@ function SelectMethod ({ className, isError, label = '', onChange, options, styl return null; } - const transform = (name: string): InterfaceMethodDefinition => - // $FlowFixMe ... string to type :( + const transform = (name: Interface$Sections): Interface$Method => map[section].methods[name]; return ( diff --git a/packages/ui-app/src/InputRpc/SelectSection.js b/packages/ui-app/src/InputRpc/SelectSection.js index bf110b29e3..1178222090 100644 --- a/packages/ui-app/src/InputRpc/SelectSection.js +++ b/packages/ui-app/src/InputRpc/SelectSection.js @@ -3,7 +3,8 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { InterfaceMethodDefinition, InterfaceTypes } from '@polkadot/jsonrpc/types'; +import type { Interface$Method, Interface$Sections } from '@polkadot/jsonrpc/types'; +import type { DropdownOptions } from '../InputExtrinsic/types'; import type { I18nProps } from '../types'; import React from 'react'; @@ -13,13 +14,12 @@ import classes from '../util/classes'; import translate from '../translate'; type Props = I18nProps & { - defaultValue?: InterfaceTypes, + defaultValue?: Interface$Sections, isError?: boolean, label: string, - onChange: (value: InterfaceTypes) => void, - // flowlint-next-line unclear-type:off - options: Array, - value: InterfaceMethodDefinition, + onChange: (value: Interface$Sections) => void, + options: DropdownOptions, + value: Interface$Method, withLabel?: boolean }; diff --git a/packages/ui-app/src/InputRpc/index.js b/packages/ui-app/src/InputRpc/index.js index 54b4a68608..81ed0cf862 100644 --- a/packages/ui-app/src/InputRpc/index.js +++ b/packages/ui-app/src/InputRpc/index.js @@ -5,7 +5,8 @@ // TODO: We have a lot shared between this and InputExtrinsic & InputStorage -import type { InterfaceMethodDefinition, InterfaceTypes } from '@polkadot/jsonrpc/types'; +import type { Interface$Method, Interface$Sections } from '@polkadot/jsonrpc/types'; +import type { DropdownOptions } from '../InputExtrinsic/types'; import type { I18nProps } from '../types'; import '../InputExtrinsic/InputExtrinsic.css'; @@ -22,20 +23,18 @@ import methodOptions from './options/method'; import sectionOptions from './options/section'; type Props = I18nProps & { - defaultValue: InterfaceMethodDefinition, + defaultValue: Interface$Method, isError?: boolean, labelMethod?: string, labelSection?: string, - onChange: (value: InterfaceMethodDefinition) => void, + onChange: (value: Interface$Method) => void, withLabel?: boolean }; type State = { - // flowlint-next-line unclear-type:off - optionsMethod: Array, - // flowlint-next-line unclear-type:off - optionsSection: Array, - value: InterfaceMethodDefinition + optionsMethod: DropdownOptions, + optionsSection: DropdownOptions, + value: Interface$Method }; class InputRpc extends React.PureComponent { @@ -82,7 +81,7 @@ class InputRpc extends React.PureComponent { ); } - onMethodChange = (value: InterfaceMethodDefinition): void => { + onMethodChange = (value: Interface$Method): void => { const { onChange } = this.props; const { value: { name, section } } = this.state; @@ -95,7 +94,7 @@ class InputRpc extends React.PureComponent { ); } - onSectionChange = (newSection: InterfaceTypes): void => { + onSectionChange = (newSection: Interface$Sections): void => { const { value: { section } } = this.state; if (newSection === section) { diff --git a/packages/ui-app/src/InputRpc/options/method.js b/packages/ui-app/src/InputRpc/options/method.js index ca0d198986..233eae5c4a 100644 --- a/packages/ui-app/src/InputRpc/options/method.js +++ b/packages/ui-app/src/InputRpc/options/method.js @@ -3,15 +3,15 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { InterfaceTypes } from '@polkadot/jsonrpc/types'; +import type { Interface$Sections } from '@polkadot/jsonrpc/types'; +import type { DropdownOptions } from '../../InputExtrinsic/types'; import React from 'react'; import map from '@polkadot/jsonrpc'; -// flowlint-next-line unclear-type:off -export default function createOptions (sectionName: any): Array { - const section = map[(sectionName: InterfaceTypes)]; +export default function createOptions (sectionName: Interface$Sections): DropdownOptions { + const section = map[sectionName]; if (!section) { return []; diff --git a/packages/ui-app/src/InputRpc/options/section.js b/packages/ui-app/src/InputRpc/options/section.js index 7048d17cb9..f0a8585268 100644 --- a/packages/ui-app/src/InputRpc/options/section.js +++ b/packages/ui-app/src/InputRpc/options/section.js @@ -3,10 +3,11 @@ // of the ISC license. See the LICENSE file for details. // @flow +import type { DropdownOptions } from '../../InputExtrinsic/types'; + import map from '@polkadot/jsonrpc'; -// flowlint-next-line unclear-type:off -export default function createOptions (): Array { +export default function createOptions (): DropdownOptions { return Object .keys(map) .sort() diff --git a/packages/ui-app/src/InputStorage/SelectKey.js b/packages/ui-app/src/InputStorage/SelectKey.js index 3154f73e1a..23f89dcc7b 100644 --- a/packages/ui-app/src/InputStorage/SelectKey.js +++ b/packages/ui-app/src/InputStorage/SelectKey.js @@ -3,7 +3,8 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { StorageDef$Key } from '@polkadot/storage/types'; +import type { Storage$Key } from '@polkadot/storage/types'; +import type { DropdownOptions } from '../InputExtrinsic/types'; import type { I18nProps } from '../types'; import React from 'react'; @@ -13,26 +14,23 @@ import map from '@polkadot/storage-substrate'; import Dropdown from '../Dropdown'; import classes from '../util/classes'; import translate from '../translate'; -import createOptions from './options/key'; type Props = I18nProps & { isError?: boolean, label?: string, - onChange: (value: StorageDef$Key) => void, - value: StorageDef$Key, + onChange: (value: Storage$Key) => void, + options: DropdownOptions, + value: Storage$Key, withLabel?: boolean }; -function SelectKey ({ className, isError, label = '', onChange, style, t, value: { name, section }, withLabel }: Props): React$Node { - // $FlowFixMe string vs ... - if (!map[section]) { +function SelectKey ({ className, isError, label = '', onChange, options, style, t, value: { name, section }, withLabel }: Props): React$Node { + if (!options.length) { return null; } - const keys = map[section].keys; - const transform = (name: string): StorageDef$Key => - keys[name]; - const options = createOptions(section); + const transform = (name: string): Storage$Key => + map[section].keys[name]; return ( void, - value: StorageDef$Key, + onChange: (value: Storage$Sections) => void, + options: DropdownOptions, + value: Storage$Key, withLabel?: boolean }; -const options = createOptions(); - -function SelectSection ({ className, defaultValue, isError, label, onChange, style, t, value: { section }, withLabel }: Props): React$Node { +function SelectSection ({ className, defaultValue, isError, label, onChange, options, style, t, value: { section }, withLabel }: Props): React$Node { return ( void, + onChange: (value: Storage$Key) => void, withLabel?: boolean }; type State = { - value: StorageDef$Key + optionsMethod: DropdownOptions, + optionsSection: DropdownOptions, + value: Storage$Key }; class InputStorage extends React.PureComponent { @@ -39,14 +43,18 @@ class InputStorage extends React.PureComponent { constructor (props: Props) { super(props); + const { section } = this.props.defaultValue; + this.state = { + optionsMethod: keyOptions(section), + optionsSection: sectionOptions(), value: this.props.defaultValue }; } render (): React$Node { const { className, labelMethod, labelSection, style, withLabel } = this.props; - const { value } = this.state; + const { optionsMethod, optionsSection, value } = this.state; return (
{ className='small' label={labelSection} onChange={this.onSectionChange} + options={optionsSection} value={value} withLabel={withLabel} /> @@ -64,6 +73,7 @@ class InputStorage extends React.PureComponent { className='large' label={labelMethod} onChange={this.onKeyChange} + options={optionsMethod} value={value} withLabel={withLabel} /> @@ -71,23 +81,32 @@ class InputStorage extends React.PureComponent { ); } - onKeyChange = (value: StorageDef$Key): void => { + onKeyChange = (value: Storage$Key): void => { const { onChange } = this.props; + const { value: { name, section } } = this.state; + + if (value.section === section && value.name === name) { + return; + } this.setState({ value }, () => onChange(value) ); } - onSectionChange = (section: StateDb$SectionNames): void => { - if (this.state.value.section === section) { + onSectionChange = (newSection: Storage$Sections): void => { + const { value: { section } } = this.state; + + if (newSection === section) { return; } - const options = keyOptions(section); - const value = map[section].keys[options[0].value]; + const optionsMethod = keyOptions(newSection); + const value = map[newSection].keys[optionsMethod[0].value]; - this.onKeyChange(value); + this.setState({ optionsMethod }, () => + this.onKeyChange(value) + ); } } diff --git a/packages/ui-app/src/InputStorage/options/key.js b/packages/ui-app/src/InputStorage/options/key.js index 1389920c24..515fe26e6d 100644 --- a/packages/ui-app/src/InputStorage/options/key.js +++ b/packages/ui-app/src/InputStorage/options/key.js @@ -3,15 +3,15 @@ // of the ISC license. See the LICENSE file for details. // @flow -import type { StateDb$SectionNames } from '@polkadot/storage/types'; +import type { Storage$Sections } from '@polkadot/storage/types'; +import type { DropdownOptions } from '../../InputExtrinsic/types'; import React from 'react'; import map from '@polkadot/storage-substrate'; -// flowlint-next-line unclear-type:off -export default function createOptions (sectionName: any): Array { - const section = map[(sectionName: StateDb$SectionNames)]; +export default function createOptions (sectionName: Storage$Sections): DropdownOptions { + const section = map[sectionName]; if (!section) { return []; diff --git a/packages/ui-app/src/InputStorage/options/section.js b/packages/ui-app/src/InputStorage/options/section.js index bdde312f01..23fe8334fd 100644 --- a/packages/ui-app/src/InputStorage/options/section.js +++ b/packages/ui-app/src/InputStorage/options/section.js @@ -3,10 +3,11 @@ // of the ISC license. See the LICENSE file for details. // @flow +import type { DropdownOptions } from '../../InputExtrinsic/types'; + import map from '@polkadot/storage-substrate'; -// flowlint-next-line unclear-type:off -export default function createOptions (): Array { +export default function createOptions (): DropdownOptions { return Object .keys(map) .sort() diff --git a/packages/ui-app/src/Params/Param/String.js b/packages/ui-app/src/Params/Param/String.js new file mode 100644 index 0000000000..c5a62b8618 --- /dev/null +++ b/packages/ui-app/src/Params/Param/String.js @@ -0,0 +1,46 @@ +// Copyright 2017-2018 Jaco Greeff +// This software may be modified and distributed under the terms +// of the ISC license. See the LICENSE file for details. +// @flow + +import type { Props } from '../types'; + +import React from 'react'; + +import Input from '../../Input'; +import Bare from './Bare'; + +export default class StringParam extends React.PureComponent { + render (): React$Node { + const { className, isDisabled, isError, label, style, withLabel } = this.props; + + return ( + + + + ); + } + + onChange = (value: string): void => { + const { onChange } = this.props; + + const isValid = value.length !== 0; + + onChange({ + isValid, + value + }); + }; +} diff --git a/packages/ui-app/src/Params/Param/findComponent.js b/packages/ui-app/src/Params/Param/findComponent.js index 9b770cf8cf..3c33e3f978 100644 --- a/packages/ui-app/src/Params/Param/findComponent.js +++ b/packages/ui-app/src/Params/Param/findComponent.js @@ -13,6 +13,7 @@ import Bytes from './Bytes'; import Code from './Code'; import Hash from './Hash'; import KeyValue from './KeyValue'; +import StringParam from './String'; import Unknown from './Unknown'; import VoteThreshold from './VoteThreshold'; @@ -34,7 +35,7 @@ const components: ComponentMap = { 'ReferendumIndex': Amount, 'SessionKey': Amount, 'Signature': Hash, - 'String': Unknown, + 'String': StringParam, 'Timestamp': Amount, 'u32': Amount, 'u64': Amount, diff --git a/packages/ui-app/src/Params/index.js b/packages/ui-app/src/Params/index.js index 237bed7960..4f36443a5f 100644 --- a/packages/ui-app/src/Params/index.js +++ b/packages/ui-app/src/Params/index.js @@ -17,13 +17,15 @@ import Param from './Param'; import createValues from './values'; type Props = I18nProps & { - item: Section$Item, + // flowlint-next-line unclear-type:off + item: Section$Item, onChange: (value: RawParams) => void, overrides?: ComponentMap }; type State = { - item: Section$Item, + // flowlint-next-line unclear-type:off + item: Section$Item, handlers: Array, onChangeParam: (at: number, next: RawParam) => void, values: RawParams diff --git a/packages/ui-app/src/Params/valueToText.js b/packages/ui-app/src/Params/valueToText.js index 07f9083b05..f6ae3bb836 100644 --- a/packages/ui-app/src/Params/valueToText.js +++ b/packages/ui-app/src/Params/valueToText.js @@ -9,7 +9,7 @@ import type { Param$Types, Param$Type$Array } from '@polkadot/params/types'; // import IdentityIcon from '@polkadot/ui-react/IdentityIcon'; import numberFormat from '@polkadot/ui-react-rx/util/numberFormat'; import addressEncode from '@polkadot/util-keyring/address/encode'; -import u8aToHexShort from '@polkadot/util/u8a/toHexShort'; +import u8aToHex from '@polkadot/util/u8a/toHex'; import isBn from '@polkadot/util/is/bn'; import isU8a from '@polkadot/util/is/u8a'; @@ -47,7 +47,7 @@ function valueToText (type: Param$Types, value: any): string { } if (isU8a(value)) { - return u8aToHexShort((value: Uint8Array), 256); + return u8aToHex((value: Uint8Array), 256); } if (isBn(value)) { diff --git a/packages/ui-keyring/package.json b/packages/ui-keyring/package.json index cb97c010c3..907ddb9e90 100644 --- a/packages/ui-keyring/package.json +++ b/packages/ui-keyring/package.json @@ -12,9 +12,9 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.47", - "@polkadot/ui-react": "^0.13.4", - "@polkadot/util": "^0.21.3", - "@polkadot/util-keyring": "^0.21.3", + "@polkadot/ui-react": "^0.13.6", + "@polkadot/util": "^0.22.1", + "@polkadot/util-keyring": "^0.22.1", "store": "^2.0.12" }, "peerDependencies": { diff --git a/packages/ui-signer/package.json b/packages/ui-signer/package.json index 23639ad412..ec0463e684 100644 --- a/packages/ui-signer/package.json +++ b/packages/ui-signer/package.json @@ -12,10 +12,10 @@ }, "dependencies": { "@babel/runtime": "^7.0.0-beta.47", - "@polkadot/extrinsics": "^0.15.8", + "@polkadot/extrinsics": "^0.16.5", "@polkadot/ui-app": "^0.6.4", "@polkadot/ui-keyring": "^0.6.4", - "@polkadot/util": "^0.21.3" + "@polkadot/util": "^0.22.1" }, "peerDependencies": { "react": "^16.3.1", diff --git a/packages/ui-signer/src/Extrinsic.js b/packages/ui-signer/src/Extrinsic.js index 19c42d5ad9..406bc6dc9a 100644 --- a/packages/ui-signer/src/Extrinsic.js +++ b/packages/ui-signer/src/Extrinsic.js @@ -13,7 +13,7 @@ import { Trans } from 'react-i18next'; import extrinsics from '@polkadot/extrinsics-substrate'; import Modal from '@polkadot/ui-app/Modal'; import IdentityIcon from '@polkadot/ui-react/IdentityIcon'; -import u8aToHexShort from '@polkadot/util/u8a/toHexShort'; +import u8aToHex from '@polkadot/util/u8a/toHex'; import addressEncode from '@polkadot/util-keyring/address/encode'; import translate from './translate'; @@ -28,7 +28,7 @@ function findExtrinsic (sectionId: number, methodId: number): { method: ?string, extrinsics[section].index[0] === sectionId ); const methods = section - ? extrinsics[section].methods.public + ? extrinsics[section].public : {}; const method = Object.keys(methods).find((method) => methods[method].index[1] === methodId @@ -70,7 +70,7 @@ function Extrinsic ({ children, className, style, t, value: { nonce = new BN(0), })}

- {u8aToHexShort(value, 512)} + {u8aToHex(value, 512)}

, rpc: InterfaceMethodDefinition): Promise { - const { name, section } = rpc; +export default async function submitMessage (api: RxApiInterface, params: Array, { name, section }: Interface$Method): Promise { + try { + const result = await api[section][name].apply(null, params).toPromise(); - // $FlowFixMe This should not be an issue... - return api[section][name] - .apply(null, params) - .toPromise() - .then((result) => { - console.log(`${section}.${name}: result ::`, result); + console.log(`${section}.${name}: result ::`, result); - return { - result, - status: 'sent' - }; - }) - .catch((error) => { - console.error(error); + return { + result, + status: 'sent' + }; + } catch (error) { + console.error(error); - return { - error, - status: 'error' - }; - }); + return { + error, + status: 'error' + }; + } } diff --git a/packages/ui-signer/src/types.js b/packages/ui-signer/src/types.js index ca9c64751a..dd7fc25d08 100644 --- a/packages/ui-signer/src/types.js +++ b/packages/ui-signer/src/types.js @@ -4,7 +4,7 @@ // @flow import type BN from 'bn.js'; -import type { InterfaceMethodDefinition } from '@polkadot/jsonrpc/types'; +import type { Interface$Method } from '@polkadot/jsonrpc/types'; import type { Param$Values } from '@polkadot/params/types'; export type EncodedMessage = { @@ -23,7 +23,7 @@ export type QueueTx$Result = { } export type QueueTx$Base = EncodedMessage & { - rpc: InterfaceMethodDefinition, + rpc: Interface$Method, nonce: BN, publicKey?: Uint8Array | null }; diff --git a/yarn.lock b/yarn.lock index 8d29317a13..12264aa74b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -719,47 +719,47 @@ version "1.0.2" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.0.2.tgz#d056b68999769728a1cff8d643bc59eb6f0be436" -"@polkadot/api-format@^0.12.4": - version "0.12.4" - resolved "https://registry.yarnpkg.com/@polkadot/api-format/-/api-format-0.12.4.tgz#9ef5d227a98e713aef0ad8cdd8cd4f2804d346fb" +"@polkadot/api-format@^0.12.6": + version "0.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/api-format/-/api-format-0.12.6.tgz#9fd8e0268c5b6bb3fb5f2d4c1e66158d07ad3af2" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/jsonrpc" "^0.15.8" - "@polkadot/primitives-json" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/jsonrpc" "^0.16.5" + "@polkadot/primitives-json" "^0.16.5" + "@polkadot/util" "^0.22.1" -"@polkadot/api-provider@^0.12.4": - version "0.12.4" - resolved "https://registry.yarnpkg.com/@polkadot/api-provider/-/api-provider-0.12.4.tgz#947cf3720a06a808d21dd5717d2bf3f3a7d37138" +"@polkadot/api-provider@^0.12.6": + version "0.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/api-provider/-/api-provider-0.12.6.tgz#5f9b043e247742d4edc0cfdcb4a7ab4051a452a9" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/storage-substrate" "^0.15.8" - "@polkadot/util" "^0.21.3" - "@polkadot/util-crypto" "^0.21.3" - "@polkadot/util-keyring" "^0.21.3" + "@polkadot/storage-substrate" "^0.16.5" + "@polkadot/util" "^0.22.1" + "@polkadot/util-crypto" "^0.22.1" + "@polkadot/util-keyring" "^0.22.1" eventemitter3 "^2.0.3" isomorphic-fetch "^2.2.1" websocket "^1.0.25" -"@polkadot/api-rx@^0.12.4": - version "0.12.4" - resolved "https://registry.yarnpkg.com/@polkadot/api-rx/-/api-rx-0.12.4.tgz#2114d29620570ebc35215a5bd967bfaa1a5ad7c9" +"@polkadot/api-rx@^0.12.6": + version "0.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/api-rx/-/api-rx-0.12.6.tgz#951ef4daa78415c4ac13c7fdbd86612d4eae987a" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/api" "^0.12.4" - "@polkadot/api-provider" "^0.12.4" + "@polkadot/api" "^0.12.6" + "@polkadot/api-provider" "^0.12.6" rxjs "^5.5.10" -"@polkadot/api@^0.12.4": - version "0.12.4" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.12.4.tgz#591912964574f9b4775cf33473adfb48ef339d3a" +"@polkadot/api@^0.12.6": + version "0.12.6" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.12.6.tgz#eacdd9797806954e54b7a41a80e5d4e9f8cedd34" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/api-format" "^0.12.4" - "@polkadot/api-provider" "^0.12.4" - "@polkadot/jsonrpc" "^0.15.8" - "@polkadot/params" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/api-format" "^0.12.6" + "@polkadot/api-provider" "^0.12.6" + "@polkadot/jsonrpc" "^0.16.5" + "@polkadot/params" "^0.16.5" + "@polkadot/util" "^0.22.1" "@polkadot/dev-react@^0.19.10": version "0.19.10" @@ -816,181 +816,181 @@ mkdirp "^0.5.1" rimraf "^2.6.2" -"@polkadot/extrinsics-codec@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/extrinsics-codec/-/extrinsics-codec-0.15.8.tgz#925ab3facb9efb1c03a098f54dc466a8072ca3fe" +"@polkadot/extrinsics-codec@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/extrinsics-codec/-/extrinsics-codec-0.16.5.tgz#06c798c12b6a55d2d62863d796a63a8cf3032773" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/extrinsics" "^0.15.8" - "@polkadot/params" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/extrinsics" "^0.16.5" + "@polkadot/params" "^0.16.5" + "@polkadot/util" "^0.22.1" bn.js "^4.11.8" -"@polkadot/extrinsics-substrate@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/extrinsics-substrate/-/extrinsics-substrate-0.15.8.tgz#8c36f8bd84711a5bb41f40d7da00c831cf1b1542" +"@polkadot/extrinsics-substrate@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/extrinsics-substrate/-/extrinsics-substrate-0.16.5.tgz#d68078ba7071898a057356b5b7d98e285b169257" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/extrinsics" "^0.15.8" + "@polkadot/extrinsics" "^0.16.5" -"@polkadot/extrinsics@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.15.8.tgz#98c3776fe1b2e560489511312a6c56a17b76fbfc" +"@polkadot/extrinsics@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.16.5.tgz#e4c8590f36728215c0c6bc7338c49dd957ce8841" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/params" "^0.15.8" - "@polkadot/primitives" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/params" "^0.16.5" + "@polkadot/primitives" "^0.16.5" + "@polkadot/util" "^0.22.1" -"@polkadot/jsonrpc@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.15.8.tgz#54ff1123eeb763f53023b16116cf5762d1d8d4e4" +"@polkadot/jsonrpc@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.16.5.tgz#448e976d7017672ab107a179c3ca34bb93ac0d8f" dependencies: - "@polkadot/params" "^0.15.8" + "@polkadot/params" "^0.16.5" babel-runtime "^6.26.0" -"@polkadot/params@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.15.8.tgz#b5b04dfd7f95ae3bfd38a360eece3d87aa1cc3a2" +"@polkadot/params@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.16.5.tgz#535b73132ff14181782b05b38df5d645ac27db6e" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/extrinsics" "^0.15.8" - "@polkadot/extrinsics-substrate" "^0.15.8" - "@polkadot/primitives" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/extrinsics" "^0.16.5" + "@polkadot/extrinsics-substrate" "^0.16.5" + "@polkadot/primitives" "^0.16.5" + "@polkadot/util" "^0.22.1" -"@polkadot/primitives-builder@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/primitives-builder/-/primitives-builder-0.15.8.tgz#6ce1db576234b62886ba29555ee366e85e14a4be" +"@polkadot/primitives-builder@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/primitives-builder/-/primitives-builder-0.16.5.tgz#b9794e0f45a19f4a38945f8f7ab2c35002dbedae" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/primitives" "^0.15.8" - "@polkadot/primitives-codec" "^0.15.8" - "@polkadot/util" "^0.21.3" - "@polkadot/util-crypto" "^0.21.3" - "@polkadot/util-triehash" "^0.21.3" + "@polkadot/primitives" "^0.16.5" + "@polkadot/primitives-codec" "^0.16.5" + "@polkadot/util" "^0.22.1" + "@polkadot/util-crypto" "^0.22.1" + "@polkadot/util-triehash" "^0.22.1" -"@polkadot/primitives-codec@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/primitives-codec/-/primitives-codec-0.15.8.tgz#1d57d253f149a7262222458f75a83601aa313bd0" +"@polkadot/primitives-codec@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/primitives-codec/-/primitives-codec-0.16.5.tgz#93beb37a886f11c2d32d222b9ffebcb8f39c2de8" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/primitives" "^0.15.8" - "@polkadot/primitives-builder" "^0.15.8" - "@polkadot/primitives-rlp" "^0.15.8" - "@polkadot/util" "^0.21.3" - "@polkadot/util-keyring" "^0.21.3" + "@polkadot/primitives" "^0.16.5" + "@polkadot/primitives-builder" "^0.16.5" + "@polkadot/primitives-rlp" "^0.16.5" + "@polkadot/util" "^0.22.1" + "@polkadot/util-keyring" "^0.22.1" -"@polkadot/primitives-json@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/primitives-json/-/primitives-json-0.15.8.tgz#ee1035ac744fe5a373152c8bc67ebf2be7643f12" +"@polkadot/primitives-json@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/primitives-json/-/primitives-json-0.16.5.tgz#a4b79054e93302fd31537dfcf1fb6b58518de0fa" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/primitives" "^0.15.8" - "@polkadot/primitives-builder" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/primitives" "^0.16.5" + "@polkadot/primitives-builder" "^0.16.5" + "@polkadot/util" "^0.22.1" -"@polkadot/primitives-rlp@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/primitives-rlp/-/primitives-rlp-0.15.8.tgz#7b6583d5026e69be48d6e029978656590c0ad4e6" +"@polkadot/primitives-rlp@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/primitives-rlp/-/primitives-rlp-0.16.5.tgz#1faae2336eee345b59985adf2a00587eb69a37ee" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/primitives" "^0.15.8" - "@polkadot/primitives-builder" "^0.15.8" - "@polkadot/util" "^0.21.3" - "@polkadot/util-crypto" "^0.21.3" + "@polkadot/primitives" "^0.16.5" + "@polkadot/primitives-builder" "^0.16.5" + "@polkadot/util" "^0.22.1" + "@polkadot/util-crypto" "^0.22.1" -"@polkadot/primitives@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.15.8.tgz#897e6dc947ab143da3eb05fd72cc874b9bd69304" +"@polkadot/primitives@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.16.5.tgz#f1806d1c0e549d8790bd02293ee71aae9cf8adb5" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/util" "^0.21.3" + "@polkadot/util" "^0.22.1" -"@polkadot/storage-substrate@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/storage-substrate/-/storage-substrate-0.15.8.tgz#1ef3442b369b1b537455a287e3d2f808ac2bba3f" +"@polkadot/storage-substrate@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/storage-substrate/-/storage-substrate-0.16.5.tgz#79d7d3c6fc6d1aa6fa3453a17133a7af8d2ed622" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/storage" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/storage" "^0.16.5" + "@polkadot/util" "^0.22.1" -"@polkadot/storage@^0.15.8": - version "0.15.8" - resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.15.8.tgz#a437074277eff576b468f921149fca612379a1df" +"@polkadot/storage@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.16.5.tgz#98be9f2e0feaaee7a8ecf7f9c85cc3ee42f551b4" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/params" "^0.15.8" - "@polkadot/primitives" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/params" "^0.16.5" + "@polkadot/primitives" "^0.16.5" + "@polkadot/util" "^0.22.1" -"@polkadot/ui-identicon@^0.13.4": - version "0.13.4" - resolved "https://registry.yarnpkg.com/@polkadot/ui-identicon/-/ui-identicon-0.13.4.tgz#c2b854825e2ece811163514dac7a733dfc887039" +"@polkadot/ui-identicon@^0.13.6": + version "0.13.6" + resolved "https://registry.yarnpkg.com/@polkadot/ui-identicon/-/ui-identicon-0.13.6.tgz#0c74fc3ff5e57025424becf40c4159fa0ce5a5c2" dependencies: "@babel/runtime" "^7.0.0-beta.47" color "^3.0.0" -"@polkadot/ui-react-rx@^0.13.4": - version "0.13.4" - resolved "https://registry.yarnpkg.com/@polkadot/ui-react-rx/-/ui-react-rx-0.13.4.tgz#23a01099b50619b761dcfbafa910e59e75b03b94" +"@polkadot/ui-react-rx@^0.13.6": + version "0.13.6" + resolved "https://registry.yarnpkg.com/@polkadot/ui-react-rx/-/ui-react-rx-0.13.6.tgz#125463300b26301f6c1cf7988b92366567fd30d8" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/api-provider" "^0.12.4" - "@polkadot/api-rx" "^0.12.4" - "@polkadot/jsonrpc" "^0.15.8" - "@polkadot/params" "^0.15.8" - "@polkadot/primitives" "^0.15.8" - "@polkadot/storage" "^0.15.8" - "@polkadot/storage-substrate" "^0.15.8" - "@polkadot/util" "^0.21.3" + "@polkadot/api-provider" "^0.12.6" + "@polkadot/api-rx" "^0.12.6" + "@polkadot/jsonrpc" "^0.16.5" + "@polkadot/params" "^0.16.5" + "@polkadot/primitives" "^0.16.5" + "@polkadot/storage" "^0.16.5" + "@polkadot/storage-substrate" "^0.16.5" + "@polkadot/util" "^0.22.1" -"@polkadot/ui-react@^0.13.4": - version "0.13.4" - resolved "https://registry.yarnpkg.com/@polkadot/ui-react/-/ui-react-0.13.4.tgz#4e60851400d738129585f965929095f5cdedd0cc" +"@polkadot/ui-react@^0.13.6": + version "0.13.6" + resolved "https://registry.yarnpkg.com/@polkadot/ui-react/-/ui-react-0.13.6.tgz#11603bf2e68d93eac00cc3b5c8de535a93273c30" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/ui-identicon" "^0.13.4" + "@polkadot/ui-identicon" "^0.13.6" -"@polkadot/util-crypto@^0.21.3": - version "0.21.3" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.21.3.tgz#96711c0c8f95b98bcffe140086d277fa1ef94676" +"@polkadot/util-crypto@^0.22.1": + version "0.22.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.22.1.tgz#c48c2ba52d6e92cf433a0db229e92a157c4a6448" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/util" "^0.21.3" + "@polkadot/util" "^0.22.1" blakejs "^1.1.0" js-sha3 "^0.7.0" tweetnacl "^1.0.0" xxhashjs "^0.2.2" -"@polkadot/util-keyring@^0.21.3": - version "0.21.3" - resolved "https://registry.yarnpkg.com/@polkadot/util-keyring/-/util-keyring-0.21.3.tgz#4b52134505af3cb4a0280412a5c595d4b6f7f9ec" +"@polkadot/util-keyring@^0.22.1": + version "0.22.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-keyring/-/util-keyring-0.22.1.tgz#c1bc9b9ba705be17e66a5292b107cd2e1e0678c8" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/util" "^0.21.3" - "@polkadot/util-crypto" "^0.21.3" + "@polkadot/util" "^0.22.1" + "@polkadot/util-crypto" "^0.22.1" bs58 "^4.0.1" -"@polkadot/util-rlp@^0.21.3": - version "0.21.3" - resolved "https://registry.yarnpkg.com/@polkadot/util-rlp/-/util-rlp-0.21.3.tgz#388c96e733087505072d6cbe329bb3ec46922d46" +"@polkadot/util-rlp@^0.22.1": + version "0.22.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-rlp/-/util-rlp-0.22.1.tgz#58d517af4430ecc9bc9cbb3802ec77511b2e56be" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/util" "^0.21.3" + "@polkadot/util" "^0.22.1" -"@polkadot/util-triehash@^0.21.3": - version "0.21.3" - resolved "https://registry.yarnpkg.com/@polkadot/util-triehash/-/util-triehash-0.21.3.tgz#e86d374dc60ddce81b219130ffcb0611d6a59ffe" +"@polkadot/util-triehash@^0.22.1": + version "0.22.1" + resolved "https://registry.yarnpkg.com/@polkadot/util-triehash/-/util-triehash-0.22.1.tgz#5eeb430e0a77a18ef931193f72fe88d5de56a00c" dependencies: "@babel/runtime" "^7.0.0-beta.47" - "@polkadot/util" "^0.21.3" - "@polkadot/util-crypto" "^0.21.3" - "@polkadot/util-rlp" "^0.21.3" + "@polkadot/util" "^0.22.1" + "@polkadot/util-crypto" "^0.22.1" + "@polkadot/util-rlp" "^0.22.1" -"@polkadot/util@^0.21.3": - version "0.21.3" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.21.3.tgz#8b1151a7b80156aefe1ac4a4a81642119a1b6bed" +"@polkadot/util@^0.22.1": + version "0.22.1" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.22.1.tgz#54966d2ffdee5a2c358c06b6c642e0d17c42442f" dependencies: "@babel/runtime" "^7.0.0-beta.47" bn.js "^4.11.8"