interface ILitNodeClient {
    config: LitNodeClientConfig;
    connectedNodes: Set<string>;
    latestBlockhash: string;
    networkPubKey: string;
    networkPubKeySet: string;
    ready: boolean;
    serverKeys: Record<string, JsonHandshakeResponse>;
    subnetPubKey: string;
    _throwNodeError(res: RejectedNodePromises, requestId: string): never;
    combineSharesAndGetJWT(signatureShares: NodeBlsSigningShare[]): Promise<string>;
    connect(): Promise<any>;
    decrypt(params: DecryptRequest): Promise<DecryptResponse>;
    encrypt(params: EncryptSdkParams): Promise<EncryptResponse>;
    executeJs(params: JsonExecutionSdkParams): Promise<ExecuteJsResponse>;
    generateSessionCapabilityObjectWithWildcards(litResources: ILitResource[]): Promise<ISessionCapabilityObject>;
    getFormattedAccessControlConditions(params: SupportedJsonRequests): FormattedMultipleAccs;
    getHashedAccessControlConditions(params: MultipleAccessControlConditions): Promise<ArrayBuffer>;
    getJWTParams(): {
        exp: number;
        iat: number;
    };
    getNodePromises(callback: Function): Promise<any>[];
    handleNodePromises<T>(nodePromises: Promise<T>[], requestId: string, minNodeCount: number): Promise<RejectedNodePromises | SuccessNodePromises<T>>;
    handshakeWithNode(params: HandshakeWithNode, requestId: string): Promise<NodeCommandServerKeysResponse>;
    sendCommandToNode(__namedParameters: SendNodeCommand): Promise<any>;
    setCustomBootstrapUrls(): void;
}

Implemented by

Properties

connectedNodes: Set<string>
latestBlockhash: string
networkPubKey: string
networkPubKeySet: string
ready: boolean
serverKeys: Record<string, JsonHandshakeResponse>
subnetPubKey: string

Methods

  • we need to send jwt params iat (issued at) and exp (expiration) because the nodes may have different wall clock times, the nodes will verify that these params are withing a grace period

    Returns {
        exp: number;
        iat: number;
    }

    • exp: number
    • iat: number