@taquito/signer 25.1.0 → 25.2.0-beta0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/lib/bls-key.js +17 -4
- package/dist/lib/derivation-tools/ecdsa.js +12 -9
- package/dist/lib/derivation-tools/ed25519.js +2 -2
- package/dist/lib/derivation-tools/index.js +24 -2
- package/dist/lib/ec-key.js +10 -12
- package/dist/lib/ed-key.js +3 -3
- package/dist/lib/in-memory-signer.js +40 -13
- package/dist/lib/mnemonic.js +112 -0
- package/dist/lib/taquito-signer.js +10 -1
- package/dist/lib/version.js +2 -2
- package/dist/taquito-signer.es6.js +702 -611
- package/dist/taquito-signer.es6.js.map +1 -1
- package/dist/taquito-signer.umd.js +833 -736
- package/dist/taquito-signer.umd.js.map +1 -1
- package/dist/types/bls-key.d.ts +1 -1
- package/dist/types/in-memory-signer.d.ts +4 -9
- package/dist/types/key-interface.d.ts +2 -2
- package/dist/types/mnemonic.d.ts +39 -0
- package/dist/types/taquito-signer.d.ts +5 -1
- package/package.json +13 -17
- package/dist/types/node_modules/@scure/base/index.d.ts +0 -555
package/dist/types/bls-key.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare class BLSKey implements SigningKeyWithProofOfPossession {
|
|
|
6
6
|
private sk;
|
|
7
7
|
private signDst;
|
|
8
8
|
sign(message: Uint8Array): RawSignResult;
|
|
9
|
-
provePossession(): RawSignResult;
|
|
9
|
+
provePossession(overridePublicKey?: string): RawSignResult;
|
|
10
10
|
publicKey(): PublicKey;
|
|
11
11
|
secretKey(): string;
|
|
12
12
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type FromMnemonicParams } from './mnemonic';
|
|
2
|
+
export type { FromMnemonicParams } from './mnemonic';
|
|
2
3
|
import { SignResult, RawSignResult, Signer } from '@taquito/core';
|
|
3
4
|
import { PublicKey } from './key-interface';
|
|
4
|
-
export interface FromMnemonicParams {
|
|
5
|
-
mnemonic: string;
|
|
6
|
-
password?: string;
|
|
7
|
-
derivationPath?: string;
|
|
8
|
-
curve?: Curves;
|
|
9
|
-
}
|
|
10
5
|
/**
|
|
11
6
|
* A local implementation of the signer. Will represent a Tezos account and be able to produce signature in its behalf
|
|
12
7
|
*
|
|
@@ -23,7 +18,7 @@ export declare class InMemorySigner implements Signer {
|
|
|
23
18
|
* @returns InMemorySigner
|
|
24
19
|
* @throws InvalidMnemonicError
|
|
25
20
|
*/
|
|
26
|
-
static fromMnemonic(
|
|
21
|
+
static fromMnemonic(params: FromMnemonicParams): InMemorySigner;
|
|
27
22
|
/**
|
|
28
23
|
*
|
|
29
24
|
* @param key Encoded private key
|
|
@@ -38,7 +33,7 @@ export declare class InMemorySigner implements Signer {
|
|
|
38
33
|
* @param watermark Watermark to append to the bytes
|
|
39
34
|
*/
|
|
40
35
|
sign(message: string | Uint8Array, watermark?: Uint8Array): Promise<SignResult>;
|
|
41
|
-
provePossession(): Promise<RawSignResult>;
|
|
36
|
+
provePossession(overridePublicKey?: string): Promise<RawSignResult>;
|
|
42
37
|
get canProvePossession(): boolean;
|
|
43
38
|
/**
|
|
44
39
|
* @returns Encoded public key
|
|
@@ -3,10 +3,10 @@ export interface SigningKey {
|
|
|
3
3
|
sign(message: Uint8Array): RawSignResult;
|
|
4
4
|
publicKey(): PublicKey;
|
|
5
5
|
secretKey(): string;
|
|
6
|
-
provePossession?: () => RawSignResult;
|
|
6
|
+
provePossession?: (overridePublicKey?: string) => RawSignResult;
|
|
7
7
|
}
|
|
8
8
|
export interface SigningKeyWithProofOfPossession extends SigningKey {
|
|
9
|
-
provePossession(): RawSignResult;
|
|
9
|
+
provePossession(overridePublicKey?: string): RawSignResult;
|
|
10
10
|
}
|
|
11
11
|
export declare function isPOP(k: SigningKey): k is SigningKeyWithProofOfPossession;
|
|
12
12
|
export interface PublicKey {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Curves } from './helpers';
|
|
2
|
+
/**
|
|
3
|
+
* Converts an English BIP39 mnemonic to entropy bytes.
|
|
4
|
+
* @throws InvalidMnemonicError for an invalid phrase, without including its text.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mnemonicToEntropy(mnemonic: string): Uint8Array;
|
|
7
|
+
/**
|
|
8
|
+
* Converts 16, 20, 24, 28 or 32 entropy bytes to an English BIP39 mnemonic.
|
|
9
|
+
* Strings must contain unprefixed, even-length hexadecimal. Leading zeros matter.
|
|
10
|
+
*/
|
|
11
|
+
export declare function entropyToMnemonic(entropy: Uint8Array | string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Generates an English BIP39 mnemonic with the dependency's secure random source.
|
|
14
|
+
* @param strength Entropy bits, 128, 160, 192, 224 or 256. Defaults to 128.
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateMnemonic(strength?: number): string;
|
|
17
|
+
export interface FromMnemonicParams {
|
|
18
|
+
mnemonic: string;
|
|
19
|
+
password?: string;
|
|
20
|
+
derivationPath?: string;
|
|
21
|
+
curve?: Curves;
|
|
22
|
+
}
|
|
23
|
+
export interface DerivedKey {
|
|
24
|
+
publicKey: string;
|
|
25
|
+
publicKeyHash: string;
|
|
26
|
+
secretKey: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function deriveMnemonicSecretKey({ mnemonic, password, derivationPath, curve, }: FromMnemonicParams): {
|
|
29
|
+
secretKey: string;
|
|
30
|
+
curve: Curves;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Derives key material without constructing an InMemorySigner.
|
|
34
|
+
* Uses the same defaults, English BIP39 phrases, password and paths as fromMnemonic.
|
|
35
|
+
* Supports Ed25519, secp256k1 and P-256 mnemonic derivation.
|
|
36
|
+
* The returned secretKey is unencrypted and matches InMemorySigner.secretKey(),
|
|
37
|
+
* including the expanded Ed25519 form. Avoid logging or sharing the result.
|
|
38
|
+
*/
|
|
39
|
+
export declare function deriveKeyFromMnemonic(params: FromMnemonicParams): DerivedKey;
|
|
@@ -6,5 +6,9 @@ export * from './in-memory-signer';
|
|
|
6
6
|
export { VERSION } from './version';
|
|
7
7
|
export * from './derivation-tools';
|
|
8
8
|
export * from './helpers';
|
|
9
|
-
export { InvalidPassphraseError } from './errors';
|
|
9
|
+
export { InvalidPassphraseError, InvalidMnemonicError } from './errors';
|
|
10
10
|
export { PublicKey } from './key-interface';
|
|
11
|
+
export { mnemonicToEntropy } from './mnemonic';
|
|
12
|
+
export { entropyToMnemonic } from './mnemonic';
|
|
13
|
+
export { generateMnemonic } from './mnemonic';
|
|
14
|
+
export { deriveKeyFromMnemonic, type DerivedKey } from './mnemonic';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/signer",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.2.0-beta0",
|
|
4
4
|
"description": "Software signer implementations and signing utilities for Taquito.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"taquito",
|
|
@@ -56,41 +56,37 @@
|
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@noble/curves": "
|
|
60
|
-
"@noble/hashes": "2.
|
|
59
|
+
"@noble/curves": "2.4.0",
|
|
60
|
+
"@noble/hashes": "2.4.0",
|
|
61
61
|
"@noble/post-quantum": "0.7.1",
|
|
62
|
-
"@scure/bip39": "2.
|
|
63
|
-
"@stablelib/nacl": "^
|
|
64
|
-
"@taquito/core": "^25.
|
|
65
|
-
"@taquito/utils": "^25.
|
|
66
|
-
"@types/bn.js": "^5.
|
|
67
|
-
"bn.js": "^5.2.
|
|
62
|
+
"@scure/bip39": "2.4.0",
|
|
63
|
+
"@stablelib/nacl": "^2.0.1",
|
|
64
|
+
"@taquito/core": "^25.2.0-beta0",
|
|
65
|
+
"@taquito/utils": "^25.2.0-beta0",
|
|
66
|
+
"@types/bn.js": "^5.2.0",
|
|
67
|
+
"bn.js": "^5.2.5",
|
|
68
68
|
"typedarray-to-buffer": "^4.0.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
72
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
72
73
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
73
74
|
"@types/bluebird": "^3.5.42",
|
|
74
75
|
"@types/node": "^22.20.5",
|
|
75
76
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
76
77
|
"@typescript-eslint/parser": "^6.21.0",
|
|
77
|
-
"colors": "^1.4.0",
|
|
78
78
|
"cross-env": "^7.0.3",
|
|
79
79
|
"eslint": "^8.57.0",
|
|
80
80
|
"lint-staged": "^15.2.7",
|
|
81
81
|
"lodash.camelcase": "^4.3.0",
|
|
82
82
|
"prettier": "^3.9.10",
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"rimraf": "^6.0.1",
|
|
86
|
-
"rollup": "^4.64.7",
|
|
87
|
-
"rollup-plugin-json": "^4.0.0",
|
|
83
|
+
"rimraf": "^6.1.3",
|
|
84
|
+
"rollup": "^4.67.3",
|
|
88
85
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
89
86
|
"rollup-plugin-typescript2": "^0.37.0",
|
|
90
|
-
"shelljs": "^0.8.5",
|
|
91
87
|
"ts-node": "^10.9.2",
|
|
92
88
|
"ts-toolbelt": "^9.6.0",
|
|
93
|
-
"typescript": "^
|
|
89
|
+
"typescript": "^6.0.3"
|
|
94
90
|
},
|
|
95
91
|
"gitHead": "551e35aeff7d6dcde1c72284238c0ed3c3aae77e"
|
|
96
92
|
}
|