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

@cfxdevkit/signer-session

v2.1.10

Published

Headless signer session factory — create a ready Signer pair (eSpace + Core) from any backend without browser UI.

Downloads

225

Readme

@cfxdevkit/signer-session

Headless signer session factory. Create a ready { eSpace, core? } Signer pair from any backend — no browser UI, no devnode-server required.

Backends

Memory (dev / test)

import { createSignerSession } from '@cfxdevkit/signer-session';

const s = await createSignerSession({
  kind: 'memory',
  privateKey: '0x…',
});
const sig = await s.eSpace.signMessage('Hello Conflux');
const coreSig = await s.core!.signMessage('Hello Core');
await s.dispose(); // no-op for memory

File keystore (CI / scripts)

const s = await createSignerSession({
  kind: 'file-keystore',
  path: '~/.cfxdevkit/keystore.json', // or set CFX_KEYSTORE_PATH
  passphrase: process.env.MY_PASS,    // or set CFX_PASSPHRASE
  ref: { service: 'cfxdevkit', account: 'deployer' },
  accountIndex: 0,
});
const sig = await s.eSpace.signMessage('Hello');
await s.dispose();

Environment variables (all optional when passed explicitly):

| Variable | Purpose | Default | |---|---|---| | CFX_KEYSTORE_PATH | Keystore file path | (required if not passed) | | CFX_PASSPHRASE | Decryption passphrase | (required if not passed) | | CFX_KEYSTORE_SERVICE | ref.service | "cfxdevkit" | | CFX_KEYSTORE_ACCOUNT | ref.account | "default" |

OneKey hardware (Node.js / Electron)

import HardwareSDK from '@onekeyfe/hd-common-connect-sdk';
await HardwareSDK.init({ debug: false });
const devicesRes = await HardwareSDK.searchDevices();
const { connectId } = devicesRes.payload[0];
const { deviceId } = (await HardwareSDK.getFeatures(connectId)).payload;

const s = await createSignerSession({
  kind: 'onekey',
  sdk: HardwareSDK,
  connectId,
  deviceId,
});

Ledger hardware (Node.js HID)

import { createNodeHidLedgerTransport } from '@cfxdevkit/wallet/hardware/ledger';
const transport = await createNodeHidLedgerTransport();

const s = await createSignerSession({
  kind: 'ledger',
  transport,
});
await s.eSpace.signMessage('Hello');
await s.dispose(); // closes HID transport

CLI — cdk sign

# Sign a message from env-var keystore
CFX_KEYSTORE_PATH=~/.cfxdevkit/keystore.json CFX_PASSPHRASE=secret \
  cdk sign message "Hello Conflux"

# Core Space
cdk sign message "Hello Core" --space core

# Typed data
cdk sign typed-data ./payload.json --space espace --json

# With explicit keystore flags
cdk sign message "Hello" --keystore ./my.json --account deployer

MCP offline mode

When devnode-server is not running, cfxdevkit_wallet_sign_message automatically falls back to createSignerSession({ kind: 'file-keystore' }) if CFX_PASSPHRASE and CFX_KEYSTORE_PATH are set. The response includes a "note" field indicating offline mode.

Signer Configuration File (.cfxdevkit/signer.json)

For projects using the full developer toolchain, configure a persistent signer:

# Interactive setup wizard
cdk signer setup

# Check current config
cdk signer status

# List all configured signers
cdk signer list

# Switch the active signer
cdk signer use hardware

.cfxdevkit/signer.json format:

{
  "defaultSigner": "dev-wallet",
  "signers": {
    "dev-wallet": {
      "kind": "file-keystore",
      "path": ".cfxdevkit/keystore.json",
      "service": "cfxdevkit",
      "account": "deployer",
      "accountIndex": 0
    },
    "quick": { "kind": "memory" },
    "hardware": { "kind": "onekey" }
  }
}

The file is automatically gitignored by the setup wizard.

CFX_SIGNER_NAME — override the active signer name without editing the file.

cdk sign reads signer config automatically when CFX_KEYSTORE_PATH is not set.

Install

pnpm add @cfxdevkit/signer-session

Usage

import { createSignerSession } from '@cfxdevkit/signer-session';

// Memory signer (ephemeral)
const mem = await createSignerSession({
  kind: 'memory',
  privateKey: '0x…',
});

// File keystore signer (CI / scripts)
const file = await createSignerSession({
  kind: 'file-keystore',
  path: process.env.CFX_KEYSTORE_PATH!,
  passphrase: process.env.CFX_PASSPHRASE!,
  ref: { service: 'myapp', account: 'deployer' },
  accountIndex: 0,
});

// Hardware signer (OneKey)
const hw = await createSignerSession({
  kind: 'onekey',
  sdk: HardwareSDK,
  connectId,
  deviceId,
});

// Sign messages
const sig = await mem.eSpace.signMessage('Hello');
const coreSig = await mem.core!.signMessage('Hello Core');

API Reference

See API.md for the full public surface.

Tier

Tier 0 — framework — Must not runtime-import from any higher tier.