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

# SDK overview

> Integrate Crycket into your mobile app

The Crycket SDK is available for React Native, iOS (Swift), and Android (Kotlin). All three platforms implement the same semantic interface.

## Key principles

* **The SDK wraps the Crycket API**, not the chain. It handles the build → sign → submit flow and provides real-time status updates.
* **The SDK never handles wallet connection.** You wrap your wallet in a `PaymentWallet` interface and pass it to the SDK. The wallet must be ready to sign before invoking the SDK.
* **Private keys never leave the device.** The SDK calls `wallet.signTransaction()` locally, then submits the signed blob to Crycket for broadcast.

## Wallet interface

You must implement the `PaymentWallet` interface for your wallet provider:

<CodeGroup>
  ```typescript React Native theme={null}
  interface PaymentWallet {
    address: string;
    chain: CAIP2ChainId;
    signTransaction(tx: UnsignedTransaction): Promise<SignedTransaction>;
  }
  ```

  ```swift Swift theme={null}
  protocol PaymentWallet {
    var address: String { get }
    var chain: CAIP2ChainId { get }
    func signTransaction(_ tx: UnsignedTransaction) async throws -> SignedTransaction
  }
  ```

  ```kotlin Kotlin theme={null}
  interface PaymentWallet {
    val address: String
    val chain: CAIP2ChainId
    suspend fun signTransaction(tx: UnsignedTransaction): SignedTransaction
  }
  ```
</CodeGroup>

## Initialization

```typescript theme={null}
const sdk = PaymentSDK.init({
  apiKey: 'pk_live_...',
  debug: false, // verbose logging in development
});
```

## Status context

The `context` object passed to `onStatusChange` drives UX without requiring chain-specific logic:

```typescript theme={null}
interface StatusContext {
  estimatedWaitSeconds: number | null; // from chain config
  isDelayed: boolean;                  // true if past expected confirmation time
  retryRequired: boolean;             // tx dropped, re-sign needed
  expiresAt: string;                  // ISO 8601
  expiresInSeconds: number;
  pendingAtExpiry: boolean;
  ataRentLamports: number | null;
  estimatedFeeDisplay: string | null; // "~$0.001 USDC" or "~0.00001 ETH"
}
```

## Next steps

<CardGroup cols={3}>
  <Card title="React Native" icon="react" href="/sdk/react-native">
    TypeScript SDK for React Native apps.
  </Card>

  <Card title="iOS" icon="apple" href="/sdk/ios">
    Swift SDK for iOS apps.
  </Card>

  <Card title="Android" icon="android" href="/sdk/android">
    Kotlin SDK for Android apps.
  </Card>
</CardGroup>
