@matterlabs/zksync-js 0.0.1

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 (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -0
  3. package/dist/adapters/ethers/client.cjs +4548 -0
  4. package/dist/adapters/ethers/client.cjs.map +1 -0
  5. package/dist/adapters/ethers/client.d.ts +61 -0
  6. package/dist/adapters/ethers/client.js +5 -0
  7. package/dist/adapters/ethers/errors/error-ops.d.ts +20 -0
  8. package/dist/adapters/ethers/errors/revert.d.ts +28 -0
  9. package/dist/adapters/ethers/index.cjs +7537 -0
  10. package/dist/adapters/ethers/index.cjs.map +1 -0
  11. package/dist/adapters/ethers/index.d.ts +12 -0
  12. package/dist/adapters/ethers/index.js +8 -0
  13. package/dist/adapters/ethers/resources/deposits/context.d.ts +27 -0
  14. package/dist/adapters/ethers/resources/deposits/index.d.ts +46 -0
  15. package/dist/adapters/ethers/resources/deposits/routes/erc20-base.d.ts +2 -0
  16. package/dist/adapters/ethers/resources/deposits/routes/erc20-nonbase.d.ts +2 -0
  17. package/dist/adapters/ethers/resources/deposits/routes/eth-nonbase.d.ts +2 -0
  18. package/dist/adapters/ethers/resources/deposits/routes/eth.d.ts +2 -0
  19. package/dist/adapters/ethers/resources/deposits/routes/types.d.ts +10 -0
  20. package/dist/adapters/ethers/resources/deposits/services/verification.d.ts +9 -0
  21. package/dist/adapters/ethers/resources/token-info.d.ts +31 -0
  22. package/dist/adapters/ethers/resources/utils.d.ts +39 -0
  23. package/dist/adapters/ethers/resources/withdrawals/context.d.ts +19 -0
  24. package/dist/adapters/ethers/resources/withdrawals/index.d.ts +56 -0
  25. package/dist/adapters/ethers/resources/withdrawals/routes/erc20-nonbase.d.ts +2 -0
  26. package/dist/adapters/ethers/resources/withdrawals/routes/eth-nonbase.d.ts +2 -0
  27. package/dist/adapters/ethers/resources/withdrawals/routes/eth.d.ts +2 -0
  28. package/dist/adapters/ethers/resources/withdrawals/routes/types.d.ts +18 -0
  29. package/dist/adapters/ethers/resources/withdrawals/services/finalization.d.ts +33 -0
  30. package/dist/adapters/ethers/rpc.d.ts +4 -0
  31. package/dist/adapters/ethers/sdk.cjs +6245 -0
  32. package/dist/adapters/ethers/sdk.cjs.map +1 -0
  33. package/dist/adapters/ethers/sdk.d.ts +29 -0
  34. package/dist/adapters/ethers/sdk.js +6 -0
  35. package/dist/adapters/ethers/typechain/IAssetRouterBase.d.ts +198 -0
  36. package/dist/adapters/ethers/typechain/IBridgehub.d.ts +731 -0
  37. package/dist/adapters/ethers/typechain/IERC20.d.ts +108 -0
  38. package/dist/adapters/ethers/typechain/IL1AssetRouter.d.ts +570 -0
  39. package/dist/adapters/ethers/typechain/IL1NativeTokenVault.d.ts +154 -0
  40. package/dist/adapters/ethers/typechain/IL1Nullifier.d.ts +305 -0
  41. package/dist/adapters/ethers/typechain/IL2AssetRouter.d.ts +288 -0
  42. package/dist/adapters/ethers/typechain/IL2NativeTokenVault.d.ts +380 -0
  43. package/dist/adapters/ethers/typechain/common.d.ts +46 -0
  44. package/dist/adapters/ethers/typechain/factories/IAssetRouterBase__factory.d.ts +203 -0
  45. package/dist/adapters/ethers/typechain/factories/IBridgehub__factory.d.ts +998 -0
  46. package/dist/adapters/ethers/typechain/factories/IERC20__factory.d.ts +177 -0
  47. package/dist/adapters/ethers/typechain/factories/IL1AssetRouter__factory.d.ts +666 -0
  48. package/dist/adapters/ethers/typechain/factories/IL1NativeTokenVault__factory.d.ts +234 -0
  49. package/dist/adapters/ethers/typechain/factories/IL1Nullifier__factory.d.ts +382 -0
  50. package/dist/adapters/ethers/typechain/factories/IL2AssetRouter__factory.d.ts +327 -0
  51. package/dist/adapters/ethers/typechain/factories/IL2NativeTokenVault__factory.d.ts +696 -0
  52. package/dist/adapters/ethers/typechain/factories/index.d.ts +8 -0
  53. package/dist/adapters/ethers/typechain/index.d.ts +17 -0
  54. package/dist/adapters/viem/client.cjs +4534 -0
  55. package/dist/adapters/viem/client.cjs.map +1 -0
  56. package/dist/adapters/viem/client.d.ts +44 -0
  57. package/dist/adapters/viem/client.js +5 -0
  58. package/dist/adapters/viem/errors/error-ops.d.ts +20 -0
  59. package/dist/adapters/viem/errors/revert.d.ts +25 -0
  60. package/dist/adapters/viem/index.cjs +7772 -0
  61. package/dist/adapters/viem/index.cjs.map +1 -0
  62. package/dist/adapters/viem/index.d.ts +11 -0
  63. package/dist/adapters/viem/index.js +8 -0
  64. package/dist/adapters/viem/resources/deposits/context.d.ts +27 -0
  65. package/dist/adapters/viem/resources/deposits/index.d.ts +46 -0
  66. package/dist/adapters/viem/resources/deposits/routes/erc20-base.d.ts +2 -0
  67. package/dist/adapters/viem/resources/deposits/routes/erc20-nonbase.d.ts +2 -0
  68. package/dist/adapters/viem/resources/deposits/routes/eth-nonbase.d.ts +2 -0
  69. package/dist/adapters/viem/resources/deposits/routes/eth.d.ts +2 -0
  70. package/dist/adapters/viem/resources/deposits/routes/types.d.ts +20 -0
  71. package/dist/adapters/viem/resources/deposits/services/verification.d.ts +7 -0
  72. package/dist/adapters/viem/resources/token-info.d.ts +34 -0
  73. package/dist/adapters/viem/resources/utils.d.ts +42 -0
  74. package/dist/adapters/viem/resources/withdrawals/context.d.ts +22 -0
  75. package/dist/adapters/viem/resources/withdrawals/index.d.ts +56 -0
  76. package/dist/adapters/viem/resources/withdrawals/routes/erc20-nonbase.d.ts +2 -0
  77. package/dist/adapters/viem/resources/withdrawals/routes/eth-nonbase.d.ts +2 -0
  78. package/dist/adapters/viem/resources/withdrawals/routes/eth.d.ts +2 -0
  79. package/dist/adapters/viem/resources/withdrawals/routes/types.d.ts +19 -0
  80. package/dist/adapters/viem/resources/withdrawals/services/finalization.d.ts +33 -0
  81. package/dist/adapters/viem/rpc.d.ts +2 -0
  82. package/dist/adapters/viem/sdk.cjs +6481 -0
  83. package/dist/adapters/viem/sdk.cjs.map +1 -0
  84. package/dist/adapters/viem/sdk.d.ts +32 -0
  85. package/dist/adapters/viem/sdk.js +6 -0
  86. package/dist/chunk-263G6636.js +36 -0
  87. package/dist/chunk-3LALBFFE.js +138 -0
  88. package/dist/chunk-4HLJJKIY.js +262 -0
  89. package/dist/chunk-6GCT6TLS.js +45 -0
  90. package/dist/chunk-7M4V3FMT.js +2444 -0
  91. package/dist/chunk-B77GWPO5.js +339 -0
  92. package/dist/chunk-BD2LUO5T.js +123 -0
  93. package/dist/chunk-CGO27P7F.js +2187 -0
  94. package/dist/chunk-DI2CJDPZ.js +76 -0
  95. package/dist/chunk-Y75OMFK6.js +4489 -0
  96. package/dist/core/constants.cjs +39 -0
  97. package/dist/core/constants.cjs.map +1 -0
  98. package/dist/core/constants.d.ts +36 -0
  99. package/dist/core/constants.js +1 -0
  100. package/dist/core/errors/factory.d.ts +10 -0
  101. package/dist/core/errors/formatter.d.ts +2 -0
  102. package/dist/core/errors/rpc.d.ts +4 -0
  103. package/dist/core/errors/withdrawal-revert-map.d.ts +3 -0
  104. package/dist/core/index.cjs +552 -0
  105. package/dist/core/index.cjs.map +1 -0
  106. package/dist/core/index.d.ts +18 -0
  107. package/dist/core/index.js +4 -0
  108. package/dist/core/internal/abi-registry.d.ts +9 -0
  109. package/dist/core/internal/abis/IAssetRouterBase.d.ts +198 -0
  110. package/dist/core/internal/abis/IBaseToken.d.ts +162 -0
  111. package/dist/core/internal/abis/IBridgehub.d.ts +994 -0
  112. package/dist/core/internal/abis/IERC20.d.ts +224 -0
  113. package/dist/core/internal/abis/IL1AssetRouter.d.ts +661 -0
  114. package/dist/core/internal/abis/IL1Nullifier.d.ts +377 -0
  115. package/dist/core/internal/abis/IL2AssetRouter.d.ts +690 -0
  116. package/dist/core/internal/abis/L1NativeTokenVault.d.ts +719 -0
  117. package/dist/core/internal/abis/L2NativeTokenVault.d.ts +735 -0
  118. package/dist/core/internal/abis/Mailbox.d.ts +779 -0
  119. package/dist/core/resources/deposits/route.d.ts +6 -0
  120. package/dist/core/resources/withdrawals/events.d.ts +9 -0
  121. package/dist/core/resources/withdrawals/logs.d.ts +5 -0
  122. package/dist/core/resources/withdrawals/route.d.ts +6 -0
  123. package/dist/core/rpc/transport.d.ts +10 -0
  124. package/dist/core/rpc/types.d.ts +40 -0
  125. package/dist/core/rpc/zks.d.ts +12 -0
  126. package/dist/core/types/errors.d.ts +177 -0
  127. package/dist/core/types/flows/base.d.ts +51 -0
  128. package/dist/core/types/flows/deposits.d.ts +43 -0
  129. package/dist/core/types/flows/route.d.ts +12 -0
  130. package/dist/core/types/flows/withdrawals.d.ts +83 -0
  131. package/dist/core/types/index.d.ts +2 -0
  132. package/dist/core/types/primitives.d.ts +3 -0
  133. package/dist/core/utils/addr.d.ts +5 -0
  134. package/dist/core/utils/gas.d.ts +13 -0
  135. package/dist/index.cjs +571 -0
  136. package/dist/index.cjs.map +1 -0
  137. package/dist/index.d.ts +18 -0
  138. package/dist/index.js +4 -0
  139. package/package.json +177 -0
@@ -0,0 +1,2 @@
1
+ import type { DepositRouteStrategy } from './types';
2
+ export declare function routeErc20NonBase(): DepositRouteStrategy;
@@ -0,0 +1,2 @@
1
+ import type { DepositRouteStrategy } from './types';
2
+ export declare function routeEthNonBase(): DepositRouteStrategy;
@@ -0,0 +1,2 @@
1
+ import type { DepositRouteStrategy } from './types';
2
+ export declare function routeEthDirect(): DepositRouteStrategy;
@@ -0,0 +1,20 @@
1
+ import type { WalletClient, Transport, Chain, Account } from 'viem';
2
+ import type { DepositParams } from '../../../../../core/types/flows/deposits';
3
+ import type { RouteStrategy } from '../../../../../core/types/flows/route';
4
+ import type { BuildCtx as DepositBuildCtx } from '../context';
5
+ type WriteParams = Parameters<WalletClient<Transport, Chain, Account>['writeContract']>[0];
6
+ /**
7
+ * viem specific
8
+ * Plan-time write request: relax 'value' so a single type can hold both
9
+ * non-payable (no value) and payable (value: bigint) requests.
10
+ */
11
+ export type ViemPlanWriteRequest = Omit<WriteParams, 'value'> & {
12
+ value?: bigint;
13
+ };
14
+ export type DepositQuoteExtras = {
15
+ baseCost: bigint;
16
+ mintValue: bigint;
17
+ l1GasLimit?: bigint;
18
+ };
19
+ export type DepositRouteStrategy = RouteStrategy<DepositParams, ViemPlanWriteRequest, DepositQuoteExtras, DepositBuildCtx>;
20
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { PublicClient, TransactionReceipt, Log } from 'viem';
2
+ import type { Hex } from '../../../../../core/types/primitives';
3
+ export declare function extractL2TxHashFromL1Logs(logs: ReadonlyArray<Log>): Hex | null;
4
+ export declare function waitForL2ExecutionFromL1Tx(l1: PublicClient, l2: PublicClient, l1TxHash: Hex): Promise<{
5
+ l2Receipt: TransactionReceipt;
6
+ l2TxHash: Hex;
7
+ }>;
@@ -0,0 +1,34 @@
1
+ import type { PublicClient } from 'viem';
2
+ export type L2Reader = {
3
+ readContract: PublicClient['readContract'];
4
+ };
5
+ import type { Address } from '../../../core/types/primitives';
6
+ /**
7
+ * Read the `BASE_TOKEN_ASSET_ID` from the L2 NativeTokenVault.
8
+ * This is the encoded assetId of the chain’s base token.
9
+ */
10
+ export declare function ntvBaseAssetId(l2: L2Reader, ntv: Address): Promise<`0x${string}`>;
11
+ /**
12
+ * Read the `L1_CHAIN_ID` that the L2 NativeTokenVault is anchored to.
13
+ * Needed when encoding asset IDs.
14
+ */
15
+ export declare function ntvL1ChainId(l2: L2Reader, ntv: Address): Promise<bigint>;
16
+ /**
17
+ * Ensure a token is registered in the L2 NativeTokenVault and return its assetId.
18
+ * (Will register on-chain if not yet registered.)
19
+ */
20
+ export declare function ntvAssetIdForToken(l2: L2Reader, ntv: Address, token: Address): Promise<`0x${string}`>;
21
+ /**
22
+ * Check if the chain is ETH-based (i.e. base token == ETH).
23
+ */
24
+ export declare function isEthBasedChain(l2: L2Reader, ntv: Address): Promise<boolean>;
25
+ /**
26
+ * Check if a given token address is the chain’s base token.
27
+ */
28
+ export declare function isBaseToken(l2: L2Reader, ntv: Address, token: Address): Promise<boolean>;
29
+ /**
30
+ * Check if the token should be treated as "ETH" on this L2.
31
+ * - If it equals the universal ETH alias (0x…800A), return true immediately.
32
+ * - Else compare the token’s assetId to the ETH sentinel assetId via the NTV.
33
+ */
34
+ export declare function isEthTokenOnThisChain(l2: L2Reader, ntv: Address, token: Address): Promise<boolean>;
@@ -0,0 +1,42 @@
1
+ import { type Hex } from 'viem';
2
+ import type { Address } from '../../../core/types';
3
+ import type { ViemClient } from '../client';
4
+ import type { Eip1559GasOverrides, ResolvedEip1559Fees } from '../../../core/types/flows/base';
5
+ export declare function encodeNativeTokenVaultAssetId(chainId: bigint, address: string): Hex;
6
+ export declare function encodeNativeTokenVaultTransferData(amount: bigint, receiver: Address, token: Address): Hex;
7
+ export declare function encodeSecondBridgeDataV1(assetId: Hex, transferData: Hex): Hex;
8
+ export declare const encodeNTVAssetId: typeof encodeNativeTokenVaultAssetId;
9
+ export declare const encodeNTVTransferData: typeof encodeNativeTokenVaultTransferData;
10
+ export declare function scaleGasLimit(gasLimit: bigint): bigint;
11
+ /** Throws if baseCost > value */
12
+ export declare function checkBaseCost(baseCost: bigint, value: bigint | Promise<bigint>): Promise<void>;
13
+ export type FeeOverrides = ResolvedEip1559Fees & {
14
+ gasPriceForBaseCost: bigint;
15
+ };
16
+ export declare function getFeeOverrides(client: ViemClient, overrides?: Eip1559GasOverrides): Promise<FeeOverrides>;
17
+ export declare function getL2FeeOverrides(client: ViemClient, overrides?: Eip1559GasOverrides): Promise<ResolvedEip1559Fees>;
18
+ export declare function buildViemFeeOverrides(fees: ResolvedEip1559Fees): Record<string, unknown>;
19
+ /** Fetches the gas price in wei (legacy) or falls back to maxFeePerGas. */
20
+ export declare function getGasPriceWei(client: ViemClient): Promise<bigint>;
21
+ export declare function buildDirectRequestStruct(args: {
22
+ chainId: bigint;
23
+ mintValue: bigint;
24
+ l2GasLimit: bigint;
25
+ gasPerPubdata: bigint;
26
+ refundRecipient: Address;
27
+ l2Contract: Address;
28
+ l2Value: bigint;
29
+ }): {
30
+ chainId: bigint;
31
+ l2Contract: `0x${string}`;
32
+ mintValue: bigint;
33
+ l2Value: bigint;
34
+ l2Calldata: Hex;
35
+ l2GasLimit: bigint;
36
+ l2GasPerPubdataByteLimit: bigint;
37
+ factoryDeps: Hex[];
38
+ refundRecipient: `0x${string}`;
39
+ };
40
+ export declare function encodeSecondBridgeArgs(token: Address, amount: bigint, l2Receiver: Address): Hex;
41
+ export declare function encodeSecondBridgeErc20Args(token: Address, amount: bigint, l2Receiver: Address): Hex;
42
+ export declare function encodeSecondBridgeEthArgs(amount: bigint, l2Receiver: Address, ethToken?: Address): Hex;
@@ -0,0 +1,22 @@
1
+ import type { ViemClient } from '../../client';
2
+ import type { Address } from '../../../../core/types/primitives';
3
+ import type { WithdrawParams, WithdrawRoute } from '../../../../core/types/flows/withdrawals';
4
+ import type { CommonCtx, ResolvedEip1559Fees } from '../../../../core/types/flows/base';
5
+ export interface BuildCtx extends CommonCtx {
6
+ client: ViemClient;
7
+ bridgehub: Address;
8
+ l1AssetRouter: Address;
9
+ l1Nullifier: Address;
10
+ l2AssetRouter: Address;
11
+ l2NativeTokenVault: Address;
12
+ l2BaseTokenSystem: Address;
13
+ baseIsEth: boolean;
14
+ chainIdL2: bigint;
15
+ sender: Address;
16
+ l2GasLimit: bigint;
17
+ gasBufferPct: number;
18
+ fee: ResolvedEip1559Fees;
19
+ }
20
+ export declare function commonCtx(p: WithdrawParams, client: ViemClient): Promise<BuildCtx & {
21
+ route: WithdrawRoute;
22
+ }>;
@@ -0,0 +1,56 @@
1
+ import type { ViemClient } from '../../client';
2
+ import type { WithdrawParams, WithdrawQuote, WithdrawPlan, WithdrawHandle, WithdrawalWaitable, WithdrawRoute, WithdrawalStatus } from '../../../../core/types/flows/withdrawals';
3
+ import type { Hex } from '../../../../core/types/primitives';
4
+ import type { TransactionReceipt } from 'viem';
5
+ import type { WithdrawRouteStrategy, TransactionReceiptZKsyncOS, ViemPlanWriteRequest } from './routes/types';
6
+ import { createFinalizationServices, type FinalizationServices } from './services/finalization';
7
+ export declare const ROUTES: Record<WithdrawRoute, WithdrawRouteStrategy>;
8
+ export interface WithdrawalsResource {
9
+ quote(p: WithdrawParams): Promise<WithdrawQuote>;
10
+ tryQuote(p: WithdrawParams): Promise<{
11
+ ok: true;
12
+ value: WithdrawQuote;
13
+ } | {
14
+ ok: false;
15
+ error: unknown;
16
+ }>;
17
+ prepare(p: WithdrawParams): Promise<WithdrawPlan<ViemPlanWriteRequest>>;
18
+ tryPrepare(p: WithdrawParams): Promise<{
19
+ ok: true;
20
+ value: WithdrawPlan<ViemPlanWriteRequest>;
21
+ } | {
22
+ ok: false;
23
+ error: unknown;
24
+ }>;
25
+ create(p: WithdrawParams): Promise<WithdrawHandle<ViemPlanWriteRequest>>;
26
+ tryCreate(p: WithdrawParams): Promise<{
27
+ ok: true;
28
+ value: WithdrawHandle<ViemPlanWriteRequest>;
29
+ } | {
30
+ ok: false;
31
+ error: unknown;
32
+ }>;
33
+ status(h: WithdrawalWaitable | Hex): Promise<WithdrawalStatus>;
34
+ wait(h: WithdrawalWaitable | Hex, opts: {
35
+ for: 'l2' | 'ready' | 'finalized';
36
+ pollMs?: number;
37
+ timeoutMs?: number;
38
+ }): Promise<TransactionReceiptZKsyncOS | TransactionReceipt | null>;
39
+ finalize(l2TxHash: Hex): Promise<{
40
+ status: WithdrawalStatus;
41
+ receipt?: TransactionReceipt;
42
+ }>;
43
+ tryFinalize(l2TxHash: Hex): Promise<{
44
+ ok: true;
45
+ value: {
46
+ status: WithdrawalStatus;
47
+ receipt?: TransactionReceipt;
48
+ };
49
+ } | {
50
+ ok: false;
51
+ error: unknown;
52
+ }>;
53
+ }
54
+ export declare function createWithdrawalsResource(client: ViemClient): WithdrawalsResource;
55
+ export { createFinalizationServices };
56
+ export type { FinalizationServices };
@@ -0,0 +1,2 @@
1
+ import type { WithdrawRouteStrategy } from './types.ts';
2
+ export declare function routeErc20NonBase(): WithdrawRouteStrategy;
@@ -0,0 +1,2 @@
1
+ import type { WithdrawRouteStrategy } from './types';
2
+ export declare function routeEthNonBase(): WithdrawRouteStrategy;
@@ -0,0 +1,2 @@
1
+ import type { WithdrawRouteStrategy } from './types';
2
+ export declare function routeEthBase(): WithdrawRouteStrategy;
@@ -0,0 +1,19 @@
1
+ import type { WalletClient, Transport, Chain, Account, TransactionReceipt } from 'viem';
2
+ import type { WithdrawParams } from '../../../../../core/types/flows/withdrawals';
3
+ import type { RouteStrategy } from '../../../../../core/types/flows/route';
4
+ import type { BuildCtx as WithdrawBuildCtx } from '../context';
5
+ import type { Address, Hex } from '../../../../../core/types';
6
+ export type ViemPlanWriteRequest = Parameters<WalletClient<Transport, Chain, Account>['writeContract']>[0];
7
+ export type WithdrawQuoteExtras = Record<string, never>;
8
+ export type WithdrawRouteStrategy = RouteStrategy<WithdrawParams, ViemPlanWriteRequest, WithdrawQuoteExtras, WithdrawBuildCtx>;
9
+ export interface L2ToL1Log {
10
+ l2ShardId?: number;
11
+ isService?: boolean;
12
+ txNumberInBlock?: number;
13
+ sender?: Address;
14
+ key?: Hex;
15
+ value?: Hex;
16
+ }
17
+ export type TransactionReceiptZKsyncOS = TransactionReceipt & {
18
+ l2ToL1Logs?: L2ToL1Log[];
19
+ };
@@ -0,0 +1,33 @@
1
+ import type { Address, Hex } from '../../../../../core/types/primitives';
2
+ import type { ViemClient } from '../../../client';
3
+ import { type FinalizeReadiness, type FinalizeDepositParams, type WithdrawalKey, type FinalizationEstimate } from '../../../../../core/types/flows/withdrawals';
4
+ import type { TransactionReceipt } from 'viem';
5
+ export interface FinalizationServices {
6
+ /**
7
+ * Build finalizeDeposit params.
8
+ */
9
+ fetchFinalizeDepositParams(l2TxHash: Hex): Promise<{
10
+ params: FinalizeDepositParams;
11
+ nullifier: Address;
12
+ }>;
13
+ /**
14
+ * Read the Nullifier mapping to check finalization status.
15
+ */
16
+ isWithdrawalFinalized(key: WithdrawalKey): Promise<boolean>;
17
+ /**
18
+ * Simulate finalizeDeposit on L1 Nullifier to check readiness.
19
+ */
20
+ simulateFinalizeReadiness(params: FinalizeDepositParams): Promise<FinalizeReadiness>;
21
+ /**
22
+ * Estimate gas & fees for finalizeDeposit on L1 Nullifier.
23
+ */
24
+ estimateFinalization(params: FinalizeDepositParams): Promise<FinalizationEstimate>;
25
+ /**
26
+ * Call finalizeDeposit on L1 Nullifier.
27
+ */
28
+ finalizeDeposit(params: FinalizeDepositParams): Promise<{
29
+ hash: string;
30
+ wait: () => Promise<TransactionReceipt>;
31
+ }>;
32
+ }
33
+ export declare function createFinalizationServices(client: ViemClient): FinalizationServices;
@@ -0,0 +1,2 @@
1
+ import type { PublicClient } from 'viem';
2
+ export declare function zksRpcFromViem(l2Client: PublicClient): import("../..").ZksRpc;