Skip to main content
The Cherp 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 Cherp 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 Cherp for broadcast.

Wallet interface

You must implement the PaymentWallet interface for your wallet provider:
interface PaymentWallet {
  address: string;
  chain: CAIP2ChainId;
  signTransaction(tx: UnsignedTransaction): Promise<SignedTransaction>;
}

Initialization

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:
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

React Native

TypeScript SDK for React Native apps.

iOS

Swift SDK for iOS apps.

Android

Kotlin SDK for Android apps.