Skip to content

@hbar-kit/payments

verifyHbarPayment(params)

ParamTypeNotes
network | clientnetwork name | MirrorClientOne is required.
receiverstringAccount ID 0.0.x.
amountstringHBAR, decimal string.
memostring?Correlation key.
comparison"exact"|"atLeast"Default "exact".
after / beforeDate|stringTime window.

Returns Promise<PaymentResult>:

ts
interface PaymentResult {
  matched: boolean
  status:
    | "confirmed"
    | "pending"
    | "underpaid"
    | "overpaid"
    | "duplicate"
    | "mismatch"
    | "expired"
    | "failed"
  receiver: string
  asset: "HBAR" | { tokenId: string; decimals: number; symbol?: string }
  transactionId?: string
  payer?: string
  amount?: string
  amountBase?: bigint
  memo?: string
  consensusTimestamp?: string
  explorerUrl?: string
  matches: PaymentMatch[]
  reason?: string
}

verifyHtsPayment(params)

Adds tokenId: string and optional decimals?: number (auto-fetched when omitted).

verifyUsdcPayment(params)

Wrapper over verifyHtsPayment that resolves the verified USDC token id for network (required; mainnet 0.0.456858, testnet 0.0.429274, previewnet throws UnsupportedAssetError) and forces decimals = 6. Accepts an optional tokenId override (dev/mock tokens, still 6 decimals). The result asset is tagged { tokenId, decimals: 6, symbol: "USDC" }. See Verify a USDC payment.

Also exported: getUsdcTokenId(network), USDC_TOKEN_IDS, USDC_DECIMALS (= 6), and isUsdcPaymentResult(result).

waitForHbarPayment / waitForHtsPayment / waitForUsdcPayment

Adds timeoutMs?, pollIntervalMs?, signal?. Resolves confirmed or expired.