Search…
Watcher API
The Watcher API runs over the watcher service and returns status of cross-chain transactions from cached data in the DB
​
The Watcher API has two endpoints :
1. /api/v1/sync-status
2. /api/v1/transaction-status
​
How this API is used in Socket :
  • The watcher API is used to track whether a cross-chain bridging transaction has completed or not
  • In case of bridges such as Polygon Native Bridge where a claiming/exit transaction is required on the destination chain to claim tokens, the watcher API can be used to alert a user when claiming is available
​

/api/v1/sync-status

Checks the sync status of the watcher service across chains
get
https://watcherapi.fund.movr.network/api/v1
/sync-status
Returns the sync status of watcher service for a given chain

Description of response parameters

Parameters
Description
success
Indicates successful response from endpoint, as intended.
isSyncing
Boolean value indicating if watcher is actively syncing
latestSyncedBlock
Latest block of chain synced by watcher
currentBlock
Current block added on the chain

Example :

Checking the sync status of xDai on Socket watcher API

QUERY PARAMETERS

Parameter
Value
ChainId
100

REQUEST

RESPONSE

Response body
​
{
"success": true,
"result": {
"isSyncing": true,
"latestSyncedBlock": 19162354,
"currentBlock": 19162359
}
}
​

/api/v1/transaction-status

Checks the status of a cross-chain transaction
get
https://watcherapi.fund.movr.network/api/v1
/transaction-status
Returns the status of cross-chain transaction
NOTE : For Polygon Native Bridge and Arbitrum Native Bridge, the bridgeName paramater is required to be filled in. For the others, it is optional.

Description of response parameters :

Parameter
Description
success
Indicates successful response from endpoint, as intended.
sourceTx
Transaction hash of source transaction
sourceTxStatus
Status of transaction on source chain
destinationTxStatus
Status of transaction on destination chain
isActionRequired
Boolean value indicating if action is required by the user for completion of the transaction
fromChainId
ID of sending/source chain
toChainId
ID of destination chain

Example :

Checking the status of Polygon Native bridge transaction from Polygon to Ethereum

QUERY PARAMETERS

Parameter
Value
transactionHash
0xa8fcdcb66b36b863c7b7081c525452602820256464798408570784bf3cdb2c0d
fromChainId
137
toChainId
1
bridgeName
polygon-native

REQUEST

RESPONSE

Response body
​
{
"success": true,
"result": {
"sourceTx": "0xa8fcdcb66b36b863c7b7081c525452602820256464798408570784bf3cdb2c0d",
"sourceTxStatus": "PENDING",
"destinationTxStatus": "PENDING",
"isActionRequired": false,
"fromChainId": 137,
"toChainId": 1
}
}
Copy link
On this page
get
Returns the sync status of watcher service for a given chain
Description of response parameters
Example :
get
Returns the status of cross-chain transaction
Description of response parameters :
Example :