copyWith method

TransactionRequest copyWith({
  1. String? to,
  2. BigInt? value,
  3. Uint8List? data,
  4. BigInt? gasLimit,
  5. BigInt? gasPrice,
  6. BigInt? maxFeePerGas,
  7. BigInt? maxPriorityFeePerGas,
  8. BigInt? nonce,
  9. int? chainId,
  10. TransactionType? type,
  11. List<AccessListEntry>? accessList,
  12. List<String>? blobVersionedHashes,
  13. BigInt? maxFeePerBlobGas,
  14. List<Authorization>? authorizationList,
})

Creates a copy with updated fields.

Implementation

TransactionRequest copyWith({
  String? to,
  BigInt? value,
  Uint8List? data,
  BigInt? gasLimit,
  BigInt? gasPrice,
  BigInt? maxFeePerGas,
  BigInt? maxPriorityFeePerGas,
  BigInt? nonce,
  int? chainId,
  TransactionType? type,
  List<AccessListEntry>? accessList,
  List<String>? blobVersionedHashes,
  BigInt? maxFeePerBlobGas,
  List<Authorization>? authorizationList,
}) {
  return TransactionRequest(
    to: to ?? this.to,
    value: value ?? this.value,
    data: data ?? this.data,
    gasLimit: gasLimit ?? this.gasLimit,
    gasPrice: gasPrice ?? this.gasPrice,
    maxFeePerGas: maxFeePerGas ?? this.maxFeePerGas,
    maxPriorityFeePerGas: maxPriorityFeePerGas ?? this.maxPriorityFeePerGas,
    nonce: nonce ?? this.nonce,
    chainId: chainId ?? this.chainId,
    type: type ?? this.type,
    accessList: accessList ?? this.accessList,
    blobVersionedHashes: blobVersionedHashes ?? this.blobVersionedHashes,
    maxFeePerBlobGas: maxFeePerBlobGas ?? this.maxFeePerBlobGas,
    authorizationList: authorizationList ?? this.authorizationList,
  );
}