@lit-protocol/vincent-e2e-test-utils 3.0.1 → 3.0.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +2 -6
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -16
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.d.ts +3 -0
- package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.d.ts.map +1 -0
- package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.js +32 -0
- package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.js.map +1 -0
- package/dist/src/lib/setup/app-registration/handleAppRegistration.d.ts +14 -0
- package/dist/src/lib/setup/app-registration/handleAppRegistration.d.ts.map +1 -0
- package/dist/src/lib/setup/app-registration/handleAppRegistration.js +43 -0
- package/dist/src/lib/setup/app-registration/handleAppRegistration.js.map +1 -0
- package/dist/src/lib/setup/app-registration/registerNewApp.d.ts +17 -0
- package/dist/src/lib/setup/app-registration/registerNewApp.d.ts.map +1 -0
- package/dist/src/lib/setup/app-registration/registerNewApp.js +46 -0
- package/dist/src/lib/setup/app-registration/registerNewApp.js.map +1 -0
- package/dist/src/lib/setup/app-registration/registerNewAppVersion.d.ts +16 -0
- package/dist/src/lib/setup/app-registration/registerNewAppVersion.d.ts.map +1 -0
- package/dist/src/lib/setup/app-registration/registerNewAppVersion.js +68 -0
- package/dist/src/lib/setup/app-registration/registerNewAppVersion.js.map +1 -0
- package/dist/src/lib/setup/app-setup.d.ts +19 -0
- package/dist/src/lib/setup/app-setup.d.ts.map +1 -0
- package/dist/src/lib/setup/app-setup.js +37 -0
- package/dist/src/lib/setup/app-setup.js.map +1 -0
- package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.d.ts +10 -0
- package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.d.ts.map +1 -0
- package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.js +17 -0
- package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.js.map +1 -0
- package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.d.ts +12 -0
- package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.d.ts.map +1 -0
- package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.js +23 -0
- package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.js.map +1 -0
- package/dist/src/lib/setup/getEnv.d.ts +2 -0
- package/dist/src/lib/setup/getEnv.d.ts.map +1 -0
- package/dist/src/lib/setup/getEnv.js +16 -0
- package/dist/src/lib/setup/getEnv.js.map +1 -0
- package/dist/src/lib/setup/index.d.ts +9 -0
- package/dist/src/lib/setup/index.d.ts.map +1 -0
- package/dist/src/lib/setup/index.js +18 -0
- package/dist/src/lib/setup/index.js.map +1 -0
- package/dist/src/lib/setup/setupAgentSmartAccount.d.ts +19 -0
- package/dist/src/lib/setup/setupAgentSmartAccount.d.ts.map +1 -0
- package/dist/src/lib/setup/setupAgentSmartAccount.js +100 -0
- package/dist/src/lib/setup/setupAgentSmartAccount.js.map +1 -0
- package/dist/src/lib/setup/smart-account/createPermissionApproval.d.ts +11 -0
- package/dist/src/lib/setup/smart-account/createPermissionApproval.d.ts.map +1 -0
- package/dist/src/lib/setup/smart-account/createPermissionApproval.js +45 -0
- package/dist/src/lib/setup/smart-account/createPermissionApproval.js.map +1 -0
- package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.d.ts +16 -0
- package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.d.ts.map +1 -0
- package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.js +128 -0
- package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.js.map +1 -0
- package/dist/src/lib/setup/smart-account/deriveAgentAddress.d.ts +23 -0
- package/dist/src/lib/setup/smart-account/deriveAgentAddress.d.ts.map +1 -0
- package/dist/src/lib/setup/smart-account/deriveAgentAddress.js +36 -0
- package/dist/src/lib/setup/smart-account/deriveAgentAddress.js.map +1 -0
- package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.d.ts +12 -0
- package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.d.ts.map +1 -0
- package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.js +82 -0
- package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.js.map +1 -0
- package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.d.ts +10 -0
- package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.d.ts.map +1 -0
- package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.js +34 -0
- package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.js.map +1 -0
- package/dist/src/lib/setup/types.d.ts +92 -0
- package/dist/src/lib/setup/types.d.ts.map +1 -0
- package/dist/src/lib/{types.js.map → setup/types.js.map} +1 -1
- package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.d.ts +32 -0
- package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.d.ts.map +1 -0
- package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.js +58 -0
- package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.js.map +1 -0
- package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.d.ts +4 -0
- package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.d.ts.map +1 -0
- package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.js +28 -0
- package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.js.map +1 -0
- package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.d.ts +31 -0
- package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.d.ts.map +1 -0
- package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.js +31 -0
- package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.js.map +1 -0
- package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.d.ts +9 -0
- package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.d.ts.map +1 -0
- package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.js +27 -0
- package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.js.map +1 -0
- package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.d.ts +8 -0
- package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.d.ts.map +1 -0
- package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.js +30 -0
- package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.js.map +1 -0
- package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.d.ts +7 -0
- package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.d.ts.map +1 -0
- package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.js +25 -0
- package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.js.map +1 -0
- package/dist/src/lib/setup/wallets/ensureWalletHasTokens.d.ts +14 -0
- package/dist/src/lib/setup/wallets/ensureWalletHasTokens.d.ts.map +1 -0
- package/dist/src/lib/setup/wallets/ensureWalletHasTokens.js +27 -0
- package/dist/src/lib/setup/wallets/ensureWalletHasTokens.js.map +1 -0
- package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.d.ts +15 -0
- package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.d.ts.map +1 -0
- package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.js +63 -0
- package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.js.map +1 -0
- package/dist/src/lib/setup/wallets/setupWallets.d.ts +48 -0
- package/dist/src/lib/setup/wallets/setupWallets.d.ts.map +1 -0
- package/dist/src/lib/setup/wallets/setupWallets.js +159 -0
- package/dist/src/lib/setup/wallets/setupWallets.js.map +1 -0
- package/dist/src/lib/setupVincentDevelopmentEnv.d.ts +3 -0
- package/dist/src/lib/setupVincentDevelopmentEnv.d.ts.map +1 -0
- package/dist/src/lib/setupVincentDevelopmentEnv.js +64 -0
- package/dist/src/lib/setupVincentDevelopmentEnv.js.map +1 -0
- package/package.json +3 -7
- package/dist/src/lib/appManager/ensure-funded.d.ts +0 -2
- package/dist/src/lib/appManager/ensure-funded.d.ts.map +0 -1
- package/dist/src/lib/appManager/ensure-funded.js +0 -11
- package/dist/src/lib/appManager/ensure-funded.js.map +0 -1
- package/dist/src/lib/appManager/index.d.ts +0 -5
- package/dist/src/lib/appManager/index.d.ts.map +0 -1
- package/dist/src/lib/appManager/index.js +0 -12
- package/dist/src/lib/appManager/index.js.map +0 -1
- package/dist/src/lib/appManager/register-new-app-version.d.ts +0 -28
- package/dist/src/lib/appManager/register-new-app-version.d.ts.map +0 -1
- package/dist/src/lib/appManager/register-new-app-version.js +0 -82
- package/dist/src/lib/appManager/register-new-app-version.js.map +0 -1
- package/dist/src/lib/appManager/register-new-app.d.ts +0 -13
- package/dist/src/lib/appManager/register-new-app.d.ts.map +0 -1
- package/dist/src/lib/appManager/register-new-app.js +0 -25
- package/dist/src/lib/appManager/register-new-app.js.map +0 -1
- package/dist/src/lib/appManager/remove-delegatee-from-app.d.ts +0 -7
- package/dist/src/lib/appManager/remove-delegatee-from-app.d.ts.map +0 -1
- package/dist/src/lib/appManager/remove-delegatee-from-app.js +0 -26
- package/dist/src/lib/appManager/remove-delegatee-from-app.js.map +0 -1
- package/dist/src/lib/chain.d.ts +0 -13
- package/dist/src/lib/chain.d.ts.map +0 -1
- package/dist/src/lib/chain.js +0 -30
- package/dist/src/lib/chain.js.map +0 -1
- package/dist/src/lib/create-random-vincent-wallets.d.ts +0 -7
- package/dist/src/lib/create-random-vincent-wallets.d.ts.map +0 -1
- package/dist/src/lib/create-random-vincent-wallets.js +0 -12
- package/dist/src/lib/create-random-vincent-wallets.js.map +0 -1
- package/dist/src/lib/delegatee/ensure-funded.d.ts +0 -2
- package/dist/src/lib/delegatee/ensure-funded.d.ts.map +0 -1
- package/dist/src/lib/delegatee/ensure-funded.js +0 -11
- package/dist/src/lib/delegatee/ensure-funded.js.map +0 -1
- package/dist/src/lib/delegatee/get-app-info.d.ts +0 -5
- package/dist/src/lib/delegatee/get-app-info.d.ts.map +0 -1
- package/dist/src/lib/delegatee/get-app-info.js +0 -19
- package/dist/src/lib/delegatee/get-app-info.js.map +0 -1
- package/dist/src/lib/delegatee/index.d.ts +0 -3
- package/dist/src/lib/delegatee/index.d.ts.map +0 -1
- package/dist/src/lib/delegatee/index.js +0 -8
- package/dist/src/lib/delegatee/index.js.map +0 -1
- package/dist/src/lib/delegator/add-permission-for-abilities.d.ts +0 -4
- package/dist/src/lib/delegator/add-permission-for-abilities.d.ts.map +0 -1
- package/dist/src/lib/delegator/add-permission-for-abilities.js +0 -21
- package/dist/src/lib/delegator/add-permission-for-abilities.js.map +0 -1
- package/dist/src/lib/delegator/agent-pkp.d.ts +0 -20
- package/dist/src/lib/delegator/agent-pkp.d.ts.map +0 -1
- package/dist/src/lib/delegator/agent-pkp.js +0 -96
- package/dist/src/lib/delegator/agent-pkp.js.map +0 -1
- package/dist/src/lib/delegator/get-platform-user-pkp-wallet.d.ts +0 -8
- package/dist/src/lib/delegator/get-platform-user-pkp-wallet.d.ts.map +0 -1
- package/dist/src/lib/delegator/get-platform-user-pkp-wallet.js +0 -77
- package/dist/src/lib/delegator/get-platform-user-pkp-wallet.js.map +0 -1
- package/dist/src/lib/delegator/index.d.ts +0 -7
- package/dist/src/lib/delegator/index.d.ts.map +0 -1
- package/dist/src/lib/delegator/index.js +0 -20
- package/dist/src/lib/delegator/index.js.map +0 -1
- package/dist/src/lib/delegator/permit-vincent-app-version.d.ts +0 -19
- package/dist/src/lib/delegator/permit-vincent-app-version.d.ts.map +0 -1
- package/dist/src/lib/delegator/permit-vincent-app-version.js +0 -45
- package/dist/src/lib/delegator/permit-vincent-app-version.js.map +0 -1
- package/dist/src/lib/delegator/platform-user-pkp.d.ts +0 -10
- package/dist/src/lib/delegator/platform-user-pkp.d.ts.map +0 -1
- package/dist/src/lib/delegator/platform-user-pkp.js +0 -48
- package/dist/src/lib/delegator/platform-user-pkp.js.map +0 -1
- package/dist/src/lib/ensure-capacity-credit.d.ts +0 -4
- package/dist/src/lib/ensure-capacity-credit.d.ts.map +0 -1
- package/dist/src/lib/ensure-capacity-credit.js +0 -57
- package/dist/src/lib/ensure-capacity-credit.js.map +0 -1
- package/dist/src/lib/env.d.ts +0 -30
- package/dist/src/lib/env.d.ts.map +0 -1
- package/dist/src/lib/env.js +0 -58
- package/dist/src/lib/env.js.map +0 -1
- package/dist/src/lib/environment/crossmint.d.ts +0 -3
- package/dist/src/lib/environment/crossmint.d.ts.map +0 -1
- package/dist/src/lib/environment/crossmint.js +0 -23
- package/dist/src/lib/environment/crossmint.js.map +0 -1
- package/dist/src/lib/environment/safe.d.ts +0 -567
- package/dist/src/lib/environment/safe.d.ts.map +0 -1
- package/dist/src/lib/environment/safe.js +0 -41
- package/dist/src/lib/environment/safe.js.map +0 -1
- package/dist/src/lib/environment/zerodev.d.ts +0 -49
- package/dist/src/lib/environment/zerodev.d.ts.map +0 -1
- package/dist/src/lib/environment/zerodev.js +0 -32
- package/dist/src/lib/environment/zerodev.js.map +0 -1
- package/dist/src/lib/funder/check-funder-balance.d.ts +0 -3
- package/dist/src/lib/funder/check-funder-balance.d.ts.map +0 -1
- package/dist/src/lib/funder/check-funder-balance.js +0 -19
- package/dist/src/lib/funder/check-funder-balance.js.map +0 -1
- package/dist/src/lib/funder/ensure-wallet-has-test-tokens.d.ts +0 -5
- package/dist/src/lib/funder/ensure-wallet-has-test-tokens.d.ts.map +0 -1
- package/dist/src/lib/funder/ensure-wallet-has-test-tokens.js +0 -35
- package/dist/src/lib/funder/ensure-wallet-has-test-tokens.js.map +0 -1
- package/dist/src/lib/funder/index.d.ts +0 -5
- package/dist/src/lib/funder/index.d.ts.map +0 -1
- package/dist/src/lib/funder/index.js +0 -10
- package/dist/src/lib/funder/index.js.map +0 -1
- package/dist/src/lib/index.d.ts +0 -18
- package/dist/src/lib/index.d.ts.map +0 -1
- package/dist/src/lib/index.js +0 -31
- package/dist/src/lib/index.js.map +0 -1
- package/dist/src/lib/litContractsClient/LitContractsInstance.d.ts +0 -14
- package/dist/src/lib/litContractsClient/LitContractsInstance.d.ts.map +0 -1
- package/dist/src/lib/litContractsClient/LitContractsInstance.js +0 -48
- package/dist/src/lib/litContractsClient/LitContractsInstance.js.map +0 -1
- package/dist/src/lib/litContractsClient/get-lit-contract-client.d.ts +0 -7
- package/dist/src/lib/litContractsClient/get-lit-contract-client.d.ts.map +0 -1
- package/dist/src/lib/litContractsClient/get-lit-contract-client.js +0 -19
- package/dist/src/lib/litContractsClient/get-lit-contract-client.js.map +0 -1
- package/dist/src/lib/litContractsClient/index.d.ts +0 -3
- package/dist/src/lib/litContractsClient/index.d.ts.map +0 -1
- package/dist/src/lib/litContractsClient/index.js +0 -8
- package/dist/src/lib/litContractsClient/index.js.map +0 -1
- package/dist/src/lib/mint-new-pkp.d.ts +0 -16
- package/dist/src/lib/mint-new-pkp.d.ts.map +0 -1
- package/dist/src/lib/mint-new-pkp.js +0 -40
- package/dist/src/lib/mint-new-pkp.js.map +0 -1
- package/dist/src/lib/setup-vincent-development-environment.d.ts +0 -81
- package/dist/src/lib/setup-vincent-development-environment.d.ts.map +0 -1
- package/dist/src/lib/setup-vincent-development-environment.js +0 -185
- package/dist/src/lib/setup-vincent-development-environment.js.map +0 -1
- package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.d.ts +0 -3
- package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.d.ts.map +0 -1
- package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.js +0 -96
- package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.js.map +0 -1
- package/dist/src/lib/smartAccount/index.d.ts +0 -5
- package/dist/src/lib/smartAccount/index.d.ts.map +0 -1
- package/dist/src/lib/smartAccount/index.js +0 -10
- package/dist/src/lib/smartAccount/index.js.map +0 -1
- package/dist/src/lib/smartAccount/safe/setup-safe-account.d.ts +0 -15
- package/dist/src/lib/smartAccount/safe/setup-safe-account.d.ts.map +0 -1
- package/dist/src/lib/smartAccount/safe/setup-safe-account.js +0 -92
- package/dist/src/lib/smartAccount/safe/setup-safe-account.js.map +0 -1
- package/dist/src/lib/smartAccount/types.d.ts +0 -30
- package/dist/src/lib/smartAccount/types.d.ts.map +0 -1
- package/dist/src/lib/smartAccount/types.js.map +0 -1
- package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.d.ts +0 -3
- package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.d.ts.map +0 -1
- package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.js +0 -24
- package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.js.map +0 -1
- package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.d.ts +0 -18
- package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.d.ts.map +0 -1
- package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.js +0 -112
- package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.js.map +0 -1
- package/dist/src/lib/types.d.ts +0 -17
- package/dist/src/lib/types.d.ts.map +0 -1
- package/dist/src/lib/types.js +0 -3
- /package/dist/src/lib/{smartAccount → setup}/types.js +0 -0
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupVincentDevelopmentEnvironment = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const viem_1 = require("viem");
|
|
6
|
-
const accounts_1 = require("viem/accounts");
|
|
7
|
-
const viemChains = tslib_1.__importStar(require("viem/chains"));
|
|
8
|
-
const appManager = tslib_1.__importStar(require("./appManager"));
|
|
9
|
-
const chain_1 = require("./chain");
|
|
10
|
-
const delegatee = tslib_1.__importStar(require("./delegatee"));
|
|
11
|
-
const delegator = tslib_1.__importStar(require("./delegator"));
|
|
12
|
-
const ensure_capacity_credit_1 = require("./ensure-capacity-credit");
|
|
13
|
-
const env_1 = require("./env");
|
|
14
|
-
const funder = tslib_1.__importStar(require("./funder"));
|
|
15
|
-
const smartAccount_1 = require("./smartAccount");
|
|
16
|
-
/**
|
|
17
|
-
* Helper function to set up a Vincent development environment with the new PKP hierarchy.
|
|
18
|
-
* This function handles all the necessary setup steps including:
|
|
19
|
-
* - Checking and funding all required accounts (funder, app delegatee, app manager)
|
|
20
|
-
* - Registering or updating your app with abilities and policies
|
|
21
|
-
* - Creating or using an existing Platform User PKP (owned by EOA)
|
|
22
|
-
* - Creating or using an existing Agent PKP for the app (owned by Platform User PKP)
|
|
23
|
-
* - Setting up permissions for the Agent PKP
|
|
24
|
-
* - Ensuring a valid capacity token exists
|
|
25
|
-
* - Optionally creating a smart account owned by agentWalletOwner with the PKP as a permitted signer
|
|
26
|
-
*
|
|
27
|
-
* PKP Hierarchy: EOA → Platform User PKP → Agent PKP (per app)
|
|
28
|
-
*
|
|
29
|
-
* @param permissionData permission data containing abilities and their policies
|
|
30
|
-
* @param smartAccountType type of smart account to create: 'zerodev', 'crossmint', 'safe', or false to disable
|
|
31
|
-
* @returns the setup result including agent PKP info, wallets, app ID, app version, and optional smart account info
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* // Example with no policies
|
|
35
|
-
* const permissionData = {
|
|
36
|
-
* [bundledVincentAbility.ipfsCid]: {},
|
|
37
|
-
* };
|
|
38
|
-
*
|
|
39
|
-
* // Example with policies
|
|
40
|
-
* const permissionDataWithPolicies = {
|
|
41
|
-
* [bundledVincentAbility.ipfsCid]: {
|
|
42
|
-
* [spendingLimitPolicy.ipfsCid]: {
|
|
43
|
-
* limit: '1000000',
|
|
44
|
-
* period: '86400',
|
|
45
|
-
* },
|
|
46
|
-
* },
|
|
47
|
-
* };
|
|
48
|
-
*
|
|
49
|
-
* // EOA mode
|
|
50
|
-
* const result = await setupVincentDevelopmentEnvironment({ permissionData });
|
|
51
|
-
*
|
|
52
|
-
* // ZeroDev smart account mode (requires SMART_ACCOUNT_CHAIN_ID and ZERODEV_RPC_URL env vars)
|
|
53
|
-
* const result = await setupVincentDevelopmentEnvironment({
|
|
54
|
-
* permissionData,
|
|
55
|
-
* smartAccountType: 'zerodev',
|
|
56
|
-
* });
|
|
57
|
-
*
|
|
58
|
-
* // Crossmint smart account mode (requires SMART_ACCOUNT_CHAIN_ID and CROSSMINT_API_KEY env vars)
|
|
59
|
-
* const result = await setupVincentDevelopmentEnvironment({
|
|
60
|
-
* permissionData,
|
|
61
|
-
* smartAccountType: 'crossmint',
|
|
62
|
-
* });
|
|
63
|
-
*
|
|
64
|
-
* // Safe smart account mode (requires SMART_ACCOUNT_CHAIN_ID, SAFE_RPC_URL, and PIMLICO_RPC_URL env vars)
|
|
65
|
-
* const result = await setupVincentDevelopmentEnvironment({
|
|
66
|
-
* permissionData,
|
|
67
|
-
* smartAccountType: 'safe',
|
|
68
|
-
* });
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
const setupVincentDevelopmentEnvironment = async ({ permissionData, smartAccountType, agentAddress, }) => {
|
|
72
|
-
// Check and fund all required accounts
|
|
73
|
-
await funder.checkFunderBalance();
|
|
74
|
-
await delegatee.ensureAppDelegateeFunded();
|
|
75
|
-
await appManager.ensureAppManagerFunded();
|
|
76
|
-
const chainHelpers = await (0, chain_1.getChainHelpers)();
|
|
77
|
-
const wallets = chainHelpers.wallets;
|
|
78
|
-
const abilityIpfsCids = Object.keys(permissionData);
|
|
79
|
-
const abilityPolicies = abilityIpfsCids.map((abilityIpfsCid) => {
|
|
80
|
-
return Object.keys(permissionData[abilityIpfsCid]);
|
|
81
|
-
});
|
|
82
|
-
// If an app exists for the delegatee, we will create a new app version with the new ipfs cids
|
|
83
|
-
// Otherwise, we will create an app w/ version 1 appVersion with the new ipfs cids
|
|
84
|
-
const existingApp = await delegatee.getAppInfo();
|
|
85
|
-
let appId;
|
|
86
|
-
let appVersion;
|
|
87
|
-
if (!existingApp) {
|
|
88
|
-
const newApp = await appManager.registerNewApp({ abilityIpfsCids, abilityPolicies });
|
|
89
|
-
appId = newApp.appId;
|
|
90
|
-
appVersion = newApp.appVersion;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
const newAppVersion = await appManager.registerNewAppVersion({
|
|
94
|
-
abilityIpfsCids,
|
|
95
|
-
abilityPolicies,
|
|
96
|
-
});
|
|
97
|
-
appId = existingApp.appId;
|
|
98
|
-
appVersion = newAppVersion.appVersion;
|
|
99
|
-
}
|
|
100
|
-
// Ensure capacity token for the EOA wallet that owns the Platform User PKP
|
|
101
|
-
await (0, ensure_capacity_credit_1.ensureUnexpiredCapacityToken)(wallets.platformUserWalletOwner);
|
|
102
|
-
// Get or create the Platform User PKP (owned by the EOA)
|
|
103
|
-
// This also ensures the PKP has ETH for gas
|
|
104
|
-
const platformUserPkpInfo = await delegator.getFundedPlatformUserPkp();
|
|
105
|
-
// Get Platform User PKP ethers wallet for signing operations
|
|
106
|
-
const platformUserPkpWallet = await delegator.getPlatformUserPkpWallet(platformUserPkpInfo);
|
|
107
|
-
// Ensure capacity token for the Platform User PKP wallet
|
|
108
|
-
await (0, ensure_capacity_credit_1.ensureUnexpiredCapacityToken)(platformUserPkpWallet);
|
|
109
|
-
// Get or create the Agent PKP for this app (owned by the Platform User PKP)
|
|
110
|
-
const agentPkpInfo = await delegator.getFundedAgentPkp(appId);
|
|
111
|
-
// Optionally set up smart account
|
|
112
|
-
let smartAccount;
|
|
113
|
-
let resolvedAgentAddress = agentAddress ?? agentPkpInfo.ethAddress;
|
|
114
|
-
if (smartAccountType) {
|
|
115
|
-
console.log(`\n🔧 Setting up ${smartAccountType} smart account...\n`);
|
|
116
|
-
const env = (0, env_1.getEnv)();
|
|
117
|
-
const { SMART_ACCOUNT_CHAIN_ID } = env;
|
|
118
|
-
if (!SMART_ACCOUNT_CHAIN_ID) {
|
|
119
|
-
throw new Error('SMART_ACCOUNT_CHAIN_ID env var is required when smartAccountType is set');
|
|
120
|
-
}
|
|
121
|
-
const chainId = parseInt(SMART_ACCOUNT_CHAIN_ID);
|
|
122
|
-
// Extract chain from viem's exported chains using chainId
|
|
123
|
-
const chains = Object.values(viemChains);
|
|
124
|
-
// Type assertion needed: extractChain expects literal union type but we have runtime value from env
|
|
125
|
-
const chain = (0, viem_1.extractChain)({
|
|
126
|
-
chains,
|
|
127
|
-
id: chainId,
|
|
128
|
-
});
|
|
129
|
-
// Convert ethers wallet to viem account
|
|
130
|
-
const ownerAccount = (0, accounts_1.privateKeyToAccount)(wallets.platformUserWalletOwner.privateKey);
|
|
131
|
-
if (smartAccountType === 'zerodev') {
|
|
132
|
-
smartAccount = await (0, smartAccount_1.setupZerodevAccount)({
|
|
133
|
-
ownerAccount,
|
|
134
|
-
permittedAddress: agentPkpInfo.ethAddress,
|
|
135
|
-
chain,
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
else if (smartAccountType === 'crossmint') {
|
|
139
|
-
smartAccount = await (0, smartAccount_1.setupCrossmintAccount)({
|
|
140
|
-
ownerAccount,
|
|
141
|
-
permittedAddress: agentPkpInfo.ethAddress,
|
|
142
|
-
chain,
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
smartAccount = await (0, smartAccount_1.setupSafeAccount)({
|
|
147
|
-
ownerAccount,
|
|
148
|
-
permittedAddress: agentPkpInfo.ethAddress,
|
|
149
|
-
chain,
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
resolvedAgentAddress = smartAccount.account.address;
|
|
153
|
-
}
|
|
154
|
-
if (resolvedAgentAddress === agentPkpInfo.ethAddress) {
|
|
155
|
-
console.warn('[setupVincentDevelopmentEnvironment] Using agent PKP address as agentAddress. Set agentAddress or smartAccountType to use a smart account.');
|
|
156
|
-
}
|
|
157
|
-
// Permit the app version for the Agent PKP
|
|
158
|
-
await delegator.permitAppVersionForAgentWalletPkp({
|
|
159
|
-
permissionData,
|
|
160
|
-
appId,
|
|
161
|
-
appVersion,
|
|
162
|
-
agentPkpInfo,
|
|
163
|
-
platformUserPkpWallet,
|
|
164
|
-
agentAddress: resolvedAgentAddress,
|
|
165
|
-
});
|
|
166
|
-
// Add permissions for abilities to the Agent PKP
|
|
167
|
-
// Note: This uses the Platform User PKP wallet to add permissions
|
|
168
|
-
await delegator.addPermissionForAbilities(platformUserPkpWallet, agentPkpInfo.tokenId, abilityIpfsCids);
|
|
169
|
-
// Ensure capacity token is valid and unexpired
|
|
170
|
-
await (0, ensure_capacity_credit_1.ensureUnexpiredCapacityToken)(wallets.appDelegatee);
|
|
171
|
-
return {
|
|
172
|
-
agentPkpInfo,
|
|
173
|
-
agentAddress: resolvedAgentAddress,
|
|
174
|
-
platformUserPkpInfo,
|
|
175
|
-
wallets: {
|
|
176
|
-
...wallets,
|
|
177
|
-
platformUserPkpWallet,
|
|
178
|
-
},
|
|
179
|
-
appId,
|
|
180
|
-
appVersion,
|
|
181
|
-
smartAccount,
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
exports.setupVincentDevelopmentEnvironment = setupVincentDevelopmentEnvironment;
|
|
185
|
-
//# sourceMappingURL=setup-vincent-development-environment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-vincent-development-environment.js","sourceRoot":"","sources":["../../../src/lib/setup-vincent-development-environment.ts"],"names":[],"mappings":";;;;AAEA,+BAAoC;AACpC,4CAAoD;AACpD,gEAA0C;AAQ1C,iEAA2C;AAC3C,mCAA0C;AAC1C,+DAAyC;AACzC,+DAAyC;AACzC,qEAAwE;AACxE,+BAA+B;AAC/B,yDAAmC;AACnC,iDAA8F;AAkB9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACI,MAAM,kCAAkC,GAAG,KAAK,EAAE,EACvD,cAAc,EACd,gBAAgB,EAChB,YAAY,GAKb,EAAkC,E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I,gBAAgB,KAAK,WAAW,EAAE,CAAC;YAC5C,YAAY,GAAG,MAAM,IAAA,oCAAqB,EAAC;gBACzC,YAAY;gBACZ,gBAAgB,EAAE,YAAY,CAAC,UAA2B;gBAC1D,KAAK;aACN,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,YAAY,GAAG,MAAM,IAAA,+BAAgB,EAAC;gBACpC,YAAY;gBACZ,gBAAgB,EAAE,YAAY,CAAC,UAA2B;gBAC1D,KAAK;aACN,CAAC,CAAC;QACL,CAAC;QACD,oBAAoB,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC;IACtD,CAAC;IACD,IAAI,oBAAoB,KAAK,YAAY,CAAC,UAAU,EAAE,CAAC;QACrD,OAAO,CAAC,IAAI,CACV,4IAA4I,CAC7I,CAAC;IACJ,CAAC;IAED,2CAA2C;IAC3C,MAAM,SAAS,CAAC,iCAAiC,CAAC;QAChD,cAAc;QACd,KAAK;QACL,UAAU;QACV,YAAY;QACZ,qBAAqB;QACrB,YAAY,EAAE,oBAAoB;KACnC,CAAC,CAAC;IAEH,iDAAiD;IACjD,kEAAkE;IAElE,MAAM,SAAS,CAAC,yBAAyB,CACvC,qBAAqB,EACrB,YAAY,CAAC,OAAO,EACpB,eAAe,CAChB,CAAC;IAEF,+CAA+C;IAC/C,MAAM,IAAA,qDAA4B,EAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzD,OAAO;QACL,YAAY;QACZ,YAAY,EAAE,oBAAoB;QAClC,mBAAmB;QACnB,OAAO,EAAE;YACP,GAAG,OAAO;YACV,qBAAqB;SACtB;QACD,KAAK;QACL,UAAU;QACV,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAjJW,QAAA,kCAAkC,sCAiJ7C"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { CrossmintSmartAccountInfo, SetupSmartAccountParams } from '../types';
|
|
2
|
-
export declare function setupCrossmintAccount({ ownerAccount, permittedAddress, chain, }: SetupSmartAccountParams): Promise<CrossmintSmartAccountInfo>;
|
|
3
|
-
//# sourceMappingURL=setup-crossmint-account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-crossmint-account.d.ts","sourceRoot":"","sources":["../../../../../src/lib/smartAccount/crossmint/setup-crossmint-account.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAInF,wBAAsB,qBAAqB,CAAC,EAC1C,YAAY,EACZ,gBAAgB,EAChB,KAAK,GACN,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CA+G9D"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupCrossmintAccount = setupCrossmintAccount;
|
|
4
|
-
const viem_1 = require("viem");
|
|
5
|
-
const crossmint_1 = require("../../environment/crossmint");
|
|
6
|
-
async function setupCrossmintAccount({ ownerAccount, permittedAddress, chain, }) {
|
|
7
|
-
const crossmintWalletApiClient = (0, crossmint_1.getCrossmintWalletApiClient)();
|
|
8
|
-
// Use email-based owner for idempotency
|
|
9
|
-
// This ensures we don't create duplicate wallets for the same owner
|
|
10
|
-
const userEmail = `${ownerAccount.address.toLowerCase()}@wallet.local`;
|
|
11
|
-
const walletLocator = `email:${userEmail}:evm:smart`;
|
|
12
|
-
// Check if wallet already exists
|
|
13
|
-
let crossmintAccount = await crossmintWalletApiClient.getWallet(walletLocator).catch(() => null);
|
|
14
|
-
let accountAlreadyExisted = false;
|
|
15
|
-
if (crossmintAccount && !('error' in crossmintAccount)) {
|
|
16
|
-
accountAlreadyExisted = true;
|
|
17
|
-
console.log(`[setupCrossmintAccount] ✅ Crossmint Smart Account already exists at: ${crossmintAccount.address}`);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
console.log(`[setupCrossmintAccount] Creating new Crossmint Smart Account...`);
|
|
21
|
-
crossmintAccount = await crossmintWalletApiClient.createWallet({
|
|
22
|
-
chainType: 'evm',
|
|
23
|
-
type: 'smart',
|
|
24
|
-
owner: `email:${userEmail}`,
|
|
25
|
-
config: {
|
|
26
|
-
adminSigner: {
|
|
27
|
-
type: 'external-wallet',
|
|
28
|
-
address: ownerAccount.address,
|
|
29
|
-
},
|
|
30
|
-
delegatedSigners: [
|
|
31
|
-
{
|
|
32
|
-
signer: {
|
|
33
|
-
type: 'external-wallet',
|
|
34
|
-
address: permittedAddress,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
if ('error' in crossmintAccount) {
|
|
41
|
-
throw new Error(`Failed to create Crossmint wallet: ${JSON.stringify(crossmintAccount.error)}`);
|
|
42
|
-
}
|
|
43
|
-
console.log(`[setupCrossmintAccount] Crossmint Smart Account address: ${crossmintAccount.address}`);
|
|
44
|
-
}
|
|
45
|
-
// Try to deploy the smart account with an empty user op
|
|
46
|
-
const deployUserOp = await crossmintWalletApiClient.createTransaction(crossmintAccount.address, {
|
|
47
|
-
params: {
|
|
48
|
-
calls: [
|
|
49
|
-
{
|
|
50
|
-
data: '0x',
|
|
51
|
-
to: viem_1.zeroAddress,
|
|
52
|
-
value: '0',
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
// @ts-expect-error - Crossmint expects specific chain literal union, viem Chain.name is generic string. Runtime validates.
|
|
56
|
-
chain: chain.name,
|
|
57
|
-
signer: ownerAccount.address,
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
if ('error' in deployUserOp) {
|
|
61
|
-
// Error creating deploy transaction - account is likely already deployed
|
|
62
|
-
if (accountAlreadyExisted) {
|
|
63
|
-
console.log(`[setupCrossmintAccount] ✅ Smart Account already deployed`);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
console.log(`[setupCrossmintAccount] Skipping deployment (unable to create transaction)`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
// Account needs deployment - sign and approve the transaction
|
|
71
|
-
console.log(`[setupCrossmintAccount] Deploying Smart Account with empty UserOp...`);
|
|
72
|
-
if (!('userOperationHash' in deployUserOp.onChain)) {
|
|
73
|
-
throw new Error('Unexpected transaction response format: missing userOperationHash');
|
|
74
|
-
}
|
|
75
|
-
const deployUserOpSignature = await ownerAccount.signMessage({
|
|
76
|
-
message: { raw: deployUserOp.onChain.userOperationHash },
|
|
77
|
-
});
|
|
78
|
-
const deployUserOpApproval = await crossmintWalletApiClient.approveTransaction(crossmintAccount.address, deployUserOp.id, {
|
|
79
|
-
approvals: [
|
|
80
|
-
{
|
|
81
|
-
signer: `external-wallet:${ownerAccount.address}`,
|
|
82
|
-
signature: deployUserOpSignature,
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
});
|
|
86
|
-
if ('error' in deployUserOpApproval) {
|
|
87
|
-
throw new Error(`Could not sign crossmint deploy user operation. Error: ${JSON.stringify(deployUserOpApproval.error)}`);
|
|
88
|
-
}
|
|
89
|
-
console.log(`[setupCrossmintAccount] ✅ Smart Account deployed`);
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
account: crossmintAccount,
|
|
93
|
-
client: crossmintWalletApiClient,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=setup-crossmint-account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-crossmint-account.js","sourceRoot":"","sources":["../../../../../src/lib/smartAccount/crossmint/setup-crossmint-account.ts"],"names":[],"mappings":";;AAMA,sDAmHC;AAzHD,+BAAmC;AAInC,2DAA0E;AAEnE,KAAK,UAAU,qBAAqB,CAAC,EAC1C,YAAY,EACZ,gBAAgB,EAChB,KAAK,GACmB;IACxB,MAAM,wBAAwB,GAAG,IAAA,uCAA2B,GAAE,CAAC;IAE/D,wCAAwC;IACxC,oEAAoE;IACpE,MAAM,SAAS,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AS,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,CACvG,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;IAClE,CAAC;IAED,OAAO;QACL,OAAO,EAAE,gBAAgB;QACzB,MAAM,EAAE,wBAAwB;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { setupZerodevAccount } from './zerodev/setup-zerodev-account';
|
|
2
|
-
export { setupCrossmintAccount } from './crossmint/setup-crossmint-account';
|
|
3
|
-
export { setupSafeAccount } from './safe/setup-safe-account';
|
|
4
|
-
export type { SmartAccountInfo, ZerodevSmartAccountInfo, CrossmintSmartAccountInfo, SafeSmartAccountInfo, SetupSmartAccountParams, SetupZerodevAccountParams, } from './types';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/smartAccount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,SAAS,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupSafeAccount = exports.setupCrossmintAccount = exports.setupZerodevAccount = void 0;
|
|
4
|
-
var setup_zerodev_account_1 = require("./zerodev/setup-zerodev-account");
|
|
5
|
-
Object.defineProperty(exports, "setupZerodevAccount", { enumerable: true, get: function () { return setup_zerodev_account_1.setupZerodevAccount; } });
|
|
6
|
-
var setup_crossmint_account_1 = require("./crossmint/setup-crossmint-account");
|
|
7
|
-
Object.defineProperty(exports, "setupCrossmintAccount", { enumerable: true, get: function () { return setup_crossmint_account_1.setupCrossmintAccount; } });
|
|
8
|
-
var setup_safe_account_1 = require("./safe/setup-safe-account");
|
|
9
|
-
Object.defineProperty(exports, "setupSafeAccount", { enumerable: true, get: function () { return setup_safe_account_1.setupSafeAccount; } });
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/smartAccount/index.ts"],"names":[],"mappings":";;;AAAA,yEAAsE;AAA7D,4HAAA,mBAAmB,OAAA;AAC5B,+EAA4E;AAAnE,gIAAA,qBAAqB,OAAA;AAC9B,gEAA6D;AAApD,sHAAA,gBAAgB,OAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { SafeSmartAccountInfo, SetupSmartAccountParams } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Set up a Safe smart account for testing with Vincent abilities.
|
|
4
|
-
*
|
|
5
|
-
* This function:
|
|
6
|
-
* 1. Creates a Safe (v1.4.1) smart account with the owner account
|
|
7
|
-
* 2. Deploys the Safe on-chain
|
|
8
|
-
* 3. Adds the PKP address as an additional owner with threshold 1
|
|
9
|
-
* 4. This allows either the owner EOA or the Vincent PKP to sign UserOps
|
|
10
|
-
*
|
|
11
|
-
* @param params - Configuration parameters
|
|
12
|
-
* @returns Safe smart account and client
|
|
13
|
-
*/
|
|
14
|
-
export declare function setupSafeAccount({ ownerAccount, permittedAddress, chain, }: SetupSmartAccountParams): Promise<SafeSmartAccountInfo>;
|
|
15
|
-
//# sourceMappingURL=setup-safe-account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-safe-account.d.ts","sourceRoot":"","sources":["../../../../../src/lib/smartAccount/safe/setup-safe-account.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAU9E;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,YAAY,EACZ,gBAAgB,EAChB,KAAK,GACN,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAwFzD"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupSafeAccount = setupSafeAccount;
|
|
4
|
-
const permissionless_1 = require("permissionless");
|
|
5
|
-
const accounts_1 = require("permissionless/accounts");
|
|
6
|
-
const viem_1 = require("viem");
|
|
7
|
-
const safe_1 = require("../../environment/safe");
|
|
8
|
-
/**
|
|
9
|
-
* Set up a Safe smart account for testing with Vincent abilities.
|
|
10
|
-
*
|
|
11
|
-
* This function:
|
|
12
|
-
* 1. Creates a Safe (v1.4.1) smart account with the owner account
|
|
13
|
-
* 2. Deploys the Safe on-chain
|
|
14
|
-
* 3. Adds the PKP address as an additional owner with threshold 1
|
|
15
|
-
* 4. This allows either the owner EOA or the Vincent PKP to sign UserOps
|
|
16
|
-
*
|
|
17
|
-
* @param params - Configuration parameters
|
|
18
|
-
* @returns Safe smart account and client
|
|
19
|
-
*/
|
|
20
|
-
async function setupSafeAccount({ ownerAccount, permittedAddress, chain, }) {
|
|
21
|
-
// Create transports - separate RPC for chain operations vs bundler operations
|
|
22
|
-
const safeTransport = (0, safe_1.getSafeTransport)(); // Regular RPC for eth_call, getCode, etc.
|
|
23
|
-
const pimlicoTransport = (0, safe_1.getPimlicoTransport)(); // Bundler RPC for UserOps
|
|
24
|
-
// Create public client for the chain using regular RPC
|
|
25
|
-
const publicClient = (0, viem_1.createPublicClient)({
|
|
26
|
-
chain,
|
|
27
|
-
transport: safeTransport,
|
|
28
|
-
});
|
|
29
|
-
// Create Pimlico paymaster client
|
|
30
|
-
const pimlicoClient = (0, safe_1.createPimlicoPaymaster)();
|
|
31
|
-
console.log('[setupSafeAccount] Creating Safe account...');
|
|
32
|
-
// Create the Safe account with the owner
|
|
33
|
-
const safeAccount = await (0, accounts_1.toSafeSmartAccount)({
|
|
34
|
-
entryPoint: safe_1.entryPoint,
|
|
35
|
-
client: publicClient,
|
|
36
|
-
owners: [ownerAccount],
|
|
37
|
-
version: safe_1.safeVersion,
|
|
38
|
-
});
|
|
39
|
-
console.log(`[setupSafeAccount] Safe Smart Account address: ${safeAccount.address}`);
|
|
40
|
-
// Check if account is already deployed
|
|
41
|
-
const accountCode = await publicClient.getCode({
|
|
42
|
-
address: safeAccount.address,
|
|
43
|
-
});
|
|
44
|
-
const isDeployed = accountCode && accountCode !== '0x';
|
|
45
|
-
// Create Safe client
|
|
46
|
-
const safeClient = (0, permissionless_1.createSmartAccountClient)({
|
|
47
|
-
account: safeAccount,
|
|
48
|
-
chain,
|
|
49
|
-
bundlerTransport: pimlicoTransport,
|
|
50
|
-
paymaster: pimlicoClient,
|
|
51
|
-
userOperation: {
|
|
52
|
-
estimateFeesPerGas: async () => {
|
|
53
|
-
return (await pimlicoClient.getUserOperationGasPrice()).fast;
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
if (isDeployed) {
|
|
58
|
-
console.log('[setupSafeAccount] ✅ Safe account already deployed');
|
|
59
|
-
// Check if PKP is already an owner
|
|
60
|
-
// For now, we'll assume if deployed, it's already configured
|
|
61
|
-
// In production, you might want to read the Safe owners and verify
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
console.log('[setupSafeAccount] Deploying Safe and adding PKP as owner...');
|
|
65
|
-
// Encode the call to add the PKP as an owner with threshold 1
|
|
66
|
-
const addOwnerCallData = (0, viem_1.encodeFunctionData)({
|
|
67
|
-
abi: (0, viem_1.parseAbi)(['function addOwnerWithThreshold(address owner, uint256 _threshold) public']),
|
|
68
|
-
functionName: 'addOwnerWithThreshold',
|
|
69
|
-
args: [permittedAddress, 1n],
|
|
70
|
-
});
|
|
71
|
-
// Deploy and configure Safe in a single transaction
|
|
72
|
-
const txHash = await safeClient.sendTransaction({
|
|
73
|
-
to: safeAccount.address,
|
|
74
|
-
value: 0n,
|
|
75
|
-
data: addOwnerCallData,
|
|
76
|
-
chain,
|
|
77
|
-
});
|
|
78
|
-
console.log(`[setupSafeAccount] Setup transaction hash: ${txHash}`);
|
|
79
|
-
// Wait for receipt
|
|
80
|
-
const receipt = await publicClient.waitForTransactionReceipt({
|
|
81
|
-
confirmations: 2,
|
|
82
|
-
hash: txHash,
|
|
83
|
-
});
|
|
84
|
-
console.log(`[setupSafeAccount] ✅ Safe deployed and PKP added as owner at block: ${receipt.blockNumber}`);
|
|
85
|
-
}
|
|
86
|
-
console.log(`[setupSafeAccount] ✅ Safe account setup complete: ${safeAccount.address}\n`);
|
|
87
|
-
return {
|
|
88
|
-
account: safeAccount,
|
|
89
|
-
client: safeClient,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=setup-safe-account.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-safe-account.js","sourceRoot":"","sources":["../../../../../src/lib/smartAccount/safe/setup-safe-account.ts"],"names":[],"mappings":";;AA0BA,4CA4FC;AAtHD,mDAA0D;AAC1D,sDAA6D;AAC7D,+BAAwE;AAIxE,iDAMgC;AAEhC;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,gBAAgB,CAAC,EACrC,YAAY,EACZ,gBAAgB,EAChB,KAAK,GACmB;IACxB,8EAA8E;IAC9E,MAAM,aAAa,GAAG,IAAA,uBAAgB,GAAE,CAAC,CAAC,0CAA0C;IACpF,MAAM,gBAAgB,GAAG,IAAA,0BAAmB,GAAE,CAAC,CAAC,0BAA0B;IAE1E,uDAAuD;IACvD,MAAM,YAAY,GAAG,IAAA,yBAAkB,EAAC;QACtC,KAAK;QACL,SAAS,EAAE,aAAa;KACzB,CAAC,CAAC;IAEH,kCAAkC;IAClC,MAAM,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CAAC,gBAAgB,EAAE,EAAE,CAAC;SAC7B,CAAC,CAAC;QAEH,oDAAoD;QACpD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,eAAe,CAAC;YAC9C,EAAE,EAAE,WAAW,CAAC,OAAO;YACvB,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,gBAAgB;YACtB,KAAK;SACN,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,8CAA8C,MAAM,EAAE,CAAC,CAAC;QAEpE,mBAAmB;QACnB,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,yBAAyB,CAAC;YAC3D,aAAa,EAAE,CAAC;YAChB,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CACT,uEAAuE,OAAO,CAAC,WAAW,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,qDAAqD,WAAW,CAAC,OAAO,IAAI,CAAC,CAAC;IAE1F,OAAO;QACL,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,UAAU;KACnB,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { WalletsApiClient } from '@crossmint/wallets-sdk';
|
|
2
|
-
import type { CreateKernelAccountReturnType } from '@zerodev/sdk';
|
|
3
|
-
import type { SmartAccountClient } from 'permissionless';
|
|
4
|
-
import type { toSafeSmartAccount } from 'permissionless/accounts';
|
|
5
|
-
import type { Address, Chain } from 'viem';
|
|
6
|
-
import type { PrivateKeyAccount } from 'viem/accounts';
|
|
7
|
-
export interface SetupSmartAccountParams {
|
|
8
|
-
ownerAccount: PrivateKeyAccount;
|
|
9
|
-
permittedAddress: Address;
|
|
10
|
-
chain: Chain;
|
|
11
|
-
}
|
|
12
|
-
export interface SetupZerodevAccountParams extends SetupSmartAccountParams {
|
|
13
|
-
deploy?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface ZerodevSmartAccountInfo {
|
|
16
|
-
account: CreateKernelAccountReturnType;
|
|
17
|
-
serializedPermissionAccount: string;
|
|
18
|
-
}
|
|
19
|
-
export interface CrossmintSmartAccountInfo {
|
|
20
|
-
account: Exclude<Awaited<ReturnType<WalletsApiClient['createWallet']>>, {
|
|
21
|
-
error: unknown;
|
|
22
|
-
}>;
|
|
23
|
-
client: WalletsApiClient;
|
|
24
|
-
}
|
|
25
|
-
export interface SafeSmartAccountInfo {
|
|
26
|
-
account: Awaited<ReturnType<typeof toSafeSmartAccount>>;
|
|
27
|
-
client: SmartAccountClient;
|
|
28
|
-
}
|
|
29
|
-
export type SmartAccountInfo = ZerodevSmartAccountInfo | CrossmintSmartAccountInfo | SafeSmartAccountInfo;
|
|
30
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/smartAccount/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,iBAAiB,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACxE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,6BAA6B,CAAC;IACvC,2BAA2B,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC5F,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;IACxD,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED,MAAM,MAAM,gBAAgB,GACxB,uBAAuB,GACvB,yBAAyB,GACzB,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/lib/smartAccount/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Address, PublicClient } from 'viem';
|
|
2
|
-
export declare function getPermissionEmptyValidator(publicClient: PublicClient, permittedAddress: Address): Promise<import("@zerodev/permissions").PermissionPlugin>;
|
|
3
|
-
//# sourceMappingURL=get-permission-empty-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-permission-empty-validator.d.ts","sourceRoot":"","sources":["../../../../../src/lib/smartAccount/zerodev/get-permission-empty-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AASlD,wBAAsB,2BAA2B,CAC/C,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,OAAO,4DAe1B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPermissionEmptyValidator = getPermissionEmptyValidator;
|
|
4
|
-
const permissions_1 = require("@zerodev/permissions");
|
|
5
|
-
const policies_1 = require("@zerodev/permissions/policies");
|
|
6
|
-
const signers_1 = require("@zerodev/permissions/signers");
|
|
7
|
-
const sdk_1 = require("@zerodev/sdk");
|
|
8
|
-
const zerodev_1 = require("../../environment/zerodev");
|
|
9
|
-
async function getPermissionEmptyValidator(publicClient, permittedAddress) {
|
|
10
|
-
const permittedEmptyAccount = (0, sdk_1.addressToEmptyAccount)(permittedAddress);
|
|
11
|
-
const permittedEmptySigner = await (0, signers_1.toECDSASigner)({
|
|
12
|
-
signer: permittedEmptyAccount,
|
|
13
|
-
});
|
|
14
|
-
return await (0, permissions_1.toPermissionValidator)(publicClient, {
|
|
15
|
-
entryPoint: zerodev_1.entryPoint,
|
|
16
|
-
kernelVersion: zerodev_1.kernelVersion,
|
|
17
|
-
signer: permittedEmptySigner,
|
|
18
|
-
policies: [
|
|
19
|
-
// This is kept simple since this is a simple development environment file.
|
|
20
|
-
(0, policies_1.toSudoPolicy)({}),
|
|
21
|
-
],
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=get-permission-empty-validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-permission-empty-validator.js","sourceRoot":"","sources":["../../../../../src/lib/smartAccount/zerodev/get-permission-empty-validator.ts"],"names":[],"mappings":";;AASA,kEAiBC;AAxBD,sDAA6D;AAC7D,4DAA6D;AAC7D,0DAA6D;AAC7D,sCAAqD;AAErD,uDAAsE;AAE/D,KAAK,UAAU,2BAA2B,CAC/C,YAA0B,EAC1B,gBAAyB;IAEzB,MAAM,qBAAqB,GAAG,IAAA,2BAAqB,EAAC,gBAAgB,CAAC,CAAC;IACtE,MAAM,oBAAoB,GAAG,MAAM,IAAA,uBAAa,EAAC;QAC/C,MAAM,EAAE,qBAAqB;KAC9B,CAAC,CAAC;IACH,OAAO,MAAM,IAAA,mCAAqB,EAAC,YAAY,EAAE;QAC/C,UAAU,EAAV,oBAAU;QACV,aAAa,EAAb,uBAAa;QACb,MAAM,EAAE,oBAAoB;QAC5B,QAAQ,EAAE;YACR,2EAA2E;YAC3E,IAAA,uBAAY,EAAC,EAAE,CAAC;SACjB;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { SetupZerodevAccountParams, ZerodevSmartAccountInfo } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Set up a ZeroDev Kernel smart account for testing with Vincent abilities.
|
|
4
|
-
*
|
|
5
|
-
* This function:
|
|
6
|
-
* 1. Creates an owner validator using the owner's private key
|
|
7
|
-
* 2. Creates a permission validator for the PKP address (empty validator)
|
|
8
|
-
* 3. Deploys the Kernel smart account on-chain
|
|
9
|
-
* 4. Generates a serialized permission account for signing UserOps
|
|
10
|
-
*
|
|
11
|
-
* @param params - Configuration parameters
|
|
12
|
-
* @param params.deploy - When false, derive the deterministic account address without submitting a UserOp.
|
|
13
|
-
* This skips on-chain deployment and lets tests register permissions for the address without paying gas, so that
|
|
14
|
-
* we can verify registry flows without requiring a funded smart account.
|
|
15
|
-
* @returns Smart account address and serialized permission account
|
|
16
|
-
*/
|
|
17
|
-
export declare function setupZerodevAccount({ ownerAccount, permittedAddress, chain, deploy, }: SetupZerodevAccountParams): Promise<ZerodevSmartAccountInfo>;
|
|
18
|
-
//# sourceMappingURL=setup-zerodev-account.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup-zerodev-account.d.ts","sourceRoot":"","sources":["../../../../../src/lib/smartAccount/zerodev/setup-zerodev-account.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAUnF;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,MAAa,GACd,EAAE,yBAAyB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CA2G9D"}
|