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

arkham-oracle-sdk

v1.1.1

Published

A verifiable off-chain oracle SDK for securely signing and delivering real-world data to smart contracts.

Readme

Arkham Oracle SDK (JavaScript/TypeScript)

The arkham-oracle-sdk provides a robust and verifiable off-chain oracle solution for JavaScript and TypeScript environments. It enables you to securely sign real-world price data, ensuring authenticity and integrity when delivering it to critical applications like smart contracts. This SDK simplifies the process of creating and interacting with a custom oracle that can serve cryptographically signed data, crucial for decentralized applications requiring trusted external information.

Installation

pnpm add arkham-oracle-sdk

For Servers: Creating an Oracle API

You can easily create an API endpoint to serve signed price data using the createOracleHandler. This handler is designed to be compatible with modern serverless environments (like Next.js App Router) and can be adapted for traditional Node.js servers (like Express.js).

Next.js App Router Example

Configure your Next.js App Router API route (app/api/price/route.ts) to use the handler.

app/api/price/route.ts

import { createOracleHandler } from 'arkham-oracle-sdk/server';

// 1. Parse the 64-byte oracle private key from your environment.
//    Example: ORACLE_PRIVATE_KEY="[194,18,35,...,62,121]"
const oraclePrivateKey = new Uint8Array(JSON.parse(process.env.ORACLE_PRIVATE_KEY!));

// 2. (Optional) Parse trusted client keys from your environment.
//    Example: TRUSTED_CLIENT_KEYS="key1,key2,key3"
//    Tip: Generate strong keys with `openssl rand -base64 48`
const trustedClientKeys = process.env.TRUSTED_CLIENT_KEYS?.split(',');

// 3. Create and export the GET handler
export const GET = createOracleHandler({
  oraclePrivateKey,
  trustedClientKeys, // Omit this property to make the endpoint public
  // dataSourceUrl: "https://my-custom-price-api.com/prices" // Optional: use a custom data source
});

Note: The trustedClientKeys option is optional. If you omit it, the API endpoint will not require an API key. The dataSourceUrl is also optional; if omitted, CoinGecko will be used by default.

Express.js Server Example

You can integrate the createOracleHandler into an Express.js application.

import express from 'express';
import { createOracleHandler } from 'arkham-oracle-sdk/server';
import { Request as ExpressRequest, Response as ExpressResponse } from 'express';

// Load environment variables (e.g., using dotenv)
require('dotenv').config();

// Parse the 64-byte oracle private key from your environment.
const oraclePrivateKey = new Uint8Array(JSON.parse(process.env.ORACLE_PRIVATE_KEY!));

// (Optional) Parse trusted client keys from your environment.
const trustedClientKeys = process.env.TRUSTED_CLIENT_KEYS?.split(',');

// Create the core handler function
const oracleApiHandler = createOracleHandler({
  oraclePrivateKey,
  trustedClientKeys,
});

const app = express();
const PORT = process.env.PORT || 3001;

// Express.js adapter for the universal handler
app.get('/api/price', async (req: ExpressRequest, res: ExpressResponse) => {
  // Convert Express.js Request to standard Request for the handler
  const url = new URL(req.url, `http://${req.headers.host}`);
  const standardRequest = new Request(url.toString(), {
    method: req.method,
    headers: req.headers as HeadersInit,
  });

  // Call the universal handler
  const response = await oracleApiHandler(standardRequest);

  // Convert standard Response back to Express.js Response
  res.status(response.status);
  response.headers.forEach((value, name) => res.setHeader(name, value));
  res.send(await response.json());
});

app.listen(PORT, () => {
  console.log(`Express Oracle Server running on port ${PORT}`);
});

For Clients: Fetching Signed Prices

You can use the OracleClient to easily fetch signed price data from any compatible oracle endpoint.

import { OracleClient } from 'arkham-oracle-sdk/client';

async function main() {
  const oracle = new OracleClient("https://arkham-dvpn.vercel.app/api/price");

  try {
    // Fetch from a protected endpoint
    const signedPriceProtected = await oracle.fetchSignedPrice(
      'solana',
      'your-trusted-client-key'
    );
    console.log('Protected Price:', signedPriceProtected.price);

    // Fetch from a public endpoint (if the server is configured as such)
    const signedPricePublic = await oracle.fetchSignedPrice('ethereum');
    console.log('Public Price:', signedPricePublic.price);

    // This data can now be used to build a transaction for the Arkham smart contract.
  } catch (error) {
    console.error('Error:', error);
  }
}

main();

Use Cases

This SDK is ideal for scenarios where:

  • Decentralized Finance (DeFi): Providing tamper-proof price feeds for lending protocols, stablecoins, or derivatives on Solana and other blockchains.
  • Decentralized VPNs (dVPNs): As implememted in the (Arkham dVPN Protocol)[https://github.com/Arkham-dVPN], for securely valuing staked assets or bandwidth payments.
  • Gaming & NFTs: Integrating real-world asset prices or dynamic game parameters into blockchain-based games or NFT marketplaces.
  • Supply Chain & Logistics: Verifying real-time commodity prices or sensor data on-chain.
  • Any Smart Contract Requiring External Data: When a smart contract needs to react to off-chain information, this oracle provides a cryptographically secure bridge.

Author: (David Nzube)[https://x.com/DavidNzubee]