call method
Future<Contract>
call(
{ - String? transition,
- dynamic params,
- BigInt? amount,
- int gasLimit = 1000,
- BigInt? gasPrice,
- Account? account,
- String? passphrase,
- int maxAttempts = 20,
- int interval = 1000,
- 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;
}
}