Token导航 LogoToken导航TokenDH.com
开发需要联网clawhub未标认证来源可访问clear审计通过

ts-sdk-typesTS SDK 类型

Agent Skill

ts-sdk-types 用于补充开发相关能力,适合在 OpenClaw 中需要让 Agent 承接开发相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,206

周安装

177

GitHub Stars

公开资料未说明

下载量

1,473
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ts-sdk-types(TS SDK 类型)
来源仓库:https://github.com/iskysun96/ts-sdk-types
安装命令:
openclaw skills install ts-sdk-types
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install ts-sdk-types

简介

ts-sdk-types 映射 @aptos-labs/ts-sdk 中的核心数据类型到 TypeScript 类型系统。

  • 适用于 OpenClaw 中处理 u64/u128/u256、TypeTag 等复杂类型转换的开发场景。
  • 明确 bigint、字符串、functionArguments 等类型的对应关系和使用时机。
  • 安装命令为 openclaw skills install ts-sdk-types,需注意类型兼容性对现有代码的影响。
  • 建议在升级前测试类型匹配情况以避免运行时错误。

SKILL.md

name
ts-sdk-types
description
license
MIT
metadata
author
aptos-labs
version
1.0
category
sdk
tags
["typescript", "sdk", "types", "typetag", "bigint", "move"]
priority
high

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

  1. Use bigint for u128 and u256 – in both view results and functionArguments; JavaScript number loses

precision above 2^53.

  1. Use string for address in payloads – e.g. "0x1" or accountAddress.toString(); SDK accepts

AccountAddressInput (string or AccountAddress).

  1. Use typeArguments for generic Move functions – e.g. coin type ["0x1::aptos_coin::AptosCoin"] for

coin::balance or coin::transfer.

  1. Cast view results explicitly when you know the Move return type – e.g. BigInt(result[0] as string) for u128.

NEVER

  1. Do not use number for u128/u256 – precision loss; use bigint.
  2. Do not pass raw number for large u64 in entry/view – use bigint if value can exceed Number.MAX_SAFE_INTEGER.
  3. Do not omit typeArguments when the Move function has type parameters (e.g. balance<CoinType>).

Move → TypeScript (summary)

Move typeTypeScript typeExample
u8, u16, u32number255, 65535
u64number \bigintPrefer bigint for large values
u128, u256bigintBigInt("340282366920938463463374607431768211455")
i8..i64 (Move 2.3+)number \bigintUse bigint for i64 when large
i128, i256bigintBigInt("-...")
boolbooleantrue
addressstring"0x1"
signerNot passed from TS; signer is the transaction sender
vector<u8>Uint8Array \string (hex)new Uint8Array([1,2,3]) or hex
vector<T>T[][1, 2, 3]
Stringstring"hello"
Object<T>string (object address)objectAddress.toString()
Option<T>T \nullValue or null

functionArguments

Order and types must match the Move entry/view function parameters:

// Move: public fun transfer<CoinType>(to: address, amount: u64)
await aptos.transaction.build.simple({
  sender: account.accountAddress,
  data: {
    function: "0x1::coin::transfer",
    typeArguments: ["0x1::aptos_coin::AptosCoin"],
    functionArguments: [
      "0xrecipient...", // address as string
      1000n // u64 as bigint (or number if small)
    ]
  }
});

typeArguments

For generic Move functions, pass full type strings (address::module::StructName):

// Move: balance<CoinType>(addr): u64
typeArguments: ["0x1::aptos_coin::AptosCoin"];

// Move: transfer<CoinType>(to, amount)
typeArguments: ["0x1::aptos_coin::AptosCoin"];

View return types

const result = await aptos.view({
  payload: {
    function: "0x1::coin::balance",
    typeArguments: ["0x1::aptos_coin::AptosCoin"],
    functionArguments: [accountAddress]
  }
});
// result is an array; u128 often returned as string in JSON
const balance = BigInt(result[0] as string);

TypeTag (advanced)

When building payloads programmatically or parsing type strings:

import { TypeTag } from "@aptos-labs/ts-sdk";

// Parser for type tag strings
import { parseTypeTag } from "@aptos-labs/ts-sdk";
const tag = parseTypeTag("0x1::aptos_coin::AptosCoin");

Use typeArguments as string array in simple cases; use TypeTag when the SDK API expects it.


Object / resource address in arguments

Pass object address as string (LONG or SHORT per AIP-40):

functionArguments: [
  nftObjectAddress.toString(), // or "0x..."
  price
];

Common mistakes

MistakeCorrect approach
Passing number for u128 amountUse 1000000n or BigInt("...")
Omitting typeArguments for coin::balanceAdd typeArguments: ["0x1::aptos_coin::AptosCoin"]
Using result[0] as number for u128Use BigInt(result[0] as string)
Wrong order of functionArgumentsMatch Move parameter order exactly

References

ts-sdk-transactions, use-ts-sdk

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

88.46%
按下载量换算1,303

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills