ts-sdk-client
TypeScript SDK: Aptos Client
Purpose
Guide creation and configuration of the Aptos client and AptosConfig in @aptos-labs/ts-sdk. One client
instance is used for all read/write and account/transaction APIs.
ALWAYS
- Create one Aptos instance per app (singleton) and reuse it – avoid multiple
new Aptos(config)for the same network. - Configure network via
AptosConfig– useNetwork.TESTNETorNetwork.MAINNET(or custom endpoints). - Use environment variables for network/URLs in production – e.g.
process.env.APTOS_NETWORKorimport.meta.env.VITE_APP_NETWORK. - Use
Network.TESTNETas default for development – devnet resets frequently.
NEVER
- Do not create a new Aptos client per request – reuse the singleton.
More from iskysun96/aptos-agent-skills
generate-tests
Creates comprehensive test suites for Move contracts with 100% coverage requirement. Triggers on: 'generate tests',
38write-contracts
Generates secure Aptos Move V2 smart contracts with Object model, Digital Asset integration, security patterns, and
35security-audit
Audits Move contracts for security vulnerabilities before deployment using 7-category checklist. Triggers on: 'audit
32deploy-contracts
Safely deploys Move contracts to Aptos networks (devnet, testnet, mainnet) with pre-deployment verification. Triggers
32search-aptos-examples
Searches aptos-core and daily-move for reference implementations before writing contracts. Triggers on: 'search
31analyze-gas-optimization
Analyze and optimize Aptos Move contracts for gas efficiency, identifying expensive operations and suggesting
31