Constrain assets, chains, and countries
Lock supported asset, network, country, and method choices into a hosted 0Gate session safely.
Constraints let your product present a focused hosted flow without turning into a custom ramp engine. Use them to keep users inside approved paths: a buy flow for one asset, a sell flow for one network, or a session that starts from a known funding intent.
Constraint decision
Constraint types
| Constraint | Session field or source | Use |
|---|---|---|
| Flow | flow | Lock to on_ramp, off_ramp, or swap. |
| Asset | target_token | Focus the user on a supported token or stablecoin. |
| Network | target_network | Avoid unsupported chain choices. |
| Wallet | wallet_address | Prefill a destination after your app validates ownership or intent. |
| Country | Capability or eligibility check | Decide whether to show a path before creating a session. |
| Payment or payout method | Capability data or hosted selection | Present method expectations only when supported. |
Product rule
Constraints narrow a hosted 0Gate journey. They do not authorize unsupported countries, unsupported assets, custom provider routing, or private liquidity paths. If a value is not supported for the partner, market, environment, or current product configuration, do not present it as available.
const supported = await checkCapabilities({
side: 'on_ramp',
country: 'GB',
currency: 'EUR',
asset: 'USDC',
network: 'ETHEREUM',
});
if (!supported) {
return { status: 'unavailable' };
}
const session = await gate.sessions.create({
amount: '100.00',
currency: 'EUR',
flow: 'on_ramp',
target_token: 'USDC',
target_network: 'ETHEREUM',
return_url: 'https://app.example/return',
});Copy guidance
| Instead of saying | Say |
|---|---|
| "0Gate supports this asset everywhere." | "This asset is available where your account and market configuration support it." |
| "All countries can buy." | "Check eligibility before presenting the buy flow." |
| "This payment method always works." | "Available methods depend on currency, country, partner configuration, and live capability data." |
| "Routing is optimized by our engine." | "0Gate routes the hosted flow according to approved product configuration." |