@dynamic-labs/ethereum-aa 4.10.4-preview.1 → 4.10.4-preview.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.
@@ -1,62 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var viem = require('viem');
7
- var zksync = require('viem/zksync');
8
-
9
- const gasPerPubdataDefault = BigInt(50000);
10
- const getEip712Domain = (transaction) => {
11
- const message = transactionToMessage(transaction);
12
- return {
13
- domain: {
14
- chainId: transaction.chainId,
15
- // cspell:ignore zkSync
16
- name: 'zkSync',
17
- version: '2',
18
- },
19
- message: message,
20
- primaryType: 'Transaction',
21
- types: {
22
- Transaction: [
23
- { name: 'txType', type: 'uint256' },
24
- { name: 'from', type: 'uint256' },
25
- { name: 'to', type: 'uint256' },
26
- { name: 'gasLimit', type: 'uint256' },
27
- { name: 'gasPerPubdataByteLimit', type: 'uint256' },
28
- { name: 'maxFeePerGas', type: 'uint256' },
29
- { name: 'maxPriorityFeePerGas', type: 'uint256' },
30
- { name: 'paymaster', type: 'uint256' },
31
- { name: 'nonce', type: 'uint256' },
32
- { name: 'value', type: 'uint256' },
33
- { name: 'data', type: 'bytes' },
34
- { name: 'factoryDeps', type: 'bytes32[]' },
35
- { name: 'paymasterInput', type: 'bytes' },
36
- ],
37
- },
38
- };
39
- };
40
- //////////////////////////////////////////////////////////////////////////////
41
- // Utilities
42
- const transactionToMessage = (transaction) => {
43
- var _a;
44
- const { gas, nonce, to, from, value, maxFeePerGas, maxPriorityFeePerGas, factoryDeps, paymaster, paymasterInput, gasPerPubdata, data, } = transaction;
45
- return {
46
- data: data ? data : '0x0',
47
- factoryDeps: (_a = factoryDeps === null || factoryDeps === void 0 ? void 0 : factoryDeps.map((dep) => viem.toHex(zksync.hashBytecode(dep)))) !== null && _a !== void 0 ? _a : [],
48
- from: BigInt(from),
49
- gasLimit: gas !== null && gas !== void 0 ? gas : BigInt(0),
50
- gasPerPubdataByteLimit: gasPerPubdata !== null && gasPerPubdata !== void 0 ? gasPerPubdata : gasPerPubdataDefault,
51
- maxFeePerGas: maxFeePerGas !== null && maxFeePerGas !== void 0 ? maxFeePerGas : BigInt(0),
52
- maxPriorityFeePerGas: maxPriorityFeePerGas !== null && maxPriorityFeePerGas !== void 0 ? maxPriorityFeePerGas : BigInt(0),
53
- nonce: nonce ? BigInt(nonce) : BigInt(0),
54
- paymaster: paymaster ? BigInt(paymaster) : BigInt(0),
55
- paymasterInput: paymasterInput ? paymasterInput : '0x',
56
- to: to ? BigInt(to) : BigInt(0),
57
- txType: BigInt(113),
58
- value: value !== null && value !== void 0 ? value : BigInt(0),
59
- };
60
- };
61
-
62
- exports.getEip712Domain = getEip712Domain;
@@ -1,2 +0,0 @@
1
- import { type EIP712DomainFn, type ZksyncEIP712TransactionSignable, type ZksyncTransactionSerializable } from 'viem/zksync';
2
- export declare const getEip712Domain: EIP712DomainFn<ZksyncTransactionSerializable, ZksyncEIP712TransactionSignable>;
@@ -1,58 +0,0 @@
1
- 'use client'
2
- import { toHex } from 'viem';
3
- import { hashBytecode } from 'viem/zksync';
4
-
5
- const gasPerPubdataDefault = BigInt(50000);
6
- const getEip712Domain = (transaction) => {
7
- const message = transactionToMessage(transaction);
8
- return {
9
- domain: {
10
- chainId: transaction.chainId,
11
- // cspell:ignore zkSync
12
- name: 'zkSync',
13
- version: '2',
14
- },
15
- message: message,
16
- primaryType: 'Transaction',
17
- types: {
18
- Transaction: [
19
- { name: 'txType', type: 'uint256' },
20
- { name: 'from', type: 'uint256' },
21
- { name: 'to', type: 'uint256' },
22
- { name: 'gasLimit', type: 'uint256' },
23
- { name: 'gasPerPubdataByteLimit', type: 'uint256' },
24
- { name: 'maxFeePerGas', type: 'uint256' },
25
- { name: 'maxPriorityFeePerGas', type: 'uint256' },
26
- { name: 'paymaster', type: 'uint256' },
27
- { name: 'nonce', type: 'uint256' },
28
- { name: 'value', type: 'uint256' },
29
- { name: 'data', type: 'bytes' },
30
- { name: 'factoryDeps', type: 'bytes32[]' },
31
- { name: 'paymasterInput', type: 'bytes' },
32
- ],
33
- },
34
- };
35
- };
36
- //////////////////////////////////////////////////////////////////////////////
37
- // Utilities
38
- const transactionToMessage = (transaction) => {
39
- var _a;
40
- const { gas, nonce, to, from, value, maxFeePerGas, maxPriorityFeePerGas, factoryDeps, paymaster, paymasterInput, gasPerPubdata, data, } = transaction;
41
- return {
42
- data: data ? data : '0x0',
43
- factoryDeps: (_a = factoryDeps === null || factoryDeps === void 0 ? void 0 : factoryDeps.map((dep) => toHex(hashBytecode(dep)))) !== null && _a !== void 0 ? _a : [],
44
- from: BigInt(from),
45
- gasLimit: gas !== null && gas !== void 0 ? gas : BigInt(0),
46
- gasPerPubdataByteLimit: gasPerPubdata !== null && gasPerPubdata !== void 0 ? gasPerPubdata : gasPerPubdataDefault,
47
- maxFeePerGas: maxFeePerGas !== null && maxFeePerGas !== void 0 ? maxFeePerGas : BigInt(0),
48
- maxPriorityFeePerGas: maxPriorityFeePerGas !== null && maxPriorityFeePerGas !== void 0 ? maxPriorityFeePerGas : BigInt(0),
49
- nonce: nonce ? BigInt(nonce) : BigInt(0),
50
- paymaster: paymaster ? BigInt(paymaster) : BigInt(0),
51
- paymasterInput: paymasterInput ? paymasterInput : '0x',
52
- to: to ? BigInt(to) : BigInt(0),
53
- txType: BigInt(113),
54
- value: value !== null && value !== void 0 ? value : BigInt(0),
55
- };
56
- };
57
-
58
- export { getEip712Domain };