getStatus method

Future<MultisigStorageStatus?> getStatus(
  1. Provider provider, {
  2. String? signerAddress,
})

Fetches the current status of this multisig transaction from the blockchain.

This method queries the on-chain storage to get information about:

  • Number of approvals received
  • Whether the transaction is complete
  • Whether this is waiting for the final approval
  • Whether a specific signer has already approved (if signerAddress is provided)
  • Whether a specific signer can approve or cancel (if signerAddress is provided)

Parameters:

  • provider: The blockchain connection provider
  • signerAddress: Optional address to check specific signer permissions

Returns: A MultisigStorageStatus if the transaction is pending, or null if no approvals have been recorded yet (first approval hasn't been submitted).

Throws:

Example:

final status = await response.getStatus(provider, signerAddress: bob.address);
if (status != null) {
  print('Approvals: ${status.approvalCount}/${status.threshold}');
  print('Bob can approve: ${status.canApprove}');
  print('Waiting for final approval: ${status.isWaitingForFinalApproval}');
} else {
  print('No approvals yet - this is the first one');
}

Implementation

Future<MultisigStorageStatus?> getStatus(
  final Provider provider, {
  final String? signerAddress,
}) async {
  final storage = await MultisigStorage.fetch(
    provider: provider,
    multisigPubkey: multisigAccount.multisigPubkey,
    callHash: callHash,
  );
  return storage?.getStatus(threshold: multisigAccount.threshold, signerAddress: signerAddress);
}