Logos Kit

Connect a wallet

Ask the user to share accounts, restore the session silently, and handle "no".

Connecting opens the wallet's connect sheet. The user picks which accounts to share and sees what your app will be able to do.

An app asking to connect: the accounts to share and what it may do

Connect

LogosKit {
    id: kit
    visible: root.visible
    // Ready (or rebuilt for another network): restore without prompting.
    onApiChanged: if (api) api.getSession().then(function (s) { if (s) root.session = s })
}

function connect() {
    kit.api.connect({ accountKinds: ["public"] }).then(function (s) {
        root.session = s                   // { sessionId, accounts[], chains, capabilities }
        root.account = s.accounts[0].address
    }, function (e) {
        if (!kit.sdk.isUserRejection(e)) root.error = e.message
    })
}
ParameterDefault
accountKinds["public"]Add "private" to allow private accounts. The user ticks each one explicitly; you get pvt_… handles.
capabilitiesthe wallet's default setSee Permissions.
signInnoneA sign-in request (SIWE-style) to sign in the same sheet.

Restore on start

getSession() never prompts. Call it when kit.api becomes ready: if the user connected before, you get the session back; otherwise null, and you show your Connect button.

When the user says no

A cancelled sheet rejects with 4001. It's not an error: check kit.sdk.isUserRejection(e) and show nothing. Other failures are in Errors.

States to design

StateShow
kit.api === nullA skeleton: the SDK is loading
No sessionA Connect button and what your app does
ConnectingThe button busy; the wallet is showing its sheet
Connected, empty accountBalance 0 and an in-flow Get test funds (faucet guide)

On this page