← 返回
开发者工具

Hedera Transaction Builder

Build, sign, and submit Hedera transactions including HBAR transfers, token operations, and smart contract calls to the Hedera network.
构建、签名并提交 Hedera 交易,包括 HBAR 转账、代币操作和智能合约调用至 Hedera 网络。
harleyscodes
开发者工具 clawhub v1.0.0 1 版本 99772.4 Key: 无需
★ 0
Stars
📥 1,315
下载
💾 4
安装
1
版本
#latest

概述

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

  • Mainnet: https://mainnet.hashio.io/api
  • Testnet: https://testnet.hashio.io/api

Important Concepts

  • Hbar: 1 HBAR = 100,000,000 tinybars
  • Account ID: Format shard.realm.num (e.g., 0.0.12345)
  • Transaction Fee: Small HBAR fee for each transaction
  • Transaction Valid Duration: 180 seconds by default

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 06:42 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 65 📥 179,842
data-analysis

KyberSwap Arbitrage

harleyscodes
通过 KyberSwap 在 Base 上执行三角套利:寻找获利机会,计算最优路径,并在考量 Gas 成本的情况下执行多跳交易。
★ 0 📥 1,140
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,791