gbangbolaoluwagbemiga-stacks-helpers-transactions
v1.0.0
Published
Build, sign, broadcast, batch, and manage Stacks L2 transactions
Downloads
9,194
Maintainers
Readme
stacks-helpers-transactions
STX transfers, fee estimation, and transaction confirmation for Stacks L2.
Repository: Gbangbolaoluwagbemiga/stacks-helpers-transactions
Install
npm install gbangbolaoluwagbemiga-stacks-helpers-transactionsUsage
import { transferSTX, estimateFee, waitForConfirmation } from "gbangbolaoluwagbemiga-stacks-helpers-transactions";
// Transfer STX
const result = await transferSTX({
recipient: "SP...",
amount: 1000000n,
senderKey: "your-private-key",
});
// Estimate fees
const fees = await estimateFee("token_transfer");
// Returns: { low: 2500, medium: 3750, high: 5000 }
// Wait for transaction confirmation
const confirmation = await waitForConfirmation("0x...");
// Returns: { success: true, status: "success" }API
transferSTX(options)
Send STX to a recipient. Options:
recipient— Address to send toamount— Amount in uSTX (bigint)senderKey— Sender's private keynetwork?— Stacks network (default: mainnet)nonce?— Transaction noncefee?— Transaction fee in uSTX
estimateFee(txType, networkUrl?)
Estimate fees for a transaction type. Returns { low, medium, high }.
waitForConfirmation(txid, networkUrl?, timeoutMs?, pollMs?)
Poll for transaction confirmation. Returns { success, status }.
License
MIT
Author
gbangbolaoluwagbemiga
