diff --git a/src/events.ts b/src/events.ts index 82089e2..b161542 100644 --- a/src/events.ts +++ b/src/events.ts @@ -265,11 +265,11 @@ export type EventScraperProps = { deleteOptions?: DeleteOptions; tokenMetadataMap?: TokenMetadataMap; postProcess?: any; - filterFunction?: (events: Event[], transaction: Transaction, allowedTxnList?: Set) => Event[]; + filterFunction?: (events: Event[], transaction: Transaction, requiredTxnList?: Set) => Event[]; filterFunctionGetContext?: ( events: Event[], web3Source: Web3Source, - allowedTxnList?: Set, + requiredTxnList?: Set, ) => Promise; }; diff --git a/src/filters/erc20_transfer_events.ts b/src/filters/erc20_transfer_events.ts index 5f02e39..47b0931 100644 --- a/src/filters/erc20_transfer_events.ts +++ b/src/filters/erc20_transfer_events.ts @@ -5,13 +5,13 @@ import { getParseTxsAsync } from '../scripts/utils/web3_utils'; export async function filterERC20TransferEventsGetContext( events: Event[], web3Source: Web3Source, - allowedTxnList?: Set, + requiredTxnList?: Set, ): Promise { if (events.length > 0) { const txHashes = events.map((log: Event) => log.transactionHash); let validTxHashSet: Set; - if (allowedTxnList && allowedTxnList.size > 0) { - validTxHashSet = allowedTxnList; + if (requiredTxnList && requiredTxnList.size > 0) { + validTxHashSet = requiredTxnList; } else { const txData = await getParseTxsAsync(web3Source, txHashes); const filteredTxsHashes = txData.parsedTxs @@ -30,11 +30,11 @@ export async function filterERC20TransferEventsGetContext( export function filterERC20TransferEvents( events: Event[], transaction: Transaction, - allowedTxnList?: Set, + requiredTxnList?: Set, ): Event[] { const filteredEvents = new Set(); - if (allowedTxnList && allowedTxnList.size > 0 && allowedTxnList.has(transaction.transactionHash)) { + if (requiredTxnList && requiredTxnList.size > 0 && requiredTxnList.has(transaction.transactionHash)) { events.filter((e) => e !== null).forEach((e) => filteredEvents.add(e)); }