Skip to content

Commit

Permalink
add apiKeyring.checkMnemonicValid() & bump polkadot-js/api v6.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed Oct 18, 2021
1 parent 09f5de4 commit 8c8acb2
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 84 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [0.3.5] - 20211018

* bump polkadot-js/api v6.4.1
* add apiKeyring.checkMnemonicValid()

## [0.3.4] - 20211012

* bump polkadot-js/api v6.3.1
Expand Down
2 changes: 1 addition & 1 deletion js_api/dist/main.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions js_api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@polkawallet/js-api",
"version": "0.3.3",
"version": "0.3.5",
"main": "index.js",
"license": "Apache-2.0",
"keywords": [
Expand All @@ -24,10 +24,10 @@
"build-dev": "webpack --mode development"
},
"resolutions": {
"@polkadot/api": "^6.3.1"
"@polkadot/api": "^6.4.1"
},
"dependencies": {
"@polkadot/api": "^6.3.1",
"@polkadot/api": "^6.4.1",
"@polkadot/extension-dapp": "^0.40.3",
"@polkadot/ui-shared": "0.85.5",
"@walletconnect/client": "2.0.0-alpha.26",
Expand Down
6 changes: 3 additions & 3 deletions js_api/src/constants/networkMetadata.ts

Large diffs are not rendered by default.

224 changes: 149 additions & 75 deletions js_api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1946,33 +1946,33 @@
dependencies:
pino "^6.7.0"

"@polkadot/api-derive@6.3.1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-6.3.1.tgz#88618243e15f82368256c7f8d068a4539f9327a3"
integrity sha512-SjE/ntziGzTcC/q+rx8HOGrCPFXGCLO9ZjoNrc+otEq9jikrMtY3pDbIyCCnnutHmx7se46e/thPungjV/wccg==
"@polkadot/api-derive@6.4.1":
version "6.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-6.4.1.tgz#5d7e1aaa18de3a806311c6a45c4ff37ea11f4ad9"
integrity sha512-RlgFEDh8LKEYYtKxacyF0Z00U/CAic/lTNvsiBHibZLRoekKdzcN9amv3Iu+giEyHIt/10NtM2+JUdmCZRgB0w==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/api" "6.3.1"
"@polkadot/rpc-core" "6.3.1"
"@polkadot/types" "6.3.1"
"@polkadot/util" "^7.4.1"
"@polkadot/util-crypto" "^7.4.1"
"@polkadot/api" "6.4.1"
"@polkadot/rpc-core" "6.4.1"
"@polkadot/types" "6.4.1"
"@polkadot/util" "^7.5.1"
"@polkadot/util-crypto" "^7.5.1"
rxjs "^7.4.0"

"@polkadot/api@6.3.1", "@polkadot/api@^6.3.1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-6.3.1.tgz#18859dec2cdd30b54e6c04bc23a9d906b485c5e8"
integrity sha512-4WbQNXIzPsmwktjR6VFQupU2uKl7Mkbch1ZsMc68a2TrGmeJTlhsTas2iL89VeM0Js3P7qp36ZiiKtMZ/IjWHQ==
"@polkadot/api@6.4.1", "@polkadot/api@^6.4.1":
version "6.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-6.4.1.tgz#b969a515712a8627af225a45d5a1dd133df49579"
integrity sha512-4kUEYrnOMsoGLVqs5nWEnTMSvvZaEz4wiebqV1SsRTn4GzbQBGaaJ8B0XMi9Y1KUGtI6CGc9dQvDEwSh8p+EGQ==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/api-derive" "6.3.1"
"@polkadot/keyring" "^7.4.1"
"@polkadot/rpc-core" "6.3.1"
"@polkadot/rpc-provider" "6.3.1"
"@polkadot/types" "6.3.1"
"@polkadot/types-known" "6.3.1"
"@polkadot/util" "^7.4.1"
"@polkadot/util-crypto" "^7.4.1"
"@polkadot/api-derive" "6.4.1"
"@polkadot/keyring" "^7.5.1"
"@polkadot/rpc-core" "6.4.1"
"@polkadot/rpc-provider" "6.4.1"
"@polkadot/types" "6.4.1"
"@polkadot/types-known" "6.4.1"
"@polkadot/util" "^7.5.1"
"@polkadot/util-crypto" "^7.5.1"
eventemitter3 "^4.0.7"
rxjs "^7.4.0"

Expand All @@ -1993,65 +1993,72 @@
dependencies:
"@babel/runtime" "^7.15.4"

"@polkadot/keyring@^7.4.1":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-7.4.1.tgz#cda3f371cc2a9bf4b8847bad41c4c14edfb05745"
integrity sha512-3QCfhiv8O2vpbQ4qThn7aQSEZ3EJm0WMJ1TxklKdzaZ+5K6kVFXOGbS3ntRXXjjtoOPSPuyjOiOq2YEi+69s4A==
"@polkadot/keyring@^7.5.1":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-7.5.1.tgz#0394d476f49f346589687611f7c273c63c9db8b2"
integrity sha512-zpgm7Z80zJrdchwkCcXynFQuWzQYh6XphoN4Z+dROtrHjFCHL2nC59gaL1iaqKLHlO/nPHarVIZqMXqluJ6KHA==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/util" "7.4.1"
"@polkadot/util-crypto" "7.4.1"
"@polkadot/util" "7.5.1"
"@polkadot/util-crypto" "7.5.1"

"@polkadot/[email protected]", "@polkadot/networks@^7.4.1":
"@polkadot/[email protected]":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-7.4.1.tgz#02b4a1a159e64b90a08d0f3a0206858b64846a3b"
integrity sha512-V+IagmVtaoDwR6zA+8R4JeihuTVJlheeYbDJyYCIyS9WtYImb5c7j/83XzoGicx+2auc+rwK2dH8hxHboi8Quw==
dependencies:
"@babel/runtime" "^7.15.4"

"@polkadot/[email protected].1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-6.3.1.tgz#96eebcea74c1334b128b34a341406ac6ade34e2d"
integrity sha512-JClQ2Gfr4g9cU+S1NADc9GH+YfwjniZXA1vYub0/94Oung7GGwp6zeICQow90NfOtYi4cpp/iPOD0H7HtDIRYA==
"@polkadot/[email protected]", "@polkadot/networks@^7.5.1":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-7.5.1.tgz#9513981d65993fd02df9762840c7662eb84574c2"
integrity sha512-UaVTP9eWg+mkW+oiuxfrOyVtLuNQ0u/Rer3rdHKom+bkQPf+NPeo+3ekg7YsWoi/fJN/OYMnIIM6rbloxm0GKA==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/rpc-provider" "6.3.1"
"@polkadot/types" "6.3.1"
"@polkadot/util" "^7.4.1"

"@polkadot/[email protected]":
version "6.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-6.4.1.tgz#dc4c63978684998af3506c0d164e0bd239e5023d"
integrity sha512-IsCzqnwKdU6Ci85kaw6tpXzLxa3N1eQvQe6AEtMVtAFY/K0I5B/GvPmsWmNqNVeyEdWI53UNtsPz/kEVT3X6Rw==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/rpc-provider" "6.4.1"
"@polkadot/types" "6.4.1"
"@polkadot/util" "^7.5.1"
rxjs "^7.4.0"

"@polkadot/rpc-provider@6.3.1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-6.3.1.tgz#8a9d11a0ad40783228e56f642bc0fe418227528c"
integrity sha512-hf1wIfQZWsq/OLrszsGTRx/bBjDqLOKj/e7Ly5O7t9ai3ItUsYewgjXo6AiCD80jttHm3h8wg+twnh7DJxJfHQ==
"@polkadot/rpc-provider@6.4.1":
version "6.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-6.4.1.tgz#8c3c8855ea3c5651e5059067a563fb80e11afdfb"
integrity sha512-p4H76uXQLeg+Vf/GGd3xXZFULYaXrsx7HWITpZZe2foY7GJPhE1+odBNqukWFBpjYniI7IT0NouWhjfxwcr5Cw==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/types" "6.3.1"
"@polkadot/util" "^7.4.1"
"@polkadot/util-crypto" "^7.4.1"
"@polkadot/x-fetch" "^7.4.1"
"@polkadot/x-global" "^7.4.1"
"@polkadot/x-ws" "^7.4.1"
"@polkadot/types" "6.4.1"
"@polkadot/util" "^7.5.1"
"@polkadot/util-crypto" "^7.5.1"
"@polkadot/x-fetch" "^7.5.1"
"@polkadot/x-global" "^7.5.1"
"@polkadot/x-ws" "^7.5.1"
eventemitter3 "^4.0.7"

"@polkadot/types-known@6.3.1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-6.3.1.tgz#dae6d8532272d8fc3c4ea53181a18d7d117b7113"
integrity sha512-zeFA2c/8irg0L5OQDfMAxBnODTbsibaa0q8bk+bsqK0sVgJ/l3Sz9XtONWL72s7FEi/zzXIOQLd+ffEVWmAN7A==
"@polkadot/types-known@6.4.1":
version "6.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-6.4.1.tgz#aedaec8b391d3447300d33fabae274d615295c59"
integrity sha512-aN2MaVX2GiEdKWdxaF7tAFpOZIWq4l4OaflfCPrgZ8EzthqkiLixFKxdSNprdNu+rm9tF9GTDZ801sDReI9dQA==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/networks" "^7.4.1"
"@polkadot/types" "6.3.1"
"@polkadot/util" "^7.4.1"
"@polkadot/networks" "^7.5.1"
"@polkadot/types" "6.4.1"
"@polkadot/util" "^7.5.1"

"@polkadot/types@6.3.1":
version "6.3.1"
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-6.3.1.tgz#98f14278806b68b784113b6aac361a9e4bd1b005"
integrity sha512-ZZHwohZlyBgTAXmvISWY/lkpOfi6IvX4QAxXUNG+fH2ZB8uLB+ZPKeztPIleOqApj3HzczOCpH9QXK3he2IzHQ==
"@polkadot/types@6.4.1":
version "6.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-6.4.1.tgz#d2abec76b50c5c5f4334ad429ce7b7215e1e18f4"
integrity sha512-tdlyoA5ltjCnMuBzWIPP98xSiCLYfcH4vHVrbdmzuk1ceEOmIU+TDZXBD8WBTvYLVvnW+W6ETRMCgTpP4+UpPA==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/util" "^7.4.1"
"@polkadot/util-crypto" "^7.4.1"
"@polkadot/util" "^7.5.1"
"@polkadot/util-crypto" "^7.5.1"
rxjs "^7.4.0"

"@polkadot/[email protected]":
Expand All @@ -2062,7 +2069,30 @@
"@babel/runtime" "^7.15.4"
color "^3.2.1"

"@polkadot/[email protected]", "@polkadot/util-crypto@^7.4.1":
"@polkadot/[email protected]", "@polkadot/util-crypto@^7.5.1":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-7.5.1.tgz#ff095262504a9f2829a41ff6b98ec3a537feb4ef"
integrity sha512-jghGTTMrGllf/TIKpWsphfXRfl0dzkn1/3PsiaFCKVLnZTmxeMv9FGH2Z6/L1XYeFheoBYmFIlKDNir45mZeiw==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/networks" "7.5.1"
"@polkadot/util" "7.5.1"
"@polkadot/wasm-crypto" "^4.2.1"
"@polkadot/x-randomvalues" "7.5.1"
base-x "^3.0.8"
base64-js "^1.5.1"
blakejs "^1.1.1"
bn.js "^4.12.0"
create-hash "^1.2.0"
ed2curve "^0.3.0"
elliptic "^6.5.4"
hash.js "^1.1.7"
js-sha3 "^0.8.0"
scryptsy "^2.1.0"
tweetnacl "^1.0.3"
xxhashjs "^0.2.2"

"@polkadot/util-crypto@^7.4.1":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-7.4.1.tgz#76760df995e9feb7deef69d85cab6c13e9ceb977"
integrity sha512-ragnHzqROJl6mlWDIgcHHMM42XA/v7BlnATbVEkKuKOV8xHmdpNHDdtTsqwWzJ+F+oV1jeITaIUZqPuEDWloiw==
Expand Down Expand Up @@ -2098,6 +2128,19 @@
camelcase "^6.2.0"
ip-regex "^4.3.0"

"@polkadot/[email protected]", "@polkadot/util@^7.5.1":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-7.5.1.tgz#aa5db65bb543173afe9db6749475b40908d98b76"
integrity sha512-6ltZyYZg/eUnyB5IBIcFpFFfhDL/ZW57Nt8CVcZmKqiKTL1kF60HmIvWky/agEV7fa00Ibd/zpANoQitEqNE0Q==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/x-textdecoder" "7.5.1"
"@polkadot/x-textencoder" "7.5.1"
"@types/bn.js" "^4.11.6"
bn.js "^4.12.0"
camelcase "^6.2.0"
ip-regex "^4.3.0"

"@polkadot/util@^0.41.1":
version "0.41.1"
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.41.1.tgz#b67762a0a7408138d843adc7240944e704e819e7"
Expand Down Expand Up @@ -2146,23 +2189,30 @@
resolved "https://registry.yarnpkg.com/@polkadot/wasm-schnorrkel/-/wasm-schnorrkel-0.3.1.tgz#08287848f769dee4955517348905888bd289f277"
integrity sha512-2J/lNZe7oDWvzUbsEfvKfiiAvBIBbIsppeBGahwSg2Y+cLweQgThXGizPpQoPo0tHxgMKdTi6jhPu7tLzCW/cA==

"@polkadot/x-fetch@^7.4.1":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-7.4.1.tgz#70dc3f648981f24b32afbcfb5b59e2000c72f4b2"
integrity sha512-ot7VcBVVSnrh+Kt0I+p/YISsenRFpmFl6sBGk4qz90JlPbrmuc93iTTwyImi1QaT6wYBEGGcM56wyfTxkzGG4g==
"@polkadot/x-fetch@^7.5.1":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-7.5.1.tgz#2329bfb749ad79fb0d631f98f81bbba2332e7036"
integrity sha512-bpKNPvT9yRQ6JRlLqezl7gAZQO8GGbAwx3eq+UUz/TaY7CHjld7T6CzVlXJgrOdAonCgTz9Rp0b1n1S21hyZWQ==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/x-global" "7.4.1"
"@polkadot/x-global" "7.5.1"
"@types/node-fetch" "^2.5.12"
node-fetch "^2.6.2"
node-fetch "^2.6.5"

"@polkadot/[email protected]", "@polkadot/x-global@^7.4.1":
"@polkadot/[email protected]":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-7.4.1.tgz#66f7f8a5d0208832773a4606c56d10e7927552fc"
integrity sha512-am24TT18b3H028ERjOtfrMt1MBIU4PN17n7+tpDmnS09HA+6ebfLlVTSU5gDWNu9p0EjzE0gOMTJIUw62mzkkg==
dependencies:
"@babel/runtime" "^7.15.4"

"@polkadot/[email protected]", "@polkadot/x-global@^7.5.1":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-7.5.1.tgz#d9723585d94c07807eab416ba92bcea65d21c3d5"
integrity sha512-SM5xbMgRAf/O5GTf8g1X9gwNaPVKGhIC6qj4ieN/pHQLAS2A5WcelmoQeJhHYrcW1JKR2m3kGKMMWuLKgMVWkw==
dependencies:
"@babel/runtime" "^7.15.4"

"@polkadot/[email protected]":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-7.4.1.tgz#e48d6c7fa869f5f871b2d18aa8b864c9802e9aeb"
Expand All @@ -2171,6 +2221,14 @@
"@babel/runtime" "^7.15.4"
"@polkadot/x-global" "7.4.1"

"@polkadot/[email protected]":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-7.5.1.tgz#030dddd785b2fcf700be4273b885774361d0b4ff"
integrity sha512-qyyV8ZRif0U0Sr2DhU9h9j6AXb67ckgj+3JVPWC30bcOi0p/biu1XFR1MlSLyB6KmxwQZxJ4SKCK3eRxbGxtdw==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/x-global" "7.5.1"

"@polkadot/[email protected]":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-7.4.1.tgz#e0e0bc375d5aa7fad8929a7ea1c279884c57ad26"
Expand All @@ -2179,6 +2237,14 @@
"@babel/runtime" "^7.15.4"
"@polkadot/x-global" "7.4.1"

"@polkadot/[email protected]":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-7.5.1.tgz#cfed161b94edd1721a2ab6f9f9114eee3960e2e9"
integrity sha512-dX4SL1QWmQau+gJiT/u8Vgh4DnyeGLd1MSWIg6MdYUCzmFs5tJg6Iqd94We2r9Lo22M0PJwXKlqf+3Fbhd2R9w==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/x-global" "7.5.1"

"@polkadot/[email protected]":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-7.4.1.tgz#0411213c6ab3f6f80af074f49ed12174c3e28775"
Expand All @@ -2187,13 +2253,21 @@
"@babel/runtime" "^7.15.4"
"@polkadot/x-global" "7.4.1"

"@polkadot/x-ws@^7.4.1":
version "7.4.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-7.4.1.tgz#94b310e3385dabf550adba99a2a06cbf03a737cb"
integrity sha512-OLM61XX8Ut8NiCqKjraDr+t8WNFGZEuhOOzyPiFfUYqSML12U0/xrdbkS2AQTrtey4Cxv7iJB9GWCjn0amM4LQ==
"@polkadot/x-[email protected].1":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-7.5.1.tgz#72d2c081c80dd30e594576d16b915a80ba77a0db"
integrity sha512-alzRtHXnydcCXK0JnmHF0W3DJMGgxGiFtGbTzvDorX6OefqjjqLYr8ALJka56xV04zsiCqAY6WqjRmu8BIBRYQ==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/x-global" "7.4.1"
"@polkadot/x-global" "7.5.1"

"@polkadot/x-ws@^7.5.1":
version "7.5.1"
resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-7.5.1.tgz#2d04dc84d47766e5313931b158ac538779a0d32e"
integrity sha512-+fBgPVExxUFR1WLpQls8i8GSw9zcYYEyWmGuzEvCeQ5HRYBlC0Of2coj8SNx17jKVIXVJ8Goyphs5c3Og0d7fQ==
dependencies:
"@babel/runtime" "^7.15.4"
"@polkadot/x-global" "7.5.1"
"@types/websocket" "^1.0.4"
websocket "^1.0.34"

Expand Down Expand Up @@ -8018,10 +8092,10 @@ node-fetch@^1.0.1:
encoding "^0.1.11"
is-stream "^1.0.1"

node-fetch@^2.6.2:
version "2.6.4"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.4.tgz#7f1d13b8f9ff0c1a994dc6f73c69f7d652c7ace2"
integrity sha512-aD1fO+xtLiSCc9vuD+sYMxpIuQyhHscGSkBEo2o5LTV/3bTEAYvdUii29n8LlO5uLCmWdGP7uVUVXFo5SRdkLA==
node-fetch@^2.6.5:
version "2.6.5"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd"
integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==
dependencies:
whatwg-url "^5.0.0"

Expand Down
5 changes: 5 additions & 0 deletions lib/api/apiKeyring.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class ApiKeyring {
});
}

/// check mnemonic valid.
Future<bool> checkMnemonicValid(String mnemonic) async {
return service!.checkMnemonicValid(mnemonic);
}

/// Import account from mnemonic/rawSeed/keystore.
/// param [cryptoType] can be `sr25519`(default) or `ed25519`.
/// throw error if import failed.
Expand Down
14 changes: 13 additions & 1 deletion lib/service/keyring.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,22 @@ class ServiceKeyring {
.evalJavascript('account.decodeAddress(["$addressOld"])'
'.then(res => account.encodeAddress(Object.keys(res), [$ss58]))'
'.then(res => account.genIcons(Object.values(res[$ss58])))');
print(acc);
return acc;
}

/// check mnemonic valid.
Future<bool> checkMnemonicValid(String mnemonic) async {
final isApiSupport = (await serviceRoot.webView!.evalJavascript(
'keyring.checkMnemonicValid ? {}:null',
wrapPromise: false)) !=
null;
final bool res = isApiSupport
? (await serviceRoot.webView!
.evalJavascript('keyring.checkMnemonicValid("$mnemonic")'))
: true;
return res;
}

/// Import account from mnemonic/rawSeed/keystore.
/// param [cryptoType] can be `sr25519`(default) or `ed25519`.
/// return [null] if import failed.
Expand Down
Loading

0 comments on commit 8c8acb2

Please sign in to comment.