aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/md/docs/subproviders/1
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/md/docs/subproviders/1')
-rw-r--r--packages/website/md/docs/subproviders/1/installation.md15
-rw-r--r--packages/website/md/docs/subproviders/1/introduction.md1
-rw-r--r--packages/website/md/docs/subproviders/1/ledger_node_hid.md17
3 files changed, 33 insertions, 0 deletions
diff --git a/packages/website/md/docs/subproviders/1/installation.md b/packages/website/md/docs/subproviders/1/installation.md
new file mode 100644
index 000000000..a049ff0ec
--- /dev/null
+++ b/packages/website/md/docs/subproviders/1/installation.md
@@ -0,0 +1,15 @@
+```bash
+npm install @0xproject/subproviders --save
+```
+
+**Import**
+
+```typescript
+import { LedgerSubprovider } from '@0xproject/subproviders';
+```
+
+or
+
+```javascript
+var LedgerSubprovider = require('@0xproject/subproviders').LedgerSubprovider;
+```
diff --git a/packages/website/md/docs/subproviders/1/introduction.md b/packages/website/md/docs/subproviders/1/introduction.md
new file mode 100644
index 000000000..835201064
--- /dev/null
+++ b/packages/website/md/docs/subproviders/1/introduction.md
@@ -0,0 +1 @@
+Welcome to the [Subproviders](https://github.com/0xProject/0x-monorepo/tree/development/packages/subproviders) documentation! Subproviders is a package containing useful [subproviders](https://0xproject.com/wiki#Web3-Provider-Explained) that can be used with the [Web3 Provider Engine](https://github.com/MetaMask/provider-engine) library.
diff --git a/packages/website/md/docs/subproviders/1/ledger_node_hid.md b/packages/website/md/docs/subproviders/1/ledger_node_hid.md
new file mode 100644
index 000000000..3089817af
--- /dev/null
+++ b/packages/website/md/docs/subproviders/1/ledger_node_hid.md
@@ -0,0 +1,17 @@
+By default, node-hid transport support is an optional dependency. This is due to the requirement of native usb developer packages on the host system. If these aren't installed the entire `npm install` fails. We also no longer export node-hid transport client factories. To re-create this see our integration tests or follow the example below:
+
+```typescript
+import Eth from '@ledgerhq/hw-app-eth';
+import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
+async function ledgerEthereumNodeJsClientFactoryAsync(): Promise<LedgerEthereumClient> {
+ const ledgerConnection = await TransportNodeHid.create();
+ const ledgerEthClient = new Eth(ledgerConnection);
+ return ledgerEthClient;
+}
+
+// Create a LedgerSubprovider with the node-hid transport
+ledgerSubprovider = new LedgerSubprovider({
+ networkId,
+ ledgerEthereumClientFactoryAsync: ledgerEthereumNodeJsClientFactoryAsync,
+});
+```