Skip to content

devwhodevs/hbar-kit

hbar-kit

CI npm license docs

hbar-kit is a TypeScript toolkit for verifying native Hedera payments. It confirms whether an HBAR or HTS-token payment reached a receiver account — by amount, memo, and time window — by reading the public Hedera Mirror Node. Read-only, non-custodial, bigint-safe, and built for real payment verification.

Verify a native Hedera payment in under 20 lines. No private keys, no custody.

Status: v0.1.x (beta). Published to npm and tested, usable today for HBAR/HTS payment verification. Pre-1.0 — the public API may still change before 1.0, so pin a version. The wallet/React/Next.js/indexer packages (Phases 2–5) are planned, not yet built.

Who it's for

Developers building checkout flows, invoices, payment links, or backend payment APIs on Hedera who need to confirm a payment server-side without holding funds or running a node.

Use it when you need to

  • verify an HBAR payment by receiver, amount, memo, and time window
  • verify an HTS token payment
  • build Hedera payment links, invoice flows, checkout flows, or backend payment APIs
  • read Hedera Mirror Node data with typed helpers

It is read-only, non-custodial, bigint-safe, and designed for production payment verification.

Install

pnpm add @hbar-kit/payments

Quick example

import { verifyHbarPayment } from "@hbar-kit/payments"

const result = await verifyHbarPayment({
  network: "testnet",
  receiver: "0.0.12345",
  amount: "25", // 25 HBAR — parsed to tinybars internally, never a float
  memo: "order_6471727153206", // your order / invoice id
  after: new Date(Date.now() - 30 * 60 * 1000),
})

if (result.matched) {
  console.log("Paid:", result.explorerUrl)
} else {
  // pending | underpaid | overpaid | duplicate | mismatch | expired
  console.log("Not settled:", result.status)
}

No private keys, no signing, no funds held — verifyHbarPayment only reads public Mirror Node data and tells you whether the payment you expected actually arrived.

Verify a USDC payment

USDC on Hedera is an HTS token. hbar-kit includes a USDC convenience helper for common invoice, checkout, and payment-link flows — it fills in the verified USDC token id and 6-decimal parsing.

import { verifyUsdcPayment } from "@hbar-kit/payments"

const result = await verifyUsdcPayment({
  network: "mainnet",
  receiver: "0.0.12345",
  amount: "25.00",
  memo: "invoice_123",
  after: new Date(Date.now() - 30 * 60 * 1000),
})

See Verify a USDC payment.

Use cases

  • Hedera payment links
  • HBAR checkout flows
  • HTS token payment verification
  • invoice payment verification
  • backend payment status APIs
  • payment webhooks
  • Mirror Node TypeScript integrations
  • Shopify-style manual crypto payment verification

What hbar-kit is not

hbar-kit is not a wallet, payment processor, custodial service, fiat on-ramp, exchange, or EVM/Solidity framework. It does not hold funds or move user money. It verifies public Hedera transactions through the Mirror Node and helps developers build payment links, invoices, checkout flows, and payment-verification APIs.

Packages

Package Status Purpose
@hbar-kit/core 0.1 (beta) Primitives: network config, bigint money, ids, timestamps, errors
@hbar-kit/mirror 0.1 (beta) Typed Mirror Node REST client
@hbar-kit/payments 0.1 (beta) HBAR/HTS payment verification
@hbar-kit/wallet Phase 2 Native Hedera wallet signing
@hbar-kit/react Phase 3 React hooks
@hbar-kit/next Phase 4 Next.js server helpers
@hbar-kit/indexer Phase 5 Forward-only Mirror Node indexer

Docs

See the documentation. Task-focused guides:

For AI agents and tools, a machine-readable summary lives at llms.txt (and llms-full.txt).

Contributing

Issues and PRs welcome — see CONTRIBUTING.md. By participating you agree to the Code of Conduct. To report a vulnerability, see SECURITY.md.

License

MIT © Oleksandr Ostrovskyi

About

TypeScript toolkit for verifying native Hedera payments (HBAR & HTS) by receiver, amount, memo & time window via the Mirror Node — read-only, non-custodial, bigint-safe.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors