ts-sdk-types
Installation
SKILL.md
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.