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

@raac/chainlinkjs

v1.0.1

Published

Chainlink JavaScript SDK for Ethers v6

Readme

Chainlink JS

License: MIT

This package contains tooling to work with Chainlink and ethers v6.

Connectors

ChainlinkVRFConnector: Connector for Chainlink VRF.

Manages Chainlink VRF v2.5 subscriptions

Environment Variables Required:

  • RPC_URL - Blockchain RPC endpoint URL
  • PRIVATE_KEY - Wallet private key for signing transactions
  • CHAINLINK_NETWORK - Network name (ethereum, polygon, arbitrum, optimism, base)
  • CHAINLINK_CHAIN - Chain name (mainnet, sepolia, mumbai, etc.)

Usage:

import { ChainlinkVRFConnector } from "./src/connectors/ChainlinkVRFConnector.js";

const vrf = new ChainlinkVRFConnector();

const subscriptions = await vrf.listSubscriptions([
  "102692964286750664259499016255520300419720563719633059324084515380375060412330"
]);

const subscriptionResult = await vrf.createSubscription();
const isOwned = await vrf.isSubscriptionOwned(subscriptionResult.subscriptionId);
const subscriptionDetails = await vrf.getSubscription(subscriptionResult.subscriptionId);

Methods

  • fundSubscription(subscriptionId, amount, currency = 'ETH') // Fund the subscription with ETH or LINK
  • createSubscription() // Create a new subscription
  • isSubscriptionOwned(subscriptionId) // Check if a subscription is owned by us
  • getSubscription(subscriptionId) // Get subscription details
  • listSubscriptions([subscriptionId]) // List all subscriptions
  • cancelSubscription(subscriptionId) // Cancel a subscription
  • addConsumer(subscriptionId, consumerAddress) // Add a consumer to a subscription
  • removeConsumer(subscriptionId, consumerAddress) // Remove a consumer from a subscription

ChainlinkSecretsConnector: Connector for Chainlink Secrets.

Manages Chainlink Secrets for Chainlink Functions.

Environment Variables Required:

  • RPC_URL - Blockchain RPC endpoint URL
  • PRIVATE_KEY - Wallet private key for signing transactions
  • CHAINLINK_NETWORK - Network name (ethereum, polygon, arbitrum, optimism, base)
  • CHAINLINK_CHAIN - Chain name (mainnet, sepolia, mumbai, etc.)

Usage:

import { ChainlinkSecretsConnector } from "./src/connectors/ChainlinkSecretsConnector.js";

const secrets = new ChainlinkSecretsConnector();

const secrets = await secrets.listHostedSecrets();

Methods

  • fetchKeys() // Fetch the keys from the Chainlink Functions contract
  • listHostedSecrets() // List all hosted secrets
  • encryptSecrets(secrets) // Encrypt secrets
  • encryptSecretsUrls(urls) // Encrypt secrets URLs
  • encryptAndUploadSecrets(secrets) // Encrypt secrets and upload to the DON
  • sendEncryptedSecretsToDON(encryptedSecrets, slotId, ttl) // Send encrypted secrets to the DON
  • listHostedSecrets() // List all hosted secrets

ChainlinkFunctionsConnector: Connector for Chainlink Functions.

Manages Chainlink Functions for Chainlink Secrets.

Environment Variables Required:

  • RPC_URL - Blockchain RPC endpoint URL
  • PRIVATE_KEY - Wallet private key for signing transactions
  • CHAINLINK_NETWORK - Network name (ethereum, polygon, arbitrum, optimism, base)
  • CHAINLINK_CHAIN - Chain name (mainnet, sepolia, mumbai, etc.)

Usage:

import { ChainlinkFunctionsConnector } from "./src/connectors/ChainlinkFunctionsConnector.js";

const functions = new ChainlinkFunctionsConnector();

const subscription = await functions.createSubscription();

Methods

  • createSubscription() // Create a new subscription
  • listSubscriptions() // List all subscriptions
  • getSubscription(subscriptionId) // Get subscription details
  • cancelSubscription(subscriptionId) // Cancel a subscription
  • addConsumer(subscriptionId, consumerAddress) // Add a consumer to a subscription
  • removeConsumer(subscriptionId, consumerAddress) // Remove a consumer from a subscription

Ciphers

Encrypting / Decrypting Secrets and Key pair generation

Generate a key pair:

import { generateKeyPair } from "./src/ciphers/crypto/keygen.js";

const { privateKey, publicKey } = generateKeyPair();

We can then share the public key with Instruxi for them to encrypt the secrets.

Encrypt and decrypt secrets:

import { encryptSecrets } from "./src/ciphers/encryptSecrets.js";
import { decryptSecrets } from "./src/ciphers/decryptSecrets.js";

const secrets = ["SECRET1=value1", "SECRET2=value2"];
const privateKey = Buffer.from(process.env.ENCRYPT_PRIVATE_KEY, 'hex');
const publicKey = Buffer.from(process.env.ENCRYPT_PUBLIC_KEY, 'hex');
const encryptedSecrets = await encryptSecrets(secrets, publicKey);
const decryptedSecrets = await decryptSecrets(encryptedSecrets, privateKey);

Utils:

import { utils } from './src/index.js';


utils.canonicalizeSignature(sig)                         // Canonicalize signature format
utils.decomposeFromChainId(chainId)                      // Decompose chain ID into chain and network (e.g. 11155111 -> { chain: 'ethereum', network: 'sepolia' })
utils.deriveAddressFromPublicKey(key)                    // Derive address from public key
utils.derivePublicKeyFromPrivateKey(privateKey)          // Derive public key from private key
utils.derSignatureToRSV(der, digest, expectedAddress)   // Convert DER to RSV format (optional: expected address for recovery validation)
utils.derToRaw(derSignature)                             // Convert DER to raw signature
utils.estimateGasLimit(provider, params, from)           // Estimate gas limit
utils.getProvider()                                      // Get provider
utils.parseSignature(signature)                          // Parse signature from hex
utils.prepareTransaction(provider, params, from, nonce)  // Prepare transaction
utils.signatureToHex(signature)                          // Convert signature to hex
utils.sleep(ms)                                          // Sleep utility
utils.retryWithBackoff(fn, options)                      // Retry with exponential backoff
utils.rawToDer(rawSignature)                             // Convert raw signature to DER

License

This project is licensed under the MIT License - see the LICENSE file for details.