confirmTx method

Future<Contract> confirmTx({
  1. int maxAttempts = 20,
  2. int interval = 1000,
})

Implementation

Future<Contract> confirmTx(
    {int maxAttempts = 20, int interval = 1000}) async {
  try {
    await this.transaction!.confirm(
        txHash: this.transaction!.transactionID,
        maxAttempts: maxAttempts,
        interval: interval);
    if (this.transaction!.receipt == null ||
        !this.transaction!.receipt!['success']) {
      this.setStatus(ContractStatus.REJECTED);
      return this;
    }
    this.setStatus(ContractStatus.DEPLOYED);
    return this;
  } catch (error) {
    rethrow;
  }
}