Skip to content

Commit 5fa589c

Browse files
committed
fmt
1 parent 2b88caf commit 5fa589c

File tree

4 files changed

+54
-53
lines changed

4 files changed

+54
-53
lines changed

packages/contracts-sdk/src/lib/contracts-sdk.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,6 @@ export class LitContracts {
11291129
});
11301130

11311131
const networks = activeValidatorStructs.map((item: ValidatorStruct) => {
1132-
11331132
// Convert the integer IP to a string format
11341133
const ip = intToIP(item.ip);
11351134
const port = item.port;

packages/core/src/lib/lit-core.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ export class LitCore {
390390

391391
/**
392392
* Gets the set of nodes from validator data, transforming bootstrap URLs into NodeSet objects.
393-
*
393+
*
394394
* @returns {Promise<NodeSet[]>} A promise that resolves with an array of NodeSet objects.
395395
*/
396396
protected _getNodeSet = async (): Promise<NodeSet[]> => {
@@ -699,9 +699,11 @@ export class LitCore {
699699
await Promise.race([
700700
new Promise((_resolve, reject) => {
701701
timeoutHandle = setTimeout(() => {
702-
const msg = `Error: Could not handshake with nodes after timeout of ${this.config.connectTimeout
703-
}ms. Could only connect to ${Object.keys(serverKeys).length} of ${this.config.bootstrapUrls.length
704-
} nodes. Please check your network connection and try again. Note that you can control this timeout with the connectTimeout config option which takes milliseconds.`;
702+
const msg = `Error: Could not handshake with nodes after timeout of ${
703+
this.config.connectTimeout
704+
}ms. Could only connect to ${Object.keys(serverKeys).length} of ${
705+
this.config.bootstrapUrls.length
706+
} nodes. Please check your network connection and try again. Note that you can control this timeout with the connectTimeout config option which takes milliseconds.`;
705707

706708
try {
707709
throw new InitError({}, msg);
@@ -1029,8 +1031,8 @@ export class LitCore {
10291031
this._epochCache.currentNumber &&
10301032
this._epochCache.startTime &&
10311033
Math.floor(Date.now() / 1000) <
1032-
this._epochCache.startTime +
1033-
Math.floor(EPOCH_PROPAGATION_DELAY / 1000) &&
1034+
this._epochCache.startTime +
1035+
Math.floor(EPOCH_PROPAGATION_DELAY / 1000) &&
10341036
this._epochCache.currentNumber >= 3 // FIXME: Why this check?
10351037
) {
10361038
return this._epochCache.currentNumber - 1;
@@ -1061,7 +1063,7 @@ export class LitCore {
10611063
data,
10621064
requestId,
10631065
}: // eslint-disable-next-line @typescript-eslint/no-explicit-any
1064-
SendNodeCommand): Promise<any> => {
1066+
SendNodeCommand): Promise<any> => {
10651067
// FIXME: Replace <any> usage with explicit, strongly typed handlers
10661068
data = { ...data, epoch: this.currentEpochNumber };
10671069

packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ import type {
136136

137137
export class LitNodeClientNodeJs
138138
extends LitCore
139-
implements LitClientSessionManager, ILitNodeClient {
139+
implements LitClientSessionManager, ILitNodeClient
140+
{
140141
defaultAuthCallback?: (authSigParams: AuthCallbackParams) => Promise<AuthSig>;
141142

142143
// ========== Constructor ==========
@@ -871,7 +872,7 @@ export class LitNodeClientNodeJs
871872
const reqBody: JsonExecutionRequest = {
872873
...formattedParams,
873874
authSig: sessionSig,
874-
nodeSet
875+
nodeSet,
875876
};
876877

877878
const urlWithPath = composeLitUrl({
@@ -1163,10 +1164,10 @@ export class LitNodeClientNodeJs
11631164
// -- optional params
11641165
...(params.authMethods &&
11651166
params.authMethods.length > 0 && {
1166-
authMethods: params.authMethods,
1167-
}),
1167+
authMethods: params.authMethods,
1168+
}),
11681169

1169-
nodeSet
1170+
nodeSet,
11701171
};
11711172

11721173
logWithRequestId(requestId, 'reqBody:', reqBody);
@@ -1892,8 +1893,8 @@ export class LitNodeClientNodeJs
18921893
const sessionCapabilityObject = params.sessionCapabilityObject
18931894
? params.sessionCapabilityObject
18941895
: await this.generateSessionCapabilityObjectWithWildcards(
1895-
params.resourceAbilityRequests.map((r) => r.resource)
1896-
);
1896+
params.resourceAbilityRequests.map((r) => r.resource)
1897+
);
18971898
const expiration = params.expiration || LitNodeClientNodeJs.getExpiration();
18981899

18991900
// -- (TRY) to get the wallet signature
@@ -1975,10 +1976,10 @@ export class LitNodeClientNodeJs
19751976

19761977
const capabilities = params.capacityDelegationAuthSig
19771978
? [
1978-
...(params.capabilityAuthSigs ?? []),
1979-
params.capacityDelegationAuthSig,
1980-
authSig,
1981-
]
1979+
...(params.capabilityAuthSigs ?? []),
1980+
params.capacityDelegationAuthSig,
1981+
authSig,
1982+
]
19821983
: [...(params.capabilityAuthSigs ?? []), authSig];
19831984

19841985
// This is the template that will be combined with the node address as a single object, then signed by the session key

packages/types/src/lib/interfaces.ts

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export interface JsonPkpSignSdkParams extends BaseJsonPkpSignRequest {
251251
*/
252252
export interface JsonPkpSignRequest
253253
extends BaseJsonPkpSignRequest,
254-
NodeSetRequired {
254+
NodeSetRequired {
255255
authSig: AuthSig;
256256

257257
/**
@@ -280,7 +280,6 @@ export interface JsonSignChainDataRequest {
280280
// Naga V8: Selected Nodes for ECDSA endpoints #1223
281281
// https://github.com/LIT-Protocol/lit-assets/pull/1223/
282282
export interface NodeSet {
283-
284283
// reference: https://github.com/LIT-Protocol/lit-assets/blob/f82b28e83824a861547307aaed981a6186e51d48/rust/lit-node/common/lit-node-testnet/src/node_collection.rs#L185-L191
285284
// eg: 192.168.0.1:8080
286285
socketAddress: string;
@@ -297,8 +296,8 @@ export interface NodeSetRequired {
297296

298297
export interface JsonSignSessionKeyRequestV1
299298
extends Pick<LitActionSdkParams, 'jsParams'>,
300-
Pick<LitActionSdkParams, 'litActionIpfsId'>,
301-
NodeSetRequired {
299+
Pick<LitActionSdkParams, 'litActionIpfsId'>,
300+
NodeSetRequired {
302301
sessionKey: string;
303302
authMethods: AuthMethod[];
304303
pkpPublicKey?: string;
@@ -482,7 +481,7 @@ export interface JsonExecutionSdkParamsTargetNode
482481

483482
export interface JsonExecutionSdkParams
484483
extends Pick<LitActionSdkParams, 'jsParams'>,
485-
ExecuteJsAdvancedOptions {
484+
ExecuteJsAdvancedOptions {
486485
/**
487486
* JS code to run on the nodes
488487
*/
@@ -528,7 +527,7 @@ export interface JsonExecutionRequestTargetNode extends JsonExecutionRequest {
528527

529528
export interface JsonExecutionRequest
530529
extends Pick<LitActionSdkParams, 'jsParams'>,
531-
NodeSetRequired {
530+
NodeSetRequired {
532531
authSig: AuthSig;
533532

534533
/**
@@ -559,7 +558,7 @@ export interface SessionSigsOrAuthSig {
559558

560559
export interface DecryptRequestBase
561560
extends SessionSigsOrAuthSig,
562-
MultipleAccessControlConditions {
561+
MultipleAccessControlConditions {
563562
/**
564563
* The chain name of the chain that this contract is deployed on. See LIT_CHAINS for currently supported chains.
565564
*/
@@ -605,7 +604,7 @@ export interface EncryptFileRequest extends DecryptRequestBase {
605604
file: AcceptedFileType;
606605
}
607606

608-
export interface DecryptRequest extends EncryptResponse, DecryptRequestBase { }
607+
export interface DecryptRequest extends EncryptResponse, DecryptRequestBase {}
609608

610609
export interface DecryptResponse {
611610
// The decrypted data as a Uint8Array
@@ -627,10 +626,10 @@ export interface SigResponse {
627626

628627
export interface ExecuteJsResponseBase {
629628
signatures:
630-
| {
631-
sig: SigResponse;
632-
}
633-
| any;
629+
| {
630+
sig: SigResponse;
631+
}
632+
| any;
634633
}
635634

636635
/**
@@ -660,7 +659,7 @@ export interface ExecuteJsNoSigningResponse extends ExecuteJsResponseBase {
660659
logs: string;
661660
}
662661

663-
export interface LitNodePromise { }
662+
export interface LitNodePromise {}
664663

665664
export interface SendNodeCommand {
666665
url: string;
@@ -669,10 +668,10 @@ export interface SendNodeCommand {
669668
}
670669
export interface SigShare {
671670
sigType:
672-
| 'BLS'
673-
| 'K256'
674-
| 'ECDSA_CAIT_SITH' // Legacy alias of K256
675-
| 'EcdsaCaitSithP256';
671+
| 'BLS'
672+
| 'K256'
673+
| 'ECDSA_CAIT_SITH' // Legacy alias of K256
674+
| 'EcdsaCaitSithP256';
676675

677676
signatureShare: string;
678677
shareIndex?: number;
@@ -1117,7 +1116,7 @@ export interface CommonGetSessionSigsProps {
11171116

11181117
export interface BaseProviderGetSessionSigsProps
11191118
extends CommonGetSessionSigsProps,
1120-
LitActionSdkParams {
1119+
LitActionSdkParams {
11211120
/**
11221121
* This is a callback that will be used to generate an AuthSig within the session signatures. It's inclusion is required, as it defines the specific resources and abilities that will be allowed for the current session.
11231122
*/
@@ -1126,7 +1125,7 @@ export interface BaseProviderGetSessionSigsProps
11261125

11271126
export interface GetSessionSigsProps
11281127
extends CommonGetSessionSigsProps,
1129-
LitActionSdkParams {
1128+
LitActionSdkParams {
11301129
/**
11311130
* This is a callback that will be used to generate an AuthSig within the session signatures. It's inclusion is required, as it defines the specific resources and abilities that will be allowed for the current session.
11321131
*/
@@ -1621,7 +1620,7 @@ export interface BaseProviderSessionSigsParams {
16211620
resourceAbilityRequests?: LitResourceAbilityRequest[];
16221621
}
16231622

1624-
export interface BaseAuthenticateOptions { }
1623+
export interface BaseAuthenticateOptions {}
16251624

16261625
export interface EthWalletAuthenticateOptions extends BaseAuthenticateOptions {
16271626
/**
@@ -1687,9 +1686,9 @@ export interface MintCapacityCreditsPerKilosecond
16871686
}
16881687
export interface MintCapacityCreditsContext
16891688
extends MintCapacityCreditsPerDay,
1690-
MintCapacityCreditsPerSecond,
1691-
MintCapacityCreditsPerKilosecond,
1692-
GasLimitParam { }
1689+
MintCapacityCreditsPerSecond,
1690+
MintCapacityCreditsPerKilosecond,
1691+
GasLimitParam {}
16931692
export interface MintCapacityCreditsRes {
16941693
rliTxHash: string;
16951694
capacityTokenId: any;
@@ -1812,12 +1811,12 @@ export interface LitActionSdkParams {
18121811
* An object that contains params to expose to the Lit Action. These will be injected to the JS runtime before your code runs, so you can use any of these as normal variables in your Lit Action.
18131812
*/
18141813
jsParams?:
1815-
| {
1816-
[key: string]: any;
1817-
publicKey?: string;
1818-
sigName?: string;
1819-
}
1820-
| any;
1814+
| {
1815+
[key: string]: any;
1816+
publicKey?: string;
1817+
sigName?: string;
1818+
}
1819+
| any;
18211820
}
18221821

18231822
export interface LitEndpoint {
@@ -1839,7 +1838,7 @@ export interface SignerLike {
18391838

18401839
export interface GetPkpSessionSigs
18411840
extends CommonGetSessionSigsProps,
1842-
LitActionSdkParams {
1841+
LitActionSdkParams {
18431842
pkpPublicKey: string;
18441843

18451844
/**
@@ -1865,11 +1864,11 @@ export type GetLitActionSessionSigs = CommonGetSessionSigsProps &
18651864
Pick<Required<LitActionSdkParams>, 'jsParams'> &
18661865
(
18671866
| (Pick<Required<LitActionSdkParams>, 'litActionCode'> & {
1868-
litActionIpfsId?: never;
1869-
})
1867+
litActionIpfsId?: never;
1868+
})
18701869
| (Pick<Required<LitActionSdkParams>, 'litActionIpfsId'> & {
1871-
litActionCode?: never;
1872-
})
1870+
litActionCode?: never;
1871+
})
18731872
) & {
18741873
ipfsOptions?: IpfsOptions;
18751874
};

0 commit comments

Comments
 (0)