TronRequestTriggerConstantContract.fromMethod constructor

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

Implementation

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

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