Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13d7dcfef5 | ||
|
|
259bb1a0ca | ||
|
|
d0fb629217 | ||
|
|
ab55c37a33 | ||
|
|
93a0a194bc | ||
|
|
3df71c9943 |
@@ -1,5 +1,13 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 6.5.1 May 22, 2021
|
||||
|
||||
Changes:
|
||||
|
||||
- Allow hdLedger derivation with optional 25th word password
|
||||
- Sync with Substrate ss58 registry
|
||||
|
||||
|
||||
## 6.4.1 May 15, 2021
|
||||
|
||||
Contributed:
|
||||
|
||||
+3
-3
@@ -21,10 +21,10 @@
|
||||
"test:one": "polkadot-dev-run-test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.2",
|
||||
"@polkadot/dev": "^0.62.14",
|
||||
"@babel/core": "^7.14.3",
|
||||
"@polkadot/dev": "^0.62.16",
|
||||
"@polkadot/ts": "^0.3.66",
|
||||
"@types/jest": "^26.0.23"
|
||||
},
|
||||
"version": "6.4.1"
|
||||
"version": "6.5.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/hw-ledger-transports",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"repository": "github:polkadot-js/common",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/hw-ledger-transports', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/hw-ledger-transports', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/hw-ledger",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"repository": "github:polkadot-js/common",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -17,8 +17,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/hw-ledger-transports": "6.4.1",
|
||||
"@polkadot/util": "^6.4.1",
|
||||
"@zondax/ledger-polkadot": "^0.13.6"
|
||||
"@polkadot/hw-ledger-transports": "6.5.1",
|
||||
"@polkadot/util": "^6.5.1",
|
||||
"@zondax/ledger-polkadot": "^0.13.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/hw-ledger', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/hw-ledger', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/keyring",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "Keyring management",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -20,11 +20,11 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/keyring#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/util": "6.4.1",
|
||||
"@polkadot/util-crypto": "6.4.1"
|
||||
"@polkadot/util": "6.5.1",
|
||||
"@polkadot/util-crypto": "6.5.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "6.4.1",
|
||||
"@polkadot/util-crypto": "6.4.1"
|
||||
"@polkadot/util": "6.5.1",
|
||||
"@polkadot/util-crypto": "6.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/keyring', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/keyring', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/networks",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A list of all available Substrate networks and their applicable prefixes",
|
||||
"main": "index.js",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/runtime": "^7.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "6.4.1",
|
||||
"@polkadot/x-fetch": "6.4.1"
|
||||
"@polkadot/util": "6.5.1",
|
||||
"@polkadot/x-fetch": "6.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/networks', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/networks', version: '6.5.1' };
|
||||
|
||||
@@ -84,13 +84,13 @@ export const knownSubstrate: KnownSubstrate[] = [
|
||||
website: 'https://edgewa.re'
|
||||
},
|
||||
{
|
||||
decimals: [18],
|
||||
displayName: 'Acala Karura Canary',
|
||||
decimals: [12],
|
||||
displayName: 'Karura',
|
||||
network: 'karura',
|
||||
prefix: 8,
|
||||
standardAccount: '*25519',
|
||||
symbols: ['KAR'],
|
||||
website: 'https://acala.network/'
|
||||
website: 'https://karura.network/'
|
||||
},
|
||||
{
|
||||
decimals: [18],
|
||||
@@ -102,7 +102,7 @@ export const knownSubstrate: KnownSubstrate[] = [
|
||||
website: 'http://laminar.network/'
|
||||
},
|
||||
{
|
||||
decimals: [18],
|
||||
decimals: [12],
|
||||
displayName: 'Acala',
|
||||
network: 'acala',
|
||||
prefix: 10,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/util-crypto",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A collection of useful crypto utilities for @polkadot",
|
||||
"main": "index.js",
|
||||
@@ -20,10 +20,10 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/util-crypto#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/networks": "6.4.1",
|
||||
"@polkadot/util": "6.4.1",
|
||||
"@polkadot/networks": "6.5.1",
|
||||
"@polkadot/util": "6.5.1",
|
||||
"@polkadot/wasm-crypto": "^4.0.2",
|
||||
"@polkadot/x-randomvalues": "6.4.1",
|
||||
"@polkadot/x-randomvalues": "6.5.1",
|
||||
"base-x": "^3.0.8",
|
||||
"base64-js": "^1.5.1",
|
||||
"blakejs": "^1.1.0",
|
||||
@@ -44,6 +44,6 @@
|
||||
"@types/xxhashjs": "^0.2.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "6.4.1"
|
||||
"@polkadot/util": "6.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { hdLedger } from '..';
|
||||
|
||||
const MNE_0 = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
|
||||
const MNE_1 = 'open jelly jeans corn ketchup supreme brief element armed lens vault weather original scissors rug priority vicious lesson raven spot gossip powder person volcano';
|
||||
const MNE_P = `${MNE_1} testing`;
|
||||
|
||||
const TESTS = {
|
||||
Kusama: {
|
||||
@@ -36,6 +37,11 @@ const TESTS = {
|
||||
ed25519: '0xe8c68348586d53e4e8d1a864b0e4e17c75e4eb06e0c63c1432bef2ba29e69d41',
|
||||
index: [0, 0],
|
||||
mnemonic: MNE_0
|
||||
},
|
||||
{
|
||||
ed25519: '0x3890e8db837eba3f8f25215c753e1091062298ce671a51441e7ef89a7adc4f48',
|
||||
index: [0, 0],
|
||||
mnemonic: MNE_P
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -11,7 +11,18 @@ import { HARDENED, hdValidatePath } from '../validatePath';
|
||||
import { ledgerDerivePrivate } from './derivePrivate';
|
||||
import { ledgerMaster } from './master';
|
||||
|
||||
export function hdLedger (mnemonic: string, path: string): Keypair {
|
||||
export function hdLedger (_mnemonic: string, path: string): Keypair {
|
||||
const parts = _mnemonic
|
||||
.split(' ')
|
||||
.map((s) => s.trim())
|
||||
.filter((s) => s);
|
||||
|
||||
assert([12, 24, 25].includes(parts.length), 'Expected a mnemonic with 24 words (or 25 including a password)');
|
||||
|
||||
const [mnemonic, password] = parts.length === 25
|
||||
? [parts.slice(0, 24).join(' '), parts[24]]
|
||||
: [parts.join(' '), ''];
|
||||
|
||||
assert(mnemonicValidate(mnemonic), 'Invalid mnemonic passed to ledger derivation');
|
||||
assert(hdValidatePath(path), 'Invalid derivation path');
|
||||
|
||||
@@ -21,7 +32,7 @@ export function hdLedger (mnemonic: string, path: string): Keypair {
|
||||
.slice(1)
|
||||
.map((n) => parseInt(n.replace("'", ''), 10))
|
||||
.map((n) => (n < HARDENED) ? (n + HARDENED) : n)
|
||||
.reduce((x, n) => ledgerDerivePrivate(x, n), ledgerMaster(mnemonic))
|
||||
.reduce((x, n) => ledgerDerivePrivate(x, n), ledgerMaster(mnemonic, password))
|
||||
.slice(0, 32)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import { mnemonicToSeedSync } from '../../mnemonic/bip39';
|
||||
const ED25519_CRYPTO = 'ed25519 seed';
|
||||
|
||||
// gets an xprv from a mnemonic
|
||||
export function ledgerMaster (mnemonic: string): Uint8Array {
|
||||
const seed = mnemonicToSeedSync(mnemonic);
|
||||
export function ledgerMaster (mnemonic: string, password?: string): Uint8Array {
|
||||
const seed = mnemonicToSeedSync(mnemonic, password);
|
||||
const chainCode = hmacSha256(ED25519_CRYPTO, new Uint8Array([1, ...seed]));
|
||||
let priv;
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/util-crypto', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/util-crypto', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/util",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A collection of useful utilities for @polkadot",
|
||||
"main": "index.js",
|
||||
@@ -20,8 +20,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/util#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/x-textdecoder": "6.4.1",
|
||||
"@polkadot/x-textencoder": "6.4.1",
|
||||
"@polkadot/x-textdecoder": "6.5.1",
|
||||
"@polkadot/x-textencoder": "6.5.1",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^4.11.9",
|
||||
"camelcase": "^5.3.1",
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/util', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/util', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-fetch",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A cross-environment fetch replacement",
|
||||
"browser": "browser.js",
|
||||
@@ -19,7 +19,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/x-fetch#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/x-global": "6.4.1",
|
||||
"@polkadot/x-global": "6.5.1",
|
||||
"@types/node-fetch": "^2.5.10",
|
||||
"node-fetch": "^2.6.1"
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-fetch', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/x-fetch', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-global",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A cross-environment global replacement",
|
||||
"main": "index.js",
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-global', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/x-global', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-randomvalues",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A cross-environment window.crypto.getRandomValues replacement",
|
||||
"browser": "browser.js",
|
||||
@@ -19,7 +19,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/x-randomvalues#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/x-global": "6.4.1"
|
||||
"@polkadot/x-global": "6.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react-native": "^0.64.5"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-randomvalues', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/x-randomvalues', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-rxjs",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A pass-through interface for RxJs (allowing node + mjs usage)",
|
||||
"main": "index.js",
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-rxjs', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/x-rxjs', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-textdecoder",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A TextDecoder replacement",
|
||||
"browser": "browser.js",
|
||||
@@ -19,6 +19,6 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/x-textdecoder#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/x-global": "6.4.1"
|
||||
"@polkadot/x-global": "6.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-textdecoder', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/x-textdecoder', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-textencoder",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A TextDecoder replacement",
|
||||
"browser": "browser.js",
|
||||
@@ -19,6 +19,6 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/x-textencoder#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/x-global": "6.4.1"
|
||||
"@polkadot/x-global": "6.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-textencoder', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/x-textencoder', version: '6.5.1' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-ws",
|
||||
"version": "6.4.1",
|
||||
"version": "6.5.1",
|
||||
"type": "module",
|
||||
"description": "A cross-environment WebSocket replacement",
|
||||
"browser": "browser.js",
|
||||
@@ -19,7 +19,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/x-ws#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@polkadot/x-global": "6.4.1",
|
||||
"@polkadot/x-global": "6.5.1",
|
||||
"@types/websocket": "^1.0.2",
|
||||
"websocket": "^1.0.34"
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-ws', version: '6.4.1' };
|
||||
export const packageInfo = { name: '@polkadot/x-ws', version: '6.5.1' };
|
||||
|
||||
Reference in New Issue
Block a user