ts-sdk-types

Map Aptos Move numeric types to TypeScript bigint for the ts-sdk.

19|8|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/aptos-labs/aptos-agent-skills --skill ts-sdk-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ts-sdk-types
Source: https://github.com/aptos-labs/aptos-agent-skills/tree/main/skills/sdk/typescript/ts-sdk-types
Command: npx skills add https://github.com/aptos-labs/aptos-agent-skills --skill ts-sdk-types

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the complex process of mapping Aptos Move data types to their corresponding TypeScript representations, ensuring accurate data handling in your dApp.

Core Features & Use Cases

  • Type Mapping: Provides clear guidelines for converting Move types (like u128, address, TypeTag) to their TypeScript equivalents (bigint, string, TypeTag objects).
  • Argument Handling: Guides on correctly formatting functionArguments and typeArguments for Aptos SDK calls.
  • Use Case: When interacting with a Move contract that returns a u128 balance, this Skill helps you correctly parse it as a bigint in TypeScript to avoid precision errors.

Quick Start

Use the ts-sdk-types skill to understand how to map a Move u128 to a TypeScript bigint.

Frequently Asked Questions about ts-sdk-types

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I map Move u128 and u256 types to TypeScript when using the Aptos SDK?

To map Move numeric types like u128 and u256 to TypeScript, you should convert them to `bigint` to avoid precision errors. This ensures correct data representation when handling large balances returned from Move contracts.

What TypeScript type should I use for Move addresses in Aptos SDK interactions?

Move addresses should be mapped to TypeScript `string` types for your Aptos SDK interactions. This conversion ensures correct data representation and prevents type mismatch errors in view and transaction payloads.

How do I format functionArguments and typeArguments for generic Move functions in TypeScript?

Formatting functionArguments and typeArguments for generic Move functions requires mapping them to correct TypeScript objects like TypeTag. This ensures the transaction payload accurately represents the expected Move data structures.

Why does my Move u64 balance lose precision in my TypeScript dApp?

Your Move u64 balance loses precision because it is not mapped to a TypeScript `bigint`. Converting numeric types like u64, u128, and u256 to `bigint` avoids these precision errors during SDK interactions.

Can I use this Aptos SDK type mapping for both view and transaction payloads?

Yes, you can use this type mapping for both view and transaction payloads. It handles the conversion of numeric types to `bigint`, addresses to `string`, and TypeTag objects to ensure correct data representation across all SDK interactions.

What is the best way to handle TypeTag conversion between Move and TypeScript?

The best way to handle TypeTag conversion is to map Move types directly to TypeScript TypeTag objects. This approach guarantees accurate data handling and correct argument formatting for generic Move functions.