@matterlabs/zksync-js 0.0.24 → 0.0.26

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,5 +1,5 @@
1
- export { buildDirectRequestStruct, createContractsResource, createDepositsResource, createFinalizationServices, createInteropFinalizationServices, createInteropResource, createTokensResource, createViemSdk, createWithdrawalProtocolService, createWithdrawalsResource, encodeNativeTokenVaultTransferData, encodeSecondBridgeArgs, encodeSecondBridgeDataV1, encodeSecondBridgeErc20Args, encodeSecondBridgeEthArgs, getL2TransactionHashFromLogs } from '../../chunk-QMMFUWRV.js';
2
- import '../../chunk-5S63J6DW.js';
1
+ export { buildDirectRequestStruct, createContractsResource, createDepositsResource, createFinalizationServices, createInteropFinalizationServices, createInteropResource, createTokensResource, createViemSdk, createWithdrawalProtocolService, createWithdrawalsResource, encodeNativeTokenVaultTransferData, encodeSecondBridgeArgs, encodeSecondBridgeDataV1, encodeSecondBridgeErc20Args, encodeSecondBridgeEthArgs, getL2TransactionHashFromLogs } from '../../chunk-VVDJFIXV.js';
2
+ import '../../chunk-FMBQ7PVA.js';
3
3
  import '../../chunk-BQ2YCWV2.js';
4
4
  import '../../chunk-OEUDZFXH.js';
5
5
  export { createViemClient as createClient, createViemClient } from '../../chunk-YEA74D2L.js';
@@ -2,5 +2,6 @@ import type { BuildCtx } from '../context';
2
2
  export type QuoteL2BaseCostInput = {
3
3
  ctx: BuildCtx;
4
4
  l2GasLimit: bigint;
5
+ l1GasPrice: bigint;
5
6
  };
6
7
  export declare function quoteL2BaseCost(input: QuoteL2BaseCostInput): Promise<bigint>;
@@ -3,9 +3,9 @@ import type { BuildCtx } from '../context';
3
3
  import type { DepositRoute } from '../../../../../core/types/flows/deposits';
4
4
  import type { TxGasOverrides } from '../../../../../core/types/fees';
5
5
  import type { Address } from '../../../../../core/types/primitives';
6
- import { type GasQuote } from '../../../../../core/resources/deposits/gas';
6
+ import { type GasQuote, type L1Fees } from '../../../../../core/resources/deposits/gas';
7
7
  import { type PriorityTxL2Leg } from '../../../../../core/resources/deposits/priority.ts';
8
- export type { GasQuote };
8
+ export type { GasQuote, L1Fees };
9
9
  export type QuoteL1GasInput = {
10
10
  ctx: BuildCtx;
11
11
  tx: TransactionRequest;
@@ -19,6 +19,13 @@ export type QuoteL2GasInput = {
19
19
  overrideGasLimit?: bigint;
20
20
  stateOverrides?: Record<string, unknown>;
21
21
  };
22
+ /**
23
+ * Resolve the fees the deposit's L1 bridge tx is sent with.
24
+ * The L2 base cost must be quoted at the returned maxFeePerGas.
25
+ */
26
+ export declare function quoteL1Fees(input: {
27
+ ctx: BuildCtx;
28
+ }): Promise<L1Fees>;
22
29
  /**
23
30
  * Quote L1 gas for a deposit transaction.
24
31
  */
@@ -27,6 +34,19 @@ export declare function quoteL1Gas(input: QuoteL1GasInput): Promise<GasQuote | u
27
34
  * Quote L2 gas for an L2 execution.
28
35
  */
29
36
  export declare function quoteL2Gas(input: QuoteL2GasInput): Promise<GasQuote | undefined>;
37
+ /**
38
+ * `l2GasLimit` for a base-token deposit (`requestL2TransactionDirect`). An explicit
39
+ * `ctx.l2GasLimit` wins. EraVM chains use the protocol floor. ZKsync OS chains use the node's
40
+ * estimate of the real L2 call, floored by the protocol minimum. When L1 cannot be read, the chain
41
+ * is treated as a ZKsync OS rollup, which only errs toward a higher limit.
42
+ */
43
+ export declare function determineBaseL2GasLimit(input: {
44
+ ctx: BuildCtx;
45
+ l2Contract: Address;
46
+ l2Value: bigint;
47
+ l2Calldata: `0x${string}`;
48
+ priorityFloorGasLimit: bigint;
49
+ }): Promise<bigint>;
30
50
  export declare function determineErc20L2Gas(input: {
31
51
  ctx: BuildCtx;
32
52
  l1Token: Address;