npm.io
1.0.3 • Published 2 weeks ago

@cef-ai/wallet-signers

Licence
MIT
Version
1.0.3
Deps
3
Size
36 kB
Vulns
0
Weekly
0

@cef-ai/wallet-signers

Three chain-signer implementations bound to a @cef-ai/wallet-identity session.

Class Curve Use case Address format
PolkadotSigner Ed25519 Polkadot / Cere SS58 SS58 (Cere prefix)
EthersSigner secp256k1 EVM (EIP-191 keccak-prefixed) 0x-prefixed hex address
SolanaSigner Ed25519 Solana base58 (Solana pubkey)

Key material lives in @cef-ai/wallet-identity's session vault — signers never hold private keys themselves. Each signer is constructed with an address and an InternalSign closure that identity hands out for the lifetime of the session.

Quick start

import { PolkadotSigner, EthersSigner, SolanaSigner } from '@cef-ai/wallet-signers';

// `addresses` and `sign` come from `@cef-ai/wallet-identity` after register/login.
const cere = new PolkadotSigner({ address: addresses.cere, sign });
const evm = new EthersSigner({ address: addresses.evm, sign });
const sol = new SolanaSigner({ address: addresses.solana, sign });

const sig = await evm.signMessage('Hello'); // 0x-prefixed RSV signature

EthersSigner is shaped to be drop-in for ethers v5/v6 consumers (getAddress, signMessage); transaction signing is deferred. PolkadotSigner implements the Polkadot.js Signer interface (id-correlated signRaw). SolanaSigner exposes a thin signMessage returning the raw 64-byte Ed25519 signature.

Status

Workspace-internal — not published to npm.