@matterlabs/zksync-js 0.0.13 → 0.0.14
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/dist/adapters/ethers/client.cjs +13 -4
- package/dist/adapters/ethers/client.cjs.map +1 -1
- package/dist/adapters/ethers/client.js +7 -6
- package/dist/adapters/ethers/index.cjs +501 -242
- package/dist/adapters/ethers/index.cjs.map +1 -1
- package/dist/adapters/ethers/index.js +10 -9
- package/dist/adapters/ethers/resources/deposits/routes/priority.d.ts +12 -0
- package/dist/adapters/ethers/resources/deposits/services/gas.d.ts +4 -0
- package/dist/adapters/ethers/resources/interop/index.d.ts +14 -14
- package/dist/adapters/ethers/resources/interop/resolvers.d.ts +3 -8
- package/dist/adapters/ethers/resources/interop/routes/types.d.ts +2 -1
- package/dist/adapters/ethers/resources/interop/services/erc20.d.ts +10 -0
- package/dist/adapters/ethers/resources/interop/services/fee.d.ts +12 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/index.d.ts +1 -1
- package/dist/adapters/ethers/resources/interop/services/finalization/polling.d.ts +1 -1
- package/dist/adapters/ethers/resources/interop/types.d.ts +6 -14
- package/dist/adapters/ethers/sdk.cjs +912 -252
- package/dist/adapters/ethers/sdk.cjs.map +1 -1
- package/dist/adapters/ethers/sdk.d.ts +6 -1
- package/dist/adapters/ethers/sdk.js +8 -7
- package/dist/adapters/viem/client.cjs +8 -4
- package/dist/adapters/viem/client.cjs.map +1 -1
- package/dist/adapters/viem/client.js +7 -6
- package/dist/adapters/viem/index.cjs +315 -73
- package/dist/adapters/viem/index.cjs.map +1 -1
- package/dist/adapters/viem/index.js +10 -9
- package/dist/adapters/viem/resources/deposits/routes/priority.d.ts +13 -0
- package/dist/adapters/viem/resources/deposits/services/gas.d.ts +4 -0
- package/dist/adapters/viem/sdk.cjs +307 -69
- package/dist/adapters/viem/sdk.cjs.map +1 -1
- package/dist/adapters/viem/sdk.js +7 -7
- package/dist/{chunk-E3KP7XCG.js → chunk-3HHUZXSV.js} +1 -1
- package/dist/{chunk-UDBRUBEK.js → chunk-5RRJDPAJ.js} +2 -2
- package/dist/{chunk-EDWBCPO3.js → chunk-75IOOODG.js} +253 -53
- package/dist/{chunk-R5WRFPK2.js → chunk-7CAVFIMW.js} +5 -4
- package/dist/chunk-BWKWWLY4.js +9 -0
- package/dist/{chunk-4S4XDA4N.js → chunk-DYJKK5FW.js} +17 -15
- package/dist/{chunk-5L6EYUJB.js → chunk-EOBXYHTZ.js} +35 -7
- package/dist/{chunk-53MC5BR2.js → chunk-HP3EWKJL.js} +1 -1
- package/dist/{chunk-HI64OOAR.js → chunk-J47RI3G7.js} +1 -1
- package/dist/{chunk-RI73VJSH.js → chunk-JY62QO3W.js} +44 -21
- package/dist/{chunk-QQ2OR434.js → chunk-MT4X5FEO.js} +18 -2
- package/dist/{chunk-2RIARDXZ.js → chunk-OTXPSNNC.js} +5 -4
- package/dist/{chunk-5R7L5NM5.js → chunk-XDRCN4FC.js} +2 -2
- package/dist/{chunk-JHO2UQ5F.js → chunk-XKRNLFET.js} +394 -200
- package/dist/core/constants.cjs +17 -1
- package/dist/core/constants.cjs.map +1 -1
- package/dist/core/constants.d.ts +9 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/index.cjs +52 -24
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +6 -5
- package/dist/core/internal/abis/IERC7786Attributes.d.ts +21 -11
- package/dist/core/internal/abis/IInteropCenter.d.ts +4 -0
- package/dist/core/resources/deposits/priority.d.ts +37 -0
- package/dist/core/resources/interop/attributes/bundle.d.ts +1 -0
- package/dist/core/resources/interop/attributes/resource.d.ts +1 -0
- package/dist/core/resources/interop/plan.d.ts +11 -3
- package/dist/core/rpc/types.d.ts +1 -0
- package/dist/core/rpc/zks.d.ts +5 -1
- package/dist/core/types/errors.d.ts +5 -0
- package/dist/core/types/flows/interop.d.ts +11 -18
- package/dist/index.cjs +69 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { pickDepositRoute } from '../chunk-
|
|
2
|
-
export { findL1MessageSentLog, isL1MessageSentLog, messengerLogIndex, pickWithdrawRoute } from '../chunk-
|
|
3
|
-
export { makeTransportFromEthers, makeTransportFromViem
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { pickDepositRoute } from '../chunk-J47RI3G7.js';
|
|
2
|
+
export { findL1MessageSentLog, isL1MessageSentLog, messengerLogIndex, pickWithdrawRoute } from '../chunk-3HHUZXSV.js';
|
|
3
|
+
export { makeTransportFromEthers, makeTransportFromViem } from '../chunk-BWKWWLY4.js';
|
|
4
|
+
export { zks_exports as zksRpc } from '../chunk-DYJKK5FW.js';
|
|
5
|
+
export { abi_exports as abi, factory_exports as errors, formatEnvelopePretty, hexEq, isAddress, isAddressEq, isETH, isHash, isHash66, isHash66Array, isHashArray, normalizeAddrEq, normalizeL1Token } from '../chunk-JY62QO3W.js';
|
|
6
|
+
export { ETH_ADDRESS, FORMAL_ETH_ADDRESS, L1_MESSENGER_ADDRESS, L1_SOPH_TOKEN_ADDRESS, L2_ASSET_ROUTER_ADDRESS, L2_BASE_TOKEN_ADDRESS, L2_NATIVE_TOKEN_VAULT_ADDRESS } from '../chunk-MT4X5FEO.js';
|
|
@@ -1,42 +1,52 @@
|
|
|
1
1
|
declare const IERC7786AttributesABI: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly name: "executionAddress";
|
|
2
4
|
readonly inputs: readonly [{
|
|
3
|
-
readonly internalType: "bytes";
|
|
4
5
|
readonly name: "_executionAddress";
|
|
5
6
|
readonly type: "bytes";
|
|
7
|
+
readonly internalType: "bytes";
|
|
6
8
|
}];
|
|
7
|
-
readonly name: "executionAddress";
|
|
8
9
|
readonly outputs: readonly [];
|
|
9
10
|
readonly stateMutability: "pure";
|
|
10
|
-
readonly type: "function";
|
|
11
11
|
}, {
|
|
12
|
+
readonly type: "function";
|
|
13
|
+
readonly name: "indirectCall";
|
|
12
14
|
readonly inputs: readonly [{
|
|
13
|
-
readonly internalType: "uint256";
|
|
14
15
|
readonly name: "_indirectCallMessageValue";
|
|
15
16
|
readonly type: "uint256";
|
|
17
|
+
readonly internalType: "uint256";
|
|
16
18
|
}];
|
|
17
|
-
readonly name: "indirectCall";
|
|
18
19
|
readonly outputs: readonly [];
|
|
19
20
|
readonly stateMutability: "pure";
|
|
20
|
-
readonly type: "function";
|
|
21
21
|
}, {
|
|
22
|
+
readonly type: "function";
|
|
23
|
+
readonly name: "interopCallValue";
|
|
22
24
|
readonly inputs: readonly [{
|
|
23
|
-
readonly internalType: "uint256";
|
|
24
25
|
readonly name: "_interopCallValue";
|
|
25
26
|
readonly type: "uint256";
|
|
27
|
+
readonly internalType: "uint256";
|
|
26
28
|
}];
|
|
27
|
-
readonly name: "interopCallValue";
|
|
28
29
|
readonly outputs: readonly [];
|
|
29
30
|
readonly stateMutability: "pure";
|
|
30
|
-
readonly type: "function";
|
|
31
31
|
}, {
|
|
32
|
+
readonly type: "function";
|
|
33
|
+
readonly name: "unbundlerAddress";
|
|
32
34
|
readonly inputs: readonly [{
|
|
33
|
-
readonly internalType: "bytes";
|
|
34
35
|
readonly name: "_unbundlerAddress";
|
|
35
36
|
readonly type: "bytes";
|
|
37
|
+
readonly internalType: "bytes";
|
|
36
38
|
}];
|
|
37
|
-
readonly name: "unbundlerAddress";
|
|
38
39
|
readonly outputs: readonly [];
|
|
39
40
|
readonly stateMutability: "pure";
|
|
41
|
+
}, {
|
|
40
42
|
readonly type: "function";
|
|
43
|
+
readonly name: "useFixedFee";
|
|
44
|
+
readonly inputs: readonly [{
|
|
45
|
+
readonly name: "_useFixed";
|
|
46
|
+
readonly type: "bool";
|
|
47
|
+
readonly internalType: "bool";
|
|
48
|
+
}];
|
|
49
|
+
readonly outputs: readonly [];
|
|
50
|
+
readonly stateMutability: "pure";
|
|
41
51
|
}];
|
|
42
52
|
export default IERC7786AttributesABI;
|
|
@@ -358,6 +358,10 @@ declare const IInteropCenterABI: readonly [{
|
|
|
358
358
|
readonly name: "destinationChainId";
|
|
359
359
|
readonly type: "uint256";
|
|
360
360
|
readonly internalType: "uint256";
|
|
361
|
+
}, {
|
|
362
|
+
readonly name: "destinationBaseTokenAssetId";
|
|
363
|
+
readonly type: "bytes32";
|
|
364
|
+
readonly internalType: "bytes32";
|
|
361
365
|
}, {
|
|
362
366
|
readonly name: "interopBundleSalt";
|
|
363
367
|
readonly type: "bytes32";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Address } from '../../types/primitives';
|
|
2
|
+
export type PriorityTxGasBreakdown = {
|
|
3
|
+
encodedLength: bigint;
|
|
4
|
+
minBodyGas: bigint;
|
|
5
|
+
overhead: bigint;
|
|
6
|
+
derivedBodyGas: bigint;
|
|
7
|
+
derivedL2GasLimit: bigint;
|
|
8
|
+
priorityTxMaxGasLimit: bigint;
|
|
9
|
+
priorityTxMaxGasLimitExceeded: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const DEFAULT_PRIORITY_BODY_GAS_ESTIMATE_MULTIPLIER = 6n;
|
|
12
|
+
export declare function applyL1ToL2Alias(address: Address): Address;
|
|
13
|
+
/**
|
|
14
|
+
* Mirrors the priority-tx floor math used by ZKsync's TransactionValidator.
|
|
15
|
+
* Source of truth for constants:
|
|
16
|
+
* https://github.com/matter-labs/era-contracts/blob/main/l1-contracts/contracts/common/Config.sol
|
|
17
|
+
* Mailbox encodes the priority transaction with `abi.encode(transaction)` before validation, and
|
|
18
|
+
* TransactionValidator uses that encoded length to derive the minimum body gas and overhead.
|
|
19
|
+
*/
|
|
20
|
+
export declare function derivePriorityTxGasBreakdown(input: {
|
|
21
|
+
encodedLength: bigint;
|
|
22
|
+
gasPerPubdata: bigint;
|
|
23
|
+
factoryDepsCount?: bigint;
|
|
24
|
+
}): PriorityTxGasBreakdown;
|
|
25
|
+
/**
|
|
26
|
+
* Exact L2 estimateGas can overestimate substantially for first-bridge token deployment paths.
|
|
27
|
+
* Keep the protocol floor as the lower bound, but cap pathological estimates to a multiple of the floor.
|
|
28
|
+
*/
|
|
29
|
+
export declare function clampPriorityBodyGasEstimate(input: {
|
|
30
|
+
rawBodyGas: bigint;
|
|
31
|
+
minBodyGas: bigint;
|
|
32
|
+
multiplier?: bigint;
|
|
33
|
+
}): bigint;
|
|
34
|
+
export declare function derivePriorityBodyGasEstimateCap(input: {
|
|
35
|
+
minBodyGas: bigint;
|
|
36
|
+
multiplier?: bigint;
|
|
37
|
+
}): bigint;
|
|
@@ -7,6 +7,7 @@ export declare function createAttributesResource(codec: AttributesCodec): {
|
|
|
7
7
|
bundle: {
|
|
8
8
|
executionAddress: (executor: import("../../..").Address) => import("../../..").Hex;
|
|
9
9
|
unbundlerAddress: (addr: import("../../..").Address) => import("../../..").Hex;
|
|
10
|
+
useFixedFee: (enabled: boolean) => import("../../..").Hex;
|
|
10
11
|
};
|
|
11
12
|
};
|
|
12
13
|
export type AttributesResource = ReturnType<typeof createAttributesResource>;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { Address, Hex } from '../../types/primitives';
|
|
2
2
|
import type { ApprovalNeed } from '../../types/flows/base';
|
|
3
|
-
import type { InteropParams } from '../../types/flows/interop';
|
|
3
|
+
import type { InteropParams, InteropFee } from '../../types/flows/interop';
|
|
4
4
|
export type InteropStarter = [Hex, Hex, Hex[]];
|
|
5
|
+
/** Fee token and amount to include in quoteExtras. */
|
|
6
|
+
export interface InteropFeeInfo {
|
|
7
|
+
/** Approval needed to cover the fee (ZK fixed-fee path). null = no approval needed. */
|
|
8
|
+
approval: ApprovalNeed | null;
|
|
9
|
+
/** Interop fee token address and total fee amount. fee.amount is added to msg.value for protocol-fee path. */
|
|
10
|
+
fee: InteropFee;
|
|
11
|
+
}
|
|
5
12
|
export interface InteropBundleBuild {
|
|
6
13
|
dstChain: Hex;
|
|
7
14
|
starters: InteropStarter[];
|
|
8
15
|
bundleAttributes: Hex[];
|
|
9
16
|
approvals: ApprovalNeed[];
|
|
17
|
+
interopFee: InteropFee;
|
|
10
18
|
quoteExtras: {
|
|
11
19
|
totalActionValue: bigint;
|
|
12
20
|
bridgedTokenTotal: bigint;
|
|
@@ -34,6 +42,6 @@ export interface InteropStarterData {
|
|
|
34
42
|
assetRouterPayload?: Hex;
|
|
35
43
|
}
|
|
36
44
|
export declare function preflightDirect(params: InteropParams, ctx: InteropBuildCtx): void;
|
|
37
|
-
export declare function buildDirectBundle(params: InteropParams, ctx: InteropBuildCtx, attrs: InteropAttributes): InteropBundleBuild;
|
|
45
|
+
export declare function buildDirectBundle(params: InteropParams, ctx: InteropBuildCtx, attrs: InteropAttributes, interopFeeInfo: InteropFeeInfo): InteropBundleBuild;
|
|
38
46
|
export declare function preflightIndirect(params: InteropParams, ctx: InteropBuildCtx): void;
|
|
39
|
-
export declare function buildIndirectBundle(params: InteropParams, ctx: InteropBuildCtx, attrs: InteropAttributes, starterData: InteropStarterData[]): InteropBundleBuild;
|
|
47
|
+
export declare function buildIndirectBundle(params: InteropParams, ctx: InteropBuildCtx, attrs: InteropAttributes, starterData: InteropStarterData[], interopFeeInfo: InteropFeeInfo): InteropBundleBuild;
|
package/dist/core/rpc/types.d.ts
CHANGED
package/dist/core/rpc/zks.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { RpcTransport, ReceiptWithL2ToL1, ProofNormalized, GenesisInput, BlockMetadata } from './types';
|
|
2
2
|
import type { Hex, Address } from '../types/primitives';
|
|
3
|
+
export declare enum ProofTarget {
|
|
4
|
+
L1BatchRoot = "l1BatchRoot",
|
|
5
|
+
MessageRoot = "messageRoot"
|
|
6
|
+
}
|
|
3
7
|
/** ZKsync-specific RPC methods. */
|
|
4
8
|
export interface ZksRpc {
|
|
5
9
|
getBridgehubAddress(): Promise<Address>;
|
|
6
10
|
getBytecodeSupplierAddress(): Promise<Address>;
|
|
7
|
-
getL2ToL1LogProof(txHash: Hex, index: number): Promise<ProofNormalized>;
|
|
11
|
+
getL2ToL1LogProof(txHash: Hex, index: number, proofTarget?: ProofTarget): Promise<ProofNormalized>;
|
|
8
12
|
getReceiptWithL2ToL1(txHash: Hex): Promise<ReceiptWithL2ToL1 | null>;
|
|
9
13
|
getBlockMetadataByNumber(blockNumber: number): Promise<BlockMetadata | null>;
|
|
10
14
|
getGenesis(): Promise<GenesisInput>;
|
|
@@ -224,5 +224,10 @@ export declare const OP_INTEROP: {
|
|
|
224
224
|
readonly poll: "interop.svc.wait:poll";
|
|
225
225
|
readonly timeout: "interop.svc.wait:timeout";
|
|
226
226
|
};
|
|
227
|
+
readonly fees: {
|
|
228
|
+
readonly zkInteropFee: "interop.svc.fees:zkInteropFee";
|
|
229
|
+
readonly zkToken: "interop.svc.fees:zkToken";
|
|
230
|
+
readonly protocolFee: "interop.svc.fees:protocolFee";
|
|
231
|
+
};
|
|
227
232
|
};
|
|
228
233
|
};
|
|
@@ -43,9 +43,18 @@ export interface InteropParams {
|
|
|
43
43
|
unbundling?: {
|
|
44
44
|
by: Address;
|
|
45
45
|
};
|
|
46
|
+
/** Optional: true - to use fixed ZK fee for the bundle, false - to use dynamic base token fee */
|
|
47
|
+
fee?: {
|
|
48
|
+
useFixed: boolean;
|
|
49
|
+
};
|
|
46
50
|
/** Optional: Gas overrides for L2 transaction */
|
|
47
51
|
txOverrides?: TxOverrides;
|
|
48
52
|
}
|
|
53
|
+
/** Fee token address and total fee amount. Amount is added to msg.value for protocol-fee path. */
|
|
54
|
+
export interface InteropFee {
|
|
55
|
+
token: Address;
|
|
56
|
+
amount: bigint;
|
|
57
|
+
}
|
|
49
58
|
/**
|
|
50
59
|
* Cost and approval quote for an interop operation before execution.
|
|
51
60
|
* Provides fee estimates and required token approvals.
|
|
@@ -59,6 +68,8 @@ export interface InteropQuote {
|
|
|
59
68
|
totalActionValue: bigint;
|
|
60
69
|
/** Total ERC-20 token amounts to be bridged */
|
|
61
70
|
bridgedTokenTotal: bigint;
|
|
71
|
+
/** Interop fee details */
|
|
72
|
+
interopFee: InteropFee;
|
|
62
73
|
/** Optional: Estimated L1 fee */
|
|
63
74
|
l1Fee?: bigint;
|
|
64
75
|
/** Optional: Estimated L2 fee */
|
|
@@ -131,22 +142,6 @@ export interface InteropStatus {
|
|
|
131
142
|
/** Destination chain execution transaction hash */
|
|
132
143
|
dstExecTxHash?: Hex;
|
|
133
144
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Interop expected root data.
|
|
136
|
-
*/
|
|
137
|
-
export interface InteropExpectedRoot {
|
|
138
|
-
/** Chain ID where the state root is published (settlement layer) */
|
|
139
|
-
rootChainId: bigint;
|
|
140
|
-
/** Batch number containing the interop message */
|
|
141
|
-
batchNumber: bigint;
|
|
142
|
-
/** Expected merkle root hash for verification */
|
|
143
|
-
expectedRoot: Hex;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Type guard to safely check if an object is InteropExpectedRoot.
|
|
147
|
-
* Validates all required and nested fields.
|
|
148
|
-
*/
|
|
149
|
-
export declare function isInteropExpectedRoot(obj: unknown): obj is InteropExpectedRoot;
|
|
150
145
|
/**
|
|
151
146
|
* Interop message proof.
|
|
152
147
|
*/
|
|
@@ -184,8 +179,6 @@ export interface InteropFinalizationInfo {
|
|
|
184
179
|
bundleHash: Hex;
|
|
185
180
|
/** Destination chain ID (EIP-155 format) */
|
|
186
181
|
dstChainId: bigint;
|
|
187
|
-
/** Expected state root for batch verification */
|
|
188
|
-
expectedRoot: InteropExpectedRoot;
|
|
189
182
|
/** Interop message proof */
|
|
190
183
|
proof: InteropMessageProof;
|
|
191
184
|
/** Encoded calldata for the finalization transaction */
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,12 @@ __export(constants_exports, {
|
|
|
22
22
|
L1_FEE_ESTIMATION_COEF_NUMERATOR: () => L1_FEE_ESTIMATION_COEF_NUMERATOR,
|
|
23
23
|
L1_MESSENGER_ADDRESS: () => L1_MESSENGER_ADDRESS,
|
|
24
24
|
L1_SOPH_TOKEN_ADDRESS: () => L1_SOPH_TOKEN_ADDRESS,
|
|
25
|
+
L1_TX_DELTA_544_ENCODING_BYTES: () => L1_TX_DELTA_544_ENCODING_BYTES,
|
|
26
|
+
L1_TX_DELTA_FACTORY_DEPS_L2_GAS: () => L1_TX_DELTA_FACTORY_DEPS_L2_GAS,
|
|
27
|
+
L1_TX_DELTA_FACTORY_DEPS_PUBDATA: () => L1_TX_DELTA_FACTORY_DEPS_PUBDATA,
|
|
28
|
+
L1_TX_INTRINSIC_L2_GAS: () => L1_TX_INTRINSIC_L2_GAS,
|
|
29
|
+
L1_TX_INTRINSIC_PUBDATA: () => L1_TX_INTRINSIC_PUBDATA,
|
|
30
|
+
L1_TX_MIN_L2_GAS_BASE: () => L1_TX_MIN_L2_GAS_BASE,
|
|
25
31
|
L2_ASSET_ROUTER_ADDRESS: () => L2_ASSET_ROUTER_ADDRESS,
|
|
26
32
|
L2_BASE_TOKEN_ADDRESS: () => L2_BASE_TOKEN_ADDRESS,
|
|
27
33
|
L2_INTEROP_CENTER_ADDRESS: () => L2_INTEROP_CENTER_ADDRESS,
|
|
@@ -29,6 +35,7 @@ __export(constants_exports, {
|
|
|
29
35
|
L2_INTEROP_ROOT_STORAGE_ADDRESS: () => L2_INTEROP_ROOT_STORAGE_ADDRESS,
|
|
30
36
|
L2_MESSAGE_VERIFICATION_ADDRESS: () => L2_MESSAGE_VERIFICATION_ADDRESS,
|
|
31
37
|
L2_NATIVE_TOKEN_VAULT_ADDRESS: () => L2_NATIVE_TOKEN_VAULT_ADDRESS,
|
|
38
|
+
PRIORITY_TX_MAX_GAS_LIMIT: () => PRIORITY_TX_MAX_GAS_LIMIT,
|
|
32
39
|
SAFE_L1_BRIDGE_GAS: () => SAFE_L1_BRIDGE_GAS,
|
|
33
40
|
TOPIC_CANONICAL_ASSIGNED: () => TOPIC_CANONICAL_ASSIGNED,
|
|
34
41
|
TOPIC_CANONICAL_SUCCESS: () => TOPIC_CANONICAL_SUCCESS,
|
|
@@ -37,6 +44,7 @@ __export(constants_exports, {
|
|
|
37
44
|
TOPIC_L1_MESSAGE_SENT_NEW: () => TOPIC_L1_MESSAGE_SENT_NEW,
|
|
38
45
|
TX_MEMORY_OVERHEAD_GAS: () => TX_MEMORY_OVERHEAD_GAS,
|
|
39
46
|
TX_OVERHEAD_GAS: () => TX_OVERHEAD_GAS,
|
|
47
|
+
TX_SLOT_OVERHEAD_L2_GAS: () => TX_SLOT_OVERHEAD_L2_GAS,
|
|
40
48
|
k256hex: () => k256hex
|
|
41
49
|
});
|
|
42
50
|
var k256hex = (s) => `0x${utils.bytesToHex(sha3.keccak_256(utils.utf8ToBytes(s)))}`.toLowerCase();
|
|
@@ -62,7 +70,15 @@ var TX_OVERHEAD_GAS = 10000n;
|
|
|
62
70
|
var TX_MEMORY_OVERHEAD_GAS = 10n;
|
|
63
71
|
var DEFAULT_PUBDATA_BYTES = 155n;
|
|
64
72
|
var DEFAULT_ABI_BYTES = 400n;
|
|
65
|
-
var SAFE_L1_BRIDGE_GAS =
|
|
73
|
+
var SAFE_L1_BRIDGE_GAS = 3000000n;
|
|
74
|
+
var L1_TX_INTRINSIC_L2_GAS = 167157n;
|
|
75
|
+
var L1_TX_INTRINSIC_PUBDATA = 88n;
|
|
76
|
+
var L1_TX_MIN_L2_GAS_BASE = 173484n;
|
|
77
|
+
var L1_TX_DELTA_544_ENCODING_BYTES = 1656n;
|
|
78
|
+
var L1_TX_DELTA_FACTORY_DEPS_L2_GAS = 2473n;
|
|
79
|
+
var L1_TX_DELTA_FACTORY_DEPS_PUBDATA = 64n;
|
|
80
|
+
var TX_SLOT_OVERHEAD_L2_GAS = 10000n;
|
|
81
|
+
var PRIORITY_TX_MAX_GAS_LIMIT = 72000000n;
|
|
66
82
|
var L1_FEE_ESTIMATION_COEF_NUMERATOR = 12;
|
|
67
83
|
var L1_FEE_ESTIMATION_COEF_DENOMINATOR = 10;
|
|
68
84
|
|
|
@@ -4202,56 +4218,69 @@ var IERC20_default = IERC20ABI;
|
|
|
4202
4218
|
// src/core/internal/abis/IERC7786Attributes.ts
|
|
4203
4219
|
var IERC7786AttributesABI = [
|
|
4204
4220
|
{
|
|
4221
|
+
type: "function",
|
|
4222
|
+
name: "executionAddress",
|
|
4205
4223
|
inputs: [
|
|
4206
4224
|
{
|
|
4207
|
-
internalType: "bytes",
|
|
4208
4225
|
name: "_executionAddress",
|
|
4209
|
-
type: "bytes"
|
|
4226
|
+
type: "bytes",
|
|
4227
|
+
internalType: "bytes"
|
|
4210
4228
|
}
|
|
4211
4229
|
],
|
|
4212
|
-
name: "executionAddress",
|
|
4213
4230
|
outputs: [],
|
|
4214
|
-
stateMutability: "pure"
|
|
4215
|
-
type: "function"
|
|
4231
|
+
stateMutability: "pure"
|
|
4216
4232
|
},
|
|
4217
4233
|
{
|
|
4234
|
+
type: "function",
|
|
4235
|
+
name: "indirectCall",
|
|
4218
4236
|
inputs: [
|
|
4219
4237
|
{
|
|
4220
|
-
internalType: "uint256",
|
|
4221
4238
|
name: "_indirectCallMessageValue",
|
|
4222
|
-
type: "uint256"
|
|
4239
|
+
type: "uint256",
|
|
4240
|
+
internalType: "uint256"
|
|
4223
4241
|
}
|
|
4224
4242
|
],
|
|
4225
|
-
name: "indirectCall",
|
|
4226
4243
|
outputs: [],
|
|
4227
|
-
stateMutability: "pure"
|
|
4228
|
-
type: "function"
|
|
4244
|
+
stateMutability: "pure"
|
|
4229
4245
|
},
|
|
4230
4246
|
{
|
|
4247
|
+
type: "function",
|
|
4248
|
+
name: "interopCallValue",
|
|
4231
4249
|
inputs: [
|
|
4232
4250
|
{
|
|
4233
|
-
internalType: "uint256",
|
|
4234
4251
|
name: "_interopCallValue",
|
|
4235
|
-
type: "uint256"
|
|
4252
|
+
type: "uint256",
|
|
4253
|
+
internalType: "uint256"
|
|
4236
4254
|
}
|
|
4237
4255
|
],
|
|
4238
|
-
name: "interopCallValue",
|
|
4239
4256
|
outputs: [],
|
|
4240
|
-
stateMutability: "pure"
|
|
4241
|
-
type: "function"
|
|
4257
|
+
stateMutability: "pure"
|
|
4242
4258
|
},
|
|
4243
4259
|
{
|
|
4260
|
+
type: "function",
|
|
4261
|
+
name: "unbundlerAddress",
|
|
4244
4262
|
inputs: [
|
|
4245
4263
|
{
|
|
4246
|
-
internalType: "bytes",
|
|
4247
4264
|
name: "_unbundlerAddress",
|
|
4248
|
-
type: "bytes"
|
|
4265
|
+
type: "bytes",
|
|
4266
|
+
internalType: "bytes"
|
|
4249
4267
|
}
|
|
4250
4268
|
],
|
|
4251
|
-
name: "unbundlerAddress",
|
|
4252
4269
|
outputs: [],
|
|
4253
|
-
stateMutability: "pure"
|
|
4254
|
-
|
|
4270
|
+
stateMutability: "pure"
|
|
4271
|
+
},
|
|
4272
|
+
{
|
|
4273
|
+
type: "function",
|
|
4274
|
+
name: "useFixedFee",
|
|
4275
|
+
inputs: [
|
|
4276
|
+
{
|
|
4277
|
+
name: "_useFixed",
|
|
4278
|
+
type: "bool",
|
|
4279
|
+
internalType: "bool"
|
|
4280
|
+
}
|
|
4281
|
+
],
|
|
4282
|
+
outputs: [],
|
|
4283
|
+
stateMutability: "pure"
|
|
4255
4284
|
}
|
|
4256
4285
|
];
|
|
4257
4286
|
var IERC7786Attributes_default = IERC7786AttributesABI;
|
|
@@ -5099,6 +5128,11 @@ var IInteropCenterABI = [
|
|
|
5099
5128
|
type: "uint256",
|
|
5100
5129
|
internalType: "uint256"
|
|
5101
5130
|
},
|
|
5131
|
+
{
|
|
5132
|
+
name: "destinationBaseTokenAssetId",
|
|
5133
|
+
type: "bytes32",
|
|
5134
|
+
internalType: "bytes32"
|
|
5135
|
+
},
|
|
5102
5136
|
{
|
|
5103
5137
|
name: "interopBundleSalt",
|
|
5104
5138
|
type: "bytes32",
|
|
@@ -6930,6 +6964,7 @@ function shapeCause(err) {
|
|
|
6930
6964
|
// src/core/rpc/zks.ts
|
|
6931
6965
|
var zks_exports = {};
|
|
6932
6966
|
__export(zks_exports, {
|
|
6967
|
+
ProofTarget: () => ProofTarget,
|
|
6933
6968
|
createZksRpc: () => createZksRpc,
|
|
6934
6969
|
normalizeBlockMetadata: () => normalizeBlockMetadata,
|
|
6935
6970
|
normalizeGenesis: () => normalizeGenesis,
|
|
@@ -6953,6 +6988,11 @@ async function withRpcOp(operation, message, ctx, fn) {
|
|
|
6953
6988
|
}
|
|
6954
6989
|
|
|
6955
6990
|
// src/core/rpc/zks.ts
|
|
6991
|
+
var ProofTarget = /* @__PURE__ */ ((ProofTarget2) => {
|
|
6992
|
+
ProofTarget2["L1BatchRoot"] = "l1BatchRoot";
|
|
6993
|
+
ProofTarget2["MessageRoot"] = "messageRoot";
|
|
6994
|
+
return ProofTarget2;
|
|
6995
|
+
})(ProofTarget || {});
|
|
6956
6996
|
var METHODS = {
|
|
6957
6997
|
getBridgehub: "zks_getBridgehubContract",
|
|
6958
6998
|
getL2ToL1LogProof: "zks_getL2ToL1LogProof",
|
|
@@ -6970,6 +7010,7 @@ function normalizeProof(p) {
|
|
|
6970
7010
|
const raw = p ?? {};
|
|
6971
7011
|
const idRaw = raw?.id ?? raw?.index;
|
|
6972
7012
|
const bnRaw = raw?.batch_number ?? raw?.batchNumber;
|
|
7013
|
+
const gwBlockNumberRaw = raw?.gatewayBlockNumber;
|
|
6973
7014
|
if (idRaw == null || bnRaw == null) {
|
|
6974
7015
|
throw createError("RPC", {
|
|
6975
7016
|
resource: "zksrpc",
|
|
@@ -6990,7 +7031,8 @@ function normalizeProof(p) {
|
|
|
6990
7031
|
id: toBig(idRaw),
|
|
6991
7032
|
batchNumber: toBig(bnRaw),
|
|
6992
7033
|
proof: toHexArray(raw?.proof),
|
|
6993
|
-
root: raw.root
|
|
7034
|
+
root: raw.root,
|
|
7035
|
+
gatewayBlockNumber: gwBlockNumberRaw != null ? toBig(gwBlockNumberRaw) : void 0
|
|
6994
7036
|
};
|
|
6995
7037
|
} catch (e) {
|
|
6996
7038
|
if (isZKsyncError(e)) throw e;
|
|
@@ -7267,13 +7309,15 @@ function createZksRpc(transport) {
|
|
|
7267
7309
|
);
|
|
7268
7310
|
},
|
|
7269
7311
|
// Fetches a proof for an L2→L1 log emitted in the given transaction.
|
|
7270
|
-
async getL2ToL1LogProof(txHash, index) {
|
|
7312
|
+
async getL2ToL1LogProof(txHash, index, proofTarget) {
|
|
7271
7313
|
return withRpcOp(
|
|
7272
7314
|
"zksrpc.getL2ToL1LogProof",
|
|
7273
7315
|
"Failed to fetch L2\u2192L1 log proof.",
|
|
7274
|
-
{ txHash, index },
|
|
7316
|
+
{ txHash, index, proofTarget },
|
|
7275
7317
|
async () => {
|
|
7276
|
-
const
|
|
7318
|
+
const params = [txHash, index];
|
|
7319
|
+
if (proofTarget != void 0) params.push(proofTarget);
|
|
7320
|
+
const proof = await transport(METHODS.getL2ToL1LogProof, params);
|
|
7277
7321
|
if (!proof) {
|
|
7278
7322
|
throw createError("STATE", {
|
|
7279
7323
|
resource: "zksrpc",
|