Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,4 @@ jobs:
run: |
echo "Running format check..."
# Use prettier directly to avoid NX git issues
npx prettier --check . || {
echo "Format check failed. Running prettier --write to fix issues..."
npx prettier --write .
echo "Checking again after formatting..."
npx prettier --check . || {
echo "Still failing after auto-format. Manual intervention needed."
exit 1
}
echo "Auto-formatting successful. All files are now properly formatted."
echo "Note: Some files were auto-formatted. Consider committing these changes in your next commit."
}
echo "Format check passed!"
npx prettier --check . && echo "Format check passed!"
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div align="center">
<h1>Lit Protocol Javascript/Typescript SDK V8.x.x</h1>


<img src="https://i.ibb.co/p2xfzK1/Screenshot-2022-11-15-at-09-56-57.png">
<br/>
<a href="https://twitter.com/LitProtocol"><img src="https://img.shields.io/twitter/follow/litprotocol?label=Follow&style=social"/></a>
Expand All @@ -25,7 +24,6 @@ The Lit JavaScript SDK provides developers with a framework for implementing Lit
<br/>
<br/>


<a href="https://developer.litprotocol.com/v3/sdk/installation"><img src="https://i.ibb.co/fDqdXLq/button-go-to-docs.png" /></a>

<a href="https://developer.litprotocol.com/v3/sdk/installation">
Expand Down
16 changes: 8 additions & 8 deletions e2e/artillery/configs/encrypt-decrypt.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
config:
target: "dummy"
target: 'dummy'
phases:
# Over 60s, ramp up to creating 50 vusers per second
- duration: 60
arrivalRate: 5
rampTo: 150
name: "Ramp Up"
name: 'Ramp Up'
# Over 300s, create 50 vusers per second
- duration: 300
arrivalRate: 150
name: "Sustained Encrypt & Decrypt"
name: 'Sustained Encrypt & Decrypt'
# Over 60s, ramp down to creating 5 vusers per second
- duration: 60
arrivalRate: 20
name: "Ramp Down"
processor: "../src/processors/multi-endpoints.ts"
name: 'Ramp Down'
processor: '../src/processors/multi-endpoints.ts'

scenarios:
- name: "Encrypt & Decrypt Stress Test"
- name: 'Encrypt & Decrypt Stress Test'
weight: 100
flow:
- function: "runEncryptDecryptTest"
- think: 0.1
- function: 'runEncryptDecryptTest'
- think: 0.1
16 changes: 8 additions & 8 deletions e2e/artillery/configs/execute.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
config:
target: "dummy"
target: 'dummy'
phases:
# Over 60s, ramp up to creating 50 vusers per second
- duration: 60
arrivalRate: 5
rampTo: 100
name: "Ramp Up"
name: 'Ramp Up'
# Over 300s, create 50 vusers per second
- duration: 300
arrivalRate: 100
name: "Sustained Encrypt & Decrypt"
name: 'Sustained Encrypt & Decrypt'
# Over 60s, ramp down to creating 5 vusers per second
- duration: 60
arrivalRate: 20
name: "Ramp Down"
processor: "../src/processors/multi-endpoints.ts"
name: 'Ramp Down'
processor: '../src/processors/multi-endpoints.ts'

scenarios:
- name: "Execute JS Stress Test"
- name: 'Execute JS Stress Test'
weight: 100
flow:
- function: "runExecuteJSTest"
- think: 0.1
- function: 'runExecuteJSTest'
- think: 0.1
24 changes: 12 additions & 12 deletions e2e/artillery/configs/mix.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
config:
target: "dummy"
target: 'dummy'
phases:
# Over 60s, ramp up to creating 50 vusers per second
- duration: 60
arrivalRate: 5
rampTo: 75
name: "Ramp Up"
name: 'Ramp Up'
# Over 300s, create 50 vusers per second
- duration: 300
arrivalRate: 75
name: "Sustained Encrypt & Decrypt"
name: 'Sustained Encrypt & Decrypt'
# Over 60s, ramp down to creating 5 vusers per second
- duration: 60
arrivalRate: 20
name: "Ramp Down"
processor: "../src/processors/multi-endpoints.ts"
name: 'Ramp Down'
processor: '../src/processors/multi-endpoints.ts'

scenarios:
- name: "PKP Sign Stress Test"
- name: 'PKP Sign Stress Test'
weight: 50
flow:
- function: "runPkpSignTest"
- function: 'runPkpSignTest'
- think: 0.1
- name: "Encrypt & Decrypt Stress Test"
- name: 'Encrypt & Decrypt Stress Test'
weight: 25
flow:
- function: "runEncryptDecryptTest"
- function: 'runEncryptDecryptTest'
- think: 0.1
- name: "Execute JS Stress Test"
- name: 'Execute JS Stress Test'
weight: 25
flow:
- function: "runExecuteJSTest"
- think: 0.1
- function: 'runExecuteJSTest'
- think: 0.1
4 changes: 2 additions & 2 deletions e2e/artillery/configs/pkp-sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ config:
- duration: 60
arrivalRate: 5
rampTo: 80
name: "Ramp Up"
name: 'Ramp Up'
# Over 300s, create 50 vusers per second
- duration: 300
arrivalRate: 80
name: "Sustained PKP Signing"
name: 'Sustained PKP Signing'
# Over 60s, ramp down to creating 5 vusers per second
- duration: 60
arrivalRate: 20
Expand Down
4 changes: 2 additions & 2 deletions packages/constants/src/lib/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1429,5 +1429,5 @@ export const SIWE_URI_PREFIX = {
export type SIWE_URI_PREFIX_TYPE = ConstantKeys<typeof SIWE_URI_PREFIX>;
export type SIWE_URI_PREFIX_VALUES = ConstantValues<typeof SIWE_URI_PREFIX>;


export const DEV_PRIVATE_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";
export const DEV_PRIVATE_KEY =
'0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80';
27 changes: 11 additions & 16 deletions packages/lit-client/src/lib/LitClient/createLitClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ export const _createNagaLitClient = async (
}
): Promise<LitNodeSignature> {
_logger.info(
`🔥 signing on ${params.chain} with ${params.signingScheme} (bypass: ${params.bypassAutoHashing || false
`🔥 signing on ${params.chain} with ${params.signingScheme} (bypass: ${
params.bypassAutoHashing || false
})`
);

Expand Down Expand Up @@ -808,9 +809,7 @@ export const _createNagaLitClient = async (
},
viewPKPPermissions: async (pkpIdentifier: PkpIdentifierRaw) => {
// It's an Anvil private key, chill. 🤣
const account = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const account = privateKeyToAccount(DEV_PRIVATE_KEY);

const pkpPermissionsManager =
await networkModule.chainApi.getPKPPermissionsManager({
Expand All @@ -829,19 +828,17 @@ export const _createNagaLitClient = async (
},
viewPKPsByAuthData: async (params: {
authData:
| {
authMethodType: number | bigint;
authMethodId: string;
accessToken?: string;
}
| AuthData;
| {
authMethodType: number | bigint;
authMethodId: string;
accessToken?: string;
}
| AuthData;
pagination?: { limit?: number; offset?: number };
storageProvider?: PKPStorageProvider;
}) => {
// Use read-only account for viewing PKPs
const account = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const account = privateKeyToAccount(DEV_PRIVATE_KEY);

return await networkModule.chainApi.getPKPsByAuthData({
authData: params.authData,
Expand All @@ -856,9 +853,7 @@ export const _createNagaLitClient = async (
storageProvider?: PKPStorageProvider;
}) => {
// Use read-only account for viewing PKPs
const account = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const account = privateKeyToAccount(DEV_PRIVATE_KEY);

return await networkModule.chainApi.getPKPsByAddress({
ownerAddress: params.ownerAddress,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ export const createReadOnlyContractsManager = <T, M>(
networkConfig: INetworkConfig<T, M>
) => {
// dummy private key for read actions
const dummyAccount = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const dummyAccount = privateKeyToAccount(DEV_PRIVATE_KEY);
return createContractsManager(networkConfig, dummyAccount);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ export const createChainManager = (
const defaultPagination = { limit: 10, offset: 0 };
const finalPagination = params.pagination
? {
limit: params.pagination.limit ?? defaultPagination.limit,
offset: params.pagination.offset ?? defaultPagination.offset,
}
limit: params.pagination.limit ?? defaultPagination.limit,
offset: params.pagination.offset ?? defaultPagination.offset,
}
: defaultPagination;

return getPKPsByAddress(
Expand Down Expand Up @@ -148,9 +148,7 @@ export const createChainManager = (

export const createReadOnlyChainManager = () => {
// dummy private key for read actions
const dummyAccount = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const dummyAccount = privateKeyToAccount(DEV_PRIVATE_KEY);
const chainManager = createChainManager(dummyAccount);
return createChainManager(chainManager);
};
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,7 @@ const networkModuleObject = {
}

// Use read-only account for viewing PKPs
const account = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const account = privateKeyToAccount(DEV_PRIVATE_KEY);

// 2. Fetch the price feed info
const nodePrices = await getNodePrices(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ export const createChainManager = (
const defaultPagination = { limit: 10, offset: 0 };
const finalPagination = params.pagination
? {
limit: params.pagination.limit ?? defaultPagination.limit,
offset: params.pagination.offset ?? defaultPagination.offset,
}
limit: params.pagination.limit ?? defaultPagination.limit,
offset: params.pagination.offset ?? defaultPagination.offset,
}
: defaultPagination;

return getPKPsByAddress(
Expand Down Expand Up @@ -148,9 +148,7 @@ export const createChainManager = (

export const createReadOnlyChainManager = () => {
// dummy private key for read actions
const dummyAccount = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const dummyAccount = privateKeyToAccount(DEV_PRIVATE_KEY);
const chainManager = createChainManager(dummyAccount);
return createChainManager(chainManager);
};
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,7 @@ const networkModuleObject = {
}

// Use read-only account for viewing PKPs
const account = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const account = privateKeyToAccount(DEV_PRIVATE_KEY);

// 2. Fetch the price feed info
const nodePrices = await getNodePrices(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ export const createChainManager = (
const defaultPagination = { limit: 10, offset: 0 };
const finalPagination = params.pagination
? {
limit: params.pagination.limit ?? defaultPagination.limit,
offset: params.pagination.offset ?? defaultPagination.offset,
}
limit: params.pagination.limit ?? defaultPagination.limit,
offset: params.pagination.offset ?? defaultPagination.offset,
}
: defaultPagination;

return getPKPsByAddress(
Expand Down Expand Up @@ -148,9 +148,7 @@ export const createChainManager = (

export const createReadOnlyChainManager = () => {
// dummy private key for read actions
const dummyAccount = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const dummyAccount = privateKeyToAccount(DEV_PRIVATE_KEY);
const chainManager = createChainManager(dummyAccount);
return createChainManager(chainManager);
};
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,7 @@ const networkModuleObject = {
}

// Use read-only account for viewing PKPs
const account = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const account = privateKeyToAccount(DEV_PRIVATE_KEY);

// 2. Fetch the price feed info
const nodePrices = await getNodePrices(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ export const createChainManager = (
const defaultPagination = { limit: 10, offset: 0 };
const finalPagination = params.pagination
? {
limit: params.pagination.limit ?? defaultPagination.limit,
offset: params.pagination.offset ?? defaultPagination.offset,
}
limit: params.pagination.limit ?? defaultPagination.limit,
offset: params.pagination.offset ?? defaultPagination.offset,
}
: defaultPagination;

return getPKPsByAddress(
Expand Down Expand Up @@ -148,9 +148,7 @@ export const createChainManager = (

export const createReadOnlyChainManager = () => {
// dummy private key for read actions
const dummyAccount = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const dummyAccount = privateKeyToAccount(DEV_PRIVATE_KEY);
const chainManager = createChainManager(dummyAccount);
return createChainManager(chainManager);
};
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,7 @@ const networkModuleObject = {
}

// Use read-only account for viewing PKPs
const account = privateKeyToAccount(
DEV_PRIVATE_KEY
);
const account = privateKeyToAccount(DEV_PRIVATE_KEY);

// 2. Fetch the price feed info
const nodePrices = await getNodePrices(
Expand Down
Loading