@matterlabs/zksync-js 0.0.13 → 0.0.14
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.cjs +13 -4
- package/dist/adapters/ethers/client.cjs.map +1 -1
- package/dist/adapters/ethers/client.js +7 -6
- package/dist/adapters/ethers/index.cjs +501 -242
- package/dist/adapters/ethers/index.cjs.map +1 -1
- package/dist/adapters/ethers/index.js +10 -9
- package/dist/adapters/ethers/resources/deposits/routes/priority.d.ts +12 -0
- package/dist/adapters/ethers/resources/deposits/services/gas.d.ts +4 -0
- package/dist/adapters/ethers/resources/interop/index.d.ts +14 -14
- package/dist/adapters/ethers/resources/interop/resolvers.d.ts +3 -8
- package/dist/adapters/ethers/resources/interop/routes/types.d.ts +2 -1
- package/dist/adapters/ethers/resources/interop/services/erc20.d.ts +10 -0
- package/dist/adapters/ethers/resources/interop/services/fee.d.ts +12 -0
- package/dist/adapters/ethers/resources/interop/services/finalization/index.d.ts +1 -1
- package/dist/adapters/ethers/resources/interop/services/finalization/polling.d.ts +1 -1
- package/dist/adapters/ethers/resources/interop/types.d.ts +6 -14
- package/dist/adapters/ethers/sdk.cjs +912 -252
- package/dist/adapters/ethers/sdk.cjs.map +1 -1
- package/dist/adapters/ethers/sdk.d.ts +6 -1
- package/dist/adapters/ethers/sdk.js +8 -7
- package/dist/adapters/viem/client.cjs +8 -4
- package/dist/adapters/viem/client.cjs.map +1 -1
- package/dist/adapters/viem/client.js +7 -6
- package/dist/adapters/viem/index.cjs +315 -73
- package/dist/adapters/viem/index.cjs.map +1 -1
- package/dist/adapters/viem/index.js +10 -9
- package/dist/adapters/viem/resources/deposits/routes/priority.d.ts +13 -0
- package/dist/adapters/viem/resources/deposits/services/gas.d.ts +4 -0
- package/dist/adapters/viem/sdk.cjs +307 -69
- package/dist/adapters/viem/sdk.cjs.map +1 -1
- package/dist/adapters/viem/sdk.js +7 -7
- package/dist/{chunk-E3KP7XCG.js → chunk-3HHUZXSV.js} +1 -1
- package/dist/{chunk-UDBRUBEK.js → chunk-5RRJDPAJ.js} +2 -2
- package/dist/{chunk-EDWBCPO3.js → chunk-75IOOODG.js} +253 -53
- package/dist/{chunk-R5WRFPK2.js → chunk-7CAVFIMW.js} +5 -4
- package/dist/chunk-BWKWWLY4.js +9 -0
- package/dist/{chunk-4S4XDA4N.js → chunk-DYJKK5FW.js} +17 -15
- package/dist/{chunk-5L6EYUJB.js → chunk-EOBXYHTZ.js} +35 -7
- package/dist/{chunk-53MC5BR2.js → chunk-HP3EWKJL.js} +1 -1
- package/dist/{chunk-HI64OOAR.js → chunk-J47RI3G7.js} +1 -1
- package/dist/{chunk-RI73VJSH.js → chunk-JY62QO3W.js} +44 -21
- package/dist/{chunk-QQ2OR434.js → chunk-MT4X5FEO.js} +18 -2
- package/dist/{chunk-2RIARDXZ.js → chunk-OTXPSNNC.js} +5 -4
- package/dist/{chunk-5R7L5NM5.js → chunk-XDRCN4FC.js} +2 -2
- package/dist/{chunk-JHO2UQ5F.js → chunk-XKRNLFET.js} +394 -200
- package/dist/core/constants.cjs +17 -1
- package/dist/core/constants.cjs.map +1 -1
- package/dist/core/constants.d.ts +9 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/index.cjs +52 -24
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.js +6 -5
- package/dist/core/internal/abis/IERC7786Attributes.d.ts +21 -11
- package/dist/core/internal/abis/IInteropCenter.d.ts +4 -0
- package/dist/core/resources/deposits/priority.d.ts +37 -0
- package/dist/core/resources/interop/attributes/bundle.d.ts +1 -0
- package/dist/core/resources/interop/attributes/resource.d.ts +1 -0
- package/dist/core/resources/interop/plan.d.ts +11 -3
- package/dist/core/rpc/types.d.ts +1 -0
- package/dist/core/rpc/zks.d.ts +5 -1
- package/dist/core/types/errors.d.ts +5 -0
- package/dist/core/types/flows/interop.d.ts +11 -18
- package/dist/index.cjs +69 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/package.json +1 -1
|
@@ -4,6 +4,11 @@ import { type WithdrawalsResource } from './resources/withdrawals/index';
|
|
|
4
4
|
import { type InteropResource } from './resources/interop/index';
|
|
5
5
|
import type { TokensResource } from '../../core/types/flows/token';
|
|
6
6
|
import type { ContractsResource } from './resources/contracts/index';
|
|
7
|
+
import type { InteropConfig } from './resources/interop/types';
|
|
8
|
+
export interface EthersSdkOptions {
|
|
9
|
+
/** Configuration required for interop operations. */
|
|
10
|
+
interop?: InteropConfig;
|
|
11
|
+
}
|
|
7
12
|
export interface EthersSdk {
|
|
8
13
|
deposits: DepositsResource;
|
|
9
14
|
withdrawals: WithdrawalsResource;
|
|
@@ -11,4 +16,4 @@ export interface EthersSdk {
|
|
|
11
16
|
contracts: ContractsResource;
|
|
12
17
|
interop: InteropResource;
|
|
13
18
|
}
|
|
14
|
-
export declare function createEthersSdk(client: EthersClient): EthersSdk;
|
|
19
|
+
export declare function createEthersSdk(client: EthersClient, options?: EthersSdkOptions): EthersSdk;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { createEthersSdk } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
1
|
+
export { createEthersSdk } from '../../chunk-XKRNLFET.js';
|
|
2
|
+
import '../../chunk-5RRJDPAJ.js';
|
|
3
|
+
import '../../chunk-EOBXYHTZ.js';
|
|
4
|
+
import '../../chunk-3HHUZXSV.js';
|
|
5
|
+
import '../../chunk-HP3EWKJL.js';
|
|
6
|
+
import '../../chunk-DYJKK5FW.js';
|
|
7
|
+
import '../../chunk-JY62QO3W.js';
|
|
8
|
+
import '../../chunk-MT4X5FEO.js';
|
|
@@ -224,6 +224,7 @@ function normalizeProof(p) {
|
|
|
224
224
|
const raw = p ?? {};
|
|
225
225
|
const idRaw = raw?.id ?? raw?.index;
|
|
226
226
|
const bnRaw = raw?.batch_number ?? raw?.batchNumber;
|
|
227
|
+
const gwBlockNumberRaw = raw?.gatewayBlockNumber;
|
|
227
228
|
if (idRaw == null || bnRaw == null) {
|
|
228
229
|
throw createError("RPC", {
|
|
229
230
|
resource: "zksrpc",
|
|
@@ -244,7 +245,8 @@ function normalizeProof(p) {
|
|
|
244
245
|
id: toBig(idRaw),
|
|
245
246
|
batchNumber: toBig(bnRaw),
|
|
246
247
|
proof: toHexArray(raw?.proof),
|
|
247
|
-
root: raw.root
|
|
248
|
+
root: raw.root,
|
|
249
|
+
gatewayBlockNumber: gwBlockNumberRaw != null ? toBig(gwBlockNumberRaw) : void 0
|
|
248
250
|
};
|
|
249
251
|
} catch (e) {
|
|
250
252
|
if (isZKsyncError(e)) throw e;
|
|
@@ -521,13 +523,15 @@ function createZksRpc(transport) {
|
|
|
521
523
|
);
|
|
522
524
|
},
|
|
523
525
|
// Fetches a proof for an L2→L1 log emitted in the given transaction.
|
|
524
|
-
async getL2ToL1LogProof(txHash, index) {
|
|
526
|
+
async getL2ToL1LogProof(txHash, index, proofTarget) {
|
|
525
527
|
return withRpcOp(
|
|
526
528
|
"zksrpc.getL2ToL1LogProof",
|
|
527
529
|
"Failed to fetch L2\u2192L1 log proof.",
|
|
528
|
-
{ txHash, index },
|
|
530
|
+
{ txHash, index, proofTarget },
|
|
529
531
|
async () => {
|
|
530
|
-
const
|
|
532
|
+
const params = [txHash, index];
|
|
533
|
+
if (proofTarget != void 0) params.push(proofTarget);
|
|
534
|
+
const proof = await transport(METHODS.getL2ToL1LogProof, params);
|
|
531
535
|
if (!proof) {
|
|
532
536
|
throw createError("STATE", {
|
|
533
537
|
resource: "zksrpc",
|