@maci-protocol/coordinator 0.0.0-ci.e0aedb2 → 0.0.0-ci.e47bd6e
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/LICENSE +1 -2
- package/README.md +13 -6
- package/build/hardhat.config.cjs +3 -0
- package/build/hardhat.config.cjs.map +1 -1
- package/build/hardhat.config.d.cts +3 -0
- package/build/scripts/generateMaciKeyPair.js +2 -2
- package/build/scripts/generateMaciKeyPair.js.map +1 -1
- package/build/tests/constants.d.ts +0 -1
- package/build/tests/constants.d.ts.map +1 -1
- package/build/tests/constants.js +0 -1
- package/build/tests/constants.js.map +1 -1
- package/build/tests/e2e.aa.test.js +17 -22
- package/build/tests/e2e.aa.test.js.map +1 -1
- package/build/tests/e2e.deploy.test.js +119 -82
- package/build/tests/e2e.deploy.test.js.map +1 -1
- package/build/tests/utils.d.ts +6 -0
- package/build/tests/utils.d.ts.map +1 -1
- package/build/tests/utils.js +12 -3
- package/build/tests/utils.js.map +1 -1
- package/build/ts/common/__tests__/common.test.js +7 -11
- package/build/ts/common/__tests__/common.test.js.map +1 -1
- package/build/ts/common/accountAbstraction.d.ts +2 -19
- package/build/ts/common/accountAbstraction.d.ts.map +1 -1
- package/build/ts/common/accountAbstraction.js +15 -44
- package/build/ts/common/accountAbstraction.js.map +1 -1
- package/build/ts/common/chain.d.ts +16 -0
- package/build/ts/common/chain.d.ts.map +1 -0
- package/build/ts/common/chain.js +35 -0
- package/build/ts/common/chain.js.map +1 -0
- package/build/ts/common/errors.d.ts +17 -18
- package/build/ts/common/errors.d.ts.map +1 -1
- package/build/ts/common/errors.js +17 -18
- package/build/ts/common/errors.js.map +1 -1
- package/build/ts/common/index.d.ts +2 -0
- package/build/ts/common/index.d.ts.map +1 -1
- package/build/ts/common/index.js +2 -0
- package/build/ts/common/index.js.map +1 -1
- package/build/ts/common/types.d.ts +2 -3
- package/build/ts/common/types.d.ts.map +1 -1
- package/build/ts/deployer/__tests__/deployer.service.test.js +30 -289
- package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -1
- package/build/ts/deployer/__tests__/utils.d.ts +30 -1
- package/build/ts/deployer/__tests__/utils.d.ts.map +1 -1
- package/build/ts/deployer/__tests__/utils.js +46 -11
- package/build/ts/deployer/__tests__/utils.js.map +1 -1
- package/build/ts/deployer/deployer.service.d.ts +17 -53
- package/build/ts/deployer/deployer.service.d.ts.map +1 -1
- package/build/ts/deployer/deployer.service.js +174 -461
- package/build/ts/deployer/deployer.service.js.map +1 -1
- package/build/ts/deployer/dto.d.ts +4 -4
- package/build/ts/deployer/dto.d.ts.map +1 -1
- package/build/ts/deployer/dto.js +9 -1
- package/build/ts/deployer/dto.js.map +1 -1
- package/build/ts/deployer/types.d.ts +62 -24
- 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 +14 -9
- 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/proof/__tests__/proof.controller.test.js +5 -2
- package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -1
- package/build/ts/proof/__tests__/proof.gateway.test.js +6 -2
- package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -1
- package/build/ts/proof/__tests__/proof.service.test.js +12 -10
- package/build/ts/proof/__tests__/proof.service.test.js.map +1 -1
- package/build/ts/proof/dto.d.ts +13 -11
- package/build/ts/proof/dto.d.ts.map +1 -1
- package/build/ts/proof/dto.js +51 -29
- 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.map +1 -1
- package/build/ts/proof/proof.service.d.ts +3 -3
- package/build/ts/proof/proof.service.d.ts.map +1 -1
- package/build/ts/proof/proof.service.js +40 -120
- package/build/ts/proof/proof.service.js.map +1 -1
- package/build/ts/proof/types.d.ts +18 -10
- package/build/ts/proof/types.d.ts.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 +13 -2
- package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -1
- package/build/ts/sessionKeys/sessionKeys.service.js +22 -4
- package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +30 -30
- 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/tests/utils.js
CHANGED
|
@@ -8,17 +8,26 @@ import { ESupportedNetworks } from "../ts/common";
|
|
|
8
8
|
import { getPublicClient } from "../ts/common/accountAbstraction";
|
|
9
9
|
import { CryptoService } from "../ts/crypto/crypto.service";
|
|
10
10
|
dotenv.config();
|
|
11
|
+
/**
|
|
12
|
+
* Encrypt a message using the coordinator's public key
|
|
13
|
+
* @param message to encrypt
|
|
14
|
+
* @returns encrypted message (ciphertext)
|
|
15
|
+
*/
|
|
16
|
+
export const encryptWithCoordinatorRSAPublicKey = async (message) => {
|
|
17
|
+
const cryptoService = new CryptoService();
|
|
18
|
+
const publicKey = await fs.promises.readFile(process.env.COORDINATOR_PUBLIC_KEY_PATH);
|
|
19
|
+
return cryptoService.encrypt(publicKey, message);
|
|
20
|
+
};
|
|
11
21
|
/**
|
|
12
22
|
* Sign a message with a wallet and encrypt it using the coordinator's public key
|
|
13
23
|
* @param signer
|
|
14
24
|
* @returns Authorization header
|
|
15
25
|
*/
|
|
16
26
|
export const getAuthorizationHeader = async (signer) => {
|
|
17
|
-
const cryptoService = new CryptoService();
|
|
18
|
-
const publicKey = await fs.promises.readFile(process.env.COORDINATOR_PUBLIC_KEY_PATH);
|
|
19
27
|
const signature = await signer.signMessage("message");
|
|
20
28
|
const digest = Buffer.from(getBytes(hashMessage("message"))).toString("hex");
|
|
21
|
-
|
|
29
|
+
const encrypted = await encryptWithCoordinatorRSAPublicKey(`${signature}:${digest}`);
|
|
30
|
+
return `Bearer ${encrypted}`;
|
|
22
31
|
};
|
|
23
32
|
/**
|
|
24
33
|
* Reloads with ETH in case the smart account is out of gas (less than 0.05)
|
package/build/tests/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../tests/utils.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAe,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAO,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB;;;;GAIG;AACH,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../tests/utils.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO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AC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,OAAY,EACZ,mBAA2B,EAC3B,kBAA0B,EACX,EAAE;IACjB,MAAM,YAAY,GAAG,eAAe,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3D,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,cAAc,IAAI,mBAAmB,EAAE,CAAC;QAC1C,MAAM,WAAW,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAwB,CAAC,CAAC;QAC9E,MAAM,YAAY,GAAG,kBAAkB,CAAC;YACtC,KAAK,EAAE,eAAe;YACtB,SAAS,EAAE,IAAI,EAAE;SAClB,CAAC,CAAC;QACH,MAAM,YAAY,CAAC,eAAe,CAAC;YACjC,OAAO,EAAE,WAAW;YACpB,EAAE,EAAE,OAAO;YACX,KAAK,EAAE,UAAU,CAAC,kBAAkB,CAAC;SACtC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mainnet, sepolia, arbitrum, arbitrumSepolia, baseSepolia, lineaSepolia, scrollSepolia, scroll, base, holesky, linea, bsc, gnosis, polygon, optimism, optimismSepolia, } from "viem/chains";
|
|
2
|
-
import {
|
|
2
|
+
import { getBundlerClient, getPublicClient, getZeroDevBundlerRPCUrl } from "../accountAbstraction";
|
|
3
|
+
import { getAlchemyRpcUrl } from "../chain";
|
|
3
4
|
import { ErrorCodes } from "../errors";
|
|
4
5
|
import { ESupportedNetworks, viemChain } from "../networks";
|
|
5
6
|
describe("common", () => {
|
|
@@ -28,28 +29,23 @@ describe("common", () => {
|
|
|
28
29
|
expect(() => getBundlerClient("Unsupported")).toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
29
30
|
});
|
|
30
31
|
});
|
|
31
|
-
describe("
|
|
32
|
+
describe("getAlchemyRpcUrl", () => {
|
|
32
33
|
test("should return the correct RPCUrl for optimism-sepolia", () => {
|
|
33
|
-
const rpcUrl =
|
|
34
|
+
const rpcUrl = getAlchemyRpcUrl(ESupportedNetworks.OPTIMISM_SEPOLIA);
|
|
34
35
|
expect(rpcUrl).toBeDefined();
|
|
35
36
|
expect(rpcUrl).toContain("https://opt-sepolia.g.alchemy.com/v2/");
|
|
36
37
|
});
|
|
37
38
|
test("should return the correct RPCUrl for sepolia", () => {
|
|
38
|
-
const rpcUrl =
|
|
39
|
+
const rpcUrl = getAlchemyRpcUrl(ESupportedNetworks.ETHEREUM_SEPOLIA);
|
|
39
40
|
expect(rpcUrl).toBeDefined();
|
|
40
41
|
expect(rpcUrl).toContain("https://eth-sepolia.g.alchemy.com/v2/");
|
|
41
42
|
});
|
|
42
43
|
test("should throw when given an unsupported network", () => {
|
|
43
|
-
expect(() =>
|
|
44
|
+
expect(() => getAlchemyRpcUrl(ESupportedNetworks.GNOSIS_CHAIN)).toThrow(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
44
45
|
});
|
|
45
46
|
test("should throw when ALCHEMY_API_KEY is not set", () => {
|
|
46
47
|
delete process.env.RPC_API_KEY;
|
|
47
|
-
expect(() =>
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
describe("getDeployedContractAddress", () => {
|
|
51
|
-
test("should throw when the log is undefined", () => {
|
|
52
|
-
expect(() => getDeployedContractAddress({})).toThrow();
|
|
48
|
+
expect(() => getAlchemyRpcUrl(ESupportedNetworks.OPTIMISM_SEPOLIA)).toThrow(ErrorCodes.RPC_API_KEY_NOT_SET.toString());
|
|
53
49
|
});
|
|
54
50
|
});
|
|
55
51
|
describe("viemChain", () => {
|
|
@@ -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,OAAO,EACP,KAAK,EACL,GAAG,EACH,MAAM,EACN,OAAO,EACP,QAAQ,EACR,eAAe,GAChB,MAAM,aAAa,CAAC;
|
|
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,OAAO,EACP,KAAK,EACL,GAAG,EACH,MAAM,EACN,OAAO,EACP,QAAQ,EACR,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE5D,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;YACzC,MAAM,YAAY,GAAG,eAAe,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;YAC1E,MAAM,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QACrC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,gDAAgD,EAAE,GAAG,EAAE;YAC1D,MAAM,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,aAAmC,CAAC,CAAC,CAAC,OAAO,CACxE,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAC1C,CAA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CAAC,eAAe,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,4CAA4C,EAAE,GAAG,EAAE;YACtD,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,qBAA2C,CAAC,CAAC,CAAC,OAAO,CAC1E,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAC1C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { type Hex
|
|
1
|
+
import { type Hex } from "viem";
|
|
2
|
+
import type { BundlerClientType, KernelClientType, PublicClientHTTPType } from "./types";
|
|
2
3
|
import { ESupportedNetworks } from "./networks";
|
|
3
|
-
import { KernelClientType, BundlerClientType, PublicClientHTTPType } from "./types";
|
|
4
|
-
/**
|
|
5
|
-
* Generate the RPCUrl for Alchemy based on the chain we need to interact with
|
|
6
|
-
*
|
|
7
|
-
* @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;
|
|
11
4
|
/**
|
|
12
5
|
* Get a public client
|
|
13
6
|
*
|
|
@@ -29,20 +22,10 @@ export declare const getZeroDevBundlerRPCUrl: (network: ESupportedNetworks) => s
|
|
|
29
22
|
* @returns the bundler client
|
|
30
23
|
*/
|
|
31
24
|
export declare const getBundlerClient: (chainName: ESupportedNetworks) => BundlerClientType;
|
|
32
|
-
/**
|
|
33
|
-
* The topic for the contract creation event
|
|
34
|
-
*/
|
|
35
|
-
export declare const contractCreationEventTopic = "0x4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b511";
|
|
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
|
*
|
|
@@ -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":"AAKA,OAAO,EAA4B,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAI1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAIzF,OAAO,EAAE,kBAAkB,EAAa,MAAM,YAAY,CAAC;AAI3D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,kBAAkB,KAAG,oBAI5D,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,kBAAkB,KAAG,MASrE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,WAAW,kBAAkB,KAAG,iBAI7D,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,YAAY,GAAG,EACf,UAAU,MAAM,EAChB,OAAO,kBAAkB,KACxB,OAAO,CAAC,gBAAgB,CA2B1B,CAAC"}
|
|
@@ -3,32 +3,13 @@ import { toECDSASigner } from "@zerodev/permissions/signers";
|
|
|
3
3
|
import { createKernelAccountClient } from "@zerodev/sdk";
|
|
4
4
|
import { getEntryPoint, KERNEL_V3_1 } from "@zerodev/sdk/constants";
|
|
5
5
|
import dotenv from "dotenv";
|
|
6
|
-
import { createBundlerClient, ENTRYPOINT_ADDRESS_V07 } from "permissionless";
|
|
7
6
|
import { createPublicClient, http } from "viem";
|
|
7
|
+
import { createBundlerClient } from "viem/account-abstraction";
|
|
8
8
|
import { privateKeyToAccount } from "viem/accounts";
|
|
9
|
+
import { getAlchemyRpcUrl } from "./chain";
|
|
9
10
|
import { ErrorCodes } from "./errors";
|
|
10
11
|
import { ESupportedNetworks, viemChain } from "./networks";
|
|
11
12
|
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
13
|
/**
|
|
33
14
|
* Get a public client
|
|
34
15
|
*
|
|
@@ -36,7 +17,7 @@ export const genAlchemyRPCUrl = (network) => {
|
|
|
36
17
|
* @returns the public client
|
|
37
18
|
*/
|
|
38
19
|
export const getPublicClient = (chainName) => createPublicClient({
|
|
39
|
-
transport: http(
|
|
20
|
+
transport: http(getAlchemyRpcUrl(chainName)),
|
|
40
21
|
chain: viemChain(chainName),
|
|
41
22
|
});
|
|
42
23
|
/**
|
|
@@ -64,26 +45,11 @@ export const getZeroDevBundlerRPCUrl = (network) => {
|
|
|
64
45
|
export const getBundlerClient = (chainName) => createBundlerClient({
|
|
65
46
|
transport: http(getZeroDevBundlerRPCUrl(chainName)),
|
|
66
47
|
chain: viemChain(chainName),
|
|
67
|
-
entryPoint: ENTRYPOINT_ADDRESS_V07,
|
|
68
48
|
});
|
|
69
|
-
/**
|
|
70
|
-
* The topic for the contract creation event
|
|
71
|
-
*/
|
|
72
|
-
export const contractCreationEventTopic = "0x4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b511";
|
|
73
49
|
/**
|
|
74
50
|
* The offset for the address in the contract creation event
|
|
75
51
|
*/
|
|
76
52
|
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
53
|
/**
|
|
88
54
|
* Get a Kernel account handle given a session key
|
|
89
55
|
*
|
|
@@ -99,12 +65,17 @@ export const getKernelClient = async (sessionKey, approval, chain) => {
|
|
|
99
65
|
const sessionKeySigner = await toECDSASigner({
|
|
100
66
|
signer: privateKeyToAccount(sessionKey),
|
|
101
67
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
68
|
+
try {
|
|
69
|
+
const sessionKeyAccount = await deserializePermissionAccount(publicClient, getEntryPoint("0.7"), KERNEL_V3_1, approval, sessionKeySigner);
|
|
70
|
+
const kernelClient = createKernelAccountClient({
|
|
71
|
+
bundlerTransport: http(bundlerUrl),
|
|
72
|
+
account: sessionKeyAccount,
|
|
73
|
+
chain: viemChain(chain),
|
|
74
|
+
});
|
|
75
|
+
return kernelClient;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
throw new Error(ErrorCodes.INVALID_APPROVAL.toString());
|
|
79
|
+
}
|
|
109
80
|
};
|
|
110
81
|
//# 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,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,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO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,CAAC;IAClD,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAE5C,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;QACF,MAAM,YAAY,GAAG,yBAAyB,CAAC;YAC7C,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC;YAClC,OAAO,EAAE,iBAAiB;YAC1B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC;SACxB,CAAC,CAAC;QAEH,OAAO,YAAY,CAAC;IACtB,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,16 @@
|
|
|
1
|
+
import { Signer } from "ethers";
|
|
2
|
+
import { ESupportedNetworks } from "./networks";
|
|
3
|
+
/**
|
|
4
|
+
* Get the RPCUrl for Alchemy based on the chain we need to interact with
|
|
5
|
+
*
|
|
6
|
+
* @param network - the network we want to interact with
|
|
7
|
+
* @returns the RPCUrl for the network
|
|
8
|
+
*/
|
|
9
|
+
export declare const getAlchemyRpcUrl: (network: ESupportedNetworks) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Get a Ethers Signer given a chain and private key
|
|
12
|
+
* @param chain
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare const getSigner: (chain: ESupportedNetworks) => Signer;
|
|
16
|
+
//# 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,EAAmB,MAAM,EAAU,MAAM,QAAQ,CAAC;AAGzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,kBAAkB,KAAG,MAe9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,kBAAkB,KAAG,MAMrD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JsonRpcProvider, Wallet } from "ethers";
|
|
2
|
+
import { ErrorCodes } from "./errors";
|
|
3
|
+
import { ESupportedNetworks } from "./networks";
|
|
4
|
+
/**
|
|
5
|
+
* Get the RPCUrl for Alchemy based on the chain we need to interact with
|
|
6
|
+
*
|
|
7
|
+
* @param network - the network we want to interact with
|
|
8
|
+
* @returns the RPCUrl for the network
|
|
9
|
+
*/
|
|
10
|
+
export const getAlchemyRpcUrl = (network) => {
|
|
11
|
+
const apiKey = process.env.RPC_API_KEY;
|
|
12
|
+
if (!apiKey) {
|
|
13
|
+
throw new Error(ErrorCodes.RPC_API_KEY_NOT_SET.toString());
|
|
14
|
+
}
|
|
15
|
+
switch (network) {
|
|
16
|
+
case ESupportedNetworks.OPTIMISM_SEPOLIA:
|
|
17
|
+
return `https://opt-sepolia.g.alchemy.com/v2/${apiKey}`;
|
|
18
|
+
case ESupportedNetworks.ETHEREUM_SEPOLIA:
|
|
19
|
+
return `https://eth-sepolia.g.alchemy.com/v2/${apiKey}`;
|
|
20
|
+
default:
|
|
21
|
+
throw new Error(ErrorCodes.UNSUPPORTED_NETWORK.toString());
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Get a Ethers Signer given a chain and private key
|
|
26
|
+
* @param chain
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export const getSigner = (chain) => {
|
|
30
|
+
const wallet = new Wallet(process.env.PRIVATE_KEY);
|
|
31
|
+
const alchemyRpcUrl = getAlchemyRpcUrl(chain);
|
|
32
|
+
const provider = new JsonRpcProvider(alchemyRpcUrl);
|
|
33
|
+
return wallet.connect(provider);
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../ts/common/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAA2B,EAAU,EAAE;IACtE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IAEvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,kBAAkB,CAAC,gBAAgB;YACtC,OAAO,wCAAwC,MAAM,EAAE,CAAC;QAC1D,KAAK,kBAAkB,CAAC,gBAAgB;YACtC,OAAO,wCAAwC,MAAM,EAAE,CAAC;QAC1D;YACE,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAU,EAAE;IAC7D,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAY,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC;IAEpD,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC,CAAC"}
|
|
@@ -11,23 +11,22 @@ 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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
NOT_MERGED_MESSAGE_TREE = 26
|
|
14
|
+
INVALID_APPROVAL = 9,
|
|
15
|
+
UNSUPPORTED_NETWORK = 10,
|
|
16
|
+
RPC_API_KEY_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 = 15,
|
|
21
|
+
UNSUPPORTED_POLICY = 16,
|
|
22
|
+
FAILED_TO_DEPLOY_CONTRACT = 17,
|
|
23
|
+
FAILED_TO_SET_MACI_INSTANCE_ON_POLICY = 18,
|
|
24
|
+
MACI_NOT_DEPLOYED = 19,
|
|
25
|
+
VERIFIER_NOT_DEPLOYED = 20,
|
|
26
|
+
VERIFYING_KEYS_REGISTRY_NOT_DEPLOYED = 21,
|
|
27
|
+
FAILED_TO_SET_VERIFYING_KEYS = 22,
|
|
28
|
+
FAILED_TO_DEPLOY_MACI = 23,
|
|
29
|
+
FAILED_TO_DEPLOY_POLL = 24,
|
|
30
|
+
NOT_MERGED_MESSAGE_TREE = 25
|
|
32
31
|
}
|
|
33
32
|
//# 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,mBAAmB,KAAA;IACnB,0BAA0B,KAAA;IAC1B,gCAAgC,KAAA;IAChC,4BAA4B,KAAA;IAC5B,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;CACxB"}
|
|
@@ -12,23 +12,22 @@ 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["
|
|
22
|
-
ErrorCodes[ErrorCodes["
|
|
23
|
-
ErrorCodes[ErrorCodes["
|
|
24
|
-
ErrorCodes[ErrorCodes["
|
|
25
|
-
ErrorCodes[ErrorCodes["
|
|
26
|
-
ErrorCodes[ErrorCodes["
|
|
27
|
-
ErrorCodes[ErrorCodes["
|
|
28
|
-
ErrorCodes[ErrorCodes["
|
|
29
|
-
ErrorCodes[ErrorCodes["
|
|
30
|
-
ErrorCodes[ErrorCodes["
|
|
31
|
-
ErrorCodes[ErrorCodes["
|
|
32
|
-
ErrorCodes[ErrorCodes["NOT_MERGED_MESSAGE_TREE"] = 26] = "NOT_MERGED_MESSAGE_TREE";
|
|
15
|
+
ErrorCodes[ErrorCodes["INVALID_APPROVAL"] = 9] = "INVALID_APPROVAL";
|
|
16
|
+
ErrorCodes[ErrorCodes["UNSUPPORTED_NETWORK"] = 10] = "UNSUPPORTED_NETWORK";
|
|
17
|
+
ErrorCodes[ErrorCodes["RPC_API_KEY_NOT_SET"] = 11] = "RPC_API_KEY_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"] = 15] = "UNSUPPORTED_VOICE_CREDIT_PROXY";
|
|
22
|
+
ErrorCodes[ErrorCodes["UNSUPPORTED_POLICY"] = 16] = "UNSUPPORTED_POLICY";
|
|
23
|
+
ErrorCodes[ErrorCodes["FAILED_TO_DEPLOY_CONTRACT"] = 17] = "FAILED_TO_DEPLOY_CONTRACT";
|
|
24
|
+
ErrorCodes[ErrorCodes["FAILED_TO_SET_MACI_INSTANCE_ON_POLICY"] = 18] = "FAILED_TO_SET_MACI_INSTANCE_ON_POLICY";
|
|
25
|
+
ErrorCodes[ErrorCodes["MACI_NOT_DEPLOYED"] = 19] = "MACI_NOT_DEPLOYED";
|
|
26
|
+
ErrorCodes[ErrorCodes["VERIFIER_NOT_DEPLOYED"] = 20] = "VERIFIER_NOT_DEPLOYED";
|
|
27
|
+
ErrorCodes[ErrorCodes["VERIFYING_KEYS_REGISTRY_NOT_DEPLOYED"] = 21] = "VERIFYING_KEYS_REGISTRY_NOT_DEPLOYED";
|
|
28
|
+
ErrorCodes[ErrorCodes["FAILED_TO_SET_VERIFYING_KEYS"] = 22] = "FAILED_TO_SET_VERIFYING_KEYS";
|
|
29
|
+
ErrorCodes[ErrorCodes["FAILED_TO_DEPLOY_MACI"] = 23] = "FAILED_TO_DEPLOY_MACI";
|
|
30
|
+
ErrorCodes[ErrorCodes["FAILED_TO_DEPLOY_POLL"] = 24] = "FAILED_TO_DEPLOY_POLL";
|
|
31
|
+
ErrorCodes[ErrorCodes["NOT_MERGED_MESSAGE_TREE"] = 25] = "NOT_MERGED_MESSAGE_TREE";
|
|
33
32
|
})(ErrorCodes || (ErrorCodes = {}));
|
|
34
33
|
//# 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,UA2BX;AA3BD,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,0EAAmB,CAAA;IACnB,wFAA0B,CAAA;IAC1B,oGAAgC,CAAA;IAChC,4FAA4B,CAAA;IAC5B,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;AACzB,CAAC,EA3BW,UAAU,KAAV,UAAU,QA2BrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC"}
|
package/build/ts/common/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CreateKernelAccountReturnType, KernelAccountClient } from "@zerodev/sdk";
|
|
2
|
-
import { BundlerClient } from "
|
|
3
|
-
import { ENTRYPOINT_ADDRESS_V07_TYPE } from "permissionless/types";
|
|
2
|
+
import { BundlerClient } from "viem/account-abstraction";
|
|
4
3
|
import type { Chain, HttpTransport, PublicClient, Transport } from "viem";
|
|
5
4
|
export type KernelClientType = KernelAccountClient<Transport, Chain, CreateKernelAccountReturnType>;
|
|
6
|
-
export type BundlerClientType = BundlerClient
|
|
5
|
+
export type BundlerClientType = BundlerClient;
|
|
7
6
|
export type PublicClientType = PublicClient<Transport, Chain>;
|
|
8
7
|
export type PublicClientHTTPType = PublicClient<HttpTransport, Chain>;
|
|
9
8
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,SAAS,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC;AAEpG,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC"}
|