Hedera tx builder

From jiayaoqijia/cryptoskill · View interactive version

Hedera tx builder is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. Build and sign Hedera transactions. Use for: (1) Creating HBAR transfers, (2) Token operations, (3) Smart contract calls, (4) Submitting to Hedera network.

How to use this skill

Skill file

Hedera Transaction Builder

Setup

npm install @hashgraph/sdk

Client Setup

import { Client, AccountBalanceQuery, Hbar } from '@hashgraph/sdk';

const client = Client.forMainnet();
// Or for testnet:
const client = Client.forTestnet();

Transfer HBAR

import { TransferTransaction, Hbar } from '@hashgraph/sdk';

const tx = new TransferTransaction()
  .addHbarTransfer(fromAccountId, new Hbar(-100)) // send
  .addHbarTransfer(toAccountId, new Hbar(100))    // receive
  .setTransactionMemo("Payment for goods");

// Sign with hashpack or operator
const signTx = await tx.sign(operatorKey);
const result = await signTx.execute(client);

Key Transaction Types

AccountCreate

new AccountCreateTransaction()
  .setKey(publicKey)
  .setInitialBalance(new Hbar(10))
  .setAccountMemo("My account");

TokenAssociate

new TokenAssociateTransaction()
  .setAccountId(accountId)
  .setTokenIds([tokenId1, tokenId2]);

TopicMessage

new TopicMessageTransaction()
  .setTopicId(topicId)
  .setMessage("Hello Hedera!");

Network Endpoints

Important Concepts

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.