Sign a Transaction

Here's a simple example how to sign a transaction

import {PhantasmaKeys, Transaction} from 'phantasma-ts';
/**
 * Sign a transaction
 * @param transaction Transaction to sign
 */
function SignATransaction(transaction: Transaction){
  let wif = "";
  let keys = PhantasmaKeys.fromWIF(wif);
  transaction.signWithKeys(keys);
  return transaction;
}

Last updated