aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website')
-rw-r--r--packages/website/md/docs/subproviders/ledger_node_hid.md17
-rw-r--r--packages/website/ts/containers/subproviders_documentation.ts4
2 files changed, 21 insertions, 0 deletions
diff --git a/packages/website/md/docs/subproviders/ledger_node_hid.md b/packages/website/md/docs/subproviders/ledger_node_hid.md
new file mode 100644
index 000000000..3089817af
--- /dev/null
+++ b/packages/website/md/docs/subproviders/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,
+});
+```
diff --git a/packages/website/ts/containers/subproviders_documentation.ts b/packages/website/ts/containers/subproviders_documentation.ts
index 34a3d7da2..7aa05f9a5 100644
--- a/packages/website/ts/containers/subproviders_documentation.ts
+++ b/packages/website/ts/containers/subproviders_documentation.ts
@@ -14,6 +14,7 @@ import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
const IntroMarkdown = require('md/docs/subproviders/introduction');
const InstallationMarkdown = require('md/docs/subproviders/installation');
+const LedgerNodeHidMarkdown = require('md/docs/subproviders/ledger_node_hid');
/* tslint:enable:no-var-requires */
const docSections = {
@@ -21,6 +22,7 @@ const docSections = {
installation: 'installation',
subprovider: 'subprovider',
ledgerSubprovider: 'ledgerSubprovider',
+ ledgerNodeHid: 'ledger-node-hid-issue',
factoryMethods: 'factory-methods',
emptyWalletSubprovider: 'emptyWalletSubprovider',
fakeGasEstimateSubprovider: 'fakeGasEstimateSubprovider',
@@ -41,6 +43,7 @@ const docsInfoConfig: DocsInfoConfig = {
install: [docSections.installation],
subprovider: [docSections.subprovider],
['ledger-subprovider']: [docSections.ledgerSubprovider],
+ ['ledger-node-hid-issue']: [docSections.ledgerNodeHid],
['factory-methods']: [docSections.factoryMethods],
['emptyWallet-subprovider']: [docSections.emptyWalletSubprovider],
['fakeGasEstimate-subprovider']: [docSections.fakeGasEstimateSubprovider],
@@ -53,6 +56,7 @@ const docsInfoConfig: DocsInfoConfig = {
sectionNameToMarkdown: {
[docSections.introduction]: IntroMarkdown,
[docSections.installation]: InstallationMarkdown,
+ [docSections.ledgerNodeHid]: LedgerNodeHidMarkdown,
},
sectionNameToModulePath: {
[docSections.subprovider]: ['"subproviders/src/subproviders/subprovider"'],