viem 2.27.1 → 2.27.2
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/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 +1 -7
- package/_cjs/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js +1 -21
- 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 +1 -691
- package/_cjs/account-abstraction/constants/abis.js.map +1 -1
- package/_cjs/account-abstraction/constants/address.js +1 -2
- package/_cjs/account-abstraction/constants/address.js.map +1 -1
- package/_cjs/account-abstraction/index.js +2 -6
- package/_cjs/account-abstraction/index.js.map +1 -1
- package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js +0 -19
- package/_cjs/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -1
- package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js +0 -70
- package/_cjs/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -1
- package/_cjs/constants/address.js +1 -2
- package/_cjs/constants/address.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_esm/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js.map +1 -1
- 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 +1 -7
- package/_esm/account-abstraction/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js +1 -21
- 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 +0 -690
- package/_esm/account-abstraction/constants/abis.js.map +1 -1
- package/_esm/account-abstraction/constants/address.js +0 -1
- package/_esm/account-abstraction/constants/address.js.map +1 -1
- package/_esm/account-abstraction/index.js +2 -3
- package/_esm/account-abstraction/index.js.map +1 -1
- package/_esm/account-abstraction/utils/formatters/userOperationRequest.js +0 -19
- package/_esm/account-abstraction/utils/formatters/userOperationRequest.js.map +1 -1
- package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js +0 -70
- package/_esm/account-abstraction/utils/userOperation/getUserOperationHash.js.map +1 -1
- package/_esm/constants/address.js +0 -1
- package/_esm/constants/address.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts +2 -1
- package/_types/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.d.ts.map +1 -1
- package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts +2 -1
- package/_types/account-abstraction/accounts/implementations/toSoladySmartAccount.d.ts.map +1 -1
- package/_types/account-abstraction/accounts/types.d.ts +3 -16
- 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 +6 -23
- 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 +0 -830
- package/_types/account-abstraction/constants/abis.d.ts.map +1 -1
- package/_types/account-abstraction/constants/address.d.ts +0 -1
- package/_types/account-abstraction/constants/address.d.ts.map +1 -1
- package/_types/account-abstraction/index.d.ts +2 -3
- 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 +3 -6
- package/_types/account-abstraction/types/rpc.d.ts.map +1 -1
- package/_types/account-abstraction/types/userOperation.d.ts +5 -49
- 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 +0 -1
- package/_types/constants/address.d.ts.map +1 -1
- package/_types/errors/version.d.ts +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 +2 -1
- package/account-abstraction/accounts/implementations/toSoladySmartAccount.ts +2 -1
- package/account-abstraction/accounts/toSmartAccount.ts +2 -2
- package/account-abstraction/accounts/types.ts +2 -26
- package/account-abstraction/actions/bundler/estimateUserOperationGas.ts +1 -8
- package/account-abstraction/actions/bundler/prepareUserOperation.ts +2 -56
- package/account-abstraction/actions/bundler/sendUserOperation.ts +2 -2
- package/account-abstraction/actions/paymaster/getPaymasterData.ts +0 -24
- package/account-abstraction/constants/abis.ts +0 -691
- package/account-abstraction/constants/address.ts +0 -2
- package/account-abstraction/index.ts +1 -12
- package/account-abstraction/types/entryPointVersion.ts +1 -1
- package/account-abstraction/types/rpc.ts +3 -6
- package/account-abstraction/types/userOperation.ts +3 -69
- package/account-abstraction/utils/formatters/userOperationRequest.ts +0 -21
- package/account-abstraction/utils/userOperation/getUserOperationHash.ts +0 -79
- package/constants/address.ts +0 -2
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/types/authorization.ts +1 -1
- package/types/misc.ts +7 -7
- package/_cjs/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js +0 -313
- package/_cjs/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js.map +0 -1
- package/_esm/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js +0 -327
- package/_esm/account-abstraction/accounts/implementations/toSimple7702SmartAccount.js.map +0 -1
- package/_types/account-abstraction/accounts/implementations/toSimple7702SmartAccount.d.ts +0 -311
- package/_types/account-abstraction/accounts/implementations/toSimple7702SmartAccount.d.ts.map +0 -1
- package/account-abstraction/accounts/implementations/toSimple7702SmartAccount.ts +0 -382
@@ -304,10 +304,10 @@ export declare const zksyncSepoliaTestnet: {
|
|
304
304
|
maxPriorityFeePerGas?: undefined | undefined;
|
305
305
|
blobs?: undefined;
|
306
306
|
accessList?: undefined;
|
307
|
+
authorizationList?: undefined;
|
307
308
|
blobVersionedHashes?: undefined;
|
308
309
|
kzg?: undefined;
|
309
310
|
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;
|
326
327
|
blobVersionedHashes?: undefined;
|
327
328
|
kzg?: undefined;
|
328
329
|
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;
|
345
346
|
blobVersionedHashes?: undefined;
|
346
347
|
kzg?: undefined;
|
347
348
|
sidecars?: undefined;
|
348
|
-
authorizationList?: undefined;
|
349
349
|
eip712Meta?: undefined | undefined;
|
350
350
|
} | {
|
351
351
|
type?: "0x3" | undefined;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
export declare const entryPoint06Address: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
|
2
2
|
export declare const entryPoint07Address: "0x0000000071727De22E5E9d8BAf0edAc6f37da032";
|
3
|
-
export declare const entryPoint08Address: "0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108";
|
4
3
|
export declare const ethAddress: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
5
4
|
export declare const zeroAddress: "0x0000000000000000000000000000000000000000";
|
6
5
|
//# 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;
|
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,2 +1,2 @@
|
|
1
|
-
export declare const version = "2.27.
|
1
|
+
export declare const version = "2.27.2";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -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
|
11
|
+
} & (signed extends true ? Signature : ExactPartial<Signature>);
|
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,
|
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/D,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 = {
|
11
11
|
r: Hex;
|
12
12
|
s: Hex;
|
13
|
-
v:
|
13
|
+
v: bigint;
|
14
14
|
};
|
15
|
-
export type Signature
|
15
|
+
export type Signature = OneOf<SignatureLegacy | {
|
16
16
|
r: Hex;
|
17
17
|
s: Hex;
|
18
18
|
/** @deprecated use `yParity`. */
|
19
|
-
v:
|
20
|
-
yParity?:
|
19
|
+
v: bigint;
|
20
|
+
yParity?: number | undefined;
|
21
21
|
} | {
|
22
22
|
r: Hex;
|
23
23
|
s: Hex;
|
24
24
|
/** @deprecated use `yParity`. */
|
25
|
-
v?:
|
26
|
-
yParity:
|
25
|
+
v?: bigint | undefined;
|
26
|
+
yParity: number;
|
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,
|
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;IAC5B,CAAC,EAAE,GAAG,CAAA;IACN,CAAC,EAAE,GAAG,CAAA;IACN,CAAC,EAAE,MAAM,CAAA;CACV,CAAA;AACD,MAAM,MAAM,SAAS,GAAG,KAAK,CACzB,eAAe,GACf;IACE,CAAC,EAAE,GAAG,CAAA;IACN,CAAC,EAAE,GAAG,CAAA;IACN,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAA;IACT,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,GACD;IACE,CAAC,EAAE,GAAG,CAAA;IACN,CAAC,EAAE,GAAG,CAAA;IACN,iCAAiC;IACjC,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;CAChB,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" | "blockHash" | "blockNumber" | "hash" | "input" | "transactionIndex" | "accessList" | "authorizationList" | "blobVersionedHashes" | "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" | "authorizationList" | "blobVersionedHashes" | "kzg" | "sidecars" | 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;
|
266
267
|
blobVersionedHashes?: undefined;
|
267
268
|
kzg?: undefined;
|
268
269
|
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;
|
285
286
|
blobVersionedHashes?: undefined;
|
286
287
|
kzg?: undefined;
|
287
288
|
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;
|
304
305
|
blobVersionedHashes?: undefined;
|
305
306
|
kzg?: undefined;
|
306
307
|
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;
|
268
269
|
blobVersionedHashes?: undefined;
|
269
270
|
kzg?: undefined;
|
270
271
|
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;
|
287
288
|
blobVersionedHashes?: undefined;
|
288
289
|
kzg?: undefined;
|
289
290
|
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;
|
306
307
|
blobVersionedHashes?: undefined;
|
307
308
|
kzg?: undefined;
|
308
309
|
sidecars?: undefined;
|
309
|
-
authorizationList?: undefined;
|
310
310
|
eip712Meta?: undefined | undefined;
|
311
311
|
} | {
|
312
312
|
type?: "0x3" | undefined;
|
@@ -4,6 +4,7 @@ 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'
|
7
8
|
import { entryPoint06Address } from '../../../constants/address.js'
|
8
9
|
import { BaseError } from '../../../errors/base.js'
|
9
10
|
import type { Hash, Hex } from '../../../types/misc.js'
|
@@ -31,7 +32,7 @@ import type {
|
|
31
32
|
|
32
33
|
export type ToCoinbaseSmartAccountParameters = {
|
33
34
|
address?: Address | undefined
|
34
|
-
client:
|
35
|
+
client: Client
|
35
36
|
ownerIndex?: number | undefined
|
36
37
|
owners: readonly (Address | OneOf<LocalAccount | WebAuthnAccount>)[]
|
37
38
|
nonce?: bigint | undefined
|
@@ -3,6 +3,7 @@ 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'
|
6
7
|
import { entryPoint07Address } from '../../../constants/address.js'
|
7
8
|
import { BaseError } from '../../../errors/base.js'
|
8
9
|
import { signMessage } from '../../../experimental/erc7739/actions/signMessage.js'
|
@@ -26,7 +27,7 @@ export type ToSoladySmartAccountParameters<
|
|
26
27
|
entryPointVersion extends EntryPointVersion = EntryPointVersion,
|
27
28
|
> = {
|
28
29
|
address?: Address | undefined
|
29
|
-
client:
|
30
|
+
client: Client
|
30
31
|
entryPoint?:
|
31
32
|
| {
|
32
33
|
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)
|
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)
|
132
132
|
return serializeErc6492Signature({
|
133
133
|
address: factory,
|
134
134
|
data: factoryData,
|
@@ -1,14 +1,7 @@
|
|
1
1
|
import type { Abi, Address, TypedData } from 'abitype'
|
2
2
|
import type * as WebAuthnP256 from 'ox/WebAuthnP256'
|
3
3
|
|
4
|
-
import type {
|
5
|
-
JsonRpcAccount,
|
6
|
-
LocalAccount,
|
7
|
-
PrivateKeyAccount,
|
8
|
-
} from '../../accounts/types.js'
|
9
4
|
import type { Client } from '../../clients/createClient.js'
|
10
|
-
import type { Transport } from '../../clients/transports/createTransport.js'
|
11
|
-
import type { Chain } from '../../types/chain.js'
|
12
5
|
import type { Hash, Hex, SignableMessage } from '../../types/misc.js'
|
13
6
|
import type { TypedDataDefinition } from '../../types/typedData.js'
|
14
7
|
import type { Assign, ExactPartial, UnionPartialBy } from '../../types/utils.js'
|
@@ -30,14 +23,9 @@ export type SmartAccountImplementation<
|
|
30
23
|
entryPointAbi extends Abi | readonly unknown[] = Abi,
|
31
24
|
entryPointVersion extends EntryPointVersion = EntryPointVersion,
|
32
25
|
extend extends object = object,
|
33
|
-
eip7702 extends boolean = boolean,
|
34
26
|
> = {
|
35
27
|
/** Client used to retrieve Smart Account data, and perform signing (if owner is a JSON-RPC Account). */
|
36
|
-
client: Client
|
37
|
-
Transport,
|
38
|
-
Chain | undefined,
|
39
|
-
JsonRpcAccount | LocalAccount | undefined
|
40
|
-
>
|
28
|
+
client: Client
|
41
29
|
/** Compatible EntryPoint of the Smart Account. */
|
42
30
|
entryPoint: {
|
43
31
|
/** Compatible EntryPoint ABI. */
|
@@ -201,19 +189,7 @@ export type SmartAccountImplementation<
|
|
201
189
|
| undefined
|
202
190
|
}
|
203
191
|
| undefined
|
204
|
-
}
|
205
|
-
? {
|
206
|
-
/** EIP-7702 authorization properties, if applicable. */
|
207
|
-
authorization: {
|
208
|
-
/** EOA to delegate to. */
|
209
|
-
account: PrivateKeyAccount
|
210
|
-
/** Delegation address. */
|
211
|
-
address: Address
|
212
|
-
}
|
213
|
-
}
|
214
|
-
: {
|
215
|
-
authorization?: undefined
|
216
|
-
})
|
192
|
+
}
|
217
193
|
|
218
194
|
export type SmartAccount<
|
219
195
|
implementation extends
|
@@ -174,13 +174,7 @@ export async function estimateUserOperationGas<
|
|
174
174
|
'prepareUserOperation',
|
175
175
|
)({
|
176
176
|
...parameters,
|
177
|
-
parameters: [
|
178
|
-
'authorization',
|
179
|
-
'factory',
|
180
|
-
'nonce',
|
181
|
-
'paymaster',
|
182
|
-
'signature',
|
183
|
-
],
|
177
|
+
parameters: ['factory', 'nonce', 'paymaster', 'signature'],
|
184
178
|
} as unknown as PrepareUserOperationParameters)
|
185
179
|
: parameters
|
186
180
|
|
@@ -189,7 +183,6 @@ export async function estimateUserOperationGas<
|
|
189
183
|
formatUserOperationRequest(request as UserOperation),
|
190
184
|
(entryPointAddress ?? account?.entryPoint?.address)!,
|
191
185
|
] as const
|
192
|
-
|
193
186
|
const result = await client.request({
|
194
187
|
method: 'eth_estimateUserOperationGas',
|
195
188
|
params: rpcStateOverride ? [...params, rpcStateOverride] : [...params],
|
@@ -3,7 +3,6 @@ import {
|
|
3
3
|
type ParseAccountErrorType,
|
4
4
|
parseAccount,
|
5
5
|
} from '../../../accounts/utils/parseAccount.js'
|
6
|
-
import { prepareAuthorization } from '../../../actions/index.js'
|
7
6
|
import {
|
8
7
|
type EstimateFeesPerGasErrorType,
|
9
8
|
estimateFeesPerGas,
|
@@ -13,7 +12,6 @@ import type { Client } from '../../../clients/createClient.js'
|
|
13
12
|
import type { Transport } from '../../../clients/transports/createTransport.js'
|
14
13
|
import { AccountNotFoundError } from '../../../errors/account.js'
|
15
14
|
import type { ErrorType } from '../../../errors/utils.js'
|
16
|
-
import type { SignedAuthorization } from '../../../types/authorization.js'
|
17
15
|
import type { Call, Calls } from '../../../types/calls.js'
|
18
16
|
import type { Chain } from '../../../types/chain.js'
|
19
17
|
import type { Hex } from '../../../types/misc.js'
|
@@ -65,7 +63,6 @@ const defaultParameters = [
|
|
65
63
|
'paymaster',
|
66
64
|
'nonce',
|
67
65
|
'signature',
|
68
|
-
'authorization',
|
69
66
|
] as const
|
70
67
|
|
71
68
|
export type PrepareUserOperationParameterType =
|
@@ -75,17 +72,10 @@ export type PrepareUserOperationParameterType =
|
|
75
72
|
| 'paymaster'
|
76
73
|
| 'nonce'
|
77
74
|
| 'signature'
|
78
|
-
| 'authorization'
|
79
75
|
|
80
76
|
type FactoryProperties<
|
81
77
|
entryPointVersion extends EntryPointVersion = EntryPointVersion,
|
82
78
|
> =
|
83
|
-
| (entryPointVersion extends '0.8'
|
84
|
-
? {
|
85
|
-
factory: UserOperation['factory']
|
86
|
-
factoryData: UserOperation['factoryData']
|
87
|
-
}
|
88
|
-
: never)
|
89
79
|
| (entryPointVersion extends '0.7'
|
90
80
|
? {
|
91
81
|
factory: UserOperation['factory']
|
@@ -101,15 +91,6 @@ type FactoryProperties<
|
|
101
91
|
type GasProperties<
|
102
92
|
entryPointVersion extends EntryPointVersion = EntryPointVersion,
|
103
93
|
> =
|
104
|
-
| (entryPointVersion extends '0.8'
|
105
|
-
? {
|
106
|
-
callGasLimit: UserOperation['callGasLimit']
|
107
|
-
preVerificationGas: UserOperation['preVerificationGas']
|
108
|
-
verificationGasLimit: UserOperation['verificationGasLimit']
|
109
|
-
paymasterPostOpGasLimit: UserOperation['paymasterPostOpGasLimit']
|
110
|
-
paymasterVerificationGasLimit: UserOperation['paymasterVerificationGasLimit']
|
111
|
-
}
|
112
|
-
: never)
|
113
94
|
| (entryPointVersion extends '0.7'
|
114
95
|
? {
|
115
96
|
callGasLimit: UserOperation['callGasLimit']
|
@@ -139,14 +120,6 @@ type NonceProperties = {
|
|
139
120
|
type PaymasterProperties<
|
140
121
|
entryPointVersion extends EntryPointVersion = EntryPointVersion,
|
141
122
|
> =
|
142
|
-
| (entryPointVersion extends '0.8'
|
143
|
-
? {
|
144
|
-
paymaster: UserOperation['paymaster']
|
145
|
-
paymasterData: UserOperation['paymasterData']
|
146
|
-
paymasterPostOpGasLimit: UserOperation['paymasterPostOpGasLimit']
|
147
|
-
paymasterVerificationGasLimit: UserOperation['paymasterVerificationGasLimit']
|
148
|
-
}
|
149
|
-
: never)
|
150
123
|
| (entryPointVersion extends '0.7'
|
151
124
|
? {
|
152
125
|
paymaster: UserOperation['paymaster']
|
@@ -165,10 +138,6 @@ type SignatureProperties = {
|
|
165
138
|
signature: UserOperation['signature']
|
166
139
|
}
|
167
140
|
|
168
|
-
type AuthorizationProperties = {
|
169
|
-
authorization: UserOperation['authorization']
|
170
|
-
}
|
171
|
-
|
172
141
|
export type PrepareUserOperationRequest<
|
173
142
|
account extends SmartAccount | undefined = SmartAccount | undefined,
|
174
143
|
accountOverride extends SmartAccount | undefined = SmartAccount | undefined,
|
@@ -239,10 +208,7 @@ export type PrepareUserOperationReturnType<
|
|
239
208
|
callData: Hex
|
240
209
|
paymasterAndData: _derivedVersion extends '0.6' ? Hex : undefined
|
241
210
|
sender: UserOperation['sender']
|
242
|
-
} & (Extract<_parameters, '
|
243
|
-
? {}
|
244
|
-
: AuthorizationProperties) &
|
245
|
-
(Extract<_parameters, 'factory'> extends never
|
211
|
+
} & (Extract<_parameters, 'factory'> extends never
|
246
212
|
? {}
|
247
213
|
: FactoryProperties<_derivedVersion>) &
|
248
214
|
(Extract<_parameters, 'nonce'> extends never ? {} : NonceProperties) &
|
@@ -393,7 +359,7 @@ export async function prepareUserOperation<
|
|
393
359
|
// Concurrently prepare properties required to fill the User Operation.
|
394
360
|
////////////////////////////////////////////////////////////////////////////////
|
395
361
|
|
396
|
-
const [callData, factory, fees, nonce
|
362
|
+
const [callData, factory, fees, nonce] = await Promise.all([
|
397
363
|
(async () => {
|
398
364
|
if (parameters.calls)
|
399
365
|
return account.encodeCalls(
|
@@ -491,24 +457,6 @@ export async function prepareUserOperation<
|
|
491
457
|
if (typeof parameters.nonce === 'bigint') return parameters.nonce
|
492
458
|
return account.getNonce()
|
493
459
|
})(),
|
494
|
-
(async () => {
|
495
|
-
if (!properties.includes('authorization')) return undefined
|
496
|
-
if (typeof parameters.authorization === 'object')
|
497
|
-
return parameters.authorization
|
498
|
-
if (account.authorization && !(await account.isDeployed())) {
|
499
|
-
const authorization = await prepareAuthorization(
|
500
|
-
account.client,
|
501
|
-
account.authorization,
|
502
|
-
)
|
503
|
-
return {
|
504
|
-
...authorization,
|
505
|
-
r: '0xfffffffffffffffffffffffffffffff000000000000000000000000000000000',
|
506
|
-
s: '0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
|
507
|
-
yParity: 1,
|
508
|
-
} satisfies SignedAuthorization
|
509
|
-
}
|
510
|
-
return undefined
|
511
|
-
})(),
|
512
460
|
])
|
513
461
|
|
514
462
|
////////////////////////////////////////////////////////////////////////////////
|
@@ -520,8 +468,6 @@ export async function prepareUserOperation<
|
|
520
468
|
request = { ...request, ...(factory as any) }
|
521
469
|
if (typeof fees !== 'undefined') request = { ...request, ...(fees as any) }
|
522
470
|
if (typeof nonce !== 'undefined') request.nonce = nonce
|
523
|
-
if (typeof authorization !== 'undefined')
|
524
|
-
request.authorization = authorization
|
525
471
|
|
526
472
|
////////////////////////////////////////////////////////////////////////////////
|
527
473
|
// Fill User Operation with the `signature` property.
|
@@ -135,7 +135,7 @@ export async function sendUserOperation<
|
|
135
135
|
: parameters
|
136
136
|
|
137
137
|
const signature = (parameters.signature ||
|
138
|
-
(await account?.signUserOperation
|
138
|
+
(await account?.signUserOperation(request as UserOperation)))!
|
139
139
|
|
140
140
|
const rpcParameters = formatUserOperationRequest({
|
141
141
|
...request,
|
@@ -148,7 +148,7 @@ export async function sendUserOperation<
|
|
148
148
|
method: 'eth_sendUserOperation',
|
149
149
|
params: [
|
150
150
|
rpcParameters,
|
151
|
-
(entryPointAddress ?? account?.entryPoint
|
151
|
+
(entryPointAddress ?? account?.entryPoint.address)!,
|
152
152
|
],
|
153
153
|
},
|
154
154
|
{ retryCount: 0 },
|
@@ -57,30 +57,6 @@ export type GetPaymasterDataParameters = OneOf<
|
|
57
57
|
| 'preVerificationGas'
|
58
58
|
| 'verificationGasLimit'
|
59
59
|
>
|
60
|
-
| PartialBy<
|
61
|
-
Pick<
|
62
|
-
UserOperation<'0.8'>,
|
63
|
-
| 'callData'
|
64
|
-
| 'callGasLimit'
|
65
|
-
| 'factory'
|
66
|
-
| 'factoryData'
|
67
|
-
| 'maxFeePerGas'
|
68
|
-
| 'maxPriorityFeePerGas'
|
69
|
-
| 'nonce'
|
70
|
-
| 'sender'
|
71
|
-
| 'preVerificationGas'
|
72
|
-
| 'verificationGasLimit'
|
73
|
-
| 'paymasterPostOpGasLimit'
|
74
|
-
| 'paymasterVerificationGasLimit'
|
75
|
-
>,
|
76
|
-
| 'callGasLimit'
|
77
|
-
| 'factory'
|
78
|
-
| 'factoryData'
|
79
|
-
| 'maxFeePerGas'
|
80
|
-
| 'maxPriorityFeePerGas'
|
81
|
-
| 'preVerificationGas'
|
82
|
-
| 'verificationGasLimit'
|
83
|
-
>
|
84
60
|
> & {
|
85
61
|
context?: unknown | undefined
|
86
62
|
chainId: number
|