Skip to content

Commit e23ce16

Browse files
committed
fix(e2e): fund accounts before creating PKP auth context
1 parent 27aa4f9 commit e23ce16

File tree

4 files changed

+39
-46
lines changed

4 files changed

+39
-46
lines changed

bun.lock

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "@lit-protocol/js-sdk",
66
"dependencies": {
77
"@dotenvx/dotenvx": "^1.6.4",
8-
"@lit-protocol/contracts": "^0.5.0",
8+
"@lit-protocol/contracts": "0.5.1",
99
"@lit-protocol/nacl": "7.1.1",
1010
"@lit-protocol/uint8arrays": "7.1.1",
1111
"@metamask/eth-sig-util": "5.0.2",
@@ -96,22 +96,22 @@
9696
},
9797
"packages/access-control-conditions": {
9898
"name": "@lit-protocol/access-control-conditions",
99-
"version": "8.0.0-beta.6",
99+
"version": "8.0.0-beta.1",
100100
"dependencies": {
101101
"ethers": "^5.7.1",
102102
"zod": "3.24.3",
103103
},
104104
},
105105
"packages/access-control-conditions-schemas": {
106106
"name": "@lit-protocol/access-control-conditions-schemas",
107-
"version": "8.0.0-beta.6",
107+
"version": "8.0.0-beta.1",
108108
"dependencies": {
109109
"zod": "3.24.3",
110110
},
111111
},
112112
"packages/auth": {
113113
"name": "@lit-protocol/auth",
114-
"version": "8.0.0-beta.6",
114+
"version": "8.0.0-beta.1",
115115
"dependencies": {
116116
"@noble/curves": "^1.8.1",
117117
"@simplewebauthn/browser": "^7.2.0",
@@ -133,7 +133,7 @@
133133
},
134134
"packages/auth-helpers": {
135135
"name": "@lit-protocol/auth-helpers",
136-
"version": "8.0.0-beta.6",
136+
"version": "8.0.0-beta.1",
137137
"dependencies": {
138138
"@wagmi/core": "^2.17.1",
139139
"ethers": "^5.7.1",
@@ -145,13 +145,13 @@
145145
},
146146
"packages/auth-services": {
147147
"name": "@lit-protocol/auth-services",
148-
"version": "2.0.0-beta.9",
148+
"version": "2.0.0-beta.1",
149149
"dependencies": {
150150
"@elysiajs/bearer": "^1.2.0",
151151
"@elysiajs/cors": "^1.2.0",
152152
"@elysiajs/static": "^1.3.0",
153153
"@elysiajs/swagger": "^1.2.0",
154-
"@lit-protocol/contracts": "^0.4.0",
154+
"@lit-protocol/contracts": "^0.5.1",
155155
"@simplewebauthn/server": "6.2.1",
156156
"@simplewebauthn/typescript-types": "^8.3.4",
157157
"@t3-oss/env-core": "^0.12.0",
@@ -184,15 +184,15 @@
184184
},
185185
"packages/constants": {
186186
"name": "@lit-protocol/constants",
187-
"version": "8.0.0-beta.6",
187+
"version": "8.0.0-beta.1",
188188
"dependencies": {
189189
"@openagenda/verror": "^3.1.4",
190190
"zod": "3.24.3",
191191
},
192192
},
193193
"packages/crypto": {
194194
"name": "@lit-protocol/crypto",
195-
"version": "8.0.0-beta.6",
195+
"version": "8.0.0-beta.1",
196196
"dependencies": {
197197
"@lit-protocol/nacl": "7.1.1",
198198
"@lit-protocol/uint8arrays": "7.1.1",
@@ -203,7 +203,7 @@
203203
},
204204
"packages/lit-client": {
205205
"name": "@lit-protocol/lit-client",
206-
"version": "8.0.0-beta.6",
206+
"version": "8.0.0-beta.1",
207207
"dependencies": {
208208
"@lit-protocol/uint8arrays": "7.1.1",
209209
"bs58": "^6.0.0",
@@ -213,16 +213,16 @@
213213
},
214214
"packages/logger": {
215215
"name": "@lit-protocol/logger",
216-
"version": "8.0.0-beta.6",
216+
"version": "8.0.0-beta.1",
217217
"dependencies": {
218218
"pino": "^9.6.0",
219219
},
220220
},
221221
"packages/networks": {
222222
"name": "@lit-protocol/networks",
223-
"version": "8.0.0-beta.6",
223+
"version": "8.0.0-beta.1",
224224
"dependencies": {
225-
"@lit-protocol/contracts": "^0.4.0",
225+
"@lit-protocol/contracts": "^0.5.1",
226226
"@lit-protocol/nacl": "7.1.1",
227227
"@noble/curves": "^1.8.1",
228228
"@wagmi/core": "^2.17.1",
@@ -238,7 +238,7 @@
238238
},
239239
"packages/schemas": {
240240
"name": "@lit-protocol/schemas",
241-
"version": "8.0.0-beta.6",
241+
"version": "8.0.0-beta.1",
242242
"dependencies": {
243243
"ethers": "^5.7.1",
244244
"siwe": "^2.3.2",
@@ -248,27 +248,27 @@
248248
},
249249
"packages/types": {
250250
"name": "@lit-protocol/types",
251-
"version": "8.0.0-beta.6",
251+
"version": "8.0.0-beta.1",
252252
"dependencies": {
253253
"ethers": "^5.7.1",
254254
"zod": "3.24.3",
255255
},
256256
},
257257
"packages/wasm": {
258258
"name": "@lit-protocol/wasm",
259-
"version": "8.0.0-beta.6",
259+
"version": "8.0.0-beta.1",
260260
"dependencies": {
261261
"ethers": "^5.7.1",
262262
"pako": "^2.1.0",
263263
},
264264
},
265265
"packages/wrapped-keys": {
266266
"name": "@lit-protocol/wrapped-keys",
267-
"version": "8.0.0-beta.6",
267+
"version": "8.0.0-beta.1",
268268
},
269269
"packages/wrapped-keys-lit-actions": {
270270
"name": "@lit-protocol/wrapped-keys-lit-actions",
271-
"version": "8.0.0-beta.6",
271+
"version": "8.0.0-beta.1",
272272
},
273273
},
274274
"packages": {
@@ -1090,7 +1090,7 @@
10901090

10911091
"@lit-protocol/constants": ["@lit-protocol/constants@workspace:packages/constants"],
10921092

1093-
"@lit-protocol/contracts": ["@lit-protocol/[email protected].0", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-dXQkG5elAME73DulVEKUu/z43nfrCXj5F5rHW/2TsNbj/Da0206fWoeikHm6lJtfqeKpXkaPn6BN98LY6hwWpQ=="],
1093+
"@lit-protocol/contracts": ["@lit-protocol/[email protected].1", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-2j4tQ5ZxNpQakXn7kEmepftlHrqYc5Gc6albDd1EewWvcNYtX32sLEgRGh5/qqYQKvAbA9/9kPFIE+g3p61rrw=="],
10941094

10951095
"@lit-protocol/crypto": ["@lit-protocol/crypto@workspace:packages/crypto"],
10961096

@@ -5028,8 +5028,6 @@
50285028

50295029
"@lerna/write-log-file/write-file-atomic": ["[email protected]", "", { "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" } }, "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg=="],
50305030

5031-
"@lit-protocol/auth-services/@lit-protocol/contracts": ["@lit-protocol/[email protected]", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-+PLkQNab2+n7AS6gLUD+b2JoVMTMSB2BDFRoO5epQuli/wd4HBH7XiwBb15111Ta7fn/+TR0R27YJLoDPNYCPg=="],
5032-
50335031
"@lit-protocol/auth-services/@simplewebauthn/typescript-types": ["@simplewebauthn/[email protected]", "", {}, "sha512-38xtca0OqfRVNloKBrFB5LEM6PN5vzFbJG6rAutPVrtGHFYxPdiV3btYWq0eAZAZmP+dqFPYJxJWeJrGfmYHng=="],
50345032

50355033
"@lit-protocol/auth-services/ethers": ["[email protected]", "", { "dependencies": { "@ethersproject/abi": "5.7.0", "@ethersproject/abstract-provider": "5.7.0", "@ethersproject/abstract-signer": "5.7.0", "@ethersproject/address": "5.7.0", "@ethersproject/base64": "5.7.0", "@ethersproject/basex": "5.7.0", "@ethersproject/bignumber": "5.7.0", "@ethersproject/bytes": "5.7.0", "@ethersproject/constants": "5.7.0", "@ethersproject/contracts": "5.7.0", "@ethersproject/hash": "5.7.0", "@ethersproject/hdnode": "5.7.0", "@ethersproject/json-wallets": "5.7.0", "@ethersproject/keccak256": "5.7.0", "@ethersproject/logger": "5.7.0", "@ethersproject/networks": "5.7.1", "@ethersproject/pbkdf2": "5.7.0", "@ethersproject/properties": "5.7.0", "@ethersproject/providers": "5.7.2", "@ethersproject/random": "5.7.0", "@ethersproject/rlp": "5.7.0", "@ethersproject/sha2": "5.7.0", "@ethersproject/signing-key": "5.7.0", "@ethersproject/solidity": "5.7.0", "@ethersproject/strings": "5.7.0", "@ethersproject/transactions": "5.7.0", "@ethersproject/units": "5.7.0", "@ethersproject/wallet": "5.7.0", "@ethersproject/web": "5.7.1", "@ethersproject/wordlists": "5.7.0" } }, "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg=="],
@@ -5040,8 +5038,6 @@
50405038

50415039
"@lit-protocol/nacl/tslib": ["[email protected]", "", {}, "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="],
50425040

5043-
"@lit-protocol/networks/@lit-protocol/contracts": ["@lit-protocol/[email protected]", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-+PLkQNab2+n7AS6gLUD+b2JoVMTMSB2BDFRoO5epQuli/wd4HBH7XiwBb15111Ta7fn/+TR0R27YJLoDPNYCPg=="],
5044-
50455041
"@lit-protocol/uint8arrays/@lit-protocol/constants": ["@lit-protocol/[email protected]", "", { "dependencies": { "@ethersproject/abstract-provider": "5.7.0", "@lit-protocol/accs-schemas": "^0.0.24", "@lit-protocol/contracts": "^0.0.74", "@lit-protocol/types": "7.1.1", "@openagenda/verror": "^3.1.4", "depd": "^2.0.0", "ethers": "^5.7.1", "siwe": "^2.3.2", "tslib": "1.14.1" } }, "sha512-wJY5r8D0FdvtkQtcjx5JfPC3Qeb5SZ1m72HTcvJdqaJaBgaPP4eg2JSUg9uNJ+knOCyfdiBPl47XlWTGqe1X4Q=="],
50465042

50475043
"@lit-protocol/uint8arrays/@lit-protocol/contracts": ["@lit-protocol/[email protected]", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-8uV038gzBp7ew7a4884SVt9Zhu8CtiTb+A8dKNnByxVoT1kFt4O4DmsaniV8p9AGjNR13IWfpU1NFChmPHVIpQ=="],

e2e/src/init.ts

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ export const init = async (
150150
});
151151
console.log('✅ Master Payment Balance:', masterPaymentBalance);
152152

153+
async function masterDepositForUser(userAddress: string) {
154+
await masterPaymentManager.depositForUser({
155+
userAddress: userAddress,
156+
amountInEth: LIVE_NETWORK_LEDGER_DEPOSIT_AMOUNT,
157+
});
158+
console.log(
159+
`✅ New ${userAddress} Ledger Balance:`,
160+
await masterPaymentManager.getBalance({ userAddress: userAddress })
161+
);
162+
}
163+
153164
/**
154165
* ====================================
155166
* Initialise the AuthManager
@@ -185,6 +196,12 @@ export const init = async (
185196
),
186197
]);
187198

199+
// Making sure all signers have sufficient ledger balance before calling the signSessionKey endpoint
200+
await masterDepositForUser(aliceViemAccount.address);
201+
await masterDepositForUser(bobViemAccount.address);
202+
await masterDepositForUser(aliceViemAccountPkp.ethAddress);
203+
await masterDepositForUser(bobViemAccountPkp.ethAddress);
204+
188205
/**
189206
* ====================================
190207
* Create the auth context
@@ -247,29 +264,9 @@ export const init = async (
247264
* ====================================
248265
*/
249266

250-
async function masterDepositForUser(userAddress: string) {
251-
await masterPaymentManager.depositForUser({
252-
userAddress: userAddress,
253-
amountInEth: LIVE_NETWORK_LEDGER_DEPOSIT_AMOUNT,
254-
});
255-
console.log(
256-
`✅ New ${userAddress} Ledger Balance:`,
257-
await masterPaymentManager.getBalance({ userAddress: userAddress })
258-
);
259-
}
260-
261-
// Deposit to the Alice EOA Ledger
262-
await masterDepositForUser(aliceViemAccount.address);
263-
264-
// Deposit to the PKP Ledger
267+
// Deposit to the PKP Viem account Ledger
265268
await masterDepositForUser(alicePkpViemAccount.address);
266269

267-
// Deposit to the Bob EOA Ledger
268-
await masterDepositForUser(bobViemAccount.address);
269-
270-
// Deposit to the Bob PKP Ledger
271-
await masterDepositForUser(bobViemAccountPkp.ethAddress);
272-
273270
// const alicePkpViemAccountPermissionsManager = await litClient.getPKPPermissionsManager({
274271
// pkpIdentifier: {
275272
// tokenId: aliceViemAccountPkp.tokenId,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"private": true,
3636
"dependencies": {
3737
"@dotenvx/dotenvx": "^1.6.4",
38-
"@lit-protocol/contracts": "^0.5.1",
38+
"@lit-protocol/contracts": "0.5.1",
3939
"@lit-protocol/nacl": "7.1.1",
4040
"@lit-protocol/uint8arrays": "7.1.1",
4141
"@metamask/eth-sig-util": "5.0.2",

packages/networks/src/networks/vNaga/envs/naga-staging/naga-staging.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { ExpectedAccountOrWalletClient } from '../../shared/managers/contra
55

66
const nagaStaging = createBaseModule({
77
networkConfig: nagaStagingEnvironment.getConfig(),
8-
moduleName: 'naga-staging',
8+
moduleName: nagaStagingEnvironment.getNetworkName(),
99
createChainManager: (account: ExpectedAccountOrWalletClient) =>
1010
createChainManager(account),
1111
});

0 commit comments

Comments
 (0)