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

@rocketh/signer

v0.17.14

Published

add signer to rocketh

Readme

@rocketh/signer

Signer protocol implementations for Rocketh. This package provides a way to configure and use different signing mechanisms in your deployment scripts.

Features

  • 🔐 Private Key Signing - Sign transactions using raw private keys
  • 🔌 Protocol-Based - Extensible signer protocol system
  • 🛡️ Type Safe - Full TypeScript support for signer configuration

Installation

# Using pnpm
pnpm add @rocketh/signer

# Using npm
npm install @rocketh/signer

# Using yarn
yarn add @rocketh/signer

Usage

Configuring the Signer Protocol

Add the signer protocol to your Rocketh configuration:

// rocketh/config.ts
import type { UserConfig } from 'rocketh/types';
import { privateKey } from '@rocketh/signer';

export const config = {
  accounts: {
    deployer: {
      default: 0,
    },
  },
  signerProtocols: {
    privateKey: privateKey,
  },
  data: {},
} as const satisfies UserConfig;

Using Private Key Signer

The private key signer allows you to sign transactions using a raw private key:

// In your environment variables or configuration
// Format: privateKey:0x{64-character-hex-string}

// Example .env file:
// DEPLOYER_SIGNER=privateKey:0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

Protocol String Format

The signer uses a protocol string format:

{protocol}:{data}

For the private key signer:

privateKey:0x{privateKeyHex}

Example:

privateKey:0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

API Reference

privateKey

A signer protocol function that creates a signer from a private key.

Type:

const privateKey: SignerProtocolFunction

Protocol String Format:

privateKey:0x{64-hex-characters}

Returns:

{
  type: 'signerOnly';
  signer: EIP1193LocalSigner;
}

Throws:

  • Error if the private key doesn't start with 0x

Creating Custom Signer Protocols

You can create custom signer protocols by implementing the SignerProtocolFunction interface:

import type { SignerProtocolFunction, Signer } from '@rocketh/core/types';

// Example: Hardware wallet signer
export const ledger: SignerProtocolFunction = async (protocolString: string) => {
  const [proto, derivationPath] = protocolString.split(':');
  
  // Connect to hardware wallet and get signer
  const hardwareSigner = await connectToLedger(derivationPath);
  
  return {
    type: 'signerOnly',
    signer: hardwareSigner,
  };
};

// Example: Cloud KMS signer
export const awsKms: SignerProtocolFunction = async (protocolString: string) => {
  const [proto, keyId] = protocolString.split(':');
  
  // Connect to AWS KMS
  const kmsSigner = await createKmsSigner(keyId);
  
  return {
    type: 'signerOnly',
    signer: kmsSigner,
  };
};

Then register in your config:

// rocketh/config.ts
import { privateKey } from '@rocketh/signer';
import { ledger, awsKms } from './custom-signers.js';

export const config = {
  signerProtocols: {
    privateKey,
    ledger,
    awsKms,
  },
  // ...
} as const satisfies UserConfig;

Signer Types

Rocketh supports three signer types:

signerOnly

A signer that can only sign transactions (no sending capability):

{
  type: 'signerOnly';
  signer: EIP1193SignerProvider;
}

remote

A remote signer (e.g., JSON-RPC provider):

{
  type: 'remote';
  signer: EIP1193ProviderWithoutEvents;
}

wallet

A full wallet provider (e.g., MetaMask):

{
  type: 'wallet';
  signer: EIP1193WalletProvider;
}

Security Considerations

⚠️ Important Security Notes:

  1. Never commit private keys - Use environment variables or secure secret management
  2. Use hardware wallets for production - Consider implementing a hardware wallet signer for mainnet deployments
  3. Limit private key exposure - The private key signer is best suited for development and testing

Recommended Practices

# .env (never commit this file!)
DEPLOYER_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

# .env.example (commit this as a template)
DEPLOYER_PRIVATE_KEY=privateKey:0x...
// Use environment variable
const signerString = process.env.DEPLOYER_PRIVATE_KEY;

Related Packages

License

MIT