Skip to content

BrowserExtensionChannel

Defined in: src/extension/browserExtensionChannel.ts:30

A Channel implementation that communicates with a browser extension signer via the ICRC-94 provider API.

Messages are sent through providerDetail.sendMessage and responses are validated as JSON-RPC before being dispatched to listeners. The channel is automatically closed if the extension fires an icrc94:unexpectedlyClosed event.

new BrowserExtensionChannel(options): BrowserExtensionChannel

Defined in: src/extension/browserExtensionChannel.ts:36

BrowserExtensionChannelOptions

BrowserExtensionChannel

get closed(): boolean

Defined in: src/extension/browserExtensionChannel.ts:54

Whether this channel has been closed.

boolean

Channel.closed

addEventListener(…__namedParameters): () => void

Defined in: src/extension/browserExtensionChannel.ts:58

["close", () => void] | ["response", (response) => void]

() => void

Channel.addEventListener


close(): Promise<void>

Defined in: src/extension/browserExtensionChannel.ts:98

Dismisses the extension and notifies all close listeners.

Promise<void>

Channel.close


send(request): Promise<void>

Defined in: src/extension/browserExtensionChannel.ts:83

Sends a JSON-RPC request to the extension via providerDetail.sendMessage. The response is validated as JSON-RPC before being dispatched. Non-JSON-RPC responses are silently ignored.

JsonRpcRequest

The JSON-RPC request to send to the extension.

Promise<void>

Channel.send