getTransaction
Returns information about a transaction by hash.
Usage
import { } from "./client";
const = await .({
: "0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d",
});
{ hash: "0xe54a939d7ecbc39610fc7c9b29f67943a04219e7a5235d412260d81721ca7d68", nonce: 0, blockHash: "0xf6cec5af1ee95f56038fc30589bcfeb4b960075c3c76b8a0eaa6d36e8e623b50", transactionIndex: 0, from: "cfx:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0sfbnjm2", to: "cfx:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0sfbnjm2", ...}import { http, createPublicClient } from 'cive'
import { mainnet } from 'cive/chains'
export const publicClient = createPublicClient({
chain: mainnet,
transport: http(),
})Returns
The transaction information.
Parameters
hash (required)
Get information about a transaction by hash.
const transaction = await publicClient.getTransaction({
hash: "0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d",
});