connect(), getSigningContext(), and signTransaction().
Connect Lifecycle
From a dApp perspective,connect() is a request for wallet approval plus account discovery.
- The dApp calls
connect(). BrowserSDKauto-initializes the iframe if needed and forwards the request to the embedded provider.- The provider posts a
connectrequest to the wallet iframe with the dApp origin and optional app metadata. - The wallet decides whether it can reuse a cached connection for the same origin, auto-approve a previously connected app, or show the connect UI.
- If approval succeeds, the wallet returns the connected accounts and resolved app metadata.
- The provider caches the connected accounts locally and emits
connect.
What Changes Connect Behavior
| Condition | What happens |
|---|---|
| Same origin is already connected in the current iframe session | The wallet can return the cached connection result immediately. |
| The dApp supplies app metadata and the app is already known for the selected account | The wallet can auto-approve if it is already unlocked. |
| The wallet is locked | The wallet shows connect UI and may require passkey unlock before approval completes. |
| No metadata is supplied | The wallet still works, but the connection flow goes through the visible approval UI. |
Signing Lifecycle
signTransaction() is a separate approval flow. A connected wallet does not imply automatic transaction approval.
- The dApp builds an unsigned transaction and base64-encodes the bytes.
- The dApp calls
wallet.signTransaction(base64Payload). - The embedded provider shows the wallet iframe and posts a
signTransactionrequest. - The wallet stores the pending request and opens the transaction approval modal.
- If the wallet is locked, passkey authentication runs before signing continues.
- The wallet signs the serialized transaction payload and returns canonical raw transaction bytes encoded as base64.
- The dApp submits those returned bytes separately.
Managed Account Vs Network Signer
The selected account and the network signer can differ.- the selected account is the managed wallet account the user is acting as
- the fee payer and signer can be the embedded manager profile instead
getSigningContext()is the source of truth for that split
getSigningContext() Lifecycle
Use getSigningContext() before building a transaction whenever the fee payer or signer identity matters.
The request returns:
selectedAccountPublicKeyfeePayerPublicKeysignerPublicKey- accepted input encodings for
signTransaction() - the output encoding that the wallet will return
dApp UX Expectations
| Phase | What the wallet is doing | What the dApp should show |
|---|---|---|
Before connect() resolves | Waiting for connect approval or unlock | A persistent “waiting for wallet approval” state |
Before signTransaction() resolves | Waiting for transaction approval and possibly passkey unlock | A persistent “confirm in wallet” state |
After signTransaction() resolves | The wallet has returned canonical raw bytes, but has not submitted them | A “submitting transaction” state until the dApp sends and tracks the transaction |
| On rejection | Returning a user-rejected error | A recoverable error state with retry |
Important Distinction
The wallet signs. The dApp submits. IfsignTransaction() succeeds but the transaction never appears in explorer, the first thing to check is whether the dApp actually sent the returned raw bytes to the network.