viem 0.1.23 → 0.1.24

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 (43) hide show
  1. package/dist/abi.js +2 -2
  2. package/dist/abi.mjs +1 -1
  3. package/dist/chains.js +63 -63
  4. package/dist/chains.mjs +1 -1
  5. package/dist/{chunk-66PXETQB.js → chunk-CVKFUFQP.js} +19 -19
  6. package/dist/{chunk-JG6MI5ZV.mjs → chunk-DZQWSJNJ.mjs} +3 -2
  7. package/dist/{chunk-JG6MI5ZV.mjs.map → chunk-DZQWSJNJ.mjs.map} +1 -1
  8. package/dist/{chunk-HRVPAYH7.mjs → chunk-QQ7PCGDW.mjs} +2 -2
  9. package/dist/{chunk-Z54YSSBJ.js → chunk-TO4LQVPW.js} +4 -3
  10. package/dist/{chunk-Z54YSSBJ.js.map → chunk-TO4LQVPW.js.map} +1 -1
  11. package/dist/contract.d.ts +2 -2
  12. package/dist/contract.js +2 -2
  13. package/dist/contract.mjs +1 -1
  14. package/dist/{createPublicClient-b250a534.d.ts → createPublicClient-31d44569.d.ts} +1 -1
  15. package/dist/{createClient-a28317a9.d.ts → createTransport-e3eba9f7.d.ts} +28 -26
  16. package/dist/ens.d.ts +2 -2
  17. package/dist/ens.js +3 -3
  18. package/dist/ens.mjs +2 -2
  19. package/dist/ethers.d.ts +2 -2
  20. package/dist/ethers.js +3 -3
  21. package/dist/ethers.mjs +1 -1
  22. package/dist/index.d.ts +41 -7
  23. package/dist/index.js +213 -137
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +123 -47
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/{parseGwei-bd0eea6c.d.ts → parseGwei-361e8a12.d.ts} +1 -1
  28. package/dist/public.d.ts +2 -2
  29. package/dist/public.js +2 -2
  30. package/dist/public.mjs +1 -1
  31. package/dist/{test-2bd23d7e.d.ts → test-67630299.d.ts} +1 -1
  32. package/dist/test.d.ts +3 -3
  33. package/dist/test.js +2 -2
  34. package/dist/test.mjs +1 -1
  35. package/dist/utils/index.d.ts +5 -5
  36. package/dist/utils/index.js +2 -2
  37. package/dist/utils/index.mjs +1 -1
  38. package/dist/wallet.d.ts +2 -2
  39. package/dist/wallet.js +2 -2
  40. package/dist/wallet.mjs +1 -1
  41. package/package.json +1 -1
  42. /package/dist/{chunk-66PXETQB.js.map → chunk-CVKFUFQP.js.map} +0 -0
  43. /package/dist/{chunk-HRVPAYH7.mjs.map → chunk-QQ7PCGDW.mjs.map} +0 -0
@@ -1,4 +1,4 @@
1
- export { m as CreateContractEventFilterParameters, n as CreateContractEventFilterReturnType, V as DeployContractParameters, X as DeployContractReturnType, o as EstimateContractGasParameters, p as EstimateContractGasReturnType, G as GetBytecodeParameters, q as GetBytecodeReturnType, r as GetStorageAtParameters, s as GetStorageAtReturnType, M as MulticallParameters, t as MulticallReturnType, O as OnLogsFn, u as OnLogsParameter, R as ReadContractParameters, v as ReadContractReturnType, w as SimulateContractParameters, x as SimulateContractReturnType, y as WatchContractEventParameters, Y as WriteContractParameters, Z as WriteContractReturnType, z as createContractEventFilter, _ as deployContract, D as estimateContractGas, H as getBytecode, I as getStorageAt, K as multicall, N as readContract, Q as simulateContract, U as watchContractEvent, $ as writeContract } from './createPublicClient-b250a534.js';
1
+ export { m as CreateContractEventFilterParameters, n as CreateContractEventFilterReturnType, V as DeployContractParameters, X as DeployContractReturnType, o as EstimateContractGasParameters, p as EstimateContractGasReturnType, G as GetBytecodeParameters, q as GetBytecodeReturnType, r as GetStorageAtParameters, s as GetStorageAtReturnType, M as MulticallParameters, t as MulticallReturnType, O as OnLogsFn, u as OnLogsParameter, R as ReadContractParameters, v as ReadContractReturnType, w as SimulateContractParameters, x as SimulateContractReturnType, y as WatchContractEventParameters, Y as WriteContractParameters, Z as WriteContractReturnType, z as createContractEventFilter, _ as deployContract, D as estimateContractGas, H as getBytecode, I as getStorageAt, K as multicall, N as readContract, Q as simulateContract, U as watchContractEvent, $ as writeContract } from './createPublicClient-31d44569.js';
2
2
  export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-3e809ff9.js';
3
3
  export { D as DecodeErrorResultParameters, a as DecodeErrorResultReturnType, b as DecodeEventLogParameters, c as DecodeEventLogReturnType, d as DecodeFunctionDataParameters, e as DecodeFunctionResultParameters, f as DecodeFunctionResultReturnType, E as EncodeDeployDataParameters, g as EncodeErrorResultParameters, h as EncodeEventTopicsParameters, i as EncodeFunctionDataParameters, j as EncodeFunctionResultParameters, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from './encodeFunctionResult-1f324375.js';
4
4
  export { a as formatAbiItem, f as formatAbiItemWithArgs } from './formatAbiItem-15e8817d.js';
@@ -6,4 +6,4 @@ import './eip1193-4f4e240c.js';
6
6
  import 'abitype';
7
7
  import './chain-1b53ef88.js';
8
8
  import '@wagmi/chains';
9
- import './createClient-a28317a9.js';
9
+ import './createTransport-e3eba9f7.js';
package/dist/contract.js CHANGED
@@ -23,7 +23,7 @@
23
23
 
24
24
 
25
25
 
26
- var _chunkZ54YSSBJjs = require('./chunk-Z54YSSBJ.js');
26
+ var _chunkTO4LQVPWjs = require('./chunk-TO4LQVPW.js');
27
27
 
28
28
 
29
29
 
@@ -49,5 +49,5 @@ var _chunkZ54YSSBJjs = require('./chunk-Z54YSSBJ.js');
49
49
 
50
50
 
51
51
 
52
- exports.createContractEventFilter = _chunkZ54YSSBJjs.createContractEventFilter; exports.decodeAbiParameters = _chunkZ54YSSBJjs.decodeAbiParameters; exports.decodeErrorResult = _chunkZ54YSSBJjs.decodeErrorResult; exports.decodeEventLog = _chunkZ54YSSBJjs.decodeEventLog; exports.decodeFunctionData = _chunkZ54YSSBJjs.decodeFunctionData; exports.decodeFunctionResult = _chunkZ54YSSBJjs.decodeFunctionResult; exports.deployContract = _chunkZ54YSSBJjs.deployContract; exports.encodeAbiParameters = _chunkZ54YSSBJjs.encodeAbiParameters; exports.encodeDeployData = _chunkZ54YSSBJjs.encodeDeployData; exports.encodeErrorResult = _chunkZ54YSSBJjs.encodeErrorResult; exports.encodeEventTopics = _chunkZ54YSSBJjs.encodeEventTopics; exports.encodeFunctionData = _chunkZ54YSSBJjs.encodeFunctionData; exports.encodeFunctionResult = _chunkZ54YSSBJjs.encodeFunctionResult; exports.estimateContractGas = _chunkZ54YSSBJjs.estimateContractGas; exports.formatAbiItem = _chunkZ54YSSBJjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkZ54YSSBJjs.formatAbiItemWithArgs; exports.getAbiItem = _chunkZ54YSSBJjs.getAbiItem; exports.getBytecode = _chunkZ54YSSBJjs.getBytecode; exports.getStorageAt = _chunkZ54YSSBJjs.getStorageAt; exports.multicall = _chunkZ54YSSBJjs.multicall; exports.readContract = _chunkZ54YSSBJjs.readContract; exports.simulateContract = _chunkZ54YSSBJjs.simulateContract; exports.watchContractEvent = _chunkZ54YSSBJjs.watchContractEvent; exports.writeContract = _chunkZ54YSSBJjs.writeContract;
52
+ exports.createContractEventFilter = _chunkTO4LQVPWjs.createContractEventFilter; exports.decodeAbiParameters = _chunkTO4LQVPWjs.decodeAbiParameters; exports.decodeErrorResult = _chunkTO4LQVPWjs.decodeErrorResult; exports.decodeEventLog = _chunkTO4LQVPWjs.decodeEventLog; exports.decodeFunctionData = _chunkTO4LQVPWjs.decodeFunctionData; exports.decodeFunctionResult = _chunkTO4LQVPWjs.decodeFunctionResult; exports.deployContract = _chunkTO4LQVPWjs.deployContract; exports.encodeAbiParameters = _chunkTO4LQVPWjs.encodeAbiParameters; exports.encodeDeployData = _chunkTO4LQVPWjs.encodeDeployData; exports.encodeErrorResult = _chunkTO4LQVPWjs.encodeErrorResult; exports.encodeEventTopics = _chunkTO4LQVPWjs.encodeEventTopics; exports.encodeFunctionData = _chunkTO4LQVPWjs.encodeFunctionData; exports.encodeFunctionResult = _chunkTO4LQVPWjs.encodeFunctionResult; exports.estimateContractGas = _chunkTO4LQVPWjs.estimateContractGas; exports.formatAbiItem = _chunkTO4LQVPWjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkTO4LQVPWjs.formatAbiItemWithArgs; exports.getAbiItem = _chunkTO4LQVPWjs.getAbiItem; exports.getBytecode = _chunkTO4LQVPWjs.getBytecode; exports.getStorageAt = _chunkTO4LQVPWjs.getStorageAt; exports.multicall = _chunkTO4LQVPWjs.multicall; exports.readContract = _chunkTO4LQVPWjs.readContract; exports.simulateContract = _chunkTO4LQVPWjs.simulateContract; exports.watchContractEvent = _chunkTO4LQVPWjs.watchContractEvent; exports.writeContract = _chunkTO4LQVPWjs.writeContract;
53
53
  //# sourceMappingURL=contract.js.map
package/dist/contract.mjs CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  simulateContract,
24
24
  watchContractEvent,
25
25
  writeContract
26
- } from "./chunk-JG6MI5ZV.mjs";
26
+ } from "./chunk-DZQWSJNJ.mjs";
27
27
  export {
28
28
  createContractEventFilter,
29
29
  decodeAbiParameters,
@@ -1,5 +1,5 @@
1
1
  import { W as WalletPermission, a as WatchAssetParams, P as PublicRequests } from './eip1193-4f4e240c.js';
2
- import { a as Transport, b as ClientConfig, C as Client } from './createClient-a28317a9.js';
2
+ import { a as Transport, b as ClientConfig, C as Client } from './createTransport-e3eba9f7.js';
3
3
  import { Abi, Narrow, Address, AbiEvent, ExtractAbiEvent, TypedData, TypedDataDomain, TypedDataToPrimitiveTypes } from 'abitype';
4
4
  import { C as Chain, H as Hex, h as ExtractConstructorArgsFromAbi, W as ExtractFormatter, a1 as Formatters, a2 as Formatter, X as Formatted, c as Block, R as RpcBlock, O as Transaction, T as TransactionReceipt, z as RpcTransactionReceipt, a3 as TransactionType, D as RpcTransactionRequest, I as TransactionRequest, f as BlockTag, a4 as MergeIntersectionProperties, g as ContractConfig, a5 as GetValue, p as ExtractResultFromAbi, a6 as MaybeAbiEventName, a7 as MaybeExtractEventArgsFromAbi, e as BlockNumber, m as ExtractEventNameFromAbi, a as Hash, F as FeeHistory, L as Log, Y as FormattedTransaction, Z as TransactionFormatter, k as ExtractEventArgsFromAbi, a8 as Prettify } from './chain-1b53ef88.js';
5
5
 
@@ -1,6 +1,32 @@
1
1
  import { R as Requests } from './eip1193-4f4e240c.js';
2
2
  import { C as Chain } from './chain-1b53ef88.js';
3
3
 
4
+ type Client<TTransport extends Transport = Transport, TChain extends Chain = Chain, TRequests extends BaseRpcRequests = Requests> = {
5
+ /** Chain for the client. */
6
+ chain?: TChain;
7
+ /** A key for the client. */
8
+ key: string;
9
+ /** A name for the client. */
10
+ name: string;
11
+ /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */
12
+ pollingInterval: number;
13
+ /** Request function wrapped with friendly error handling */
14
+ request: TRequests['request'];
15
+ /** The RPC transport (http, webSocket, custom, etc) */
16
+ transport: ReturnType<TTransport>['config'] & ReturnType<TTransport>['value'];
17
+ /** The type of client. */
18
+ type: string;
19
+ /** A unique ID for the client. */
20
+ uid: string;
21
+ };
22
+ type ClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain, TRequests extends BaseRpcRequests = Requests> = Partial<Pick<Client<TTransport, TChain, TRequests>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'type'>> & {
23
+ transport: TTransport;
24
+ };
25
+ /**
26
+ * @description Creates a base client with the given transport.
27
+ */
28
+ declare function createClient<TTransport extends Transport, TChain extends Chain, TRequests extends BaseRpcRequests>({ chain, key, name, pollingInterval, transport, type, }: ClientConfig<TTransport, TChain, TRequests>): Client<TTransport, TChain, TRequests>;
29
+
4
30
  type BaseRpcRequests = {
5
31
  request(...args: any): Promise<any>;
6
32
  };
@@ -22,7 +48,9 @@ type TransportConfig<TType extends string = string, TRequests extends BaseRpcReq
22
48
  };
23
49
  type Transport<TType extends string = string, TRpcAttributes = Record<string, any>, TRequests extends BaseRpcRequests['request'] = Requests['request']> = <TChain extends Chain = Chain>({ chain, }: {
24
50
  chain?: TChain;
51
+ pollingInterval?: ClientConfig['pollingInterval'];
25
52
  retryCount?: TransportConfig['retryCount'];
53
+ timeout?: TransportConfig['timeout'];
26
54
  }) => {
27
55
  config: TransportConfig<TType>;
28
56
  request: TRequests;
@@ -33,30 +61,4 @@ type Transport<TType extends string = string, TRpcAttributes = Record<string, an
33
61
  */
34
62
  declare function createTransport<TType extends string = string, TRpcAttributes = any>({ key, name, request, retryCount, retryDelay, timeout, type, }: TransportConfig<TType>, value?: TRpcAttributes): ReturnType<Transport<TType, TRpcAttributes>>;
35
63
 
36
- type Client<TTransport extends Transport = Transport, TChain extends Chain = Chain, TRequests extends BaseRpcRequests = Requests> = {
37
- /** Chain for the client. */
38
- chain?: TChain;
39
- /** A key for the client. */
40
- key: string;
41
- /** A name for the client. */
42
- name: string;
43
- /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */
44
- pollingInterval: number;
45
- /** Request function wrapped with friendly error handling */
46
- request: TRequests['request'];
47
- /** The RPC transport (http, webSocket, custom, etc) */
48
- transport: ReturnType<TTransport>['config'] & ReturnType<TTransport>['value'];
49
- /** The type of client. */
50
- type: string;
51
- /** A unique ID for the client. */
52
- uid: string;
53
- };
54
- type ClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain, TRequests extends BaseRpcRequests = Requests> = Partial<Pick<Client<TTransport, TChain, TRequests>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'type'>> & {
55
- transport: TTransport;
56
- };
57
- /**
58
- * @description Creates a base client with the given transport.
59
- */
60
- declare function createClient<TTransport extends Transport, TChain extends Chain, TRequests extends BaseRpcRequests>({ chain, key, name, pollingInterval, transport, type, }: ClientConfig<TTransport, TChain, TRequests>): Client<TTransport, TChain, TRequests>;
61
-
62
64
  export { BaseRpcRequests as B, Client as C, TransportConfig as T, Transport as a, ClientConfig as b, createClient as c, createTransport as d };
package/dist/ens.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { a0 as GetEnsAddressParameters, a1 as GetEnsNameParameters, a2 as getEnsAddress, a3 as getEnsName } from './createPublicClient-b250a534.js';
1
+ export { a0 as GetEnsAddressParameters, a1 as GetEnsNameParameters, a2 as getEnsAddress, a3 as getEnsName } from './createPublicClient-31d44569.js';
2
2
  export { l as labelhash, n as namehash } from './namehash-afff0feb.js';
3
3
  import './eip1193-4f4e240c.js';
4
4
  import 'abitype';
5
5
  import './chain-1b53ef88.js';
6
6
  import '@wagmi/chains';
7
- import './createClient-a28317a9.js';
7
+ import './createTransport-e3eba9f7.js';
8
8
 
9
9
  /**
10
10
  * @description Normalizes ENS name
package/dist/ens.js CHANGED
@@ -3,8 +3,8 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk66PXETQBjs = require('./chunk-66PXETQB.js');
7
- require('./chunk-Z54YSSBJ.js');
6
+ var _chunkCVKFUFQPjs = require('./chunk-CVKFUFQP.js');
7
+ require('./chunk-TO4LQVPW.js');
8
8
 
9
9
  // src/utils/ens/normalize.ts
10
10
  var _idnauts46hx = require('idna-uts46-hx');
@@ -17,5 +17,5 @@ function normalize(name) {
17
17
 
18
18
 
19
19
 
20
- exports.getEnsAddress = _chunk66PXETQBjs.getEnsAddress; exports.getEnsName = _chunk66PXETQBjs.getEnsName; exports.labelhash = _chunk66PXETQBjs.labelhash; exports.namehash = _chunk66PXETQBjs.namehash; exports.normalize = normalize;
20
+ exports.getEnsAddress = _chunkCVKFUFQPjs.getEnsAddress; exports.getEnsName = _chunkCVKFUFQPjs.getEnsName; exports.labelhash = _chunkCVKFUFQPjs.labelhash; exports.namehash = _chunkCVKFUFQPjs.namehash; exports.normalize = normalize;
21
21
  //# sourceMappingURL=ens.js.map
package/dist/ens.mjs CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  getEnsName,
4
4
  labelhash,
5
5
  namehash
6
- } from "./chunk-HRVPAYH7.mjs";
7
- import "./chunk-JG6MI5ZV.mjs";
6
+ } from "./chunk-QQ7PCGDW.mjs";
7
+ import "./chunk-DZQWSJNJ.mjs";
8
8
 
9
9
  // src/utils/ens/normalize.ts
10
10
  import { toUnicode } from "idna-uts46-hx";
package/dist/ethers.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { A as Account } from './createPublicClient-b250a534.js';
1
+ import { A as Account } from './createPublicClient-31d44569.js';
2
2
  import './eip1193-4f4e240c.js';
3
3
  import 'abitype';
4
4
  import './chain-1b53ef88.js';
5
5
  import '@wagmi/chains';
6
- import './createClient-a28317a9.js';
6
+ import './createTransport-e3eba9f7.js';
7
7
 
8
8
  type BigNumberish = string | number | bigint;
9
9
  type BytesLike = string | Uint8Array;
package/dist/ethers.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkZ54YSSBJjs = require('./chunk-Z54YSSBJ.js');
4
+ var _chunkTO4LQVPWjs = require('./chunk-TO4LQVPW.js');
5
5
 
6
6
  // src/adapters/ethers.ts
7
- var getAccount2 = (wallet) => _chunkZ54YSSBJjs.getAccount.call(void 0, {
7
+ var getAccount2 = (wallet) => _chunkTO4LQVPWjs.getAccount.call(void 0, {
8
8
  address: wallet.address,
9
9
  async signMessage(message) {
10
- return await wallet.signMessage(_chunkZ54YSSBJjs.toBytes.call(void 0, message));
10
+ return await wallet.signMessage(_chunkTO4LQVPWjs.toBytes.call(void 0, message));
11
11
  },
12
12
  async signTransaction(txn) {
13
13
  return await wallet.signTransaction({
package/dist/ethers.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getAccount,
3
3
  toBytes
4
- } from "./chunk-JG6MI5ZV.mjs";
4
+ } from "./chunk-DZQWSJNJ.mjs";
5
5
 
6
6
  // src/adapters/ethers.ts
7
7
  var getAccount2 = (wallet) => getAccount({
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-a28317a9.js';
2
- export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-a28317a9.js';
3
- import { B as BaseError, H as HttpOptions, R as RpcResponse } from './parseGwei-bd0eea6c.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 ToRlpReturnType, 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 concat, z as concatBytes, A as concatHex, D as formatEther, J as formatGwei, K as formatUnits, L as fromBytes, M as fromHex, O as fromRlp, P as getAccount, Q as getAddress, S as getContractAddress, V as getContractError, X as getCreate2Address, Y as getCreateAddress, Z as getEventSelector, _ as getFunctionSelector, $ as hashMessage, a0 as hexToBigInt, a1 as hexToBool, a2 as hexToBytes, a3 as hexToNumber, a4 as hexToString, a5 as isAddress, a6 as isAddressEqual, a7 as isBytes, a8 as isHex, a9 as keccak256, aa as numberToBytes, ab as numberToHex, ac as pad, ad as padBytes, ae as padHex, af as parseEther, ag as parseGwei, ah as parseUnits, ai as recoverAddress, aj as recoverMessageAddress, ak as size, al as slice, am as sliceBytes, an as sliceHex, ao as stringToBytes, ap as stringToHex, aq as stringify, ar as toBytes, as as toHex, at as toRlp, au as trim, av as verifyMessage } from './parseGwei-bd0eea6c.js';
1
+ import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createTransport-e3eba9f7.js';
2
+ export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createTransport-e3eba9f7.js';
3
+ import { B as BaseError, H as HttpOptions, R as RpcResponse } from './parseGwei-361e8a12.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 ToRlpReturnType, 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 concat, z as concatBytes, A as concatHex, D as formatEther, J as formatGwei, K as formatUnits, L as fromBytes, M as fromHex, O as fromRlp, P as getAccount, Q as getAddress, S as getContractAddress, V as getContractError, X as getCreate2Address, Y as getCreateAddress, Z as getEventSelector, _ as getFunctionSelector, $ as hashMessage, a0 as hexToBigInt, a1 as hexToBool, a2 as hexToBytes, a3 as hexToNumber, a4 as hexToString, a5 as isAddress, a6 as isAddressEqual, a7 as isBytes, a8 as isHex, a9 as keccak256, aa as numberToBytes, ab as numberToHex, ac as pad, ad as padBytes, ae as padHex, af as parseEther, ag as parseGwei, ah as parseUnits, ai as recoverAddress, aj as recoverMessageAddress, ak as size, al as slice, am as sliceBytes, an as sliceHex, ao as stringToBytes, ap as stringToHex, aq as stringify, ar as toBytes, as as toHex, at as toRlp, au as trim, av as verifyMessage } from './parseGwei-361e8a12.js';
5
5
  import WebSocket from 'isomorphic-ws';
6
6
  import { H as Hex, A as AbiItem, a as Hash, C as Chain, B as ByteArray } from './chain-1b53ef88.js';
7
7
  export { A as AbiItem, b as AccessList, c as Block, d as BlockIdentifier, e as BlockNumber, f as BlockTag, B as ByteArray, C as Chain, g as ContractConfig, E as ExtractArgsFromAbi, h as ExtractConstructorArgsFromAbi, i as ExtractErrorArgsFromAbi, j as ExtractErrorNameFromAbi, k as ExtractEventArgsFromAbi, l as ExtractEventArgsFromTopics, m as ExtractEventNameFromAbi, W as ExtractFormatter, n as ExtractFunctionNameFromAbi, o as ExtractNameFromAbi, p as ExtractResultFromAbi, F as FeeHistory, q as FeeValues, r as FeeValuesEIP1559, s as FeeValuesLegacy, X as Formatted, Y as FormattedTransaction, a as Hash, H as Hex, L as Log, R as RpcBlock, t as RpcBlockIdentifier, u as RpcBlockNumber, v as RpcFeeHistory, w as RpcFeeValues, x as RpcLog, y as RpcTransaction, z as RpcTransactionReceipt, D as RpcTransactionRequest, G as RpcUncle, O as Transaction, P as TransactionBase, Q as TransactionEIP1559, S as TransactionEIP2930, Z as TransactionFormatter, U as TransactionLegacy, T as TransactionReceipt, I as TransactionRequest, J as TransactionRequestBase, K as TransactionRequestEIP1559, M as TransactionRequestEIP2930, N as TransactionRequestLegacy, V as Uncle, _ as defineTransaction, $ as formatTransaction, a0 as transactionType } from './chain-1b53ef88.js';
8
- export { A as Account, B as BlockFormatter, F as FormattedBlock, e as FormattedTransactionReceipt, f as FormattedTransactionRequest, J as JsonRpcAccount, L as LocalAccount, P as PublicClient, a as PublicClientConfig, T as TransactionReceiptFormatter, g as TransactionRequestFormatter, W as WalletClient, b as WalletClientConfig, c as createPublicClient, d as createWalletClient, h as defineBlock, i as defineTransactionReceipt, j as defineTransactionRequest, k as formatBlock, l as formatTransactionRequest } from './createPublicClient-b250a534.js';
9
- export { T as TestClient, a as TestClientConfig, c as createTestClient } from './test-2bd23d7e.js';
8
+ export { A as Account, B as BlockFormatter, F as FormattedBlock, e as FormattedTransactionReceipt, f as FormattedTransactionRequest, J as JsonRpcAccount, L as LocalAccount, P as PublicClient, a as PublicClientConfig, T as TransactionReceiptFormatter, g as TransactionRequestFormatter, W as WalletClient, b as WalletClientConfig, c as createPublicClient, d as createWalletClient, h as defineBlock, i as defineTransactionReceipt, j as defineTransactionRequest, k as formatBlock, l as formatTransactionRequest } from './createPublicClient-31d44569.js';
9
+ export { T as TestClient, a as TestClientConfig, c as createTestClient } from './test-67630299.js';
10
10
  import { AbiParameter } from 'abitype';
11
11
  export { Address, ParseAbi, ParseAbiItem, ParseAbiParameter, ParseAbiParameters, parseAbi, parseAbiItem, parseAbiParameter, parseAbiParameters } from 'abitype';
12
12
  export { l as labelhash, n as namehash } from './namehash-afff0feb.js';
@@ -375,11 +375,45 @@ type CustomTransport = Transport<'custom', EthereumProvider['request']>;
375
375
  */
376
376
  declare function custom<TProvider extends EthereumProvider>(provider: TProvider, config?: CustomTransportConfig): CustomTransport;
377
377
 
378
+ type RankOptions = {
379
+ /**
380
+ * The polling interval (in ms) at which the ranker should ping the RPC URL.
381
+ * @default client.pollingInterval
382
+ */
383
+ interval?: number;
384
+ /**
385
+ * The number of previous samples to perform ranking on.
386
+ * @default 10
387
+ */
388
+ sampleCount?: number;
389
+ /**
390
+ * Timeout when sampling transports.
391
+ * @default 1_000
392
+ */
393
+ timeout?: number;
394
+ /**
395
+ * Weights to apply to the scores. Weight values are proportional.
396
+ */
397
+ weights?: {
398
+ /**
399
+ * The weight to apply to the latency score.
400
+ * @default 0.3
401
+ */
402
+ latency?: number;
403
+ /**
404
+ * The weight to apply to the stability score.
405
+ * @default 0.7
406
+ */
407
+ stability?: number;
408
+ };
409
+ };
378
410
  type FallbackTransportConfig = {
379
411
  /** The key of the Fallback transport. */
380
412
  key?: TransportConfig['key'];
381
413
  /** The name of the Fallback transport. */
382
414
  name?: TransportConfig['name'];
415
+ /** Toggle to enable ranking, or rank options. */
416
+ rank?: boolean | RankOptions;
383
417
  /** The max number of times to retry. */
384
418
  retryCount?: TransportConfig['retryCount'];
385
419
  /** The base delay (in ms) between retries. */
@@ -388,7 +422,7 @@ type FallbackTransportConfig = {
388
422
  type FallbackTransport = Transport<'fallback', {
389
423
  transports: Transport[];
390
424
  }>;
391
- declare function fallback(transports: Transport[], config?: FallbackTransportConfig): FallbackTransport;
425
+ declare function fallback(transports_: Transport[], config?: FallbackTransportConfig): FallbackTransport;
392
426
 
393
427
  type HttpTransportConfig = {
394
428
  /**