Aptos TypeScript SDK: AccountAddress for Openclaw

A comprehensive guide and toolset for managing, parsing, and deriving Aptos account addresses in compliance with AIP-40 using the TypeScript SDK.

iskysun96
v1.0.0
Mar 19, 2026
0
766
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install ts-sdk-address

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-address 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 TypeScript SDK: AccountAddress?

This Openclaw Skills module provides developers with the technical logic and best practices for handling account addresses within the Aptos ecosystem. It focuses on the @aptos-labs/ts-sdk implementation, ensuring that addresses—which are 32-byte values—are correctly formatted, parsed, and validated according to the AIP-40 standard.

The skill bridges the gap between raw hex strings and the structured AccountAddress class, offering specialized methods for flexible input parsing, strict validation, and deterministic address derivation for objects, resources, and tokens. By integrating these Openclaw Skills, developers avoid common pitfalls like improper string comparisons or manual hashing for derived addresses.

Aptos TypeScript SDK: AccountAddress Use Cases

  • Parsing user-provided hex strings into validated AccountAddress objects.
  • Generating deterministic addresses for Aptos objects, resource accounts, and NFTs (tokens).
  • Converting addresses between LONG (64 hex chars) and SHORT formats for UI display or on-chain interactions.
  • Implementing strict AIP-40 compliance for high-security or standardized financial applications.
  • Validating address inputs in frontend forms using relaxed or strict rules.

How Aptos TypeScript SDK: AccountAddress Works

  1. The skill identifies the input type (string, Uint8Array, or AccountAddress) and selects the appropriate parsing method like AccountAddress.from().
  2. It applies AIP-40 formatting rules to determine if the address is a special address (0x0-0xf) or a standard 32-byte address.
  3. For derived addresses, it utilizes SDK-native hashing utilities to generate deterministic addresses based on creator seeds and metadata.
  4. It provides comparison logic via the .equals() method to ensure logical equality regardless of string casing or leading zeros.
  5. Finally, it outputs the address in the required format (Long, Short, or No-Prefix) for use in transactions or data storage.

Aptos TypeScript SDK: AccountAddress Setup

To use this Openclaw Skills resource, ensure you have the Aptos TypeScript SDK installed in your project:

npm install @aptos-labs/ts-sdk

Then, import the necessary classes and functions:

import { AccountAddress, createObjectAddress } from "@aptos-labs/ts-sdk";

Aptos TypeScript SDK: AccountAddress Data Schema & Taxonomy

The skill manages address data through the AccountAddress class and several utility functions. Below is the taxonomy of output formats available through these Openclaw Skills:

Method Output Format Description
toString() AIP-40 Default SHORT for special addresses, LONG for others
toStringLong() 0x + 64 hex Full length with prefix
toStringShort() Shortest Hex Minimal characters, no leading zeros
toUint8Array() 32-byte Array Raw byte representation for BCS serialization

Aptos TypeScript SDK: AccountAddress Advanced Features

  • Multi-mode validation: Support for both relaxed and strict AIP-40 validation checks.
  • Deterministic Derivation: Built-in support for createResourceAddress, createTokenAddress, and createUserDerivedObjectAddress.
  • Constant Access: Fast access to system addresses via AccountAddress.ZERO through AccountAddress.A.
  • Type Safety: Full TypeScript support using AccountAddressInput for flexible function arguments.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*