Skip to main content

Functions

createLitClient({ network })

Parameters

NagaNetworkModule
required
The network to connect to.

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

Returns

LitNodeSignature Object

executeJs

Execute a Lit Action (JS) on the network.

Parameters

object

Returns

ExecuteJsResponse Object

encrypt

Encrypt data with access control conditions using BLS.

Parameters

object

Returns

EncryptResponse Object

decrypt

Decrypt data previously encrypted with access control conditions.

Parameters

object

Returns

DecryptResponse Object

mintWithEoa

Mint a PKP using an EOA.

Parameters

object

Returns

AuthServerTx<PKPData>

mintWithAuth

Mint a PKP using an authentication method.

Parameters

object

Returns

AuthServerTx<PKPData>

mintWithCustomAuth

Mint a PKP using custom authentication (Lit Action validator or IPFS CID).

Parameters

object

Returns

object

authService.mintWithAuth

Mint a PKP via the Auth Service. Parameters and returns mirror mintWithAuth.

Parameters

object

Returns

AuthServerTx<PKPData>

getPKPPermissionsManager

Create a PKP permissions manager instance.

Parameters

object

Returns

PKPPermissionsManager Object

getPaymentManager

Get a Payment Manager for Ledger contract operations.

Parameters

object

Returns

PaymentManager Object

viewPKPPermissions

View current permissions context for a PKP.

Parameters

{ tokenId?: string; pubkey?: string; address?: string }
required

Returns

object

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

Returns

LitNodeSignature Object

utils.getDerivedKeyId

Resolve the uncompressed PKP public key for a given derived key identifier.

Parameters

string
required
0x-prefixed bytes32 identifier (for example, keccak256(stringToBytes(lit_action_${ipfsCid}))).

Returns

Promise<string>
0x-prefixed uncompressed public key as returned by the PubkeyRouter contract.

Example

Note: this helper currently calls PubkeyRouter.getDerivedPubkey with the default Naga key set (naga-keyset1). See the Derive Lit Action Public Keys guide for an end-to-end workflow.

getChainConfig

Returns the chain configuration for the current network.

Parameters

none

Returns

ChainConfig

disconnect

Stop background state updates and release resources.

Parameters

none

Returns

void