Skip to content

Aptos chain integration #12493

Description

@linear

Aptos chain integration, PR 1 (chain support + NEAR Intents routes)

Native Aptos support in web: accounts, balances, send, transaction history, and cross chain swaps via NEAR Intents.

Docs: https://aptos.dev
SDK: @aptos-labs/ts-sdk
PR: #12349
Stacked on top: #12494 (Panora swapper, same chain swaps)


Scope

  • Chain adapter, CAIP support, account derivation (m/44'/637'/0'/0'/0'), portfolio, send flow, tx history parsing
  • Cross chain swaps in and out of Aptos via NEAR Intents
  • Behind VITE_FEATURE_APTOS, off in production
  • Out of scope: same chain swaps (Panora swapper #12494), Ledger support (follow up below), DAO treasury address (BIZ-35)

Architecture

  • AptosChainAdapter in packages/chain-adapters/src/aptos/, built on @aptos-labs/ts-sdk
  • Transactions are BCS serialized SimpleTransactions. AptosSignTx carries both signingMessageBytes (sha3-256 prefix + BCS raw transaction, for off device signers) and rawTransactionBytes (for on device signers and broadcast reconstruction)
  • Gas estimation: simulate, then 1.5x safety factor on gas_used, capped by affordability (Aptos CLI convention). max_gas_amount from simulation is an affordability ceiling, not a recommendation
  • Native APT is slip44:637; other assets are Move coins (coin: namespace, the CoinStore type is the asset reference)
  • Address validation and comparison go through AccountAddress from the SDK (short and long forms of the same address must compare equal)

Remaining work (review findings)

  • AptosChainAdapter.buildSendApiTransaction: add a branch for fungible asset (FA) only assets, chainSpecific.coinType is currently always passed as a Move type argument
  • src/lib/utils/aptos.ts:5: import TxStatus from the unchained-client package entrypoint instead of packages/unchained-client/src/types
  • src/hooks/useActionCenterSubscribers/useSendActionSubscriber.tsx:220: failed Aptos transactions are marked confirmed, branch on the failed status

Validation (definition of done)

  • CI workflows approved and green (fork PR, needs maintainer approval to run)
  • Review findings above addressed, or explicitly deferred with a PR comment
  • Engineering review approved, merged to develop
  • With VITE_FEATURE_APTOS=true on a local build: Aptos appears in the network filter, APT account derives, send and receive APT work on a dev wallet
  • NEAR Intents returns routes in and out of Aptos (e.g. USDC on Ethereum to APT)
  • Aptos assets appear in the app after the next scheduled asset data regeneration (pnpm run generate:asset-data locally to test before that)

Follow ups

  • Ledger hardware wallet support: working implementation exists on a side branch, dropped from this PR during review, rebase once this lands
  • Affiliate fees on Aptos swaps: blocked on a DAO Aptos treasury address (BIZ-35)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions