triggerConstantContract method

Future<JSON> triggerConstantContract({
  1. required String address,
  2. required String contractAddress,
  3. String? functionSelector,
  4. String? parameter,
  5. String? data,
  6. bool visible = true,
})

Trigger a constant contract (read-only, does not modify the blockchain)

Implementation

Future<JSON> triggerConstantContract({
  required String address,
  required String contractAddress,
  String? functionSelector,
  String? parameter,
  String? data,
  bool visible = true,
}) {
  assert(
    functionSelector != null || data != null,
    "FunctionSelector or Data must be provided",
  );

  return postCall<JSON>(
    "$baseURL/wallet/triggerconstantcontract",
    data: {
      "owner_address": address,
      "contract_address": contractAddress,
      if (functionSelector != null) "function_selector": functionSelector,
      if (parameter != null) "parameter": parameter,
      if (data != null) "data": data,
      "visible": visible,
    },
  );
}