@tetherto/wdk-wallet-aptos

Note: This package is currently in beta. Please test thoroughly in development environments before using in production.
A simple and secure package to manage SLIP-0010 HD wallets for the Aptos blockchain. This package provides a clean API for creating, managing, and interacting with Aptos wallets using BIP-39 seed phrases and ed25519 (SLIP-0010) key derivation.
About WDK
This module is part of the WDK (Wallet Development Kit) project, which empowers developers to build secure, non-custodial wallets with unified blockchain access, stateless architecture, and complete user control.
For detailed documentation about the complete WDK ecosystem, visit docs.wdk.tether.io.
⬇️ Installation
You can install it using npm:
🚀 Quick Start
Importing from @tetherto/wdk-wallet-aptos
Create a Wallet Manager (seed-based)
Managing Multiple Accounts (seed-based manager)
Checking Balances
Owned Account
For accounts where you have the seed phrase and full access:
Read-Only Account
For addresses where you don't have the seed phrase:
Sending Transactions
Send native APT and estimate fees using WalletAccountAptos. The module simulates each transaction to size gas before signing.
Token Transfers
Transfer fungible assets and estimate fees using WalletAccountAptos. Uses 0x1::primary_fungible_store::transfer, which auto-creates the recipient's primary store.
Message Signing and Verification
Sign messages using WalletAccountAptos and verify signatures using WalletAccountReadOnlyAptos.
Fee Management
Retrieve current fee rates using WalletManagerAptos.
Memory Management
Clear sensitive data from memory using dispose methods in WalletAccountAptos and WalletManagerAptos.
Key Capabilities
- BIP-39 Seed Phrase Support: Generate and validate mnemonic seed phrases
- SLIP-0010 Derivation Paths: ed25519 HD derivation on the Aptos path (
m/44'/637'/…, all segments hardened)
- Multi-Account Management: Derive multiple accounts from a single seed phrase
- Fungible Asset (FA) Support: Query balances and transfer fungible assets, including native USDT
- Native APT Transfers: Send APT with automatic simulation-based gas sizing
- Message Signing: Sign and verify ed25519 messages
- Fee Estimation: Network fee rates with normal/fast tiers
- Secure Memory Disposal: Clear private keys from memory when done
- Bare-Runtime Compatible: Talks to the fullnode REST API over
fetch, with no Aptos SDK in the runtime path — runs on both Node.js and the Bare runtime
Aptos specifics
- Derivation:
m/44'/637'/account'/0'/0' (SLIP-0010 ed25519, all segments hardened). getAccount(index) maps to account = index.
- Address: 32-byte, derived as
sha3_256(publicKey ‖ 0x00), rendered as a 0x-prefixed 64-hex string. Short forms (e.g. 0xa) are accepted as inputs and normalized.
- Token model: tokens use the Fungible Asset (FA) standard.
getTokenBalance(tokenAddress) and transfer({ token, ... }) take the FA metadata address (e.g. the USDT metadata address above), not a coin type tag.
- Balances: read through the unified
/accounts/{addr}/balance/{asset} endpoint, which aggregates legacy Coin and migrated FA balances and returns 0 for accounts that do not exist yet.
- Offline signing:
signTransaction covers native APT transfers only. Token (fungible asset) transfers go through transfer, which simulates, signs, and submits in one call.
- Decimals: APT = 8, USDT = 6.
Compatibility
- Aptos Mainnet (chain id
1) and Testnet (chain id 2)
- Runtimes: Node.js and the Bare runtime
Community
Join the WDK Discord to connect with other developers.
Support
For support, please open an issue on GitHub or reach out via email.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.