Skip to main content

Overview

Cavos integrates with Ramp Network to allow users to purchase crypto with fiat currency directly into their wallet.

Supported Networks

NetworkStatus
MainnetSupported
SepoliaNot available
Onramp is only available on mainnet. Calling getOnramp() on Sepolia will throw an error.

Usage

Web SDK

import { useCavos } from '@cavos/react';

function BuyButton() {
  const { getOnramp, address } = useCavos();

  const handleBuy = () => {
    if (!address) return;
    
    const url = getOnramp('RAMP_NETWORK');
    window.open(url, '_blank');
  };

  return <button onClick={handleBuy}>Buy Crypto</button>;
}

React Native SDK

import { useCavosNative } from '@cavos/react-native';
import * as Linking from 'expo-linking';

function BuyButton() {
  const { cavos } = useCavosNative();

  const handleBuy = async () => {
    const url = cavos.getOnramp('RAMP_NETWORK');
    await Linking.openURL(url);
  };

  return <Button title="Buy Crypto" onPress={handleBuy} />;
}

Supported Providers

ProviderIDDescription
Ramp NetworkRAMP_NETWORKCard payments, bank transfers

Ramp Network Details

The generated URL includes:
ParameterValue
userAddressUser’s Starknet wallet address
outAssetSTARKNET_USDC
enabledCryptoAssetsSTARKNET_*
defaultFlowONRAMP
Users can change the output asset in the Ramp interface.

Error Handling

try {
  const url = getOnramp('RAMP_NETWORK');
} catch (error) {
  if (error.message.includes('No account')) {
    // User not logged in
  } else if (error.message.includes('Sepolia')) {
    // Wrong network
  }
}