Skip to content

waitForSupertransactionReceipt

Waits for a super transaction receipt to be available and returns the transaction details along with explorer links.

When to Use This Method

The waitForSupertransactionReceipt method is designed for scenarios where you need to wait for transaction completion before proceeding:

  • Blocks execution until all user operations have reached a final state
  • Simplifies transaction monitoring with a convenient "fire and wait" pattern
  • Automatically polls getSupertransactionReceipt at regular intervals (default: 1000ms)
  • Continues polling until all operations have settled (no longer in "PENDING" state)
  • Perfect for sequential workflows that depend on transaction completion

Use this method when you want a simplified approach to waiting for transaction completion without implementing custom polling logic. For more granular control over transaction status checking, consider using getSupertransactionReceipt directly.

Usage

const receipt = await meeClient.waitForSupertransactionReceipt({ hash });

Parameters

ParameterTypeRequiredDescription
hashHexYesThe hash of the super transaction to wait for
confirmations?numberNoOptional number of confirmations to wait for (optional, example seen in tests: 3)
waitForReceipts?booleanNoSet internally to true - will ensure receipts are included in the response

Returns

Returns a promise that resolves to a WaitForSupertransactionReceiptPayload object containing:

PropertyTypeDescription
hashHexThe hash of the super transaction
nodeAddressAddress of the MEE node that processed the transaction
commitmentHexCommitment hash for the transaction
paymentInfoFilledPaymentInfoPayment information object (see below)
userOpsMeeFilledUserOpDetails[]Array of user operations (see below)
explorerLinksUrl[]Array of links to view the transaction on block explorers
transactionStatus"MINED_SUCCESS" | "MINED_FAIL" | "PENDING" | "FAILED"Overall status of the transaction
receiptsArray<TransactionReceipt>Array of blockchain transaction receipts

FilledPaymentInfo Object

PropertyTypeDescription
tokenAddressAddress of the token used for payment
amountbigintAmount of tokens to be paid
decimalsnumberNumber of decimals for the token
symbolstringToken symbol
exchangeRatestringExchange rate used for the transaction

MeeFilledUserOpDetails Object

PropertyTypeDescription
chainIdnumberChain ID where the operation is executed
senderAddressAddress of the sender account
noncebigintAccount nonce
initCodeHexAccount initialization code (if needed)
callDataHexThe call data for the operation
callGasLimitbigintGas limit for the main execution
verificationGasLimitbigintGas limit for signature verification
preVerificationGasbigintGas required for pre-verification
maxFeePerGasbigintMaximum fee per gas unit
maxPriorityFeePerGasbigintMaximum priority fee per gas unit
paymasterAndDataHexPaymaster contract address and data
signatureHexOperation signature
factoryAddressAccount factory address
executionStatus"SUCCESS" | "PENDING" | "FAILED"Status of the operation execution
executionDataHexData returned from the execution
executionErrorstring | nullError message if execution failed

Behavior

  • Polls the MEE explorer API by calling getSupertransactionReceipt until all user operations are no longer in a "PENDING" state
  • Uses the client's pollingInterval (defaults to 1000ms) between checks
  • Throws an error if any user operation fails (status "FAILED" or "MINED_FAIL")
  • Automatically generates relevant block explorer links for the transaction

Examples

Basic Usage

import { createMeeClient } from '@biconomy/abstractjs';
 
// Create MEE client
const meeClient = await createMeeClient({
  account: multiChainAccount,
});
 
// Execute a quote
const { hash } = await meeClient.executeQuote({ quote });
 
// Wait for all operations to complete before proceeding
// This will block execution until the transaction is done
try {
  const receipt = await meeClient.waitForSupertransactionReceipt({ hash });
  
  if (receipt.transactionStatus === "MINED_SUCCESS") {
    console.log("Transaction completed successfully!");
    console.log("View transaction:");
    receipt.explorerLinks.forEach(link => console.log(link));
    
    // Continue with your workflow now that transaction is complete
    processTransactionResults(receipt);
  } else {
    console.error("Transaction failed:", receipt.transactionStatus);
  }
} catch (error) {
  console.error("Error waiting for transaction:", error);
}

With Confirmations Parameter

Based on the test files, you can specify the number of confirmations to wait for:

// Execute a signed quote
const executeSignedQuoteResponse = await meeClient.executeSignedQuote({
  signedQuote
});
 
// Wait for the transaction with 3 confirmations
const superTransactionReceipt = await meeClient.waitForSupertransactionReceipt({
  hash: executeSignedQuoteResponse.hash,
  confirmations: 3
});
 
// Check explorerLinks
expect(superTransactionReceipt.explorerLinks.length).toBeGreaterThan(0);

Comparison with getSupertransactionReceipt

While getSupertransactionReceipt provides a snapshot of the current transaction state and returns immediately, waitForSupertransactionReceipt simplifies the process by:

  1. Repeatedly polling getSupertransactionReceipt at regular intervals
  2. Automatically handling the waiting logic for you
  3. Only resolving once all operations have reached a final state (no longer "PENDING")
  4. Throwing errors automatically if the transaction fails
  5. Providing a more convenient API for sequential workflows