Historical Transaction Data for Wallet Address

The full API reference for our /history endpoint can be found in the API reference section.

Whether you want to see the progress of an active transaction or re-call the status of past transactions for a certain wallet address, you can use the /history endpoint to retrieve such data. It will return a list of all relevant transactions for the supplied wallet address. You can filter by either bridge, source chain or destination chain to drill down to the specific range of transactions you are looking for.

You can query the /history endpoint in the following manner:

const getHistory = async (userAddress) => {
  const result = await axios.get(
    'https://swap.prod.swing.xyz/v0/transfer/history',
    {
      userAddress: userAddress,
    }
  )
  return result.data.transactions
}

The result contains a list of transactions (in all stages) that look like the following:

{
  "bridge": "debridge",
  "id": 1341,
  "status": "Completed",
  "refundReason": "",
  "needClaim": false,
  "txId": "0x922751a57c52317fe8a6b69a18197195ea8ca3ccd9cf634b06b50717d2d8b016",
  "txStartedTimestamp": 1670344719,
  "fromUserAddress": "0x4C904f5C12B86AAA4cA1d35d52D2c0064618A737",
  "toUserAddress": null,
  "fromTokenAddress": "0x1dDcaa4Ed761428ae348BEfC6718BCb12e63bFaa",
  "fromAmount": "1996829",
  "fromAmountUsdValue": "0",
  "fromChainId": 56,
  "fromChainSlug": "bsc",
  "fromChainTxHash": "0x922751a57c52317fe8a6b69a18197195ea8ca3ccd9cf634b06b50717d2d8b016",
  "toTokenAddress": "0x1dDcaa4Ed761428ae348BEfC6718BCb12e63bFaa",
  "toAmount": "1582989",
  "toAmountUsdValue": "0",
  "toChainId": 137,
  "toChainSlug": "polygon",
  "toChainTxHash": "0x8b68b3c2eee956e2ff52995249b3d7ec370d57dadfb7d4e1efdd5e4f676e5f95",
  "sourceIpAddress": null,
  "sourceReferrer": null,
  "originalTx": false,
  "updatedAt": "2022-12-09T21:44:04.465Z",
  "createdAt": "2022-12-06T16:38:39.000Z"
}

Next, lets learn how to check the status of a transfer. Navigate to the next section 👈