getTransactionHistory()
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / getTransactionHistory
Function: getTransactionHistory()
Section titled “Function: 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.
Parameters
Section titled “Parameters”params
Section titled “params”History retrieval parameters
Returns
Section titled “Returns”Promise<NEARTransactionHistoryResult>
Transaction history result with pagination
Example
Section titled “Example”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}`)}