npm-package-near-batch-receipt
v1.0.0
Published
npm Package - near-batch-receipt
Downloads
138
Readme
npm-package-near-batch-receipt
Fetch and filter NEAR blockchain receipts with ease — single, batch, by block, or by transaction.
Installation
npm install npm-package-near-batch-receipt
API & Usage
getReceipt(receiptId: string)
Fetch a single receipt by its ID.
import { getReceipt } from 'npm-package-near-batch-receipt';
const receipt = await getReceipt('AzureReceiptId123'); console.log(receipt);
getBatchReceipts(receiptIds: string[])
Fetch multiple receipts in parallel.
import { getBatchReceipts } from 'npm-package-near-batch-receipt';
const receipts = await getBatchReceipts(['id1', 'id2', 'id3']); console.log(receipts);
getReceiptsByBlock(blockHash: string)
Fetch all receipts included in a specific block.
import { getReceiptsByBlock } from 'npm-package-near-batch-receipt';
const receipts = await getReceiptsByBlock('BlockHashABC123'); console.log(receipts);
getReceiptsByTx(txHash: string)
Fetch all receipts produced by a transaction.
import { getReceiptsByTx } from 'npm-package-near-batch-receipt';
const receipts = await getReceiptsByTx('TxHash456'); console.log(receipts);
filterReceiptsByReceiver(receipts: Record<string, unknown>[], receiverId: string)
Filter an array of receipts by receiver account ID.
import { getReceiptsByBlock, filterReceiptsByReceiver } from 'npm-package-near-batch-receipt';
const receipts = await getReceiptsByBlock('BlockHashABC123'); const filtered = filterReceiptsByReceiver(receipts, 'alice.near'); console.log(filtered);
License
MIT
