0Bit Documentation

Capability-first routing

Use 0Gate capabilities, eligibility, and session constraints before showing a ramp, payment, payout, or swap path.

Capability-first routing means your product checks what is supported before it presents a 0Gate path to the user. The supported path can depend on country, currency, asset, network, payment method, payout method, flow, partner account configuration, environment, and contract status.

Routing model

The public product rule is simple: do not make your UI promise a country, currency, asset, network, payment method, payout method, or quote unless the current environment and partner configuration support it.

What to check

CheckWhy it mattersExample decision
Country eligibilityA user's region can decide whether a ramp path is available.Hide the buy button or show an unavailable state.
Fiat currencyCountry and partner configuration can affect supported fiat choices.Offer only returned currencies.
Asset and networkToken support can differ by side and market.Show only supported assets for on-ramp or off-ramp.
Payment methodBuy-side methods can be configured per country/currency.Present only methods returned by capability data or hosted 0Gate.
Payout methodSell-side payout methods can differ from payment methods.Do not reuse buy-side method labels for sell flows.
Flow lockon_ramp, off_ramp, and swap are distinct hosted paths.Bind the session to the selected task when the UI already knows it.

Implementation pattern

  1. Capture the user's intent: buy, sell, swap, fund, withdraw, or top up.
  2. Use server-side capability checks or approved product configuration to determine whether the path can be shown.
  3. If unsupported, stop before session creation and explain that the path is unavailable.
  4. If supported, create the 0Gate session with only allowed constraints.
  5. Mount the hosted surface or redirect.
  6. Verify the signed webhook before updating durable state.
type GateFlow = 'on_ramp' | 'off_ramp' | 'swap';

function shouldCreateGateSession(input: {
  flow: GateFlow;
  countrySupported: boolean;
  fiatSupported: boolean;
  assetSupported: boolean;
}) {
  return (
    input.countrySupported &&
    input.fiatSupported &&
    input.assetSupported &&
    ['on_ramp', 'off_ramp', 'swap'].includes(input.flow)
  );
}

This is deliberately a product guard, not a substitute for the API. The hosted 0Gate surface can still reject or route a flow according to current configuration.

Boundary

Capability-first routing is not internal liquidity routing. Public docs and partner UI should not describe provider selection, inventory levels, venue behavior, reserve allocation, treasury operations, or fallback algorithms. Say that availability depends on account configuration, region, asset, method, and current capability data.

On this page