@matterlabs/zksync-js 0.0.6 → 0.0.8

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 (76) hide show
  1. package/dist/adapters/ethers/client.cjs +243 -79
  2. package/dist/adapters/ethers/client.cjs.map +1 -1
  3. package/dist/adapters/ethers/client.js +6 -6
  4. package/dist/adapters/ethers/errors/error-ops.d.ts +26 -19
  5. package/dist/adapters/ethers/index.cjs +290 -119
  6. package/dist/adapters/ethers/index.cjs.map +1 -1
  7. package/dist/adapters/ethers/index.js +9 -9
  8. package/dist/adapters/ethers/sdk.cjs +78 -59
  9. package/dist/adapters/ethers/sdk.cjs.map +1 -1
  10. package/dist/adapters/ethers/sdk.js +7 -7
  11. package/dist/adapters/viem/client.cjs +192 -34
  12. package/dist/adapters/viem/client.cjs.map +1 -1
  13. package/dist/adapters/viem/client.js +4 -4
  14. package/dist/adapters/viem/errors/error-ops.d.ts +26 -19
  15. package/dist/adapters/viem/index.cjs +290 -119
  16. package/dist/adapters/viem/index.cjs.map +1 -1
  17. package/dist/adapters/viem/index.js +8 -8
  18. package/dist/adapters/viem/sdk.cjs +97 -80
  19. package/dist/adapters/viem/sdk.cjs.map +1 -1
  20. package/dist/adapters/viem/sdk.js +6 -6
  21. package/dist/{chunk-M5J2MM2U.js → chunk-3GFCAGGI.js} +1430 -7
  22. package/dist/chunk-5V2JRM5J.js +75 -0
  23. package/dist/{chunk-WU2LOG2A.js → chunk-63DNJXS3.js} +7 -8
  24. package/dist/{chunk-F2ENUV3A.js → chunk-C3AGOEHR.js} +12 -2
  25. package/dist/{chunk-3MRGU4HV.js → chunk-FGXRG2JS.js} +4 -4
  26. package/dist/{chunk-NTEIA5KA.js → chunk-L343N56B.js} +1 -1
  27. package/dist/{chunk-2MDK3GLO.js → chunk-LNIEQ7AN.js} +9 -54
  28. package/dist/{chunk-LL3WKCFJ.js → chunk-NODVRI3E.js} +2 -2
  29. package/dist/{chunk-XRE7H466.js → chunk-NVULC4JB.js} +3 -47
  30. package/dist/{chunk-YUK547UF.js → chunk-ODMBZ2VX.js} +3 -3
  31. package/dist/{chunk-NEC2ZKHI.js → chunk-QZVYN3YA.js} +30 -7
  32. package/dist/{chunk-6K6VJQAL.js → chunk-SHQQI3UD.js} +175 -20
  33. package/dist/core/abi.d.ts +5 -0
  34. package/dist/core/constants.cjs +11 -1
  35. package/dist/core/constants.cjs.map +1 -1
  36. package/dist/core/constants.d.ts +11 -1
  37. package/dist/core/constants.js +1 -1
  38. package/dist/core/errors/error-ops.d.ts +18 -0
  39. package/dist/core/index.cjs +1737 -131
  40. package/dist/core/index.cjs.map +1 -1
  41. package/dist/core/index.d.ts +2 -1
  42. package/dist/core/index.js +5 -5
  43. package/dist/core/internal/abis/IERC7786Attributes.d.ts +42 -0
  44. package/dist/core/internal/abis/IInteropCenter.d.ts +211 -0
  45. package/dist/core/internal/abis/IInteropHandler.d.ts +166 -0
  46. package/dist/core/internal/abis/InteropCenter.d.ts +578 -0
  47. package/dist/core/internal/abis/InteropRootStorage.d.ts +20 -0
  48. package/dist/core/internal/abis/L2MessageVerification.d.ts +277 -0
  49. package/dist/core/resources/interop/attributes/bundle.d.ts +6 -0
  50. package/dist/core/resources/interop/attributes/call.d.ts +6 -0
  51. package/dist/core/resources/interop/attributes/index.d.ts +4 -0
  52. package/dist/core/resources/interop/attributes/resource.d.ts +12 -0
  53. package/dist/core/resources/interop/attributes/types.d.ts +6 -0
  54. package/dist/core/resources/interop/events.d.ts +7 -0
  55. package/dist/core/resources/interop/finalization.d.ts +61 -0
  56. package/dist/core/resources/interop/plan.d.ts +39 -0
  57. package/dist/core/resources/interop/route.d.ts +15 -0
  58. package/dist/core/rpc/types.d.ts +14 -0
  59. package/dist/core/rpc/zks.d.ts +4 -1
  60. package/dist/core/types/errors.d.ts +43 -2
  61. package/dist/core/types/flows/base.d.ts +1 -1
  62. package/dist/core/types/flows/interop.d.ts +231 -0
  63. package/dist/core/types/flows/withdrawals.d.ts +0 -8
  64. package/dist/core/types/transactions.d.ts +10 -0
  65. package/dist/core/utils/addr.d.ts +2 -2
  66. package/dist/core/utils/events.d.ts +12 -0
  67. package/dist/core/utils/hash.d.ts +5 -0
  68. package/dist/core/utils/index.d.ts +5 -0
  69. package/dist/core/utils/number.d.ts +2 -0
  70. package/dist/index.cjs +1748 -132
  71. package/dist/index.cjs.map +1 -1
  72. package/dist/index.d.ts +2 -1
  73. package/dist/index.js +5 -5
  74. package/package.json +6 -2
  75. package/dist/chunk-NCAIVYBR.js +0 -23
  76. package/dist/core/resources/withdrawals/events.d.ts +0 -9
package/dist/index.d.ts CHANGED
@@ -6,9 +6,10 @@ export * as zksRpc from './core/rpc/zks';
6
6
  export type { ZksRpc } from './core/rpc/zks';
7
7
  export { makeTransportFromEthers, makeTransportFromViem } from './core/rpc/transport';
8
8
  export * from './core/utils/addr';
9
+ export * from './core/utils/hash';
9
10
  export * from './core/resources/deposits/route';
10
11
  export * from './core/resources/withdrawals/route';
11
- export * from './core/resources/withdrawals/events';
12
+ export * from './core/utils/events';
12
13
  export * from './core/resources/withdrawals/logs';
13
14
  export type * from './core/types';
14
15
  export type * from './core/types/errors';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { pickDepositRoute } from './chunk-NTEIA5KA.js';
2
- export { findL1MessageSentLog, hexEq, isAddressEq, isETH, isHash66, messengerLogIndex, normalizeAddrEq, normalizeL1Token, pickWithdrawRoute } from './chunk-NEC2ZKHI.js';
3
- export { makeTransportFromEthers, makeTransportFromViem, zks_exports as zksRpc } from './chunk-6K6VJQAL.js';
4
- export { abi_exports as abi, factory_exports as errors, formatEnvelopePretty } from './chunk-M5J2MM2U.js';
5
- export { constants_exports as constants } from './chunk-F2ENUV3A.js';
1
+ export { pickDepositRoute } from './chunk-L343N56B.js';
2
+ export { findL1MessageSentLog, hexEq, isAddress, isAddressEq, isETH, isHash, isHash66, isHash66Array, isHashArray, isL1MessageSentLog, messengerLogIndex, normalizeAddrEq, normalizeL1Token, pickWithdrawRoute } from './chunk-QZVYN3YA.js';
3
+ export { makeTransportFromEthers, makeTransportFromViem, zks_exports as zksRpc } from './chunk-SHQQI3UD.js';
4
+ export { abi_exports as abi, factory_exports as errors, formatEnvelopePretty } from './chunk-3GFCAGGI.js';
5
+ export { constants_exports as constants } from './chunk-C3AGOEHR.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matterlabs/zksync-js",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "devDependencies": {
@@ -42,6 +42,9 @@
42
42
  "access": "public"
43
43
  },
44
44
  "exports": {
45
+ "./types/flows/interop": null,
46
+ "./core/types/flows/interop": null,
47
+ "./core/resources/interop/*": null,
45
48
  ".": {
46
49
  "types": "./dist/index.d.ts",
47
50
  "import": "./dist/index.js",
@@ -142,7 +145,8 @@
142
145
  "test:e2e:viem": "bun test ./src/adapters/viem/e2e/*.e2e.ts",
143
146
  "test:watch": "bun test --watch",
144
147
  "test:cov": "bun test --coverage",
145
- "test:core": "bun test src/core"
148
+ "test:core": "bun test src/core",
149
+ "test:docs": "bun test docs/snippets --timeout 100000"
146
150
  },
147
151
  "sideEffects": false,
148
152
  "type": "module",
@@ -1,23 +0,0 @@
1
- // src/core/errors/withdrawal-revert-map.ts
2
- var REVERT_TO_READINESS = {
3
- // Already done
4
- WithdrawalAlreadyFinalized: { kind: "FINALIZED" },
5
- // Temporary — try later
6
- BatchNotExecuted: { kind: "NOT_READY", reason: "batch-not-executed" },
7
- LocalRootIsZero: { kind: "NOT_READY", reason: "root-missing" },
8
- // Permanent — won’t become ready for this tx
9
- WrongL2Sender: { kind: "UNFINALIZABLE", reason: "message-invalid" },
10
- InvalidSelector: { kind: "UNFINALIZABLE", reason: "message-invalid" },
11
- L2WithdrawalMessageWrongLength: { kind: "UNFINALIZABLE", reason: "message-invalid" },
12
- WrongMsgLength: { kind: "UNFINALIZABLE", reason: "message-invalid" },
13
- TokenNotLegacy: { kind: "UNFINALIZABLE", reason: "message-invalid" },
14
- TokenIsLegacy: { kind: "UNFINALIZABLE", reason: "message-invalid" },
15
- InvalidProof: { kind: "UNFINALIZABLE", reason: "message-invalid" },
16
- InvalidChainId: { kind: "UNFINALIZABLE", reason: "invalid-chain" },
17
- NotSettlementLayer: { kind: "UNFINALIZABLE", reason: "settlement-layer" },
18
- // Likely environment mismatch — treat as permanent for this tx
19
- OnlyEraSupported: { kind: "UNFINALIZABLE", reason: "unsupported" },
20
- LocalRootMustBeZero: { kind: "UNFINALIZABLE", reason: "unsupported" }
21
- };
22
-
23
- export { REVERT_TO_READINESS };
@@ -1,9 +0,0 @@
1
- import type { ParsedLog, ParsedReceipt } from '../../types/flows/withdrawals';
2
- type Prefer = 'messenger' | 'assetRouter' | {
3
- address: string;
4
- };
5
- export declare function findL1MessageSentLog(receipt: ParsedReceipt, opts?: {
6
- prefer?: Prefer;
7
- index?: number;
8
- }): ParsedLog;
9
- export {};