@maci-protocol/coordinator 0.0.0-ci.4c6d4e8 → 0.0.0-ci.4d0e3a3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +224 -0
- package/LICENSE +1 -2
- package/README.md +71 -10
- package/build/hardhat.config.cjs +17 -9
- package/build/hardhat.config.cjs.map +1 -1
- package/build/hardhat.config.d.cts +15 -12
- package/build/hardhat.config.d.cts.map +1 -1
- package/build/scripts/generateKeypair.js +2 -2
- package/build/scripts/generateKeypair.js.map +1 -1
- package/build/scripts/generateMaciKeyPair.js +2 -2
- package/build/scripts/generateMaciKeyPair.js.map +1 -1
- package/build/tests/constants.d.ts +3 -4
- package/build/tests/constants.d.ts.map +1 -1
- package/build/tests/constants.js +5 -4
- package/build/tests/constants.js.map +1 -1
- package/build/tests/e2e.deploy.test.js +133 -103
- package/build/tests/e2e.deploy.test.js.map +1 -1
- package/build/tests/e2e.redis.test.d.ts +2 -0
- package/build/tests/e2e.redis.test.d.ts.map +1 -0
- package/build/tests/e2e.redis.test.js +118 -0
- package/build/tests/e2e.redis.test.js.map +1 -0
- package/build/tests/utils.d.ts +7 -1
- package/build/tests/utils.d.ts.map +1 -1
- package/build/tests/utils.js +17 -6
- package/build/tests/utils.js.map +1 -1
- package/build/ts/app.module.d.ts.map +1 -1
- package/build/ts/app.module.js +6 -0
- package/build/ts/app.module.js.map +1 -1
- package/build/ts/common/__tests__/common.test.js +44 -46
- package/build/ts/common/__tests__/common.test.js.map +1 -1
- package/build/ts/common/accountAbstraction.d.ts +7 -24
- package/build/ts/common/accountAbstraction.d.ts.map +1 -1
- package/build/ts/common/accountAbstraction.js +22 -49
- package/build/ts/common/accountAbstraction.js.map +1 -1
- package/build/ts/common/chain.d.ts +22 -0
- package/build/ts/common/chain.d.ts.map +1 -0
- package/build/ts/common/chain.js +37 -0
- package/build/ts/common/chain.js.map +1 -0
- package/build/ts/common/coordinatorKeypair.d.ts +7 -0
- package/build/ts/common/coordinatorKeypair.d.ts.map +1 -0
- package/build/ts/common/coordinatorKeypair.js +14 -0
- package/build/ts/common/coordinatorKeypair.js.map +1 -0
- package/build/ts/common/errors.d.ts +13 -10
- package/build/ts/common/errors.d.ts.map +1 -1
- package/build/ts/common/errors.js +12 -9
- package/build/ts/common/errors.js.map +1 -1
- package/build/ts/common/http.d.ts +6 -0
- package/build/ts/common/http.d.ts.map +1 -0
- package/build/ts/common/http.js +49 -0
- package/build/ts/common/http.js.map +1 -0
- package/build/ts/common/index.d.ts +3 -1
- package/build/ts/common/index.d.ts.map +1 -1
- package/build/ts/common/index.js +3 -1
- package/build/ts/common/index.js.map +1 -1
- package/build/ts/common/networks.d.ts +2 -21
- package/build/ts/common/networks.d.ts.map +1 -1
- package/build/ts/common/networks.js +39 -48
- package/build/ts/common/networks.js.map +1 -1
- package/build/ts/common/types.d.ts +3 -4
- package/build/ts/common/types.d.ts.map +1 -1
- package/build/ts/deployer/__tests__/deployer.controller.test.js +23 -25
- package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -1
- package/build/ts/deployer/__tests__/deployer.service.test.js +184 -337
- package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -1
- package/build/ts/deployer/__tests__/utils.d.ts +31 -6
- package/build/ts/deployer/__tests__/utils.d.ts.map +1 -1
- package/build/ts/deployer/__tests__/utils.js +48 -24
- package/build/ts/deployer/__tests__/utils.js.map +1 -1
- package/build/ts/deployer/deployer.controller.d.ts.map +1 -1
- package/build/ts/deployer/deployer.controller.js +19 -6
- package/build/ts/deployer/deployer.controller.js.map +1 -1
- package/build/ts/deployer/deployer.service.d.ts +26 -53
- package/build/ts/deployer/deployer.service.d.ts.map +1 -1
- package/build/ts/deployer/deployer.service.js +343 -469
- package/build/ts/deployer/deployer.service.js.map +1 -1
- package/build/ts/deployer/dto.d.ts +7 -7
- package/build/ts/deployer/dto.d.ts.map +1 -1
- package/build/ts/deployer/dto.js +14 -6
- package/build/ts/deployer/dto.js.map +1 -1
- package/build/ts/deployer/types.d.ts +84 -47
- package/build/ts/deployer/types.d.ts.map +1 -1
- package/build/ts/file/__tests__/file.service.test.js +12 -11
- package/build/ts/file/__tests__/file.service.test.js.map +1 -1
- package/build/ts/file/file.service.d.ts +4 -3
- package/build/ts/file/file.service.d.ts.map +1 -1
- package/build/ts/file/file.service.js +16 -10
- package/build/ts/file/file.service.js.map +1 -1
- package/build/ts/file/types.d.ts +2 -2
- package/build/ts/file/types.d.ts.map +1 -1
- package/build/ts/health/__tests__/health.controller.test.d.ts +2 -0
- package/build/ts/health/__tests__/health.controller.test.d.ts.map +1 -0
- package/build/ts/health/__tests__/health.controller.test.js +52 -0
- package/build/ts/health/__tests__/health.controller.test.js.map +1 -0
- package/build/ts/health/__tests__/health.service.test.d.ts +2 -0
- package/build/ts/health/__tests__/health.service.test.d.ts.map +1 -0
- package/build/ts/health/__tests__/health.service.test.js +101 -0
- package/build/ts/health/__tests__/health.service.test.js.map +1 -0
- package/build/ts/health/health.controller.d.ts +16 -0
- package/build/ts/health/health.controller.d.ts.map +1 -0
- package/build/ts/health/health.controller.js +43 -0
- package/build/ts/health/health.controller.js.map +1 -0
- package/build/ts/health/health.module.d.ts +3 -0
- package/build/ts/health/health.module.d.ts.map +1 -0
- package/build/ts/health/health.module.js +22 -0
- package/build/ts/health/health.module.js.map +1 -0
- package/build/ts/health/health.service.d.ts +42 -0
- package/build/ts/health/health.service.d.ts.map +1 -0
- package/build/ts/health/health.service.js +176 -0
- package/build/ts/health/health.service.js.map +1 -0
- package/build/ts/health/types.d.ts +87 -0
- package/build/ts/health/types.d.ts.map +1 -0
- package/build/ts/health/types.js +2 -0
- package/build/ts/health/types.js.map +1 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts +11 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts.map +1 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js +12 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js.map +1 -0
- package/build/ts/main.js +1 -1
- package/build/ts/proof/__tests__/proof.controller.test.js +8 -7
- package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -1
- package/build/ts/proof/__tests__/proof.gateway.test.js +5 -3
- package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -1
- package/build/ts/proof/__tests__/proof.service.test.js +31 -75
- package/build/ts/proof/__tests__/proof.service.test.js.map +1 -1
- package/build/ts/proof/dto.d.ts +15 -18
- package/build/ts/proof/dto.d.ts.map +1 -1
- package/build/ts/proof/dto.js +55 -49
- package/build/ts/proof/dto.js.map +1 -1
- package/build/ts/proof/proof.controller.d.ts +3 -2
- package/build/ts/proof/proof.controller.d.ts.map +1 -1
- package/build/ts/proof/proof.controller.js +38 -15
- package/build/ts/proof/proof.controller.js.map +1 -1
- package/build/ts/proof/proof.module.d.ts.map +1 -1
- package/build/ts/proof/proof.module.js +1 -0
- package/build/ts/proof/proof.module.js.map +1 -1
- package/build/ts/proof/proof.service.d.ts +4 -6
- package/build/ts/proof/proof.service.d.ts.map +1 -1
- package/build/ts/proof/proof.service.js +48 -130
- package/build/ts/proof/proof.service.js.map +1 -1
- package/build/ts/proof/types.d.ts +21 -17
- package/build/ts/proof/types.d.ts.map +1 -1
- package/build/ts/proof/types.js.map +1 -1
- package/build/ts/redis/__tests__/redis.service.test.d.ts +2 -0
- package/build/ts/redis/__tests__/redis.service.test.d.ts.map +1 -0
- package/build/ts/redis/__tests__/redis.service.test.js +148 -0
- package/build/ts/redis/__tests__/redis.service.test.js.map +1 -0
- package/build/ts/redis/redis.module.d.ts +3 -0
- package/build/ts/redis/redis.module.d.ts.map +1 -0
- package/build/ts/redis/redis.module.js +18 -0
- package/build/ts/redis/redis.module.js.map +1 -0
- package/build/ts/redis/redis.service.d.ts +53 -0
- package/build/ts/redis/redis.service.d.ts.map +1 -0
- package/build/ts/redis/redis.service.js +99 -0
- package/build/ts/redis/redis.service.js.map +1 -0
- package/build/ts/redis/types.d.ts +66 -0
- package/build/ts/redis/types.d.ts.map +1 -0
- package/build/ts/redis/types.js +2 -0
- package/build/ts/redis/types.js.map +1 -0
- package/build/ts/redis/utils.d.ts +20 -0
- package/build/ts/redis/utils.d.ts.map +1 -0
- package/build/ts/redis/utils.js +27 -0
- package/build/ts/redis/utils.js.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts +2 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.js +62 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.js.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts +2 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.js +369 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.js.map +1 -0
- package/build/ts/scheduler/dto.d.ts +41 -0
- package/build/ts/scheduler/dto.d.ts.map +1 -0
- package/build/ts/scheduler/dto.js +115 -0
- package/build/ts/scheduler/dto.js.map +1 -0
- package/build/ts/scheduler/scheduler.controller.d.ts +32 -0
- package/build/ts/scheduler/scheduler.controller.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.controller.js +118 -0
- package/build/ts/scheduler/scheduler.controller.js.map +1 -0
- package/build/ts/scheduler/scheduler.module.d.ts +3 -0
- package/build/ts/scheduler/scheduler.module.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.module.js +24 -0
- package/build/ts/scheduler/scheduler.module.js.map +1 -0
- package/build/ts/scheduler/scheduler.service.d.ts +71 -0
- package/build/ts/scheduler/scheduler.service.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.service.js +297 -0
- package/build/ts/scheduler/scheduler.service.js.map +1 -0
- package/build/ts/scheduler/types.d.ts +65 -0
- package/build/ts/scheduler/types.d.ts.map +1 -0
- package/build/ts/scheduler/types.js +2 -0
- package/build/ts/scheduler/types.js.map +1 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +2 -2
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -1
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js +34 -19
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js.map +1 -1
- package/build/ts/sessionKeys/__tests__/utils.d.ts +1 -1
- package/build/ts/sessionKeys/__tests__/utils.d.ts.map +1 -1
- package/build/ts/sessionKeys/__tests__/utils.js +7 -6
- package/build/ts/sessionKeys/__tests__/utils.js.map +1 -1
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts +53 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts.map +1 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js +105 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.service.d.ts +16 -4
- package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -1
- package/build/ts/sessionKeys/sessionKeys.service.js +23 -6
- package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.controller.test.js +3 -3
- package/build/ts/subgraph/__tests__/subgraph.controller.test.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.js +2 -2
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.service.test.js +5 -5
- package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -1
- package/build/ts/subgraph/dto.d.ts +2 -2
- package/build/ts/subgraph/dto.d.ts.map +1 -1
- package/build/ts/subgraph/dto.js +3 -3
- package/build/ts/subgraph/dto.js.map +1 -1
- package/build/ts/subgraph/subgraph.controller.d.ts.map +1 -1
- package/build/ts/subgraph/subgraph.controller.js +8 -3
- package/build/ts/subgraph/subgraph.controller.js.map +1 -1
- package/build/ts/subgraph/subgraph.service.d.ts +4 -0
- package/build/ts/subgraph/subgraph.service.d.ts.map +1 -1
- package/build/ts/subgraph/subgraph.service.js +23 -10
- package/build/ts/subgraph/subgraph.service.js.map +1 -1
- package/build/ts/subgraph/types.d.ts +2 -2
- package/build/ts/subgraph/types.d.ts.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +46 -39
- package/build/tests/e2e.aa.test.d.ts +0 -2
- package/build/tests/e2e.aa.test.d.ts.map +0 -1
- package/build/tests/e2e.aa.test.js +0 -103
- package/build/tests/e2e.aa.test.js.map +0 -1
- package/build/ts/deployer/utils.d.ts +0 -8
- package/build/ts/deployer/utils.d.ts.map +0 -1
- package/build/ts/deployer/utils.js +0 -9
- package/build/ts/deployer/utils.js.map +0 -1
package/build/ts/app.module.js
CHANGED
|
@@ -9,7 +9,10 @@ import { ThrottlerModule } from "@nestjs/throttler";
|
|
|
9
9
|
import { CryptoModule } from "./crypto/crypto.module";
|
|
10
10
|
import { DeployerModule } from "./deployer/deployer.module";
|
|
11
11
|
import { FileModule } from "./file/file.module";
|
|
12
|
+
import { HealthModule } from "./health/health.module";
|
|
12
13
|
import { ProofModule } from "./proof/proof.module";
|
|
14
|
+
import { RedisModule } from "./redis/redis.module";
|
|
15
|
+
import { SchedulerModule } from "./scheduler/scheduler.module";
|
|
13
16
|
import { SessionKeysModule } from "./sessionKeys/sessionKeys.module";
|
|
14
17
|
import { SubgraphModule } from "./subgraph/subgraph.module";
|
|
15
18
|
let AppModule = class AppModule {
|
|
@@ -23,12 +26,15 @@ AppModule = __decorate([
|
|
|
23
26
|
limit: Number(process.env.LIMIT),
|
|
24
27
|
},
|
|
25
28
|
]),
|
|
29
|
+
HealthModule,
|
|
26
30
|
FileModule,
|
|
27
31
|
CryptoModule,
|
|
28
32
|
SubgraphModule,
|
|
29
33
|
ProofModule,
|
|
30
34
|
SessionKeysModule,
|
|
31
35
|
DeployerModule,
|
|
36
|
+
RedisModule,
|
|
37
|
+
SchedulerModule,
|
|
32
38
|
],
|
|
33
39
|
})
|
|
34
40
|
], AppModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../ts/app.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../ts/app.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAqBrD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IAnBrB,MAAM,CAAC;QACN,OAAO,EAAE;YACP,eAAe,CAAC,OAAO,CAAC;gBACtB;oBACE,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;oBAC5B,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;iBACjC;aACF,CAAC;YACF,YAAY;YACZ,UAAU;YACV,YAAY;YACZ,cAAc;YACd,WAAW;YACX,iBAAiB;YACjB,cAAc;YACd,WAAW;YACX,eAAe;SAChB;KACF,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ESupportedChains } from "@maci-protocol/sdk";
|
|
2
|
+
import { mainnet, sepolia, arbitrum, localhost, arbitrumSepolia, baseSepolia, lineaSepolia, scrollSepolia, scroll, base, linea, gnosis, polygon, optimism, optimismSepolia, hardhat, polygonAmoy, polygonZkEvm, polygonZkEvmCardona, zksyncSepoliaTestnet, zksync, gnosisChiado, } from "viem/chains";
|
|
3
|
+
import { getBundlerClient, getPublicClient, getZeroDevBundlerRPCUrl } from "../accountAbstraction";
|
|
4
|
+
import { getRpcUrl } from "../chain";
|
|
3
5
|
import { ErrorCodes } from "../errors";
|
|
4
|
-
import {
|
|
6
|
+
import { viemChain } from "../networks";
|
|
5
7
|
describe("common", () => {
|
|
6
8
|
describe("getPublicClient", () => {
|
|
7
|
-
test("should return a public client", () => {
|
|
8
|
-
const publicClient = getPublicClient(
|
|
9
|
+
test("should return a public client", async () => {
|
|
10
|
+
const publicClient = await getPublicClient(ESupportedChains.Sepolia);
|
|
9
11
|
expect(publicClient).toBeDefined();
|
|
10
12
|
});
|
|
11
|
-
test("should throw when given an unsupported network", () => {
|
|
12
|
-
expect(() => getPublicClient("Unsupported")).toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
13
|
+
test("should throw when given an unsupported network", async () => {
|
|
14
|
+
await expect(() => getPublicClient("Unsupported")).rejects.toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
13
15
|
});
|
|
14
16
|
});
|
|
15
17
|
describe("getZeroDevBundlerRPCUrl", () => {
|
|
@@ -17,59 +19,55 @@ describe("common", () => {
|
|
|
17
19
|
expect(() => getZeroDevBundlerRPCUrl("Unsupported")).toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
18
20
|
});
|
|
19
21
|
test("should return an RPCUrl for a supported network", () => {
|
|
20
|
-
const rpcUrlOPS = getZeroDevBundlerRPCUrl(
|
|
22
|
+
const rpcUrlOPS = getZeroDevBundlerRPCUrl(ESupportedChains.OptimismSepolia);
|
|
21
23
|
expect(rpcUrlOPS).toBeDefined();
|
|
22
|
-
const
|
|
24
|
+
const rpcUrlSepolia = getZeroDevBundlerRPCUrl(ESupportedChains.Sepolia);
|
|
25
|
+
expect(rpcUrlSepolia).toBeDefined();
|
|
26
|
+
const rpcUrlOP = getZeroDevBundlerRPCUrl(ESupportedChains.Optimism);
|
|
23
27
|
expect(rpcUrlOP).toBeDefined();
|
|
24
28
|
});
|
|
29
|
+
test("should throw when a unsupported zero dev network is given", () => {
|
|
30
|
+
expect(() => getZeroDevBundlerRPCUrl(ESupportedChains.Base)).toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
31
|
+
});
|
|
25
32
|
});
|
|
26
33
|
describe("getBundlerClient", () => {
|
|
27
34
|
test("should throw when the network is not supported", () => {
|
|
28
35
|
expect(() => getBundlerClient("Unsupported")).toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
29
36
|
});
|
|
30
37
|
});
|
|
31
|
-
describe("
|
|
32
|
-
test("should
|
|
33
|
-
|
|
34
|
-
expect(rpcUrl).toBeDefined();
|
|
35
|
-
expect(rpcUrl).toContain("https://opt-sepolia.g.alchemy.com/v2/");
|
|
36
|
-
});
|
|
37
|
-
test("should return the correct RPCUrl for sepolia", () => {
|
|
38
|
-
const rpcUrl = genAlchemyRPCUrl(ESupportedNetworks.ETHEREUM_SEPOLIA);
|
|
39
|
-
expect(rpcUrl).toBeDefined();
|
|
40
|
-
expect(rpcUrl).toContain("https://eth-sepolia.g.alchemy.com/v2/");
|
|
41
|
-
});
|
|
42
|
-
test("should throw when given an unsupported network", () => {
|
|
43
|
-
expect(() => genAlchemyRPCUrl(ESupportedNetworks.GNOSIS_CHAIN)).toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
38
|
+
describe("getRpcUrl", () => {
|
|
39
|
+
test("should throw when given an unsupported network", async () => {
|
|
40
|
+
await expect(() => getRpcUrl("Unsupported")).rejects.toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
44
41
|
});
|
|
45
|
-
test("should throw when
|
|
46
|
-
delete process.env.
|
|
47
|
-
expect(() =>
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
describe("getDeployedContractAddress", () => {
|
|
51
|
-
test("should throw when the log is undefined", () => {
|
|
52
|
-
expect(() => getDeployedContractAddress({})).toThrow();
|
|
42
|
+
test("should throw when COORDINATOR_RPC_URL is not set", async () => {
|
|
43
|
+
delete process.env.COORDINATOR_RPC_URL;
|
|
44
|
+
await expect(() => getRpcUrl(ESupportedChains.OptimismSepolia)).rejects.toThrow(ErrorCodes.COORDINATOR_RPC_URL_NOT_SET.toString());
|
|
53
45
|
});
|
|
54
46
|
});
|
|
55
47
|
describe("viemChain", () => {
|
|
56
48
|
test("should return correct chain for all supported networks", () => {
|
|
57
|
-
expect(viemChain(
|
|
58
|
-
expect(viemChain(
|
|
59
|
-
expect(viemChain(
|
|
60
|
-
expect(viemChain(
|
|
61
|
-
expect(viemChain(
|
|
62
|
-
expect(viemChain(
|
|
63
|
-
expect(viemChain(
|
|
64
|
-
expect(viemChain(
|
|
65
|
-
expect(viemChain(
|
|
66
|
-
expect(viemChain(
|
|
67
|
-
expect(viemChain(
|
|
68
|
-
expect(viemChain(
|
|
69
|
-
expect(viemChain(
|
|
70
|
-
expect(viemChain(
|
|
71
|
-
expect(viemChain(
|
|
72
|
-
expect(viemChain(
|
|
49
|
+
expect(viemChain(ESupportedChains.Mainnet)).toBe(mainnet);
|
|
50
|
+
expect(viemChain(ESupportedChains.Sepolia)).toBe(sepolia);
|
|
51
|
+
expect(viemChain(ESupportedChains.Optimism)).toBe(optimism);
|
|
52
|
+
expect(viemChain(ESupportedChains.OptimismSepolia)).toBe(optimismSepolia);
|
|
53
|
+
expect(viemChain(ESupportedChains.Scroll)).toBe(scroll);
|
|
54
|
+
expect(viemChain(ESupportedChains.ScrollSepolia)).toBe(scrollSepolia);
|
|
55
|
+
expect(viemChain(ESupportedChains.Arbitrum)).toBe(arbitrum);
|
|
56
|
+
expect(viemChain(ESupportedChains.ArbitrumSepolia)).toBe(arbitrumSepolia);
|
|
57
|
+
expect(viemChain(ESupportedChains.Base)).toBe(base);
|
|
58
|
+
expect(viemChain(ESupportedChains.BaseSepolia)).toBe(baseSepolia);
|
|
59
|
+
expect(viemChain(ESupportedChains.Gnosis)).toBe(gnosis);
|
|
60
|
+
expect(viemChain(ESupportedChains.GnosisChiado)).toBe(gnosisChiado);
|
|
61
|
+
expect(viemChain(ESupportedChains.Polygon)).toBe(polygon);
|
|
62
|
+
expect(viemChain(ESupportedChains.PolygonAmoy)).toBe(polygonAmoy);
|
|
63
|
+
expect(viemChain(ESupportedChains.Linea)).toBe(linea);
|
|
64
|
+
expect(viemChain(ESupportedChains.LineaSepolia)).toBe(lineaSepolia);
|
|
65
|
+
expect(viemChain(ESupportedChains.ZkSyncEra)).toBe(zksync);
|
|
66
|
+
expect(viemChain(ESupportedChains.ZkSyncSepolia)).toBe(zksyncSepoliaTestnet);
|
|
67
|
+
expect(viemChain(ESupportedChains.PolygonZkEvm)).toBe(polygonZkEvm);
|
|
68
|
+
expect(viemChain(ESupportedChains.PolygonCardonaZkEvm)).toBe(polygonZkEvmCardona);
|
|
69
|
+
expect(viemChain(ESupportedChains.Hardhat)).toBe(hardhat);
|
|
70
|
+
expect(viemChain(ESupportedChains.Localhost)).toBe(localhost);
|
|
73
71
|
});
|
|
74
72
|
test("should throw error for unsupported network", () => {
|
|
75
73
|
expect(() => viemChain("UNSUPPORTED_NETWORK")).toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.test.js","sourceRoot":"","sources":["../../../../ts/common/__tests__/common.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,MAAM,EACN,IAAI,EACJ,
|
|
1
|
+
{"version":3,"file":"common.test.js","sourceRoot":"","sources":["../../../../ts/common/__tests__/common.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,MAAM,EACN,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,IAAI,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;YAC/C,MAAM,YAAY,GAAG,M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|
-
* @param network - the network we want to interact with
|
|
8
|
-
* @returns the RPCUrl for the network
|
|
9
|
-
*/
|
|
10
|
-
export declare const genAlchemyRPCUrl: (network: ESupportedNetworks) => string;
|
|
1
|
+
import { ESupportedChains } from "@maci-protocol/sdk";
|
|
2
|
+
import { type Hex } from "viem";
|
|
3
|
+
import type { BundlerClientType, KernelClientType, PublicClientHTTPType } from "./types";
|
|
11
4
|
/**
|
|
12
5
|
* Get a public client
|
|
13
6
|
*
|
|
14
7
|
* @param chainName - the name of the chain to use
|
|
15
8
|
* @returns the public client
|
|
16
9
|
*/
|
|
17
|
-
export declare const getPublicClient: (chainName:
|
|
10
|
+
export declare const getPublicClient: (chainName: ESupportedChains) => Promise<PublicClientHTTPType>;
|
|
18
11
|
/**
|
|
19
12
|
* Get the ZeroDev bundler RPC URL based on the network
|
|
20
13
|
*
|
|
21
14
|
* @param network - the network we are on
|
|
22
15
|
* @returns the ZeroDev bundler RPC URL
|
|
23
16
|
*/
|
|
24
|
-
export declare const getZeroDevBundlerRPCUrl: (network:
|
|
17
|
+
export declare const getZeroDevBundlerRPCUrl: (network: ESupportedChains) => string;
|
|
25
18
|
/**
|
|
26
19
|
* Get a bundler client
|
|
27
20
|
*
|
|
28
21
|
* @param chainName - the chain name
|
|
29
22
|
* @returns the bundler client
|
|
30
23
|
*/
|
|
31
|
-
export declare const getBundlerClient: (chainName:
|
|
32
|
-
/**
|
|
33
|
-
* The topic for the contract creation event
|
|
34
|
-
*/
|
|
35
|
-
export declare const contractCreationEventTopic = "0x4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b511";
|
|
24
|
+
export declare const getBundlerClient: (chainName: ESupportedChains) => BundlerClientType;
|
|
36
25
|
/**
|
|
37
26
|
* The offset for the address in the contract creation event
|
|
38
27
|
*/
|
|
39
28
|
export declare const addressOffset = 26;
|
|
40
|
-
/**
|
|
41
|
-
* Get the address of the newly deployed contract from a transaction receipt
|
|
42
|
-
* @param receipt - The transaction receipt
|
|
43
|
-
* @returns The address of the newly deployed contract
|
|
44
|
-
*/
|
|
45
|
-
export declare const getDeployedContractAddress: (receipt: TransactionReceipt) => string | undefined;
|
|
46
29
|
/**
|
|
47
30
|
* Get a Kernel account handle given a session key
|
|
48
31
|
*
|
|
@@ -51,5 +34,5 @@ export declare const getDeployedContractAddress: (receipt: TransactionReceipt) =
|
|
|
51
34
|
* @param chain - the chain to use
|
|
52
35
|
* @returns the kernel client
|
|
53
36
|
*/
|
|
54
|
-
export declare const getKernelClient: (sessionKey: Hex, approval: string, chain:
|
|
37
|
+
export declare const getKernelClient: (sessionKey: Hex, approval: string, chain: ESupportedChains) => Promise<KernelClientType>;
|
|
55
38
|
//# sourceMappingURL=accountAbstraction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountAbstraction.d.ts","sourceRoot":"","sources":["../../../ts/common/accountAbstraction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accountAbstraction.d.ts","sourceRoot":"","sources":["../../../ts/common/accountAbstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,OAAO,EAA4B,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAI1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAQzF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAU,WAAW,gBAAgB,KAAG,OAAO,CAAC,oBAAoB,CAI5F,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,gBAAgB,KAAG,MAWnE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,gBAAgB,KAAG,iBAI3D,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,YAAY,GAAG,EACf,UAAU,MAAM,EAChB,OAAO,gBAAgB,KACtB,OAAO,CAAC,gBAAgB,CA0B1B,CAAC"}
|
|
@@ -1,42 +1,24 @@
|
|
|
1
|
+
import { ESupportedChains } from "@maci-protocol/sdk";
|
|
1
2
|
import { deserializePermissionAccount } from "@zerodev/permissions";
|
|
2
3
|
import { toECDSASigner } from "@zerodev/permissions/signers";
|
|
3
4
|
import { createKernelAccountClient } from "@zerodev/sdk";
|
|
4
5
|
import { getEntryPoint, KERNEL_V3_1 } from "@zerodev/sdk/constants";
|
|
5
6
|
import dotenv from "dotenv";
|
|
6
|
-
import { createBundlerClient, ENTRYPOINT_ADDRESS_V07 } from "permissionless";
|
|
7
7
|
import { createPublicClient, http } from "viem";
|
|
8
|
+
import { createBundlerClient } from "viem/account-abstraction";
|
|
8
9
|
import { privateKeyToAccount } from "viem/accounts";
|
|
10
|
+
import { getRpcUrl } from "./chain";
|
|
9
11
|
import { ErrorCodes } from "./errors";
|
|
10
|
-
import {
|
|
12
|
+
import { viemChain } from "./networks";
|
|
11
13
|
dotenv.config();
|
|
12
|
-
/**
|
|
13
|
-
* Generate the RPCUrl for Alchemy based on the chain we need to interact with
|
|
14
|
-
*
|
|
15
|
-
* @param network - the network we want to interact with
|
|
16
|
-
* @returns the RPCUrl for the network
|
|
17
|
-
*/
|
|
18
|
-
export const genAlchemyRPCUrl = (network) => {
|
|
19
|
-
const rpcAPIKey = process.env.RPC_API_KEY;
|
|
20
|
-
if (!rpcAPIKey) {
|
|
21
|
-
throw new Error(ErrorCodes.RPC_API_KEY_NOT_SET.toString());
|
|
22
|
-
}
|
|
23
|
-
switch (network) {
|
|
24
|
-
case ESupportedNetworks.OPTIMISM_SEPOLIA:
|
|
25
|
-
return `https://opt-sepolia.g.alchemy.com/v2/${rpcAPIKey}`;
|
|
26
|
-
case ESupportedNetworks.ETHEREUM_SEPOLIA:
|
|
27
|
-
return `https://eth-sepolia.g.alchemy.com/v2/${rpcAPIKey}`;
|
|
28
|
-
default:
|
|
29
|
-
throw new Error(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
14
|
/**
|
|
33
15
|
* Get a public client
|
|
34
16
|
*
|
|
35
17
|
* @param chainName - the name of the chain to use
|
|
36
18
|
* @returns the public client
|
|
37
19
|
*/
|
|
38
|
-
export const getPublicClient = (chainName) => createPublicClient({
|
|
39
|
-
transport: http(
|
|
20
|
+
export const getPublicClient = async (chainName) => createPublicClient({
|
|
21
|
+
transport: http(await getRpcUrl(chainName)),
|
|
40
22
|
chain: viemChain(chainName),
|
|
41
23
|
});
|
|
42
24
|
/**
|
|
@@ -47,10 +29,12 @@ export const getPublicClient = (chainName) => createPublicClient({
|
|
|
47
29
|
*/
|
|
48
30
|
export const getZeroDevBundlerRPCUrl = (network) => {
|
|
49
31
|
switch (network) {
|
|
50
|
-
case
|
|
32
|
+
case ESupportedChains.OptimismSepolia:
|
|
51
33
|
return process.env.ZERODEV_BUNDLER_RPC_OP_SEPOLIA || "";
|
|
52
|
-
case
|
|
34
|
+
case ESupportedChains.Optimism:
|
|
53
35
|
return process.env.ZERODEV_BUNDLER_RPC_OP || "";
|
|
36
|
+
case ESupportedChains.Sepolia:
|
|
37
|
+
return process.env.ZERODEV_BUNDLER_RPC_SEPOLIA || "";
|
|
54
38
|
default:
|
|
55
39
|
throw new Error(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
56
40
|
}
|
|
@@ -64,26 +48,11 @@ export const getZeroDevBundlerRPCUrl = (network) => {
|
|
|
64
48
|
export const getBundlerClient = (chainName) => createBundlerClient({
|
|
65
49
|
transport: http(getZeroDevBundlerRPCUrl(chainName)),
|
|
66
50
|
chain: viemChain(chainName),
|
|
67
|
-
entryPoint: ENTRYPOINT_ADDRESS_V07,
|
|
68
51
|
});
|
|
69
|
-
/**
|
|
70
|
-
* The topic for the contract creation event
|
|
71
|
-
*/
|
|
72
|
-
export const contractCreationEventTopic = "0x4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b511";
|
|
73
52
|
/**
|
|
74
53
|
* The offset for the address in the contract creation event
|
|
75
54
|
*/
|
|
76
55
|
export const addressOffset = 26;
|
|
77
|
-
/**
|
|
78
|
-
* Get the address of the newly deployed contract from a transaction receipt
|
|
79
|
-
* @param receipt - The transaction receipt
|
|
80
|
-
* @returns The address of the newly deployed contract
|
|
81
|
-
*/
|
|
82
|
-
export const getDeployedContractAddress = (receipt) => {
|
|
83
|
-
const addr = receipt.logs.find((log) => log.topics[0] === contractCreationEventTopic);
|
|
84
|
-
const deployedAddress = addr ? `0x${addr.topics[1]?.slice(addressOffset)}` : undefined;
|
|
85
|
-
return deployedAddress;
|
|
86
|
-
};
|
|
87
56
|
/**
|
|
88
57
|
* Get a Kernel account handle given a session key
|
|
89
58
|
*
|
|
@@ -94,17 +63,21 @@ export const getDeployedContractAddress = (receipt) => {
|
|
|
94
63
|
*/
|
|
95
64
|
export const getKernelClient = async (sessionKey, approval, chain) => {
|
|
96
65
|
const bundlerUrl = getZeroDevBundlerRPCUrl(chain);
|
|
97
|
-
const publicClient = getPublicClient(chain);
|
|
66
|
+
const publicClient = await getPublicClient(chain);
|
|
98
67
|
// Using a stored private key
|
|
99
68
|
const sessionKeySigner = await toECDSASigner({
|
|
100
69
|
signer: privateKeyToAccount(sessionKey),
|
|
101
70
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
71
|
+
try {
|
|
72
|
+
const sessionKeyAccount = await deserializePermissionAccount(publicClient, getEntryPoint("0.7"), KERNEL_V3_1, approval, sessionKeySigner);
|
|
73
|
+
return createKernelAccountClient({
|
|
74
|
+
bundlerTransport: http(bundlerUrl),
|
|
75
|
+
account: sessionKeyAccount,
|
|
76
|
+
chain: viemChain(chain),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error(ErrorCodes.INVALID_APPROVAL.toString());
|
|
81
|
+
}
|
|
109
82
|
};
|
|
110
83
|
//# sourceMappingURL=accountAbstraction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountAbstraction.js","sourceRoot":"","sources":["../../../ts/common/accountAbstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"accountAbstraction.js","sourceRoot":"","sources":["../../../ts/common/accountAbstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAY,MAAM,MAAM,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIpD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;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e,CAAC,KAAK,CAAC,CAAC;IAElD,6BAA6B;IAC7B,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;QAC3C,MAAM,EAAE,mBAAmB,CAAC,UAAU,CAAC;KACxC,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,iBAAiB,GAAG,MAAM,4BAA4B,CAC1D,YAAY,EACZ,aAAa,CAAC,KAAK,CAAC,EACpB,WAAW,EACX,QAAQ,EACR,gBAAgB,CACjB,CAAC;QAEF,OAAO,yBAAyB,CAAC;YAC/B,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC;YAClC,OAAO,EAAE,iBAAiB;YAC1B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC;SACxB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ESupportedChains } from "@maci-protocol/sdk";
|
|
2
|
+
import { type HDNodeWallet, type Signer, Wallet } from "ethers";
|
|
3
|
+
/**
|
|
4
|
+
* Get the RPC url for the chain we need to interact with
|
|
5
|
+
*
|
|
6
|
+
* @param network - the network we want to interact with
|
|
7
|
+
* @returns the RPC url for the network
|
|
8
|
+
*/
|
|
9
|
+
export declare const getRpcUrl: (network: ESupportedChains) => Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Get wallet from private key or mnemonic env variable
|
|
12
|
+
*
|
|
13
|
+
* @returns wallet
|
|
14
|
+
*/
|
|
15
|
+
export declare const getWallet: () => Wallet | HDNodeWallet;
|
|
16
|
+
/**
|
|
17
|
+
* Get a Ethers Signer given a chain and private key
|
|
18
|
+
* @param chain
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare const getSigner: (chain: ESupportedChains) => Promise<Signer>;
|
|
22
|
+
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../ts/common/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,MAAM,EAAmB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIjF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAU,SAAS,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAYzE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAO,MAAM,GAAG,YACoE,CAAC;AAE3G;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAU,OAAO,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAOvE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ESupportedChains } from "@maci-protocol/sdk";
|
|
2
|
+
import { JsonRpcProvider, Wallet } from "ethers";
|
|
3
|
+
import { ErrorCodes } from "./errors";
|
|
4
|
+
/**
|
|
5
|
+
* Get the RPC url for the chain we need to interact with
|
|
6
|
+
*
|
|
7
|
+
* @param network - the network we want to interact with
|
|
8
|
+
* @returns the RPC url for the network
|
|
9
|
+
*/
|
|
10
|
+
export const getRpcUrl = async (network) => {
|
|
11
|
+
const rpcUrl = process.env.COORDINATOR_RPC_URL;
|
|
12
|
+
if (!rpcUrl) {
|
|
13
|
+
return Promise.reject(new Error(ErrorCodes.COORDINATOR_RPC_URL_NOT_SET.toString()));
|
|
14
|
+
}
|
|
15
|
+
if (!Object.values(ESupportedChains).includes(network)) {
|
|
16
|
+
return Promise.reject(new Error(ErrorCodes.UNSUPPORTED_NETWORK.toString()));
|
|
17
|
+
}
|
|
18
|
+
return Promise.resolve(rpcUrl);
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get wallet from private key or mnemonic env variable
|
|
22
|
+
*
|
|
23
|
+
* @returns wallet
|
|
24
|
+
*/
|
|
25
|
+
export const getWallet = () => process.env.PRIVATE_KEY ? new Wallet(process.env.PRIVATE_KEY) : Wallet.fromPhrase(process.env.MNEMONIC);
|
|
26
|
+
/**
|
|
27
|
+
* Get a Ethers Signer given a chain and private key
|
|
28
|
+
* @param chain
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
export const getSigner = async (chain) => {
|
|
32
|
+
const wallet = getWallet();
|
|
33
|
+
const alchemyRpcUrl = await getRpcUrl(chain);
|
|
34
|
+
const provider = new JsonRpcProvider(alchemyRpcUrl);
|
|
35
|
+
return wallet.connect(provider);
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../ts/common/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAkC,eAAe,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAAE,OAAyB,EAAmB,EAAE;IAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAE/C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,2BAA2B,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACtF,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACvD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,GAA0B,EAAE,CACnD,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,QAAS,CAAC,CAAC;AAE3G;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAAE,KAAuB,EAAmB,EAAE;IAC1E,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC;IAEpD,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Keypair } from "@maci-protocol/domainobjs";
|
|
2
|
+
/**
|
|
3
|
+
* Instantiate the MACI Coordinator keypair.
|
|
4
|
+
* @returns {Keypair} - The MACI Coordinator keypair.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getCoordinatorKeypair: () => Keypair;
|
|
7
|
+
//# sourceMappingURL=coordinatorKeypair.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinatorKeypair.d.ts","sourceRoot":"","sources":["../../../ts/common/coordinatorKeypair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAc,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAO,OAUxC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Keypair, PrivateKey } from "@maci-protocol/domainobjs";
|
|
2
|
+
/**
|
|
3
|
+
* Instantiate the MACI Coordinator keypair.
|
|
4
|
+
* @returns {Keypair} - The MACI Coordinator keypair.
|
|
5
|
+
*/
|
|
6
|
+
export const getCoordinatorKeypair = () => {
|
|
7
|
+
const privateKey = String(process.env.COORDINATOR_MACI_PRIVATE_KEY);
|
|
8
|
+
if (!privateKey) {
|
|
9
|
+
throw new Error("COORDINATOR_MACI_PRIVATE_KEY environment variable is not set.");
|
|
10
|
+
}
|
|
11
|
+
const maciPrivateKey = PrivateKey.deserialize(privateKey);
|
|
12
|
+
return new Keypair(maciPrivateKey);
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=coordinatorKeypair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinatorKeypair.js","sourceRoot":"","sources":["../../../ts/common/coordinatorKeypair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAY,EAAE;IACjD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAEpE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;IAED,MAAM,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE1D,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -11,23 +11,26 @@ export declare enum ErrorCodes {
|
|
|
11
11
|
SUBGRAPH_DEPLOY = 6,
|
|
12
12
|
SUBGRAPH_DEPLOY_KEY_NOT_FOUND = 7,
|
|
13
13
|
SESSION_KEY_NOT_FOUND = 8,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
INVALID_APPROVAL = 9,
|
|
15
|
+
UNSUPPORTED_NETWORK = 10,
|
|
16
|
+
COORDINATOR_RPC_URL_NOT_SET = 11,
|
|
17
|
+
FAILED_TO_MERGE_STATE_TREE = 12,
|
|
18
|
+
FAILED_TO_MERGE_MESSAGE_SUBTREES = 13,
|
|
19
|
+
FAILED_TO_MERGE_MESSAGE_TREE = 14,
|
|
20
|
+
UNSUPPORTED_VOICE_CREDIT_PROXY_FACTORY = 15,
|
|
21
21
|
UNSUPPORTED_VOICE_CREDIT_PROXY = 16,
|
|
22
22
|
UNSUPPORTED_POLICY = 17,
|
|
23
23
|
FAILED_TO_DEPLOY_CONTRACT = 18,
|
|
24
24
|
FAILED_TO_SET_MACI_INSTANCE_ON_POLICY = 19,
|
|
25
25
|
MACI_NOT_DEPLOYED = 20,
|
|
26
26
|
VERIFIER_NOT_DEPLOYED = 21,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
VERIFYING_KEYS_REGISTRY_NOT_DEPLOYED = 22,
|
|
28
|
+
FAILED_TO_SET_VERIFYING_KEYS = 23,
|
|
29
29
|
FAILED_TO_DEPLOY_MACI = 24,
|
|
30
30
|
FAILED_TO_DEPLOY_POLL = 25,
|
|
31
|
-
NOT_MERGED_MESSAGE_TREE = 26
|
|
31
|
+
NOT_MERGED_MESSAGE_TREE = 26,
|
|
32
|
+
FAILED_TO_UPDATE_SCHEDULED_POLL = 27,
|
|
33
|
+
POLL_ALREADY_SCHEDULED = 28,
|
|
34
|
+
POLL_ALREADY_TALLIED = 29
|
|
32
35
|
}
|
|
33
36
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../ts/common/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,UAAU;IACpB,qBAAqB,IAAA;IACrB,oBAAoB,IAAA;IACpB,cAAc,IAAA;IACd,UAAU,IAAA;IACV,UAAU,IAAA;IACV,cAAc,IAAA;IACd,eAAe,IAAA;IACf,6BAA6B,IAAA;IAC7B,qBAAqB,IAAA;IACrB,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../ts/common/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,UAAU;IACpB,qBAAqB,IAAA;IACrB,oBAAoB,IAAA;IACpB,cAAc,IAAA;IACd,UAAU,IAAA;IACV,UAAU,IAAA;IACV,cAAc,IAAA;IACd,eAAe,IAAA;IACf,6BAA6B,IAAA;IAC7B,qBAAqB,IAAA;IACrB,gBAAgB,IAAA;IAChB,mBAAmB,KAAA;IACnB,2BAA2B,KAAA;IAC3B,0BAA0B,KAAA;IAC1B,gCAAgC,KAAA;IAChC,4BAA4B,KAAA;IAC5B,sCAAsC,KAAA;IACtC,8BAA8B,KAAA;IAC9B,kBAAkB,KAAA;IAClB,yBAAyB,KAAA;IACzB,qCAAqC,KAAA;IACrC,iBAAiB,KAAA;IACjB,qBAAqB,KAAA;IACrB,oCAAoC,KAAA;IACpC,4BAA4B,KAAA;IAC5B,qBAAqB,KAAA;IACrB,qBAAqB,KAAA;IACrB,uBAAuB,KAAA;IACvB,+BAA+B,KAAA;IAC/B,sBAAsB,KAAA;IACtB,oBAAoB,KAAA;CACrB"}
|
|
@@ -12,23 +12,26 @@ export var ErrorCodes;
|
|
|
12
12
|
ErrorCodes[ErrorCodes["SUBGRAPH_DEPLOY"] = 6] = "SUBGRAPH_DEPLOY";
|
|
13
13
|
ErrorCodes[ErrorCodes["SUBGRAPH_DEPLOY_KEY_NOT_FOUND"] = 7] = "SUBGRAPH_DEPLOY_KEY_NOT_FOUND";
|
|
14
14
|
ErrorCodes[ErrorCodes["SESSION_KEY_NOT_FOUND"] = 8] = "SESSION_KEY_NOT_FOUND";
|
|
15
|
-
ErrorCodes[ErrorCodes["
|
|
16
|
-
ErrorCodes[ErrorCodes["
|
|
17
|
-
ErrorCodes[ErrorCodes["
|
|
18
|
-
ErrorCodes[ErrorCodes["
|
|
19
|
-
ErrorCodes[ErrorCodes["
|
|
20
|
-
ErrorCodes[ErrorCodes["
|
|
21
|
-
ErrorCodes[ErrorCodes["
|
|
15
|
+
ErrorCodes[ErrorCodes["INVALID_APPROVAL"] = 9] = "INVALID_APPROVAL";
|
|
16
|
+
ErrorCodes[ErrorCodes["UNSUPPORTED_NETWORK"] = 10] = "UNSUPPORTED_NETWORK";
|
|
17
|
+
ErrorCodes[ErrorCodes["COORDINATOR_RPC_URL_NOT_SET"] = 11] = "COORDINATOR_RPC_URL_NOT_SET";
|
|
18
|
+
ErrorCodes[ErrorCodes["FAILED_TO_MERGE_STATE_TREE"] = 12] = "FAILED_TO_MERGE_STATE_TREE";
|
|
19
|
+
ErrorCodes[ErrorCodes["FAILED_TO_MERGE_MESSAGE_SUBTREES"] = 13] = "FAILED_TO_MERGE_MESSAGE_SUBTREES";
|
|
20
|
+
ErrorCodes[ErrorCodes["FAILED_TO_MERGE_MESSAGE_TREE"] = 14] = "FAILED_TO_MERGE_MESSAGE_TREE";
|
|
21
|
+
ErrorCodes[ErrorCodes["UNSUPPORTED_VOICE_CREDIT_PROXY_FACTORY"] = 15] = "UNSUPPORTED_VOICE_CREDIT_PROXY_FACTORY";
|
|
22
22
|
ErrorCodes[ErrorCodes["UNSUPPORTED_VOICE_CREDIT_PROXY"] = 16] = "UNSUPPORTED_VOICE_CREDIT_PROXY";
|
|
23
23
|
ErrorCodes[ErrorCodes["UNSUPPORTED_POLICY"] = 17] = "UNSUPPORTED_POLICY";
|
|
24
24
|
ErrorCodes[ErrorCodes["FAILED_TO_DEPLOY_CONTRACT"] = 18] = "FAILED_TO_DEPLOY_CONTRACT";
|
|
25
25
|
ErrorCodes[ErrorCodes["FAILED_TO_SET_MACI_INSTANCE_ON_POLICY"] = 19] = "FAILED_TO_SET_MACI_INSTANCE_ON_POLICY";
|
|
26
26
|
ErrorCodes[ErrorCodes["MACI_NOT_DEPLOYED"] = 20] = "MACI_NOT_DEPLOYED";
|
|
27
27
|
ErrorCodes[ErrorCodes["VERIFIER_NOT_DEPLOYED"] = 21] = "VERIFIER_NOT_DEPLOYED";
|
|
28
|
-
ErrorCodes[ErrorCodes["
|
|
29
|
-
ErrorCodes[ErrorCodes["
|
|
28
|
+
ErrorCodes[ErrorCodes["VERIFYING_KEYS_REGISTRY_NOT_DEPLOYED"] = 22] = "VERIFYING_KEYS_REGISTRY_NOT_DEPLOYED";
|
|
29
|
+
ErrorCodes[ErrorCodes["FAILED_TO_SET_VERIFYING_KEYS"] = 23] = "FAILED_TO_SET_VERIFYING_KEYS";
|
|
30
30
|
ErrorCodes[ErrorCodes["FAILED_TO_DEPLOY_MACI"] = 24] = "FAILED_TO_DEPLOY_MACI";
|
|
31
31
|
ErrorCodes[ErrorCodes["FAILED_TO_DEPLOY_POLL"] = 25] = "FAILED_TO_DEPLOY_POLL";
|
|
32
32
|
ErrorCodes[ErrorCodes["NOT_MERGED_MESSAGE_TREE"] = 26] = "NOT_MERGED_MESSAGE_TREE";
|
|
33
|
+
ErrorCodes[ErrorCodes["FAILED_TO_UPDATE_SCHEDULED_POLL"] = 27] = "FAILED_TO_UPDATE_SCHEDULED_POLL";
|
|
34
|
+
ErrorCodes[ErrorCodes["POLL_ALREADY_SCHEDULED"] = 28] = "POLL_ALREADY_SCHEDULED";
|
|
35
|
+
ErrorCodes[ErrorCodes["POLL_ALREADY_TALLIED"] = 29] = "POLL_ALREADY_TALLIED";
|
|
33
36
|
})(ErrorCodes || (ErrorCodes = {}));
|
|
34
37
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../ts/common/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../ts/common/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,UA+BX;AA/BD,WAAY,UAAU;IACpB,6EAAqB,CAAA;IACrB,2EAAoB,CAAA;IACpB,+DAAc,CAAA;IACd,uDAAU,CAAA;IACV,uDAAU,CAAA;IACV,+DAAc,CAAA;IACd,iEAAe,CAAA;IACf,6FAA6B,CAAA;IAC7B,6EAAqB,CAAA;IACrB,mEAAgB,CAAA;IAChB,0EAAmB,CAAA;IACnB,0FAA2B,CAAA;IAC3B,wFAA0B,CAAA;IAC1B,oGAAgC,CAAA;IAChC,4FAA4B,CAAA;IAC5B,gHAAsC,CAAA;IACtC,gGAA8B,CAAA;IAC9B,wEAAkB,CAAA;IAClB,sFAAyB,CAAA;IACzB,8GAAqC,CAAA;IACrC,sEAAiB,CAAA;IACjB,8EAAqB,CAAA;IACrB,4GAAoC,CAAA;IACpC,4FAA4B,CAAA;IAC5B,8EAAqB,CAAA;IACrB,8EAAqB,CAAA;IACrB,kFAAuB,CAAA;IACvB,kGAA+B,CAAA;IAC/B,gFAAsB,CAAA;IACtB,4EAAoB,CAAA;AACtB,CAAC,EA/BW,UAAU,KAAV,UAAU,QA+BrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../ts/common/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,CAiD7D"}
|