@faremeter/wallet-evm
@faremeter/wallet-evm turns a raw EVM private key into a wallet compatible with @faremeter/payment-evm. It wraps viem primitives to expose typed signing helpers while validating inputs using @faremeter/types/evm.
Quick start
API surface
createLocalWallet(chain, privateKey)
Returns a Promise<EvmWallet>:
chain:ChainInfo(id, rpcUrls) describing the target network.privateKey: must be a0x-prefixed 64-character hex string. The function throws early if validation fails.
chain: the sameChainInfoyou passed in.address: normalizedHexaccount address.account: viemprivateKeyToAccount(privateKey)result (exposessignTypedData, etc.).client: viemWalletClientbound to the chain’s default RPC URL.
@faremeter/payment-evm/exact.createPaymentHandler and other viem-based utilities.
Usage patterns
- Custom transports: After constructing the wallet you can replace
wallet.clientwith a client built using your own transport (e.g., WebSocket) if needed. - Ledger support: For hardware-backed accounts use
@faremeter/wallet-ledger.createLedgerEvmWallet, which returns an object with the same shape. - Network registry: Keep a central list of
ChainInfoobjects (chain id, name, RPC URL) and reuse them across wallets and facilitators to stay consistent.
Related references
@faremeter/payment-evm: consumes the wallet to sign EIP-3009 authorizations.@faremeter/types/evm: provides theChainInfotype and validation helpers used internally.- Source: GitHub › packages/wallet-evm