@matterlabs/zksync-js 0.0.23 → 0.0.24

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,7 +1,7 @@
1
- export { createEthersClient } from '../../chunk-URHDNDFN.js';
2
- import '../../chunk-TUN6NH5D.js';
1
+ export { createEthersClient } from '../../chunk-PNTR5FTL.js';
2
+ import '../../chunk-RZH7HBH3.js';
3
3
  import '../../chunk-UMPAKZCQ.js';
4
4
  import '../../chunk-BWKWWLY4.js';
5
- import '../../chunk-4GPIHYVF.js';
6
- import '../../chunk-2DDJFHHD.js';
5
+ import '../../chunk-4ZANKNIK.js';
6
+ import '../../chunk-JNS4XZE2.js';
7
7
  import '../../chunk-3IPSDGHO.js';
@@ -329,7 +329,7 @@ var OP_DEPOSITS = {
329
329
  ethNonBase: {
330
330
  allowanceBase: "deposits.eth-nonbase:allowanceBaseToken",
331
331
  ethBalance: "deposits.eth-nonbase:getEthBalance",
332
- encodeCalldata: "deposits.eth-nonbase:encodeSecondBridgeEthArgs",
332
+ encodeCalldata: "deposits.eth-nonbase:encodeSecondBridgeEthDepositCalldata",
333
333
  assertEthAsset: "deposits.eth-nonbase:assertEthAsset",
334
334
  assertNonEthBase: "deposits.eth-nonbase:assertNonEthBase",
335
335
  assertEthBalance: "deposits.eth-nonbase:assertEthBalance"
@@ -9219,6 +9219,20 @@ var ntvCodec2 = createNTVCodec({
9219
9219
  encode: (types, values) => ethers.AbiCoder.defaultAbiCoder().encode(types, values),
9220
9220
  keccak256: (data) => ethers.keccak256(data)
9221
9221
  });
9222
+ async function encodeSecondBridgeEthDepositCalldata(input) {
9223
+ const registeredAssetId = input.ctx.resolvedToken?.assetId;
9224
+ const assetId = registeredAssetId && registeredAssetId.toLowerCase() !== ZERO_ASSET_ID2 ? registeredAssetId : ntvCodec2.encodeAssetId(
9225
+ BigInt((await input.ctx.client.l1.getNetwork()).chainId),
9226
+ L2_NATIVE_TOKEN_VAULT_ADDRESS,
9227
+ ETH_ADDRESS
9228
+ );
9229
+ const transferData = encodeNativeTokenVaultTransferData(
9230
+ input.amount,
9231
+ input.receiver,
9232
+ ETH_ADDRESS
9233
+ );
9234
+ return encodeSecondBridgeDataV1(assetId, transferData);
9235
+ }
9222
9236
  async function getPriorityGasModel2(input) {
9223
9237
  try {
9224
9238
  const l1AssetRouter = await input.ctx.contracts.l1AssetRouter();
@@ -9372,10 +9386,10 @@ function routeEthNonBase() {
9372
9386
  const secondBridgeCalldata = await wrapAs4(
9373
9387
  "INTERNAL",
9374
9388
  OP_DEPOSITS.ethNonBase.encodeCalldata,
9375
- () => Promise.resolve(encodeSecondBridgeEthArgs(p.amount, receiver)),
9389
+ () => encodeSecondBridgeEthDepositCalldata({ ctx, amount: p.amount, receiver }),
9376
9390
  {
9377
9391
  ctx: {
9378
- where: "encodeSecondBridgeEthArgs",
9392
+ where: "encodeSecondBridgeEthDepositCalldata",
9379
9393
  amount: p.amount.toString(),
9380
9394
  to: receiver
9381
9395
  }