@ledgerhq/hw-transport 6.9.1-taproot.0 → 6.19.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/README.md +66 -66
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -13,40 +13,40 @@
|
|
|
13
13
|
|
|
14
14
|
#### Table of Contents
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
16
|
+
* [Subscription](#subscription)
|
|
17
|
+
* [Properties](#properties)
|
|
18
|
+
* [Device](#device)
|
|
19
|
+
* [DescriptorEvent](#descriptorevent)
|
|
20
|
+
* [Observer](#observer)
|
|
21
|
+
* [Transport](#transport)
|
|
22
|
+
* [exchange](#exchange)
|
|
23
|
+
* [Parameters](#parameters)
|
|
24
|
+
* [setScrambleKey](#setscramblekey)
|
|
25
|
+
* [Parameters](#parameters-1)
|
|
26
|
+
* [close](#close)
|
|
27
|
+
* [on](#on)
|
|
28
|
+
* [Parameters](#parameters-2)
|
|
29
|
+
* [off](#off)
|
|
30
|
+
* [Parameters](#parameters-3)
|
|
31
|
+
* [setDebugMode](#setdebugmode)
|
|
32
|
+
* [setExchangeTimeout](#setexchangetimeout)
|
|
33
|
+
* [Parameters](#parameters-4)
|
|
34
|
+
* [setExchangeUnresponsiveTimeout](#setexchangeunresponsivetimeout)
|
|
35
|
+
* [Parameters](#parameters-5)
|
|
36
|
+
* [send](#send)
|
|
37
|
+
* [Parameters](#parameters-6)
|
|
38
|
+
* [isSupported](#issupported)
|
|
39
|
+
* [list](#list)
|
|
40
|
+
* [Examples](#examples)
|
|
41
|
+
* [listen](#listen)
|
|
42
|
+
* [Parameters](#parameters-7)
|
|
43
|
+
* [Examples](#examples-1)
|
|
44
|
+
* [open](#open)
|
|
45
|
+
* [Parameters](#parameters-8)
|
|
46
|
+
* [Examples](#examples-2)
|
|
47
|
+
* [create](#create)
|
|
48
|
+
* [Parameters](#parameters-9)
|
|
49
|
+
* [Examples](#examples-3)
|
|
50
50
|
|
|
51
51
|
### Subscription
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ Type: {unsubscribe: function (): void}
|
|
|
54
54
|
|
|
55
55
|
#### Properties
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
* `unsubscribe` **function (): void**
|
|
58
58
|
|
|
59
59
|
### Device
|
|
60
60
|
|
|
@@ -69,7 +69,7 @@ device: transport specific device info
|
|
|
69
69
|
|
|
70
70
|
### Observer
|
|
71
71
|
|
|
72
|
-
Type: Readonly
|
|
72
|
+
Type: Readonly<{next: function (event: Ev): any, error: function (e: any): any, complete: function (): any}>
|
|
73
73
|
|
|
74
74
|
### Transport
|
|
75
75
|
|
|
@@ -85,10 +85,10 @@ Instead, the recommanded way is to use send() method
|
|
|
85
85
|
|
|
86
86
|
##### Parameters
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
* `_apdu` **[Buffer](https://nodejs.org/api/buffer.html)**
|
|
89
|
+
* `apdu` the data to send
|
|
90
90
|
|
|
91
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
91
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Buffer](https://nodejs.org/api/buffer.html)>** a Promise of response data
|
|
92
92
|
|
|
93
93
|
#### setScrambleKey
|
|
94
94
|
|
|
@@ -97,26 +97,26 @@ Each App can have a different scramble key and they internally will set it at in
|
|
|
97
97
|
|
|
98
98
|
##### Parameters
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
* `_key` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
101
|
+
* `key` the scramble key
|
|
102
102
|
|
|
103
103
|
#### close
|
|
104
104
|
|
|
105
105
|
close the exchange with the device.
|
|
106
106
|
|
|
107
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
107
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<void>** a Promise that ends when the transport is closed.
|
|
108
108
|
|
|
109
109
|
#### on
|
|
110
110
|
|
|
111
111
|
Listen to an event on an instance of transport.
|
|
112
112
|
Transport implementation can have specific events. Here is the common events:
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
* `"disconnect"` : triggered if Transport is disconnected
|
|
115
115
|
|
|
116
116
|
##### Parameters
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
* `eventName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
119
|
+
* `cb` **function (...args: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<any>): any**
|
|
120
120
|
|
|
121
121
|
Returns **void**
|
|
122
122
|
|
|
@@ -126,8 +126,8 @@ Stop listening to an event on an instance of transport.
|
|
|
126
126
|
|
|
127
127
|
##### Parameters
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
* `eventName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
130
|
+
* `cb` **function (...args: [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<any>): any**
|
|
131
131
|
|
|
132
132
|
Returns **void**
|
|
133
133
|
|
|
@@ -141,7 +141,7 @@ Set a timeout (in milliseconds) for the exchange call. Only some transport might
|
|
|
141
141
|
|
|
142
142
|
##### Parameters
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
* `exchangeTimeout` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
145
145
|
|
|
146
146
|
Returns **void**
|
|
147
147
|
|
|
@@ -151,7 +151,7 @@ Define the delay before emitting "unresponsive" on an exchange that does not res
|
|
|
151
151
|
|
|
152
152
|
##### Parameters
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
* `unresponsiveTimeout` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
155
155
|
|
|
156
156
|
Returns **void**
|
|
157
157
|
|
|
@@ -161,26 +161,26 @@ wrapper on top of exchange to simplify work of the implementation.
|
|
|
161
161
|
|
|
162
162
|
##### Parameters
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
* `cla` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
165
|
+
* `ins` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
166
|
+
* `p1` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
167
|
+
* `p2` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
168
|
+
* `data` **[Buffer](https://nodejs.org/api/buffer.html)** (optional, default `Buffer.alloc(0)`)
|
|
169
|
+
* `statusList` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)>** is a list of accepted status code (shorts). \[0x9000] by default (optional, default `[StatusCodes.OK]`)
|
|
170
170
|
|
|
171
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
171
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Buffer](https://nodejs.org/api/buffer.html)>** a Promise of response buffer
|
|
172
172
|
|
|
173
173
|
#### isSupported
|
|
174
174
|
|
|
175
175
|
Statically check if a transport is supported on the user's platform/browser.
|
|
176
176
|
|
|
177
|
-
Type: function (): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
177
|
+
Type: function (): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)>
|
|
178
178
|
|
|
179
179
|
#### list
|
|
180
180
|
|
|
181
181
|
List once all available descriptors. For a better granularity, checkout `listen()`.
|
|
182
182
|
|
|
183
|
-
Type: function (): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
183
|
+
Type: function (): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)\<any>>
|
|
184
184
|
|
|
185
185
|
##### Examples
|
|
186
186
|
|
|
@@ -197,11 +197,11 @@ a DescriptorEvent is a `{ descriptor, type }` object. type can be `"add"` or `"r
|
|
|
197
197
|
each listen() call will first emit all potential device already connected and then will emit events can come over times,
|
|
198
198
|
for instance if you plug a USB device after listen() or a bluetooth device become discoverable.
|
|
199
199
|
|
|
200
|
-
Type: function (observer: [Observer](#observer)
|
|
200
|
+
Type: function (observer: [Observer](#observer)<[DescriptorEvent](#descriptorevent)\<any>>): [Subscription](#subscription)
|
|
201
201
|
|
|
202
202
|
##### Parameters
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
* `observer` is an object with a next, error and complete function (compatible with observer pattern)
|
|
205
205
|
|
|
206
206
|
##### Examples
|
|
207
207
|
|
|
@@ -225,12 +225,12 @@ Returns **any** a Subscription object on which you can `.unsubscribe()` to stop
|
|
|
225
225
|
|
|
226
226
|
attempt to create a Transport instance with potentially a descriptor.
|
|
227
227
|
|
|
228
|
-
Type: function (descriptor: any, timeout: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
228
|
+
Type: function (descriptor: any, timeout: [number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)): [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Transport](#transport)>
|
|
229
229
|
|
|
230
230
|
##### Parameters
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
|
|
232
|
+
* `descriptor` : the descriptor to open the transport with.
|
|
233
|
+
* `timeout` : an optional timeout
|
|
234
234
|
|
|
235
235
|
##### Examples
|
|
236
236
|
|
|
@@ -248,8 +248,8 @@ This is a light helper, alternative to using listen() and open() (that you may n
|
|
|
248
248
|
|
|
249
249
|
##### Parameters
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
* `openTimeout` (optional, default `3000`)
|
|
252
|
+
* `listenTimeout` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?**
|
|
253
253
|
|
|
254
254
|
##### Examples
|
|
255
255
|
|
|
@@ -257,4 +257,4 @@ This is a light helper, alternative to using listen() and open() (that you may n
|
|
|
257
257
|
TransportFoo.create().then(transport => ...)
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
260
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Transport](#transport)>**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/hw-transport",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.19.0",
|
|
4
4
|
"description": "Ledger Hardware Wallet common interface of the communication layer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"types": "lib/Transport.d.ts",
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ledgerhq/devices": "^6.
|
|
29
|
-
"@ledgerhq/errors": "^6.
|
|
28
|
+
"@ledgerhq/devices": "^6.19.0",
|
|
29
|
+
"@ledgerhq/errors": "^6.10.0",
|
|
30
30
|
"events": "^3.3.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"watch": "bash ../../script/watch.sh",
|
|
36
36
|
"doc": "bash ../../script/doc.sh"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "37f11a943eabfca3e506deb2f494d3d886731292"
|
|
39
39
|
}
|