@taquito/signer 22.0.0 → 23.0.0-RC.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,11 +1,10 @@
1
+ import { SigningKey } from './key-interface';
2
+ import { RawSignResult } from '@taquito/taquito';
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,19 +12,13 @@ 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): Promise<RawSignResult>;
29
22
  /**
30
23
  * @returns Encoded public key
31
24
  */
@@ -0,0 +1,12 @@
1
+ import { RawSignResult } from '@taquito/taquito';
2
+ export interface SigningKey {
3
+ sign(message: Uint8Array): Promise<RawSignResult>;
4
+ publicKey(): Promise<string>;
5
+ publicKeyHash(): Promise<string>;
6
+ secretKey(): Promise<string>;
7
+ provePossession?: () => Promise<RawSignResult>;
8
+ }
9
+ export interface SigningKeyWithProofOfPossession extends SigningKey {
10
+ provePossession(): Promise<RawSignResult>;
11
+ }
12
+ export declare function isPOP(k: SigningKey): k is SigningKeyWithProofOfPossession;
@@ -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,4 +1,5 @@
1
1
  import { Curves } from './helpers';
2
+ import { SignResult, RawSignResult, Signer } from '@taquito/taquito';
2
3
  export * from './import-key';
3
4
  export { VERSION } from './version';
4
5
  export * from './derivation-tools';
@@ -16,8 +17,8 @@ export interface FromMnemonicParams {
16
17
  * @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
18
  * @throws {@link InvalidMnemonicError}
18
19
  */
19
- export declare class InMemorySigner {
20
- private _key;
20
+ export declare class InMemorySigner implements Signer {
21
+ #private;
21
22
  static fromFundraiser(email: string, password: string, mnemonic: string): InMemorySigner;
22
23
  static fromSecretKey(key: string, passphrase?: string): Promise<InMemorySigner>;
23
24
  /**
@@ -44,12 +45,9 @@ export declare class InMemorySigner {
44
45
  * @param bytes Bytes to sign
45
46
  * @param watermark Watermark to append to the bytes
46
47
  */
47
- sign(bytes: string, watermark?: Uint8Array): Promise<{
48
- bytes: string;
49
- sig: string;
50
- prefixSig: string;
51
- sbytes: string;
52
- }>;
48
+ sign(message: string | Uint8Array, watermark?: Uint8Array): Promise<SignResult>;
49
+ provePossession(): Promise<RawSignResult>;
50
+ get canProvePossession(): boolean;
53
51
  /**
54
52
  * @returns Encoded public key
55
53
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taquito/signer",
3
- "version": "22.0.0",
3
+ "version": "23.0.0-RC.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": "^22.0.0",
76
- "@taquito/taquito": "^22.0.0",
77
- "@taquito/utils": "^22.0.0",
76
+ "@taquito/core": "^23.0.0-RC.0",
77
+ "@taquito/taquito": "^23.0.0-RC.0",
78
+ "@taquito/utils": "^23.0.0-RC.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": "134ec228acbee03b4f40b80c89d78c718557569b"
115
+ "gitHead": "3bdb33e97e705d1c7090dd83e1b243e6e2a4d768"
115
116
  }