mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-04-25 07:07:58 +00:00
addMultisig for ui-keyring (#311)
* addMultisig for ui-keyring * Bumps * Spelling.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
# 0.53.0-beta.x
|
||||
|
||||
- Add `addMultisig` into keyring (with all options to re-create address)
|
||||
|
||||
# 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
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.9.0",
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"@polkadot/dev": "^0.52.9",
|
||||
"@polkadot/dev": "^0.52.11",
|
||||
"@polkadot/ts": "^0.3.18",
|
||||
"@types/jest": "^25.2.1",
|
||||
"babel-plugin-transform-vue-template": "^0.4.2",
|
||||
@@ -40,7 +40,7 @@
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-is": "^16.13.1",
|
||||
"react-native": "^0.62.1",
|
||||
"react-native": "^0.62.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack-serve": "^3.2.0"
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
"@polkadot/ui-keyring": "0.52.1",
|
||||
"@polkadot/ui-settings": "0.52.1",
|
||||
"@react-native-community/async-storage": "^1.9.0",
|
||||
"fast-text-encoding": "^1.0.1",
|
||||
"fast-text-encoding": "^1.0.2",
|
||||
"get-yarn-workspaces": "^1.0.2",
|
||||
"os-browserify": "^0.3.0",
|
||||
"process": "^0.11.10",
|
||||
"react": "16.13.1",
|
||||
"react-native": "^0.62.1",
|
||||
"react-native": "^0.62.2",
|
||||
"react-native-crypto": "^2.2.0",
|
||||
"react-native-randombytes": "^3.5.3",
|
||||
"stream-http": "^3.1.0"
|
||||
@@ -40,12 +40,12 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.9.0",
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"@polkadot/keyring": "^2.8.1",
|
||||
"@polkadot/util": "^2.8.1",
|
||||
"@polkadot/util-crypto": "^2.8.1",
|
||||
"@react-native-community/cli-platform-ios": "^4.5.0",
|
||||
"@polkadot/keyring": "^2.9.0-beta.0",
|
||||
"@polkadot/util": "^2.9.0-beta.0",
|
||||
"@polkadot/util-crypto": "^2.9.0-beta.0",
|
||||
"@react-native-community/cli-platform-ios": "^4.7.0",
|
||||
"@types/react-test-renderer": "16.9.2",
|
||||
"babel-jest": "^25.2.6",
|
||||
"babel-jest": "^25.4.0",
|
||||
"metro-react-native-babel-preset": "^0.59.0",
|
||||
"react-test-renderer": "16.13.1"
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"color": "^3.1.2",
|
||||
"jdenticon": "2.2.0",
|
||||
"react-copy-to-clipboard": "^5.0.2",
|
||||
"styled-components": "^5.0.1"
|
||||
"styled-components": "^5.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/keyring": "*",
|
||||
@@ -26,12 +26,12 @@
|
||||
"react-is": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^2.8.1",
|
||||
"@polkadot/util": "^2.8.1",
|
||||
"@polkadot/util-crypto": "^2.8.1",
|
||||
"@polkadot/keyring": "^2.9.0-beta.0",
|
||||
"@polkadot/util": "^2.9.0-beta.0",
|
||||
"@polkadot/util-crypto": "^2.9.0-beta.0",
|
||||
"@types/react-copy-to-clipboard": "^4.3.0",
|
||||
"@types/react-dom": "^16.9.6",
|
||||
"@types/styled-components": "^5.0.1",
|
||||
"@types/styled-components": "^5.1.0",
|
||||
"xmlserializer": "^0.6.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
"react-qr-reader": "^2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react-qr-reader": "^2.1.2",
|
||||
"@types/styled-components": "^5.0.1"
|
||||
"@types/react-qr-reader": "^2.1.3",
|
||||
"@types/styled-components": "^5.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "*",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"@polkadot/ui-shared": "0.52.1",
|
||||
"react-native-svg": "^12.0.3"
|
||||
"react-native-svg": "^12.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util-crypto": "*",
|
||||
@@ -19,7 +19,7 @@
|
||||
"react-native": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util-crypto": "^2.8.1",
|
||||
"@types/react-native": "^0.62.1"
|
||||
"@polkadot/util-crypto": "^2.9.0-beta.0",
|
||||
"@types/react-native": "^0.62.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,24 +18,24 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.9.2",
|
||||
"@ledgerhq/hw-transport-u2f": "^5.12.0",
|
||||
"@ledgerhq/hw-transport-webusb": "^5.12.0",
|
||||
"@ledgerhq/hw-transport-u2f": "^5.13.1",
|
||||
"@ledgerhq/hw-transport-webusb": "^5.13.1",
|
||||
"ledger-polkadot": "^0.7.0",
|
||||
"mkdirp": "^1.0.4",
|
||||
"rxjs": "^6.5.5",
|
||||
"store": "^2.0.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^2.8.1",
|
||||
"@polkadot/types": "^1.10.1",
|
||||
"@polkadot/util": "^2.8.1",
|
||||
"@polkadot/keyring": "^2.9.0-beta.0",
|
||||
"@polkadot/types": "^1.12.0-beta.5",
|
||||
"@polkadot/util": "^2.9.0-beta.0",
|
||||
"@types/ledgerhq__hw-transport-node-hid": "^4.22.1",
|
||||
"@types/ledgerhq__hw-transport-u2f": "^4.21.1",
|
||||
"@types/mkdirp": "^1.0.0",
|
||||
"@types/store": "^2.0.2"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@ledgerhq/hw-transport-node-hid": "^5.12.0"
|
||||
"@ledgerhq/hw-transport-node-hid": "^5.13.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/keyring": "*",
|
||||
|
||||
@@ -7,9 +7,11 @@ import { KeypairType } from '@polkadot/util-crypto/types';
|
||||
import { AddressSubject, SingleAddress } from './observable/types';
|
||||
import { CreateResult, KeyringAddress, KeyringAddressType, KeyringItemType, KeyringJson, KeyringJson$Meta, KeyringOptions, KeyringStruct } from './types';
|
||||
|
||||
import BN from 'bn.js';
|
||||
import createPair from '@polkadot/keyring/pair';
|
||||
import chains from '@polkadot/ui-settings/defaults/chains';
|
||||
import { hexToU8a, isHex, isString } from '@polkadot/util';
|
||||
import { bnToBn, hexToU8a, isHex, isString } from '@polkadot/util';
|
||||
import { createKeyMulti } from '@polkadot/util-crypto';
|
||||
|
||||
import env from './observable/development';
|
||||
import Base from './Base';
|
||||
@@ -41,6 +43,13 @@ export class Keyring extends Base implements KeyringStruct {
|
||||
return this.addExternal(address, { ...meta, hardwareType, isHardware: true });
|
||||
}
|
||||
|
||||
public addMultisig (addresses: (string | Uint8Array)[], threshold: BigInt | BN | number, meta: KeyringPair$Meta = {}): CreateResult {
|
||||
const address = createKeyMulti(addresses, threshold);
|
||||
const who = addresses.map((who) => this.encodeAddress(who));
|
||||
|
||||
return this.addExternal(address, { ...meta, isMultisig: true, threshold: bnToBn(threshold).toNumber(), who });
|
||||
}
|
||||
|
||||
public addPair (pair: KeyringPair, password: string): CreateResult {
|
||||
this.keyring.addPair(pair);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"store": "^2.0.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^2.8.1",
|
||||
"@polkadot/util": "^2.9.0-beta.0",
|
||||
"@types/store": "^2.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
"@polkadot/util-crypto": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "^2.8.1",
|
||||
"@polkadot/util-crypto": "^2.8.1",
|
||||
"@polkadot/util": "^2.9.0-beta.0",
|
||||
"@polkadot/util-crypto": "^2.9.0-beta.0",
|
||||
"@types/color": "^3.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"vue": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util-crypto": "^2.8.1",
|
||||
"@polkadot/util-crypto": "^2.9.0-beta.0",
|
||||
"vue": "^2.6.11"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user