Browser transaction lifecycle
- Resolve the active wallet through
lib/wallet-adapter.tsand obtain its source account. - Build the operation using the configured testnet passphrase and exact ScVal types.
- Prepare/simulate the transaction to derive authorization and Soroban resource requirements.
- Sign the prepared transaction using Freighter or the configured Privy bridge.
- Submit to Soroban RPC and poll the transaction hash for a terminal result.
- Refresh account, pool, and wallet state after confirmation.
Status and retry behavior
A simulation result or submission response is not final confirmation. The service layer handles sequence/footprint races with bounded rebuild/retry paths.resubmitOnTryAgainLater resubmits the same signed envelope when the RPC queue declines an attempt. Inspect failed transaction diagnostics before retrying a business-rule rejection.
Transaction progress is shared through lib/tx-progress.tsx and stores. Some operations pad simulated resource budgets to account for changes between simulation and execution. A timeout or missing history row does not prove the transaction failed; reconcile its hash and on-chain balances.
Multi-step strategies
Lite Mode tries an atomic deposit/borrow/Blend-supply path for eligible same-asset Blend strategies. It can fall back to separate transactions. Other strategies can deposit, borrow one or two assets, swap, and add liquidity in separate submissions. Confirmed earlier steps remain if a later step fails.closePosition withdraws/removes liquidity and repays available debt legs; it is not the AccountManager close_account lifecycle function.
Copilot writes add their own plan approval, wallet binding, execution policy, and receipt flow. Do not assume every Copilot write uses the same browser signing path or that plan approval means on-chain success.
Source reference
mercury-stellar-backend/lib/stellar-utils.tsmercury-stellar-backend/lib/wallet-adapter.tsmercury-stellar-backend/lib/one-click-strategy.tsmercury-stellar-backend/lib/copilot/handle.ts

