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.
- package/chains/package.json +1 -1
- package/contract/package.json +4 -0
- package/dist/chain-00b37e4e.d.ts +543 -0
- package/dist/chain-38182d92.d.ts +5 -0
- package/dist/chains.d.ts +1305 -74
- package/dist/chains.js +125 -130
- package/dist/chains.js.map +1 -0
- package/dist/chains.mjs +129 -0
- package/dist/chains.mjs.map +1 -0
- package/dist/chunk-5STAX3WF.js +265 -0
- package/dist/chunk-5STAX3WF.js.map +1 -0
- package/dist/chunk-6ZFIUYGC.mjs +3436 -0
- package/dist/chunk-6ZFIUYGC.mjs.map +1 -0
- package/dist/chunk-APXHGB76.mjs +197 -0
- package/dist/chunk-APXHGB76.mjs.map +1 -0
- package/dist/chunk-C54QK7K3.mjs +210 -0
- package/dist/chunk-C54QK7K3.mjs.map +1 -0
- package/dist/{chunk-YZEQFYZ3.js → chunk-IBWRBL2I.mjs} +725 -556
- package/dist/chunk-IBWRBL2I.mjs.map +1 -0
- package/dist/chunk-J7QHQ26Y.js +3436 -0
- package/dist/chunk-J7QHQ26Y.js.map +1 -0
- package/dist/chunk-MYFKW55L.js +210 -0
- package/dist/chunk-MYFKW55L.js.map +1 -0
- package/dist/chunk-NCPBWOQA.js +1216 -0
- package/dist/chunk-NCPBWOQA.js.map +1 -0
- package/dist/chunk-QBB3DFIB.mjs +265 -0
- package/dist/chunk-QBB3DFIB.mjs.map +1 -0
- package/dist/chunk-UUULPQHV.js +197 -0
- package/dist/chunk-UUULPQHV.js.map +1 -0
- package/dist/contract.d.ts +11 -0
- package/dist/contract.js +57 -0
- package/dist/contract.js.map +1 -0
- package/dist/contract.mjs +57 -0
- package/dist/contract.mjs.map +1 -0
- package/dist/createClient-5258d590.d.ts +70 -0
- package/dist/createPublicClient-99be385b.d.ts +650 -0
- package/dist/{eip1193-8b4d90ce.d.ts → eip1193-fcdeee04.d.ts} +13 -10
- package/dist/ens.d.ts +22 -0
- package/dist/ens.js +22 -0
- package/dist/ens.js.map +1 -0
- package/dist/ens.mjs +22 -0
- package/dist/ens.mjs.map +1 -0
- package/dist/formatAbiItem-50cb39d8.d.ts +14 -0
- package/dist/getAbiItem-6d4f64d2.d.ts +97 -0
- package/dist/index.d.ts +251 -67
- package/dist/index.js +769 -344
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +769 -0
- package/dist/index.mjs.map +1 -0
- package/dist/namehash-88f4639d.d.ts +22 -0
- package/dist/parseGwei-8af7a0a6.d.ts +509 -0
- package/dist/public.d.ts +29 -0
- package/dist/public.js +60 -0
- package/dist/public.js.map +1 -0
- package/dist/public.mjs +60 -0
- package/dist/public.mjs.map +1 -0
- package/dist/test-79ec416c.d.ts +213 -0
- package/dist/test.d.ts +20 -0
- package/dist/test.js +62 -0
- package/dist/test.js.map +1 -0
- package/dist/test.mjs +62 -0
- package/dist/test.mjs.map +1 -0
- package/dist/utils/index.d.ts +52 -7
- package/dist/utils/index.js +187 -126
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +187 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/wallet-cf5c8351.d.ts +115 -0
- package/dist/wallet.d.ts +7 -0
- package/dist/wallet.js +24 -0
- package/dist/wallet.js.map +1 -0
- package/dist/wallet.mjs +24 -0
- package/dist/wallet.mjs.map +1 -0
- package/dist/window.d.ts +5 -2
- package/dist/window.js +1 -0
- package/dist/window.js.map +1 -0
- package/dist/window.mjs +1 -0
- package/dist/window.mjs.map +1 -0
- package/ens/package.json +4 -0
- package/package.json +46 -73
- package/public/package.json +4 -0
- package/test/package.json +4 -0
- package/utils/package.json +1 -1
- package/wallet/package.json +4 -0
- package/window/package.json +1 -1
- package/actions/package.json +0 -4
- package/clients/package.json +0 -4
- package/dist/actions/index.d.ts +0 -7
- package/dist/actions/index.js +0 -124
- package/dist/chunk-SRDTRROA.js +0 -1214
- package/dist/chunk-TLEMV4T3.js +0 -258
- package/dist/chunk-WZITKXV3.js +0 -996
- package/dist/clients/index.d.ts +0 -7
- package/dist/clients/index.js +0 -23
- package/dist/createWalletClient-15ad1601.d.ts +0 -130
- package/dist/parseGwei-0f85e8ca.d.ts +0 -248
- package/dist/rpc-15b85963.d.ts +0 -292
- package/dist/rpc-26932bae.d.ts +0 -61
- package/dist/transactionRequest-f538ea86.d.ts +0 -44
- package/dist/watchAsset-0c9d01e2.d.ts +0 -522
- package/dist/webSocket-b55b0951.d.ts +0 -83
package/dist/index.d.ts
CHANGED
@@ -1,37 +1,42 @@
|
|
1
|
-
|
2
|
-
export { C as Client,
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
export { F as
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
15
|
-
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
}
|
20
|
-
|
21
|
-
|
22
|
-
}
|
23
|
-
|
24
|
-
|
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:
|
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
|
-
|
132
|
-
|
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
|
137
|
-
|
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,
|
252
|
+
constructor(err: Error, { docsPath, metaMessages, shortMessage, }: {
|
177
253
|
docsPath?: string;
|
178
|
-
|
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,
|
260
|
+
constructor(err: RpcError, { docsPath, shortMessage }: {
|
184
261
|
docsPath?: string;
|
185
|
-
|
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
|
-
|
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 };
|