Payments Overview
The ONE SDK (@one_deploy/sdk v1.1.0) provides a complete payments layer that covers every movement of value your users need: buying crypto with fiat, selling crypto back to fiat, swapping between tokens, sending peer-to-peer transfers, funding e-wallets, and paying bills.
Payment Flow
+------------------+
| Your User |
+--------+---------+
|
+---------------------+---------------------+
| | | | |
v v v v v
+---------+ +--------+ +------+ +--------+ +---------+
| On-ramp | |Off-ramp| | Swap | |Transfer| | Top-up |
| (Buy) | | (Sell) | | | | (P2P) | | / Bills |
+---------+ +--------+ +------+ +--------+ +---------+
| | | | |
v v v v v
+---------------------------------------------------+
| @one_deploy/sdk Payments API |
| |
| Widgets (Web) | OneEngineClient (All) |
+---------------------------------------------------+
| | | | |
v v v v v
+---------------------------------------------------+
| ONE Engine API (engine.one23.io) |
+---------------------------------------------------+
| | |
v v v
Fiat Payment Blockchain Local Payment
Processors Networks Providers
Payment Capabilities
| Capability | Description | Widget (Web) | API (All Platforms) |
|---|---|---|---|
| On-ramp | Buy crypto with fiat (card, bank, mobile money) | OneOnrampWidget | getOnrampQuote, createOnrampSession |
| Off-ramp | Sell crypto to fiat (bank payout, mobile money) | OneOfframpWidget | getOfframpQuote, createOfframpTransaction |
| Swap | Exchange token-to-token, same-chain or cross-chain | OneSwapWidget | getSwapQuote, executeSwap |
| P2P Transfer | Send tokens to any wallet address | OneSendWidget | sendTransaction |
| Top-up | Fund e-wallets via local payment methods | OnePayWidget | createTopup |
| Bill Payments | Pay utility bills, airtime, subscriptions | -- (coming soon) | payBill, getBillProviders |
Widgets vs. API
The ONE SDK exposes two complementary interfaces for payments:
Web Widgets (React DOM only)
Pre-built React components that handle the full UI flow -- input fields, quote display, confirmation, and status tracking. Drop them into any React DOM application.
import { OneOnrampWidget, OneSwapWidget, OnePayWidget } from '@one_deploy/sdk';
All payment widgets render to the DOM and require a browser environment. They are not available in React Native or Node.js. Use the API methods directly on those platforms.
API Methods (All Platforms)
Every payment action is also available as a method on OneEngineClient. Use these in React Native, Node.js backends, or when you need full control over the UI.
import { OneEngineClient } from '@one_deploy/sdk';
const engine = new OneEngineClient({
apiKey: process.env.ONE_API_KEY!,
projectId: process.env.ONE_PROJECT_ID!,
});
// Works on Web, React Native, and Node.js
const quote = await engine.getOnrampQuote('USD', 100, 'USDT');
const swapQuote = await engine.getSwapQuote({ fromToken: 'ETH', toToken: 'USDC', amount: '1.0' });
Supported Chains
Payment methods are available on the following networks (varies by capability):
| Chain | On-ramp | Off-ramp | Swap | Transfer |
|---|---|---|---|---|
| Ethereum | Yes | Yes | Yes | Yes |
| Polygon | Yes | Yes | Yes | Yes |
| Arbitrum | Yes | Yes | Yes | Yes |
| Optimism | Yes | -- | Yes | Yes |
| Base | Yes | -- | Yes | Yes |
| BSC | Yes | Yes | Yes | Yes |
| Avalanche | Yes | -- | Yes | Yes |
Common Types
Several types are shared across payment APIs:
/** Identifies a token across chains */
interface TokenIdentifier {
symbol: string;
chainId: number;
address?: string; // native tokens omit address
}
/** Fiat currency reference */
interface FiatCurrency {
code: string; // ISO 4217 -- "USD", "EUR", "NGN"
name: string;
symbol: string; // "$", "€", "₦"
decimals: number;
}
/** Generic payment status used across all flows */
type PaymentStatus =
| 'pending'
| 'processing'
| 'completed'
| 'failed'
| 'expired'
| 'refunded';
/** Callback shape used by all payment widgets */
interface PaymentCallbacks {
onSuccess?: (result: { transactionId: string; status: PaymentStatus }) => void;
onError?: (error: { code: string; message: string }) => void;
onClose?: () => void;
}
Next Steps
- On-ramp (Buy Crypto) -- let users buy crypto with fiat.
- Off-ramp (Sell Crypto) -- let users cash out to fiat.
- Token Swap -- exchange tokens same-chain or cross-chain.
- P2P Transfer -- send tokens to any address.
- E-wallet Top-up -- fund wallets via local payment methods.
- Bill Payments -- pay bills with crypto (coming soon).
- Pay Widget -- unified payment component with multiple modes.