diff --git a/package.json b/package.json index 7bc3f779bd..b865aacff2 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,10 @@ "afterSign": "electron-builder-notarize" }, "resolutions": { - "@polkadot/api": "^2.1.1", - "@polkadot/api-contract": "^2.1.1", + "@polkadot/api": "^2.1.2-13", + "@polkadot/api-contract": "^2.1.2-13", "@polkadot/keyring": "^3.5.1", - "@polkadot/types": "^2.1.1", + "@polkadot/types": "^2.1.2-13", "@polkadot/util": "^3.5.1", "@polkadot/util-crypto": "^3.5.1", "@polkadot/wasm-crypto": "^1.4.1", @@ -84,7 +84,7 @@ "@babel/register": "^7.11.5", "@babel/runtime": "^7.11.2", "@pinata/sdk": "^1.1.11", - "@polkadot/dev": "^0.57.8", + "@polkadot/dev": "^0.58.1", "@polkadot/ts": "^0.3.49", "@types/bn.js": "^4.11.6", "@types/chart.js": "^2.9.25", diff --git a/packages/apps-electron/package.json b/packages/apps-electron/package.json index 3a0cdc41c1..6f2318cf31 100644 --- a/packages/apps-electron/package.json +++ b/packages/apps-electron/package.json @@ -6,7 +6,7 @@ "dependencies": { "@babel/core": "^7.11.6", "@babel/polyfill": "^7.11.5", - "@polkadot/dev": "^0.57.8", + "@polkadot/dev": "^0.58.1", "@polkadot/react-components": "0.61.2-8", "electron-log": "^4.2.4", "electron-updater": "^4.3.5" diff --git a/packages/apps/package.json b/packages/apps/package.json index b1bee6c102..3313d01f71 100644 --- a/packages/apps/package.json +++ b/packages/apps/package.json @@ -18,7 +18,7 @@ "@babel/runtime": "^7.11.2", "@polkadot/apps-config": "0.61.2-8", "@polkadot/apps-routing": "0.61.2-8", - "@polkadot/dev": "^0.57.8", + "@polkadot/dev": "^0.58.1", "@polkadot/react-api": "0.61.2-8", "@polkadot/react-components": "0.61.2-8", "@polkadot/react-hooks": "0.61.2-8", diff --git a/packages/apps/public/locales/en/app-contracts.json b/packages/apps/public/locales/en/app-contracts.json index 5247663047..230e27d219 100644 --- a/packages/apps/public/locales/en/app-contracts.json +++ b/packages/apps/public/locales/en/app-contracts.json @@ -11,18 +11,22 @@ "Clear all": "Clear all", "Code": "Code", "Confirm ABI removal": "Confirm ABI removal", + "Constructors ({{count}})": "Constructors ({{count}})", "Contracts": "Contracts", "Deploy": "Deploy", "Deploy a code hash": "Deploy a code hash", "Deploy this code hash as a smart contract": "Deploy this code hash as a smart contract", "Deploy with this constructor": "Deploy with this constructor", + "Execute": "Execute", "Forget this code hash": "Forget this code hash", "Forget this contract": "Forget this contract", "Messages": "Messages", + "Messages ({{count}})": "Messages ({{count}})", "Mutates contract state": "Mutates contract state", "No code hashes available": "No code hashes available", "No contracts available": "No contracts available", "No documentation provided": "No documentation provided", + "Read": "Read", "Remove": "Remove", "Remove ABI": "Remove ABI", "Save": "Save", @@ -45,12 +49,15 @@ "The maximum amount of gas to use for this contract call. If the call requires more, it will fail.": "The maximum amount of gas to use for this contract call. If the call requires more, it will fail.", "The message to send to this contract. Parameters are adjusted based on the ABI provided.": "The message to send to this contract. Parameters are adjusted based on the ABI provided.", "The value is not in a valid address format": "The value is not in a valid address format", + "This app now only supports Substrate 2.0 with Ink! 3.0. As such versions older of the contracts ABI cannot be used and will display an error when uploaded. Ensure you follow the Ink! instructions for updating if you are using an older version.": "This app now only supports Substrate 2.0 with Ink! 3.0. As such versions older of the contracts ABI cannot be used and will display an error when uploaded. Ensure you follow the Ink! instructions for updating if you are using an older version.", "This operation does not impact the associated on-chain code or any of its contracts.": "This operation does not impact the associated on-chain code or any of its contracts.", "This operation does not remove the uploaded code WASM and ABI from the chain, nor any deployed contracts. The forget operation only limits your access to the code on this browser.": "This operation does not remove the uploaded code WASM and ABI from the chain, nor any deployed contracts. The forget operation only limits your access to the code on this browser.", "Unable to find deployed contract code at the specified address": "Unable to find deployed contract code at the specified address", "Unable to find on-chain WASM code for the supplied codeHash": "Unable to find on-chain WASM code for the supplied codeHash", + "Understood, close this": "Understood, close this", "Upload": "Upload", "Upload WASM": "Upload WASM", + "With the ABI updates, there may still be dragons... the new ABI formats are a complete departure and required a lot of under-the-hood changes. So when something doesn't quite work as expected, please let us know via GH issues.": "With the ABI updates, there may still be dragons... the new ABI formats are a complete departure and required a lot of under-the-hood changes. So when something doesn't quite work as expected, please let us know via GH issues.", "You are about to remove this code from your list of available code hashes. Once completed, should you need to access it again, you will have to manually add the code hash again.": "You are about to remove this code from your list of available code hashes. Once completed, should you need to access it again, you will have to manually add the code hash again.", "You are about to remove this code's ABI. Once completed, should you need to access it again, you will have to manually re-upload it.": "You are about to remove this code's ABI. Once completed, should you need to access it again, you will have to manually re-upload it.", "You are using an ABI with an outdated format. Please generate a new one.": "You are using an ABI with an outdated format. Please generate a new one.", @@ -59,17 +66,21 @@ "click to select or drag and drop a JSON ABI file": "click to select or drag and drop a JSON ABI file", "code for this contract": "code for this contract", "code hash": "code hash", + "code hashes": "code hashes", "compiled contract WASM": "compiled contract WASM", "contract address": "contract address", "contract to use": "contract to use", + "contracts": "contracts", "deploy": "deploy", "deployment account": "deployment account", "deployment constructor": "deployment constructor", "endowment": "endowment", + "exec": "exec", "execute": "execute", "invalid ABI file selected": "invalid ABI file selected", "maximum gas allowed": "maximum gas allowed", "message to send": "message to send", + "read": "read", "send as RPC call": "send as RPC call", "send as transaction": "send as transaction", "value": "value", diff --git a/packages/apps/public/locales/en/translation.json b/packages/apps/public/locales/en/translation.json index 7bcfec2764..4d3ca8bb83 100644 --- a/packages/apps/public/locales/en/translation.json +++ b/packages/apps/public/locales/en/translation.json @@ -144,6 +144,7 @@ "Democracy overview": "", "Deploy": "", "Deploy a code hash": "", + "Deploy code hash": "", "Deploy this code hash as a smart contract": "", "Deploy with this constructor": "", "Deposit": "", @@ -168,6 +169,7 @@ "Enter the Asset ID of the token you want to transfer.": "", "Erroneous": "", "Evaluated {{count}} keys in {{elapsed}}s ({{avg}} keys/s)": "", + "Execute": "", "Extensions": "", "External": "", "Extrinsic submission": "", @@ -834,12 +836,14 @@ "code": "", "code for this contract": "", "code hash": "", + "code hashes": "", "commission": "", "compiled contract WASM": "", "connected peers": "", "contacts": "", "contract address": "", "contract to use": "", + "contracts": "", "controller": "", "controller account": "", "conviction": "", diff --git a/packages/apps/src/themes.ts b/packages/apps/src/themes.ts index a45a1631c9..5d1b9fcd7e 100644 --- a/packages/apps/src/themes.ts +++ b/packages/apps/src/themes.ts @@ -5,6 +5,7 @@ import { ThemeDef } from '@polkadot/react-components/types'; export const darkTheme: ThemeDef = { bgInput: '#38393f', + bgInputError: '#48393f', bgInverse: 'rgba(78, 78, 78, 0.66)', bgMenu: '#26272c', bgMenuHover: 'rgba(255, 255, 255, 0.05)', @@ -23,6 +24,7 @@ export const darkTheme: ThemeDef = { export const lightTheme: ThemeDef = { bgInput: '#fff', + bgInputError: '#fff6f6', bgInverse: 'rgba(244, 242, 240, 0.91)', bgMenu: '#fff', bgMenuHover: 'rgba(255, 255, 255, 0.5)', diff --git a/packages/page-accounts/package.json b/packages/page-accounts/package.json index 61db681f12..b08fe76872 100644 --- a/packages/page-accounts/package.json +++ b/packages/page-accounts/package.json @@ -13,7 +13,7 @@ "dependencies": { "@babel/runtime": "^7.11.2", "@polkadot/react-components": "0.61.2-8", - "@polkadot/vanitygen": "^0.22.0-beta.2", + "@polkadot/vanitygen": "^0.22.1", "detect-browser": "^5.1.1", "file-saver": "^2.0.2" }, diff --git a/packages/page-addresses/package.json b/packages/page-addresses/package.json index 881a6b1505..0c243f64f4 100644 --- a/packages/page-addresses/package.json +++ b/packages/page-addresses/package.json @@ -13,7 +13,7 @@ "dependencies": { "@babel/runtime": "^7.11.2", "@polkadot/react-components": "0.61.2-8", - "@polkadot/vanitygen": "^0.22.0-beta.2", + "@polkadot/vanitygen": "^0.22.1", "detect-browser": "^5.1.1", "file-saver": "^2.0.2" }, diff --git a/packages/page-contracts/package.json b/packages/page-contracts/package.json index f7f9e0811a..1bfd85cc73 100644 --- a/packages/page-contracts/package.json +++ b/packages/page-contracts/package.json @@ -12,6 +12,6 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime": "^7.11.2", - "@polkadot/api-contract": "^2.1.1" + "@polkadot/api-contract": "^2.1.2-13" } } diff --git a/packages/page-contracts/src/Codes/Add.tsx b/packages/page-contracts/src/Codes/Add.tsx index 233bc0d948..f86a963b88 100644 --- a/packages/page-contracts/src/Codes/Add.tsx +++ b/packages/page-contracts/src/Codes/Add.tsx @@ -4,10 +4,7 @@ import { StringOrNull } from '@polkadot/react-components/types'; import React, { useCallback, useMemo, useState } from 'react'; -import { createType } from '@polkadot/types'; -import { registry } from '@polkadot/react-api'; import { Button, Input, Modal } from '@polkadot/react-components'; -import { useToggle } from '@polkadot/react-hooks'; import { isNull } from '@polkadot/util'; import { ABI, InputName } from '../shared'; @@ -16,9 +13,12 @@ import store from '../store'; import { useTranslation } from '../translate'; import useAbi from '../useAbi'; -function Add (): React.ReactElement { +interface Props { + onClose: () => void; +} + +function Add ({ onClose }: Props): React.ReactElement { const { t } = useTranslation(); - const [isOpen, toggleIsOpen, setIsOpen] = useToggle(); const [codeHash, setCodeHash] = useState(''); const [isCodeHashValid, setIsCodeHashValid] = useState(false); const [name, setName] = useState(null); @@ -41,64 +41,55 @@ function Add (): React.ReactElement { } store - .saveCode(createType(registry, 'Hash', codeHash), { abi, name, tags: [] }) - .then((): void => setIsOpen(false)) + .saveCode(codeHash, { abi, name, tags: [] }) + .then(() => onClose()) .catch((error): void => { console.error('Unable to save code', error); }); }, - [abi, codeHash, name, setIsOpen] + [abi, codeHash, name, onClose] ); return ( - <> -