Skip to content

feat: migrate from XRPL to EVM (no backward compatibility)#4

Open
aston-ai wants to merge 1 commit intomainfrom
evm
Open

feat: migrate from XRPL to EVM (no backward compatibility)#4
aston-ai wants to merge 1 commit intomainfrom
evm

Conversation

@aston-ai
Copy link
Collaborator

@aston-ai aston-ai commented Mar 6, 2026

Summary

  • migrate backend and frontend blockchain integration from XRPL to EVM
  • remove XRPL/XRLP-specific logic, services, and transaction handling
  • add EVM client flow and update configs/docs for EVM-only operation
  • update API and web app wiring to align with EVM architecture

Breaking changes

  • all XRPL support is removed
  • no backward compatibility layer is included

Validation

  • apps/api: bun run build
  • apps/web: bun run build

Replace all XRPL/XRP logic, dependencies, and adapters with EVM equivalents.
No backward compatibility layer — clean break.

### API changes
- Replace `xrpl` package with `viem` for EVM signing and tx submission
- New `apps/api/src/evm/client.ts` for operator-signed ETH transfers
- Remove `apps/api/src/xrpl/` directory (client, tx-builder, memo, ledger-sync)
- Remove `apps/api/src/db/models/escrows.ts` (escrow model)
- Rename all `*_drops` fields to `*_wei` in DB models and routes
- Rename `ledger_events` → `chain_events`, `ledger_index` → `block_number`
- Market auto-opens immediately on creation (no escrow tx required)
- Auto-payouts via `signAndSubmitWithOperator` using operator private key
- Update config: `EVM_RPC_URL`, `EVM_CHAIN_ID`, `EVM_OPERATOR_ADDRESS/PRIVATE_KEY`
- Update default user provider: `"gemwallet"` → `"metamask"`

### Routes
- `bets.ts`: amountWei, effectiveAmountWei, plain EVM unsignedTx (no trustSet)
- `offers.ts`: ethAmountWei, blockNumber, volumeWei
- `resolve.ts`: removed duplicate /resolve endpoint (now in markets.ts), amountWei
- `markets.ts`: /resolve handles auto-payouts via viem

### Frontend changes
- Replace GemWallet (`@gemwallet/api`) with MetaMask (EIP-1193 `window.ethereum`)
- `WalletContext.tsx`: eth_requestAccounts, eth_sendTransaction, eth_chainId
- `api.ts`: all types updated (totalPoolWei, amountWei, blockNumber, etc.)
- Remove XRP helpers (formatXrp, xrpToDrops); add ETH helpers (formatEth, ethToWei)
- Admin page: simplified 1-step market creation (no escrow signing flow)
- Bet panel: ETH quick amounts [0.001, 0.01, 0.1, 1], single tx signing step
- All components updated: formatEth, metaMaskInstalled, ETH labels
- Footer updated: "EVM Parimutuel Prediction Market"

### Docs
- README.md, DEMO.md, docs/ADR.md, docs/runbook.md: XRPL → EVM throughout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aston-ai aston-ai requested a review from hitsuji-haneta March 6, 2026 04:02
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.

2 participants