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 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