Skip to main content

Supported wallets

WalletInstallSelf-custodyNotes
Blinkbuilt-in❌ custodialEasiest setup, GraphQL API
Alby Hubbuilt-in✅ self-hosted optionREST API, supports own Hub
CustomL402Wallet interfaceBring your own wallet

BlinkWallet

Setup

  1. Sign up at blink.sv
  2. Go to Dashboard → API Keys → create a key
  3. Copy your Wallet ID from the dashboard
export BLINK_API_KEY="your-api-key"
export BLINK_WALLET_ID="your-wallet-id"

Node.js

import { BlinkWallet } from "l402-kit";

const wallet = new BlinkWallet(
  process.env.BLINK_API_KEY!,
  process.env.BLINK_WALLET_ID!,
);

Python

from l402kit.wallets import BlinkWallet

wallet = BlinkWallet(
    api_key=os.environ["BLINK_API_KEY"],
    wallet_id=os.environ["BLINK_WALLET_ID"],
)

How it works

Calls the Blink GraphQL API with the lnInvoicePaymentSend mutation. Returns the preImage from the settled transaction.

AlbyWallet

Setup

  1. Create an account at getalby.com
  2. Go to Settings → Access Tokens → create a token with payments:send scope
  3. (Optional) Run your own Alby Hub for self-custody
export ALBY_TOKEN="your-access-token"
# Optional — only needed for self-hosted Hub:
export ALBY_HUB_URL="https://your-hub.example.com"

Node.js

import { AlbyWallet } from "l402-kit";

// Alby cloud
const wallet = new AlbyWallet(process.env.ALBY_TOKEN!);

// Self-hosted Hub
const wallet = new AlbyWallet(
  process.env.ALBY_TOKEN!,
  process.env.ALBY_HUB_URL,  // optional base URL
);

Python

from l402kit.wallets import AlbyWallet

# Alby cloud
wallet = AlbyWallet(os.environ["ALBY_TOKEN"])

# Self-hosted Hub
wallet = AlbyWallet(
    access_token=os.environ["ALBY_TOKEN"],
    base_url=os.environ.get("ALBY_HUB_URL", "https://api.getalby.com"),
)

How it works

Calls POST /payments/bolt11 on the Alby Hub REST API with a Bearer token. Returns the payment_preimage from the response.

Custom wallet

Implement the L402Wallet interface to use any Lightning wallet:
import type { L402Wallet } from "l402-kit";

class PhoenixWallet implements L402Wallet {
  async payInvoice(bolt11: string): Promise<{ preimage: string }> {
    const res = await fetch("http://localhost:9740/payinvoice", {
      method: "POST",
      body: new URLSearchParams({ invoice: bolt11 }),
    });
    const data = await res.json();
    return { preimage: data.paymentPreimage };
  }
}
The interface requires a single method:
MethodTypeScriptPython
Pay a BOLT11 invoicepayInvoice(bolt11): Promise<{ preimage: string }>pay_invoice(bolt11: str) -> str

Choosing a wallet

  • Testing / prototyping → Blink (custodial, instant setup, free tier)
  • Production agent, max control → Alby Hub self-hosted (non-custodial, REST API)
  • High throughput / low fees → Phoenix via custom L402Wallet (non-custodial, ACINQ)
  • Enterprise → LNbits self-hosted via custom wallet