CAIP-319 defines a JSON-RPC method for a wallet to send notifications to a caller in a context authorized by or in a valid scopeObject and, optionally, tagged with a sessionId for maintaining session continuity if applicable.
This proposal aims to define a standard method for wallets to send notifications to callers regarding events or state changes related to a specific, previously-authorized target network (such as nodes of a specific blockchain or consensus community within a protocol). It requires a valid scopeObject. It MAY be tagged with a sessionId if the CAIP-25 session in which it is authorized is keyed by a sessionId (see CAIP-316 for more details). These two properties MAY be inherited from a persistent session created by CAIP-25, but could also be used as part of other session management mechanisms.
The motivation for this proposal comes from the need for standardized, chain-specific notifications from wallets to applications in a concurrent multi-chain connection where methods and notifications with the same namespace may exist across chains or namespaces.
The wallet is able to send a single JSON-RPC notification accompanied by a
CAIP-2 compatible chainId, and optionally scoped by the
sessionId of a pre-existing session if applicable.
The wallet or user agent would send a notification to the application as follows:
The JSON-RPC method is labeled as wallet_notify and expects two required
parameters:
Additionally, it MAY include an optional parameter:
sessionId referencing a known, open sessionAs this syntax simply provides a wrapper to a standard JSON-RPC notification and functions as one itself, no response is expected from the application. The wallet or user agent SHOULD NOT wait for a response before continuing its operations.
Copyright and related rights waived via CC0.