BidirectionalTransport
Defined in: packages/dapp/src/transport/types.ts:36
Bidirectional transport that can also receive messages.
Extends
Section titled “Extends”Methods
Section titled “Methods”notify()
Section titled “notify()”notify(
event,payload,target?):void
Defined in: packages/dapp/src/transport/types.ts:52
Send a wallet-pushed notification to listeners.
Parameters
Section titled “Parameters”string
Notification method name
payload
Section titled “payload”unknown
Notification params payload
target?
Section titled “target?”string
Optional routing key for browser-extension messaging
Returns
Section titled “Returns”void
onNotification()
Section titled “onNotification()”onNotification(
listener): () =>void
Defined in: packages/dapp/src/transport/types.ts:43
Subscribe to wallet-pushed JSON-RPC notifications.
Parameters
Section titled “Parameters”listener
Section titled “listener”Notification callback invoked for id-less request frames
Returns
Section titled “Returns”Unsubscribe function
():
void
Returns
Section titled “Returns”void
submit()
Section titled “submit()”submit(
payload):Promise<{[key:string]:unknown;result?:unknown; } | {[key:string]:unknown;error: {code:number;data?:unknown;message:string; }; }>
Defined in: packages/dapp/src/transport/types.ts:30
Submit an RPC request and wait for response.
Parameters
Section titled “Parameters”payload
Section titled “payload”Request payload with method and params
method
Section titled “method”string = ...
params?
Section titled “params?”Record<string, unknown> | unknown[] = ...
Returns
Section titled “Returns”Promise<{[key: string]: unknown; result?: unknown; } | {[key: string]: unknown; error: { code: number; data?: unknown; message: string; }; }>
Promise resolving to success or error response
Inherited from
Section titled “Inherited from”submitResponse()
Section titled “submitResponse()”submitResponse(
id,payload):void
Defined in: packages/dapp/src/transport/types.ts:60
Send a response back to the requester.
Parameters
Section titled “Parameters”Request ID to respond to
string | number | null
payload
Section titled “payload”Response payload
{[key: string]: unknown; result?: unknown; } | {[key: string]: unknown; error: { code: number; data?: unknown; message: string; }; }
Returns
Section titled “Returns”void