Functions
createLitClient({ network })
Parameters
NagaNetworkModule
required
The network to connect to.
import { nagaDev } from "@lit-protocol/networks";
const litClient = await createLitClient({ network: nagaDev });
Returns
object
Complete litClient object with all returned methods.
chain.raw.pkpSign
Signs arbitrary bytes with a PKP using the specified signing scheme on the chosen chain.Parameters
object
Show properties
Show properties
string
required
0x‑prefixed PKP public key.
Uint8Array | ArrayLike<number>
required
Bytes to sign. If hashing is enabled, the hash of this payload is signed.
enum
required
Signing scheme to use.
Show allowed values
Show allowed values
string
ECDSA over secp256k1 with SHA‑256 prehash.
string
ECDSA over P‑256 with SHA‑256 prehash.
string
ECDSA over P‑384 with SHA‑384 prehash.
string
Schnorr over Ed25519 with SHA‑512 prehash.
string
Schnorr over secp256k1 with SHA‑256 prehash.
string
Schnorr over P‑256 with SHA‑256 prehash.
string
Schnorr over P‑384 with SHA‑384 prehash.
string
Schnorr over Ristretto25519 with SHA‑512 prehash.
string
Schnorr over Ed448 with SHAKE‑256 prehash.
string
Schnorr over Jubjub (red) with BLAKE2b‑512 prehash.
string
Schnorr over secp256k1 (Taproot) variant.
string
Schnorr over Decaf377 (red) with BLAKE2b‑512 prehash.
string
Schnorrkel (Substrate) variant.
enum
required
AuthenticationContext
required
Authorisation/session context
bigint
Optional maximum price the user is willing to pay for this request.
boolean
Optional. Controls message pre‑hashing before signing.
Show behaviour
Show behaviour
Show auto‑hash mapping (ECDSA)
Show auto‑hash mapping (ECDSA)
Show auto‑hash mapping (FROST)
Show auto‑hash mapping (FROST)
none
No hashing is applied;
toSign is signed as‑is.Returns
LitNodeSignature Object
Show properties
Show properties
string
The final signature for the request.
string
0x‑prefixed verifying (compressed) public key used to produce the signature.
string
0x‑prefixed hex of the exact payload that was signed (post‑hashing if applicable).
number | null
Recovery identifier when applicable to the scheme (0 or 1; may be null).
string
0x‑prefixed PKP public key associated with the signature.
string
The signature type/scheme used
executeJs
Execute a Lit Action (JS) on the network.Parameters
object
Show properties
Show properties
string
Inline JS code to run. Either code or ipfsId must be provided.
string
IPFS CID of a Lit Action to run. Either code or ipfsId must be provided.
any | { publicKey?: string; sigName?: string; ... }
Parameters injected into the Lit Action runtime before execution.
AuthenticationContext
required
Authorisation/session context for node authorisation.
bigint
Optional maximum price the user is willing to pay.
Returns
ExecuteJsResponse Object
encrypt
Encrypt data with access control conditions using BLS.Parameters
object
Show properties
Show properties
string | object | any[] | Uint8Array
required
The data to encrypt. Strings/objects/arrays are internally converted to bytes. Objects/arrays are JSON-stringified first.
string
required
Target chain context for condition evaluation.
ACC[]
Standard access control conditions (ACC). Provide one of ACC, evmContractConditions, solRpcConditions, or unifiedAccessControlConditions.
EVM ACC[]
EVM-specific contract conditions (mutually exclusive with other condition types).
Solana ACC[]
Solana RPC conditions (mutually exclusive with other condition types).
Unified ACC[]
Unified access control conditions (mutually exclusive with other condition types).
object
Optional metadata to describe the data being encrypted.
Returns
EncryptResponse Object
decrypt
Decrypt data previously encrypted with access control conditions.Parameters
object
Show properties
Show properties
EncryptResponse
Optional. Pass the full encrypted object from encrypt(). If omitted, provide fields below individually.
string
Base64-encoded ciphertext (required if data is not provided).
string
SHA-256 hash (hex) of the original plaintext (required if data is not provided).
ACC[]
One of ACC, evmContractConditions, solRpcConditions, or unifiedAccessControlConditions (must match encryption).
EVM ACC[]
Solana ACC[]
Unified ACC[]
string
Target chain context for condition evaluation.
AuthenticationContext
Authorisation/session context for node authorisation.
bigint
Optional maximum price the user is willing to pay for this request.
Returns
DecryptResponse Object
mintWithEoa
Mint a PKP using an EOA.Parameters
object
Show properties
Show properties
Account | WalletClient | Signer
required
The signing account that will perform the mint on-chain.
Returns
AuthServerTx<PKPData>
mintWithAuth
Mint a PKP using an authentication method.Parameters
object
Show properties
Show properties
Account | WalletClient | Signer
required
The signing account that will perform the mint on-chain.
AuthData
required
Auth method payload (e.g., from ViemAccountAuthenticator): includes authMethodType, authMethodId, optional accessToken.
string[] | number[]
required
Permission scopes to attach to the minted PKP.
Returns
mintWithCustomAuth
Mint a PKP using custom authentication (Lit Action validator or IPFS CID).Parameters
object
Show properties
Show properties
Account | WalletClient | Signer
required
The signing account for on-chain operations.
AuthData (without accessToken)
required
Authentication method details used alongside the validation Lit Action.
string
required
Lit Action IPFS CID (must start with “Qm” and be ≥ 46 chars).
'no-permissions' | 'sign-anything' | 'personal-sign'
required
Initial permission scope to grant.
boolean
default:"false"
If true, add the PKP’s own address as a permitted address.
boolean
default:"true"
If true, transfers the PKP to itself after minting.
Returns
object
authService.mintWithAuth
Mint a PKP via the Auth Service. Parameters and returns mirrormintWithAuth.
Parameters
object
Returns
AuthServerTx<PKPData>
getPKPPermissionsManager
Create a PKP permissions manager instance.Parameters
object
Hide properties
Hide properties
object
required
Account | WalletClient | Signer
required
Account used for permission transactions and reads.
Returns
PKPPermissionsManager Object
Hide properties
Hide properties
Promise<LitTxVoid>
Promise<LitTxVoid>
Promise<LitTxVoid>
Promise<LitTxVoid>
Promise<LitTxVoid>
Show params
Show params
string
required
Show example
Show example
await manager.removePermittedAction({ ipfsId: "Qm..." });
Promise<LitTxVoid>
Show params
Show params
string
required
Show example
Show example
await manager.removePermittedAddress({ address: "0xUser..." });
Promise<LitTxVoid>
Promise<LitTxVoid>
Promise<boolean>
Show params
Show params
string
required
Show example
Show example
const ok = await manager.isPermittedAction({ ipfsId: "Qm..." });
Promise<boolean>
Show params
Show params
string
required
Show example
Show example
const ok = await manager.isPermittedAddress({ address: "0xUser..." });
Promise<readonly 0x-hex[]>
Promise<readonly 0x-hex[]>
Promise<readonly AuthMethod[]>
Promise<PermissionsContext>
Returns consolidated permissions (actions, addresses, authMethods).
Promise<void>
Batch perform add/remove operations.
Show example
Show example
await manager.batchUpdatePermissions([
{ type: 'addAddress', address: '0xUser...', scopes: ['sign-anything'] },
{ type: 'addAction', ipfsId: 'Qm...', scopes: ['sign-anything'] },
]);
Promise<void>
Remove all addresses, auth methods, and known test actions.
getPaymentManager
Get a Payment Manager for Ledger contract operations.Parameters
object
Show properties
Show properties
Account | WalletClient | Signer
required
The account used for deposits, withdrawals, and queries.
Returns
PaymentManager Object
Hide properties
Hide properties
Promise<LitTxVoid>
Deposit funds to your own account.
Show params
Show params
string
required
Amount to deposit in ETH (string), internally converted to Wei.
Show example
Show example
await paymentManager.deposit({ amountInEth: "0.1" });
Promise<LitTxVoid>
Promise<PaymentBalance>
Get total and available balances for a user.
Show params
Show params
string
required
Show example
Show example
const bal = await paymentManager.getBalance({ userAddress: "0x..." });
console.log(bal.totalBalance, bal.availableBalance);
Promise<LitTxVoid>
Request withdrawal (starts delay period).
Show params
Show params
string
required
Show example
Show example
await paymentManager.requestWithdraw({ amountInEth: "0.05" });
Promise<LitTxVoid>
Execute withdrawal after delay.
Show params
Show params
string
required
Show example
Show example
await paymentManager.withdraw({ amountInEth: "0.05" });
Promise<WithdrawRequestInfo>
Get current withdrawal request for a user.
Show params
Show params
string
required
Show example
Show example
const info = await paymentManager.getWithdrawRequest({ userAddress: "0x..." });
Promise<{ delaySeconds: string; raw: bigint }>
Get global withdrawal delay in seconds.
Show example
Show example
const delay = await paymentManager.getWithdrawDelay();
Promise<{ canExecute: boolean; timeRemaining?: number; withdrawRequest: WithdrawRequestInfo }>
Check whether a user’s withdrawal can be executed now.
Show params
Show params
string
required
Show example
Show example
const { canExecute, timeRemaining } = await paymentManager.canExecuteWithdraw({ userAddress: "0x..." });
Promise<LitTxVoid>
Delegate payments to a user.
Show params
Show params
string
required
Show example
Show example
await paymentManager.delegatePayments({ userAddress: "0xUser..." });
Promise<LitTxVoid>
Undelegate payments from a user.
Show params
Show params
string
required
Show example
Show example
await paymentManager.undelegatePayments({ userAddress: "0xUser..." });
Promise<LitTxVoid>
Delegate payments to multiple users.
Show params
Show params
string[]
required
Show example
Show example
await paymentManager.delegatePaymentsBatch({ userAddresses: ["0xA...","0xB..."] });
Promise<LitTxVoid>
Undelegate payments from multiple users.
Show params
Show params
string[]
required
Show example
Show example
await paymentManager.undelegatePaymentsBatch({ userAddresses: ["0xA...","0xB..."] });
Promise<LitTxVoid>
Promise<string[]>
List payers for a user.
Show params
Show params
string
required
Show example
Show example
const payers = await paymentManager.getPayers({ userAddress: "0xUser..." });
Promise<string[]>
List users for a payer.
Show params
Show params
string
required
Show example
Show example
const users = await paymentManager.getUsers({ payerAddress: "0xPayer..." });
Promise<{ totalMaxPrice: string; requestsPerPeriod: string; periodSeconds: string; raw: Restriction }>
Get restriction for a payer.
Show params
Show params
string
required
Show example
Show example
const r = await paymentManager.getRestriction({ payerAddress: "0xPayer..." });
Promise<{ payers: string[][]; restrictions: { totalMaxPrice: string; requestsPerPeriod: string; periodSeconds: string; }[][]; raw: { payers: string[][]; restrictions: Restriction[][] } }>
Batch get payers and restrictions for users.
Show params
Show params
string[]
required
Show example
Show example
const res = await paymentManager.getPayersAndRestrictions({ userAddresses: ["0xA...","0xB..."] });
viewPKPPermissions
View current permissions context for a PKP.Parameters
{ tokenId?: string; pubkey?: string; address?: string }
required
Returns
viewPKPsByAddress
List PKPs owned by an address.Parameters
object
Returns
PaginatedPKPsResponse
getPkpViemAccount
Create a Viem-compatible account backed by a PKP.Parameters
object
Returns
Viem Account Object
Show properties
Show properties
functions
Standard Viem account methods that route to PKP signing under the hood.
Returns
LitNodeSignature Object
Show properties
Show properties
string
The final signature for the request.
string
0x‑prefixed verifying (compressed) public key used to produce the signature.
string
0x‑prefixed hex of the exact payload that was signed (post‑hashing if applicable).
number | null
Recovery identifier when applicable to the scheme (0 or 1; may be null).
string
0x‑prefixed PKP public key associated with the signature.
string
The signature type/scheme used (e.g. ECDSA, Schnorr).
getChainConfig
Returns the chain configuration for the current network.Parameters
noneReturns
ChainConfig