@taquito/signer 24.2.0 → 24.3.0-beta.1
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/dist/lib/derivation-tools/ecdsa.js +2 -2
- package/dist/lib/derivation-tools/ed25519.js +2 -2
- package/dist/lib/ec-key.js +2 -2
- package/dist/lib/ed-key.js +2 -2
- package/dist/lib/errors.js +8 -9
- package/dist/lib/helpers.js +1 -1
- package/dist/lib/in-memory-signer.js +31 -51
- package/dist/lib/version.js +2 -2
- package/dist/taquito-signer.es6.js +50 -72
- package/dist/taquito-signer.es6.js.map +1 -1
- package/dist/taquito-signer.umd.js +50 -72
- package/dist/taquito-signer.umd.js.map +1 -1
- package/dist/types/derivation-tools/ecdsa.d.ts +2 -2
- package/dist/types/derivation-tools/ed25519.d.ts +2 -2
- package/dist/types/ec-key.d.ts +2 -2
- package/dist/types/ed-key.d.ts +2 -2
- package/dist/types/errors.d.ts +11 -8
- package/dist/types/helpers.d.ts +1 -1
- package/dist/types/in-memory-signer.d.ts +7 -11
- package/dist/types/key-interface.d.ts +7 -7
- package/package.json +23 -11
- package/LICENSE +0 -202
|
@@ -40,16 +40,6 @@
|
|
|
40
40
|
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
44
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
45
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
46
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
47
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
48
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
49
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
43
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
54
44
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
55
45
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
@@ -70,7 +60,7 @@
|
|
|
70
60
|
|
|
71
61
|
var _EdKey_keyPair, _EdPublicKey_key;
|
|
72
62
|
/**
|
|
73
|
-
*
|
|
63
|
+
* Provide signing logic for ed25519 curve based key (tz1)
|
|
74
64
|
*/
|
|
75
65
|
class EdKey {
|
|
76
66
|
/**
|
|
@@ -78,7 +68,7 @@
|
|
|
78
68
|
* @param key Encoded private key
|
|
79
69
|
* @param encrypted Is the private key encrypted
|
|
80
70
|
* @param decrypt Decrypt function
|
|
81
|
-
* @throws
|
|
71
|
+
* @throws InvalidKeyError
|
|
82
72
|
*/
|
|
83
73
|
constructor(key, decrypt) {
|
|
84
74
|
_EdKey_keyPair.set(this, void 0);
|
|
@@ -174,19 +164,18 @@
|
|
|
174
164
|
|
|
175
165
|
/**
|
|
176
166
|
* @category Error
|
|
177
|
-
*
|
|
167
|
+
* Error that indicates an invalid Mnemonic being passed or used
|
|
178
168
|
*/
|
|
179
169
|
class InvalidMnemonicError extends core.ParameterValidationError {
|
|
180
|
-
constructor(
|
|
170
|
+
constructor(_mnemonic) {
|
|
181
171
|
super();
|
|
182
|
-
this.mnemonic = mnemonic;
|
|
183
172
|
this.name = 'InvalidMnemonicError';
|
|
184
|
-
this.message =
|
|
173
|
+
this.message = 'Invalid mnemonic';
|
|
185
174
|
}
|
|
186
175
|
}
|
|
187
176
|
/**
|
|
188
177
|
* @category Error
|
|
189
|
-
*
|
|
178
|
+
* Error that indicates a curve with incorrect bit size being passed or used
|
|
190
179
|
*/
|
|
191
180
|
class InvalidBitSize extends core.ParameterValidationError {
|
|
192
181
|
constructor(message) {
|
|
@@ -197,7 +186,7 @@
|
|
|
197
186
|
}
|
|
198
187
|
/**
|
|
199
188
|
* @category Error
|
|
200
|
-
*
|
|
189
|
+
* Error that indicates an unsupported cureve being passed or used
|
|
201
190
|
*/
|
|
202
191
|
class InvalidCurveError extends core.ParameterValidationError {
|
|
203
192
|
constructor(message) {
|
|
@@ -208,7 +197,7 @@
|
|
|
208
197
|
}
|
|
209
198
|
/**
|
|
210
199
|
* @category Error
|
|
211
|
-
*
|
|
200
|
+
* Error that indicates a seed with invalid length being passed or used
|
|
212
201
|
*/
|
|
213
202
|
class InvalidSeedLengthError extends core.ParameterValidationError {
|
|
214
203
|
constructor(seedLength) {
|
|
@@ -220,7 +209,7 @@
|
|
|
220
209
|
}
|
|
221
210
|
/**
|
|
222
211
|
* @category Error
|
|
223
|
-
*
|
|
212
|
+
* Error that indicates a feature still under developement
|
|
224
213
|
*/
|
|
225
214
|
class ToBeImplemented extends core.UnsupportedActionError {
|
|
226
215
|
constructor() {
|
|
@@ -231,7 +220,7 @@
|
|
|
231
220
|
}
|
|
232
221
|
/**
|
|
233
222
|
* @category Error
|
|
234
|
-
*
|
|
223
|
+
* Error that indicates an invalid passphrase being passed or used
|
|
235
224
|
*/
|
|
236
225
|
class InvalidPassphraseError extends core.ParameterValidationError {
|
|
237
226
|
constructor(message) {
|
|
@@ -259,14 +248,14 @@
|
|
|
259
248
|
},
|
|
260
249
|
};
|
|
261
250
|
/**
|
|
262
|
-
*
|
|
251
|
+
* Provide signing logic for elliptic curve based key (tz2, tz3)
|
|
263
252
|
*/
|
|
264
253
|
class ECKey {
|
|
265
254
|
/**
|
|
266
255
|
*
|
|
267
256
|
* @param key Encoded private key
|
|
268
257
|
* @param decrypt Decrypt function
|
|
269
|
-
* @throws
|
|
258
|
+
* @throws InvalidKeyError
|
|
270
259
|
*/
|
|
271
260
|
constructor(key, decrypt) {
|
|
272
261
|
_ECKey_keyPair.set(this, void 0);
|
|
@@ -452,7 +441,7 @@
|
|
|
452
441
|
*
|
|
453
442
|
* @param seedSrc result of Bip39.mnemonicToSeed
|
|
454
443
|
* @returns instance of PrivateKey
|
|
455
|
-
* @throws
|
|
444
|
+
* @throws InvalidSeedLengthError
|
|
456
445
|
*/
|
|
457
446
|
static fromSeed(seedSrc) {
|
|
458
447
|
const seed = typeof seedSrc === 'string' ? parseHex(seedSrc) : seedSrc;
|
|
@@ -471,7 +460,7 @@
|
|
|
471
460
|
return this.priv.subarray(0, 32);
|
|
472
461
|
}
|
|
473
462
|
/**
|
|
474
|
-
|
|
463
|
+
\* @remarks index: current derivation path item ie: 1729'
|
|
475
464
|
* @returns derivation path child of original private key pair
|
|
476
465
|
*/
|
|
477
466
|
derive(index) {
|
|
@@ -535,7 +524,7 @@
|
|
|
535
524
|
* @param seedSrc result of Bip39.mnemonicToSeed
|
|
536
525
|
* @param curve known supported curve p256 or secp256k1
|
|
537
526
|
* @returns instance of PrivateKey non-HD keys derived
|
|
538
|
-
* @throws
|
|
527
|
+
* @throws InvalidBitSize | InvalidCurveError | InvalidSeedLengthError
|
|
539
528
|
*/
|
|
540
529
|
static fromSeed(seedSrc, curve) {
|
|
541
530
|
let seed = typeof seedSrc === 'string' ? parseHex(seedSrc) : seedSrc;
|
|
@@ -629,7 +618,7 @@
|
|
|
629
618
|
/**
|
|
630
619
|
*
|
|
631
620
|
* @returns Uint8Array (if contains a private key)
|
|
632
|
-
* @throws
|
|
621
|
+
* @throws InvalidKeyError
|
|
633
622
|
*/
|
|
634
623
|
bytes() {
|
|
635
624
|
if (!this.keyPair.secretKey) {
|
|
@@ -690,7 +679,7 @@
|
|
|
690
679
|
* @param derivationPath Tezos Requirement 44'/1729' for HD key address default 44'/1729'/0'/0'
|
|
691
680
|
* @param curve 'ed25519' | 'secp256k1' | 'p256''
|
|
692
681
|
* @returns final Derivation of HD keys tezos Secret key
|
|
693
|
-
* @throws
|
|
682
|
+
* @throws InvalidCurveError | ToBeImplemented
|
|
694
683
|
*/
|
|
695
684
|
const generateSecretKey = (seed, derivationPath, curve) => {
|
|
696
685
|
const path = Path.fromString(derivationPath);
|
|
@@ -811,40 +800,33 @@
|
|
|
811
800
|
|
|
812
801
|
var _InMemorySigner_key;
|
|
813
802
|
/**
|
|
814
|
-
*
|
|
803
|
+
* A local implementation of the signer. Will represent a Tezos account and be able to produce signature in its behalf
|
|
815
804
|
*
|
|
816
|
-
* @
|
|
817
|
-
* @throws
|
|
805
|
+
* @remarks If running in production and dealing with tokens that have real value, it is strongly recommended to use a HSM backed signer so that private key material is not stored in memory or on disk
|
|
806
|
+
* @throws InvalidMnemonicError
|
|
818
807
|
*/
|
|
819
808
|
class InMemorySigner {
|
|
820
809
|
static fromFundraiser(email, password, mnemonic) {
|
|
821
810
|
if (!Bip39__namespace.validateMnemonic(mnemonic)) {
|
|
822
|
-
throw new InvalidMnemonicError(
|
|
811
|
+
throw new InvalidMnemonicError();
|
|
823
812
|
}
|
|
824
813
|
const seed = Bip39__namespace.mnemonicToSeedSync(mnemonic, `${email}${password}`);
|
|
825
814
|
const key = utils.b58Encode(seed.subarray(0, 32), utils.PrefixV2.Ed25519Seed);
|
|
826
815
|
return new InMemorySigner(key);
|
|
827
816
|
}
|
|
828
|
-
static fromSecretKey(key, passphrase) {
|
|
829
|
-
return
|
|
830
|
-
return new InMemorySigner(key, passphrase);
|
|
831
|
-
});
|
|
817
|
+
static async fromSecretKey(key, passphrase) {
|
|
818
|
+
return new InMemorySigner(key, passphrase);
|
|
832
819
|
}
|
|
833
820
|
/**
|
|
834
821
|
*
|
|
835
|
-
*
|
|
836
|
-
* @param mnemonic 12-24 word mnemonic
|
|
837
|
-
* @param password password used to encrypt the mnemonic to seed value
|
|
838
|
-
* @param derivationPath default 44'/1729'/0'/0' (44'/1729' mandatory)
|
|
839
|
-
* @param curve currently only supported for tz1, tz2, tz3 addresses. soon bip25519
|
|
822
|
+
* Instantiation of an InMemorySigner instance from a mnemonic
|
|
840
823
|
* @returns InMemorySigner
|
|
841
|
-
* @throws
|
|
824
|
+
* @throws InvalidMnemonicError
|
|
842
825
|
*/
|
|
843
826
|
static fromMnemonic({ mnemonic, password = '', derivationPath = "44'/1729'/0'/0'", curve = 'ed25519', }) {
|
|
844
827
|
// check if curve is defined if not default tz1
|
|
845
828
|
if (!Bip39__namespace.validateMnemonic(mnemonic)) {
|
|
846
|
-
|
|
847
|
-
throw new InvalidMnemonicError(mnemonic);
|
|
829
|
+
throw new InvalidMnemonicError();
|
|
848
830
|
}
|
|
849
831
|
const seed = Bip39__namespace.mnemonicToSeedSync(mnemonic, password);
|
|
850
832
|
const sk = generateSecretKey(seed, derivationPath, curve);
|
|
@@ -854,7 +836,7 @@
|
|
|
854
836
|
*
|
|
855
837
|
* @param key Encoded private key
|
|
856
838
|
* @param passphrase Passphrase to decrypt the private key if it is encrypted
|
|
857
|
-
* @throws
|
|
839
|
+
* @throws InvalidKeyError
|
|
858
840
|
*
|
|
859
841
|
*/
|
|
860
842
|
constructor(key, passphrase) {
|
|
@@ -875,7 +857,7 @@
|
|
|
875
857
|
const [, pre] = utils.b58DecodeAndCheckPrefix(key, keyPrefixes);
|
|
876
858
|
return pre;
|
|
877
859
|
}
|
|
878
|
-
catch
|
|
860
|
+
catch {
|
|
879
861
|
throw new core.InvalidKeyError(`Invalid private key, expecting one of the following prefixes '${keyPrefixes}'.`);
|
|
880
862
|
}
|
|
881
863
|
})();
|
|
@@ -924,33 +906,29 @@
|
|
|
924
906
|
}
|
|
925
907
|
/**
|
|
926
908
|
*
|
|
927
|
-
* @param
|
|
909
|
+
* @param message Bytes to sign
|
|
928
910
|
* @param watermark Watermark to append to the bytes
|
|
929
911
|
*/
|
|
930
|
-
sign(message, watermark) {
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
};
|
|
943
|
-
});
|
|
912
|
+
async sign(message, watermark) {
|
|
913
|
+
const msg = typeof message == 'string' ? utils.hex2buf(message) : message;
|
|
914
|
+
const watermarkMsg = watermark !== undefined ? utils.mergebuf(watermark, msg) : msg;
|
|
915
|
+
const { rawSignature, sig: signature, prefixSig: prefixedSignature, } = await __classPrivateFieldGet(this, _InMemorySigner_key, "f").sign(watermarkMsg);
|
|
916
|
+
return {
|
|
917
|
+
bytes: utils.buf2hex(msg),
|
|
918
|
+
sig: signature,
|
|
919
|
+
prefixSig: prefixedSignature,
|
|
920
|
+
sbytes: utils.buf2hex(utils.mergebuf(msg,
|
|
921
|
+
// bls only Signature_prefix ff03 ref:https://octez.tezos.com/docs/shell/p2p_api.html#signature-prefix-tag-255 & https://octez.tezos.com/docs/shell/p2p_api.html#bls-prefix-tag-3
|
|
922
|
+
isPOP(__classPrivateFieldGet(this, _InMemorySigner_key, "f")) ? utils.mergebuf(new Uint8Array([255, 3]), rawSignature) : rawSignature)),
|
|
923
|
+
};
|
|
944
924
|
}
|
|
945
|
-
provePossession() {
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
}
|
|
953
|
-
});
|
|
925
|
+
async provePossession() {
|
|
926
|
+
if (isPOP(__classPrivateFieldGet(this, _InMemorySigner_key, "f"))) {
|
|
927
|
+
return __classPrivateFieldGet(this, _InMemorySigner_key, "f").provePossession();
|
|
928
|
+
}
|
|
929
|
+
else {
|
|
930
|
+
throw new core.ProhibitedActionError('Only BLS keys can prove possession');
|
|
931
|
+
}
|
|
954
932
|
}
|
|
955
933
|
get canProvePossession() {
|
|
956
934
|
return isPOP(__classPrivateFieldGet(this, _InMemorySigner_key, "f"));
|
|
@@ -996,8 +974,8 @@
|
|
|
996
974
|
|
|
997
975
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
|
|
998
976
|
const VERSION = {
|
|
999
|
-
"commitHash": "
|
|
1000
|
-
"version": "24.
|
|
977
|
+
"commitHash": "05df48fee92f846cba793920d6fa829afd6a1847",
|
|
978
|
+
"version": "24.3.0-beta.1"
|
|
1001
979
|
};
|
|
1002
980
|
|
|
1003
981
|
exports.ECDSA = ecdsa;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-signer.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taquito-signer.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -25,7 +25,7 @@ export declare class PrivateKey implements ExtendedPrivateKey {
|
|
|
25
25
|
* @param seedSrc result of Bip39.mnemonicToSeed
|
|
26
26
|
* @param curve known supported curve p256 or secp256k1
|
|
27
27
|
* @returns instance of PrivateKey non-HD keys derived
|
|
28
|
-
* @throws
|
|
28
|
+
* @throws InvalidBitSize | InvalidCurveError | InvalidSeedLengthError
|
|
29
29
|
*/
|
|
30
30
|
static fromSeed(seedSrc: Uint8Array | string, curve: CurveName): PrivateKey;
|
|
31
31
|
/**
|
|
@@ -43,7 +43,7 @@ export declare class PrivateKey implements ExtendedPrivateKey {
|
|
|
43
43
|
/**
|
|
44
44
|
*
|
|
45
45
|
* @returns Uint8Array (if contains a private key)
|
|
46
|
-
* @throws
|
|
46
|
+
* @throws InvalidKeyError
|
|
47
47
|
*/
|
|
48
48
|
bytes(): Uint8Array;
|
|
49
49
|
}
|
|
@@ -12,7 +12,7 @@ export declare class PrivateKey implements ExtendedPrivateKey {
|
|
|
12
12
|
*
|
|
13
13
|
* @param seedSrc result of Bip39.mnemonicToSeed
|
|
14
14
|
* @returns instance of PrivateKey
|
|
15
|
-
* @throws
|
|
15
|
+
* @throws InvalidSeedLengthError
|
|
16
16
|
*/
|
|
17
17
|
static fromSeed(seedSrc: Uint8Array | string): PrivateKey;
|
|
18
18
|
/**
|
|
@@ -21,7 +21,7 @@ export declare class PrivateKey implements ExtendedPrivateKey {
|
|
|
21
21
|
*/
|
|
22
22
|
seed(): Uint8Array;
|
|
23
23
|
/**
|
|
24
|
-
|
|
24
|
+
\* @remarks index: current derivation path item ie: 1729'
|
|
25
25
|
* @returns derivation path child of original private key pair
|
|
26
26
|
*/
|
|
27
27
|
derive(index: number): PrivateKey;
|
package/dist/types/ec-key.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { SigningKey, PublicKey } from './key-interface';
|
|
|
2
2
|
import { RawSignResult } from '@taquito/core';
|
|
3
3
|
type Curve = 'p256' | 'secp256k1';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Provide signing logic for elliptic curve based key (tz2, tz3)
|
|
6
6
|
*/
|
|
7
7
|
export declare class ECKey implements SigningKey {
|
|
8
8
|
#private;
|
|
@@ -10,7 +10,7 @@ export declare class ECKey implements SigningKey {
|
|
|
10
10
|
*
|
|
11
11
|
* @param key Encoded private key
|
|
12
12
|
* @param decrypt Decrypt function
|
|
13
|
-
* @throws
|
|
13
|
+
* @throws InvalidKeyError
|
|
14
14
|
*/
|
|
15
15
|
constructor(key: string, decrypt?: (k: Uint8Array) => Uint8Array);
|
|
16
16
|
/**
|
package/dist/types/ed-key.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SigningKey, PublicKey } from './key-interface';
|
|
2
2
|
import { RawSignResult } from '@taquito/core';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Provide signing logic for ed25519 curve based key (tz1)
|
|
5
5
|
*/
|
|
6
6
|
export declare class EdKey implements SigningKey {
|
|
7
7
|
#private;
|
|
@@ -10,7 +10,7 @@ export declare class EdKey implements SigningKey {
|
|
|
10
10
|
* @param key Encoded private key
|
|
11
11
|
* @param encrypted Is the private key encrypted
|
|
12
12
|
* @param decrypt Decrypt function
|
|
13
|
-
* @throws
|
|
13
|
+
* @throws InvalidKeyError
|
|
14
14
|
*/
|
|
15
15
|
constructor(key: string, decrypt?: (k: Uint8Array) => Uint8Array);
|
|
16
16
|
/**
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { ParameterValidationError, UnsupportedActionError } from '@taquito/core';
|
|
2
2
|
/**
|
|
3
3
|
* @category Error
|
|
4
|
-
*
|
|
4
|
+
* Error that indicates an invalid Mnemonic being passed or used
|
|
5
5
|
*/
|
|
6
6
|
export declare class InvalidMnemonicError extends ParameterValidationError {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use `new InvalidMnemonicError()` instead. The mnemonic argument is ignored for security reasons.
|
|
9
|
+
*/
|
|
10
|
+
constructor(_mnemonic: string);
|
|
11
|
+
constructor();
|
|
9
12
|
}
|
|
10
13
|
/**
|
|
11
14
|
* @category Error
|
|
12
|
-
*
|
|
15
|
+
* Error that indicates a curve with incorrect bit size being passed or used
|
|
13
16
|
*/
|
|
14
17
|
export declare class InvalidBitSize extends ParameterValidationError {
|
|
15
18
|
readonly message: string;
|
|
@@ -17,7 +20,7 @@ export declare class InvalidBitSize extends ParameterValidationError {
|
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* @category Error
|
|
20
|
-
*
|
|
23
|
+
* Error that indicates an unsupported cureve being passed or used
|
|
21
24
|
*/
|
|
22
25
|
export declare class InvalidCurveError extends ParameterValidationError {
|
|
23
26
|
readonly message: string;
|
|
@@ -25,7 +28,7 @@ export declare class InvalidCurveError extends ParameterValidationError {
|
|
|
25
28
|
}
|
|
26
29
|
/**
|
|
27
30
|
* @category Error
|
|
28
|
-
*
|
|
31
|
+
* Error that indicates a seed with invalid length being passed or used
|
|
29
32
|
*/
|
|
30
33
|
export declare class InvalidSeedLengthError extends ParameterValidationError {
|
|
31
34
|
readonly seedLength: number;
|
|
@@ -33,14 +36,14 @@ export declare class InvalidSeedLengthError extends ParameterValidationError {
|
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* @category Error
|
|
36
|
-
*
|
|
39
|
+
* Error that indicates a feature still under developement
|
|
37
40
|
*/
|
|
38
41
|
export declare class ToBeImplemented extends UnsupportedActionError {
|
|
39
42
|
constructor();
|
|
40
43
|
}
|
|
41
44
|
/**
|
|
42
45
|
* @category Error
|
|
43
|
-
*
|
|
46
|
+
* Error that indicates an invalid passphrase being passed or used
|
|
44
47
|
*/
|
|
45
48
|
export declare class InvalidPassphraseError extends ParameterValidationError {
|
|
46
49
|
readonly message: string;
|
package/dist/types/helpers.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ export type Curves = 'ed25519' | 'secp256k1' | 'p256' | 'bip25519';
|
|
|
5
5
|
* @param derivationPath Tezos Requirement 44'/1729' for HD key address default 44'/1729'/0'/0'
|
|
6
6
|
* @param curve 'ed25519' | 'secp256k1' | 'p256''
|
|
7
7
|
* @returns final Derivation of HD keys tezos Secret key
|
|
8
|
-
* @throws
|
|
8
|
+
* @throws InvalidCurveError | ToBeImplemented
|
|
9
9
|
*/
|
|
10
10
|
export declare const generateSecretKey: (seed: Uint8Array, derivationPath: string, curve: Curves) => string;
|
|
@@ -8,10 +8,10 @@ export interface FromMnemonicParams {
|
|
|
8
8
|
curve?: Curves;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A local implementation of the signer. Will represent a Tezos account and be able to produce signature in its behalf
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
14
|
-
* @throws
|
|
13
|
+
* @remarks If running in production and dealing with tokens that have real value, it is strongly recommended to use a HSM backed signer so that private key material is not stored in memory or on disk
|
|
14
|
+
* @throws InvalidMnemonicError
|
|
15
15
|
*/
|
|
16
16
|
export declare class InMemorySigner implements Signer {
|
|
17
17
|
#private;
|
|
@@ -19,26 +19,22 @@ export declare class InMemorySigner implements Signer {
|
|
|
19
19
|
static fromSecretKey(key: string, passphrase?: string): Promise<InMemorySigner>;
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
* @param mnemonic 12-24 word mnemonic
|
|
24
|
-
* @param password password used to encrypt the mnemonic to seed value
|
|
25
|
-
* @param derivationPath default 44'/1729'/0'/0' (44'/1729' mandatory)
|
|
26
|
-
* @param curve currently only supported for tz1, tz2, tz3 addresses. soon bip25519
|
|
22
|
+
* Instantiation of an InMemorySigner instance from a mnemonic
|
|
27
23
|
* @returns InMemorySigner
|
|
28
|
-
* @throws
|
|
24
|
+
* @throws InvalidMnemonicError
|
|
29
25
|
*/
|
|
30
26
|
static fromMnemonic({ mnemonic, password, derivationPath, curve, }: FromMnemonicParams): InMemorySigner;
|
|
31
27
|
/**
|
|
32
28
|
*
|
|
33
29
|
* @param key Encoded private key
|
|
34
30
|
* @param passphrase Passphrase to decrypt the private key if it is encrypted
|
|
35
|
-
* @throws
|
|
31
|
+
* @throws InvalidKeyError
|
|
36
32
|
*
|
|
37
33
|
*/
|
|
38
34
|
constructor(key: string, passphrase?: string);
|
|
39
35
|
/**
|
|
40
36
|
*
|
|
41
|
-
* @param
|
|
37
|
+
* @param message Bytes to sign
|
|
42
38
|
* @param watermark Watermark to append to the bytes
|
|
43
39
|
*/
|
|
44
40
|
sign(message: string | Uint8Array, watermark?: Uint8Array): Promise<SignResult>;
|
|
@@ -11,26 +11,26 @@ export interface SigningKeyWithProofOfPossession extends SigningKey {
|
|
|
11
11
|
export declare function isPOP(k: SigningKey): k is SigningKeyWithProofOfPossession;
|
|
12
12
|
export interface PublicKey {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* @param
|
|
14
|
+
* Compare two public keys of the same elliptic curve
|
|
15
|
+
* @param other the other PublicKey class to compare to
|
|
16
16
|
* @returns -1 if this public key is less than the other, 0 if they are equal, 1 if this public key is greater than the other
|
|
17
|
-
* @throws
|
|
17
|
+
* @throws InvalidPublicKeyError
|
|
18
18
|
*/
|
|
19
19
|
compare(other: PublicKey): number;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Hash of the public key (tz1, tz2, tz3, tz4 addresses)
|
|
22
22
|
* @returns the hash of the public key
|
|
23
23
|
*/
|
|
24
24
|
hash(): string;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @param compress
|
|
26
|
+
* Get the bytes of the public key without prefix
|
|
27
|
+
* @param compress Whether to get the compressed format of the public key
|
|
28
28
|
* @default true
|
|
29
29
|
* @returns the bytes of the public key
|
|
30
30
|
*/
|
|
31
31
|
bytes(compress?: boolean): Uint8Array;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Get the bytes of the public key with prefix
|
|
34
34
|
* @returns the bytes of the public key
|
|
35
35
|
*/
|
|
36
36
|
toProtocol(): Uint8Array;
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/signer",
|
|
3
|
-
"version": "24.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "24.3.0-beta.1",
|
|
4
|
+
"description": "Software signer implementations and signing utilities for Taquito.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"taquito",
|
|
6
7
|
"tezos",
|
|
8
|
+
"typescript",
|
|
7
9
|
"blockchain",
|
|
8
|
-
"signer"
|
|
10
|
+
"signer",
|
|
11
|
+
"crypto"
|
|
9
12
|
],
|
|
10
13
|
"main": "dist/taquito-signer.umd.js",
|
|
11
14
|
"module": "dist/taquito-signer.es6.js",
|
|
@@ -17,14 +20,24 @@
|
|
|
17
20
|
"publishConfig": {
|
|
18
21
|
"access": "public"
|
|
19
22
|
},
|
|
20
|
-
"author": "
|
|
23
|
+
"author": "ECAD Labs Inc <info@ecadlabs.com>",
|
|
24
|
+
"contributors": [
|
|
25
|
+
"Jev Björsell (jevonearth)",
|
|
26
|
+
"Roxane Letourneau <roxane@ecadlabs.com>",
|
|
27
|
+
"Davis Sawali <davis.sawali@ecadlabs.com>",
|
|
28
|
+
"Simon Boissonneault-Robert <simon@ecadlabs.com>"
|
|
29
|
+
],
|
|
30
|
+
"homepage": "https://taquito.io/",
|
|
21
31
|
"repository": {
|
|
22
32
|
"type": "git",
|
|
23
|
-
"url": ""
|
|
33
|
+
"url": "git+https://github.com/ecadlabs/taquito.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/ecadlabs/taquito/issues"
|
|
24
37
|
},
|
|
25
38
|
"license": "Apache-2.0",
|
|
26
39
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
40
|
+
"node": ">=22"
|
|
28
41
|
},
|
|
29
42
|
"scripts": {
|
|
30
43
|
"test": "jest --coverage",
|
|
@@ -73,8 +86,8 @@
|
|
|
73
86
|
"@stablelib/nacl": "^1.0.4",
|
|
74
87
|
"@stablelib/pbkdf2": "^1.0.1",
|
|
75
88
|
"@stablelib/sha512": "^1.0.1",
|
|
76
|
-
"@taquito/core": "^24.
|
|
77
|
-
"@taquito/utils": "^24.
|
|
89
|
+
"@taquito/core": "^24.3.0-beta.1",
|
|
90
|
+
"@taquito/utils": "^24.3.0-beta.1",
|
|
78
91
|
"@types/bn.js": "^5.1.5",
|
|
79
92
|
"bip39": "3.1.0",
|
|
80
93
|
"bn.js": "^5.2.2",
|
|
@@ -108,8 +121,7 @@
|
|
|
108
121
|
"ts-jest": "^29.2.3",
|
|
109
122
|
"ts-node": "^10.9.2",
|
|
110
123
|
"ts-toolbelt": "^9.6.0",
|
|
111
|
-
"
|
|
112
|
-
"typescript": "~5.5.4"
|
|
124
|
+
"typescript": "^5.9.3"
|
|
113
125
|
},
|
|
114
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "551e35aeff7d6dcde1c72284238c0ed3c3aae77e"
|
|
115
127
|
}
|