viem 2.27.1-canary-20250416051407 → 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 +3 -1
- package/_cjs/account-abstraction/accounts/implementations/toCoinbaseSmartAccount.js +17 -10
- 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 +16 -9
- 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 +26 -4
- 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 +25 -11
- 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":[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AE,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,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AAA;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
|
@@ -177,14 +176,14 @@ export async function toCoinbaseSmartAccount(
|
|
177
176
|
async sign(parameters) {
|
178
177
|
const address = await this.getAddress()
|
179
178
|
|
180
|
-
const
|
179
|
+
const typedData = toReplaySafeTypedData({
|
181
180
|
address,
|
182
181
|
chainId: client.chain!.id,
|
183
182
|
hash: parameters.hash,
|
184
183
|
})
|
185
184
|
|
186
185
|
if (owner.type === 'address') throw new Error('owner cannot sign')
|
187
|
-
const signature = await
|
186
|
+
const signature = await signTypedData({ owner, typedData })
|
188
187
|
|
189
188
|
return wrapSignature({
|
190
189
|
ownerIndex,
|
@@ -196,14 +195,14 @@ export async function toCoinbaseSmartAccount(
|
|
196
195
|
const { message } = parameters
|
197
196
|
const address = await this.getAddress()
|
198
197
|
|
199
|
-
const
|
198
|
+
const typedData = toReplaySafeTypedData({
|
200
199
|
address,
|
201
200
|
chainId: client.chain!.id,
|
202
201
|
hash: hashMessage(message),
|
203
202
|
})
|
204
203
|
|
205
204
|
if (owner.type === 'address') throw new Error('owner cannot sign')
|
206
|
-
const signature = await
|
205
|
+
const signature = await signTypedData({ owner, typedData })
|
207
206
|
|
208
207
|
return wrapSignature({
|
209
208
|
ownerIndex,
|
@@ -216,7 +215,7 @@ export async function toCoinbaseSmartAccount(
|
|
216
215
|
parameters as TypedDataDefinition<TypedData, string>
|
217
216
|
const address = await this.getAddress()
|
218
217
|
|
219
|
-
const
|
218
|
+
const typedData = toReplaySafeTypedData({
|
220
219
|
address,
|
221
220
|
chainId: client.chain!.id,
|
222
221
|
hash: hashTypedData({
|
@@ -228,7 +227,7 @@ export async function toCoinbaseSmartAccount(
|
|
228
227
|
})
|
229
228
|
|
230
229
|
if (owner.type === 'address') throw new Error('owner cannot sign')
|
231
|
-
const signature = await
|
230
|
+
const signature = await signTypedData({ owner, typedData })
|
232
231
|
|
233
232
|
return wrapSignature({
|
234
233
|
ownerIndex,
|
@@ -278,6 +277,21 @@ export async function toCoinbaseSmartAccount(
|
|
278
277
|
// Utilities
|
279
278
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
280
279
|
|
280
|
+
/** @internal */
|
281
|
+
export async function signTypedData({
|
282
|
+
typedData,
|
283
|
+
owner,
|
284
|
+
}: {
|
285
|
+
typedData: TypedDataDefinition
|
286
|
+
owner: OneOf<LocalAccount | WebAuthnAccount>
|
287
|
+
}) {
|
288
|
+
if (owner.type === 'local' && owner.signTypedData)
|
289
|
+
return owner.signTypedData(typedData)
|
290
|
+
|
291
|
+
const hash = hashTypedData(typedData)
|
292
|
+
return sign({ hash, owner })
|
293
|
+
}
|
294
|
+
|
281
295
|
/** @internal */
|
282
296
|
export async function sign({
|
283
297
|
hash,
|
@@ -297,12 +311,12 @@ export async function sign({
|
|
297
311
|
}
|
298
312
|
|
299
313
|
/** @internal */
|
300
|
-
export function
|
314
|
+
export function toReplaySafeTypedData({
|
301
315
|
address,
|
302
316
|
chainId,
|
303
317
|
hash,
|
304
318
|
}: { address: Address; chainId: number; hash: Hash }) {
|
305
|
-
return
|
319
|
+
return {
|
306
320
|
domain: {
|
307
321
|
chainId,
|
308
322
|
name: 'Coinbase Smart Wallet',
|
@@ -321,7 +335,7 @@ export function toReplaySafeHash({
|
|
321
335
|
message: {
|
322
336
|
hash,
|
323
337
|
},
|
324
|
-
}
|
338
|
+
} as const
|
325
339
|
}
|
326
340
|
|
327
341
|
/** @internal */
|