PostMessageChannel
Defined in: src/web/postMessageChannel.ts:42
A Channel implementation that communicates with a signer
via window.postMessage. Created by PostMessageTransport
after the ICRC-29 heartbeat handshake completes.
Messages are filtered by source window and origin to prevent
cross-origin interference. When the signer status is "pending",
outgoing messages are queued and flushed when it becomes "ready".
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PostMessageChannel(
options):PostMessageChannel
Defined in: src/web/postMessageChannel.ts:48
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”PostMessageChannel
Accessors
Section titled “Accessors”closed
Section titled “closed”Get Signature
Section titled “Get Signature”get closed():
boolean
Defined in: src/web/postMessageChannel.ts:58
Whether this channel has been closed.
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”addEventListener()
Section titled “addEventListener()”addEventListener(…
__namedParameters): () =>void
Defined in: src/web/postMessageChannel.ts:62
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”["close", () => void] | ["response", (response) => void]
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”changeStatus()
Section titled “changeStatus()”changeStatus(
status):void
Defined in: src/web/postMessageChannel.ts:145
Updates the signer status. When transitioning to "ready",
all queued messages are flushed to the signer window.
Parameters
Section titled “Parameters”status
Section titled “status”"pending" | "ready"
The new signer status.
Returns
Section titled “Returns”void
close()
Section titled “close()”close():
Promise<void>
Defined in: src/web/postMessageChannel.ts:122
Closes the signer window and notifies all close listeners.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”send()
Section titled “send()”send(
request):Promise<void>
Defined in: src/web/postMessageChannel.ts:99
Sends a JSON-RPC request to the signer. If the signer status is
"pending", the request is queued until changeStatus is
called with "ready".
Parameters
Section titled “Parameters”request
Section titled “request”JsonRpcRequest
The JSON-RPC request to send.
Returns
Section titled “Returns”Promise<void>