call method

Future<Contract> call({
  1. String? transition,
  2. dynamic params,
  3. BigInt? amount,
  4. int gasLimit = 1000,
  5. BigInt? gasPrice,
  6. Account? account,
  7. String? passphrase,
  8. int maxAttempts = 20,
  9. int interval = 1000,
  10. bool toDS = false,
})

Implementation

Future<Contract> call(
    {String? transition,
    params,
    BigInt? amount,
    int gasLimit = 1000,
    BigInt? gasPrice,
    Account? account,
    String? passphrase,
    int maxAttempts = 20,
    int interval = 1000,
    bool toDS = false}) async {
  if (this.contractAddress == null) {
    throw 'Contract has not been deployed!';
  }
  var defaultAmount = BigInt.from(10000);
  var defaultGasPrice = BigInt.from(100000000);
  try {
    this.setCallPayload(
        transition: transition,
        params: params,
        amount: amount ?? defaultAmount,
        gasLimit: gasLimit,
        gasPrice: gasPrice ?? defaultGasPrice,
        toDS: toDS);
    await this.sendContract(
        account: account ?? this.signer, passphrase: passphrase);
    await this.confirmTx(maxAttempts: maxAttempts, interval: interval);
    return this;
  } catch (err) {
    rethrow;
  }
}