@@ -57,14 +57,8 @@ export type GetContractEventsResult<
5757
5858export type GetLogsParamsExtra = {
5959 signature ?: string ;
60- insightTopicFilters ?: InsightTopicFilter [ ] ;
6160} & GetLogsParams ;
6261
63- export type InsightTopicFilter = {
64- topic : Hex ;
65- index : 1 | 2 | 3 ;
66- } ;
67-
6862/**
6963 * Retrieves events from a contract based on the provided options.
7064 * @param options - The options for retrieving events.
@@ -120,9 +114,7 @@ export async function getContractEvents<
120114 > [ ] ,
121115 const TStrict extends boolean = true ,
122116> (
123- options : GetContractEventsOptions < abi , abiEvents , TStrict > & {
124- insightTopicFilters ?: InsightTopicFilter [ ] ;
125- } ,
117+ options : GetContractEventsOptions < abi , abiEvents , TStrict > ,
126118) : Promise < GetContractEventsResult < abiEvents , TStrict > > {
127119 const { contract, events, blockRange, ...restParams } = options ;
128120
@@ -190,7 +182,6 @@ export async function getContractEvents<
190182 address : getAddress ( contract . address ) ,
191183 topics : e . topics ,
192184 signature : `${ e ?. abiEvent . name } (${ e ?. abiEvent . inputs . map ( ( i ) => i . type ) . join ( "," ) } )` ,
193- insightTopicFilters : options . insightTopicFilters ,
194185 } ) )
195186 : // otherwise we want "all" events (aka not pass any topics at all)
196187 [ { ...restParams , address : getAddress ( contract . address ) } ] ;
@@ -229,9 +220,8 @@ async function getLogsFromInsight(options: {
229220 chain : Chain ;
230221 client : ThirdwebClient ;
231222 signature ?: string ;
232- insightTopicFilters ?: InsightTopicFilter [ ] ;
233223} ) : Promise < Log [ ] > {
234- const { params, chain, client, signature, insightTopicFilters } = options ;
224+ const { params, chain, client, signature } = options ;
235225
236226 const chainServices = await getChainServices ( chain ) ;
237227 const insightEnabled = chainServices . some (
@@ -277,12 +267,12 @@ async function getLogsFromInsight(options: {
277267 }
278268 }
279269
280- if ( insightTopicFilters ) {
281- for ( const topicFilter of insightTopicFilters ) {
282- url . searchParams . set (
283- `filter_topic_ ${ topicFilter . index } ` ,
284- topicFilter . topic ,
285- ) ;
270+ if ( params . topics ) {
271+ const args = params . topics . slice ( 1 ) ;
272+ for ( const [ i , a ] of args . entries ( ) ) {
273+ if ( a ) {
274+ url . searchParams . set ( `filter_topic_ ${ i + 1 } ` , a as Hex ) ;
275+ }
286276 }
287277 }
288278
0 commit comments