Repository navigation
Release dev to main: transfer recovery, batch router, rebalance price (2026-11-26) - #310
Open
ezedike-evan wants to merge 7 commits into
Open
ezedike-evan wants to merge 7 commits into
ezedike-evan wants to merge 7 commits into
Conversation
…akers (#303) * Fee table per route, with a capped rebalance price for market makers (#297) Off-contract routes (EVM, Solana, Sui and Aptos sources) now price Xebra's fee from one table in the SDK core (FEE_TABLE) through one pure function, priceFee, used by both /v1 (quote and build) and the page's build routes. Rules match on product, API key, source and destination domain; the most specific wins. The default rule is today's 0.01% + 0.01 USDC, unchanged. A rebalance with a valid API key is priced at 0.01% capped at 2 USDC a move, plus 0.01: 100,000 USDC costs 2.01 instead of 10.01, 1,000 USDC stays 0.11. Without a key, a rebalance is priced as a transfer. - /v1/quote and /v1/transfers take an optional product; quotes carry feeRule, the rule that priced them (null where a contract prices it). - The handler passes the guard's gate to the service, so the partner is the caller's verified key id, never something the request claims. - createRebalancer sends product "rebalance" on its quotes and builds; estimate returns feeRule. - flatFeeFor and amountForBurn price through the default rule with the same results; checkFeeTable refuses a table with no default, a free rule, or a rebalance price without a key. - Stellar and Arc contract routes are untouched. * Fee table: the rebalance price only for market-maker keys the server names Any valid API key earned the capped rebalance price, so an integrator holding an ordinary key could label a user's transfer a rebalance and pay 2.01 on 1M instead of 100.01. - FeeRule.partner ("any" or one key) becomes partners: a list of key ids. ANY_PARTNER is gone; checkFeeTable refuses a rebalance rule that names no keys. - FEE_TABLE ships the default rule only. withRebalancePartners(keyIds) adds the capped rule for the keys a server names, so key ids never ship in the SDK. - The web server builds its table from XEBRA_REBALANCE_KEY_IDS (comma-separated key ids, server-only; unset = nobody gets the cap) and passes it to the service as deps.feeTable. - Tests: a valid key not on the list pays the default for a rebalance; an empty list names nobody; the env list is parsed. - Docs, changelog, schema text and openapi.json say the price is for keys set up for market-maker rebalances.
…switch (#304) Adds eight tests to XebraCctpWrapper (computeSplit and quote refusals, zero-address roles, unknown-domain tighten/remove, ceiling checks on proposals, pending getters, and the solvency post-check with a token that can seize). Branch coverage goes from 67.7% to 95.4%. forwarding-wrapper.md called tighten_domain(forward=false) a kill switch, but bridge still burns on the plain path with it off; the doc now points to remove_domain or pause. GOVERNANCE.md said a higher min_fee is stricter; tighten_params only accepts lower fees.
After a burn the form re-reads the wallet balance, which the burn just spent, while the quote or amount stays. The shortfall notice then showed under the "Burn submitted" receipt (0.00 held, 8.00 short). Hide it once a transfer has gone out, like the Circle health notices already do. Same fix in the Stellar and EVM forms.
…#306) * Stellar batch router: many transfers in one signature, all or nothing A Soroban contract that takes a list of transfers and calls the live v2 wrapper's bridge for each, under one auth. If any transfer fails, the whole batch reverts. No admin and no state beyond the wrapper address. Limit is 5 transfers per transaction: Soroban's 16,384-byte events budget, which the return value also counts toward. simulateTransaction does not enforce it (6 simulated fine and then failed on chain). Tests run against the mainnet v2 wrapper WASM in wasm/ and are added to CI. Proven on testnet, including one 5-chain batch (Arc, Base, Avalanche, Optimism, Solana) delivered on every chain. Not deployed to mainnet. No site or SDK support yet. * Batch router script: drop an unused import, format
Adds a default export condition to every subpath so CommonJS on Node 22.12+ can require() the package (found wiring createRebalancer into a CommonJS NEAR Intents solver), and oneClick.jwt, sent as Authorization: Bearer, which 1Click accepts on generate-intent and submit-intent as it does X-API-Key. Listed under Unreleased; no version bump here. The 0.4.1 release commit from 15 Nov was never pushed, and dev has gained other SDK changes since.
The burn hash lived only in the page's memory, so a refresh lost the transfer, and the only way back (above all to Sui, which ends at /claim) was digging the hash out of the wallet's history. The form now saves the transfer it is following (hash, destination, recipient, time bound, and whether Xebra's relayer finishes it) in this browser the moment the wallet returns the hash, and brings it back on load. It re-enters as "waiting for Stellar", so the same Horizon check decides where it stands. Cleared when Stellar refuses it, when Circle reports it delivered, or on Start over. A relayed Sui transfer comes back relayed, so the page keeps asking the relayer to finish it. If the browser will not save, the receipt says so and offers the hash to copy.
#309) A wallet can send the burn through its own RPC and still report a failure (the 11-15 pilot: Android UnknownHostException, then a retry that sent). After a wallet error the form now reads the sender's last burn on Sui (new /api/sui-stellar/last-burn, Sui GraphQL) and, if a new one landed, follows it and says the transfer went through instead of inviting a second send. Network errors get plain wording; when Sui cannot be read the message says to check the wallet's activity first. Also: a bare "closed" (connection closed) no longer counts as a decline, a decline is checked twice, and the relayer loop no longer restarts on "completing", which dropped the relayer's answer and posted the mint again.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings
mainlevel withdev@0d39a4b. Cut frommainand cherry-pickede2d07f8..dev(the tree is identical todev), the same way as #299 and #302.Live-site changes
GET /api/sui-stellar/last-burn. The relayer loop no longer posts a mint twice.Not visible to users
require()andoneClick.jwt, listed as Unreleased. No npm publish in this PR.remove_domainis the kill switch.Deploy notes
XEBRA_REBALANCE_KEY_IDS: unset means no key gets the capped rebalance price, so everyone is priced as a transfer.SUI_GRAPHQL_URL: unset uses Sui's public GraphQL.devis level withmainagain. Next release anchor:dev@0d39a4b.Use Rebase and merge or Squash; both keep the tree equal to
dev.🤖 Generated with Claude Code