import { Socket } from 'socket.io-client'; import type { ManagerOptions, SocketOptions } from 'socket.io-client'; import type { AddressStxBalanceResponse, AddressTransactionWithTransfers, Block, ClientToServerMessages, MempoolTransaction, Microblock, NftEvent, ServerToClientMessages, Topic, Transaction } from '../types'; export type StacksApiSocket = Socket; export type StacksApiSocketConnectionOptions = { url?: string; /** Initial topics to subscribe to. */ subscriptions?: Topic[]; socketOpts?: Partial; }; export declare class StacksApiSocketClient { readonly socket: StacksApiSocket; constructor(socket: StacksApiSocket); constructor(opts?: StacksApiSocketConnectionOptions); static connect(opts?: StacksApiSocketConnectionOptions): StacksApiSocketClient; handleSubscription(topic: Topic, subscribe?: boolean, listener?: (...args: any[]) => void): { unsubscribe: () => void; }; subscribeBlocks(listener?: (tx: Block) => void): { unsubscribe: () => void; }; unsubscribeBlocks(): void; subscribeMicroblocks(listener?: (tx: Microblock) => void): { unsubscribe: () => void; }; unsubscribeMicroblocks(): void; subscribeMempool(listener?: (tx: MempoolTransaction) => void): { unsubscribe: () => void; }; unsubscribeMempool(): void; subscribeAddressTransactions(address: string, listener?: (address: string, tx: AddressTransactionWithTransfers) => void): { unsubscribe: () => void; }; unsubscribeAddressTransactions(address: string): void; subscribeAddressStxBalance(address: string, listener?: (address: string, stxBalance: AddressStxBalanceResponse) => void): { unsubscribe: () => void; }; unsubscribeAddressStxBalance(address: string): void; subscribeTransaction(txId: string, listener?: (tx: MempoolTransaction | Transaction) => void): { unsubscribe: () => void; }; unsubscribeTransaction(txId: string): void; subscribeNftEvent(listener?: (event: NftEvent) => void): { unsubscribe: () => void; }; unsubscribeNftEvent(): void; subscribeNftAssetEvent(assetIdentifier: string, value: string, listener?: (assetIdentifier: string, value: string, event: NftEvent) => void): { unsubscribe: () => void; }; unsubscribeNftAssetEvent(assetIdentifier: string, value: string): void; subscribeNftCollectionEvent(assetIdentifier: string, listener?: (assetIdentifier: string, event: NftEvent) => void): { unsubscribe: () => void; }; unsubscribeNftCollectionEvent(assetIdentifier: string): void; logEvents(): void; }