Hierarchy

Constructors

Properties

_blockHashUrl: string = 'https://block-indexer.litgateway.com/get_most_recent_valid_block'
_connectingPromise: Promise<void> = null
_epochCache: EpochCache = ...
_networkSyncInterval: Timeout = null
_stakingContract: Contract = null
_stakingContractListener: Listener = null
connectedNodes: any = ...
hdRootPubkeys: string[] = null
lastBlockHashRetrieved: number = null
latestBlockhash: string = null
networkPubKey: string = null
networkPubKeySet: string = null
ready: boolean = false
serverKeys: Record<string, JsonHandshakeResponse> = {}
subnetPubKey: string = null

Accessors

  • set _epochState(__namedParameters: Pick<EpochCache, "startTime" | "currentNumber">): void
  • Parameters

    • __namedParameters: Pick<EpochCache, "startTime" | "currentNumber">

    Returns void

Methods

  • Retrieves the validator data including staking contract, epoch, minNodeCount, and bootstrapUrls.

    Returns

    An object containing the validator data.

    Throws

    Error if minNodeCount is not provided, is less than or equal to 0, or if bootstrapUrls are not available.

    Returns Promise<{
        bootstrapUrls: string[];
        epochInfo: EpochInfo;
        minNodeCount: number;
        stakingContract: Contract;
    }>

  • Sets up a listener to detect state changes (new epochs) in the staking contract. When a new epoch is detected, it triggers the setNewConfig function to update the client's configuration based on the new state of the network. This ensures that the client's configuration is always in sync with the current state of the staking contract.

    Returns

    A promise that resolves when the listener is successfully set up.

    Returns void

  • Private

    Handshakes with all nodes that are in bootstrapUrls

    Returns

    Returns a set of the urls of nodes that we successfully connected to, an object containing their returned keys, and our 'core' config (most common values for critical values)

    Returns Promise<{
        connectedNodes: Set<string>;
        coreNodeConfig: CoreNodeConfig;
        serverKeys: Record<string, JsonHandshakeResponse>;
    }>

  • Calculates a Key Id for claiming a pkp based on a user identifier and an app identifier. The key Identifier is an Auth Method Id which scopes the key uniquely to a specific application context. These identifiers are specific to each auth method and will derive the public key portion of a pkp which will be persisted when a key is claimed.

    Auth Method User ID App ID
    Google OAuth token sub token aud
    Discord OAuth user id client app identifier
    Stytch OTP token sub token aud
    Lit Actions user defined ipfs cid
    Note Lit Action claiming uses a different schema than other auth methods

    Returns

    public key of pkp when claimed

    Parameters

    • userId: string

      user identifier for the Key Identifier

    • appId: string

      app identifier for the Key Identifier

    • isForActionContext: boolean = false

      should be set for true if using claiming through actions

    Returns string

  • Calculates an HD public key from a given keyId The curve type or signature type is assumed to be k256 unless provided

    Returns

    public key

    Parameters

    • keyId: string
    • sigType: LIT_CURVE = LIT_CURVE.EcdsaCaitSith

    Returns string

  • Stops internal listeners/polling that refresh network state and watch for epoch changes. Removes global objects created internally

    Returns Promise<void>

  • Get and gather node promises

    Returns

    Parameters

    • callback: ((url: string) => Promise<any>)
        • (url: string): Promise<any>
        • Parameters

          • url: string

          Returns Promise<any>

    Returns Promise<any>[]

  • Get a random hex string for use as an attestation challenge

    Returns

    Parameters

    • size: number

    Returns string

  • Parameters

    • callback: ((url: string) => Promise<any>)
        • (url: string): Promise<any>
        • Parameters

          • url: string

          Returns Promise<any>

    Returns Promise<any>[]

  • Retrieves the session signature for a given URL from the sessionSigs map. Throws an error if sessionSigs is not provided or if the session signature for the URL is not found.

    Returns

    The session signature for the given URL.

    Throws

    An error if sessionSigs is not provided or if the session signature for the URL is not found.

    Parameters

    Returns AuthSig

Generated using TypeDoc