0Bit Documentation

Pre-fill a ramp flow

Use session fields to prefill the hosted 0Gate experience without moving privileged logic into the browser.

Pre-fill lets your product make the hosted 0Gate flow feel native while keeping the authority server-side. The session can bind the flow, return routes, asset constraints, network constraints, wallet address, user reference, and metadata before the browser opens the hosted experience.

Pre-fill fields

FieldUsePublic-safe note
flowLock to on_ramp, off_ramp, or swap.Prefer server-side flow locks over browser-only assumptions.
target_tokenPreselect or constrain the asset.Only use assets supported for the active side and market.
target_networkPreselect or constrain the network.Validate wallet and chain compatibility.
wallet_addressPrefill the destination where applicable.Treat as customer data; avoid logging it unnecessarily.
user_referenceCorrelate events to your order or user record.Use opaque ids, not raw PII.
metadataAttach support-safe order context.Do not include secrets, identity documents, bank details, or provider payloads.
kyc_packageContract-gated enterprise path for trusted partners.Do not document raw package shape publicly; follow partner-specific approval.

Flow

Example

const session = await gate.sessions.create({
  amount: '50.00',
  currency: 'EUR',
  flow: 'on_ramp',
  target_token: 'USDC',
  target_network: 'ETHEREUM',
  wallet_address: '0x0000000000000000000000000000000000000000',
  user_reference: 'wallet_funding_123',
  return_url: 'https://app.example/funding/123/return',
  metadata: {
    funding_intent_id: 'wallet_funding_123',
    product_surface: 'wallet',
  },
});

Review rules

  • Use capability data before pre-filling asset, network, country, payment, or payout expectations.
  • Use user_reference for correlation and metadata for support-safe ids.
  • Do not pass raw KYC/KYB documents unless the partner account is explicitly enabled for the contract-gated path.
  • Do not use metadata to store secrets, credentials, card data, bank details, raw identity data, or internal pricing logic.

On this page