buildTransaction function

Transaction buildTransaction(
  1. List<Clause> clauses,
  2. int chainTag,
  3. String blockRef,
  4. int nonce, {
  5. int expiration = 32,
  6. int gasPriceCoef = 0,
  7. int gas = 0,
  8. String? dependsOn,
  9. bool feeDelegation = false,
})

Implementation

Transaction buildTransaction(
    List<Clause> clauses, int chainTag, String blockRef, int nonce,
    {int expiration = 32,
    int gasPriceCoef = 0,
    int gas = 0,
    String? dependsOn,
    bool feeDelegation = false}) {
  Reserved reserved;
  if (!feeDelegation) {
    reserved = Reserved.getNullReserved();
  } else {
    reserved = Reserved(1, []);
  }
  Transaction tx = Transaction(
      chainTag,
      blockRef,
      expiration.toRadixString(10),
      clauses,
      gasPriceCoef.toRadixString(10),
      gas.toRadixString(10),
      dependsOn,
      nonce.toRadixString(10),
      reserved);

  return tx;
}