calculateFee function

BigInt calculateFee({
  1. required RawTransaction tx,
  2. required Amount feePerByte,
})

Implementation

BigInt calculateFee({
  required RawTransaction tx,
  required Amount feePerByte,
}) {
  return switch (tx) {
    EC8RawTransaction _ => calculateFeeEC8(tx: tx),
    _ => tx.size.toBI * feePerByte.value,
  };
}