有人可以提供有关如何使用该库的示例吗? https://www.npmjs.com/package/@ledgerhq/logs
这是我的代码:
const LedgerWalletProvider = require('@ledgerhq/web3-subprovider');
const createLedgerSubprovider = LedgerWalletProvider.default;
const TransportNodeHid = require('@ledgerhq/hw-transport-node-hid').default;
const ProviderEngine = require('web3-provider-engine');
const RpcSubprovider = require('web3-provider-engine/subproviders/rpc');
const engine = new ProviderEngine();
const getTransport = () => TransportNodeHid.create();
const ledger = createLedgerSubprovider(getTransport, { askConfirm: true });
engine.addProvider(ledger);
engine.addProvider(new RpcSubprovider({ rpcUrl: process.env.BLOCKCHAIN_NODE_MAINNET }));
engine.start();
module.exports = engine;