TronRequestTriggerSmartContract.fromMethod constructor

TronRequestTriggerSmartContract.fromMethod({
  1. required TronAddress ownerAddress,
  2. required TronAddress contractAddress,
  3. required AbiFunctionFragment function,
  4. required List params,
  5. BigInt? feeLimit,
  6. int? permissionId,
  7. String? parameter,
  8. BigInt? callValue,
  9. BigInt? callTokenValue,
  10. BigInt? tokenId,
  11. bool visible = true,
})

Implementation

factory TronRequestTriggerSmartContract.fromMethod({
  required TronAddress ownerAddress,
  required TronAddress contractAddress,
  required AbiFunctionFragment function,
  required List<dynamic> params,
  final BigInt? feeLimit,
  final int? permissionId,
  String? parameter,
  BigInt? callValue,
  BigInt? callTokenValue,
  BigInt? tokenId,
  bool visible = true,
}) {
  final rawBytes = function.encode(params, true);

  return TronRequestTriggerSmartContract._(
      ownerAddress: ownerAddress,
      contractAddress: contractAddress,
      callTokenValue: callTokenValue,
      callValue: callValue,
      data: rawBytes.isEmpty ? null : BytesUtils.toHexString(rawBytes),
      fragment: function,
      tokenId: tokenId,
      visible: visible,
      permissionId: permissionId,
      feeLimit: feeLimit);
}