Buy crypto with credit card, Apple Pay, or Google Pay.
When to use:
- New players without existing crypto
- Topping up wallets with fiat
- Simplest path to getting tokens
Installation
Quick Start
import { checkout } from '@imtbl/sdk';
import { Environment } from '@imtbl/sdk/config';
const { Checkout, WidgetType, WidgetTheme, CommerceFlowType, CommerceEventType } = checkout;
const checkoutSDK = new Checkout({
baseConfig: {
environment: Environment.SANDBOX,
publishableKey: 'YOUR_PUBLISHABLE_KEY',
},
});
// Basic onramp flow - buy crypto with fiat
export async function openOnramp(elementId: string) {
const widgets = await checkoutSDK.widgets({ config: { theme: WidgetTheme.DARK } });
const widget = widgets.create(WidgetType.IMMUTABLE_COMMERCE);
widget.mount(elementId, { flow: CommerceFlowType.ONRAMP });
widget.addListener(CommerceEventType.SUCCESS, (data) => {
console.log('Onramp complete:', data);
widget.unmount();
});
widget.addListener(CommerceEventType.FAILURE, (data) => {
console.error('Onramp failed:', data);
widget.unmount();
});
widget.addListener(CommerceEventType.CLOSE, () => {
widget.unmount();
});
return widget;
}
// Onramp with pre-selected token and amount
export async function onrampWithAmount(
elementId: string,
options: {
tokenAddress?: string;
amount?: string;
}
) {
const widgets = await checkoutSDK.widgets({ config: { theme: WidgetTheme.DARK } });
const widget = widgets.create(WidgetType.IMMUTABLE_COMMERCE);
widget.mount(elementId, {
flow: CommerceFlowType.ONRAMP,
tokenAddress: options.tokenAddress,
amount: options.amount,
});
return widget;
}
Parameters
| Parameter | Type | Description |
|---|
flow | 'ONRAMP' | Required. Specifies the onramp flow |
tokenAddress | string | Token to purchase |
amount | string | Amount to purchase (in token units) |
Events
| Event | Description | Payload |
|---|
SUCCESS | Purchase completed | { token, amount } |
FAILURE | Purchase failed | { error } |
CLOSE | User closed widget | — |
Supported Tokens
| Token | Available |
|---|
| IMX | ✅ |
| USDC | ✅ |
| ETH | ✅ |
Payment Methods
| Method | Availability |
|---|
| Credit/Debit Card | Global |
| Apple Pay | iOS/Safari |
| Google Pay | Android/Chrome |
| Bank Transfer | Select regions |
How It Works
The onramp is powered by Transak:
1. User selects token and amount
↓
2. Enter payment details (first time only)
↓
3. KYC verification (if required for amount)
↓
4. Payment processed
↓
5. Tokens delivered to wallet
Transactions above certain thresholds may require identity verification (KYC). This is a one-time process.
Fees
- Service fee: ~1-3% (varies by payment method)
- Network fee: Included in the quoted price
- No hidden fees
Next Steps