Optional
cosmosCosmos wallet type, to support mutliple popular cosmos wallets Keplr & Cypher -> window.keplr Leap -> window.leap
Optional
expirationOptional
jsAn object that contains params to expose to the Lit Action. These will be injected to the JS runtime before your code runs, so you can use any of these as normal variables in your Lit Action.
Optional
litThe litActionCode is the JavaScript code that will run on the nodes. You will need to convert the string content to base64.
Optional
litYou can obtain the Lit Action IPFS CID by converting your JavaScript code using this tool: https://explorer.litprotocol.com/create-action
Note: You do not need to pin your code to IPFS necessarily. You can convert a code string to an IPFS hash using the "ipfs-hash-only" or 'ipfs-unixfs-importer' library.
async function stringToIpfsHash(input: string): Promise<string> {
// Convert the input string to a Buffer
const content = Buffer.from(input);
// Import the content to create an IPFS file
const files = importer([{ content }], {} as any, { onlyHash: true });
// Get the first (and only) file result
const result = (await files.next()).value;
const ipfsHash = (result as any).cid.toString();
if (!ipfsHash.startsWith('Qm')) {
throw new Error('Generated hash does not start with Qm');
}
return ipfsHash;
}
The blockhash that the nodes return during the handshake
Optional
resourceOptional
resourcesOptional and only used with EVM chains. A list of resources to be passed to Sign In with Ethereum. These resources will be part of the Sign in with Ethereum signed message presented to the user.
Optional
sessionThe serialized session key pair to sign. If not provided, a session key pair will be fetched from localStorge or generated.
Optional
statementThe statement that describes what the user is signing. If the auth callback is for signing a SIWE message, you MUST add this statement to the end of the SIWE statement.
Optional
switchOptional and only used with EVM chains right now. Set to true by default. Whether or not to ask Metamask or the user's wallet to switch chains before signing. This may be desired if you're going to have the user send a txn on that chain. On the other hand, if all you care about is the user's wallet signature, then you probably don't want to make them switch chains for no reason. Pass false here to disable this chain switching behavior.
Optional
uriOptional
walletOptional project ID for WalletConnect V2. Only required if one is using checkAndSignAuthMessage and wants to display WalletConnect as an option.
The chain you want to use. Find the supported list of chains here: https://developer.litprotocol.com/docs/supportedChains