How to use the @ledgerhq/errors.ETHAddressNonEIP function in @ledgerhq/errors

To help you get started, we’ve selected a few @ledgerhq/errors 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 LedgerHQ / ledger-live-common / src / families / ethereum / bridge / js.js View on Github external
function getRecipientWarning(currency, recipient) {
  if (!recipient.match(/^0x[0-9a-fA-F]{40}$/)) return null;
  const slice = recipient.substr(2);
  const isFullUpper = slice === slice.toUpperCase();
  const isFullLower = slice === slice.toLowerCase();
  if (isFullUpper || isFullLower) {
    return new ETHAddressNonEIP();
  }
  return null;
}
github LedgerHQ / ledger-live-desktop / src / bridge / EthereumJSBridge.js View on Github external
function getRecipientWarning(currency, recipient) {
  if (!recipient.match(/^0x[0-9a-fA-F]{40}$/)) return null
  const slice = recipient.substr(2)
  const isFullUpper = slice === slice.toUpperCase()
  const isFullLower = slice === slice.toLowerCase()
  if (isFullUpper || isFullLower) {
    return new ETHAddressNonEIP()
  }
  return null
}