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

ts-sdk-transactionsTS SDK transactions 命令行

Agent Skill

ts-sdk-transactions 用于辅助前端页面、组件、样式和交互逻辑开发,适合在 OpenClaw 中需要维护前端项目、生成组件或检查界面实现时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,557

周安装

188

GitHub Stars

公开资料未说明

下载量

1,489
OpenClaw

安装说明

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

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

ClawHubOpenClaw
openclaw skills install ts-sdk-transactions

简介

ts-sdk-transactions 提供交易构建、签名、提交与模拟的完整流程指导。

  • 适合在 OpenClaw 中开发链上交互功能或调试智能合约调用时使用。
  • 支持 build.simple()、signAndSubmitTransaction() 等关键方法的详细说明。
  • 安装命令为 openclaw skills install ts-sdk-transactions,需关注私钥处理和交易广播权限。
  • 建议结合具体业务逻辑验证模拟结果的真实性和准确性。

SKILL.md

name
ts-sdk-transactions
description
license
MIT
metadata
author
aptos-labs
version
1.0
category
sdk
tags
["typescript", "sdk", "transaction", "submit", "simulate", "sponsored", "multi-agent"]
priority
high

TypeScript SDK: Transactions

Purpose

Guide building, signing, submitting, and simulating transactions with @aptos-labs/ts-sdk. Use the build → sign → submit → wait pattern; optionally simulate before submit.

ALWAYS

  1. Call aptos.waitForTransaction({ transactionHash }) after submit – do not assume transaction is committed after

signAndSubmitTransaction.

  1. Use aptos.transaction.build.simple() for entry function payloads – pass sender and

data: { function, functionArguments, typeArguments? }.

  1. Simulate before submit for critical/high-value flows – use aptos.transaction.simulate.simple() and check

success and vm_status.

  1. Use the same Account instance for signer that you use for sender address when building (e.g.

account.accountAddress as sender, account as signer).

NEVER

  1. Do not skip waitForTransaction – submission returns when the tx is accepted, not when it is committed.
  2. Do not use deprecated scriptComposer (removed in v6) – use separate transactions or batch patterns.
  3. Do not use number for u64/u128/u256 in functionArguments – use bigint where required to avoid precision

loss.


Standard flow (simple transaction)

import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";

const aptos = new Aptos(new AptosConfig({ network: Network.TESTNET }));
const MODULE_ADDRESS = "0x...";

// 1. Build
const transaction = await aptos.transaction.build.simple({
  sender: account.accountAddress,
  data: {
    function: `${MODULE_ADDRESS}::counter::increment`,
    functionArguments: []
  }
});

// 2. Sign and submit
const pendingTx = await aptos.signAndSubmitTransaction({
  signer: account,
  transaction
});

// 3. Wait for commitment
const committedTx = await aptos.waitForTransaction({
  transactionHash: pendingTx.hash
});

if (!committedTx.success) {
  throw new Error(`Tx failed: ${committedTx.vm_status}`);
}

Build options

// With type arguments (e.g. coin type)
const transaction = await aptos.transaction.build.simple({
  sender: account.accountAddress,
  data: {
    function: "0x1::coin::transfer",
    typeArguments: ["0x1::aptos_coin::AptosCoin"],
    functionArguments: [recipientAddress, amount]
  }
});

// Optional: max gas, expiry, etc. (see SDK types for full options)
const transactionWithOptions = await aptos.transaction.build.simple({
  sender: account.accountAddress,
  data: { function: "...", functionArguments: [] },
  options: {
    maxGasAmount: 2000n,
    gasUnitPrice: 100n,
    expireTimestamp: BigInt(Math.floor(Date.now() / 1000) + 600)
  }
});

Simulation (before submit)

const transaction = await aptos.transaction.build.simple({
  sender: account.accountAddress,
  data: {
    function: `${MODULE_ADDRESS}::counter::increment`,
    functionArguments: []
  }
});

const [simResult] = await aptos.transaction.simulate.simple({
  signerPublicKey: account.publicKey,
  transaction
});

if (!simResult.success) {
  throw new Error(`Simulation failed: ${simResult.vm_status}`);
}
console.log("Gas used:", simResult.gas_used);

Sponsored transactions (fee payer)

// 1. Build with fee payer
const transaction = await aptos.transaction.build.simple({
  sender: sender.accountAddress,
  withFeePayer: true,
  data: {
    function: `${MODULE_ADDRESS}::counter::increment`,
    functionArguments: []
  }
});

// 2. Sender signs
const senderAuth = aptos.transaction.sign({
  signer: sender,
  transaction
});

// 3. Fee payer signs (different method)
const feePayerAuth = aptos.transaction.signAsFeePayer({
  signer: feePayer,
  transaction
});

// 4. Submit with both authenticators
const pendingTx = await aptos.transaction.submit.simple({
  transaction,
  senderAuthenticator: senderAuth,
  feePayerAuthenticator: feePayerAuth
});

await aptos.waitForTransaction({ transactionHash: pendingTx.hash });

Multi-agent transactions

const transaction = await aptos.transaction.build.multiAgent({
  sender: alice.accountAddress,
  secondarySignerAddresses: [bob.accountAddress],
  data: {
    function: `${MODULE_ADDRESS}::escrow::exchange`,
    functionArguments: [itemAddress, amount]
  }
});

const aliceAuth = aptos.transaction.sign({ signer: alice, transaction });
const bobAuth = aptos.transaction.sign({ signer: bob, transaction });

const pendingTx = await aptos.transaction.submit.multiAgent({
  transaction,
  senderAuthenticator: aliceAuth,
  additionalSignersAuthenticators: [bobAuth]
});

await aptos.waitForTransaction({ transactionHash: pendingTx.hash });

waitForTransaction options

const committed = await aptos.waitForTransaction({
  transactionHash: pendingTx.hash,
  options: {
    timeoutSecs: 60,
    checkSuccess: true // throw if tx failed
  }
});

Gas profiling

const gasProfile = await aptos.gasProfile({
  sender: account.accountAddress,
  data: {
    function: `${MODULE_ADDRESS}::module::function_name`,
    functionArguments: []
  }
});
console.log("Gas profile:", gasProfile);

Common mistakes

MistakeCorrect approach
Not calling waitForTransactionAlways wait and check committedTx.success
Using number for large amountsUse bigint for u64/u128/u256 in functionArguments
Wrong signer for submitUse the Account whose address is the sender (or fee payer / additional signer as appropriate)
Assuming scriptComposer existsUse separate transactions or batch; scriptComposer removed in v6

References

ts-sdk-wallet-adapter, use-ts-sdk

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

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

04

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

OpenClaw

92.2%
按下载量换算1,373

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills