This commit is contained in:
Jaco Greeff 2019-06-12 20:48:15 +02:00 committed by GitHub
parent bed1a57150
commit 7177c97fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 734 additions and 844 deletions

View File

@ -10,11 +10,11 @@
"packages/*"
],
"resolutions": {
"@polkadot/api": "^0.81.0-beta.7",
"@polkadot/keyring": "^0.93.0-beta.0",
"@polkadot/types": "^0.81.0-beta.7",
"@polkadot/util": "^0.93.0-beta.0",
"@polkadot/util-crypto": "^0.93.0-beta.0",
"@polkadot/api": "^0.81.0-beta.11",
"@polkadot/keyring": "^0.93.0-beta.3",
"@polkadot/types": "^0.81.0-beta.11",
"@polkadot/util": "^0.93.0-beta.3",
"@polkadot/util-crypto": "^0.93.0-beta.3",
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.5.1"
},
@ -32,8 +32,8 @@
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/runtime": "^7.4.5",
"@polkadot/dev-react": "^0.30.0-beta.11",
"@polkadot/ts": "^0.1.59",
"@polkadot/dev-react": "^0.30.0-beta.13",
"@polkadot/ts": "^0.1.60",
"autoprefixer": "^9.5.1",
"empty": "^0.10.1",
"gh-pages": "^2.0.1",

View File

@ -4,8 +4,7 @@
import { Generator$Match, Generator$Options } from './types';
import { encodeAddress } from '@polkadot/keyring';
import { naclKeypairFromSeed, randomAsU8a, schnorrkelKeypairFromSeed } from '@polkadot/util-crypto';
import { encodeAddress, naclKeypairFromSeed, randomAsU8a, schnorrkelKeypairFromSeed } from '@polkadot/util-crypto';
import calculate from './calculate';

View File

@ -14,7 +14,7 @@
"dependencies": {
"@babel/runtime": "^7.4.5",
"@polkadot/ui-app": "^0.34.0-beta.9",
"@polkadot/ui-assets": "^0.41.0-beta.4",
"@polkadot/ui-assets": "^0.41.0-beta.5",
"@polkadot/ui-signer": "^0.34.0-beta.9"
}
}

View File

@ -31,8 +31,8 @@
"homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme",
"dependencies": {
"@babel/runtime": "^7.4.5",
"@polkadot/api": "^0.81.0-beta.7",
"@polkadot/extension-dapp": "^0.1.1-beta.25",
"@polkadot/api": "^0.81.0-beta.11",
"@polkadot/extension-dapp": "^0.1.1-beta.26",
"rxjs-compat": "^6.4.0"
}
}

View File

@ -12,10 +12,10 @@
"dependencies": {
"@babel/runtime": "^7.4.5",
"@polkadot/ui-api": "^0.34.0-beta.9",
"@polkadot/ui-identicon": "^0.41.0-beta.4",
"@polkadot/ui-keyring": "^0.41.0-beta.4",
"@polkadot/ui-identicon": "^0.41.0-beta.5",
"@polkadot/ui-keyring": "^0.41.0-beta.5",
"@polkadot/ui-reactive": "^0.34.0-beta.9",
"@polkadot/ui-settings": "^0.41.0-beta.4",
"@polkadot/ui-settings": "^0.41.0-beta.5",
"@types/chart.js": "^2.7.53",
"@types/classnames": "^2.2.7",
"@types/i18next": "^12.1.0",

View File

@ -9,7 +9,6 @@ import { classes } from '@polkadot/ui-app/util';
import { isNull, isUndefined, u8aToHex } from '@polkadot/util';
import { Option, U8a } from '@polkadot/types';
// const empty = div({}, '<empty>');
const unknown = div({}, '<unknown>');
type DivProps = {
@ -28,120 +27,7 @@ function div ({ key, className }: DivProps, ...values: Array<React.ReactNode>):
);
}
// function accountToText (_address: string | Uint8Array): React.ReactNode {
// const address = isU8a(_address)
// ? encodeAddress(_address)
// : _address;
// return div(
// { className: 'nowrap', key: `account_${address}` },
// <IdentityIcon
// className='icon'
// key='icon'
// size={24}
// value={address}
// />,
// div({ key: 'address', className: 'ui--Param-Address' }, address),
// // Empty div so double clicking on the address only selects the address
// <div key={address}></div>
// );
// }
// function proposalToText ({ extrinsic, params }: ExtrinsicDecoded): React.ReactNode {
// if (!extrinsic) {
// return unknown;
// }
// const inputs = extrinsic.params.map(({ name, type }, index) =>
// div(
// { key: `param_${index}` },
// div({ className: 'name', key: 'param_name' }, `${name}=`),
// valueToText(type, params[index])
// )
// );
// return div(
// {},
// div({ className: 'name' }, `${extrinsic.section}.${extrinsic.name}(`),
// inputs,
// div({ className: 'name' }, ')')
// );
// }
// function arrayToText (type: Param$Type$Array, value: Array<any>, withBound: boolean = true): React.ReactNode {
// if (value.length === 0) {
// return empty;
// }
// if (type.length === 1) {
// if (type[0] === 'KeyValueStorage') {
// return div({}, value.length);
// }
// return value.map((value, index) =>
// div(
// { key: `value_${index}` },
// div({ className: 'name', key: 'name' }, `${index}:`),
// valueToText(type[0], value, false)
// )
// );
// }
// const values = type.map((_type, index) =>
// valueToText(_type, value[index], false)
// );
// return div(
// {},
// div({ className: 'name' }, '('),
// values,
// div({ className: 'name' }, ')')
// );
// }
function valueToText (type: string, value: any, swallowError: boolean = true, contentShorten: boolean = true): React.ReactNode {
// try {
// if (type === 'bool') {
// return div({}, value ? 'Yes' : 'No');
// }
// if (isUndefined(value)) {
// return unknown;
// }
// if (Array.isArray(type)) {
// return arrayToText(type, value);
// }
// if (type === 'AccountId') {
// return value && value.length
// ? accountToText(value as string)
// : unknown;
// }
// if (type === 'Proposal') {
// return proposalToText(value as ExtrinsicDecoded);
// }
// if (type === 'VoteThreshold') {
// return div({}, thresholdTextMap[value]);
// }
// if (isU8a(value)) {
// return div({}, u8aToHex(value, 256));
// }
// if (isBn(value)) {
// return div({}, formatNumber(value));
// }
// } catch (error) {
// if (!swallowError) {
// throw error;
// } else {
// console.log('valueToText', type, value, error);
// }
// }
// dont' even ask, nested ?: ... really?
return isNull(value) || isUndefined(value)
? unknown

1435
yarn.lock

File diff suppressed because it is too large Load Diff