feat: add Tron support (TRX + USDT on Tron)#117
Conversation
Chainflip added trx.tron (native TRX) and usdt.tron (USDT on Tron). Wire both as swappable assets: - caip: tronChainId, trxAssetId, usdtOnTronAssetId constants - assets: TRX + USDT-Tron entries (precision 6, tronscan explorer) - chainflip: map assetIds to trx.tron / usdt.tron - validation: Tron address validation via multicoin-address-validator - marketData: coingecko ids tron / tether Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@CumpsD is attempting to deploy a commit to the ShapeShift Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughTron network support is added across five files: new CAIP constants for the Tron chain and assets, TRX and USDT TRC-20 entries in the static asset list, Tron address validation logic, and mappings from the new asset IDs to Chainflip and CoinGecko identifiers. ChangesTron Asset Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- caip.ts: group constants by chain (chainId, native asset, then tokens) for easy extension; remove unused CHAIN_NAMESPACE/CHAIN_REFERENCE/ASSET_NAMESPACE/ ASSET_REFERENCE maps and FEE_ASSET_IDS (none referenced in the repo) - add Tron coverage to the Chainflip asset-mapping test (trx.tron, usdt.tron) - add address-validation tests covering EVM/Solana/BTC/Tron incl. cross-chain rejection; export isValidAddressSync for testability - vitest: drop isolate:false/singleThread pooling which shared one module registry and made the marketData axios mock order-dependent (tests failed when run together); default isolated pool makes the suite deterministic Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
Chainflip recently added native TRX (
trx.tron) and USDT on Tron (usdt.tron). This wires both as swappable assets.This app is a swap-only frontend over Chainflip — the user pastes a destination address; no key derivation/signing for the receiving chain. So adding Tron only requires declaring the assets, mapping to Chainflip IDs, validating pasted addresses, and wiring market data.
Changes
constants/caip.ts—tronChainId,trxAssetId,usdtOnTronAssetIdconstants (+ namespace/reference map entries,trxAssetIdinFEE_ASSET_IDS)constants/assets.ts— TRX + USDT-on-Tron entries ininitialAssets(precision 6, tronscan explorer, Trust Wallet icons; USDT-Tron links to canonical USDT viarelatedAssetKeyfor the network badge)queries/chainflip/assets.ts— map asset IDs totrx.tron/usdt.tronlib/validation.ts— Tron address validation viamulticoin-address-validator(TRX)queries/marketData/index.ts— coingecko idstron/tetherAsset modal, quote, and swap flows are chain-agnostic and pick up the new assets automatically.
CAIP identifiers
tron:0x2b6653dc/slip44:195tron:0x2b6653dc/trc20:TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6tTesting
yarn type-check,yarn lint,yarn test(9/9) all passSummary by CodeRabbit
Release Notes