@maci-protocol/coordinator 0.0.0-ci.7f7ef53 → 0.0.0-ci.7fb2610

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 (140) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +31 -6
  3. package/build/hardhat.config.cjs +3 -0
  4. package/build/hardhat.config.cjs.map +1 -1
  5. package/build/hardhat.config.d.cts +3 -0
  6. package/build/scripts/generateMaciKeyPair.js +2 -2
  7. package/build/scripts/generateMaciKeyPair.js.map +1 -1
  8. package/build/tests/constants.d.ts +0 -1
  9. package/build/tests/constants.d.ts.map +1 -1
  10. package/build/tests/constants.js +0 -1
  11. package/build/tests/constants.js.map +1 -1
  12. package/build/tests/e2e.deploy.test.js +145 -89
  13. package/build/tests/e2e.deploy.test.js.map +1 -1
  14. package/build/tests/utils.d.ts +6 -0
  15. package/build/tests/utils.d.ts.map +1 -1
  16. package/build/tests/utils.js +12 -3
  17. package/build/tests/utils.js.map +1 -1
  18. package/build/ts/app.module.d.ts.map +1 -1
  19. package/build/ts/app.module.js +2 -0
  20. package/build/ts/app.module.js.map +1 -1
  21. package/build/ts/common/__tests__/common.test.js +7 -21
  22. package/build/ts/common/__tests__/common.test.js.map +1 -1
  23. package/build/ts/common/accountAbstraction.d.ts +2 -19
  24. package/build/ts/common/accountAbstraction.d.ts.map +1 -1
  25. package/build/ts/common/accountAbstraction.js +15 -44
  26. package/build/ts/common/accountAbstraction.js.map +1 -1
  27. package/build/ts/common/chain.d.ts +16 -0
  28. package/build/ts/common/chain.d.ts.map +1 -0
  29. package/build/ts/common/chain.js +31 -0
  30. package/build/ts/common/chain.js.map +1 -0
  31. package/build/ts/common/coordinatorKeypair.d.ts +7 -0
  32. package/build/ts/common/coordinatorKeypair.d.ts.map +1 -0
  33. package/build/ts/common/coordinatorKeypair.js +14 -0
  34. package/build/ts/common/coordinatorKeypair.js.map +1 -0
  35. package/build/ts/common/errors.d.ts +17 -18
  36. package/build/ts/common/errors.d.ts.map +1 -1
  37. package/build/ts/common/errors.js +17 -18
  38. package/build/ts/common/errors.js.map +1 -1
  39. package/build/ts/common/index.d.ts +2 -0
  40. package/build/ts/common/index.d.ts.map +1 -1
  41. package/build/ts/common/index.js +2 -0
  42. package/build/ts/common/index.js.map +1 -1
  43. package/build/ts/common/types.d.ts +2 -3
  44. package/build/ts/common/types.d.ts.map +1 -1
  45. package/build/ts/deployer/__tests__/deployer.controller.test.js +7 -7
  46. package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -1
  47. package/build/ts/deployer/__tests__/deployer.service.test.js +73 -286
  48. package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -1
  49. package/build/ts/deployer/__tests__/utils.d.ts +26 -1
  50. package/build/ts/deployer/__tests__/utils.d.ts.map +1 -1
  51. package/build/ts/deployer/__tests__/utils.js +39 -11
  52. package/build/ts/deployer/__tests__/utils.js.map +1 -1
  53. package/build/ts/deployer/deployer.service.d.ts +18 -55
  54. package/build/ts/deployer/deployer.service.d.ts.map +1 -1
  55. package/build/ts/deployer/deployer.service.js +302 -471
  56. package/build/ts/deployer/deployer.service.js.map +1 -1
  57. package/build/ts/deployer/dto.d.ts +4 -4
  58. package/build/ts/deployer/dto.d.ts.map +1 -1
  59. package/build/ts/deployer/dto.js +9 -1
  60. package/build/ts/deployer/dto.js.map +1 -1
  61. package/build/ts/deployer/types.d.ts +68 -35
  62. package/build/ts/deployer/types.d.ts.map +1 -1
  63. package/build/ts/file/__tests__/file.service.test.js +12 -11
  64. package/build/ts/file/__tests__/file.service.test.js.map +1 -1
  65. package/build/ts/file/file.service.d.ts +4 -3
  66. package/build/ts/file/file.service.d.ts.map +1 -1
  67. package/build/ts/file/file.service.js +14 -9
  68. package/build/ts/file/file.service.js.map +1 -1
  69. package/build/ts/file/types.d.ts +2 -2
  70. package/build/ts/file/types.d.ts.map +1 -1
  71. package/build/ts/health/__tests__/health.controller.test.d.ts +2 -0
  72. package/build/ts/health/__tests__/health.controller.test.d.ts.map +1 -0
  73. package/build/ts/health/__tests__/health.controller.test.js +22 -0
  74. package/build/ts/health/__tests__/health.controller.test.js.map +1 -0
  75. package/build/ts/health/__tests__/health.service.test.d.ts +2 -0
  76. package/build/ts/health/__tests__/health.service.test.d.ts.map +1 -0
  77. package/build/ts/health/__tests__/health.service.test.js +77 -0
  78. package/build/ts/health/__tests__/health.service.test.js.map +1 -0
  79. package/build/ts/health/health.controller.d.ts +16 -0
  80. package/build/ts/health/health.controller.d.ts.map +1 -0
  81. package/build/ts/health/health.controller.js +43 -0
  82. package/build/ts/health/health.controller.js.map +1 -0
  83. package/build/ts/health/health.module.d.ts +3 -0
  84. package/build/ts/health/health.module.d.ts.map +1 -0
  85. package/build/ts/health/health.module.js +21 -0
  86. package/build/ts/health/health.module.js.map +1 -0
  87. package/build/ts/health/health.service.d.ts +35 -0
  88. package/build/ts/health/health.service.d.ts.map +1 -0
  89. package/build/ts/health/health.service.js +169 -0
  90. package/build/ts/health/health.service.js.map +1 -0
  91. package/build/ts/health/types.d.ts +79 -0
  92. package/build/ts/health/types.d.ts.map +1 -0
  93. package/build/ts/health/types.js +2 -0
  94. package/build/ts/health/types.js.map +1 -0
  95. package/build/ts/proof/__tests__/proof.controller.test.js +5 -3
  96. package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -1
  97. package/build/ts/proof/__tests__/proof.gateway.test.js +6 -3
  98. package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -1
  99. package/build/ts/proof/__tests__/proof.service.test.js +37 -76
  100. package/build/ts/proof/__tests__/proof.service.test.js.map +1 -1
  101. package/build/ts/proof/dto.d.ts +13 -15
  102. package/build/ts/proof/dto.d.ts.map +1 -1
  103. package/build/ts/proof/dto.js +51 -44
  104. package/build/ts/proof/dto.js.map +1 -1
  105. package/build/ts/proof/proof.controller.d.ts +3 -2
  106. package/build/ts/proof/proof.controller.d.ts.map +1 -1
  107. package/build/ts/proof/proof.controller.js +1 -4
  108. package/build/ts/proof/proof.controller.js.map +1 -1
  109. package/build/ts/proof/proof.service.d.ts +4 -6
  110. package/build/ts/proof/proof.service.d.ts.map +1 -1
  111. package/build/ts/proof/proof.service.js +48 -130
  112. package/build/ts/proof/proof.service.js.map +1 -1
  113. package/build/ts/proof/types.d.ts +19 -14
  114. package/build/ts/proof/types.d.ts.map +1 -1
  115. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +2 -2
  116. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -1
  117. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts +53 -0
  118. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts.map +1 -0
  119. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js +105 -0
  120. package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js.map +1 -0
  121. package/build/ts/sessionKeys/sessionKeys.service.d.ts +13 -2
  122. package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -1
  123. package/build/ts/sessionKeys/sessionKeys.service.js +22 -4
  124. package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -1
  125. package/build/ts/subgraph/__tests__/subgraph.service.test.js +2 -3
  126. package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -1
  127. package/build/ts/subgraph/subgraph.service.d.ts +4 -0
  128. package/build/ts/subgraph/subgraph.service.d.ts.map +1 -1
  129. package/build/ts/subgraph/subgraph.service.js +16 -5
  130. package/build/ts/subgraph/subgraph.service.js.map +1 -1
  131. package/build/tsconfig.build.tsbuildinfo +1 -1
  132. package/package.json +36 -36
  133. package/build/tests/e2e.aa.test.d.ts +0 -2
  134. package/build/tests/e2e.aa.test.d.ts.map +0 -1
  135. package/build/tests/e2e.aa.test.js +0 -103
  136. package/build/tests/e2e.aa.test.js.map +0 -1
  137. package/build/ts/deployer/utils.d.ts +0 -8
  138. package/build/ts/deployer/utils.d.ts.map +0 -1
  139. package/build/ts/deployer/utils.js +0 -9
  140. package/build/ts/deployer/utils.js.map +0 -1
@@ -1,21 +1,16 @@
1
- import { EPolicies, EContracts, EInitialVoiceCreditProxies, EMode, type ISetVerifyingKeysArgs, VkRegistry } from "@maci-protocol/sdk";
1
+ import { EInitialVoiceCreditProxies, EMode, ISetVerifyingKeysArgs, BasePolicy, ConstantInitialVoiceCreditProxy } from "@maci-protocol/sdk";
2
2
  import { Signer } from "ethers";
3
- import { GetUserOperationReceiptReturnType } from "permissionless";
4
- import { Abi, type Hex } from "viem";
5
- import { ESupportedNetworks, KernelClientType, BundlerClientType, PublicClientType } from "../common";
3
+ import { type Hex } from "viem";
4
+ import { ESupportedNetworks } from "../common";
6
5
  import { FileService } from "../file/file.service";
7
6
  import { SessionKeysService } from "../sessionKeys/sessionKeys.service";
8
- import { IContractData, IDeployMaciArgs, IDeployPollArgs, IPolicyArgs, IInitialVoiceCreditProxyArgs, IVkRegistryArgs } from "./types";
7
+ import { IDeployMaciArgs, IDeployPollArgs, IInitialVoiceCreditProxyArgs, IVerifyingKeysRegistryArgs, IDeployPolicyConfig } from "./types";
9
8
  /**
10
9
  * DeployerService is responsible for deploying contracts.
11
10
  */
12
11
  export declare class DeployerService {
13
12
  private readonly sessionKeysService;
14
13
  private readonly fileService;
15
- /**
16
- * Logger
17
- */
18
- private readonly logger;
19
14
  /**
20
15
  * Contract storage instance
21
16
  */
@@ -27,67 +22,35 @@ export declare class DeployerService {
27
22
  */
28
23
  constructor(sessionKeysService: SessionKeysService, fileService: FileService);
29
24
  /**
30
- * Get the policy abi and bytecode based on the policy type
31
- * and also check if there is already an instance deployed
25
+ * Get the policy contract object
26
+ * always deploy and save it
32
27
  *
33
- * @param policyType - the policy type
28
+ * @param signer - the signer
34
29
  * @param network - the network
35
- * @param args - the policy args
36
- * @returns - the policy abi and bytecode
30
+ * @param policyConfig - the policy configuration parameters
31
+ * @returns - the policy contract
37
32
  */
38
- getPolicyData(policyType: EPolicies, network: ESupportedNetworks, args?: IPolicyArgs): IContractData;
33
+ deployAndSavePolicy(signer: Signer, network: ESupportedNetworks, policyConfig: IDeployPolicyConfig): Promise<BasePolicy>;
39
34
  /**
40
- * Get the voice credit proxy abi and bytecode based on the voice credit proxy type
41
- * and also check if there is already an instance deployed
35
+ * Get the voice credit proxy contract object
36
+ * always deploy and save it
42
37
  *
38
+ * @param signer - the signer
43
39
  * @param voiceCreditProxyType - the voice credit proxy type
44
40
  * @param network - the network
45
- * @param args - the voice credit proxy args
46
- * @returns - the voice credit proxy abi and bytecode
47
- */
48
- getVoiceCreditProxyData(voiceCreditProxyType: EInitialVoiceCreditProxies, network: ESupportedNetworks, args: IInitialVoiceCreditProxyArgs): IContractData;
49
- /**
50
- * @param abi - the abi
51
- * @param bytecode - the bytecode
52
- * @param args - the args
53
- * @param publicClient - the public client
54
- * @returns - the address
55
- */
56
- deployAndGetAddress(kernelClient: KernelClientType, abi: Abi, bytecode: Hex, args: unknown[], bundlerClient: BundlerClientType, publicClient: PublicClientType): Promise<string | undefined>;
57
- /**
58
- * Deploy a contract and store the address
59
- *
60
- * @param contract - the contract to deploy
61
- * @param args - the args
62
- * @param abi - the abi
63
- * @param bytecode - the bytecode
64
- * @param kernelClient - the kernel client
65
- * @param publicClient - the public client
66
- * @param chain - the chain
67
- * @returns - the address of the deployed contract
68
- */
69
- deployAndStore(contract: EContracts, args: unknown[], abi: Abi, bytecode: Hex, kernelClient: KernelClientType, bundlerClient: BundlerClientType, publicClient: PublicClientType, chain: ESupportedNetworks): Promise<Hex>;
70
- /**
71
- * Estimate gas, add a bit extra and send the user operation (aka. transaction)
72
- * @param to - the to address of the user operation
73
- * @param value - the value of the user operation
74
- * @param abi - the abi
75
- * @param functionName - the function name
76
41
  * @param args - the args
77
- * @param errorMessage - the error message
78
- * @param kernelClient - the kernel client
79
- * @param bundlerClient - the bundler client
42
+ * @returns - the voice credit proxy contract
80
43
  */
81
- estimateGasAndSend(to: Hex, value: bigint, abi: Abi, functionName: string, args: unknown[], errorMessage: string, kernelClient: KernelClientType, bundlerClient: BundlerClientType): Promise<GetUserOperationReceiptReturnType>;
44
+ deployAndSaveVoiceCreditProxy(signer: Signer, voiceCreditProxyType: EInitialVoiceCreditProxies, network: ESupportedNetworks, args?: IInitialVoiceCreditProxyArgs): Promise<ConstantInitialVoiceCreditProxy>;
82
45
  /**
83
46
  * Get verifying keys arguments (specially zkey paths)
84
47
  * @param signer - the signer
85
- * @param vkRegistryContract - the deployed vk registry contract
86
- * @param vkRegistryArgs - the arguments send to the endpoint
48
+ * @param verifyingKeysRegistryContract - the deployed verifyingKey registry contract
49
+ * @param verifyingKeysRegistryArgs - the arguments send to the endpoint
87
50
  * @param mode - use QV or NON_QV
88
51
  * @returns SetVerifyingKeysArgs
89
52
  */
90
- getVerifyingKeysArgs(signer: Signer, vkRegistryContract: VkRegistry, vkRegistryArgs: IVkRegistryArgs, mode: EMode): Promise<ISetVerifyingKeysArgs>;
53
+ getVerifyingKeysArgs(signer: Signer, verifyingKeysRegistryAddress: Hex, verifyingKeysRegistryArgs: IVerifyingKeysRegistryArgs, mode: EMode): Promise<ISetVerifyingKeysArgs>;
91
54
  /**
92
55
  * Deploy MACI contracts
93
56
  *
@@ -1 +1 @@
1
- {"version":3,"file":"deployer.service.d.ts","sourceRoot":"","sources":["../../../ts/deployer/deployer.service.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,SAAS,EAsBT,UAAU,EACV,0BAA0B,EAC1B,KAAK,EAEL,KAAK,qBAAqB,EAK1B,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAA8B,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAsB,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAIzD,OAAO,EAAc,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACn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