Reference

API reference · Solana widget SDK

createRamps configuration, callbacks, and shared types used by Web and React Native Solana integrations.

createRampsTypesUSDC

MoneyGram Ramps: API reference (widget SDK)

Applies to the iframe SDK used by Web and (via WebView) React Native on Solana and Stellar (non-custodial and custodial).

API Reference

createRamps(config)

Creates and initializes the MoneyGram widget.

Parameters:

TypeScript
interface RampsConfig {  // Required  container: HTMLElement                // DOM element to mount widget into  sessionToken?: string                 // JWT from your backend    // Wallet context  wallet?: {    address: string                     // Solana public key or Stellar G-address    chain: 'solana' | 'stellar'    asset: 'USDC'    walletType: 'non-custodial'    displayName?: string                // e.g. "Your Wallet App" (optional)  }    // Customer pre-fill (optional)  customer?: {    firstName?: string    middleName?: string    lastName?: string    email?: string    phone?: string    dateOfBirth?: string                // YYYY-MM-DD  }    // Transaction pre-fill (optional)  transaction?: {    type: 'off-ramp'    destinationCountry?: string         // ISO 3166-1 alpha-3, e.g. "MEX"    destinationCurrency?: string        // ISO 4217, e.g. "MXN"    destinationSubdivision?: string     // ISO 3166-2, e.g. "MX-CMX"    amount?: number    asset?: 'USDC'  }    // View mode (optional)  viewTransaction?: {    id: string                          // Ramps transaction id (from onTransactionCreated or onComplete)  }    // Callbacks  onSignTransaction?: (tx: OnChainTransaction) => Promise<string>  // Custodial partners: resolve with the on-chain transaction hash  onDepositAddress?: (deposit: DepositAddress) => void | Promise<void | string>  onReady?: () => void  // Optional. Fires once after validate succeeds (before commit). React Native: RAMPS_TRANSACTION_CREATED postMessage.  onTransactionCreated?: (transaction: TransactionRecord) => void  onComplete?: (transaction: TransactionRecord) => void  onError?: (error: { transactionId?: string; reason: string }) => void  onClose?: () => void    // Advanced  theme?: 'dark' | 'light'  widgetUrl?: string                    // Override widget URL (testing only)}

Returns:

TypeScript
interface RampsSDK {  open(): void      // Show the widget  close(): void     // Hide the widget  destroy(): void   // Remove iframe and cleanup}

TypeScript Types

Copy these type definitions into your project:

TypeScript
// Full SDK unions. This widget integration accepts chain 'solana' | 'stellar' and asset 'USDC'.type SupportedChain =  | 'stellar'  | 'ethereum'  | 'polygon'  | 'base'  | 'arbitrum'  | 'celo'  | 'monad'  | 'solana'type SupportedAsset = 'USDC' | 'USDT' | 'XLM'type WalletType = 'custodial' | 'non-custodial'// Widget config uses off-ramp / on-ramp.// RAMPS_TRANSACTION_CREATED uses cash-out / cash-in for the same flows.type TransactionType = 'off-ramp' | 'on-ramp' // Transactioninterface OnChainTransaction {  chain: SupportedChain  to: string  amount: string  asset: SupportedAsset  requiredNetwork?: 'mainnet' | 'testnet'  tokenAddress?: string  tokenDecimals?: number  issuer?: string // Stellar Circle issuer when present  memo?: string  rawTransaction?: unknown // Optional. Not populated for Stellar.} interface DepositAddress {  address: string  memo?: string  chain: SupportedChain  asset: SupportedAsset  amount?: string                       // stringified asset amount to transfer} interface TransactionRecord {  id: string  type: TransactionType  status: string  chain: SupportedChain  asset: SupportedAsset  walletType: WalletType  walletAddress: string  amount: number  referenceNumber?: string  createdAt: string  updatedAt: string} // Sessioninterface Session {  sessionToken: string  sessionId: string  walletType: 'custodial' | 'non-custodial'  language: string // resolved widget language short code (en/es/fr/pt/uk)  widgetUrl: string // always includes /widget.html?mode=off-ramp} // SDKinterface RampsSDK {  open(): void  close(): void  destroy(): void} // Configuration: RampsConfig is defined once under `createRamps(config)` above.

Related: onTransactionCreated / RAMPS_TRANSACTION_CREATED (optional, after validate) · Transaction status & webhooks