Skip to main content
Each wallet adapter follows the same pattern: install, create, pass to a handler. This page covers setup for every supported wallet type.

Solana local keypair

For local development and server-side agents.
pnpm add @faremeter/wallet-solana @solana/web3.js
import { Keypair } from "@solana/web3.js"
import { createLocalWallet } from "@faremeter/wallet-solana"
import { readFileSync } from "node:fs"

const keypairBytes = JSON.parse(readFileSync("~/.config/solana/id.json", "utf-8"))
const keypair = Keypair.fromSecretKey(new Uint8Array(keypairBytes))
const wallet = await createLocalWallet("devnet", keypair)
The network parameter ("devnet", "testnet", "mainnet-beta") determines which Solana cluster the wallet targets. If the keypair file does not exist or contains invalid data, createLocalWallet throws with a descriptive error.

EVM private key

For local development and server-side agents.
pnpm add @faremeter/wallet-evm
import { createLocalWallet } from "@faremeter/wallet-evm"

const wallet = await createLocalWallet(
  { id: 84532, name: "Base Sepolia" },
  process.env.EVM_PRIVATE_KEY,
)
The first parameter is a ChainInfo object with the chain’s numeric ID and name. The private key should be a hex string starting with 0x. The wallet supports EIP-712 typed signatures used by the EVM payment handler. If the private key is malformed, the factory throws.

Crossmint custodial

For managed wallets where you do not handle private keys directly. Crossmint provides a custodial wallet API.
pnpm add @faremeter/wallet-crossmint
import { createCrossmintWallet } from "@faremeter/wallet-crossmint"

const wallet = await createCrossmintWallet({
  apiKey: process.env.CROSSMINT_API_KEY,
  walletId: process.env.CROSSMINT_WALLET_ID,
})
Currently supports Solana networks.

Squads multisig

For DAOs and shared treasuries using Squads Protocol on Solana.
pnpm add @faremeter/wallet-solana-squads
import { createSquadsWallet } from "@faremeter/wallet-solana-squads"

const wallet = await createSquadsWallet({
  network: "devnet",
  multisigAddress: "...",
  memberKeypair: keypairBytes,
})
Squads wallets create proposals that require approval from other multisig members. The payment flow includes a proposal and approval step before the transaction is submitted.

Ledger hardware

For high-security signing with a Ledger hardware wallet.
pnpm add @faremeter/wallet-ledger
import { createLedgerWallet } from "@faremeter/wallet-ledger"

const wallet = await createLedgerWallet({
  chain: "solana",
  accountIndex: 0,
})
Supports both Solana and EVM chains. The accountIndex selects which account on the Ledger device to use. Requires the Ledger device to be connected and unlocked with the appropriate app open. If the device is not available, the factory throws.

Passing wallets to handlers

All wallets follow the same pattern once created:
import { createPaymentHandler } from "@faremeter/payment-solana/exact"

const handler = createPaymentHandler(wallet, wallet.mint)
The handler uses the wallet to sign payments when a matching 402 requirement is received.

Further reading