getTransaction
Call this function to query the status of a submitted transaction. The input tx_id
should be a tx_id
returned by calling one of the contract execution functions.
Example Usage
import {Halliday} from "halliday-sdk";
// Previous Transaction
// Call an arbitrary contract.
const contractAddress = '0x1f6557356bfb310a556300a36fb18f54fb4791b1';
// The contract's ABI
const contractAbi = [...]; // Replace with your contract's ABI
// Create an instance of the contract
const contract = new ethers.Contract(contractAddress, contractAbi, signer);
// Get the calldata for a contract call
const calldata = contract.interface.encodeFunctionData('someFunction', ['arg1', 'arg2']);
// Call the contract, with gas sponsored by the paymaster.
const contractCallTxInfo = await hallidayClient.callContract({
from_in_game_player_id: userInGameId, // your user's id in your application
target_address: contractAddress,
value: "0",
calldata,
sponsor_gas: true,
});
// get transaction based on tx_id
const getTxInfo = await hallidayClient.getTransaction(contractCallTxInfo.tx_id)
Outputs
Promise to a GetTransactionReponse Object
Name | Type | Description |
---|---|---|
blockchain_type | string | The blockchain on which this transaction occurred (e.g. MUMBAI, ARBITRUM) |
tx_id | string | The ID of the transaction |
status | string | The status of the transaction (e.g. PENDING, COMPLETE, FAILED) |
retry_count | number | The number of times we've retried sending this transaction |
on_chain_id (optional) | string | The transaction hash on chain if the transaction succeeded |
error_message (optional) | string | The error message if the transaction failed |
user_op_receipt (optional) | string | JSON Object of the transaction receipt (if the transaction went through on chain) |
Updated about 13 hours ago
What’s Next