@taquito/ledger-signer 24.3.0-beta.4 → 24.3.0-beta.6
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/taquito-ledger-signer.js +3 -2
- package/dist/lib/utils.js +5 -4
- package/dist/lib/version.js +2 -2
- package/dist/taquito-ledger-signer.es6.js +2379 -8
- package/dist/taquito-ledger-signer.es6.js.map +1 -1
- package/dist/taquito-ledger-signer.umd.js +2379 -8
- package/dist/taquito-ledger-signer.umd.js.map +1 -1
- package/dist/types/utils.d.ts +1 -0
- package/package.json +5 -4
- package/rollup.config.ts +6 -1
- package/src/taquito-ledger-signer.ts +1 -0
- package/src/utils.ts +1 -0
- package/src/version.ts +2 -2
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LedgerSigner = exports.VERSION = exports.HDPathTemplate = exports.InvalidDerivationTypeError = exports.DerivationType = exports.InvalidDerivationPathError = void 0;
|
|
8
|
+
const buffer_1 = require("buffer");
|
|
8
9
|
const utils_1 = require("@taquito/utils");
|
|
9
10
|
const utils_2 = require("./utils");
|
|
10
11
|
const blake2_js_1 = require("@noble/hashes/blake2.js");
|
|
@@ -121,7 +122,7 @@ class LedgerSigner {
|
|
|
121
122
|
}
|
|
122
123
|
async sign(bytes, watermark) {
|
|
123
124
|
const watermarkedBytes = (0, utils_2.appendWatermark)(bytes, watermark);
|
|
124
|
-
const watermarkedBytes2buff = Buffer.from(watermarkedBytes, 'hex');
|
|
125
|
+
const watermarkedBytes2buff = buffer_1.Buffer.from(watermarkedBytes, 'hex');
|
|
125
126
|
let messageToSend = [];
|
|
126
127
|
messageToSend.push((0, utils_2.transformPathToBuffer)(this.path));
|
|
127
128
|
messageToSend = (0, utils_2.chunkOperation)(messageToSend, watermarkedBytes2buff);
|
|
@@ -139,7 +140,7 @@ class LedgerSigner {
|
|
|
139
140
|
const rValue = (0, utils_2.extractValue)(idxLengthRVal, ledgerResponse);
|
|
140
141
|
const idxLengthSVal = rValue.idxValueStart + rValue.length + 1;
|
|
141
142
|
const sValue = (0, utils_2.extractValue)(idxLengthSVal, ledgerResponse);
|
|
142
|
-
const signatureBuffer = Buffer.concat([rValue.buffer, sValue.buffer]);
|
|
143
|
+
const signatureBuffer = buffer_1.Buffer.concat([rValue.buffer, sValue.buffer]);
|
|
143
144
|
signature = signatureBuffer.toString('hex');
|
|
144
145
|
}
|
|
145
146
|
return {
|
package/dist/lib/utils.js
CHANGED
|
@@ -10,6 +10,7 @@ exports.appendWatermark = appendWatermark;
|
|
|
10
10
|
exports.chunkOperation = chunkOperation;
|
|
11
11
|
exports.validateResponse = validateResponse;
|
|
12
12
|
exports.extractValue = extractValue;
|
|
13
|
+
const buffer_1 = require("buffer");
|
|
13
14
|
const MAX_CHUNK_SIZE = 230;
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
@@ -31,7 +32,7 @@ function transformPathToBuffer(path) {
|
|
|
31
32
|
}
|
|
32
33
|
result.push(toNumber);
|
|
33
34
|
});
|
|
34
|
-
const buffer = Buffer.alloc(1 + result.length * 4);
|
|
35
|
+
const buffer = buffer_1.Buffer.alloc(1 + result.length * 4);
|
|
35
36
|
buffer[0] = result.length;
|
|
36
37
|
result.forEach((element, index) => {
|
|
37
38
|
buffer.writeUInt32BE(element, 1 + 4 * index);
|
|
@@ -55,7 +56,7 @@ function compressPublicKey(publicKey, curve) {
|
|
|
55
56
|
function appendWatermark(bytes, watermark) {
|
|
56
57
|
let transactionHex = bytes;
|
|
57
58
|
if (typeof watermark !== 'undefined') {
|
|
58
|
-
const hexWatermark = Buffer.from(watermark).toString('hex');
|
|
59
|
+
const hexWatermark = buffer_1.Buffer.from(watermark).toString('hex');
|
|
59
60
|
transactionHex = hexWatermark.concat(bytes);
|
|
60
61
|
}
|
|
61
62
|
return transactionHex;
|
|
@@ -71,7 +72,7 @@ function chunkOperation(messageToSend, operation) {
|
|
|
71
72
|
let offset = 0;
|
|
72
73
|
while (offset !== operation.length) {
|
|
73
74
|
const chunkSize = offset + MAX_CHUNK_SIZE >= operation.length ? operation.length - offset : MAX_CHUNK_SIZE;
|
|
74
|
-
const buff = Buffer.alloc(chunkSize);
|
|
75
|
+
const buff = buffer_1.Buffer.alloc(chunkSize);
|
|
75
76
|
operation.copy(buff, 0, offset, offset + chunkSize);
|
|
76
77
|
messageToSend.push(buff);
|
|
77
78
|
offset += chunkSize;
|
|
@@ -114,7 +115,7 @@ function validateResponse(response) {
|
|
|
114
115
|
* @returns An object that contains the extracted buffer, the index where it starts in the response and the length of the extracted part
|
|
115
116
|
*/
|
|
116
117
|
function extractValue(idxLength, response) {
|
|
117
|
-
const buffer = Buffer.alloc(32);
|
|
118
|
+
const buffer = buffer_1.Buffer.alloc(32);
|
|
118
119
|
buffer.fill(0);
|
|
119
120
|
let length = response[idxLength];
|
|
120
121
|
let idxValueStart = idxLength + 1;
|
package/dist/lib/version.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT!
|
|
5
5
|
exports.VERSION = {
|
|
6
|
-
"commitHash": "
|
|
7
|
-
"version": "24.3.0-beta.
|
|
6
|
+
"commitHash": "3d5ea7e96f2c88d3bb96cae59beb95808c6eaa17",
|
|
7
|
+
"version": "24.3.0-beta.6"
|
|
8
8
|
};
|