From 77c9d8ff6a87cc24e0f0bc6770882e670e675561 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 2 Jul 2024 21:44:34 +0300 Subject: [PATCH] fix: streams cancellation error (#18) Co-authored-by: segfaultdoctor --- src/sdk/block-engine/searcher.ts | 2 +- src/sdk/geyser/geyser.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sdk/block-engine/searcher.ts b/src/sdk/block-engine/searcher.ts index 7c82fe8..fb80fc1 100644 --- a/src/sdk/block-engine/searcher.ts +++ b/src/sdk/block-engine/searcher.ts @@ -147,7 +147,7 @@ export class SearcherClient { errorCallback(new Error(`Stream error: ${e.message}`)); }); - return stream.cancel; + return () => stream.cancel(); } /** diff --git a/src/sdk/geyser/geyser.ts b/src/sdk/geyser/geyser.ts index c6c5d40..5f608d6 100644 --- a/src/sdk/geyser/geyser.ts +++ b/src/sdk/geyser/geyser.ts @@ -71,7 +71,7 @@ export class GeyserClient { errorCallback(new Error(`Stream error: ${e.message}`)) ); - return stream.cancel; + return () => stream.cancel(); } /** @@ -102,7 +102,7 @@ export class GeyserClient { errorCallback(new Error(`Stream error: ${e.message}`)) ); - return stream.cancel; + return () => stream.cancel(); } /** @@ -130,7 +130,7 @@ export class GeyserClient { errorCallback(new Error(`Stream error: ${e.message}`)) ); - return stream.cancel; + return () => stream.cancel(); } }