Skip to content

Commit ae059f8

Browse files
committed
fix: 🐛 Fixed invalid onLogs interface
1 parent 3c68a31 commit ae059f8

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

packages/contracts-manger/src/index.ts

+16-7
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ export class ProtocolContracts<
702702
* @param {TAbi} abi The ABI of the contract to subscribe to.
703703
* @param {Address} address The address of the contract.
704704
* @param {InferEventName<TAbi, TEventName>} eventName The name of the event.
705-
* @param {(logs: GetFilterLogsReturnType<TAbi>) => void} onLogs Callback to execute when logs are received.
705+
* @param {(logs: GetFilterLogsReturnType<TAbi>, maxBlockNumber: bigint) => void} onLogs Callback to execute when logs are received.
706706
* @param {bigint} [fromBlock] The block number from which to start listening for events.
707707
* @param {number} [pollInterval=1000] The interval in milliseconds at which to poll for new events.
708708
* @returns {() => void} A promise that resolves to an unsubscribe function.
@@ -782,14 +782,17 @@ export class ProtocolContracts<
782782
*
783783
* @template TEventName Type of event name.
784784
* @param {InferEventName<typeof marketABI, TEventName>} eventName The event name to subscribe to.
785-
* @param {(logs: GetFilterLogsReturnType<typeof marketABI>) => void} onLogs Callback for when logs are received.
785+
* @param {(logs: GetFilterLogsReturnType<typeof marketABI>, maxBlockNumber: bigint) => void} onLogs Callback for when logs are received.
786786
* @param {bigint} [fromBlock] Starting block number for listening for events.
787787
* @param {number} [pollInterval=1000] Polling interval in milliseconds.
788788
* @returns {() => void} Unsubscribe function.
789789
*/
790790
subscribeMarket<TEventName extends string | undefined = undefined>(
791791
eventName: InferEventName<typeof marketABI, TEventName>,
792-
onLogs: (logs: GetFilterLogsReturnType<typeof marketABI>) => void,
792+
onLogs: (
793+
logs: GetFilterLogsReturnType<typeof marketABI>,
794+
maxBlockNumber: bigint,
795+
) => void,
793796
fromBlock?: bigint,
794797
pollInterval: number = 1000,
795798
): () => void {
@@ -808,14 +811,17 @@ export class ProtocolContracts<
808811
*
809812
* @template TEventName Type of event name.
810813
* @param {InferEventName<typeof entitiesRegistryABI, TEventName>} eventName The event name to subscribe to.
811-
* @param {(logs: GetFilterLogsReturnType<typeof entitiesRegistryABI>) => void} onLogs Callback for when logs are received.
814+
* @param {(logs: GetFilterLogsReturnType<typeof entitiesRegistryABI>, maxBlockNumber: bigint) => void} onLogs Callback for when logs are received.
812815
* @param {bigint} [fromBlock] Starting block number for listening for events.
813816
* @param {number} [pollInterval=1000] Polling interval in milliseconds.
814817
* @returns {() => void} Unsubscribe function.
815818
*/
816819
subscribeEntities<TEventName extends string | undefined = undefined>(
817820
eventName: InferEventName<typeof entitiesRegistryABI, TEventName>,
818-
onLogs: (logs: GetFilterLogsReturnType<typeof entitiesRegistryABI>) => void,
821+
onLogs: (
822+
logs: GetFilterLogsReturnType<typeof entitiesRegistryABI>,
823+
maxBlockNumber: bigint,
824+
) => void,
819825
fromBlock?: bigint,
820826
pollInterval: number = 1000,
821827
): () => void {
@@ -834,14 +840,17 @@ export class ProtocolContracts<
834840
*
835841
* @template TEventName Type of event name.
836842
* @param {InferEventName<typeof configABI, TEventName>} eventName The event name to subscribe to.
837-
* @param {(logs: GetFilterLogsReturnType<typeof configABI>) => void} onLogs Callback for when logs are received.
843+
* @param {(logs: GetFilterLogsReturnType<typeof configABI>, maxBlockNumber: bigint) => void} onLogs Callback for when logs are received.
838844
* @param {bigint} [fromBlock] Starting block number for listening for events.
839845
* @param {number} [pollInterval=1000] Polling interval in milliseconds.
840846
* @returns {() => void} Unsubscribe function.
841847
*/
842848
subscribeConfig<TEventName extends string | undefined = undefined>(
843849
eventName: InferEventName<typeof configABI, TEventName>,
844-
onLogs: (logs: GetFilterLogsReturnType<typeof configABI>) => void,
850+
onLogs: (
851+
logs: GetFilterLogsReturnType<typeof configABI>,
852+
maxBlockNumber: bigint,
853+
) => void,
845854
fromBlock?: bigint,
846855
pollInterval: number = 1000,
847856
): () => void {

0 commit comments

Comments
 (0)