api: {
    batchGeneratePrivateKeys: ((params: BatchGeneratePrivateKeysParams) => Promise<BatchGeneratePrivateKeysResult>);
    exportPrivateKey: ((params: ExportPrivateKeyParams) => Promise<ExportPrivateKeyResult>);
    generatePrivateKey: ((params: GeneratePrivateKeyParams) => Promise<GeneratePrivateKeyResult>);
    getEncryptedKey: ((params: GetEncryptedKeyDataParams) => Promise<StoredKeyData>);
    importPrivateKey: ((params: ImportPrivateKeyParams) => Promise<ImportPrivateKeyResult>);
    listEncryptedKeyMetadata: ((params: BaseApiParams) => Promise<StoredKeyMetadata[]>);
    signMessageWithEncryptedKey: ((params: SignMessageWithEncryptedKeyParams) => Promise<string>);
    signTransactionWithEncryptedKey: ((params: SignTransactionWithEncryptedKeyParams) => Promise<string>);
    storeEncryptedKey: ((params: StoreEncryptedKeyParams) => Promise<StoreEncryptedKeyResult>);
    storeEncryptedKeyBatch: ((params: StoreEncryptedKeyBatchParams) => Promise<StoreEncryptedKeyBatchResult>);
} = ...

Type declaration

  • batchGeneratePrivateKeys: ((params: BatchGeneratePrivateKeysParams) => Promise<BatchGeneratePrivateKeysResult>)
      • (params: BatchGeneratePrivateKeysParams): Promise<BatchGeneratePrivateKeysResult>
      • TODO: Document batch behaviour

        Returns

        • The generated keys and, optionally, signed messages

        Parameters

        • params: BatchGeneratePrivateKeysParams

          Parameters to use for generating keys and optionally signing messages

        Returns Promise<BatchGeneratePrivateKeysResult>

  • exportPrivateKey: ((params: ExportPrivateKeyParams) => Promise<ExportPrivateKeyResult>)
      • (params: ExportPrivateKeyParams): Promise<ExportPrivateKeyResult>
      • Exports a previously persisted private key from the wrapped keys service for direct use by the caller, along with the keys metadata. This method fetches the encrypted key from the wrapped keys service, then executes a Lit Action that decrypts the key inside the LIT action and removes the salt from the decrypted key.

        Returns

        • The decrypted private key of the Wrapped Key along with all the associated key info and LIT PKP Address associated with the Wrapped Key

        Parameters

        Returns Promise<ExportPrivateKeyResult>

  • generatePrivateKey: ((params: GeneratePrivateKeyParams) => Promise<GeneratePrivateKeyResult>)
      • (params: GeneratePrivateKeyParams): Promise<GeneratePrivateKeyResult>
      • Generates a random private key inside a Lit Action, and persists the key and its metadata to the wrapped keys service. Returns the public key of the random private key, and the PKP address that it was associated with. We don't return the generated wallet address since it can be derived from the publicKey

        The key will be associated with the PKP address embedded in the pkpSessionSigs you provide. One and only one wrapped key can be associated with a given LIT PKP.

        Returns

        • The publicKey of the generated random private key and the LIT PKP Address associated with the Wrapped Key

        Parameters

        Returns Promise<GeneratePrivateKeyResult>

  • getEncryptedKey: ((params: GetEncryptedKeyDataParams) => Promise<StoredKeyData>)
      • (params: GetEncryptedKeyDataParams): Promise<StoredKeyData>
      • Get a previously encrypted and persisted private key and its metadata. Note that this method does not decrypt the private key; only the encrypted key and its metadata will be returned to the caller.

        Returns

        The encrypted private key and its associated metadata

        Parameters

        Returns Promise<StoredKeyData>

  • importPrivateKey: ((params: ImportPrivateKeyParams) => Promise<ImportPrivateKeyResult>)
      • (params: ImportPrivateKeyParams): Promise<ImportPrivateKeyResult>
      • Import a provided private key into the wrapped keys service backend. First, the key is pre-pended with LIT_PREFIX for security reasons, then the salted key is encrypted and stored in the backend service. The key will be associated with the PKP address embedded in the pkpSessionSigs you provide. One and only one wrapped key can be associated with a given LIT PKP.

        Returns

        • The LIT PKP Address associated with the Wrapped Key

        Parameters

        • params: ImportPrivateKeyParams

          The parameters required to import the private key into the wrapped keys backend service

        Returns Promise<ImportPrivateKeyResult>

  • listEncryptedKeyMetadata: ((params: BaseApiParams) => Promise<StoredKeyMetadata[]>)
      • (params: BaseApiParams): Promise<StoredKeyMetadata[]>
      • Get list of metadata for previously encrypted and persisted private keys Note that this method does include the ciphertext or dataToEncryptHash values necessary to decrypt the keys. To get those values, call getEncryptedKey() with the id for the appropriate key returned by this method.

        Returns

        The encrypted private key and its associated metadata

        Parameters

        • params: BaseApiParams

          Parameters required to fetch the encrypted private key metadata

        Returns Promise<StoredKeyMetadata[]>

  • signMessageWithEncryptedKey: ((params: SignMessageWithEncryptedKeyParams) => Promise<string>)
      • (params: SignMessageWithEncryptedKeyParams): Promise<string>
      • Signs a message inside the Lit Action using the previously persisted wrapped key associated with the current LIT PK. This method fetches the encrypted key from the wrapped keys service, then executes a Lit Action that decrypts the key inside the LIT action and uses the decrypted key to sign the provided transaction

        Returns

        • The signed message

        Parameters

        Returns Promise<string>

  • signTransactionWithEncryptedKey: ((params: SignTransactionWithEncryptedKeyParams) => Promise<string>)
      • (params: SignTransactionWithEncryptedKeyParams): Promise<string>
      • Signs a transaction inside the Lit Action using the previously persisted wrapped key associated with the current LIT PK. This method fetches the encrypted key from the wrapped keys service, then executes a Lit Action that decrypts the key inside the LIT action and uses the decrypted key to sign the provided transaction Optionally, if you pass broadcast: true, the LIT action will also submit the signed transaction to the associated RPC endpoint on your behalf

        Returns

        The signed transaction OR its transaction hash if you set broadcast: true and the LIT action supports this functionality.

        Parameters

        Returns Promise<string>

  • storeEncryptedKey: ((params: StoreEncryptedKeyParams) => Promise<StoreEncryptedKeyResult>)
  • storeEncryptedKeyBatch: ((params: StoreEncryptedKeyBatchParams) => Promise<StoreEncryptedKeyBatchResult>)

Generated using TypeDoc