> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Types

## Configuration

### ClientProps

Configuration object for initializing the Dynamic SDK.

```kotlin theme={"system"}
data class ClientProps(
    val environmentId: String,                              // Your Dynamic environment ID (required)
    val apiBaseUrl: String? = "https://app.dynamicauth.com/api/v0",
    val appLogoUrl: String? = null,
    val appName: String = "Dynamic",
    val redirectUrl: String? = null,
    val appOrigin: String? = null,
    val cssOverrides: String? = null,
    val debugWebview: Boolean = false,
    val logLevel: LoggerLevel = LoggerLevel.INFO,
    val debug: ClientDebugProps? = null,
    val evmNetworks: List<GenericNetwork>? = null,
    val reownProjectId: String? = null,
    val deviceRegistrationModal: DeviceRegistrationModal? = null
)
```

#### Properties

| Property                  | Type                     | Required | Description                                                     |
| ------------------------- | ------------------------ | -------- | --------------------------------------------------------------- |
| `environmentId`           | String                   | Yes      | Your Dynamic environment ID from the dashboard                  |
| `apiBaseUrl`              | String?                  | No       | Override the Dynamic API base URL                               |
| `appLogoUrl`              | String?                  | No       | URL to your app's logo (shown in auth UI)                       |
| `appName`                 | String                   | No       | Your app's display name (defaults to `"Dynamic"`)               |
| `redirectUrl`             | String?                  | No       | Deep link URL scheme for callbacks (e.g., `yourapp://`)         |
| `appOrigin`               | String?                  | No       | Your app's origin URL                                           |
| `cssOverrides`            | String?                  | No       | CSS string injected into the webview to override default styles |
| `debugWebview`            | Boolean                  | No       | Enable WebView debugging                                        |
| `logLevel`                | LoggerLevel              | No       | Logging level (`DEBUG`, `INFO`, `WARN`, `ERROR`)                |
| `debug`                   | ClientDebugProps?        | No       | Debug options                                                   |
| `evmNetworks`             | `List<GenericNetwork>?`  | No       | Custom EVM networks                                             |
| `reownProjectId`          | String?                  | No       | Reown (WalletConnect) project ID                                |
| `deviceRegistrationModal` | DeviceRegistrationModal? | No       | Controls the device registration modal behavior                 |

#### Example

```kotlin theme={"system"}
import com.dynamic.sdk.android.DynamicSDK
import com.dynamic.sdk.android.core.ClientProps
import com.dynamic.sdk.android.core.LoggerLevel

val props = ClientProps(
    environmentId = "YOUR_ENV_ID",
    appLogoUrl = "https://your-app.com/logo.png",
    appName = "Your App Name",
    redirectUrl = "yourappscheme://",
    appOrigin = "https://your-app.com",
    cssOverrides = ".wallet-list-item__tile { background-color: lightblue; }",
    logLevel = LoggerLevel.DEBUG
)

DynamicSDK.initialize(props, applicationContext, this)
```

### ClientDebugProps

Debug configuration options.

```kotlin theme={"system"}
data class ClientDebugProps(
    val webview: Boolean = false,
    val messageTransport: Boolean = false,
    val loggerLevel: Int? = null
)
```

#### Properties

* **webview** (Boolean) - Log webview messages
* **messageTransport** (Boolean) - Log message transport events
* **loggerLevel** (Int?) - Override the logger level by numeric value

### DeviceRegistrationModal

Controls whether the device registration modal is shown automatically.

```kotlin theme={"system"}
data class DeviceRegistrationModal(
    val enabled: Boolean = true
)
```

#### Properties

* **enabled** (Boolean) - When `false`, the SDK does not show the device registration modal automatically

## Authentication

### UserProfile

Represents an authenticated user's profile.

```kotlin theme={"system"}
data class UserProfile(
    val userId: String?,
    val email: String?,
    val phoneNumber: String?,
    // Additional fields available
)
```

#### Example

```kotlin theme={"system"}
val user = sdk.auth.authenticatedUser
if (user != null) {
    println("User ID: ${user.userId}")
    println("Email: ${user.email}")
    println("Phone: ${user.phoneNumber}")
}
```

### PhoneData

Phone number data for SMS authentication.

```kotlin theme={"system"}
data class PhoneData(
    val dialCode: String,   // e.g., "+1"
    val iso2: String,       // e.g., "US"
    val phone: String       // Phone number without country code
)
```

#### Example

```kotlin theme={"system"}
val phoneData = PhoneData(
    dialCode = "+1",
    iso2 = "US",
    phone = "5551234567"
)

sdk.auth.sms.sendOTP(phoneData)
```

### SignInWithExternalJwtParams

Parameters for external JWT authentication.

```kotlin theme={"system"}
data class SignInWithExternalJwtParams(
    val jwt: String     // The external JWT token
)
```

#### Example

```kotlin theme={"system"}
sdk.auth.externalAuth.signInWithExternalJwt(
    SignInWithExternalJwtParams(jwt = "your-jwt-token")
)
```

## Wallets

### BaseWallet

Represents a user's wallet.

```kotlin theme={"system"}
data class BaseWallet(
    val address: String,        // Wallet address
    val chain: String,          // "EVM" or "SOL"
    val walletName: String?,    // Wallet name (optional)
    val id: String?             // Wallet ID for API operations (optional)
)
```

#### Example

```kotlin theme={"system"}
val wallets = sdk.wallets.userWallets
wallets.forEach { wallet ->
    println("Address: ${wallet.address}")
    println("Chain: ${wallet.chain}")
    println("Name: ${wallet.walletName}")
    println("ID: ${wallet.id}")
}
```

### GenericNetwork

Represents a blockchain network.

```kotlin theme={"system"}
data class GenericNetwork(
    val name: String,
    val chainId: Int?,      // For EVM networks
    val networkId: String?  // For Solana networks
)
```

#### Example

```kotlin theme={"system"}
val evmNetworks = sdk.networks.evm
val ethereum = evmNetworks.first { it.chainId == 1 }
println("Network: ${ethereum.name}, Chain ID: ${ethereum.chainId}")

val solanaNetworks = sdk.networks.solana
val mainnet = solanaNetworks.first { it.networkId == "mainnet-beta" }
println("Network: ${mainnet.name}, Network ID: ${mainnet.networkId}")
```

## EVM / Blockchain

### EthereumTransaction

Transaction data for EVM chains.

```kotlin theme={"system"}
data class EthereumTransaction(
    val to: String,                     // Recipient address
    val value: String,                  // Amount in Wei (as String)
    val gasLimit: Int,                  // Gas limit
    val maxFeePerGas: Int? = null,      // Max fee per gas (optional)
    val maxPriorityFeePerGas: Int? = null, // Priority fee (optional)
    val data: String? = null            // Contract data (optional)
)
```

#### Example

```kotlin theme={"system"}
val transaction = EthereumTransaction(
    to = "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
    value = "1000000000000000", // 0.001 ETH in Wei
    gasLimit = 21000,
    maxFeePerGas = 30000000000,
    maxPriorityFeePerGas = 2000000000
)
```

### WriteContractInput

Input for writing to a smart contract.

```kotlin theme={"system"}
data class WriteContractInput(
    val address: String,                // Contract address
    val functionName: String,           // Function to call
    val args: List<Any>,                // Function arguments
    val abi: List<Map<String, Any>>     // Contract ABI
)
```

#### Example

```kotlin theme={"system"}
val input = WriteContractInput(
    address = "0x...",
    functionName = "transfer",
    args = listOf("0x...", "1000000000000000000"), // recipient, amount
    abi = parseAbiJson(Erc20.abi)
)
```

### GasPrice

Current gas price information for EVM chains.

```kotlin theme={"system"}
data class GasPrice(
    val maxFeePerGas: Int,
    val maxPriorityFeePerGas: Int
)
```

#### Example

```kotlin theme={"system"}
val client = sdk.evm.createPublicClient(chainId = 1)
val gasPrice = client.getGasPrice()
println("Max fee: ${gasPrice.maxFeePerGas}")
println("Priority fee: ${gasPrice.maxPriorityFeePerGas}")
```

### Erc20

ERC20 token utilities.

```kotlin theme={"system"}
object Erc20 {
    val abi: String  // Standard ERC20 ABI as JSON string
}
```

#### Example

```kotlin theme={"system"}
// Parse ERC20 ABI for contract interactions
val abiList = parseAbiJson(Erc20.abi)
```

### BlockhashResult

Solana blockhash information.

```kotlin theme={"system"}
data class BlockhashResult(
    val blockhash: String,
    val lastValidBlockHeight: Long
)
```

#### Example

```kotlin theme={"system"}
val connection = sdk.solana.createConnection()
val result = connection.getLatestBlockhash()
println("Blockhash: ${result.blockhash}")
println("Valid until block: ${result.lastValidBlockHeight}")
```

## MFA

### MfaDevice

Represents an MFA device.

```kotlin theme={"system"}
data class MfaDevice(
    val id: String?,
    val type: MfaDeviceType?
)

enum class MfaDeviceType {
    totp
}
```

#### Example

```kotlin theme={"system"}
val devices = sdk.mfa.getUserDevices()
devices.forEach { device ->
    println("Device ID: ${device.id}")
    println("Type: ${device.type?.name}")
}
```

### MfaAddDevice

Response when adding an MFA device.

```kotlin theme={"system"}
data class MfaAddDevice(
    val secret: String,     // Secret for QR code generation
    val id: String?
)
```

#### Example

```kotlin theme={"system"}
val device = sdk.mfa.addDevice("totp")
println("Secret for QR code: ${device.secret}")
// Display QR code with this secret for user to scan
```

### MfaAuthenticateDevice

Parameters for authenticating an MFA device.

```kotlin theme={"system"}
data class MfaAuthenticateDevice(
    val code: String,
    val deviceId: String,
    val createMfaToken: MfaCreateToken
)
```

#### Example

```kotlin theme={"system"}
val token = sdk.mfa.authenticateDevice(
    MfaAuthenticateDevice(
        code = "123456",
        deviceId = "device-id",
        createMfaToken = MfaCreateToken(singleUse = true)
    )
)
```

### MfaCreateToken

Parameters for MFA token creation.

```kotlin theme={"system"}
data class MfaCreateToken(
    val singleUse: Boolean
)
```

#### Example

```kotlin theme={"system"}
val createToken = MfaCreateToken(singleUse = true)
```

## Passkeys

### UserPasskey

Represents a user's passkey.

```kotlin theme={"system"}
data class UserPasskey(
    val id: String,
    val createdAt: String,      // ISO format
    val lastUsedAt: String?,    // ISO format (optional)
    val isDefault: Boolean?
)
```

#### Example

```kotlin theme={"system"}
val passkeys = sdk.passkeys.getPasskeys()
passkeys.forEach { passkey ->
    println("ID: ${passkey.id}")
    println("Created: ${passkey.createdAt}")
    println("Last used: ${passkey.lastUsedAt}")
    println("Is default: ${passkey.isDefault}")
}
```

### DeletePasskeyRequest

Request to delete a passkey.

```kotlin theme={"system"}
data class DeletePasskeyRequest(
    val passkeyId: String
)
```

#### Example

```kotlin theme={"system"}
sdk.passkeys.deletePasskey(
    DeletePasskeyRequest(passkeyId = "passkey-id")
)
```

### PasskeyAuthenticationResponse

Response from passkey MFA authentication.

```kotlin theme={"system"}
data class PasskeyAuthenticationResponse(
    val jwt: String?    // MFA token
)
```

#### Example

```kotlin theme={"system"}
val response = sdk.passkeys.authenticatePasskeyMFA(
    createMfaToken = MfaCreateToken(singleUse = true),
    relatedOriginRpId = null
)
println("MFA Token: ${response.jwt}")
```

## Error Handling

All SDK methods that can fail will throw exceptions. Use standard Kotlin error handling:

```kotlin theme={"system"}
try {
    sdk.auth.email.verifyOTP(code)
} catch (e: Exception) {
    Log.e("SDK", "Error: ${e.message}")
}
```

For suspend functions in coroutines:

```kotlin theme={"system"}
viewModelScope.launch {
    try {
        val wallets = sdk.wallets.userWallets
    } catch (e: Exception) {
        errorMessage.value = "Failed: ${e.message}"
    }
}
```
