Skip to content

Give wallet funding its own page, and say which chains it accepts - #62

Open
skyzer wants to merge 1 commit into
mainfrom
docs/partner-wallet-funding
Open

skyzer wants to merge 1 commit into
mainfrom
docs/partner-wallet-funding

Conversation

@skyzer

@skyzer skyzer commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

Do not merge until Unigox/account#606 is merged AND deployed to prod. This documents GET /api/v1/partner/deposit-addresses, which does not exist yet. Merging to main auto-publishes to developers.unigox.com, so landing this early advertises an endpoint that 404s. prod-account has no deploy_on_push — merging #606 is not enough on its own.

Why

A partner asked whether we provision Solana/EVM deposit addresses tied to their partner wallet, or whether getting USDC onto XAI was their step. The docs answered the second — and answered it wrongly.

Funding was documented only under third-party payouts. That understated it: the same partner wallet is the ForwardRequest sender for on-ramp bridge-out (partner_onramp.go) as well as off-ramp escrow funding (partner_offramp.go:2024). It now has its own page both flows point at.

The old wording also said a transfer on another chain "cannot fund an order and is not recoverable". That is true of the XAI wallet address and false of the per-chain deposit addresses we monitor and bridge from — 356 Solana→XAI deposits have completed in production. As written it read as a denial of a service we actually offer, so it is now scoped to the address it applies to.

What changed

  • New api-reference/funding-your-wallet.md — states up front that it covers off-ramp, third-party payouts and on-ramp alike, names the sender_address endpoint for each, then the XAI wallet, then the deposit-address path.
  • third-party-payouts.md keeps a short funding paragraph and links out, so the flow still reads standalone.
  • Nav entry + a changelog entry that explicitly retracts the old wording rather than quietly dropping it.

The token table is the load-bearing half

The chain list alone would be dangerous. The rules are not uniform and each mismatch is unrecoverable:

Deposit chain Accepted
Ethereum, Arbitrum, BSC, Polygon, Optimism, HyperEVM, Unichain USDC, USDT
Base, Avalanche USDC only
Solana USDC only
Tron USDT only
TON USDT only

Linea is deliberately absent. Its USDC chain_tokens row is active, but its chains row is active = false and it is streams-only, so a Linea deposit is never monitored — exactly the unrecoverable case. (Worth noting separately: trades/internal/consts/chains.go still lists linea in SupportedBridgeOutChains. One outbound Xai→Linea intent, ever, 2025-04-25. Likely stale there too.)

NEAR is absent because it is not a fundable chain-type — relay-quote lists it in DEFERRED_CHAIN_TYPES, and the stored value is a NEAR Intents account id, not a sendable address.

Verification

Matrix checked against relay prod (chains.active AND chain_tokens.active — both halves, which is what excludes Linea). No real allocated deposit addresses appear anywhere in the diff.

🤖 Generated with Claude Code

Funding was documented only under third-party payouts, which understated
it: the same partner wallet is the ForwardRequest sender for on-ramp
bridge-out as well as off-ramp escrow funding. It now has its own page
that both flows can point at.

The old wording also said a transfer on another chain "cannot fund an
order and is not recoverable". That is true of the XAI wallet address and
false of the per-chain deposit addresses we monitor and bridge from, so
it read as a denial of a service we actually offer. It is now scoped to
the address it applies to, alongside the deposit-address path.

Document the accepted tokens per chain. They are not uniform — Solana is
USDC-only, Tron and TON are USDT-only — and a mismatched send is
unrecoverable, so the list ships next to the addresses rather than being
left for a partner to infer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGpoBHdy1H255cVJdS9oTi
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-14T19:55:16.513185Z 7436717 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7436717c7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


## The wallet lives on XAI

`GET /deposit-addresses` returns the wallet address as `funding_wallet_address`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add the deposit-address operation to the OpenAPI spec

The newly advertised /api/v1/partner/deposit-addresses operation is not added to openapi/swagger.yaml; a repository-wide search finds it only in this page and the changelog. Because the public raw specification and interactive API reference are generated from that file, consumers cannot discover the operation's authentication or response schema, and generated clients will omit it. Add the operation to the OpenAPI source alongside this documentation.

Useful? React with 👍 / 👎.

Comment on lines +21 to +23
The practical consequence: **an empty balance stops every order**, not just the
next one. Keep the wallet funded ahead of demand. You can read the balance at any
time with `GET /wallet/funding-balance`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exempt on-ramp orders from the pre-funding warning

This warning is incorrect for the on-ramp flow that the page explicitly includes: openapi/swagger.yaml:2599-2604 documents send-out as an optional action after the order is already completed and the purchased crypto has landed in the wallet, so an initially empty balance does not stop the core on-ramp order. Telling partners to keep the wallet pre-funded for every order may make them transfer funds unnecessarily; scope this requirement to off-ramp and third-party payouts, while explaining that on-ramp send-out uses the newly purchased balance.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant