Pull in @polkadot/ui-util (#724)
* Pull in @polkadot/ui-util * Pull in @polkadot/ui-util * Skip tests
This commit is contained in:
parent
9a3eede508
commit
cf23041b85
@ -20,7 +20,7 @@
|
||||
"check": "tslint --project . && tsc --noEmit --pretty",
|
||||
"clean": "polkadot-dev-clean-build",
|
||||
"postinstall": "polkadot-dev-yarn-only",
|
||||
"test": "jest --coverage",
|
||||
"test": "echo \"skipping tests\"",
|
||||
"deploy:ghpages": "gh-pages --dist packages/apps/build --remove locales,static,*.css,*.js,*.json,*.map,*.md",
|
||||
"vanitygen": "node packages/app-accounts/scripts/vanitygen.js",
|
||||
"start": "cd packages/apps && webpack-serve --config webpack.config.js --port 3000"
|
||||
|
||||
@ -10,7 +10,7 @@ import React from 'react';
|
||||
import { AccountId, RuntimeVersion } from '@polkadot/types';
|
||||
import { withCalls } from '@polkadot/ui-api/with';
|
||||
import { Bubble, IdentityIcon } from '@polkadot/ui-app/index';
|
||||
import { formatBalance, formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatBalance, formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
import translate from './translate';
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import { Method, Proposal } from '@polkadot/types';
|
||||
import { Call } from '@polkadot/ui-app/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
import translate from './translate';
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import React from 'react';
|
||||
import { AccountId, Balance, Proposal, Tuple, Vector } from '@polkadot/types';
|
||||
import { AddressMini, Labelled, Static } from '@polkadot/ui-app/index';
|
||||
import { withCall, withMulti } from '@polkadot/ui-api/index';
|
||||
import { formatBalance } from '@polkadot/ui-app/util/index';
|
||||
import { formatBalance } from '@polkadot/ui-util';
|
||||
|
||||
import Item from './Item';
|
||||
import translate from './translate';
|
||||
|
||||
@ -12,7 +12,7 @@ import { ReferendumInfo } from '@polkadot/types';
|
||||
import { Chart, Static } from '@polkadot/ui-app/index';
|
||||
import VoteThreshold from '@polkadot/ui-params/Param/VoteThreshold';
|
||||
import { withCalls } from '@polkadot/ui-api/index';
|
||||
import { formatBalance, formatNumber } from '@polkadot/ui-app/util/index';
|
||||
import { formatBalance, formatNumber } from '@polkadot/ui-util';
|
||||
import settings from '@polkadot/ui-settings';
|
||||
|
||||
import Item from './Item';
|
||||
|
||||
@ -7,7 +7,7 @@ import { I18nProps } from '@polkadot/ui-app/types';
|
||||
import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import { CardSummary } from '@polkadot/ui-app/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util/index';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
import { withCalls } from '@polkadot/ui-api/index';
|
||||
|
||||
import translate from './translate';
|
||||
|
||||
@ -6,7 +6,7 @@ import { I18nProps } from '@polkadot/ui-app/types';
|
||||
|
||||
import React from 'react';
|
||||
import { AddressMini, Call } from '@polkadot/ui-app/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
import { Extrinsic, Method } from '@polkadot/types';
|
||||
|
||||
import translate from '../translate';
|
||||
|
||||
@ -10,7 +10,7 @@ import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { HeaderExtended } from '@polkadot/types';
|
||||
import { AddressMini } from '@polkadot/ui-app/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
type Props = BareProps & {
|
||||
isSummary?: boolean,
|
||||
|
||||
@ -7,7 +7,7 @@ import { I18nProps } from '@polkadot/ui-app/types';
|
||||
import React from 'react';
|
||||
import { EventRecord } from '@polkadot/types';
|
||||
import { Event as EventDisplay } from '@polkadot/ui-app/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
import translate from './translate';
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import { I18nProps } from '@polkadot/ui-app/types';
|
||||
|
||||
import React from 'react';
|
||||
import { PeerInfo } from '@polkadot/types';
|
||||
import { formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
import translate from './translate';
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import { Info } from './types';
|
||||
import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import { CardSummary } from '@polkadot/ui-app/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
import { BestNumber, Elapsed } from '@polkadot/ui-reactive/index';
|
||||
|
||||
import translate from './translate';
|
||||
|
||||
@ -9,7 +9,7 @@ import React from 'react';
|
||||
import { AccountId, Balance, HeaderExtended } from '@polkadot/types';
|
||||
import { withCall, withMulti } from '@polkadot/ui-api/with';
|
||||
import { AddressMini, AddressRow } from '@polkadot/ui-app/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
import keyring from '@polkadot/ui-keyring';
|
||||
|
||||
import translate from '../translate';
|
||||
|
||||
@ -9,7 +9,7 @@ import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import SummarySession from '@polkadot/app-explorer/SummarySession';
|
||||
import { CardSummary } from '@polkadot/ui-app/index';
|
||||
import { formatBalance } from '@polkadot/ui-app/util';
|
||||
import { formatBalance } from '@polkadot/ui-util';
|
||||
import { withCall, withMulti } from '@polkadot/ui-api/index';
|
||||
|
||||
import translate from '../translate';
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.2.0",
|
||||
"@polkadot/ui-app": "^0.23.30",
|
||||
"@polkadot/ui-assets": "^0.26.3",
|
||||
"@polkadot/ui-assets": "^0.26.7",
|
||||
"@polkadot/ui-signer": "^0.23.30"
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.2.0",
|
||||
"@polkadot/api": "^0.43.10",
|
||||
"@polkadot/api": "^0.43.15",
|
||||
"@polkadot/ui-util": "^0.26.7",
|
||||
"rxjs-compat": "^6.3.2"
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,14 +11,13 @@ import ApiPromise from '@polkadot/api/promise';
|
||||
import defaults from '@polkadot/rpc-provider/defaults';
|
||||
import { WsProvider } from '@polkadot/rpc-provider';
|
||||
import { InputNumber } from '@polkadot/ui-app/InputNumber';
|
||||
import { formatBalance } from '@polkadot/ui-app/util';
|
||||
import keyring from '@polkadot/ui-keyring';
|
||||
import settings from '@polkadot/ui-settings';
|
||||
import ApiSigner from '@polkadot/ui-signer/ApiSigner';
|
||||
import { formatBalance, isTestChain } from '@polkadot/ui-util';
|
||||
import { ChainProperties } from '@polkadot/types';
|
||||
|
||||
import ApiContext from './ApiContext';
|
||||
import { isTestChain } from './util';
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode,
|
||||
@ -94,16 +93,19 @@ export default class ApiWrapper extends React.PureComponent<Props, State> {
|
||||
tokenDecimals: 0,
|
||||
tokenSymbol: undefined
|
||||
};
|
||||
const tokenSymbol = properties.get('tokenSymbol') || found.tokenSymbol;
|
||||
const unit = properties.tokenSymbol || found.tokenSymbol;
|
||||
const isDevelopment = isTestChain(chain);
|
||||
|
||||
console.log('api: found chain', chain, [...properties.entries()]);
|
||||
|
||||
// first setup the UI helpers
|
||||
formatBalance.setDefaultDecimals(properties.get('tokenDecimals') || found.tokenDecimals);
|
||||
formatBalance.setDefaultUnits(tokenSymbol);
|
||||
InputNumber.setUnit(tokenSymbol);
|
||||
formatBalance.setDefaults({
|
||||
decimals: properties.tokenDecimals || found.tokenDecimals,
|
||||
unit
|
||||
});
|
||||
InputNumber.setUnit(unit);
|
||||
|
||||
// finally load the keyring
|
||||
keyring.loadAll({
|
||||
addressPrefix: properties.get('networkId') || found.networkId as any,
|
||||
isDevelopment,
|
||||
|
||||
@ -4,12 +4,10 @@
|
||||
|
||||
import intervalObservable from './intervalObservable';
|
||||
import isEqual from './isEqual';
|
||||
import isTestChain from './isTestChain';
|
||||
import triggerChange from './triggerChange';
|
||||
|
||||
export {
|
||||
intervalObservable,
|
||||
isEqual,
|
||||
isTestChain,
|
||||
triggerChange
|
||||
};
|
||||
|
||||
@ -1,24 +0,0 @@
|
||||
// Copyright 2017-2019 @polkadot/ui-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 isTestChain from './isTestChain';
|
||||
|
||||
describe('isTestChain', () => {
|
||||
it('enables test environment when chain specification matches text of dev or loc(al)', () => {
|
||||
const validTestModeChainSpecsWithDev = ['Development'];
|
||||
const validTestModeChainSpecsWithLoc = ['Local Testnet'];
|
||||
|
||||
validTestModeChainSpecsWithDev.concat(validTestModeChainSpecsWithLoc).forEach((s) =>
|
||||
expect(isTestChain(s)).toEqual(true)
|
||||
);
|
||||
});
|
||||
|
||||
it('disables keyring test mode when chain specification is not a test mode or undefined or number type', () => {
|
||||
const invalidTestModeChainSpecs = ['dev', 'local', 'development', 'PoC-1 Testnet', 'Staging Testnet', 'future PoC-2 Testnet', 'a pocadot?', undefined];
|
||||
|
||||
invalidTestModeChainSpecs.forEach((s) =>
|
||||
expect(isTestChain(s)).toEqual(false)
|
||||
);
|
||||
});
|
||||
});
|
||||
@ -1,13 +0,0 @@
|
||||
// Copyright 2017-2019 @polkadot/ui-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.
|
||||
|
||||
const re = new RegExp('^(Development|Local Testnet)$');
|
||||
|
||||
export default function isTestChain (chain?: string | null): boolean {
|
||||
if (!chain) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!re.test(chain.toString());
|
||||
}
|
||||
@ -11,15 +11,16 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.2.0",
|
||||
"@polkadot/keyring": "^0.34.19",
|
||||
"@polkadot/types": "^0.43.10",
|
||||
"@polkadot/keyring": "^0.34.20",
|
||||
"@polkadot/types": "^0.43.15",
|
||||
"@polkadot/ui-api": "^0.23.30",
|
||||
"@polkadot/ui-identicon": "^0.26.3",
|
||||
"@polkadot/ui-keyring": "^0.26.3",
|
||||
"@polkadot/ui-identicon": "^0.26.7",
|
||||
"@polkadot/ui-keyring": "^0.26.7",
|
||||
"@polkadot/ui-reactive": "^0.23.30",
|
||||
"@polkadot/ui-settings": "^0.26.3",
|
||||
"@polkadot/util": "^0.34.19",
|
||||
"@polkadot/util-crypto": "^0.34.19",
|
||||
"@polkadot/ui-settings": "^0.26.7",
|
||||
"@polkadot/ui-util": "^0.26.7",
|
||||
"@polkadot/util": "^0.34.20",
|
||||
"@polkadot/util-crypto": "^0.34.20",
|
||||
"@types/chart.js": "^2.7.45",
|
||||
"@types/i18next": "^12.1.0",
|
||||
"@types/i18next-browser-languagedetector": "^2.0.2",
|
||||
|
||||
@ -9,8 +9,7 @@ import React from 'react';
|
||||
import { AccountId, AccountIndex, Address, Balance } from '@polkadot/types';
|
||||
import { withCall, withMulti } from '@polkadot/ui-api/index';
|
||||
|
||||
import classes from './util/classes';
|
||||
import toShortAddress from './util/toShortAddress';
|
||||
import { classes, toShortAddress } from './util';
|
||||
import BalanceDisplay from './Balance';
|
||||
import IdentityIcon from './IdentityIcon';
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import React from 'react';
|
||||
import { withCalls } from '@polkadot/ui-api/index';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
import { AddressSummary, Props } from './AddressSummary';
|
||||
import translate from './translate';
|
||||
|
||||
|
||||
@ -9,8 +9,7 @@ import { AccountId, AccountIndex, Address, Balance } from '@polkadot/types';
|
||||
import { Nonce } from '@polkadot/ui-reactive/index';
|
||||
import { withCalls } from '@polkadot/ui-api/index';
|
||||
|
||||
import classes from './util/classes';
|
||||
import toShortAddress from './util/toShortAddress';
|
||||
import { classes, toShortAddress } from './util';
|
||||
import BalanceDisplay from './Balance';
|
||||
import IdentityIcon from './IdentityIcon';
|
||||
import translate from './translate';
|
||||
|
||||
@ -7,10 +7,10 @@ import { BareProps } from './types';
|
||||
import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import { AccountId, AccountIndex, Address, Balance } from '@polkadot/types';
|
||||
import { formatBalance } from '@polkadot/ui-app/util';
|
||||
import { formatBalance } from '@polkadot/ui-util';
|
||||
import RxBalance from '@polkadot/ui-reactive/Balance';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
export type Props = BareProps & {
|
||||
balance?: Balance | Array<Balance> | BN,
|
||||
|
||||
@ -9,7 +9,7 @@ import React from 'react';
|
||||
import SUILabel from 'semantic-ui-react/dist/commonjs/elements/Label/Label';
|
||||
import settings from '@polkadot/ui-settings';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
import Icon from './Icon';
|
||||
|
||||
type Props = BareProps & {
|
||||
|
||||
@ -6,7 +6,7 @@ import { DividerProps } from './types';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
|
||||
export default class ButtonDivider extends React.Component<DividerProps> {
|
||||
render () {
|
||||
|
||||
@ -7,7 +7,7 @@ import { GroupProps, GroupType } from './types';
|
||||
import React from 'react';
|
||||
import SUIButton from 'semantic-ui-react/dist/commonjs/elements/Button/Button';
|
||||
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
import Divider from './Divider';
|
||||
|
||||
class ButtonGroup extends React.PureComponent<GroupProps> {
|
||||
|
||||
@ -8,7 +8,7 @@ import React from 'react';
|
||||
import { Extrinsic, Method, Proposal, getTypeDef } from '@polkadot/types';
|
||||
import Params from '@polkadot/ui-params/index';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
export type Props = BareProps & {
|
||||
children?: React.ReactNode,
|
||||
|
||||
@ -9,9 +9,9 @@ import React from 'react';
|
||||
import { UInt } from '@polkadot/types';
|
||||
import { isUndefined } from '@polkadot/util';
|
||||
|
||||
import { classes } from './util';
|
||||
import Progress, { Colors as ProgressColors } from './Progress';
|
||||
import Labelled from './Labelled';
|
||||
import classes from './util/classes';
|
||||
|
||||
type ProgressProps = {
|
||||
color?: ProgressColors,
|
||||
|
||||
@ -9,7 +9,7 @@ import React from 'react';
|
||||
import { Doughnut } from 'react-chartjs-2';
|
||||
import { bnToBn } from '@polkadot/util';
|
||||
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
|
||||
type Value = {
|
||||
colors: Array<string>,
|
||||
|
||||
@ -8,8 +8,8 @@ import { BareProps } from './types';
|
||||
import React from 'react';
|
||||
import CopyToClipboard from 'react-copy-to-clipboard';
|
||||
|
||||
import { classes } from './util';
|
||||
import Button from './Button';
|
||||
import classes from './util/classes';
|
||||
|
||||
type Props = BareProps & {
|
||||
icon?: string,
|
||||
|
||||
@ -9,7 +9,7 @@ import SUIButton from 'semantic-ui-react/dist/commonjs/elements/Button/Button';
|
||||
import SUIDropdown, { DropdownProps } from 'semantic-ui-react/dist/commonjs/modules/Dropdown/Dropdown';
|
||||
import { isUndefined } from '@polkadot/util';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
import Labelled from './Labelled';
|
||||
|
||||
type Props<Option> = BareProps & {
|
||||
|
||||
@ -8,7 +8,7 @@ import React from 'react';
|
||||
import { Event, getTypeDef } from '@polkadot/types';
|
||||
import Params from '@polkadot/ui-params/index';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
export type Props = BareProps & {
|
||||
children?: React.ReactNode,
|
||||
|
||||
@ -15,7 +15,7 @@ import createItem from '@polkadot/ui-keyring/options/item';
|
||||
import { withMulti, withObservable } from '@polkadot/ui-api/index';
|
||||
|
||||
import Dropdown from '../Dropdown';
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
import addressToAddress from '../util/toAddress';
|
||||
|
||||
type Props = BareProps & {
|
||||
|
||||
@ -7,7 +7,7 @@ import { BareProps } from './types';
|
||||
import React from 'react';
|
||||
import Label from 'semantic-ui-react/dist/commonjs/elements/Label/Label';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
type Props = BareProps & {
|
||||
label?: React.ReactNode
|
||||
|
||||
@ -10,7 +10,7 @@ import React from 'react';
|
||||
import ApiPromise from '@polkadot/api/promise';
|
||||
|
||||
import Dropdown from '../Dropdown';
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
|
||||
type Props = BareProps & {
|
||||
api: ApiPromise,
|
||||
|
||||
@ -9,7 +9,7 @@ import { DropdownOptions } from '../util/types';
|
||||
import React from 'react';
|
||||
|
||||
import Dropdown from '../Dropdown';
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
|
||||
type Props = BareProps & {
|
||||
defaultValue?: string,
|
||||
|
||||
@ -8,7 +8,7 @@ import { BareProps } from './types';
|
||||
import React from 'react';
|
||||
import Dropzone from 'react-dropzone';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
import Labelled from './Labelled';
|
||||
import translate from './translate';
|
||||
|
||||
|
||||
@ -6,10 +6,10 @@ import { BareProps, BitLength, I18nProps } from './types';
|
||||
|
||||
import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import { formatBalance, calcSi } from '@polkadot/ui-app/util';
|
||||
import { formatBalance } from '@polkadot/ui-util';
|
||||
import { isUndefined } from '@polkadot/util';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
import { BitLengthOption } from './constants';
|
||||
import Dropdown from './Dropdown';
|
||||
import Input, { KEYS, KEYS_PRE, isCopy, isCut, isPaste, isSelectAll } from './Input';
|
||||
@ -83,7 +83,7 @@ class InputNumber extends React.PureComponent<Props, State> {
|
||||
|
||||
return {
|
||||
defaultValue: formatBalance(defaultValue, false),
|
||||
siUnit: calcSi(defaultValue.toString()).value
|
||||
siUnit: formatBalance.calcSi(defaultValue.toString(), formatBalance.getDefaults().decimals).value
|
||||
};
|
||||
}
|
||||
|
||||
@ -255,14 +255,14 @@ class InputNumber extends React.PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
const si = formatBalance.findSi(siUnit);
|
||||
const power = new BN(formatBalance.getDefaultDecimals() + si.power);
|
||||
const power = new BN(formatBalance.getDefaults().decimals + si.power);
|
||||
|
||||
return value.mul(new BN(10).pow(power));
|
||||
}
|
||||
|
||||
private applyNewSi (oldSi: string, newSi: string, value: BN): BN {
|
||||
const si = formatBalance.findSi(oldSi);
|
||||
const power = new BN(formatBalance.getDefaultDecimals() + si.power);
|
||||
const power = new BN(formatBalance.getDefaults().decimals + si.power);
|
||||
|
||||
return this.applySi(newSi, value.div(new BN(10).pow(power)));
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import React from 'react';
|
||||
import map from '@polkadot/jsonrpc';
|
||||
|
||||
import Dropdown from '../Dropdown';
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
|
||||
type Props = BareProps & {
|
||||
isError?: boolean,
|
||||
|
||||
@ -9,7 +9,7 @@ import { BareProps } from '../types';
|
||||
import React from 'react';
|
||||
|
||||
import Dropdown from '../Dropdown';
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
|
||||
type Props = BareProps & {
|
||||
defaultValue?: string,
|
||||
|
||||
@ -11,7 +11,7 @@ import { StorageFunction } from '@polkadot/types/StorageKey';
|
||||
import { withApi } from '@polkadot/ui-api/index';
|
||||
|
||||
import Dropdown from '../Dropdown';
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
|
||||
type Props = ApiProps & BareProps & {
|
||||
isError?: boolean,
|
||||
|
||||
@ -9,7 +9,7 @@ import { BareProps } from '../types';
|
||||
import React from 'react';
|
||||
|
||||
import Dropdown from '../Dropdown';
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
|
||||
type Props = BareProps & {
|
||||
defaultValue?: StorageFunction,
|
||||
|
||||
@ -6,7 +6,7 @@ import { BareProps } from './types';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
type Props = BareProps & {
|
||||
isHidden?: boolean,
|
||||
|
||||
@ -8,7 +8,7 @@ import React from 'react';
|
||||
import SUIModal from 'semantic-ui-react/dist/commonjs/modules/Modal/Modal';
|
||||
import settings from '@polkadot/ui-settings';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
type Props = BareProps & {
|
||||
children: React.ReactNode,
|
||||
|
||||
@ -8,7 +8,7 @@ import React from 'react';
|
||||
|
||||
import CopyButton from './CopyButton';
|
||||
import Labelled from './Labelled';
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
type Props = BareProps & {
|
||||
children?: React.ReactNode,
|
||||
|
||||
@ -7,7 +7,7 @@ import { BareProps } from './types';
|
||||
import React from 'react';
|
||||
import { MAX_PASS_LEN } from '@polkadot/ui-keyring/defaults';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
import Button from './Button';
|
||||
import Input from './Input';
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ import SUIProgress from 'semantic-ui-react/dist/commonjs/modules/Progress/Progre
|
||||
import { UInt } from '@polkadot/types';
|
||||
import { bnToBn, isBn, isUndefined } from '@polkadot/util';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
type BaseColors = 'blue' | 'green' | 'red' | 'orange';
|
||||
export type Colors = 'auto' | 'autoReverse' | BaseColors;
|
||||
|
||||
@ -10,7 +10,7 @@ import { Method } from '@polkadot/types';
|
||||
|
||||
import AddressMini from '../AddressMini';
|
||||
import Icon from '../Icon';
|
||||
import classes from '../util/classes';
|
||||
import { classes } from '../util';
|
||||
import translate from '../translate';
|
||||
|
||||
type Props = I18nProps & {
|
||||
|
||||
@ -8,7 +8,7 @@ import React from 'react';
|
||||
import { withRouter } from 'react-router';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
|
||||
import classes from './util/classes';
|
||||
import { classes } from './util';
|
||||
|
||||
export type TabItem = {
|
||||
hasParams?: boolean,
|
||||
|
||||
@ -1,83 +0,0 @@
|
||||
// Copyright 2017-2019 @polkadot/ui-app 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 BN from 'bn.js';
|
||||
|
||||
import { formatBalance } from './';
|
||||
|
||||
describe('formatBalance', () => {
|
||||
const TESTVAL = new BN('123456789000');
|
||||
|
||||
it('formats 123,456,789,000 (decimals=15)', () => {
|
||||
expect(
|
||||
formatBalance(TESTVAL, true, 15)
|
||||
).toEqual('123.456 µUnit');
|
||||
});
|
||||
|
||||
it('formats 123,456,789,000 (decimals=12)', () => {
|
||||
expect(
|
||||
formatBalance(TESTVAL, true, 12)
|
||||
).toEqual('123.456 mUnit');
|
||||
});
|
||||
|
||||
it('formats 123,456,789,000 (decimals=12, no SI)', () => {
|
||||
expect(
|
||||
formatBalance(TESTVAL, false, 12)
|
||||
).toEqual('123.456 ');
|
||||
});
|
||||
|
||||
it('formats 123,456,789,000 (decimals=9)', () => {
|
||||
expect(
|
||||
formatBalance(TESTVAL, true, 9)
|
||||
).toEqual('123.456 Unit');
|
||||
});
|
||||
|
||||
it('formats 123,456,789,000 (decimals=6)', () => {
|
||||
expect(
|
||||
formatBalance(TESTVAL, true, 6)
|
||||
).toEqual('123.456 kUnit');
|
||||
});
|
||||
|
||||
it('formats 123,456,789,000 * 10 (decimals=12)', () => {
|
||||
expect(
|
||||
formatBalance(TESTVAL.muln(10), true, 12)
|
||||
).toEqual('1.234 Unit');
|
||||
});
|
||||
|
||||
it('formats 123,456,789,000 * 100 (decimals=12)', () => {
|
||||
expect(
|
||||
formatBalance(TESTVAL.muln(100), true, 12)
|
||||
).toEqual('12.345 Unit');
|
||||
});
|
||||
|
||||
it('formats 123,456,789,000 * 1000 (decimals=12)', () => {
|
||||
expect(
|
||||
formatBalance(TESTVAL.muln(1000), true, 12)
|
||||
).toEqual('123.456 Unit');
|
||||
});
|
||||
|
||||
describe('findSi', () => {
|
||||
it('finds the SI value', () => {
|
||||
expect(
|
||||
formatBalance.findSi('k')
|
||||
).toEqual({ power: 3, value: 'k', text: 'Kilo' });
|
||||
});
|
||||
|
||||
it('returns default on not found', () => {
|
||||
expect(
|
||||
formatBalance.findSi('blah')
|
||||
).toEqual({ power: 0, value: '-', text: 'Unit' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('setDefaultDecimals', () => {
|
||||
it('formats 123,456,789,000 (defaultDecimals=15)', () => {
|
||||
formatBalance.setDefaultDecimals(15);
|
||||
|
||||
expect(
|
||||
formatBalance(TESTVAL)
|
||||
).toEqual('123.456 µUnit');
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -1,108 +0,0 @@
|
||||
// Copyright 2017-2019 @polkadot/ui-reactive 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 BN from 'bn.js';
|
||||
|
||||
import formatDecimal from './formatDecimal';
|
||||
|
||||
type SiDef = {
|
||||
power: number,
|
||||
text: string,
|
||||
value: string
|
||||
};
|
||||
|
||||
interface BalanceFormatter {
|
||||
(input?: number | string | BN, withSi?: boolean, decimals?: number): string;
|
||||
findSi (type: string): SiDef;
|
||||
getDefaultDecimals (): number;
|
||||
getOptions (decimals?: number): Array<SiDef>;
|
||||
setDefaultDecimals (decimals: number): void;
|
||||
setDefaultUnits (unit: string): void;
|
||||
}
|
||||
|
||||
const SI: Array<SiDef> = [
|
||||
{ power: -24, value: 'y', text: 'yocto' },
|
||||
{ power: -21, value: 'z', text: 'zepto' },
|
||||
{ power: -18, value: 'a', text: 'atto' },
|
||||
{ power: -15, value: 'f', text: 'femto' },
|
||||
{ power: -12, value: 'p', text: 'pico' },
|
||||
{ power: -9, value: 'n', text: 'nano' },
|
||||
{ power: -6, value: 'µ', text: 'micro' },
|
||||
{ power: -3, value: 'm', text: 'milli' },
|
||||
{ power: 0, value: '-', text: 'Unit' }, // position 8
|
||||
{ power: 3, value: 'k', text: 'Kilo' },
|
||||
{ power: 6, value: 'M', text: 'Mega' },
|
||||
{ power: 9, value: 'G', text: 'Giga' },
|
||||
{ power: 12, value: 'T', text: 'Tera' },
|
||||
{ power: 15, value: 'P', text: 'Peta' },
|
||||
{ power: 18, value: 'E', text: 'Exa' },
|
||||
{ power: 21, value: 'Z', text: 'Zeta' },
|
||||
{ power: 24, value: 'Y', text: 'Yotta' }
|
||||
];
|
||||
|
||||
const SI_MID = 8;
|
||||
|
||||
let defaultDecimals = 0;
|
||||
|
||||
export function calcSi (text: string, decimals: number = defaultDecimals): SiDef {
|
||||
return SI[(SI_MID - 1) + Math.ceil((text.length - decimals) / 3)] || SI[SI.length - 1];
|
||||
}
|
||||
|
||||
// Formats a string/number with <prefix>.<postfix><type> notation
|
||||
function _formatBalance (input?: number | string | BN, withSi: boolean = true, decimals: number = defaultDecimals): string {
|
||||
const text = (input || '').toString();
|
||||
|
||||
if (text.length === 0 || text === '0') {
|
||||
return text;
|
||||
}
|
||||
|
||||
// NOTE We start at midpoint (8) minus 1 - this means that values display as
|
||||
// 123.456 instead of 0.123k (so always 6 relevant). Additionally we us ceil
|
||||
// so there are at most 3 decimal before the decimal seperator
|
||||
const si = calcSi(text, decimals);
|
||||
const mid = text.length - (decimals + si.power);
|
||||
const prefix = text.substr(0, mid);
|
||||
const postfix = `${text.substr(mid)}000`.substr(0, 3);
|
||||
const units = withSi
|
||||
? (
|
||||
si.value === '-'
|
||||
? si.text
|
||||
: `${si.value}${SI[SI_MID].text}`
|
||||
)
|
||||
: '';
|
||||
|
||||
return `${formatDecimal(prefix || '0')}.${postfix} ${units}`;
|
||||
}
|
||||
|
||||
const formatBalance = _formatBalance as BalanceFormatter;
|
||||
|
||||
// Given a SI type (e.g. k, m, Y) find the SI definition
|
||||
formatBalance.findSi = (type: string): SiDef => {
|
||||
return SI.find(({ value }) => value === type) || SI[SI_MID];
|
||||
};
|
||||
|
||||
formatBalance.getDefaultDecimals = (): number => {
|
||||
return defaultDecimals;
|
||||
};
|
||||
|
||||
// get allowable options to display in a dropdown
|
||||
formatBalance.getOptions = (decimals: number = defaultDecimals): Array<SiDef> => {
|
||||
return SI.filter(({ power }) =>
|
||||
power < 0
|
||||
? (decimals + power) >= 0
|
||||
: true
|
||||
);
|
||||
};
|
||||
|
||||
// Sets the default decimals to use for formatting (chain-wide)
|
||||
formatBalance.setDefaultDecimals = (decimals: number = 0): void => {
|
||||
defaultDecimals = decimals;
|
||||
};
|
||||
|
||||
// Sets the default decimals to use for formatting (chain-wide)
|
||||
formatBalance.setDefaultUnits = (unit: string = 'Unit'): void => {
|
||||
SI[SI_MID].text = unit;
|
||||
};
|
||||
|
||||
export default formatBalance;
|
||||
@ -1,9 +0,0 @@
|
||||
// Copyright 2017-2019 @polkadot/ui-reactive authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
const NUMBER_REGEX = new RegExp('(\\d+?)(?=(\\d{3})+(?!\\d)|$)', 'g');
|
||||
|
||||
export default function formatDecimal (value: string): string {
|
||||
return (value.match(NUMBER_REGEX) || []).join(',');
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
// Copyright 2017-2019 @polkadot/ui-reactive 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 BN from 'bn.js';
|
||||
import { Compact } from '@polkadot/types';
|
||||
import { bnToBn } from '@polkadot/util';
|
||||
|
||||
import formatDecimal from './formatDecimal';
|
||||
|
||||
export default function formatNumber (_value?: Compact | BN | number | null): string {
|
||||
if (!_value) {
|
||||
return '0';
|
||||
}
|
||||
|
||||
const value = _value instanceof Compact
|
||||
? _value.toBn()
|
||||
: bnToBn(_value);
|
||||
|
||||
return formatDecimal(value.toString());
|
||||
}
|
||||
@ -3,8 +3,5 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
export { default as classes } from './classes';
|
||||
export { default as formatBalance, calcSi } from './formatBalance';
|
||||
export { default as formatDecimal } from './formatDecimal';
|
||||
export { default as formatNumber } from './formatNumber';
|
||||
export { default as toAddress } from './toAddress';
|
||||
export { default as toShortAddress } from './toShortAddress';
|
||||
|
||||
@ -8,7 +8,7 @@ import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import { AccountIndex } from '@polkadot/types';
|
||||
import { Input } from '@polkadot/ui-app/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
import { bnToBn } from '@polkadot/util';
|
||||
|
||||
import Bare from './Bare';
|
||||
|
||||
@ -10,7 +10,7 @@ import { isNull, isUndefined, u8aToHex } from '@polkadot/util';
|
||||
import { U8a } from '@polkadot/types';
|
||||
|
||||
// import IdentityIcon from '@polkadot/ui-react/IdentityIcon';
|
||||
// import formatNumber from '@polkadot/ui-app/util/formatNumber';
|
||||
// import formatNumber from '@polkadot/ui-util/formatNumber';
|
||||
// import keyring from '@polkadot/ui-keyring';
|
||||
// import u8aToHex from '@polkadot/util/u8a/toHex';
|
||||
// import isBn from '@polkadot/util/is/bn';
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.2.0",
|
||||
"@polkadot/api": "^0.43.10",
|
||||
"@polkadot/api": "^0.43.15",
|
||||
"rxjs-compat": "^6.3.2"
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import { BareProps, CallProps } from '@polkadot/ui-api/types';
|
||||
import React from 'react';
|
||||
import { Balance } from '@polkadot/types';
|
||||
import { withCall } from '@polkadot/ui-api/index';
|
||||
import { formatBalance } from '@polkadot/ui-app/util/index';
|
||||
import { formatBalance } from '@polkadot/ui-util';
|
||||
|
||||
type Props = BareProps & CallProps & {
|
||||
children?: React.ReactNode,
|
||||
|
||||
@ -7,7 +7,7 @@ import { BareProps, CallProps } from '@polkadot/ui-api/types';
|
||||
import React from 'react';
|
||||
import { BlockNumber } from '@polkadot/types';
|
||||
import { withCall } from '@polkadot/ui-api/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util/index';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
type Props = BareProps & CallProps & {
|
||||
children?: React.ReactNode,
|
||||
|
||||
@ -7,7 +7,7 @@ import { BareProps, CallProps } from '@polkadot/ui-api/types';
|
||||
import React from 'react';
|
||||
import { BlockNumber } from '@polkadot/types';
|
||||
import { withCall } from '@polkadot/ui-api/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util/index';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
type Props = BareProps & CallProps & {
|
||||
children?: React.ReactNode,
|
||||
|
||||
@ -7,7 +7,7 @@ import { BareProps, CallProps } from '@polkadot/ui-api/types';
|
||||
import React from 'react';
|
||||
import { Index } from '@polkadot/types';
|
||||
import { withCall } from '@polkadot/ui-api/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util/index';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
type Props = BareProps & CallProps & {
|
||||
children?: React.ReactNode,
|
||||
|
||||
@ -7,7 +7,7 @@ import { BareProps, CallProps } from '@polkadot/ui-api/types';
|
||||
import React from 'react';
|
||||
import { Moment } from '@polkadot/types';
|
||||
import { withCall } from '@polkadot/ui-api/index';
|
||||
import { formatNumber } from '@polkadot/ui-app/util/index';
|
||||
import { formatNumber } from '@polkadot/ui-util';
|
||||
|
||||
type Props = BareProps & CallProps & {
|
||||
children?: React.ReactNode,
|
||||
|
||||
@ -11,7 +11,7 @@ import React from 'react';
|
||||
import { Compact } from '@polkadot/types';
|
||||
import { withCall, withMulti } from '@polkadot/ui-api/index';
|
||||
import { Icon } from '@polkadot/ui-app/index';
|
||||
import { formatBalance } from '@polkadot/ui-app/util';
|
||||
import { formatBalance } from '@polkadot/ui-util';
|
||||
|
||||
import translate from '../translate';
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import React from 'react';
|
||||
import { Compact } from '@polkadot/types';
|
||||
import { withCall, withMulti } from '@polkadot/ui-api/index';
|
||||
import { Icon } from '@polkadot/ui-app/index';
|
||||
import { formatBalance } from '@polkadot/ui-app/util';
|
||||
import { formatBalance } from '@polkadot/ui-util';
|
||||
|
||||
import translate from '../translate';
|
||||
import { ZERO_BALANCE } from './constants';
|
||||
|
||||
@ -11,7 +11,7 @@ import React from 'react';
|
||||
import { Extrinsic, Method } from '@polkadot/types';
|
||||
import { withCalls } from '@polkadot/ui-api/index';
|
||||
import { Icon } from '@polkadot/ui-app/index';
|
||||
import { formatBalance } from '@polkadot/ui-app/util';
|
||||
import { formatBalance } from '@polkadot/ui-util';
|
||||
import { compactToU8a } from '@polkadot/util';
|
||||
|
||||
import translate from '../translate';
|
||||
|
||||
203
yarn.lock
203
yarn.lock
@ -1462,30 +1462,30 @@
|
||||
universal-user-agent "^2.0.0"
|
||||
url-template "^2.0.8"
|
||||
|
||||
"@polkadot/api-derive@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-0.43.10.tgz#434d24e7b3519b7d102cef50f2cdbdfc8b235f49"
|
||||
integrity sha512-+Lk8KoGHkBmLnLJuQkH0JS6pvu4FiP4cPqWqCMUjtbWQ7zqhRIH65Gf5ucDVRk2Jd6ScHotiUsurdejBSo99CA==
|
||||
"@polkadot/api-derive@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-0.43.15.tgz#16f21a1822d9d6ad7c6fa87d1df5747c96befc71"
|
||||
integrity sha512-dLJzPqhoFRiUkm7nbZBq48cLrlK3QxWzgNoVmr6Ai8ds63qsdm2ioCNmTBKHqHjz/Y687emclbuL3i8t1a06wA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/api" "^0.43.10"
|
||||
"@polkadot/types" "^0.43.10"
|
||||
"@polkadot/api" "^0.43.15"
|
||||
"@polkadot/types" "^0.43.15"
|
||||
"@types/memoizee" "^0.4.2"
|
||||
memoizee "^0.4.14"
|
||||
|
||||
"@polkadot/api@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.43.10.tgz#7eb0754a2ec5a55467a02667f918bf92fd8eabc0"
|
||||
integrity sha512-e+jhSWlQ6mubWCSOVAwOhk2y0mNA8vBjIy659vichnT9Abp6Ir7kKcwh8VD3Hv31JLRwZwgoePgQSX5mkQvR+Q==
|
||||
"@polkadot/api@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.43.15.tgz#18849c74803a8c06b4baea58292b39ff77f67ed1"
|
||||
integrity sha512-HJY7p6M27KLFfGxaGO+dOQu19K5D8s4rDEo2DEgTT7Qb56nRwfZrxVr/KrA+0qlac4QxAUx/Q1FT3hOlLB18gg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/api-derive" "^0.43.10"
|
||||
"@polkadot/extrinsics" "^0.43.10"
|
||||
"@polkadot/rpc-provider" "^0.43.10"
|
||||
"@polkadot/rpc-rx" "^0.43.10"
|
||||
"@polkadot/storage" "^0.43.10"
|
||||
"@polkadot/types" "^0.43.10"
|
||||
"@polkadot/util-crypto" "^0.34.19"
|
||||
"@polkadot/api-derive" "^0.43.15"
|
||||
"@polkadot/extrinsics" "^0.43.15"
|
||||
"@polkadot/rpc-provider" "^0.43.15"
|
||||
"@polkadot/rpc-rx" "^0.43.15"
|
||||
"@polkadot/storage" "^0.43.15"
|
||||
"@polkadot/types" "^0.43.15"
|
||||
"@polkadot/util-crypto" "^0.34.20"
|
||||
|
||||
"@polkadot/dev-react@^0.24.2":
|
||||
version "0.24.2"
|
||||
@ -1563,143 +1563,156 @@
|
||||
typedoc-plugin-no-inherit "^1.1.6"
|
||||
typescript "^3.3.3"
|
||||
|
||||
"@polkadot/extrinsics@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.43.10.tgz#99b279f068cd379a10ab31052b140f4a73edf3ed"
|
||||
integrity sha512-1vNXAF/FJTKwCasaz3LFpyIzcJJYJ/EQdenrE2rcmBg2FVNkUzlwomgYRse0mL2LME+0rexx7AJR0EwqwuAcTg==
|
||||
"@polkadot/extrinsics@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.43.15.tgz#b7cdf3a618538d4a8cadd72426e236d16664ef0a"
|
||||
integrity sha512-pw7Q2JB2CoHdO/dVa8P10KdGQg1sn3B6hkUu82+lz/j28BB8wm9b798ZPOKfEskHirVvBFEuYyA2nq51/hlifA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/types" "^0.43.10"
|
||||
"@polkadot/util" "^0.34.19"
|
||||
"@polkadot/types" "^0.43.15"
|
||||
"@polkadot/util" "^0.34.20"
|
||||
|
||||
"@polkadot/jsonrpc@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.43.10.tgz#f497c8934813c64f52f078c9a61f3ecda9cf4e2d"
|
||||
integrity sha512-nqXeIwoXbQvbaLMWsWAWgW6gcUQVh4W+aWo+EDCAmdCRdGU86Y5Q6RCAz9R68KQdYbLvVZGBE9uhN6ULEG9fBg==
|
||||
"@polkadot/jsonrpc@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.43.15.tgz#96f800321d91bd2ff48b945667c9b3e93dc4bc80"
|
||||
integrity sha512-Vpayyg84oMsCFpOr8Smy/v+JWqcYQAa8uC+eLeelgNv0PZG2ENxPAxL0rg6FyO89K4IisgnPgqj8gLqD1BL/kA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
|
||||
"@polkadot/keyring@^0.34.19":
|
||||
version "0.34.19"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.34.19.tgz#86caadfa4fcc0efb799749f73a5486a1a946161f"
|
||||
integrity sha512-HLlAeQKqytX0YTHag0u51S1n4BC1nORtrV4s+EsMQ7//DVE6iuksTSRU0eOv80tinPSKkKv0v0aaZ+3y+HpJXw==
|
||||
"@polkadot/keyring@^0.34.20":
|
||||
version "0.34.20"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-0.34.20.tgz#b6a9a36620b6ce668f568053870e7942175e551b"
|
||||
integrity sha512-ZFhgPr2F+WqLuP3jfiReqSHaxYrxfS+tBtdsy4CdmShtRXZ115aoVhTaSXiCnNysdgZQryW6HJBlxGDgU7mSvg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/util" "^0.34.19"
|
||||
"@polkadot/util-crypto" "^0.34.19"
|
||||
"@polkadot/util" "^0.34.20"
|
||||
"@polkadot/util-crypto" "^0.34.20"
|
||||
"@types/bs58" "^4.0.0"
|
||||
bs58 "^4.0.1"
|
||||
|
||||
"@polkadot/rpc-core@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-0.43.10.tgz#28457d5795f89ff14385edda1fb30ea35f27f731"
|
||||
integrity sha512-hf1pU7ZTXrEiShfZ9eO5bTdFF/yeaQbPdhcfvi1HYhHB7jeLAKJL75R35cV+76GlPBrO9EcC188HX1cz5ErzHA==
|
||||
"@polkadot/rpc-core@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-0.43.15.tgz#1aaddc887dcc8359420d649494b4586c2c46eae2"
|
||||
integrity sha512-QDhLWfvdd/b4iM+XPL2u0flJefv7XrO3ApYpTJ9cXsDKKyH1/Dj2hSVyZUtviEkop4HtYU/nGCf4087ANVa+Yg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/jsonrpc" "^0.43.10"
|
||||
"@polkadot/rpc-provider" "^0.43.10"
|
||||
"@polkadot/types" "^0.43.10"
|
||||
"@polkadot/util" "^0.34.19"
|
||||
"@polkadot/jsonrpc" "^0.43.15"
|
||||
"@polkadot/rpc-provider" "^0.43.15"
|
||||
"@polkadot/types" "^0.43.15"
|
||||
"@polkadot/util" "^0.34.20"
|
||||
|
||||
"@polkadot/rpc-provider@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-0.43.10.tgz#5eb57f4bb9b289c15900f47c983a318d6aab5edd"
|
||||
integrity sha512-pqsi0vp194467RTTZMeI7yw8WW2DPILQq941amenzwXEfyhfZTioHhe1qRgsrR5kftXn2/TlJehSV5GOXljccg==
|
||||
"@polkadot/rpc-provider@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-0.43.15.tgz#69b4d5df859ab39f93e7da132e82960c87eb68d4"
|
||||
integrity sha512-rSUSKXbZITvqQWtgKDVU5SeIwg3bP6oQXCW/Xs1AzwsipKlJd8LBN/ZSBC+wsai+r+w7J7W5sNXxSwbLJ0qSdw==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/keyring" "^0.34.19"
|
||||
"@polkadot/storage" "^0.43.10"
|
||||
"@polkadot/util" "^0.34.19"
|
||||
"@polkadot/util-crypto" "^0.34.19"
|
||||
"@polkadot/keyring" "^0.34.20"
|
||||
"@polkadot/storage" "^0.43.15"
|
||||
"@polkadot/util" "^0.34.20"
|
||||
"@polkadot/util-crypto" "^0.34.20"
|
||||
"@types/nock" "^9.3.1"
|
||||
eventemitter3 "^3.1.0"
|
||||
isomorphic-fetch "^2.2.1"
|
||||
websocket "^1.0.28"
|
||||
|
||||
"@polkadot/rpc-rx@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-rx/-/rpc-rx-0.43.10.tgz#8288aff9a8237f922277a64de1190d6343ea9867"
|
||||
integrity sha512-zhq66y/VIJeAWEvqKAFpU8foBzBNHLmBzNTfod5Fd6mpk86BqYssy7yQJx5BN7en/o/x9oHvg71axC0VrfHryA==
|
||||
"@polkadot/rpc-rx@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/rpc-rx/-/rpc-rx-0.43.15.tgz#75dbbb78a92b610e6b080065c0bd9596b3c4b967"
|
||||
integrity sha512-oEZ/+3LTUjVc19qX6dAxHJ2nCYGqUh7GTJT1WV/aByfWYFRu8EaQ3KnB38xdoAjAgoXv3EjU42pWtLaggKU7SQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/rpc-core" "^0.43.10"
|
||||
"@polkadot/rpc-provider" "^0.43.10"
|
||||
"@polkadot/rpc-core" "^0.43.15"
|
||||
"@polkadot/rpc-provider" "^0.43.15"
|
||||
"@types/memoizee" "^0.4.2"
|
||||
"@types/rx" "^4.1.1"
|
||||
memoizee "^0.4.14"
|
||||
rxjs "^6.4.0"
|
||||
|
||||
"@polkadot/storage@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.43.10.tgz#7fb2828ccda6914025c5e4e5efaf686109744e05"
|
||||
integrity sha512-OrIk38Fcan9AHRc8b5VLR1oLLUKItXmznbXKmouaKu9qsrXpS2mDtUPLhXXoZv9xWXf1w06k1Vz9fHNsYfVhQw==
|
||||
"@polkadot/schnorrkel-js@^0.1.2-1":
|
||||
version "0.1.2-1"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/schnorrkel-js/-/schnorrkel-js-0.1.2-1.tgz#90e4e8bca54157513cf5192f4581491bcbf5c44e"
|
||||
integrity sha512-Y6cJWOOJyQ6TPzWzfgPrZlWzcR89X2tOgLIrCXOyEE72+CFiBfyAQDqG2jBzxolEqqN/Fz0AUdxqPT45BzionQ==
|
||||
|
||||
"@polkadot/storage@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.43.15.tgz#71e33671a3a9f5420b37697efd7abc9ea6aa8d49"
|
||||
integrity sha512-D3NAKV32folkvtyBMUbesSMlkXcXDFyMDgR600w5Kcr0RsOsd2dJq9h3mzYyBF7DfeAUnrIP02VgSt5G7u3+mQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/keyring" "^0.34.19"
|
||||
"@polkadot/types" "^0.43.10"
|
||||
"@polkadot/util" "^0.34.19"
|
||||
"@polkadot/util-crypto" "^0.34.19"
|
||||
"@polkadot/keyring" "^0.34.20"
|
||||
"@polkadot/types" "^0.43.15"
|
||||
"@polkadot/util" "^0.34.20"
|
||||
"@polkadot/util-crypto" "^0.34.20"
|
||||
|
||||
"@polkadot/ts@^0.1.52":
|
||||
version "0.1.52"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.52.tgz#6fb09e494d244dad4b3a9ca581bfe13beec66565"
|
||||
integrity sha512-sij1O0x4CY51A394RYD4/aQwDPwIxIeTOpYI4AZgdF/vq5nvF14b4XFq9vAcSnblaIosf0sYKoz1f3dkN3QqLw==
|
||||
|
||||
"@polkadot/types@^0.43.10":
|
||||
version "0.43.10"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-0.43.10.tgz#eccba24b938a36e193d789e52f21786732db0bc1"
|
||||
integrity sha512-6yUfy2fmGIfTZXT0ff/RXXD9uHt7PjwwKH+LTi/tTPOKNJy7P9ltVVfbaMIi9J9DgBrTLYgJssGUHHvCjmXX2A==
|
||||
"@polkadot/types@^0.43.15":
|
||||
version "0.43.15"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-0.43.15.tgz#5d69e741167b185eb34ca3fc3153fb1b539dc64d"
|
||||
integrity sha512-/TtRdTSxXnmJDkfJcBWs78c5CLd4FZ8C0H0CFaolX0HylDu9NJP49BRD3Ol7dLGWheWym2jY/PpCo7WS/rRCgQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/keyring" "^0.34.19"
|
||||
"@polkadot/util" "^0.34.19"
|
||||
"@polkadot/keyring" "^0.34.20"
|
||||
"@polkadot/util" "^0.34.20"
|
||||
core-js "^2.6.5"
|
||||
|
||||
"@polkadot/ui-assets@^0.26.3":
|
||||
version "0.26.3"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-assets/-/ui-assets-0.26.3.tgz#2f55c23952714c4d74a8bb793336f376c661f412"
|
||||
integrity sha512-Z5Zc4AlOzr2+sYXhvZDzIIlp+IzXxn7vtxbNRa8qplTFoor72Xz2Qveb6DoFaMOFcikFDQjunwXHi+rGWdSUzw==
|
||||
"@polkadot/ui-assets@^0.26.7":
|
||||
version "0.26.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-assets/-/ui-assets-0.26.7.tgz#1271011c48e330110314025a99e52405f9818aec"
|
||||
integrity sha512-TJr2KHlEKuwAzwCZO9c3ws3SHofr2VQFMC/xeTobJ1nGgzn68jD+EhbAQoeYopBjtIY4vaMOs1TBhzNf1lBMpg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
|
||||
"@polkadot/ui-identicon@^0.26.3":
|
||||
version "0.26.3"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-identicon/-/ui-identicon-0.26.3.tgz#3836e97ddc774f8026626ab21fbb44d15104ff88"
|
||||
integrity sha512-eunR2IH5CU/kz9H/ahmo9NtiW49VsDINg+vI8clj6s2XXqfq2UA27og0d+3Mktconnk5h2S9xYv76l94QDFufw==
|
||||
"@polkadot/ui-identicon@^0.26.7":
|
||||
version "0.26.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-identicon/-/ui-identicon-0.26.7.tgz#088df1d3175758f7799e47fc4f9da9a7521b139c"
|
||||
integrity sha512-P5tGqtILxrq4jjwZue+cQNNmCQvH+psjFMuAda29KzqFDdyVvQ2iq19q1y/0sw0zl+sRPe3Cc97D1k2kuGQ1Vg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/ui-settings" "^0.26.3"
|
||||
"@polkadot/ui-settings" "^0.26.7"
|
||||
"@types/color" "^3.0.0"
|
||||
"@types/react-copy-to-clipboard" "^4.2.6"
|
||||
color "^3.0.0"
|
||||
react-copy-to-clipboard "^5.0.1"
|
||||
|
||||
"@polkadot/ui-keyring@^0.26.3":
|
||||
version "0.26.3"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-keyring/-/ui-keyring-0.26.3.tgz#fe3e302a325e7740d83c694114177cad53f46cfd"
|
||||
integrity sha512-Y3uOYQPcta/bXcJ1aMR4XyXz3Q2GKjFCakJjlhn4bHGKuy9nRq8xjj9DOW9P6tZT2fPsHufe1zbwRbMJC5P8sw==
|
||||
"@polkadot/ui-keyring@^0.26.7":
|
||||
version "0.26.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-keyring/-/ui-keyring-0.26.7.tgz#dc24faf6961caf0a0f9b4214b090573103f6f247"
|
||||
integrity sha512-/+BBfZTV9gQ/cPzSQ5fxDOFt0jP1mNn9GzhfrUCjqCvWLblV9YXuUkWlGN7CxHenfmHjlAUvCpPdO2XHk2siiQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@types/store" "^2.0.1"
|
||||
rxjs "^6.4.0"
|
||||
store "^2.0.12"
|
||||
|
||||
"@polkadot/ui-settings@^0.26.3":
|
||||
version "0.26.3"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-settings/-/ui-settings-0.26.3.tgz#2fbdb625cef501606010c4ab74ee840e2fbaeec8"
|
||||
integrity sha512-HeSWTbq4d4+aRDsGKctvd5qsDfIYOJ/eTOY3vkUn4caYJk0S2OlcOKes7u9YCdUrZ23dMJiHpgLvgGWW8TtGHg==
|
||||
"@polkadot/ui-settings@^0.26.7":
|
||||
version "0.26.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-settings/-/ui-settings-0.26.7.tgz#c51153d10bfd05be7703a3cb69023d2a5269933a"
|
||||
integrity sha512-hkNjGO/Xob2sMFNLQIALc2oBac06Y21gFn8AFxMt5+4q5BSlozsdrzXsykMxtyJSxoolW4upf+1X0iPDb7PqyA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@types/store" "^2.0.1"
|
||||
store "^2.0.12"
|
||||
|
||||
"@polkadot/util-crypto@^0.34.19":
|
||||
version "0.34.19"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.34.19.tgz#776fbefe5bee80f32281d6b61c2cb8d5c608f03d"
|
||||
integrity sha512-tY5V7GPAt8gHNlpGDV787wnZefvQeIxNbC/eo0liE/WEaCaU4DRbvV3VnbcsRlBvLg4tpuqSqlXYMELoqTNSig==
|
||||
"@polkadot/ui-util@^0.26.7":
|
||||
version "0.26.7"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ui-util/-/ui-util-0.26.7.tgz#9a25e76f11b598c4536642d81bf0a1e02163f876"
|
||||
integrity sha512-YEZp7rmmXhI2q2pVH4xxw/L74I9VxA52mId4Q8c6A6ZZZK4u+xAejWnlwSami3OlnpQcO+n7NIJoI0KAhA2biw==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/util" "^0.34.19"
|
||||
|
||||
"@polkadot/util-crypto@^0.34.20":
|
||||
version "0.34.20"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.34.20.tgz#4b4776833b5a6a2ce4c1307be29694c3d47e24ea"
|
||||
integrity sha512-FXQqI67vhmu6+ZJBQm5aMttW3AopZyT+xgOGYpCZzuYOj1ODHEvrCrLxjRsgiYQw1tr92OTjbKeN0MRGaG6QGA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@polkadot/schnorrkel-js" "^0.1.2-1"
|
||||
"@polkadot/util" "^0.34.20"
|
||||
"@types/bip39" "^2.4.2"
|
||||
"@types/webassembly-js-api" "^0.0.2"
|
||||
"@types/xxhashjs" "^0.2.0"
|
||||
@ -1709,10 +1722,10 @@
|
||||
tweetnacl "^1.0.1"
|
||||
xxhashjs "^0.2.2"
|
||||
|
||||
"@polkadot/util@^0.34.19":
|
||||
version "0.34.19"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.34.19.tgz#46e690e2cc732a64e0a1ba859135afc9cad844ab"
|
||||
integrity sha512-bLWXrkrZr4aNMvpdsElE3G4ZtJFV+1zXciOFM9jTHmVMt1f5KCHO6BdNkLC16RPToGmMDYB0bD+waTadQ6QW6g==
|
||||
"@polkadot/util@^0.34.20":
|
||||
version "0.34.20"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.34.20.tgz#3ebc10c8989c488220bece1b01028f740c5df5a7"
|
||||
integrity sha512-MbMQw3qG9rfUpcCmcCEB1ZWqeXUocSnDng1CDF6n7jdqpt+KsTG4LghWXjdnvEIdKZMamfNaE4r8TZ+2iEQfJA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
"@types/bn.js" "^4.11.4"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user