> ## 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.

# Kotlin API reference

> Complete public API reference for the OMS Wallet Kotlin SDK.

## OMSWallet

### `OMSWallet`

Main entry point for OMS Wallet.

```kotlin theme={null}
class OMSWallet {
    val wallet: WalletClient

    val indexer: IndexerClient

    /**
     * Creates an Android-backed client with separate session metadata storage
     * and Android Keystore request signing.
     */
    constructor(
        context: Context,
        publishableKey: String,
        okHttpClient: OkHttpClient = OkHttpClient(),
    )
}
```

## Authentication and sessions

### `OMSWalletSessionAuth`

```kotlin theme={null}
sealed interface OMSWalletSessionAuth {
    val email: String?
}
```

### `OMSWalletEmailSessionAuth`

```kotlin theme={null}
data class OMSWalletEmailSessionAuth(
    override val email: String,
) : OMSWalletSessionAuth
```

### `OMSWalletOidcSessionAuthFlow`

```kotlin theme={null}
enum class OMSWalletOidcSessionAuthFlow {
    Redirect,
    IdToken,
}
```

### `OMSWalletOidcSessionAuth`

```kotlin theme={null}
data class OMSWalletOidcSessionAuth(
    val flow: OMSWalletOidcSessionAuthFlow,
    val issuer: String,
    val provider: String?,
    val providerLabel: String?,
    override val email: String?,
) : OMSWalletSessionAuth
```

### `OMSWalletSession`

Expiry and auth metadata for the active wallet session of a `WalletClient`.

```kotlin theme={null}
data class OMSWalletSession(
    /**
     * ISO-8601 current expiration time of the wallet session. WaaS extends it with use up to the
     * requested lifetime, and the SDK refreshes it, so it can move while the session is active.
     */
    val expiresAt: String,
    val auth: OMSWalletSessionAuth,
)
```

### `OMSWalletSessionChangeEvent`

A change of `WalletClient.activeWallet` or `WalletClient.session`, with the state right after it.
See `WalletClient.onSessionChange`.

```kotlin theme={null}
sealed interface OMSWalletSessionChangeEvent {
    /**
     * The active wallet after the change; null for `SignedOut` and `Expired`.
     */
    val activeWallet: Wallet?

    /**
     * The session after the change; non-null exactly when `activeWallet` is.
     */
    val session: OMSWalletSession?
}
```

### `OMSWalletSessionChangeEvent.SignedIn`

A sign-in made a wallet active.

```kotlin theme={null}
data class SignedIn(
    override val activeWallet: Wallet,
    override val session: OMSWalletSession,
) : OMSWalletSessionChangeEvent
```

### `OMSWalletSessionChangeEvent.WalletChanged`

Another wallet of the same sign-in became active.

```kotlin theme={null}
data class WalletChanged(
    override val activeWallet: Wallet,
    override val session: OMSWalletSession,
) : OMSWalletSessionChangeEvent
```

### `OMSWalletSessionChangeEvent.ExpiryUpdated`

`OMSWalletSession.expiresAt` moved. Safe to ignore unless you show the expiry.

```kotlin theme={null}
data class ExpiryUpdated(
    override val activeWallet: Wallet,
    override val session: OMSWalletSession,
) : OMSWalletSessionChangeEvent
```

### `OMSWalletSessionChangeEvent.SignedOut`

There is no session any more and it did not expire: `WalletClient.signOut`, a sign-in started
while signed in, or another process signing in. Not necessarily the user's choice.

```kotlin theme={null}
data object SignedOut : OMSWalletSessionChangeEvent {
    override val activeWallet: Wallet?

    override val session: OMSWalletSession?
}
```

### `OMSWalletSessionChangeEvent.Expired`

The session expired, or the wallet API no longer accepts it.

```kotlin theme={null}
data class Expired(
    val expiredSession: OMSWalletExpiredSession,
) : OMSWalletSessionChangeEvent {
    override val activeWallet: Wallet?

    override val session: OMSWalletSession?
}
```

### `OMSWalletExpiredSession`

A session that expired, as reported by `OMSWalletSessionChangeEvent.Expired`. Apps can use it to
prefill re-authentication UI.

```kotlin theme={null}
data class OMSWalletExpiredSession(
    /**
     * Wallet that was active when the session expired, or null when the
     * credential expired while a manual wallet selection was still pending.
     */
    val wallet: Wallet?,
    val session: OMSWalletSession,
    /**
     * ISO-8601 time the session ended: its expiry, or the time the SDK found it ended when that was
     * earlier.
     */
    val expiredAt: String,
)
```

### `WalletType`

```kotlin theme={null}
enum class WalletType(
    val wireValue: String,
) {
    Ethereum("ethereum"),
    Solana("solana"),
    Tron("tron"),
    UNKNOWN_DEFAULT("UNKNOWN_DEFAULT"),
}
```

### `Wallet`

A wallet available to the authenticated user.

```kotlin theme={null}
data class Wallet(
    val id: String,
    val type: WalletType,
    val address: String,
    val reference: String? = null,
    val keyOrigin: WalletKeyOrigin,
)
```

### `WalletKeyOrigin`

Whether a wallet key was created in WaaS custody or imported by its owner.

```kotlin theme={null}
enum class WalletKeyOrigin(
    val wireValue: String,
) {
    Enclave("enclave"),
    Imported("imported"),
    UNKNOWN_DEFAULT("UNKNOWN_DEFAULT"),
}
```

### `Page`

```kotlin theme={null}
data class Page(
    val limit: UInt? = null,
    val cursor: String? = null,
)
```

### `WalletImportCipherSuite`

HPKE cipher suites accepted by the wallet-import transport.

```kotlin theme={null}
enum class WalletImportCipherSuite(
    val wireValue: String,
) {
    X25519Sha256Aes256Gcm("x25519-sha256-aes256gcm"),
    X25519Sha256ChaCha20Poly1305("x25519-sha256-chacha20poly1305"),
    P256Sha256Aes256Gcm("p256-sha256-aes256gcm"),
    P256Sha256ChaCha20Poly1305("p256-sha256-chacha20poly1305"),
}
```

### `WalletImportPrivateKey`

Plaintext private-key input for high-level wallet import.

```kotlin theme={null}
sealed interface WalletImportPrivateKey {
    val walletType: WalletType
}
```

### `WalletImportPrivateKey.Ethereum`

Ethereum private key supplied as hexadecimal text.

```kotlin theme={null}
data class Ethereum(
    val value: String,
) : WalletImportPrivateKey {
    override val walletType: WalletType

    /**
     * Redacted so the key does not reach logs or crash reports.
     */
    override fun toString(): String
}
```

### `WalletImportPrivateKey.EthereumBytes`

Ethereum private key supplied as 32 raw bytes.

```kotlin theme={null}
class EthereumBytes(
    val value: ByteArray,
) : WalletImportPrivateKey {
    override val walletType: WalletType
}
```

### `WalletImportPrivateKey.Solana`

Solana seed or keypair supplied as base58 text.

```kotlin theme={null}
data class Solana(
    val value: String,
) : WalletImportPrivateKey {
    override val walletType: WalletType

    /**
     * Redacted so the key does not reach logs or crash reports.
     */
    override fun toString(): String
}
```

### `WalletImportPrivateKey.SolanaBytes`

Solana seed or keypair supplied as 32 or 64 raw bytes.

```kotlin theme={null}
class SolanaBytes(
    val value: ByteArray,
) : WalletImportPrivateKey {
    override val walletType: WalletType
}
```

### `WalletImportPrivateKey.Tron`

Tron (secp256k1) private key supplied as hexadecimal text.

```kotlin theme={null}
data class Tron(
    val value: String,
) : WalletImportPrivateKey {
    override val walletType: WalletType

    /**
     * Redacted so the key does not reach logs or crash reports.
     */
    override fun toString(): String
}
```

### `WalletImportPrivateKey.TronBytes`

Tron (secp256k1) private key supplied as 32 raw bytes.

```kotlin theme={null}
class TronBytes(
    val value: ByteArray,
) : WalletImportPrivateKey {
    override val walletType: WalletType
}
```

### `WalletImportRecipientKey`

Attested public key returned for an advanced wallet-import encryption flow.

```kotlin theme={null}
data class WalletImportRecipientKey(
    val keyId: String,
    val cipherSuite: WalletImportCipherSuite,
    val publicKey: String,
)
```

### `EncryptedWalletImportKeyMaterial`

Caller-encrypted private-key material accepted by advanced wallet import.

```kotlin theme={null}
data class EncryptedWalletImportKeyMaterial(
    val keyId: String,
    val cipherSuite: WalletImportCipherSuite,
    val encapsulatedKey: String,
    val ciphertext: String,
)
```

### `WalletCredential`

A credential currently authorized to use the selected wallet.

```kotlin theme={null}
data class WalletCredential(
    val credentialId: String,
    /**
     * ISO-8601 expiry of the credential as reported when this value was returned. It is not
     * updated afterwards; WaaS extends the expiry with use up to the requested lifetime, and the
     * live expiry is `WalletClient.session?.expiresAt`.
     */
    val expiresAt: String,
    val isCaller: Boolean,
)
```

### `RemoteCredentialMetadata`

Display metadata supplied by a remote application credential.

```kotlin theme={null}
data class RemoteCredentialMetadata(
    val appUrl: String,
    val appName: String,
    val appLogoUrl: String,
    val custom: Map<String, String>,
)
```

### `SmartSessionGrant`

Owner-approved EVM operation allowed during a bounded smart session.

```kotlin theme={null}
sealed interface SmartSessionGrant
```

### `SmartSessionGrant.NativeTransfer`

```kotlin theme={null}
data class NativeTransfer(
    val to: String,
    val limit: BigInteger,
) : SmartSessionGrant
```

### `SmartSessionGrant.Erc20Transfer`

```kotlin theme={null}
data class Erc20Transfer(
    val token: String,
    val to: String? = null,
    val limit: BigInteger,
    val cumulative: Boolean? = null,
) : SmartSessionGrant
```

### `AccessGrantType`

Filter for direct or remotely authorized wallet access.

```kotlin theme={null}
enum class AccessGrantType {
    Direct,
    Remote,
}
```

### `AccessGrant`

Direct or remote credential access associated with a wallet.

```kotlin theme={null}
sealed interface AccessGrant {
    val credential: WalletCredential
}
```

### `AccessGrant.Direct`

```kotlin theme={null}
data class Direct(
    override val credential: WalletCredential,
) : AccessGrant
```

### `AccessGrant.Remote`

```kotlin theme={null}
data class Remote(
    override val credential: WalletCredential,
    val sessionId: String,
    val metadata: RemoteCredentialMetadata,
    val grants: List<SmartSessionGrant>,
) : AccessGrant
```

### `AccessGrantPage`

One page of wallet access grants and its continuation cursor.

```kotlin theme={null}
data class AccessGrantPage(
    val grants: List<AccessGrant>,
    val page: Page? = null,
)
```

### `AuthorizedRemoteAccess`

Identifiers returned after an owner authorizes a remote smart session.

```kotlin theme={null}
data class AuthorizedRemoteAccess(
    val walletId: String,
    val sessionId: String,
    val expiresAt: String,
)
```

### `RemoteAccessSession`

Owner-visible details for one authorized smart session.

```kotlin theme={null}
data class RemoteAccessSession(
    val sessionId: String,
    val walletId: String,
    val signerAddress: String,
    val grants: List<SmartSessionGrant>,
    val chainId: Int,
    val expiresAt: String,
)
```

### `SmartSessionGrantUsage`

Current usage for one bounded smart-session grant.

```kotlin theme={null}
data class SmartSessionGrantUsage(
    val grant: SmartSessionGrant,
    val used: BigInteger? = null,
)
```

### `CustomOidcProviderConfig`

Caller-owned OIDC provider configuration for authorization-code redirect auth.

```kotlin theme={null}
data class CustomOidcProviderConfig(
    val issuer: String,
    val clientId: String,
    val authorizationUrl: String,
    val providerRedirectUri: String,
    val provider: String? = null,
    val providerLabel: String? = null,
    val scopes: List<String> = emptyList(),
    val authorizeParams: Map<String, String> = emptyMap(),
    val authMode: OidcAuthMode = OidcAuthMode.AuthCodePKCE,
)
```

### `OmsRelayOidcProvider`

Opaque OIDC provider value whose OAuth callback is owned by the OMS relay.

```kotlin theme={null}
sealed interface OmsRelayOidcProvider
```

### `OmsRelayOidcProviders`

SDK-owned OMS relay provider values.

```kotlin theme={null}
object OmsRelayOidcProviders {
    val google: OmsRelayOidcProvider

    val apple: OmsRelayOidcProvider
}
```

### `OidcAuthMode`

WaaS redirect auth-code mode supported by OIDC redirect providers.

```kotlin theme={null}
@Serializable
enum class OidcAuthMode {
    @SerialName("auth-code")
    AuthCode,
    @SerialName("auth-code-pkce")
    AuthCodePKCE,
}
```

### `StartOidcRedirectAuthResult`

Result returned after starting an OIDC authorization-code redirect flow.

```kotlin theme={null}
data class StartOidcRedirectAuthResult(
    val authorizationUrl: String,
)
```

### `OidcRedirectAuthResult`

Result of handling an incoming OIDC authorization-code redirect callback.

```kotlin theme={null}
sealed interface OidcRedirectAuthResult
```

### `OidcRedirectAuthResult.Completed`

```kotlin theme={null}
data class Completed(
    val result: CompleteAuthResult,
) : OidcRedirectAuthResult
```

### `OidcRedirectAuthResult.NotOidcRedirectCallback`

```kotlin theme={null}
data object NotOidcRedirectCallback : OidcRedirectAuthResult
```

### `OidcRedirectAuthResult.NoPendingAuth`

```kotlin theme={null}
data object NoPendingAuth : OidcRedirectAuthResult
```

### `WalletActivationResult`

Result returned after selecting, creating, or importing a wallet.

```kotlin theme={null}
data class WalletActivationResult(
    val wallet: Wallet,
)
```

### `WalletSelectionBehavior`

Controls whether auth completion should select a wallet automatically or let
the app complete wallet selection.

```kotlin theme={null}
enum class WalletSelectionBehavior {
    /**
     * Selects the first existing wallet for the requested wallet type. When none
     * exists, claims and selects a claimable (preallocated) wallet of that type,
     * or creates and selects one when there is none to claim. Use `Manual` when
     * the app needs to present wallet choices.
     */
    Automatic,
    /**
     * Completes auth and returns a `PendingWalletSelection` for app-driven
     * wallet selection.
     */
    Manual,
}
```

### `PendingWalletSelection`

Authenticated state waiting for the app to select or create a wallet.

```kotlin theme={null}
class PendingWalletSelection {
    val walletType: WalletType

    val wallets: List<Wallet>

    val claimableWallets: List<Wallet>

    val credential: WalletCredential

    /**
     * Selects one of `wallets` and persists it as the active wallet session.
     */
    suspend fun selectWallet(walletId: String): WalletActivationResult

    /**
     * Creates a new wallet for `walletType`, selects it, and persists it as the
     * active wallet session.
     */
    suspend fun createAndSelectWallet(reference: String? = null): WalletActivationResult

    /**
     * Claims one of `claimableWallets`, selects it, and persists it as the
     * active wallet session.
     */
    suspend fun claimAndSelectWallet(walletId: String): WalletActivationResult
}
```

### `CompleteAuthResult`

Result returned by auth completion APIs when wallet selection can be automatic
or app-driven.

```kotlin theme={null}
sealed interface CompleteAuthResult {
    /**
     * The credential issued by auth completion.
     */
    val credential: WalletCredential

    /**
     * The selected wallet, or `null` while wallet selection is pending.
     */
    val wallet: Wallet?
}
```

### `CompleteAuthResult.WalletSelected`

Auth completed and `wallet` is active. `claimableWallets` are wallets preallocated
for the signed-in user's verified email that this sign-in did not claim; claim one
with `WalletClient.claimWallet`.

```kotlin theme={null}
data class WalletSelected(
    override val wallet: Wallet,
    val wallets: List<Wallet>,
    override val credential: WalletCredential,
    val claimableWallets: List<Wallet> = emptyList(),
) : CompleteAuthResult
```

### `CompleteAuthResult.WalletSelection`

```kotlin theme={null}
data class WalletSelection(
    val pendingSelection: PendingWalletSelection,
) : CompleteAuthResult {
    override val credential: WalletCredential

    override val wallet: Wallet?
}
```

### `WalletClient`

```kotlin theme={null}
class WalletClient
```

### `WalletClient.DEFAULT_SESSION_LIFETIME_SECONDS`

Default requested WaaS wallet session lifetime in seconds (180 days, the maximum).

```kotlin theme={null}
const val DEFAULT_SESSION_LIFETIME_SECONDS: Long = 15_552_000L
```

### `WalletClient.MAX_SESSION_LIFETIME_SECONDS`

Maximum requested WaaS wallet session lifetime in seconds (180 days). WaaS extends a
session's expiry with use up to the requested lifetime.

```kotlin theme={null}
const val MAX_SESSION_LIFETIME_SECONDS: Long = 15_552_000L
```

### `WalletClient.activeWallet`

The active wallet, or null until auth completes or a session is restored,
while a manual wallet selection is pending, and after sign-out or session
expiry. Same shape as `listWallets` entries;
branch on `Wallet.type` before using `Wallet.address` with family-specific
code.

```kotlin theme={null}
val activeWallet: Wallet?
```

### `WalletClient.session`

Expiry and auth metadata for the active wallet session. Non-null exactly
when `activeWallet` is.

```kotlin theme={null}
val session: OMSWalletSession?
```

### `WalletClient.onSessionChange`

Calls `listener` on the main thread after every change of `activeWallet` or `session`, in
order and after the change (never during the call that made it). Subscribe first, then read
`activeWallet` and `session`, so no change is missed. A listener added while signed out first
receives the last `OMSWalletSessionChangeEvent.Expired`, if a session expired since the last
sign-in or sign-out (for example while the app was not running). Every client of the same
project and environment shares the session, so its listeners hear every change. The returned
function unsubscribes; call it when the listener's owner goes away (for example in
`ViewModel.onCleared`).

```kotlin theme={null}
fun onSessionChange(listener: (OMSWalletSessionChangeEvent) -> Unit): () -> Unit
```

### `WalletClient.signOut`

```kotlin theme={null}
fun signOut()
```

### `WalletClient.startEmailAuth`

```kotlin theme={null}
suspend fun startEmailAuth(
    email: String,
    sessionLifetimeSeconds: Long = DEFAULT_SESSION_LIFETIME_SECONDS,
): Unit
```

### `WalletClient.signInWithOidcIdToken`

```kotlin theme={null}
suspend fun signInWithOidcIdToken(
    idToken: String,
    issuer: String,
    audience: String,
    walletType: WalletType = WalletType.Ethereum,
    walletSelection: WalletSelectionBehavior = WalletSelectionBehavior.Automatic,
    sessionLifetimeSeconds: Long = DEFAULT_SESSION_LIFETIME_SECONDS,
    provider: String? = null,
    providerLabel: String? = null,
): CompleteAuthResult
```

### `WalletClient.startOidcRedirectAuth`

```kotlin theme={null}
suspend fun startOidcRedirectAuth(
    provider: OmsRelayOidcProvider,
    omsRelayReturnUri: String,
    walletType: WalletType = WalletType.Ethereum,
    walletSelection: WalletSelectionBehavior? = null,
    sessionLifetimeSeconds: Long? = null,
    loginHint: String? = null,
): StartOidcRedirectAuthResult

suspend fun startOidcRedirectAuth(
    provider: CustomOidcProviderConfig,
    walletType: WalletType = WalletType.Ethereum,
    walletSelection: WalletSelectionBehavior? = null,
    sessionLifetimeSeconds: Long? = null,
    loginHint: String? = null,
    authorizeParams: Map<String, String> = emptyMap(),
): StartOidcRedirectAuthResult
```

### `WalletClient.handleOidcRedirectCallback`

```kotlin theme={null}
suspend fun handleOidcRedirectCallback(
    callbackUrl: String?,
    walletSelection: WalletSelectionBehavior? = null,
    sessionLifetimeSeconds: Long? = null,
): OidcRedirectAuthResult
```

### `WalletClient.completeEmailAuth`

```kotlin theme={null}
suspend fun completeEmailAuth(
    code: String,
    walletSelection: WalletSelectionBehavior = WalletSelectionBehavior.Automatic,
    walletType: WalletType = WalletType.Ethereum,
): CompleteAuthResult
```

### `WalletClient.useWallet`

Selects an existing wallet by its WaaS wallet id.

```kotlin theme={null}
suspend fun useWallet(walletId: String): WalletActivationResult
```

### `WalletClient.claimWallet`

Claims a preallocated wallet offered in `CompleteAuthResult.WalletSelected.claimableWallets` or
`PendingWalletSelection.claimableWallets` and selects it, like `useWallet`. Claiming links the
wallet to the signed-in identity, so it is listed with the owned wallets afterwards. During a
pending manual selection, prefer `PendingWalletSelection.claimAndSelectWallet`.

```kotlin theme={null}
suspend fun claimWallet(walletId: String): WalletActivationResult
```

### `WalletClient.createWallet`

Creates and selects a new wallet for the authenticated user.

```kotlin theme={null}
suspend fun createWallet(
    walletType: WalletType = WalletType.Ethereum,
    reference: String? = null,
): WalletActivationResult
```

### `WalletClient.importWallet`

Imports and activates an Ethereum, Solana, or Tron private key through the attested import transport.

```kotlin theme={null}
suspend fun importWallet(
    privateKey: WalletImportPrivateKey,
    reference: String? = null,
): WalletActivationResult
```

### `WalletClient.getWalletImportRecipientKey`

Fetches an attested recipient key for caller-managed wallet-import encryption.

```kotlin theme={null}
suspend fun getWalletImportRecipientKey(cipherSuite: WalletImportCipherSuite): WalletImportRecipientKey
```

### `WalletClient.importEncryptedWallet`

Imports and activates caller-encrypted private-key material.

```kotlin theme={null}
suspend fun importEncryptedWallet(
    walletType: WalletType,
    keyMaterial: EncryptedWalletImportKeyMaterial,
    reference: String? = null,
): WalletActivationResult
```

### `WalletClient.listWallets`

Lists all wallets available to the authenticated credential.

```kotlin theme={null}
suspend fun listWallets(): List<Wallet>
```

### `WalletClient.inspectRemoteCredential`

Returns display metadata for a remote credential before the owner approves access.

```kotlin theme={null}
suspend fun inspectRemoteCredential(credentialId: String): RemoteCredentialMetadata
```

### `WalletClient.authorizeRemoteAccess`

Authorizes owner-approved EVM smart-session grants for a remote credential. Omit `sessionId`
to create a session; pass an existing session ID to replace that session's grants and
requested expiry without changing its signer. WaaS caps the effective expiry at the remote
credential's expiry.

```kotlin theme={null}
suspend fun authorizeRemoteAccess(
    credentialId: String,
    network: Network,
    grants: List<SmartSessionGrant>,
    expiresAt: String,
    sessionId: String? = null,
): AuthorizedRemoteAccess
```

### `WalletClient.listAccess`

Returns all access grants, following WaaS cursors with the requested `pageSize`.

```kotlin theme={null}
suspend fun listAccess(
    pageSize: UInt? = null,
    type: AccessGrantType? = null,
): List<AccessGrant>
```

### `WalletClient.listAccessPages`

Emits credential-access pages for the selected wallet until WaaS stops
returning a cursor.

```kotlin theme={null}
fun listAccessPages(
    pageSize: UInt? = null,
    type: AccessGrantType? = null,
): Flow<AccessGrantPage>
```

### `WalletClient.listAccessPage`

Returns one credential-access page for the selected wallet.

```kotlin theme={null}
suspend fun listAccessPage(
    pageSize: UInt? = null,
    cursor: String? = null,
    type: AccessGrantType? = null,
): AccessGrantPage
```

### `WalletClient.getRemoteAccessSession`

Returns one owner-visible smart-session and checks that it belongs to the active wallet.

```kotlin theme={null}
suspend fun getRemoteAccessSession(sessionId: String): RemoteAccessSession
```

### `WalletClient.getRemoteAccessSessionUsage`

Returns grant usage for an owner-visible smart session on `network`.

```kotlin theme={null}
suspend fun getRemoteAccessSessionUsage(
    sessionId: String,
    network: Network,
): List<SmartSessionGrantUsage>
```

### `WalletClient.getIdToken`

Returns an ID token for the currently selected wallet.

```kotlin theme={null}
suspend fun getIdToken(
    ttlSeconds: UInt? = null,
    customClaims: Map<String, JsonElement>? = null,
): String
```

### `WalletClient.revokeAccess`

Revokes one access grant from the selected wallet. Use `listAccess` or `listAccessPage` to
find the direct or remote grant. Omit `sessionId` for a direct grant; for a remote grant,
pass its session ID to revoke exactly that session.

```kotlin theme={null}
suspend fun revokeAccess(
    credentialId: String,
    sessionId: String? = null,
): Unit
```

## Transactions and signing

### `TransactionMode`

```kotlin theme={null}
enum class TransactionMode(
    val wireValue: String,
) {
    Native("native"),
    Relayer("relayer"),
    UNKNOWN_DEFAULT("UNKNOWN_DEFAULT"),
}
```

### `TransactionStatus`

```kotlin theme={null}
enum class TransactionStatus(
    val wireValue: String,
) {
    Quoted("quoted"),
    Pending("pending"),
    Executed("executed"),
    Failed("failed"),
    UNKNOWN_DEFAULT("UNKNOWN_DEFAULT"),
}
```

### `FeeToken`

```kotlin theme={null}
data class FeeToken(
    val network: String,
    val name: String,
    val symbol: String,
    val type: String,
    val decimals: UInt? = null,
    val logoUrl: String? = null,
    val contractAddress: String? = null,
    val tokenId: String? = null,
)
```

### `FeeOption`

```kotlin theme={null}
data class FeeOption(
    val token: FeeToken,
    val value: String,
    val displayValue: String,
)
```

### `FeeOptionSelection`

```kotlin theme={null}
data class FeeOptionSelection(
    val token: String,
    val index: UInt? = null,
) {
    constructor(feeOption: FeeOption, index: UInt? = null)
}
```

### `AbiArg`

```kotlin theme={null}
data class AbiArg(
    val type: String,
    val value: JsonElement,
)
```

### `TransactionStatusResponse`

```kotlin theme={null}
data class TransactionStatusResponse(
    val status: TransactionStatus,
    val txnHash: String? = null,
)
```

### `FeeOptionSelector`

Selects a fee option before execution. Sponsored transactions pass an empty list;
returning null acknowledges the free fee, while throwing stops execution.

```kotlin theme={null}
fun interface FeeOptionSelector {
    suspend fun select(feeOptions: List<FeeOptionWithBalance>): FeeOptionSelection?

    companion object {
        /**
         * Selects the first fee option whose available raw balance covers the
         * quoted fee value. Returns null when no option has sufficient balance.
         */
        val firstAvailable: FeeOptionSelector
    }
}
```

### `FeeOptionWithBalance`

```kotlin theme={null}
data class FeeOptionWithBalance(
    val feeOption: FeeOption,
    val selection: FeeOptionSelection = FeeOptionSelection(feeOption),
    val balance: TokenBalance? = null,
    val available: String? = null,
    val availableRaw: String? = null,
    val decimals: Int? = null,
)
```

### `SendTransactionRequest`

```kotlin theme={null}
data class SendTransactionRequest(
    val to: String,
    /**
     * Raw base-unit transaction value. Use
     * `technology.polygon.omswallet.utils.parseUnits` to convert decimal display
     * values before sending.
     */
    val value: BigInteger,
    val data: String? = null,
    val mode: TransactionMode = TransactionMode.Relayer,
)
```

### `SendTransactionResponse`

```kotlin theme={null}
data class SendTransactionResponse(
    val txnId: String,
    val status: TransactionStatus,
    val txnHash: String?,
    val statusResolution: TransactionStatusResolution,
)
```

### `TransactionStatusResolution`

```kotlin theme={null}
enum class TransactionStatusResolution {
    NotRequested,
    Resolved,
    TimedOut,
}
```

### `TransactionStatusPollingOptions`

Transaction status polling after execution. The first `fastPollCount` polls wait
`fastIntervalMs` between requests, later polls wait `intervalMs`, and polling
stops after `timeoutMs`. All durations are in milliseconds.

```kotlin theme={null}
data class TransactionStatusPollingOptions(
    val fastIntervalMs: Long = 400L,
    val fastPollCount: Int = 5,
    val intervalMs: Long = 2_000L,
    val timeoutMs: Long = 60_000L,
)
```

### `WalletClient.signMessage`

Signs `message` with the currently selected wallet on `network`.

```kotlin theme={null}
suspend fun signMessage(
    network: Network,
    message: String,
): String
```

### `WalletClient.signSolanaMessage`

Signs `message` with the currently selected Solana wallet.

```kotlin theme={null}
suspend fun signSolanaMessage(message: String): String
```

### `WalletClient.signTypedData`

Signs EIP-712 `typedData` with the currently selected wallet on `network`.

```kotlin theme={null}
suspend fun signTypedData(
    network: Network,
    typedData: JsonElement,
): String
```

### `WalletClient.isValidMessageSignature`

Validates `signature` for `message` through the WaaS public wallet RPC.
Pass the `0x` `walletAddress` to verify any Ethereum wallet without a
session; when it is omitted, the active Ethereum wallet's address is used.

```kotlin theme={null}
suspend fun isValidMessageSignature(
    network: Network,
    message: String,
    signature: String,
    walletAddress: String? = null,
): Boolean
```

### `WalletClient.isValidSolanaMessageSignature`

Validates `signature` for a Solana `message` through the WaaS public wallet
RPC. Pass the base58 `walletAddress` to verify any Solana wallet without a
session; when it is omitted, the active Solana wallet's address is used.

```kotlin theme={null}
suspend fun isValidSolanaMessageSignature(
    message: String,
    signature: String,
    walletAddress: String? = null,
): Boolean
```

### `WalletClient.isValidTypedDataSignature`

Validates `signature` for EIP-712 `typedData` through the WaaS public
wallet RPC. Pass the `0x` `walletAddress` to verify any Ethereum wallet
without a session; when it is omitted, the active Ethereum wallet's address
is used.

```kotlin theme={null}
suspend fun isValidTypedDataSignature(
    network: Network,
    typedData: JsonElement,
    signature: String,
    walletAddress: String? = null,
): Boolean
```

### `WalletClient.signTronMessage`

Signs `message` with the currently selected Tron wallet.

```kotlin theme={null}
suspend fun signTronMessage(message: String): String
```

### `WalletClient.signTronTypedData`

Signs TIP-712 `typedData` with the currently selected Tron wallet. Address
values may be Base58Check (`T…`).

```kotlin theme={null}
suspend fun signTronTypedData(typedData: JsonElement): String
```

### `WalletClient.isValidTronMessageSignature`

Validates a Tron `signature` for `message` through the WaaS public wallet
RPC. Pass the Base58Check `walletAddress` (`T…`) to verify any Tron wallet
without a session; when it is omitted, the active Tron wallet's address is
used.

```kotlin theme={null}
suspend fun isValidTronMessageSignature(
    message: String,
    signature: String,
    walletAddress: String? = null,
): Boolean
```

### `WalletClient.isValidTronTypedDataSignature`

Validates a Tron `signature` for TIP-712 `typedData` through the WaaS
public wallet RPC. Pass the Base58Check `walletAddress` (`T…`) to verify
any Tron wallet without a session; when it is omitted, the active Tron
wallet's address is used.

```kotlin theme={null}
suspend fun isValidTronTypedDataSignature(
    typedData: JsonElement,
    signature: String,
    walletAddress: String? = null,
): Boolean
```

### `WalletClient.sendTransaction`

Sends a transaction from the currently selected wallet on `network`.

```kotlin theme={null}
suspend fun sendTransaction(
    network: Network,
    to: String,
    value: BigInteger,
    mode: TransactionMode = TransactionMode.Relayer,
    waitForStatus: Boolean = true,
    statusPolling: TransactionStatusPollingOptions? = null,
    selectFeeOption: FeeOptionSelector? = null,
): SendTransactionResponse

suspend fun sendTransaction(
    network: Network,
    request: SendTransactionRequest,
    waitForStatus: Boolean = true,
    statusPolling: TransactionStatusPollingOptions? = null,
    selectFeeOption: FeeOptionSelector? = null,
): SendTransactionResponse
```

### `WalletClient.sendSolanaTransfer`

Sends a native SOL or SPL token transfer from the selected Solana wallet.

```kotlin theme={null}
suspend fun sendSolanaTransfer(
    network: SolanaNetwork,
    asset: String,
    to: String,
    amount: BigInteger,
    mode: TransactionMode = TransactionMode.Relayer,
    waitForStatus: Boolean = true,
    statusPolling: TransactionStatusPollingOptions? = null,
    selectFeeOption: FeeOptionSelector? = null,
): SendTransactionResponse
```

### `WalletClient.sendTronTransaction`

Sends a Tron transaction from the selected Tron wallet. Tron wallets are
EOAs and always execute in native mode.

```kotlin theme={null}
suspend fun sendTronTransaction(
    network: TronNetwork,
    to: String,
    value: BigInteger = BigInteger.ZERO,
    data: String? = null,
    waitForStatus: Boolean = true,
    statusPolling: TransactionStatusPollingOptions? = null,
    selectFeeOption: FeeOptionSelector? = null,
): SendTransactionResponse
```

### `WalletClient.callContract`

Calls a state-changing smart contract function through the WaaS
prepare/execute flow.

```kotlin theme={null}
suspend fun callContract(
    network: Network,
    contractAddress: String,
    method: String,
    args: List<AbiArg>? = null,
    mode: TransactionMode = TransactionMode.Relayer,
    waitForStatus: Boolean = true,
    statusPolling: TransactionStatusPollingOptions? = null,
    selectFeeOption: FeeOptionSelector? = null,
): SendTransactionResponse
```

### `WalletClient.callTronContract`

Calls a state-changing Tron contract function from the selected Tron
wallet in native mode. The wallet service ABI-encodes `args`;
address-typed arguments accept Base58Check (`T…`) addresses.

```kotlin theme={null}
suspend fun callTronContract(
    network: TronNetwork,
    contractAddress: String,
    method: String,
    args: List<AbiArg>? = null,
    waitForStatus: Boolean = true,
    statusPolling: TransactionStatusPollingOptions? = null,
    selectFeeOption: FeeOptionSelector? = null,
): SendTransactionResponse
```

### `WalletClient.getTransactionStatus`

Returns the current WaaS execution status for a prepared or submitted
transaction.

```kotlin theme={null}
suspend fun getTransactionStatus(txnId: String): TransactionStatusResponse
```

## Indexer

### `IndexerClient`

```kotlin theme={null}
class IndexerClient
```

### `IndexerClient.getBalances`

Gets token and native balances for `walletAddress`.

```kotlin theme={null}
suspend fun getBalances(
    walletAddress: String,
    networks: List<Network> = emptyList(),
    networkType: IndexerNetworkType = IndexerNetworkType.MAINNETS,
    contractAddresses: List<String> = emptyList(),
    includeMetadata: Boolean = true,
    omitPrices: Boolean? = null,
    tokenIds: List<String> = emptyList(),
    contractStatus: ContractVerificationStatus? = null,
    page: TokenBalancesPageRequest = TokenBalancesPageRequest(),
): BalancesResult
```

### `IndexerClient.getTransactionHistory`

Gets transaction history for `walletAddress`.

```kotlin theme={null}
suspend fun getTransactionHistory(
    walletAddress: String,
    networks: List<Network> = emptyList(),
    networkType: IndexerNetworkType = IndexerNetworkType.MAINNETS,
    contractAddresses: List<String> = emptyList(),
    transactionHashes: List<String> = emptyList(),
    metaTransactionIds: List<String> = emptyList(),
    fromBlock: Long? = null,
    toBlock: Long? = null,
    tokenId: String? = null,
    includeMetadata: Boolean = true,
    omitPrices: Boolean? = null,
    metadataOptions: MetadataOptions? = null,
    page: TokenBalancesPageRequest = TokenBalancesPageRequest(),
): TransactionHistoryResult
```

### `IndexerClient.getSolanaBalances`

Gets native SOL and fungible-token balances for `walletAddress`.

```kotlin theme={null}
suspend fun getSolanaBalances(
    walletAddress: String,
    networks: List<SolanaNetwork> = listOf(SolanaNetwork.Mainnet, SolanaNetwork.Devnet),
    includeMetadata: Boolean = true,
    omitNativeBalances: Boolean? = null,
    mintAddresses: List<String> = emptyList(),
    excludedMintAddresses: List<String> = emptyList(),
): SolanaBalancesResult
```

### `SolanaVerificationStatus`

Verification state assigned to Solana asset metadata.

```kotlin theme={null}
enum class SolanaVerificationStatus {
    Verified,
    Unverified,
    Unknown,
}
```

### `SolanaVerificationSource`

Source used to verify Solana asset metadata.

```kotlin theme={null}
enum class SolanaVerificationSource {
    Jupiter,
    SolflareUtl,
    None,
}
```

### `SolanaTokenProgram`

Token program owning a Solana mint.

```kotlin theme={null}
enum class SolanaTokenProgram {
    SplToken,
    Token2022,
}
```

### `SolanaBalance`

Common public fields returned for a Solana balance.

```kotlin theme={null}
sealed interface SolanaBalance {
    val network: SolanaNetwork

    val accountAddress: String

    val name: String

    val symbol: String

    val decimals: Int

    val balance: String

    val formattedBalance: String

    val imageUrl: String?

    val metadataUri: String?

    val verificationStatus: SolanaVerificationStatus

    val verificationSource: SolanaVerificationSource

    val priceUSD: String?

    val balanceUSD: String?
}
```

### `SolanaBalance.Native`

Native SOL balance.

```kotlin theme={null}
data class Native(
    override val network: SolanaNetwork,
    override val accountAddress: String,
    override val name: String,
    override val symbol: String,
    override val decimals: Int,
    override val balance: String,
    override val formattedBalance: String,
    override val imageUrl: String?,
    override val metadataUri: String?,
    override val verificationStatus: SolanaVerificationStatus,
    override val verificationSource: SolanaVerificationSource,
    override val priceUSD: String?,
    override val balanceUSD: String?,
) : SolanaBalance
```

### `SolanaBalance.FungibleToken`

SPL Token or Token-2022 balance.

```kotlin theme={null}
data class FungibleToken(
    override val network: SolanaNetwork,
    override val accountAddress: String,
    val tokenProgram: SolanaTokenProgram,
    val mintAddress: String,
    override val name: String,
    override val symbol: String,
    override val decimals: Int,
    override val balance: String,
    override val formattedBalance: String,
    override val imageUrl: String?,
    override val metadataUri: String?,
    override val verificationStatus: SolanaVerificationStatus,
    override val verificationSource: SolanaVerificationSource,
    override val priceUSD: String?,
    override val balanceUSD: String?,
) : SolanaBalance
```

### `SolanaNetworkError`

Per-network failure returned alongside partial Solana balance results.

```kotlin theme={null}
data class SolanaNetworkError(
    val network: SolanaNetwork,
    val reason: String,
)
```

### `SolanaBalancesResult`

Solana balances and partial network errors returned by the gateway.

```kotlin theme={null}
data class SolanaBalancesResult(
    val status: Int,
    val balances: List<SolanaBalance>,
    val errors: List<SolanaNetworkError>,
)
```

### `IndexerClient.getTronBalances`

Gets native TRX and TRC-20 balances for the Base58Check `walletAddress` (`T…`).

```kotlin theme={null}
suspend fun getTronBalances(
    walletAddress: String,
    networks: List<TronNetwork> = listOf(TronNetwork.Mainnet, TronNetwork.Nile),
    includeMetadata: Boolean = true,
    omitNativeBalances: Boolean? = null,
    contractAddresses: List<String> = emptyList(),
    excludedContractAddresses: List<String> = emptyList(),
): TronBalancesResult
```

### `TronVerificationStatus`

Verification state assigned to Tron asset metadata.

```kotlin theme={null}
enum class TronVerificationStatus {
    Verified,
    Unverified,
    Unknown,
}
```

### `TronTokenStandard`

Token standard of a Tron fungible token. TRC-10 tokens are not supported.

```kotlin theme={null}
enum class TronTokenStandard {
    Trc20,
}
```

### `TronBalance`

Common public fields returned for a Tron balance.

```kotlin theme={null}
sealed interface TronBalance {
    val network: TronNetwork

    /**
     * Base58Check account address (`T…`).
     */
    val accountAddress: String

    val name: String

    val symbol: String

    val decimals: Int

    /**
     * Raw balance in the token's base units (sun for TRX).
     */
    val balance: String

    val formattedBalance: String

    val imageUrl: String?

    val metadataUri: String?

    val verificationStatus: TronVerificationStatus

    /**
     * Source reported by the gateway for `verificationStatus`, such as `none`.
     */
    val verificationSource: String

    val priceUSD: String?

    val balanceUSD: String?
}
```

### `TronBalance.Native`

Native TRX balance.

```kotlin theme={null}
data class Native(
    override val network: TronNetwork,
    override val accountAddress: String,
    override val name: String,
    override val symbol: String,
    override val decimals: Int,
    override val balance: String,
    override val formattedBalance: String,
    override val imageUrl: String?,
    override val metadataUri: String?,
    override val verificationStatus: TronVerificationStatus,
    override val verificationSource: String,
    override val priceUSD: String?,
    override val balanceUSD: String?,
) : TronBalance
```

### `TronBalance.FungibleToken`

TRC-20 token balance.

```kotlin theme={null}
data class FungibleToken(
    override val network: TronNetwork,
    override val accountAddress: String,
    val tokenStandard: TronTokenStandard,
    /** Base58Check TRC-20 contract address (`T…`). */
    val contractAddress: String,
    override val name: String,
    override val symbol: String,
    override val decimals: Int,
    override val balance: String,
    override val formattedBalance: String,
    override val imageUrl: String?,
    override val metadataUri: String?,
    override val verificationStatus: TronVerificationStatus,
    override val verificationSource: String,
    override val priceUSD: String?,
    override val balanceUSD: String?,
) : TronBalance
```

### `TronNetworkError`

Per-network failure returned alongside partial Tron balance results.

```kotlin theme={null}
data class TronNetworkError(
    val network: TronNetwork,
    val reason: String,
)
```

### `TronBalancesResult`

Tron balances and partial network errors returned by the gateway.

```kotlin theme={null}
data class TronBalancesResult(
    val status: Int,
    val balances: List<TronBalance>,
    val errors: List<TronNetworkError>,
)
```

### `TokenBalancesPageRequest`

Indexer page request. `column`, `before`, `after`, and `sort` are the
indexer's optional cursor fields and are sent only when set.

```kotlin theme={null}
data class TokenBalancesPageRequest(
    val page: Int = 0,
    val pageSize: Int = 40,
    val column: String? = null,
    val before: JsonElement? = null,
    val after: JsonElement? = null,
    val sort: List<SortBy>? = null,
)
```

### `SortBy`

Indexer sort column and direction.

```kotlin theme={null}
data class SortBy(
    val column: String,
    val order: SortOrder,
)
```

### `SortOrder`

Indexer sort direction.

```kotlin theme={null}
enum class SortOrder(
    val wireValue: String,
) {
    DESC("DESC"),
    ASC("ASC"),
}
```

### `IndexerNetworkType`

```kotlin theme={null}
enum class IndexerNetworkType(
    val wireValue: String,
) {
    MAINNETS("MAINNETS"),
    TESTNETS("TESTNETS"),
    ALL("ALL"),
}
```

### `ContractVerificationStatus`

```kotlin theme={null}
enum class ContractVerificationStatus(
    val wireValue: String,
) {
    VERIFIED("VERIFIED"),
    UNVERIFIED("UNVERIFIED"),
    ALL("ALL"),
}
```

### `TokenBalancesPage`

Indexer page returned with results. `before`, `after`, `column`, and `sort`
are present when the indexer returns cursor paging state.

```kotlin theme={null}
data class TokenBalancesPage(
    val page: Int,
    val pageSize: Int,
    val more: Boolean,
    val column: String? = null,
    val before: JsonElement? = null,
    val after: JsonElement? = null,
    val sort: List<SortBy>? = null,
)
```

### `MetadataOptions`

```kotlin theme={null}
data class MetadataOptions(
    val verifiedOnly: Boolean? = null,
    val unverifiedOnly: Boolean? = null,
    val includeContracts: List<String> = emptyList(),
)
```

### `TokenContractInfo`

```kotlin theme={null}
data class TokenContractInfo(
    val chainId: Long,
    val address: String,
    val source: String,
    val name: String,
    val type: String,
    val symbol: String,
    val decimals: Int? = null,
    val logoURI: String? = null,
    val deployed: Boolean,
    val bytecodeHash: String,
    val extensions: Map<String, JsonElement>,
    val updatedAt: String,
    val queuedAt: String? = null,
    val status: String,
)
```

### `TokenMetadataAsset`

```kotlin theme={null}
data class TokenMetadataAsset(
    val id: Long? = null,
    val collectionId: Long? = null,
    val tokenId: String? = null,
    val url: String? = null,
    val metadataField: String? = null,
    val name: String? = null,
    val filesize: Long? = null,
    val mimeType: String? = null,
    val width: Int? = null,
    val height: Int? = null,
    val updatedAt: String? = null,
)
```

### `TokenMetadata`

```kotlin theme={null}
data class TokenMetadata(
    val chainId: Long? = null,
    val contractAddress: String? = null,
    val tokenId: String,
    val source: String,
    val name: String,
    val description: String? = null,
    val image: String? = null,
    val video: String? = null,
    val audio: String? = null,
    val properties: Map<String, JsonElement>? = null,
    val attributes: List<Map<String, JsonElement>>,
    val imageData: String? = null,
    val externalUrl: String? = null,
    val backgroundColor: String? = null,
    val animationUrl: String? = null,
    val decimals: Int? = null,
    val updatedAt: String? = null,
    val assets: List<TokenMetadataAsset>? = null,
    val status: String,
    val queuedAt: String? = null,
    val lastFetched: String? = null,
)
```

### `TokenBalance`

```kotlin theme={null}
sealed interface TokenBalance {
    val contractType: String

    val accountAddress: String

    val balance: String

    val chainId: Long

    val balanceUSD: String?

    val priceUSD: String?

    val priceUpdatedAt: String?
}
```

### `NativeTokenBalance`

```kotlin theme={null}
data class NativeTokenBalance(
    override val accountAddress: String,
    val name: String,
    val symbol: String,
    override val balance: String,
    override val chainId: Long,
    override val balanceUSD: String? = null,
    override val priceUSD: String? = null,
    override val priceUpdatedAt: String? = null,
) : TokenBalance {
    override val contractType: String
}
```

### `ContractTokenBalance`

```kotlin theme={null}
data class ContractTokenBalance(
    override val contractType: String,
    val contractAddress: String,
    override val accountAddress: String,
    val tokenId: String,
    override val balance: String,
    val blockHash: String,
    val blockNumber: Long,
    override val chainId: Long,
    override val balanceUSD: String? = null,
    override val priceUSD: String? = null,
    override val priceUpdatedAt: String? = null,
    val uniqueCollectibles: String? = null,
    val isSummary: Boolean? = null,
    val contractInfo: TokenContractInfo? = null,
    val tokenMetadata: TokenMetadata? = null,
) : TokenBalance
```

### `BalancesResult`

```kotlin theme={null}
data class BalancesResult(
    val status: Int,
    val page: TokenBalancesPage?,
    val balances: List<ContractTokenBalance>,
    val nativeBalances: List<NativeTokenBalance> = emptyList(),
)
```

### `TransactionTransfer`

```kotlin theme={null}
data class TransactionTransfer(
    val transferType: String,
    val contractAddress: String,
    val contractType: String,
    val from: String,
    val to: String,
    val tokenIds: List<String>? = null,
    val amounts: List<String>,
    val logIndex: Long,
    val amountsUSD: List<String>? = null,
    val pricesUSD: List<String>? = null,
    val contractInfo: TokenContractInfo? = null,
    val tokenMetadata: Map<String, TokenMetadata>? = null,
)
```

### `Transaction`

```kotlin theme={null}
data class Transaction(
    val txnHash: String,
    val blockNumber: Long,
    val blockHash: String,
    val chainId: Long,
    val metaTxnId: String? = null,
    val transfers: List<TransactionTransfer> = emptyList(),
    val timestamp: String,
)
```

### `TransactionHistoryResult`

```kotlin theme={null}
data class TransactionHistoryResult(
    val status: Int,
    val page: TokenBalancesPage?,
    val transactions: List<Transaction>,
)
```

## Networks, types, and errors

### `Network`

A network supported by the OMS Wallet SDK.

```kotlin theme={null}
class Network {
    val id: Int

    val name: String

    val nativeTokenSymbol: String

    val explorerUrl: String

    val displayName: String

    override fun equals(other: Any?): Boolean

    override fun hashCode(): Int

    override fun toString(): String

    companion object {
        val MAINNET: Network

        val SEPOLIA: Network

        val POLYGON: Network

        val AMOY: Network

        val ARBITRUM: Network

        val ARBITRUM_SEPOLIA: Network

        val OPTIMISM: Network

        val OPTIMISM_SEPOLIA: Network

        val BASE: Network

        val BASE_SEPOLIA: Network

        val BSC: Network

        val BSC_TESTNET: Network

        val ARBITRUM_NOVA: Network

        val AVALANCHE: Network

        val AVALANCHE_TESTNET: Network

        val KATANA: Network

        val entries: List<Network>
    }
}
```

### `OMSWalletNetworks`

Networks currently supported by this SDK build.

```kotlin theme={null}
object OMSWalletNetworks {
    /**
     * All networks currently supported by this SDK build.
     */
    val supportedNetworks: List<Network>

    /**
     * Returns a supported network by chain id.
     */
    fun findById(id: Int): Network?

    /**
     * Returns a supported network by registry name.
     */
    fun findByName(name: String): Network?
}
```

### `SolanaNetwork`

```kotlin theme={null}
enum class SolanaNetwork(
    val wireValue: String,
) {
    Devnet("solana:devnet"),
    Mainnet("solana:mainnet"),
}
```

### `SolanaNetworks`

```kotlin theme={null}
object SolanaNetworks {
    val DEVNET: SolanaNetwork

    val MAINNET: SolanaNetwork
}
```

### `TronNetwork`

A Tron network supported by the OMS Wallet Tron APIs.

```kotlin theme={null}
enum class TronNetwork(
    val wireValue: String,
) {
    Mainnet("tron:mainnet"),
    Nile("tron:nile"),
}
```

### `TronNetworks`

```kotlin theme={null}
object TronNetworks {
    val MAINNET: TronNetwork

    val NILE: TronNetwork
}
```

### `OMSWalletErrorCode`

Stable SDK-level error categories for app-facing error handling.

```kotlin theme={null}
enum class OMSWalletErrorCode(
    val id: String,
) {
    HttpError("OMS_HTTP_ERROR"),
    InvalidResponse("OMS_INVALID_RESPONSE"),
    RequestFailed("OMS_REQUEST_FAILED"),
    AuthCommitmentConsumed("OMS_AUTH_COMMITMENT_CONSUMED"),
    SessionMissing("OMS_SESSION_MISSING"),
    SessionExpired("OMS_SESSION_EXPIRED"),
    WalletSelectionStale("OMS_WALLET_SELECTION_STALE"),
    WalletSelectionUnavailable("OMS_WALLET_SELECTION_UNAVAILABLE"),
    WalletSelectionInFlight("OMS_WALLET_SELECTION_IN_FLIGHT"),
    TransactionExecutionUnconfirmed("OMS_TRANSACTION_EXECUTION_UNCONFIRMED"),
    TransactionStatusLookupFailed("OMS_TRANSACTION_STATUS_LOOKUP_FAILED"),
    ValidationError("OMS_VALIDATION_ERROR"),
    StorageError("OMS_STORAGE_ERROR"),
    AttestationVerificationFailed("OMS_ATTESTATION_VERIFICATION_FAILED"),
    WalletAddressAlreadyImported("OMS_WALLET_ADDRESS_ALREADY_IMPORTED"),
}
```

### `OMSWalletOperation`

Stable identifiers for SDK operations that can appear on `OMSWalletException`.

```kotlin theme={null}
enum class OMSWalletOperation(
    val id: String,
) {
    PendingWalletSelection("wallet.pendingWalletSelection"),
    PendingWalletSelectionClaimAndSelectWallet("wallet.pendingWalletSelection.claimAndSelectWallet"),
    PendingWalletSelectionCreateAndSelectWallet("wallet.pendingWalletSelection.createAndSelectWallet"),
    PendingWalletSelectionSelectWallet("wallet.pendingWalletSelection.selectWallet"),
    IndexerGetBalances("indexer.getBalances"),
    IndexerGetSolanaBalances("indexer.getSolanaBalances"),
    IndexerGetTronBalances("indexer.getTronBalances"),
    IndexerGetTransactionHistory("indexer.getTransactionHistory"),
    WalletCallContract("wallet.callContract"),
    WalletCallTronContract("wallet.callTronContract"),
    WalletClaimWallet("wallet.claimWallet"),
    WalletAuthorizeRemoteAccess("wallet.authorizeRemoteAccess"),
    WalletCompleteEmailAuth("wallet.completeEmailAuth"),
    WalletCreateWallet("wallet.createWallet"),
    WalletImportWallet("wallet.importWallet"),
    WalletGetImportRecipientKey("wallet.getWalletImportRecipientKey"),
    WalletImportEncryptedWallet("wallet.importEncryptedWallet"),
    WalletExecute("wallet.execute"),
    WalletGetIdToken("wallet.getIdToken"),
    WalletGetRemoteAccessSession("wallet.getRemoteAccessSession"),
    WalletGetRemoteAccessSessionUsage("wallet.getRemoteAccessSessionUsage"),
    WalletHandleOidcRedirectCallback("wallet.handleOidcRedirectCallback"),
    WalletGetTransactionStatus("wallet.getTransactionStatus"),
    WalletIsValidMessageSignature("wallet.isValidMessageSignature"),
    WalletIsValidSolanaMessageSignature("wallet.isValidSolanaMessageSignature"),
    WalletIsValidTypedDataSignature("wallet.isValidTypedDataSignature"),
    WalletIsValidTronMessageSignature("wallet.isValidTronMessageSignature"),
    WalletIsValidTronTypedDataSignature("wallet.isValidTronTypedDataSignature"),
    WalletInspectRemoteCredential("wallet.inspectRemoteCredential"),
    WalletListAccess("wallet.listAccess"),
    WalletListAccessPage("wallet.listAccessPage"),
    WalletListAccessPages("wallet.listAccessPages"),
    WalletListWallets("wallet.listWallets"),
    WalletRevokeAccess("wallet.revokeAccess"),
    WalletSendTransaction("wallet.sendTransaction"),
    WalletSendSolanaTransfer("wallet.sendSolanaTransfer"),
    WalletSendTronTransaction("wallet.sendTronTransaction"),
    WalletSignInWithOidcIdToken("wallet.signInWithOidcIdToken"),
    WalletSignMessage("wallet.signMessage"),
    WalletSignSolanaMessage("wallet.signSolanaMessage"),
    WalletSignOut("wallet.signOut"),
    WalletSignTypedData("wallet.signTypedData"),
    WalletSignTronMessage("wallet.signTronMessage"),
    WalletSignTronTypedData("wallet.signTronTypedData"),
    WalletStartEmailAuth("wallet.startEmailAuth"),
    WalletStartOidcRedirectAuth("wallet.startOidcRedirectAuth"),
    WalletTransactionStatus("wallet.transactionStatus"),
    WalletUseWallet("wallet.useWallet"),
}
```

### `OMSWalletUpstreamService`

Remote OMS service that produced diagnostic failure details. `wireValue` is the
service identifier shared with the TypeScript and Swift SDKs.

```kotlin theme={null}
enum class OMSWalletUpstreamService(
    val wireValue: String,
) {
    Waas("waas"),
    Indexer("indexer"),
}
```

### `OMSWalletUpstreamError`

Normalized diagnostic detail from a remote OMS service response or transport failure.

```kotlin theme={null}
data class OMSWalletUpstreamError(
    val service: OMSWalletUpstreamService,
    val name: String? = null,
    val code: String? = null,
    val message: String? = null,
    val status: Int? = null,
    /** The service's reason for this error, when it gives one, for example why a request was invalid. */
    val cause: String? = null,
)
```

### `OMSWalletException`

Base exception type thrown by public OMS Wallet SDK APIs.

```kotlin theme={null}
sealed class OMSWalletException(
    val code: OMSWalletErrorCode,
    val operation: OMSWalletOperation? = null,
    val status: Int? = null,
    val txnId: String? = null,
    val retryable: Boolean? = null,
    val upstreamError: OMSWalletUpstreamError? = null,
    message: String,
    cause: Throwable? = null,
) : RuntimeException
```

### `OMSWalletSessionException`

```kotlin theme={null}
class OMSWalletSessionException(
    code: OMSWalletErrorCode = OMSWalletErrorCode.SessionMissing,
    operation: OMSWalletOperation? = null,
    message: String = "No active wallet session",
    cause: Throwable? = null,
) : OMSWalletException
```

### `OMSWalletRequestException`

```kotlin theme={null}
class OMSWalletRequestException(
    code: OMSWalletErrorCode = OMSWalletErrorCode.RequestFailed,
    operation: OMSWalletOperation? = null,
    status: Int? = null,
    retryable: Boolean? = status == null || status >= 500,
    upstreamError: OMSWalletUpstreamError? = null,
    message: String = "OMS request failed",
    cause: Throwable? = null,
) : OMSWalletException
```

### `OMSWalletResponseException`

```kotlin theme={null}
class OMSWalletResponseException(
    operation: OMSWalletOperation? = null,
    status: Int? = null,
    upstreamError: OMSWalletUpstreamError? = null,
    message: String = "OMS response was invalid",
    cause: Throwable? = null,
) : OMSWalletException
```

### `OMSWalletTransactionException`

```kotlin theme={null}
class OMSWalletTransactionException(
    code: OMSWalletErrorCode = OMSWalletErrorCode.TransactionStatusLookupFailed,
    operation: OMSWalletOperation? = null,
    status: Int? = null,
    txnId: String? = null,
    retryable: Boolean? = true,
    upstreamError: OMSWalletUpstreamError? = null,
    message: String = "Transaction status lookup failed",
    cause: Throwable? = null,
) : OMSWalletException
```

### `OMSWalletSelectionException`

```kotlin theme={null}
class OMSWalletSelectionException(
    code: OMSWalletErrorCode,
    operation: OMSWalletOperation? = null,
    message: String,
    cause: Throwable? = null,
) : OMSWalletException
```

### `OMSWalletValidationException`

```kotlin theme={null}
class OMSWalletValidationException(
    operation: OMSWalletOperation? = null,
    message: String,
    cause: Throwable? = null,
) : OMSWalletException
```

### `OMSWalletStorageException`

```kotlin theme={null}
class OMSWalletStorageException(
    operation: OMSWalletOperation? = null,
    message: String,
    cause: Throwable? = null,
) : OMSWalletException
```

### `OMSWalletAttestationException`

Thrown when a wallet-import response cannot be authenticated as an approved enclave.

```kotlin theme={null}
class OMSWalletAttestationException(
    operation: OMSWalletOperation? = null,
    message: String,
    cause: Throwable? = null,
) : OMSWalletException
```

### `formatUnits`

Divides `value` by 10^`decimals` and formats it as a decimal string.

```kotlin theme={null}
fun formatUnits(
    value: BigInteger,
    decimals: Int,
): String
```

### `parseUnits`

Multiplies the decimal string `value` by 10^`decimals`.

```kotlin theme={null}
fun parseUnits(
    value: String,
    decimals: Int,
): BigInteger
```
