@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.
Files changed (256) hide show
  1. package/dist/package.json +2 -6
  2. package/dist/src/index.d.ts +3 -2
  3. package/dist/src/index.d.ts.map +1 -1
  4. package/dist/src/index.js +8 -16
  5. package/dist/src/index.js.map +1 -1
  6. package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.d.ts +3 -0
  7. package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.d.ts.map +1 -0
  8. package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.js +32 -0
  9. package/dist/src/lib/setup/app-registration/areAbilitiesAndPoliciesEqual.js.map +1 -0
  10. package/dist/src/lib/setup/app-registration/handleAppRegistration.d.ts +14 -0
  11. package/dist/src/lib/setup/app-registration/handleAppRegistration.d.ts.map +1 -0
  12. package/dist/src/lib/setup/app-registration/handleAppRegistration.js +43 -0
  13. package/dist/src/lib/setup/app-registration/handleAppRegistration.js.map +1 -0
  14. package/dist/src/lib/setup/app-registration/registerNewApp.d.ts +17 -0
  15. package/dist/src/lib/setup/app-registration/registerNewApp.d.ts.map +1 -0
  16. package/dist/src/lib/setup/app-registration/registerNewApp.js +46 -0
  17. package/dist/src/lib/setup/app-registration/registerNewApp.js.map +1 -0
  18. package/dist/src/lib/setup/app-registration/registerNewAppVersion.d.ts +16 -0
  19. package/dist/src/lib/setup/app-registration/registerNewAppVersion.d.ts.map +1 -0
  20. package/dist/src/lib/setup/app-registration/registerNewAppVersion.js +68 -0
  21. package/dist/src/lib/setup/app-registration/registerNewAppVersion.js.map +1 -0
  22. package/dist/src/lib/setup/app-setup.d.ts +19 -0
  23. package/dist/src/lib/setup/app-setup.d.ts.map +1 -0
  24. package/dist/src/lib/setup/app-setup.js +37 -0
  25. package/dist/src/lib/setup/app-setup.js.map +1 -0
  26. package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.d.ts +10 -0
  27. package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.d.ts.map +1 -0
  28. package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.js +17 -0
  29. package/dist/src/lib/setup/blockchain/installAppUsingUserEoa.js.map +1 -0
  30. package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.d.ts +12 -0
  31. package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.d.ts.map +1 -0
  32. package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.js +23 -0
  33. package/dist/src/lib/setup/blockchain/registerNewAppVersionOnChain.js.map +1 -0
  34. package/dist/src/lib/setup/getEnv.d.ts +2 -0
  35. package/dist/src/lib/setup/getEnv.d.ts.map +1 -0
  36. package/dist/src/lib/setup/getEnv.js +16 -0
  37. package/dist/src/lib/setup/getEnv.js.map +1 -0
  38. package/dist/src/lib/setup/index.d.ts +9 -0
  39. package/dist/src/lib/setup/index.d.ts.map +1 -0
  40. package/dist/src/lib/setup/index.js +18 -0
  41. package/dist/src/lib/setup/index.js.map +1 -0
  42. package/dist/src/lib/setup/setupAgentSmartAccount.d.ts +19 -0
  43. package/dist/src/lib/setup/setupAgentSmartAccount.d.ts.map +1 -0
  44. package/dist/src/lib/setup/setupAgentSmartAccount.js +100 -0
  45. package/dist/src/lib/setup/setupAgentSmartAccount.js.map +1 -0
  46. package/dist/src/lib/setup/smart-account/createPermissionApproval.d.ts +11 -0
  47. package/dist/src/lib/setup/smart-account/createPermissionApproval.d.ts.map +1 -0
  48. package/dist/src/lib/setup/smart-account/createPermissionApproval.js +45 -0
  49. package/dist/src/lib/setup/smart-account/createPermissionApproval.js.map +1 -0
  50. package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.d.ts +16 -0
  51. package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.d.ts.map +1 -0
  52. package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.js +128 -0
  53. package/dist/src/lib/setup/smart-account/deploySmartAccountToChain.js.map +1 -0
  54. package/dist/src/lib/setup/smart-account/deriveAgentAddress.d.ts +23 -0
  55. package/dist/src/lib/setup/smart-account/deriveAgentAddress.d.ts.map +1 -0
  56. package/dist/src/lib/setup/smart-account/deriveAgentAddress.js +36 -0
  57. package/dist/src/lib/setup/smart-account/deriveAgentAddress.js.map +1 -0
  58. package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.d.ts +12 -0
  59. package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.d.ts.map +1 -0
  60. package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.js +82 -0
  61. package/dist/src/lib/setup/smart-account/vincentViemPkpSigner.js.map +1 -0
  62. package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.d.ts +10 -0
  63. package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.d.ts.map +1 -0
  64. package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.js +34 -0
  65. package/dist/src/lib/setup/smart-account/wrapKernelAccountWithUserOpCapture.js.map +1 -0
  66. package/dist/src/lib/setup/types.d.ts +92 -0
  67. package/dist/src/lib/setup/types.d.ts.map +1 -0
  68. package/dist/src/lib/{types.js.map → setup/types.js.map} +1 -1
  69. package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.d.ts +32 -0
  70. package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.d.ts.map +1 -0
  71. package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.js +58 -0
  72. package/dist/src/lib/setup/vincent-api/completeAppInstallationViaVincentApi.js.map +1 -0
  73. package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.d.ts +4 -0
  74. package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.d.ts.map +1 -0
  75. package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.js +28 -0
  76. package/dist/src/lib/setup/vincent-api/generateAppManagerJwt.js.map +1 -0
  77. package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.d.ts +31 -0
  78. package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.d.ts.map +1 -0
  79. package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.js +31 -0
  80. package/dist/src/lib/setup/vincent-api/installAppViaVincentApi.js.map +1 -0
  81. package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.d.ts +9 -0
  82. package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.d.ts.map +1 -0
  83. package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.js +27 -0
  84. package/dist/src/lib/setup/vincent-api/registerAppVersionWithVincentApi.js.map +1 -0
  85. package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.d.ts +8 -0
  86. package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.d.ts.map +1 -0
  87. package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.js +30 -0
  88. package/dist/src/lib/setup/vincent-api/registerAppWithVincentApi.js.map +1 -0
  89. package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.d.ts +7 -0
  90. package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.d.ts.map +1 -0
  91. package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.js +25 -0
  92. package/dist/src/lib/setup/vincent-api/setActiveVersionWithVincentApi.js.map +1 -0
  93. package/dist/src/lib/setup/wallets/ensureWalletHasTokens.d.ts +14 -0
  94. package/dist/src/lib/setup/wallets/ensureWalletHasTokens.d.ts.map +1 -0
  95. package/dist/src/lib/setup/wallets/ensureWalletHasTokens.js +27 -0
  96. package/dist/src/lib/setup/wallets/ensureWalletHasTokens.js.map +1 -0
  97. package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.d.ts +15 -0
  98. package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.d.ts.map +1 -0
  99. package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.js +63 -0
  100. package/dist/src/lib/setup/wallets/ensureWalletHasUnexpiredCapacityCredit.js.map +1 -0
  101. package/dist/src/lib/setup/wallets/setupWallets.d.ts +48 -0
  102. package/dist/src/lib/setup/wallets/setupWallets.d.ts.map +1 -0
  103. package/dist/src/lib/setup/wallets/setupWallets.js +159 -0
  104. package/dist/src/lib/setup/wallets/setupWallets.js.map +1 -0
  105. package/dist/src/lib/setupVincentDevelopmentEnv.d.ts +3 -0
  106. package/dist/src/lib/setupVincentDevelopmentEnv.d.ts.map +1 -0
  107. package/dist/src/lib/setupVincentDevelopmentEnv.js +64 -0
  108. package/dist/src/lib/setupVincentDevelopmentEnv.js.map +1 -0
  109. package/package.json +3 -7
  110. package/dist/src/lib/appManager/ensure-funded.d.ts +0 -2
  111. package/dist/src/lib/appManager/ensure-funded.d.ts.map +0 -1
  112. package/dist/src/lib/appManager/ensure-funded.js +0 -11
  113. package/dist/src/lib/appManager/ensure-funded.js.map +0 -1
  114. package/dist/src/lib/appManager/index.d.ts +0 -5
  115. package/dist/src/lib/appManager/index.d.ts.map +0 -1
  116. package/dist/src/lib/appManager/index.js +0 -12
  117. package/dist/src/lib/appManager/index.js.map +0 -1
  118. package/dist/src/lib/appManager/register-new-app-version.d.ts +0 -28
  119. package/dist/src/lib/appManager/register-new-app-version.d.ts.map +0 -1
  120. package/dist/src/lib/appManager/register-new-app-version.js +0 -82
  121. package/dist/src/lib/appManager/register-new-app-version.js.map +0 -1
  122. package/dist/src/lib/appManager/register-new-app.d.ts +0 -13
  123. package/dist/src/lib/appManager/register-new-app.d.ts.map +0 -1
  124. package/dist/src/lib/appManager/register-new-app.js +0 -25
  125. package/dist/src/lib/appManager/register-new-app.js.map +0 -1
  126. package/dist/src/lib/appManager/remove-delegatee-from-app.d.ts +0 -7
  127. package/dist/src/lib/appManager/remove-delegatee-from-app.d.ts.map +0 -1
  128. package/dist/src/lib/appManager/remove-delegatee-from-app.js +0 -26
  129. package/dist/src/lib/appManager/remove-delegatee-from-app.js.map +0 -1
  130. package/dist/src/lib/chain.d.ts +0 -13
  131. package/dist/src/lib/chain.d.ts.map +0 -1
  132. package/dist/src/lib/chain.js +0 -30
  133. package/dist/src/lib/chain.js.map +0 -1
  134. package/dist/src/lib/create-random-vincent-wallets.d.ts +0 -7
  135. package/dist/src/lib/create-random-vincent-wallets.d.ts.map +0 -1
  136. package/dist/src/lib/create-random-vincent-wallets.js +0 -12
  137. package/dist/src/lib/create-random-vincent-wallets.js.map +0 -1
  138. package/dist/src/lib/delegatee/ensure-funded.d.ts +0 -2
  139. package/dist/src/lib/delegatee/ensure-funded.d.ts.map +0 -1
  140. package/dist/src/lib/delegatee/ensure-funded.js +0 -11
  141. package/dist/src/lib/delegatee/ensure-funded.js.map +0 -1
  142. package/dist/src/lib/delegatee/get-app-info.d.ts +0 -5
  143. package/dist/src/lib/delegatee/get-app-info.d.ts.map +0 -1
  144. package/dist/src/lib/delegatee/get-app-info.js +0 -19
  145. package/dist/src/lib/delegatee/get-app-info.js.map +0 -1
  146. package/dist/src/lib/delegatee/index.d.ts +0 -3
  147. package/dist/src/lib/delegatee/index.d.ts.map +0 -1
  148. package/dist/src/lib/delegatee/index.js +0 -8
  149. package/dist/src/lib/delegatee/index.js.map +0 -1
  150. package/dist/src/lib/delegator/add-permission-for-abilities.d.ts +0 -4
  151. package/dist/src/lib/delegator/add-permission-for-abilities.d.ts.map +0 -1
  152. package/dist/src/lib/delegator/add-permission-for-abilities.js +0 -21
  153. package/dist/src/lib/delegator/add-permission-for-abilities.js.map +0 -1
  154. package/dist/src/lib/delegator/agent-pkp.d.ts +0 -20
  155. package/dist/src/lib/delegator/agent-pkp.d.ts.map +0 -1
  156. package/dist/src/lib/delegator/agent-pkp.js +0 -96
  157. package/dist/src/lib/delegator/agent-pkp.js.map +0 -1
  158. package/dist/src/lib/delegator/get-platform-user-pkp-wallet.d.ts +0 -8
  159. package/dist/src/lib/delegator/get-platform-user-pkp-wallet.d.ts.map +0 -1
  160. package/dist/src/lib/delegator/get-platform-user-pkp-wallet.js +0 -77
  161. package/dist/src/lib/delegator/get-platform-user-pkp-wallet.js.map +0 -1
  162. package/dist/src/lib/delegator/index.d.ts +0 -7
  163. package/dist/src/lib/delegator/index.d.ts.map +0 -1
  164. package/dist/src/lib/delegator/index.js +0 -20
  165. package/dist/src/lib/delegator/index.js.map +0 -1
  166. package/dist/src/lib/delegator/permit-vincent-app-version.d.ts +0 -19
  167. package/dist/src/lib/delegator/permit-vincent-app-version.d.ts.map +0 -1
  168. package/dist/src/lib/delegator/permit-vincent-app-version.js +0 -45
  169. package/dist/src/lib/delegator/permit-vincent-app-version.js.map +0 -1
  170. package/dist/src/lib/delegator/platform-user-pkp.d.ts +0 -10
  171. package/dist/src/lib/delegator/platform-user-pkp.d.ts.map +0 -1
  172. package/dist/src/lib/delegator/platform-user-pkp.js +0 -48
  173. package/dist/src/lib/delegator/platform-user-pkp.js.map +0 -1
  174. package/dist/src/lib/ensure-capacity-credit.d.ts +0 -4
  175. package/dist/src/lib/ensure-capacity-credit.d.ts.map +0 -1
  176. package/dist/src/lib/ensure-capacity-credit.js +0 -57
  177. package/dist/src/lib/ensure-capacity-credit.js.map +0 -1
  178. package/dist/src/lib/env.d.ts +0 -30
  179. package/dist/src/lib/env.d.ts.map +0 -1
  180. package/dist/src/lib/env.js +0 -58
  181. package/dist/src/lib/env.js.map +0 -1
  182. package/dist/src/lib/environment/crossmint.d.ts +0 -3
  183. package/dist/src/lib/environment/crossmint.d.ts.map +0 -1
  184. package/dist/src/lib/environment/crossmint.js +0 -23
  185. package/dist/src/lib/environment/crossmint.js.map +0 -1
  186. package/dist/src/lib/environment/safe.d.ts +0 -567
  187. package/dist/src/lib/environment/safe.d.ts.map +0 -1
  188. package/dist/src/lib/environment/safe.js +0 -41
  189. package/dist/src/lib/environment/safe.js.map +0 -1
  190. package/dist/src/lib/environment/zerodev.d.ts +0 -49
  191. package/dist/src/lib/environment/zerodev.d.ts.map +0 -1
  192. package/dist/src/lib/environment/zerodev.js +0 -32
  193. package/dist/src/lib/environment/zerodev.js.map +0 -1
  194. package/dist/src/lib/funder/check-funder-balance.d.ts +0 -3
  195. package/dist/src/lib/funder/check-funder-balance.d.ts.map +0 -1
  196. package/dist/src/lib/funder/check-funder-balance.js +0 -19
  197. package/dist/src/lib/funder/check-funder-balance.js.map +0 -1
  198. package/dist/src/lib/funder/ensure-wallet-has-test-tokens.d.ts +0 -5
  199. package/dist/src/lib/funder/ensure-wallet-has-test-tokens.d.ts.map +0 -1
  200. package/dist/src/lib/funder/ensure-wallet-has-test-tokens.js +0 -35
  201. package/dist/src/lib/funder/ensure-wallet-has-test-tokens.js.map +0 -1
  202. package/dist/src/lib/funder/index.d.ts +0 -5
  203. package/dist/src/lib/funder/index.d.ts.map +0 -1
  204. package/dist/src/lib/funder/index.js +0 -10
  205. package/dist/src/lib/funder/index.js.map +0 -1
  206. package/dist/src/lib/index.d.ts +0 -18
  207. package/dist/src/lib/index.d.ts.map +0 -1
  208. package/dist/src/lib/index.js +0 -31
  209. package/dist/src/lib/index.js.map +0 -1
  210. package/dist/src/lib/litContractsClient/LitContractsInstance.d.ts +0 -14
  211. package/dist/src/lib/litContractsClient/LitContractsInstance.d.ts.map +0 -1
  212. package/dist/src/lib/litContractsClient/LitContractsInstance.js +0 -48
  213. package/dist/src/lib/litContractsClient/LitContractsInstance.js.map +0 -1
  214. package/dist/src/lib/litContractsClient/get-lit-contract-client.d.ts +0 -7
  215. package/dist/src/lib/litContractsClient/get-lit-contract-client.d.ts.map +0 -1
  216. package/dist/src/lib/litContractsClient/get-lit-contract-client.js +0 -19
  217. package/dist/src/lib/litContractsClient/get-lit-contract-client.js.map +0 -1
  218. package/dist/src/lib/litContractsClient/index.d.ts +0 -3
  219. package/dist/src/lib/litContractsClient/index.d.ts.map +0 -1
  220. package/dist/src/lib/litContractsClient/index.js +0 -8
  221. package/dist/src/lib/litContractsClient/index.js.map +0 -1
  222. package/dist/src/lib/mint-new-pkp.d.ts +0 -16
  223. package/dist/src/lib/mint-new-pkp.d.ts.map +0 -1
  224. package/dist/src/lib/mint-new-pkp.js +0 -40
  225. package/dist/src/lib/mint-new-pkp.js.map +0 -1
  226. package/dist/src/lib/setup-vincent-development-environment.d.ts +0 -81
  227. package/dist/src/lib/setup-vincent-development-environment.d.ts.map +0 -1
  228. package/dist/src/lib/setup-vincent-development-environment.js +0 -185
  229. package/dist/src/lib/setup-vincent-development-environment.js.map +0 -1
  230. package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.d.ts +0 -3
  231. package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.d.ts.map +0 -1
  232. package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.js +0 -96
  233. package/dist/src/lib/smartAccount/crossmint/setup-crossmint-account.js.map +0 -1
  234. package/dist/src/lib/smartAccount/index.d.ts +0 -5
  235. package/dist/src/lib/smartAccount/index.d.ts.map +0 -1
  236. package/dist/src/lib/smartAccount/index.js +0 -10
  237. package/dist/src/lib/smartAccount/index.js.map +0 -1
  238. package/dist/src/lib/smartAccount/safe/setup-safe-account.d.ts +0 -15
  239. package/dist/src/lib/smartAccount/safe/setup-safe-account.d.ts.map +0 -1
  240. package/dist/src/lib/smartAccount/safe/setup-safe-account.js +0 -92
  241. package/dist/src/lib/smartAccount/safe/setup-safe-account.js.map +0 -1
  242. package/dist/src/lib/smartAccount/types.d.ts +0 -30
  243. package/dist/src/lib/smartAccount/types.d.ts.map +0 -1
  244. package/dist/src/lib/smartAccount/types.js.map +0 -1
  245. package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.d.ts +0 -3
  246. package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.d.ts.map +0 -1
  247. package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.js +0 -24
  248. package/dist/src/lib/smartAccount/zerodev/get-permission-empty-validator.js.map +0 -1
  249. package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.d.ts +0 -18
  250. package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.d.ts.map +0 -1
  251. package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.js +0 -112
  252. package/dist/src/lib/smartAccount/zerodev/setup-zerodev-account.js.map +0 -1
  253. package/dist/src/lib/types.d.ts +0 -17
  254. package/dist/src/lib/types.d.ts.map +0 -1
  255. package/dist/src/lib/types.js +0 -3
  256. /package/dist/src/lib/{smartAccount → setup}/types.js +0 -0
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getChainHelpers = void 0;
4
- const ethers_1 = require("ethers");
5
- const env_1 = require("./env");
6
- let ethersHelpers;
7
- // Vincent delegation uses a set of wallets that interact with LIT's test network: Yellowstone RPC
8
- // This function constructs Ethers Wallet objects configured using the appropriate environment variables
9
- // It also provides the low-level providers for `yellowstone` and `base` networks for doing things like checking account balances
10
- const getChainHelpers = async () => {
11
- if (ethersHelpers) {
12
- return ethersHelpers;
13
- }
14
- const { YELLOWSTONE_RPC_URL, TEST_FUNDER_PRIVATE_KEY, TEST_APP_MANAGER_PRIVATE_KEY, TEST_APP_DELEGATEE_PRIVATE_KEY, TEST_AGENT_WALLET_PKP_OWNER_PRIVATE_KEY, } = (0, env_1.getEnv)();
15
- const yellowstoneProvider = new ethers_1.ethers.providers.JsonRpcProvider(YELLOWSTONE_RPC_URL);
16
- ethersHelpers = {
17
- providers: {
18
- yellowstone: yellowstoneProvider,
19
- },
20
- wallets: {
21
- appDelegatee: new ethers_1.Wallet(TEST_APP_DELEGATEE_PRIVATE_KEY, yellowstoneProvider),
22
- funder: new ethers_1.Wallet(TEST_FUNDER_PRIVATE_KEY, yellowstoneProvider),
23
- appManager: new ethers_1.Wallet(TEST_APP_MANAGER_PRIVATE_KEY, yellowstoneProvider),
24
- platformUserWalletOwner: new ethers_1.Wallet(TEST_AGENT_WALLET_PKP_OWNER_PRIVATE_KEY, yellowstoneProvider),
25
- },
26
- };
27
- return ethersHelpers;
28
- };
29
- exports.getChainHelpers = getChainHelpers;
30
- //# sourceMappingURL=chain.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../src/lib/chain.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,+BAA+B;AAE/B,IAAI,aAUH,CAAC;AAEF,kGAAkG;AAClG,wGAAwG;AACxG,iIAAiI;AAC1H,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE;IACxC,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM,EACJ,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,uCAAuC,GACxC,GAAG,IAAA,YAAM,GAAE,CAAC;IAEb,MAAM,mBAAmB,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAEtF,aAAa,GAAG;QACd,SAAS,EAAE;YACT,WAAW,EAAE,mBAAmB;SACjC;QACD,OAAO,EAAE;YACP,YAAY,EAAE,IAAI,eAAM,CAAC,8BAA8B,EAAE,mBAAmB,CAAC;YAC7E,MAAM,EAAE,IAAI,eAAM,CAAC,uBAAuB,EAAE,mBAAmB,CAAC;YAChE,UAAU,EAAE,IAAI,eAAM,CAAC,4BAA4B,EAAE,mBAAmB,CAAC;YACzE,uBAAuB,EAAE,IAAI,eAAM,CACjC,uCAAuC,EACvC,mBAAmB,CACpB;SACF;KACF,CAAC;IAEF,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AA/BW,QAAA,eAAe,mBA+B1B"}
@@ -1,7 +0,0 @@
1
- import { Wallet } from 'ethers';
2
- export declare function createRandomVincentWallets(): {
3
- appDelegatee: Wallet;
4
- appManager: Wallet;
5
- platformUserWalletOwner: Wallet;
6
- };
7
- //# sourceMappingURL=create-random-vincent-wallets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-random-vincent-wallets.d.ts","sourceRoot":"","sources":["../../../src/lib/create-random-vincent-wallets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,0BAA0B;;;;EAMzC"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createRandomVincentWallets = createRandomVincentWallets;
4
- const ethers_1 = require("ethers");
5
- function createRandomVincentWallets() {
6
- return {
7
- appDelegatee: ethers_1.Wallet.createRandom(),
8
- appManager: ethers_1.Wallet.createRandom(),
9
- platformUserWalletOwner: ethers_1.Wallet.createRandom(),
10
- };
11
- }
12
- //# sourceMappingURL=create-random-vincent-wallets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-random-vincent-wallets.js","sourceRoot":"","sources":["../../../src/lib/create-random-vincent-wallets.ts"],"names":[],"mappings":";;AAEA,gEAMC;AARD,mCAAgC;AAEhC,SAAgB,0BAA0B;IACxC,OAAO;QACL,YAAY,EAAE,eAAM,CAAC,YAAY,EAAE;QACnC,UAAU,EAAE,eAAM,CAAC,YAAY,EAAE;QACjC,uBAAuB,EAAE,eAAM,CAAC,YAAY,EAAE;KAC/C,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const ensureAppDelegateeFunded: () => Promise<void>;
2
- //# sourceMappingURL=ensure-funded.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensure-funded.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegatee/ensure-funded.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,qBAMpC,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureAppDelegateeFunded = void 0;
4
- const chain_1 = require("../chain");
5
- const funder_1 = require("../funder");
6
- const ensureAppDelegateeFunded = async () => {
7
- const { wallets: { appDelegatee }, } = await (0, chain_1.getChainHelpers)();
8
- return (0, funder_1.ensureWalletHasTestTokens)({ address: await appDelegatee.getAddress() });
9
- };
10
- exports.ensureAppDelegateeFunded = ensureAppDelegateeFunded;
11
- //# sourceMappingURL=ensure-funded.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensure-funded.js","sourceRoot":"","sources":["../../../../src/lib/delegatee/ensure-funded.ts"],"names":[],"mappings":";;;AAAA,oCAA2C;AAC3C,sCAAsD;AAE/C,MAAM,wBAAwB,GAAG,KAAK,IAAI,EAAE;IACjD,MAAM,EACJ,OAAO,EAAE,EAAE,YAAY,EAAE,GAC1B,GAAG,MAAM,IAAA,uBAAe,GAAE,CAAC;IAE5B,OAAO,IAAA,kCAAyB,EAAC,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACjF,CAAC,CAAC;AANW,QAAA,wBAAwB,4BAMnC"}
@@ -1,5 +0,0 @@
1
- export declare function getAppInfo(): Promise<{
2
- appId: number;
3
- appVersion: number;
4
- } | null>;
5
- //# sourceMappingURL=get-app-info.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-app-info.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegatee/get-app-info.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU;;;UAiB/B"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAppInfo = getAppInfo;
4
- const vincent_contracts_sdk_1 = require("@lit-protocol/vincent-contracts-sdk");
5
- const chain_1 = require("../chain");
6
- async function getAppInfo() {
7
- const { wallets: { appDelegatee }, } = await (0, chain_1.getChainHelpers)();
8
- const app = await (0, vincent_contracts_sdk_1.getClient)({
9
- signer: appDelegatee,
10
- }).getAppByDelegateeAddress({
11
- delegateeAddress: appDelegatee.address,
12
- });
13
- if (!app) {
14
- return null;
15
- }
16
- const { id: appId, latestVersion: appVersion } = app;
17
- return { appId, appVersion };
18
- }
19
- //# sourceMappingURL=get-app-info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-app-info.js","sourceRoot":"","sources":["../../../../src/lib/delegatee/get-app-info.ts"],"names":[],"mappings":";;AAIA,gCAiBC;AArBD,+EAAgE;AAEhE,oCAA2C;AAEpC,KAAK,UAAU,UAAU;IAC9B,MAAM,EACJ,OAAO,EAAE,EAAE,YAAY,EAAE,GAC1B,GAAG,MAAM,IAAA,uBAAe,GAAE,CAAC;IAE5B,MAAM,GAAG,GAAG,MAAM,IAAA,iCAAS,EAAC;QAC1B,MAAM,EAAE,YAAY;KACrB,CAAC,CAAC,wBAAwB,CAAC;QAC1B,gBAAgB,EAAE,YAAY,CAAC,OAAO;KACvC,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;IACrD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC/B,CAAC"}
@@ -1,3 +0,0 @@
1
- export { ensureAppDelegateeFunded } from './ensure-funded';
2
- export { getAppInfo } from './get-app-info';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegatee/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAppInfo = exports.ensureAppDelegateeFunded = void 0;
4
- var ensure_funded_1 = require("./ensure-funded");
5
- Object.defineProperty(exports, "ensureAppDelegateeFunded", { enumerable: true, get: function () { return ensure_funded_1.ensureAppDelegateeFunded; } });
6
- var get_app_info_1 = require("./get-app-info");
7
- Object.defineProperty(exports, "getAppInfo", { enumerable: true, get: function () { return get_app_info_1.getAppInfo; } });
8
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/delegatee/index.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAAlD,yHAAA,wBAAwB,OAAA;AACjC,+CAA4C;AAAnC,0GAAA,UAAU,OAAA"}
@@ -1,4 +0,0 @@
1
- import type { Wallet } from 'ethers';
2
- import type { PKPEthersWallet } from '@lit-protocol/pkp-ethers';
3
- export declare const addPermissionForAbilities: (wallet: Wallet | PKPEthersWallet, pkpTokenId: string, abilityIpfsCids: string[]) => Promise<void>;
4
- //# sourceMappingURL=add-permission-for-abilities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-permission-for-abilities.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegator/add-permission-for-abilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAShE,eAAO,MAAM,yBAAyB,GACpC,QAAQ,MAAM,GAAG,eAAe,EAChC,YAAY,MAAM,EAClB,iBAAiB,MAAM,EAAE,kBAe1B,CAAC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addPermissionForAbilities = void 0;
4
- const constants_1 = require("@lit-protocol/constants");
5
- const get_lit_contract_client_1 = require("../litContractsClient/get-lit-contract-client");
6
- // The LIT network requires that abilities be permitted for the Agent PKP to execute Lit Actions.
7
- // This is part of the PKP ecosystem and is managed independently of the Vincent Delegation contract.
8
- // The Platform User PKP wallet is used to add these permissions to the Agent PKP.
9
- const addPermissionForAbilities = async (wallet, pkpTokenId, abilityIpfsCids) => {
10
- const litContractClient = await (0, get_lit_contract_client_1.getLitContractsClient)({ wallet });
11
- for (const ipfsCid of abilityIpfsCids) {
12
- console.log(`Permitting ability: ${ipfsCid} with ability to sign on behalf of Agent PKP ${pkpTokenId}`);
13
- await litContractClient.addPermittedAction({
14
- pkpTokenId,
15
- ipfsId: ipfsCid,
16
- authMethodScopes: [constants_1.AUTH_METHOD_SCOPE.SignAnything],
17
- });
18
- }
19
- };
20
- exports.addPermissionForAbilities = addPermissionForAbilities;
21
- //# sourceMappingURL=add-permission-for-abilities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-permission-for-abilities.js","sourceRoot":"","sources":["../../../../src/lib/delegator/add-permission-for-abilities.ts"],"names":[],"mappings":";;;AAIA,uDAA4D;AAE5D,2FAAsF;AAEtF,iGAAiG;AACjG,qGAAqG;AACrG,kFAAkF;AAC3E,MAAM,yBAAyB,GAAG,KAAK,EAC5C,MAAgC,EAChC,UAAkB,EAClB,eAAyB,EACzB,EAAE;IACF,MAAM,iBAAiB,GAAG,MAAM,IAAA,+CAAqB,EAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAElE,KAAK,MAAM,OAAO,IAAI,eAAe,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,CACT,uBAAuB,OAAO,gDAAgD,UAAU,EAAE,CAC3F,CAAC;QAEF,MAAM,iBAAiB,CAAC,kBAAkB,CAAC;YACzC,UAAU;YACV,MAAM,EAAE,OAAO;YACf,gBAAgB,EAAE,CAAC,6BAAiB,CAAC,YAAY,CAAC;SACnD,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AAlBW,QAAA,yBAAyB,6BAkBpC"}
@@ -1,20 +0,0 @@
1
- import type { PkpInfo } from '../mint-new-pkp';
2
- /**
3
- * Get an existing Agent PKP for a specific app ID, or mint a new one if none exists.
4
- * The Agent PKP will be owned by the User Platform PKP.
5
- * This function queries all Agent PKPs owned by the User Platform PKP and finds the one
6
- * that has permissions for the specified app ID.
7
- * @param appId the app ID to get or create an Agent PKP for
8
- * @returns the Agent PKP info for the specified app
9
- */
10
- export declare const ensureAgentPkpExists: (appId: number) => Promise<PkpInfo>;
11
- export declare const ensureFundedAgentPkpExists: (appId: number) => Promise<PkpInfo>;
12
- /**
13
- * Returns Agent PKP info for a specific app for this run.
14
- * This method will mint a new Agent PKP if none exists for the specified app.
15
- * This method will also fund the Agent PKP if it is not already funded.
16
- * @param appId the app ID to get a funded Agent PKP for
17
- * @returns the funded Agent PKP info for the specified app
18
- */
19
- export declare const getFundedAgentPkp: (appId: number) => Promise<PkpInfo>;
20
- //# sourceMappingURL=agent-pkp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-pkp.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegator/agent-pkp.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAS/C;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAU,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CA+EzE,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAU,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAM/E,CAAC;AAKF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAU,OAAO,MAAM,KAAG,OAAO,CAAC,OAAO,CAWtE,CAAC"}
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFundedAgentPkp = exports.ensureFundedAgentPkpExists = exports.ensureAgentPkpExists = void 0;
4
- const vincent_contracts_sdk_1 = require("@lit-protocol/vincent-contracts-sdk");
5
- const chain_1 = require("../chain");
6
- const ensure_wallet_has_test_tokens_1 = require("../funder/ensure-wallet-has-test-tokens");
7
- const get_lit_contract_client_1 = require("../litContractsClient/get-lit-contract-client");
8
- const mint_new_pkp_1 = require("../mint-new-pkp");
9
- const get_platform_user_pkp_wallet_1 = require("./get-platform-user-pkp-wallet");
10
- const platform_user_pkp_1 = require("./platform-user-pkp");
11
- /**
12
- * Get an existing Agent PKP for a specific app ID, or mint a new one if none exists.
13
- * The Agent PKP will be owned by the User Platform PKP.
14
- * This function queries all Agent PKPs owned by the User Platform PKP and finds the one
15
- * that has permissions for the specified app ID.
16
- * @param appId the app ID to get or create an Agent PKP for
17
- * @returns the Agent PKP info for the specified app
18
- */
19
- const ensureAgentPkpExists = async (appId) => {
20
- const { wallets: { platformUserWalletOwner }, } = await (0, chain_1.getChainHelpers)();
21
- // Get or create the Platform User PKP first
22
- const platformUserPkp = await (0, platform_user_pkp_1.getFundedPlatformUserPkp)();
23
- // Get all PKPs owned by the Platform User PKP using Lit Contracts Client
24
- const litContractClient = await (0, get_lit_contract_client_1.getLitContractsClient)({ wallet: platformUserWalletOwner });
25
- await litContractClient.connect();
26
- const ownedPkps = await litContractClient.pkpNftContractUtils.read.getTokensInfoByAddress(platformUserPkp.ethAddress);
27
- console.log(`Platform User PKP ${platformUserPkp.ethAddress} owns ${ownedPkps.length} Agent PKP(s)`);
28
- // If there are owned PKPs, query their permitted apps to find the one for this app ID
29
- if (ownedPkps.length > 0) {
30
- const client = (0, vincent_contracts_sdk_1.getClient)({ signer: platformUserWalletOwner });
31
- // Query all owned PKP addresses to find which one has permission for this app
32
- const pkpAddresses = ownedPkps.map((pkp) => pkp.ethAddress);
33
- // Get permitted apps for all owned PKPs
34
- const permittedAppsData = await client.getPermittedAppForAgents({
35
- agentAddresses: pkpAddresses,
36
- });
37
- // Find the PKP that has permission for the specified app ID
38
- for (const permittedAppResult of permittedAppsData) {
39
- const permittedApp = permittedAppResult.permittedApp;
40
- const hasAppPermission = permittedApp?.appId === appId;
41
- if (hasAppPermission) {
42
- const matchingPkp = ownedPkps.find((pkp) => pkp.ethAddress.toLowerCase() === permittedAppResult.agentAddress.toLowerCase());
43
- if (matchingPkp) {
44
- console.log(`Found existing Agent PKP for app ${appId} with ethAddress: ${matchingPkp.ethAddress}, tokenId: ${matchingPkp.tokenId}`);
45
- const publicKey = await litContractClient.pkpNftContract.read.getPubkey(matchingPkp.tokenId);
46
- return {
47
- tokenId: matchingPkp.tokenId,
48
- ethAddress: matchingPkp.ethAddress,
49
- publicKey,
50
- };
51
- }
52
- }
53
- }
54
- }
55
- console.log(`No Agent PKP found for app ${appId}; minting a new Agent PKP owned by Platform User PKP ${platformUserPkp.ethAddress}...`);
56
- // Be sure the platformUserPkp has enough test tokens to mint a new PKP
57
- await (0, ensure_wallet_has_test_tokens_1.ensureWalletHasTestTokens)({ address: platformUserPkp.ethAddress });
58
- // Get PKP Ethers Wallet for the Platform User PKP
59
- const platformUserPkpWallet = await (0, get_platform_user_pkp_wallet_1.getPlatformUserPkpWallet)(platformUserPkp);
60
- // Mint a new PKP using the Platform User PKP's wallet
61
- // This makes the Platform User PKP the owner and controller of the Agent PKP
62
- const { tokenId, ethAddress, publicKey } = await (0, mint_new_pkp_1.mintNewPkp)({
63
- wallet: platformUserPkpWallet,
64
- });
65
- console.log(`Minted new Agent PKP ${ethAddress} owned by Platform User PKP ${platformUserPkp.ethAddress}`);
66
- return { tokenId, ethAddress, publicKey };
67
- };
68
- exports.ensureAgentPkpExists = ensureAgentPkpExists;
69
- const ensureFundedAgentPkpExists = async (appId) => {
70
- const agentPkp = await (0, exports.ensureAgentPkpExists)(appId);
71
- await (0, ensure_wallet_has_test_tokens_1.ensureWalletHasTestTokens)({ address: agentPkp.ethAddress });
72
- return agentPkp;
73
- };
74
- exports.ensureFundedAgentPkpExists = ensureFundedAgentPkpExists;
75
- // Map to store Agent PKPs by app ID for the current run
76
- const agentPkpsByAppId = new Map();
77
- /**
78
- * Returns Agent PKP info for a specific app for this run.
79
- * This method will mint a new Agent PKP if none exists for the specified app.
80
- * This method will also fund the Agent PKP if it is not already funded.
81
- * @param appId the app ID to get a funded Agent PKP for
82
- * @returns the funded Agent PKP info for the specified app
83
- */
84
- const getFundedAgentPkp = async (appId) => {
85
- const cached = agentPkpsByAppId.get(appId);
86
- if (cached) {
87
- // Verify that the cached PKP still has sufficient funds
88
- await (0, ensure_wallet_has_test_tokens_1.ensureWalletHasTestTokens)({ address: cached.ethAddress });
89
- return cached;
90
- }
91
- const agentPkp = await (0, exports.ensureFundedAgentPkpExists)(appId);
92
- agentPkpsByAppId.set(appId, agentPkp);
93
- return agentPkp;
94
- };
95
- exports.getFundedAgentPkp = getFundedAgentPkp;
96
- //# sourceMappingURL=agent-pkp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-pkp.js","sourceRoot":"","sources":["../../../../src/lib/delegator/agent-pkp.ts"],"names":[],"mappings":";;;AAAA,+EAAgE;AAIhE,oCAA2C;AAC3C,2FAAoF;AACpF,2FAAsF;AACtF,kDAA6C;AAC7C,iFAA0E;AAC1E,2DAA+D;AAE/D;;;;;;;GAOG;AACI,MAAM,oBAAoB,GAAG,KAAK,EAAE,KAAa,EAAoB,EAAE;IAC5E,MAAM,EACJ,OAAO,EAAE,EAAE,uBAAuB,EAAE,GACrC,GAAG,MAAM,IAAA,uBAAe,GAAE,CAAC;IAE5B,4CAA4C;IAC5C,MAAM,eAAe,GAAG,MAAM,IAAA,4CAAwB,GAAE,CAAC;IAEzD,yEAAyE;IACzE,MAAM,iBAAiB,GAAG,MAAM,IAAA,+CAAqB,EAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC;IAC3F,MAAM,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAElC,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,mBAAmB,CAAC,IAAI,CAAC,sBAAsB,CACvF,eAAe,CAAC,UAAU,CAC3B,CAAC;IAEF,OAAO,CAAC,GAAG,CACT,qBAAqB,eAAe,CAAC,UAAU,SAAS,SAAS,CAAC,MAAM,eAAe,CACxF,CAAC;IAEF,sFAAsF;IACtF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,IAAA,iCAAS,EAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC;QAE9D,8EAA8E;QAC9E,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAE5D,wCAAwC;QACxC,MAAM,i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import type { PkpInfo } from '../mint-new-pkp';
3
- /**
4
- * Get a PKPEthersWallet instance for the Platform User PKP
5
- * This wallet can be used to sign transactions and mint new PKPs on behalf of the Platform User PKP
6
- */
7
- export declare const getPlatformUserPkpWallet: (platformUserPkpInfo: PkpInfo) => Promise<PKPEthersWallet>;
8
- //# sourceMappingURL=get-platform-user-pkp-wallet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-platform-user-pkp-wallet.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegator/get-platform-user-pkp-wallet.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAyB/C;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GACnC,qBAAqB,OAAO,KAC3B,OAAO,CAAC,eAAe,CAkEzB,CAAC"}
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPlatformUserPkpWallet = void 0;
4
- const auth_helpers_1 = require("@lit-protocol/auth-helpers");
5
- const constants_1 = require("@lit-protocol/constants");
6
- const lit_node_client_1 = require("@lit-protocol/lit-node-client");
7
- const pkp_ethers_1 = require("@lit-protocol/pkp-ethers");
8
- const chain_1 = require("../chain");
9
- const get_lit_contract_client_1 = require("../litContractsClient/get-lit-contract-client");
10
- const SELECTED_LIT_NETWORK = constants_1.LIT_NETWORK.Datil;
11
- let litNodeClient = null;
12
- const getLitNodeClient = async () => {
13
- if (litNodeClient) {
14
- return litNodeClient;
15
- }
16
- litNodeClient = new lit_node_client_1.LitNodeClient({
17
- alertWhenUnauthorized: false,
18
- litNetwork: SELECTED_LIT_NETWORK,
19
- debug: false,
20
- });
21
- await litNodeClient.connect();
22
- return litNodeClient;
23
- };
24
- /**
25
- * Get a PKPEthersWallet instance for the Platform User PKP
26
- * This wallet can be used to sign transactions and mint new PKPs on behalf of the Platform User PKP
27
- */
28
- const getPlatformUserPkpWallet = async (platformUserPkpInfo) => {
29
- const { wallets: { platformUserWalletOwner }, } = await (0, chain_1.getChainHelpers)();
30
- const litContractClient = await (0, get_lit_contract_client_1.getLitContractsClient)({ wallet: platformUserWalletOwner });
31
- await litContractClient.connect();
32
- const client = await getLitNodeClient();
33
- // Get the PKP's public key
34
- const publicKey = await litContractClient.pkpNftContract.read.getPubkey(platformUserPkpInfo.tokenId);
35
- console.log(`Creating PKP Ethers Wallet for Platform User PKP ${platformUserPkpInfo.ethAddress}...`);
36
- // Get session signatures for controlling the PKP
37
- // The EOA wallet owner signs to prove it has authority to use the PKP
38
- const sessionSigs = await client.getSessionSigs({
39
- chain: 'ethereum',
40
- resourceAbilityRequests: [
41
- {
42
- resource: new auth_helpers_1.LitPKPResource('*'),
43
- ability: constants_1.LIT_ABILITY.PKPSigning,
44
- },
45
- {
46
- resource: new auth_helpers_1.LitActionResource('*'),
47
- ability: constants_1.LIT_ABILITY.LitActionExecution,
48
- },
49
- ],
50
- authNeededCallback: async ({ resourceAbilityRequests, uri }) => {
51
- const [walletAddress, nonce] = await Promise.all([
52
- platformUserWalletOwner.getAddress(),
53
- client.getLatestBlockhash(),
54
- ]);
55
- const toSign = await (0, auth_helpers_1.createSiweMessageWithRecaps)({
56
- uri: uri || 'http://localhost:3000',
57
- expiration: new Date(Date.now() + 1000 * 60 * 60 * 1).toISOString(), // 1 hour
58
- resources: resourceAbilityRequests || [],
59
- walletAddress,
60
- nonce,
61
- litNodeClient: client,
62
- });
63
- return await (0, auth_helpers_1.generateAuthSig)({ signer: platformUserWalletOwner, toSign });
64
- },
65
- });
66
- // Create PKP Ethers Wallet with RPC provider for proper gas estimation
67
- const pkpWallet = new pkp_ethers_1.PKPEthersWallet({
68
- litNodeClient: client,
69
- pkpPubKey: publicKey,
70
- controllerSessionSigs: sessionSigs,
71
- });
72
- await pkpWallet.init();
73
- console.log(`PKP Ethers Wallet initialized for Platform User PKP ${await pkpWallet.getAddress()}`);
74
- return pkpWallet;
75
- };
76
- exports.getPlatformUserPkpWallet = getPlatformUserPkpWallet;
77
- //# sourceMappingURL=get-platform-user-pkp-wallet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-platform-user-pkp-wallet.js","sourceRoot":"","sources":["../../../../src/lib/delegator/get-platform-user-pkp-wallet.ts"],"names":[],"mappings":";;;AAEA,6DAKoC;AACpC,uDAAmE;AACnE,mEAA8D;AAC9D,yDAA2D;AAI3D,oCAA2C;AAC3C,2FAAsF;AAEtF,MAAM,oBAAoB,GAAG,uBAAW,CAAC,KAA0B,CAAC;AAEpE,IAAI,aAAa,GAAyB,IAAI,CAAC;AAE/C,MAAM,gBAAgB,GAAG,KAAK,IAA4B,EAAE;IAC1D,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,aAAa,GAAG,IAAI,+BAAa,CAAC;QAChC,qBAAqB,EAAE,KAAK;QAC5B,UAAU,EAAE,oBAAoB;QAChC,KAAK,EAAE,KAAK;KACb,CAAC,CAAC;IAEH,MAAM,aAAa,CAAC,OAAO,EAAE,CAAC;IAE9B,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,wBAAwB,GAAG,KAAK,EAC3C,mBAA4B,EACF,EAAE;IAC5B,MAAM,EACJ,OAAO,EAAE,EAAE,uBAAuB,EAAE,GACrC,GAAG,MAAM,IAAA,uBAAe,GAAE,CAAC;IAE5B,MAAM,iBAAiB,GAAG,MAAM,IAAA,+CAAqB,EAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC;IAC3F,MAAM,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAElC,MAAM,MAAM,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAExC,2BAA2B;IAC3B,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CACrE,mBAAmB,CAAC,OAAO,CAC5B,CAAC;I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ACpB,qBAAqB,EAAE,WAAW;KACnC,CAAC,CAAC;IAEH,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;IAEvB,OAAO,CAAC,GAAG,CACT,uDAAuD,MAAM,SAAS,CAAC,UAAU,EAAE,EAAE,CACtF,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AApEW,QAAA,wBAAwB,4BAoEnC"}
@@ -1,7 +0,0 @@
1
- export { addPermissionForAbilities } from './add-permission-for-abilities';
2
- export { mintNewPkp } from '../mint-new-pkp';
3
- export { getFundedAgentPkp, ensureAgentPkpExists, ensureFundedAgentPkpExists } from './agent-pkp';
4
- export { getPlatformUserPkpWallet } from './get-platform-user-pkp-wallet';
5
- export { getFundedPlatformUserPkp, ensurePlatformUserPkpExists, ensureFundedPlatformUserPkpExists, } from './platform-user-pkp';
6
- export { permitAppVersionForAgentWalletPkp } from './permit-vincent-app-version';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.permitAppVersionForAgentWalletPkp = exports.ensureFundedPlatformUserPkpExists = exports.ensurePlatformUserPkpExists = exports.getFundedPlatformUserPkp = exports.getPlatformUserPkpWallet = exports.ensureFundedAgentPkpExists = exports.ensureAgentPkpExists = exports.getFundedAgentPkp = exports.mintNewPkp = exports.addPermissionForAbilities = void 0;
4
- var add_permission_for_abilities_1 = require("./add-permission-for-abilities");
5
- Object.defineProperty(exports, "addPermissionForAbilities", { enumerable: true, get: function () { return add_permission_for_abilities_1.addPermissionForAbilities; } });
6
- var mint_new_pkp_1 = require("../mint-new-pkp");
7
- Object.defineProperty(exports, "mintNewPkp", { enumerable: true, get: function () { return mint_new_pkp_1.mintNewPkp; } });
8
- var agent_pkp_1 = require("./agent-pkp");
9
- Object.defineProperty(exports, "getFundedAgentPkp", { enumerable: true, get: function () { return agent_pkp_1.getFundedAgentPkp; } });
10
- Object.defineProperty(exports, "ensureAgentPkpExists", { enumerable: true, get: function () { return agent_pkp_1.ensureAgentPkpExists; } });
11
- Object.defineProperty(exports, "ensureFundedAgentPkpExists", { enumerable: true, get: function () { return agent_pkp_1.ensureFundedAgentPkpExists; } });
12
- var get_platform_user_pkp_wallet_1 = require("./get-platform-user-pkp-wallet");
13
- Object.defineProperty(exports, "getPlatformUserPkpWallet", { enumerable: true, get: function () { return get_platform_user_pkp_wallet_1.getPlatformUserPkpWallet; } });
14
- var platform_user_pkp_1 = require("./platform-user-pkp");
15
- Object.defineProperty(exports, "getFundedPlatformUserPkp", { enumerable: true, get: function () { return platform_user_pkp_1.getFundedPlatformUserPkp; } });
16
- Object.defineProperty(exports, "ensurePlatformUserPkpExists", { enumerable: true, get: function () { return platform_user_pkp_1.ensurePlatformUserPkpExists; } });
17
- Object.defineProperty(exports, "ensureFundedPlatformUserPkpExists", { enumerable: true, get: function () { return platform_user_pkp_1.ensureFundedPlatformUserPkpExists; } });
18
- var permit_vincent_app_version_1 = require("./permit-vincent-app-version");
19
- Object.defineProperty(exports, "permitAppVersionForAgentWalletPkp", { enumerable: true, get: function () { return permit_vincent_app_version_1.permitAppVersionForAgentWalletPkp; } });
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/delegator/index.ts"],"names":[],"mappings":";;;AAAA,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,gDAA6C;AAApC,0GAAA,UAAU,OAAA;AACnB,yCAAkG;AAAzF,8GAAA,iBAAiB,OAAA;AAAE,iHAAA,oBAAoB,OAAA;AAAE,uHAAA,0BAA0B,OAAA;AAC5E,+EAA0E;AAAjE,wIAAA,wBAAwB,OAAA;AACjC,yDAI6B;AAH3B,6HAAA,wBAAwB,OAAA;AACxB,gIAAA,2BAA2B,OAAA;AAC3B,sIAAA,iCAAiC,OAAA;AAEnC,2EAAiF;AAAxE,+IAAA,iCAAiC,OAAA"}
@@ -1,19 +0,0 @@
1
- import type { PKPEthersWallet } from '@lit-protocol/pkp-ethers';
2
- import type { PermissionData } from '@lit-protocol/vincent-contracts-sdk';
3
- import type { PkpInfo } from '../mint-new-pkp';
4
- /**
5
- * Adds Vincent delegation permission for a specific app version for the Agent PKP.
6
- *
7
- * This function will check if the requested app version is already permitted. If it is,
8
- * it will skip the permission step and return early. If a different version is permitted,
9
- * it will remove the old permission before adding the new one.
10
- */
11
- export declare function permitAppVersionForAgentWalletPkp({ permissionData, appId, appVersion, agentPkpInfo, platformUserPkpWallet, agentAddress, }: {
12
- permissionData: PermissionData;
13
- appId: number;
14
- appVersion: number;
15
- agentPkpInfo: PkpInfo;
16
- platformUserPkpWallet: PKPEthersWallet;
17
- agentAddress: string;
18
- }): Promise<void>;
19
- //# sourceMappingURL=permit-vincent-app-version.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"permit-vincent-app-version.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegator/permit-vincent-app-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAI1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;GAMG;AACH,wBAAsB,iCAAiC,CAAC,EACtD,cAAc,EACd,KAAK,EACL,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,YAAY,GACb,EAAE;IACD,cAAc,EAAE,cAAc,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;IACtB,qBAAqB,EAAE,eAAe,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2ChB"}
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.permitAppVersionForAgentWalletPkp = permitAppVersionForAgentWalletPkp;
4
- const vincent_contracts_sdk_1 = require("@lit-protocol/vincent-contracts-sdk");
5
- /**
6
- * Adds Vincent delegation permission for a specific app version for the Agent PKP.
7
- *
8
- * This function will check if the requested app version is already permitted. If it is,
9
- * it will skip the permission step and return early. If a different version is permitted,
10
- * it will remove the old permission before adding the new one.
11
- */
12
- async function permitAppVersionForAgentWalletPkp({ permissionData, appId, appVersion, agentPkpInfo, platformUserPkpWallet, agentAddress, }) {
13
- const client = (0, vincent_contracts_sdk_1.getClient)({
14
- signer: platformUserPkpWallet,
15
- });
16
- const [permittedAppResult] = await client.getPermittedAppForAgents({
17
- agentAddresses: [agentAddress],
18
- });
19
- const existingPermittedApp = permittedAppResult?.permittedApp ?? null;
20
- // Check if the requested version is already permitted
21
- if (existingPermittedApp?.appId === appId && existingPermittedApp.version === appVersion) {
22
- console.log(`App version ${appVersion} is already permitted for Agent ${agentAddress}. Skipping permission.`);
23
- return;
24
- }
25
- // If a different version (or app) is permitted, remove it first
26
- if (existingPermittedApp) {
27
- console.log(`Removing existing permission for app ${existingPermittedApp.appId} version ${existingPermittedApp.version}`);
28
- await client.unPermitApp({
29
- agentAddress,
30
- appId: existingPermittedApp.appId,
31
- appVersion: existingPermittedApp.version,
32
- });
33
- }
34
- // Permit the new version
35
- const result = await client.permitApp({
36
- agentAddress,
37
- pkpSigner: agentPkpInfo.ethAddress,
38
- pkpSignerPubKey: agentPkpInfo.publicKey,
39
- appId,
40
- appVersion,
41
- permissionData: permissionData,
42
- });
43
- console.log(`Permitted App with ID ${appId} and version ${appVersion} for Agent ${agentAddress}\nTx hash: ${result.txHash}`);
44
- }
45
- //# sourceMappingURL=permit-vincent-app-version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"permit-vincent-app-version.js","sourceRoot":"","sources":["../../../../src/lib/delegator/permit-vincent-app-version.ts"],"names":[],"mappings":";;AAcA,8EAyDC;AApED,+EAAgE;AAIhE;;;;;;GAMG;AACI,KAAK,UAAU,iCAAiC,CAAC,EACtD,cAAc,EACd,KAAK,EACL,UAAU,EACV,YAAY,EACZ,qBAAqB,EACrB,YAAY,GAQb;IACC,MAAM,MAAM,GAAG,IAAA,iCAAS,EAAC;QACvB,MAAM,EAAE,qBAAqB;KAC9B,CAAC,CAAC;IAEH,MAAM,CAAC,kBAAkB,CAAC,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC;QACjE,cAAc,EAAE,CAAC,YAAY,CAAC;KAC/B,CAAC,CAAC;IACH,MAAM,oBAAoB,GAAG,kBAAkB,EAAE,YAAY,IAAI,IAAI,CAAC;IAEtE,sDAAsD;IACtD,IAAI,oBAAoB,EAAE,KAAK,KAAK,KAAK,IAAI,oBAAoB,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;QACzF,OAAO,CAAC,GAAG,CACT,eAAe,UAAU,mCAAmC,YAAY,wBAAwB,CACjG,CAAC;QACF,OAAO;IACT,CAAC;IAED,gEAAgE;IAChE,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CACT,wCAAwC,oBAAoB,CAAC,KAAK,YAAY,oBAAoB,CAAC,OAAO,EAAE,CAC7G,CAAC;QACF,MAAM,MAAM,CAAC,WAAW,CAAC;YACvB,YAAY;YACZ,KAAK,EAAE,oBAAoB,CAAC,KAAK;YACjC,UAAU,EAAE,oBAAoB,CAAC,OAAO;SACzC,CAAC,CAAC;IACL,CAAC;IAED,yBAAyB;IACzB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC;QACpC,YAAY;QACZ,SAAS,EAAE,YAAY,CAAC,UAAU;QAClC,eAAe,EAAE,YAAY,CAAC,SAAS;QACvC,KAAK;QACL,UAAU;QACV,cAAc,EAAE,cAAc;KAC/B,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CACT,yBAAyB,KAAK,gBAAgB,UAAU,cAAc,YAAY,cAAc,MAAM,CAAC,MAAM,EAAE,CAChH,CAAC;AACJ,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { PkpInfo } from '../mint-new-pkp';
2
- export declare const ensurePlatformUserPkpExists: () => Promise<PkpInfo>;
3
- export declare const ensureFundedPlatformUserPkpExists: () => Promise<PkpInfo>;
4
- /**
5
- * Returns platform user Pkp info for this run.
6
- * This method will mint a new platform user Pkp if none exists for the current platform user wallet owner.
7
- * This method will also fund the platform user Pkp if it is not already funded.
8
- */
9
- export declare const getFundedPlatformUserPkp: () => Promise<PkpInfo>;
10
- //# sourceMappingURL=platform-user-pkp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-user-pkp.d.ts","sourceRoot":"","sources":["../../../../src/lib/delegator/platform-user-pkp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAO/C,eAAO,MAAM,2BAA2B,QAAa,OAAO,CAAC,OAAO,CAqCnE,CAAC;AAEF,eAAO,MAAM,iCAAiC,QAAa,OAAO,CAAC,OAAO,CAMzE,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,QAAa,OAAO,CAAC,OAAO,CAOhE,CAAC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFundedPlatformUserPkp = exports.ensureFundedPlatformUserPkpExists = exports.ensurePlatformUserPkpExists = void 0;
4
- const chain_1 = require("../chain");
5
- const ensure_wallet_has_test_tokens_1 = require("../funder/ensure-wallet-has-test-tokens");
6
- const get_lit_contract_client_1 = require("../litContractsClient/get-lit-contract-client");
7
- const mint_new_pkp_1 = require("../mint-new-pkp");
8
- const ensurePlatformUserPkpExists = async () => {
9
- const { wallets: { platformUserWalletOwner }, } = await (0, chain_1.getChainHelpers)();
10
- const litContractClient = await (0, get_lit_contract_client_1.getLitContractsClient)({ wallet: platformUserWalletOwner });
11
- const ownedPkps = await litContractClient.pkpNftContractUtils.read.getTokensInfoByAddress(platformUserWalletOwner.address);
12
- if (ownedPkps.length > 1) {
13
- console.warn(`${ownedPkps.length} PKPs found for platform user wallet owner. When e2e testing, we recommend that you use a _dedicated platform user wallet owner account_ which always only has a single platform user PKP. Using the first PKP found.`, ownedPkps);
14
- }
15
- if (ownedPkps.length > 0) {
16
- console.log(`${platformUserWalletOwner.address} has a PKP -- using existing PKP with ethAddress: ${ownedPkps[0].ethAddress}, tokenId: ${ownedPkps[0].tokenId}`);
17
- const { tokenId, ethAddress } = ownedPkps[0];
18
- const publicKey = await litContractClient.pkpNftContract.read.getPubkey(tokenId);
19
- return { tokenId, ethAddress, publicKey };
20
- }
21
- console.log(`No platform user PKP found; minting a new platform user PKP for ${platformUserWalletOwner.address}...`);
22
- // Be sure the platformUserWalletOwner has enough test tokens to mint a new PKP
23
- await (0, ensure_wallet_has_test_tokens_1.ensureWalletHasTestTokens)({ address: await platformUserWalletOwner.getAddress() });
24
- const { tokenId, ethAddress, publicKey } = await (0, mint_new_pkp_1.mintNewPkp)({ wallet: platformUserWalletOwner });
25
- return { tokenId, ethAddress, publicKey };
26
- };
27
- exports.ensurePlatformUserPkpExists = ensurePlatformUserPkpExists;
28
- const ensureFundedPlatformUserPkpExists = async () => {
29
- const platformUserPkp = await (0, exports.ensurePlatformUserPkpExists)();
30
- await (0, ensure_wallet_has_test_tokens_1.ensureWalletHasTestTokens)({ address: platformUserPkp.ethAddress });
31
- return platformUserPkp;
32
- };
33
- exports.ensureFundedPlatformUserPkpExists = ensureFundedPlatformUserPkpExists;
34
- let platformUserPkpInfo = null;
35
- /**
36
- * Returns platform user Pkp info for this run.
37
- * This method will mint a new platform user Pkp if none exists for the current platform user wallet owner.
38
- * This method will also fund the platform user Pkp if it is not already funded.
39
- */
40
- const getFundedPlatformUserPkp = async () => {
41
- if (platformUserPkpInfo) {
42
- return platformUserPkpInfo;
43
- }
44
- platformUserPkpInfo = await (0, exports.ensureFundedPlatformUserPkpExists)();
45
- return platformUserPkpInfo;
46
- };
47
- exports.getFundedPlatformUserPkp = getFundedPlatformUserPkp;
48
- //# sourceMappingURL=platform-user-pkp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-user-pkp.js","sourceRoot":"","sources":["../../../../src/lib/delegator/platform-user-pkp.ts"],"names":[],"mappings":";;;AAEA,oCAA2C;AAC3C,2FAAoF;AACpF,2FAAsF;AACtF,kDAA6C;AAEtC,MAAM,2BAA2B,GAAG,KAAK,IAAsB,EAAE;IACtE,MAAM,EACJ,OAAO,EAAE,EAAE,uBAAuB,EAAE,GACrC,GAAG,MAAM,IAAA,uBAAe,GAAE,CAAC;IAE5B,MAAM,iBAAiB,GAAG,MAAM,IAAA,+CAAqB,EAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC;IAC3F,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,mBAAmB,CAAC,IAAI,CAAC,sBAAsB,CACvF,uBAAuB,CAAC,OAAO,CAChC,CAAC;IAEF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CACV,GAAG,SAAS,CAAC,MAAM,uNAAuN,EAC1O,SAAS,CACV,CAAC;IACJ,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC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AAE,CAAC;QACxB,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,mBAAmB,GAAG,MAAM,IAAA,yCAAiC,GAAE,CAAC;IAChE,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC;AAPW,QAAA,wBAAwB,4BAOnC"}
@@ -1,4 +0,0 @@
1
- import { ethers } from 'ethers';
2
- import type { PKPEthersWallet } from '@lit-protocol/pkp-ethers';
3
- export declare const ensureUnexpiredCapacityToken: (targetWallet: ethers.Wallet | PKPEthersWallet) => Promise<void>;
4
- //# sourceMappingURL=ensure-capacity-credit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensure-capacity-credit.d.ts","sourceRoot":"","sources":["../../../src/lib/ensure-capacity-credit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAMhE,eAAO,MAAM,4BAA4B,GACvC,cAAc,MAAM,CAAC,MAAM,GAAG,eAAe,kBAkF9C,CAAC"}