@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.
- package/dist/adapters/ethers/client.js +4 -4
- package/dist/adapters/ethers/index.cjs +17 -3
- package/dist/adapters/ethers/index.cjs.map +1 -1
- package/dist/adapters/ethers/index.js +7 -7
- package/dist/adapters/ethers/sdk.cjs +17 -12
- package/dist/adapters/ethers/sdk.cjs.map +1 -1
- package/dist/adapters/ethers/sdk.js +6 -6
- package/dist/adapters/viem/client.js +4 -4
- package/dist/adapters/viem/index.cjs +17 -3
- package/dist/adapters/viem/index.cjs.map +1 -1
- package/dist/adapters/viem/index.js +7 -7
- package/dist/adapters/viem/sdk.cjs +17 -16
- package/dist/adapters/viem/sdk.cjs.map +1 -1
- package/dist/adapters/viem/sdk.js +6 -6
- package/dist/{chunk-4GPIHYVF.js → chunk-4ZANKNIK.js} +1 -1
- package/dist/{chunk-WPCZNITC.js → chunk-5S63J6DW.js} +1 -1
- package/dist/{chunk-V2TDNGI5.js → chunk-B6P24GL5.js} +20 -6
- package/dist/{chunk-JJ523MOL.js → chunk-BQ2YCWV2.js} +1 -1
- package/dist/{chunk-4M7VNYGC.js → chunk-H5A6GU3D.js} +2 -2
- package/dist/{chunk-2DDJFHHD.js → chunk-JNS4XZE2.js} +1 -1
- package/dist/{chunk-URHDNDFN.js → chunk-PNTR5FTL.js} +2 -2
- package/dist/{chunk-NVOFHV3A.js → chunk-QMMFUWRV.js} +20 -6
- package/dist/{chunk-TUN6NH5D.js → chunk-RZH7HBH3.js} +2 -2
- package/dist/{chunk-6WIAMFIW.js → chunk-YEA74D2L.js} +2 -2
- package/dist/{chunk-X2JJDQ4O.js → chunk-YGXEIOK6.js} +1 -1
- package/dist/core/index.js +3 -3
- package/dist/core/types/errors.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { buildDirectRequestStruct, createContractsResource, createDepositsResource, createFinalizationServices, createInteropFinalizationServices, createInteropResource, createTokensResource, createViemSdk, createWithdrawalProtocolService, createWithdrawalsResource, encodeNativeTokenVaultTransferData, encodeSecondBridgeArgs, encodeSecondBridgeDataV1, encodeSecondBridgeErc20Args, encodeSecondBridgeEthArgs, getL2TransactionHashFromLogs } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
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';
|
|
3
|
+
import '../../chunk-BQ2YCWV2.js';
|
|
4
4
|
import '../../chunk-OEUDZFXH.js';
|
|
5
|
-
export { createViemClient as createClient, createViemClient } from '../../chunk-
|
|
6
|
-
export { classifyReadinessFromRevert, createErrorHandlers, decodeRevert, registerErrorAbi, toZKsyncError } from '../../chunk-
|
|
5
|
+
export { createViemClient as createClient, createViemClient } from '../../chunk-YEA74D2L.js';
|
|
6
|
+
export { classifyReadinessFromRevert, createErrorHandlers, decodeRevert, registerErrorAbi, toZKsyncError } from '../../chunk-H5A6GU3D.js';
|
|
7
7
|
import '../../chunk-UMPAKZCQ.js';
|
|
8
8
|
import '../../chunk-BWKWWLY4.js';
|
|
9
|
-
import '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-4ZANKNIK.js';
|
|
10
|
+
import '../../chunk-JNS4XZE2.js';
|
|
11
11
|
import '../../chunk-3IPSDGHO.js';
|
|
@@ -5838,19 +5838,6 @@ function encodeSecondBridgeDataV1(assetId, transferData) {
|
|
|
5838
5838
|
);
|
|
5839
5839
|
return viem.concat(["0x01", data]);
|
|
5840
5840
|
}
|
|
5841
|
-
function encodeSecondBridgeArgs(token, amount, l2Receiver) {
|
|
5842
|
-
return viem.encodeAbiParameters(
|
|
5843
|
-
[
|
|
5844
|
-
{ type: "address", name: "token" },
|
|
5845
|
-
{ type: "uint256", name: "amount" },
|
|
5846
|
-
{ type: "address", name: "l2Receiver" }
|
|
5847
|
-
],
|
|
5848
|
-
[token, amount, l2Receiver]
|
|
5849
|
-
);
|
|
5850
|
-
}
|
|
5851
|
-
function encodeSecondBridgeEthArgs(amount, l2Receiver, ethToken = ETH_ADDRESS) {
|
|
5852
|
-
return encodeSecondBridgeArgs(ethToken, amount, l2Receiver);
|
|
5853
|
-
}
|
|
5854
5841
|
function buildDirectRequestStruct(args) {
|
|
5855
5842
|
return {
|
|
5856
5843
|
chainId: args.chainId,
|
|
@@ -6146,7 +6133,7 @@ var OP_DEPOSITS = {
|
|
|
6146
6133
|
ethNonBase: {
|
|
6147
6134
|
allowanceBase: "deposits.eth-nonbase:allowanceBaseToken",
|
|
6148
6135
|
ethBalance: "deposits.eth-nonbase:getEthBalance",
|
|
6149
|
-
encodeCalldata: "deposits.eth-nonbase:
|
|
6136
|
+
encodeCalldata: "deposits.eth-nonbase:encodeSecondBridgeEthDepositCalldata",
|
|
6150
6137
|
estGas: "deposits.eth-nonbase:estimateGas",
|
|
6151
6138
|
assertEthAsset: "deposits.eth-nonbase:assertEthAsset",
|
|
6152
6139
|
assertNonEthBase: "deposits.eth-nonbase:assertNonEthBase",
|
|
@@ -7489,6 +7476,20 @@ var ntvCodec2 = createNTVCodec({
|
|
|
7489
7476
|
),
|
|
7490
7477
|
keccak256: viem.keccak256
|
|
7491
7478
|
});
|
|
7479
|
+
async function encodeSecondBridgeEthDepositCalldata(input) {
|
|
7480
|
+
const registeredAssetId = input.ctx.resolvedToken?.assetId;
|
|
7481
|
+
const assetId = registeredAssetId && registeredAssetId.toLowerCase() !== ZERO_ASSET_ID2 ? registeredAssetId : ntvCodec2.encodeAssetId(
|
|
7482
|
+
BigInt(await input.ctx.client.l1.getChainId()),
|
|
7483
|
+
L2_NATIVE_TOKEN_VAULT_ADDRESS,
|
|
7484
|
+
ETH_ADDRESS
|
|
7485
|
+
);
|
|
7486
|
+
const transferData = encodeNativeTokenVaultTransferData(
|
|
7487
|
+
input.amount,
|
|
7488
|
+
input.receiver,
|
|
7489
|
+
ETH_ADDRESS
|
|
7490
|
+
);
|
|
7491
|
+
return encodeSecondBridgeDataV1(assetId, transferData);
|
|
7492
|
+
}
|
|
7492
7493
|
async function getPriorityGasModel2(input) {
|
|
7493
7494
|
try {
|
|
7494
7495
|
const l1AssetRouter = await input.ctx.contracts.l1AssetRouter();
|
|
@@ -7657,10 +7658,10 @@ function routeEthNonBase() {
|
|
|
7657
7658
|
const secondBridgeCalldata = await wrapAs4(
|
|
7658
7659
|
"INTERNAL",
|
|
7659
7660
|
OP_DEPOSITS.ethNonBase.encodeCalldata,
|
|
7660
|
-
() =>
|
|
7661
|
+
() => encodeSecondBridgeEthDepositCalldata({ ctx, amount: p.amount, receiver }),
|
|
7661
7662
|
{
|
|
7662
7663
|
ctx: {
|
|
7663
|
-
where: "
|
|
7664
|
+
where: "encodeSecondBridgeEthDepositCalldata",
|
|
7664
7665
|
amount: p.amount.toString(),
|
|
7665
7666
|
to: receiver
|
|
7666
7667
|
},
|