How to use the @ledgerhq/hw-transport-node-hid.default.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 cryppadotta / dotta-license / dot-abi-cli / bin / test-ledger-address.js View on Github external
const getAddress = async () => {
  console.log('Testing Ledger Hardware...');
  console.log('supported:', await Transport.isSupported());
  console.log('Devices:');
  console.log(await Transport.list());
  const transport = await Transport.create();
  const eth = new AppEth(transport);

  // note: this path matches MEWs: m/44'/60'/0'
  const result = await eth.getAddress("m/44'/60'/0'/0");
  return result;
};
getAddress().then(a => console.log(a));
github cryppadotta / dotta-license / dotlicense-cli / lib / experiments / get-ledger-address.js View on Github external
const getAddress = async () => {
  console.log('Testing Ledger Hardware...');
  console.log('supported:', await Transport.isSupported());
  console.log('Devices:');
  console.log(await Transport.list());
  const transport = await Transport.create();
  const eth = new AppEth(transport);

  // note: this path matches MEWs: m/44'/60'/0'
  const result = await eth.getAddress("m/44'/60'/0'/0");
  return result;
};
getAddress().then(a => console.log(a));
github HathorNetwork / hathor-wallet / public / ledger.js View on Github external
const promiseMethod = new Promise((resolve, reject) => {
      const promise = Transport.create(this.timeout, this.timeout);
      promise.then((transport) => {
        this.transport = transport;
        this.methods = [
          "getVersion",
          "getPublicKeyData",
          "checkAddress",
          "sendTx",
          "getSignatures"
        ];
        this.transport.decorateAppAPIMethods(this, this.methods, "HTR");
        resolve(transport);
      }, (e) => {
        // We have to create a new error because sometimes we receive some errors that 
        // are not user friendly, e.g. 'Race condition'.
        const error = new Error('Error connecting to ledger device.');
        reject(error);
github Cryptonomic / ConseilJS / test / Ledger.spec.ts View on Github external
const getAddress = async () => {
    const transport = await Transport.create();
    const xtz = new App(transport);
    console.log(xtz)
    const result = await xtz.getAddress("44'/1729'/0'/0'/0'", true);
    return result.publicKey;
};
/*const signOperation = async () => {
github Cryptonomic / ConseilJS / dist / utils / LedgerUtils.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            if (this.transport === null) {
                this.transport = yield Transport.create();
            }
            return this.transport;
        });
    }
github tronscan / tronscan-frontend / desktop / src / Ledger / LedgerBridge.js View on Github external
return new Promise(async (resolve, reject) => {
      const transport = await Transport.create();
      try {
        const trx = new AppTrx(transport);
        let response = await trx.signTransaction(
          this.path,
          transaction.hex,
          transaction.sha256,
          transaction.contractType);
        resolve(response);
      } catch(e) {
        reject(e);
      } finally {
        transport.close();
      }
    });
  }
github OriginProtocol / origin-js / token / lib / ledger.js View on Github external
    const getTransport = () => TransportU2F.create()
    const ledger = createLedgerSubprovider(getTransport, options)
github tezbox / desktop-wallet / app / lib / ledger-tezos / index.js View on Github external
sign : async (path, data) => {
	  const transport = await Transport.create(60 * 1000);
	  const xtz = new App(transport);
	  const result = await xtz.signOperation(path, data);
	  return result;
	}
};