@taquito/ledger-signer 17.3.2 → 17.4.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.
- package/coverage/clover.xml +3 -3
- package/coverage/coverage-final.json +2 -2
- package/coverage/lcov-report/errors.ts.html +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/taquito-ledger-signer.ts.html +1 -1
- package/coverage/lcov-report/utils.ts.html +1 -1
- package/coverage/lcov-report/version.ts.html +5 -8
- package/coverage/lcov.info +1 -1
- package/dist/lib/errors.js +0 -1
- package/dist/lib/taquito-ledger-signer.js +14 -15
- package/dist/lib/utils.js +0 -1
- package/dist/lib/version.js +2 -3
- package/dist/taquito-ledger-signer.es6.js +350 -348
- package/dist/taquito-ledger-signer.es6.js.map +1 -1
- package/dist/taquito-ledger-signer.umd.js +350 -350
- package/dist/taquito-ledger-signer.umd.js.map +1 -1
- package/dist/types/errors.d.ts +32 -32
- package/dist/types/taquito-ledger-signer.d.ts +75 -75
- package/dist/types/utils.d.ts +43 -43
- package/dist/types/version.d.ts +4 -4
- package/package.json +27 -29
- package/rollup.config.ts +0 -4
- package/signature.json +4 -6
- package/src/version.ts +2 -2
- package/dist/lib/errors.js.map +0 -1
- package/dist/lib/taquito-ledger-signer.js.map +0 -1
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/version.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-ledger-signer.umd.js","sources":["../src/utils.ts","../src/errors.ts","../src/version.ts","../src/taquito-ledger-signer.ts"],"sourcesContent":["/*\n * Some code in this file is adapted from sotez\n * Copyright (c) 2018 Andrew Kishino\n */\n\nimport { DerivationType } from './taquito-ledger-signer';\n\nconst MAX_CHUNK_SIZE = 230;\n\n/**\n *\n * @description Convert the path to a buffer that will be used as LC and CDATA in the APDU send to the ledger device (https://github.com/obsidiansystems/ledger-app-tezos/blob/master/APDUs.md)\n *\n * @param path The ledger derivation path (default is \"44'/1729'/0'/0'\")\n * @returns A buffer where the first element is the length of the path (default is 4), then 3 bytes for each number of the path to which is added 0x8000000\n */\nexport function transformPathToBuffer(path: string): Buffer {\n const result: number[] = [];\n const components = path.split('/');\n components.forEach((element) => {\n let toNumber = parseInt(element, 10);\n if (Number.isNaN(toNumber)) {\n return;\n }\n if (element.length > 1 && element[element.length - 1] === \"'\") {\n toNumber += 0x80000000;\n }\n result.push(toNumber);\n });\n const buffer = Buffer.alloc(1 + result.length * 4);\n buffer[0] = result.length;\n result.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n return buffer;\n}\n\n/**\n *\n * @description Converts uncompressed ledger key to standard tezos binary representation\n */\nexport function compressPublicKey(publicKey: Buffer, curve: DerivationType) {\n if (curve === 0x00 || curve === 0x03) {\n publicKey = publicKey.slice(1);\n } else {\n publicKey[0] = 0x02 + (publicKey[64] & 0x01);\n publicKey = publicKey.slice(0, 33);\n }\n return publicKey;\n}\n\nexport function appendWatermark(bytes: string, watermark?: Uint8Array): string {\n let transactionHex = bytes;\n if (typeof watermark !== 'undefined') {\n const hexWatermark = Buffer.from(watermark).toString('hex');\n transactionHex = hexWatermark.concat(bytes);\n }\n return transactionHex;\n}\n\n/**\n *\n * @description In order not to exceed the data length allowed by the Ledger device, split the operation into buffers of 230 bytes (max) and add them to the message to send to the Ledger\n * @param messageToSend The message to send to the Ledger device\n * @param operation The operation which will be chunk if its length is over 230 bytes\n * @returns The instruction to send to the Ledger device\n */\nexport function chunkOperation(messageToSend: any, operation: Buffer) {\n let offset = 0;\n while (offset !== operation.length) {\n const chunkSize =\n offset + MAX_CHUNK_SIZE >= operation.length ? operation.length - offset : MAX_CHUNK_SIZE;\n const buff = Buffer.alloc(chunkSize);\n operation.copy(buff, 0, offset, offset + chunkSize);\n messageToSend.push(buff);\n offset += chunkSize;\n }\n return messageToSend;\n}\n\n/**\n *\n * @description Verify if the signature returned by the ledger for tz2 and tz3 is valid\n * @param response The signature returned by the Ledger (return from the signWithLedger function)\n * @returns True if valid, false otherwise\n */\nexport function validateResponse(response: Buffer): boolean {\n let valid = true;\n if (response[0] !== 0x31 && response[0] !== 0x30) {\n valid = false;\n }\n if (response[1] + 4 !== response.length) {\n valid = false;\n }\n if (response[2] !== 0x02) {\n valid = false;\n }\n const rLength = response[3];\n if (response[4 + rLength] !== 0x02) {\n valid = false;\n }\n\n const idxLengthSVal = 5 + rLength;\n const sLength = response[idxLengthSVal];\n if (idxLengthSVal + 1 + sLength + 2 !== response.length) {\n valid = false;\n }\n return valid;\n}\n\n/**\n *\n * @description Extract a part of the response returned by the Ledger\n * @param idxLength The index in the response from the Ledger that corresponds to the length of the part to extract\n * @param response The signature returned by the Ledger (return from the signWithLedger function)\n * @returns An object that contains the extracted buffer, the index where it starts in the response and the length of the extracted part\n */\nexport function extractValue(idxLength: number, response: Buffer) {\n const buffer = Buffer.alloc(32);\n buffer.fill(0);\n\n let length = response[idxLength];\n let idxValueStart = idxLength + 1;\n if (length > 32) {\n idxValueStart += length - 32;\n length = 32;\n }\n response.copy(buffer, 32 - length, idxValueStart, idxValueStart + length);\n return { buffer, idxValueStart, length };\n}\n","import { ParameterValidationError, TaquitoError } from '@taquito/core';\n\n/**\n * @category Error\n * @description Error that indicates an invalid or unparseable ledger response\n */\nexport class InvalidLedgerResponseError extends TaquitoError {\n constructor(public readonly message: string) {\n super();\n this.name = 'InvalidLedgerResponseError';\n }\n}\n\n/**\n * @category Error\n * @description Error that indicates a failure when trying to retrieve a Public Key from Ledger signer\n */\nexport class PublicKeyRetrievalError extends TaquitoError {\n constructor(public readonly cause: any) {\n super();\n this.name = 'PublicKeyRetrievalError';\n this.message = `Unable to retrieve Public Key from Ledger`;\n }\n}\n\n/**\n * @category Error\n * @description Error that indicates a failure when trying to retrieve a Public Key Hash from Ledger signer\n */\nexport class PublicKeyHashRetrievalError extends TaquitoError {\n constructor() {\n super();\n this.name = 'PublicKeyHashRetrievalError';\n this.message = 'Unable to retrieve Public Key Hash from Ledger';\n }\n}\n\n/**\n * @category Error\n * @description Error that indicates an invalid derivation type being passed or used\n */\nexport class InvalidDerivationTypeError extends ParameterValidationError {\n constructor(public readonly derivationType: string) {\n super();\n this.name = 'InvalidDerivationTypeError';\n this.message = `Invalid derivation type ${derivationType} expecting one of the following: DerivationType.ED25519, DerivationType.SECP256K1, DerivationType.P256 or DerivationType.BIP32_ED25519`;\n }\n}\n","\n// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!\nexport const VERSION = {\n \"commitHash\": \"a97e506efd61b86e39ae30db588401b8fda46553\",\n \"version\": \"17.3.2\"\n};\n","/**\n * @packageDocumentation\n * @module @taquito/ledger-signer\n */\n\nimport { Signer } from '@taquito/taquito';\nimport Transport from '@ledgerhq/hw-transport';\nimport { b58cencode, invalidDetail, prefix, Prefix, ValidationResult } from '@taquito/utils';\nimport {\n appendWatermark,\n transformPathToBuffer,\n compressPublicKey,\n chunkOperation,\n validateResponse,\n extractValue,\n} from './utils';\nimport { hash } from '@stablelib/blake2b';\nimport {\n PublicKeyHashRetrievalError,\n PublicKeyRetrievalError,\n InvalidLedgerResponseError,\n InvalidDerivationTypeError,\n} from './errors';\nimport { InvalidDerivationPathError, ProhibitedActionError } from '@taquito/core';\n\nexport { InvalidDerivationPathError } from '@taquito/core';\n\nexport type LedgerTransport = Pick<Transport, 'send' | 'decorateAppAPIMethods' | 'setScrambleKey'>;\n\nexport enum DerivationType {\n ED25519 = 0x00, // tz1\n SECP256K1 = 0x01, // tz2\n P256 = 0x02, // tz3\n BIP32_ED25519 = 0x03, // tz1 BIP32\n}\n\nexport { InvalidDerivationTypeError } from './errors';\n\nexport const HDPathTemplate = (account: number) => {\n return `44'/1729'/${account}'/0'`;\n};\n\nexport { VERSION } from './version';\n\n/**\n *\n * @description Implementation of the Signer interface that will allow signing operation from a Ledger Nano device\n *\n * @param transport A transport instance from LedgerJS libraries depending on the platform used (e.g. Web, Node)\n * @param path The ledger derivation path (default is \"44'/1729'/0'/0'\")\n * @param prompt Whether to prompt the ledger for public key (default is true)\n * @param derivationType The value which defines the curve to use (DerivationType.ED25519(default), DerivationType.SECP256K1, DerivationType.P256, DerivationType.BIP32_ED25519)\n *\n * @example\n * ```\n * import TransportNodeHid from \"@ledgerhq/hw-transport-node-hid\";\n * const transport = await TransportNodeHid.create();\n * const ledgerSigner = new LedgerSigner(transport, \"44'/1729'/0'/0'\", false, DerivationType.ED25519);\n * ```\n *\n * @example\n * ```\n * import TransportU2F from \"@ledgerhq/hw-transport-u2f\";\n * const transport = await TransportU2F.create();\n * const ledgerSigner = new LedgerSigner(transport, \"44'/1729'/0'/0'\", true, DerivationType.SECP256K1);\n * ```\n *\n * @example\n * ```\n * import TransportU2F from \"@ledgerhq/hw-transport-u2f\";\n * const transport = await TransportU2F.create();\n * const ledgerSigner = new LedgerSigner(transport, \"44'/1729'/6'/0'\", true, DerivationType.BIP32_ED25519);\n * ```\n */\nexport class LedgerSigner implements Signer {\n // constants for APDU requests (https://github.com/obsidiansystems/ledger-app-tezos/blob/master/APDUs.md)\n private readonly CLA = 0x80; // Instruction class (always 0x80)\n private readonly INS_GET_PUBLIC_KEY = 0x02; // Instruction code to get the ledger’s internal public key without prompt\n private readonly INS_PROMPT_PUBLIC_KEY = 0x03; // Instruction code to get the ledger’s internal public key with prompt\n private readonly INS_SIGN = 0x04; // Sign a message with the ledger’s key\n private readonly FIRST_MESSAGE_SEQUENCE = 0x00;\n private readonly LAST_MESSAGE_SEQUENCE = 0x81;\n private readonly OTHER_MESSAGE_SEQUENCE = 0x01;\n\n private _publicKey?: string;\n private _publicKeyHash?: string;\n constructor(\n private transport: LedgerTransport,\n private path: string = \"44'/1729'/0'/0'\",\n private prompt: boolean = true,\n private derivationType: DerivationType = DerivationType.ED25519\n ) {\n this.transport.setScrambleKey('XTZ');\n if (!path.startsWith(`44'/1729'`)) {\n throw new InvalidDerivationPathError(\n path,\n `${invalidDetail(ValidationResult.NO_PREFIX_MATCHED)} expecting prefix \"44'/1729'\".`\n );\n }\n if (!Object.values(DerivationType).includes(derivationType)) {\n throw new InvalidDerivationTypeError(derivationType.toString());\n }\n }\n\n async publicKeyHash(): Promise<string> {\n if (!this._publicKeyHash) {\n await this.publicKey();\n }\n if (this._publicKeyHash) {\n return this._publicKeyHash;\n }\n throw new PublicKeyHashRetrievalError();\n }\n\n async publicKey(): Promise<string> {\n if (this._publicKey) {\n return this._publicKey;\n }\n const responseLedger = await this.getLedgerPublicKey();\n const publicKeyLength = responseLedger[0];\n const rawPublicKey = responseLedger.slice(1, 1 + publicKeyLength);\n const compressedPublicKey = compressPublicKey(rawPublicKey, this.derivationType);\n\n const prefixes = this.getPrefixes();\n const publicKey = b58cencode(compressedPublicKey, prefixes.prefPk);\n const publicKeyHash = b58cencode(hash(compressedPublicKey, 20), prefixes.prefPkh);\n\n this._publicKey = publicKey;\n this._publicKeyHash = publicKeyHash;\n return publicKey;\n }\n\n private async getLedgerPublicKey(): Promise<Buffer> {\n try {\n let ins = this.INS_PROMPT_PUBLIC_KEY;\n if (this.prompt === false) {\n ins = this.INS_GET_PUBLIC_KEY;\n }\n const responseLedger = await this.transport.send(\n this.CLA,\n ins,\n this.FIRST_MESSAGE_SEQUENCE,\n this.derivationType,\n transformPathToBuffer(this.path)\n );\n return responseLedger;\n } catch (error) {\n throw new PublicKeyRetrievalError(error);\n }\n }\n\n async secretKey(): Promise<string> {\n throw new ProhibitedActionError('Secret key cannot be exposed');\n }\n\n async sign(bytes: string, watermark?: Uint8Array) {\n const watermarkedBytes = appendWatermark(bytes, watermark);\n const watermarkedBytes2buff = Buffer.from(watermarkedBytes, 'hex');\n let messageToSend = [];\n messageToSend.push(transformPathToBuffer(this.path));\n messageToSend = chunkOperation(messageToSend, watermarkedBytes2buff);\n const ledgerResponse = await this.signWithLedger(messageToSend);\n let signature;\n if (\n this.derivationType === DerivationType.ED25519 ||\n this.derivationType === DerivationType.BIP32_ED25519\n ) {\n signature = ledgerResponse.slice(0, ledgerResponse.length - 2).toString('hex');\n } else {\n if (!validateResponse(ledgerResponse)) {\n throw new InvalidLedgerResponseError(\n 'Invalid signature return by ledger unable to parse the response'\n );\n }\n const idxLengthRVal = 3; // Third element of response is length of r value\n const rValue = extractValue(idxLengthRVal, ledgerResponse);\n const idxLengthSVal = rValue.idxValueStart + rValue.length + 1;\n const sValue = extractValue(idxLengthSVal, ledgerResponse);\n const signatureBuffer = Buffer.concat([rValue.buffer, sValue.buffer]);\n signature = signatureBuffer.toString('hex');\n }\n\n return {\n bytes,\n sig: b58cencode(signature, prefix[Prefix.SIG]),\n prefixSig: b58cencode(signature, this.getPrefixes().prefSig),\n sbytes: bytes + signature,\n };\n }\n\n private async signWithLedger(message: Buffer[]): Promise<Buffer> {\n // first element of the message represents the path\n let ledgerResponse = await this.transport.send(\n this.CLA,\n this.INS_SIGN,\n this.FIRST_MESSAGE_SEQUENCE,\n this.derivationType,\n message[0]\n );\n for (let i = 1; i < message.length; i++) {\n const p1 =\n i === message.length - 1 ? this.LAST_MESSAGE_SEQUENCE : this.OTHER_MESSAGE_SEQUENCE;\n ledgerResponse = await this.transport.send(\n this.CLA,\n this.INS_SIGN,\n p1,\n this.derivationType,\n message[i]\n );\n }\n return ledgerResponse;\n }\n\n private getPrefixes() {\n if (\n this.derivationType === DerivationType.ED25519 ||\n this.derivationType === DerivationType.BIP32_ED25519\n ) {\n return {\n prefPk: prefix[Prefix.EDPK],\n prefPkh: prefix[Prefix.TZ1],\n prefSig: prefix[Prefix.EDSIG],\n };\n } else if (this.derivationType === DerivationType.SECP256K1) {\n return {\n prefPk: prefix[Prefix.SPPK],\n prefPkh: prefix[Prefix.TZ2],\n prefSig: prefix[Prefix.SPSIG],\n };\n } else {\n return {\n prefPk: prefix[Prefix.P2PK],\n prefPkh: prefix[Prefix.TZ3],\n prefSig: prefix[Prefix.P2SIG],\n };\n }\n }\n}\n"],"names":["TaquitoError","ParameterValidationError","DerivationType","InvalidDerivationPathError","invalidDetail","ValidationResult","b58cencode","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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { ParameterValidationError, TaquitoError } from '@taquito/core';
|
|
2
|
-
/**
|
|
3
|
-
* @category Error
|
|
4
|
-
* @description Error that indicates an invalid or unparseable ledger response
|
|
5
|
-
*/
|
|
6
|
-
export declare class InvalidLedgerResponseError extends TaquitoError {
|
|
7
|
-
readonly message: string;
|
|
8
|
-
constructor(message: string);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @category Error
|
|
12
|
-
* @description Error that indicates a failure when trying to retrieve a Public Key from Ledger signer
|
|
13
|
-
*/
|
|
14
|
-
export declare class PublicKeyRetrievalError extends TaquitoError {
|
|
15
|
-
readonly cause: any;
|
|
16
|
-
constructor(cause: any);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* @category Error
|
|
20
|
-
* @description Error that indicates a failure when trying to retrieve a Public Key Hash from Ledger signer
|
|
21
|
-
*/
|
|
22
|
-
export declare class PublicKeyHashRetrievalError extends TaquitoError {
|
|
23
|
-
constructor();
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @category Error
|
|
27
|
-
* @description Error that indicates an invalid derivation type being passed or used
|
|
28
|
-
*/
|
|
29
|
-
export declare class InvalidDerivationTypeError extends ParameterValidationError {
|
|
30
|
-
readonly derivationType: string;
|
|
31
|
-
constructor(derivationType: string);
|
|
32
|
-
}
|
|
1
|
+
import { ParameterValidationError, TaquitoError } from '@taquito/core';
|
|
2
|
+
/**
|
|
3
|
+
* @category Error
|
|
4
|
+
* @description Error that indicates an invalid or unparseable ledger response
|
|
5
|
+
*/
|
|
6
|
+
export declare class InvalidLedgerResponseError extends TaquitoError {
|
|
7
|
+
readonly message: string;
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @category Error
|
|
12
|
+
* @description Error that indicates a failure when trying to retrieve a Public Key from Ledger signer
|
|
13
|
+
*/
|
|
14
|
+
export declare class PublicKeyRetrievalError extends TaquitoError {
|
|
15
|
+
readonly cause: any;
|
|
16
|
+
constructor(cause: any);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @category Error
|
|
20
|
+
* @description Error that indicates a failure when trying to retrieve a Public Key Hash from Ledger signer
|
|
21
|
+
*/
|
|
22
|
+
export declare class PublicKeyHashRetrievalError extends TaquitoError {
|
|
23
|
+
constructor();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @category Error
|
|
27
|
+
* @description Error that indicates an invalid derivation type being passed or used
|
|
28
|
+
*/
|
|
29
|
+
export declare class InvalidDerivationTypeError extends ParameterValidationError {
|
|
30
|
+
readonly derivationType: string;
|
|
31
|
+
constructor(derivationType: string);
|
|
32
|
+
}
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* @module @taquito/ledger-signer
|
|
4
|
-
*/
|
|
5
|
-
import { Signer } from '@taquito/taquito';
|
|
6
|
-
import Transport from '@ledgerhq/hw-transport';
|
|
7
|
-
export { InvalidDerivationPathError } from '@taquito/core';
|
|
8
|
-
export
|
|
9
|
-
export declare enum DerivationType {
|
|
10
|
-
ED25519 = 0,
|
|
11
|
-
SECP256K1 = 1,
|
|
12
|
-
P256 = 2,
|
|
13
|
-
BIP32_ED25519 = 3
|
|
14
|
-
}
|
|
15
|
-
export { InvalidDerivationTypeError } from './errors';
|
|
16
|
-
export declare const HDPathTemplate: (account: number) => string;
|
|
17
|
-
export { VERSION } from './version';
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @description Implementation of the Signer interface that will allow signing operation from a Ledger Nano device
|
|
21
|
-
*
|
|
22
|
-
* @param transport A transport instance from LedgerJS libraries depending on the platform used (e.g. Web, Node)
|
|
23
|
-
* @param path The ledger derivation path (default is "44'/1729'/0'/0'")
|
|
24
|
-
* @param prompt Whether to prompt the ledger for public key (default is true)
|
|
25
|
-
* @param derivationType The value which defines the curve to use (DerivationType.ED25519(default), DerivationType.SECP256K1, DerivationType.P256, DerivationType.BIP32_ED25519)
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```
|
|
29
|
-
* import TransportNodeHid from "@ledgerhq/hw-transport-node-hid";
|
|
30
|
-
* const transport = await TransportNodeHid.create();
|
|
31
|
-
* const ledgerSigner = new LedgerSigner(transport, "44'/1729'/0'/0'", false, DerivationType.ED25519);
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```
|
|
36
|
-
* import TransportU2F from "@ledgerhq/hw-transport-u2f";
|
|
37
|
-
* const transport = await TransportU2F.create();
|
|
38
|
-
* const ledgerSigner = new LedgerSigner(transport, "44'/1729'/0'/0'", true, DerivationType.SECP256K1);
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```
|
|
43
|
-
* import TransportU2F from "@ledgerhq/hw-transport-u2f";
|
|
44
|
-
* const transport = await TransportU2F.create();
|
|
45
|
-
* const ledgerSigner = new LedgerSigner(transport, "44'/1729'/6'/0'", true, DerivationType.BIP32_ED25519);
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
export declare class LedgerSigner implements Signer {
|
|
49
|
-
private transport;
|
|
50
|
-
private path;
|
|
51
|
-
private prompt;
|
|
52
|
-
private derivationType;
|
|
53
|
-
private readonly CLA;
|
|
54
|
-
private readonly INS_GET_PUBLIC_KEY;
|
|
55
|
-
private readonly INS_PROMPT_PUBLIC_KEY;
|
|
56
|
-
private readonly INS_SIGN;
|
|
57
|
-
private readonly FIRST_MESSAGE_SEQUENCE;
|
|
58
|
-
private readonly LAST_MESSAGE_SEQUENCE;
|
|
59
|
-
private readonly OTHER_MESSAGE_SEQUENCE;
|
|
60
|
-
private _publicKey?;
|
|
61
|
-
private _publicKeyHash?;
|
|
62
|
-
constructor(transport: LedgerTransport, path?: string, prompt?: boolean, derivationType?: DerivationType);
|
|
63
|
-
publicKeyHash(): Promise<string>;
|
|
64
|
-
publicKey(): Promise<string>;
|
|
65
|
-
private getLedgerPublicKey;
|
|
66
|
-
secretKey(): Promise<string>;
|
|
67
|
-
sign(bytes: string, watermark?: Uint8Array): Promise<{
|
|
68
|
-
bytes: string;
|
|
69
|
-
sig: string;
|
|
70
|
-
prefixSig: string;
|
|
71
|
-
sbytes: string;
|
|
72
|
-
}>;
|
|
73
|
-
private signWithLedger;
|
|
74
|
-
private getPrefixes;
|
|
75
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module @taquito/ledger-signer
|
|
4
|
+
*/
|
|
5
|
+
import { Signer } from '@taquito/taquito';
|
|
6
|
+
import Transport from '@ledgerhq/hw-transport';
|
|
7
|
+
export { InvalidDerivationPathError } from '@taquito/core';
|
|
8
|
+
export type LedgerTransport = Pick<Transport, 'send' | 'decorateAppAPIMethods' | 'setScrambleKey'>;
|
|
9
|
+
export declare enum DerivationType {
|
|
10
|
+
ED25519 = 0,
|
|
11
|
+
SECP256K1 = 1,
|
|
12
|
+
P256 = 2,
|
|
13
|
+
BIP32_ED25519 = 3
|
|
14
|
+
}
|
|
15
|
+
export { InvalidDerivationTypeError } from './errors';
|
|
16
|
+
export declare const HDPathTemplate: (account: number) => string;
|
|
17
|
+
export { VERSION } from './version';
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @description Implementation of the Signer interface that will allow signing operation from a Ledger Nano device
|
|
21
|
+
*
|
|
22
|
+
* @param transport A transport instance from LedgerJS libraries depending on the platform used (e.g. Web, Node)
|
|
23
|
+
* @param path The ledger derivation path (default is "44'/1729'/0'/0'")
|
|
24
|
+
* @param prompt Whether to prompt the ledger for public key (default is true)
|
|
25
|
+
* @param derivationType The value which defines the curve to use (DerivationType.ED25519(default), DerivationType.SECP256K1, DerivationType.P256, DerivationType.BIP32_ED25519)
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```
|
|
29
|
+
* import TransportNodeHid from "@ledgerhq/hw-transport-node-hid";
|
|
30
|
+
* const transport = await TransportNodeHid.create();
|
|
31
|
+
* const ledgerSigner = new LedgerSigner(transport, "44'/1729'/0'/0'", false, DerivationType.ED25519);
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```
|
|
36
|
+
* import TransportU2F from "@ledgerhq/hw-transport-u2f";
|
|
37
|
+
* const transport = await TransportU2F.create();
|
|
38
|
+
* const ledgerSigner = new LedgerSigner(transport, "44'/1729'/0'/0'", true, DerivationType.SECP256K1);
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```
|
|
43
|
+
* import TransportU2F from "@ledgerhq/hw-transport-u2f";
|
|
44
|
+
* const transport = await TransportU2F.create();
|
|
45
|
+
* const ledgerSigner = new LedgerSigner(transport, "44'/1729'/6'/0'", true, DerivationType.BIP32_ED25519);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare class LedgerSigner implements Signer {
|
|
49
|
+
private transport;
|
|
50
|
+
private path;
|
|
51
|
+
private prompt;
|
|
52
|
+
private derivationType;
|
|
53
|
+
private readonly CLA;
|
|
54
|
+
private readonly INS_GET_PUBLIC_KEY;
|
|
55
|
+
private readonly INS_PROMPT_PUBLIC_KEY;
|
|
56
|
+
private readonly INS_SIGN;
|
|
57
|
+
private readonly FIRST_MESSAGE_SEQUENCE;
|
|
58
|
+
private readonly LAST_MESSAGE_SEQUENCE;
|
|
59
|
+
private readonly OTHER_MESSAGE_SEQUENCE;
|
|
60
|
+
private _publicKey?;
|
|
61
|
+
private _publicKeyHash?;
|
|
62
|
+
constructor(transport: LedgerTransport, path?: string, prompt?: boolean, derivationType?: DerivationType);
|
|
63
|
+
publicKeyHash(): Promise<string>;
|
|
64
|
+
publicKey(): Promise<string>;
|
|
65
|
+
private getLedgerPublicKey;
|
|
66
|
+
secretKey(): Promise<string>;
|
|
67
|
+
sign(bytes: string, watermark?: Uint8Array): Promise<{
|
|
68
|
+
bytes: string;
|
|
69
|
+
sig: string;
|
|
70
|
+
prefixSig: string;
|
|
71
|
+
sbytes: string;
|
|
72
|
+
}>;
|
|
73
|
+
private signWithLedger;
|
|
74
|
+
private getPrefixes;
|
|
75
|
+
}
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { DerivationType } from './taquito-ledger-signer';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @description Convert the path to a buffer that will be used as LC and CDATA in the APDU send to the ledger device (https://github.com/obsidiansystems/ledger-app-tezos/blob/master/APDUs.md)
|
|
6
|
-
*
|
|
7
|
-
* @param path The ledger derivation path (default is "44'/1729'/0'/0'")
|
|
8
|
-
* @returns A buffer where the first element is the length of the path (default is 4), then 3 bytes for each number of the path to which is added 0x8000000
|
|
9
|
-
*/
|
|
10
|
-
export declare function transformPathToBuffer(path: string): Buffer;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @description Converts uncompressed ledger key to standard tezos binary representation
|
|
14
|
-
*/
|
|
15
|
-
export declare function compressPublicKey(publicKey: Buffer, curve: DerivationType): Buffer;
|
|
16
|
-
export declare function appendWatermark(bytes: string, watermark?: Uint8Array): string;
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @description In order not to exceed the data length allowed by the Ledger device, split the operation into buffers of 230 bytes (max) and add them to the message to send to the Ledger
|
|
20
|
-
* @param messageToSend The message to send to the Ledger device
|
|
21
|
-
* @param operation The operation which will be chunk if its length is over 230 bytes
|
|
22
|
-
* @returns The instruction to send to the Ledger device
|
|
23
|
-
*/
|
|
24
|
-
export declare function chunkOperation(messageToSend: any, operation: Buffer): any;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @description Verify if the signature returned by the ledger for tz2 and tz3 is valid
|
|
28
|
-
* @param response The signature returned by the Ledger (return from the signWithLedger function)
|
|
29
|
-
* @returns True if valid, false otherwise
|
|
30
|
-
*/
|
|
31
|
-
export declare function validateResponse(response: Buffer): boolean;
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @description Extract a part of the response returned by the Ledger
|
|
35
|
-
* @param idxLength The index in the response from the Ledger that corresponds to the length of the part to extract
|
|
36
|
-
* @param response The signature returned by the Ledger (return from the signWithLedger function)
|
|
37
|
-
* @returns An object that contains the extracted buffer, the index where it starts in the response and the length of the extracted part
|
|
38
|
-
*/
|
|
39
|
-
export declare function extractValue(idxLength: number, response: Buffer): {
|
|
40
|
-
buffer: Buffer;
|
|
41
|
-
idxValueStart: number;
|
|
42
|
-
length: number;
|
|
43
|
-
};
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { DerivationType } from './taquito-ledger-signer';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @description Convert the path to a buffer that will be used as LC and CDATA in the APDU send to the ledger device (https://github.com/obsidiansystems/ledger-app-tezos/blob/master/APDUs.md)
|
|
6
|
+
*
|
|
7
|
+
* @param path The ledger derivation path (default is "44'/1729'/0'/0'")
|
|
8
|
+
* @returns A buffer where the first element is the length of the path (default is 4), then 3 bytes for each number of the path to which is added 0x8000000
|
|
9
|
+
*/
|
|
10
|
+
export declare function transformPathToBuffer(path: string): Buffer;
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @description Converts uncompressed ledger key to standard tezos binary representation
|
|
14
|
+
*/
|
|
15
|
+
export declare function compressPublicKey(publicKey: Buffer, curve: DerivationType): Buffer;
|
|
16
|
+
export declare function appendWatermark(bytes: string, watermark?: Uint8Array): string;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @description In order not to exceed the data length allowed by the Ledger device, split the operation into buffers of 230 bytes (max) and add them to the message to send to the Ledger
|
|
20
|
+
* @param messageToSend The message to send to the Ledger device
|
|
21
|
+
* @param operation The operation which will be chunk if its length is over 230 bytes
|
|
22
|
+
* @returns The instruction to send to the Ledger device
|
|
23
|
+
*/
|
|
24
|
+
export declare function chunkOperation(messageToSend: any, operation: Buffer): any;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @description Verify if the signature returned by the ledger for tz2 and tz3 is valid
|
|
28
|
+
* @param response The signature returned by the Ledger (return from the signWithLedger function)
|
|
29
|
+
* @returns True if valid, false otherwise
|
|
30
|
+
*/
|
|
31
|
+
export declare function validateResponse(response: Buffer): boolean;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @description Extract a part of the response returned by the Ledger
|
|
35
|
+
* @param idxLength The index in the response from the Ledger that corresponds to the length of the part to extract
|
|
36
|
+
* @param response The signature returned by the Ledger (return from the signWithLedger function)
|
|
37
|
+
* @returns An object that contains the extracted buffer, the index where it starts in the response and the length of the extracted part
|
|
38
|
+
*/
|
|
39
|
+
export declare function extractValue(idxLength: number, response: Buffer): {
|
|
40
|
+
buffer: Buffer;
|
|
41
|
+
idxValueStart: number;
|
|
42
|
+
length: number;
|
|
43
|
+
};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION: {
|
|
2
|
-
commitHash: string;
|
|
3
|
-
version: string;
|
|
4
|
-
};
|
|
1
|
+
export declare const VERSION: {
|
|
2
|
+
commitHash: string;
|
|
3
|
+
version: string;
|
|
4
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/ledger-signer",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.4.0",
|
|
4
4
|
"description": "Ledger signer provider",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tezos",
|
|
@@ -20,22 +20,21 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
23
|
+
"node": ">=18"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"lint": "eslint --ext .js,.ts .",
|
|
27
27
|
"precommit": "lint-staged",
|
|
28
28
|
"prebuild": "rimraf dist",
|
|
29
29
|
"version-stamp": "node ../taquito/version-stamping.js",
|
|
30
|
-
"build": "tsc --project ./tsconfig.prod.json --module commonjs && rollup -c rollup.config.ts ",
|
|
31
|
-
"start": "rollup -c rollup.config.ts -w",
|
|
30
|
+
"build": "tsc --project ./tsconfig.prod.json --module commonjs && rollup -c rollup.config.ts --bundleConfigAsCjs",
|
|
31
|
+
"start": "rollup -c rollup.config.ts --bundleConfigAsCjs -w",
|
|
32
32
|
"test": "jest --coverage"
|
|
33
33
|
},
|
|
34
34
|
"lint-staged": {
|
|
35
35
|
"{src,test}/**/*.ts": [
|
|
36
36
|
"prettier --write",
|
|
37
|
-
"eslint --fix"
|
|
38
|
-
"git add"
|
|
37
|
+
"eslint --fix"
|
|
39
38
|
]
|
|
40
39
|
},
|
|
41
40
|
"jest": {
|
|
@@ -60,39 +59,38 @@
|
|
|
60
59
|
"dependencies": {
|
|
61
60
|
"@ledgerhq/hw-transport": "^6.28.8",
|
|
62
61
|
"@stablelib/blake2b": "^1.0.1",
|
|
63
|
-
"@taquito/core": "^17.
|
|
64
|
-
"@taquito/taquito": "^17.
|
|
65
|
-
"@taquito/utils": "^17.
|
|
62
|
+
"@taquito/core": "^17.4.0",
|
|
63
|
+
"@taquito/taquito": "^17.4.0",
|
|
64
|
+
"@taquito/utils": "^17.4.0",
|
|
66
65
|
"buffer": "^6.0.3"
|
|
67
66
|
},
|
|
68
67
|
"devDependencies": {
|
|
69
|
-
"@types/bluebird": "^3.5.
|
|
70
|
-
"@types/jest": "^
|
|
71
|
-
"@types/node": "^
|
|
72
|
-
"@types/ws": "^8.
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
74
|
-
"@typescript-eslint/parser": "^
|
|
68
|
+
"@types/bluebird": "^3.5.40",
|
|
69
|
+
"@types/jest": "^29.5.5",
|
|
70
|
+
"@types/node": "^20",
|
|
71
|
+
"@types/ws": "^8.5.7",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^6.8.0",
|
|
73
|
+
"@typescript-eslint/parser": "^6.8.0",
|
|
75
74
|
"colors": "^1.4.0",
|
|
76
75
|
"coveralls": "^3.1.1",
|
|
77
76
|
"cross-env": "^7.0.3",
|
|
78
|
-
"eslint": "^8.
|
|
79
|
-
"jest": "^
|
|
80
|
-
"jest-config": "^
|
|
81
|
-
"lint-staged": "^
|
|
77
|
+
"eslint": "^8.51.0",
|
|
78
|
+
"jest": "^29.7.0",
|
|
79
|
+
"jest-config": "^29.7.0",
|
|
80
|
+
"lint-staged": "^14.0.1",
|
|
82
81
|
"lodash.camelcase": "^4.3.0",
|
|
83
|
-
"prettier": "^
|
|
82
|
+
"prettier": "^3.0.3",
|
|
84
83
|
"prompt": "^1.3.0",
|
|
85
|
-
"replace-in-file": "^
|
|
86
|
-
"rimraf": "^
|
|
87
|
-
"rollup": "^
|
|
84
|
+
"replace-in-file": "^7.0.1",
|
|
85
|
+
"rimraf": "^5.0.5",
|
|
86
|
+
"rollup": "^4.1.4",
|
|
88
87
|
"rollup-plugin-json": "^4.0.0",
|
|
89
|
-
"rollup-plugin-
|
|
90
|
-
"rollup-plugin-typescript2": "^0.32.1",
|
|
88
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
91
89
|
"shelljs": "^0.8.5",
|
|
92
|
-
"ts-jest": "^
|
|
93
|
-
"ts-node": "^10.
|
|
90
|
+
"ts-jest": "^29.1.1",
|
|
91
|
+
"ts-node": "^10.9.1",
|
|
94
92
|
"ts-toolbelt": "^9.6.0",
|
|
95
|
-
"typescript": "~
|
|
93
|
+
"typescript": "~5.2.2"
|
|
96
94
|
},
|
|
97
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "f7b158c2c93a38d59a113e0cf541960aa25c961d"
|
|
98
96
|
}
|
package/rollup.config.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import sourceMaps from 'rollup-plugin-sourcemaps';
|
|
2
1
|
import camelCase from 'lodash.camelcase';
|
|
3
2
|
import typescript from 'rollup-plugin-typescript2';
|
|
4
3
|
import json from 'rollup-plugin-json';
|
|
@@ -23,8 +22,5 @@ export default {
|
|
|
23
22
|
json(),
|
|
24
23
|
// Compile TypeScript files
|
|
25
24
|
typescript({ tsconfig: './tsconfig.prod.json', useTsconfigDeclarationDir: true }),
|
|
26
|
-
|
|
27
|
-
// Resolve source maps to the original source
|
|
28
|
-
sourceMaps(),
|
|
29
25
|
],
|
|
30
26
|
};
|
package/signature.json
CHANGED
|
@@ -142,20 +142,19 @@
|
|
|
142
142
|
},
|
|
143
143
|
"license": "MIT",
|
|
144
144
|
"engines": {
|
|
145
|
-
"node": ">=
|
|
145
|
+
"node": ">=18"
|
|
146
146
|
},
|
|
147
147
|
"scripts": {
|
|
148
148
|
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
|
|
149
149
|
"precommit": "lint-staged",
|
|
150
150
|
"prebuild": "rimraf dist",
|
|
151
|
-
"build": "tsc --project ./tsconfig.prod.json --module commonjs && rollup -c rollup.config.ts
|
|
151
|
+
"build": "tsc --project ./tsconfig.prod.json --module commonjs && rollup -c rollup.config.ts",
|
|
152
152
|
"start": "rollup -c rollup.config.ts -w"
|
|
153
153
|
},
|
|
154
154
|
"lint-staged": {
|
|
155
155
|
"{src,test}/**/*.ts": [
|
|
156
156
|
"prettier --write",
|
|
157
|
-
"tslint --fix"
|
|
158
|
-
"git add"
|
|
157
|
+
"tslint --fix"
|
|
159
158
|
]
|
|
160
159
|
},
|
|
161
160
|
"jest": {
|
|
@@ -189,7 +188,7 @@
|
|
|
189
188
|
"@types/jest": "^26.0.16",
|
|
190
189
|
"@types/ledgerhq__hw-transport-node-hid": "^4.22.2",
|
|
191
190
|
"@types/libsodium-wrappers": "^0.7.8",
|
|
192
|
-
"@types/node": "^
|
|
191
|
+
"@types/node": "^18",
|
|
193
192
|
"@types/ws": "^7.4.0",
|
|
194
193
|
"colors": "^1.4.0",
|
|
195
194
|
"coveralls": "^3.1.0",
|
|
@@ -204,7 +203,6 @@
|
|
|
204
203
|
"rimraf": "^3.0.2",
|
|
205
204
|
"rollup": "^2.28.2",
|
|
206
205
|
"rollup-plugin-json": "^4.0.0",
|
|
207
|
-
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
208
206
|
"rollup-plugin-typescript2": "^0.27.3",
|
|
209
207
|
"shelljs": "^0.8.4",
|
|
210
208
|
"ts-jest": "^26.4.4",
|
package/src/version.ts
CHANGED
package/dist/lib/errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAAA,wCAAuE;AAEvE;;;GAGG;AACH,MAAa,0BAA2B,SAAQ,mBAAY;IAC1D,YAA4B,OAAe;QACzC,KAAK,EAAE,CAAC;QADkB,YAAO,GAAP,OAAO,CAAQ;QAEzC,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF;AALD,gEAKC;AAED;;;GAGG;AACH,MAAa,uBAAwB,SAAQ,mBAAY;IACvD,YAA4B,KAAU;QACpC,KAAK,EAAE,CAAC;QADkB,UAAK,GAAL,KAAK,CAAK;QAEpC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,OAAO,G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