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

@ghostgate/sdk

v0.2.0

Published

Ghost Protocol Node.js SDK for GhostGate Express, open x402, telemetry, fulfillment, and direct GhostWire escrow.

Readme

@ghostgate/sdk

Node.js SDK for Ghost Protocol:

  • Express access via connect()
  • x402 request flow via requestX402()
  • GhostWire direct escrow helpers
  • merchant onboarding and x402 settlement reporting

Install

npm install @ghostgate/sdk

Core surfaces

  • GhostAgent
    • connect()
    • requestX402()
    • pulse()
    • outcome()
    • startHeartbeat()
    • createWireQuote()
    • prepareWireJob()
    • recordWireArtifacts()
    • getWireJob()
    • waitForWireTerminal()
    • getWireDeliverable()
  • GhostMerchant
    • activate()
    • reportX402Settlement()
    • reportX402Settlements()
  • GhostFulfillmentConsumer
  • GhostFulfillmentMerchant
  • buildCanaryPayload()
  • createCanaryHandler()

Express example

import { GhostAgent } from "@ghostgate/sdk";

const agent = new GhostAgent({
  apiKey: process.env.GHOST_API_KEY,
  privateKey: process.env.GHOST_SIGNER_PRIVATE_KEY as `0x${string}`,
  baseUrl: process.env.GHOST_BASE_URL,
  serviceSlug: "agent-18755",
  creditCost: 1,
});

const result = await agent.connect();
console.log(result.status, result.payload);

x402 example

requestX402() is the high-level Node helper. It handles the standard 402 -> payment -> retry flow for you.

import { GhostAgent } from "@ghostgate/sdk";

const agent = new GhostAgent({
  privateKey: process.env.GHOST_SIGNER_PRIVATE_KEY as `0x${string}`,
  chainId: 8453,
});

const result = await agent.requestX402({
  url: "https://merchant.example.com/ask",
  method: "POST",
  body: { prompt: "hello" },
  maxAmountAtomic: "100000",
});

console.log(result.status, result.payload, result.paymentResponse);

Merchant x402 settlement reporting

import { GhostMerchant } from "@ghostgate/sdk";

const merchant = new GhostMerchant({
  serviceSlug: "agent-18755",
  ownerPrivateKey: process.env.GHOST_OWNER_PRIVATE_KEY as `0x${string}`,
  delegatedPrivateKey: process.env.GHOST_SIGNER_PRIVATE_KEY as `0x${string}`,
});

const report = await merchant.reportX402Settlement({
  agentId: "18755",
  serviceSlug: "agent-18755",
  requestId: "req_123",
  paymentReference: "0xabc123",
  payerIdentity: "0xpayer",
  scheme: "exact",
  network: "base",
  chainId: 8453,
  asset: "USDC",
  amountAtomic: "1000000",
  decimals: 6,
  success: true,
  statusCode: 200,
});

console.log(report.countedForRank, report.duplicate);

GhostWire direct escrow

const quote = await agent.createWireQuote({
  client: "0xclient...",
  provider: "0xprovider...",
  evaluator: "0xevaluator...",
  principalAmount: "1000000",
  chainId: 8453,
});

const prepared = await agent.prepareWireJob({
  quoteId: quote.quoteId!,
  client: "0xclient...",
  provider: "0xprovider...",
  evaluator: "0xevaluator...",
  specHash: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
});

Notes

  • connect() is Express only. The old Express x402-compat envelope has been removed.
  • requestX402() is the real standards-native x402 rail and automatically handles the payment retry path.
  • GhostRank credit for x402 depends on merchant-side reportX402Settlement(...).
  • Use signer private keys only in trusted backend/server/CLI environments.