A base class that can be shared between Ethers and Cosmos signers.

Type Parameters

Hierarchy

  • PKPBase

Constructors

Properties

PREFIX: string = '[PKPBase]'
authContext?: AuthenticationProps
compressedPubKey: string
compressedPubKeyBuffer: Uint8Array
controllerAuthMethods?: AuthMethod[]
controllerAuthSig?: AuthSig
controllerSessionSigs?: SessionSigsMap
debug: boolean
litActionCode?: string
litActionIPFS?: string
litActionJsParams: T
litNodeClient: LitNodeClient
orange: string = '\x1b[33m'
red: string = '\x1b[31m'
reset: string = '\x1b[0m'
rpcs?: RPCUrls
uncompressedPubKey: string
uncompressedPubKeyBuffer: Uint8Array
useAction: boolean

Accessors

Methods

  • Ensures that the LitNode client is ready for use by waiting for initialization if necessary. If the client is already ready, this function does nothing.

    Returns

    • A Promise that resolves when the LitNode client is ready for use.

    Returns Promise<void>

  • Logs the provided arguments to the console, but only if debugging is enabled.

    Returns

    • This function does not return a value.

    Parameters

    • Rest ...args: any[]

      The values to be logged to the console.

    Returns void

  • Runs the specified Lit action with the given parameters.

    Returns

    • A Promise that resolves with the signature returned by the Lit action.

    Throws

    • Throws an error if pkpPubKey is not provided, if controllerAuthSig or controllerSessionSigs is not provided, if controllerSessionSigs is not an object, if executeJsArgs does not have either code or ipfsId, or if an error occurs during the execution of the Lit action.

    Parameters

    • toSign: Uint8Array

      The data to be signed by the Lit action.

    • sigName: string

      The name of the signature to be returned by the Lit action.

    Returns Promise<any>

  • Sign the provided data with the PKP private key.

    Returns

    • A Promise that resolves with the signature of the provided data.

    Throws

    • Throws an error if pkpPubKey is not provided, if controllerAuthSig or controllerSessionSigs is not provided, if controllerSessionSigs is not an object, or if an error occurs during the signing process.

    Parameters

    • toSign: Uint8Array

      The data to be signed.

    Returns Promise<SigResponse>

  • Sets the Lit action to be executed by the LitNode client.

    Returns

    • If both litActionCode and litActionIPFS are present, throws an Error. Otherwise, does not return a value.

    Parameters

    • pkpBaseProp: PKPBaseProp

      An object containing the parameters for the Lit action.

    Returns void

  • A function that sets the value of the litActionJsParams property to the given params object.

    Returns

    Type Parameters

    • CustomType = T

      A generic type that extends T, where T is the type of the litActionJsParams property.

    Parameters

    • params: CustomType

      An object of type CustomType that contains the parameters to be set as litActionJsParams.

    Returns void

  • Logs an error message to the console and throws an Error with the same message.

    Returns

    • This function does not return a value since it always throws an Error.

    Parameters

    • message: string

      The error message to be logged and thrown.

    Returns never

Generated using TypeDoc