callOperation method

Future<OperationsList> callOperation({
  1. String entrypoint = 'default',
  2. dynamic params,
  3. required Keystore source,
  4. int amount = 0,
  5. int? customFee,
  6. int? customGasLimit,
  7. int? customStorageLimit,
})

Returns a OperationsList containing a TransactionOperation related to a call of an entrypoint of the contract

  • entrypoint is the entrypoint we want to call. Default value is 'default'

  • params is the parameters in Dart Types of the call operation. MichelineEncoder is used for conversion to Micheline

  • source is the Keystore initiating the operation

  • amount is the amount of the operation. Default value is 0

  • when params are incompatible with the entrypoint signature, a TypeError is thrown

Implementation

Future<OperationsList> callOperation({
  String entrypoint = 'default',
  dynamic params,
  required Keystore source,
  int amount = 0,
  int? customFee,
  int? customGasLimit,
  int? customStorageLimit,
}) async {
  final type = await _type(entrypoint);
  final michelineParams = MichelineEncoder(type: type, params: params).encode();

  return OperationsList(
    source: source,
    rpcInterface: rpcInterface,
  )..appendOperation(TransactionOperation(
      amount: amount,
      destination: contractAddress,
      params: michelineParams,
      entrypoint: entrypoint,
      customFee: customFee,
      customGasLimit: customGasLimit,
      customStorageLimit: customStorageLimit,
    ));
}