Skip to content

getTransactionHistory()

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / getTransactionHistory

getTransactionHistory(params): Promise<NEARTransactionHistoryResult>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:19042

Get transaction history for a NEAR privacy wallet

Scans the blockchain for stealth address announcements and returns transactions belonging to the provided viewing key.

Note: In production, this would integrate with a blockchain indexer for efficient announcement fetching. Currently uses the scanner API which requires announcements to be pre-fetched.

NEARTransactionHistoryParams

History retrieval parameters

Promise<NEARTransactionHistoryResult>

Transaction history result with pagination

const history = await getTransactionHistory({
rpcUrl: 'https://rpc.mainnet.near.org',
viewingPrivateKey: '0x...',
spendingPrivateKey: '0x...',
limit: 20,
})
for (const tx of history.transactions) {
console.log(`${tx.type}: ${tx.amountFormatted} ${tx.token}`)
}