Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
42 changes: 19 additions & 23 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "@lit-protocol/js-sdk",
"dependencies": {
"@dotenvx/dotenvx": "^1.6.4",
"@lit-protocol/contracts": "^0.5.0",
"@lit-protocol/contracts": "0.5.1",
"@lit-protocol/nacl": "7.1.1",
"@lit-protocol/uint8arrays": "7.1.1",
"@metamask/eth-sig-util": "5.0.2",
Expand Down Expand Up @@ -96,22 +96,22 @@
},
"packages/access-control-conditions": {
"name": "@lit-protocol/access-control-conditions",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"ethers": "^5.7.1",
"zod": "3.24.3",
},
},
"packages/access-control-conditions-schemas": {
"name": "@lit-protocol/access-control-conditions-schemas",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"zod": "3.24.3",
},
},
"packages/auth": {
"name": "@lit-protocol/auth",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"@noble/curves": "^1.8.1",
"@simplewebauthn/browser": "^7.2.0",
Expand All @@ -133,7 +133,7 @@
},
"packages/auth-helpers": {
"name": "@lit-protocol/auth-helpers",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"@wagmi/core": "^2.17.1",
"ethers": "^5.7.1",
Expand All @@ -145,13 +145,13 @@
},
"packages/auth-services": {
"name": "@lit-protocol/auth-services",
"version": "2.0.0-beta.9",
"version": "2.0.0-beta.1",
"dependencies": {
"@elysiajs/bearer": "^1.2.0",
"@elysiajs/cors": "^1.2.0",
"@elysiajs/static": "^1.3.0",
"@elysiajs/swagger": "^1.2.0",
"@lit-protocol/contracts": "^0.4.0",
"@lit-protocol/contracts": "^0.5.1",
"@simplewebauthn/server": "6.2.1",
"@simplewebauthn/typescript-types": "^8.3.4",
"@t3-oss/env-core": "^0.12.0",
Expand Down Expand Up @@ -184,15 +184,15 @@
},
"packages/constants": {
"name": "@lit-protocol/constants",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"@openagenda/verror": "^3.1.4",
"zod": "3.24.3",
},
},
"packages/crypto": {
"name": "@lit-protocol/crypto",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"@lit-protocol/nacl": "7.1.1",
"@lit-protocol/uint8arrays": "7.1.1",
Expand All @@ -203,7 +203,7 @@
},
"packages/lit-client": {
"name": "@lit-protocol/lit-client",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"@lit-protocol/uint8arrays": "7.1.1",
"bs58": "^6.0.0",
Expand All @@ -213,16 +213,16 @@
},
"packages/logger": {
"name": "@lit-protocol/logger",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"pino": "^9.6.0",
},
},
"packages/networks": {
"name": "@lit-protocol/networks",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"@lit-protocol/contracts": "^0.4.0",
"@lit-protocol/contracts": "^0.5.1",
"@lit-protocol/nacl": "7.1.1",
"@noble/curves": "^1.8.1",
"@wagmi/core": "^2.17.1",
Expand All @@ -238,7 +238,7 @@
},
"packages/schemas": {
"name": "@lit-protocol/schemas",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"ethers": "^5.7.1",
"siwe": "^2.3.2",
Expand All @@ -248,27 +248,27 @@
},
"packages/types": {
"name": "@lit-protocol/types",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"ethers": "^5.7.1",
"zod": "3.24.3",
},
},
"packages/wasm": {
"name": "@lit-protocol/wasm",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
"dependencies": {
"ethers": "^5.7.1",
"pako": "^2.1.0",
},
},
"packages/wrapped-keys": {
"name": "@lit-protocol/wrapped-keys",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
},
"packages/wrapped-keys-lit-actions": {
"name": "@lit-protocol/wrapped-keys-lit-actions",
"version": "8.0.0-beta.6",
"version": "8.0.0-beta.1",
},
},
"packages": {
Expand Down Expand Up @@ -1090,7 +1090,7 @@

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

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

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

Expand Down Expand Up @@ -5028,8 +5028,6 @@

"@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=="],

"@lit-protocol/auth-services/@lit-protocol/contracts": ["@lit-protocol/[email protected]", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-+PLkQNab2+n7AS6gLUD+b2JoVMTMSB2BDFRoO5epQuli/wd4HBH7XiwBb15111Ta7fn/+TR0R27YJLoDPNYCPg=="],

"@lit-protocol/auth-services/@simplewebauthn/typescript-types": ["@simplewebauthn/[email protected]", "", {}, "sha512-38xtca0OqfRVNloKBrFB5LEM6PN5vzFbJG6rAutPVrtGHFYxPdiV3btYWq0eAZAZmP+dqFPYJxJWeJrGfmYHng=="],

"@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=="],
Expand All @@ -5040,8 +5038,6 @@

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

"@lit-protocol/networks/@lit-protocol/contracts": ["@lit-protocol/[email protected]", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-+PLkQNab2+n7AS6gLUD+b2JoVMTMSB2BDFRoO5epQuli/wd4HBH7XiwBb15111Ta7fn/+TR0R27YJLoDPNYCPg=="],

"@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=="],

"@lit-protocol/uint8arrays/@lit-protocol/contracts": ["@lit-protocol/[email protected]", "", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-8uV038gzBp7ew7a4884SVt9Zhu8CtiTb+A8dKNnByxVoT1kFt4O4DmsaniV8p9AGjNR13IWfpU1NFChmPHVIpQ=="],
Expand Down
39 changes: 18 additions & 21 deletions e2e/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ export const init = async (
});
console.log('✅ Master Payment Balance:', masterPaymentBalance);

async function masterDepositForUser(userAddress: string) {
await masterPaymentManager.depositForUser({
userAddress: userAddress,
amountInEth: LIVE_NETWORK_LEDGER_DEPOSIT_AMOUNT,
});
console.log(
`✅ New ${userAddress} Ledger Balance:`,
await masterPaymentManager.getBalance({ userAddress: userAddress })
);
}

/**
* ====================================
* Initialise the AuthManager
Expand Down Expand Up @@ -185,6 +196,12 @@ export const init = async (
),
]);

// Making sure all signers have sufficient ledger balance before calling the signSessionKey endpoint
await masterDepositForUser(aliceViemAccount.address);
await masterDepositForUser(bobViemAccount.address);
await masterDepositForUser(aliceViemAccountPkp.ethAddress);
await masterDepositForUser(bobViemAccountPkp.ethAddress);

/**
* ====================================
* Create the auth context
Expand Down Expand Up @@ -247,29 +264,9 @@ export const init = async (
* ====================================
*/

async function masterDepositForUser(userAddress: string) {
await masterPaymentManager.depositForUser({
userAddress: userAddress,
amountInEth: LIVE_NETWORK_LEDGER_DEPOSIT_AMOUNT,
});
console.log(
`✅ New ${userAddress} Ledger Balance:`,
await masterPaymentManager.getBalance({ userAddress: userAddress })
);
}

// Deposit to the Alice EOA Ledger
await masterDepositForUser(aliceViemAccount.address);

// Deposit to the PKP Ledger
// Deposit to the PKP Viem account Ledger
await masterDepositForUser(alicePkpViemAccount.address);

// Deposit to the Bob EOA Ledger
await masterDepositForUser(bobViemAccount.address);

// Deposit to the Bob PKP Ledger
await masterDepositForUser(bobViemAccountPkp.ethAddress);

// const alicePkpViemAccountPermissionsManager = await litClient.getPKPPermissionsManager({
// pkpIdentifier: {
// tokenId: aliceViemAccountPkp.tokenId,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"private": true,
"dependencies": {
"@dotenvx/dotenvx": "^1.6.4",
"@lit-protocol/contracts": "^0.5.0",
"@lit-protocol/contracts": "0.5.1",
"@lit-protocol/nacl": "7.1.1",
"@lit-protocol/uint8arrays": "7.1.1",
"@metamask/eth-sig-util": "5.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@elysiajs/cors": "^1.2.0",
"@elysiajs/static": "^1.3.0",
"@elysiajs/swagger": "^1.2.0",
"@lit-protocol/contracts": "^0.4.0",
"@lit-protocol/contracts": "^0.5.1",
"@simplewebauthn/server": "6.2.1",
"@simplewebauthn/typescript-types": "^8.3.4",
"@t3-oss/env-core": "^0.12.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/networks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"directory": "../../dist/packages/networks"
},
"dependencies": {
"@lit-protocol/contracts": "^0.4.0",
"@lit-protocol/contracts": "^0.5.1",
"@lit-protocol/nacl": "7.1.1",
"@noble/curves": "^1.8.1",
"@wagmi/core": "^2.17.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { ExpectedAccountOrWalletClient } from '../../shared/managers/contra

const nagaStaging = createBaseModule({
networkConfig: nagaStagingEnvironment.getConfig(),
moduleName: 'naga-staging',
moduleName: nagaStagingEnvironment.getNetworkName(),
createChainManager: (account: ExpectedAccountOrWalletClient) =>
createChainManager(account),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const mintPKP = async (
const tx = await mintNextAndAddAuthMethods(
{
keyType: 2,
keySetId: 'naga-keyset1',
permittedAuthMethodTypes: [validatedRequest.authMethodType],
permittedAuthMethodIds: [validatedRequest.authMethodId],
permittedAuthMethodPubkeys: [validatedRequest.pubkey],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const mintWithMultiAuths = async (
const tx = await mintNextAndAddAuthMethods(
{
keyType: 2,
keySetId: 'naga-keyset1',
permittedAuthMethodTypes: validatedRequest.authMethodTypes,
permittedAuthMethodIds: validatedRequest.authMethodIds,
permittedAuthMethodPubkeys: validatedRequest.pubkeys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function mintNext(
const hash = await callWithAdjustedOverrides(
pkpNftContract,
'mintNext',
[2],
[2, 'naga-keyset1'],
{
value: mintCost,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export async function mintNextAndAddAuthMethods(
'mintNextAndAddAuthMethods',
[
validatedRequest.keyType,
validatedRequest.keySetId,
validatedRequest.permittedAuthMethodTypes,
validatedRequest.permittedAuthMethodIds,
validatedRequest.permittedAuthMethodPubkeys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {

export const MintRequestSchema = z.object({
keyType: toBigInt,
keySetId: z.literal('naga-keyset1'),
permittedAuthMethodTypes: toBigIntArray,
permittedAuthMethodIds: toHexStringArray,
permittedAuthMethodPubkeys: toHexStringArray,
Expand Down
Loading