Gateway: GetTransferStatus
Get transfer status from cBridge gateway
post
https://cbridge-prod2.celer.app
/v2/getTransferStatus
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);
Name | Type | Description |
---|---|---|
transfer_id | String |
Name | Type | Description |
---|---|---|
status | transfer status | |
wd_onchain | String | Serialized on-chain withdraw request(only for refund) |
sorted_sigs | Array<String> | Celer SGN validators' sign for wd_onchain (only for refund) |
signers | Array<String> | Celer SGN validators which has signed for wd_onchain (only for refund) |
powers | Array<String> | Powers for each signed validators (only for refund) |
refund_reason | Used when status is TRANSFER_TO_BE_REFUNDED | |
block_delay | Number | Waiting block for this transfer on src chain |
src_block_tx_link | String | source chain transaction link |
dst_block_tx_link | String | destination chain transaction link |
Type | Description | Code |
---|---|---|
TRANSFER_UNKNOWN | Placeholder status | 0 |
TRANSFER_SUBMITTING | cBridge gateway monitoring on-chain transaction | 1 |
TRANSFER_FAILED | transfer failed, no need to refund | 2 |
TRANSFER_WAITING_FOR_SGN_CONFIRMATION | cBridge gateway waiting for Celer SGN confirmation | 3 |
TRANSFER_WAITING_FOR_FUND_RELEASE | waiting for user's fund release on destination chain | 4 |
TRANSFER_COMPLETED | Transfer completed | 5 |
TRANSFER_TO_BE_REFUNDED | Transfer failed, should trigger refund flow, whether it is Pool-Based or Mint/Burn refund | 6 |
TRANSFER_REQUESTING_REFUND | cBridge gateway is preparing information for user's transfer refund | 7 |
TRANSFER_REFUND_TO_BE_CONFIRMED | The user should submit on-chain refund transaction based on information provided by this api | 8 |
TRANSFER_CONFIRMING_YOUR_REFUND | cBridge monitoring transfer refund status on source chain | 9 |
TRANSFER_REFUNDED | Transfer refund completed | 10 |
TRANSFER_DELAYED | Transfer is put into a delayed execution queue | 11 |
Type | Description | Code |
---|---|---|
UNKNOWN | Placeholder | 0 |
OK_TO_RELAY | TRANSFER_WAITING_FOR_SGN_CONFIRMATION | 1 |
SUCCESS | Transfer success | 2 |
BAD_LIQUIDITY | Not enough liquidity | 3 |
BAD_SLIPPAGE | Slippage is too low | 4 |
BAD_TOKEN | not supported token or token amount not available | 5 |
REFUND_REQUESTED | refund started | 6 |
REFUND_DONE | refund finished | 7 |
BAD_XFER_DISABLED | transfer for this token is disabled | 8 |
BAD_DEST_CHAIN | not supported destination chain | 9 |
We should focus on status types with BAD prefix, it shows the error reason for failed transfer transaction. Other status indicates normal transaction flow.
JavaScript
/// Code Sample
const statusRes = await getTransferStatus({ transfer_id: transferId }
Last modified 3mo ago