UNPKG

lit-wrapper-sdk

Version:
68 lines (67 loc) 4.61 kB
import { LIT_NETWORKS_KEYS } from "@lit-protocol/types"; import * as ethers from "ethers"; import { PKP, WK, AddPermittedActionParams, UploadViaPinataParams, CreatePKPWithLitActionParams, ExecuteLitActionParams, ConditionalSigningOnSolanaParams, ExecuteCustomActionOnSolanaParams, CreateSerializedLitTxnParams, SendSolanaWKTxnWithSolParams, SendSolanaWKTxnWithCustomTokenParams, TestLitActionParams, FlagForLitTxn, GetDecipheringDetailsParams, ExecuteSolanaAgentKitParams, RemovePermittedActionParams } from "./types.js"; declare class LitWrapper { private litNodeClient; private litNetwork; private pkp; private wk; constructor(litNetwork: LIT_NETWORKS_KEYS); createPKP(userPrivateKey: string): Promise<{ tokenId: any; publicKey: string; ethAddress: string; } | undefined>; addAuthAddress(userPrivateKey: string, pkpTokenId: string, ethAddress: string): Promise<ethers.ethers.ContractReceipt>; removeAuthAddress(userPrivateKey: string, pkpTokenId: string, ethAddress: string): Promise<ethers.ethers.ContractTransaction>; addPermittedAction({ userPrivateKey, pkpTokenId, litActionCode, pinataAPIKey, }: AddPermittedActionParams): Promise<{ ipfsCID: any; response: ethers.ethers.ContractReceipt; }>; removePermittedAction({ userPrivateKey, pkpTokenId, ipfsCID, }: RemovePermittedActionParams): Promise<ethers.ethers.ContractTransaction>; checkPermits(pkpTokenId: string): Promise<{ actions: string[]; authMethods: import("@lit-protocol/contracts-sdk/src/abis/PKPPermissions.sol/PKPPermissions.js").LibPKPPermissionsStorage.AuthMethodStructOutput[]; addresses: string[]; }>; createPKPWithLitAction({ userPrivateKey, litActionCode, pinataAPIKey, }: CreatePKPWithLitActionParams): Promise<{ pkp: PKP; ipfsCID: Promise<{ ipfsCID: any; response: ethers.ethers.ContractReceipt; }>; }>; createPKPSessionSigs(userPrivateKey: string, pkpPublicKey: string): Promise<import("@lit-protocol/types").SessionSigsMap | undefined>; getSessionSigs(userPrivateKey: string, pkpPublicKey: string, type: string): Promise<import("@lit-protocol/types").SessionSigsMap>; executeLitAction({ userPrivateKey, pkpPublicKey, litActionIpfsCid, litActionCode, params, }: ExecuteLitActionParams): Promise<import("@lit-protocol/types").ExecuteJsResponse | undefined>; getDecipheringDetails({ userPrivateKey, pkp, wk, }: GetDecipheringDetailsParams): Promise<{ ciphertext: string; dataToEncryptHash: string; }>; uploadViaPinata({ pinataAPIKey, litActionCode, }: UploadViaPinataParams): Promise<any>; createSolanaWK(userPrivateKey: string): Promise<{ pkpInfo: PKP; wkInfo: WK; } | undefined>; getConditionalLitAction(conditionalLogic: string): Promise<string>; conditionalSigningOnSolana({ userPrivateKey, litTransaction, broadcastTransaction, conditionalLogic, pkp, wk, params, }: ConditionalSigningOnSolanaParams): Promise<import("@lit-protocol/types").ExecuteJsResponse | undefined>; executeCustomActionOnSolana({ userPrivateKey, litActionCode, pkp, wk, params, }: ExecuteCustomActionOnSolanaParams): Promise<import("@lit-protocol/types").ExecuteJsResponse | undefined>; executeSolanaAgentKit({ userPrivateKey, MESSAGE, RPC_URL, OPENAI_API_KEY, pkp, wk, }: ExecuteSolanaAgentKitParams): Promise<import("@lit-protocol/types").ExecuteJsResponse | undefined>; sendSolanaWKTxnWithSol({ amount, toAddress, network, broadcastTransaction, userPrivateKey, wk, pkp, }: SendSolanaWKTxnWithSolParams): Promise<string | undefined>; sendSolanaWKTxnWithCustomToken({ tokenMintAddress, amount, toAddress, network, broadcastTransaction, userPrivateKey, wk, pkp, }: SendSolanaWKTxnWithCustomTokenParams): Promise<string | undefined>; createSerializedLitTxn({ toAddress, amount, network, flag, tokenMintAddress, wk, }: CreateSerializedLitTxnParams): Promise<{ serializedTransaction: string; chain: import("@solana/web3.js").Cluster; } | undefined>; } declare class LitTester { litNetwork: LIT_NETWORKS_KEYS; pkp: PKP | null; userPrivateKey: any; initialized: boolean; constructor(userPrivateKey: string, litNetwork: LIT_NETWORKS_KEYS); static init(userPrivateKey: string, litNetwork: LIT_NETWORKS_KEYS): Promise<LitTester>; initializePKP(): Promise<void>; testLitAction({ litActionCode, params }: TestLitActionParams): Promise<import("@lit-protocol/types").ExecuteJsResponse | undefined>; } export { LitWrapper, LitTester, FlagForLitTxn };