0Bit Documentation

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

ConstraintSession field or sourceUse
FlowflowLock to on_ramp, off_ramp, or swap.
Assettarget_tokenFocus the user on a supported token or stablecoin.
Networktarget_networkAvoid unsupported chain choices.
Walletwallet_addressPrefill a destination after your app validates ownership or intent.
CountryCapability or eligibility checkDecide whether to show a path before creating a session.
Payment or payout methodCapability data or hosted selectionPresent 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 sayingSay
"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."

On this page