npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pay-normalize/nomba

v0.1.1

Published

Nomba connector for pay-normalize: webhooks and transaction-record API responses (EXPERIMENTAL).

Readme

@pay-normalize/nomba

Nomba connector — normalizes webhooks and transaction-record API responses into StandardizedTransaction. The flagship connector, built from Owoore production experience.

Status: EXPERIMENTAL (connector version: "0.1.0"). The signature scheme is validated byte-for-byte against Nomba's published golden vector, and transaction-record fixtures are sanitized real production records. Webhook fixtures remain docs-derived until real captures are donated; it graduates then (NOT_DOING.md §11).

import { nomba } from "@pay-normalize/nomba";

See ../../docs/INTEGRATION.md and ../../docs/SECURITY.md.


Signature

  • Headers: nomba-signature (the HMAC) and nomba-timestamp (part of the signed input).
  • Scheme: HMAC-SHA256 over a canonical string of 9 colon-joined fields, base64, constant-time compared.

Canonical string:

event_type : requestId : merchant.userId : merchant.walletId :
transaction.transactionId : transaction.type : transaction.time :
transaction.responseCode : nomba-timestamp

Quirks encoded: a literal "null" responseCode is treated as empty before hashing; the timestamp comes from the header (binding each delivery to its send time — hosts can reject stale timestamps to shrink the replay window). The connector extracts these fields from the parsed body and headers for you.

⚠️ The amount is UNSIGNED. The canonical string is metadata only — transactionAmount, fee, sender, and account number are outside the HMAC. Enforce TLS and confirm material credits via Nomba's lookup API. Full detail: SECURITY.md H-2.


Events (parseNombaWebhook)

Status and direction are both encoded in the event name:

| Event | Status | Direction | |---|---|---| | payment_success | SUCCESSFUL | credit | | payment_failed | FAILED | credit | | payment_reversal | REVERSED | credit | | payout_success | SUCCESSFUL | debit | | payout_failed | FAILED | debit | | payout_refund | REVERSED | debit | | unrecognized | — | unknown_event (Nomba adds events over time) |

Money

Webhook amounts are naira decimal numbers (transactionAmount: 120, fee: 0.6) → parseNairaDecimalString. net = amount − fee. Currency is NGN (webhooks carry no currency field). requestId (per-delivery UUID) maps to providerEventId; identity for dedupe is transactionIdnomba:transaction:<transactionId>.


Transaction records (parseNombaTransactionRecord)

Normalizes rows from Nomba's transaction list/lookup API (data.results[]) — the recon-side shape. Amounts here are naira decimal strings.

Money model, with a checkable invariant:

amount        "100.0"  = principal (what the recipient receives)  -> netAmountInKobo
fixedCharge   "20.0"   = Nomba's fee, charged on top              -> feeInKobo
amountCharged "120.0"  = amount + fixedCharge = total movement    -> amountInKobo

Records whose money fields disagree (amountCharged ≠ amount + fixedCharge) become a parse_error — no guessing which is authoritative. record.id is the same identity space as the webhook's transactionId, so a record-sourced row reconciles against its webhook twin.


Settlement files

parseSettlementFile(buffer) throws UnsupportedFileFormatError. For API-fetched transaction lists, use parseNombaTransactionRecord per result row.


Exports

| Export | Type | |---|---| | nomba | Connector | | parseNombaWebhook | (rawBody) => ParseResult | | parseNombaTransactionRecord | (record) => ParseResult | | verifyNombaSignature | (input) => boolean | | buildNombaCanonicalString / signNombaCanonicalString | canonical-string helpers | | headerValue | case-insensitive header lookup | | EVENT_MAP | the event → status/direction table | | SIGNATURE_HEADER / TIMESTAMP_HEADER | "nomba-signature" / "nomba-timestamp" | | PROVIDER | "nomba" | | NombaSignedFields | type of the canonical-string inputs |

Depends on @pay-normalize/core and zod.