@zerodev/sdk 4.0.30 → 4.0.31

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.
@@ -8,25 +8,8 @@ export declare class ZeroDevEthersProvider<V extends SupportedValidators> extend
8
8
  constructor(validatorType: V, params: ValidatorProviderParamsMap[V]);
9
9
  static init<V extends SupportedValidators>(validatorType: V, params: ValidatorProviderParamsMap[V]): Promise<ZeroDevEthersProvider<V>>;
10
10
  getAccountProvider(): ValidatorProviderTypeMap[V];
11
- /**
12
- * Rewrites the send method to use the account provider's EIP-1193
13
- * compliant request method
14
- *
15
- * @param method - the RPC method to call
16
- * @param params - the params required by the RPC method
17
- * @returns the result of the RPC call
18
- */
19
11
  send(method: string, params: any[]): Promise<any>;
20
- /**
21
- * Connects the Provider to an Account and returns a Signer
22
- *
23
- * @param fn - a function that takes the account provider's rpcClient and returns a BaseSmartContractAccount
24
- * @returns an {@link ZeroDevAccountSigner} that can be used to sign and send user operations
25
- */
26
12
  connectToAccount(fn: (rpcClient: PublicErc4337Client) => BaseSmartContractAccount): ZeroDevAccountSigner<V>;
27
- /**
28
- * @returns an {@link ZeroDevAccountSigner} using this as the underlying provider
29
- */
30
13
  getAccountSigner(): ZeroDevAccountSigner<V>;
31
14
  withPaymasterMiddleware: (overrides: {
32
15
  dummyPaymasterDataMiddleware?: PaymasterAndDataMiddleware;
@@ -1 +1 @@
1
- {"version":3,"file":"ethers-provider.d.ts","sourceRoot":"","sources":["../../../../src/kernel-zerodev/ethers-provider/ethers-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAExB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B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AAgB,aAAc,sBAAsB,KAAG,IAAI,CAGzD;IAEF,iBAAiB,aAAc,iBAAiB,KAAG,IAAI,CAGrD;IAEF,oBAAoB,aAAc,mBAAmB,KAAG,IAAI,CAG1D;IAEF,sBAAsB,IAAI,mBAAmB;CAG9C"}
@@ -2,10 +2,6 @@ import type { ZeroDevProvider } from "../provider.js";
2
2
  import { type UserOperationStruct, type BigNumberish } from "@alchemy/aa-core";
3
3
  export declare const withZeroDevGasEstimator: (provider: ZeroDevProvider) => ZeroDevProvider;
4
4
  export declare const estimateCreationGas: (provider: ZeroDevProvider, initCode?: string) => Promise<bigint>;
5
- /**
6
- * should cover cost of putting calldata on-chain, and some overhead.
7
- * actual overhead depends on the expected bundle size
8
- */
9
5
  export declare const getPreVerificationGas: (userOp: Partial<UserOperationStruct>) => Promise<number>;
10
6
  export declare const eip1559GasPrice: (provider: ZeroDevProvider) => Promise<{
11
7
  maxFeePerGas: bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"gas-estimator.d.ts","sourceRoot":"","sources":["../../../../src/kernel-zerodev/middleware/gas-estimator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAGL,KAAK,mBAAmB,EAExB,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAC;AAI1B,eAAO,MAAM,uBAAuB,aACxB,eAAe,KACxB,eAmFF,CAAC;AAEF,eAAO,MAAM,mBAAmB,aACpB,eAAe,aACd,MAAM,KAChB,QAAQ,MAAM,CAShB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,WACxB,QAAQ,mBAAmB,CAAC,KACnC,QAAQ,MAAM,CAGhB,CAAC;AAEF,eAAO,MAAM,eAAe,aAAoB,eAAe;;;EAkB9D,CAAC;AACF,UAAU,OAAO;IACf,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,oBAAoB,EAAE,YAAY,GAAG,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,UAAU,aACX,eAAe,KACxB,QAAQ,OAAO,CAgCjB,CAAC"}
1
+ {"version":3,"file":"gas-estimator.d.ts","sourceRoot":"","sources":["../../../../src/kernel-zerodev/middleware/gas-estimator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAGL,KAAK,mBAAmB,EAExB,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAC;AAI1B,eAAO,MAAM,uBAAuB,aACxB,eAAe,KACxB,eAmFF,CAAC;AAEF,eAAO,MAAM,mBAAmB,aACpB,eAAe,aACd,MAAM,KAChB,QAAQ,MAAM,CAShB,CAAC;AAMF,eAAO,MAAM,qBAAqB,WACxB,QAAQ,mBAAmB,CAAC,KACnC,QAAQ,MAAM,CAGhB,CAAC;AAEF,eAAO,MAAM,eAAe,aAAoB,eAAe;;;EAkB9D,CAAC;AACF,UAAU,OAAO;IACf,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,oBAAoB,EAAE,YAAY,GAAG,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,UAAU,aACX,eAAe,KACxB,QAAQ,OAAO,CAgCjB,CAAC"}
@@ -3,7 +3,6 @@ export type Hex = `0x${string}`;
3
3
  export type Hash = `0x${string}`;
4
4
  export type LogTopic = Hex | Hex[] | null;
5
5
  export type SignableMessage = string | {
6
- /** Raw data representation of the message. */
7
6
  raw: Hex | ByteArray;
8
7
  };
9
8
  export type Signature = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/kernel-zerodev/owner/passkey/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AACnC,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAChC,MAAM,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;AACjC,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;AAC1C,MAAM,MAAM,eAAe,GACvB,MAAM,GACN;IACE,8CAA8C;IAC9C,GAAG,EAAE,GAAG,GAAG,SAAS,CAAC;CACtB,CAAC;AACN,MAAM,MAAM,SAAS,GAAG;IAEtB,CAAC,EAAE,GAAG,CAAC;IAEP,CAAC,EAAE,GAAG,CAAC;IAEP,CAAC,EAAE,MAAM,CAAC;CACX,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/kernel-zerodev/owner/passkey/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AACnC,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAChC,MAAM,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;AACjC,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC;AAC1C,MAAM,MAAM,eAAe,GACvB,MAAM,GACN;IAEE,GAAG,EAAE,GAAG,GAAG,SAAS,CAAC;CACtB,CAAC;AACN,MAAM,MAAM,SAAS,GAAG;IAEtB,CAAC,EAAE,GAAG,CAAC;IAEP,CAAC,EAAE,GAAG,CAAC;IAEP,CAAC,EAAE,MAAM,CAAC;CACX,CAAC"}
@@ -1,18 +1,6 @@
1
1
  import { type UserOperationRequest, type UserOperationStruct } from "@alchemy/aa-core";
2
2
  import type { NotPromise } from "./calc-pre-verification-gas.js";
3
- /**
4
- * pack the userOperation
5
- * @param op
6
- * @param forSignature "true" if the hash is needed to calculate the getUserOpHash()
7
- * "false" to pack entire UserOp, for calculating the calldata cost of putting it on-chain.
8
- */
9
3
  export declare function packUserOp(op: NotPromise<UserOperationStruct>, forSignature?: boolean): string;
10
- /**
11
- * Utility method for asserting a {@link UserOperationStruct} is a {@link UserOperationRequest}
12
- *
13
- * @param request a {@link UserOperationStruct} to validate
14
- * @returns a type guard that asserts the {@link UserOperationStruct} is a {@link UserOperationRequest}
15
- */
16
4
  export declare function isValidRequest(request: UserOperationStruct): request is UserOperationRequest;
17
5
  export declare const hexifyUserOp: (resolvedUserOp: any) => {};
18
6
  //# sourceMappingURL=ERC4337-utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ERC4337-utils.d.ts","sourceRoot":"","sources":["../../../../src/kernel-zerodev/utils/ERC4337-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAmCjE;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,UAAU,CAAC,mBAAmB,CAAC,EACnC,YAAY,UAAO,GAClB,MAAM,CA0ER;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,IAAI,oBAAoB,CASjC;AAED,eAAO,MAAM,YAAY,mBAAoB,GAAG,OAgB/C,CAAC"}
1
+ {"version":3,"file":"ERC4337-utils.d.ts","sourceRoot":"","sources":["../../../../src/kernel-zerodev/utils/ERC4337-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAyCjE,wBAAgB,UAAU,CACxB,EAAE,EAAE,UAAU,CAAC,mBAAmB,CAAC,EACnC,YAAY,UAAO,GAClB,MAAM,CA0ER;AAQD,wBAAgB,cAAc,CAC5B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,IAAI,oBAAoB,CASjC;AAED,eAAO,MAAM,YAAY,mBAAoB,GAAG,OAgB/C,CAAC"}
@@ -1,44 +1,16 @@
1
1
  import type { UserOperationStruct } from "@alchemy/aa-core";
2
2
  export interface GasOverheads {
3
- /**
4
- * fixed overhead for entire handleOp bundle.
5
- */
6
3
  fixed: number;
7
- /**
8
- * per userOp overhead, added on top of the above fixed per-bundle.
9
- */
10
4
  perUserOp: number;
11
- /**
12
- * overhead for userOp word (32 bytes) block
13
- */
14
5
  perUserOpWord: number;
15
- /**
16
- * zero byte cost, for calldata gas cost calculations
17
- */
18
6
  zeroByte: number;
19
- /**
20
- * non-zero byte cost, for calldata gas cost calculations
21
- */
22
7
  nonZeroByte: number;
23
- /**
24
- * expected bundle size, to split per-bundle overhead between all ops.
25
- */
26
8
  bundleSize: number;
27
- /**
28
- * expected length of the userOp signature.
29
- */
30
9
  sigSize: number;
31
10
  }
32
11
  export declare const DefaultGasOverheads: GasOverheads;
33
12
  export type NotPromise<T> = {
34
13
  [P in keyof T]: Exclude<T[P], Promise<any>>;
35
14
  };
36
- /**
37
- * calculate the preVerificationGas of the given UserOperation
38
- * preVerificationGas (by definition) is the cost overhead that can't be calculated on-chain.
39
- * it is based on parameters that are defined by the Ethereum protocol for external transactions.
40
- * @param userOp filled userOp to calculate. The only possible missing fields can be the signature and preVerificationGas itself
41
- * @param overheads gas overheads to use, to override the default values
42
- */
43
15
  export declare function calcPreVerificationGas(userOp: Partial<NotPromise<UserOperationStruct>>, overheads?: Partial<GasOverheads>): number;
44
16
  //# sourceMappingURL=calc-pre-verification-gas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"calc-pre-verification-gas.d.ts","sourceRoot":"","sources":["../../../../src/kernel-zerodev/utils/calc-pre-verification-gas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAItB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,WAAW,EA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,YAAY,CAAC,GAChC,MAAM,CAoBR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodev/sdk",
3
- "version": "4.0.30",
3
+ "version": "4.0.31",
4
4
  "description": "A collection of ERC-4337 compliant smart contract account interfaces",
5
5
  "author": "ZeroDev",
6
6
  "license": "MIT",
@@ -36,8 +36,8 @@
36
36
  },
37
37
  "scripts": {
38
38
  "build": "yarn clean && yarn build:cjs && yarn build:esm && yarn build:types",
39
- "build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
40
- "build:esm": "tsc --project tsconfig.build.json --module es2020 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'",
39
+ "build:cjs": "tsc --project tsconfig.build-cjs.json && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
40
+ "build:esm": "tsc --project tsconfig.build.json && echo > ./dist/esm/package.json '{\"type\":\"module\"}'",
41
41
  "build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
42
42
  "clean": "rm -rf ./dist",
43
43
  "test": "vitest",