viem 0.0.1-alpha.3 → 0.0.1-alpha.31

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 (101) hide show
  1. package/chains/package.json +1 -1
  2. package/contract/package.json +4 -0
  3. package/dist/chain-00b37e4e.d.ts +543 -0
  4. package/dist/chain-38182d92.d.ts +5 -0
  5. package/dist/chains.d.ts +1305 -74
  6. package/dist/chains.js +125 -130
  7. package/dist/chains.js.map +1 -0
  8. package/dist/chains.mjs +129 -0
  9. package/dist/chains.mjs.map +1 -0
  10. package/dist/chunk-5STAX3WF.js +265 -0
  11. package/dist/chunk-5STAX3WF.js.map +1 -0
  12. package/dist/chunk-6ZFIUYGC.mjs +3436 -0
  13. package/dist/chunk-6ZFIUYGC.mjs.map +1 -0
  14. package/dist/chunk-APXHGB76.mjs +197 -0
  15. package/dist/chunk-APXHGB76.mjs.map +1 -0
  16. package/dist/chunk-C54QK7K3.mjs +210 -0
  17. package/dist/chunk-C54QK7K3.mjs.map +1 -0
  18. package/dist/{chunk-YZEQFYZ3.js → chunk-IBWRBL2I.mjs} +725 -556
  19. package/dist/chunk-IBWRBL2I.mjs.map +1 -0
  20. package/dist/chunk-J7QHQ26Y.js +3436 -0
  21. package/dist/chunk-J7QHQ26Y.js.map +1 -0
  22. package/dist/chunk-MYFKW55L.js +210 -0
  23. package/dist/chunk-MYFKW55L.js.map +1 -0
  24. package/dist/chunk-NCPBWOQA.js +1216 -0
  25. package/dist/chunk-NCPBWOQA.js.map +1 -0
  26. package/dist/chunk-QBB3DFIB.mjs +265 -0
  27. package/dist/chunk-QBB3DFIB.mjs.map +1 -0
  28. package/dist/chunk-UUULPQHV.js +197 -0
  29. package/dist/chunk-UUULPQHV.js.map +1 -0
  30. package/dist/contract.d.ts +11 -0
  31. package/dist/contract.js +57 -0
  32. package/dist/contract.js.map +1 -0
  33. package/dist/contract.mjs +57 -0
  34. package/dist/contract.mjs.map +1 -0
  35. package/dist/createClient-5258d590.d.ts +70 -0
  36. package/dist/createPublicClient-99be385b.d.ts +650 -0
  37. package/dist/{eip1193-8b4d90ce.d.ts → eip1193-fcdeee04.d.ts} +13 -10
  38. package/dist/ens.d.ts +22 -0
  39. package/dist/ens.js +22 -0
  40. package/dist/ens.js.map +1 -0
  41. package/dist/ens.mjs +22 -0
  42. package/dist/ens.mjs.map +1 -0
  43. package/dist/formatAbiItem-50cb39d8.d.ts +14 -0
  44. package/dist/getAbiItem-6d4f64d2.d.ts +97 -0
  45. package/dist/index.d.ts +251 -67
  46. package/dist/index.js +769 -344
  47. package/dist/index.js.map +1 -0
  48. package/dist/index.mjs +769 -0
  49. package/dist/index.mjs.map +1 -0
  50. package/dist/namehash-88f4639d.d.ts +22 -0
  51. package/dist/parseGwei-8af7a0a6.d.ts +509 -0
  52. package/dist/public.d.ts +29 -0
  53. package/dist/public.js +60 -0
  54. package/dist/public.js.map +1 -0
  55. package/dist/public.mjs +60 -0
  56. package/dist/public.mjs.map +1 -0
  57. package/dist/test-79ec416c.d.ts +213 -0
  58. package/dist/test.d.ts +20 -0
  59. package/dist/test.js +62 -0
  60. package/dist/test.js.map +1 -0
  61. package/dist/test.mjs +62 -0
  62. package/dist/test.mjs.map +1 -0
  63. package/dist/utils/index.d.ts +52 -7
  64. package/dist/utils/index.js +187 -126
  65. package/dist/utils/index.js.map +1 -0
  66. package/dist/utils/index.mjs +187 -0
  67. package/dist/utils/index.mjs.map +1 -0
  68. package/dist/wallet-cf5c8351.d.ts +115 -0
  69. package/dist/wallet.d.ts +7 -0
  70. package/dist/wallet.js +24 -0
  71. package/dist/wallet.js.map +1 -0
  72. package/dist/wallet.mjs +24 -0
  73. package/dist/wallet.mjs.map +1 -0
  74. package/dist/window.d.ts +5 -2
  75. package/dist/window.js +1 -0
  76. package/dist/window.js.map +1 -0
  77. package/dist/window.mjs +1 -0
  78. package/dist/window.mjs.map +1 -0
  79. package/ens/package.json +4 -0
  80. package/package.json +46 -73
  81. package/public/package.json +4 -0
  82. package/test/package.json +4 -0
  83. package/utils/package.json +1 -1
  84. package/wallet/package.json +4 -0
  85. package/window/package.json +1 -1
  86. package/actions/package.json +0 -4
  87. package/clients/package.json +0 -4
  88. package/dist/actions/index.d.ts +0 -7
  89. package/dist/actions/index.js +0 -124
  90. package/dist/chunk-SRDTRROA.js +0 -1214
  91. package/dist/chunk-TLEMV4T3.js +0 -258
  92. package/dist/chunk-WZITKXV3.js +0 -996
  93. package/dist/clients/index.d.ts +0 -7
  94. package/dist/clients/index.js +0 -23
  95. package/dist/createWalletClient-15ad1601.d.ts +0 -130
  96. package/dist/parseGwei-0f85e8ca.d.ts +0 -248
  97. package/dist/rpc-15b85963.d.ts +0 -292
  98. package/dist/rpc-26932bae.d.ts +0 -61
  99. package/dist/transactionRequest-f538ea86.d.ts +0 -44
  100. package/dist/watchAsset-0c9d01e2.d.ts +0 -522
  101. package/dist/webSocket-b55b0951.d.ts +0 -83
package/dist/index.d.ts CHANGED
@@ -1,37 +1,42 @@
1
- export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as GetFilterLogsArgs, q as GetFilterLogsResponse, r as GetGasPriceResponse, s as GetPermissionsResponse, t as GetTransactionArgs, u as GetTransactionConfirmationsArgs, v as GetTransactionConfirmationsResponse, w as GetTransactionCountArgs, x as GetTransactionCountResponse, z as GetTransactionReceiptArgs, A as GetTransactionReceiptResponse, y as GetTransactionResponse, I as ImpersonateAccountArgs, B as IncreaseTimeArgs, M as MineArgs, O as OnBlock, F as OnBlockNumber, H as OnBlockNumberResponse, J as OnBlockResponse, K as OnTransactions, L as OnTransactionsResponse, N as RequestPermissionsResponse, R as ResetArgs, P as RevertArgs, S as SendTransactionArgs, Q as SendTransactionResponse, T as SendUnsignedTransactionArgs, U as SendUnsignedTransactionResponse, V as SetBalanceArgs, W as SetBlockGasLimitArgs, $ as SetBlockTimestampIntervalArgs, X as SetCodeArgs, Y as SetCoinbaseArgs, Z as SetIntervalMiningArgs, _ as SetMinGasPriceArgs, a1 as SetNextBlockBaseFeePerGasArgs, a0 as SetNextBlockTimestampArgs, a2 as SetNonceArgs, a3 as SetStorageAtArgs, a4 as SignMessageArgs, a5 as SignMessageResponse, a6 as StopImpersonatingAccountArgs, a7 as SwitchChainArgs, a8 as UninstallFilterArgs, a9 as UninstallFilterResponse, aa as WaitForTransactionReceiptArgs, ab as WaitForTransactionReceiptResponse, ac as WatchAssetArgs, ad as WatchAssetResponse, ae as WatchBlockNumberArgs, af as WatchBlocksArgs, ag as WatchPendingTransactionsArgs, ah as addChain, ai as call, aj as createBlockFilter, ak as createPendingTransactionFilter, am as dropTransaction, al as estimateGas, an as getAccounts, ao as getAutomine, ap as getBalance, aq as getBlock, ar as getBlockNumber, as as getBlockTransactionCount, at as getChainId, au as getFeeHistory, av as getFilterChanges, aw as getFilterLogs, ax as getGasPrice, ay as getPermissions, az as getTransaction, aA as getTransactionConfirmations, aB as getTransactionCount, aC as getTransactionReceipt, aD as getTxpoolContent, aE as getTxpoolStatus, aF as impersonateAccount, aG as increaseTime, aH as inspectTxpool, aI as mine, aJ as removeBlockTimestampInterval, aL as requestAccounts, aM as requestPermissions, aK as reset, aN as revert, aO as sendTransaction, aP as sendUnsignedTransaction, aQ as setAutomine, aR as setBalance, aS as setBlockGasLimit, aT as setBlockTimestampInterval, aU as setCode, aV as setCoinbase, aW as setIntervalMining, aX as setLoggingEnabled, aY as setMinGasPrice, aZ as setNextBlockBaseFeePerGas, a_ as setNextBlockTimestamp, a$ as setNonce, b0 as setStorageAt, b1 as signMessage, b2 as snapshot, b3 as stopImpersonatingAccount, b4 as switchChain, b5 as uninstallFilter, b6 as waitForTransactionReceipt, b7 as watchAsset, b8 as watchBlockNumber, b9 as watchBlocks, ba as watchPendingTransactions } from './watchAsset-0c9d01e2.js';
2
- export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from './createWalletClient-15ad1601.js';
3
- export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-b55b0951.js';
4
- import { A as Address, H as Hash, B as ByteArray, a as Hex, b as BlockTag } from './rpc-15b85963.js';
5
- export { c as AccessList, A as Address, d as Block, f as BlockIdentifier, h as BlockNumber, b as BlockTag, B as ByteArray, F as FeeHistory, i as FeeValues, j as FeeValuesEIP1559, k as FeeValuesLegacy, H as Hash, a as Hex, L as Log, R as RpcBlock, l as RpcBlockIdentifier, m as RpcBlockNumber, n as RpcFeeHistory, o as RpcFeeValues, p as RpcLog, q as RpcTransaction, r as RpcTransactionReceipt, s as RpcTransactionRequest, u as RpcUncle, D as Transaction, E as TransactionBase, G as TransactionEIP1559, I as TransactionEIP2930, J as TransactionLegacy, T as TransactionReceipt, v as TransactionRequest, x as TransactionRequestBase, y as TransactionRequestEIP1559, z as TransactionRequestEIP2930, C as TransactionRequestLegacy, U as Uncle, e as etherUnits, g as gweiUnits, t as transactionType, w as weiUnits } from './rpc-15b85963.js';
6
- export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, e as boolToBytes, f as boolToHex, g as bytesToBigint, h as bytesToBool, c as bytesToHex, i as bytesToNumber, d as bytesToString, j as decodeAbi, k as decodeBytes, l as decodeFunctionData, m as decodeHex, n as decodeRlp, o as encodeAbi, p as encodeBytes, q as encodeFunctionData, r as encodeHex, s as encodeRlp, z as formatEther, S as formatGwei, T as formatUnit, t as getAddress, u as getContractAddress, w as getCreate2Address, v as getCreateAddress, x as getEventSignature, y as getFunctionSignature, F as hexToBigInt, H as hexToBool, I as hexToBytes, U as hexToNumber, J as hexToString, A as isAddress, B as isAddressEqual, C as isBytes, D as isHex, K as keccak256, L as numberToBytes, V as numberToHex, M as pad, N as padBytes, O as padHex, P as parseEther, Q as parseGwei, R as parseUnit, W as size, X as slice, Y as sliceBytes, Z as sliceHex, _ as stringToBytes, $ as stringToHex, a0 as trim } from './parseGwei-0f85e8ca.js';
7
- export { F as FormattedBlock, a as FormattedTransaction, b as FormattedTransactionRequest, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from './transactionRequest-f538ea86.js';
8
- import './chains.js';
9
- import '@wagmi/chains';
10
- import './eip1193-8b4d90ce.js';
11
- import './rpc-26932bae.js';
1
+ import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-5258d590.js';
2
+ export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-5258d590.js';
3
+ import { B as BaseError, H as HttpOptions, R as RpcResponse } from './parseGwei-8af7a0a6.js';
4
+ export { B as BaseError, C as CallExecutionError, a as ContractFunctionExecutionError, b as ContractFunctionRevertedError, c as ContractFunctionZeroDataError, E as EstimateGasExecutionError, d as ExecutionRevertedError, F as FeeCapTooHighError, e as FeeCapTooLowError, G as GetContractAddressOptions, o as GetCreate2AddressOptions, p as GetCreateAddressOptions, I as InsufficientFundsError, f as IntrinsicGasTooHighError, g as IntrinsicGasTooLowError, N as NonceMaxValueError, h as NonceTooHighError, i as NonceTooLowError, j as RawContractError, T as TipAboveFeeCapError, q as ToRlpResponse, k as TransactionExecutionError, m as TransactionNotFoundError, n as TransactionReceiptNotFoundError, l as TransactionTypeNotSupportedError, U as UnknownNodeError, W as WaitForTransactionReceiptTimeoutError, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, v as bytesToHex, w as bytesToNumber, x as bytesToString, y as etherUnits, z as formatEther, A as formatGwei, D as formatUnit, J as fromBytes, K as fromHex, L as fromRlp, M as getAddress, O as getContractAddress, P as getContractError, Q as getCreate2Address, S as getCreateAddress, V as getEventSelector, X as getFunctionSelector, Y as gweiUnits, Z as hexToBigInt, _ as hexToBool, $ as hexToBytes, a0 as hexToNumber, a1 as hexToString, a2 as isAddress, a3 as isAddressEqual, a4 as isBytes, a5 as isHex, a6 as keccak256, a7 as numberToBytes, a8 as numberToHex, a9 as pad, aa as padBytes, ab as padHex, ac as parseEther, ad as parseGwei, ae as parseUnit, af as size, ag as slice, ah as sliceBytes, ai as sliceHex, aj as stringToBytes, ak as stringToHex, al as stringify, am as toBytes, an as toHex, ao as toRlp, ap as trim, aq as weiUnits } from './parseGwei-8af7a0a6.js';
5
+ import WebSocket from 'isomorphic-ws';
6
+ import { H as Hex, a as Hash, C as Chain, B as ByteArray } from './chain-00b37e4e.js';
7
+ export { b as AbiItem, c as AccessList, A as Address, d as Block, e as BlockIdentifier, f as BlockNumber, g as BlockTag, B as ByteArray, C as Chain, h as ContractConfig, J as ExtractFormatter, F as FeeHistory, i as FeeValues, j as FeeValuesEIP1559, k as FeeValuesLegacy, K as Formatted, M as FormattedTransaction, a as Hash, H as Hex, L as Log, R as RpcBlock, l as RpcBlockIdentifier, m as RpcBlockNumber, n as RpcFeeHistory, o as RpcFeeValues, p as RpcLog, q as RpcTransaction, r as RpcTransactionReceipt, s as RpcTransactionRequest, t as RpcUncle, z as Transaction, D as TransactionBase, E as TransactionEIP1559, G as TransactionEIP2930, N as TransactionFormatter, I as TransactionLegacy, T as TransactionReceipt, u as TransactionRequest, v as TransactionRequestBase, w as TransactionRequestEIP1559, x as TransactionRequestEIP2930, y as TransactionRequestLegacy, U as Uncle, O as defineTransaction, P as formatTransaction, Q as transactionType } from './chain-00b37e4e.js';
8
+ export { B as BlockFormatter, F as FormattedBlock, b as FormattedTransactionReceipt, P as PublicClient, a as PublicClientConfig, T as TransactionReceiptFormatter, c as createPublicClient, d as defineBlock, e as defineTransactionReceipt, f as formatBlock } from './createPublicClient-99be385b.js';
9
+ export { T as TestClient, a as TestClientConfig, c as createTestClient } from './test-79ec416c.js';
10
+ export { F as FormattedTransactionRequest, T as TransactionRequestFormatter, W as WalletClient, a as WalletClientConfig, c as createWalletClient, d as defineTransactionRequest, f as formatTransactionRequest } from './wallet-cf5c8351.js';
11
+ export { l as labelhash, n as namehash } from './namehash-88f4639d.js';
12
+ export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeErrorResultResponse, c as DecodeEventLogArgs, d as DecodeEventLogResponse, e as DecodeFunctionDataArgs, f as DecodeFunctionResultArgs, g as DecodeFunctionResultResponse, E as EncodeAbiArgs, h as EncodeDeployDataArgs, i as EncodeErrorResultArgs, j as EncodeEventTopicsArgs, k as EncodeFunctionDataArgs, l as EncodeFunctionResultArgs, G as GetAbiItemArgs, m as decodeAbi, n as decodeErrorResult, o as decodeEventLog, p as decodeFunctionData, q as decodeFunctionResult, r as encodeAbi, s as encodeDeployData, t as encodeErrorResult, u as encodeEventTopics, v as encodeFunctionData, w as encodeFunctionResult, x as getAbiItem } from './getAbiItem-6d4f64d2.js';
13
+ export { d as defineChain } from './chain-38182d92.js';
14
+ import './eip1193-fcdeee04.js';
12
15
  import 'abitype';
16
+ import '@wagmi/chains';
17
+ import 'ethers@6/types/providers';
18
+ import 'abitype/dist/abi-78346466';
13
19
 
14
- type BaseErrorArgs = {
15
- docsPath?: string;
16
- } & ({
17
- cause?: never;
18
- details?: string;
19
- } | {
20
- cause: BaseError | Error;
21
- details?: never;
22
- });
23
- declare class BaseError extends Error {
24
- humanMessage: string;
25
- details: string;
26
- docsPath?: string;
27
- name: string;
28
- constructor(humanMessage: string, args?: BaseErrorArgs);
20
+ declare class AbiConstructorNotFoundError extends BaseError {
21
+ name: string;
22
+ constructor({ docsPath }: {
23
+ docsPath: string;
24
+ });
25
+ }
26
+ declare class AbiConstructorParamsNotFoundError extends BaseError {
27
+ name: string;
28
+ constructor({ docsPath }: {
29
+ docsPath: string;
30
+ });
29
31
  }
30
-
31
32
  declare class AbiDecodingDataSizeInvalidError extends BaseError {
32
33
  name: string;
33
34
  constructor(size: number);
34
35
  }
36
+ declare class AbiDecodingZeroDataError extends BaseError {
37
+ name: string;
38
+ constructor();
39
+ }
35
40
  declare class AbiEncodingArrayLengthMismatchError extends BaseError {
36
41
  name: string;
37
42
  constructor({ expectedLength, givenLength, type, }: {
@@ -47,17 +52,65 @@ declare class AbiEncodingLengthMismatchError extends BaseError {
47
52
  givenLength: number;
48
53
  });
49
54
  }
55
+ declare class AbiErrorInputsNotFoundError extends BaseError {
56
+ name: string;
57
+ constructor(errorName: string, { docsPath }: {
58
+ docsPath: string;
59
+ });
60
+ }
61
+ declare class AbiErrorNotFoundError extends BaseError {
62
+ name: string;
63
+ constructor(errorName: string, { docsPath }: {
64
+ docsPath: string;
65
+ });
66
+ }
67
+ declare class AbiErrorSignatureNotFoundError extends BaseError {
68
+ name: string;
69
+ constructor(signature: Hex, { docsPath }: {
70
+ docsPath: string;
71
+ });
72
+ }
73
+ declare class AbiEventSignatureNotFoundError extends BaseError {
74
+ name: string;
75
+ constructor(signature: Hex, { docsPath }: {
76
+ docsPath: string;
77
+ });
78
+ }
79
+ declare class AbiEventNotFoundError extends BaseError {
80
+ name: string;
81
+ constructor(eventName: string, { docsPath }: {
82
+ docsPath: string;
83
+ });
84
+ }
50
85
  declare class AbiFunctionNotFoundError extends BaseError {
51
86
  name: string;
52
- constructor(functionName: string);
87
+ constructor(functionName: string, { docsPath }: {
88
+ docsPath: string;
89
+ });
90
+ }
91
+ declare class AbiFunctionOutputsNotFoundError extends BaseError {
92
+ name: string;
93
+ constructor(functionName: string, { docsPath }: {
94
+ docsPath: string;
95
+ });
96
+ }
97
+ declare class AbiFunctionSignatureNotFoundError extends BaseError {
98
+ name: string;
99
+ constructor(signature: Hex, { docsPath }: {
100
+ docsPath: string;
101
+ });
53
102
  }
54
103
  declare class InvalidAbiEncodingTypeError extends BaseError {
55
104
  name: string;
56
- constructor(type: string);
105
+ constructor(type: string, { docsPath }: {
106
+ docsPath: string;
107
+ });
57
108
  }
58
109
  declare class InvalidAbiDecodingTypeError extends BaseError {
59
110
  name: string;
60
- constructor(type: string);
111
+ constructor(type: string, { docsPath }: {
112
+ docsPath: string;
113
+ });
61
114
  }
62
115
  declare class InvalidArrayError extends BaseError {
63
116
  name: string;
@@ -71,7 +124,7 @@ declare class InvalidDefinitionTypeError extends BaseError {
71
124
  declare class InvalidAddressError extends BaseError {
72
125
  name: string;
73
126
  constructor({ address }: {
74
- address: Address;
127
+ address: string;
75
128
  });
76
129
  }
77
130
 
@@ -83,6 +136,18 @@ declare class BlockNotFoundError extends BaseError {
83
136
  });
84
137
  }
85
138
 
139
+ declare class ChainDoesNotSupportContract extends BaseError {
140
+ name: string;
141
+ constructor({ blockNumber, chain, contract, }: {
142
+ blockNumber?: bigint;
143
+ chain: Chain;
144
+ contract: {
145
+ name: string;
146
+ blockCreated?: number;
147
+ };
148
+ });
149
+ }
150
+
86
151
  declare class SizeExceedsPaddingSizeError extends BaseError {
87
152
  name: string;
88
153
  constructor({ size, targetSize, type, }: {
@@ -126,15 +191,26 @@ declare class OffsetOutOfBoundsError extends BaseError {
126
191
  });
127
192
  }
128
193
 
194
+ declare class FilterTypeNotSupportedError extends BaseError {
195
+ name: string;
196
+ constructor(type: string);
197
+ }
198
+
129
199
  declare class HttpRequestError extends BaseError {
130
200
  name: string;
131
- status: number;
132
- constructor({ body, details, status, url, }: {
201
+ body: {
202
+ [key: string]: unknown;
203
+ };
204
+ headers?: Headers;
205
+ status?: number;
206
+ url: string;
207
+ constructor({ body, details, headers, status, url, }: {
133
208
  body: {
134
209
  [key: string]: unknown;
135
210
  };
136
- details: string;
137
- status: number;
211
+ details?: string;
212
+ headers?: Headers;
213
+ status?: number;
138
214
  url: string;
139
215
  });
140
216
  }
@@ -173,16 +249,17 @@ declare class TimeoutError extends BaseError {
173
249
  }
174
250
 
175
251
  declare class RequestError extends BaseError {
176
- constructor(err: Error, { docsPath, humanMessage }: {
252
+ constructor(err: Error, { docsPath, metaMessages, shortMessage, }: {
177
253
  docsPath?: string;
178
- humanMessage: string;
254
+ metaMessages?: string[];
255
+ shortMessage: string;
179
256
  });
180
257
  }
181
258
  declare class RpcRequestError extends RequestError {
182
259
  code: number;
183
- constructor(err: RpcError, { docsPath, humanMessage }: {
260
+ constructor(err: RpcError, { docsPath, shortMessage }: {
184
261
  docsPath?: string;
185
- humanMessage: string;
262
+ shortMessage: string;
186
263
  });
187
264
  }
188
265
  declare class ParseRpcError extends RpcRequestError {
@@ -250,35 +327,142 @@ declare class UnknownRpcError extends RequestError {
250
327
  constructor(err: Error);
251
328
  }
252
329
 
253
- declare class InvalidGasArgumentsError extends BaseError {
254
- name: string;
255
- constructor();
256
- }
257
- declare class TransactionNotFoundError extends BaseError {
258
- name: string;
259
- constructor({ blockHash, blockNumber, blockTag, hash, index, }: {
260
- blockHash?: Hash;
261
- blockNumber?: bigint;
262
- blockTag?: BlockTag;
263
- hash?: Hash;
264
- index?: number;
265
- });
266
- }
267
- declare class TransactionReceiptNotFoundError extends BaseError {
268
- name: string;
269
- constructor({ hash }: {
270
- hash: Hash;
271
- });
272
- }
273
- declare class WaitForTransactionReceiptTimeoutError extends BaseError {
274
- name: string;
275
- constructor({ hash }: {
276
- hash: Hash;
277
- });
278
- }
279
-
280
330
  declare class UrlRequiredError extends BaseError {
281
331
  constructor();
282
332
  }
283
333
 
284
- export { AbiDecodingDataSizeInvalidError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiFunctionNotFoundError, BaseError, BlockNotFoundError, DataLengthTooLongError, DataLengthTooShortError, HttpRequestError, InternalRpcError, InvalidAbiDecodingTypeError, InvalidAbiEncodingTypeError, InvalidAddressError, InvalidArrayError, InvalidBytesBooleanError, InvalidDefinitionTypeError, InvalidGasArgumentsError, InvalidHexBooleanError, InvalidHexValueError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, OffsetOutOfBoundsError, ParseRpcError, RequestError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, RpcError, RpcRequestError, SizeExceedsPaddingSizeError, TimeoutError, TransactionNotFoundError, TransactionReceiptNotFoundError, TransactionRejectedRpcError, UnknownRpcError, UrlRequiredError, WaitForTransactionReceiptTimeoutError, WebSocketRequestError };
334
+ type EthereumProvider = {
335
+ request: BaseRpcRequests['request'];
336
+ };
337
+ type CustomTransportConfig = {
338
+ /** The key of the transport. */
339
+ key?: TransportConfig['key'];
340
+ /** The name of the transport. */
341
+ name?: TransportConfig['name'];
342
+ /** The max number of times to retry. */
343
+ retryCount?: TransportConfig['retryCount'];
344
+ /** The base delay (in ms) between retries. */
345
+ retryDelay?: TransportConfig['retryDelay'];
346
+ };
347
+ type CustomTransport = Transport<'custom', EthereumProvider['request']>;
348
+ /**
349
+ * @description Creates a custom transport given an EIP-1193 compliant `request` attribute.
350
+ */
351
+ declare function custom<TProvider extends EthereumProvider>(
352
+ /** An Ethereum provider with an EIP-1193 "request" attribute. */
353
+ provider: TProvider, config?: CustomTransportConfig): CustomTransport;
354
+
355
+ type FallbackTransportConfig = {
356
+ /** The key of the Fallback transport. */
357
+ key?: TransportConfig['key'];
358
+ /** The name of the Fallback transport. */
359
+ name?: TransportConfig['name'];
360
+ /** The max number of times to retry. */
361
+ retryCount?: TransportConfig['retryCount'];
362
+ /** The base delay (in ms) between retries. */
363
+ retryDelay?: TransportConfig['retryDelay'];
364
+ };
365
+ type FallbackTransport = Transport<'fallback', {
366
+ transports: Transport[];
367
+ }>;
368
+ declare function fallback(transports: Transport[], config?: FallbackTransportConfig): FallbackTransport;
369
+
370
+ type HttpTransportConfig = {
371
+ /**
372
+ * Request configuration to pass to `fetch`.
373
+ * @link https://developer.mozilla.org/en-US/docs/Web/API/fetch
374
+ */
375
+ fetchOptions?: HttpOptions['fetchOptions'];
376
+ /** The key of the HTTP transport. */
377
+ key?: TransportConfig['key'];
378
+ /** The name of the HTTP transport. */
379
+ name?: TransportConfig['name'];
380
+ /** The max number of times to retry. */
381
+ retryCount?: TransportConfig['retryCount'];
382
+ /** The base delay (in ms) between retries. */
383
+ retryDelay?: TransportConfig['retryDelay'];
384
+ /** The timeout (in ms) for the HTTP request. Default: 10_000 */
385
+ timeout?: TransportConfig['timeout'];
386
+ };
387
+ type HttpTransport = Transport<'http', {
388
+ url?: string;
389
+ }>;
390
+ /**
391
+ * @description Creates a HTTP transport that connects to a JSON-RPC API.
392
+ */
393
+ declare function http(
394
+ /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
395
+ url?: string, config?: HttpTransportConfig): HttpTransport;
396
+
397
+ type WebSocketTransportSubscribeArgs = {
398
+ onData: (data: RpcResponse) => void;
399
+ onError?: (error: any) => void;
400
+ };
401
+ type WebSocketTransportSubscribeResponse = {
402
+ subscriptionId: Hash;
403
+ unsubscribe: () => Promise<RpcResponse<boolean>>;
404
+ };
405
+ type WebSocketTransportSubscribe = {
406
+ subscribe(args: WebSocketTransportSubscribeArgs & {
407
+ /**
408
+ * @description Add information about compiled contracts
409
+ * @link https://hardhat.org/hardhat-network/docs/reference#hardhat_addcompilationresult
410
+ */
411
+ params: ['newHeads'];
412
+ }): Promise<WebSocketTransportSubscribeResponse>;
413
+ };
414
+ type WebSocketTransportConfig = {
415
+ /** The key of the WebSocket transport. */
416
+ key?: TransportConfig['key'];
417
+ /** The name of the WebSocket transport. */
418
+ name?: TransportConfig['name'];
419
+ /** The max number of times to retry. */
420
+ retryCount?: TransportConfig['retryCount'];
421
+ /** The base delay (in ms) between retries. */
422
+ retryDelay?: TransportConfig['retryDelay'];
423
+ /** The timeout (in ms) for async WebSocket requests. Default: 10_000 */
424
+ timeout?: TransportConfig['timeout'];
425
+ };
426
+ type WebSocketTransport = Transport<'webSocket', {
427
+ getSocket(): Promise<WebSocket>;
428
+ subscribe: WebSocketTransportSubscribe['subscribe'];
429
+ }>;
430
+ /**
431
+ * @description Creates a WebSocket transport that connects to a JSON-RPC API.
432
+ */
433
+ declare function webSocket(
434
+ /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
435
+ url?: string, config?: WebSocketTransportConfig): WebSocketTransport;
436
+
437
+ declare const multicall3Abi: readonly [{
438
+ readonly inputs: readonly [{
439
+ readonly components: readonly [{
440
+ readonly name: "target";
441
+ readonly type: "address";
442
+ }, {
443
+ readonly name: "allowFailure";
444
+ readonly type: "bool";
445
+ }, {
446
+ readonly name: "callData";
447
+ readonly type: "bytes";
448
+ }];
449
+ readonly name: "calls";
450
+ readonly type: "tuple[]";
451
+ }];
452
+ readonly name: "aggregate3";
453
+ readonly outputs: readonly [{
454
+ readonly components: readonly [{
455
+ readonly name: "success";
456
+ readonly type: "bool";
457
+ }, {
458
+ readonly name: "returnData";
459
+ readonly type: "bytes";
460
+ }];
461
+ readonly name: "returnData";
462
+ readonly type: "tuple[]";
463
+ }];
464
+ readonly stateMutability: "view";
465
+ readonly type: "function";
466
+ }];
467
+
468
+ export { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, AbiDecodingDataSizeInvalidError, AbiDecodingZeroDataError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiErrorInputsNotFoundError, AbiErrorNotFoundError, AbiErrorSignatureNotFoundError, AbiEventNotFoundError, AbiEventSignatureNotFoundError, AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, AbiFunctionSignatureNotFoundError, BlockNotFoundError, ChainDoesNotSupportContract, CustomTransport, CustomTransportConfig, DataLengthTooLongError, DataLengthTooShortError, FallbackTransport, FallbackTransportConfig, FilterTypeNotSupportedError, HttpRequestError, HttpTransport, HttpTransportConfig, InternalRpcError, InvalidAbiDecodingTypeError, InvalidAbiEncodingTypeError, InvalidAddressError, InvalidArrayError, InvalidBytesBooleanError, InvalidDefinitionTypeError, InvalidHexBooleanError, InvalidHexValueError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, OffsetOutOfBoundsError, ParseRpcError, RequestError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, RpcError, RpcRequestError, SizeExceedsPaddingSizeError, TimeoutError, TransactionRejectedRpcError, UnknownRpcError, UrlRequiredError, WebSocketRequestError, WebSocketTransport, WebSocketTransportConfig, custom, fallback, http, multicall3Abi, webSocket };