How to use @cardano-foundation/ledgerjs-hw-app-cardano - 1 common examples

To help you get started, we’ve selected a few @cardano-foundation/ledgerjs-hw-app-cardano 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 vacuumlabs / adalite / app / frontend / wallet / cardano-ledger-crypto-provider.js View on Github external
const CardanoLedgerCryptoProvider = async (ADALITE_CONFIG, walletState) => {
  let transport
  try {
    transport = await LedgerTransportU2F.create()
  } catch (u2fError) {
    try {
      transport = await LedgerTransportWebusb.create()
    } catch (webUsbError) {
      debugLog(webUsbError)
      throw u2fError
    }
  }
  transport.setExchangeTimeout(ADALITE_CONFIG.ADALITE_LOGOUT_AFTER * 1000)
  const ledger = new Ledger(transport)
  const state = Object.assign(walletState, {
    derivationScheme: derivationSchemes.v2,
    rootHdPassphrase: null,
    derivedAddresses: {},
  })

  const isHwWallet = () => true
  const getHwWalletName = () => 'Ledger'

  const deriveXpub = CachedDeriveXpubFactory(state.derivationScheme, async (absDerivationPath) => {
    const response = await ledger.getExtendedPublicKey(absDerivationPath)
    const xpubHex = response.publicKeyHex + response.chainCodeHex
    return Buffer.from(xpubHex, 'hex')
  })

  function deriveHdNode(childIndex) {

@cardano-foundation/ledgerjs-hw-app-cardano

Ledger Hardware Wallet Cardano ADA API

Apache-2.0
Latest version published 2 months ago

Package Health Score

69 / 100
Full package analysis

Popular @cardano-foundation/ledgerjs-hw-app-cardano functions