From f7630e26412907d9f8ac3cc8b0edd87a6dbf8d98 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 14 Jan 2020 11:05:55 +0100 Subject: [PATCH] API 1.0-beta & common 2.0-beta (#2115) * API 1.0-beta & common 2.0-beta * May fix effect issue --- package.json | 12 +- packages/app-accounts/package.json | 2 +- packages/app-contracts/package.json | 2 +- packages/apps/package.json | 2 +- packages/react-api/package.json | 4 +- packages/react-components/package.json | 8 +- packages/react-components/src/AddressInfo.tsx | 21 +- packages/react-signer/package.json | 2 +- yarn.lock | 220 +++++++++--------- 9 files changed, 134 insertions(+), 139 deletions(-) diff --git a/package.json b/package.json index 9c9a81329e..dc3fd27a5b 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,12 @@ "packages/*" ], "resolutions": { - "@polkadot/api": "^0.100.1", - "@polkadot/api-contract": "^0.100.1", - "@polkadot/keyring": "^1.8.1", - "@polkadot/types": "^0.100.1", - "@polkadot/util": "^1.8.1", - "@polkadot/util-crypto": "^1.8.1", + "@polkadot/api": "^1.0.0-beta.3", + "@polkadot/api-contract": "^1.0.0-beta.3", + "@polkadot/keyring": "^2.0.0-beta.1", + "@polkadot/types": "^1.0.0-beta.3", + "@polkadot/util": "^2.0.0-beta.1", + "@polkadot/util-crypto": "^2.0.0-beta.1", "babel-core": "^7.0.0-bridge.0", "typescript": "^3.7.4" }, diff --git a/packages/app-accounts/package.json b/packages/app-accounts/package.json index ebcce30baf..ceda0f07cc 100644 --- a/packages/app-accounts/package.json +++ b/packages/app-accounts/package.json @@ -12,7 +12,7 @@ "dependencies": { "@babel/runtime": "^7.7.7", "@polkadot/react-components": "^0.39.0-beta.47", - "@polkadot/react-qr": "^0.48.0-beta.9", + "@polkadot/react-qr": "^0.48.0-beta.10", "@types/file-saver": "^2.0.0", "@types/yargs": "^13.0.2", "detect-browser": "^4.8.0", diff --git a/packages/app-contracts/package.json b/packages/app-contracts/package.json index 599284ac03..d30f1a7b99 100644 --- a/packages/app-contracts/package.json +++ b/packages/app-contracts/package.json @@ -11,6 +11,6 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.7.7", - "@polkadot/api-contract": "^0.100.1" + "@polkadot/api-contract": "^1.0.0-beta.3" } } diff --git a/packages/apps/package.json b/packages/apps/package.json index 2b434e8f9f..7303ee31a8 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -16,7 +16,7 @@ "@babel/runtime": "^7.7.7", "@polkadot/react-components": "^0.39.0-beta.47", "@polkadot/react-signer": "^0.39.0-beta.47", - "@polkadot/ui-assets": "^0.48.0-beta.9", + "@polkadot/ui-assets": "^0.48.0-beta.10", "query-string": "^6.8.3" } } diff --git a/packages/react-api/package.json b/packages/react-api/package.json index 7b9f83bace..0bbe711f21 100644 --- a/packages/react-api/package.json +++ b/packages/react-api/package.json @@ -31,8 +31,8 @@ "homepage": "https://github.com/polkadot-js/ui/tree/master/packages/ui-reactive#readme", "dependencies": { "@babel/runtime": "^7.7.6", - "@polkadot/api": "^0.100.1", - "@polkadot/extension-dapp": "^0.15.0-beta.0", + "@polkadot/api": "^1.0.0-beta.3", + "@polkadot/extension-dapp": "^0.15.0-beta.1", "edgeware-node-types": "^1.0.10", "rxjs-compat": "^6.5.3" } diff --git a/packages/react-components/package.json b/packages/react-components/package.json index c1cf2e26ec..c1dadccc10 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -11,12 +11,12 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.7.6", - "@polkadot/keyring": "^1.8.1", + "@polkadot/keyring": "^2.0.0-beta.1", "@polkadot/react-api": "^0.39.0-beta.47", - "@polkadot/react-identicon": "^0.48.0-beta.9", + "@polkadot/react-identicon": "^0.48.0-beta.10", "@polkadot/react-query": "^0.39.0-beta.47", - "@polkadot/ui-keyring": "^0.48.0-beta.9", - "@polkadot/ui-settings": "^0.48.0-beta.9", + "@polkadot/ui-keyring": "^0.48.0-beta.10", + "@polkadot/ui-settings": "^0.48.0-beta.10", "@types/chart.js": "^2.9.8", "@types/i18next": "^13.0.0", "@types/react-copy-to-clipboard": "^4.3.0", diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index b155365b44..6d2a1dc429 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -129,8 +129,7 @@ function calcBonded (stakingInfo?: DerivedStakingAccount, bonded?: boolean | BN[ return [own, other]; } -function renderExtended ({ balancesAll, address, withExtended }: Props): React.ReactNode { - const { t } = useTranslation(); +function renderExtended ({ balancesAll, address, withExtended }: Props, t: (key: string) => string): React.ReactNode { const extendedDisplay = withExtended === true ? DEFAULT_EXTENDED : withExtended || undefined; @@ -160,9 +159,7 @@ function renderExtended ({ balancesAll, address, withExtended }: Props): React.R ); } -function renderUnlocking ({ stakingInfo }: Props): React.ReactNode { - const { t } = useTranslation(); - +function renderUnlocking ({ stakingInfo }: Props, t: (key: string, data: any) => string): React.ReactNode { if (!stakingInfo || !stakingInfo.unlocking || !stakingInfo.unlocking.length) { return null; } @@ -198,8 +195,7 @@ function renderUnlocking ({ stakingInfo }: Props): React.ReactNode { ); } -function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Props): React.ReactNode { - const { t } = useTranslation(); +function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Props, t: (key: string) => string): React.ReactNode { const validatorPrefsDisplay = withValidatorPrefs === true ? DEFAULT_PREFS : withValidatorPrefs; @@ -241,8 +237,7 @@ function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Prop ); } -function renderBalances (props: Props, allAccounts: string[]): React.ReactNode { - const { t } = useTranslation(); +function renderBalances (props: Props, allAccounts: string[], t: (key: string) => string): React.ReactNode { const { balancesAll, stakingInfo, withBalance = true, withBalanceToggle = false } = props; const balanceDisplay = withBalance === true ? DEFAULT_BALANCES @@ -344,7 +339,7 @@ function renderBalances (props: Props, allAccounts: string[]): React.ReactNode { <>