Embedded Wallets
SDK
Javascript
How to
Wallet Operation
Transaction Details

Transaction Details

This method allows you to retrieve details for a specific transaction using its hash.

Method Signature

async getTransactionDetails(config: TransactionDetailsConfig): Promise<TransactionDetailResponse>

Parameters

config: TransactionDetailsConfig - An object with the following properties:

  • network: Network (required) - The network used for transactions.
  • transactionHash: string (required) - The transaction hash to look up.
  • walletToken: string (required) - The wallet token of the wallet to get the transaction details for.
  • refreshToken: string (optional) - The refresh token for authentication. Use this if you want to allow SDK automatically refresh the wallet token.

Returns

Promise<TransactionDetailResponse> - An object containing the transaction details.

Example Usage

const transactionDetail = await sdk.wallet.getTransactionDetails({
  network: Network.ETHEREUM,
  transactionHash: '0x44222fb6d2c4e4c7fff099f33b92acb7899e55d6a470d5b92906642f9da14349',
  walletToken: 'your-wallet-token',
  refreshToken: 'your-refresh-token' // Optional
});
console.log(transactionDetail);

Response Example

{
  "transactionDetail": {
    "_type": "TransactionReceipt",
    "blockHash": "0xad2025a00b6eb0a3c60e01dc4e2517c7f32277dfba8af9e92b56c1b5dc9d67e6",
    "blockNumber": 21136542,
    "contractAddress": null,
    "cumulativeGasUsed": "12572215",
    "from": "0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5",
    "gasPrice": "20781380515",
    "gasUsed": "21000",
    "hash": "0x44222fb6d2c4e4c7fff099f33b92acb7899e55d6a470d5b92906642f9da14349",
    "index": 149,
    "logs": [],
    "logsBloom": "0x0000...",
    "status": 1,
    "to": "0xcDA9D71bdfAe59b89Cee131eD3079f8AC4c77062"
  },
  "walletToken": "your-new-wallet-token",
  "refreshToken": "your-new-refresh-token"
}
ℹ️

The SDK will automatically refresh the wallet token and return the new wallet token and refresh token if the refresh token is provided.

Additional Information

  • This method requires a valid wallet token in the SDK configuration.
  • The transaction hash must be a valid hash for the specified network.
  • The response includes detailed information about the transaction's execution and its placement in the blockchain.

For more information, see the Xellar Transaction Detail API Documentation (opens in a new tab).