I am querying the testnet using fuel-ts sdk using the method getTransactionsByOwner
In the transaction that I see after decoding the raw transaction, the txPointer. block height is undefined. Where can i get the block height from txn data ?
We have the getTransactionsSummaries which seems to fit your use case, it can be used like so:
import { getTransactionsSummaries } from "fuels";
const summaries = await getTransactionsSummaries({
provider,
filters: {
owner: request.address,
}
});
for (const tx of summaries.transactions) {
console.log(tx.blockId);
console.log(tx.transaction.txPointer?.blockHeight)
}
It’s worth noting, that only transactions that have been accepted and processed by the node (with a type of SuccessStatus or FailureStatus) will have the appropriate block information. So, transactions pending execution (with a type of SubmittedStatus) will not contain any block information.
I am trying to query the testnet with the address for which i see some transactions on explorer (Is this the correct testnet explorer link ?): Fuel Explorer
However, when i query with this address, i see an empty array for transactions in the transactions summary results @p.s . Is it the correct explorer link for testnet ?
Also, is there any endpoint which filters transactions based on block numbers ? (provides transactions for an address after a certain block number)
Thanks @p.s for your response. For the code you suggested above, only returns the block ID (tx.blockId) and not the block number. Apparently i have to make another query to get the block height in number ?
I am using 0xbff2343fc5f189ed4f4531e857e10f216eab3f04435f4e1640a59faad9416957
on beta-5.
Also, is the data on https://app.fuel.network/ synced beta-5 network ?