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

@vaultkey/sdk

v1.0.1

Published

Official TypeScript SDK for the VaultKey API

Readme

@vaultkey/sdk

Official TypeScript / JavaScript SDK for the VaultKey API.

VaultKey lets you create and manage crypto wallets, sign messages and transactions, transfer stablecoins, and sweep funds — all through a simple API.

Installation

npm install @vaultkey/sdk
# or
pnpm add @vaultkey/sdk
# or
yarn add @vaultkey/sdk

Requirements

  • Node.js 18+
  • A VaultKey API key and secret from your dashboard

Quick Start

import { VaultKey } from "@vaultkey/sdk";

const vk = new VaultKey({
  apiKey: "vk_live_...",
  apiSecret: "...",
});

// Create a wallet
const { data: wallet, error } = await vk.wallets.create({
  userId: "user_123",
  chainType: "evm",
});

if (error) {
  console.error(error.message);
} else {
  console.log(wallet.address); // "0x..."
}

Configuration

const vk = new VaultKey({
  apiKey: "vk_live_...",       // or set VAULTKEY_API_KEY env var
  apiSecret: "...",             // or set VAULTKEY_API_SECRET env var
  baseUrl: "https://...",       // optional — override for self-hosted deployments
});

API key prefixes:

  • testnet_ — testnet environment
  • vk_live_ — mainnet / production

The SDK will warn you at construction time if your key prefix does not match the detected environment.


Response Shape

Every method returns { data, error }. Exactly one will be non-null.

const { data, error } = await vk.wallets.get("wallet_id");

if (error) {
  console.error(error.code, error.message);
  return;
}

console.log(data.address);

Wallets

Create a wallet

const { data: wallet } = await vk.wallets.create({
  userId: "user_123",
  chainType: "evm",       // "evm" | "solana"
  label: "Primary",       // optional
});

Get a wallet

const { data: wallet } = await vk.wallets.get("wallet_id");

List wallets for a user

const { data } = await vk.wallets.listByUser("user_123");

// Paginate
if (data.hasMore) {
  const { data: page2 } = await vk.wallets.listByUser("user_123", {
    after: data.nextCursor,
  });
}

Signing

Signing operations are asynchronous. They return a jobId which you poll via vk.jobs.get().

Sign an EVM message

const { data: job } = await vk.wallets
  .signing("wallet_id")
  .evmMessage({
    payload: { message: "Hello from VaultKey" },
    idempotencyKey: "unique-key-123",  // optional — safe to retry
  });

// Poll until done
const result = await pollJob(vk, job.jobId);

Sign a Solana message

const { data: job } = await vk.wallets
  .signing("wallet_id")
  .solanaMessage({
    payload: { data: "SGVsbG8=" },
  });

Balances

EVM balance

// Preferred: use chain name
const { data } = await vk.wallets.evmBalance("wallet_id", {
  chainName: "base",
});

// Fallback: use chain ID
const { data } = await vk.wallets.evmBalance("wallet_id", {
  chainId: "8453",
});

console.log(data.balance);     // "0.05"
console.log(data.symbol);      // "ETH"
console.log(data.chainName);   // "base"

Solana balance

const { data } = await vk.wallets.solanaBalance("wallet_id");
console.log(data.balance);  // "1.5"
console.log(data.symbol);   // "SOL"

Broadcast

Send a pre-signed transaction to the network.

EVM

const { data } = await vk.wallets.broadcastEVM("wallet_id", {
  signedTx: "0x...",
  chainName: "base",
});
console.log(data.txHash);

Solana

const { data } = await vk.wallets.broadcastSolana("wallet_id", {
  signedTx: "base58encodedtx...",
});
console.log(data.signature);

Sweep

Move all funds from a wallet to the configured master wallet. Async — poll the returned job.

// EVM sweep
const { data: job } = await vk.wallets.sweep("wallet_id", {
  chainType: "evm",
  chainName: "base",
});

// Solana sweep
const { data: job } = await vk.wallets.sweep("wallet_id", {
  chainType: "solana",
});

const result = await pollJob(vk, job.jobId);

Stablecoin

Transfer USDC or USDT, and check stablecoin balances.

Transfer

// EVM — gasless (relayer pays gas)
const { data } = await vk.stablecoin.transfer("wallet_id", {
  token: "usdc",
  to: "0xRecipient",
  amount: "50.00",
  chainType: "evm",
  chainName: "base",
  gasless: true,
  speed: "fast",              // "slow" | "normal" | "fast"
  idempotencyKey: "tx-001",  // optional — prevents double sends on retry
});

// Solana — omit chain fields
const { data } = await vk.stablecoin.transfer("wallet_id", {
  token: "usdc",
  to: "RecipientBase58...",
  amount: "50.00",
  chainType: "solana",
});

// Poll the async job
const result = await pollJob(vk, data.jobId);

Balance

const { data } = await vk.stablecoin.balance("wallet_id", {
  token: "usdc",
  chainType: "evm",
  chainName: "polygon",
});
console.log(data.balance);  // "50.00"

Jobs

Poll the status of any async operation.

const { data } = await vk.jobs.get("job_id");
// data.status: "pending" | "processing" | "completed" | "failed"

Polling helper

async function pollJob(vk: VaultKey, jobId: string, intervalMs = 1000) {
  while (true) {
    const { data, error } = await vk.jobs.get(jobId);
    if (error) throw new Error(error.message);
    if (data.status === "completed") return data;
    if (data.status === "failed") throw new Error(data.error ?? "Job failed");
    await new Promise((r) => setTimeout(r, intervalMs));
  }
}

Chains

Discover supported chains for the current environment.

const { data: chains } = await vk.chains.list();
// [{ name: "base", chainId: "8453", nativeSymbol: "ETH", testnet: false }, ...]

Supported EVM chains:

| Mainnet | Testnet | |---|---| | ethereum | sepolia | | polygon | amoy | | arbitrum | arbitrum-sepolia | | base | base-sepolia | | optimism | optimism-sepolia | | avalanche | avalanche-fuji | | bsc | bsc-testnet | | linea | — | | scroll | — | | zksync | zksync-sepolia |


Environment Variables

| Variable | Description | |---|---| | VAULTKEY_API_KEY | Your API key (fallback if not passed to constructor) | | VAULTKEY_API_SECRET | Your API secret (fallback if not passed to constructor) | | VAULTKEY_BASE_URL | Override base URL (optional) | | ENVIRONMENT | "testnet" or "mainnet" — used for key prefix validation warnings |


Available Resources

| Resource | Methods | |---|---| | vk.wallets | create, get, listByUser, evmBalance, solanaBalance, broadcastEVM, broadcastSolana, sweep | | vk.wallets.signing(id) | evmMessage, solanaMessage | | vk.stablecoin | transfer, balance | | vk.jobs | get | | vk.chains | list |