@lit-protocol/vincent-e2e-test-utils 3.0.0 → 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.
Files changed (258) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/CHANGELOG.md +20 -0
  3. package/dist/package.json +3 -7
  4. package/dist/src/index.d.ts +3 -2
  5. package/dist/src/index.d.ts.map +1 -1
  6. package/dist/src/index.js +8 -16
  7. package/dist/src/index.js.map +1 -1
  8. package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.d.ts +3 -0
  9. package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.d.ts.map +1 -0
  10. package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.js +32 -0
  11. package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.js.map +1 -0
  12. package/dist/src/lib/setup/app-registration/handleAppRegistration.d.ts +14 -0
  13. package/dist/src/lib/setup/app-registration/handleAppRegistration.d.ts.map +1 -0
  14. package/dist/src/lib/setup/app-registration/handleAppRegistration.js +43 -0
  15. package/dist/src/lib/setup/app-registration/handleAppRegistration.js.map +1 -0
  16. package/dist/src/lib/setup/app-registration/registerNewApp.d.ts +17 -0
  17. package/dist/src/lib/setup/app-registration/registerNewApp.d.ts.map +1 -0
  18. package/dist/src/lib/setup/app-registration/registerNewApp.js +46 -0
  19. package/dist/src/lib/setup/app-registration/registerNewApp.js.map +1 -0
  20. package/dist/src/lib/setup/app-registration/registerNewAppVersion.d.ts +16 -0
  21. package/dist/src/lib/setup/app-registration/registerNewAppVersion.d.ts.map +1 -0
  22. package/dist/src/lib/setup/app-registration/registerNewAppVersion.js +68 -0
  23. package/dist/src/lib/setup/app-registration/registerNewAppVersion.js.map +1 -0
  24. package/dist/src/lib/setup/app-setup.d.ts +19 -0
  25. package/dist/src/lib/setup/app-setup.d.ts.map +1 -0
  26. package/dist/src/lib/setup/app-setup.js +37 -0
  27. package/dist/src/lib/setup/app-setup.js.map +1 -0
  28. package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.d.ts +10 -0
  29. package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.d.ts.map +1 -0
  30. package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.js +17 -0
  31. package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.js.map +1 -0
  32. package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.d.ts +12 -0
  33. package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.d.ts.map +1 -0
  34. package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.js +23 -0
  35. package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.js.map +1 -0
  36. package/dist/src/lib/setup/getEnv.d.ts +2 -0
  37. package/dist/src/lib/setup/getEnv.d.ts.map +1 -0
  38. package/dist/src/lib/setup/getEnv.js +16 -0
  39. package/dist/src/lib/setup/getEnv.js.map +1 -0
  40. package/dist/src/lib/setup/index.d.ts +9 -0
  41. package/dist/src/lib/setup/index.d.ts.map +1 -0
  42. package/dist/src/lib/setup/index.js +18 -0
  43. package/dist/src/lib/setup/index.js.map +1 -0
  44. package/dist/src/lib/setup/setupAgentSmartAccount.d.ts +19 -0
  45. package/dist/src/lib/setup/setupAgentSmartAccount.d.ts.map +1 -0
  46. package/dist/src/lib/setup/setupAgentSmartAccount.js +100 -0
  47. package/dist/src/lib/setup/setupAgentSmartAccount.js.map +1 -0
  48. package/dist/src/lib/setup/smart-account/createPermissionApproval.d.ts +11 -0
  49. package/dist/src/lib/setup/smart-account/createPermissionApproval.d.ts.map +1 -0
  50. package/dist/src/lib/setup/smart-account/createPermissionApproval.js +45 -0
  51. package/dist/src/lib/setup/smart-account/createPermissionApproval.js.map +1 -0
  52. package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.d.ts +16 -0
  53. package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.d.ts.map +1 -0
  54. package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.js +128 -0
  55. package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.js.map +1 -0
  56. package/dist/src/lib/setup/smart-account/deriveAgentAddress.d.ts +23 -0
  57. package/dist/src/lib/setup/smart-account/deriveAgentAddress.d.ts.map +1 -0
  58. package/dist/src/lib/setup/smart-account/deriveAgentAddress.js +36 -0
  59. package/dist/src/lib/setup/smart-account/deriveAgentAddress.js.map +1 -0
  60. package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.d.ts +12 -0
  61. package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.d.ts.map +1 -0
  62. package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.js +82 -0
  63. package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.js.map +1 -0
  64. package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.d.ts +10 -0
  65. package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.d.ts.map +1 -0
  66. package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.js +34 -0
  67. package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.js.map +1 -0
  68. package/dist/src/lib/setup/types.d.ts +92 -0
  69. package/dist/src/lib/setup/types.d.ts.map +1 -0
  70. package/dist/src/lib/{types.js.map → setup/types.js.map} +1 -1
  71. package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.d.ts +32 -0
  72. package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.d.ts.map +1 -0
  73. package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.js +58 -0
  74. package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.js.map +1 -0
  75. package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.d.ts +4 -0
  76. package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.d.ts.map +1 -0
  77. package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.js +28 -0
  78. package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.js.map +1 -0
  79. package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.d.ts +31 -0
  80. package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.d.ts.map +1 -0
  81. package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.js +31 -0
  82. package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.js.map +1 -0
  83. package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.d.ts +9 -0
  84. package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.d.ts.map +1 -0
  85. package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.js +27 -0
  86. package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.js.map +1 -0
  87. package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.d.ts +8 -0
  88. package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.d.ts.map +1 -0
  89. package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.js +30 -0
  90. package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.js.map +1 -0
  91. package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.d.ts +7 -0
  92. package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.d.ts.map +1 -0
  93. package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.js +25 -0
  94. package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.js.map +1 -0
  95. package/dist/src/lib/setup/wallets/ensureWalletHasTokens.d.ts +14 -0
  96. package/dist/src/lib/setup/wallets/ensureWalletHasTokens.d.ts.map +1 -0
  97. package/dist/src/lib/setup/wallets/ensureWalletHasTokens.js +27 -0
  98. package/dist/src/lib/setup/wallets/ensureWalletHasTokens.js.map +1 -0
  99. package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.d.ts +15 -0
  100. package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.d.ts.map +1 -0
  101. package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.js +63 -0
  102. package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.js.map +1 -0
  103. package/dist/src/lib/setup/wallets/setupWallets.d.ts +48 -0
  104. package/dist/src/lib/setup/wallets/setupWallets.d.ts.map +1 -0
  105. package/dist/src/lib/setup/wallets/setupWallets.js +159 -0
  106. package/dist/src/lib/setup/wallets/setupWallets.js.map +1 -0
  107. package/dist/src/lib/setupVincentDevelopmentEnv.d.ts +3 -0
  108. package/dist/src/lib/setupVincentDevelopmentEnv.d.ts.map +1 -0
  109. package/dist/src/lib/setupVincentDevelopmentEnv.js +64 -0
  110. package/dist/src/lib/setupVincentDevelopmentEnv.js.map +1 -0
  111. package/package.json +4 -8
  112. package/dist/src/lib/appManager/ensure-funded.d.ts +0 -2
  113. package/dist/src/lib/appManager/ensure-funded.d.ts.map +0 -1
  114. package/dist/src/lib/appManager/ensure-funded.js +0 -11
  115. package/dist/src/lib/appManager/ensure-funded.js.map +0 -1
  116. package/dist/src/lib/appManager/index.d.ts +0 -5
  117. package/dist/src/lib/appManager/index.d.ts.map +0 -1
  118. package/dist/src/lib/appManager/index.js +0 -12
  119. package/dist/src/lib/appManager/index.js.map +0 -1
  120. package/dist/src/lib/appManager/register-new-app-version.d.ts +0 -28
  121. package/dist/src/lib/appManager/register-new-app-version.d.ts.map +0 -1
  122. package/dist/src/lib/appManager/register-new-app-version.js +0 -82
  123. package/dist/src/lib/appManager/register-new-app-version.js.map +0 -1
  124. package/dist/src/lib/appManager/register-new-app.d.ts +0 -13
  125. package/dist/src/lib/appManager/register-new-app.d.ts.map +0 -1
  126. package/dist/src/lib/appManager/register-new-app.js +0 -25
  127. package/dist/src/lib/appManager/register-new-app.js.map +0 -1
  128. package/dist/src/lib/appManager/remove-delegatee-from-app.d.ts +0 -7
  129. package/dist/src/lib/appManager/remove-delegatee-from-app.d.ts.map +0 -1
  130. package/dist/src/lib/appManager/remove-delegatee-from-app.js +0 -26
  131. package/dist/src/lib/appManager/remove-delegatee-from-app.js.map +0 -1
  132. package/dist/src/lib/chain.d.ts +0 -13
  133. package/dist/src/lib/chain.d.ts.map +0 -1
  134. package/dist/src/lib/chain.js +0 -30
  135. package/dist/src/lib/chain.js.map +0 -1
  136. package/dist/src/lib/create-random-vincent-wallets.d.ts +0 -7
  137. package/dist/src/lib/create-random-vincent-wallets.d.ts.map +0 -1
  138. package/dist/src/lib/create-random-vincent-wallets.js +0 -12
  139. package/dist/src/lib/create-random-vincent-wallets.js.map +0 -1
  140. package/dist/src/lib/delegatee/ensure-funded.d.ts +0 -2
  141. package/dist/src/lib/delegatee/ensure-funded.d.ts.map +0 -1
  142. package/dist/src/lib/delegatee/ensure-funded.js +0 -11
  143. package/dist/src/lib/delegatee/ensure-funded.js.map +0 -1
  144. package/dist/src/lib/delegatee/get-app-info.d.ts +0 -5
  145. package/dist/src/lib/delegatee/get-app-info.d.ts.map +0 -1
  146. package/dist/src/lib/delegatee/get-app-info.js +0 -19
  147. package/dist/src/lib/delegatee/get-app-info.js.map +0 -1
  148. package/dist/src/lib/delegatee/index.d.ts +0 -3
  149. package/dist/src/lib/delegatee/index.d.ts.map +0 -1
  150. package/dist/src/lib/delegatee/index.js +0 -8
  151. package/dist/src/lib/delegatee/index.js.map +0 -1
  152. package/dist/src/lib/delegator/add-permission-for-abilities.d.ts +0 -4
  153. package/dist/src/lib/delegator/add-permission-for-abilities.d.ts.map +0 -1
  154. package/dist/src/lib/delegator/add-permission-for-abilities.js +0 -21
  155. package/dist/src/lib/delegator/add-permission-for-abilities.js.map +0 -1
  156. package/dist/src/lib/delegator/agent-pkp.d.ts +0 -20
  157. package/dist/src/lib/delegator/agent-pkp.d.ts.map +0 -1
  158. package/dist/src/lib/delegator/agent-pkp.js +0 -96
  159. package/dist/src/lib/delegator/agent-pkp.js.map +0 -1
  160. package/dist/src/lib/delegator/get-platform-user-pkp-wallet.d.ts +0 -8
  161. package/dist/src/lib/delegator/get-platform-user-pkp-wallet.d.ts.map +0 -1
  162. package/dist/src/lib/delegator/get-platform-user-pkp-wallet.js +0 -77
  163. package/dist/src/lib/delegator/get-platform-user-pkp-wallet.js.map +0 -1
  164. package/dist/src/lib/delegator/index.d.ts +0 -7
  165. package/dist/src/lib/delegator/index.d.ts.map +0 -1
  166. package/dist/src/lib/delegator/index.js +0 -20
  167. package/dist/src/lib/delegator/index.js.map +0 -1
  168. package/dist/src/lib/delegator/permit-vincent-app-version.d.ts +0 -19
  169. package/dist/src/lib/delegator/permit-vincent-app-version.d.ts.map +0 -1
  170. package/dist/src/lib/delegator/permit-vincent-app-version.js +0 -45
  171. package/dist/src/lib/delegator/permit-vincent-app-version.js.map +0 -1
  172. package/dist/src/lib/delegator/platform-user-pkp.d.ts +0 -10
  173. package/dist/src/lib/delegator/platform-user-pkp.d.ts.map +0 -1
  174. package/dist/src/lib/delegator/platform-user-pkp.js +0 -48
  175. package/dist/src/lib/delegator/platform-user-pkp.js.map +0 -1
  176. package/dist/src/lib/ensure-capacity-credit.d.ts +0 -4
  177. package/dist/src/lib/ensure-capacity-credit.d.ts.map +0 -1
  178. package/dist/src/lib/ensure-capacity-credit.js +0 -57
  179. package/dist/src/lib/ensure-capacity-credit.js.map +0 -1
  180. package/dist/src/lib/env.d.ts +0 -30
  181. package/dist/src/lib/env.d.ts.map +0 -1
  182. package/dist/src/lib/env.js +0 -58
  183. package/dist/src/lib/env.js.map +0 -1
  184. package/dist/src/lib/environment/crossmint.d.ts +0 -3
  185. package/dist/src/lib/environment/crossmint.d.ts.map +0 -1
  186. package/dist/src/lib/environment/crossmint.js +0 -23
  187. package/dist/src/lib/environment/crossmint.js.map +0 -1
  188. package/dist/src/lib/environment/safe.d.ts +0 -567
  189. package/dist/src/lib/environment/safe.d.ts.map +0 -1
  190. package/dist/src/lib/environment/safe.js +0 -41
  191. package/dist/src/lib/environment/safe.js.map +0 -1
  192. package/dist/src/lib/environment/zerodev.d.ts +0 -49
  193. package/dist/src/lib/environment/zerodev.d.ts.map +0 -1
  194. package/dist/src/lib/environment/zerodev.js +0 -32
  195. package/dist/src/lib/environment/zerodev.js.map +0 -1
  196. package/dist/src/lib/funder/check-funder-balance.d.ts +0 -3
  197. package/dist/src/lib/funder/check-funder-balance.d.ts.map +0 -1
  198. package/dist/src/lib/funder/check-funder-balance.js +0 -19
  199. package/dist/src/lib/funder/check-funder-balance.js.map +0 -1
  200. package/dist/src/lib/funder/ensure-wallet-has-test-tokens.d.ts +0 -5
  201. package/dist/src/lib/funder/ensure-wallet-has-test-tokens.d.ts.map +0 -1
  202. package/dist/src/lib/funder/ensure-wallet-has-test-tokens.js +0 -35
  203. package/dist/src/lib/funder/ensure-wallet-has-test-tokens.js.map +0 -1
  204. package/dist/src/lib/funder/index.d.ts +0 -5
  205. package/dist/src/lib/funder/index.d.ts.map +0 -1
  206. package/dist/src/lib/funder/index.js +0 -10
  207. package/dist/src/lib/funder/index.js.map +0 -1
  208. package/dist/src/lib/index.d.ts +0 -18
  209. package/dist/src/lib/index.d.ts.map +0 -1
  210. package/dist/src/lib/index.js +0 -31
  211. package/dist/src/lib/index.js.map +0 -1
  212. package/dist/src/lib/litContractsClient/LitContractsInstance.d.ts +0 -14
  213. package/dist/src/lib/litContractsClient/LitContractsInstance.d.ts.map +0 -1
  214. package/dist/src/lib/litContractsClient/LitContractsInstance.js +0 -48
  215. package/dist/src/lib/litContractsClient/LitContractsInstance.js.map +0 -1
  216. package/dist/src/lib/litContractsClient/get-lit-contract-client.d.ts +0 -7
  217. package/dist/src/lib/litContractsClient/get-lit-contract-client.d.ts.map +0 -1
  218. package/dist/src/lib/litContractsClient/get-lit-contract-client.js +0 -19
  219. package/dist/src/lib/litContractsClient/get-lit-contract-client.js.map +0 -1
  220. package/dist/src/lib/litContractsClient/index.d.ts +0 -3
  221. package/dist/src/lib/litContractsClient/index.d.ts.map +0 -1
  222. package/dist/src/lib/litContractsClient/index.js +0 -8
  223. package/dist/src/lib/litContractsClient/index.js.map +0 -1
  224. package/dist/src/lib/mint-new-pkp.d.ts +0 -16
  225. package/dist/src/lib/mint-new-pkp.d.ts.map +0 -1
  226. package/dist/src/lib/mint-new-pkp.js +0 -40
  227. package/dist/src/lib/mint-new-pkp.js.map +0 -1
  228. package/dist/src/lib/setup-vincent-development-environment.d.ts +0 -81
  229. package/dist/src/lib/setup-vincent-development-environment.d.ts.map +0 -1
  230. package/dist/src/lib/setup-vincent-development-environment.js +0 -185
  231. package/dist/src/lib/setup-vincent-development-environment.js.map +0 -1
  232. package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.d.ts +0 -3
  233. package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.d.ts.map +0 -1
  234. package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.js +0 -96
  235. package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.js.map +0 -1
  236. package/dist/src/lib/smartAccount/index.d.ts +0 -5
  237. package/dist/src/lib/smartAccount/index.d.ts.map +0 -1
  238. package/dist/src/lib/smartAccount/index.js +0 -10
  239. package/dist/src/lib/smartAccount/index.js.map +0 -1
  240. package/dist/src/lib/smartAccount/safe/setup-safe-account.d.ts +0 -15
  241. package/dist/src/lib/smartAccount/safe/setup-safe-account.d.ts.map +0 -1
  242. package/dist/src/lib/smartAccount/safe/setup-safe-account.js +0 -92
  243. package/dist/src/lib/smartAccount/safe/setup-safe-account.js.map +0 -1
  244. package/dist/src/lib/smartAccount/types.d.ts +0 -30
  245. package/dist/src/lib/smartAccount/types.d.ts.map +0 -1
  246. package/dist/src/lib/smartAccount/types.js.map +0 -1
  247. package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.d.ts +0 -3
  248. package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.d.ts.map +0 -1
  249. package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.js +0 -24
  250. package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.js.map +0 -1
  251. package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.d.ts +0 -18
  252. package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.d.ts.map +0 -1
  253. package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.js +0 -112
  254. package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.js.map +0 -1
  255. package/dist/src/lib/types.d.ts +0 -17
  256. package/dist/src/lib/types.d.ts.map +0 -1
  257. package/dist/src/lib/types.js +0 -3
  258. /package/dist/src/lib/{smartAccount → setup}/types.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.0.1 (2026-01-17)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated contracts-sdk to 8.1.0
6
+
1
7
  # 3.0.0 (2026-01-14)
2
8
 
3
9
  ### ⚠️ Breaking Changes
package/dist/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 3.0.1 (2026-01-17)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated contracts-sdk to 8.1.0
6
+
7
+ # 3.0.0 (2026-01-14)
8
+
9
+ ### ⚠️ Breaking Changes
10
+
11
+ - Upgrade to support Vincent 2.0 architecture ([cf97ffde](https://github.com/LIT-Protocol/Vincent/commit/cf97ffde))
12
+
13
+ ### 🧱 Updated Dependencies
14
+
15
+ - Updated contracts-sdk to 8.0.0
16
+
17
+ ### ❤️ Thank You
18
+
19
+ - Wyatt Barnes @Spacesai1or
20
+
1
21
  ## 2.0.3 (2026-01-12)
2
22
 
3
23
  ### 🩹 Fixes
package/dist/package.json CHANGED
@@ -1,15 +1,10 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-e2e-test-utils",
3
- "version": "2.0.3",
3
+ "version": "3.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "scripts": {
8
- "test:smartAccount": "NODE_OPTIONS=--experimental-vm-modules dotenv -e .env jest test/smartAccount/all.spec.ts",
9
- "test:crossmint": "NODE_OPTIONS=--experimental-vm-modules dotenv -e .env jest test/smartAccount/crossmint.spec.ts",
10
- "test:zerodev": "NODE_OPTIONS=--experimental-vm-modules dotenv -e .env jest test/smartAccount/zerodev.spec.ts",
11
- "test:safe": "NODE_OPTIONS=--experimental-vm-modules dotenv -e .env jest test/smartAccount/safe.spec.ts"
12
- },
7
+ "scripts": {},
13
8
  "dependencies": {
14
9
  "@lit-protocol/auth-helpers": "^7",
15
10
  "@lit-protocol/constants": "^7",
@@ -18,6 +13,7 @@
18
13
  "@lit-protocol/lit-node-client": "^7",
19
14
  "@lit-protocol/pkp-ethers": "^7.3.1",
20
15
  "@lit-protocol/types": "^7",
16
+ "@lit-protocol/vincent-app-sdk": "workspace:*",
21
17
  "@lit-protocol/vincent-contracts-sdk": "workspace:*",
22
18
  "@t3-oss/env-core": "^0.13.8",
23
19
  "@zerodev/ecdsa-validator": "^5.4.9",
@@ -1,3 +1,4 @@
1
- export { delegator, delegatee, funder, chain, appManager, mintNewPkp, ensureUnexpiredCapacityToken, getEnv, getChainHelpers, createRandomVincentWallets, setupVincentDevelopmentEnvironment, setupZerodevAccount, setupCrossmintAccount, setupSafeAccount, } from './lib';
2
- export type { PkpInfo, SmartAccountInfo, ZerodevSmartAccountInfo, CrossmintSmartAccountInfo, SafeSmartAccountInfo, VincentDevEnvironment, } from './lib';
1
+ export { setupVincentDevelopmentEnvironment } from './lib/setupVincentDevelopmentEnv';
2
+ export { getEnv, deploySmartAccountToChain, ensureWalletHasTokens, createPermissionApproval, } from './lib/setup';
3
+ export type { SetupConfig, VincentDevEnvironment } from './lib/setup';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,MAAM,EACN,KAAK,EACL,UAAU,EACV,UAAU,EACV,4BAA4B,EAC5B,MAAM,EACN,eAAe,EACf,0BAA0B,EAC1B,kCAAkC,EAClC,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,OAAO,CAAC;AAEf,YAAY,EACV,OAAO,EACP,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,kCAAkC,CAAC;AACtF,OAAO,EACL,MAAM,EACN,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,19 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setupSafeAccount = exports.setupCrossmintAccount = exports.setupZerodevAccount = exports.setupVincentDevelopmentEnvironment = exports.createRandomVincentWallets = exports.getChainHelpers = exports.getEnv = exports.ensureUnexpiredCapacityToken = exports.mintNewPkp = exports.appManager = exports.chain = exports.funder = exports.delegatee = exports.delegator = void 0;
4
- var lib_1 = require("./lib");
5
- Object.defineProperty(exports, "delegator", { enumerable: true, get: function () { return lib_1.delegator; } });
6
- Object.defineProperty(exports, "delegatee", { enumerable: true, get: function () { return lib_1.delegatee; } });
7
- Object.defineProperty(exports, "funder", { enumerable: true, get: function () { return lib_1.funder; } });
8
- Object.defineProperty(exports, "chain", { enumerable: true, get: function () { return lib_1.chain; } });
9
- Object.defineProperty(exports, "appManager", { enumerable: true, get: function () { return lib_1.appManager; } });
10
- Object.defineProperty(exports, "mintNewPkp", { enumerable: true, get: function () { return lib_1.mintNewPkp; } });
11
- Object.defineProperty(exports, "ensureUnexpiredCapacityToken", { enumerable: true, get: function () { return lib_1.ensureUnexpiredCapacityToken; } });
12
- Object.defineProperty(exports, "getEnv", { enumerable: true, get: function () { return lib_1.getEnv; } });
13
- Object.defineProperty(exports, "getChainHelpers", { enumerable: true, get: function () { return lib_1.getChainHelpers; } });
14
- Object.defineProperty(exports, "createRandomVincentWallets", { enumerable: true, get: function () { return lib_1.createRandomVincentWallets; } });
15
- Object.defineProperty(exports, "setupVincentDevelopmentEnvironment", { enumerable: true, get: function () { return lib_1.setupVincentDevelopmentEnvironment; } });
16
- Object.defineProperty(exports, "setupZerodevAccount", { enumerable: true, get: function () { return lib_1.setupZerodevAccount; } });
17
- Object.defineProperty(exports, "setupCrossmintAccount", { enumerable: true, get: function () { return lib_1.setupCrossmintAccount; } });
18
- Object.defineProperty(exports, "setupSafeAccount", { enumerable: true, get: function () { return lib_1.setupSafeAccount; } });
3
+ exports.createPermissionApproval = exports.ensureWalletHasTokens = exports.deploySmartAccountToChain = exports.getEnv = exports.setupVincentDevelopmentEnvironment = void 0;
4
+ var setupVincentDevelopmentEnv_1 = require("./lib/setupVincentDevelopmentEnv");
5
+ Object.defineProperty(exports, "setupVincentDevelopmentEnvironment", { enumerable: true, get: function () { return setupVincentDevelopmentEnv_1.setupVincentDevelopmentEnvironment; } });
6
+ var setup_1 = require("./lib/setup");
7
+ Object.defineProperty(exports, "getEnv", { enumerable: true, get: function () { return setup_1.getEnv; } });
8
+ Object.defineProperty(exports, "deploySmartAccountToChain", { enumerable: true, get: function () { return setup_1.deploySmartAccountToChain; } });
9
+ Object.defineProperty(exports, "ensureWalletHasTokens", { enumerable: true, get: function () { return setup_1.ensureWalletHasTokens; } });
10
+ Object.defineProperty(exports, "createPermissionApproval", { enumerable: true, get: function () { return setup_1.createPermissionApproval; } });
19
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,6BAee;AAdb,gGAAA,SAAS,OAAA;AACT,gGAAA,SAAS,OAAA;AACT,6FAAA,MAAM,OAAA;AACN,4FAAA,KAAK,OAAA;AACL,iGAAA,UAAU,OAAA;AACV,iGAAA,UAAU,OAAA;AACV,mHAAA,4BAA4B,OAAA;AAC5B,6FAAA,MAAM,OAAA;AACN,sGAAA,eAAe,OAAA;AACf,iHAAA,0BAA0B,OAAA;AAC1B,yHAAA,kCAAkC,OAAA;AAClC,0GAAA,mBAAmB,OAAA;AACnB,4GAAA,qBAAqB,OAAA;AACrB,uGAAA,gBAAgB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,+EAAsF;AAA7E,gJAAA,kCAAkC,OAAA;AAC3C,qCAKqB;AAJnB,+FAAA,MAAM,OAAA;AACN,kHAAA,yBAAyB,OAAA;AACzB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA"}
@@ -0,0 +1,3 @@
1
+ import type { AppVersion } from '@lit-protocol/vincent-contracts-sdk';
2
+ export declare function areAbilitiesAndPoliciesEqual(existingAppVersion: AppVersion, newAbilityIpfsCids: string[], newAbilityPolicies: string[][]): boolean;
3
+ //# sourceMappingURL=areAbilitiesAndPoliciesEqual.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areAbilitiesAndPoliciesEqual.d.ts","sourceRoot":"","sources":["../../../../../src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEtE,wBAAgB,4BAA4B,CAC1C,kBAAkB,EAAE,UAAU,EAC9B,kBAAkB,EAAE,MAAM,EAAE,EAC5B,kBAAkB,EAAE,MAAM,EAAE,EAAE,GAC7B,OAAO,CAkCT"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.areAbilitiesAndPoliciesEqual = areAbilitiesAndPoliciesEqual;
4
+ function areAbilitiesAndPoliciesEqual(existingAppVersion, newAbilityIpfsCids, newAbilityPolicies) {
5
+ // Create a map from ability CID to its policies for easy lookup
6
+ const existingAbilityMap = new Map();
7
+ existingAppVersion.abilities.forEach((ability) => {
8
+ existingAbilityMap.set(ability.abilityIpfsCid, ability.policyIpfsCids);
9
+ });
10
+ // Check if we have the same number of abilities
11
+ if (existingAbilityMap.size !== newAbilityIpfsCids.length) {
12
+ return false;
13
+ }
14
+ // For each ability in the new version, check if it exists with the same policies
15
+ const allMatch = newAbilityIpfsCids.every((abilityId, index) => {
16
+ const existingPolicies = existingAbilityMap.get(abilityId);
17
+ if (existingPolicies === undefined)
18
+ return false; // Ability doesn't exist in current version
19
+ const newPolicies = newAbilityPolicies[index];
20
+ if (newPolicies === undefined) {
21
+ throw new Error(`Parallel arrays are not in sync: abilityPolicies[${index}] is undefined for ability '${abilityId}'.`);
22
+ }
23
+ // Compare policy arrays (order-independent)
24
+ if (existingPolicies.length !== newPolicies.length)
25
+ return false;
26
+ const sortedExisting = [...existingPolicies].sort();
27
+ const sortedNew = [...newPolicies].sort();
28
+ return sortedExisting.every((policy, i) => policy === sortedNew[i]);
29
+ });
30
+ return allMatch;
31
+ }
32
+ //# sourceMappingURL=areAbilitiesAndPoliciesEqual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"areAbilitiesAndPoliciesEqual.js","sourceRoot":"","sources":["../../../../../src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.ts"],"names":[],"mappings":";;AAEA,oEAsCC;AAtCD,SAAgB,4BAA4B,CAC1C,kBAA8B,EAC9B,kBAA4B,EAC5B,kBAA8B;IAE9B,gEAAgE;IAChE,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAoB,CAAC;IACvD,kBAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC/C,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,cAA0B,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;IAEH,gDAAgD;IAChD,IAAI,kBAAkB,CAAC,IAAI,KAAK,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAC1D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,iFAAiF;IACjF,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;QAC7D,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,gBAAgB,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC,CAAC,2CAA2C;QAE7F,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,oDAAoD,KAAK,+BAA+B,SAAS,IAAI,CACtG,CAAC;QACJ,CAAC;QAED,4CAA4C;QAC5C,IAAI,gBAAgB,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAEjE,MAAM,cAAc,GAAG,CAAC,GAAG,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC;QACpD,MAAM,SAAS,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;QAE1C,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type NewAppRegistration } from './registerNewApp';
2
+ import { type NewAppVersionRegistration } from './registerNewAppVersion';
3
+ import type { AppMetadata } from '../types';
4
+ export declare function handleAppRegistration({ vincentApiUrl, vincentRegistryRpcUrl, appManagerPrivateKey, appDelegateePrivateKey, appMetadata, appDelegatees, abilityIpfsCids, abilityPolicies, }: {
5
+ vincentApiUrl: string;
6
+ vincentRegistryRpcUrl: string;
7
+ appManagerPrivateKey: `0x${string}`;
8
+ appDelegateePrivateKey: `0x${string}`;
9
+ appMetadata: AppMetadata;
10
+ appDelegatees: `0x${string}`[];
11
+ abilityIpfsCids: string[];
12
+ abilityPolicies: string[][];
13
+ }): Promise<NewAppRegistration | NewAppVersionRegistration>;
14
+ //# sourceMappingURL=handleAppRegistration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleAppRegistration.d.ts","sourceRoot":"","sources":["../../../../../src/lib/setup/app-registration/handleAppRegistration.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,kBAAkB,EAAkB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,KAAK,yBAAyB,EAAyB,MAAM,yBAAyB,CAAC;AAChG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,wBAAsB,qBAAqB,CAAC,EAC1C,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,GAChB,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,KAAK,MAAM,EAAE,CAAC;IACpC,sBAAsB,EAAE,KAAK,MAAM,EAAE,CAAC;IACtC,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IAC/B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC;CAC7B,GAAG,OAAO,CAAC,kBAAkB,GAAG,yBAAyB,CAAC,CAwC1D"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleAppRegistration = handleAppRegistration;
4
+ const ethers_1 = require("ethers");
5
+ const vincent_contracts_sdk_1 = require("@lit-protocol/vincent-contracts-sdk");
6
+ const registerNewApp_1 = require("./registerNewApp");
7
+ const registerNewAppVersion_1 = require("./registerNewAppVersion");
8
+ async function handleAppRegistration({ vincentApiUrl, vincentRegistryRpcUrl, appManagerPrivateKey, appDelegateePrivateKey, appMetadata, appDelegatees, abilityIpfsCids, abilityPolicies, }) {
9
+ console.log('=== Handling app registration ===');
10
+ const delegateeEthersWallet = new ethers_1.Wallet(appDelegateePrivateKey, new ethers_1.providers.JsonRpcProvider(vincentRegistryRpcUrl));
11
+ const client = (0, vincent_contracts_sdk_1.getClient)({ signer: delegateeEthersWallet });
12
+ const delegateeExistingApp = await client.getAppByDelegateeAddress({
13
+ delegateeAddress: delegateeEthersWallet.address,
14
+ });
15
+ if (delegateeExistingApp) {
16
+ console.log(`Found existing app for delegatee ${delegateeEthersWallet.address}:`);
17
+ console.table({
18
+ 'App ID': delegateeExistingApp.id,
19
+ 'Latest Version': delegateeExistingApp.latestVersion,
20
+ 'Manager Address': delegateeExistingApp.manager,
21
+ });
22
+ return await (0, registerNewAppVersion_1.registerNewAppVersion)({
23
+ vincentRegistryRpcUrl,
24
+ vincentApiUrl,
25
+ appManagerPrivateKey,
26
+ existingApp: delegateeExistingApp,
27
+ newAbilityIpfsCids: abilityIpfsCids,
28
+ newAbilityPolicies: abilityPolicies,
29
+ });
30
+ }
31
+ else {
32
+ return await (0, registerNewApp_1.registerNewApp)({
33
+ vincentRegistryRpcUrl,
34
+ vincentApiUrl,
35
+ appMetadata,
36
+ appManagerPrivateKey,
37
+ delegatees: appDelegatees,
38
+ abilityIpfsCids,
39
+ abilityPolicies,
40
+ });
41
+ }
42
+ }
43
+ //# sourceMappingURL=handleAppRegistration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleAppRegistration.js","sourceRoot":"","sources":["../../../../../src/lib/setup/app-registration/handleAppRegistration.ts"],"names":[],"mappings":";;AAOA,sDA0DC;AAjED,mCAA2C;AAC3C,+EAAgE;AAEhE,qDAA2E;AAC3E,mEAAgG;AAGzF,KAAK,UAAU,qBAAqB,CAAC,EAC1C,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACX,aAAa,EACb,eAAe,EACf,eAAe,GAUhB;IACC,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IAEjD,MAAM,qBAAqB,GAAG,IAAI,eAAM,CACtC,sBAAsB,EACtB,IAAI,kBAAS,CAAC,eAAe,CAAC,qBAAqB,CAAC,CACrD,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,iCAAS,EAAC,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC5D,MAAM,oBAAoB,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC;QACjE,gBAAgB,EAAE,qBAAqB,CAAC,OAAO;KAChD,CAAC,CAAC;IAEH,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,oCAAoC,qBAAqB,CAAC,OAAO,GAAG,CAAC,CAAC;QAClF,OAAO,CAAC,KAAK,CAAC;YACZ,QAAQ,EAAE,oBAAoB,CAAC,EAAE;YACjC,gBAAgB,EAAE,oBAAoB,CAAC,aAAa;YACpD,iBAAiB,EAAE,oBAAoB,CAAC,OAAO;SAChD,CAAC,CAAC;QAEH,OAAO,MAAM,IAAA,6CAAqB,EAAC;YACjC,qBAAqB;YACrB,aAAa;YACb,oBAAoB;YACpB,WAAW,EAAE,oBAAoB;YACjC,kBAAkB,EAAE,eAAe;YACnC,kBAAkB,EAAE,eAAe;SACpC,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,IAAA,+BAAc,EAAC;YAC1B,qBAAqB;YACrB,aAAa;YACb,WAAW;YACX,oBAAoB;YACpB,UAAU,EAAE,aAAa;YACzB,eAAe;YACf,eAAe;SAChB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { AppMetadata } from '../types';
2
+ export interface NewAppRegistration {
3
+ appId: number;
4
+ appVersion: number;
5
+ accountIndexHash: string;
6
+ txHash: string;
7
+ }
8
+ export declare function registerNewApp({ vincentRegistryRpcUrl, vincentApiUrl, appManagerPrivateKey, appMetadata, delegatees, abilityIpfsCids, abilityPolicies, }: {
9
+ vincentRegistryRpcUrl: string;
10
+ vincentApiUrl: string;
11
+ appManagerPrivateKey: `0x${string}`;
12
+ appMetadata: AppMetadata;
13
+ delegatees: string[];
14
+ abilityIpfsCids: string[];
15
+ abilityPolicies: string[][];
16
+ }): Promise<NewAppRegistration>;
17
+ //# sourceMappingURL=registerNewApp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerNewApp.d.ts","sourceRoot":"","sources":["../../../../../src/lib/setup/app-registration/registerNewApp.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,cAAc,CAAC,EACnC,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,eAAe,EACf,eAAe,GAChB,EAAE;IACD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,KAAK,MAAM,EAAE,CAAC;IACpC,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC;CAC7B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA+C9B"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerNewApp = registerNewApp;
4
+ const vincent_contracts_sdk_1 = require("@lit-protocol/vincent-contracts-sdk");
5
+ const ethers_1 = require("ethers");
6
+ const registerAppWithVincentApi_1 = require("../vincent-api/registerAppWithVincentApi");
7
+ async function registerNewApp({ vincentRegistryRpcUrl, vincentApiUrl, appManagerPrivateKey, appMetadata, delegatees, abilityIpfsCids, abilityPolicies, }) {
8
+ console.log('=== Registering new app ===');
9
+ const vincentRegistryEthersProvider = new ethers_1.providers.JsonRpcProvider(vincentRegistryRpcUrl);
10
+ const appManagerEthersWallet = new ethers_1.Wallet(appManagerPrivateKey, vincentRegistryEthersProvider);
11
+ const client = (0, vincent_contracts_sdk_1.getClient)({ signer: appManagerEthersWallet });
12
+ const { txHash, appId, newAppVersion, accountIndexHash } = await client.registerApp({
13
+ delegateeAddresses: delegatees,
14
+ versionAbilities: {
15
+ abilityIpfsCids,
16
+ abilityPolicies,
17
+ },
18
+ });
19
+ console.log('Waiting for 2 block confirmations...');
20
+ await vincentRegistryEthersProvider.waitForTransaction(txHash, 2);
21
+ console.log('App registration transaction confirmed');
22
+ await (0, registerAppWithVincentApi_1.registerAppWithVincentApi)({
23
+ vincentApiUrl,
24
+ appManagerPrivateKey,
25
+ appId,
26
+ appMetadata,
27
+ });
28
+ console.table({
29
+ 'App ID': appId,
30
+ 'App Version': newAppVersion,
31
+ 'Account Index Hash': accountIndexHash,
32
+ 'App Registration Transaction Hash': txHash,
33
+ });
34
+ console.log('Abilities and Policies:');
35
+ console.table(abilityIpfsCids.map((cid, index) => ({
36
+ 'Ability IPFS CID': cid,
37
+ Policies: abilityPolicies[index].join(', '),
38
+ })));
39
+ return {
40
+ appId,
41
+ appVersion: newAppVersion,
42
+ accountIndexHash,
43
+ txHash,
44
+ };
45
+ }
46
+ //# sourceMappingURL=registerNewApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerNewApp.js","sourceRoot":"","sources":["../../../../../src/lib/setup/app-registration/registerNewApp.ts"],"names":[],"mappings":";;AAaA,wCA+DC;AA5ED,+EAAgE;AAChE,mCAA2C;AAE3C,wFAAqF;AAU9E,KAAK,UAAU,cAAc,CAAC,EACnC,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,UAAU,EACV,eAAe,EACf,eAAe,GAShB;IACC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;IAE3C,MAAM,6BAA6B,GAAG,IAAI,kBAAS,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC3F,MAAM,sBAAsB,GAAG,IAAI,eAAM,CAAC,oBAAoB,EAAE,6BAA6B,CAAC,CAAC;IAC/F,MAAM,MAAM,GAAG,IAAA,iCAAS,EAAC,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAE7D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC;QAClF,kBAAkB,EAAE,UAAU;QAC9B,gBAAgB,EAAE;YAChB,eAAe;YACf,eAAe;SAChB;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACpD,MAAM,6BAA6B,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IAEtD,MAAM,IAAA,qDAAyB,EAAC;QAC9B,aAAa;QACb,oBAAoB;QACpB,KAAK;QACL,WAAW;KACZ,CAAC,CAAC;IAEH,OAAO,CAAC,KAAK,CAAC;QACZ,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,aAAa;QAC5B,oBAAoB,EAAE,gBAAgB;QACtC,mCAAmC,EAAE,MAAM;KAC5C,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IACvC,OAAO,CAAC,KAAK,CACX,eAAe,CAAC,GAAG,CAAC,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE,CAAC,CAAC;QACnD,kBAAkB,EAAE,GAAG;QACvB,QAAQ,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;KAC5C,CAAC,CAAC,CACJ,CAAC;IAEF,OAAO;QACL,KAAK;QACL,UAAU,EAAE,aAAa;QACzB,gBAAgB;QAChB,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type App } from '@lit-protocol/vincent-contracts-sdk';
2
+ export interface NewAppVersionRegistration {
3
+ appId: number;
4
+ appVersion: number;
5
+ accountIndexHash: string;
6
+ txHash?: string;
7
+ }
8
+ export declare function registerNewAppVersion({ vincentRegistryRpcUrl, vincentApiUrl, existingApp, appManagerPrivateKey, newAbilityIpfsCids, newAbilityPolicies, }: {
9
+ vincentRegistryRpcUrl: string;
10
+ vincentApiUrl: string;
11
+ existingApp: App;
12
+ appManagerPrivateKey: `0x${string}`;
13
+ newAbilityIpfsCids: string[];
14
+ newAbilityPolicies: string[][];
15
+ }): Promise<NewAppVersionRegistration>;
16
+ //# sourceMappingURL=registerNewAppVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerNewAppVersion.d.ts","sourceRoot":"","sources":["../../../../../src/lib/setup/app-registration/registerNewAppVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,GAAG,EAA2B,MAAM,qCAAqC,CAAC;AAQnG,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,GACnB,EAAE;IACD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,GAAG,CAAC;IACjB,oBAAoB,EAAE,KAAK,MAAM,EAAE,CAAC;IACpC,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,kBAAkB,EAAE,MAAM,EAAE,EAAE,CAAC;CAChC,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAmFrC"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerNewAppVersion = registerNewAppVersion;
4
+ const vincent_contracts_sdk_1 = require("@lit-protocol/vincent-contracts-sdk");
5
+ const ethers_1 = require("ethers");
6
+ const viem_1 = require("viem");
7
+ const areAbilitiesAndPoliciesEqual_1 = require("./areAbilitiesAndPoliciesEqual");
8
+ const registerAppVersionWithVincentApi_1 = require("../vincent-api/registerAppVersionWithVincentApi");
9
+ const registerNewAppVersionOnChain_1 = require("../blockchain/registerNewAppVersionOnChain");
10
+ async function registerNewAppVersion({ vincentRegistryRpcUrl, vincentApiUrl, existingApp, appManagerPrivateKey, newAbilityIpfsCids, newAbilityPolicies, }) {
11
+ console.log('=== Registering new app version ===');
12
+ const vincentRegistryEthersProvider = new ethers_1.providers.JsonRpcProvider(vincentRegistryRpcUrl);
13
+ const appManagerEthersWallet = new ethers_1.Wallet(appManagerPrivateKey, vincentRegistryEthersProvider);
14
+ const client = (0, vincent_contracts_sdk_1.getClient)({ signer: appManagerEthersWallet });
15
+ if (existingApp.manager.toLowerCase() !== appManagerEthersWallet.address.toLowerCase()) {
16
+ throw new Error(`${existingApp.manager} is the manager of app ${existingApp.id}, not the provided app manager: ${appManagerEthersWallet.address}.`);
17
+ }
18
+ const latestAppVersion = await client.getAppVersion({
19
+ appId: existingApp.id,
20
+ version: existingApp.latestVersion,
21
+ });
22
+ if (!latestAppVersion) {
23
+ throw new Error(`Latest app version: ${existingApp.latestVersion} for app ${existingApp.id} not found.`);
24
+ }
25
+ const abilitiesMatch = (0, areAbilitiesAndPoliciesEqual_1.areAbilitiesAndPoliciesEqual)(latestAppVersion.appVersion, newAbilityIpfsCids, newAbilityPolicies);
26
+ if (!abilitiesMatch) {
27
+ const { newAppVersion: newAppVersionFromVincentApi } = await (0, registerAppVersionWithVincentApi_1.registerAppVersionWithVincentApi)({
28
+ vincentApiUrl,
29
+ appManagerPrivateKey,
30
+ appId: existingApp.id,
31
+ whatChanged: `New version with updated abilities (${new Date().toISOString()})`,
32
+ });
33
+ const { appId, appVersion: newAppVersionFromChain, txHash, } = await (0, registerNewAppVersionOnChain_1.registerNewAppVersionOnChain)({
34
+ vincentRegistryRpcUrl,
35
+ appManagerPrivateKey,
36
+ appId: existingApp.id,
37
+ abilityIpfsCids: newAbilityIpfsCids,
38
+ abilityPolicies: newAbilityPolicies,
39
+ });
40
+ if (newAppVersionFromVincentApi !== newAppVersionFromChain) {
41
+ throw new Error(`New app version from Vincent API: ${newAppVersionFromVincentApi} does not match new app version from chain: ${newAppVersionFromChain}`);
42
+ }
43
+ const accountIndexHash = (0, viem_1.toHex)((0, vincent_contracts_sdk_1.deriveSmartAccountIndex)(appId), { size: 32 });
44
+ console.log('New app version registered');
45
+ console.table({
46
+ 'App ID': appId,
47
+ 'New App Version': newAppVersionFromChain,
48
+ 'Account Index Hash': accountIndexHash,
49
+ 'Version Registration Transaction Hash': txHash,
50
+ });
51
+ return {
52
+ appId,
53
+ appVersion: newAppVersionFromChain,
54
+ accountIndexHash,
55
+ txHash,
56
+ };
57
+ }
58
+ else {
59
+ console.log('Abilities and Policies match, no new app version needed');
60
+ }
61
+ const accountIndexHash = (0, viem_1.toHex)((0, vincent_contracts_sdk_1.deriveSmartAccountIndex)(existingApp.id), { size: 32 });
62
+ return {
63
+ appId: existingApp.id,
64
+ appVersion: existingApp.latestVersion,
65
+ accountIndexHash,
66
+ };
67
+ }
68
+ //# sourceMappingURL=registerNewAppVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerNewAppVersion.js","sourceRoot":"","sources":["../../../../../src/lib/setup/app-registration/registerNewAppVersion.ts"],"names":[],"mappings":";;AAeA,sDAiGC;AAhHD,+EAAmG;AACnG,mCAA2C;AAC3C,+BAA6B;AAE7B,iFAA8E;AAC9E,sGAAmG;AACnG,6FAA0F;AASnF,KAAK,UAAU,qBAAqB,CAAC,EAC1C,qBAAqB,EACrB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,GAQnB;IACC,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IAEnD,MAAM,6BAA6B,GAAG,IAAI,kBAAS,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC3F,MAAM,sBAAsB,GAAG,IAAI,eAAM,CAAC,oBAAoB,EAAE,6BAA6B,CAAC,CAAC;IAC/F,MAAM,MAAM,GAAG,IAAA,iCAAS,EAAC,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAE7D,IAAI,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,sBAAsB,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;QACvF,MAAM,IAAI,KAAK,CACb,GAAG,WAAW,CAAC,OAAO,0BAA0B,WAAW,CAAC,EAAE,mCAAmC,sBAAsB,CAAC,OAAO,GAAG,CACnI,CAAC;IACJ,CAAC;IAED,MAAM,gBAAgB,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC;QAClD,KAAK,EAAE,WAAW,CAAC,EAAE;QACrB,OAAO,EAAE,WAAW,CAAC,aAAa;KACnC,CAAC,CAAC;IAEH,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,uBAAuB,WAAW,CAAC,aAAa,YAAY,WAAW,CAAC,EAAE,aAAa,CACxF,CAAC;IACJ,CAAC;IAED,MAAM,cAAc,GAAG,IAAA,2DAA4B,EACjD,gBAAgB,CAAC,UAAU,EAC3B,kBAAkB,EAClB,kBAAkB,CACnB,CAAC;IAEF,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,EAAE,aAAa,EAAE,2BAA2B,EAAE,GAAG,MAAM,IAAA,mEAAgC,EAAC;YAC5F,aAAa;YACb,oBAAoB;YACpB,KAAK,EAAE,WAAW,CAAC,EAAE;YACrB,WAAW,EAAE,uCAAuC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,GAAG;SAChF,CAAC,CAAC;QAEH,MAAM,EACJ,KAAK,EACL,UAAU,EAAE,sBAAsB,EAClC,MAAM,GACP,GAAG,MAAM,IAAA,2DAA4B,EAAC;YACrC,qBAAqB;YACrB,oBAAoB;YACpB,KAAK,EAAE,WAAW,CAAC,EAAE;YACrB,eAAe,EAAE,kBAAkB;YACnC,eAAe,EAAE,kBAAkB;SACpC,CAAC,CAAC;QAEH,IAAI,2BAA2B,KAAK,sBAAsB,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CACb,qCAAqC,2BAA2B,+CAA+C,sBAAsB,EAAE,CACxI,CAAC;QACJ,CAAC;QAED,MAAM,gBAAgB,GAAG,IAAA,YAAK,EAAC,IAAA,+CAAuB,EAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAE7E,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAC1C,OAAO,CAAC,KAAK,CAAC;YACZ,QAAQ,EAAE,KAAK;YACf,iBAAiB,EAAE,sBAAsB;YACzC,oBAAoB,EAAE,gBAAgB;YACtC,uCAAuC,EAAE,MAAM;SAChD,CAAC,CAAC;QAEH,OAAO;YACL,KAAK;YACL,UAAU,EAAE,sBAAsB;YAClC,gBAAgB;YAChB,MAAM;SACP,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAA,YAAK,EAAC,IAAA,+CAAuB,EAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAEtF,OAAO;QACL,KAAK,EAAE,WAAW,CAAC,EAAE;QACrB,UAAU,EAAE,WAAW,CAAC,aAAa;QACrC,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { AppMetadata } from './types';
2
+ export interface SetupVincentAppParams {
3
+ vincentApiUrl: string;
4
+ vincentRegistryRpcUrl: string;
5
+ appMetadata: AppMetadata;
6
+ appManagerPrivateKey: `0x${string}`;
7
+ appDelegateePrivateKey: `0x${string}`;
8
+ appDelegatees: `0x${string}`[];
9
+ abilityIpfsCids: string[];
10
+ abilityPolicies: string[][];
11
+ }
12
+ export interface VincentAppInfo {
13
+ appId: number;
14
+ appVersion: number;
15
+ accountIndexHash?: string;
16
+ txHash?: string;
17
+ }
18
+ export declare function setupVincentApp({ vincentApiUrl, vincentRegistryRpcUrl, appMetadata, appManagerPrivateKey, appDelegateePrivateKey, appDelegatees, abilityIpfsCids, abilityPolicies, }: SetupVincentAppParams): Promise<VincentAppInfo>;
19
+ //# sourceMappingURL=app-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-setup.d.ts","sourceRoot":"","sources":["../../../../src/lib/setup/app-setup.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,oBAAoB,EAAE,KAAK,MAAM,EAAE,CAAC;IACpC,sBAAsB,EAAE,KAAK,MAAM,EAAE,CAAC;IACtC,aAAa,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IAC/B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,eAAe,CAAC,EACpC,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,eAAe,GAChB,EAAE,qBAAqB,GAAG,OAAO,CAAC,cAAc,CAAC,CAkCjD"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupVincentApp = setupVincentApp;
4
+ const handleAppRegistration_1 = require("./app-registration/handleAppRegistration");
5
+ const setActiveVersionWithVincentApi_1 = require("./vincent-api/setActiveVersionWithVincentApi");
6
+ async function setupVincentApp({ vincentApiUrl, vincentRegistryRpcUrl, appMetadata, appManagerPrivateKey, appDelegateePrivateKey, appDelegatees, abilityIpfsCids, abilityPolicies, }) {
7
+ console.log('=== Setting up Vincent App ===');
8
+ // Step 1: Handle app registration (new app or new version)
9
+ // This registers on-chain and with the API
10
+ const registration = await (0, handleAppRegistration_1.handleAppRegistration)({
11
+ vincentApiUrl,
12
+ vincentRegistryRpcUrl,
13
+ appManagerPrivateKey,
14
+ appDelegateePrivateKey,
15
+ appMetadata,
16
+ appDelegatees,
17
+ abilityIpfsCids,
18
+ abilityPolicies,
19
+ });
20
+ // Step 2: Set active version
21
+ // For new apps: handleAppRegistration already called registerAppWithVincentApi
22
+ // For new versions: handleAppRegistration already called registerAppVersionWithVincentApi
23
+ // Now we just need to set the active version
24
+ await (0, setActiveVersionWithVincentApi_1.setActiveVersionWithVincentApi)({
25
+ vincentApiUrl,
26
+ appManagerPrivateKey,
27
+ appId: registration.appId,
28
+ activeVersion: registration.appVersion,
29
+ });
30
+ return {
31
+ appId: registration.appId,
32
+ appVersion: registration.appVersion,
33
+ accountIndexHash: 'accountIndexHash' in registration ? registration.accountIndexHash : undefined,
34
+ txHash: registration.txHash,
35
+ };
36
+ }
37
+ //# sourceMappingURL=app-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-setup.js","sourceRoot":"","sources":["../../../../src/lib/setup/app-setup.ts"],"names":[],"mappings":";;AAsBA,0CA2CC;AAjED,oFAAiF;AACjF,iGAA8F;AAqBvF,KAAK,UAAU,eAAe,CAAC,EACpC,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,eAAe,GACO;IACtB,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAE9C,2DAA2D;IAC3D,2CAA2C;IAC3C,MAAM,YAAY,GAAG,MAAM,IAAA,6CAAqB,EAAC;QAC/C,aAAa;QACb,qBAAqB;QACrB,oBAAoB;QACpB,sBAAsB;QACtB,WAAW;QACX,aAAa;QACb,eAAe;QACf,eAAe;KAChB,CAAC,CAAC;IAEH,6BAA6B;IAC7B,+EAA+E;IAC/E,0FAA0F;IAC1F,6CAA6C;IAC7C,MAAM,IAAA,+DAA8B,EAAC;QACnC,aAAa;QACb,oBAAoB;QACpB,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,aAAa,EAAE,YAAY,CAAC,UAAU;KACvC,CAAC,CAAC;IAEH,OAAO;QACL,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,UAAU,EAAE,YAAY,CAAC,UAAU;QACnC,gBAAgB,EACd,kBAAkB,IAAI,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;QAChF,MAAM,EAAE,YAAY,CAAC,MAAM;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type PublicClient, type WalletClient, type Account } from 'viem';
2
+ export declare function installAppUsingUserEoa({ userEoaWalletClient, vincentRegistryPublicClient, transactionData, }: {
3
+ userEoaWalletClient: WalletClient<any, any, Account>;
4
+ vincentRegistryPublicClient: PublicClient;
5
+ transactionData: {
6
+ to: `0x${string}`;
7
+ data: `0x${string}`;
8
+ };
9
+ }): Promise<`0x${string}`>;
10
+ //# sourceMappingURL=installAppUsingUserEoa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installAppUsingUserEoa.d.ts","sourceRoot":"","sources":["../../../../../src/lib/setup/blockchain/installAppUsingUserEoa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AAE1E,wBAAsB,sBAAsB,CAAC,EAC3C,mBAAmB,EACnB,2BAA2B,EAC3B,eAAe,GAChB,EAAE;IACD,mBAAmB,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IACrD,2BAA2B,EAAE,YAAY,CAAC;IAC1C,eAAe,EAAE;QACf,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;QAClB,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;KACrB,CAAC;CACH,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAgBzB"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.installAppUsingUserEoa = installAppUsingUserEoa;
4
+ async function installAppUsingUserEoa({ userEoaWalletClient, vincentRegistryPublicClient, transactionData, }) {
5
+ console.log('=== Installing app using user EOA (direct submission from user EOA) ===');
6
+ const txHash = await userEoaWalletClient.sendTransaction({
7
+ to: transactionData.to,
8
+ data: transactionData.data,
9
+ chain: userEoaWalletClient.chain,
10
+ });
11
+ const receipt = await vincentRegistryPublicClient.waitForTransactionReceipt({ hash: txHash });
12
+ if (receipt.status !== 'success') {
13
+ throw new Error(`Transaction failed. Tx hash: ${txHash}`);
14
+ }
15
+ return txHash;
16
+ }
17
+ //# sourceMappingURL=installAppUsingUserEoa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installAppUsingUserEoa.js","sourceRoot":"","sources":["../../../../../src/lib/setup/blockchain/installAppUsingUserEoa.ts"],"names":[],"mappings":";;AAEA,wDA2BC;AA3BM,KAAK,UAAU,sBAAsB,CAAC,EAC3C,mBAAmB,EACnB,2BAA2B,EAC3B,eAAe,GAQhB;IACC,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IAEvF,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,eAAe,CAAC;QACvD,EAAE,EAAE,eAAe,CAAC,EAAE;QACtB,IAAI,EAAE,eAAe,CAAC,IAAI;QAC1B,KAAK,EAAE,mBAAmB,CAAC,KAAK;KACjC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,2BAA2B,CAAC,yBAAyB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAE9F,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,gCAAgC,MAAM,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare function registerNewAppVersionOnChain({ vincentRegistryRpcUrl, appManagerPrivateKey, appId, abilityIpfsCids, abilityPolicies, }: {
2
+ vincentRegistryRpcUrl: string;
3
+ appManagerPrivateKey: `0x${string}`;
4
+ appId: number;
5
+ abilityIpfsCids: string[];
6
+ abilityPolicies: string[][];
7
+ }): Promise<{
8
+ appId: number;
9
+ appVersion: number;
10
+ txHash: string;
11
+ }>;
12
+ //# sourceMappingURL=registerNewAppVersionOnChain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerNewAppVersionOnChain.d.ts","sourceRoot":"","sources":["../../../../../src/lib/setup/blockchain/registerNewAppVersionOnChain.ts"],"names":[],"mappings":"AAGA,wBAAsB,4BAA4B,CAAC,EACjD,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,EACL,eAAe,EACf,eAAe,GAChB,EAAE;IACD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,KAAK,MAAM,EAAE,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,EAAE,CAAC;CAC7B,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBjE"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerNewAppVersionOnChain = registerNewAppVersionOnChain;
4
+ const vincent_contracts_sdk_1 = require("@lit-protocol/vincent-contracts-sdk");
5
+ const ethers_1 = require("ethers");
6
+ async function registerNewAppVersionOnChain({ vincentRegistryRpcUrl, appManagerPrivateKey, appId, abilityIpfsCids, abilityPolicies, }) {
7
+ const vincentRegistryEthersProvider = new ethers_1.providers.JsonRpcProvider(vincentRegistryRpcUrl);
8
+ const appManagerEthersWallet = new ethers_1.Wallet(appManagerPrivateKey, vincentRegistryEthersProvider);
9
+ const client = (0, vincent_contracts_sdk_1.getClient)({ signer: appManagerEthersWallet });
10
+ // Register new version if abilities or policies have changed
11
+ const { txHash, newAppVersion } = await client.registerNextVersion({
12
+ appId,
13
+ versionAbilities: {
14
+ abilityIpfsCids,
15
+ abilityPolicies,
16
+ },
17
+ });
18
+ console.log('Waiting for 2 block confirmations...');
19
+ await vincentRegistryEthersProvider.waitForTransaction(txHash, 2);
20
+ console.log('New app version registration transaction confirmed');
21
+ return { appId, appVersion: newAppVersion, txHash };
22
+ }
23
+ //# sourceMappingURL=registerNewAppVersionOnChain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerNewAppVersionOnChain.js","sourceRoot":"","sources":["../../../../../src/lib/setup/blockchain/registerNewAppVersionOnChain.ts"],"names":[],"mappings":";;AAGA,oEA+BC;AAlCD,+EAAgE;AAChE,mCAA2C;AAEpC,KAAK,UAAU,4BAA4B,CAAC,EACjD,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,EACL,eAAe,EACf,eAAe,GAOhB;IACC,MAAM,6BAA6B,GAAG,IAAI,kBAAS,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC;IAC3F,MAAM,sBAAsB,GAAG,IAAI,eAAM,CAAC,oBAAoB,EAAE,6BAA6B,CAAC,CAAC;IAC/F,MAAM,MAAM,GAAG,IAAA,iCAAS,EAAC,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAE7D,6DAA6D;IAC7D,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,CAAC;QACjE,KAAK;QACL,gBAAgB,EAAE;YAChB,eAAe;YACf,eAAe;SAChB;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACpD,MAAM,6BAA6B,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;IAElE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const getEnv: (key: string, fallback?: string) => string;
2
+ //# sourceMappingURL=getEnv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEnv.d.ts","sourceRoot":"","sources":["../../../../src/lib/setup/getEnv.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,EAAE,WAAW,MAAM,KAAG,MASvD,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEnv = void 0;
4
+ // Helper to get required environment variables
5
+ const getEnv = (key, fallback) => {
6
+ const value = process.env[key] ?? fallback;
7
+ if (!value) {
8
+ throw new Error(`Environment variable ${key} is not set`);
9
+ }
10
+ if (!process.env[key] && fallback) {
11
+ console.warn(`${key} not set; using fallback value.`);
12
+ }
13
+ return value;
14
+ };
15
+ exports.getEnv = getEnv;
16
+ //# sourceMappingURL=getEnv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEnv.js","sourceRoot":"","sources":["../../../../src/lib/setup/getEnv.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AACxC,MAAM,MAAM,GAAG,CAAC,GAAW,EAAE,QAAiB,EAAU,EAAE;IAC/D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC;IAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,aAAa,CAAC,CAAC;IAC5D,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,QAAQ,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,iCAAiC,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AATW,QAAA,MAAM,UASjB"}
@@ -0,0 +1,9 @@
1
+ export { setupWallets } from './wallets/setupWallets';
2
+ export { setupVincentApp } from './app-setup';
3
+ export { setupAgentSmartAccount } from './setupAgentSmartAccount';
4
+ export { deploySmartAccountToChain } from './smart-account/deploySmartAccountToChain';
5
+ export { createPermissionApproval } from './smart-account/createPermissionApproval';
6
+ export { ensureWalletHasTokens } from './wallets/ensureWalletHasTokens';
7
+ export { getEnv } from './getEnv';
8
+ export type { SetupConfig, VincentDevEnvironment } from './types';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/setup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}