How to use the @ledgerhq/hw-transport-node-hid.create function in @ledgerhq/hw-transport-node-hid

To help you get started, weā€™ve selected a few @ledgerhq/hw-transport-node-hid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unstoppabledomains / browseth / signer-ledger / index.js View on Github external
initialize = async () => {
    if (!SignerLedger.allowParallel && SignerLedger.initialized)
      throw new Error('another SignerLedger wallet call is already initialized')

    this.constructor.initialized = true
    const transport = await TransportNodeHid.create()
    // const transport = await TransportU2F.create()

    // transport.setDebugMode(true);
    return {
      app: new AppEth(transport),
      close: () => {
        SignerLedger.initialized = false
        transport.close()
      },
    }
  }
github rate-engineering / rate3-monorepo / LedgerIntegration.js View on Github external
async function getInfos(path = "44'/60'/0'/0") {
  let transport;
  try {
    transport = await TransportNodeHid.create();
    const eth = new Eth(transport);
    eth.getAddress(
      path,
      true,
      true,
    ).then(function(publicKey) {
      console.log(JSON.stringify(publicKey));
    }).catch(function(err) {
      console.log(err);
    });
  } catch (e) {
    console.log(e);
  }
}
getInfos();
github hubiinetwork / hubii-core / src / electron / wallets / lns / index.js View on Github external
const createEthTransportActivity = async (descriptor, activityFn) => {
  let transport;
  try {
    if (process.platform === 'win32') {
      transport = await LedgerTransport.create();
    } else {
      transport = await LedgerTransport.open(descriptor);
    }
    const ethTransport = new Eth(transport);
    const result = await activityFn(ethTransport);
    return result;
  } finally {
    if (transport) {
      await transport.close();
    }
  }
};
github rate-engineering / rate3-monorepo / packages / wallet / Ledger.js View on Github external
async signMessage(path, message) {
    let result;
    const transport = await TransportNodeHid.create();
    if (this.currency === 'stellar') {
      const str = new Str(transport);
      result = str.signHash(path, message);
      result = result.signature;
    } else {
      const eth = new Eth(transport);
      result = await eth.signTransaction(path, message);
    }
    return result;
  }
}
github hubiinetwork / hubii-core / src / utils / ledger / comms.js View on Github external
export const createTransport = () => LedgerTransport.create();
github SelfKeyFoundation / Identity-Wallet / src / main / blockchain / leadger-service.js View on Github external
		const getTransport = () => HWTransportNodeHid.create();
		const ledger = Web3SubProvider(getTransport, {