viem 2.27.1-canary-20250417045626 → 2.27.1
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 +1 -1
- package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
- package/_cjs/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js +313 -0
- package/_cjs/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js.map +1 -0
- package/_cjs/account-abstraction/accounts/implementations/toSoladySmartAccount.js.map +1 -1
- package/_cjs/account-abstraction/accounts/toSmartAccount.js +2 -2
- package/_cjs/account-abstraction/accounts/toSmartAccount.js.map +1 -1
- package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js +7 -1
- package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js +21 -1
- package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
- package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js +2 -2
- package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -1
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -1
- package/_cjs/account-abstraction/constants/abis.js +691 -1
- package/_cjs/account-abstraction/constants/abis.js.map +1 -1
- package/_cjs/account-abstraction/constants/address.js +2 -1
- package/_cjs/account-abstraction/constants/address.js.map +1 -1
- package/_cjs/account-abstraction/index.js +6 -2
- package/_cjs/account-abstraction/index.js.map +1 -1
- package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js +19 -0
- package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -1
- package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js +70 -0
- package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -1
- package/_cjs/constants/address.js +2 -1
- package/_cjs/constants/address.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
- package/_esm/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js +327 -0
- package/_esm/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js.map +1 -0
- package/_esm/account-abstraction/accounts/implementations/toSoladySmartAccount.js.map +1 -1
- package/_esm/account-abstraction/accounts/toSmartAccount.js +2 -2
- package/_esm/account-abstraction/accounts/toSmartAccount.js.map +1 -1
- package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js +7 -1
- package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js +21 -1
- package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
- package/_esm/account-abstraction/actions/bundler/sendUserOperation.js +2 -2
- package/_esm/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -1
- package/_esm/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -1
- package/_esm/account-abstraction/constants/abis.js +690 -0
- package/_esm/account-abstraction/constants/abis.js.map +1 -1
- package/_esm/account-abstraction/constants/address.js +1 -0
- package/_esm/account-abstraction/constants/address.js.map +1 -1
- package/_esm/account-abstraction/index.js +3 -2
- package/_esm/account-abstraction/index.js.map +1 -1
- package/_esm/account-abstraction/utils/formatters/userOperationRequest.js +19 -0
- package/_esm/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -1
- package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js +70 -0
- package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -1
- package/_esm/constants/address.js +1 -0
- package/_esm/constants/address.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts +1 -2
- package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts.map +1 -1
- package/_types/account-abstraction/accounts/implementations/toSimple7702SmartAccount.d.ts +311 -0
- package/_types/account-abstraction/accounts/implementations/toSimple7702SmartAccount.d.ts.map +1 -0
- package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts +1 -2
- package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts.map +1 -1
- package/_types/account-abstraction/accounts/types.d.ts +16 -3
- package/_types/account-abstraction/accounts/types.d.ts.map +1 -1
- package/_types/account-abstraction/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts +23 -6
- package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts.map +1 -1
- package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts +1 -1
- package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts.map +1 -1
- package/_types/account-abstraction/constants/abis.d.ts +830 -0
- package/_types/account-abstraction/constants/abis.d.ts.map +1 -1
- package/_types/account-abstraction/constants/address.d.ts +1 -0
- package/_types/account-abstraction/constants/address.d.ts.map +1 -1
- package/_types/account-abstraction/index.d.ts +3 -2
- package/_types/account-abstraction/index.d.ts.map +1 -1
- package/_types/account-abstraction/types/entryPointVersion.d.ts +1 -1
- package/_types/account-abstraction/types/entryPointVersion.d.ts.map +1 -1
- package/_types/account-abstraction/types/rpc.d.ts +6 -3
- package/_types/account-abstraction/types/rpc.d.ts.map +1 -1
- package/_types/account-abstraction/types/userOperation.d.ts +49 -5
- package/_types/account-abstraction/types/userOperation.d.ts.map +1 -1
- package/_types/account-abstraction/utils/formatters/userOperationRequest.d.ts.map +1 -1
- package/_types/account-abstraction/utils/userOperation/getUserOperationHash.d.ts.map +1 -1
- package/_types/celo/chainConfig.d.ts +14 -14
- package/_types/celo/formatters.d.ts +7 -7
- package/_types/chains/definitions/abstract.d.ts +3 -3
- package/_types/chains/definitions/abstractTestnet.d.ts +3 -3
- package/_types/chains/definitions/celo.d.ts +14 -14
- package/_types/chains/definitions/celoAlfajores.d.ts +14 -14
- package/_types/chains/definitions/playfiAlbireo.d.ts +3 -3
- package/_types/chains/definitions/sophon.d.ts +3 -3
- package/_types/chains/definitions/sophonTestnet.d.ts +3 -3
- package/_types/chains/definitions/treasure.d.ts +3 -3
- package/_types/chains/definitions/treasureTopaz.d.ts +3 -3
- package/_types/chains/definitions/zksync.d.ts +3 -3
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts +3 -3
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts +3 -3
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts +3 -3
- package/_types/chains/definitions/zksyncLocalNode.d.ts +3 -3
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts +3 -3
- package/_types/constants/address.d.ts +1 -0
- package/_types/constants/address.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/types/authorization.d.ts +1 -1
- package/_types/types/authorization.d.ts.map +1 -1
- package/_types/types/misc.d.ts +7 -7
- package/_types/types/misc.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +1 -1
- package/_types/zksync/chainConfig.d.ts +3 -3
- package/_types/zksync/formatters.d.ts +3 -3
- package/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.ts +1 -2
- package/account-abstraction/accounts/implementations/toSimple7702SmartAccount.ts +382 -0
- package/account-abstraction/accounts/implementations/toSoladySmartAccount.ts +1 -2
- package/account-abstraction/accounts/toSmartAccount.ts +2 -2
- package/account-abstraction/accounts/types.ts +26 -2
- package/account-abstraction/actions/bundler/estimateUserOperationGas.ts +8 -1
- package/account-abstraction/actions/bundler/prepareUserOperation.ts +56 -2
- package/account-abstraction/actions/bundler/sendUserOperation.ts +2 -2
- package/account-abstraction/actions/paymaster/getPaymasterData.ts +24 -0
- package/account-abstraction/constants/abis.ts +691 -0
- package/account-abstraction/constants/address.ts +2 -0
- package/account-abstraction/index.ts +12 -1
- package/account-abstraction/types/entryPointVersion.ts +1 -1
- package/account-abstraction/types/rpc.ts +6 -3
- package/account-abstraction/types/userOperation.ts +69 -3
- package/account-abstraction/utils/formatters/userOperationRequest.ts +21 -0
- package/account-abstraction/utils/userOperation/getUserOperationHash.ts +79 -0
- package/constants/address.ts +2 -0
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/types/authorization.ts +1 -1
- package/types/misc.ts +7 -7
@@ -304,10 +304,10 @@ export declare const zksyncSepoliaTestnet: {
|
|
304
304
|
maxPriorityFeePerGas?: undefined | undefined;
|
305
305
|
blobs?: undefined;
|
306
306
|
accessList?: undefined;
|
307
|
-
authorizationList?: undefined;
|
308
307
|
blobVersionedHashes?: undefined;
|
309
308
|
kzg?: undefined;
|
310
309
|
sidecars?: undefined;
|
310
|
+
authorizationList?: undefined;
|
311
311
|
eip712Meta?: undefined | undefined;
|
312
312
|
} | {
|
313
313
|
data?: `0x${string}` | undefined;
|
@@ -323,10 +323,10 @@ export declare const zksyncSepoliaTestnet: {
|
|
323
323
|
maxPriorityFeePerGas?: undefined | undefined;
|
324
324
|
accessList?: import("../../index.js").AccessList | undefined;
|
325
325
|
blobs?: undefined;
|
326
|
-
authorizationList?: undefined;
|
327
326
|
blobVersionedHashes?: undefined;
|
328
327
|
kzg?: undefined;
|
329
328
|
sidecars?: undefined;
|
329
|
+
authorizationList?: undefined;
|
330
330
|
eip712Meta?: undefined | undefined;
|
331
331
|
} | {
|
332
332
|
data?: `0x${string}` | undefined;
|
@@ -342,10 +342,10 @@ export declare const zksyncSepoliaTestnet: {
|
|
342
342
|
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
343
343
|
accessList?: import("../../index.js").AccessList | undefined;
|
344
344
|
blobs?: undefined;
|
345
|
-
authorizationList?: undefined;
|
346
345
|
blobVersionedHashes?: undefined;
|
347
346
|
kzg?: undefined;
|
348
347
|
sidecars?: undefined;
|
348
|
+
authorizationList?: undefined;
|
349
349
|
eip712Meta?: undefined | undefined;
|
350
350
|
} | {
|
351
351
|
type?: "0x3" | undefined;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export declare const entryPoint06Address: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
|
2
2
|
export declare const entryPoint07Address: "0x0000000071727De22E5E9d8BAf0edAc6f37da032";
|
3
|
+
export declare const entryPoint08Address: "0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108";
|
3
4
|
export declare const ethAddress: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
4
5
|
export declare const zeroAddress: "0x0000000000000000000000000000000000000000";
|
5
6
|
//# sourceMappingURL=address.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../constants/address.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,EAC9B,4CAAqD,CAAA;AACvD,eAAO,MAAM,mBAAmB,EAC9B,4CAAqD,CAAA;AAEvD,eAAO,MAAM,UAAU,EAAG,4CAAqD,CAAA;AAE/E,eAAO,MAAM,WAAW,EAAG,4CAAqD,CAAA"}
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../constants/address.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,EAC9B,4CAAqD,CAAA;AACvD,eAAO,MAAM,mBAAmB,EAC9B,4CAAqD,CAAA;AACvD,eAAO,MAAM,mBAAmB,EAC9B,4CAAqD,CAAA;AAEvD,eAAO,MAAM,UAAU,EAAG,4CAAqD,CAAA;AAE/E,eAAO,MAAM,WAAW,EAAG,4CAAqD,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "2.27.1
|
1
|
+
export declare const version = "2.27.1";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../errors/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../errors/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAA"}
|
@@ -8,7 +8,7 @@ export type Authorization<uint32 = number, signed extends boolean = false> = {
|
|
8
8
|
chainId: uint32;
|
9
9
|
/** Nonce of the EOA to delegate to. */
|
10
10
|
nonce: uint32;
|
11
|
-
} & (signed extends true ? Signature : ExactPartial<Signature
|
11
|
+
} & (signed extends true ? Signature<uint32> : ExactPartial<Signature<uint32>>);
|
12
12
|
export type AuthorizationList<uint32 = number, signed extends boolean = false> = readonly Authorization<uint32, signed>[];
|
13
13
|
export type AuthorizationRequest<uint32 = number> = OneOf<{
|
14
14
|
/** Address of the contract to delegate to. */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../types/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAErD,MAAM,MAAM,aAAa,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,SAAS,OAAO,GAAG,KAAK,IAAI;IAC3E,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,CAAC,MAAM,SAAS,IAAI,GAAG,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,CAAA;AAE/
|
1
|
+
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../types/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAErD,MAAM,MAAM,aAAa,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,SAAS,OAAO,GAAG,KAAK,IAAI;IAC3E,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,CAAC,MAAM,SAAS,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAE/E,MAAM,MAAM,iBAAiB,CAC3B,MAAM,GAAG,MAAM,EACf,MAAM,SAAS,OAAO,GAAG,KAAK,IAC5B,SAAS,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;AAE5C,MAAM,MAAM,oBAAoB,CAAC,MAAM,GAAG,MAAM,IAAI,KAAK,CACrD;IACE,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAA;CACjB,GACD;IACE;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAA;CACzB,CACJ,GAAG;IACF,gBAAgB;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,MAAM,GAAG,MAAM,IAAI,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;AAE9E,MAAM,MAAM,uBAAuB,CAAC,MAAM,GAAG,MAAM,IACjD,SAAS,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAA;AAExC,MAAM,MAAM,uBAAuB,GAAG,SAAS;IAC7C,OAAO,EAAE,GAAG;IACZ,OAAO,EAAE,GAAG;IACZ,KAAK,EAAE,GAAG;IACV,OAAO,EAAE,GAAG;IACZ,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;CACP,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG,SAAS,uBAAuB,EAAE,CAAA"}
|
package/_types/types/misc.d.ts
CHANGED
@@ -7,23 +7,23 @@ export type SignableMessage = string | {
|
|
7
7
|
/** Raw data representation of the message. */
|
8
8
|
raw: Hex | ByteArray;
|
9
9
|
};
|
10
|
-
export type SignatureLegacy = {
|
10
|
+
export type SignatureLegacy<bigintType = bigint> = {
|
11
11
|
r: Hex;
|
12
12
|
s: Hex;
|
13
|
-
v:
|
13
|
+
v: bigintType;
|
14
14
|
};
|
15
|
-
export type Signature = OneOf<SignatureLegacy | {
|
15
|
+
export type Signature<numberType = number, bigintType = bigint> = OneOf<SignatureLegacy | {
|
16
16
|
r: Hex;
|
17
17
|
s: Hex;
|
18
18
|
/** @deprecated use `yParity`. */
|
19
|
-
v:
|
20
|
-
yParity?:
|
19
|
+
v: bigintType;
|
20
|
+
yParity?: numberType | undefined;
|
21
21
|
} | {
|
22
22
|
r: Hex;
|
23
23
|
s: Hex;
|
24
24
|
/** @deprecated use `yParity`. */
|
25
|
-
v?:
|
26
|
-
yParity:
|
25
|
+
v?: bigintType | undefined;
|
26
|
+
yParity: numberType;
|
27
27
|
}>;
|
28
28
|
export type CompactSignature = {
|
29
29
|
r: Hex;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../types/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,MAAM,SAAS,GAAG,UAAU,CAAA;AAClC,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAA;AAC/B,MAAM,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAA;AAChC,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI,CAAA;AACzC,MAAM,MAAM,eAAe,GACvB,MAAM,GACN;IACE,8CAA8C;IAC9C,GAAG,EAAE,GAAG,GAAG,SAAS,CAAA;CACrB,CAAA;AACL,MAAM,MAAM,eAAe,GAAG;
|
1
|
+
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../types/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,MAAM,SAAS,GAAG,UAAU,CAAA;AAClC,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAA;AAC/B,MAAM,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAA;AAChC,MAAM,MAAM,QAAQ,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,IAAI,CAAA;AACzC,MAAM,MAAM,eAAe,GACvB,MAAM,GACN;IACE,8CAA8C;IAC9C,GAAG,EAAE,GAAG,GAAG,SAAS,CAAA;CACrB,CAAA;AACL,MAAM,MAAM,eAAe,CAAC,UAAU,GAAG,MAAM,IAAI;IACjD,CAAC,EAAE,GAAG,CAAA;IACN,CAAC,EAAE,GAAG,CAAA;IACN,CAAC,EAAE,UAAU,CAAA;CACd,CAAA;AACD,MAAM,MAAM,SAAS,CAAC,UAAU,GAAG,MAAM,EAAE,UAAU,GAAG,MAAM,IAAI,KAAK,CACnE,eAAe,GACf;IACE,CAAC,EAAE,GAAG,CAAA;IACN,CAAC,EAAE,GAAG,CAAA;IACN,iCAAiC;IACjC,CAAC,EAAE,UAAU,CAAA;IACb,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;CACjC,GACD;IACE,CAAC,EAAE,GAAG,CAAA;IACN,CAAC,EAAE,GAAG,CAAA;IACN,iCAAiC;IACjC,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IAC1B,OAAO,EAAE,UAAU,CAAA;CACpB,CACJ,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,EAAE,GAAG,CAAA;IACN,WAAW,EAAE,GAAG,CAAA;CACjB,CAAA"}
|
@@ -20,7 +20,7 @@ export declare const transactionType: {
|
|
20
20
|
export type FormatTransactionErrorType = ErrorType;
|
21
21
|
export declare function formatTransaction(transaction: ExactPartial<RpcTransaction>): Transaction;
|
22
22
|
export type DefineTransactionErrorType = DefineFormatterErrorType | ErrorType;
|
23
|
-
export declare const defineTransaction: <parametersOverride, returnTypeOverride, exclude extends ("type" | "r" | "s" | "v" | "yParity" | "gasPrice" | "maxFeePerBlobGas" | "maxFeePerGas" | "maxPriorityFeePerGas" | "to" | "from" | "gas" | "nonce" | "value" | "
|
23
|
+
export declare const defineTransaction: <parametersOverride, returnTypeOverride, exclude extends ("type" | "r" | "s" | "v" | "yParity" | "gasPrice" | "maxFeePerBlobGas" | "maxFeePerGas" | "maxPriorityFeePerGas" | "to" | "from" | "gas" | "nonce" | "value" | "accessList" | "blobVersionedHashes" | "authorizationList" | "blockHash" | "blockNumber" | "hash" | "input" | "transactionIndex" | "chainId" | keyof parametersOverride)[] = []>({ exclude, format: overrides, }: {
|
24
24
|
exclude?: exclude | undefined;
|
25
25
|
format: (_: parametersOverride) => returnTypeOverride;
|
26
26
|
}) => {
|
@@ -15,7 +15,7 @@ export declare const rpcTransactionType: {
|
|
15
15
|
export type FormatTransactionRequestErrorType = ErrorType;
|
16
16
|
export declare function formatTransactionRequest(request: ExactPartial<TransactionRequest>): RpcTransactionRequest;
|
17
17
|
export type DefineTransactionRequestErrorType = DefineFormatterErrorType | ErrorType;
|
18
|
-
export declare const defineTransactionRequest: <parametersOverride, returnTypeOverride, exclude extends ("type" | "gasPrice" | "maxFeePerBlobGas" | "maxFeePerGas" | "maxPriorityFeePerGas" | "to" | "data" | "from" | "gas" | "nonce" | "value" | "blobs" | "accessList" | "
|
18
|
+
export declare const defineTransactionRequest: <parametersOverride, returnTypeOverride, exclude extends ("type" | "gasPrice" | "maxFeePerBlobGas" | "maxFeePerGas" | "maxPriorityFeePerGas" | "to" | "data" | "from" | "gas" | "nonce" | "value" | "blobs" | "accessList" | "blobVersionedHashes" | "kzg" | "sidecars" | "authorizationList" | keyof parametersOverride)[] = []>({ exclude, format: overrides, }: {
|
19
19
|
exclude?: exclude | undefined;
|
20
20
|
format: (_: parametersOverride) => returnTypeOverride;
|
21
21
|
}) => {
|
@@ -263,10 +263,10 @@ export declare const chainConfig: {
|
|
263
263
|
maxPriorityFeePerGas?: undefined | undefined;
|
264
264
|
blobs?: undefined;
|
265
265
|
accessList?: undefined;
|
266
|
-
authorizationList?: undefined;
|
267
266
|
blobVersionedHashes?: undefined;
|
268
267
|
kzg?: undefined;
|
269
268
|
sidecars?: undefined;
|
269
|
+
authorizationList?: undefined;
|
270
270
|
eip712Meta?: undefined | undefined;
|
271
271
|
} | {
|
272
272
|
data?: `0x${string}` | undefined;
|
@@ -282,10 +282,10 @@ export declare const chainConfig: {
|
|
282
282
|
maxPriorityFeePerGas?: undefined | undefined;
|
283
283
|
accessList?: import("../index.js").AccessList | undefined;
|
284
284
|
blobs?: undefined;
|
285
|
-
authorizationList?: undefined;
|
286
285
|
blobVersionedHashes?: undefined;
|
287
286
|
kzg?: undefined;
|
288
287
|
sidecars?: undefined;
|
288
|
+
authorizationList?: undefined;
|
289
289
|
eip712Meta?: undefined | undefined;
|
290
290
|
} | {
|
291
291
|
data?: `0x${string}` | undefined;
|
@@ -301,10 +301,10 @@ export declare const chainConfig: {
|
|
301
301
|
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
302
302
|
accessList?: import("../index.js").AccessList | undefined;
|
303
303
|
blobs?: undefined;
|
304
|
-
authorizationList?: undefined;
|
305
304
|
blobVersionedHashes?: undefined;
|
306
305
|
kzg?: undefined;
|
307
306
|
sidecars?: undefined;
|
307
|
+
authorizationList?: undefined;
|
308
308
|
eip712Meta?: undefined | undefined;
|
309
309
|
} | {
|
310
310
|
type?: "0x3" | undefined;
|
@@ -265,10 +265,10 @@ export declare const formatters: {
|
|
265
265
|
maxPriorityFeePerGas?: undefined | undefined;
|
266
266
|
blobs?: undefined;
|
267
267
|
accessList?: undefined;
|
268
|
-
authorizationList?: undefined;
|
269
268
|
blobVersionedHashes?: undefined;
|
270
269
|
kzg?: undefined;
|
271
270
|
sidecars?: undefined;
|
271
|
+
authorizationList?: undefined;
|
272
272
|
eip712Meta?: undefined | undefined;
|
273
273
|
} | {
|
274
274
|
data?: `0x${string}` | undefined;
|
@@ -284,10 +284,10 @@ export declare const formatters: {
|
|
284
284
|
maxPriorityFeePerGas?: undefined | undefined;
|
285
285
|
accessList?: import("../index.js").AccessList | undefined;
|
286
286
|
blobs?: undefined;
|
287
|
-
authorizationList?: undefined;
|
288
287
|
blobVersionedHashes?: undefined;
|
289
288
|
kzg?: undefined;
|
290
289
|
sidecars?: undefined;
|
290
|
+
authorizationList?: undefined;
|
291
291
|
eip712Meta?: undefined | undefined;
|
292
292
|
} | {
|
293
293
|
data?: `0x${string}` | undefined;
|
@@ -303,10 +303,10 @@ export declare const formatters: {
|
|
303
303
|
maxPriorityFeePerGas?: `0x${string}` | undefined;
|
304
304
|
accessList?: import("../index.js").AccessList | undefined;
|
305
305
|
blobs?: undefined;
|
306
|
-
authorizationList?: undefined;
|
307
306
|
blobVersionedHashes?: undefined;
|
308
307
|
kzg?: undefined;
|
309
308
|
sidecars?: undefined;
|
309
|
+
authorizationList?: undefined;
|
310
310
|
eip712Meta?: undefined | undefined;
|
311
311
|
} | {
|
312
312
|
type?: "0x3" | undefined;
|
@@ -4,7 +4,6 @@ import type * as WebAuthnP256 from 'ox/WebAuthnP256'
|
|
4
4
|
|
5
5
|
import type { LocalAccount } from '../../../accounts/types.js'
|
6
6
|
import { readContract } from '../../../actions/public/readContract.js'
|
7
|
-
import type { Client } from '../../../clients/createClient.js'
|
8
7
|
import { entryPoint06Address } from '../../../constants/address.js'
|
9
8
|
import { BaseError } from '../../../errors/base.js'
|
10
9
|
import type { Hash, Hex } from '../../../types/misc.js'
|
@@ -32,7 +31,7 @@ import type {
|
|
32
31
|
|
33
32
|
export type ToCoinbaseSmartAccountParameters = {
|
34
33
|
address?: Address | undefined
|
35
|
-
client:
|
34
|
+
client: CoinbaseSmartAccountImplementation['client']
|
36
35
|
ownerIndex?: number | undefined
|
37
36
|
owners: readonly (Address | OneOf<LocalAccount | WebAuthnAccount>)[]
|
38
37
|
nonce?: bigint | undefined
|
@@ -0,0 +1,382 @@
|
|
1
|
+
import type { Address, TypedData } from 'abitype'
|
2
|
+
|
3
|
+
import type { PrivateKeyAccount } from '../../../accounts/types.js'
|
4
|
+
import { entryPoint08Address } from '../../../constants/address.js'
|
5
|
+
import { BaseError } from '../../../errors/base.js'
|
6
|
+
import type { TypedDataDefinition } from '../../../types/typedData.js'
|
7
|
+
import type { Prettify } from '../../../types/utils.js'
|
8
|
+
import { decodeFunctionData } from '../../../utils/abi/decodeFunctionData.js'
|
9
|
+
import { encodeFunctionData } from '../../../utils/abi/encodeFunctionData.js'
|
10
|
+
import { concat, encodePacked, numberToHex, pad } from '../../../utils/index.js'
|
11
|
+
import { entryPoint08Abi } from '../../constants/abis.js'
|
12
|
+
import { toSmartAccount } from '../toSmartAccount.js'
|
13
|
+
import type { SmartAccount, SmartAccountImplementation } from '../types.js'
|
14
|
+
|
15
|
+
export type ToSimple7702SmartAccountParameters = {
|
16
|
+
client: Simple7702SmartAccountImplementation['client']
|
17
|
+
implementation?: Address | undefined
|
18
|
+
getNonce?: SmartAccountImplementation['getNonce'] | undefined
|
19
|
+
owner: PrivateKeyAccount
|
20
|
+
}
|
21
|
+
|
22
|
+
export type ToSimple7702SmartAccountReturnType = Prettify<
|
23
|
+
SmartAccount<Simple7702SmartAccountImplementation>
|
24
|
+
>
|
25
|
+
|
26
|
+
export type Simple7702SmartAccountImplementation = SmartAccountImplementation<
|
27
|
+
typeof entryPoint08Abi,
|
28
|
+
'0.8',
|
29
|
+
{ abi: typeof abi; owner: PrivateKeyAccount },
|
30
|
+
true
|
31
|
+
>
|
32
|
+
|
33
|
+
/**
|
34
|
+
* @description Create a Simple7702 Smart Account.
|
35
|
+
*
|
36
|
+
* @param parameters - {@link ToSimple7702SmartAccountParameters}
|
37
|
+
* @returns Simple7702 Smart Account. {@link ToSimple7702SmartAccountReturnType}
|
38
|
+
*
|
39
|
+
* @example
|
40
|
+
* import { toSimple7702SmartAccount } from 'viem/account-abstraction'
|
41
|
+
* import { client } from './client.js'
|
42
|
+
*
|
43
|
+
* const implementation = toSimple7702SmartAccount({
|
44
|
+
* client,
|
45
|
+
* owner: '0x...',
|
46
|
+
* })
|
47
|
+
*/
|
48
|
+
export async function toSimple7702SmartAccount(
|
49
|
+
parameters: ToSimple7702SmartAccountParameters,
|
50
|
+
): Promise<ToSimple7702SmartAccountReturnType> {
|
51
|
+
const {
|
52
|
+
client,
|
53
|
+
implementation = '0xe6Cae83BdE06E4c305530e199D7217f42808555B',
|
54
|
+
getNonce,
|
55
|
+
owner,
|
56
|
+
} = parameters
|
57
|
+
|
58
|
+
const entryPoint = {
|
59
|
+
abi: entryPoint08Abi,
|
60
|
+
address: entryPoint08Address,
|
61
|
+
version: '0.8',
|
62
|
+
} as const
|
63
|
+
|
64
|
+
return toSmartAccount({
|
65
|
+
authorization: { account: owner, address: implementation },
|
66
|
+
abi,
|
67
|
+
client,
|
68
|
+
extend: { abi, owner }, // not removing abi from here as this will be a breaking change
|
69
|
+
entryPoint,
|
70
|
+
getNonce,
|
71
|
+
|
72
|
+
async decodeCalls(data) {
|
73
|
+
const result = decodeFunctionData({
|
74
|
+
abi,
|
75
|
+
data,
|
76
|
+
})
|
77
|
+
|
78
|
+
if (result.functionName === 'execute')
|
79
|
+
return [
|
80
|
+
{ to: result.args[0], value: result.args[1], data: result.args[2] },
|
81
|
+
]
|
82
|
+
if (result.functionName === 'executeBatch')
|
83
|
+
return result.args[0].map((arg) => ({
|
84
|
+
to: arg.target,
|
85
|
+
value: arg.value,
|
86
|
+
data: arg.data,
|
87
|
+
}))
|
88
|
+
throw new BaseError(`unable to decode calls for "${result.functionName}"`)
|
89
|
+
},
|
90
|
+
|
91
|
+
async encodeCalls(calls) {
|
92
|
+
if (calls.length === 1)
|
93
|
+
return encodeFunctionData({
|
94
|
+
abi,
|
95
|
+
functionName: 'execute',
|
96
|
+
args: [calls[0].to, calls[0].value ?? 0n, calls[0].data ?? '0x'],
|
97
|
+
})
|
98
|
+
return encodeFunctionData({
|
99
|
+
abi,
|
100
|
+
functionName: 'executeBatch',
|
101
|
+
args: [
|
102
|
+
calls.map((call) => ({
|
103
|
+
data: call.data ?? '0x',
|
104
|
+
target: call.to,
|
105
|
+
value: call.value ?? 0n,
|
106
|
+
})),
|
107
|
+
],
|
108
|
+
})
|
109
|
+
},
|
110
|
+
|
111
|
+
async getAddress() {
|
112
|
+
return owner.address
|
113
|
+
},
|
114
|
+
|
115
|
+
async getFactoryArgs() {
|
116
|
+
return { factory: '0x7702', factoryData: '0x' }
|
117
|
+
},
|
118
|
+
|
119
|
+
async getStubSignature() {
|
120
|
+
return '0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c'
|
121
|
+
},
|
122
|
+
|
123
|
+
async signMessage(parameters) {
|
124
|
+
const { message } = parameters
|
125
|
+
return await owner.signMessage({ message })
|
126
|
+
},
|
127
|
+
|
128
|
+
async signTypedData(parameters) {
|
129
|
+
const { domain, types, primaryType, message } =
|
130
|
+
parameters as TypedDataDefinition<TypedData, string>
|
131
|
+
return await owner.signTypedData({
|
132
|
+
domain,
|
133
|
+
message,
|
134
|
+
primaryType,
|
135
|
+
types,
|
136
|
+
})
|
137
|
+
},
|
138
|
+
|
139
|
+
async signUserOperation(parameters) {
|
140
|
+
const { chainId = client.chain!.id, ...userOperation } = parameters
|
141
|
+
|
142
|
+
const address = await this.getAddress()
|
143
|
+
|
144
|
+
const isEip7702 =
|
145
|
+
userOperation.factory &&
|
146
|
+
userOperation.factory === '0x7702' &&
|
147
|
+
userOperation.authorization
|
148
|
+
|
149
|
+
const delegation = isEip7702
|
150
|
+
? userOperation.authorization?.address
|
151
|
+
: undefined
|
152
|
+
|
153
|
+
const initCode = delegation
|
154
|
+
? userOperation.factoryData
|
155
|
+
? encodePacked(
|
156
|
+
['address', 'bytes'],
|
157
|
+
[delegation, userOperation.factoryData],
|
158
|
+
)
|
159
|
+
: encodePacked(['address'], [delegation])
|
160
|
+
: userOperation.factory && userOperation.factoryData
|
161
|
+
? concat([userOperation.factory, userOperation.factoryData])
|
162
|
+
: '0x'
|
163
|
+
|
164
|
+
const accountGasLimits = concat([
|
165
|
+
pad(numberToHex(userOperation.verificationGasLimit), { size: 16 }),
|
166
|
+
pad(numberToHex(userOperation.callGasLimit), { size: 16 }),
|
167
|
+
])
|
168
|
+
const gasFees = concat([
|
169
|
+
pad(numberToHex(userOperation.maxPriorityFeePerGas), { size: 16 }),
|
170
|
+
pad(numberToHex(userOperation.maxFeePerGas), { size: 16 }),
|
171
|
+
])
|
172
|
+
const paymasterAndData = userOperation.paymaster
|
173
|
+
? concat([
|
174
|
+
userOperation.paymaster,
|
175
|
+
pad(numberToHex(userOperation.paymasterVerificationGasLimit || 0), {
|
176
|
+
size: 16,
|
177
|
+
}),
|
178
|
+
pad(numberToHex(userOperation.paymasterPostOpGasLimit || 0), {
|
179
|
+
size: 16,
|
180
|
+
}),
|
181
|
+
userOperation.paymasterData || '0x',
|
182
|
+
])
|
183
|
+
: '0x'
|
184
|
+
|
185
|
+
const signature = await owner.signTypedData({
|
186
|
+
types: {
|
187
|
+
PackedUserOperation: [
|
188
|
+
{ type: 'address', name: 'sender' },
|
189
|
+
{ type: 'uint256', name: 'nonce' },
|
190
|
+
{ type: 'bytes', name: 'initCode' },
|
191
|
+
{ type: 'bytes', name: 'callData' },
|
192
|
+
{ type: 'bytes32', name: 'accountGasLimits' },
|
193
|
+
{ type: 'uint256', name: 'preVerificationGas' },
|
194
|
+
{ type: 'bytes32', name: 'gasFees' },
|
195
|
+
{ type: 'bytes', name: 'paymasterAndData' },
|
196
|
+
],
|
197
|
+
},
|
198
|
+
primaryType: 'PackedUserOperation',
|
199
|
+
domain: {
|
200
|
+
name: 'ERC4337',
|
201
|
+
version: '1',
|
202
|
+
chainId,
|
203
|
+
verifyingContract: entryPoint.address,
|
204
|
+
},
|
205
|
+
message: {
|
206
|
+
sender: address,
|
207
|
+
nonce: userOperation.nonce,
|
208
|
+
initCode,
|
209
|
+
callData: userOperation.callData,
|
210
|
+
accountGasLimits,
|
211
|
+
preVerificationGas: userOperation.preVerificationGas,
|
212
|
+
gasFees,
|
213
|
+
paymasterAndData,
|
214
|
+
},
|
215
|
+
})
|
216
|
+
return signature
|
217
|
+
},
|
218
|
+
})
|
219
|
+
}
|
220
|
+
|
221
|
+
/////////////////////////////////////////////////////////////////////////////////////////////
|
222
|
+
// Constants
|
223
|
+
|
224
|
+
const abi = [
|
225
|
+
{ inputs: [], name: 'ECDSAInvalidSignature', type: 'error' },
|
226
|
+
{
|
227
|
+
inputs: [{ internalType: 'uint256', name: 'length', type: 'uint256' }],
|
228
|
+
name: 'ECDSAInvalidSignatureLength',
|
229
|
+
type: 'error',
|
230
|
+
},
|
231
|
+
{
|
232
|
+
inputs: [{ internalType: 'bytes32', name: 's', type: 'bytes32' }],
|
233
|
+
name: 'ECDSAInvalidSignatureS',
|
234
|
+
type: 'error',
|
235
|
+
},
|
236
|
+
{
|
237
|
+
inputs: [
|
238
|
+
{ internalType: 'uint256', name: 'index', type: 'uint256' },
|
239
|
+
{ internalType: 'bytes', name: 'error', type: 'bytes' },
|
240
|
+
],
|
241
|
+
name: 'ExecuteError',
|
242
|
+
type: 'error',
|
243
|
+
},
|
244
|
+
{ stateMutability: 'payable', type: 'fallback' },
|
245
|
+
{
|
246
|
+
inputs: [],
|
247
|
+
name: 'entryPoint',
|
248
|
+
outputs: [
|
249
|
+
{ internalType: 'contract IEntryPoint', name: '', type: 'address' },
|
250
|
+
],
|
251
|
+
stateMutability: 'pure',
|
252
|
+
type: 'function',
|
253
|
+
},
|
254
|
+
{
|
255
|
+
inputs: [
|
256
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
257
|
+
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
258
|
+
{ internalType: 'bytes', name: 'data', type: 'bytes' },
|
259
|
+
],
|
260
|
+
name: 'execute',
|
261
|
+
outputs: [],
|
262
|
+
stateMutability: 'nonpayable',
|
263
|
+
type: 'function',
|
264
|
+
},
|
265
|
+
{
|
266
|
+
inputs: [
|
267
|
+
{
|
268
|
+
components: [
|
269
|
+
{ internalType: 'address', name: 'target', type: 'address' },
|
270
|
+
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
271
|
+
{ internalType: 'bytes', name: 'data', type: 'bytes' },
|
272
|
+
],
|
273
|
+
internalType: 'struct BaseAccount.Call[]',
|
274
|
+
name: 'calls',
|
275
|
+
type: 'tuple[]',
|
276
|
+
},
|
277
|
+
],
|
278
|
+
name: 'executeBatch',
|
279
|
+
outputs: [],
|
280
|
+
stateMutability: 'nonpayable',
|
281
|
+
type: 'function',
|
282
|
+
},
|
283
|
+
{
|
284
|
+
inputs: [],
|
285
|
+
name: 'getNonce',
|
286
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
287
|
+
stateMutability: 'view',
|
288
|
+
type: 'function',
|
289
|
+
},
|
290
|
+
{
|
291
|
+
inputs: [
|
292
|
+
{ internalType: 'bytes32', name: 'hash', type: 'bytes32' },
|
293
|
+
{ internalType: 'bytes', name: 'signature', type: 'bytes' },
|
294
|
+
],
|
295
|
+
name: 'isValidSignature',
|
296
|
+
outputs: [{ internalType: 'bytes4', name: 'magicValue', type: 'bytes4' }],
|
297
|
+
stateMutability: 'view',
|
298
|
+
type: 'function',
|
299
|
+
},
|
300
|
+
{
|
301
|
+
inputs: [
|
302
|
+
{ internalType: 'address', name: '', type: 'address' },
|
303
|
+
{ internalType: 'address', name: '', type: 'address' },
|
304
|
+
{ internalType: 'uint256[]', name: '', type: 'uint256[]' },
|
305
|
+
{ internalType: 'uint256[]', name: '', type: 'uint256[]' },
|
306
|
+
{ internalType: 'bytes', name: '', type: 'bytes' },
|
307
|
+
],
|
308
|
+
name: 'onERC1155BatchReceived',
|
309
|
+
outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }],
|
310
|
+
stateMutability: 'nonpayable',
|
311
|
+
type: 'function',
|
312
|
+
},
|
313
|
+
{
|
314
|
+
inputs: [
|
315
|
+
{ internalType: 'address', name: '', type: 'address' },
|
316
|
+
{ internalType: 'address', name: '', type: 'address' },
|
317
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
318
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
319
|
+
{ internalType: 'bytes', name: '', type: 'bytes' },
|
320
|
+
],
|
321
|
+
name: 'onERC1155Received',
|
322
|
+
outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }],
|
323
|
+
stateMutability: 'nonpayable',
|
324
|
+
type: 'function',
|
325
|
+
},
|
326
|
+
{
|
327
|
+
inputs: [
|
328
|
+
{ internalType: 'address', name: '', type: 'address' },
|
329
|
+
{ internalType: 'address', name: '', type: 'address' },
|
330
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
331
|
+
{ internalType: 'bytes', name: '', type: 'bytes' },
|
332
|
+
],
|
333
|
+
name: 'onERC721Received',
|
334
|
+
outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }],
|
335
|
+
stateMutability: 'nonpayable',
|
336
|
+
type: 'function',
|
337
|
+
},
|
338
|
+
{
|
339
|
+
inputs: [{ internalType: 'bytes4', name: 'id', type: 'bytes4' }],
|
340
|
+
name: 'supportsInterface',
|
341
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
342
|
+
stateMutability: 'pure',
|
343
|
+
type: 'function',
|
344
|
+
},
|
345
|
+
{
|
346
|
+
inputs: [
|
347
|
+
{
|
348
|
+
components: [
|
349
|
+
{ internalType: 'address', name: 'sender', type: 'address' },
|
350
|
+
{ internalType: 'uint256', name: 'nonce', type: 'uint256' },
|
351
|
+
{ internalType: 'bytes', name: 'initCode', type: 'bytes' },
|
352
|
+
{ internalType: 'bytes', name: 'callData', type: 'bytes' },
|
353
|
+
{
|
354
|
+
internalType: 'bytes32',
|
355
|
+
name: 'accountGasLimits',
|
356
|
+
type: 'bytes32',
|
357
|
+
},
|
358
|
+
{
|
359
|
+
internalType: 'uint256',
|
360
|
+
name: 'preVerificationGas',
|
361
|
+
type: 'uint256',
|
362
|
+
},
|
363
|
+
{ internalType: 'bytes32', name: 'gasFees', type: 'bytes32' },
|
364
|
+
{ internalType: 'bytes', name: 'paymasterAndData', type: 'bytes' },
|
365
|
+
{ internalType: 'bytes', name: 'signature', type: 'bytes' },
|
366
|
+
],
|
367
|
+
internalType: 'struct PackedUserOperation',
|
368
|
+
name: 'userOp',
|
369
|
+
type: 'tuple',
|
370
|
+
},
|
371
|
+
{ internalType: 'bytes32', name: 'userOpHash', type: 'bytes32' },
|
372
|
+
{ internalType: 'uint256', name: 'missingAccountFunds', type: 'uint256' },
|
373
|
+
],
|
374
|
+
name: 'validateUserOp',
|
375
|
+
outputs: [
|
376
|
+
{ internalType: 'uint256', name: 'validationData', type: 'uint256' },
|
377
|
+
],
|
378
|
+
stateMutability: 'nonpayable',
|
379
|
+
type: 'function',
|
380
|
+
},
|
381
|
+
{ stateMutability: 'payable', type: 'receive' },
|
382
|
+
] as const
|
@@ -3,7 +3,6 @@ import type { Abi, Address, TypedData } from 'abitype'
|
|
3
3
|
import { parseAccount } from '../../../accounts/utils/parseAccount.js'
|
4
4
|
import { readContract } from '../../../actions/public/readContract.js'
|
5
5
|
import { signMessage as signMessage_ } from '../../../actions/wallet/signMessage.js'
|
6
|
-
import type { Client } from '../../../clients/createClient.js'
|
7
6
|
import { entryPoint07Address } from '../../../constants/address.js'
|
8
7
|
import { BaseError } from '../../../errors/base.js'
|
9
8
|
import { signMessage } from '../../../experimental/erc7739/actions/signMessage.js'
|
@@ -27,7 +26,7 @@ export type ToSoladySmartAccountParameters<
|
|
27
26
|
entryPointVersion extends EntryPointVersion = EntryPointVersion,
|
28
27
|
> = {
|
29
28
|
address?: Address | undefined
|
30
|
-
client:
|
29
|
+
client: SoladySmartAccountImplementation['client']
|
31
30
|
entryPoint?:
|
32
31
|
| {
|
33
32
|
abi: entryPointAbi
|
@@ -115,7 +115,7 @@ export async function toSmartAccount<
|
|
115
115
|
this.getFactoryArgs(),
|
116
116
|
implementation.signMessage(parameters),
|
117
117
|
])
|
118
|
-
if (factory && factoryData)
|
118
|
+
if (factory && factoryData && factory !== '0x7702')
|
119
119
|
return serializeErc6492Signature({
|
120
120
|
address: factory,
|
121
121
|
data: factoryData,
|
@@ -128,7 +128,7 @@ export async function toSmartAccount<
|
|
128
128
|
this.getFactoryArgs(),
|
129
129
|
implementation.signTypedData(parameters),
|
130
130
|
])
|
131
|
-
if (factory && factoryData)
|
131
|
+
if (factory && factoryData && factory !== '0x7702')
|
132
132
|
return serializeErc6492Signature({
|
133
133
|
address: factory,
|
134
134
|
data: factoryData,
|