getTransactions
How to call the API from an app
const snapId = `npm:@hashgraph/hedera-wallet-snap`
const getTransactionsAPI = async () => {
const externalAccountParams = {
externalAccount: {
accountIdOrEvmAddress: '0.0.12345',
curve: 'ED25519'
}
}
/*
If you want to retrieve all the transactions for your account,
transactionId can be empty
*/
const getTransactionsParams = {
transactionId: '0.0.4228598@1706816923.997995813'
}
await window.ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId,
request: {
method: 'getTransactions',
params: {
network: 'testnet',
transactionId: getTransactionsParams.transactionId,
/*
Uncomment the below line if you want to connect
to a non-metamask account
*/
// ...externalAccountParams
}
}
}
})
}What the API does
Live Demo on CodePen
Last updated
Was this helpful?

