@upbond/sdk - v0.0.3
    Preparing search index...

    Class WidgetProvider

    The EIP-1193 provider the RP receives from UpbondClient.getEthereumProvider() (embedded mode). It bridges standard request() calls to the wallet-origin widget over a MessagePort and emits the standard connect/disconnect/accountsChanged/chainChanged events; ethers/viem plug into it directly. Keys, tokens, and the signing ceremony stay inside the widget — this object only ever sees addresses, chain id, and signatures. Obtain instances via the SDK facade rather than constructing one.

    Index
    • Parameters

      • frame: WidgetFrame
      • opts: { requestTimeoutMs?: number } = {}

      Returns WidgetProvider

    • get accounts(): string[]

      The currently connected accounts, from the last widget state snapshot.

      Returns string[]

    • get chainId(): `0x${string}`

      The active chain id as a 0x-prefixed hex string (the RP-facing default chain).

      Returns `0x${string}`

    • get connected(): boolean

      Whether the widget currently reports a connected wallet.

      Returns boolean

    • Hide the wallet overlay.

      Returns void

    • Rejects every in-flight request and detaches from the port. Called by EmbeddedWallet.destroy() — a torn-down widget must not leave callers awaiting forever.

      Returns void

    • Subscribe to a provider event (EIP-1193 on); returns this for chaining.

      Parameters

      Returns this

    • RP-initiated overlay open (e.g. a "wallet" button): shows the frame and tells the widget which view to render.

      Parameters

      • view: "home" | "activity" | "send" | "receive" = 'home'

      Returns void

    • Unsubscribe a listener previously added with WidgetProvider.on.

      Parameters

      Returns this

    • Issue an EIP-1193 JSON-RPC request to the wallet. Signing methods surface a confirm + fresh-biometric ceremony inside the widget before resolving.

      Type Parameters

      • T = unknown

      Parameters

      Returns Promise<T>

      The RPC result.

      Eip1193Error on an RPC error, a request timeout (widget unresponsive), or a destroyed provider.