钱包 API
查询交易详情

查询交易详情#

在交易历史列表中只有基本信息,使用 GET /api/v5/waas/transaction/get-transaction-detail 接口来获取交易详情信息。

//定义你的参数
const params = {
    walletId: '13886e05-1265-4b79-8ac3-b7ab46211001',
    orderId: '469356614923743232',
    chainId: '1'
  };

//定义辅助函数
const getTransactionDetailData = async () => {
    const apiRequestUrl = getRequestUrl(
      apiBaseUrl,
      '/api/v5/waas/transaction/get-transactions',
      params
    );
    return fetch(apiRequestUrl, {
      method: 'GET',
      headers: headersParams,
    })
      .then((res) => res.json())
      .then((res) => {
        return res;
      });
  };

const { data: transactionDetailData } = await getTransactionDetailData();

查询详情成功后,你将收到如下的响应:

{
	"code": 0,
	"msg": "success",
	"data": [{
		"chainId": "1",
		"orderId": "469356614923743232",
		"txhash": null,
		"address": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2",
		"fromAddr": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2",
		"toAddr": "0x1e80c39051f078ee34763282cbb36ffd88b40c65",
		"txType": "2",
		"txTime": "1697547606177",
		"txStatus": "3",
		"exploreUrl": "",
		"gasPrice": "null",
		"priorityFee": "null",
		"gasLimit": "null",
		"nonce": "null",
		"assetChange": [{
			"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"
		}]
	}]
}