@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.
Files changed (66) hide show
  1. package/dist/adapters/ethers/client.cjs +13 -4
  2. package/dist/adapters/ethers/client.cjs.map +1 -1
  3. package/dist/adapters/ethers/client.js +7 -6
  4. package/dist/adapters/ethers/index.cjs +501 -242
  5. package/dist/adapters/ethers/index.cjs.map +1 -1
  6. package/dist/adapters/ethers/index.js +10 -9
  7. package/dist/adapters/ethers/resources/deposits/routes/priority.d.ts +12 -0
  8. package/dist/adapters/ethers/resources/deposits/services/gas.d.ts +4 -0
  9. package/dist/adapters/ethers/resources/interop/index.d.ts +14 -14
  10. package/dist/adapters/ethers/resources/interop/resolvers.d.ts +3 -8
  11. package/dist/adapters/ethers/resources/interop/routes/types.d.ts +2 -1
  12. package/dist/adapters/ethers/resources/interop/services/erc20.d.ts +10 -0
  13. package/dist/adapters/ethers/resources/interop/services/fee.d.ts +12 -0
  14. package/dist/adapters/ethers/resources/interop/services/finalization/index.d.ts +1 -1
  15. package/dist/adapters/ethers/resources/interop/services/finalization/polling.d.ts +1 -1
  16. package/dist/adapters/ethers/resources/interop/types.d.ts +6 -14
  17. package/dist/adapters/ethers/sdk.cjs +912 -252
  18. package/dist/adapters/ethers/sdk.cjs.map +1 -1
  19. package/dist/adapters/ethers/sdk.d.ts +6 -1
  20. package/dist/adapters/ethers/sdk.js +8 -7
  21. package/dist/adapters/viem/client.cjs +8 -4
  22. package/dist/adapters/viem/client.cjs.map +1 -1
  23. package/dist/adapters/viem/client.js +7 -6
  24. package/dist/adapters/viem/index.cjs +315 -73
  25. package/dist/adapters/viem/index.cjs.map +1 -1
  26. package/dist/adapters/viem/index.js +10 -9
  27. package/dist/adapters/viem/resources/deposits/routes/priority.d.ts +13 -0
  28. package/dist/adapters/viem/resources/deposits/services/gas.d.ts +4 -0
  29. package/dist/adapters/viem/sdk.cjs +307 -69
  30. package/dist/adapters/viem/sdk.cjs.map +1 -1
  31. package/dist/adapters/viem/sdk.js +7 -7
  32. package/dist/{chunk-E3KP7XCG.js → chunk-3HHUZXSV.js} +1 -1
  33. package/dist/{chunk-UDBRUBEK.js → chunk-5RRJDPAJ.js} +2 -2
  34. package/dist/{chunk-EDWBCPO3.js → chunk-75IOOODG.js} +253 -53
  35. package/dist/{chunk-R5WRFPK2.js → chunk-7CAVFIMW.js} +5 -4
  36. package/dist/chunk-BWKWWLY4.js +9 -0
  37. package/dist/{chunk-4S4XDA4N.js → chunk-DYJKK5FW.js} +17 -15
  38. package/dist/{chunk-5L6EYUJB.js → chunk-EOBXYHTZ.js} +35 -7
  39. package/dist/{chunk-53MC5BR2.js → chunk-HP3EWKJL.js} +1 -1
  40. package/dist/{chunk-HI64OOAR.js → chunk-J47RI3G7.js} +1 -1
  41. package/dist/{chunk-RI73VJSH.js → chunk-JY62QO3W.js} +44 -21
  42. package/dist/{chunk-QQ2OR434.js → chunk-MT4X5FEO.js} +18 -2
  43. package/dist/{chunk-2RIARDXZ.js → chunk-OTXPSNNC.js} +5 -4
  44. package/dist/{chunk-5R7L5NM5.js → chunk-XDRCN4FC.js} +2 -2
  45. package/dist/{chunk-JHO2UQ5F.js → chunk-XKRNLFET.js} +394 -200
  46. package/dist/core/constants.cjs +17 -1
  47. package/dist/core/constants.cjs.map +1 -1
  48. package/dist/core/constants.d.ts +9 -1
  49. package/dist/core/constants.js +1 -1
  50. package/dist/core/index.cjs +52 -24
  51. package/dist/core/index.cjs.map +1 -1
  52. package/dist/core/index.js +6 -5
  53. package/dist/core/internal/abis/IERC7786Attributes.d.ts +21 -11
  54. package/dist/core/internal/abis/IInteropCenter.d.ts +4 -0
  55. package/dist/core/resources/deposits/priority.d.ts +37 -0
  56. package/dist/core/resources/interop/attributes/bundle.d.ts +1 -0
  57. package/dist/core/resources/interop/attributes/resource.d.ts +1 -0
  58. package/dist/core/resources/interop/plan.d.ts +11 -3
  59. package/dist/core/rpc/types.d.ts +1 -0
  60. package/dist/core/rpc/zks.d.ts +5 -1
  61. package/dist/core/types/errors.d.ts +5 -0
  62. package/dist/core/types/flows/interop.d.ts +11 -18
  63. package/dist/index.cjs +69 -25
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.js +6 -5
  66. 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-JHO2UQ5F.js';
2
- import '../../chunk-UDBRUBEK.js';
3
- import '../../chunk-5L6EYUJB.js';
4
- import '../../chunk-E3KP7XCG.js';
5
- import '../../chunk-53MC5BR2.js';
6
- import '../../chunk-RI73VJSH.js';
7
- import '../../chunk-QQ2OR434.js';
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 proof = await transport(METHODS.getL2ToL1LogProof, [txHash, index]);
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",