Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt

Use this file to discover all available pages before exploring further.

Use the Kotlin SDK session APIs after authentication to restore wallet state, issue ID tokens, and manage credential access.

Session State

Completed wallet sessions are restored automatically when the Android-backed OMSClient is created.
val session = client.session

println("Wallet: ${session.walletAddress}")
println("Expires at: ${session.expiresAt}")
println("Login type: ${session.loginType}")
println("Email: ${session.sessionEmail}")
client.session only reports completed wallet-session state. Pending email OTP state is in memory, and OIDC redirect verifier state is stored internally for callback handling. Returns Returns OMSClientSessionState with walletAddress, expiresAt, loginType, and sessionEmail.

List Wallets

List wallets available to the authenticated credential.
val wallets = client.wallet.listWallets()

for (wallet in wallets) {
    println("${wallet.id} ${wallet.type} ${wallet.address}")
}
Parameters Takes no parameters. Returns Returns List<Wallet>.

Get ID Token

Request an ID token for the active wallet session. Send this token to your backend when using backend wallet verification.
val idToken = client.wallet.getIdToken(ttlSeconds = 300u)
Parameters
ParameterTypeDescription
ttlSecondsUInt?Optional token lifetime in seconds.
customClaimsMap<String, JsonElement>?Optional custom claims to include in the token.
Returns Returns String.

List Access

List credentials that currently have access to the active wallet.
val credentials = client.wallet.listAccess(pageSize = 25u)

for (credential in credentials) {
    println("${credential.credentialId} ${credential.expiresAt} ${credential.isCaller}")
}
Parameters
ParameterTypeDescription
pageSizeUInt?Optional page size used while following Wallet API cursors.
Returns Returns List<CredentialInfo>.

List Access Pages

Stream credential-access pages when your UI wants page-at-a-time rendering.
import kotlinx.coroutines.flow.collect

client.wallet.listAccessPages(pageSize = 25u).collect { page ->
    for (credential in page.credentials) {
        println("${credential.credentialId} ${credential.isCaller}")
    }
}
Parameters
ParameterTypeDescription
pageSizeUInt?Optional page size used for each Wallet API request.
Returns Returns Flow<ListAccessResponse>.

List Access Page

Fetch one credential-access page with an optional cursor.
val page = client.wallet.listAccessPage(pageSize = 25u)
val nextCursor = page.page?.cursor
Parameters
ParameterTypeDescription
pageSizeUInt?Optional page size for this request.
cursorString?Optional cursor returned by a previous page.
Returns Returns ListAccessResponse.

Revoke Access

Revoke another credential’s access to the active wallet.
client.wallet.revokeAccess(targetCredentialId = "credential-id")
Parameters
ParameterTypeDescription
targetCredentialIdStringCredential ID returned by listAccess.
Returns Returns Unit.

Sign Out

client.wallet.signOut()
Signing out clears in-memory state, persisted wallet metadata, OIDC redirect state, and the Android Keystore credential used to sign wallet API requests. Parameters Takes no parameters. Returns Returns Unit.