How to use the @dashevo/dashcore-lib.Transaction function in @dashevo/dashcore-lib

To help you get started, we’ve selected a few @dashevo/dashcore-lib 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 citrusbyte / universal-wallet / packages / webapp / src / utils / dash.js View on Github external
const generateTx = ({ utxos, fromAddress, toAddress, privateKey, amount }) => {
  const tx = Transaction();
  tx.from(utxos);
  tx.to(toAddress, toSatoshi(amount));
  tx.change(fromAddress);
  try {
    tx.sign(privateKey);
    tx.serialize();
  } catch (err) {
    throw new Error(`Could not sign & serialize transaction: ${err}`);
  }
  return tx;
};

@dashevo/dashcore-lib

A pure and powerful JavaScript Dash library.

MIT
Latest version published 2 months ago

Package Health Score

79 / 100
Full package analysis