viem 2.30.1 → 2.30.3
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/CHANGELOG.md +22 -0
- package/_cjs/actions/public/call.js +2 -2
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/estimateGas.js +1 -1
- package/_cjs/actions/public/estimateGas.js.map +1 -1
- package/_cjs/actions/public/simulateBlocks.js +1 -1
- package/_cjs/actions/public/simulateBlocks.js.map +1 -1
- package/_cjs/actions/public/watchBlocks.js +4 -2
- package/_cjs/actions/public/watchBlocks.js.map +1 -1
- package/_cjs/chains/definitions/bitkub.js +3 -3
- package/_cjs/chains/definitions/bitkub.js.map +1 -1
- package/_cjs/chains/definitions/jbc.js +1 -1
- package/_cjs/chains/definitions/jbc.js.map +1 -1
- package/_cjs/chains/definitions/riseTestnet.js +29 -0
- package/_cjs/chains/definitions/riseTestnet.js.map +1 -0
- package/_cjs/chains/index.js +6 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/utils/rpc/socket.js +8 -4
- package/_cjs/utils/rpc/socket.js.map +1 -1
- package/_cjs/zksync/actions/claimFailedDeposit.js +146 -0
- package/_cjs/zksync/actions/claimFailedDeposit.js.map +1 -0
- package/_cjs/zksync/actions/deposit.js +51 -4
- package/_cjs/zksync/actions/deposit.js.map +1 -1
- package/_cjs/zksync/actions/finalizeWithdrawal.js +41 -41
- package/_cjs/zksync/actions/finalizeWithdrawal.js.map +1 -1
- package/_cjs/zksync/actions/getDefaultBridgeAddresses.js +2 -0
- package/_cjs/zksync/actions/getDefaultBridgeAddresses.js.map +1 -1
- package/_cjs/zksync/actions/isWithdrawalFinalized.js +2 -17
- package/_cjs/zksync/actions/isWithdrawalFinalized.js.map +1 -1
- package/_cjs/zksync/actions/withdraw.js +49 -8
- package/_cjs/zksync/actions/withdraw.js.map +1 -1
- package/_cjs/zksync/constants/address.js +4 -1
- package/_cjs/zksync/constants/address.js.map +1 -1
- package/_cjs/zksync/decorators/walletL1.js +2 -0
- package/_cjs/zksync/decorators/walletL1.js.map +1 -1
- package/_cjs/zksync/errors/bridge.js +23 -1
- package/_cjs/zksync/errors/bridge.js.map +1 -1
- package/_cjs/zksync/index.js +4 -2
- package/_cjs/zksync/index.js.map +1 -1
- package/_esm/actions/public/call.js +2 -2
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/estimateGas.js +1 -1
- package/_esm/actions/public/estimateGas.js.map +1 -1
- package/_esm/actions/public/simulateBlocks.js +1 -1
- package/_esm/actions/public/simulateBlocks.js.map +1 -1
- package/_esm/actions/public/watchBlocks.js +4 -2
- package/_esm/actions/public/watchBlocks.js.map +1 -1
- package/_esm/chains/definitions/bitkub.js +3 -3
- package/_esm/chains/definitions/bitkub.js.map +1 -1
- package/_esm/chains/definitions/jbc.js +1 -1
- package/_esm/chains/definitions/jbc.js.map +1 -1
- package/_esm/chains/definitions/riseTestnet.js +26 -0
- package/_esm/chains/definitions/riseTestnet.js.map +1 -0
- package/_esm/chains/index.js +2 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/utils/rpc/socket.js +10 -6
- package/_esm/utils/rpc/socket.js.map +1 -1
- package/_esm/zksync/actions/claimFailedDeposit.js +199 -0
- package/_esm/zksync/actions/claimFailedDeposit.js.map +1 -0
- package/_esm/zksync/actions/deposit.js +61 -11
- package/_esm/zksync/actions/deposit.js.map +1 -1
- package/_esm/zksync/actions/finalizeWithdrawal.js +42 -42
- package/_esm/zksync/actions/finalizeWithdrawal.js.map +1 -1
- package/_esm/zksync/actions/getDefaultBridgeAddresses.js +2 -0
- package/_esm/zksync/actions/getDefaultBridgeAddresses.js.map +1 -1
- package/_esm/zksync/actions/isWithdrawalFinalized.js +3 -18
- package/_esm/zksync/actions/isWithdrawalFinalized.js.map +1 -1
- package/_esm/zksync/actions/withdraw.js +54 -10
- package/_esm/zksync/actions/withdraw.js.map +1 -1
- package/_esm/zksync/constants/address.js +3 -0
- package/_esm/zksync/constants/address.js.map +1 -1
- package/_esm/zksync/decorators/walletL1.js +2 -0
- package/_esm/zksync/decorators/walletL1.js.map +1 -1
- package/_esm/zksync/errors/bridge.js +19 -0
- package/_esm/zksync/errors/bridge.js.map +1 -1
- package/_esm/zksync/index.js +1 -0
- package/_esm/zksync/index.js.map +1 -1
- package/_types/actions/public/call.d.ts +1 -1
- package/_types/actions/public/estimateGas.d.ts +1 -1
- package/_types/actions/public/watchBlocks.d.ts.map +1 -1
- package/_types/chains/definitions/bitkub.d.ts +3 -3
- package/_types/chains/definitions/jbc.d.ts +1 -1
- package/_types/chains/definitions/riseTestnet.d.ts +35 -0
- package/_types/chains/definitions/riseTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +2 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/utils/rpc/socket.d.ts.map +1 -1
- package/_types/zksync/actions/claimFailedDeposit.d.ts +77 -0
- package/_types/zksync/actions/claimFailedDeposit.d.ts.map +1 -0
- package/_types/zksync/actions/deposit.d.ts +0 -1
- package/_types/zksync/actions/deposit.d.ts.map +1 -1
- package/_types/zksync/actions/finalizeWithdrawal.d.ts.map +1 -1
- package/_types/zksync/actions/getDefaultBridgeAddresses.d.ts.map +1 -1
- package/_types/zksync/actions/isWithdrawalFinalized.d.ts.map +1 -1
- package/_types/zksync/actions/withdraw.d.ts +1 -1
- package/_types/zksync/actions/withdraw.d.ts.map +1 -1
- package/_types/zksync/constants/address.d.ts +3 -0
- package/_types/zksync/constants/address.d.ts.map +1 -1
- package/_types/zksync/decorators/walletL1.d.ts +32 -1
- package/_types/zksync/decorators/walletL1.d.ts.map +1 -1
- package/_types/zksync/errors/bridge.d.ts +23 -0
- package/_types/zksync/errors/bridge.d.ts.map +1 -1
- package/_types/zksync/index.d.ts +1 -0
- package/_types/zksync/index.d.ts.map +1 -1
- package/_types/zksync/types/contract.d.ts +2 -0
- package/_types/zksync/types/contract.d.ts.map +1 -1
- package/_types/zksync/types/eip1193.d.ts +2 -0
- package/_types/zksync/types/eip1193.d.ts.map +1 -1
- package/actions/public/call.ts +3 -3
- package/actions/public/estimateGas.ts +2 -2
- package/actions/public/simulateBlocks.ts +1 -1
- package/actions/public/watchBlocks.ts +7 -5
- package/chains/definitions/bitkub.ts +3 -3
- package/chains/definitions/jbc.ts +1 -1
- package/chains/definitions/riseTestnet.ts +26 -0
- package/chains/index.ts +2 -0
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/utils/rpc/socket.ts +10 -8
- package/zksync/actions/claimFailedDeposit.ts +319 -0
- package/zksync/actions/deposit.ts +116 -14
- package/zksync/actions/finalizeWithdrawal.ts +53 -51
- package/zksync/actions/getDefaultBridgeAddresses.ts +3 -0
- package/zksync/actions/isWithdrawalFinalized.ts +4 -22
- package/zksync/actions/withdraw.ts +64 -8
- package/zksync/constants/address.ts +9 -0
- package/zksync/decorators/walletL1.ts +49 -1
- package/zksync/errors/bridge.ts +35 -0
- package/zksync/index.ts +6 -0
- package/zksync/types/contract.ts +2 -0
- package/zksync/types/eip1193.ts +2 -0
@@ -1,4 +1,3 @@
|
|
1
|
-
import type { Address } from 'abitype'
|
2
1
|
import type { Account } from '../../accounts/types.js'
|
3
2
|
import { readContract } from '../../actions/public/readContract.js'
|
4
3
|
import type { Client } from '../../clients/createClient.js'
|
@@ -9,9 +8,7 @@ import {
|
|
9
8
|
} from '../../errors/chain.js'
|
10
9
|
import type { Chain } from '../../types/chain.js'
|
11
10
|
import type { Hash } from '../../types/misc.js'
|
12
|
-
import {
|
13
|
-
import { l1SharedBridgeAbi, l2SharedBridgeAbi } from '../constants/abis.js'
|
14
|
-
import { l2BaseTokenAddress } from '../constants/address.js'
|
11
|
+
import { l1SharedBridgeAbi } from '../constants/abis.js'
|
15
12
|
import {
|
16
13
|
WithdrawalLogNotFoundError,
|
17
14
|
type WithdrawalLogNotFoundErrorType,
|
@@ -19,7 +16,6 @@ import {
|
|
19
16
|
import type { ChainEIP712 } from '../types/chain.js'
|
20
17
|
import { getWithdrawalL2ToL1Log } from '../utils/bridge/getWithdrawalL2ToL1Log.js'
|
21
18
|
import { getWithdrawalLog } from '../utils/bridge/getWithdrawalLog.js'
|
22
|
-
import { getBaseTokenL1Address } from './getBaseTokenL1Address.js'
|
23
19
|
import { getDefaultBridgeAddresses } from './getDefaultBridgeAddresses.js'
|
24
20
|
import { getLogProof } from './getLogProof.js'
|
25
21
|
|
@@ -87,7 +83,7 @@ export async function isWithdrawalFinalized<
|
|
87
83
|
hash,
|
88
84
|
index,
|
89
85
|
})
|
90
|
-
|
86
|
+
|
91
87
|
// `getLogProof` is called not to get proof but
|
92
88
|
// to get the index of the corresponding L2->L1 log,
|
93
89
|
// which is returned as `proof.id`.
|
@@ -95,23 +91,9 @@ export async function isWithdrawalFinalized<
|
|
95
91
|
txHash: hash,
|
96
92
|
index: l2ToL1LogIndex!,
|
97
93
|
})
|
98
|
-
if (!proof) {
|
99
|
-
throw new WithdrawalLogNotFoundError({ hash })
|
100
|
-
}
|
94
|
+
if (!proof) throw new WithdrawalLogNotFoundError({ hash })
|
101
95
|
|
102
|
-
|
103
|
-
if (
|
104
|
-
isAddressEqual(sender, await getBaseTokenL1Address(l2Client)) ||
|
105
|
-
isAddressEqual(sender, l2BaseTokenAddress)
|
106
|
-
)
|
107
|
-
l1Bridge = (await getDefaultBridgeAddresses(l2Client)).sharedL1
|
108
|
-
else
|
109
|
-
l1Bridge = await readContract(l2Client, {
|
110
|
-
address: sender,
|
111
|
-
abi: l2SharedBridgeAbi,
|
112
|
-
functionName: 'l1SharedBridge',
|
113
|
-
args: [],
|
114
|
-
})
|
96
|
+
const l1Bridge = (await getDefaultBridgeAddresses(l2Client)).sharedL1
|
115
97
|
|
116
98
|
return await readContract(client, {
|
117
99
|
address: l1Bridge,
|
@@ -1,26 +1,33 @@
|
|
1
|
-
import type
|
1
|
+
import { type Address, parseAbi } from 'abitype'
|
2
2
|
import type { Account } from '../../accounts/types.js'
|
3
|
+
import { readContract } from '../../actions/public/readContract.js'
|
3
4
|
import type { Client } from '../../clients/createClient.js'
|
4
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
5
6
|
import { AccountNotFoundError } from '../../errors/account.js'
|
7
|
+
import { ClientChainNotConfiguredError } from '../../errors/chain.js'
|
6
8
|
import type { GetAccountParameter } from '../../types/account.js'
|
7
9
|
import type { GetChainParameter } from '../../types/chain.js'
|
8
10
|
import type { UnionOmit } from '../../types/utils.js'
|
9
11
|
import type { EncodeFunctionDataReturnType } from '../../utils/abi/encodeFunctionData.js'
|
10
12
|
import {
|
13
|
+
encodeAbiParameters,
|
11
14
|
encodeFunctionData,
|
12
15
|
isAddressEqual,
|
16
|
+
keccak256,
|
13
17
|
parseAccount,
|
14
18
|
} from '../../utils/index.js'
|
15
19
|
import { ethTokenAbi, l2SharedBridgeAbi } from '../constants/abis.js'
|
16
20
|
import {
|
17
21
|
ethAddressInContracts,
|
22
|
+
l2AssetRouterAddress,
|
18
23
|
l2BaseTokenAddress,
|
24
|
+
l2NativeTokenVaultAddress,
|
19
25
|
legacyEthAddress,
|
20
26
|
} from '../constants/address.js'
|
21
27
|
import type { ChainEIP712 } from '../types/chain.js'
|
22
28
|
import type { ZksyncTransactionRequest } from '../types/transaction.js'
|
23
29
|
import { getDefaultBridgeAddresses } from './getDefaultBridgeAddresses.js'
|
30
|
+
import { getL1ChainId } from './getL1ChainId.js'
|
24
31
|
import { getL2TokenAddress } from './getL2TokenAddress.js'
|
25
32
|
import {
|
26
33
|
type SendTransactionErrorType,
|
@@ -133,6 +140,7 @@ export async function withdraw<
|
|
133
140
|
): Promise<WithdrawReturnType> {
|
134
141
|
let {
|
135
142
|
account: account_ = client.account,
|
143
|
+
chain: chain_ = client.chain,
|
136
144
|
token = l2BaseTokenAddress,
|
137
145
|
to,
|
138
146
|
amount,
|
@@ -165,17 +173,65 @@ export async function withdraw<
|
|
165
173
|
value = amount
|
166
174
|
contract = l2BaseTokenAddress
|
167
175
|
} else {
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
176
|
+
const assetId = await readContract(client, {
|
177
|
+
address: l2NativeTokenVaultAddress,
|
178
|
+
abi: parseAbi(['function assetId(address token) view returns (bytes32)']),
|
179
|
+
functionName: 'assetId',
|
180
|
+
args: [token],
|
172
181
|
})
|
173
|
-
|
174
|
-
|
175
|
-
: (
|
182
|
+
const originChainId = await readContract(client, {
|
183
|
+
address: l2NativeTokenVaultAddress,
|
184
|
+
abi: parseAbi([
|
185
|
+
'function originChainId(bytes32 assetId) view returns (uint256)',
|
186
|
+
]),
|
187
|
+
functionName: 'originChainId',
|
188
|
+
args: [assetId],
|
189
|
+
})
|
190
|
+
const l1ChainId = await getL1ChainId(client)
|
191
|
+
|
192
|
+
const isTokenL1Native =
|
193
|
+
originChainId === BigInt(l1ChainId) || token === ethAddressInContracts
|
194
|
+
if (!bridgeAddress) {
|
195
|
+
// If the legacy L2SharedBridge is deployed we use it for l1 native tokens.
|
196
|
+
bridgeAddress = isTokenL1Native
|
197
|
+
? (await getDefaultBridgeAddresses(client)).sharedL2
|
198
|
+
: l2AssetRouterAddress
|
199
|
+
}
|
200
|
+
// For non L1 native tokens we need to use the AssetRouter.
|
201
|
+
// For L1 native tokens we can use the legacy withdraw method.
|
202
|
+
if (!isTokenL1Native) {
|
203
|
+
contract = l2AssetRouterAddress
|
204
|
+
if (!chain_) throw new ClientChainNotConfiguredError()
|
205
|
+
const chainId = chain_.id
|
206
|
+
const assetId = keccak256(
|
207
|
+
encodeAbiParameters(
|
208
|
+
[{ type: 'uint256' }, { type: 'address' }, { type: 'address' }],
|
209
|
+
[BigInt(chainId), l2NativeTokenVaultAddress, token],
|
210
|
+
),
|
211
|
+
)
|
212
|
+
const assetData = encodeAbiParameters(
|
213
|
+
[{ type: 'uint256' }, { type: 'address' }, { type: 'address' }],
|
214
|
+
[BigInt(amount), to, token],
|
215
|
+
)
|
216
|
+
data = encodeFunctionData({
|
217
|
+
abi: parseAbi([
|
218
|
+
'function withdraw(bytes32 _assetId, bytes _transferData)',
|
219
|
+
]),
|
220
|
+
functionName: 'withdraw',
|
221
|
+
args: [assetId, assetData],
|
222
|
+
})
|
223
|
+
} else {
|
224
|
+
contract = bridgeAddress
|
225
|
+
data = encodeFunctionData({
|
226
|
+
abi: l2SharedBridgeAbi,
|
227
|
+
functionName: 'withdraw',
|
228
|
+
args: [to, token, amount],
|
229
|
+
})
|
230
|
+
}
|
176
231
|
}
|
177
232
|
|
178
233
|
return await sendTransaction(client, {
|
234
|
+
chain: chain_,
|
179
235
|
account,
|
180
236
|
to: contract,
|
181
237
|
data,
|
@@ -21,4 +21,13 @@ export const l1MessengerAddress =
|
|
21
21
|
export const l1ToL2AliasOffset =
|
22
22
|
'0x1111000000000000000000000000000000001111' as const
|
23
23
|
|
24
|
+
export const l2AssetRouterAddress =
|
25
|
+
'0x0000000000000000000000000000000000010003' as const
|
26
|
+
|
27
|
+
export const l2NativeTokenVaultAddress =
|
28
|
+
'0x0000000000000000000000000000000000010004' as const
|
29
|
+
|
30
|
+
export const bootloaderFormalAddress =
|
31
|
+
'0x0000000000000000000000000000000000008001' as const
|
32
|
+
|
24
33
|
export const addressModulo = 2n ** 160n
|
@@ -2,6 +2,11 @@ import type { Client } from '../../clients/createClient.js'
|
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import type { Account } from '../../types/account.js'
|
4
4
|
import type { Chain } from '../../types/chain.js'
|
5
|
+
import {
|
6
|
+
type ClaimFailedDepositParameters,
|
7
|
+
type ClaimFailedDepositReturnType,
|
8
|
+
claimFailedDeposit,
|
9
|
+
} from '../actions/claimFailedDeposit.js'
|
5
10
|
import {
|
6
11
|
type DepositParameters,
|
7
12
|
type DepositReturnType,
|
@@ -23,6 +28,49 @@ export type WalletActionsL1<
|
|
23
28
|
chain extends Chain | undefined = Chain | undefined,
|
24
29
|
account extends Account | undefined = Account | undefined,
|
25
30
|
> = {
|
31
|
+
/**
|
32
|
+
* Withdraws funds from the initiated deposit, which failed when finalizing on L2.
|
33
|
+
* If the deposit L2 transaction has failed, it sends an L1 transaction calling `claimFailedDeposit` method of the
|
34
|
+
* L1 bridge, which results in returning L1 tokens back to the depositor.
|
35
|
+
*
|
36
|
+
* @param parameters - {@link ClaimFailedDepositParameters}
|
37
|
+
* @returns hash - The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. {@link ClaimFailedDepositReturnType}
|
38
|
+
*
|
39
|
+
* @example
|
40
|
+
* import { createPublicClient, createWalletClient, http } from 'viem'
|
41
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
42
|
+
* import { zksync, mainnet } from 'viem/chains'
|
43
|
+
* import { walletActionsL1, publicActionsL2 } from 'viem/zksync'
|
44
|
+
*
|
45
|
+
* const walletClient = createWalletClient({
|
46
|
+
* chain: mainnet,
|
47
|
+
* transport: http(),
|
48
|
+
* account: privateKeyToAccount('0x…'),
|
49
|
+
* }).extend(walletActionsL1())
|
50
|
+
*
|
51
|
+
* const clientL2 = createPublicClient({
|
52
|
+
* chain: zksync,
|
53
|
+
* transport: http(),
|
54
|
+
* }).extend(publicActionsL2())
|
55
|
+
*
|
56
|
+
* const hash = await walletClient.claimFailedDeposit({
|
57
|
+
* client: clientL2,
|
58
|
+
* depositHash: <L2_HASH_OF_FAILED_DEPOSIT>,
|
59
|
+
* })
|
60
|
+
*/
|
61
|
+
claimFailedDeposit: <
|
62
|
+
chainOverride extends Chain | undefined = undefined,
|
63
|
+
chainL2 extends ChainEIP712 | undefined = ChainEIP712 | undefined,
|
64
|
+
accountL2 extends Account | undefined = Account | undefined,
|
65
|
+
>(
|
66
|
+
parameters: ClaimFailedDepositParameters<
|
67
|
+
chain,
|
68
|
+
account,
|
69
|
+
chainOverride,
|
70
|
+
chainL2,
|
71
|
+
accountL2
|
72
|
+
>,
|
73
|
+
) => Promise<ClaimFailedDepositReturnType>
|
26
74
|
/**
|
27
75
|
* Transfers the specified token from the associated account on the L1 network to the target account on the L2 network.
|
28
76
|
* The token can be either ETH or any ERC20 token. For ERC20 tokens, enough approved tokens must be associated with
|
@@ -53,7 +101,6 @@ export type WalletActionsL1<
|
|
53
101
|
*
|
54
102
|
* const hash = await walletClient.deposit({
|
55
103
|
* client: clientL2,
|
56
|
-
* account,
|
57
104
|
* token: legacyEthAddress,
|
58
105
|
* to: walletClient.account.address,
|
59
106
|
* amount: 1_000_000_000_000_000_000n,
|
@@ -168,6 +215,7 @@ export function walletActionsL1() {
|
|
168
215
|
>(
|
169
216
|
client: Client<transport, chain, account>,
|
170
217
|
): WalletActionsL1<chain, account> => ({
|
218
|
+
claimFailedDeposit: (args) => claimFailedDeposit(client, args),
|
171
219
|
deposit: (args) => deposit(client, args),
|
172
220
|
finalizeWithdrawal: (args) => finalizeWithdrawal(client, args),
|
173
221
|
requestExecute: (args) => requestExecute(client, args),
|
package/zksync/errors/bridge.ts
CHANGED
@@ -44,3 +44,38 @@ export class WithdrawalLogNotFoundError extends BaseError {
|
|
44
44
|
)
|
45
45
|
}
|
46
46
|
}
|
47
|
+
|
48
|
+
export type CannotClaimSuccessfulDepositErrorType =
|
49
|
+
CannotClaimSuccessfulDepositError & {
|
50
|
+
name: 'CannotClaimSuccessfulDepositError'
|
51
|
+
}
|
52
|
+
export class CannotClaimSuccessfulDepositError extends BaseError {
|
53
|
+
constructor({ hash }: { hash: Hash }) {
|
54
|
+
super([`Cannot claim successful deposit: ${hash}.`].join('\n'), {
|
55
|
+
name: 'CannotClaimSuccessfulDepositError',
|
56
|
+
})
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
export type LogProofNotFoundErrorType = LogProofNotFoundError & {
|
61
|
+
name: 'LogProofNotFoundError'
|
62
|
+
}
|
63
|
+
export class LogProofNotFoundError extends BaseError {
|
64
|
+
constructor({ hash, index }: { hash: Hash; index: number }) {
|
65
|
+
super(
|
66
|
+
[`Log proof not found for hash ${hash} and index ${index}.`].join('\n'),
|
67
|
+
{ name: 'LogProofNotFoundError' },
|
68
|
+
)
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
export type L2BridgeNotFoundErrorType = L2BridgeNotFoundError & {
|
73
|
+
name: 'L2BridgeNotFoundError'
|
74
|
+
}
|
75
|
+
export class L2BridgeNotFoundError extends BaseError {
|
76
|
+
constructor() {
|
77
|
+
super(['L2 bridge address not found.'].join('\n'), {
|
78
|
+
name: 'L2BridgeNotFoundError',
|
79
|
+
})
|
80
|
+
}
|
81
|
+
}
|
package/zksync/index.ts
CHANGED
@@ -28,6 +28,12 @@ export {
|
|
28
28
|
type HashBytecodeErrorType,
|
29
29
|
hashBytecode,
|
30
30
|
} from './utils/hashBytecode.js'
|
31
|
+
export {
|
32
|
+
type ClaimFailedDepositErrorType,
|
33
|
+
type ClaimFailedDepositParameters,
|
34
|
+
type ClaimFailedDepositReturnType,
|
35
|
+
claimFailedDeposit,
|
36
|
+
} from './actions/claimFailedDeposit.js'
|
31
37
|
export {
|
32
38
|
type DepositErrorType,
|
33
39
|
type DepositReturnType,
|
package/zksync/types/contract.ts
CHANGED