@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 { createEthersClient as createClient, createEthersClient } from '../../chunk-
|
|
2
|
-
export { buildDirectRequestStruct, createDepositsResource, createEthersSdk, createFinalizationServices, createInteropFinalizationServices, createInteropResource, createTokensResource, createWithdrawalProtocolService, createWithdrawalsResource, encodeNativeTokenVaultTransferData, encodeSecondBridgeArgs, encodeSecondBridgeDataV1, encodeSecondBridgeErc20Args, encodeSecondBridgeEthArgs, getL2TransactionHashFromLogs } from '../../chunk-
|
|
3
|
-
export { classifyReadinessFromRevert, createErrorHandlers, decodeRevert, registerErrorAbi, toZKsyncError } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
export { createEthersClient as createClient, createEthersClient } from '../../chunk-PNTR5FTL.js';
|
|
2
|
+
export { buildDirectRequestStruct, createDepositsResource, createEthersSdk, createFinalizationServices, createInteropFinalizationServices, createInteropResource, createTokensResource, createWithdrawalProtocolService, createWithdrawalsResource, encodeNativeTokenVaultTransferData, encodeSecondBridgeArgs, encodeSecondBridgeDataV1, encodeSecondBridgeErc20Args, encodeSecondBridgeEthArgs, getL2TransactionHashFromLogs } from '../../chunk-B6P24GL5.js';
|
|
3
|
+
export { classifyReadinessFromRevert, createErrorHandlers, decodeRevert, registerErrorAbi, toZKsyncError } from '../../chunk-RZH7HBH3.js';
|
|
4
|
+
import '../../chunk-5S63J6DW.js';
|
|
5
|
+
import '../../chunk-BQ2YCWV2.js';
|
|
6
6
|
import '../../chunk-OEUDZFXH.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';
|
|
@@ -317,7 +317,7 @@ var OP_DEPOSITS = {
|
|
|
317
317
|
ethNonBase: {
|
|
318
318
|
allowanceBase: "deposits.eth-nonbase:allowanceBaseToken",
|
|
319
319
|
ethBalance: "deposits.eth-nonbase:getEthBalance",
|
|
320
|
-
encodeCalldata: "deposits.eth-nonbase:
|
|
320
|
+
encodeCalldata: "deposits.eth-nonbase:encodeSecondBridgeEthDepositCalldata",
|
|
321
321
|
assertEthAsset: "deposits.eth-nonbase:assertEthAsset",
|
|
322
322
|
assertNonEthBase: "deposits.eth-nonbase:assertNonEthBase",
|
|
323
323
|
assertEthBalance: "deposits.eth-nonbase:assertEthBalance"
|
|
@@ -6209,15 +6209,6 @@ function encodeSecondBridgeDataV1(assetId, transferData) {
|
|
|
6209
6209
|
const data = abi2.encode(["bytes32", "bytes"], [assetId, transferData]);
|
|
6210
6210
|
return ethers.ethers.concat(["0x01", data]);
|
|
6211
6211
|
}
|
|
6212
|
-
function encodeSecondBridgeArgs(token, amount, l2Receiver) {
|
|
6213
|
-
return ethers.AbiCoder.defaultAbiCoder().encode(
|
|
6214
|
-
["address", "uint256", "address"],
|
|
6215
|
-
[token, amount, l2Receiver]
|
|
6216
|
-
);
|
|
6217
|
-
}
|
|
6218
|
-
function encodeSecondBridgeEthArgs(amount, l2Receiver, ethToken = ETH_ADDRESS) {
|
|
6219
|
-
return encodeSecondBridgeArgs(ethToken, amount, l2Receiver);
|
|
6220
|
-
}
|
|
6221
6212
|
function buildDirectRequestStruct(args) {
|
|
6222
6213
|
return {
|
|
6223
6214
|
chainId: args.chainId,
|
|
@@ -7266,6 +7257,20 @@ var ntvCodec2 = createNTVCodec({
|
|
|
7266
7257
|
encode: (types, values) => ethers.AbiCoder.defaultAbiCoder().encode(types, values),
|
|
7267
7258
|
keccak256: (data) => ethers.keccak256(data)
|
|
7268
7259
|
});
|
|
7260
|
+
async function encodeSecondBridgeEthDepositCalldata(input) {
|
|
7261
|
+
const registeredAssetId = input.ctx.resolvedToken?.assetId;
|
|
7262
|
+
const assetId = registeredAssetId && registeredAssetId.toLowerCase() !== ZERO_ASSET_ID2 ? registeredAssetId : ntvCodec2.encodeAssetId(
|
|
7263
|
+
BigInt((await input.ctx.client.l1.getNetwork()).chainId),
|
|
7264
|
+
L2_NATIVE_TOKEN_VAULT_ADDRESS,
|
|
7265
|
+
ETH_ADDRESS
|
|
7266
|
+
);
|
|
7267
|
+
const transferData = encodeNativeTokenVaultTransferData(
|
|
7268
|
+
input.amount,
|
|
7269
|
+
input.receiver,
|
|
7270
|
+
ETH_ADDRESS
|
|
7271
|
+
);
|
|
7272
|
+
return encodeSecondBridgeDataV1(assetId, transferData);
|
|
7273
|
+
}
|
|
7269
7274
|
async function getPriorityGasModel2(input) {
|
|
7270
7275
|
try {
|
|
7271
7276
|
const l1AssetRouter = await input.ctx.contracts.l1AssetRouter();
|
|
@@ -7419,10 +7424,10 @@ function routeEthNonBase() {
|
|
|
7419
7424
|
const secondBridgeCalldata = await wrapAs3(
|
|
7420
7425
|
"INTERNAL",
|
|
7421
7426
|
OP_DEPOSITS.ethNonBase.encodeCalldata,
|
|
7422
|
-
() =>
|
|
7427
|
+
() => encodeSecondBridgeEthDepositCalldata({ ctx, amount: p.amount, receiver }),
|
|
7423
7428
|
{
|
|
7424
7429
|
ctx: {
|
|
7425
|
-
where: "
|
|
7430
|
+
where: "encodeSecondBridgeEthDepositCalldata",
|
|
7426
7431
|
amount: p.amount.toString(),
|
|
7427
7432
|
to: receiver
|
|
7428
7433
|
}
|