viem 0.0.1-alpha.24 → 0.0.1-alpha.25
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/contract/package.json +4 -0
- package/dist/call-ac509982.d.ts +23 -0
- package/dist/{chain-e33d019b.d.ts → chain-c4ccb458.d.ts} +1 -1
- package/dist/{chain-afa13f5a.d.ts → chain-f16512e8.d.ts} +20 -1
- package/dist/chains.d.ts +20 -8
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-YQUC52RL.mjs → chunk-2Y3UZMSP.mjs} +77 -84
- package/dist/chunk-2Y3UZMSP.mjs.map +1 -0
- package/dist/{chunk-A2HXAZXC.js → chunk-CD2XJOBJ.js} +135 -142
- package/dist/chunk-CD2XJOBJ.js.map +1 -0
- package/dist/{chunk-LQVMDX5I.mjs → chunk-KSAO4Y4Q.mjs} +133 -54
- package/dist/chunk-KSAO4Y4Q.mjs.map +1 -0
- package/dist/{chunk-3ARWEJ3G.mjs → chunk-LEPQJNVO.mjs} +18 -2
- package/dist/chunk-LEPQJNVO.mjs.map +1 -0
- package/dist/{chunk-ZYSXBTBB.js → chunk-NUXMGPMK.js} +30 -14
- package/dist/chunk-NUXMGPMK.js.map +1 -0
- package/dist/{chunk-4D5XG6XB.js → chunk-THMRUG4D.js} +148 -69
- package/dist/chunk-THMRUG4D.js.map +1 -0
- package/dist/{contract-70f4ddbe.d.ts → contract-9e76e561.d.ts} +44 -31
- package/dist/contract.d.ts +123 -0
- package/dist/contract.js +53 -0
- package/dist/{clients/index.js.map → contract.js.map} +0 -0
- package/dist/contract.mjs +53 -0
- package/dist/{clients/index.mjs.map → contract.mjs.map} +0 -0
- package/dist/{createClient-60e3ab98.d.ts → createClient-68ee4bb4.d.ts} +3 -3
- package/dist/{createPublicClient-d3d12dc3.d.ts → createPublicClient-b732194e.d.ts} +3 -3
- package/dist/{createTestClient-5f4532c4.d.ts → createTestClient-dedf321e.d.ts} +3 -3
- package/dist/{createWalletClient-9ec3df4f.d.ts → createWalletClient-75813d83.d.ts} +3 -3
- package/dist/decodeErrorResult-0b934d23.d.ts +16 -0
- package/dist/{eip1193-9317a312.d.ts → eip1193-6f9ba163.d.ts} +1 -1
- package/dist/ens.d.ts +82 -1
- package/dist/ens.js +208 -3
- package/dist/ens.js.map +1 -1
- package/dist/ens.mjs +209 -4
- package/dist/ens.mjs.map +1 -1
- package/dist/getAbiItem-c8e6e7d4.d.ts +97 -0
- package/dist/index.d.ts +85 -175
- package/dist/index.js +237 -279
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +245 -287
- package/dist/index.mjs.map +1 -1
- package/dist/public.d.ts +352 -10
- package/dist/public.js +3 -4
- package/dist/public.mjs +6 -7
- package/dist/readContract-4f6e2692.d.ts +10 -0
- package/dist/rpc-a5a7f376.d.ts +121 -0
- package/dist/{sendTransaction-54a0d509.d.ts → sendTransaction-e713f90c.d.ts} +3 -3
- package/dist/test.d.ts +160 -5
- package/dist/test.js +222 -18
- package/dist/test.js.map +1 -1
- package/dist/test.mjs +233 -29
- package/dist/test.mjs.map +1 -1
- package/dist/transactionReceipt-2a86c7c7.d.ts +26 -0
- package/dist/{transactionRequest-bdf57f7d.d.ts → transactionRequest-c7794f5e.d.ts} +1 -1
- package/dist/utils/index.d.ts +224 -20
- package/dist/utils/index.js +2 -6
- package/dist/utils/index.mjs +3 -7
- package/dist/wallet.d.ts +41 -7
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/watchEvent-c346c12d.d.ts +41 -0
- package/dist/window.d.ts +2 -2
- package/ens/package.json +4 -0
- package/package.json +13 -9
- package/src/_test/constants.ts +2 -0
- package/src/_test/utils.ts +10 -5
- package/src/actions/ens/getEnsAddress.bench.ts +26 -0
- package/src/actions/ens/getEnsAddress.test.ts +97 -0
- package/src/actions/ens/getEnsAddress.ts +122 -0
- package/src/actions/ens/getEnsName.bench.ts +30 -0
- package/src/actions/ens/getEnsName.test.ts +101 -0
- package/src/actions/ens/getEnsName.ts +106 -0
- package/src/actions/ens/index.test.ts +12 -0
- package/src/actions/ens/index.ts +3 -0
- package/src/actions/index.ts +3 -3
- package/src/actions/public/createEventFilter.test.ts +36 -4
- package/src/actions/public/createEventFilter.ts +27 -10
- package/src/actions/public/getFilterChanges.test.ts +198 -4
- package/src/actions/public/getFilterLogs.test.ts +195 -2
- package/src/actions/public/getLogs.test.ts +201 -2
- package/src/actions/public/index.test.ts +0 -1
- package/src/actions/public/index.ts +1 -7
- package/src/actions/public/multicall.ts +8 -3
- package/src/actions/public/simulateContract.ts +1 -4
- package/src/actions/public/watchContractEvent.test.ts +4 -4
- package/src/actions/{public → wallet}/deployContract.test.ts +1 -2
- package/src/actions/{public → wallet}/deployContract.ts +0 -0
- package/src/actions/wallet/index.test.ts +1 -0
- package/src/actions/wallet/index.ts +6 -0
- package/src/chains.test.ts +44 -1517
- package/src/clients/transports/webSocket.test.ts +1 -0
- package/src/clients/transports/webSocket.ts +1 -0
- package/src/contract.test.ts +31 -0
- package/src/contract.ts +68 -0
- package/src/ens.test.ts +15 -0
- package/src/ens.ts +4 -1
- package/src/errors/abi.ts +18 -2
- package/src/errors/chain.test.ts +46 -0
- package/src/errors/chain.ts +33 -0
- package/src/errors/contract.ts +2 -2
- package/src/errors/index.ts +3 -0
- package/src/index.test.ts +0 -147
- package/src/index.ts +0 -257
- package/src/public.test.ts +36 -0
- package/src/public.ts +2 -6
- package/src/test.test.ts +38 -0
- package/src/test.ts +1 -0
- package/src/types/contract.ts +144 -40
- package/src/types/index.ts +2 -1
- package/src/types/utils.ts +21 -0
- package/src/utils/abi/decodeErrorResult.test.ts +1 -1
- package/src/utils/abi/decodeEventLog.test.ts +542 -0
- package/src/utils/abi/decodeEventLog.ts +107 -0
- package/src/utils/abi/decodeFunctionData.test.ts +1 -2
- package/src/utils/abi/decodeFunctionData.ts +5 -2
- package/src/utils/abi/encodeFunctionData.ts +1 -4
- package/src/utils/abi/index.test.ts +1 -0
- package/src/utils/abi/index.ts +6 -0
- package/src/utils/ens/index.test.ts +1 -0
- package/src/utils/ens/index.ts +2 -0
- package/src/utils/ens/packetToBytes.test.ts +11 -0
- package/src/utils/ens/packetToBytes.ts +29 -0
- package/src/utils/index.test.ts +1 -3
- package/src/utils/index.ts +3 -2
- package/src/utils/rpc.test.ts +1 -0
- package/src/utils/rpc.ts +4 -2
- package/src/wallet.test.ts +19 -0
- package/wallet/package.json +4 -0
- package/clients/package.json +0 -4
- package/dist/chunk-3ARWEJ3G.mjs.map +0 -1
- package/dist/chunk-4D5XG6XB.js.map +0 -1
- package/dist/chunk-6QTEW2BE.mjs +0 -260
- package/dist/chunk-6QTEW2BE.mjs.map +0 -1
- package/dist/chunk-A2HXAZXC.js.map +0 -1
- package/dist/chunk-KRPS5CIB.mjs +0 -256
- package/dist/chunk-KRPS5CIB.mjs.map +0 -1
- package/dist/chunk-LQVMDX5I.mjs.map +0 -1
- package/dist/chunk-N3IOPT3R.js +0 -256
- package/dist/chunk-N3IOPT3R.js.map +0 -1
- package/dist/chunk-YQUC52RL.mjs.map +0 -1
- package/dist/chunk-ZSTVHQ6J.js +0 -260
- package/dist/chunk-ZSTVHQ6J.js.map +0 -1
- package/dist/chunk-ZYSXBTBB.js.map +0 -1
- package/dist/clients/index.d.ts +0 -9
- package/dist/clients/index.js +0 -24
- package/dist/clients/index.mjs +0 -24
- package/dist/normalize-ef9240c0.d.ts +0 -33
- package/dist/parseGwei-492ab7dd.d.ts +0 -355
- package/dist/rpc-26932bae.d.ts +0 -61
- package/dist/stopImpersonatingAccount-c1a4b7e5.d.ts +0 -156
- package/dist/watchAsset-d59d6e35.d.ts +0 -38
- package/dist/watchPendingTransactions-ea21b31d.d.ts +0 -373
- package/dist/webSocket-775b4037.d.ts +0 -83
package/dist/index.d.ts
CHANGED
@@ -1,26 +1,18 @@
|
|
1
|
-
import {
|
2
|
-
export { C as
|
3
|
-
import
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from './createPublicClient-
|
9
|
-
|
10
|
-
export {
|
11
|
-
export {
|
12
|
-
|
13
|
-
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './createTestClient-5f4532c4.js';
|
14
|
-
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from './createWalletClient-9ec3df4f.js';
|
15
|
-
export { G as GetPermissionsResponse, R as RequestPermissionsResponse, S as SignMessageArgs, a as SignMessageResponse, b as SwitchChainArgs, W as WatchAssetArgs, c as WatchAssetResponse, d as addChain, g as getAccounts, e as getPermissions, r as requestAccounts, f as requestPermissions, s as signMessage, h as switchChain, w as watchAsset } from './watchAsset-d59d6e35.js';
|
16
|
-
export { S as SendTransactionArgs, a as SendTransactionResponse, s as sendTransaction } from './sendTransaction-54a0d509.js';
|
17
|
-
import { B as BaseError } from './parseGwei-492ab7dd.js';
|
18
|
-
export { B as BaseError, C as ContractFunctionExecutionError, a as ContractFunctionRevertedError, b as ContractFunctionZeroDataError, D as DecodeAbiArgs, c as DecodeErrorResultArgs, d as DecodeFunctionDataArgs, e as DecodeFunctionResultArgs, f as DecodeFunctionResultResponse, E as EncodeAbiArgs, g as EncodeDeployDataArgs, h as EncodeErrorResultArgs, i as EncodeEventTopicsArgs, j as EncodeFunctionDataArgs, k as EncodeFunctionResultArgs, o as EncodeRlpResponse, n as GetAbiItemArgs, G as GetContractAddressOptions, m as GetCreate2AddressOptions, l as GetCreateAddressOptions, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, p as bytesToHex, v as bytesToNumber, q as bytesToString, w as decodeAbi, x as decodeBytes, y as decodeErrorResult, z as decodeFunctionData, A as decodeFunctionResult, F as decodeHex, H as decodeRlp, I as encodeAbi, J as encodeBytes, K as encodeDeployData, L as encodeErrorResult, M as encodeEventTopics, N as encodeFunctionData, O as encodeFunctionResult, P as encodeHex, Q as encodeRlp, R as etherUnits, Z as formatEther, ae as formatGwei, af as formatUnit, S as getAddress, T as getContractAddress, V as getCreate2Address, U as getCreateAddress, W as getEventSignature, X as getFunctionSignature, Y as gweiUnits, a2 as hexToBigInt, a3 as hexToBool, a4 as hexToBytes, ag as hexToNumber, a5 as hexToString, _ as isAddress, $ as isAddressEqual, a0 as isBytes, a1 as isHex, a6 as keccak256, a7 as numberToBytes, ah as numberToHex, a8 as pad, a9 as padBytes, aa as padHex, ab as parseEther, ac as parseGwei, ad as parseUnit, ai as size, aj as slice, ak as sliceBytes, al as sliceHex, am as stringToBytes, an as stringToHex, ao as trim, ap as weiUnits } from './parseGwei-492ab7dd.js';
|
19
|
-
export { F as FormattedTransactionRequest, f as formatTransactionRequest } from './transactionRequest-bdf57f7d.js';
|
1
|
+
import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-68ee4bb4.js';
|
2
|
+
export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-68ee4bb4.js';
|
3
|
+
import WebSocket from 'isomorphic-ws';
|
4
|
+
import { H as Hex, A as Address, a as Hash, B as ByteArray, b as BlockTag } from './chain-f16512e8.js';
|
5
|
+
export { c as AccessList, A as Address, d as Block, e as BlockIdentifier, f as BlockNumber, b as BlockTag, B as ByteArray, C as Chain, F as FeeHistory, g as FeeValues, h as FeeValuesEIP1559, i as FeeValuesLegacy, a as Hash, H as Hex, L as Log, R as RpcBlock, j as RpcBlockIdentifier, k as RpcBlockNumber, l as RpcFeeHistory, m as RpcFeeValues, n as RpcLog, o as RpcTransaction, p as RpcTransactionReceipt, q as RpcTransactionRequest, r as RpcUncle, x as Transaction, y as TransactionBase, z as TransactionEIP1559, D as TransactionEIP2930, E as TransactionLegacy, T as TransactionReceipt, s as TransactionRequest, t as TransactionRequestBase, u as TransactionRequestEIP1559, v as TransactionRequestEIP2930, w as TransactionRequestLegacy, U as Uncle } from './chain-f16512e8.js';
|
6
|
+
import { B as BaseError, R as RpcResponse } from './rpc-a5a7f376.js';
|
7
|
+
export { B as BaseError, C as ContractFunctionExecutionError, a as ContractFunctionRevertedError, b as ContractFunctionZeroDataError } from './rpc-a5a7f376.js';
|
8
|
+
export { P as PublicClient, a as PublicClientConfig, c as createPublicClient } from './createPublicClient-b732194e.js';
|
9
|
+
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './createTestClient-dedf321e.js';
|
10
|
+
export { W as WalletClient, a as WalletClientConfig, c as createWalletClient } from './createWalletClient-75813d83.js';
|
11
|
+
export { A as AbiItem, C as ContractConfig } from './contract-9e76e561.js';
|
12
|
+
import './eip1193-6f9ba163.js';
|
20
13
|
import '@wagmi/chains';
|
21
|
-
import '
|
22
|
-
import './
|
23
|
-
import 'abitype/dist/abi-78346466';
|
14
|
+
import 'abitype';
|
15
|
+
import './decodeErrorResult-0b934d23.js';
|
24
16
|
|
25
17
|
declare class AbiConstructorNotFoundError extends BaseError {
|
26
18
|
name: string;
|
@@ -334,165 +326,83 @@ declare class UrlRequiredError extends BaseError {
|
|
334
326
|
constructor();
|
335
327
|
}
|
336
328
|
|
337
|
-
type
|
338
|
-
|
339
|
-
abi: TAbi;
|
340
|
-
functionName: TFunctionName;
|
329
|
+
type EthereumProvider = {
|
330
|
+
request: BaseRpcRequests['request'];
|
341
331
|
};
|
342
|
-
type
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
...Tail
|
350
|
-
], TProperties, [
|
351
|
-
...Result,
|
352
|
-
ContractConfig<Head['abi'], Head['functionName']> & TProperties
|
353
|
-
], [
|
354
|
-
...Depth,
|
355
|
-
1
|
356
|
-
]> : unknown[] extends TContracts ? TContracts : TContracts extends ContractConfig<infer TAbi, infer TFunctionName>[] ? (ContractConfig<TAbi, TFunctionName> & TProperties)[] : (ContractConfig & TProperties)[];
|
357
|
-
type MulticallResult<Result, TAllowFailure extends boolean = true> = TAllowFailure extends true ? ({
|
358
|
-
error?: undefined;
|
359
|
-
result: Result;
|
360
|
-
status: 'success';
|
361
|
-
} | {
|
362
|
-
error: Error;
|
363
|
-
result?: undefined;
|
364
|
-
status: 'error';
|
365
|
-
}) : Result;
|
366
|
-
type MulticallResults<TContracts extends Contract[], TAllowFailure extends boolean = true, Result extends any[] = [], Depth extends ReadonlyArray<number> = []> = Depth['length'] extends MAXIMUM_DEPTH ? MulticallResult<ExtractResultFromAbi, TAllowFailure>[] : TContracts extends [] ? [] : TContracts extends [infer Head extends Contract] ? [...Result, MulticallResult<ExtractResultFromAbi<Head['abi'], Head['functionName']>, TAllowFailure>] : TContracts extends [
|
367
|
-
infer Head extends Contract,
|
368
|
-
...infer Tail extends Contract[]
|
369
|
-
] ? MulticallResults<[
|
370
|
-
...Tail
|
371
|
-
], TAllowFailure, [
|
372
|
-
...Result,
|
373
|
-
MulticallResult<ExtractResultFromAbi<Head['abi'], Head['functionName']>, TAllowFailure>
|
374
|
-
], [
|
375
|
-
...Depth,
|
376
|
-
1
|
377
|
-
]> : TContracts extends ContractConfig<infer TAbi, infer TFunctionName>[] ? MulticallResult<ExtractResultFromAbi<TAbi, TFunctionName>, TAllowFailure>[] : MulticallResult<ExtractResultFromAbi, TAllowFailure>[];
|
378
|
-
|
379
|
-
type EventFilterArgs<TEventDefinition extends EventDefinition> = ExtractArgsFromEventDefinition<TEventDefinition>;
|
380
|
-
type CreateEventFilterArgs<TEventDefinition extends EventDefinition> = {
|
381
|
-
address?: Address | Address[];
|
382
|
-
fromBlock?: BlockNumber | BlockTag;
|
383
|
-
toBlock?: BlockNumber | BlockTag;
|
384
|
-
} & ({
|
385
|
-
event: TEventDefinition;
|
386
|
-
args?: EventFilterArgs<TEventDefinition>;
|
387
|
-
} | {
|
388
|
-
event?: never;
|
389
|
-
args?: never;
|
390
|
-
});
|
391
|
-
type CreateEventFilterResponse = Filter<'event'>;
|
392
|
-
declare function createEventFilter<TEventDefinition extends EventDefinition>(client: PublicClient, { address, event, args, fromBlock, toBlock, }?: CreateEventFilterArgs<TEventDefinition>): Promise<CreateEventFilterResponse>;
|
393
|
-
|
394
|
-
type CreateContractEventFilterArgs<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = any> = {
|
395
|
-
address?: Address | Address[];
|
396
|
-
abi: TAbi;
|
397
|
-
eventName: ExtractEventNameFromAbi<TAbi, TEventName>;
|
398
|
-
fromBlock?: BlockNumber | BlockTag;
|
399
|
-
toBlock?: BlockNumber | BlockTag;
|
400
|
-
} & ExtractEventArgsFromAbi<TAbi, TEventName>;
|
401
|
-
type CreateContractEventFilterResponse = Filter<'event'>;
|
402
|
-
declare function createContractEventFilter<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = any>(client: PublicClient, { address, abi, args, eventName, fromBlock, toBlock, }: CreateContractEventFilterArgs<TAbi, TEventName>): Promise<CreateContractEventFilterResponse>;
|
403
|
-
|
404
|
-
type GetLogsArgs<TEventDefinition extends EventDefinition> = {
|
405
|
-
/** Address or list of addresses from which logs originated */
|
406
|
-
address?: Address | Address[];
|
407
|
-
} & ({
|
408
|
-
event: TEventDefinition;
|
409
|
-
args?: EventFilterArgs<TEventDefinition>;
|
410
|
-
} | {
|
411
|
-
event?: never;
|
412
|
-
args?: never;
|
413
|
-
}) & ({
|
414
|
-
/** Block number or tag after which to include logs */
|
415
|
-
fromBlock?: BlockNumber<bigint> | BlockTag;
|
416
|
-
/** Block number or tag before which to include logs */
|
417
|
-
toBlock?: BlockNumber<bigint> | BlockTag;
|
418
|
-
blockHash?: never;
|
419
|
-
} | {
|
420
|
-
fromBlock?: never;
|
421
|
-
toBlock?: never;
|
422
|
-
/** Hash of block to include logs from */
|
423
|
-
blockHash?: Hash;
|
424
|
-
});
|
425
|
-
type GetLogsResponse = Log[];
|
332
|
+
type CustomTransportConfig = {
|
333
|
+
/** The key of the transport. */
|
334
|
+
key?: TransportConfig['key'];
|
335
|
+
/** The name of the transport. */
|
336
|
+
name?: TransportConfig['name'];
|
337
|
+
};
|
338
|
+
type CustomTransport = Transport<'custom', EthereumProvider['request']>;
|
426
339
|
/**
|
427
|
-
* @description
|
340
|
+
* @description Creates a custom transport given an EIP-1193 compliant `request` attribute.
|
428
341
|
*/
|
429
|
-
declare function
|
342
|
+
declare function custom<TProvider extends EthereumProvider>(
|
343
|
+
/** An Ethereum provider with an EIP-1193 "request" attribute. */
|
344
|
+
provider: TProvider, { key, name }?: CustomTransportConfig): CustomTransport;
|
430
345
|
|
431
|
-
type
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
blockTag?: BlockTag;
|
437
|
-
} | {
|
438
|
-
blockNumber?: bigint;
|
439
|
-
blockTag?: never;
|
440
|
-
});
|
441
|
-
type GetStorageAtResponse = Hex | undefined;
|
442
|
-
declare function getStorageAt(client: PublicClient, { address, blockNumber, blockTag, slot }: GetStorageAtArgs): Promise<GetStorageAtResponse>;
|
443
|
-
|
444
|
-
type MulticallArgs<TContracts extends ContractConfig[], TAllowFailure extends boolean = true> = Pick<CallArgs, 'blockNumber' | 'blockTag'> & {
|
445
|
-
allowFailure?: TAllowFailure;
|
446
|
-
contracts: readonly [...MulticallContracts<TContracts>];
|
447
|
-
multicallAddress: Address;
|
346
|
+
type FallbackTransportConfig = {
|
347
|
+
/** The key of the Fallback transport. */
|
348
|
+
key?: TransportConfig['key'];
|
349
|
+
/** The name of the Fallback transport. */
|
350
|
+
name?: TransportConfig['name'];
|
448
351
|
};
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
declare function readContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: PublicClient, { abi, address, args, functionName, ...callRequest }: ReadContractArgs<TAbi, TFunctionName>): Promise<ReadContractResponse<TAbi, TFunctionName>>;
|
352
|
+
type FallbackTransport = Transport<'fallback', {
|
353
|
+
transports: Transport[];
|
354
|
+
}>;
|
355
|
+
declare function fallback(transports: Transport[], { key, name }?: FallbackTransportConfig): FallbackTransport;
|
454
356
|
|
455
|
-
type
|
456
|
-
|
457
|
-
|
458
|
-
/** The
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
/** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
|
471
|
-
pollingInterval?: number;
|
472
|
-
} & ExtractEventArgsFromAbi<TAbi, TEventName>;
|
473
|
-
declare function watchContractEvent<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = any>(client: PublicClient, { abi, address, args, batch, eventName, onError, onLogs, pollingInterval, }: WatchContractEventArgs<TAbi, TEventName>): () => void;
|
357
|
+
type HttpTransportConfig = {
|
358
|
+
/** The key of the HTTP transport. */
|
359
|
+
key?: TransportConfig['key'];
|
360
|
+
/** The name of the HTTP transport. */
|
361
|
+
name?: TransportConfig['name'];
|
362
|
+
};
|
363
|
+
type HttpTransport = Transport<'http', {
|
364
|
+
url?: string;
|
365
|
+
}>;
|
366
|
+
/**
|
367
|
+
* @description Creates a HTTP transport that connects to a JSON-RPC API.
|
368
|
+
*/
|
369
|
+
declare function http(
|
370
|
+
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
|
371
|
+
url?: string, { key, name }?: HttpTransportConfig): HttpTransport;
|
474
372
|
|
475
|
-
type
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
}
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
373
|
+
type WebSocketTransportSubscribeArgs = {
|
374
|
+
onData: (data: RpcResponse) => void;
|
375
|
+
onError?: (error: any) => void;
|
376
|
+
};
|
377
|
+
type WebSocketTransportSubscribeResponse = {
|
378
|
+
subscriptionId: Hash;
|
379
|
+
unsubscribe: () => Promise<RpcResponse<boolean>>;
|
380
|
+
};
|
381
|
+
type WebSocketTransportSubscribe = {
|
382
|
+
subscribe(args: WebSocketTransportSubscribeArgs & {
|
383
|
+
/**
|
384
|
+
* @description Add information about compiled contracts
|
385
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_addcompilationresult
|
386
|
+
*/
|
387
|
+
params: ['newHeads'];
|
388
|
+
}): Promise<WebSocketTransportSubscribeResponse>;
|
389
|
+
};
|
390
|
+
type WebSocketTransportConfig = {
|
391
|
+
/** The key of the WebSocket transport. */
|
392
|
+
key?: TransportConfig['key'];
|
393
|
+
/** The name of the WebSocket transport. */
|
394
|
+
name?: TransportConfig['name'];
|
395
|
+
};
|
396
|
+
type WebSocketTransport = Transport<'webSocket', {
|
397
|
+
getSocket(): Promise<WebSocket>;
|
398
|
+
subscribe: WebSocketTransportSubscribe['subscribe'];
|
399
|
+
}>;
|
400
|
+
/**
|
401
|
+
* @description Creates a WebSocket transport that connects to a JSON-RPC API.
|
402
|
+
*/
|
403
|
+
declare function webSocket(
|
404
|
+
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
|
405
|
+
url?: string, { key, name, }?: WebSocketTransportConfig): WebSocketTransport;
|
496
406
|
|
497
407
|
declare const multicall3Abi: readonly [{
|
498
408
|
readonly inputs: readonly [{
|
@@ -525,4 +435,4 @@ declare const multicall3Abi: readonly [{
|
|
525
435
|
readonly type: "function";
|
526
436
|
}];
|
527
437
|
|
528
|
-
export { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, AbiDecodingDataSizeInvalidError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiErrorInputsNotFoundError, AbiErrorNotFoundError, AbiErrorSignatureNotFoundError, AbiEventNotFoundError, AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, AbiFunctionSignatureNotFoundError, BlockNotFoundError,
|
438
|
+
export { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, AbiDecodingDataSizeInvalidError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiErrorInputsNotFoundError, AbiErrorNotFoundError, AbiErrorSignatureNotFoundError, AbiEventNotFoundError, AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, AbiFunctionSignatureNotFoundError, BlockNotFoundError, CustomTransport, CustomTransportConfig, DataLengthTooLongError, DataLengthTooShortError, FallbackTransport, FallbackTransportConfig, FilterTypeNotSupportedError, HttpRequestError, HttpTransport, HttpTransportConfig, 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, WebSocketTransport, WebSocketTransportConfig, custom, fallback, http, multicall3Abi, webSocket };
|