From c5d7b0ea947b784b92abcea42dbbba2f953d4d0a Mon Sep 17 00:00:00 2001 From: Massimo Cairo Date: Thu, 15 Feb 2024 19:15:28 +0200 Subject: [PATCH 1/7] Add `K256` as alias of `ECDSA_CAIT_SITH` sig type (#356) --- packages/constants/src/lib/enums.ts | 3 ++- packages/crypto/src/lib/crypto.spec.ts | 2 +- packages/crypto/src/lib/crypto.ts | 4 +++- .../src/lib/lit-node-client-nodejs.ts | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/constants/src/lib/enums.ts b/packages/constants/src/lib/enums.ts index 9c4d4b61ae..6312ea041f 100644 --- a/packages/constants/src/lib/enums.ts +++ b/packages/constants/src/lib/enums.ts @@ -7,7 +7,8 @@ export enum VMTYPE { export enum SIGTYPE { BLS = 'BLS', - EcdsaCaitSith = 'ECDSA_CAIT_SITH', + EcdsaK256 = 'K256', + EcdsaCaitSith = 'ECDSA_CAIT_SITH', // Legacy alias of K256 EcdsaCAITSITHP256 = 'EcdsaCaitSithP256', } diff --git a/packages/crypto/src/lib/crypto.spec.ts b/packages/crypto/src/lib/crypto.spec.ts index 6cb95b24dc..d7b13edb36 100644 --- a/packages/crypto/src/lib/crypto.spec.ts +++ b/packages/crypto/src/lib/crypto.spec.ts @@ -174,7 +174,7 @@ describe('combine ECDSA Shares', () => { sigName: 'sig', }, { - sigType: 'ECDSA_CAIT_SITH', + sigType: 'K256', signatureShare: 'BA77EB500884A60583DEA49578D4BB64BB55EF497F37C88DF935D739CE8E0A9F', shareIndex: 0, diff --git a/packages/crypto/src/lib/crypto.ts b/packages/crypto/src/lib/crypto.ts index 1adc2d7ef5..c19d610175 100644 --- a/packages/crypto/src/lib/crypto.ts +++ b/packages/crypto/src/lib/crypto.ts @@ -241,6 +241,7 @@ export const combineEcdsaShares = ( let res: string = ''; switch (type) { case SIGTYPE.EcdsaCaitSith: + case SIGTYPE.EcdsaK256: res = ecdsaSdk.combine_signature(validShares, 2); try { @@ -256,7 +257,7 @@ export const combineEcdsaShares = ( /* r and s values of the signature should be maximum of 64 bytes - r and s values can have polarity as the first two bits, here we remove + r and s values can have polarity as the first two bits, here we remove */ if (sig && sig.r && sig.r.length > 64) { while (sig.r.length > 64) { @@ -298,6 +299,7 @@ export const computeHDPubKey = ( try { switch (sigType) { case SIGTYPE.EcdsaCaitSith: + case SIGTYPE.EcdsaK256: // a bit of pre processing to remove characters which will cause our wasm module to reject the values. pubkeys = pubkeys.map((value: string) => { return value.replace('0x', ''); diff --git a/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts b/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts index 90df3dc390..7f09110d60 100644 --- a/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts +++ b/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts @@ -1298,10 +1298,11 @@ export class LitNodeClientNodeJs extends LitCore { // -- validate if signature type is ECDSA if ( sigType !== SIGTYPE.EcdsaCaitSith && + sigType !== SIGTYPE.EcdsaK256 && sigType !== SIGTYPE.EcdsaCAITSITHP256 ) { throwError({ - message: `signature type is ${sigType} which is not ECDSA_CAIT_SITH`, + message: `signature type is ${sigType} which is invalid`, errorKind: LIT_ERROR.UNKNOWN_SIGNATURE_TYPE.kind, errorCode: LIT_ERROR.UNKNOWN_SIGNATURE_TYPE.name, }); @@ -1461,10 +1462,11 @@ export class LitNodeClientNodeJs extends LitCore { // -- validate if signature type is ECDSA if ( sigType !== SIGTYPE.EcdsaCaitSith && + sigType !== SIGTYPE.EcdsaK256 && sigType !== SIGTYPE.EcdsaCAITSITHP256 ) { throwError({ - message: `signature type is ${sigType} which is not ECDSA_CAIT_SITH`, + message: `signature type is ${sigType} which is invalid`, errorKind: LIT_ERROR.UNKNOWN_SIGNATURE_TYPE.kind, errorCode: LIT_ERROR.UNKNOWN_SIGNATURE_TYPE.name, }); From af453de8ae6b18600bedc87aaab5f4629a369858 Mon Sep 17 00:00:00 2001 From: Adam Reif Date: Thu, 15 Feb 2024 23:39:11 -0500 Subject: [PATCH 2/7] format check on every PR/push Signed-off-by: Adam Reif --- .github/workflows/ci.yml | 17 ----------------- .github/workflows/lint.yml | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16fe1254ab..7e73b1168a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,23 +30,6 @@ jobs: run: yarn build - name: Run Unit tests run: yarn tools --test --unit - linter: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - cache: 'yarn' - - name: Install project dependencies - run: yarn install - - name: Lint - run: yarn nx format:check --all e2e-connection: runs-on: ubuntu-latest timeout-minutes: 30 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..ef8c5600d5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: lint +on: + - pull_request + - push +jobs: + linter: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + cache: 'yarn' + - name: Install project dependencies + run: yarn install + - name: Lint + run: yarn nx format:check --all From c917f1f90cf8c9be47bc88a280db08587a291e09 Mon Sep 17 00:00:00 2001 From: Adam Reif Date: Thu, 15 Feb 2024 23:43:24 -0500 Subject: [PATCH 3/7] all PRs but only direct pushes to master Signed-off-by: Adam Reif --- .github/workflows/lint.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ef8c5600d5..3b93e30175 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,7 +1,9 @@ name: lint on: - - pull_request - - push + pull_request: + push: + branches: + - master jobs: linter: runs-on: ubuntu-latest From 265cdfbe70233231e3590082d36c921b74ad7b3b Mon Sep 17 00:00:00 2001 From: Ansonhkg Date: Fri, 16 Feb 2024 18:40:57 +0000 Subject: [PATCH 4/7] staging --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4635b22618..d86c778183 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-

Lit Protocol Javascript/Typescript SDK V3.1.4

+

Lit Protocol Javascript/Typescript SDK V?


From 394894cc89b0c9c49954bde873343838f76ba9d7 Mon Sep 17 00:00:00 2001 From: Ansonhkg Date: Fri, 16 Feb 2024 18:41:37 +0000 Subject: [PATCH 5/7] chore: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d86c778183..4635b22618 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-

Lit Protocol Javascript/Typescript SDK V?

+

Lit Protocol Javascript/Typescript SDK V3.1.4


From 2264a02c51ed84d0a1601ae40c815a468356d169 Mon Sep 17 00:00:00 2001 From: Chris Cassano Date: Sat, 17 Feb 2024 12:19:45 -0800 Subject: [PATCH 6/7] remove lit-siwe --- apps/nodejs/manual-test.ts | 158 +++++++++--------- .../group-rli/test-rli-pkp-as-delegatee.mjs | 2 +- package.json | 1 - packages/auth-browser/package.json | 2 +- packages/auth-browser/src/lib/chains/eth.ts | 2 +- .../src/lib/providers/EthWalletProvider.ts | 2 +- .../src/lib/lit-node-client-nodejs.ts | 13 +- tools/scripts/utils.mjs | 4 +- yarn.lock | 16 -- 9 files changed, 91 insertions(+), 109 deletions(-) diff --git a/apps/nodejs/manual-test.ts b/apps/nodejs/manual-test.ts index 329eae12fb..175cb6fe38 100644 --- a/apps/nodejs/manual-test.ts +++ b/apps/nodejs/manual-test.ts @@ -3,7 +3,7 @@ import * as LitJsSdk from '@lit-protocol/lit-node-client'; // import { LitContracts } from '@lit-protocol/contracts-sdk'; import { ethers } from 'ethers'; import { PKPEthersWallet } from '@lit-protocol/pkp-ethers'; -import { SiweMessage } from 'lit-siwe'; +import { SiweMessage } from 'siwe'; import { LIT_EVM_CHAINS } from '@lit-protocol/constants'; @@ -206,30 +206,30 @@ const runLogic = async (contract: LitContracts) => { // }; const pkpSign = async (client, pkpPubkey, authSig) => { - // try and sign something - let sig = await client.pkpSign({ - toSign: ethers.utils.arrayify(ethers.utils.keccak256([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])), // hello world in Uint8Array - pubKey: pkpPubkey, - authSig, - }); + // try and sign something + let sig = await client.pkpSign({ + toSign: ethers.utils.arrayify(ethers.utils.keccak256([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])), // hello world in Uint8Array + pubKey: pkpPubkey, + authSig, + }); - // console.log("sig: ", sig); + // console.log("sig: ", sig); - const recoveredPk = ethers.utils.recoverPublicKey("0x" + sig.dataSigned, sig.signature); - const addr = ethers.utils.computeAddress('0x' + sig.publicKey); - const recoveredAddr = ethers.utils.computeAddress(recoveredPk); - const claimedAddr = ethers.utils.computeAddress(pkpPubkey); + const recoveredPk = ethers.utils.recoverPublicKey("0x" + sig.dataSigned, sig.signature); + const addr = ethers.utils.computeAddress('0x' + sig.publicKey); + const recoveredAddr = ethers.utils.computeAddress(recoveredPk); + const claimedAddr = ethers.utils.computeAddress(pkpPubkey); - const allGood = addr === recoveredAddr && addr === claimedAddr; + const allGood = addr === recoveredAddr && addr === claimedAddr; - console.log('all addresses match: ', allGood); - return allGood; + console.log('all addresses match: ', allGood); + return allGood; } -const litActionSign = async(client, pkpPubkey, authSig) => { - console.log('testing sig with lit actions...'); - // this code will be run on the node - const litActionCode = ` +const litActionSign = async (client, pkpPubkey, authSig) => { + console.log('testing sig with lit actions...'); + // this code will be run on the node + const litActionCode = ` const go = async () => { // this requests a signature share from the Lit Node // the signature share will be automatically returned in the HTTP response from the node @@ -241,40 +241,40 @@ const litActionSign = async(client, pkpPubkey, authSig) => { go(); `; - const signatures = await client.executeJs({ - code: litActionCode, - authSig, - // all jsParams can be used anywhere in your litActionCode - jsParams: { - // this is the string "Hello World" for testing - toSign: ethers.utils.arrayify(ethers.utils.keccak256([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])), - publicKey: pkpPubkey, - sigName: "sig1", - }, - }); - // console.log("signatures: ", signatures); - const { sig1, sig2 } = signatures.signatures - const sigKeys = { - sig1: { - recovered: ethers.utils.computeAddress(ethers.utils.recoverPublicKey("0x" + sig1.dataSigned, sig1.signature)), - reported: ethers.utils.computeAddress('0x' + sig1.publicKey) - }, - sig2: { - recovered: ethers.utils.computeAddress(ethers.utils.recoverPublicKey("0x" + sig2.dataSigned, sig2.signature)), - reported: ethers.utils.computeAddress('0x' + sig2.publicKey) - }, - } + const signatures = await client.executeJs({ + code: litActionCode, + authSig, + // all jsParams can be used anywhere in your litActionCode + jsParams: { + // this is the string "Hello World" for testing + toSign: ethers.utils.arrayify(ethers.utils.keccak256([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])), + publicKey: pkpPubkey, + sigName: "sig1", + }, + }); + // console.log("signatures: ", signatures); + const { sig1, sig2 } = signatures.signatures + const sigKeys = { + sig1: { + recovered: ethers.utils.computeAddress(ethers.utils.recoverPublicKey("0x" + sig1.dataSigned, sig1.signature)), + reported: ethers.utils.computeAddress('0x' + sig1.publicKey) + }, + sig2: { + recovered: ethers.utils.computeAddress(ethers.utils.recoverPublicKey("0x" + sig2.dataSigned, sig2.signature)), + reported: ethers.utils.computeAddress('0x' + sig2.publicKey) + }, + } - // console.log(`sigKeys: ${JSON.stringify(sigKeys, null, 2)}`) + // console.log(`sigKeys: ${JSON.stringify(sigKeys, null, 2)}`) - const pkpAddr = ethers.utils.computeAddress(pkpPubkey); - // console.log('pkpAddr:', pkpAddr) + const pkpAddr = ethers.utils.computeAddress(pkpPubkey); + // console.log('pkpAddr:', pkpAddr) - let allGood = sigKeys.sig1.recovered == sigKeys.sig1.reported && sigKeys.sig2.recovered == sigKeys.sig2.reported && sigKeys.sig1.recovered == sigKeys.sig2.recovered && sigKeys.sig1.recovered == pkpAddr; - console.log('all addresses match: ', allGood); - return allGood; - } + let allGood = sigKeys.sig1.recovered == sigKeys.sig1.reported && sigKeys.sig2.recovered == sigKeys.sig2.reported && sigKeys.sig1.recovered == sigKeys.sig2.recovered && sigKeys.sig1.recovered == pkpAddr; + console.log('all addresses match: ', allGood); + return allGood; +} const mintPkpAndSign = async () => { let client; @@ -321,37 +321,37 @@ const mintPkpAndSign = async () => { await client.connect(); - const litContracts = new LitContracts({ - privateKey: TEST_FUNDED_PRIVATE_KEY, - }); - const pkpPubkey = await runLogic(litContracts); - console.log('pkpPubkey:', pkpPubkey); - - const privateKey = TEST_FUNDED_PRIVATE_KEY; - const provider = new ethers.providers.JsonRpcProvider( - LIT_EVM_CHAINS['chronicleTestnet'].rpcUrls[0] - ); - const wallet = new ethers.Wallet(privateKey, provider); - const authSig = await getAuthSig(wallet); - - // console.log('Sleeping for 5 seconds so that the chronicle node replica can sync up'); - // Sleep for 5 seconds - // await new Promise(resolve => setTimeout(resolve, 5000)); - - - let startTime = Date.now(); - let allGood = true; - const testCount = 1; - for(let i = 0; i < testCount; i++){ - console.log(`testing ${i + 1} of ${testCount}`); - let result = await pkpSign(client, pkpPubkey, authSig); - if (!result) { - allGood = false; - } + const litContracts = new LitContracts({ + privateKey: TEST_FUNDED_PRIVATE_KEY, + }); + const pkpPubkey = await runLogic(litContracts); + console.log('pkpPubkey:', pkpPubkey); + + const privateKey = TEST_FUNDED_PRIVATE_KEY; + const provider = new ethers.providers.JsonRpcProvider( + LIT_EVM_CHAINS['chronicleTestnet'].rpcUrls[0] + ); + const wallet = new ethers.Wallet(privateKey, provider); + const authSig = await getAuthSig(wallet); + + // console.log('Sleeping for 5 seconds so that the chronicle node replica can sync up'); + // Sleep for 5 seconds + // await new Promise(resolve => setTimeout(resolve, 5000)); + + + let startTime = Date.now(); + let allGood = true; + const testCount = 1; + for (let i = 0; i < testCount; i++) { + console.log(`testing ${i + 1} of ${testCount}`); + let result = await pkpSign(client, pkpPubkey, authSig); + if (!result) { + allGood = false; } - console.log(`it took ${(Date.now() - startTime) / 1000}s to run ${testCount} tests`) - console.log('all tests were good', allGood); - // await litActionSign(client, pkpPubkey, authSig); + } + console.log(`it took ${(Date.now() - startTime) / 1000}s to run ${testCount} tests`) + console.log('all tests were good', allGood); + // await litActionSign(client, pkpPubkey, authSig); } const getAuthSig = async (wallet) => { diff --git a/e2e-nodejs/group-rli/test-rli-pkp-as-delegatee.mjs b/e2e-nodejs/group-rli/test-rli-pkp-as-delegatee.mjs index 3cbf47bbcb..314179a9e0 100644 --- a/e2e-nodejs/group-rli/test-rli-pkp-as-delegatee.mjs +++ b/e2e-nodejs/group-rli/test-rli-pkp-as-delegatee.mjs @@ -214,7 +214,7 @@ export async function main() { resources: resources, chainId: 1, - // optional (this would use normal siwe lib, without it, it would use lit-siwe) + // optional (this would use normal siwe lib, without it, it would use siwe-recap) resourceAbilityRequests: resourceAbilityRequests, }); diff --git a/package.json b/package.json index 01c819f70e..4c0f2a3763 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,6 @@ "ipfs-unixfs-importer": "^12.0.0", "jose": "^4.14.4", "jszip": "^3.10.1", - "lit-siwe": "^1.1.8", "micromodal": "^0.4.10", "multiformats": "^12.1.3", "nanoid": "3.3.4", diff --git a/packages/auth-browser/package.json b/packages/auth-browser/package.json index 107184647e..1eb53482ba 100644 --- a/packages/auth-browser/package.json +++ b/packages/auth-browser/package.json @@ -21,7 +21,7 @@ "peerDependencies": { "@walletconnect/ethereum-provider": "2.9.2", "@walletconnect/modal": "2.6.1", - "lit-siwe": "^1.1.8", + "siwe": "^2.0.5", "tweetnacl": "^1.0.3", "tweetnacl-util": "^0.13.3", "util": "^0.12.4", diff --git a/packages/auth-browser/src/lib/chains/eth.ts b/packages/auth-browser/src/lib/chains/eth.ts index 3e6a95e50b..8ca7da797b 100644 --- a/packages/auth-browser/src/lib/chains/eth.ts +++ b/packages/auth-browser/src/lib/chains/eth.ts @@ -22,7 +22,7 @@ import LitConnectModal from '../connect-modal/modal'; import { Web3Provider, JsonRpcSigner } from '@ethersproject/providers'; -import { SiweMessage } from 'lit-siwe'; +import { SiweMessage } from 'siwe'; import { getAddress } from 'ethers/lib/utils'; // @ts-ignore: If importing 'nacl' directly, the built files will use .default instead diff --git a/packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts b/packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts index 9a025dbdcd..96f4943ca9 100644 --- a/packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts +++ b/packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts @@ -6,7 +6,7 @@ import { EthWalletAuthenticateOptions, } from '@lit-protocol/types'; import { LIT_CHAINS, AuthMethodType, LIT_ERROR } from '@lit-protocol/constants'; -import { SiweMessage } from 'lit-siwe'; +import { SiweMessage } from 'siwe'; import { ethers } from 'ethers'; import { BaseProvider } from './BaseProvider'; import { checkAndSignAuthMessage } from '@lit-protocol/lit-node-client'; diff --git a/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts b/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts index 7f09110d60..a83a945162 100644 --- a/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts +++ b/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts @@ -89,8 +89,7 @@ import { import { computeAddress } from '@ethersproject/transactions'; import { joinSignature, sha256 } from 'ethers/lib/utils'; -import { SiweMessage } from 'lit-siwe'; -import * as siweNormal from 'siwe'; +import * as from 'siwe'; import { LitCore } from '@lit-protocol/core'; import { IPFSBundledSDK } from '@lit-protocol/lit-third-party-libs'; @@ -113,7 +112,7 @@ import { } from '@lit-protocol/misc-browser'; import { nacl } from '@lit-protocol/nacl'; import { BigNumber, ethers, utils } from 'ethers'; -import * as siwe from 'siwe'; +import { SiweMessage } from 'siwe'; // TODO: move this to auth-helper for next patch interface CapacityCreditsReq { @@ -2533,7 +2532,7 @@ export class LitNodeClientNodeJs extends LitCore { }); // regular siwe - siweMessage = new siweNormal.SiweMessage({ + siweMessage = new SiweMessage({ domain: params?.domain || globalThis.location?.host || 'litprotocol.com', address: pkpEthAddress, @@ -2548,7 +2547,7 @@ export class LitNodeClientNodeJs extends LitCore { siweMessage = recapObject.addToSiweMessage(siweMessage); } else { - // lit-siwe (NOT regular siwe) + // regular siwe without recap siweMessage = new SiweMessage({ domain: params?.domain || globalThis.location?.host || 'litprotocol.com', @@ -2771,8 +2770,8 @@ export class LitNodeClientNodeJs extends LitCore { const sessionCapabilityObject = params.sessionCapabilityObject ? params.sessionCapabilityObject : await this.generateSessionCapabilityObjectWithWildcards( - params.resourceAbilityRequests.map((r) => r.resource) - ); + params.resourceAbilityRequests.map((r) => r.resource) + ); let expiration = params.expiration || LitNodeClientNodeJs.getExpiration(); if (!this.latestBlockhash) { diff --git a/tools/scripts/utils.mjs b/tools/scripts/utils.mjs index cf95fbf06f..b1bfa2d417 100644 --- a/tools/scripts/utils.mjs +++ b/tools/scripts/utils.mjs @@ -10,7 +10,7 @@ import util from 'util'; import { toBech32 } from '@cosmjs/encoding'; import { Secp256k1 } from '@cosmjs/crypto'; import { rawSecp256k1PubkeyToRawAddress } from '@cosmjs/amino'; -import siwe from 'lit-siwe'; +import siwe from 'siwe'; import { ethers } from 'ethers'; const eventsEmitter = new events.EventEmitter(); @@ -160,7 +160,7 @@ export const spawnCommand = ( options = {}, options2 = { logExit: true, - exitCallback: () => {}, + exitCallback: () => { }, } ) => { // Use the spawn() function to run the command in a child process diff --git a/yarn.lock b/yarn.lock index 7f7126ee30..d27c910b89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5116,13 +5116,6 @@ uri-js "^4.4.1" valid-url "^1.0.9" -"@spruceid/siwe-parser@1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@spruceid/siwe-parser/-/siwe-parser-1.1.3.tgz#0eebe8bbd63c6de89cb44c06b6329b00b305df65" - integrity sha512-oQ8PcwDqjGWJvLmvAF2yzd6iniiWxK0Qtz+Dw+gLD/W5zOQJiKIUXwslHOm8VB8OOOKW9vfR3dnPBhHaZDvRsw== - dependencies: - apg-js "^4.1.1" - "@stablelib/aead@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@stablelib/aead/-/aead-1.0.1.tgz#c4b1106df9c23d1b867eb9b276d8f42d5fc4c0c3" @@ -18532,15 +18525,6 @@ lit-html@^2.7.0, lit-html@^2.8.0: dependencies: "@types/trusted-types" "^2.0.2" -lit-siwe@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/lit-siwe/-/lit-siwe-1.1.8.tgz#6a393069012816d629c518bb8aa410f1e4a78bd7" - integrity sha512-gXI8GG0GAClw6G7T9p4p6Kn9ywDo8j2d90ShaYArJdsqqO9gwXfzxF84SMeY+bpsNqqQ3FahrhEwTCHd6w7wNw== - dependencies: - "@spruceid/siwe-parser" "1.1.3" - "@stablelib/random" "^1.0.1" - apg-js "^4.1.1" - lit@2.7.6: version "2.7.6" resolved "https://registry.yarnpkg.com/lit/-/lit-2.7.6.tgz#810007b876ed43e0c70124de91831921598b1665" From d543be14bb815fa29e7a1894d65e1cc3fc0f700e Mon Sep 17 00:00:00 2001 From: Ansonhkg Date: Mon, 19 Feb 2024 15:55:35 +0000 Subject: [PATCH 7/7] fix: import issue --- .../src/lib/lit-node-client-nodejs.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts b/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts index a83a945162..fd38087665 100644 --- a/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts +++ b/packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts @@ -89,7 +89,7 @@ import { import { computeAddress } from '@ethersproject/transactions'; import { joinSignature, sha256 } from 'ethers/lib/utils'; -import * as from 'siwe'; +import siwe from 'siwe'; import { LitCore } from '@lit-protocol/core'; import { IPFSBundledSDK } from '@lit-protocol/lit-third-party-libs'; @@ -2770,8 +2770,8 @@ export class LitNodeClientNodeJs extends LitCore { const sessionCapabilityObject = params.sessionCapabilityObject ? params.sessionCapabilityObject : await this.generateSessionCapabilityObjectWithWildcards( - params.resourceAbilityRequests.map((r) => r.resource) - ); + params.resourceAbilityRequests.map((r) => r.resource) + ); let expiration = params.expiration || LitNodeClientNodeJs.getExpiration(); if (!this.latestBlockhash) {