Skip to content

feat: add Aptos chain support with NEAR Intents routing #12348

Open

Description

@swdiscordia

tl;dr

Add Aptos blockchain as a supported chain in ShapeShift Web, with NEAR Intents routing for cross-chain swaps into/out of APT and Aptos-native assets. Aptos is non-EVM (Move VM, BCS-signed transactions, Ed25519 + SHA3-256), so it follows the non-EVM chain integration pattern established by Solana, Sui, Near, Ton.

User-facing capabilities

  • Connect a Native wallet that derives Aptos accounts at BIP44 m/44'/637'/0'/0'/0'
  • View APT balance + Aptos-native asset balances in the portfolio
  • Receive APT and any Aptos token (via address derivation + QR)
  • Send APT and Aptos tokens (BCS-signed 0x1::aptos_account::transfer_coins)
  • Swap into/out of APT and Aptos-native assets via NEAR Intents — cross-chain solver model (no APT needed on destination for incoming swaps; solver pays Aptos gas)

Scope (in this initial PR)

  • HDWallet (Native): hdwallet-core Aptos interfaces + SLIP-44 637, hdwallet-native Ed25519 + SHA3-256 AptosAdapter (with mixins + native.ts init/wipe/describePath wiring)
  • CAIP / chain adapter: full AptosChainAdapter (account discovery, balances, BCS signing, broadcast, fee estimation, 19 unit tests)
  • App wire-up: Aptos plugin, feature flag VITE_FEATURE_APTOS, CSP headers, portfolio account derivation, send modal, trade execution dispatch, RFOX bridge integration, state migrations bump v334
  • Asset data: ~80 Aptos tokens via the Panora token list, CoinGecko market data adapter, treasury / base assets
  • NEAR Intents Aptos route: solver routing wired into NearIntentsSwapper for USDC / ETH / etc. ↔ APT and Aptos-native assets
  • qabot fixture: e2e/fixtures/aptos-chain-integration.yaml for future automated regression
  • Bug fix: Aptos fee estimation now uses sim.gas_used * 1.5 (Aptos CLI safety factor) instead of sim.max_gas_amount, which the node returns as the sender's affordability ceiling — fixes a 100-300× fee inflation on the trade preview

Not in scope (separate follow-up PRs)

  • PanoraSwapper (Aptos-native DEX aggregator) — deferred to a stacked PR to keep this one reviewable
  • External blockers (yield.xyz Aptos support, watchlists, etc.)

Risk

HIGH-RISK — introduces:

  • A brand-new on-chain transaction type (BCS-signed Aptos SimpleTransaction.submit.simple)
  • A new HDWallet implementation (Ed25519 + SHA3-256, SLIP-44 637) across hdwallet-core + hdwallet-native
  • A new ChainAdapter (no code reuse from existing adapters)
  • A new trade execution path + Send modal path
  • NEAR Intents Aptos routing (extension of existing swapper — type ripple to AptosSwapperDeps requires updates in unrelated swapper test mocks, e.g. ButterSwap)
  • State migrations bump (v334)

Risk is contained by feature flag: VITE_FEATURE_APTOS=false in .env.production. Operations testing follows the flag flip.

References

Activity

  1. Hobie1Kenobi commented on May 24, 2026

    @Hobie1Kenobi

    Okay, here's a draft GitHub comment based on your provided information:

    Hi team,
    
    This PR introduces Aptos chain support with NEAR Intents routing, addressing a significant expansion of our supported chains.  It’s a high-risk feature due to the introduction of new transaction types, HDWallet implementations, and a new trade execution path.  We've mitigated risk with a feature flag.
    
    **Deliverables:** Functional Aptos chain integration, NEAR Intents routing for APT and Aptos assets, updated asset data, and bug fixes related to fee estimation.
    
    **ETA:**  Approximately 3 days for review and potential minor adjustments.
    
    **Payout Address (Base):** `0x408f39B19266022FeC03076091e59D1f4f163658`
    
    I'm happy to answer any questions and provide further clarification as needed.  Let me know if you’d like a walkthrough of the key changes.

    Would you like me to refine this comment in any way (e.g., adjust the tone, add specific details)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions