@taquito/signer 23.0.0-beta.0 → 23.0.0

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.
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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} from './key-interface';
2
+ import { RawSignResult } from '@taquito/core';
3
+ export declare class BLSKey implements SigningKeyWithProofOfPossession {
4
+ #private;
5
+ constructor(key: string, decrypt?: (k: Uint8Array) => Uint8Array);
6
+ private sk;
7
+ private signDst;
8
+ sign(message: Uint8Array): RawSignResult;
9
+ provePossession(): RawSignResult;
10
+ publicKey(): PublicKey;
11
+ secretKey(): string;
12
+ }
13
+ export declare class BLSPublicKey implements PublicKey {
14
+ #private;
15
+ constructor(src: string | Uint8Array);
16
+ compare(other: PublicKey): number;
17
+ hash(): string;
18
+ bytes(): Uint8Array;
19
+ toProtocol(): Uint8Array;
20
+ toString(): string;
21
+ }
@@ -1,49 +1,46 @@
1
+ import elliptic from 'elliptic';
2
+ import { SigningKey, PublicKey } from './key-interface';
3
+ import { RawSignResult } from '@taquito/core';
4
+ type Curve = 'p256' | 'secp256k1';
5
+ declare class ECKeyBase {
6
+ readonly keyPair: elliptic.ec.KeyPair;
7
+ constructor(keyPair: elliptic.ec.KeyPair);
8
+ curve(): Curve;
9
+ }
1
10
  /**
2
11
  * @description Provide signing logic for elliptic curve based key (tz2, tz3)
3
12
  */
4
- export declare class ECKey {
5
- private curve;
6
- private key;
7
- private _key;
8
- private _publicKey;
13
+ export declare class ECKey extends ECKeyBase implements SigningKey {
9
14
  /**
10
15
  *
11
- * @param curve Curve to use with the key
12
16
  * @param key Encoded private key
13
- * @param encrypted Is the private key encrypted
14
17
  * @param decrypt Decrypt function
15
18
  * @throws {@link InvalidKeyError}
16
19
  */
17
- constructor(curve: 'p256' | 'secp256k1', key: string, encrypted: boolean, decrypt: (k: any) => any);
20
+ constructor(key: string, decrypt?: (k: Uint8Array) => Uint8Array);
18
21
  /**
19
22
  *
20
23
  * @param bytes Bytes to sign
21
24
  * @param bytesHash Blake2b hash of the bytes to sign
22
25
  */
23
- sign(bytes: string, bytesHash: Uint8Array): Promise<{
24
- bytes: string;
25
- sig: string;
26
- prefixSig: string;
27
- sbytes: string;
28
- }>;
26
+ sign(bytes: Uint8Array): RawSignResult;
29
27
  /**
30
28
  * @returns Encoded public key
31
29
  */
32
- publicKey(): Promise<string>;
33
- /**
34
- * @returns Encoded public key hash
35
- */
36
- publicKeyHash(): Promise<string>;
30
+ publicKey(): PublicKey;
37
31
  /**
38
32
  * @returns Encoded private key
39
33
  */
40
- secretKey(): Promise<string>;
34
+ secretKey(): string;
41
35
  }
42
- /**
43
- * @description Tz3 key class using the p256 curve
44
- */
45
- export declare const Tz3: new (key: string, encrypted: boolean, decrypt: (k: any) => any) => ECKey;
46
- /**
47
- * @description Tz2 key class using the secp256k1 curve
48
- */
49
- export declare const Tz2: new (key: string, encrypted: boolean, decrypt: (k: any) => any) => ECKey;
36
+ export declare class ECPublicKey extends ECKeyBase implements PublicKey {
37
+ constructor(src: string);
38
+ constructor(src: elliptic.ec.KeyPair);
39
+ constructor(src: Uint8Array, curve: Curve);
40
+ compare(other: PublicKey): number;
41
+ hash(): string;
42
+ bytes(compress?: boolean): Uint8Array;
43
+ toProtocol(): Uint8Array;
44
+ toString(): string;
45
+ }
46
+ export {};
@@ -1,11 +1,10 @@
1
+ import { SigningKey, PublicKey } from './key-interface';
2
+ import { RawSignResult } from '@taquito/core';
1
3
  /**
2
4
  * @description Provide signing logic for ed25519 curve based key (tz1)
3
5
  */
4
- export declare class Tz1 {
5
- private key;
6
- private _key;
7
- private _publicKey;
8
- private isInit;
6
+ export declare class EdKey implements SigningKey {
7
+ #private;
9
8
  /**
10
9
  *
11
10
  * @param key Encoded private key
@@ -13,29 +12,28 @@ export declare class Tz1 {
13
12
  * @param decrypt Decrypt function
14
13
  * @throws {@link InvalidKeyError}
15
14
  */
16
- constructor(key: string, encrypted: boolean, decrypt: (k: any) => any);
17
- private init;
15
+ constructor(key: string, decrypt?: (k: Uint8Array) => Uint8Array);
18
16
  /**
19
17
  *
20
18
  * @param bytes Bytes to sign
21
19
  * @param bytesHash Blake2b hash of the bytes to sign
22
20
  */
23
- sign(bytes: string, bytesHash: Uint8Array): Promise<{
24
- bytes: string;
25
- sig: string;
26
- prefixSig: string;
27
- sbytes: string;
28
- }>;
21
+ sign(bytes: Uint8Array): RawSignResult;
29
22
  /**
30
23
  * @returns Encoded public key
31
24
  */
32
- publicKey(): Promise<string>;
33
- /**
34
- * @returns Encoded public key hash
35
- */
36
- publicKeyHash(): Promise<string>;
25
+ publicKey(): PublicKey;
37
26
  /**
38
27
  * @returns Encoded private key
39
28
  */
40
- secretKey(): Promise<string>;
29
+ secretKey(): string;
30
+ }
31
+ export declare class EdPublicKey implements PublicKey {
32
+ #private;
33
+ constructor(src: string | Uint8Array);
34
+ compare(other: PublicKey): number;
35
+ hash(): string;
36
+ bytes(): Uint8Array;
37
+ toProtocol(): Uint8Array;
38
+ toString(): string;
41
39
  }
@@ -0,0 +1,17 @@
1
+ import { RawSignResult } from '@taquito/core';
2
+ export interface SigningKey {
3
+ sign(message: Uint8Array): RawSignResult;
4
+ publicKey(): PublicKey;
5
+ secretKey(): string;
6
+ provePossession?: () => RawSignResult;
7
+ }
8
+ export interface SigningKeyWithProofOfPossession extends SigningKey {
9
+ provePossession(): RawSignResult;
10
+ }
11
+ export declare function isPOP(k: SigningKey): k is SigningKeyWithProofOfPossession;
12
+ export interface PublicKey {
13
+ compare(other: PublicKey): number;
14
+ hash(): string;
15
+ bytes(compress?: boolean): Uint8Array;
16
+ toProtocol(): Uint8Array;
17
+ }
@@ -0,0 +1,16 @@
1
+ export interface SignResult {
2
+ sig: string;
3
+ prefixSig: string;
4
+ rawSignature: Uint8Array;
5
+ }
6
+ export interface SigningKey {
7
+ sign(message: Uint8Array): Promise<SignResult>;
8
+ publicKey(): Promise<string>;
9
+ publicKeyHash(): Promise<string>;
10
+ secretKey(): Promise<string>;
11
+ provePossession?: () => Promise<SignResult>;
12
+ }
13
+ export interface SigningKeyWithProofOfPossession extends SigningKey {
14
+ provePossession(): Promise<SignResult>;
15
+ }
16
+ export declare function isPOP(k: SigningKey): k is SigningKeyWithProofOfPossession;
@@ -1,9 +1,12 @@
1
1
  import { Curves } from './helpers';
2
+ import { SignResult, RawSignResult, Signer } from '@taquito/core';
3
+ import { PublicKey } from './key-interface';
2
4
  export * from './import-key';
3
5
  export { VERSION } from './version';
4
6
  export * from './derivation-tools';
5
7
  export * from './helpers';
6
8
  export { InvalidPassphraseError } from './errors';
9
+ export { PublicKey } from './key-interface';
7
10
  export interface FromMnemonicParams {
8
11
  mnemonic: string;
9
12
  password?: string;
@@ -16,8 +19,8 @@ export interface FromMnemonicParams {
16
19
  * @warn 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
17
20
  * @throws {@link InvalidMnemonicError}
18
21
  */
19
- export declare class InMemorySigner {
20
- private _key;
22
+ export declare class InMemorySigner implements Signer {
23
+ #private;
21
24
  static fromFundraiser(email: string, password: string, mnemonic: string): InMemorySigner;
22
25
  static fromSecretKey(key: string, passphrase?: string): Promise<InMemorySigner>;
23
26
  /**
@@ -44,12 +47,9 @@ export declare class InMemorySigner {
44
47
  * @param bytes Bytes to sign
45
48
  * @param watermark Watermark to append to the bytes
46
49
  */
47
- sign(bytes: string, watermark?: Uint8Array): Promise<{
48
- bytes: string;
49
- sig: string;
50
- prefixSig: string;
51
- sbytes: string;
52
- }>;
50
+ sign(message: string | Uint8Array, watermark?: Uint8Array): Promise<SignResult>;
51
+ provePossession(): Promise<RawSignResult>;
52
+ get canProvePossession(): boolean;
53
53
  /**
54
54
  * @returns Encoded public key
55
55
  */
@@ -63,3 +63,4 @@ export declare class InMemorySigner {
63
63
  */
64
64
  secretKey(): Promise<string>;
65
65
  }
66
+ export declare function publicKeyFromString(src: string): PublicKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taquito/signer",
3
- "version": "23.0.0-beta.0",
3
+ "version": "23.0.0",
4
4
  "description": "Provide signing functionality to be with taquito",
5
5
  "keywords": [
6
6
  "tezos",
@@ -66,15 +66,16 @@
66
66
  ]
67
67
  },
68
68
  "dependencies": {
69
+ "@noble/curves": "^1.9.6",
69
70
  "@stablelib/blake2b": "^1.0.1",
70
71
  "@stablelib/ed25519": "^1.0.3",
71
72
  "@stablelib/hmac": "^1.0.1",
72
73
  "@stablelib/nacl": "^1.0.4",
73
74
  "@stablelib/pbkdf2": "^1.0.1",
74
75
  "@stablelib/sha512": "^1.0.1",
75
- "@taquito/core": "^23.0.0-beta.0",
76
- "@taquito/taquito": "^23.0.0-beta.0",
77
- "@taquito/utils": "^23.0.0-beta.0",
76
+ "@taquito/core": "^23.0.0",
77
+ "@taquito/taquito": "^23.0.0",
78
+ "@taquito/utils": "^23.0.0",
78
79
  "@types/bn.js": "^5.1.5",
79
80
  "bip39": "3.1.0",
80
81
  "elliptic": "^6.6.1",
@@ -111,5 +112,5 @@
111
112
  "typedoc": "^0.26.5",
112
113
  "typescript": "~5.5.4"
113
114
  },
114
- "gitHead": "37cc766d60407d7909fbd2d841d9dd946243d04a"
115
+ "gitHead": "4ac77876be144da54f292e639b5b977a13642de9"
115
116
  }