@ledgerhq/hw-transport-webusb 6.7.0 → 6.11.2
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 +27 -27
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
Allows to communicate with Ledger Hardware Wallets.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**\[Web]** **(WebUSB)** – WebUSB [check browser support](https://caniuse.com/webusb).
|
|
11
11
|
|
|
12
12
|
### FAQ: "DOM Exception" is triggered when creating the transport
|
|
13
13
|
|
|
@@ -29,10 +29,10 @@ in (2) case, you will need to have a Connect button that appear when you don’t
|
|
|
29
29
|
|
|
30
30
|
WebUSB is currently only supported on Google Chrome / Chromium.
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
* In Linux, user need to install the [specific udev rules](https://raw.githubusercontent.com/LedgerHQ/udev-rules/master/add_udev_rules.sh)
|
|
33
|
+
* In Mac, it should work.
|
|
34
|
+
* In Windows, [WebUSB does not work out of the box](https://github.com/WICG/webusb/issues/143) but you can fix it with [Zadig](https://zadig.akeo.ie/).
|
|
35
|
+
* In Android Chrome it works.
|
|
36
36
|
|
|
37
37
|
## API
|
|
38
38
|
|
|
@@ -40,20 +40,20 @@ WebUSB is currently only supported on Google Chrome / Chromium.
|
|
|
40
40
|
|
|
41
41
|
#### Table of Contents
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
* [TransportWebUSB](#transportwebusb)
|
|
44
|
+
* [Parameters](#parameters)
|
|
45
|
+
* [Examples](#examples)
|
|
46
|
+
* [close](#close)
|
|
47
|
+
* [exchange](#exchange)
|
|
48
|
+
* [Parameters](#parameters-1)
|
|
49
|
+
* [isSupported](#issupported)
|
|
50
|
+
* [list](#list)
|
|
51
|
+
* [listen](#listen)
|
|
52
|
+
* [Parameters](#parameters-2)
|
|
53
|
+
* [request](#request)
|
|
54
|
+
* [openConnected](#openconnected)
|
|
55
|
+
* [open](#open)
|
|
56
|
+
* [Parameters](#parameters-3)
|
|
57
57
|
|
|
58
58
|
### TransportWebUSB
|
|
59
59
|
|
|
@@ -63,8 +63,8 @@ WebUSB Transport implementation
|
|
|
63
63
|
|
|
64
64
|
#### Parameters
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
* `device` **USBDevice**
|
|
67
|
+
* `interfaceNumber` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)**
|
|
68
68
|
|
|
69
69
|
#### Examples
|
|
70
70
|
|
|
@@ -78,7 +78,7 @@ TransportWebUSB.create().then(transport => ...)
|
|
|
78
78
|
|
|
79
79
|
Release the transport device
|
|
80
80
|
|
|
81
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)
|
|
81
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<void>**
|
|
82
82
|
|
|
83
83
|
#### exchange
|
|
84
84
|
|
|
@@ -86,9 +86,9 @@ Exchange with the device using APDU protocol.
|
|
|
86
86
|
|
|
87
87
|
##### Parameters
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
* `apdu` **[Buffer](https://nodejs.org/api/buffer.html)**
|
|
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 apdu response
|
|
92
92
|
|
|
93
93
|
#### isSupported
|
|
94
94
|
|
|
@@ -107,7 +107,7 @@ Important: it must be called in the context of a UI click!
|
|
|
107
107
|
|
|
108
108
|
##### Parameters
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
* `observer` **Observer\<DescriptorEvent\<USBDevice>>**
|
|
111
111
|
|
|
112
112
|
Returns **Subscription**
|
|
113
113
|
|
|
@@ -117,7 +117,7 @@ Similar to create() except it will always display the device permission (even if
|
|
|
117
117
|
|
|
118
118
|
#### openConnected
|
|
119
119
|
|
|
120
|
-
Similar to create() except it will never display the device permission (it returns a Promise
|
|
120
|
+
Similar to create() except it will never display the device permission (it returns a Promise\<?Transport>, null if it fails to find a device).
|
|
121
121
|
|
|
122
122
|
#### open
|
|
123
123
|
|
|
@@ -125,4 +125,4 @@ Create a Ledger transport with a USBDevice
|
|
|
125
125
|
|
|
126
126
|
##### Parameters
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
* `device` **USBDevice**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/hw-transport-webusb",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.11.2",
|
|
4
4
|
"description": "Ledger Hardware Wallet WebUSB implementation of the communication layer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ledger",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"types": "lib/TransportWebUSB.d.ts",
|
|
27
27
|
"license": "Apache-2.0",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ledgerhq/devices": "^6.
|
|
30
|
-
"@ledgerhq/errors": "^6.
|
|
31
|
-
"@ledgerhq/hw-transport": "^6.
|
|
32
|
-
"@ledgerhq/logs": "^6.
|
|
29
|
+
"@ledgerhq/devices": "^6.11.2",
|
|
30
|
+
"@ledgerhq/errors": "^6.10.0",
|
|
31
|
+
"@ledgerhq/hw-transport": "^6.11.2",
|
|
32
|
+
"@ledgerhq/logs": "^6.10.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/w3c-web-usb": "^1.0.5"
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"watch": "bash ../../script/watch.sh",
|
|
42
42
|
"doc": "bash ../../script/doc.sh"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "d243550a31bd781924fc301492320b16212c3dbe"
|
|
45
45
|
}
|