Skip to content

Commit

Permalink
chore(btc): add handlerType.BTC_BLOCK (#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedragon authored Sep 26, 2024
1 parent 9d21f41 commit 0d7374a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/sdk/src/btc/btc-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class BTCPlugin extends Plugin {
this.handlers = handlers
}

supportedHandlers = [HandlerType.BTC_TRANSACTION]
supportedHandlers = [HandlerType.BTC_TRANSACTION, HandlerType.BTC_BLOCK]

processBinding(request: DataBinding): Promise<ProcessResult> {
switch (request.handlerType) {
Expand Down
16 changes: 8 additions & 8 deletions packages/sdk/src/btc/btc-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,31 +90,31 @@ export class BTCProcessor {
public onBlockInterval(
handler: (block: BTCBlock, ctx: BTCBlockContext) => PromiseOrVoid,
blockInterval = 250,
backfillBlockInterval = 1000
// fetchConfig?: Partial<FuelFetchConfig>
backfillBlockInterval = 1000,
fetchConfig?: BTCOnIntervalFetchConfig
): this {
return this.onInterval(
handler,
undefined,
{
recentInterval: blockInterval,
backfillInterval: backfillBlockInterval
}
// fetchConfig,
},
fetchConfig
)
}

public onTimeInterval(
handler: (block: BTCBlock, ctx: BTCBlockContext) => PromiseOrVoid,
timeIntervalInMinutes = 60,
backfillTimeIntervalInMinutes = 240
// fetchConfig?: Partial<FuelFetchConfig>,
backfillTimeIntervalInMinutes = 240,
fetchConfig?: BTCOnIntervalFetchConfig
): this {
return this.onInterval(
handler,
{ recentInterval: timeIntervalInMinutes, backfillInterval: backfillTimeIntervalInMinutes },
undefined
// fetchConfig
undefined,
fetchConfig
)
}
}
Expand Down

0 comments on commit 0d7374a

Please sign in to comment.