@ledgerhq/hw-transport-mocker 6.27.13 → 6.27.14-next.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/CHANGELOG.md +7 -0
- package/lib/MockTransport.d.ts +8 -0
- package/lib/MockTransport.d.ts.map +1 -0
- package/lib/MockTransport.js +17 -0
- package/lib/MockTransport.js.map +1 -0
- package/lib/RecordStore.d.ts +2 -2
- package/lib/RecordStore.d.ts.map +1 -1
- package/lib/RecordStore.js +33 -65
- package/lib/RecordStore.js.map +1 -1
- package/lib/createTransportRecorder.js +25 -74
- package/lib/createTransportRecorder.js.map +1 -1
- package/lib/createTransportReplayer.js +32 -52
- package/lib/createTransportReplayer.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -8
- package/lib/index.js.map +1 -1
- package/lib/openTransportReplayer.js +46 -67
- package/lib/openTransportReplayer.js.map +1 -1
- package/lib-es/MockTransport.d.ts +8 -0
- package/lib-es/MockTransport.d.ts.map +1 -0
- package/lib-es/MockTransport.js +11 -0
- package/lib-es/MockTransport.js.map +1 -0
- package/lib-es/RecordStore.d.ts +2 -2
- package/lib-es/RecordStore.d.ts.map +1 -1
- package/lib-es/RecordStore.js +32 -65
- package/lib-es/RecordStore.js.map +1 -1
- package/lib-es/createTransportRecorder.js +22 -71
- package/lib-es/createTransportRecorder.js.map +1 -1
- package/lib-es/createTransportReplayer.js +28 -48
- package/lib-es/createTransportReplayer.js.map +1 -1
- package/lib-es/index.d.ts +2 -1
- package/lib-es/index.d.ts.map +1 -1
- package/lib-es/index.js +2 -1
- package/lib-es/index.js.map +1 -1
- package/lib-es/openTransportReplayer.js +41 -63
- package/lib-es/openTransportReplayer.js.map +1 -1
- package/package.json +4 -5
- package/src/MockTransport.ts +14 -0
- package/src/RecordStore.ts +4 -4
- package/src/index.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import Transport from "@ledgerhq/hw-transport";
|
|
3
|
+
export default class MockTransport extends Transport {
|
|
4
|
+
private preRecordResponse;
|
|
5
|
+
constructor(preRecordResponse: Buffer);
|
|
6
|
+
exchange(_apdu: Buffer): Promise<Buffer>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=MockTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockTransport.d.ts","sourceRoot":"","sources":["../src/MockTransport.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,SAAS;IAClD,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,iBAAiB,EAAE,MAAM;IAKrC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAGzC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const hw_transport_1 = __importDefault(require("@ledgerhq/hw-transport"));
|
|
7
|
+
class MockTransport extends hw_transport_1.default {
|
|
8
|
+
constructor(preRecordResponse) {
|
|
9
|
+
super();
|
|
10
|
+
this.preRecordResponse = preRecordResponse;
|
|
11
|
+
}
|
|
12
|
+
exchange(_apdu) {
|
|
13
|
+
return Promise.resolve(this.preRecordResponse);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = MockTransport;
|
|
17
|
+
//# sourceMappingURL=MockTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MockTransport.js","sourceRoot":"","sources":["../src/MockTransport.ts"],"names":[],"mappings":";;;;;AAAA,0EAA+C;AAE/C,MAAqB,aAAc,SAAQ,sBAAS;IAGlD,YAAY,iBAAyB;QACnC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACjD,CAAC;CACF;AAXD,gCAWC"}
|
package/lib/RecordStore.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare function RecordStoreRemainingAPDU(expected: string): void;
|
|
|
27
27
|
export declare namespace RecordStoreRemainingAPDU {
|
|
28
28
|
var prototype: Error;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
30
|
+
export type Queue = [string, string][];
|
|
31
31
|
/**
|
|
32
32
|
* - autoSkipUnknownApdu:
|
|
33
33
|
* smart mechanism that would skip an apdu un-recognize to the next one that does
|
|
@@ -36,7 +36,7 @@ export declare type Queue = [string, string][];
|
|
|
36
36
|
* - warning:
|
|
37
37
|
* allows to override the warning function (defaults to console.warn)
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type RecordStoreOptions = {
|
|
40
40
|
autoSkipUnknownApdu: boolean;
|
|
41
41
|
warning: (arg0: string) => void;
|
|
42
42
|
};
|
package/lib/RecordStore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordStore.d.ts","sourceRoot":"","sources":["../src/RecordStore.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,QAIxD;yBAJe,yBAAyB;;;AAQzC;;GAEG;AACH,wBAAgB,qBAAqB,SAIpC;yBAJe,qBAAqB;;;AAQrC;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,QAOb;yBAVe,oBAAoB;;;AAcpC;;GAEG;AACH,wBAAgB,wBAAw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,MAAM,CAAC,UAAU,CACf,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,GACjC,WAAW;CAmCf"}
|
package/lib/RecordStore.js
CHANGED
|
@@ -1,32 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
exports.__esModule = true;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
3
|
exports.RecordStore = exports.RecordStoreRemainingAPDU = exports.RecordStoreWrongAPDU = exports.RecordStoreQueueEmpty = exports.RecordStoreInvalidSynthax = void 0;
|
|
31
4
|
/**
|
|
32
5
|
* thrown by the RecordStore.fromString parser.
|
|
@@ -53,7 +26,7 @@ RecordStoreQueueEmpty.prototype = new Error();
|
|
|
53
26
|
*/
|
|
54
27
|
function RecordStoreWrongAPDU(expected, got, line) {
|
|
55
28
|
this.name = "RecordStoreWrongAPDU";
|
|
56
|
-
this.message =
|
|
29
|
+
this.message = `wrong apdu to replay line ${line}. Expected ${expected}, Got ${got}`;
|
|
57
30
|
this.expectedAPDU = expected;
|
|
58
31
|
this.gotAPDU = got;
|
|
59
32
|
this.stack = new Error().stack;
|
|
@@ -65,48 +38,47 @@ RecordStoreWrongAPDU.prototype = new Error();
|
|
|
65
38
|
*/
|
|
66
39
|
function RecordStoreRemainingAPDU(expected) {
|
|
67
40
|
this.name = "RecordStoreRemainingAPDU";
|
|
68
|
-
this.message =
|
|
41
|
+
this.message = `replay expected more APDUs to come:\n${expected}`;
|
|
69
42
|
this.stack = new Error().stack;
|
|
70
43
|
}
|
|
71
44
|
exports.RecordStoreRemainingAPDU = RecordStoreRemainingAPDU;
|
|
72
45
|
RecordStoreRemainingAPDU.prototype = new Error();
|
|
73
|
-
|
|
46
|
+
const defaultOpts = {
|
|
74
47
|
autoSkipUnknownApdu: false,
|
|
75
|
-
warning:
|
|
48
|
+
warning: (log) => console.warn(log),
|
|
76
49
|
};
|
|
77
50
|
/**
|
|
78
51
|
* a RecordStore is a stateful object that represents a queue of APDUs.
|
|
79
52
|
* It is both used by replayer and recorder transports and is the basic for writing Ledger tests with a mock device.
|
|
80
53
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
var _this = this;
|
|
54
|
+
class RecordStore {
|
|
55
|
+
constructor(queue, opts) {
|
|
84
56
|
this.passed = 0;
|
|
85
57
|
/**
|
|
86
58
|
* check if there is no more APDUs to replay
|
|
87
59
|
*/
|
|
88
|
-
this.isEmpty =
|
|
60
|
+
this.isEmpty = () => this.queue.length === 0;
|
|
89
61
|
this.queue = queue || [];
|
|
90
|
-
this.opts =
|
|
62
|
+
this.opts = Object.assign(Object.assign({}, defaultOpts), opts);
|
|
91
63
|
}
|
|
92
64
|
/**
|
|
93
65
|
* Record an APDU (used by createTransportRecorder)
|
|
94
66
|
* @param {Buffer} apdu input
|
|
95
67
|
* @param {Buffer} out response
|
|
96
68
|
*/
|
|
97
|
-
|
|
69
|
+
recordExchange(apdu, out) {
|
|
98
70
|
this.queue.push([apdu.toString("hex"), out.toString("hex")]);
|
|
99
|
-
}
|
|
71
|
+
}
|
|
100
72
|
/**
|
|
101
73
|
* Replay an APDU (used by createTransportReplayer)
|
|
102
74
|
* @param apdu
|
|
103
75
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
for (
|
|
108
|
-
|
|
109
|
-
|
|
76
|
+
replayExchange(apdu) {
|
|
77
|
+
const { queue, opts } = this;
|
|
78
|
+
const apduHex = apdu.toString("hex");
|
|
79
|
+
for (let i = 0; i < queue.length; i++) {
|
|
80
|
+
const head = queue[i];
|
|
81
|
+
const line = 2 * (this.passed + i);
|
|
110
82
|
if (apduHex === head[0]) {
|
|
111
83
|
++this.passed;
|
|
112
84
|
this.queue = queue.slice(i + 1);
|
|
@@ -128,48 +100,45 @@ var RecordStore = /** @class */ (function () {
|
|
|
128
100
|
}
|
|
129
101
|
this.queue = [];
|
|
130
102
|
throw new RecordStoreQueueEmpty();
|
|
131
|
-
}
|
|
103
|
+
}
|
|
132
104
|
/**
|
|
133
105
|
* Check all APDUs was replayed. Throw if it's not the case.
|
|
134
106
|
*/
|
|
135
|
-
|
|
107
|
+
ensureQueueEmpty() {
|
|
136
108
|
if (!this.isEmpty()) {
|
|
137
109
|
throw new RecordStoreRemainingAPDU(this.toString());
|
|
138
110
|
}
|
|
139
|
-
}
|
|
111
|
+
}
|
|
140
112
|
/**
|
|
141
113
|
* Print out the series of apdus
|
|
142
114
|
*/
|
|
143
|
-
|
|
115
|
+
toString() {
|
|
144
116
|
return (this.queue
|
|
145
|
-
.map(
|
|
146
|
-
var _b = __read(_a, 2), send = _b[0], receive = _b[1];
|
|
147
|
-
return "=> ".concat(send, "\n<= ").concat(receive);
|
|
148
|
-
})
|
|
117
|
+
.map(([send, receive]) => `=> ${send}\n<= ${receive}`)
|
|
149
118
|
.join("\n") + "\n");
|
|
150
|
-
}
|
|
119
|
+
}
|
|
151
120
|
/**
|
|
152
121
|
* Create a RecordStore by parsing a string (a series of => HEX\n<= HEX)
|
|
153
122
|
* @param {string} series of APDUs
|
|
154
123
|
* @param {$Shape<RecordStoreOptions>} opts
|
|
155
124
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
125
|
+
static fromString(str, opts) {
|
|
126
|
+
const queue = [];
|
|
127
|
+
let value = [];
|
|
159
128
|
str
|
|
160
129
|
.split("\n")
|
|
161
|
-
.map(
|
|
162
|
-
.filter(
|
|
163
|
-
.forEach(
|
|
130
|
+
.map((line) => line.replace(/ /g, ""))
|
|
131
|
+
.filter((o) => o)
|
|
132
|
+
.forEach((line) => {
|
|
164
133
|
if (value.length === 0) {
|
|
165
|
-
|
|
134
|
+
const m = line.match(/^=>([0-9a-fA-F]+)$/);
|
|
166
135
|
if (!m) {
|
|
167
136
|
throw new RecordStoreInvalidSynthax("expected an apdu input");
|
|
168
137
|
}
|
|
169
138
|
value.push(m[1]);
|
|
170
139
|
}
|
|
171
140
|
else {
|
|
172
|
-
|
|
141
|
+
const m = line.match(/^<=([0-9a-fA-F]+)$/);
|
|
173
142
|
if (!m) {
|
|
174
143
|
throw new RecordStoreInvalidSynthax("expected an apdu output");
|
|
175
144
|
}
|
|
@@ -182,8 +151,7 @@ var RecordStore = /** @class */ (function () {
|
|
|
182
151
|
throw new RecordStoreInvalidSynthax("unexpected end of file");
|
|
183
152
|
}
|
|
184
153
|
return new RecordStore(queue, opts);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
}());
|
|
154
|
+
}
|
|
155
|
+
}
|
|
188
156
|
exports.RecordStore = RecordStore;
|
|
189
157
|
//# sourceMappingURL=RecordStore.js.map
|
package/lib/RecordStore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordStore.js","sourceRoot":"","sources":["../src/RecordStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,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I,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;aACrC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;aAChB,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAChB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;gBAE3C,IAAI,CAAC,CAAC,EAAE;oBACN,MAAM,IAAI,yBAAyB,CAAC,wBAAwB,CAAC,CAAC;iBAC/D;gBAED,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAClB;iBAAM;gBACL,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;gBAE3C,IAAI,CAAC,CAAC,EAAE;oBACN,MAAM,IAAI,yBAAyB,CAAC,yBAAyB,CAAC,CAAC;iBAChE;gBAED,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjB,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjC,KAAK,GAAG,EAAE,CAAC;aACZ;QACH,CAAC,CAAC,CAAC;QAEL,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,MAAM,IAAI,yBAAyB,CAAC,wBAAwB,CAAC,CAAC;SAC/D;QAED,OAAO,IAAI,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;CACF;AA9HD,kCA8HC"}
|
|
@@ -1,90 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
18
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
|
-
if (!m) return o;
|
|
20
|
-
var i = m.call(o), r, ar = [], e;
|
|
21
|
-
try {
|
|
22
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
23
|
-
}
|
|
24
|
-
catch (error) { e = { error: error }; }
|
|
25
|
-
finally {
|
|
26
|
-
try {
|
|
27
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
28
|
-
}
|
|
29
|
-
finally { if (e) throw e.error; }
|
|
30
|
-
}
|
|
31
|
-
return ar;
|
|
32
|
-
};
|
|
33
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
34
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
35
|
-
if (ar || !(i in from)) {
|
|
36
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
37
|
-
ar[i] = from[i];
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
41
|
-
};
|
|
42
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
43
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
4
|
};
|
|
45
|
-
exports
|
|
46
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const hw_transport_1 = __importDefault(require("@ledgerhq/hw-transport"));
|
|
47
7
|
/**
|
|
48
8
|
* decorate a real transport and proxy it to record the APDUs.
|
|
49
9
|
* @param {Transport} DecoratedTransport: an actual transport class. Like @ledgerhq/hw-transport-webusb
|
|
50
10
|
* @param {RecordStore} recordStore: a record store to record the apdu in.
|
|
51
11
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _this = _super.call(this) || this;
|
|
57
|
-
_this.transport = t;
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
TransportRecorder.prototype.setScrambleKey = function () { };
|
|
61
|
-
TransportRecorder.prototype.close = function () {
|
|
12
|
+
const createTransportRecorder = (DecoratedTransport, recordStore) => {
|
|
13
|
+
class TransportRecorder extends hw_transport_1.default {
|
|
14
|
+
setScrambleKey() { }
|
|
15
|
+
close() {
|
|
62
16
|
return this.transport.close();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
17
|
+
}
|
|
18
|
+
constructor(t) {
|
|
19
|
+
super();
|
|
20
|
+
this.transport = t;
|
|
21
|
+
}
|
|
22
|
+
exchange(apdu) {
|
|
23
|
+
const output = this.transport.exchange(apdu);
|
|
24
|
+
output.then((out) => {
|
|
67
25
|
recordStore.recordExchange(apdu, out);
|
|
68
26
|
});
|
|
69
27
|
return output;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
args[_i - 1] = arguments[_i];
|
|
81
|
-
}
|
|
82
|
-
return (_a = DecoratedTransport.constructor)
|
|
83
|
-
.open.apply(_a, __spreadArray([descriptor], __read(args), false)).then(function (t) { return new TransportRecorder(t); });
|
|
84
|
-
};
|
|
85
|
-
return TransportRecorder;
|
|
86
|
-
}(hw_transport_1["default"]));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
TransportRecorder.recordStore = recordStore;
|
|
31
|
+
TransportRecorder.isSupported = DecoratedTransport.constructor
|
|
32
|
+
.isSupported;
|
|
33
|
+
TransportRecorder.list = DecoratedTransport.constructor.list;
|
|
34
|
+
TransportRecorder.listen = DecoratedTransport.constructor.listen;
|
|
35
|
+
TransportRecorder.open = (descriptor, ...args) => DecoratedTransport.constructor
|
|
36
|
+
.open(descriptor, ...args)
|
|
37
|
+
.then((t) => new TransportRecorder(t));
|
|
87
38
|
return TransportRecorder;
|
|
88
39
|
};
|
|
89
|
-
exports
|
|
40
|
+
exports.default = createTransportRecorder;
|
|
90
41
|
//# sourceMappingURL=createTransportRecorder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTransportRecorder.js","sourceRoot":"","sources":["../src/createTransportRecorder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createTransportRecorder.js","sourceRoot":"","sources":["../src/createTransportRecorder.ts"],"names":[],"mappings":";;;;;AAAA,0EAA+C;AAG/C;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,CAC9B,kBAA6B,EAC7B,WAAwB,EACF,EAAE;IACxB,MAAM,iBAAkB,SAAQ,sBAAS;QAWvC,cAAc,KAAI,CAAC;QAEnB,KAAK;YACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QAChC,CAAC;QAID,YAAY,CAAY;YACtB,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACrB,CAAC;QAED,QAAQ,CAAC,IAAY;YACnB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBAClB,WAAW,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;QAChB,CAAC;;IA7BM,6BAAW,GAAG,WAAW,CAAC;IAC1B,6BAAW,GAAI,kBAAkB,CAAC,WAAgC;SACtE,WAAW,CAAC;IACR,sBAAI,GAAI,kBAAkB,CAAC,WAAgC,CAAC,IAAI,CAAC;IACjE,wBAAM,GAAI,kBAAkB,CAAC,WAAgC,CAAC,MAAM,CAAC;IACrE,sBAAI,GAAG,CAAC,UAAe,EAAE,GAAG,IAAI,EAAE,EAAE,CACxC,kBAAkB,CAAC,WAAgC;SACjD,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC;SACzB,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAwB7C,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
|
|
@@ -1,44 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
4
|
};
|
|
20
|
-
exports
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const hw_transport_1 = __importDefault(require("@ledgerhq/hw-transport"));
|
|
7
|
+
const logs_1 = require("@ledgerhq/logs");
|
|
23
8
|
/**
|
|
24
9
|
* create a transport replayer with a record store.
|
|
25
10
|
* @param recordStore
|
|
26
11
|
*/
|
|
27
|
-
|
|
12
|
+
const createTransportReplayer = (recordStore) => {
|
|
28
13
|
console.warn("TO BE DEPRECATED: use openTransportReplayer instead");
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
33
|
-
}
|
|
34
|
-
TransportReplayer.prototype.setScrambleKey = function () { };
|
|
35
|
-
TransportReplayer.prototype.close = function () {
|
|
14
|
+
class TransportReplayer extends hw_transport_1.default {
|
|
15
|
+
setScrambleKey() { }
|
|
16
|
+
close() {
|
|
36
17
|
return Promise.resolve();
|
|
37
|
-
}
|
|
38
|
-
|
|
18
|
+
}
|
|
19
|
+
exchange(apdu) {
|
|
39
20
|
(0, logs_1.log)("apdu", apdu.toString("hex"));
|
|
40
21
|
try {
|
|
41
|
-
|
|
22
|
+
const buffer = recordStore.replayExchange(apdu);
|
|
42
23
|
(0, logs_1.log)("apdu", buffer.toString("hex"));
|
|
43
24
|
return Promise.resolve(buffer);
|
|
44
25
|
}
|
|
@@ -46,30 +27,29 @@ var createTransportReplayer = function (recordStore) {
|
|
|
46
27
|
(0, logs_1.log)("apdu-error", String(e));
|
|
47
28
|
return Promise.reject(e);
|
|
48
29
|
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
TransportReplayer.isSupported = () => Promise.resolve(true);
|
|
33
|
+
TransportReplayer.list = () => Promise.resolve([null]);
|
|
34
|
+
TransportReplayer.listen = (o) => {
|
|
35
|
+
let unsubscribed;
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
if (unsubscribed)
|
|
38
|
+
return;
|
|
39
|
+
o.next({
|
|
40
|
+
type: "add",
|
|
41
|
+
descriptor: null,
|
|
42
|
+
});
|
|
43
|
+
o.complete();
|
|
44
|
+
}, 0);
|
|
45
|
+
return {
|
|
46
|
+
unsubscribe: () => {
|
|
47
|
+
unsubscribed = true;
|
|
48
|
+
},
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
TransportReplayer.listen = function (o) {
|
|
53
|
-
var unsubscribed;
|
|
54
|
-
setTimeout(function () {
|
|
55
|
-
if (unsubscribed)
|
|
56
|
-
return;
|
|
57
|
-
o.next({
|
|
58
|
-
type: "add",
|
|
59
|
-
descriptor: null
|
|
60
|
-
});
|
|
61
|
-
o.complete();
|
|
62
|
-
}, 0);
|
|
63
|
-
return {
|
|
64
|
-
unsubscribe: function () {
|
|
65
|
-
unsubscribed = true;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
TransportReplayer.open = function () { return Promise.resolve(new TransportReplayer()); };
|
|
70
|
-
return TransportReplayer;
|
|
71
|
-
}(hw_transport_1["default"]));
|
|
50
|
+
};
|
|
51
|
+
TransportReplayer.open = () => Promise.resolve(new TransportReplayer());
|
|
72
52
|
return TransportReplayer;
|
|
73
53
|
};
|
|
74
|
-
exports
|
|
54
|
+
exports.default = createTransportReplayer;
|
|
75
55
|
//# sourceMappingURL=createTransportReplayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTransportReplayer.js","sourceRoot":"","sources":["../src/createTransportReplayer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createTransportReplayer.js","sourceRoot":"","sources":["../src/createTransportReplayer.ts"],"names":[],"mappings":";;;;;AAAA,0EAA+C;AAC/C,yCAAqC;AAGrC;;;GAGG;AACH,MAAM,uBAAuB,GAAG,CAC9B,WAAwB,EACH,EAAE;IACvB,OAAO,CAAC,IAAI,CAAC,qDAA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ACK,sBAAI,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;IAsB/D,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export * from "./RecordStore";
|
|
|
2
2
|
import createTransportReplayer from "./createTransportReplayer";
|
|
3
3
|
import createTransportRecorder from "./createTransportRecorder";
|
|
4
4
|
import openTransportReplayer from "./openTransportReplayer";
|
|
5
|
-
|
|
5
|
+
import MockTransport from "./MockTransport";
|
|
6
|
+
export { createTransportRecorder, createTransportReplayer, openTransportReplayer, MockTransport, };
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,aAAa,GACd,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -16,13 +16,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
|
-
exports
|
|
20
|
-
exports.openTransportReplayer = exports.createTransportReplayer = exports.createTransportRecorder = void 0;
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.MockTransport = exports.openTransportReplayer = exports.createTransportReplayer = exports.createTransportRecorder = void 0;
|
|
21
21
|
__exportStar(require("./RecordStore"), exports);
|
|
22
|
-
|
|
23
|
-
exports.createTransportReplayer = createTransportReplayer_1
|
|
24
|
-
|
|
25
|
-
exports.createTransportRecorder = createTransportRecorder_1
|
|
26
|
-
|
|
27
|
-
exports.openTransportReplayer = openTransportReplayer_1
|
|
22
|
+
const createTransportReplayer_1 = __importDefault(require("./createTransportReplayer"));
|
|
23
|
+
exports.createTransportReplayer = createTransportReplayer_1.default;
|
|
24
|
+
const createTransportRecorder_1 = __importDefault(require("./createTransportRecorder"));
|
|
25
|
+
exports.createTransportRecorder = createTransportRecorder_1.default;
|
|
26
|
+
const openTransportReplayer_1 = __importDefault(require("./openTransportReplayer"));
|
|
27
|
+
exports.openTransportReplayer = openTransportReplayer_1.default;
|
|
28
|
+
const MockTransport_1 = __importDefault(require("./MockTransport"));
|
|
29
|
+
exports.MockTransport = MockTransport_1.default;
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,wFAAgE;AAM9D,kCANK,iCAAuB,CAML;AALzB,wFAAgE;AAI9D,kCAJK,iCAAuB,CAIL;AAHzB,oFAA4D;AAK1D,gCALK,+BAAqB,CAKL;AAJvB,oEAA4C;AAK1C,wBALK,uBAAa,CAKL"}
|