Make Blockchain Subscribe methods return Unsubscribe callback
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
type BlockchainCallback,
|
||||
type BlockchainUTXOs,
|
||||
type BlockchainTransactions,
|
||||
type BlockchainUnsubscribeCallback,
|
||||
} from './types.js';
|
||||
|
||||
import { Transaction } from '@xocash/primitives';
|
||||
@@ -109,7 +110,7 @@ export abstract class BaseBlockchain<
|
||||
abstract subscribeLockscript(
|
||||
lockscript: string | Uint8Array,
|
||||
callback: BlockchainCallback<AddressNotificationPayload>,
|
||||
): Promise<void>;
|
||||
): Promise<BlockchainUnsubscribeCallback>;
|
||||
|
||||
/**
|
||||
* Removes a subscription for a specific blockchain address.
|
||||
@@ -136,7 +137,7 @@ export abstract class BaseBlockchain<
|
||||
abstract subscribeAddress(
|
||||
address: string,
|
||||
callback: BlockchainCallback<AddressNotificationPayload>,
|
||||
): Promise<void>;
|
||||
): Promise<BlockchainUnsubscribeCallback>;
|
||||
|
||||
/**
|
||||
* Removes a subscription for a specific blockchain address.
|
||||
@@ -163,7 +164,7 @@ export abstract class BaseBlockchain<
|
||||
abstract subscribeTransaction(
|
||||
transactionHash: string,
|
||||
callback: BlockchainCallback<TransactionNotificationPayload>,
|
||||
): Promise<void>;
|
||||
): Promise<BlockchainUnsubscribeCallback>;
|
||||
|
||||
/**
|
||||
* Removes a subscription for a specific transaction.
|
||||
|
||||
Reference in New Issue
Block a user