Portal Connect
class PortalConnect(apiKey: String, var chainId: Int, keychain: MobileStorageAdapter, gatewayConfig: Map<Int, String>, webSocketServer: String = "connect.portalhq.io", autoApprove: Boolean = false, apiHost: String = "api.portalhq.io", mpcHost: String = "mpc.portalhq.io", version: String = "v6") : EventBus
PortalConnect
is the main class for managing connections and interactions with the Portal network. It handles WebSocket communication, session management, and signing requests, providing a high-level interface for applications to integrate with the Portal infrastructure.
This class extends EventBus
, enabling it to emit and listen for various events related to the connection and signing processes.
Constructors
Link copied to clipboard
constructor(apiKey: String, chainId: Int, keychain: MobileStorageAdapter, gatewayConfig: Map<Int, String>, webSocketServer: String = "connect.portalhq.io", autoApprove: Boolean = false, apiHost: String = "api.portalhq.io", mpcHost: String = "mpc.portalhq.io", version: String = "v6")
Creates a new PortalConnect
instance, initializing the provider and setting up event listeners.
Properties
Functions
Link copied to clipboard
Adds new chains to the existing list of chains in a SessionProposal's required namespaces.
Link copied to clipboard
Link copied to clipboard
Disconnects the WebSocket client.
Link copied to clipboard
Emits a "portal_getSessionRequest" event to the connected client.
Link copied to clipboard
Unregisters an event handler for a given event
Link copied to clipboard