Gateway: GetTransferStatus

Get transfer status from cBridge gateway

REST API

POST https://cbridge-prod2.celer.app/v2/getTransferStatus

Here is a curl example.

curl -d '{"transfer_id":"77D7E231B08120217969DED3FF1ED2B40C0028CA1E239B225F535C57808A23F6"}' -H "Content-Type: application/json" -X POST https://cbridge-prod2.celer.app/v2/getTransferStatus

When you get the response, you can get TransferHistoryStatus and XferStatus according to below mapping.

For example, if the "status" is 6 and the "refund_reason" is 4, we know this tx needs to be refunded for user since slippage is too low to finish the cBridge transfer flow.

Headers

Request Body

{
  "err": null,
  "status": 5,
  "wd_onchain": null,
  "sorted_sigs": [
  ],
  "signers": [
  ],
  "powers": [
  ],
  "refund_reason": 0,
  "block_delay": 30,
  "src_block_tx_link": "https://ftmscan.com/tx/0x5817041ff87994234a74edbff7f25afb659a5519c1ce0b90b7d886aca67eaccc",
  "dst_block_tx_link": "https://arbiscan.io/tx/0xe73db1fff7407a72d4755cd52252d29afd2e5326b755725df56befba4ff7594b"
}

GRPC-Web API

import {
    GetTransferStatusRequest
} from "../ts-proto/sgn/gateway/v1/gateway_pb";

// import grpc-web WebClient
import { 
    WebClient 
} from "../ts-proto/sgn/gateway/v1/GatewayServiceClientPb";

/// https://ftmscan.com/tx/0x5817041ff87994234a74edbff7f25afb659a5519c1ce0b90b7d886aca67eaccc"
const request = new GetTransferStatusRequest();
request.setTransferId("77D7E231B08120217969DED3FF1ED2B40C0028CA1E239B225F535C57808A23F6");
const client = new WebClient(`https://cbridge-prod2.celer.app`, null, null);
const response = await client.getTransferStatus((request, null);

Request Parameter

Response Parameters

TransferHistoryStatus

XferStatus

We should focus on status types with BAD prefix, it shows the error reason for failed transfer transaction. Other status indicates normal transaction flow.

/// Code Sample

const statusRes = await getTransferStatus({ transfer_id: transferId }

Last updated