Wallet API
Query transaction history

Query transaction history#

After sending the transaction, you can call the POST /api/v5/waas/transaction/get-transactions API to query the transaction history and view the current transaction status.

//Define your parameters
const getTransactionBody = {
     walletId: '13886e05-1265-4b79-8ac3-b7ab46211001',
     limit: '5'
   };

//Define auxiliary function
const getTransactionData = async () => {
     const apiRequestUrl = getRequestUrl(
       apiBaseUrl,
       '/api/v5/waas/transaction/get-transactions'
     );
     return fetch(apiRequestUrl, {
      method: 'post',
      headers: headersParams,
      body: JSON.stringify(getTransactionBody),
     })
       .then((res) => res.json())
       .then((res) => {
         return res;
       });
   };

const { data: transactionData } = await getTransactionData();

After successfully querying transaction history, you will receive the following response:

{
	"code": 0,
	"msg": "success",
	"data": [
		{
			"chainId": "1",
			"orderId": "469367099106684928",
			"txHash": "0xff54b6c6195ea4d948d03bfd818d365cf1751098",
			"fromAddr": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2",
			"toAddr": "0x1e80c39051f078ee34763282cbb36ffd88b40c65",
			"txType": "2",
			"txTime": "1697550105768",
			"txStatus": "1",
			"rowId": "1697550105768",
			"assetSummary": [{
				"coinId": "3",
				"direction": "2",
				"coinAmount": "0.00012300000000000",
				"coinAmountNum": "123000000000000",
				"precision": "18",
				"coinSymbol": "ETH",
				"coinName": "ETH",
				"currencyAmount": null,
				"coinLogoUrl": "https://static.coinall.ltd/cdn/wallet/logo/ETH-20220328.png"
			}]
		},
		// ...more transaction records
	]
}