You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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-sdkPR: #12349
Stacked on top: #12494 (Panora swapper, same chain swaps)
Scope
m/44'/637'/0'/0'/0'), portfolio, send flow, tx history parsingVITE_FEATURE_APTOS, off in productionArchitecture
AptosChainAdapterinpackages/chain-adapters/src/aptos/, built on@aptos-labs/ts-sdkSimpleTransactions.AptosSignTxcarries bothsigningMessageBytes(sha3-256 prefix + BCS raw transaction, for off device signers) andrawTransactionBytes(for on device signers and broadcast reconstruction)gas_used, capped by affordability (Aptos CLI convention).max_gas_amountfrom simulation is an affordability ceiling, not a recommendationslip44:637; other assets are Move coins (coin:namespace, the CoinStore type is the asset reference)AccountAddressfrom 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.coinTypeis currently always passed as a Move type argumentsrc/lib/utils/aptos.ts:5: importTxStatusfrom the unchained-client package entrypoint instead ofpackages/unchained-client/src/typessrc/hooks/useActionCenterSubscribers/useSendActionSubscriber.tsx:220: failed Aptos transactions are marked confirmed, branch on the failed statusValidation (definition of done)
VITE_FEATURE_APTOS=trueon a local build: Aptos appears in the network filter, APT account derives, send and receive APT work on a dev walletpnpm run generate:asset-datalocally to test before that)Follow ups