> ## 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 SDK quickstart

> Install the Kotlin SDK, authenticate a wallet, and send a transaction on Polygon Amoy.

The Kotlin SDK supports Android 10 / API 29 or newer.

## Install the SDK

Add version `0.3.0` of the SDK to your app module.

```kotlin theme={null}
dependencies {
    implementation("io.github.0xsequence:oms-wallet-kotlin-sdk:0.3.0")
}
```

Use Android `compileSdk 34` or newer and Java 17 compile options. The SDK dependency includes its required runtime transitively.

## Create the client

```kotlin theme={null}
import technology.polygon.omswallet.OMSWallet

val omsWallet = OMSWallet(
    context = context,
    publishableKey = "YOUR_PUBLISHABLE_KEY",
)
```

You can pass an activity, service, or application `Context`. The constructor retains `context.applicationContext` for storage and Android Keystore access, so keep one client for your application scope rather than tying it to an activity instance.

Construction is synchronous and restores a valid completed session when one exists. Methods that contact OMS, including authentication, wallet transactions, and indexer queries, are `suspend` functions. Call them from your coroutine scope.

The client exposes two independent surfaces:

| Property            | Purpose                                                           |
| ------------------- | ----------------------------------------------------------------- |
| `omsWallet.wallet`  | Authentication, active wallet sessions, signing, and transactions |
| `omsWallet.indexer` | Read-only balances and history for any address                    |

## Authenticate with email

Request a code, then complete authentication after the user enters it.

```kotlin theme={null}
import technology.polygon.omswallet.wallet.CompleteAuthResult

omsWallet.wallet.startEmailAuth("user@example.com")

val auth = omsWallet.wallet.completeEmailAuth("123456")
check(auth is CompleteAuthResult.WalletSelected)

println("Wallet address: ${auth.wallet.address}")
```

Automatic wallet selection is the default. It selects the first existing Ethereum wallet returned by OMS, or creates one when none exists. See [Authentication](/wallets/sdk/kotlin/authentication) for native OIDC ID-token authentication, redirect authentication, and app-driven wallet selection.

## Send a transaction

After authentication, submit a zero-value transaction on Polygon Amoy.

```kotlin theme={null}
import technology.polygon.omswallet.Network
import java.math.BigInteger

val result = omsWallet.wallet.sendTransaction(
    network = Network.AMOY,
    to = "0x1111111111111111111111111111111111111111",
    value = BigInteger.ZERO,
)

println("OMS transaction: ${result.txnId}")
println("Status: ${result.status}")
println("Transaction hash: ${result.txnHash}")
```

The SDK prepares, executes, and waits for status by default. See [Send transactions](/wallets/sdk/kotlin/send-transactions) for other transaction inputs, fee selection, and status handling.
