Interpreting Transaction & Transfer Status
Learn how to interpret the status of transactions and individual transfer steps from the Skip Go API’s /v2/tx/status endpoint to provide accurate feedback to users.
The fields and logic discussed in this guide pertain to the JSON response object from the /v2/tx/status
endpoint of the Skip Go API. Refer to the API Reference for detailed schema information.
Understanding the status of a cross-chain transaction and its individual steps is crucial for building a clear and reliable user experience. This guide explains how to interpret the relevant fields from the /v2/tx/status
API response to determine if a transaction (and each of its constituent transfers) is pending, successful, has encountered an error, or has been abandoned.
This approach is useful for driving UI elements such as progress indicators, status messages, and error displays in your application.
Example /v2/tx/status
Response
Below is an example of a JSON response from the /v2/tx/status
endpoint, illustrating some of the key fields discussed in this guide:
Core Concepts for Status Interpretation
The logic relies on a few key pieces of information typically available in the /v2/tx/status
API response object:
-
The Overall Transaction Status: This provides a high-level view of the entire multi-step operation.
- Look at the top-level
state
field in the response. - Possible values include:
'STATE_COMPLETED_SUCCESS'
: The entire transaction finished successfully.'STATE_COMPLETED_ERROR'
: The transaction finished, but an error occurred.'STATE_ABANDONED'
: The transaction was abandoned (e.g., due to timeout or user action).
- If the state is not one of these terminal states, it’s generally assumed to be pending or in progress.
- Look at the top-level
-
The Next Blocking Step (or Failure Point): This indicates which specific transfer in the sequence is currently active, or which one caused a failure or abandonment.
- Utilize the
next_blocking_transfer.transfer_sequence_index
field (ifnext_blocking_transfer
exists in the response). - This will be an index pointing to an operation within the top-level
transfer_sequence
array.
- Utilize the
-
Categorizing Each Operation in the Sequence: For each operation within the
transfer_sequence
array of the response, you can determine its individual status:-
Loading/Pending:
- The operation’s index matches the
next_blocking_transfer.transfer_sequence_index
(ifnext_blocking_transfer
exists). - AND the overall transaction is still in progress (i.e., the top-level
state
is notSTATE_COMPLETED_ERROR
orSTATE_ABANDONED
).
- The operation’s index matches the
-
Error/Failed/Abandoned:
- The operation’s index matches the
next_blocking_transfer.transfer_sequence_index
(ifnext_blocking_transfer
exists - it is typicallynull
if the overallstate
is terminal (e.g.,STATE_COMPLETED_SUCCESS
,STATE_COMPLETED_ERROR
, orSTATE_ABANDONED
) as the transaction is no longer actively blocked or has finished successfully). - AND the overall transaction state (the top-level
state
field) isSTATE_COMPLETED_ERROR
orSTATE_ABANDONED
. - Additionally, if the overall transaction state is
STATE_COMPLETED_ERROR
and this is the last operation in the sequence, it is also considered to be in an error state. - Note: If the overall transaction
state
isSTATE_COMPLETED_ERROR
, it’s also crucial to inspect the specificerror
object within each individual transfer step in thetransfer_sequence
(e.g.,step.ibc_transfer.packet_txs.error
,step.cctp_transfer.error
, etc.). This will help pinpoint the exact leg(s) that encountered issues, as thenext_blocking_transfer
might benull
if the transaction reached a terminal error state rather than getting stuck midway.
- The operation’s index matches the
-
Success:
- If the overall transaction state (top-level
state
field) isSTATE_COMPLETED_SUCCESS
, then all operations in the sequence are considered successful. - If the overall transaction is still in progress, or has failed/been abandoned, any operation before the
next_blocking_transfer.transfer_sequence_index
(ifnext_blocking_transfer
exists - see note above about it typically beingnull
in terminal states) is assumed to have completed successfully.
- If the overall transaction state (top-level
-
Example Implementation Logic (JavaScript)
The following JavaScript snippet demonstrates how these concepts can be translated into code to determine the status of each step.
By implementing logic based on these fields and states, you can provide users with accurate and timely feedback on the progress of their cross-chain transactions.
Understanding Asset Release (transfer_asset_release
)
The transfer_asset_release
object in the /v2/tx/status
response provides crucial information about where the user’s assets have ultimately landed or are expected to be claimable, especially in scenarios involving swaps or complex routes.
Key fields include:
chain_id
: The chain ID where the assets are located.denom
: The denomination (asset identifier) of the released assets.amount
: The quantity of the released assets.released
: A boolean indicating if the assets have been definitively released to the user (e.g., available in their wallet or claimable). Iffalse
, it might indicate that assets are still in a contract or awaiting a final step for release.
In the event of a cross-chain swap failure, the transfer_asset_release
field is particularly important for determining the location and state of the user’s funds. For a comprehensive understanding of how assets are handled in different failure scenarios (e.g., pre-swap vs. post-swap failures), please refer to our detailed guide on Handling Cross-Chain Failure Cases.