❗️ Currently free on the dev network, so no need to deposit funds. More details coming soon for test and production networks.
💰 Need Test Tokens? Visit the Chronicle Yellowstone Faucet to get test tokens for your EOA account.
See SDK Reference for more details on the Payment Manager. Payment Manager Reference

Overview

The Payment Manager demonstrates Lit Protocol’s payment system - a billing system for decentralised cryptographic services. Users pay for compute resources on the Lit network to access core services like:
  • Encryption/Decryption - Secure data with programmable access control
  • PKP Signing - Cryptographic keys that can sign transactions based on conditions
  • Lit Actions - Serverless functions with cryptographic capabilities
Similar to how you pay AWS for cloud computing, this\system ensures the decentralised network can sustain itself and pay node operators. You can deposit funds, request withdrawals with security delays, and manage balances for yourself or other users (enabling applications to sponsor their users’ costs for better UX).
1

Payment Manager Setup

import { createLitClient } from '@lit-protocol/lit-client';
import { nagaDev } from '@lit-protocol/networks';

// 1. Create lit client
const litClient = await createLitClient({ network: nagaDev });

// 2. Get PaymentManager instance (requires account for transactions)
const paymentManager = await litClient.getPaymentManager({ 
  account: yourAccount // viem account instance
});

2

Create an account

// 1. import the useWalletClient function from wagmi
import { useWalletClient } from 'wagmi';

// 2. Use your connected wallet as the account
const { data: myAccount } = useWalletClient();
3

Deposit funds

  // 1. Deposit funds to your own account
  const result = await paymentManager.deposit({ 
    amountInEth: "0.1" 
  });

  console.log(`Deposit successful: ${result.hash}`);
  // Returns: { hash: string, receipt: object }