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

@solana/keychain-memory

v1.4.0

Published

In-memory Ed25519 keypair signer for Solana transactions

Readme

@solana/keychain-memory

In-memory Ed25519 keypair signer for Solana transactions.

The private key never leaves the local process — all signing happens via the Web Crypto API. Useful for development, integration tests, and server-side signing where a remote vendor is overkill.

Installation

pnpm add @solana/keychain-memory

Usage

From a Solana CLI keypair file

import { createMemorySignerFromKeypairFile } from '@solana/keychain-memory';

const signer = await createMemorySignerFromKeypairFile('/path/to/id.json');
console.log('Signer address:', signer.address);

From a base58 private key string

import { createMemorySignerFromPrivateKeyString } from '@solana/keychain-memory';

const signer = await createMemorySignerFromPrivateKeyString(process.env.SOLANA_PRIVATE_KEY!);

From a U8Array string (Solana CLI inline format)

import { createMemorySignerFromPrivateKeyString } from '@solana/keychain-memory';

const signer = await createMemorySignerFromPrivateKeyString('[1, 2, 3, ..., 64]');

From raw bytes

Accepts either a 64-byte Solana CLI keypair (seed concatenated with public key — seed↔pubkey match is validated) or a 32-byte Ed25519 seed (public key derived).

import { createMemorySignerFromBytes } from '@solana/keychain-memory';

// 64 bytes: Solana CLI format
const signer = await createMemorySignerFromBytes(solanaCliKeypairBytes);

// 32 bytes: raw Ed25519 seed (e.g. exported from generateKey)
const signerFromSeed = await createMemorySignerFromBytes(seed32);

From an existing CryptoKeyPair

import { generateKeyPair } from '@solana/keys';
import { createMemorySignerFromKeyPair } from '@solana/keychain-memory';

const keyPair = await generateKeyPair();
const signer = await createMemorySignerFromKeyPair(keyPair);

Unified factory

import { createMemorySigner } from '@solana/keychain-memory';

const signer = await createMemorySigner({
    privateKeyString: process.env.SOLANA_PRIVATE_KEY!,
});

Provide exactly one of: keyPair, privateKey, privateKeyString, privateKeyPath.

Sign messages and transactions

import { createSignableMessage } from '@solana/signers';

const message = createSignableMessage('Hello, Solana!');
const [messageSignatures] = await signer.signMessages([message]);

const [transactionSignatures] = await signer.signTransactions([transaction]);

Check availability

const available = await signer.isAvailable(); // always true

API Reference

createMemorySigner(config)

Returns Promise<SolanaSigner>.

Config (MemorySignerConfig):

  • keyPair?: CryptoKeyPair — pre-built CryptoKeyPair (e.g. from generateKeyPair)
  • privateKey?: Uint8Array — 64-byte Solana keypair (seed‖pubkey, validated) OR 32-byte Ed25519 seed (pubkey derived)
  • privateKeyString?: string — base58 OR U8Array string "[1, 2, ..., 64]"
  • privateKeyPath?: string — path to a Solana CLI keypair JSON file (Node-only)

Named factories

  • createMemorySignerFromKeyPair(keyPair)
  • createMemorySignerFromBytes(privateKey)
  • createMemorySignerFromPrivateKeyString(privateKeyString) — auto-detects base58 vs U8Array
  • createMemorySignerFromKeypairFile(privateKeyPath) — Node-only

Security Notes

  • The private key is held in memory as a non-extractable CryptoKey — it cannot be exported back to bytes.
  • Do not hardcode private keys in source files. Use environment variables, secret managers, or operator-supplied keypair files.
  • For production wallets, prefer a remote signer backend (AWS KMS, GCP KMS, Turnkey, Privy, etc.).