@ledgerhq/hw-app-str 7.0.4 → 7.1.0-nightly.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/.turbo/turbo-build.log +1 -1
- package/.unimportedrc.json +2 -1
- package/CHANGELOG.md +6 -0
- package/jest.config.ts +17 -0
- package/lib/Str.d.ts +1 -0
- package/lib/Str.d.ts.map +1 -1
- package/lib/Str.js +51 -71
- package/lib/Str.js.map +1 -1
- package/lib-es/Str.d.ts +1 -0
- package/lib-es/Str.d.ts.map +1 -1
- package/lib-es/Str.js +51 -71
- package/lib-es/Str.js.map +1 -1
- package/package.json +8 -5
package/.turbo/turbo-build.log
CHANGED
package/.unimportedrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ledgerhq/hw-app-str
|
|
2
2
|
|
|
3
|
+
## 7.1.0-nightly.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#9298](https://github.com/LedgerHQ/ledger-live/pull/9298) [`2785d49`](https://github.com/LedgerHQ/ledger-live/commit/2785d49ac320498f98ed39b4eccc48310ad35fe1) Thanks [@Canestin](https://github.com/Canestin)! - config coin-integration env for sonarqube
|
|
8
|
+
|
|
3
9
|
## 7.0.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/jest.config.ts
CHANGED
|
@@ -3,4 +3,21 @@ import baseConfig from "../../jest.config";
|
|
|
3
3
|
export default {
|
|
4
4
|
...baseConfig,
|
|
5
5
|
rootDir: __dirname,
|
|
6
|
+
collectCoverageFrom: [
|
|
7
|
+
"src/**/*.ts",
|
|
8
|
+
"!src/**/*.test.{ts,tsx}",
|
|
9
|
+
"!src/**/*.spec.{ts,tsx}",
|
|
10
|
+
"!src/**/__tests__/**",
|
|
11
|
+
"!tests/**",
|
|
12
|
+
],
|
|
13
|
+
coverageReporters: ["json", ["lcov", { projectRoot: "../" }], "json-summary", "text"],
|
|
14
|
+
reporters: [
|
|
15
|
+
[
|
|
16
|
+
"jest-sonar",
|
|
17
|
+
{
|
|
18
|
+
outputName: "hw-app-str-sonar-executionTests-report.xml",
|
|
19
|
+
reportedFilePath: "absolute",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
],
|
|
6
23
|
};
|
package/lib/Str.d.ts
CHANGED
package/lib/Str.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Str.d.ts","sourceRoot":"","sources":["../src/Str.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Str.d.ts","sourceRoot":"","sources":["../src/Str.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AA8BpD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,GAAG;IACtB,OAAO,CAAC,SAAS,CAAY;gBAEjB,SAAS,EAAE,SAAS,EAAE,WAAW,SAAQ;IAerD;;;;;;;OAOG;IACG,mBAAmB,IAAI,OAAO,CAAC;QACnC,OAAO,EAAE,MAAM,CAAC;QAChB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAUF;;;;;;;;;OASG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAWpF;;;;;;;;OAQG;IACG,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QACT,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAOF;;;;;;;;OAQG;IACG,wBAAwB,CAC5B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC;QACT,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAOF;;;;;;;;OAQG;IACG,QAAQ,CACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;QACT,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;YAOY,YAAY;CAsB3B;AA8CD,cAAc,UAAU,CAAC"}
|
package/lib/Str.js
CHANGED
|
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
18
|
};
|
|
@@ -56,6 +47,7 @@ const SW_DATA_PARSING_FAIL = 0xb005;
|
|
|
56
47
|
* const str = new Str(transport)
|
|
57
48
|
*/
|
|
58
49
|
class Str {
|
|
50
|
+
transport;
|
|
59
51
|
constructor(transport, scrambleKey = "l0v") {
|
|
60
52
|
this.transport = transport;
|
|
61
53
|
transport.decorateAppAPIMethods(this, [
|
|
@@ -74,16 +66,14 @@ class Str {
|
|
|
74
66
|
* @example
|
|
75
67
|
* str.getAppConfiguration().then(o => o.version)
|
|
76
68
|
*/
|
|
77
|
-
getAppConfiguration() {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
};
|
|
86
|
-
});
|
|
69
|
+
async getAppConfiguration() {
|
|
70
|
+
const resp = await this.sendToDevice(INS_GET_CONF, Buffer.alloc(0));
|
|
71
|
+
const [hashSigningEnabled, major, minor, patch, maxDataSizeHi, maxDataSizeLo] = resp;
|
|
72
|
+
return {
|
|
73
|
+
hashSigningEnabled: hashSigningEnabled === 0x01,
|
|
74
|
+
version: `${major}.${minor}.${patch}`,
|
|
75
|
+
maxDataSize: resp.length > 4 ? (maxDataSizeHi << 8) | maxDataSizeLo : undefined, // For compatibility with older app, let's remove this in the future
|
|
76
|
+
};
|
|
87
77
|
}
|
|
88
78
|
/**
|
|
89
79
|
* Get Stellar raw public key for a given BIP 32 path.
|
|
@@ -95,18 +85,16 @@ class Str {
|
|
|
95
85
|
* @example
|
|
96
86
|
* str.getPublicKey("44'/148'/0'").then(o => o.rawPublicKey)
|
|
97
87
|
*/
|
|
98
|
-
getPublicKey(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
});
|
|
88
|
+
async getPublicKey(path, display = false) {
|
|
89
|
+
const pathBuffer = pathToBuffer(path);
|
|
90
|
+
const p2 = display ? P2_CONFIRM : P2_NON_CONFIRM;
|
|
91
|
+
try {
|
|
92
|
+
const data = await this.transport.send(CLA, INS_GET_PK, P1_FIRST, p2, pathBuffer);
|
|
93
|
+
return { rawPublicKey: data.slice(0, -2) };
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
throw remapErrors(e);
|
|
97
|
+
}
|
|
110
98
|
}
|
|
111
99
|
/**
|
|
112
100
|
* Sign a Stellar transaction.
|
|
@@ -117,13 +105,11 @@ class Str {
|
|
|
117
105
|
* @example
|
|
118
106
|
* str.signTransaction("44'/148'/0'", signatureBase).then(o => o.signature)
|
|
119
107
|
*/
|
|
120
|
-
signTransaction(path, transaction) {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return { signature: resp };
|
|
126
|
-
});
|
|
108
|
+
async signTransaction(path, transaction) {
|
|
109
|
+
const pathBuffer = pathToBuffer(path);
|
|
110
|
+
const payload = Buffer.concat([pathBuffer, transaction]);
|
|
111
|
+
const resp = await this.sendToDevice(INS_SIGN_TX, payload);
|
|
112
|
+
return { signature: resp };
|
|
127
113
|
}
|
|
128
114
|
/**
|
|
129
115
|
* Sign a Stellar Soroban authorization.
|
|
@@ -134,13 +120,11 @@ class Str {
|
|
|
134
120
|
* @example
|
|
135
121
|
* str.signSorobanAuthorization("44'/148'/0'", hashIdPreimage).then(o => o.signature)
|
|
136
122
|
*/
|
|
137
|
-
signSorobanAuthorization(path, hashIdPreimage) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return { signature: resp };
|
|
143
|
-
});
|
|
123
|
+
async signSorobanAuthorization(path, hashIdPreimage) {
|
|
124
|
+
const pathBuffer = pathToBuffer(path);
|
|
125
|
+
const payload = Buffer.concat([pathBuffer, hashIdPreimage]);
|
|
126
|
+
const resp = await this.sendToDevice(INS_SIGN_SOROBAN_AUTHORIZATION, payload);
|
|
127
|
+
return { signature: resp };
|
|
144
128
|
}
|
|
145
129
|
/**
|
|
146
130
|
* Sign a hash.
|
|
@@ -151,34 +135,30 @@ class Str {
|
|
|
151
135
|
* @example
|
|
152
136
|
* str.signHash("44'/148'/0'", hash).then(o => o.signature)
|
|
153
137
|
*/
|
|
154
|
-
signHash(path, hash) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
return { signature: resp };
|
|
160
|
-
});
|
|
138
|
+
async signHash(path, hash) {
|
|
139
|
+
const pathBuffer = pathToBuffer(path);
|
|
140
|
+
const payload = Buffer.concat([pathBuffer, hash]);
|
|
141
|
+
const resp = await this.sendToDevice(INS_SIGN_HASH, payload);
|
|
142
|
+
return { signature: resp };
|
|
161
143
|
}
|
|
162
|
-
sendToDevice(instruction, payload) {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
144
|
+
async sendToDevice(instruction, payload) {
|
|
145
|
+
let response = Buffer.alloc(0);
|
|
146
|
+
let remaining = payload.length;
|
|
147
|
+
// eslint-disable-next-line no-constant-condition
|
|
148
|
+
while (true) {
|
|
149
|
+
const chunkSize = remaining > APDU_MAX_PAYLOAD ? APDU_MAX_PAYLOAD : remaining;
|
|
150
|
+
const p1 = remaining === payload.length ? P1_FIRST : P1_MORE;
|
|
151
|
+
const p2 = remaining - chunkSize === 0 ? P2_LAST : P2_MORE;
|
|
152
|
+
const chunk = payload.slice(payload.length - remaining, payload.length - remaining + chunkSize);
|
|
153
|
+
response = await this.transport.send(CLA, instruction, p1, p2, chunk).catch(e => {
|
|
154
|
+
throw remapErrors(e);
|
|
155
|
+
});
|
|
156
|
+
remaining -= chunkSize;
|
|
157
|
+
if (remaining === 0) {
|
|
158
|
+
break;
|
|
179
159
|
}
|
|
180
|
-
|
|
181
|
-
|
|
160
|
+
}
|
|
161
|
+
return response.slice(0, -2);
|
|
182
162
|
}
|
|
183
163
|
}
|
|
184
164
|
exports.default = Str;
|
package/lib/Str.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Str.js","sourceRoot":"","sources":["../src/Str.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Str.js","sourceRoot":"","sources":["../src/Str.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;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CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,YAAoB,EAAE,EAAE;IAC5C,MAAM,IAAI,GAAG,YAAY;SACtB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;SAChF,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,MAAM,QAAQ,GAAa,oBAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;IAClE,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,IAAc,EAAE,EAAE;IACvC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/B,KAAK,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QACtC,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,2CAAyB"}
|
package/lib-es/Str.d.ts
CHANGED
package/lib-es/Str.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Str.d.ts","sourceRoot":"","sources":["../src/Str.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Str.d.ts","sourceRoot":"","sources":["../src/Str.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;kFAekF;AAClF,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AA8BpD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,GAAG;IACtB,OAAO,CAAC,SAAS,CAAY;gBAEjB,SAAS,EAAE,SAAS,EAAE,WAAW,SAAQ;IAerD;;;;;;;OAOG;IACG,mBAAmB,IAAI,OAAO,CAAC;QACnC,OAAO,EAAE,MAAM,CAAC;QAChB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IAUF;;;;;;;;;OASG;IACG,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAWpF;;;;;;;;OAQG;IACG,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;QACT,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAOF;;;;;;;;OAQG;IACG,wBAAwB,CAC5B,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC;QACT,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAOF;;;;;;;;OAQG;IACG,QAAQ,CACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;QACT,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;YAOY,YAAY;CAsB3B;AA8CD,cAAc,UAAU,CAAC"}
|
package/lib-es/Str.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import BIPPath from "bip32-path";
|
|
11
2
|
import { StellarHashSigningNotEnabledError, StellarDataParsingFailedError, StellarUserRefusedError, StellarDataTooLargeError, } from "./errors";
|
|
12
3
|
const CLA = 0xe0;
|
|
@@ -37,6 +28,7 @@ const SW_DATA_PARSING_FAIL = 0xb005;
|
|
|
37
28
|
* const str = new Str(transport)
|
|
38
29
|
*/
|
|
39
30
|
export default class Str {
|
|
31
|
+
transport;
|
|
40
32
|
constructor(transport, scrambleKey = "l0v") {
|
|
41
33
|
this.transport = transport;
|
|
42
34
|
transport.decorateAppAPIMethods(this, [
|
|
@@ -55,16 +47,14 @@ export default class Str {
|
|
|
55
47
|
* @example
|
|
56
48
|
* str.getAppConfiguration().then(o => o.version)
|
|
57
49
|
*/
|
|
58
|
-
getAppConfiguration() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
});
|
|
50
|
+
async getAppConfiguration() {
|
|
51
|
+
const resp = await this.sendToDevice(INS_GET_CONF, Buffer.alloc(0));
|
|
52
|
+
const [hashSigningEnabled, major, minor, patch, maxDataSizeHi, maxDataSizeLo] = resp;
|
|
53
|
+
return {
|
|
54
|
+
hashSigningEnabled: hashSigningEnabled === 0x01,
|
|
55
|
+
version: `${major}.${minor}.${patch}`,
|
|
56
|
+
maxDataSize: resp.length > 4 ? (maxDataSizeHi << 8) | maxDataSizeLo : undefined, // For compatibility with older app, let's remove this in the future
|
|
57
|
+
};
|
|
68
58
|
}
|
|
69
59
|
/**
|
|
70
60
|
* Get Stellar raw public key for a given BIP 32 path.
|
|
@@ -76,18 +66,16 @@ export default class Str {
|
|
|
76
66
|
* @example
|
|
77
67
|
* str.getPublicKey("44'/148'/0'").then(o => o.rawPublicKey)
|
|
78
68
|
*/
|
|
79
|
-
getPublicKey(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
});
|
|
69
|
+
async getPublicKey(path, display = false) {
|
|
70
|
+
const pathBuffer = pathToBuffer(path);
|
|
71
|
+
const p2 = display ? P2_CONFIRM : P2_NON_CONFIRM;
|
|
72
|
+
try {
|
|
73
|
+
const data = await this.transport.send(CLA, INS_GET_PK, P1_FIRST, p2, pathBuffer);
|
|
74
|
+
return { rawPublicKey: data.slice(0, -2) };
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
throw remapErrors(e);
|
|
78
|
+
}
|
|
91
79
|
}
|
|
92
80
|
/**
|
|
93
81
|
* Sign a Stellar transaction.
|
|
@@ -98,13 +86,11 @@ export default class Str {
|
|
|
98
86
|
* @example
|
|
99
87
|
* str.signTransaction("44'/148'/0'", signatureBase).then(o => o.signature)
|
|
100
88
|
*/
|
|
101
|
-
signTransaction(path, transaction) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return { signature: resp };
|
|
107
|
-
});
|
|
89
|
+
async signTransaction(path, transaction) {
|
|
90
|
+
const pathBuffer = pathToBuffer(path);
|
|
91
|
+
const payload = Buffer.concat([pathBuffer, transaction]);
|
|
92
|
+
const resp = await this.sendToDevice(INS_SIGN_TX, payload);
|
|
93
|
+
return { signature: resp };
|
|
108
94
|
}
|
|
109
95
|
/**
|
|
110
96
|
* Sign a Stellar Soroban authorization.
|
|
@@ -115,13 +101,11 @@ export default class Str {
|
|
|
115
101
|
* @example
|
|
116
102
|
* str.signSorobanAuthorization("44'/148'/0'", hashIdPreimage).then(o => o.signature)
|
|
117
103
|
*/
|
|
118
|
-
signSorobanAuthorization(path, hashIdPreimage) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return { signature: resp };
|
|
124
|
-
});
|
|
104
|
+
async signSorobanAuthorization(path, hashIdPreimage) {
|
|
105
|
+
const pathBuffer = pathToBuffer(path);
|
|
106
|
+
const payload = Buffer.concat([pathBuffer, hashIdPreimage]);
|
|
107
|
+
const resp = await this.sendToDevice(INS_SIGN_SOROBAN_AUTHORIZATION, payload);
|
|
108
|
+
return { signature: resp };
|
|
125
109
|
}
|
|
126
110
|
/**
|
|
127
111
|
* Sign a hash.
|
|
@@ -132,34 +116,30 @@ export default class Str {
|
|
|
132
116
|
* @example
|
|
133
117
|
* str.signHash("44'/148'/0'", hash).then(o => o.signature)
|
|
134
118
|
*/
|
|
135
|
-
signHash(path, hash) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return { signature: resp };
|
|
141
|
-
});
|
|
119
|
+
async signHash(path, hash) {
|
|
120
|
+
const pathBuffer = pathToBuffer(path);
|
|
121
|
+
const payload = Buffer.concat([pathBuffer, hash]);
|
|
122
|
+
const resp = await this.sendToDevice(INS_SIGN_HASH, payload);
|
|
123
|
+
return { signature: resp };
|
|
142
124
|
}
|
|
143
|
-
sendToDevice(instruction, payload) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
125
|
+
async sendToDevice(instruction, payload) {
|
|
126
|
+
let response = Buffer.alloc(0);
|
|
127
|
+
let remaining = payload.length;
|
|
128
|
+
// eslint-disable-next-line no-constant-condition
|
|
129
|
+
while (true) {
|
|
130
|
+
const chunkSize = remaining > APDU_MAX_PAYLOAD ? APDU_MAX_PAYLOAD : remaining;
|
|
131
|
+
const p1 = remaining === payload.length ? P1_FIRST : P1_MORE;
|
|
132
|
+
const p2 = remaining - chunkSize === 0 ? P2_LAST : P2_MORE;
|
|
133
|
+
const chunk = payload.slice(payload.length - remaining, payload.length - remaining + chunkSize);
|
|
134
|
+
response = await this.transport.send(CLA, instruction, p1, p2, chunk).catch(e => {
|
|
135
|
+
throw remapErrors(e);
|
|
136
|
+
});
|
|
137
|
+
remaining -= chunkSize;
|
|
138
|
+
if (remaining === 0) {
|
|
139
|
+
break;
|
|
160
140
|
}
|
|
161
|
-
|
|
162
|
-
|
|
141
|
+
}
|
|
142
|
+
return response.slice(0, -2);
|
|
163
143
|
}
|
|
164
144
|
}
|
|
165
145
|
const remapErrors = e => {
|
package/lib-es/Str.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Str.js","sourceRoot":"","sources":["../src/Str.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Str.js","sourceRoot":"","sources":["../src/Str.ts"],"names":[],"mappings":"AAiBA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EACL,iCAAiC,EACjC,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAElB,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,QAAQ,GAAG,IAAI,CAAC;AACtB,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,mBAAmB;AAChD,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,mBAAmB;AAE5C,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,aAAa,GAAG,IAAI,C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WAAW,EAAE,CAAC;IAClE,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,IAAc,EAAE,EAAE;IACvC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9C,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/B,KAAK,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QACtC,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,cAAc,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/hw-app-str",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.1.0-nightly.0",
|
|
4
4
|
"description": "Ledger Hardware Wallet Stellar Application API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -28,26 +28,29 @@
|
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"bip32-path": "^0.4.2",
|
|
31
|
-
"@ledgerhq/
|
|
32
|
-
"@ledgerhq/
|
|
31
|
+
"@ledgerhq/errors": "^6.19.1",
|
|
32
|
+
"@ledgerhq/hw-transport": "^6.31.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/jest": "^29.5.10",
|
|
36
|
-
"@types/node": "^
|
|
36
|
+
"@types/node": "^22.10.10",
|
|
37
37
|
"documentation": "14.0.2",
|
|
38
38
|
"jest": "^29.7.0",
|
|
39
39
|
"rimraf": "^4.4.1",
|
|
40
40
|
"source-map-support": "^0.5.21",
|
|
41
41
|
"ts-jest": "^29.1.1",
|
|
42
42
|
"ts-node": "^10.4.0",
|
|
43
|
+
"jest-sonar": "0.2.16",
|
|
43
44
|
"@ledgerhq/hw-transport-mocker": "^6.29.4"
|
|
44
45
|
},
|
|
45
46
|
"gitHead": "dd0dea64b58e5a9125c8a422dcffd29e5ef6abec",
|
|
46
47
|
"scripts": {
|
|
47
48
|
"clean": "rimraf lib lib-es",
|
|
48
|
-
"build": "tsc && tsc -m
|
|
49
|
+
"build": "tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es",
|
|
50
|
+
"coverage": "jest --coverage --passWithNoTests && mv coverage/coverage-final.json coverage/coverage-hw-app-str.json && mv coverage/lcov.info coverage/hw-app-str-lcov.info",
|
|
49
51
|
"prewatch": "pnpm build",
|
|
50
52
|
"watch": "tsc --watch",
|
|
53
|
+
"watch:es": "tsc --watch -m esnext --moduleResolution bundler --outDir lib-es",
|
|
51
54
|
"doc": "documentation readme src/** --section=API --pe ts --re ts --re d.ts",
|
|
52
55
|
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx --cache",
|
|
53
56
|
"lint:fix": "pnpm lint --fix",
|