Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4923b80fc | ||
|
|
678d4dc524 | ||
|
|
4e92aab586 | ||
|
|
1833b1a28f | ||
|
|
3ca640fd3c | ||
|
|
0017139d69 | ||
|
|
87fd12c002 | ||
|
|
723641ac57 | ||
|
|
4155547c0b | ||
|
|
262b8ad7c3 | ||
|
|
64f630d904 | ||
|
|
8525c59b9a | ||
|
|
0288421cef | ||
|
|
8f1ae11d9c | ||
|
|
8f61882bf7 | ||
|
|
12cba3f23d | ||
|
|
05d8d95991 | ||
|
|
adbaa6caf4 | ||
|
|
db6948d658 | ||
|
|
6ca5ac62eb | ||
|
|
0b63b9eaf9 | ||
|
|
b62cfcaf94 | ||
|
|
e24cf09608 | ||
|
|
815bbd647c | ||
|
|
54a325f306 | ||
|
|
d5b9362c85 | ||
|
|
55f3ca652d | ||
|
|
1cce48ef53 | ||
|
|
44bf1f4260 | ||
|
|
a26ef77df2 | ||
|
|
0bffc7af3c | ||
|
|
496dc7fe2e | ||
|
|
3610d1b921 | ||
|
|
abdfa588a6 | ||
|
|
ccfa730713 | ||
|
|
3eb8799f67 | ||
|
|
42e57ee0ca | ||
|
|
e37751672b | ||
|
|
9768383b40 | ||
|
|
b87479f618 | ||
|
|
fdc310b32e | ||
|
|
8766481109 | ||
|
|
d4575f7e65 | ||
|
|
59952cbb3a | ||
|
|
492e1739bc | ||
|
|
a6065f7154 | ||
|
|
11c44643aa | ||
|
|
04b61d6b7a | ||
|
|
bc15f44780 | ||
|
|
735b18d59f | ||
|
|
5001dea3c1 | ||
|
|
1be84c778b | ||
|
|
ddb1b8169b | ||
|
|
e077259037 | ||
|
|
c88bccb560 | ||
|
|
5bd2b3c85e | ||
|
|
078d6800a6 | ||
|
|
4126dffc96 | ||
|
|
61400d4c03 | ||
|
|
a3ab735c4e | ||
|
|
0138ac3e4a | ||
|
|
0dcbdcac3a |
@@ -1 +1,2 @@
|
||||
1
|
||||
0.57.20.57.3
|
||||
@@ -1 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/ui authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
module.exports = require('./babel.config.js');
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// Copyright 2017-2020 @polkadot/ui authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const base = require('@polkadot/dev/config/eslint');
|
||||
|
||||
module.exports = {
|
||||
@@ -7,5 +10,14 @@ module.exports = {
|
||||
project: [
|
||||
'./tsconfig.json'
|
||||
]
|
||||
},
|
||||
rules: {
|
||||
...base.rules,
|
||||
// add override for any (a metric ton of them, initial conversion)
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
// these should be removed, there are 8 of them as errors
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
// this seems very broken atm, false positives
|
||||
'@typescript-eslint/unbound-method': 'off'
|
||||
}
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+55
File diff suppressed because one or more lines are too long
Vendored
-56
File diff suppressed because one or more lines are too long
+2
-2
@@ -5,7 +5,7 @@ enableProgressBars: false
|
||||
nodeLinker: node-modules
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.js
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
||||
|
||||
yarnPath: .yarn/releases/yarn-rc.js
|
||||
yarnPath: .yarn/releases/yarn-2.2.2.cjs
|
||||
|
||||
+150
-1
@@ -1,119 +1,217 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 0.59.1 Sep 28, 2020
|
||||
|
||||
Changes:
|
||||
|
||||
- Expose createFromJson on keyring to compliment createFromUri
|
||||
- Support Account/address indexes for Ledger
|
||||
- Bump to `@polkadot/api` 2.0.1
|
||||
- Bump to `@polkadot/util` 3.5.1
|
||||
|
||||
|
||||
## 0.58.1 Aug 31, 2020
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add Subsocial to ss58 defaults (Thanks to https://github.com/F3Joule)
|
||||
|
||||
Changes:
|
||||
|
||||
- Support QR scanning where name contains ":"
|
||||
- Support for Moonbeam ETH-compatible crypto types
|
||||
|
||||
|
||||
## 0.57.3 Jul 27, 2020
|
||||
|
||||
Changes:
|
||||
|
||||
- Support for JSON v3 kdf-enabled format
|
||||
- Adjust password validity checks (alongside v3)
|
||||
- Bump to `@polkadot/api` 1.26.1
|
||||
- Bump to `@polkadot/util` 3.0.1
|
||||
|
||||
|
||||
## 0.56.1 Jul 20, 2020
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add Kulupu to ss58 options (https://github.com/carumusan)
|
||||
|
||||
Changes:
|
||||
|
||||
- Remove CC1 naming for Polkadot (as applicable)
|
||||
- Flatten React IdentityIcon (no extra wrapping)
|
||||
- Bump to `@polkadot/api` 1.25.1
|
||||
- Bump to `@polkadot/util` 2.18.1
|
||||
|
||||
|
||||
## 0.55.1 Jul 2, 2020
|
||||
|
||||
Contributed:
|
||||
|
||||
- Better error-handling for invalid FileStore accounts (Thanks to https://github.com/yuhui1208)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust react-qr `Scan*` making `onScan` callbacks required
|
||||
- Rework the react-qr display to use functional components
|
||||
- Bump to `@polkadot/api` 1.21.1
|
||||
- Bump to `@polkadot/util` 2.15.1
|
||||
|
||||
|
||||
## 0.54.1 Jun 16, 2020
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add genesisHash to signer payload (Thanks to https://github.com/hanwencheng)
|
||||
- Allow QR scanning to parse mini keys (Thanks to https://github.com/hanwencheng)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust ordering of available crypto types (native first)
|
||||
- Rename Substrate prefix entry (42) to "generic"
|
||||
- Bump to `@polkadot/api` 1.19.1
|
||||
- Bump to `@polkadot/util` 2.14.1
|
||||
|
||||
|
||||
## 0.53.1 May 14, 2020
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add Ecdsa to the supported crypto types options (Thanks to https://github.com/akru)
|
||||
- Add Egedware to network prefix settings (Thanks to https://github.com/jnaviask)
|
||||
|
||||
Changes:
|
||||
|
||||
- Add `addMultisig` into keyring (with all options to re-create address)
|
||||
- Bump to `@polkadot/api` 1.14.1
|
||||
- Bump to `@polkadot/util` 2.10.1
|
||||
|
||||
|
||||
## 0.52.1 Apr 15, 2020
|
||||
|
||||
- **Breaking change** (TypeScript only) The `*.d.ts` files now contain TypeScript 3.8 features, `#private`, which is not usable in older versions
|
||||
|
||||
Contributed:
|
||||
|
||||
- Allow for the encoding of chain-settings via QR (Thanks to https://github.com/hanwencheng)
|
||||
- Enhance checks for ws url in settings (Thanks to https://github.com/kwingram25)
|
||||
|
||||
Changes:
|
||||
|
||||
- Start of `isAlternative` implementations for identicons to react, react-native & vue (currently only Polkadot sixPoint)
|
||||
- Bump to `@polkadot/api` 1.10 & `@polkadot/util` 2.8
|
||||
- Convert `private <field>` to `#<field>`
|
||||
- Remove internal/duplicated ui-keyring ss58Format mapping, rather set it directly on wrapped keyring
|
||||
|
||||
|
||||
## 0.51.1 Feb 18, 2020
|
||||
|
||||
Changes:
|
||||
|
||||
- Support formatting of addresses via createPair base on latest upstream keyring
|
||||
- Bump to `@polkadot/api` 1.3.1
|
||||
- Bump to `@polkadot/util` 2.4.1
|
||||
|
||||
|
||||
## 0.50.1 Feb 16, 2020
|
||||
|
||||
Changes:
|
||||
|
||||
- ui-settings does not expose pre-configured endpoints by default (only local dev node)
|
||||
- Bump to `@polkadot/api` 1.2.1
|
||||
- Bump to `@polkadot/util` 2.3.1
|
||||
|
||||
|
||||
## 0.49.1 Feb 06, 2020
|
||||
|
||||
Changes:
|
||||
|
||||
- Add resolver for jest requires (tests from src)
|
||||
|
||||
|
||||
## 0.48.1 Jan 30, 2020
|
||||
|
||||
Changes:
|
||||
|
||||
- Add Westend & Kulupulu, remove Alexander
|
||||
- Update Edgeware wss uri
|
||||
- Change display name for Kusama
|
||||
- Mirror QR scanning display
|
||||
|
||||
|
||||
## 0.47.1 Nov 29, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Support for Kusama CC3 (network endpoints)
|
||||
- Genesis hashes for accounts can now lookup against a range (so CC2-locked accounts will show on CC3)
|
||||
- Language options have been removed from settings (these will be app-specific)
|
||||
- QR display loops now have a timeout decay (slower as it loops)
|
||||
|
||||
|
||||
## 0.46.1 Oct 25, 2019
|
||||
|
||||
- Add an example for using React Native (thanks to https://github.com/cameronfr)
|
||||
|
||||
Changes:
|
||||
|
||||
- Add base documentation for getting started
|
||||
- Add camera access to the setting structure
|
||||
|
||||
|
||||
## 0.45.1 Sep 26, 2019
|
||||
|
||||
- Support for Kusama CC2
|
||||
- **Breaking change** The subscription subject for `ui-keyring` does not return a pre-formatted React object anymore. This is SUI-specific, so had limited use and therefore should not even be split into a `react-keyring` component. Rather users of this functionality should construct their own options for their framework.
|
||||
|
||||
Changes:
|
||||
|
||||
- Support for Kusama CC2
|
||||
- Experimental support for signing via Ledger HW
|
||||
- Add specific settings for the icon type to `ui-settings`
|
||||
- Add Edgeware live RPC endpoints to `ui-settings`
|
||||
- Adjust `react-identicon` highlights (validators)
|
||||
- Add `example-{react, vue}` highlighting simple use with `ui-keyring`, `ui-settings` & `*-identicon` components
|
||||
|
||||
|
||||
## 0.44.1 Sep 12, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Update `@polkadot/util` to 1.4.1
|
||||
- Upddate to Babel 7.6
|
||||
|
||||
|
||||
## 0.43.1 Sep 10, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Add W3F Node for Kusama
|
||||
- Add extended info to ui-settings, i.e. info on each option
|
||||
- Adjust logos in ui-assets (incl. updated Substrate logo)
|
||||
- ui-keyring now check the genesisHash on all load operations (if supplied)
|
||||
- react-qr is now operational and integrated in the polkadot-js/extension and apps repos
|
||||
|
||||
|
||||
## 0.42.1 Aug 24, 2019
|
||||
|
||||
- **Breaking Change** The `@polkadot/ui-identicon` package has been renamed to `@polkadot/react-identicon`
|
||||
- **Breaking change** For `@polkadot/ui-keyring` the stores are now not exported from the index, imports should be changed to either `ui-keyring/stores` or explicitly to `ui-keyring/stores/Extension`
|
||||
|
||||
Changes:
|
||||
|
||||
- Support for Kusama with endpoints and settings
|
||||
- The `@polkadot/reactnative-identicon` package has been added (only Polkadot support atm)
|
||||
- The `@polkadot/react-qr` package has been added to display/scan QR codes
|
||||
- `@polkadot/ui-settings` has UNfrastructure added as an RPC provider for Alex
|
||||
- `@polkadot/ui-settings` exposes a dropdown with address prefix options
|
||||
|
||||
|
||||
## 0.41.1 Jun 14, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Adapt interface to cater for new `@polkadot/keyring`, where pairs -
|
||||
- expose `address` getter instead of `address()`
|
||||
- expose `publicKey` getter instead of `publicKey()`
|
||||
@@ -124,87 +222,138 @@
|
||||
- Remove previously deprecated kering functions, `createAccount`, `createAccountExternal` & `createAccountMnemonic`
|
||||
- Remove (previously deprecated), `@polkadot/ui-util`, all these functions have been incorporated in `@polkadot/util`
|
||||
|
||||
|
||||
## 0.40.1 Jun 04, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Address encoding changes, use encoded address instead of supplied
|
||||
|
||||
|
||||
## 0.39.1 May 22, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Allow for externally injected accounts
|
||||
- @polkadot/util 0.91.1 & @polkadot/api 0.79.1
|
||||
|
||||
|
||||
## 0.38.1 May 08, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Sorting of keyring addresses
|
||||
- Fix JSON import defaults (previously detection was not working for old accounts)
|
||||
- Display icons using publicKey (not the encoded address)
|
||||
- Ensure only a single instance of ui-keyring is loaded
|
||||
- Adjust short address option display (keyring options)
|
||||
|
||||
|
||||
## 0.37.1 Apr 03, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Add Emberic Elm (Dried Danta discontinued)
|
||||
- @polkadot/util & @polkadot/api 0.75.1
|
||||
|
||||
|
||||
## 0.36.1 Mar 29, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Small fixes, latest @polkadot/wasm-* packages
|
||||
|
||||
|
||||
## 0.35.1 Mar 29, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- @polkadot/util & @polkadot/api 0.75.1
|
||||
|
||||
|
||||
## 0.34.1 Mar 28, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix for blake2 in Polkadot identicon generation
|
||||
|
||||
|
||||
## 0.33.1 Mar 23, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Rename createUri and createExternal to addExternal and addUri
|
||||
- Rename addAccountPair to addPair
|
||||
- Add additional createFromUri function to create pair, but not add it
|
||||
- Latest api, util & util-crypto (this with WASM and JS fallbacks)
|
||||
|
||||
|
||||
## 0.32.1 Mar 20, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Add createUri to create an account from a path uri
|
||||
- Add createExternal as an alias for createAccountExternal
|
||||
- Deprecate createAccount, createAccountExternal and createAccountMnemonic
|
||||
- Fix styled-component dependencies when used in a non-@polkadot project
|
||||
|
||||
|
||||
## 0.31.1 Mar 18, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Allow for latest keyring with sr25519 derived support
|
||||
- When using dev mode, it assumes the substrate node has sr25519 derived keys
|
||||
|
||||
|
||||
## 0.30.1 Mar 14, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
- Swap to publishing -beta.x on merge (non-breaking testing)
|
||||
|
||||
|
||||
## 0.29.1 Mar 13, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
Swap to using a dev HDKD keyring (only available on latest substrate master, only affects nodes running with --dev, normal operation unaffected)
|
||||
|
||||
|
||||
## 0.28.1 Feb 21, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
Default Substrate icon is Jdenticon
|
||||
|
||||
|
||||
## 0.27.1 Feb 20, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
Replace Charred Cherry with Dried Danta, remove old decimals and token name configs
|
||||
|
||||
|
||||
## 0.26.1 Feb 14, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
Add keyring support for sd25519 (schnorrkel)
|
||||
|
||||
|
||||
## 0.25.1 Jan 09, 2019
|
||||
|
||||
Changes:
|
||||
|
||||
Add `@polkadot/{keyring,util,util-crypto,types}` as peerDependencies for the various packages as used. Thie should allow less churn on this repo with version bumps, although it does add some extra effort onto the users of these libraries. (But the assumption is that they use these anyway)
|
||||
|
||||
|
||||
## 0.24.1 Dec 19, 2018
|
||||
|
||||
## 0.23.1 Dec 14, 2018
|
||||
|
||||
## 0.22.1 Dec 05, 2018
|
||||
|
||||
Changes:
|
||||
|
||||
- Split from apps
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const base = require('@polkadot/dev/config/babel');
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2017-2020 @polkadot/ui authors & contributors
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
function copy_folder () {
|
||||
SRC="packages/$1/build"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2017-2020 @polkadot/ui authors & contributors
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
function copy_folder () {
|
||||
SRC="packages/$1/build"
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const config = require('@polkadot/dev/config/jest');
|
||||
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const path = require('path');
|
||||
|
||||
|
||||
+1
-1
@@ -10,5 +10,5 @@
|
||||
"packages": [
|
||||
"packages/*"
|
||||
],
|
||||
"version": "0.56.1"
|
||||
"version": "0.59.1"
|
||||
}
|
||||
|
||||
+13
-9
@@ -8,7 +8,8 @@
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"babel-core": "^7.0.0-bridge.0"
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
"typescript": "^4.0.3"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "polkadot-dev-build-ts",
|
||||
@@ -29,19 +30,22 @@
|
||||
"test:one": "polkadot-dev-run-test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.10.5",
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"@polkadot/dev": "^0.55.27",
|
||||
"@polkadot/ts": "^0.3.29",
|
||||
"@types/jest": "^26.0.5",
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@polkadot/dev": "^0.55.54",
|
||||
"@polkadot/ts": "^0.3.47",
|
||||
"@types/jest": "^26.0.14",
|
||||
"babel-plugin-transform-vue-template": "^0.4.2",
|
||||
"empty": "^0.10.1",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-is": "^16.13.1",
|
||||
"react-native": "^0.63.1",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"react-native": "^0.63.2",
|
||||
"typedoc": "^0.19.2",
|
||||
"typedoc-plugin-markdown": "^3.0.2",
|
||||
"typedoc-plugin-no-inherit": "^1.2.0",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"webpack-serve": "^3.2.0"
|
||||
},
|
||||
"version": "0.56.1"
|
||||
"version": "0.59.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/example-react",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"description": "A very basic example with ui-* & react-* packages",
|
||||
"main": "index.js",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -9,6 +9,6 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5"
|
||||
"@babel/runtime": "^7.11.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-react authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-react authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const path = require('path');
|
||||
const { WebpackPluginServe } = require('webpack-plugin-serve');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/example-vue",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"description": "A very basic example with ui-* & vue-* packages",
|
||||
"main": "index.js",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -9,6 +9,6 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5"
|
||||
"@babel/runtime": "^7.11.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-vue authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Prefix } from '@polkadot/util-crypto/address/types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-vue authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const path = require('path');
|
||||
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-react authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Button, SafeAreaView, ScrollView, StatusBar, StyleSheet, Text, View } from 'react-native';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-reactnative authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
module.exports = {
|
||||
presets: ['module:metro-react-native-babel-preset']
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-react authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './nodeGlobalsShim.js';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-reactnative authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const path = require('path');
|
||||
const getWorkspaces = require('get-yarn-workspaces');
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/example-reactnative authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable no-global-assign */
|
||||
|
||||
|
||||
@@ -1,18 +1,7 @@
|
||||
{
|
||||
"name": "exampleReactNative",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"private": true,
|
||||
"workspaces": {
|
||||
"nohoist": [
|
||||
"react-native",
|
||||
"react-native/**",
|
||||
"react-native-randombytes",
|
||||
"react-native-randombytes/**",
|
||||
"@react-native-community/**",
|
||||
"react-native-svg",
|
||||
"react-native-svg/**"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"copy-workspace-packages": "yarn copy-identicon && yarn copy-ui-shared",
|
||||
"copy-identicon": "mkdir -p node_modules/@polkadot/reactnative-identicon && cp -r ../reactnative-identicon/build/* ./node_modules/@polkadot/reactnative-identicon",
|
||||
@@ -23,30 +12,30 @@
|
||||
"test": "jest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@polkadot/reactnative-identicon": "0.56.1",
|
||||
"@polkadot/ui-keyring": "0.56.1",
|
||||
"@polkadot/ui-settings": "0.56.1",
|
||||
"@react-native-community/async-storage": "^1.11.0",
|
||||
"@polkadot/reactnative-identicon": "0.59.1",
|
||||
"@polkadot/ui-keyring": "0.59.1",
|
||||
"@polkadot/ui-settings": "0.59.1",
|
||||
"@react-native-community/async-storage": "^1.12.0",
|
||||
"fast-text-encoding": "^1.0.3",
|
||||
"get-yarn-workspaces": "^1.0.2",
|
||||
"os-browserify": "^0.3.0",
|
||||
"process": "^0.11.10",
|
||||
"react": "16.13.1",
|
||||
"react-native": "^0.63.1",
|
||||
"react-native": "^0.63.2",
|
||||
"react-native-crypto": "^2.2.0",
|
||||
"react-native-randombytes": "^3.5.3",
|
||||
"stream-http": "^3.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.10.5",
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"@polkadot/keyring": "^2.18.1",
|
||||
"@polkadot/util": "^2.18.1",
|
||||
"@polkadot/util-crypto": "^2.18.1",
|
||||
"@react-native-community/cli-platform-ios": "^4.10.1",
|
||||
"@types/react-test-renderer": "16.9.2",
|
||||
"babel-jest": "^26.1.0",
|
||||
"metro-react-native-babel-preset": "^0.60.0",
|
||||
"@babel/core": "^7.11.6",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@polkadot/keyring": "^3.5.1",
|
||||
"@polkadot/util": "^3.5.1",
|
||||
"@polkadot/util-crypto": "^3.5.1",
|
||||
"@react-native-community/cli-platform-ios": "^4.13.0",
|
||||
"@types/react-test-renderer": "16.9.3",
|
||||
"babel-jest": "^26.3.0",
|
||||
"metro-react-native-babel-preset": "^0.63.0",
|
||||
"react-test-renderer": "16.13.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/react-identicon",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"description": "Renders an SVG picture representing an address",
|
||||
"main": "index.js",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -9,9 +9,9 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"@polkadot/ui-settings": "0.56.1",
|
||||
"@polkadot/ui-shared": "0.56.1",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@polkadot/ui-settings": "0.59.1",
|
||||
"@polkadot/ui-shared": "0.59.1",
|
||||
"color": "^3.1.2",
|
||||
"jdenticon": "2.2.0",
|
||||
"react-copy-to-clipboard": "^5.0.2"
|
||||
@@ -26,13 +26,13 @@
|
||||
"styled-components": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^2.18.1",
|
||||
"@polkadot/util": "^2.18.1",
|
||||
"@polkadot/util-crypto": "^2.18.1",
|
||||
"@polkadot/keyring": "^3.5.1",
|
||||
"@polkadot/util": "^3.5.1",
|
||||
"@polkadot/util-crypto": "^3.5.1",
|
||||
"@types/react-copy-to-clipboard": "^4.3.0",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@types/styled-components": "^5.1.1",
|
||||
"styled-components": "^5.1.1",
|
||||
"@types/styled-components": "^5.1.3",
|
||||
"styled-components": "^5.2.0",
|
||||
"xmlserializer": "^0.6.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Prefix } from '@polkadot/util-crypto/address/types';
|
||||
import { IdentityProps as Props, Props as ComponentProps } from './types';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Props } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Props } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Props } from '../types';
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Copyright 2018 Paritytech via paritytech/oo7/polkadot-identicon
|
||||
// Copyright 2018-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright 2018 Paritytech via paritytech/oo7/polkadot-identicon
|
||||
|
||||
// This has been converted from the original version that can be found at
|
||||
//
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as Beachball } from './Beachball';
|
||||
export { default as Empty } from './Empty';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import Identicon from './Identicon';
|
||||
export * from './icons';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2018-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Prefix } from '@polkadot/util-crypto/address/types';
|
||||
import React from 'react';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const path = require('path');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/react-qr",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"description": "Generates and reads QR codes",
|
||||
"main": "index.js",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -9,13 +9,13 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"qrcode-generator": "^1.4.4",
|
||||
"react-qr-reader": "^2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react-qr-reader": "^2.1.3",
|
||||
"@types/styled-components": "^5.1.1"
|
||||
"@types/styled-components": "^5.1.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*",
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { xxhashAsHex } from '@polkadot/util-crypto';
|
||||
|
||||
@@ -46,9 +45,13 @@ function getDataUrl (value: Uint8Array): string {
|
||||
|
||||
function Display ({ className, size, skipEncoding, style, value }: Props): React.ReactElement<Props> | null {
|
||||
const [{ image }, setFrameState] = useState<FrameState>({ frameIdx: 0, frames: [], image: null, valueHash: null });
|
||||
const [containerStyle, setContainerStyle] = useState(createImgSize(size));
|
||||
const timerRef = useRef<TimerState>({ timerDelay: FRAME_DELAY, timerId: null });
|
||||
|
||||
const containerStyle = useMemo(
|
||||
() => createImgSize(size),
|
||||
[size]
|
||||
);
|
||||
|
||||
// run on initial load to setup the global timer and provide and unsubscribe
|
||||
useEffect((): () => void => {
|
||||
const nextFrame = () => setFrameState((state): FrameState => {
|
||||
@@ -86,10 +89,6 @@ function Display ({ className, size, skipEncoding, style, value }: Props): React
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect((): void => {
|
||||
setContainerStyle(createImgSize(size));
|
||||
}, [size]);
|
||||
|
||||
useEffect((): void => {
|
||||
setFrameState((state): FrameState => {
|
||||
const valueHash = xxhashAsHex(value);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import { createAddressPayload } from './util';
|
||||
import QrDisplay from './Display';
|
||||
@@ -16,11 +15,10 @@ interface Props {
|
||||
}
|
||||
|
||||
function DisplayExtrinsic ({ address, className, genesisHash, size, style }: Props): React.ReactElement<Props> | null {
|
||||
const [data, setData] = useState<Uint8Array | null>(null);
|
||||
|
||||
useEffect((): void => {
|
||||
setData(createAddressPayload(address, genesisHash));
|
||||
}, [address, genesisHash]);
|
||||
const data = useMemo(
|
||||
() => createAddressPayload(address, genesisHash),
|
||||
[address, genesisHash]
|
||||
);
|
||||
|
||||
if (!data) {
|
||||
return null;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import { createSignPayload } from './util';
|
||||
import QrDisplay from './Display';
|
||||
@@ -18,11 +17,10 @@ interface Props {
|
||||
}
|
||||
|
||||
function DisplayPayload ({ address, className, cmd, genesisHash, payload, size, style }: Props): React.ReactElement<Props> | null {
|
||||
const [data, setData] = useState<Uint8Array | null>(null);
|
||||
|
||||
useEffect((): void => {
|
||||
setData(createSignPayload(address, cmd, payload, genesisHash));
|
||||
}, [address, cmd, payload, genesisHash]);
|
||||
const data = useMemo(
|
||||
() => createSignPayload(address, cmd, payload, genesisHash),
|
||||
[address, cmd, payload, genesisHash]
|
||||
);
|
||||
|
||||
if (!data) {
|
||||
return null;
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { NetworkSpecsStruct } from '@polkadot/ui-settings';
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import QrDisplay from './Display';
|
||||
|
||||
import { encodeString } from './util';
|
||||
@@ -17,11 +16,10 @@ interface Props {
|
||||
}
|
||||
|
||||
function DisplayNetworkSpecs ({ className, networkSpecs, size, style }: Props): React.ReactElement<Props> | null {
|
||||
const [data, setData] = useState<Uint8Array | null>(null);
|
||||
|
||||
useEffect((): void => {
|
||||
setData(encodeString(JSON.stringify(networkSpecs)));
|
||||
}, [networkSpecs]);
|
||||
const data = useMemo(
|
||||
() => encodeString(JSON.stringify(networkSpecs)),
|
||||
[networkSpecs]
|
||||
);
|
||||
|
||||
if (!data) {
|
||||
return null;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import Reader from 'react-qr-reader';
|
||||
import styled from 'styled-components';
|
||||
|
||||
@@ -24,11 +23,10 @@ const DEFAULT_ERROR = (error: Error): void => {
|
||||
};
|
||||
|
||||
function Scan ({ className, delay = DEFAULT_DELAY, onError = DEFAULT_ERROR, onScan, size, style }: Props): React.ReactElement<Props> {
|
||||
const [containerStyle, setContainerStyle] = useState(createImgSize(size));
|
||||
|
||||
useEffect((): void => {
|
||||
setContainerStyle(createImgSize(size));
|
||||
}, [size]);
|
||||
const containerStyle = useMemo(
|
||||
() => createImgSize(size),
|
||||
[size]
|
||||
);
|
||||
|
||||
const _onError = useCallback(
|
||||
(error: Error) => onError(error),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
import { assert } from '@polkadot/util';
|
||||
@@ -29,7 +28,7 @@ function ScanAddress ({ className, onError, onScan, size, style }: Props): React
|
||||
(data: string | null): void => {
|
||||
if (data) {
|
||||
try {
|
||||
const [prefix, content, genesisHash, name] = data.split(':');
|
||||
const [prefix, content, genesisHash, ...name] = data.split(':');
|
||||
const isValidPrefix = prefix === ADDRESS_PREFIX || prefix === SEED_PREFIX;
|
||||
|
||||
assert(isValidPrefix, `Invalid prefix received, expected '${ADDRESS_PREFIX}/${SEED_PREFIX}' , found '${prefix}'`);
|
||||
@@ -40,7 +39,7 @@ function ScanAddress ({ className, onError, onScan, size, style }: Props): React
|
||||
decodeAddress(content);
|
||||
}
|
||||
|
||||
onScan({ content, genesisHash, isAddress, name });
|
||||
onScan({ content, genesisHash, isAddress, name: name?.length ? name.join(':') : undefined });
|
||||
} catch (error) {
|
||||
console.error('@polkadot/react-qr:QrScanAddress', (error as Error).message, data);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const ADDRESS_PREFIX = 'substrate';
|
||||
const SEED_PREFIX = 'secret';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as QrDisplayAddress } from './DisplayAddress';
|
||||
export { default as QrDisplayPayload } from './DisplayPayload';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import _qrcode from 'qrcode-generator';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { u8aConcat, u8aToHex, u8aToString } from '@polkadot/util';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/react-qr authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { isString, u8aConcat, u8aToU8a } from '@polkadot/util';
|
||||
import { decodeAddress } from '@polkadot/util-crypto';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/reactnative-identicon",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"description": "Renders an SVG picture representing an address",
|
||||
"main": "index.js",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -9,8 +9,8 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"@polkadot/ui-shared": "0.56.1",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@polkadot/ui-shared": "0.59.1",
|
||||
"react-native-svg": "^12.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -19,7 +19,7 @@
|
||||
"react-native": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util-crypto": "^2.18.1",
|
||||
"@types/react-native": "^0.63.1"
|
||||
"@polkadot/util-crypto": "^3.5.1",
|
||||
"@types/react-native": "^0.63.22"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/reactnative-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Prefix } from '@polkadot/util-crypto/address/types';
|
||||
import { Props as ComponentProps } from './types';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/reactnative-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Props } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2018-2020 @polkadot/reactnative-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Circle as CircleType } from '@polkadot/ui-shared/icons/types';
|
||||
import { Props } from '../types';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/reactnative-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as Empty } from './Empty';
|
||||
export { default as Polkadot } from './Polkadot';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/reactnative-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import Identicon from './Identicon';
|
||||
export * from './icons';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2018-2020 @polkadot/reactnative-identicon authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export interface Props {
|
||||
address: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/ui-assets",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"description": "Static assets shared accross projects",
|
||||
"main": "index.js",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -9,6 +9,6 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5"
|
||||
"@babel/runtime": "^7.11.2"
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-assets authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
declare module '*.svg' {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/ui-keyring",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"main": "index.js",
|
||||
"repository": "https://github.com/polkadot-js/apps.git",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -17,24 +17,24 @@
|
||||
"./ledger/transportsWeb": "./ledger/transportsEmpty"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"@ledgerhq/hw-transport-webusb": "^5.19.1",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@ledgerhq/hw-transport-webusb": "^5.25.0",
|
||||
"@zondax/ledger-polkadot": "^0.11.0",
|
||||
"mkdirp": "^1.0.4",
|
||||
"rxjs": "^6.6.0",
|
||||
"rxjs": "^6.6.3",
|
||||
"store": "^2.0.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^2.18.1",
|
||||
"@polkadot/types": "^1.25.1",
|
||||
"@polkadot/util": "^2.18.1",
|
||||
"@polkadot/keyring": "^3.5.1",
|
||||
"@polkadot/types": "^2.0.1",
|
||||
"@polkadot/util": "^3.5.1",
|
||||
"@types/ledgerhq__hw-transport-node-hid": "^4.22.1",
|
||||
"@types/ledgerhq__hw-transport-webusb": "^4.70.0",
|
||||
"@types/mkdirp": "^1.0.1",
|
||||
"@types/store": "^2.0.2"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@ledgerhq/hw-transport-node-hid": "^5.19.1"
|
||||
"@ledgerhq/hw-transport-node-hid": "^5.25.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/keyring": "*",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { KeyringInstance, KeyringPair } from '@polkadot/keyring/types';
|
||||
import { Prefix } from '@polkadot/util-crypto/address/types';
|
||||
@@ -15,7 +14,6 @@ import addresses from './observable/addresses';
|
||||
import contracts from './observable/contracts';
|
||||
import env from './observable/development';
|
||||
import BrowserStore from './stores/Browser'; // direct import (skip index with all)
|
||||
import { MAX_PASS_LEN } from './defaults';
|
||||
|
||||
export default class Base {
|
||||
#accounts: AddressSubject;
|
||||
@@ -91,7 +89,7 @@ export default class Base {
|
||||
}
|
||||
|
||||
public isPassValid (password: string): boolean {
|
||||
return password.length > 0 && password.length <= MAX_PASS_LEN;
|
||||
return password.length > 0;
|
||||
}
|
||||
|
||||
public setSS58Format (ss58Format?: Prefix): void {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { KeyringPair, KeyringPair$Meta, KeyringPair$Json } from '@polkadot/keyring/types';
|
||||
import { KeypairType } from '@polkadot/util-crypto/types';
|
||||
@@ -11,7 +10,7 @@ import BN from 'bn.js';
|
||||
import createPair from '@polkadot/keyring/pair';
|
||||
import chains from '@polkadot/ui-settings/defaults/chains';
|
||||
import { bnToBn, hexToU8a, isHex, isString, u8aSorted } from '@polkadot/util';
|
||||
import { createKeyMulti } from '@polkadot/util-crypto';
|
||||
import { base64Decode, createKeyMulti } from '@polkadot/util-crypto';
|
||||
|
||||
import env from './observable/development';
|
||||
import Base from './Base';
|
||||
@@ -80,6 +79,10 @@ export class Keyring extends Base implements KeyringStruct {
|
||||
return pair.toJson(password);
|
||||
}
|
||||
|
||||
public createFromJson (json: KeyringPair$Json, meta: KeyringPair$Meta = {}): KeyringPair {
|
||||
return this.keyring.createFromJson({ ...json, meta: { ...(json.meta || {}), meta } });
|
||||
}
|
||||
|
||||
public createFromUri (suri: string, meta: KeyringPair$Meta = {}, type?: KeypairType): KeyringPair {
|
||||
return this.keyring.createFromUri(suri, meta, type);
|
||||
}
|
||||
@@ -273,12 +276,14 @@ export class Keyring extends Base implements KeyringStruct {
|
||||
}
|
||||
|
||||
public restoreAccount (json: KeyringPair$Json, password: string): KeyringPair {
|
||||
const type = Array.isArray(json.encoding.content) ? json.encoding.content[1] : 'ed25519';
|
||||
const cryptoType = Array.isArray(json.encoding.content) ? json.encoding.content[1] : 'ed25519';
|
||||
const encType = Array.isArray(json.encoding.type) ? json.encoding.type : [json.encoding.type];
|
||||
const pair = createPair(
|
||||
{ toSS58: this.encodeAddress, type },
|
||||
{ toSS58: this.encodeAddress, type: cryptoType },
|
||||
{ publicKey: this.decodeAddress(json.address, true) },
|
||||
json.meta,
|
||||
hexToU8a(json.encoded)
|
||||
isHex(json.encoded) ? hexToU8a(json.encoded) : base64Decode(json.encoded),
|
||||
encType
|
||||
);
|
||||
|
||||
// unlock, save account and then lock (locking cleans secretKey, so needs to be last)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { u8aToHex } from '@polkadot/util';
|
||||
import { decodeAddress } from '@polkadot/keyring';
|
||||
@@ -8,7 +7,6 @@ import { decodeAddress } from '@polkadot/keyring';
|
||||
const ACCOUNT_PREFIX = 'account:';
|
||||
const ADDRESS_PREFIX = 'address:';
|
||||
const CONTRACT_PREFIX = 'contract:';
|
||||
const MAX_PASS_LEN = 32;
|
||||
|
||||
function toHex (address: string): string {
|
||||
return u8aToHex(
|
||||
@@ -38,6 +36,5 @@ export {
|
||||
addressKey,
|
||||
addressRegex,
|
||||
contractKey,
|
||||
contractRegex,
|
||||
MAX_PASS_LEN
|
||||
contractRegex
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import Transport from '@ledgerhq/hw-transport';
|
||||
import { LedgerAddress, LedgerSignature, LedgerTypes, LedgerVersion } from './types';
|
||||
import { AccountOptions, LedgerAddress, LedgerSignature, LedgerTypes, LedgerVersion } from './types';
|
||||
|
||||
import { ResponseBase, SubstrateApp, newKusamaApp, newPolkadotApp } from '@zondax/ledger-polkadot';
|
||||
import { assert, bufferToU8a, u8aToBuffer, u8aToHex } from '@polkadot/util';
|
||||
@@ -81,9 +80,9 @@ export default class Ledger {
|
||||
return result;
|
||||
}
|
||||
|
||||
public async getAddress (confirm = false, account = LEDGER_DEFAULT_ACCOUNT, change = LEDGER_DEFAULT_CHANGE, addressIndex = LEDGER_DEFAULT_INDEX): Promise<LedgerAddress> {
|
||||
public async getAddress (confirm = false, accountOffset = 0, addressOffset = 0, { account = LEDGER_DEFAULT_ACCOUNT, addressIndex = LEDGER_DEFAULT_INDEX, change = LEDGER_DEFAULT_CHANGE }: Partial<AccountOptions> = {}): Promise<LedgerAddress> {
|
||||
return this._withApp(async (app: SubstrateApp): Promise<LedgerAddress> => {
|
||||
const { address, pubKey } = await this._wrapError(app.getAddress(account, change, addressIndex, confirm));
|
||||
const { address, pubKey } = await this._wrapError(app.getAddress(account + accountOffset, change, addressIndex + addressOffset, confirm));
|
||||
|
||||
return {
|
||||
address,
|
||||
@@ -104,10 +103,10 @@ export default class Ledger {
|
||||
});
|
||||
}
|
||||
|
||||
public async sign (message: Uint8Array, account = LEDGER_DEFAULT_ACCOUNT, change = LEDGER_DEFAULT_CHANGE, addressIndex = LEDGER_DEFAULT_INDEX): Promise<LedgerSignature> {
|
||||
public async sign (message: Uint8Array, accountOffset = 0, addressOffset = 0, { account = LEDGER_DEFAULT_ACCOUNT, addressIndex = LEDGER_DEFAULT_INDEX, change = LEDGER_DEFAULT_CHANGE }: Partial<AccountOptions> = {}): Promise<LedgerSignature> {
|
||||
return this._withApp(async (app: SubstrateApp): Promise<LedgerSignature> => {
|
||||
const buffer = u8aToBuffer(message);
|
||||
const { signature } = await this._wrapError(app.sign(account, change, addressIndex, buffer));
|
||||
const { signature } = await this._wrapError(app.sign(account + accountOffset, change, addressIndex + addressOffset, buffer));
|
||||
|
||||
return {
|
||||
signature: u8aToHex(bufferToU8a(signature))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TransportDef } from './types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TransportDef } from './types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TransportDef } from './types';
|
||||
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import Transport from '@ledgerhq/hw-transport';
|
||||
|
||||
export type LedgerTypes = 'hid' | 'u2f' | 'webusb';
|
||||
|
||||
export interface AccountOptions {
|
||||
account: number;
|
||||
addressIndex: number;
|
||||
change: number;
|
||||
}
|
||||
|
||||
export interface LedgerAddress {
|
||||
address: string;
|
||||
publicKey: string;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { accountKey } from '../defaults';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { addressKey } from '../defaults';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { contractKey } from '../defaults';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { SubjectInfo, AddressSubject, SingleAddress } from './types';
|
||||
import { KeyringJson, KeyringStore } from '../types';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { SubjectInfo } from './types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { KeyringSectionOption } from '../options/types';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { KeyringStruct } from '../types';
|
||||
import keyringOptionInstance from '.';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { KeyringStruct } from '../types';
|
||||
import { SingleAddress } from '../observable/types';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { KeyringSectionOption } from './types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { KeyringItemType, KeyringStruct } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { KeyringStore, KeyringJson } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { KeyringStore, KeyringJson } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as BrowserStore } from './Browser';
|
||||
export { default as FileStore } from './File';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-keyring authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Hash } from '@polkadot/types/interfaces';
|
||||
import { KeyringInstance as BaseKeyringInstance, KeyringPair, KeyringPair$Meta, KeyringPair$Json, KeyringOptions as KeyringOptionsBase } from '@polkadot/keyring/types';
|
||||
@@ -12,20 +11,6 @@ export interface ContractMeta {
|
||||
genesisHash?: string | null;
|
||||
}
|
||||
|
||||
export interface KeyringStore {
|
||||
all: (cb: (key: string, value: KeyringJson) => void) => void;
|
||||
get: (key: string, cb: (value: KeyringJson) => void) => void;
|
||||
remove: (key: string, cb?: () => void) => void;
|
||||
set: (key: string, value: KeyringJson, cb?: () => void) => void;
|
||||
}
|
||||
|
||||
export interface KeyringOptions extends KeyringOptionsBase {
|
||||
filter?: (json: KeyringJson) => boolean;
|
||||
genesisHash?: Hash;
|
||||
isDevelopment?: boolean;
|
||||
store?: KeyringStore;
|
||||
}
|
||||
|
||||
export interface KeyringJson$Meta {
|
||||
contract?: ContractMeta;
|
||||
genesisHash?: string | null;
|
||||
@@ -46,6 +31,20 @@ export interface KeyringJson {
|
||||
meta: KeyringJson$Meta;
|
||||
}
|
||||
|
||||
export interface KeyringStore {
|
||||
all: (cb: (key: string, value: KeyringJson) => void) => void;
|
||||
get: (key: string, cb: (value: KeyringJson) => void) => void;
|
||||
remove: (key: string, cb?: () => void) => void;
|
||||
set: (key: string, value: KeyringJson, cb?: () => void) => void;
|
||||
}
|
||||
|
||||
export interface KeyringOptions extends KeyringOptionsBase {
|
||||
filter?: (json: KeyringJson) => boolean;
|
||||
genesisHash?: Hash;
|
||||
isDevelopment?: boolean;
|
||||
store?: KeyringStore;
|
||||
}
|
||||
|
||||
export interface KeyringAddress {
|
||||
readonly address: string;
|
||||
readonly meta: KeyringJson$Meta;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/ui-settings",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"description": "Manages app settings",
|
||||
"main": "index.js",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -9,12 +9,12 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"eventemitter3": "^4.0.4",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"store": "^2.0.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^2.18.1",
|
||||
"@polkadot/util": "^3.5.1",
|
||||
"@types/store": "^2.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import EventEmitter from 'eventemitter3';
|
||||
import store from 'store';
|
||||
import { isUndefined } from '@polkadot/util';
|
||||
|
||||
import { CAMERA_DEFAULT, CAMERA, CRYPTOS, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN, LEDGER_CONN_DEFAULT, LOCKING_DEFAULT, LOCKING, PREFIX_DEFAULT, PREFIXES, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './defaults';
|
||||
import { CAMERA_DEFAULT, CAMERA, CRYPTOS, CRYPTOS_ETH, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN, LEDGER_CONN_DEFAULT, LOCKING_DEFAULT, LOCKING, PREFIX_DEFAULT, PREFIXES, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './defaults';
|
||||
import { Option, SettingsStruct } from './types';
|
||||
|
||||
type ChangeCallback = (settings: SettingsStruct) => void;
|
||||
@@ -101,6 +100,10 @@ export class Settings implements SettingsStruct {
|
||||
return CRYPTOS;
|
||||
}
|
||||
|
||||
public get availableCryptosEth (): Option[] {
|
||||
return CRYPTOS_ETH;
|
||||
}
|
||||
|
||||
public get availableIcons (): Option[] {
|
||||
return ICONS;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
type ChainDef = string[];
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Option } from '../types';
|
||||
|
||||
@@ -17,7 +16,15 @@ export const CRYPTOS: Option[] = [
|
||||
},
|
||||
{
|
||||
info: 'ecdsa',
|
||||
text: 'ECDSA (BTC/ETH compatible)',
|
||||
text: 'ECDSA (Non BTC/ETH compatible)',
|
||||
value: 'ecdsa'
|
||||
}
|
||||
];
|
||||
|
||||
export const CRYPTOS_ETH: Option[] = [
|
||||
{
|
||||
info: 'ethereum',
|
||||
text: 'ECDSA (ETH compatible)',
|
||||
value: 'ethereum'
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Option } from '../types';
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Option } from '../types';
|
||||
|
||||
import { CRYPTOS } from './crypto';
|
||||
import { CRYPTOS, CRYPTOS_ETH } from './crypto';
|
||||
import { ENDPOINTS, ENDPOINT_DEFAULT } from './endpoints';
|
||||
import { LEDGER_CONN, LEDGER_CONN_DEFAULT } from './ledger';
|
||||
import { PREFIXES, PREFIX_DEFAULT } from './ss58';
|
||||
@@ -46,6 +45,7 @@ export {
|
||||
CAMERA_DEFAULT,
|
||||
CAMERA,
|
||||
CRYPTOS,
|
||||
CRYPTOS_ETH,
|
||||
ENDPOINT_DEFAULT,
|
||||
ENDPOINTS,
|
||||
ICON_DEFAULT,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Option } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Option } from '../types';
|
||||
|
||||
@@ -38,5 +37,10 @@ export const PREFIXES: Option[] = [
|
||||
info: 'kulupu',
|
||||
text: 'Kulupu (live)',
|
||||
value: 16
|
||||
},
|
||||
{
|
||||
info: 'subsocial',
|
||||
text: 'Subsocial (live)',
|
||||
value: 28
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// matches https://polkadot.js.org & https://*.polkadot.io
|
||||
export const isPolkadot = typeof window !== 'undefined' && window.location.host.includes('polkadot');
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { Option } from '../types';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import settings, { Settings } from './Settings';
|
||||
export { ENDPOINT_DEFAULT, ICON_DEFAULT, ICON_DEFAULT_HOST, LANGUAGE_DEFAULT, LOCKING_DEFAULT, PREFIX_DEFAULT, UIMODE_DEFAULT, UITHEME_DEFAULT } from './defaults';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-settings authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export type Option = {
|
||||
disabled?: boolean;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/ui-shared",
|
||||
"version": "0.56.1",
|
||||
"version": "0.59.1",
|
||||
"description": "Shared logic that is usable accross all frameworks-specific areas",
|
||||
"main": "index.js",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -9,7 +9,7 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.10.5",
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"color": "^3.1.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -17,9 +17,9 @@
|
||||
"@polkadot/util-crypto": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^2.18.1",
|
||||
"@polkadot/util-crypto": "^2.18.1",
|
||||
"@polkadot/util": "^3.5.1",
|
||||
"@polkadot/util-crypto": "^3.5.1",
|
||||
"@types/color": "^3.0.1",
|
||||
"@types/xmlserializer": "^0.6.0"
|
||||
"@types/xmlserializer": "^0.6.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2020 @polkadot/ui-shared authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { ColorGen } from './types';
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user