Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56a3d19083 | ||
|
|
caf76a7511 | ||
|
|
834a1e6a52 | ||
|
|
7a5b1207b0 | ||
|
|
8221576d25 | ||
|
|
1f9d36d4db | ||
|
|
b292f2ae1d | ||
|
|
7eddfc25c9 |
+2
-1
@@ -16,4 +16,5 @@
|
||||
6.0.5
|
||||
|
||||
7.0.2
|
||||
7.0.3
|
||||
7.0.3
|
||||
7.1.2
|
||||
@@ -1,5 +1,24 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 7.1.2 Aug 11, 2021
|
||||
|
||||
Changes:
|
||||
|
||||
- Ensure `@polkadot/util-crypto` doesn't re-export `packageInfo` from `@polkadot/networks`
|
||||
- Minor TS style cleanups in `@polkadot/x-bundle`
|
||||
|
||||
|
||||
## 7.1.1 Aug 2, 2021
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add keyring encrypt/decrypt functionality (Thanks to https://github.com/RoyTimes)
|
||||
|
||||
Changes:
|
||||
|
||||
- Bump Ledger libraries to latest versions
|
||||
|
||||
|
||||
## 7.0.3 Jul 26, 2021
|
||||
|
||||
Changes:
|
||||
|
||||
+4
-3
@@ -23,10 +23,11 @@
|
||||
"test:one": "polkadot-dev-run-test --runInBand"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.8",
|
||||
"@polkadot/dev": "^0.62.57",
|
||||
"@babel/core": "^7.15.0",
|
||||
"@polkadot/dev": "^0.62.58",
|
||||
"@polkadot/ts": "^0.4.4",
|
||||
"@types/ed2curve": "^0.2.2",
|
||||
"@types/jest": "^26.0.24"
|
||||
},
|
||||
"version": "7.0.3"
|
||||
"version": "7.1.2"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/hw-ledger-transports",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"type": "module",
|
||||
"repository": "github:polkadot-js/common",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -16,11 +16,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@ledgerhq/hw-transport": "^6.2.0",
|
||||
"@ledgerhq/hw-transport-webhid": "^6.2.0",
|
||||
"@ledgerhq/hw-transport-webusb": "^6.2.0"
|
||||
"@ledgerhq/hw-transport": "^6.3.0",
|
||||
"@ledgerhq/hw-transport-webhid": "^6.3.0",
|
||||
"@ledgerhq/hw-transport-webusb": "^6.3.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@ledgerhq/hw-transport-node-hid-singleton": "^6.2.0"
|
||||
"@ledgerhq/hw-transport-node-hid-singleton": "^6.3.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/hw-ledger-transports', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/hw-ledger-transports', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/hw-ledger",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"type": "module",
|
||||
"repository": "github:polkadot-js/common",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
@@ -17,8 +17,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/hw-ledger-transports": "7.0.3",
|
||||
"@polkadot/util": "^7.0.3",
|
||||
"@polkadot/hw-ledger-transports": "7.1.2",
|
||||
"@polkadot/util": "7.1.2",
|
||||
"@zondax/ledger-substrate": "^0.17.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/hw-ledger', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/hw-ledger', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/keyring",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"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.8",
|
||||
"@polkadot/util": "7.0.3",
|
||||
"@polkadot/util-crypto": "7.0.3"
|
||||
"@polkadot/util": "7.1.2",
|
||||
"@polkadot/util-crypto": "7.1.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "7.0.3",
|
||||
"@polkadot/util-crypto": "7.0.3"
|
||||
"@polkadot/util": "7.1.2",
|
||||
"@polkadot/util-crypto": "7.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/keyring', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/keyring', version: '7.1.2' };
|
||||
|
||||
@@ -18,6 +18,10 @@ describe('pair', (): void => {
|
||||
});
|
||||
|
||||
const SIGNATURE = new Uint8Array([80, 191, 198, 147, 225, 207, 75, 88, 126, 39, 129, 109, 191, 38, 72, 181, 75, 254, 81, 143, 244, 79, 237, 38, 236, 141, 28, 252, 134, 26, 169, 234, 79, 33, 153, 158, 151, 34, 175, 188, 235, 20, 35, 135, 83, 120, 139, 211, 233, 130, 1, 208, 201, 215, 73, 80, 56, 98, 185, 196, 11, 8, 193, 14]);
|
||||
const ENCRYPTED = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 59, 53, 85, 227, 40, 107, 48, 234, 198, 238, 157, 238, 224, 235, 179, 75, 153, 241, 142, 254]);
|
||||
|
||||
// the last byte is changed from 254 -> 253
|
||||
const ENCRYPTED_CHANGED = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 59, 53, 85, 227, 40, 107, 48, 234, 198, 238, 157, 238, 224, 235, 179, 75, 153, 241, 142, 253]);
|
||||
|
||||
it('has a publicKey', (): void => {
|
||||
expect(
|
||||
@@ -53,7 +57,7 @@ describe('pair', (): void => {
|
||||
it('fails a correctly signed message (signer changed)', (): void => {
|
||||
expect(
|
||||
keyring.alice.verify(
|
||||
new Uint8Array([0x61, 0x62, 0x63, 0x64, 0x65]),
|
||||
new Uint8Array([0x61, 0x62, 0x63, 0x64]),
|
||||
SIGNATURE,
|
||||
keyring.bob.publicKey
|
||||
)
|
||||
@@ -94,6 +98,93 @@ describe('pair', (): void => {
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('allows encrypting', (): void => {
|
||||
const message = new Uint8Array([0x61, 0x62, 0x63, 0x64, 0x65]);
|
||||
|
||||
expect(
|
||||
keyring.alice.encryptMessage(
|
||||
message,
|
||||
keyring.bob.publicKey,
|
||||
new Uint8Array(24)
|
||||
)
|
||||
).toEqual(ENCRYPTED);
|
||||
});
|
||||
|
||||
it('validates a correctly encrypted message', (): void => {
|
||||
const message = new Uint8Array([0x61, 0x62, 0x63, 0x64, 0x65]);
|
||||
|
||||
expect(
|
||||
keyring.bob.decryptMessage(
|
||||
ENCRYPTED,
|
||||
keyring.alice.publicKey
|
||||
)
|
||||
).toEqual(message);
|
||||
});
|
||||
|
||||
it('fails a correctly encrypted message (message changed)', (): void => {
|
||||
expect(
|
||||
keyring.bob.decryptMessage(
|
||||
ENCRYPTED_CHANGED,
|
||||
keyring.alice.publicKey
|
||||
)
|
||||
).toEqual(null);
|
||||
});
|
||||
|
||||
it('fails a correctly encrypted message (sender changed)', (): void => {
|
||||
expect(
|
||||
keyring.bob.decryptMessage(
|
||||
ENCRYPTED,
|
||||
keyring.charlie.publicKey
|
||||
)
|
||||
).toEqual(null);
|
||||
});
|
||||
|
||||
it('fails a correctly encrypted message (receiver changed)', (): void => {
|
||||
expect(
|
||||
keyring.charlie.decryptMessage(
|
||||
ENCRYPTED,
|
||||
keyring.alice.publicKey
|
||||
)
|
||||
).toEqual(null);
|
||||
});
|
||||
|
||||
it('validates encryption between ed25519 & sr25519 key pairs', (): void => {
|
||||
const PASS = 'testing';
|
||||
const encodedA = keyring.alice.encodePkcs8(PASS);
|
||||
const encodedB = keyring.bob.encodePkcs8(PASS);
|
||||
|
||||
const pairA = createPair({ toSS58, type: 'sr25519' }, { publicKey: keyring.alice.publicKey });
|
||||
const pairB = createPair({ toSS58, type: 'sr25519' }, { publicKey: keyring.bob.publicKey });
|
||||
|
||||
pairA.decodePkcs8(PASS, encodedA);
|
||||
pairB.decodePkcs8(PASS, encodedB);
|
||||
const message = new Uint8Array([0x61, 0x62, 0x63, 0x64, 0x65]);
|
||||
|
||||
// alice-sr25519 -> bob-ed25519
|
||||
const encrypted1 = pairA.encryptMessage(message, keyring.bob.publicKey);
|
||||
|
||||
// alice-sr25519 -> bob-sr25519
|
||||
const encrypted2 = pairA.encryptMessage(message, pairB.publicKey);
|
||||
|
||||
// alice-ed25519 -> bob-sr25519
|
||||
const encrypted3 = keyring.alice.encryptMessage(message, pairB.publicKey);
|
||||
|
||||
// decrypt: Bob-ed25519 - use alice-ed25519 pubkey
|
||||
expect(
|
||||
keyring.bob.decryptMessage(encrypted3, keyring.alice.publicKey)
|
||||
).toEqual(message);
|
||||
|
||||
// decrypt: Bob-ed25519 - use alice-sr25519 pubkey
|
||||
expect(
|
||||
keyring.bob.decryptMessage(encrypted1, pairA.publicKey)
|
||||
).toEqual(message);
|
||||
|
||||
// decrypt: Bob-sr25519 - use alice-sr25519 pubkey
|
||||
expect(
|
||||
pairB.decryptMessage(encrypted2, pairA.publicKey)
|
||||
).toEqual(message);
|
||||
});
|
||||
|
||||
it('allows setting/getting of meta', (): void => {
|
||||
keyring.bob.setMeta({ foo: 'bar', something: 'else' });
|
||||
|
||||
@@ -183,5 +274,22 @@ describe('pair', (): void => {
|
||||
});
|
||||
expect(json.address).toEqual(u8aToHex(PUBLICDERIVED));
|
||||
});
|
||||
|
||||
it('denies access to encryptMessage/decryptMessage API', (): void => {
|
||||
const PASS = 'testing';
|
||||
const encoded = keyring.alice.encodePkcs8(PASS);
|
||||
|
||||
const pair = createPair({ toSS58, type: 'ethereum' }, { publicKey: keyring.alice.publicKey });
|
||||
|
||||
pair.decodePkcs8(PASS, encoded);
|
||||
|
||||
expect(
|
||||
() => pair.encryptMessage(
|
||||
new Uint8Array(4), // null message
|
||||
keyring.bob.publicKey,
|
||||
new Uint8Array(24)
|
||||
)
|
||||
).toThrow('Secp256k1 not supported yet');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { KeyringPair, KeyringPair$Json, KeyringPair$Meta, SignOptions } fro
|
||||
import type { PairInfo } from './types';
|
||||
|
||||
import { assert, u8aConcat, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
import { blake2AsU8a, ethereumEncode, keccakAsU8a, keyExtractPath, keyFromPath, naclKeypairFromSeed as naclFromSeed, naclSign, schnorrkelKeypairFromSeed as schnorrkelFromSeed, schnorrkelSign, schnorrkelVrfSign, schnorrkelVrfVerify, secp256k1Compress, secp256k1Expand, secp256k1KeypairFromSeed as secp256k1FromSeed, secp256k1Sign, signatureVerify } from '@polkadot/util-crypto';
|
||||
import { blake2AsU8a, convertPublicKeyToCurve25519, convertSecretKeyToCurve25519, ethereumEncode, keccakAsU8a, keyExtractPath, keyFromPath, naclKeypairFromSeed as naclFromSeed, naclOpen, naclSeal, naclSign, schnorrkelKeypairFromSeed as schnorrkelFromSeed, schnorrkelSign, schnorrkelVrfSign, schnorrkelVrfVerify, secp256k1Compress, secp256k1Expand, secp256k1KeypairFromSeed as secp256k1FromSeed, secp256k1Sign, signatureVerify } from '@polkadot/util-crypto';
|
||||
|
||||
import { decodePair } from './decode';
|
||||
import { encodePair } from './encode';
|
||||
@@ -145,6 +145,17 @@ export function createPair ({ toSS58, type }: Setup, { publicKey, secretKey }: P
|
||||
},
|
||||
// eslint-disable-next-line sort-keys
|
||||
decodePkcs8,
|
||||
decryptMessage: (encryptedMessageWithNonce: string | Uint8Array, senderPublicKey: string | Uint8Array): Uint8Array | null => {
|
||||
assert(!isLocked(secretKey), 'Cannot encrypt with a locked key pair');
|
||||
assert(!['ecdsa', 'ethereum'].includes(type), 'Secp256k1 not supported yet');
|
||||
|
||||
return naclOpen(
|
||||
u8aToU8a(encryptedMessageWithNonce.slice(24, encryptedMessageWithNonce.length)),
|
||||
u8aToU8a(encryptedMessageWithNonce.slice(0, 24)),
|
||||
convertPublicKeyToCurve25519(u8aToU8a(senderPublicKey)),
|
||||
convertSecretKeyToCurve25519(secretKey)
|
||||
);
|
||||
},
|
||||
derive: (suri: string, meta?: KeyringPair$Meta): KeyringPair => {
|
||||
assert(type !== 'ethereum', 'Unable to derive on this keypair');
|
||||
assert(!isLocked(secretKey), 'Cannot derive on a locked keypair');
|
||||
@@ -157,6 +168,14 @@ export function createPair ({ toSS58, type }: Setup, { publicKey, secretKey }: P
|
||||
encodePkcs8: (passphrase?: string): Uint8Array => {
|
||||
return recode(passphrase);
|
||||
},
|
||||
encryptMessage: (message: string | Uint8Array, recipientPublicKey: string | Uint8Array, _nonce?: Uint8Array): Uint8Array => {
|
||||
assert(!isLocked(secretKey), 'Cannot encrypt with a locked key pair');
|
||||
assert(!['ecdsa', 'ethereum'].includes(type), 'Secp256k1 not supported yet');
|
||||
|
||||
const { nonce, sealed } = naclSeal(u8aToU8a(message), convertSecretKeyToCurve25519(secretKey), convertPublicKeyToCurve25519(u8aToU8a(recipientPublicKey)), _nonce);
|
||||
|
||||
return u8aConcat(nonce, sealed);
|
||||
},
|
||||
lock: (): void => {
|
||||
secretKey = new Uint8Array();
|
||||
},
|
||||
|
||||
@@ -30,11 +30,17 @@ export function nobody (): KeyringPair {
|
||||
decodePkcs8: (passphrase?: string, encoded?: Uint8Array): void =>
|
||||
undefined,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
decryptMessage: (encryptedMessageWithNonce: string | Uint8Array, senderPublicKey: string | Uint8Array): Uint8Array | null =>
|
||||
null,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
derive: (suri: string, meta?: KeyringPair$Meta): KeyringPair =>
|
||||
pair,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
encodePkcs8: (passphrase?: string): Uint8Array =>
|
||||
new Uint8Array(0),
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
encryptMessage: (message: string | Uint8Array, recipientPublicKey: string | Uint8Array, _nonce?: Uint8Array): Uint8Array =>
|
||||
new Uint8Array(),
|
||||
isLocked: true,
|
||||
lock: (): void => {
|
||||
// no locking, it is always locked
|
||||
|
||||
@@ -37,6 +37,8 @@ export interface KeyringPair {
|
||||
sign (message: string | Uint8Array, options?: SignOptions): Uint8Array;
|
||||
toJson (passphrase?: string): KeyringPair$Json;
|
||||
unlock (passphrase?: string): void;
|
||||
encryptMessage (message: string | Uint8Array, recipientPublicKey: string | Uint8Array, nonce?: Uint8Array): Uint8Array;
|
||||
decryptMessage (encryptedMessageWithNonce: string | Uint8Array, senderPublicKey: string | Uint8Array): Uint8Array | null;
|
||||
verify (message: string | Uint8Array, signature: Uint8Array, signerPublic: string | Uint8Array): boolean;
|
||||
vrfSign (message: string | Uint8Array, context?: string | Uint8Array, extra?: string | Uint8Array): Uint8Array;
|
||||
vrfVerify (message: string | Uint8Array, vrfResult: Uint8Array, signerPublic: Uint8Array | string, context?: string | Uint8Array, extra?: string | Uint8Array): boolean;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/networks",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"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.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "7.0.3",
|
||||
"@polkadot/x-fetch": "7.0.3"
|
||||
"@polkadot/util": "7.1.2",
|
||||
"@polkadot/x-fetch": "7.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +1,5 @@
|
||||
// Copyright 2017-2021 @polkadot/networks authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Network, SubstrateNetwork } from './types';
|
||||
|
||||
import { knownGenesis, knownIcon, knownLedger, knownTestnet } from './defaults';
|
||||
import { knownSubstrate } from './substrate';
|
||||
|
||||
export * from './interfaces';
|
||||
export { packageInfo } from './packageInfo';
|
||||
|
||||
// These are known prefixes that are not sorted
|
||||
const UNSORTED = [0, 2, 42];
|
||||
|
||||
export const allNetworks = knownSubstrate.map((o): SubstrateNetwork => {
|
||||
const network = o.network || '';
|
||||
const n = o as SubstrateNetwork;
|
||||
|
||||
n.slip44 = knownLedger[network];
|
||||
n.hasLedgerSupport = !!n.slip44;
|
||||
|
||||
n.genesisHash = knownGenesis[network] || [];
|
||||
n.icon = knownIcon[network] || 'substrate';
|
||||
n.isIgnored = !network || !!knownTestnet[network] || network.startsWith('reserved');
|
||||
|
||||
return n;
|
||||
});
|
||||
|
||||
// The list of available/claimed prefixes
|
||||
// - no testnets
|
||||
// - we only include those where we have a standardAccount
|
||||
// - when no icon has been specified, default to substrate
|
||||
// - sort by name, however we keep 0, 2, 42 first in the list
|
||||
export const availableNetworks = allNetworks
|
||||
.filter((n): n is Network => !n.isIgnored && !!n.network)
|
||||
.sort((a, b) =>
|
||||
UNSORTED.includes(a.prefix) === UNSORTED.includes(b.prefix)
|
||||
? 0
|
||||
: UNSORTED.includes(a.prefix)
|
||||
? -1
|
||||
: UNSORTED.includes(b.prefix)
|
||||
? 1
|
||||
: a.displayName.localeCompare(b.displayName)
|
||||
);
|
||||
|
||||
// A filtered list of those chains we have details about (genesisHashes)
|
||||
export const selectableNetworks = availableNetworks.filter((n) => n.genesisHash.length || n.prefix === 42);
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// Copyright 2017-2021 @polkadot/networks authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Network, SubstrateNetwork } from './types';
|
||||
|
||||
import { knownGenesis, knownIcon, knownLedger, knownTestnet } from './defaults';
|
||||
import { knownSubstrate } from './substrate';
|
||||
|
||||
// These are known prefixes that are not sorted
|
||||
const UNSORTED = [0, 2, 42];
|
||||
|
||||
export const allNetworks = knownSubstrate.map((o): SubstrateNetwork => {
|
||||
const network = o.network || '';
|
||||
const n = o as SubstrateNetwork;
|
||||
|
||||
n.slip44 = knownLedger[network];
|
||||
n.hasLedgerSupport = !!n.slip44;
|
||||
|
||||
n.genesisHash = knownGenesis[network] || [];
|
||||
n.icon = knownIcon[network] || 'substrate';
|
||||
n.isIgnored = !network || !!knownTestnet[network] || network.startsWith('reserved');
|
||||
|
||||
return n;
|
||||
});
|
||||
|
||||
// The list of available/claimed prefixes
|
||||
// - no testnets
|
||||
// - we only include those where we have a standardAccount
|
||||
// - sort by name, however we keep 0, 2, 42 first in the list
|
||||
export const availableNetworks = allNetworks
|
||||
.filter((n): n is Network => !n.isIgnored && !!n.network)
|
||||
.sort((a, b) =>
|
||||
UNSORTED.includes(a.prefix) === UNSORTED.includes(b.prefix)
|
||||
? 0
|
||||
: UNSORTED.includes(a.prefix)
|
||||
? -1
|
||||
: UNSORTED.includes(b.prefix)
|
||||
? 1
|
||||
: a.displayName.localeCompare(b.displayName)
|
||||
);
|
||||
|
||||
// A filtered list of those chains we have details about (genesisHashes)
|
||||
export const selectableNetworks = availableNetworks.filter((n) => n.genesisHash.length || n.prefix === 42);
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/networks', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/networks', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/util-crypto",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"type": "module",
|
||||
"description": "A collection of useful crypto utilities for @polkadot",
|
||||
"main": "index.js",
|
||||
@@ -22,15 +22,16 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/util-crypto#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/networks": "7.0.3",
|
||||
"@polkadot/util": "7.0.3",
|
||||
"@polkadot/networks": "7.1.2",
|
||||
"@polkadot/util": "7.1.2",
|
||||
"@polkadot/wasm-crypto": "^4.1.2",
|
||||
"@polkadot/x-randomvalues": "7.0.3",
|
||||
"@polkadot/x-randomvalues": "7.1.2",
|
||||
"base-x": "^3.0.8",
|
||||
"base64-js": "^1.5.1",
|
||||
"blakejs": "^1.1.1",
|
||||
"bn.js": "^4.11.9",
|
||||
"create-hash": "^1.2.0",
|
||||
"ed2curve": "^0.3.0",
|
||||
"elliptic": "^6.5.4",
|
||||
"hash.js": "^1.1.7",
|
||||
"js-sha3": "^0.8.0",
|
||||
@@ -46,6 +47,6 @@
|
||||
"@types/xxhashjs": "^0.2.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "7.0.3"
|
||||
"@polkadot/util": "7.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import ed2curve from 'ed2curve';
|
||||
|
||||
export function convertSecretKeyToCurve25519 (secretKey: Uint8Array): Uint8Array {
|
||||
return ed2curve.convertSecretKey(secretKey);
|
||||
}
|
||||
|
||||
export function convertPublicKeyToCurve25519 (publicKey: Uint8Array): Uint8Array {
|
||||
return ed2curve.convertPublicKey(publicKey) as Uint8Array;
|
||||
}
|
||||
@@ -15,3 +15,4 @@ export { naclVerify } from './verify';
|
||||
export { naclBoxKeypairFromSecret } from './box/fromSecret';
|
||||
export { naclOpen } from './open';
|
||||
export { naclSeal } from './seal';
|
||||
export { convertSecretKeyToCurve25519, convertPublicKeyToCurve25519 } from './convertKey';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export * from '@polkadot/networks';
|
||||
export * from '@polkadot/networks/interfaces';
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/util-crypto', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/util-crypto', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/util",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"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.8",
|
||||
"@polkadot/x-textdecoder": "7.0.3",
|
||||
"@polkadot/x-textencoder": "7.0.3",
|
||||
"@polkadot/x-textdecoder": "7.1.2",
|
||||
"@polkadot/x-textencoder": "7.1.2",
|
||||
"@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: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/util', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-bundle",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"type": "module",
|
||||
"description": "A bundler helper",
|
||||
"main": "index.js",
|
||||
@@ -17,7 +17,7 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/x-bundle#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/util": "^7.0.3",
|
||||
"@polkadot/util": "7.1.2",
|
||||
"buffer-es6": "^4.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/x-bundle authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const crypto = {};
|
||||
|
||||
export default crypto;
|
||||
export default {};
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/x-bundle authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const empty = {};
|
||||
|
||||
export default empty;
|
||||
export default {};
|
||||
|
||||
@@ -5,22 +5,16 @@
|
||||
// The ISC License
|
||||
// Copyright (c) Isaac Z. Schlueter
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/explicit-module-boundary-types
|
||||
function inherits (ctor: any, superCtor: any): any {
|
||||
export default function inherits (ctor: Record<string, unknown>, superCtor: Record<string, unknown>): void {
|
||||
if (superCtor) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access
|
||||
ctor.super_ = superCtor;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access
|
||||
ctor.prototype = Object.create(superCtor.prototype, {
|
||||
ctor.prototype = Object.create(superCtor.prototype as null, {
|
||||
constructor: {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
value: ctor,
|
||||
writable: true
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default inherits;
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-bundle', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/x-bundle', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-fetch",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"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.8",
|
||||
"@polkadot/x-global": "7.0.3",
|
||||
"@polkadot/x-global": "7.1.2",
|
||||
"@types/node-fetch": "^2.5.12",
|
||||
"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: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/x-fetch', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-global",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"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: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/x-global', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-randomvalues",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"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.8",
|
||||
"@polkadot/x-global": "7.0.3"
|
||||
"@polkadot/x-global": "7.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react-native": "^0.64.12"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-randomvalues', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/x-randomvalues', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-textdecoder",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"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.8",
|
||||
"@polkadot/x-global": "7.0.3"
|
||||
"@polkadot/x-global": "7.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-textdecoder', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/x-textdecoder', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-textencoder",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"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.8",
|
||||
"@polkadot/x-global": "7.0.3"
|
||||
"@polkadot/x-global": "7.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-textencoder', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/x-textencoder', version: '7.1.2' };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-ws",
|
||||
"version": "7.0.3",
|
||||
"version": "7.1.2",
|
||||
"type": "module",
|
||||
"description": "A cross-environment WebSocket replacement",
|
||||
"browser": "browser.js",
|
||||
@@ -19,8 +19,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/x-ws#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.14.8",
|
||||
"@polkadot/x-global": "7.0.3",
|
||||
"@types/websocket": "^1.0.3",
|
||||
"@polkadot/x-global": "7.1.2",
|
||||
"@types/websocket": "^1.0.4",
|
||||
"websocket": "^1.0.34"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/x-ws', version: '7.0.3' };
|
||||
export const packageInfo = { name: '@polkadot/x-ws', version: '7.1.2' };
|
||||
|
||||
Reference in New Issue
Block a user