Swap and PayFi Test BenchLive quotes, on-chain replay, payment-link checks

Built by Edward Tay as a work sample for a Bitget Wallet application. Independent: not affiliated with or operated by Bitget. Uses public, keyless APIs (Bitget Wallet's public quote endpoint, KyberSwap, Velora, LI.FI, DefiLlama, public RPCs); only quotes are read from Bitget Wallet, no order is created. Nothing is signed or sent; every swap is replayed with eth_call from an empty test address.

One run checks what the user is shown against what the chain would do.

Bitget Wallet cases read the wallet's own public quote endpoint and check its fee tiers, min received, route ranking and spenders against an independent aggregator at the same moment. Each swap case pulls a live route, builds the transaction, then replays that calldata on the current block with a balance override. Each payment case parses a real payment link and renders the amount from on-chain decimals. A source that cannot be read counts as an error, never a pass.

0cases
0pass
0warn
0fail
0error
0skip
0srun time

Each run records its ID, the bench version and every chain's head block at start, and these go into the JUnit and JSON exports.

CaseAreaPriorityStatusEvidence

A case that fails or errors is run a second time. If it fails again it stays red; if the second attempt is clean it is marked flaky and counted as a warning, with both attempts kept in the evidence.

Run the swap checks on any pair.

Pick a chain, a pair and a size. The bench quotes, builds, checks the router and recipient, and replays the transaction. Native-coin inputs are simulated end to end; ERC-20 inputs stop after the build checks.

Paste what a merchant QR code contains.

EIP-681 (ethereum:) and Solana Pay (solana:) links are parsed to spec. Checksums, chain, recipient and amount format are validated, and ERC-20 amounts are rendered from the token's own decimals() on chain.

The test plan behind the suite.

Risk-ranked cases for a wallet's Swap and PayFi flows. Automated rows run in the Suite tab; manual rows need a device and a small real balance on mainnet. Areas follow the seams in the public partner docs: order mode, gas abstraction, cross-chain settlement, QR pay and the card.

The same suite runs headless.

The browser bench and the CI runner import one core module, so a case written once runs in both. Node 18 or later, no install step. Exit code 1 on any fail or error, so a pipeline can block a release.