SignTransaction constructor

SignTransaction({
  1. required String fromAddress,
  2. required String chainId,
  3. required BigInt weiValue,
  4. required String data,
  5. String? toAddress,
  6. int? nonce,
  7. BigInt? gasPriceInWei,
  8. BigInt? maxFeePerGas,
  9. BigInt? maxPriorityFeePerGas,
  10. BigInt? gasLimit,
})

Implementation

SignTransaction({
  required String fromAddress,
  required String chainId,
  required BigInt weiValue,
  required String data,
  String? toAddress,
  int? nonce,
  BigInt? gasPriceInWei,
  BigInt? maxFeePerGas,
  BigInt? maxPriorityFeePerGas,
  BigInt? gasLimit,
}) : super(
        method: 'eth_signTransaction',
        paramsJson: jsonEncode({
          'fromAddress': fromAddress,
          'data': data,
          'chainId': chainId,
          'weiValue': weiValue.toString(),
          if (toAddress != null) 'toAddress': toAddress,
          if (nonce != null) 'nonce': nonce,
          if (gasPriceInWei != null)
            'gasPriceInWei': gasPriceInWei.toString(),
          if (maxFeePerGas != null) 'maxFeePerGas': maxFeePerGas.toString(),
          if (maxPriorityFeePerGas != null)
            'maxPriorityFeePerGas': maxPriorityFeePerGas.toString(),
          if (gasLimit != null) 'gasLimit': gasLimit.toString(),
        }),
      );