The Kotlin SDK is an Android library. It requires AndroidDocumentation Index
Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
Use this file to discover all available pages before exploring further.
minSdk 26, Android compileSdk 34 or newer, Java 17 Android compile options, Kotlin, a project access key, and a project ID.
Install
Add the SDK dependency from Maven Central to your app module.Create The Client
Use the Android constructor to get secure session persistence and a non-extractable Android Keystore P-256 request credential.| Property | Use |
|---|---|
client.wallet | Authentication, wallet selection, signing, signature verification, ID tokens, and transactions. |
client.indexer | Token balance reads. |
client.session | Completed wallet-session state restored from Android-backed storage. |
client.supportedNetworks | Networks supported by this SDK build. |
Authenticate With Email
Email auth is a two-step OTP flow. Call these methods from a coroutine.completeEmailAuth resolves the authenticated wallet. If one matching wallet exists, it uses it. If none exists, it creates one.
Send A Transaction
After authentication, send a native token transaction withclient.wallet.sendTransaction. Values are raw base-unit integers.
On testnets, fee options are automatically sponsored, so Polygon Amoy is a good first network for testing.