Skip to content

Browser-Runtime

@aeternity/aepp-sdk/es/utils/aepp-wallet-communication/connection/browser-runtime

Browser runtime connector module

This is the complement to @aeternity/aepp-sdk/es/utils/aepp-wallet-communication/connection.

Example

import BrowserRuntimeConnection from '@aeternity/aepp-sdk/es/utils/aepp-wallet-communication/connection/browser-runtime'

exports.BrowserRuntimeConnection(params) ⇒ Object

BrowserRuntimeConnection stamp Handle browser runtime communication

Kind: Exported function
rtype: Stamp

Param Type Default Description
params Object {} Initializer object
params.port Object Runtime port object
[params.connectionInfo] Object {} Connection info object
[params.debug] Boolean false Debug flag

exports.BrowserRuntimeConnection.connect(onMessage, onDisconnect) ⇒ void

Connect

Kind: instance method of exports.BrowserRuntimeConnection
rtype: (onMessage: Function, onDisconnect: Function) => void

Param Type Description
onMessage function Message handler
onDisconnect function trigger when runtime connection in closed

exports.BrowserRuntimeConnection.sendMessage(msg) ⇒ void

Send message

Kind: instance method of exports.BrowserRuntimeConnection
rtype: (msg: Object) => void

Param Type Description
msg Object Message

exports.BrowserRuntimeConnection.isConnected() ⇒ Boolean

Check if connected

Kind: instance method of exports.BrowserRuntimeConnection
Returns: Boolean - Is connected
rtype: () => Boolean