Skip to content

[core] Watchers #281

@catmcgee

Description

@catmcgee

watchAccount(address)

Add a watcher inside @gillsdk/core for a single account that streams updates via WebSocket and falls back to polling

watchAccount(address: PublicKey, opts?: { commitment?: Commitment; transport?: WsTransport })

use makeDurableWs by default - fallback to polling if WS transport is not available

emit { slot, accountInfo } on change

remember to handle disconnects/reconnects cleanly!

watchProgramLogs(programId)

add a watcher for program logs, with reconnect + filtering support

watchProgramLogs(programId: PublicKey, opts?: { filter?: 'all'|'error'|'success'; transport?: WsTransport }

parse logs into { signature, slot, logs[] }

allow for filtering and expose an unsubscribe function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions