ts-sdk-types
TypeScript SDK: Types (Move ↔ TypeScript)
Purpose
Guide type mapping between Move and TypeScript when using @aptos-labs/ts-sdk: numeric types (especially
u128/u256), address, TypeTag, and functionArguments / typeArguments.
ALWAYS
- Use
bigintfor u128 and u256 – in both view results andfunctionArguments; JavaScriptnumberloses precision above 2^53. - Use
stringfor address in payloads – e.g."0x1"oraccountAddress.toString(); SDK acceptsAccountAddressInput(string or AccountAddress). - Use
typeArgumentsfor generic Move functions – e.g. coin type["0x1::aptos_coin::AptosCoin"]forcoin::balanceorcoin::transfer. - Cast view results explicitly when you know the Move return type – e.g.
BigInt(result[0] as string)for u128.
NEVER
More from aptos-labs/aptos-agent-skills
use-ts-sdk
Orchestrates TypeScript SDK integration for Aptos dApps. Routes to granular skills for specific tasks (client setup,
33ts-sdk-client
How to create and configure the Aptos client (Aptos, AptosConfig) in @aptos-labs/ts-sdk. Covers Network,
33ts-sdk-account
How to create and use Account (signer) in @aptos-labs/ts-sdk. Covers Account.generate(), fromPrivateKey(),
33security-audit
Audits Move contracts for security vulnerabilities before deployment using 7-category checklist. Triggers on: 'audit
33ts-sdk-wallet-adapter
How to integrate wallet connection in React frontends using @aptos-labs/wallet-adapter-react. Covers
33ts-sdk-transactions
How to build, sign, submit, and simulate transactions in @aptos-labs/ts-sdk. Covers build.simple(),
32