Skip to content

Commit 1e7ceb1

Browse files
author
Bean
authored
Merge pull request #492 from LIT-Protocol/revert/pr-482
Revert "Merge pull request #482 from LIT-Protocol/feature/lit-3139-id…
2 parents 2a609a4 + b595a2a commit 1e7ceb1

File tree

38 files changed

+1889
-1574
lines changed

38 files changed

+1889
-1574
lines changed

cypress/e2e/spec.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ describe('Lit Action', () => {
549549
url: 'https://cayenne.litgateway.com:7371/web/execute',
550550
data,
551551
};
552-
const res = await savedParams.litNodeClient._sendCommandToNode(reqBody);
552+
const res = await savedParams.litNodeClient.sendCommandToNode(reqBody);
553553
expect(res).to.have.property('success', true);
554554
});
555555

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
33
"useNx": true,
44
"useWorkspaces": true,
5-
"version": "6.0.0"
5+
"version": "6.0.1"
66
}

packages/access-control-conditions/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"tags": [
2222
"universal"
2323
],
24-
"version": "6.0.0",
24+
"version": "6.0.0-tslib-test",
2525
"main": "./dist/src/index.js",
2626
"typings": "./dist/src/index.d.ts"
27-
}
27+
}

packages/auth-browser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"tags": [
3131
"browser"
3232
],
33-
"version": "6.0.0",
33+
"version": "6.0.0-tslib-test",
3434
"main": "./dist/src/index.js",
3535
"typings": "./dist/src/index.d.ts"
36-
}
36+
}

packages/auth-helpers/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"crypto": false,
2929
"stream": false
3030
},
31-
"version": "6.0.0",
31+
"version": "6.0.0-tslib-test",
3232
"main": "./dist/src/index.js",
3333
"typings": "./dist/src/index.d.ts"
34-
}
34+
}

packages/bls-sdk/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"buildOptions": {
2828
"genReact": false
2929
},
30-
"version": "6.0.0",
30+
"version": "6.0.0-tslib-test",
3131
"main": "./dist/src/index.js",
3232
"typings": "./dist/src/index.d.ts"
33-
}
33+
}

packages/constants/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"tags": [
2121
"universal"
2222
],
23-
"version": "6.0.0",
23+
"version": "6.0.0-tslib-test",
2424
"main": "./dist/src/index.js",
2525
"typings": "./dist/src/index.d.ts"
26-
}
26+
}

packages/constants/src/lib/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = '6.0.0';
1+
export const version = '6.0.1';

packages/contracts-sdk/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"tags": [
3333
"universal"
3434
],
35-
"version": "6.0.0",
35+
"version": "6.0.0-tslib-test",
3636
"main": "./dist/src/index.js",
3737
"typings": "./dist/src/index.d.ts"
38-
}
38+
}

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lit-protocol/core",
3-
"version": "6.0.0",
3+
"version": "6.0.0-tslib-test",
44
"type": "commonjs",
55
"license": "MIT",
66
"homepage": "https://github.com/Lit-Protocol/js-sdk",
@@ -27,4 +27,4 @@
2727
],
2828
"main": "./dist/src/index.js",
2929
"typings": "./dist/src/index.d.ts"
30-
}
30+
}

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

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
import {
3636
bootstrapLogManager,
3737
executeWithRetry,
38+
getIpAddress,
3839
isBrowser,
3940
isNode,
4041
log,
@@ -175,7 +176,7 @@ export class LitCore {
175176
}
176177

177178
// -- set bootstrapUrls to match the network litNetwork unless it's set to custom
178-
this.#setCustomBootstrapUrls();
179+
this.setCustomBootstrapUrls();
179180

180181
// -- set global variables
181182
globalThis.litConfig = this.config;
@@ -439,9 +440,9 @@ export class LitCore {
439440
* that the client's configuration is always in sync with the current state of the
440441
* staking contract.
441442
*
442-
* @returns { void }
443+
* @returns {Promise<void>} A promise that resolves when the listener is successfully set up.
443444
*/
444-
#listenForNewEpoch(): void {
445+
private _listenForNewEpoch() {
445446
// Check if we've already set up the listener to avoid duplicates
446447
if (this._stakingContractListener) {
447448
// Already listening, do nothing
@@ -475,14 +476,13 @@ export class LitCore {
475476
if (globalThis.litConfig) delete globalThis.litConfig;
476477
}
477478

478-
protected _stopNetworkPolling() {
479+
_stopNetworkPolling() {
479480
if (this._networkSyncInterval) {
480481
clearInterval(this._networkSyncInterval);
481482
this._networkSyncInterval = null;
482483
}
483484
}
484-
485-
protected _stopListeningForNewEpoch() {
485+
_stopListeningForNewEpoch() {
486486
if (this._stakingContract && this._stakingContractListener) {
487487
this._stakingContract.off('StateChanged', this._stakingContractListener);
488488
this._stakingContractListener = null;
@@ -496,7 +496,7 @@ export class LitCore {
496496
* @returns { void }
497497
*
498498
*/
499-
#setCustomBootstrapUrls = (): void => {
499+
setCustomBootstrapUrls = (): void => {
500500
// -- validate
501501
if (this.config.litNetwork === 'custom') return;
502502

@@ -585,8 +585,8 @@ export class LitCore {
585585
await this._runHandshakeWithBootstrapUrls();
586586
Object.assign(this, { ...coreNodeConfig, connectedNodes, serverKeys });
587587

588-
this.#scheduleNetworkSync();
589-
this.#listenForNewEpoch();
588+
this._scheduleNetworkSync();
589+
this._listenForNewEpoch();
590590

591591
// FIXME: don't create global singleton; multiple instances of `core` should not all write to global
592592
// @ts-expect-error typeof globalThis is not defined. We're going to get rid of the global soon.
@@ -617,7 +617,7 @@ export class LitCore {
617617
}): Promise<JsonHandshakeResponse> {
618618
const challenge = this.getRandomHexString(64);
619619

620-
const handshakeResult = await this.#handshakeWithNode(
620+
const handshakeResult = await this.handshakeWithNode(
621621
{ url, challenge },
622622
requestId
623623
);
@@ -707,7 +707,7 @@ export class LitCore {
707707
coreNodeConfig: CoreNodeConfig;
708708
}> {
709709
// -- handshake with each node
710-
const requestId: string = this.#getRequestId();
710+
const requestId: string = this.getRequestId();
711711

712712
// track connectedNodes for the new handshake operation
713713
const connectedNodes = new Set<string>();
@@ -858,7 +858,7 @@ export class LitCore {
858858
* We can remove this network sync code entirely if we refactor our code to fetch latest blockhash on-demand.
859859
* @private
860860
*/
861-
#scheduleNetworkSync() {
861+
private _scheduleNetworkSync() {
862862
if (this._networkSyncInterval) {
863863
clearInterval(this._networkSyncInterval);
864864
}
@@ -880,7 +880,7 @@ export class LitCore {
880880
* @returns { string }
881881
*
882882
*/
883-
#getRequestId(): string {
883+
getRequestId() {
884884
return Math.random().toString(16).slice(2);
885885
}
886886

@@ -891,7 +891,7 @@ export class LitCore {
891891
* @returns { string }
892892
*/
893893

894-
getRandomHexString(size: number): string {
894+
getRandomHexString(size: number) {
895895
return [...Array(size)]
896896
.map(() => Math.floor(Math.random() * 16).toString(16))
897897
.join('');
@@ -905,7 +905,7 @@ export class LitCore {
905905
* @returns { Promise<NodeCommandServerKeysResponse> }
906906
*
907907
*/
908-
#handshakeWithNode = async (
908+
handshakeWithNode = async (
909909
params: HandshakeWithNode,
910910
requestId: string
911911
): Promise<NodeCommandServerKeysResponse> => {
@@ -927,7 +927,7 @@ export class LitCore {
927927
challenge: params.challenge,
928928
};
929929

930-
return await this._sendCommandToNode({
930+
return await this.sendCommandToNode({
931931
url: urlWithPath,
932932
data,
933933
requestId,
@@ -985,7 +985,7 @@ export class LitCore {
985985
* @returns { Promise<any> }
986986
*
987987
*/
988-
protected _sendCommandToNode = async ({
988+
sendCommandToNode = async ({
989989
url,
990990
data,
991991
requestId,
@@ -1023,7 +1023,7 @@ export class LitCore {
10231023
* @returns { Array<Promise<any>> }
10241024
*
10251025
*/
1026-
protected _getNodePromises = (
1026+
getNodePromises = (
10271027
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10281028
callback: (url: string) => Promise<any>
10291029
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1048,7 +1048,7 @@ export class LitCore {
10481048
* @returns The session signature for the given URL.
10491049
* @throws An error if sessionSigs is not provided or if the session signature for the URL is not found.
10501050
*/
1051-
protected _getSessionSigByUrl = ({
1051+
getSessionSigByUrl = ({
10521052
sessionSigs,
10531053
url,
10541054
}: {
@@ -1154,7 +1154,7 @@ export class LitCore {
11541154
* @param { number } minNodeCount number of nodes we need valid results from in order to resolve
11551155
* @returns { Promise<SuccessNodePromises<T> | RejectedNodePromises> }
11561156
*/
1157-
protected _handleNodePromises = async <T>(
1157+
handleNodePromises = async <T>(
11581158
nodePromises: Promise<T>[],
11591159
requestId: string,
11601160
minNodeCount: number
@@ -1237,10 +1237,7 @@ export class LitCore {
12371237
* @returns { void }
12381238
*
12391239
*/
1240-
protected _throwNodeError = (
1241-
res: RejectedNodePromises,
1242-
requestId: string
1243-
): void => {
1240+
_throwNodeError = (res: RejectedNodePromises, requestId: string): void => {
12441241
if (res.error) {
12451242
if (
12461243
((res.error.errorCode &&

packages/crypto/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"tags": [
2222
"universal"
2323
],
24-
"version": "6.0.0",
24+
"version": "6.0.0-tslib-test",
2525
"main": "./dist/src/index.js",
2626
"typings": "./dist/src/index.d.ts"
27-
}
27+
}

packages/ecdsa-sdk/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"tags": [
2525
"universal"
2626
],
27-
"version": "6.0.0",
27+
"version": "6.0.0-tslib-test",
2828
"main": "./dist/src/index.js",
2929
"typings": "./dist/src/index.d.ts"
30-
}
30+
}

packages/encryption/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"crypto": false,
2626
"stream": false
2727
},
28-
"version": "6.0.0",
28+
"version": "6.0.0-tslib-test",
2929
"main": "./dist/src/index.js",
3030
"typings": "./dist/src/index.d.ts"
31-
}
31+
}

packages/lit-auth-client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lit-protocol/lit-auth-client",
3-
"version": "6.0.0",
3+
"version": "6.0.0-tslib-test",
44
"type": "commonjs",
55
"license": "MIT",
66
"homepage": "https://github.com/Lit-Protocol/js-sdk",
@@ -32,4 +32,4 @@
3232
},
3333
"main": "./dist/src/index.js",
3434
"typings": "./dist/src/index.d.ts"
35-
}
35+
}

packages/lit-node-client-nodejs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"tags": [
2525
"nodejs"
2626
],
27-
"version": "6.0.0",
27+
"version": "6.0.0-tslib-test",
2828
"main": "./dist/src/index.js",
2929
"typings": "./dist/src/index.d.ts"
30-
}
30+
}

packages/lit-node-client-nodejs/src/lib/helpers/get-expiration.test.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/lit-node-client-nodejs/src/lib/helpers/get-expiration.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)