createRawTransaction function

Transaction_raw createRawTransaction({
  1. required TronContractData data,
  2. required Uint8List refBlockBytes,
  3. required Uint8List refBlockHash,
  4. required int expiration,
  5. required int timestamp,
  6. int? feeLimit,
})

Implementation

tron.Transaction_raw createRawTransaction({
  required TronContractData data,
  required Uint8List refBlockBytes,
  required Uint8List refBlockHash,
  required int expiration,
  required int timestamp,
  int? feeLimit,
}) {
  final contract = data.createContract();

  final tx = tron.Transaction_raw(
    contract: [
      contract,
    ],
    refBlockBytes: refBlockBytes,
    refBlockHash: refBlockHash,
    expiration: Int64(expiration),
    timestamp: Int64(timestamp),
    feeLimit: feeLimit != null && feeLimit != 0 ? Int64(feeLimit) : null,
  );

  return tx;
}