viem 2.22.9 → 2.22.10
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 +12 -0
- package/_cjs/chains/definitions/alephZeroTestnet.js +30 -0
- package/_cjs/chains/definitions/alephZeroTestnet.js.map +1 -0
- package/_cjs/chains/definitions/goat.js +29 -0
- package/_cjs/chains/definitions/goat.js.map +1 -0
- package/_cjs/chains/index.js +15 -11
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/transports/createTransport.js +2 -2
- package/_cjs/clients/transports/createTransport.js.map +1 -1
- package/_cjs/clients/transports/custom.js +2 -1
- package/_cjs/clients/transports/custom.js.map +1 -1
- package/_cjs/clients/transports/http.js +2 -1
- package/_cjs/clients/transports/http.js.map +1 -1
- package/_cjs/clients/transports/ipc.js +2 -1
- package/_cjs/clients/transports/ipc.js.map +1 -1
- package/_cjs/clients/transports/webSocket.js +2 -1
- package/_cjs/clients/transports/webSocket.js.map +1 -1
- package/_cjs/errors/rpc.js +1 -1
- package/_cjs/errors/rpc.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/utils/buildRequest.js +10 -1
- package/_cjs/utils/buildRequest.js.map +1 -1
- package/_cjs/zksync/actions/withdraw.js +53 -0
- package/_cjs/zksync/actions/withdraw.js.map +1 -0
- package/_cjs/zksync/constants/abis.js +246 -1
- package/_cjs/zksync/constants/abis.js.map +1 -1
- package/_cjs/zksync/constants/address.js.map +1 -1
- package/_cjs/zksync/decorators/walletL2.js +10 -0
- package/_cjs/zksync/decorators/walletL2.js.map +1 -0
- package/_cjs/zksync/index.js +9 -2
- package/_cjs/zksync/index.js.map +1 -1
- package/_esm/chains/definitions/alephZeroTestnet.js +27 -0
- package/_esm/chains/definitions/alephZeroTestnet.js.map +1 -0
- package/_esm/chains/definitions/goat.js +26 -0
- package/_esm/chains/definitions/goat.js.map +1 -0
- package/_esm/chains/index.js +2 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/transports/createTransport.js +2 -2
- package/_esm/clients/transports/createTransport.js.map +1 -1
- package/_esm/clients/transports/custom.js +2 -1
- package/_esm/clients/transports/custom.js.map +1 -1
- package/_esm/clients/transports/http.js +2 -1
- package/_esm/clients/transports/http.js.map +1 -1
- package/_esm/clients/transports/ipc.js +2 -1
- package/_esm/clients/transports/ipc.js.map +1 -1
- package/_esm/clients/transports/webSocket.js +2 -1
- package/_esm/clients/transports/webSocket.js.map +1 -1
- package/_esm/errors/rpc.js +1 -1
- package/_esm/errors/rpc.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/utils/buildRequest.js +10 -1
- package/_esm/utils/buildRequest.js.map +1 -1
- package/_esm/zksync/actions/withdraw.js +120 -0
- package/_esm/zksync/actions/withdraw.js.map +1 -0
- package/_esm/zksync/constants/abis.js +245 -0
- package/_esm/zksync/constants/abis.js.map +1 -1
- package/_esm/zksync/constants/address.js +2 -0
- package/_esm/zksync/constants/address.js.map +1 -1
- package/_esm/zksync/decorators/walletL2.js +7 -0
- package/_esm/zksync/decorators/walletL2.js.map +1 -0
- package/_esm/zksync/index.js +3 -0
- package/_esm/zksync/index.js.map +1 -1
- package/_types/chains/definitions/alephZeroTestnet.d.ts +35 -0
- package/_types/chains/definitions/alephZeroTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/goat.d.ts +33 -0
- package/_types/chains/definitions/goat.d.ts.map +1 -0
- package/_types/chains/index.d.ts +2 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/transports/createTransport.d.ts +8 -1
- package/_types/clients/transports/createTransport.d.ts.map +1 -1
- package/_types/clients/transports/custom.d.ts +2 -0
- package/_types/clients/transports/custom.d.ts.map +1 -1
- package/_types/clients/transports/http.d.ts +2 -0
- package/_types/clients/transports/http.d.ts.map +1 -1
- package/_types/clients/transports/ipc.d.ts +2 -0
- package/_types/clients/transports/ipc.d.ts.map +1 -1
- package/_types/clients/transports/webSocket.d.ts +2 -0
- package/_types/clients/transports/webSocket.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +9 -0
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/utils/buildRequest.d.ts.map +1 -1
- package/_types/zksync/actions/withdraw.d.ts +94 -0
- package/_types/zksync/actions/withdraw.d.ts.map +1 -0
- package/_types/zksync/constants/abis.d.ts +191 -0
- package/_types/zksync/constants/abis.d.ts.map +1 -1
- package/_types/zksync/constants/address.d.ts +2 -0
- package/_types/zksync/constants/address.d.ts.map +1 -1
- package/_types/zksync/decorators/walletL2.d.ts +75 -0
- package/_types/zksync/decorators/walletL2.d.ts.map +1 -0
- package/_types/zksync/index.d.ts +3 -0
- package/_types/zksync/index.d.ts.map +1 -1
- package/chains/definitions/alephZeroTestnet.ts +27 -0
- package/chains/definitions/goat.ts +26 -0
- package/chains/index.ts +2 -0
- package/clients/transports/createTransport.ts +14 -1
- package/clients/transports/custom.ts +9 -1
- package/clients/transports/http.ts +4 -0
- package/clients/transports/ipc.ts +10 -1
- package/clients/transports/webSocket.ts +4 -0
- package/errors/rpc.ts +1 -1
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/types/eip1193.ts +14 -3
- package/utils/buildRequest.ts +12 -0
- package/zksync/actions/withdraw.ts +185 -0
- package/zksync/constants/abis.ts +246 -0
- package/zksync/constants/address.ts +2 -0
- package/zksync/decorators/walletL2.ts +95 -0
- package/zksync/index.ts +16 -0
@@ -221,6 +221,197 @@ export declare const l2SharedBridgeAbi: readonly [{
|
|
221
221
|
readonly stateMutability: "nonpayable";
|
222
222
|
readonly type: "function";
|
223
223
|
}];
|
224
|
+
export declare const ethTokenAbi: readonly [{
|
225
|
+
readonly anonymous: false;
|
226
|
+
readonly inputs: readonly [{
|
227
|
+
readonly indexed: true;
|
228
|
+
readonly internalType: "address";
|
229
|
+
readonly name: "account";
|
230
|
+
readonly type: "address";
|
231
|
+
}, {
|
232
|
+
readonly indexed: false;
|
233
|
+
readonly internalType: "uint256";
|
234
|
+
readonly name: "amount";
|
235
|
+
readonly type: "uint256";
|
236
|
+
}];
|
237
|
+
readonly name: "Mint";
|
238
|
+
readonly type: "event";
|
239
|
+
}, {
|
240
|
+
readonly anonymous: false;
|
241
|
+
readonly inputs: readonly [{
|
242
|
+
readonly indexed: true;
|
243
|
+
readonly internalType: "address";
|
244
|
+
readonly name: "from";
|
245
|
+
readonly type: "address";
|
246
|
+
}, {
|
247
|
+
readonly indexed: true;
|
248
|
+
readonly internalType: "address";
|
249
|
+
readonly name: "to";
|
250
|
+
readonly type: "address";
|
251
|
+
}, {
|
252
|
+
readonly indexed: false;
|
253
|
+
readonly internalType: "uint256";
|
254
|
+
readonly name: "value";
|
255
|
+
readonly type: "uint256";
|
256
|
+
}];
|
257
|
+
readonly name: "Transfer";
|
258
|
+
readonly type: "event";
|
259
|
+
}, {
|
260
|
+
readonly anonymous: false;
|
261
|
+
readonly inputs: readonly [{
|
262
|
+
readonly indexed: true;
|
263
|
+
readonly internalType: "address";
|
264
|
+
readonly name: "_l2Sender";
|
265
|
+
readonly type: "address";
|
266
|
+
}, {
|
267
|
+
readonly indexed: true;
|
268
|
+
readonly internalType: "address";
|
269
|
+
readonly name: "_l1Receiver";
|
270
|
+
readonly type: "address";
|
271
|
+
}, {
|
272
|
+
readonly indexed: false;
|
273
|
+
readonly internalType: "uint256";
|
274
|
+
readonly name: "_amount";
|
275
|
+
readonly type: "uint256";
|
276
|
+
}];
|
277
|
+
readonly name: "Withdrawal";
|
278
|
+
readonly type: "event";
|
279
|
+
}, {
|
280
|
+
readonly anonymous: false;
|
281
|
+
readonly inputs: readonly [{
|
282
|
+
readonly indexed: true;
|
283
|
+
readonly internalType: "address";
|
284
|
+
readonly name: "_l2Sender";
|
285
|
+
readonly type: "address";
|
286
|
+
}, {
|
287
|
+
readonly indexed: true;
|
288
|
+
readonly internalType: "address";
|
289
|
+
readonly name: "_l1Receiver";
|
290
|
+
readonly type: "address";
|
291
|
+
}, {
|
292
|
+
readonly indexed: false;
|
293
|
+
readonly internalType: "uint256";
|
294
|
+
readonly name: "_amount";
|
295
|
+
readonly type: "uint256";
|
296
|
+
}, {
|
297
|
+
readonly indexed: false;
|
298
|
+
readonly internalType: "bytes";
|
299
|
+
readonly name: "_additionalData";
|
300
|
+
readonly type: "bytes";
|
301
|
+
}];
|
302
|
+
readonly name: "WithdrawalWithMessage";
|
303
|
+
readonly type: "event";
|
304
|
+
}, {
|
305
|
+
readonly inputs: readonly [{
|
306
|
+
readonly internalType: "uint256";
|
307
|
+
readonly name: "";
|
308
|
+
readonly type: "uint256";
|
309
|
+
}];
|
310
|
+
readonly name: "balanceOf";
|
311
|
+
readonly outputs: readonly [{
|
312
|
+
readonly internalType: "uint256";
|
313
|
+
readonly name: "";
|
314
|
+
readonly type: "uint256";
|
315
|
+
}];
|
316
|
+
readonly stateMutability: "view";
|
317
|
+
readonly type: "function";
|
318
|
+
}, {
|
319
|
+
readonly inputs: readonly [];
|
320
|
+
readonly name: "decimals";
|
321
|
+
readonly outputs: readonly [{
|
322
|
+
readonly internalType: "uint8";
|
323
|
+
readonly name: "";
|
324
|
+
readonly type: "uint8";
|
325
|
+
}];
|
326
|
+
readonly stateMutability: "pure";
|
327
|
+
readonly type: "function";
|
328
|
+
}, {
|
329
|
+
readonly inputs: readonly [{
|
330
|
+
readonly internalType: "address";
|
331
|
+
readonly name: "_account";
|
332
|
+
readonly type: "address";
|
333
|
+
}, {
|
334
|
+
readonly internalType: "uint256";
|
335
|
+
readonly name: "_amount";
|
336
|
+
readonly type: "uint256";
|
337
|
+
}];
|
338
|
+
readonly name: "mint";
|
339
|
+
readonly outputs: readonly [];
|
340
|
+
readonly stateMutability: "nonpayable";
|
341
|
+
readonly type: "function";
|
342
|
+
}, {
|
343
|
+
readonly inputs: readonly [];
|
344
|
+
readonly name: "name";
|
345
|
+
readonly outputs: readonly [{
|
346
|
+
readonly internalType: "string";
|
347
|
+
readonly name: "";
|
348
|
+
readonly type: "string";
|
349
|
+
}];
|
350
|
+
readonly stateMutability: "pure";
|
351
|
+
readonly type: "function";
|
352
|
+
}, {
|
353
|
+
readonly inputs: readonly [];
|
354
|
+
readonly name: "symbol";
|
355
|
+
readonly outputs: readonly [{
|
356
|
+
readonly internalType: "string";
|
357
|
+
readonly name: "";
|
358
|
+
readonly type: "string";
|
359
|
+
}];
|
360
|
+
readonly stateMutability: "pure";
|
361
|
+
readonly type: "function";
|
362
|
+
}, {
|
363
|
+
readonly inputs: readonly [];
|
364
|
+
readonly name: "totalSupply";
|
365
|
+
readonly outputs: readonly [{
|
366
|
+
readonly internalType: "uint256";
|
367
|
+
readonly name: "";
|
368
|
+
readonly type: "uint256";
|
369
|
+
}];
|
370
|
+
readonly stateMutability: "view";
|
371
|
+
readonly type: "function";
|
372
|
+
}, {
|
373
|
+
readonly inputs: readonly [{
|
374
|
+
readonly internalType: "address";
|
375
|
+
readonly name: "_from";
|
376
|
+
readonly type: "address";
|
377
|
+
}, {
|
378
|
+
readonly internalType: "address";
|
379
|
+
readonly name: "_to";
|
380
|
+
readonly type: "address";
|
381
|
+
}, {
|
382
|
+
readonly internalType: "uint256";
|
383
|
+
readonly name: "_amount";
|
384
|
+
readonly type: "uint256";
|
385
|
+
}];
|
386
|
+
readonly name: "transferFromTo";
|
387
|
+
readonly outputs: readonly [];
|
388
|
+
readonly stateMutability: "nonpayable";
|
389
|
+
readonly type: "function";
|
390
|
+
}, {
|
391
|
+
readonly inputs: readonly [{
|
392
|
+
readonly internalType: "address";
|
393
|
+
readonly name: "_l1Receiver";
|
394
|
+
readonly type: "address";
|
395
|
+
}];
|
396
|
+
readonly name: "withdraw";
|
397
|
+
readonly outputs: readonly [];
|
398
|
+
readonly stateMutability: "payable";
|
399
|
+
readonly type: "function";
|
400
|
+
}, {
|
401
|
+
readonly inputs: readonly [{
|
402
|
+
readonly internalType: "address";
|
403
|
+
readonly name: "_l1Receiver";
|
404
|
+
readonly type: "address";
|
405
|
+
}, {
|
406
|
+
readonly internalType: "bytes";
|
407
|
+
readonly name: "_additionalData";
|
408
|
+
readonly type: "bytes";
|
409
|
+
}];
|
410
|
+
readonly name: "withdrawWithMessage";
|
411
|
+
readonly outputs: readonly [];
|
412
|
+
readonly stateMutability: "payable";
|
413
|
+
readonly type: "function";
|
414
|
+
}];
|
224
415
|
export declare const bridgehubAbi: readonly [{
|
225
416
|
readonly anonymous: false;
|
226
417
|
readonly inputs: readonly [{
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"abis.d.ts","sourceRoot":"","sources":["../../../zksync/constants/abis.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsa/B,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;GAqCxB,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuLpB,CAAA;AAEV,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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declare const contractDeployerAddress: "0x0000000000000000000000000000000000008006";
|
2
2
|
export declare const contract2FactoryAddress: "0x0000000000000000000000000000000000010000";
|
3
|
+
/** The address of the L1 `ETH` token. */
|
3
4
|
export declare const legacyEthAddress: "0x0000000000000000000000000000000000000000";
|
4
5
|
export declare const ethAddressInContracts: "0x0000000000000000000000000000000000000001";
|
6
|
+
/** The address of the base token. */
|
5
7
|
export declare const l2BaseTokenAddress: "0x000000000000000000000000000000000000800a";
|
6
8
|
//# sourceMappingURL=address.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../zksync/constants/address.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,8CACmB,CAAA;AAEvD,eAAO,MAAM,uBAAuB,8CACmB,CAAA;AAEvD,eAAO,MAAM,gBAAgB,8CAC0B,CAAA;AAEvD,eAAO,MAAM,qBAAqB,8CACqB,CAAA;AAEvD,eAAO,MAAM,kBAAkB,8CACwB,CAAA"}
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../zksync/constants/address.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,8CACmB,CAAA;AAEvD,eAAO,MAAM,uBAAuB,8CACmB,CAAA;AAEvD,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,8CAC0B,CAAA;AAEvD,eAAO,MAAM,qBAAqB,8CACqB,CAAA;AAEvD,qCAAqC;AACrC,eAAO,MAAM,kBAAkB,8CACwB,CAAA"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import type { Client } from '../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
+
import type { Account } from '../../types/account.js';
|
4
|
+
import { type WithdrawParameters, type WithdrawReturnType } from '../actions/withdraw.js';
|
5
|
+
import type { ChainEIP712 } from '../types/chain.js';
|
6
|
+
export type WalletActionsL2<chain extends ChainEIP712 | undefined = ChainEIP712 | undefined, account extends Account | undefined = Account | undefined> = {
|
7
|
+
/**
|
8
|
+
* Initiates the withdrawal process which withdraws ETH or any ERC20 token
|
9
|
+
* from the associated account on L2 network to the target account on L1 network.
|
10
|
+
*
|
11
|
+
* @param args - {@link WithdrawParameters}
|
12
|
+
* @returns hash - The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. {@link WithdrawReturnType}
|
13
|
+
*
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* import { createPublicClient, http } from 'viem'
|
17
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
18
|
+
* import { zksync } from 'viem/chains'
|
19
|
+
* import { publicActionsL2, legacyEthAddress } from 'viem/zksync'
|
20
|
+
*
|
21
|
+
* const client = createPublicClient({
|
22
|
+
* chain: zksync,
|
23
|
+
* transport: http(),
|
24
|
+
* }).extend(publicActionsL2())
|
25
|
+
*
|
26
|
+
* const hash = await client.withdraw({
|
27
|
+
* account: privateKeyToAccount('0x…'),
|
28
|
+
* amount: 1_000_000_000_000_000_000n,
|
29
|
+
* token: legacyEthAddress,
|
30
|
+
* })
|
31
|
+
*
|
32
|
+
* @example Account Hoisting
|
33
|
+
* import { createWalletClient, http } from 'viem'
|
34
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
35
|
+
* import { zksync } from 'viem/chains'
|
36
|
+
* import { publicActionsL2, legacyEthAddress } from 'viem/zksync'
|
37
|
+
*
|
38
|
+
* const client = createWalletClient({
|
39
|
+
* account: privateKeyToAccount('0x…'),
|
40
|
+
* chain: zksync,
|
41
|
+
* transport: http(),
|
42
|
+
* }).extend(publicActionsL2())
|
43
|
+
*
|
44
|
+
* const hash = await client.withdraw({
|
45
|
+
* amount: 1_000_000_000_000_000_000n,
|
46
|
+
* token: legacyEthAddress,
|
47
|
+
* })
|
48
|
+
*
|
49
|
+
* @example Paymaster
|
50
|
+
* import { createPublicClient, http } from 'viem'
|
51
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
52
|
+
* import { zksync } from 'viem/chains'
|
53
|
+
* import { publicActionsL2, legacyEthAddress } from 'viem/zksync'
|
54
|
+
*
|
55
|
+
* const client = createPublicClient({
|
56
|
+
* chain: zksync,
|
57
|
+
* transport: http(),
|
58
|
+
* }).extend(publicActionsL2())
|
59
|
+
*
|
60
|
+
* const hash = await client.withdraw({
|
61
|
+
* account: privateKeyToAccount('0x…'),
|
62
|
+
* amount: 1_000_000_000_000_000_000n,
|
63
|
+
* token: legacyEthAddress,
|
64
|
+
* paymaster: '0x0EEc6f45108B4b806e27B81d9002e162BD910670',
|
65
|
+
* paymasterInput: getApprovalBasedPaymasterInput({
|
66
|
+
* minAllowance: 1n,
|
67
|
+
* token: '0x2dc3685cA34163952CF4A5395b0039c00DFa851D',
|
68
|
+
* innerInput: new Uint8Array(),
|
69
|
+
* }),
|
70
|
+
* })
|
71
|
+
*/
|
72
|
+
withdraw: <chainOverride extends ChainEIP712 | undefined = undefined>(args: WithdrawParameters<chain, account, chainOverride>) => Promise<WithdrawReturnType>;
|
73
|
+
};
|
74
|
+
export declare function walletActionsL2(): <transport extends Transport, chain extends ChainEIP712 | undefined = ChainEIP712 | undefined, account extends Account | undefined = Account | undefined>(client: Client<transport, chain, account>) => WalletActionsL2<chain, account>;
|
75
|
+
//# sourceMappingURL=walletL2.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"walletL2.d.ts","sourceRoot":"","sources":["../../../zksync/decorators/walletL2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEpD,MAAM,MAAM,eAAe,CACzB,KAAK,SAAS,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,EAC/D,OAAO,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACvD;IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgEG;IACH,QAAQ,EAAE,CAAC,aAAa,SAAS,WAAW,GAAG,SAAS,GAAG,SAAS,EAClE,IAAI,EAAE,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,KACpD,OAAO,CAAC,kBAAkB,CAAC,CAAA;CACjC,CAAA;AAED,wBAAgB,eAAe,KAE3B,SAAS,SAAS,SAAS,EAC3B,KAAK,SAAS,WAAW,GAAG,SAAS,4BACrC,OAAO,SAAS,OAAO,GAAG,SAAS,gCAE3B,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,KACxC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAGnC"}
|
package/_types/zksync/index.d.ts
CHANGED
@@ -28,6 +28,8 @@ export { type SignEip712TransactionErrorType, type SignEip712TransactionParamete
|
|
28
28
|
export { type SignTransactionErrorType, type SignTransactionParameters, type SignTransactionReturnType, signTransaction, } from './actions/signTransaction.js';
|
29
29
|
export { type GetL2TokenAddressReturnType, type GetL2TokenAddressParameters, getL2TokenAddress, } from './actions/getL2TokenAddress.js';
|
30
30
|
export { type GetL1TokenAddressReturnType, type GetL1TokenAddressParameters, getL1TokenAddress, } from './actions/getL1TokenAddress.js';
|
31
|
+
export { type WithdrawErrorType, type WithdrawParameters, type WithdrawReturnType, withdraw, } from './actions/withdraw.js';
|
32
|
+
export { legacyEthAddress, l2BaseTokenAddress, } from './constants/address.js';
|
31
33
|
export {
|
32
34
|
/** @deprecated Use `zksync` instead */
|
33
35
|
zksync as zkSync, zksync,
|
@@ -42,6 +44,7 @@ export { eip712WalletActions, type Eip712WalletActions, } from './decorators/eip
|
|
42
44
|
export { publicActionsL1, type PublicActionsL1, } from './decorators/publicL1.js';
|
43
45
|
export { publicActionsL2, type PublicActionsL2, } from './decorators/publicL2.js';
|
44
46
|
export { walletActionsL1, type WalletActionsL1, } from './decorators/walletL1.js';
|
47
|
+
export { walletActionsL2, type WalletActionsL2, } from './decorators/walletL2.js';
|
45
48
|
export { serializeTransaction } from './serializers.js';
|
46
49
|
export type { ZksyncSmartAccount } from './types/account.js';
|
47
50
|
export type {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../zksync/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,cAAc,GACf,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,KAAK,gCAAgC,EACrC,sBAAsB,GACvB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,KAAK,iCAAiC,EACtC,uBAAuB,GACxB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,cAAc,GACf,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,gBAAgB,GACjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACL,KAAK,qBAAqB,EAC1B,YAAY,GACb,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,WAAW,GACZ,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,cAAc,GACf,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,eAAe,GAChB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,KAAK,mCAAmC,EACxC,yBAAyB,GAC1B,MAAM,wCAAwC,CAA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C5D,2BAA2B,IAAI,2BAA2B,EAC1D,2BAA2B;AAC3B,kEAAkE;AAClE,iCAAiC,IAAI,iCAAiC,EACtE,iCAAiC;AACjC,sDAAsD;AACtD,qBAAqB,IAAI,qBAAqB,EAC9C,qBAAqB;AACrB,2DAA2D;AAC3D,0BAA0B,IAAI,0BAA0B,EACxD,0BAA0B;AAC1B,4DAA4D;AAC5D,2BAA2B,IAAI,2BAA2B,EAC1D,2BAA2B;AAC3B,yDAAyD;AACzD,wBAAwB,IAAI,wBAAwB,EACpD,wBAAwB,GACzB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,KAAK,gCAAgC,EACrC,uBAAuB,GACxB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EACL,KAAK,wCAAwC,EAC7C,KAAK,wCAAwC,EAC7C,8BAA8B,GAC/B,MAAM,qDAAqD,CAAA;AAC5D,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,kCAAkC,EACvC,wBAAwB,GACzB,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const alephZeroTestnet = /*#__PURE__*/ defineChain({
|
4
|
+
id: 2039,
|
5
|
+
name: 'Aleph Zero Testnet',
|
6
|
+
nativeCurrency: { name: 'TZERO', symbol: 'TZERO', decimals: 18 },
|
7
|
+
rpcUrls: {
|
8
|
+
default: {
|
9
|
+
http: ['https://rpc.alephzero-testnet.gelato.digital'],
|
10
|
+
webSocket: ['wss://ws.alephzero-testnet.gelato.digital'],
|
11
|
+
},
|
12
|
+
},
|
13
|
+
blockExplorers: {
|
14
|
+
default: {
|
15
|
+
name: 'Aleph Zero EVM Testnet explorer',
|
16
|
+
url: 'https://evm-explorer-testnet.alephzero.org',
|
17
|
+
apiUrl: 'https://evm-explorer-testnet.alephzero.org/api',
|
18
|
+
},
|
19
|
+
},
|
20
|
+
contracts: {
|
21
|
+
multicall3: {
|
22
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
23
|
+
blockCreated: 2861745,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
testnet: true,
|
27
|
+
})
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const goat = /*#__PURE__*/ defineChain({
|
4
|
+
id: 2345,
|
5
|
+
name: 'GOAT',
|
6
|
+
nativeCurrency: {
|
7
|
+
decimals: 18,
|
8
|
+
name: 'Bitcoin',
|
9
|
+
symbol: 'BTC',
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
default: { http: ['https://rpc.goat.network'] },
|
13
|
+
},
|
14
|
+
blockExplorers: {
|
15
|
+
default: {
|
16
|
+
name: 'Goat Explorer',
|
17
|
+
url: 'https://explorer.goat.network',
|
18
|
+
},
|
19
|
+
},
|
20
|
+
contracts: {
|
21
|
+
multicall3: {
|
22
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
23
|
+
blockCreated: 0,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
})
|
package/chains/index.ts
CHANGED
@@ -8,6 +8,7 @@ export { acria } from './definitions/acria.js'
|
|
8
8
|
export { adf } from './definitions/adf.js'
|
9
9
|
export { aioz } from './definitions/aioz.js'
|
10
10
|
export { alephZero } from './definitions/alephZero.js'
|
11
|
+
export { alephZeroTestnet } from './definitions/alephZeroTestnet.js'
|
11
12
|
export { alienx } from './definitions/alienX.js'
|
12
13
|
export { alienxHalTestnet } from './definitions/alienXHalTestnet.js'
|
13
14
|
export { ancient8 } from './definitions/ancient8.js'
|
@@ -183,6 +184,7 @@ export { glideL1Protocol } from './definitions/glideL1Protocol.js'
|
|
183
184
|
export { glideL2Protocol } from './definitions/glideL2Protocol.js'
|
184
185
|
export { gnosis } from './definitions/gnosis.js'
|
185
186
|
export { gnosisChiado } from './definitions/gnosisChiado.js'
|
187
|
+
export { goat } from './definitions/goat.js'
|
186
188
|
export { gobi } from './definitions/gobi.js'
|
187
189
|
export { goChain } from './definitions/goChain.js'
|
188
190
|
export { godwoken } from './definitions/godwoken.js'
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ErrorType } from '../../errors/utils.js'
|
2
2
|
import type { Chain } from '../../types/chain.js'
|
3
3
|
import type { EIP1193RequestFn } from '../../types/eip1193.js'
|
4
|
+
import type { OneOf } from '../../types/utils.js'
|
4
5
|
import { buildRequest } from '../../utils/buildRequest.js'
|
5
6
|
import { uid as uid_ } from '../../utils/uid.js'
|
6
7
|
import type { ClientConfig } from '../createClient.js'
|
@@ -13,6 +14,17 @@ export type TransportConfig<
|
|
13
14
|
name: string
|
14
15
|
/** The key of the transport. */
|
15
16
|
key: string
|
17
|
+
/** Methods to include or exclude from executing RPC requests. */
|
18
|
+
methods?:
|
19
|
+
| OneOf<
|
20
|
+
| {
|
21
|
+
include?: string[] | undefined
|
22
|
+
}
|
23
|
+
| {
|
24
|
+
exclude?: string[] | undefined
|
25
|
+
}
|
26
|
+
>
|
27
|
+
| undefined
|
16
28
|
/** The JSON-RPC request function that matches the EIP-1193 request spec. */
|
17
29
|
request: eip1193RequestFn
|
18
30
|
/** The base delay (in ms) between retries. */
|
@@ -53,6 +65,7 @@ export function createTransport<
|
|
53
65
|
>(
|
54
66
|
{
|
55
67
|
key,
|
68
|
+
methods,
|
56
69
|
name,
|
57
70
|
request,
|
58
71
|
retryCount = 3,
|
@@ -73,7 +86,7 @@ export function createTransport<
|
|
73
86
|
timeout,
|
74
87
|
type,
|
75
88
|
},
|
76
|
-
request: buildRequest(request, { retryCount, retryDelay, uid }),
|
89
|
+
request: buildRequest(request, { methods, retryCount, retryDelay, uid }),
|
77
90
|
value,
|
78
91
|
}
|
79
92
|
}
|
@@ -11,6 +11,8 @@ type EthereumProvider = { request(...args: any): Promise<any> }
|
|
11
11
|
export type CustomTransportConfig = {
|
12
12
|
/** The key of the transport. */
|
13
13
|
key?: TransportConfig['key'] | undefined
|
14
|
+
/** Methods to include or exclude from executing RPC requests. */
|
15
|
+
methods?: TransportConfig['methods'] | undefined
|
14
16
|
/** The name of the transport. */
|
15
17
|
name?: TransportConfig['name'] | undefined
|
16
18
|
/** The max number of times to retry. */
|
@@ -34,10 +36,16 @@ export function custom<provider extends EthereumProvider>(
|
|
34
36
|
provider: provider,
|
35
37
|
config: CustomTransportConfig = {},
|
36
38
|
): CustomTransport {
|
37
|
-
const {
|
39
|
+
const {
|
40
|
+
key = 'custom',
|
41
|
+
methods,
|
42
|
+
name = 'Custom Provider',
|
43
|
+
retryDelay,
|
44
|
+
} = config
|
38
45
|
return ({ retryCount: defaultRetryCount }) =>
|
39
46
|
createTransport({
|
40
47
|
key,
|
48
|
+
methods,
|
41
49
|
name,
|
42
50
|
request: provider.request.bind(provider),
|
43
51
|
retryCount: config.retryCount ?? defaultRetryCount,
|
@@ -43,6 +43,8 @@ export type HttpTransportConfig = {
|
|
43
43
|
onFetchResponse?: HttpRpcClientOptions['onResponse'] | undefined
|
44
44
|
/** The key of the HTTP transport. */
|
45
45
|
key?: TransportConfig['key'] | undefined
|
46
|
+
/** Methods to include or exclude from executing RPC requests. */
|
47
|
+
methods?: TransportConfig['methods'] | undefined
|
46
48
|
/** The name of the HTTP transport. */
|
47
49
|
name?: TransportConfig['name'] | undefined
|
48
50
|
/** The max number of times to retry. */
|
@@ -78,6 +80,7 @@ export function http(
|
|
78
80
|
batch,
|
79
81
|
fetchOptions,
|
80
82
|
key = 'http',
|
83
|
+
methods,
|
81
84
|
name = 'HTTP JSON-RPC',
|
82
85
|
onFetchRequest,
|
83
86
|
onFetchResponse,
|
@@ -101,6 +104,7 @@ export function http(
|
|
101
104
|
return createTransport(
|
102
105
|
{
|
103
106
|
key,
|
107
|
+
methods,
|
104
108
|
name,
|
105
109
|
async request({ method, params }) {
|
106
110
|
const body = { method, params }
|
@@ -40,6 +40,8 @@ type IpcTransportSubscribe = {
|
|
40
40
|
export type IpcTransportConfig = {
|
41
41
|
/** The key of the Ipc transport. */
|
42
42
|
key?: TransportConfig['key'] | undefined
|
43
|
+
/** Methods to include or exclude from executing RPC requests. */
|
44
|
+
methods?: TransportConfig['methods'] | undefined
|
43
45
|
/** The name of the Ipc transport. */
|
44
46
|
name?: TransportConfig['name'] | undefined
|
45
47
|
/**
|
@@ -75,13 +77,20 @@ export function ipc(
|
|
75
77
|
path: string,
|
76
78
|
config: IpcTransportConfig = {},
|
77
79
|
): IpcTransport {
|
78
|
-
const {
|
80
|
+
const {
|
81
|
+
key = 'ipc',
|
82
|
+
methods,
|
83
|
+
name = 'IPC JSON-RPC',
|
84
|
+
reconnect,
|
85
|
+
retryDelay,
|
86
|
+
} = config
|
79
87
|
return ({ retryCount: retryCount_, timeout: timeout_ }) => {
|
80
88
|
const retryCount = config.retryCount ?? retryCount_
|
81
89
|
const timeout = timeout_ ?? config.timeout ?? 10_000
|
82
90
|
return createTransport(
|
83
91
|
{
|
84
92
|
key,
|
93
|
+
methods,
|
85
94
|
name,
|
86
95
|
async request({ method, params }) {
|
87
96
|
const body = { method, params }
|
@@ -49,6 +49,8 @@ export type WebSocketTransportConfig = {
|
|
49
49
|
keepAlive?: GetWebSocketRpcClientOptions['keepAlive'] | undefined
|
50
50
|
/** The key of the WebSocket transport. */
|
51
51
|
key?: TransportConfig['key'] | undefined
|
52
|
+
/** Methods to include or exclude from executing RPC requests. */
|
53
|
+
methods?: TransportConfig['methods'] | undefined
|
52
54
|
/** The name of the WebSocket transport. */
|
53
55
|
name?: TransportConfig['name'] | undefined
|
54
56
|
/**
|
@@ -92,6 +94,7 @@ export function webSocket(
|
|
92
94
|
const {
|
93
95
|
keepAlive,
|
94
96
|
key = 'webSocket',
|
97
|
+
methods,
|
95
98
|
name = 'WebSocket JSON-RPC',
|
96
99
|
reconnect,
|
97
100
|
retryDelay,
|
@@ -104,6 +107,7 @@ export function webSocket(
|
|
104
107
|
return createTransport(
|
105
108
|
{
|
106
109
|
key,
|
110
|
+
methods,
|
107
111
|
name,
|
108
112
|
async request({ method, params }) {
|
109
113
|
const body = { method, params }
|
package/errors/rpc.ts
CHANGED
@@ -309,7 +309,7 @@ export class MethodNotSupportedRpcError extends RpcError {
|
|
309
309
|
super(cause, {
|
310
310
|
code: MethodNotSupportedRpcError.code,
|
311
311
|
name: 'MethodNotSupportedRpcError',
|
312
|
-
shortMessage: `Method${method ? ` "${method}"` : ''} is not
|
312
|
+
shortMessage: `Method${method ? ` "${method}"` : ''} is not supported.`,
|
313
313
|
})
|
314
314
|
}
|
315
315
|
}
|
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '2.22.
|
1
|
+
export const version = '2.22.10'
|
package/package.json
CHANGED
package/types/eip1193.ts
CHANGED
@@ -1922,11 +1922,22 @@ export type EIP1193Parameters<
|
|
1922
1922
|
}
|
1923
1923
|
|
1924
1924
|
export type EIP1193RequestOptions = {
|
1925
|
-
|
1925
|
+
/** Deduplicate in-flight requests. */
|
1926
1926
|
dedupe?: boolean | undefined
|
1927
|
-
|
1927
|
+
/** Methods to include or exclude from executing RPC requests. */
|
1928
|
+
methods?:
|
1929
|
+
| OneOf<
|
1930
|
+
| {
|
1931
|
+
include?: string[] | undefined
|
1932
|
+
}
|
1933
|
+
| {
|
1934
|
+
exclude?: string[] | undefined
|
1935
|
+
}
|
1936
|
+
>
|
1937
|
+
| undefined
|
1938
|
+
/** The base delay (in ms) between retries. */
|
1928
1939
|
retryDelay?: number | undefined
|
1929
|
-
|
1940
|
+
/** The max number of times to retry. */
|
1930
1941
|
retryCount?: number | undefined
|
1931
1942
|
/** Unique identifier for the request. */
|
1932
1943
|
uid?: string | undefined
|
package/utils/buildRequest.ts
CHANGED
@@ -100,6 +100,7 @@ export function buildRequest<request extends (args: any) => Promise<any>>(
|
|
100
100
|
return async (args, overrideOptions = {}) => {
|
101
101
|
const {
|
102
102
|
dedupe = false,
|
103
|
+
methods,
|
103
104
|
retryDelay = 150,
|
104
105
|
retryCount = 3,
|
105
106
|
uid,
|
@@ -107,6 +108,17 @@ export function buildRequest<request extends (args: any) => Promise<any>>(
|
|
107
108
|
...options,
|
108
109
|
...overrideOptions,
|
109
110
|
}
|
111
|
+
|
112
|
+
const { method } = args
|
113
|
+
if (methods?.exclude?.includes(method))
|
114
|
+
throw new MethodNotSupportedRpcError(new Error('method not supported'), {
|
115
|
+
method,
|
116
|
+
})
|
117
|
+
if (methods?.include && !methods.include.includes(method))
|
118
|
+
throw new MethodNotSupportedRpcError(new Error('method not supported'), {
|
119
|
+
method,
|
120
|
+
})
|
121
|
+
|
110
122
|
const requestId = dedupe
|
111
123
|
? keccak256(stringToHex(`${uid}.${stringify(args)}`))
|
112
124
|
: undefined
|