Skip to content

Commit 8c8acb2

Browse files
committed
add apiKeyring.checkMnemonicValid() & bump polkadot-js/api v6.4.1
1 parent 09f5de4 commit 8c8acb2

File tree

8 files changed

+180
-84
lines changed

8 files changed

+180
-84
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [0.3.5] - 20211018
2+
3+
* bump polkadot-js/api v6.4.1
4+
* add apiKeyring.checkMnemonicValid()
5+
16
## [0.3.4] - 20211012
27

38
* bump polkadot-js/api v6.3.1

js_api/dist/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js_api/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@polkawallet/js-api",
3-
"version": "0.3.3",
3+
"version": "0.3.5",
44
"main": "index.js",
55
"license": "Apache-2.0",
66
"keywords": [
@@ -24,10 +24,10 @@
2424
"build-dev": "webpack --mode development"
2525
},
2626
"resolutions": {
27-
"@polkadot/api": "^6.3.1"
27+
"@polkadot/api": "^6.4.1"
2828
},
2929
"dependencies": {
30-
"@polkadot/api": "^6.3.1",
30+
"@polkadot/api": "^6.4.1",
3131
"@polkadot/extension-dapp": "^0.40.3",
3232
"@polkadot/ui-shared": "0.85.5",
3333
"@walletconnect/client": "2.0.0-alpha.26",

js_api/src/constants/networkMetadata.ts

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

js_api/yarn.lock

Lines changed: 149 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,33 +1946,33 @@
19461946
dependencies:
19471947
pino "^6.7.0"
19481948

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

1962-
"@polkadot/api@6.3.1", "@polkadot/api@^6.3.1":
1963-
version "6.3.1"
1964-
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-6.3.1.tgz#18859dec2cdd30b54e6c04bc23a9d906b485c5e8"
1965-
integrity sha512-4WbQNXIzPsmwktjR6VFQupU2uKl7Mkbch1ZsMc68a2TrGmeJTlhsTas2iL89VeM0Js3P7qp36ZiiKtMZ/IjWHQ==
1962+
"@polkadot/api@6.4.1", "@polkadot/api@^6.4.1":
1963+
version "6.4.1"
1964+
resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-6.4.1.tgz#b969a515712a8627af225a45d5a1dd133df49579"
1965+
integrity sha512-4kUEYrnOMsoGLVqs5nWEnTMSvvZaEz4wiebqV1SsRTn4GzbQBGaaJ8B0XMi9Y1KUGtI6CGc9dQvDEwSh8p+EGQ==
19661966
dependencies:
19671967
"@babel/runtime" "^7.15.4"
1968-
"@polkadot/api-derive" "6.3.1"
1969-
"@polkadot/keyring" "^7.4.1"
1970-
"@polkadot/rpc-core" "6.3.1"
1971-
"@polkadot/rpc-provider" "6.3.1"
1972-
"@polkadot/types" "6.3.1"
1973-
"@polkadot/types-known" "6.3.1"
1974-
"@polkadot/util" "^7.4.1"
1975-
"@polkadot/util-crypto" "^7.4.1"
1968+
"@polkadot/api-derive" "6.4.1"
1969+
"@polkadot/keyring" "^7.5.1"
1970+
"@polkadot/rpc-core" "6.4.1"
1971+
"@polkadot/rpc-provider" "6.4.1"
1972+
"@polkadot/types" "6.4.1"
1973+
"@polkadot/types-known" "6.4.1"
1974+
"@polkadot/util" "^7.5.1"
1975+
"@polkadot/util-crypto" "^7.5.1"
19761976
eventemitter3 "^4.0.7"
19771977
rxjs "^7.4.0"
19781978

@@ -1993,65 +1993,72 @@
19931993
dependencies:
19941994
"@babel/runtime" "^7.15.4"
19951995

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

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

2012-
"@polkadot/[email protected].1":
2013-
version "6.3.1"
2014-
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-6.3.1.tgz#96eebcea74c1334b128b34a341406ac6ade34e2d"
2015-
integrity sha512-JClQ2Gfr4g9cU+S1NADc9GH+YfwjniZXA1vYub0/94Oung7GGwp6zeICQow90NfOtYi4cpp/iPOD0H7HtDIRYA==
2012+
"@polkadot/[email protected]", "@polkadot/networks@^7.5.1":
2013+
version "7.5.1"
2014+
resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-7.5.1.tgz#9513981d65993fd02df9762840c7662eb84574c2"
2015+
integrity sha512-UaVTP9eWg+mkW+oiuxfrOyVtLuNQ0u/Rer3rdHKom+bkQPf+NPeo+3ekg7YsWoi/fJN/OYMnIIM6rbloxm0GKA==
20162016
dependencies:
20172017
"@babel/runtime" "^7.15.4"
2018-
"@polkadot/rpc-provider" "6.3.1"
2019-
"@polkadot/types" "6.3.1"
2020-
"@polkadot/util" "^7.4.1"
2018+
2019+
"@polkadot/[email protected]":
2020+
version "6.4.1"
2021+
resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-6.4.1.tgz#dc4c63978684998af3506c0d164e0bd239e5023d"
2022+
integrity sha512-IsCzqnwKdU6Ci85kaw6tpXzLxa3N1eQvQe6AEtMVtAFY/K0I5B/GvPmsWmNqNVeyEdWI53UNtsPz/kEVT3X6Rw==
2023+
dependencies:
2024+
"@babel/runtime" "^7.15.4"
2025+
"@polkadot/rpc-provider" "6.4.1"
2026+
"@polkadot/types" "6.4.1"
2027+
"@polkadot/util" "^7.5.1"
20212028
rxjs "^7.4.0"
20222029

2023-
"@polkadot/rpc-provider@6.3.1":
2024-
version "6.3.1"
2025-
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-6.3.1.tgz#8a9d11a0ad40783228e56f642bc0fe418227528c"
2026-
integrity sha512-hf1wIfQZWsq/OLrszsGTRx/bBjDqLOKj/e7Ly5O7t9ai3ItUsYewgjXo6AiCD80jttHm3h8wg+twnh7DJxJfHQ==
2030+
"@polkadot/rpc-provider@6.4.1":
2031+
version "6.4.1"
2032+
resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-6.4.1.tgz#8c3c8855ea3c5651e5059067a563fb80e11afdfb"
2033+
integrity sha512-p4H76uXQLeg+Vf/GGd3xXZFULYaXrsx7HWITpZZe2foY7GJPhE1+odBNqukWFBpjYniI7IT0NouWhjfxwcr5Cw==
20272034
dependencies:
20282035
"@babel/runtime" "^7.15.4"
2029-
"@polkadot/types" "6.3.1"
2030-
"@polkadot/util" "^7.4.1"
2031-
"@polkadot/util-crypto" "^7.4.1"
2032-
"@polkadot/x-fetch" "^7.4.1"
2033-
"@polkadot/x-global" "^7.4.1"
2034-
"@polkadot/x-ws" "^7.4.1"
2036+
"@polkadot/types" "6.4.1"
2037+
"@polkadot/util" "^7.5.1"
2038+
"@polkadot/util-crypto" "^7.5.1"
2039+
"@polkadot/x-fetch" "^7.5.1"
2040+
"@polkadot/x-global" "^7.5.1"
2041+
"@polkadot/x-ws" "^7.5.1"
20352042
eventemitter3 "^4.0.7"
20362043

2037-
"@polkadot/types-known@6.3.1":
2038-
version "6.3.1"
2039-
resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-6.3.1.tgz#dae6d8532272d8fc3c4ea53181a18d7d117b7113"
2040-
integrity sha512-zeFA2c/8irg0L5OQDfMAxBnODTbsibaa0q8bk+bsqK0sVgJ/l3Sz9XtONWL72s7FEi/zzXIOQLd+ffEVWmAN7A==
2044+
"@polkadot/types-known@6.4.1":
2045+
version "6.4.1"
2046+
resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-6.4.1.tgz#aedaec8b391d3447300d33fabae274d615295c59"
2047+
integrity sha512-aN2MaVX2GiEdKWdxaF7tAFpOZIWq4l4OaflfCPrgZ8EzthqkiLixFKxdSNprdNu+rm9tF9GTDZ801sDReI9dQA==
20412048
dependencies:
20422049
"@babel/runtime" "^7.15.4"
2043-
"@polkadot/networks" "^7.4.1"
2044-
"@polkadot/types" "6.3.1"
2045-
"@polkadot/util" "^7.4.1"
2050+
"@polkadot/networks" "^7.5.1"
2051+
"@polkadot/types" "6.4.1"
2052+
"@polkadot/util" "^7.5.1"
20462053

2047-
"@polkadot/types@6.3.1":
2048-
version "6.3.1"
2049-
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-6.3.1.tgz#98f14278806b68b784113b6aac361a9e4bd1b005"
2050-
integrity sha512-ZZHwohZlyBgTAXmvISWY/lkpOfi6IvX4QAxXUNG+fH2ZB8uLB+ZPKeztPIleOqApj3HzczOCpH9QXK3he2IzHQ==
2054+
"@polkadot/types@6.4.1":
2055+
version "6.4.1"
2056+
resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-6.4.1.tgz#d2abec76b50c5c5f4334ad429ce7b7215e1e18f4"
2057+
integrity sha512-tdlyoA5ltjCnMuBzWIPP98xSiCLYfcH4vHVrbdmzuk1ceEOmIU+TDZXBD8WBTvYLVvnW+W6ETRMCgTpP4+UpPA==
20512058
dependencies:
20522059
"@babel/runtime" "^7.15.4"
2053-
"@polkadot/util" "^7.4.1"
2054-
"@polkadot/util-crypto" "^7.4.1"
2060+
"@polkadot/util" "^7.5.1"
2061+
"@polkadot/util-crypto" "^7.5.1"
20552062
rxjs "^7.4.0"
20562063

20572064
"@polkadot/[email protected]":
@@ -2062,7 +2069,30 @@
20622069
"@babel/runtime" "^7.15.4"
20632070
color "^3.2.1"
20642071

2065-
"@polkadot/[email protected]", "@polkadot/util-crypto@^7.4.1":
2072+
"@polkadot/[email protected]", "@polkadot/util-crypto@^7.5.1":
2073+
version "7.5.1"
2074+
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-7.5.1.tgz#ff095262504a9f2829a41ff6b98ec3a537feb4ef"
2075+
integrity sha512-jghGTTMrGllf/TIKpWsphfXRfl0dzkn1/3PsiaFCKVLnZTmxeMv9FGH2Z6/L1XYeFheoBYmFIlKDNir45mZeiw==
2076+
dependencies:
2077+
"@babel/runtime" "^7.15.4"
2078+
"@polkadot/networks" "7.5.1"
2079+
"@polkadot/util" "7.5.1"
2080+
"@polkadot/wasm-crypto" "^4.2.1"
2081+
"@polkadot/x-randomvalues" "7.5.1"
2082+
base-x "^3.0.8"
2083+
base64-js "^1.5.1"
2084+
blakejs "^1.1.1"
2085+
bn.js "^4.12.0"
2086+
create-hash "^1.2.0"
2087+
ed2curve "^0.3.0"
2088+
elliptic "^6.5.4"
2089+
hash.js "^1.1.7"
2090+
js-sha3 "^0.8.0"
2091+
scryptsy "^2.1.0"
2092+
tweetnacl "^1.0.3"
2093+
xxhashjs "^0.2.2"
2094+
2095+
"@polkadot/util-crypto@^7.4.1":
20662096
version "7.4.1"
20672097
resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-7.4.1.tgz#76760df995e9feb7deef69d85cab6c13e9ceb977"
20682098
integrity sha512-ragnHzqROJl6mlWDIgcHHMM42XA/v7BlnATbVEkKuKOV8xHmdpNHDdtTsqwWzJ+F+oV1jeITaIUZqPuEDWloiw==
@@ -2098,6 +2128,19 @@
20982128
camelcase "^6.2.0"
20992129
ip-regex "^4.3.0"
21002130

2131+
"@polkadot/[email protected]", "@polkadot/util@^7.5.1":
2132+
version "7.5.1"
2133+
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-7.5.1.tgz#aa5db65bb543173afe9db6749475b40908d98b76"
2134+
integrity sha512-6ltZyYZg/eUnyB5IBIcFpFFfhDL/ZW57Nt8CVcZmKqiKTL1kF60HmIvWky/agEV7fa00Ibd/zpANoQitEqNE0Q==
2135+
dependencies:
2136+
"@babel/runtime" "^7.15.4"
2137+
"@polkadot/x-textdecoder" "7.5.1"
2138+
"@polkadot/x-textencoder" "7.5.1"
2139+
"@types/bn.js" "^4.11.6"
2140+
bn.js "^4.12.0"
2141+
camelcase "^6.2.0"
2142+
ip-regex "^4.3.0"
2143+
21012144
"@polkadot/util@^0.41.1":
21022145
version "0.41.1"
21032146
resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.41.1.tgz#b67762a0a7408138d843adc7240944e704e819e7"
@@ -2146,23 +2189,30 @@
21462189
resolved "https://registry.yarnpkg.com/@polkadot/wasm-schnorrkel/-/wasm-schnorrkel-0.3.1.tgz#08287848f769dee4955517348905888bd289f277"
21472190
integrity sha512-2J/lNZe7oDWvzUbsEfvKfiiAvBIBbIsppeBGahwSg2Y+cLweQgThXGizPpQoPo0tHxgMKdTi6jhPu7tLzCW/cA==
21482191

2149-
"@polkadot/x-fetch@^7.4.1":
2150-
version "7.4.1"
2151-
resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-7.4.1.tgz#70dc3f648981f24b32afbcfb5b59e2000c72f4b2"
2152-
integrity sha512-ot7VcBVVSnrh+Kt0I+p/YISsenRFpmFl6sBGk4qz90JlPbrmuc93iTTwyImi1QaT6wYBEGGcM56wyfTxkzGG4g==
2192+
"@polkadot/x-fetch@^7.5.1":
2193+
version "7.5.1"
2194+
resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-7.5.1.tgz#2329bfb749ad79fb0d631f98f81bbba2332e7036"
2195+
integrity sha512-bpKNPvT9yRQ6JRlLqezl7gAZQO8GGbAwx3eq+UUz/TaY7CHjld7T6CzVlXJgrOdAonCgTz9Rp0b1n1S21hyZWQ==
21532196
dependencies:
21542197
"@babel/runtime" "^7.15.4"
2155-
"@polkadot/x-global" "7.4.1"
2198+
"@polkadot/x-global" "7.5.1"
21562199
"@types/node-fetch" "^2.5.12"
2157-
node-fetch "^2.6.2"
2200+
node-fetch "^2.6.5"
21582201

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

2209+
"@polkadot/[email protected]", "@polkadot/x-global@^7.5.1":
2210+
version "7.5.1"
2211+
resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-7.5.1.tgz#d9723585d94c07807eab416ba92bcea65d21c3d5"
2212+
integrity sha512-SM5xbMgRAf/O5GTf8g1X9gwNaPVKGhIC6qj4ieN/pHQLAS2A5WcelmoQeJhHYrcW1JKR2m3kGKMMWuLKgMVWkw==
2213+
dependencies:
2214+
"@babel/runtime" "^7.15.4"
2215+
21662216
"@polkadot/[email protected]":
21672217
version "7.4.1"
21682218
resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-7.4.1.tgz#e48d6c7fa869f5f871b2d18aa8b864c9802e9aeb"
@@ -2171,6 +2221,14 @@
21712221
"@babel/runtime" "^7.15.4"
21722222
"@polkadot/x-global" "7.4.1"
21732223

2224+
"@polkadot/[email protected]":
2225+
version "7.5.1"
2226+
resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-7.5.1.tgz#030dddd785b2fcf700be4273b885774361d0b4ff"
2227+
integrity sha512-qyyV8ZRif0U0Sr2DhU9h9j6AXb67ckgj+3JVPWC30bcOi0p/biu1XFR1MlSLyB6KmxwQZxJ4SKCK3eRxbGxtdw==
2228+
dependencies:
2229+
"@babel/runtime" "^7.15.4"
2230+
"@polkadot/x-global" "7.5.1"
2231+
21742232
"@polkadot/[email protected]":
21752233
version "7.4.1"
21762234
resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-7.4.1.tgz#e0e0bc375d5aa7fad8929a7ea1c279884c57ad26"
@@ -2179,6 +2237,14 @@
21792237
"@babel/runtime" "^7.15.4"
21802238
"@polkadot/x-global" "7.4.1"
21812239

2240+
"@polkadot/[email protected]":
2241+
version "7.5.1"
2242+
resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-7.5.1.tgz#cfed161b94edd1721a2ab6f9f9114eee3960e2e9"
2243+
integrity sha512-dX4SL1QWmQau+gJiT/u8Vgh4DnyeGLd1MSWIg6MdYUCzmFs5tJg6Iqd94We2r9Lo22M0PJwXKlqf+3Fbhd2R9w==
2244+
dependencies:
2245+
"@babel/runtime" "^7.15.4"
2246+
"@polkadot/x-global" "7.5.1"
2247+
21822248
"@polkadot/[email protected]":
21832249
version "7.4.1"
21842250
resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-7.4.1.tgz#0411213c6ab3f6f80af074f49ed12174c3e28775"
@@ -2187,13 +2253,21 @@
21872253
"@babel/runtime" "^7.15.4"
21882254
"@polkadot/x-global" "7.4.1"
21892255

2190-
"@polkadot/x-ws@^7.4.1":
2191-
version "7.4.1"
2192-
resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-7.4.1.tgz#94b310e3385dabf550adba99a2a06cbf03a737cb"
2193-
integrity sha512-OLM61XX8Ut8NiCqKjraDr+t8WNFGZEuhOOzyPiFfUYqSML12U0/xrdbkS2AQTrtey4Cxv7iJB9GWCjn0amM4LQ==
2256+
"@polkadot/x-[email protected].1":
2257+
version "7.5.1"
2258+
resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-7.5.1.tgz#72d2c081c80dd30e594576d16b915a80ba77a0db"
2259+
integrity sha512-alzRtHXnydcCXK0JnmHF0W3DJMGgxGiFtGbTzvDorX6OefqjjqLYr8ALJka56xV04zsiCqAY6WqjRmu8BIBRYQ==
21942260
dependencies:
21952261
"@babel/runtime" "^7.15.4"
2196-
"@polkadot/x-global" "7.4.1"
2262+
"@polkadot/x-global" "7.5.1"
2263+
2264+
"@polkadot/x-ws@^7.5.1":
2265+
version "7.5.1"
2266+
resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-7.5.1.tgz#2d04dc84d47766e5313931b158ac538779a0d32e"
2267+
integrity sha512-+fBgPVExxUFR1WLpQls8i8GSw9zcYYEyWmGuzEvCeQ5HRYBlC0Of2coj8SNx17jKVIXVJ8Goyphs5c3Og0d7fQ==
2268+
dependencies:
2269+
"@babel/runtime" "^7.15.4"
2270+
"@polkadot/x-global" "7.5.1"
21972271
"@types/websocket" "^1.0.4"
21982272
websocket "^1.0.34"
21992273

@@ -8018,10 +8092,10 @@ node-fetch@^1.0.1:
80188092
encoding "^0.1.11"
80198093
is-stream "^1.0.1"
80208094

8021-
node-fetch@^2.6.2:
8022-
version "2.6.4"
8023-
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.4.tgz#7f1d13b8f9ff0c1a994dc6f73c69f7d652c7ace2"
8024-
integrity sha512-aD1fO+xtLiSCc9vuD+sYMxpIuQyhHscGSkBEo2o5LTV/3bTEAYvdUii29n8LlO5uLCmWdGP7uVUVXFo5SRdkLA==
8095+
node-fetch@^2.6.5:
8096+
version "2.6.5"
8097+
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.5.tgz#42735537d7f080a7e5f78b6c549b7146be1742fd"
8098+
integrity sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==
80258099
dependencies:
80268100
whatwg-url "^5.0.0"
80278101

lib/api/apiKeyring.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ class ApiKeyring {
5959
});
6060
}
6161

62+
/// check mnemonic valid.
63+
Future<bool> checkMnemonicValid(String mnemonic) async {
64+
return service!.checkMnemonicValid(mnemonic);
65+
}
66+
6267
/// Import account from mnemonic/rawSeed/keystore.
6368
/// param [cryptoType] can be `sr25519`(default) or `ed25519`.
6469
/// throw error if import failed.

lib/service/keyring.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,22 @@ class ServiceKeyring {
107107
.evalJavascript('account.decodeAddress(["$addressOld"])'
108108
'.then(res => account.encodeAddress(Object.keys(res), [$ss58]))'
109109
'.then(res => account.genIcons(Object.values(res[$ss58])))');
110-
print(acc);
111110
return acc;
112111
}
113112

113+
/// check mnemonic valid.
114+
Future<bool> checkMnemonicValid(String mnemonic) async {
115+
final isApiSupport = (await serviceRoot.webView!.evalJavascript(
116+
'keyring.checkMnemonicValid ? {}:null',
117+
wrapPromise: false)) !=
118+
null;
119+
final bool res = isApiSupport
120+
? (await serviceRoot.webView!
121+
.evalJavascript('keyring.checkMnemonicValid("$mnemonic")'))
122+
: true;
123+
return res;
124+
}
125+
114126
/// Import account from mnemonic/rawSeed/keystore.
115127
/// param [cryptoType] can be `sr25519`(default) or `ed25519`.
116128
/// return [null] if import failed.

0 commit comments

Comments
 (0)