How to use @ledgerhq/hw-app-xrp - 4 common examples

To help you get started, we’ve selected a few @ledgerhq/hw-app-xrp 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 / ripple / libcore-signOperation.js View on Github external
async function signTransaction({
  account: { freshAddress, freshAddressPath, id: accountId, balance },
  transport,
  transaction,
  coreTransaction,
  onDeviceSignatureRequested,
  onDeviceSignatureGranted
}) {
  const hwApp = new Xrp(transport);
  const serialized = await coreTransaction.serialize();

  onDeviceSignatureRequested();
  const result = await hwApp.signTransaction(freshAddressPath, serialized);
  onDeviceSignatureGranted();

  await coreTransaction.setDERSignature(result);

  const signature = await coreTransaction.serialize();

  // build optimistic update

  const txHash = ""; // will be resolved at broadcast() time
  const senders = [freshAddress];
  const receiver = await coreTransaction.getReceiver();
  const recipients = [await receiver.toBase58()];
github LedgerHQ / ledger-live-desktop / src / helpers / getAddressForCurrency / ripple.js View on Github external
export default async (
  transport: Transport<*>,
  currency: CryptoCurrency,
  path: string,
  { verify = false }: *,
) => {
  const xrp = new Xrp(transport)
  const { address, publicKey } = await xrp.getAddress(path, verify)
  return { path, address, publicKey }
}
github LedgerHQ / ledger-live-common / src / hw / signTransaction / ripple.js View on Github external
export default async (
  currency: CryptoCurrency,
  transport: Transport<*>,
  path: string,
  txArg: Object
) => {
  const tx = { ...txArg };
  const xrp = new Xrp(transport);
  const { publicKey } = await xrp.getAddress(path);
  tx.SigningPubKey = publicKey.toUpperCase();
  const rawTxHex = BinaryCodec.encode(tx).toUpperCase();
  tx.TxnSignature = (await xrp.signTransaction(path, rawTxHex)).toUpperCase();
  return BinaryCodec.encode(tx).toUpperCase();
};
github LedgerHQ / ledger-live-common / src / families / ripple / hw-getAddress.js View on Github external
const resolver: Resolver = async (
  transport,
  { path, verify, askChainCode }
) => {
  const xrp = new Xrp(transport);
  const { address, publicKey, chainCode } = await xrp.getAddress(
    path,
    verify,
    askChainCode || false
  );
  return { path, address, publicKey, chainCode };
};

@ledgerhq/hw-app-xrp

Ledger Hardware Wallet Ripple Application API

MIT
Latest version published 2 months ago

Package Health Score

85 / 100
Full package analysis

Popular @ledgerhq/hw-app-xrp functions