/** * Client for Arcade transaction status updates. * * Uses react-native-sse EventSource to connect to Arcade's * `GET /events?callbackToken=` endpoint for real-time status updates. */ export interface ArcSSEEvent { txid: string; txStatus: string; timestamp: string; /** Transport cursor attached by ArcSSEClient; not part of Arcade's JSON payload. */ eventId?: string; /** ARC rejection code supplied by Arcade for classifiable REJECTED events. */ status?: number; /** Arcade's validator or network rejection detail. */ extraInfo?: string; blockHash?: string; blockHeight?: number; merklePath?: string; } export interface ArcSSEClientOptions { /** Base URL of the Arcade instance (e.g. "https://arcade-us-1.bsvb.tech") */ baseUrl: string; /** Stable per-wallet token matching the X-CallbackToken sent on broadcast */ callbackToken: string; /** Server-level API key for Authorization header (from ArcConfig.apiKey) */ arcApiKey?: string; /** Called for each status event received; resolution acknowledges durable processing. */ onEvent: (event: ArcSSEEvent) => void | Promise; /** Called when a connection or processing error occurs. Callback failures are contained. */ onError?: (error: Error) => void | Promise; /** Initial lastEventId for catchup */ lastEventId?: string; /** Called after event processing and before lastEventId advances. */ onLastEventIdChanged?: (lastEventId: string) => void | Promise; /** Maximum UTF-8 bytes admitted for one status event. Default: 262144; maximum: 8388608. */ maxEventBytes?: number; /** Maximum received events retained while earlier work commits. Default: 64; maximum: 4096. */ maxPendingEvents?: number; /** Maximum aggregate bytes retained while earlier work commits. Default: 4194304; maximum: 67108864. */ maxPendingBytes?: number; /** Optional fixed-message operational logger. The client is silent by default. */ log?: (message: string) => void; /** The react-native-sse EventSource class — passed in to avoid import from wallet-toolbox */ EventSourceClass: any; } export declare class ArcSSEClient { private _lastEventId; private es; private readonly url; private readonly options; private connected; private connecting; private generation; private processingGeneration; private readonly pendingEvents; private pendingBytes; constructor(options: ArcSSEClientOptions); get lastEventId(): string | undefined; /** Open the SSE connection. Events are processed serially in exact arrival order. */ connect(): void; private receiveStatusEvent; private startDrain; private drainEvents; private terminateSource; private reportError; private emitLog; /** Close the connection, discard unacknowledged network events, and reset lifecycle state. */ close(): void; /** Ensure a connection is open; events still commit asynchronously in arrival order. */ fetchEvents(): Promise; } //# sourceMappingURL=ArcSSEClient.d.ts.map