📍Transaction Status API

Description:

Brydge offers an endpoint that returns a given transaction's status throughout a transaction.

These parameters can be exposed from the Brydge widget using the onTxSubmit prop as explained here.

Note that upon a transaction's submission, the Brydge widget automatically shows a confirmation window with a link to your transaction's status page on Brydge's website. So, integrating the Transaction status API is an optional extra step that you may choose to add for an even better user experience.

Base URL:

https://brydge-backend.herokuapp.com/

Query Parameters:

Query ParameterType

chainId

number

Chain ID of the Source Chain

srcTxHash

string

Transaction hash of the source transaction

isCrossChain

boolean

Boolean indicating if the transaction was cross-chain (defaults to false or same-chain if omitted)

Output:

export class GetTransactionStatusResponse {
  statusCode: number;

  data: {
    srcChainId: number;
    dstChainId: number;
    srcTxHash: string;
    dstTxHash: string;
    dstTxError: string;
    txStatus: string;
  };
}

Data Returned from Output:

ParameterTypeDescription

srcChainId

number

Chain ID of the source transaction.

dstChainId

number

Chain ID of the destination transaction.

srcTxHash

string

Transaction hash of the source transaction.

dstTxHash

string

Transaction hash of the destination transaction.

dstTxError

string

Error message from the destination transaction (if any error occurs).

txStatus

string

Status of the overall transaction (explained below).

txStatus values:

StatusDescription

SRC_TX_PENDING

Transaction is pending on the source chain.

DST_TX_PENDING

Transaction is pending on the destination chain.

COMPLETED

Transaction is complete on both the source and destination chains.

SRC_TX_FAILED

Transaction failed on the source chain.

DST_TX_FAILED

Transaction failed on the destination chain.

Status Codes:

Status CodeDescription

202

Transaction is inflight, either source or destination transaction is pending.

200

Transaction is complete

400

Transaction failed

500

Internal server error (transaction not found or any runtime issue)

Examples:

Request Example:

https://brydge-backend.herokuapp.com/transaction/status?chainId=10&srcTxHash=0x3fe7e7fc0eff1f2fd4a0d99c2e1984a094748af3e3915e8441690bfec6e8763e&isCrossChain=false

Output Examples:

// Source transaction pending 
{
    "data": {
        "srcChainId": 1,
        "dstChainId": 137,
        "srcTxHash": "0xa3a1c8b501797da0c239669a3d04039def35db812e0da9f0799c00f719dcc9e1",
				"status": "SRC_TX_PENDING"
    },
    "statusCode": 202
}

// Destination Transaction Pending
{
    "data": {
        "srcChainId": 137,
        "dstChainId": 10,
        "srcTxHash": "0xf71d1f963329698c5e46b78335abcbb219a04a31ee29a7c7d1a0937746599435",
        "txStatus": "DST_TX_PENDING"
    },
    "statusCode": 202
}

// Transaction Completed
{
    "data": {
        "srcChainId": 10,
        "dstChainId": 42161,
        "srcTxHash": "0xa3a1c8b501797da0c239669a3d04039def35db812e0da9f0799c00f719dcc9e1",
        "dstTxHash": "0x2bc70ef5e3b4ff40e10c36b9fabdabf994ea7a72cb5056d3031cb7d56638eaa0",
        "dstTxError": null,
        "status": "COMPLETED"
    },
    "statusCode": 200
}

Last updated