Format multiple balances w/ properties (#4480)
* Format mutiple balances w/ properties * Bump API * Update chainDecimals extraction * Fox bounties mock API * Expand rendering * Bumps
This commit is contained in:
parent
95e275e0ab
commit
38b7ebc24c
20
package.json
20
package.json
@ -12,17 +12,17 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"@polkadot/api": "^3.5.2-10",
|
||||
"@polkadot/api-contract": "^3.5.2-10",
|
||||
"@polkadot/hw-ledger": "^5.3.2-7",
|
||||
"@polkadot/keyring": "^5.3.2-7",
|
||||
"@polkadot/networks": "^5.3.2-7",
|
||||
"@polkadot/phishing": "^0.3.22",
|
||||
"@polkadot/types": "^3.5.2-10",
|
||||
"@polkadot/util": "^5.3.2-7",
|
||||
"@polkadot/util-crypto": "^5.3.2-7",
|
||||
"@polkadot/api": "^3.5.2-13",
|
||||
"@polkadot/api-contract": "^3.5.2-13",
|
||||
"@polkadot/hw-ledger": "^5.3.2-8",
|
||||
"@polkadot/keyring": "^5.3.2-8",
|
||||
"@polkadot/networks": "^5.3.2-8",
|
||||
"@polkadot/phishing": "^0.3.23",
|
||||
"@polkadot/types": "^3.5.2-13",
|
||||
"@polkadot/util": "^5.3.2-8",
|
||||
"@polkadot/util-crypto": "^5.3.2-8",
|
||||
"@polkadot/wasm-crypto": "^3.2.1",
|
||||
"@polkadot/x-rxjs": "^5.3.2-7",
|
||||
"@polkadot/x-rxjs": "^5.3.2-8",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"styled-components": "^5.2.0",
|
||||
"typescript": "^4.1.3"
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
"@edgeware/node-types": "^3.2.0",
|
||||
"@interlay/polkabtc-types": "^0.3.1",
|
||||
"@laminar/type-definitions": "^0.2.0-beta.143",
|
||||
"@polkadot/networks": "^5.3.2-7",
|
||||
"@polkadot/networks": "^5.3.2-8",
|
||||
"@sora-substrate/type-definitions": "^0.3.5",
|
||||
"@subsocial/types": "^0.4.28",
|
||||
"moonbeam-types-bundle": "^1.0.6"
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@polkadot/phishing": "^0.3.22",
|
||||
"@polkadot/phishing": "^0.3.23",
|
||||
"@polkadot/react-components": "^0.76.2-23",
|
||||
"@polkadot/vanitygen": "^0.25.2-2",
|
||||
"detect-browser": "^5.2.0",
|
||||
|
||||
@ -101,20 +101,22 @@ describe('Bounties', () => {
|
||||
const renderBounties = (bountyApi: Partial<BountyApi> = {}, { balance = 1 } = {}) => {
|
||||
mockBountyApi = { ...mockBountyApi, ...bountyApi };
|
||||
mockBalance = balanceOf(balance);
|
||||
const mockApi: ApiProps = { api: {
|
||||
derive: {
|
||||
accounts: { info: () => Promise.resolve(() => { /**/ }) }
|
||||
},
|
||||
genesisHash: aGenesisHash(),
|
||||
query: {},
|
||||
registry: { chainDecimals: 12 },
|
||||
tx: {
|
||||
council: {
|
||||
propose
|
||||
const mockApi: ApiProps = {
|
||||
api: {
|
||||
derive: {
|
||||
accounts: { info: () => Promise.resolve(() => { /**/ }) }
|
||||
},
|
||||
genesisHash: aGenesisHash(),
|
||||
query: {},
|
||||
registry: { chainDecimals: [12], chainTokens: ['Unit'] },
|
||||
tx: {
|
||||
council: {
|
||||
propose
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
systemName: 'substrate' } as unknown as ApiProps;
|
||||
},
|
||||
systemName: 'substrate'
|
||||
} as unknown as ApiProps;
|
||||
|
||||
const queue = {
|
||||
queueExtrinsic
|
||||
|
||||
@ -10,6 +10,6 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@polkadot/api-contract": "^3.5.2-10"
|
||||
"@polkadot/api-contract": "^3.5.2-13"
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import { getSystemChainColor, getSystemIcon } from '@polkadot/apps-config';
|
||||
import { DEFAULT_DECIMALS, DEFAULT_SS58 } from '@polkadot/react-api';
|
||||
import { useApi } from '@polkadot/react-hooks';
|
||||
import { getSpecTypes } from '@polkadot/types-known';
|
||||
import { isNumber } from '@polkadot/util';
|
||||
import { formatBalance, isNumber } from '@polkadot/util';
|
||||
|
||||
function createInfo (api: ApiPromise, systemChain: string, systemName: string): ChainInfo {
|
||||
return {
|
||||
@ -21,8 +21,8 @@ function createInfo (api: ApiPromise, systemChain: string, systemName: string):
|
||||
metaCalls: Buffer.from(api.runtimeMetadata.asCallsOnly.toU8a()).toString('base64'),
|
||||
specVersion: api.runtimeVersion.specVersion.toNumber(),
|
||||
ss58Format: isNumber(api.registry.chainSS58) ? api.registry.chainSS58 : DEFAULT_SS58.toNumber(),
|
||||
tokenDecimals: isNumber(api.registry.chainDecimals) ? api.registry.chainDecimals : DEFAULT_DECIMALS.toNumber(),
|
||||
tokenSymbol: api.registry.chainToken || 'Unit',
|
||||
tokenDecimals: (api.registry.chainDecimals || [DEFAULT_DECIMALS.toNumber()])[0],
|
||||
tokenSymbol: (api.registry.chainTokens || formatBalance.getDefaults().unit)[0],
|
||||
types: getSpecTypes(api.registry, systemChain, api.runtimeVersion.specName, api.runtimeVersion.specVersion) as unknown as Record<string, string>
|
||||
};
|
||||
}
|
||||
|
||||
@ -52,8 +52,8 @@ function saveProperties (api: ApiPromise, { name, version }: InjectedExtension):
|
||||
allProperties[name] = {
|
||||
extensionVersion: version,
|
||||
ss58Format: api.registry.chainSS58,
|
||||
tokenDecimals: api.registry.chainDecimals,
|
||||
tokenSymbol: api.registry.chainToken
|
||||
tokenDecimals: api.registry.chainDecimals[0],
|
||||
tokenSymbol: api.registry.chainTokens[0]
|
||||
};
|
||||
|
||||
store.set(storeKey, allProperties);
|
||||
@ -73,8 +73,8 @@ function hasCurrentProperties (api: ApiPromise, { extension }: ExtensionKnown):
|
||||
const { ss58Format, tokenDecimals, tokenSymbol } = allProperties[extension.name];
|
||||
|
||||
return ss58Format === api.registry.chainSS58 &&
|
||||
tokenDecimals === api.registry.chainDecimals &&
|
||||
tokenSymbol === api.registry.chainToken;
|
||||
tokenDecimals === api.registry.chainDecimals[0] &&
|
||||
tokenSymbol === api.registry.chainTokens[0];
|
||||
}
|
||||
|
||||
// filter extensions based on the properties we have available
|
||||
|
||||
@ -15,9 +15,9 @@
|
||||
"homepage": "https://github.com/polkadot-js/apps/tree/master/packages/react-api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@polkadot/api": "^3.5.2-10",
|
||||
"@polkadot/api": "^3.5.2-13",
|
||||
"@polkadot/extension-dapp": "^0.36.2-8",
|
||||
"@polkadot/x-rxjs": "^5.3.2-7",
|
||||
"@polkadot/x-rxjs": "^5.3.2-8",
|
||||
"fflate": "^0.6.0"
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
// Copyright 2017-2021 @polkadot/react-api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type BN from 'bn.js';
|
||||
import type { InjectedExtension } from '@polkadot/extension-inject/types';
|
||||
import type { ChainProperties, ChainType } from '@polkadot/types/interfaces';
|
||||
import type { KeyringStore } from '@polkadot/ui-keyring/types';
|
||||
@ -11,7 +12,7 @@ import store from 'store';
|
||||
|
||||
import { ApiPromise } from '@polkadot/api/promise';
|
||||
import { deriveMapCache, setDeriveCache } from '@polkadot/api-derive/util';
|
||||
import { ethereumChains, POLKADOT_GENESIS, typesBundle, typesChain, typesSpec } from '@polkadot/apps-config';
|
||||
import { ethereumChains, typesBundle, typesChain, typesSpec } from '@polkadot/apps-config';
|
||||
import { web3Accounts, web3Enable } from '@polkadot/extension-dapp';
|
||||
import { TokenUnit } from '@polkadot/react-components/InputNumber';
|
||||
import { StatusContext } from '@polkadot/react-components/Status';
|
||||
@ -53,6 +54,7 @@ interface ChainData {
|
||||
|
||||
export const DEFAULT_DECIMALS = registry.createType('u32', 12);
|
||||
export const DEFAULT_SS58 = registry.createType('u32', addressDefaults.prefix);
|
||||
export const DEFAULT_AUX = ['Aux1', 'Aux2', 'Aux3', 'Aux4', 'Aux5', 'Aux6', 'Aux7', 'Aux8', 'Aux9'];
|
||||
|
||||
let api: ApiPromise;
|
||||
|
||||
@ -110,11 +112,7 @@ async function retrieve (api: ApiPromise, injectedPromise: Promise<InjectedExten
|
||||
|
||||
// HACK Horrible hack to try and give some window to the DOT denomination
|
||||
const ss58Format = api.consts.system?.ss58Prefix || chainProperties.ss58Format;
|
||||
const properties = registry.createType('ChainProperties',
|
||||
api.genesisHash.eq(POLKADOT_GENESIS)
|
||||
? { ...chainProperties, ss58Format, tokenDecimals: 10, tokenSymbol: 'DOT' }
|
||||
: { ...chainProperties, ss58Format }
|
||||
);
|
||||
const properties = registry.createType('ChainProperties', { ...chainProperties, ss58Format });
|
||||
|
||||
return {
|
||||
injectedAccounts,
|
||||
@ -132,8 +130,8 @@ async function loadOnReady (api: ApiPromise, injectedPromise: Promise<InjectedEx
|
||||
const ss58Format = settings.prefix === -1
|
||||
? properties.ss58Format.unwrapOr(DEFAULT_SS58).toNumber()
|
||||
: settings.prefix;
|
||||
const tokenSymbol = properties.tokenSymbol.unwrapOr(undefined)?.toString();
|
||||
const tokenDecimals = properties.tokenDecimals.unwrapOr(DEFAULT_DECIMALS).toNumber();
|
||||
const tokenSymbol = properties.tokenSymbol.unwrapOr([formatBalance.getDefaults().unit, ...DEFAULT_AUX]);
|
||||
const tokenDecimals = properties.tokenDecimals.unwrapOr([DEFAULT_DECIMALS]);
|
||||
const isEthereum = ethereumChains.includes(api.runtimeVersion.specName.toString());
|
||||
const isDevelopment = !isEthereum && (systemChainType.isDevelopment || systemChainType.isLocal || isTestChain(systemChain));
|
||||
|
||||
@ -147,10 +145,10 @@ async function loadOnReady (api: ApiPromise, injectedPromise: Promise<InjectedEx
|
||||
|
||||
// first setup the UI helpers
|
||||
formatBalance.setDefaults({
|
||||
decimals: tokenDecimals,
|
||||
unit: tokenSymbol
|
||||
decimals: (tokenDecimals as BN[]).map((b) => b.toNumber()),
|
||||
unit: tokenSymbol[0].toString()
|
||||
});
|
||||
TokenUnit.setAbbr(tokenSymbol);
|
||||
TokenUnit.setAbbr(tokenSymbol[0].toString());
|
||||
|
||||
// finally load the keyring
|
||||
isKeyringLoaded() || keyring.loadAll({
|
||||
|
||||
@ -12,15 +12,15 @@
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.34",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.2",
|
||||
"@fortawesome/react-fontawesome": "^0.1.14",
|
||||
"@polkadot/keyring": "^5.3.2-7",
|
||||
"@polkadot/keyring": "^5.3.2-8",
|
||||
"@polkadot/react-api": "^0.76.2-23",
|
||||
"@polkadot/react-identicon": "^0.66.4-1",
|
||||
"@polkadot/react-qr": "^0.66.4-1",
|
||||
"@polkadot/react-query": "^0.76.2-23",
|
||||
"@polkadot/ui-keyring": "^0.66.4-1",
|
||||
"@polkadot/ui-settings": "^0.66.4-1",
|
||||
"@polkadot/util": "^5.3.2-7",
|
||||
"@polkadot/util-crypto": "^5.3.2-7",
|
||||
"@polkadot/util": "^5.3.2-8",
|
||||
"@polkadot/util-crypto": "^5.3.2-8",
|
||||
"chart.js": "^2.9.4",
|
||||
"codeflask": "^1.4.1",
|
||||
"i18next": "^19.8.4",
|
||||
|
||||
@ -216,162 +216,174 @@ function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Prop
|
||||
);
|
||||
}
|
||||
|
||||
function createBalanceItems (index: number, lookup: Record<string, string>, t: TFunction, { address, balanceDisplay, balancesAll, bestNumber, democracyLocks, isAllLocked, otherBonded, ownBonded, stakingInfo, withBalanceToggle }: { address: string; balanceDisplay: BalanceActiveType; balancesAll?: DeriveBalancesAll | DeriveBalancesAccountData; bestNumber: BlockNumber; democracyLocks?: DeriveDemocracyLock[]; isAllLocked: boolean; otherBonded: BN[]; ownBonded: BN; stakingInfo?: DeriveStakingAccount; withBalanceToggle: boolean }): React.ReactNode {
|
||||
const allItems = (
|
||||
<>
|
||||
{!withBalanceToggle && balancesAll && balanceDisplay.total && (
|
||||
<>
|
||||
<Label label={t<string>('total')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
value={balancesAll.freeBalance.add(balancesAll.reservedBalance)}
|
||||
function createBalanceItems (formatIndex: number, lookup: Record<string, string>, t: TFunction, { address, balanceDisplay, balancesAll, bestNumber, democracyLocks, isAllLocked, otherBonded, ownBonded, stakingInfo, withBalanceToggle }: { address: string; balanceDisplay: BalanceActiveType; balancesAll?: DeriveBalancesAll | DeriveBalancesAccountData; bestNumber: BlockNumber; democracyLocks?: DeriveDemocracyLock[]; isAllLocked: boolean; otherBonded: BN[]; ownBonded: BN; stakingInfo?: DeriveStakingAccount; withBalanceToggle: boolean }): React.ReactNode {
|
||||
const allItems: React.ReactNode[] = [];
|
||||
|
||||
!withBalanceToggle && balancesAll && balanceDisplay.total && allItems.push(
|
||||
<React.Fragment key={0}>
|
||||
<Label label={t<string>('total')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
formatIndex={formatIndex}
|
||||
value={balancesAll.freeBalance.add(balancesAll.reservedBalance)}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
balancesAll && balanceDisplay.available && (balancesAll as DeriveBalancesAll).availableBalance && allItems.push(
|
||||
<React.Fragment key={1}>
|
||||
<Label label={t<string>('transferrable')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
formatIndex={formatIndex}
|
||||
value={(balancesAll as DeriveBalancesAll).availableBalance}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
balanceDisplay.vested && (balancesAll as DeriveBalancesAll)?.isVesting && allItems.push(
|
||||
<React.Fragment key={2}>
|
||||
<Label label={t<string>('vested')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
formatIndex={formatIndex}
|
||||
label={
|
||||
<Icon
|
||||
icon='info-circle'
|
||||
tooltip={`${address}-vested-trigger`}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{balancesAll && balanceDisplay.available && (balancesAll as DeriveBalancesAll).availableBalance && (
|
||||
<>
|
||||
<Label label={t<string>('transferrable')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
value={(balancesAll as DeriveBalancesAll).availableBalance}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{balanceDisplay.vested && (balancesAll as DeriveBalancesAll)?.isVesting && (
|
||||
<>
|
||||
<Label label={t<string>('vested')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
label={
|
||||
<Icon
|
||||
icon='info-circle'
|
||||
tooltip={`${address}-vested-trigger`}
|
||||
/>
|
||||
}
|
||||
value={(balancesAll as DeriveBalancesAll).vestedBalance}
|
||||
>
|
||||
<Tooltip
|
||||
text={
|
||||
}
|
||||
value={(balancesAll as DeriveBalancesAll).vestedBalance}
|
||||
>
|
||||
<Tooltip
|
||||
text={
|
||||
<>
|
||||
<div>
|
||||
{formatBalance((balancesAll as DeriveBalancesAll).vestedClaimable, { forceUnit: '-' })}
|
||||
<div className='faded'>{t('available to be unlocked')}</div>
|
||||
</div>
|
||||
{bestNumber.lt((balancesAll as DeriveBalancesAll).vestingEndBlock) && (
|
||||
<>
|
||||
<div>
|
||||
{formatBalance((balancesAll as DeriveBalancesAll).vestedClaimable, { forceUnit: '-' })}
|
||||
<div className='faded'>{t('available to be unlocked')}</div>
|
||||
<BlockToTime blocks={(balancesAll as DeriveBalancesAll).vestingEndBlock.sub(bestNumber)} />
|
||||
<div className='faded'>{t('until block')} {formatNumber((balancesAll as DeriveBalancesAll).vestingEndBlock)}</div>
|
||||
</div>
|
||||
<div>
|
||||
{formatBalance((balancesAll as DeriveBalancesAll).vestingPerBlock)}
|
||||
<div className='faded'>{t('per block')}</div>
|
||||
</div>
|
||||
{bestNumber.lt((balancesAll as DeriveBalancesAll).vestingEndBlock) && (
|
||||
<>
|
||||
<div>
|
||||
<BlockToTime blocks={(balancesAll as DeriveBalancesAll).vestingEndBlock.sub(bestNumber)} />
|
||||
<div className='faded'>{t('until block')} {formatNumber((balancesAll as DeriveBalancesAll).vestingEndBlock)}</div>
|
||||
</div>
|
||||
<div>
|
||||
{formatBalance((balancesAll as DeriveBalancesAll).vestingPerBlock)}
|
||||
<div className='faded'>{t('per block')}</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
trigger={`${address}-vested-trigger`}
|
||||
/>
|
||||
</FormatBalance>
|
||||
</>
|
||||
)}
|
||||
{balanceDisplay.locked && balancesAll && (isAllLocked || (balancesAll as DeriveBalancesAll).lockedBalance?.gtn(0)) && (
|
||||
<>
|
||||
<Label label={t<string>('locked')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
label={
|
||||
<Icon
|
||||
icon='info-circle'
|
||||
tooltip={`${address}-locks-trigger`}
|
||||
/>
|
||||
}
|
||||
value={isAllLocked ? 'all' : (balancesAll as DeriveBalancesAll).lockedBalance}
|
||||
>
|
||||
<Tooltip
|
||||
text={(balancesAll as DeriveBalancesAll).lockedBreakdown.map(({ amount, id, reasons }, index): React.ReactNode => (
|
||||
<div key={index}>
|
||||
{amount.isMax()
|
||||
? t<string>('everything')
|
||||
: formatBalance(amount, { forceUnit: '-' })
|
||||
}{id && <div className='faded'>{lookupLock(lookup, id)}</div>}<div className='faded'>{reasons.toString()}</div>
|
||||
</div>
|
||||
))}
|
||||
trigger={`${address}-locks-trigger`}
|
||||
/>
|
||||
</FormatBalance>
|
||||
</>
|
||||
)}
|
||||
{balanceDisplay.reserved && balancesAll?.reservedBalance?.gtn(0) && (
|
||||
<>
|
||||
<Label label={t<string>('reserved')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
value={balancesAll.reservedBalance}
|
||||
)}
|
||||
</>
|
||||
}
|
||||
trigger={`${address}-vested-trigger`}
|
||||
/>
|
||||
</FormatBalance>
|
||||
</React.Fragment>
|
||||
);
|
||||
balanceDisplay.locked && balancesAll && (isAllLocked || (balancesAll as DeriveBalancesAll).lockedBalance?.gtn(0)) && allItems.push(
|
||||
<React.Fragment key={3}>
|
||||
<Label label={t<string>('locked')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
formatIndex={formatIndex}
|
||||
label={
|
||||
<Icon
|
||||
icon='info-circle'
|
||||
tooltip={`${address}-locks-trigger`}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{balanceDisplay.bonded && (ownBonded.gtn(0) || otherBonded.length !== 0) && (
|
||||
<>
|
||||
<Label label={t<string>('bonded')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
value={ownBonded}
|
||||
>
|
||||
{otherBonded.length !== 0 && (
|
||||
<> (+{otherBonded.map((bonded, index): React.ReactNode =>
|
||||
<FormatBalance
|
||||
key={index}
|
||||
value={bonded}
|
||||
/>
|
||||
)})</>
|
||||
)}
|
||||
</FormatBalance>
|
||||
</>
|
||||
)}
|
||||
{balanceDisplay.redeemable && stakingInfo?.redeemable?.gtn(0) && (
|
||||
<>
|
||||
<Label label={t<string>('redeemable')} />
|
||||
<StakingRedeemable
|
||||
className='result'
|
||||
stakingInfo={stakingInfo}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{balanceDisplay.unlocking && stakingInfo?.unlocking && (
|
||||
<>
|
||||
<Label label={t<string>('unbonding')} />
|
||||
<div className='result'>
|
||||
<StakingUnbonding stakingInfo={stakingInfo} />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{balanceDisplay.unlocking && democracyLocks && (democracyLocks.length !== 0) && (
|
||||
<>
|
||||
<Label label={t<string>('democracy')} />
|
||||
<div className='result'>
|
||||
<DemocracyLocks value={democracyLocks} />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
value={isAllLocked ? 'all' : (balancesAll as DeriveBalancesAll).lockedBalance}
|
||||
>
|
||||
<Tooltip
|
||||
text={(balancesAll as DeriveBalancesAll).lockedBreakdown.map(({ amount, id, reasons }, index): React.ReactNode => (
|
||||
<div key={index}>
|
||||
{amount.isMax()
|
||||
? t<string>('everything')
|
||||
: formatBalance(amount, { forceUnit: '-' })
|
||||
}{id && <div className='faded'>{lookupLock(lookup, id)}</div>}<div className='faded'>{reasons.toString()}</div>
|
||||
</div>
|
||||
))}
|
||||
trigger={`${address}-locks-trigger`}
|
||||
/>
|
||||
</FormatBalance>
|
||||
</React.Fragment>
|
||||
);
|
||||
balanceDisplay.reserved && balancesAll?.reservedBalance?.gtn(0) && allItems.push(
|
||||
<React.Fragment key={4}>
|
||||
<Label label={t<string>('reserved')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
formatIndex={formatIndex}
|
||||
value={balancesAll.reservedBalance}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
balanceDisplay.bonded && (ownBonded.gtn(0) || otherBonded.length !== 0) && allItems.push(
|
||||
<React.Fragment key={5}>
|
||||
<Label label={t<string>('bonded')} />
|
||||
<FormatBalance
|
||||
className='result'
|
||||
formatIndex={formatIndex}
|
||||
value={ownBonded}
|
||||
>
|
||||
{otherBonded.length !== 0 && (
|
||||
<> (+{otherBonded.map((bonded, index): React.ReactNode =>
|
||||
<FormatBalance
|
||||
formatIndex={formatIndex}
|
||||
key={index}
|
||||
value={bonded}
|
||||
/>
|
||||
)})</>
|
||||
)}
|
||||
</FormatBalance>
|
||||
</React.Fragment>
|
||||
);
|
||||
balanceDisplay.redeemable && stakingInfo?.redeemable?.gtn(0) && allItems.push(
|
||||
<React.Fragment key={6}>
|
||||
<Label label={t<string>('redeemable')} />
|
||||
<StakingRedeemable
|
||||
className='result'
|
||||
stakingInfo={stakingInfo}
|
||||
/>
|
||||
</React.Fragment>
|
||||
);
|
||||
balanceDisplay.unlocking && stakingInfo?.unlocking && allItems.push(
|
||||
<React.Fragment key={7}>
|
||||
<Label label={t<string>('unbonding')} />
|
||||
<div className='result'>
|
||||
<StakingUnbonding stakingInfo={stakingInfo} />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
balanceDisplay.unlocking && democracyLocks && (democracyLocks.length !== 0) && allItems.push(
|
||||
<React.Fragment key={8}>
|
||||
<Label label={t<string>('democracy')} />
|
||||
<div className='result'>
|
||||
<DemocracyLocks value={democracyLocks} />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
if (withBalanceToggle) {
|
||||
return (
|
||||
<React.Fragment key={index}>
|
||||
<Expander summary={<FormatBalance value={balancesAll && balancesAll.freeBalance.add(balancesAll.reservedBalance)} />}>
|
||||
<div className='body column'>
|
||||
{allItems}
|
||||
</div>
|
||||
<React.Fragment key={formatIndex}>
|
||||
<Expander summary={
|
||||
<FormatBalance
|
||||
formatIndex={formatIndex}
|
||||
value={balancesAll && balancesAll.freeBalance.add(balancesAll.reservedBalance)}
|
||||
/>
|
||||
}>
|
||||
{allItems.length !== 0 && (
|
||||
<div className='body column'>
|
||||
{allItems}
|
||||
</div>
|
||||
)}
|
||||
</Expander>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment key={index}>
|
||||
<React.Fragment key={formatIndex}>
|
||||
{allItems}
|
||||
</React.Fragment>
|
||||
);
|
||||
|
||||
@ -121,7 +121,7 @@ function inputToBn (api: ApiPromise, input: string, si: SiDef | null, bitLength:
|
||||
}
|
||||
|
||||
const div = new BN(input.replace(/\.\d*$/, ''));
|
||||
const modString = input.replace(/^\d+\./, '').substr(0, api.registry.chainDecimals);
|
||||
const modString = input.replace(/^\d+\./, '').substr(0, api.registry.chainDecimals[0]);
|
||||
const mod = new BN(modString);
|
||||
|
||||
result = div
|
||||
|
||||
@ -3,11 +3,13 @@
|
||||
|
||||
import type { ThemeProps } from '@polkadot/react-components/types';
|
||||
import type { Compact } from '@polkadot/types';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import BN from 'bn.js';
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { useApi } from '@polkadot/react-hooks';
|
||||
import { formatBalance } from '@polkadot/util';
|
||||
|
||||
import { useTranslation } from './translate';
|
||||
@ -15,6 +17,7 @@ import { useTranslation } from './translate';
|
||||
interface Props {
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
formatIndex?: number;
|
||||
isShort?: boolean;
|
||||
label?: React.ReactNode;
|
||||
labelPost?: string;
|
||||
@ -28,6 +31,20 @@ interface Props {
|
||||
const M_LENGTH = 6 + 1;
|
||||
const K_LENGTH = 3 + 1;
|
||||
|
||||
function getFormat (registry: Registry, formatIndex = 0): [number, string] {
|
||||
const decimals = registry.chainDecimals;
|
||||
const tokens = registry.chainTokens;
|
||||
|
||||
return [
|
||||
formatIndex < decimals.length
|
||||
? decimals[formatIndex]
|
||||
: decimals[0],
|
||||
formatIndex < tokens.length
|
||||
? tokens[formatIndex]
|
||||
: tokens[1]
|
||||
];
|
||||
}
|
||||
|
||||
function formatDisplay (prefix: string, postfix: string, unit: string, label = '', isShort = false): React.ReactNode {
|
||||
return <>{`${prefix}${isShort ? '' : '.'}`}{!isShort && <span className='ui--FormatBalance-postfix'>{`0000${postfix || ''}`.slice(-4)}</span>}<span className='ui--FormatBalance-unit'> {unit}</span>{label}</>;
|
||||
}
|
||||
@ -39,13 +56,13 @@ function splitFormat (value: string, label?: string, isShort?: boolean): React.R
|
||||
return formatDisplay(prefix, postfix, unit, label, isShort);
|
||||
}
|
||||
|
||||
function format (value: Compact<any> | BN | string, withCurrency = true, withSi?: boolean, _isShort?: boolean, labelPost?: string): React.ReactNode {
|
||||
const [prefix, postfix] = formatBalance(value, { forceUnit: '-', withSi: false }).split('.');
|
||||
function format (value: Compact<any> | BN | string, [decimals, token]: [number, string], withCurrency = true, withSi?: boolean, _isShort?: boolean, labelPost?: string): React.ReactNode {
|
||||
const [prefix, postfix] = formatBalance(value, { decimals, forceUnit: '-', withSi: false }).split('.');
|
||||
const isShort = _isShort || (withSi && prefix.length >= K_LENGTH);
|
||||
const unitPost = withCurrency ? formatBalance.getDefaults().unit : '';
|
||||
const unitPost = withCurrency ? token : '';
|
||||
|
||||
if (prefix.length > M_LENGTH) {
|
||||
const [major, rest] = formatBalance(value, { withUnit: false }).split('.');
|
||||
const [major, rest] = formatBalance(value, { decimals, withUnit: false }).split('.');
|
||||
const minor = rest.substr(0, 4);
|
||||
const unit = rest.substr(4);
|
||||
|
||||
@ -55,8 +72,14 @@ function format (value: Compact<any> | BN | string, withCurrency = true, withSi?
|
||||
return formatDisplay(prefix, postfix, unitPost, labelPost, isShort);
|
||||
}
|
||||
|
||||
function FormatBalance ({ children, className = '', isShort, label, labelPost, value, valueFormatted, withCurrency, withSi }: Props): React.ReactElement<Props> {
|
||||
function FormatBalance ({ children, className = '', formatIndex, isShort, label, labelPost, value, valueFormatted, withCurrency, withSi }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
const { api } = useApi();
|
||||
|
||||
const formatInfo = useMemo(
|
||||
() => getFormat(api.registry, formatIndex),
|
||||
[api, formatIndex]
|
||||
);
|
||||
|
||||
// labelPost here looks messy, however we ensure we have one less text node
|
||||
return (
|
||||
@ -67,7 +90,7 @@ function FormatBalance ({ children, className = '', isShort, label, labelPost, v
|
||||
: value
|
||||
? value === 'all'
|
||||
? t<string>('everything{{labelPost}}', { replace: { labelPost } })
|
||||
: format(value, withCurrency, withSi, isShort, labelPost)
|
||||
: format(value, formatInfo, withCurrency, withSi, isShort, labelPost)
|
||||
: `-${labelPost || ''}`
|
||||
}</span>{children}
|
||||
</div>
|
||||
|
||||
284
yarn.lock
284
yarn.lock
@ -1909,54 +1909,54 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/api-contract@npm:^3.5.2-10":
|
||||
version: 3.5.2-10
|
||||
resolution: "@polkadot/api-contract@npm:3.5.2-10"
|
||||
"@polkadot/api-contract@npm:^3.5.2-13":
|
||||
version: 3.5.2-13
|
||||
resolution: "@polkadot/api-contract@npm:3.5.2-13"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/api": 3.5.2-10
|
||||
"@polkadot/types": 3.5.2-10
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/api": 3.5.2-13
|
||||
"@polkadot/types": 3.5.2-13
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/x-rxjs": 3.5.2-1
|
||||
bn.js: ^4.11.9
|
||||
checksum: 7512c240f67544e5609ba05a15bdb3051acad9b1c99dd6ecdef10d7e7a53ec447d824ff5efc850ce85be4979e015c7fd48571419e39b55bc1aade14d15ecf271
|
||||
checksum: 906eb036b69bdfebb7c9e378705fa5208ad4fb4ab7cdc95994a0bf4bd2b276cb1fbb304dd8c84ed7c0b0646cda5f29114c5975999b7ae8ab516620dc2c54ac98
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/api-derive@npm:3.5.2-10":
|
||||
version: 3.5.2-10
|
||||
resolution: "@polkadot/api-derive@npm:3.5.2-10"
|
||||
"@polkadot/api-derive@npm:3.5.2-13":
|
||||
version: 3.5.2-13
|
||||
resolution: "@polkadot/api-derive@npm:3.5.2-13"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/api": 3.5.2-10
|
||||
"@polkadot/rpc-core": 3.5.2-10
|
||||
"@polkadot/types": 3.5.2-10
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/util-crypto": ^5.3.2-7
|
||||
"@polkadot/api": 3.5.2-13
|
||||
"@polkadot/rpc-core": 3.5.2-13
|
||||
"@polkadot/types": 3.5.2-13
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/util-crypto": ^5.3.2-8
|
||||
"@polkadot/x-rxjs": 3.5.2-1
|
||||
bn.js: ^4.11.9
|
||||
checksum: 6761af6cd027c890589c19f93d3d0fa32e79abf4685a08c0149eb2c306347a2e0d723443aefdbb54ccfca623b93715fd5145f493dee5ed4263b10b3f31c368bc
|
||||
checksum: 382c8ad8e372f4550f284a9ac7226228f44f2886de388926e50e19b0f73a7d7f0be657494a13bcac9c5d42d69992ff1e7d8e0433ab3feca7a6e81b82b3a26dec
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/api@npm:^3.5.2-10":
|
||||
version: 3.5.2-10
|
||||
resolution: "@polkadot/api@npm:3.5.2-10"
|
||||
"@polkadot/api@npm:^3.5.2-13":
|
||||
version: 3.5.2-13
|
||||
resolution: "@polkadot/api@npm:3.5.2-13"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/api-derive": 3.5.2-10
|
||||
"@polkadot/keyring": ^5.3.2-7
|
||||
"@polkadot/metadata": 3.5.2-10
|
||||
"@polkadot/rpc-core": 3.5.2-10
|
||||
"@polkadot/rpc-provider": 3.5.2-10
|
||||
"@polkadot/types": 3.5.2-10
|
||||
"@polkadot/types-known": 3.5.2-10
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/util-crypto": ^5.3.2-7
|
||||
"@polkadot/api-derive": 3.5.2-13
|
||||
"@polkadot/keyring": ^5.3.2-8
|
||||
"@polkadot/metadata": 3.5.2-13
|
||||
"@polkadot/rpc-core": 3.5.2-13
|
||||
"@polkadot/rpc-provider": 3.5.2-13
|
||||
"@polkadot/types": 3.5.2-13
|
||||
"@polkadot/types-known": 3.5.2-13
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/util-crypto": ^5.3.2-8
|
||||
"@polkadot/x-rxjs": 3.5.2-1
|
||||
bn.js: ^4.11.9
|
||||
eventemitter3: ^4.0.7
|
||||
checksum: 85210682a2bbe2137c93be404b2e4d48b22d263fa3c1b4feb6a4ea97521e2cc5a2c32caf8e1fe483f8a59400c287711513afe2f46e2e0b539a50a76e1600752c
|
||||
checksum: d011adac74effe42f9074ca3f5e9fa1e4be4d91a41cd0c116ca2603d8f9c092c358a9f9e6f4452b03245f2e557016724a3d69d5534b000b163246efba7be015a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -1965,7 +1965,7 @@ __metadata:
|
||||
resolution: "@polkadot/app-accounts@workspace:packages/page-accounts"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/phishing": ^0.3.22
|
||||
"@polkadot/phishing": ^0.3.23
|
||||
"@polkadot/react-components": ^0.76.2-23
|
||||
"@polkadot/test-support": 0.76.2-23
|
||||
"@polkadot/vanitygen": ^0.25.2-2
|
||||
@ -2020,7 +2020,7 @@ __metadata:
|
||||
resolution: "@polkadot/app-contracts@workspace:packages/page-contracts"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/api-contract": ^3.5.2-10
|
||||
"@polkadot/api-contract": ^3.5.2-13
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
@ -2190,7 +2190,7 @@ __metadata:
|
||||
"@edgeware/node-types": ^3.2.0
|
||||
"@interlay/polkabtc-types": ^0.3.1
|
||||
"@laminar/type-definitions": ^0.2.0-beta.143
|
||||
"@polkadot/networks": ^5.3.2-7
|
||||
"@polkadot/networks": ^5.3.2-8
|
||||
"@sora-substrate/type-definitions": ^0.3.5
|
||||
"@subsocial/types": ^0.4.28
|
||||
i18next: ^19.8.4
|
||||
@ -2387,9 +2387,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/hw-ledger-transports@npm:5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/hw-ledger-transports@npm:5.3.2-7"
|
||||
"@polkadot/hw-ledger-transports@npm:5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/hw-ledger-transports@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@ledgerhq/hw-transport-node-hid-singleton": ^5.39.0
|
||||
@ -2397,68 +2397,68 @@ __metadata:
|
||||
dependenciesMeta:
|
||||
"@ledgerhq/hw-transport-node-hid-singleton":
|
||||
optional: true
|
||||
checksum: fd1b88b535e6f59a51e4053d66e7fa8998130b2bc312ef522fbd71cd8b0362d5ee76e0b9aa7f01a71976a630a0f7e7fc75896c1efbb624ae0294a8a8afc48d06
|
||||
checksum: 6bfee0d4fb1d60e25e02341600aafdc1621cc8ae9db9d1737151c96b06c88b46b681af6336891518695ee21962f7fbe5d64c8b79ebc0d14b838384e3e101265b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/hw-ledger@npm:^5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/hw-ledger@npm:5.3.2-7"
|
||||
"@polkadot/hw-ledger@npm:^5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/hw-ledger@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/hw-ledger-transports": 5.3.2-7
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/hw-ledger-transports": 5.3.2-8
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@zondax/ledger-polkadot": ^0.13.0
|
||||
checksum: 8c8b168805c7db92021aa55ce24c75c3aae97a1b96e5c518874cd86733caaea7ce5e55b2fbc03db70e4dfb70166970cb372216d36c6f093e0e51e41e6b1ff687
|
||||
checksum: f0badd6c83168cd59a94b1c36477483655f28297a2164f461d5174286129a0f48e3125ff3c4d8761b59535940f396083e110a8b92bca52dcca22c8301b34ccce
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/keyring@npm:^5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/keyring@npm:5.3.2-7"
|
||||
"@polkadot/keyring@npm:^5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/keyring@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/util": 5.3.2-7
|
||||
"@polkadot/util-crypto": 5.3.2-7
|
||||
"@polkadot/util": 5.3.2-8
|
||||
"@polkadot/util-crypto": 5.3.2-8
|
||||
peerDependencies:
|
||||
"@polkadot/util": 5.3.2-7
|
||||
"@polkadot/util-crypto": 5.3.2-7
|
||||
checksum: 3ec3422dc7b00ef73bbfed45bff18b2d979c8e9d53a9b93980ed488937018c42bfe33f335e888ecc7faf3ec3543112c7786fe0ca86a00e0a74927afff2b4fd7b
|
||||
"@polkadot/util": 5.3.2-8
|
||||
"@polkadot/util-crypto": 5.3.2-8
|
||||
checksum: 6884b5f73f3a442208f19fe023176130e70886a7be507fbb6608677a7f66564d8c80408b0bc3824204aa47f3a8bfd447efb0eae6909a68c7440638cb5086a6c3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/metadata@npm:3.5.2-10":
|
||||
version: 3.5.2-10
|
||||
resolution: "@polkadot/metadata@npm:3.5.2-10"
|
||||
"@polkadot/metadata@npm:3.5.2-13":
|
||||
version: 3.5.2-13
|
||||
resolution: "@polkadot/metadata@npm:3.5.2-13"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/types": 3.5.2-10
|
||||
"@polkadot/types-known": 3.5.2-10
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/util-crypto": ^5.3.2-7
|
||||
"@polkadot/types": 3.5.2-13
|
||||
"@polkadot/types-known": 3.5.2-13
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/util-crypto": ^5.3.2-8
|
||||
bn.js: ^4.11.9
|
||||
checksum: 206de796f6ad737b5862a4db6dbfd2d9665107a436acaadeb56b554f367bb70d69263fbf33ad9e658a83de1ba01ee529aaef626c656a501e11e59b66feb74811
|
||||
checksum: 1a7e7b3125bef6ee539018828beed7c6a9bdbed1a2292097ac9a71eecf2256344831ce488ccff1833eccd0737d368d1e7fe1c3c59404c071ce79e788982648a0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/networks@npm:^5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/networks@npm:5.3.2-7"
|
||||
"@polkadot/networks@npm:^5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/networks@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
checksum: 4bd6193b653dfb1f7fd0e3b59e201ccc53c85da37a090bcbe06de1a4ab9fa64364057b372335158a3d4e522a8fb716deb592f8bbdbbf5654410b0fc91dde7b26
|
||||
checksum: 227a5730193f059171d0840f7c6852ce2f28fb7d41e4efe0ca400faaf73798b3c1c7ac3f5a0243f984058b1758e6d2295066e358c5f17b1971ef773ccbb2b8c5
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/phishing@npm:^0.3.22":
|
||||
version: 0.3.22
|
||||
resolution: "@polkadot/phishing@npm:0.3.22"
|
||||
"@polkadot/phishing@npm:^0.3.23":
|
||||
version: 0.3.23
|
||||
resolution: "@polkadot/phishing@npm:0.3.23"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/util": ^5.3.2-6
|
||||
"@polkadot/util-crypto": ^5.3.2-6
|
||||
"@polkadot/x-fetch": ^5.3.2-6
|
||||
checksum: c5e77c345d9c4b5f3d3cd77f9268f014af3c6ae58549d21eb79594111f1a528f23c0a9e2da991a2f41ace55a1e5ea7931577e8e5410e76b3e5dee0fe990ff8f6
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/util-crypto": ^5.3.2-8
|
||||
"@polkadot/x-fetch": ^5.3.2-8
|
||||
checksum: f52f077cace4c4ec15471484f7c36a6091ae8daa0535424aafe24fd6e4b46f2e67e6916c61e03417bab72b4197bf383e8c17824bf198530ab2a0a04e5aa9b794
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -2467,9 +2467,9 @@ __metadata:
|
||||
resolution: "@polkadot/react-api@workspace:packages/react-api"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/api": ^3.5.2-10
|
||||
"@polkadot/api": ^3.5.2-13
|
||||
"@polkadot/extension-dapp": ^0.36.2-8
|
||||
"@polkadot/x-rxjs": ^5.3.2-7
|
||||
"@polkadot/x-rxjs": ^5.3.2-8
|
||||
fflate: ^0.6.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@ -2482,15 +2482,15 @@ __metadata:
|
||||
"@fortawesome/fontawesome-svg-core": ^1.2.34
|
||||
"@fortawesome/free-solid-svg-icons": ^5.15.2
|
||||
"@fortawesome/react-fontawesome": ^0.1.14
|
||||
"@polkadot/keyring": ^5.3.2-7
|
||||
"@polkadot/keyring": ^5.3.2-8
|
||||
"@polkadot/react-api": ^0.76.2-23
|
||||
"@polkadot/react-identicon": ^0.66.4-1
|
||||
"@polkadot/react-qr": ^0.66.4-1
|
||||
"@polkadot/react-query": ^0.76.2-23
|
||||
"@polkadot/ui-keyring": ^0.66.4-1
|
||||
"@polkadot/ui-settings": ^0.66.4-1
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/util-crypto": ^5.3.2-7
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/util-crypto": ^5.3.2-8
|
||||
"@types/codeflask": ^1.4.2
|
||||
"@types/owasp-password-strength-test": ^1.3.0
|
||||
chart.js: ^2.9.4
|
||||
@ -2598,33 +2598,33 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/rpc-core@npm:3.5.2-10":
|
||||
version: 3.5.2-10
|
||||
resolution: "@polkadot/rpc-core@npm:3.5.2-10"
|
||||
"@polkadot/rpc-core@npm:3.5.2-13":
|
||||
version: 3.5.2-13
|
||||
resolution: "@polkadot/rpc-core@npm:3.5.2-13"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/metadata": 3.5.2-10
|
||||
"@polkadot/rpc-provider": 3.5.2-10
|
||||
"@polkadot/types": 3.5.2-10
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/metadata": 3.5.2-13
|
||||
"@polkadot/rpc-provider": 3.5.2-13
|
||||
"@polkadot/types": 3.5.2-13
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/x-rxjs": 3.5.2-1
|
||||
checksum: e0e2864b4c3ccaef6caab56313cd069a1b259bf4e4fbe699b92c67531c13dec6b9f03dac96cf7bd8636f66b0f1fbb6841499dd8ac8c22b5c1167755af1bf5a15
|
||||
checksum: c661aceb6b046d9ec09a3c2df891285e008eaa3f527d50b2d2d226679eda5fdad93e002aa1c3f0aeefca044d17626f305f66e09987cb489b04aedd64e6fea745
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/rpc-provider@npm:3.5.2-10":
|
||||
version: 3.5.2-10
|
||||
resolution: "@polkadot/rpc-provider@npm:3.5.2-10"
|
||||
"@polkadot/rpc-provider@npm:3.5.2-13":
|
||||
version: 3.5.2-13
|
||||
resolution: "@polkadot/rpc-provider@npm:3.5.2-13"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/types": 3.5.2-10
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/util-crypto": ^5.3.2-7
|
||||
"@polkadot/x-fetch": ^5.3.2-7
|
||||
"@polkadot/x-ws": ^5.3.2-7
|
||||
"@polkadot/types": 3.5.2-13
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/util-crypto": ^5.3.2-8
|
||||
"@polkadot/x-fetch": ^5.3.2-8
|
||||
"@polkadot/x-ws": ^5.3.2-8
|
||||
bn.js: ^4.11.9
|
||||
eventemitter3: ^4.0.7
|
||||
checksum: a53bf75bb957583517e5951fe70c6200cd7f25bea446a0d80588936f6bf97a7b475f382e349572de0b2397e1646e6cf722238ba1902149566f11973ed1525b74
|
||||
checksum: b3f05b5404bace78cd22c1afe3ee3441d9031af0a237ce1774e7bad07a6856dbdb338e3cb53214b5f71d9cc669a515cca4ef7f8228943e47c2fbd32ddfdc78c9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -2648,30 +2648,30 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/types-known@npm:3.5.2-10":
|
||||
version: 3.5.2-10
|
||||
resolution: "@polkadot/types-known@npm:3.5.2-10"
|
||||
"@polkadot/types-known@npm:3.5.2-13":
|
||||
version: 3.5.2-13
|
||||
resolution: "@polkadot/types-known@npm:3.5.2-13"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/types": 3.5.2-10
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/types": 3.5.2-13
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
bn.js: ^4.11.9
|
||||
checksum: 30a1f9a013a98a5881428d1facb296a16e8f80554b4f289f6e68bdfd4bf266c95996efb6306bbbb6b27076e7ccdf6deda1ea70b6fa2f2421c29a332acf3d5e1f
|
||||
checksum: 2b589cad954397a9500a07bec47ae24a204697f297b5a654bdcff46c8ca6c7d2cd4e4222db700d4278cab8a6a186e5dc2c8d190104b696468bd124ba54b49a5c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/types@npm:^3.5.2-10":
|
||||
version: 3.5.2-10
|
||||
resolution: "@polkadot/types@npm:3.5.2-10"
|
||||
"@polkadot/types@npm:^3.5.2-13":
|
||||
version: 3.5.2-13
|
||||
resolution: "@polkadot/types@npm:3.5.2-13"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/metadata": 3.5.2-10
|
||||
"@polkadot/util": ^5.3.2-7
|
||||
"@polkadot/util-crypto": ^5.3.2-7
|
||||
"@polkadot/metadata": 3.5.2-13
|
||||
"@polkadot/util": ^5.3.2-8
|
||||
"@polkadot/util-crypto": ^5.3.2-8
|
||||
"@polkadot/x-rxjs": 3.5.2-1
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^4.11.9
|
||||
checksum: 82bde1ba7e58615fd91cdcdf09cdf17335edb98b2eacdbc7407e97c2862a9576742c329125cbc98e2bb05303a1350fa1e2b2d8e0ae894df7f19eb05511ffb3f8
|
||||
checksum: 49db2a25000aae295dd13768a296e1454231f5d1681b9b4158d757bc44f17c998d0e2b7ccc6752cdaec3676151fbdd88ad2e10e84db9ce46ed743c08a410643e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -2724,15 +2724,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/util-crypto@npm:^5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/util-crypto@npm:5.3.2-7"
|
||||
"@polkadot/util-crypto@npm:^5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/util-crypto@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/networks": 5.3.2-7
|
||||
"@polkadot/util": 5.3.2-7
|
||||
"@polkadot/networks": 5.3.2-8
|
||||
"@polkadot/util": 5.3.2-8
|
||||
"@polkadot/wasm-crypto": ^3.2.1
|
||||
"@polkadot/x-randomvalues": 5.3.2-7
|
||||
"@polkadot/x-randomvalues": 5.3.2-8
|
||||
base-x: ^3.0.8
|
||||
blakejs: ^1.1.0
|
||||
bn.js: ^4.11.9
|
||||
@ -2744,23 +2744,23 @@ __metadata:
|
||||
tweetnacl: ^1.0.3
|
||||
xxhashjs: ^0.2.2
|
||||
peerDependencies:
|
||||
"@polkadot/util": 5.3.2-7
|
||||
checksum: 9c0a231fe5b1a2513d2f17c2ca12cc8aecf33c91d78716f5631b341252eb0b1c556c2f61410dcc34b4997311eed26f6e06635d71a93139d71521268e97d2fcbd
|
||||
"@polkadot/util": 5.3.2-8
|
||||
checksum: d513ff19f654cf7ba151f6e3173e3e7f65d22b6589d448534aeb551c3e94d5eab13ae521c407a58689a29fe6663b746f4b4eeb5679625d09d3a2b890ae6e682c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/util@npm:^5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/util@npm:5.3.2-7"
|
||||
"@polkadot/util@npm:^5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/util@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/x-textdecoder": 5.3.2-7
|
||||
"@polkadot/x-textencoder": 5.3.2-7
|
||||
"@polkadot/x-textdecoder": 5.3.2-8
|
||||
"@polkadot/x-textencoder": 5.3.2-8
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^4.11.9
|
||||
camelcase: ^5.3.1
|
||||
ip-regex: ^4.2.0
|
||||
checksum: fe179b893f238f632f8434688ad94811f3ee72f100c5e92dc335851e6bb0c1f800f2cbabf08325ccc913ae9660d00b26d1900bb266d71a62fbc294ebb09fa476
|
||||
checksum: 897a87d1bf3d658ca840e1d63f2f3848ce42bc859a829c88012847ffc389c72f47202d4c678ee79f1eac5f99dac1f09e08809f3da5c6356fc6f5ddb653346d3d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -2813,62 +2813,62 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-fetch@npm:^5.3.2-6, @polkadot/x-fetch@npm:^5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/x-fetch@npm:5.3.2-7"
|
||||
"@polkadot/x-fetch@npm:^5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/x-fetch@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@types/node-fetch": ^2.5.8
|
||||
node-fetch: ^2.6.1
|
||||
checksum: 1706b2c7d5c6735c388784774e7194438a37d9e7d0c46bee372e9e90dac7aacebe7b655cf7b061919df27bf01f46e71bdd00aae3dd70e04fc4e89c8f45992f33
|
||||
checksum: e6207996cfafb6e64508347194a1c0f2d56c52e0892b41bee0e9e2c73c60fc3688cf55d29f88ef32ee8942dbd5646f093b4ff904454b0a0f28361fedececfa6f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-randomvalues@npm:5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/x-randomvalues@npm:5.3.2-7"
|
||||
"@polkadot/x-randomvalues@npm:5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/x-randomvalues@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
checksum: aff63596c76fdaf236b93d41915f29169788e0d86cf44d871836d95d7310e8a9fed75ed4ca05f1c11ebafb77e51b78ae9921a8b35a47765b7f6ea0bae5c161eb
|
||||
checksum: dd1db83d18422b48a9fc3051ef4a3ec55ff6cf61f4ef69c723149526ca002bec314867a624c3db994fc838122eafe3d4730e20a5d262cf236454228a33b515d9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-rxjs@npm:^5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/x-rxjs@npm:5.3.2-7"
|
||||
"@polkadot/x-rxjs@npm:^5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/x-rxjs@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
rxjs: ^6.6.3
|
||||
checksum: 005c3d8072144b8d85738a1904384aa234b266e9331ccb583ed055e7b4d201f824295bcbad4e66ee5ec5cf769600f89ce344b6d0dc891d1f64ded7cdc29ae513
|
||||
checksum: c50b88bbadce3e3e534c2fad19c4c1ff9db74094e34fce8f17a9338a86def680daa7e806fa25b25d3fe08b1c1d113df681d5e20cad90a5fd23e1ccc8b83edef3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-textdecoder@npm:5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/x-textdecoder@npm:5.3.2-7"
|
||||
"@polkadot/x-textdecoder@npm:5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/x-textdecoder@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
checksum: efceb8fe6e6856fb9f6b4242bf8cadfa33e8c93da7ed1139f990fb906ad0fb5de83b54bd92ddfadf7d31f4bfec098f2a3ee037783223c49a93953dd33c57d8a0
|
||||
checksum: afe2dbb5702f95d7e054bdbdf801a943debd73b0a77d1ffd856adcf80dd41fc7f1530b6c3910b24ba67442f958d2366d57cabb233c15618eba4bc115569021ad
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-textencoder@npm:5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/x-textencoder@npm:5.3.2-7"
|
||||
"@polkadot/x-textencoder@npm:5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/x-textencoder@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
checksum: 583a21914bdafccd2f5f81dba12950cbd7c84512eb9becbbebe8223b27236600f43802c0805494f43bd9da37bc2a66d973ec576c1adcd95db06c9a382e5c5d00
|
||||
checksum: 0b81d1c412442f85f529f14690af47acfe920c011622705803683b3f4ddf005935e41757238f7faf6551c50729f38e67128f00838d6b90e9eed87b83199ded99
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-ws@npm:^5.3.2-7":
|
||||
version: 5.3.2-7
|
||||
resolution: "@polkadot/x-ws@npm:5.3.2-7"
|
||||
"@polkadot/x-ws@npm:^5.3.2-8":
|
||||
version: 5.3.2-8
|
||||
resolution: "@polkadot/x-ws@npm:5.3.2-8"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@types/websocket": ^1.0.1
|
||||
websocket: ^1.0.33
|
||||
checksum: e7300dd29703616cf69e99cbd99b3ada441411e9b53e6a1003147b18d6c251630937033ebd776de643dae4d3b95a464915d7a251e2fc3143b481081e3ce7dadc
|
||||
checksum: 61f7e39e4624e769ce68d5ae63072b54292558c8a6c704d27cd03bfbf2a5bfc78816147d22bd5b9d2935b93663df5839305b6cea23994f76f142b9da027fd0a6
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user