@matterlabs/zksync-js 0.0.19 → 0.0.21
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 +38 -6
- package/dist/adapters/ethers/index.cjs.map +1 -1
- package/dist/adapters/ethers/index.js +3 -3
- package/dist/adapters/ethers/sdk.cjs +38 -6
- package/dist/adapters/ethers/sdk.cjs.map +1 -1
- package/dist/adapters/ethers/sdk.js +3 -3
- package/dist/adapters/viem/index.cjs +36 -4
- package/dist/adapters/viem/index.cjs.map +1 -1
- package/dist/adapters/viem/index.js +3 -3
- package/dist/adapters/viem/sdk.cjs +36 -4
- package/dist/adapters/viem/sdk.cjs.map +1 -1
- package/dist/adapters/viem/sdk.js +3 -3
- package/dist/{chunk-5H3VTIYD.js → chunk-2CGBLD5H.js} +15 -8
- package/dist/{chunk-3T5V4HKS.js → chunk-7GZDTLHX.js} +13 -6
- package/dist/{chunk-6LYAENO6.js → chunk-IDXSGCGF.js} +20 -3
- package/dist/{chunk-3HHUZXSV.js → chunk-LGTYM5XP.js} +9 -1
- package/dist/core/index.cjs +9 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/resources/withdrawals/status.d.ts +5 -0
- package/dist/core/types/flows/withdrawals.d.ts +2 -2
- package/dist/core/utils/events.d.ts +2 -0
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { pickDepositRoute } from '../chunk-TYYUG5GA.js';
|
|
2
|
-
export { findL1MessageSentLog, isL1MessageSentLog, messengerLogIndex, pickWithdrawRoute } from '../chunk-
|
|
2
|
+
export { findL1MessageSentLog, isL1MessageSentLog, l1MessageSentSender, messengerLogIndex, pickWithdrawRoute } from '../chunk-LGTYM5XP.js';
|
|
3
3
|
export { makeTransportFromEthers, makeTransportFromViem } from '../chunk-BWKWWLY4.js';
|
|
4
4
|
export { abi_exports as abi, factory_exports as errors, formatEnvelopePretty, hexEq, isAddress, isAddressEq, isETH, isHash, isHash66, isHash66Array, isHashArray, normalizeAddrEq, normalizeL1Token, zks_exports as zksRpc } from '../chunk-UEKFQAOS.js';
|
|
5
5
|
export { ETH_ADDRESS, FORMAL_ETH_ADDRESS, L1_MESSENGER_ADDRESS, L1_SOPH_TOKEN_ADDRESS, L2_ASSET_ROUTER_ADDRESS, L2_BASE_TOKEN_ADDRESS, L2_NATIVE_TOKEN_VAULT_ADDRESS } from '../chunk-MT4X5FEO.js';
|
|
@@ -53,12 +53,13 @@ export type WithdrawalKey = {
|
|
|
53
53
|
l2BatchNumber: bigint;
|
|
54
54
|
l2MessageIndex: bigint;
|
|
55
55
|
};
|
|
56
|
-
type WithdrawalPhase = 'L2_PENDING' | 'L2_INCLUDED' | 'PENDING' | 'READY_TO_FINALIZE' | 'FINALIZING' | 'FINALIZED' | 'FINALIZE_FAILED' | 'UNKNOWN';
|
|
56
|
+
export type WithdrawalPhase = 'L2_PENDING' | 'L2_INCLUDED' | 'PENDING' | 'READY_TO_FINALIZE' | 'FINALIZING' | 'FINALIZED' | 'FINALIZE_FAILED' | 'UNFINALIZABLE' | 'UNKNOWN';
|
|
57
57
|
export type WithdrawalStatus = {
|
|
58
58
|
phase: WithdrawalPhase;
|
|
59
59
|
l2TxHash: Hex;
|
|
60
60
|
l1FinalizeTxHash?: Hex;
|
|
61
61
|
key?: WithdrawalKey;
|
|
62
|
+
reason?: string;
|
|
62
63
|
};
|
|
63
64
|
export type FinalizeReadiness = {
|
|
64
65
|
kind: 'READY';
|
|
@@ -78,4 +79,3 @@ export interface FinalizationEstimate {
|
|
|
78
79
|
maxFeePerGas: bigint;
|
|
79
80
|
maxPriorityFeePerGas: bigint;
|
|
80
81
|
}
|
|
81
|
-
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Log, TxReceipt } from '../types/transactions';
|
|
2
|
+
import type { Address } from '../types/primitives';
|
|
2
3
|
type Prefer = 'messenger' | 'assetRouter' | {
|
|
3
4
|
address: string;
|
|
4
5
|
};
|
|
@@ -9,4 +10,5 @@ export declare function findL1MessageSentLog(receipt: TxReceipt, opts?: {
|
|
|
9
10
|
export declare function isL1MessageSentLog(log: Log, opts?: {
|
|
10
11
|
prefer?: Prefer;
|
|
11
12
|
}): boolean;
|
|
13
|
+
export declare function l1MessageSentSender(log: Log): Address;
|
|
12
14
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -7432,6 +7432,14 @@ function isL1MessageSentLog(log, opts) {
|
|
|
7432
7432
|
const preferAddr = extractPreferAddress(opts);
|
|
7433
7433
|
return log.address.toLowerCase() === preferAddr && (topic === TOPIC_L1_MESSAGE_SENT_LEG.toLowerCase() || topic === TOPIC_L1_MESSAGE_SENT_NEW.toLowerCase());
|
|
7434
7434
|
}
|
|
7435
|
+
var SENDER_TOPIC = /^0x0{24}([0-9a-fA-F]{40})$/;
|
|
7436
|
+
function l1MessageSentSender(log) {
|
|
7437
|
+
const sender = SENDER_TOPIC.exec(log.topics?.[1] ?? "")?.[1];
|
|
7438
|
+
if (!sender) {
|
|
7439
|
+
throw new Error("L1MessageSent log has no valid sender topic.");
|
|
7440
|
+
}
|
|
7441
|
+
return `0x${sender.toLowerCase()}`;
|
|
7442
|
+
}
|
|
7435
7443
|
|
|
7436
7444
|
// src/core/resources/withdrawals/logs.ts
|
|
7437
7445
|
function messengerLogIndex(raw, opts) {
|
|
@@ -7459,6 +7467,7 @@ exports.isHash66 = isHash66;
|
|
|
7459
7467
|
exports.isHash66Array = isHash66Array;
|
|
7460
7468
|
exports.isHashArray = isHashArray;
|
|
7461
7469
|
exports.isL1MessageSentLog = isL1MessageSentLog;
|
|
7470
|
+
exports.l1MessageSentSender = l1MessageSentSender;
|
|
7462
7471
|
exports.makeTransportFromEthers = makeTransportFromEthers;
|
|
7463
7472
|
exports.makeTransportFromViem = makeTransportFromViem;
|
|
7464
7473
|
exports.messengerLogIndex = messengerLogIndex;
|