Aptos TS-SDK: View and Query Data for Openclaw

A specialized module within Openclaw Skills for AI agents to retrieve on-chain data, query Move view functions, and check account balances using the Aptos TypeScript SDK.

iskysun96
v1.0.0
Mar 19, 2026
0
734
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install ts-sdk-view-and-query

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install ts-sdk-view-and-query using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Aptos TS-SDK: View and Query Data?

This skill provides a comprehensive technical framework for performing read-only queries on the Aptos blockchain using the @aptos-labs/ts-sdk. By utilizing this implementation of Openclaw Skills, developers and AI agents can access account information, monitor APT balances, and retrieve specific Move resources with high efficiency. The skill prioritizes modern SDK methods, replacing deprecated functions with high-performance alternatives that ensure data integrity. It acts as a bridge between high-level application logic and the Aptos on-chain state, making Openclaw Skills essential for building responsive and data-aware blockchain applications.

Aptos TS-SDK: View and Query Data Use Cases

  • Retrieving real-time APT balances for user accounts using the optimized getBalance method.
  • Executing Move view functions to read smart contract states without incurring gas costs.
  • Auditing account resources and modules to verify deployed code or stored data structures.
  • Implementing paginated data fetching for accounts with a large number of resources or modules.
  • Mapping complex Move return types to TypeScript native types for use in frontend interfaces.

How Aptos TS-SDK: View and Query Data Works

  1. The AI agent identifies the required on-chain data point, such as a balance or a specific Move resource.
  2. The skill prepares a query payload, including the account address and, if necessary, the Move function signature and type arguments.
  3. The request is sent to the Aptos blockchain through the TS-SDK client provider.
  4. The raw blockchain response is captured and parsed according to the expected Move data types.
  5. The skill applies necessary type casting, such as converting stringified large numbers into bigint to maintain precision.
  6. The final structured data is returned to the calling agent or application for display or logic processing.

Aptos TS-SDK: View and Query Data Setup

To integrate this capability into your project using Openclaw Skills, ensure you have the Aptos TypeScript SDK installed in your environment. Use the following command:

npm install @aptos-labs/ts-sdk

After installation, initialize the Aptos client and ensure your network configuration matches the target chain (Mainnet, Testnet, or Devnet) to begin querying data.

Aptos TS-SDK: View and Query Data Data Schema & Taxonomy

The skill organizes blockchain data into the following schema for clarity and type safety:

Data Category TypeScript Type Description
APT Balance bigint Account balance represented in octas
Account Info AccountInfo Includes sequence number and authentication key
Move Resource MoveResource Data object containing the fields of a Move struct
View Results Array An array of values returned by a Move view function
Modules MoveModuleBytecode ABI and bytecode information for deployed contracts

All queries accept AccountAddressInput, which supports both hex string and AccountAddress object formats.

Aptos TS-SDK: View and Query Data Advanced Features

  • Support for bigint precision handling to accurately manage u128 and u256 values from Move contracts.
  • Cursor-based pagination for getAccountResourcesPage and getAccountModulesPage to handle large-scale data sets.
  • Generic type argument support for view functions, enabling queries on polymorphic smart contracts.
  • Specialized resource lookup via getAccountResource for targeted data retrieval from specific accounts.
  • Full compatibility with the broader ecosystem of Openclaw Skills for automated on-chain monitoring and reporting.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*