@matterlabs/zksync-js 0.0.16 → 0.0.17
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/index.cjs +29 -15
- package/dist/adapters/ethers/index.cjs.map +1 -1
- package/dist/adapters/ethers/index.js +2 -2
- package/dist/adapters/ethers/resources/interop/index.d.ts +3 -2
- package/dist/adapters/ethers/resources/interop/services/finalization/bundle.d.ts +2 -1
- package/dist/adapters/ethers/resources/interop/services/finalization/index.d.ts +2 -1
- package/dist/adapters/ethers/sdk.cjs +29 -15
- package/dist/adapters/ethers/sdk.cjs.map +1 -1
- package/dist/adapters/ethers/sdk.js +2 -2
- package/dist/adapters/viem/index.cjs +28 -15
- package/dist/adapters/viem/index.cjs.map +1 -1
- package/dist/adapters/viem/index.js +2 -2
- package/dist/adapters/viem/resources/interop/index.d.ts +3 -2
- package/dist/adapters/viem/resources/interop/services/finalization/bundle.d.ts +2 -1
- package/dist/adapters/viem/resources/interop/services/finalization/index.d.ts +2 -1
- package/dist/adapters/viem/sdk.cjs +28 -15
- package/dist/adapters/viem/sdk.cjs.map +1 -1
- package/dist/adapters/viem/sdk.js +2 -2
- package/dist/{chunk-NLUCYVMX.js → chunk-6LYAENO6.js} +3 -6
- package/dist/{chunk-5HG2DUYW.js → chunk-J2RPWU2R.js} +27 -10
- package/dist/{chunk-3KH5PCD6.js → chunk-ONCNOWNC.js} +26 -10
- package/dist/core/resources/deposits/priority.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createEthersSdk } from '../../chunk-
|
|
1
|
+
export { createEthersSdk } from '../../chunk-J2RPWU2R.js';
|
|
2
2
|
import '../../chunk-NJK325XV.js';
|
|
3
|
-
import '../../chunk-
|
|
3
|
+
import '../../chunk-6LYAENO6.js';
|
|
4
4
|
import '../../chunk-3HHUZXSV.js';
|
|
5
5
|
import '../../chunk-JSBMIT4S.js';
|
|
6
6
|
import '../../chunk-UEKFQAOS.js';
|
|
@@ -7979,8 +7979,8 @@ function buildFeeBreakdown(p) {
|
|
|
7979
7979
|
|
|
7980
7980
|
// src/core/resources/deposits/priority.ts
|
|
7981
7981
|
var PRIORITY_TX_ENCODING_STEP_BYTES = 544n;
|
|
7982
|
-
var DEFAULT_PRIORITY_BODY_GAS_ESTIMATE_MULTIPLIER =
|
|
7983
|
-
var
|
|
7982
|
+
var DEFAULT_PRIORITY_BODY_GAS_ESTIMATE_MULTIPLIER = 7n;
|
|
7983
|
+
var PRIORITY_L2_GAS_BUFFER = 40n;
|
|
7984
7984
|
var maxBigInt2 = (a, b) => a > b ? a : b;
|
|
7985
7985
|
var ceilDiv = (a, b) => (a + b - 1n) / b;
|
|
7986
7986
|
function derivePriorityTxGasBreakdown(input) {
|
|
@@ -8008,10 +8008,7 @@ function derivePriorityBodyGasEstimateCap(input) {
|
|
|
8008
8008
|
return input.minBodyGas * (input.multiplier ?? DEFAULT_PRIORITY_BODY_GAS_ESTIMATE_MULTIPLIER);
|
|
8009
8009
|
}
|
|
8010
8010
|
function applyPriorityL2GasLimitBuffer(input) {
|
|
8011
|
-
|
|
8012
|
-
return input.gasLimit;
|
|
8013
|
-
}
|
|
8014
|
-
return input.gasLimit * (100n + ERAVM_PRIORITY_L2_GAS_BUFFER) / 100n;
|
|
8011
|
+
return input.gasLimit * (100n + PRIORITY_L2_GAS_BUFFER) / 100n;
|
|
8015
8012
|
}
|
|
8016
8013
|
var EMPTY_BYTES = "0x";
|
|
8017
8014
|
var ZERO_RESERVED_WORDS = [0n, 0n, 0n, 0n];
|
|
@@ -11155,13 +11152,23 @@ function routeIndirect() {
|
|
|
11155
11152
|
}
|
|
11156
11153
|
function routeDirect() {
|
|
11157
11154
|
return {
|
|
11158
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
11159
11155
|
async preflight(params, ctx) {
|
|
11160
11156
|
preflightDirect(params, {
|
|
11161
11157
|
dstChainId: ctx.dstChainId,
|
|
11162
11158
|
baseTokens: ctx.baseTokens,
|
|
11163
11159
|
l2AssetRouter: ctx.l2AssetRouter,
|
|
11164
11160
|
l2NativeTokenVault: ctx.l2NativeTokenVault});
|
|
11161
|
+
for (const action of params.actions) {
|
|
11162
|
+
const bytecode = await ctx.dstPublicClient.getCode({ address: action.to });
|
|
11163
|
+
if (!bytecode || bytecode === "0x") {
|
|
11164
|
+
throw createError("VALIDATION", {
|
|
11165
|
+
resource: "interop",
|
|
11166
|
+
operation: OP_INTEROP.routes.direct.preflight,
|
|
11167
|
+
message: `Destination address ${action.to} is not a contract on the destination chain. The receiver must be a contract that implements the IERC7786Recipient interface (receiveMessage).`,
|
|
11168
|
+
context: { to: action.to, action: action.type }
|
|
11169
|
+
});
|
|
11170
|
+
}
|
|
11171
|
+
}
|
|
11165
11172
|
},
|
|
11166
11173
|
async build(params, ctx) {
|
|
11167
11174
|
const steps = [];
|
|
@@ -11421,7 +11428,7 @@ async function getBundleStatus(client, dstProvider, topics, bundleHash, opts) {
|
|
|
11421
11428
|
}
|
|
11422
11429
|
return { phase: "SENT" };
|
|
11423
11430
|
}
|
|
11424
|
-
async function executeBundle(client, dstProvider, info, opts) {
|
|
11431
|
+
async function executeBundle(client, dstProvider, info, opts, txOverrides) {
|
|
11425
11432
|
const { topics } = getTopics();
|
|
11426
11433
|
const { bundleHash, encodedData, proof } = info;
|
|
11427
11434
|
const dstStatus = await getBundleStatus(client, dstProvider, topics, bundleHash, opts);
|
|
@@ -11450,7 +11457,10 @@ async function executeBundle(client, dstProvider, info, opts) {
|
|
|
11450
11457
|
functionName: "executeBundle",
|
|
11451
11458
|
args: [encodedData, proof],
|
|
11452
11459
|
account: client.account,
|
|
11453
|
-
chain: dstProvider.chain ?? null
|
|
11460
|
+
chain: dstProvider.chain ?? null,
|
|
11461
|
+
gas: txOverrides?.gasLimit,
|
|
11462
|
+
maxFeePerGas: txOverrides?.maxFeePerGas,
|
|
11463
|
+
maxPriorityFeePerGas: txOverrides?.maxPriorityFeePerGas
|
|
11454
11464
|
});
|
|
11455
11465
|
return {
|
|
11456
11466
|
hash,
|
|
@@ -11907,8 +11917,8 @@ function createInteropFinalizationServices(client) {
|
|
|
11907
11917
|
wait(dstProvider, gwProvider, input, opts) {
|
|
11908
11918
|
return waitForFinalization(client, dstProvider, gwProvider, input, opts);
|
|
11909
11919
|
},
|
|
11910
|
-
async finalize(dstProvider, info, opts) {
|
|
11911
|
-
const execResult = await executeBundle(client, dstProvider, info, opts);
|
|
11920
|
+
async finalize(dstProvider, info, opts, txOverrides) {
|
|
11921
|
+
const execResult = await executeBundle(client, dstProvider, info, opts, txOverrides);
|
|
11912
11922
|
await execResult.wait();
|
|
11913
11923
|
return {
|
|
11914
11924
|
bundleHash: info.bundleHash,
|
|
@@ -12136,22 +12146,25 @@ function createInteropResource(client, config, tokens, contracts, attributes) {
|
|
|
12136
12146
|
ctx: { where: "interop.wait" }
|
|
12137
12147
|
});
|
|
12138
12148
|
const tryWait = (dstChain, h, opts) => toResult2(OP_INTEROP.tryWait, () => wait(dstChain, h, opts));
|
|
12139
|
-
const finalize = (dstChain, h, opts) => wrap7(
|
|
12149
|
+
const finalize = (dstChain, h, opts, txOverrides) => wrap7(
|
|
12140
12150
|
OP_INTEROP.finalize,
|
|
12141
12151
|
async () => {
|
|
12142
12152
|
const dstProvider = resolveChainRef(dstChain);
|
|
12143
12153
|
if (isInteropFinalizationInfo(h)) {
|
|
12144
|
-
return svc.finalize(dstProvider, h, opts);
|
|
12154
|
+
return svc.finalize(dstProvider, h, opts, txOverrides);
|
|
12145
12155
|
}
|
|
12146
12156
|
const info = await svc.wait(dstProvider, getGwProvider(), h);
|
|
12147
|
-
return svc.finalize(dstProvider, info, opts);
|
|
12157
|
+
return svc.finalize(dstProvider, info, opts, txOverrides);
|
|
12148
12158
|
},
|
|
12149
12159
|
{
|
|
12150
12160
|
message: "Failed to finalize/execute interop bundle on destination.",
|
|
12151
12161
|
ctx: { where: "interop.finalize" }
|
|
12152
12162
|
}
|
|
12153
12163
|
);
|
|
12154
|
-
const tryFinalize = (dstChain, h, opts
|
|
12164
|
+
const tryFinalize = (dstChain, h, opts, txOverrides) => toResult2(
|
|
12165
|
+
OP_INTEROP.tryFinalize,
|
|
12166
|
+
() => finalize(dstChain, h, opts, txOverrides)
|
|
12167
|
+
);
|
|
12155
12168
|
const interopGetRoot = (dstChain, rootChainId, batchNumber) => wrap7(
|
|
12156
12169
|
OP_INTEROP.svc.status.getRoot,
|
|
12157
12170
|
() => getInteropRoot(resolveChainRef(dstChain), rootChainId, batchNumber),
|