viem 0.1.23 → 0.1.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.
Files changed (45) 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-HRVPAYH7.mjs → chunk-4E27RP3Y.mjs} +2 -2
  6. package/dist/{chunk-JG6MI5ZV.mjs → chunk-FTVVJS5Q.mjs} +4 -3
  7. package/dist/chunk-FTVVJS5Q.mjs.map +1 -0
  8. package/dist/{chunk-Z54YSSBJ.js → chunk-G5HJC7PY.js} +5 -4
  9. package/dist/chunk-G5HJC7PY.js.map +1 -0
  10. package/dist/{chunk-66PXETQB.js → chunk-JBAQOWGC.js} +19 -19
  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-JG6MI5ZV.mjs.map +0 -1
  43. package/dist/chunk-Z54YSSBJ.js.map +0 -1
  44. /package/dist/{chunk-HRVPAYH7.mjs.map → chunk-4E27RP3Y.mjs.map} +0 -0
  45. /package/dist/{chunk-66PXETQB.js.map → chunk-JBAQOWGC.js.map} +0 -0
@@ -11,27 +11,27 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkZ54YSSBJjs = require('./chunk-Z54YSSBJ.js');
14
+ var _chunkG5HJC7PYjs = require('./chunk-G5HJC7PY.js');
15
15
 
16
16
  // src/utils/ens/labelhash.ts
17
17
  function labelhash(label) {
18
18
  let result = new Uint8Array(32).fill(0);
19
19
  if (!label)
20
- return _chunkZ54YSSBJjs.bytesToHex.call(void 0, result);
21
- return _chunkZ54YSSBJjs.keccak256.call(void 0, _chunkZ54YSSBJjs.stringToBytes.call(void 0, label));
20
+ return _chunkG5HJC7PYjs.bytesToHex.call(void 0, result);
21
+ return _chunkG5HJC7PYjs.keccak256.call(void 0, _chunkG5HJC7PYjs.stringToBytes.call(void 0, label));
22
22
  }
23
23
 
24
24
  // src/utils/ens/namehash.ts
25
25
  function namehash(name) {
26
26
  let result = new Uint8Array(32).fill(0);
27
27
  if (!name)
28
- return _chunkZ54YSSBJjs.bytesToHex.call(void 0, result);
28
+ return _chunkG5HJC7PYjs.bytesToHex.call(void 0, result);
29
29
  const labels = name.split(".");
30
30
  for (let i = labels.length - 1; i >= 0; i -= 1) {
31
- const hashed = _chunkZ54YSSBJjs.keccak256.call(void 0, _chunkZ54YSSBJjs.stringToBytes.call(void 0, labels[i]), "bytes");
32
- result = _chunkZ54YSSBJjs.keccak256.call(void 0, _chunkZ54YSSBJjs.concat.call(void 0, [result, hashed]), "bytes");
31
+ const hashed = _chunkG5HJC7PYjs.keccak256.call(void 0, _chunkG5HJC7PYjs.stringToBytes.call(void 0, labels[i]), "bytes");
32
+ result = _chunkG5HJC7PYjs.keccak256.call(void 0, _chunkG5HJC7PYjs.concat.call(void 0, [result, hashed]), "bytes");
33
33
  }
34
- return _chunkZ54YSSBJjs.bytesToHex.call(void 0, result);
34
+ return _chunkG5HJC7PYjs.bytesToHex.call(void 0, result);
35
35
  }
36
36
 
37
37
  // src/utils/ens/packetToBytes.ts
@@ -39,7 +39,7 @@ function packetToBytes(packet) {
39
39
  function length(value2) {
40
40
  if (value2 === "." || value2 === "..")
41
41
  return 1;
42
- return _chunkZ54YSSBJjs.toBytes.call(void 0, value2.replace(/^\.|\.$/gm, "")).length + 2;
42
+ return _chunkG5HJC7PYjs.toBytes.call(void 0, value2.replace(/^\.|\.$/gm, "")).length + 2;
43
43
  }
44
44
  const bytes = new Uint8Array(length(packet));
45
45
  const value = packet.replace(/^\.|\.$/gm, "");
@@ -48,7 +48,7 @@ function packetToBytes(packet) {
48
48
  let offset = 0;
49
49
  const list = value.split(".");
50
50
  for (let i = 0; i < list.length; i++) {
51
- const encoded = _chunkZ54YSSBJjs.toBytes.call(void 0, list[i]);
51
+ const encoded = _chunkG5HJC7PYjs.toBytes.call(void 0, list[i]);
52
52
  bytes[offset] = encoded.length;
53
53
  bytes.set(encoded, offset + 1);
54
54
  offset += encoded.length + 1;
@@ -69,13 +69,13 @@ async function getEnsAddress(client, {
69
69
  throw new Error(
70
70
  "client chain not configured. universalResolverAddress is required."
71
71
  );
72
- universalResolverAddress = _chunkZ54YSSBJjs.getChainContractAddress.call(void 0, {
72
+ universalResolverAddress = _chunkG5HJC7PYjs.getChainContractAddress.call(void 0, {
73
73
  blockNumber,
74
74
  chain: client.chain,
75
75
  contract: "ensUniversalResolver"
76
76
  });
77
77
  }
78
- const res = await _chunkZ54YSSBJjs.readContract.call(void 0, client, {
78
+ const res = await _chunkG5HJC7PYjs.readContract.call(void 0, client, {
79
79
  address: universalResolverAddress,
80
80
  abi: [
81
81
  {
@@ -94,8 +94,8 @@ async function getEnsAddress(client, {
94
94
  ],
95
95
  functionName: "resolve",
96
96
  args: [
97
- _chunkZ54YSSBJjs.toHex.call(void 0, packetToBytes(name)),
98
- _chunkZ54YSSBJjs.encodeFunctionData.call(void 0, {
97
+ _chunkG5HJC7PYjs.toHex.call(void 0, packetToBytes(name)),
98
+ _chunkG5HJC7PYjs.encodeFunctionData.call(void 0, {
99
99
  abi: [
100
100
  {
101
101
  name: "addr",
@@ -112,7 +112,7 @@ async function getEnsAddress(client, {
112
112
  blockNumber,
113
113
  blockTag
114
114
  });
115
- return _chunkZ54YSSBJjs.decodeFunctionResult.call(void 0, {
115
+ return _chunkG5HJC7PYjs.decodeFunctionResult.call(void 0, {
116
116
  abi: [
117
117
  {
118
118
  name: "addr",
@@ -140,7 +140,7 @@ async function getEnsName(client, {
140
140
  throw new Error(
141
141
  "client chain not configured. universalResolverAddress is required."
142
142
  );
143
- universalResolverAddress = _chunkZ54YSSBJjs.getChainContractAddress.call(void 0, {
143
+ universalResolverAddress = _chunkG5HJC7PYjs.getChainContractAddress.call(void 0, {
144
144
  blockNumber,
145
145
  chain: client.chain,
146
146
  contract: "ensUniversalResolver"
@@ -148,7 +148,7 @@ async function getEnsName(client, {
148
148
  }
149
149
  const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse`;
150
150
  try {
151
- const res = await _chunkZ54YSSBJjs.readContract.call(void 0, client, {
151
+ const res = await _chunkG5HJC7PYjs.readContract.call(void 0, client, {
152
152
  address: universalResolverAddress,
153
153
  abi: [
154
154
  {
@@ -165,13 +165,13 @@ async function getEnsName(client, {
165
165
  }
166
166
  ],
167
167
  functionName: "reverse",
168
- args: [_chunkZ54YSSBJjs.toHex.call(void 0, packetToBytes(reverseNode))],
168
+ args: [_chunkG5HJC7PYjs.toHex.call(void 0, packetToBytes(reverseNode))],
169
169
  blockNumber,
170
170
  blockTag
171
171
  });
172
172
  return res[0];
173
173
  } catch (error) {
174
- if (error instanceof _chunkZ54YSSBJjs.ContractFunctionExecutionError && error.cause.reason === _chunkZ54YSSBJjs.panicReasons[50])
174
+ if (error instanceof _chunkG5HJC7PYjs.ContractFunctionExecutionError && error.cause.reason === _chunkG5HJC7PYjs.panicReasons[50])
175
175
  return null;
176
176
  throw error;
177
177
  }
@@ -183,4 +183,4 @@ async function getEnsName(client, {
183
183
 
184
184
 
185
185
  exports.labelhash = labelhash; exports.namehash = namehash; exports.getEnsAddress = getEnsAddress; exports.getEnsName = getEnsName;
186
- //# sourceMappingURL=chunk-66PXETQB.js.map
186
+ //# sourceMappingURL=chunk-JBAQOWGC.js.map
@@ -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 _chunkG5HJC7PYjs = require('./chunk-G5HJC7PY.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 = _chunkG5HJC7PYjs.createContractEventFilter; exports.decodeAbiParameters = _chunkG5HJC7PYjs.decodeAbiParameters; exports.decodeErrorResult = _chunkG5HJC7PYjs.decodeErrorResult; exports.decodeEventLog = _chunkG5HJC7PYjs.decodeEventLog; exports.decodeFunctionData = _chunkG5HJC7PYjs.decodeFunctionData; exports.decodeFunctionResult = _chunkG5HJC7PYjs.decodeFunctionResult; exports.deployContract = _chunkG5HJC7PYjs.deployContract; exports.encodeAbiParameters = _chunkG5HJC7PYjs.encodeAbiParameters; exports.encodeDeployData = _chunkG5HJC7PYjs.encodeDeployData; exports.encodeErrorResult = _chunkG5HJC7PYjs.encodeErrorResult; exports.encodeEventTopics = _chunkG5HJC7PYjs.encodeEventTopics; exports.encodeFunctionData = _chunkG5HJC7PYjs.encodeFunctionData; exports.encodeFunctionResult = _chunkG5HJC7PYjs.encodeFunctionResult; exports.estimateContractGas = _chunkG5HJC7PYjs.estimateContractGas; exports.formatAbiItem = _chunkG5HJC7PYjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkG5HJC7PYjs.formatAbiItemWithArgs; exports.getAbiItem = _chunkG5HJC7PYjs.getAbiItem; exports.getBytecode = _chunkG5HJC7PYjs.getBytecode; exports.getStorageAt = _chunkG5HJC7PYjs.getStorageAt; exports.multicall = _chunkG5HJC7PYjs.multicall; exports.readContract = _chunkG5HJC7PYjs.readContract; exports.simulateContract = _chunkG5HJC7PYjs.simulateContract; exports.watchContractEvent = _chunkG5HJC7PYjs.watchContractEvent; exports.writeContract = _chunkG5HJC7PYjs.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-FTVVJS5Q.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 _chunkJBAQOWGCjs = require('./chunk-JBAQOWGC.js');
7
+ require('./chunk-G5HJC7PY.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 = _chunkJBAQOWGCjs.getEnsAddress; exports.getEnsName = _chunkJBAQOWGCjs.getEnsName; exports.labelhash = _chunkJBAQOWGCjs.labelhash; exports.namehash = _chunkJBAQOWGCjs.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-4E27RP3Y.mjs";
7
+ import "./chunk-FTVVJS5Q.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 _chunkG5HJC7PYjs = require('./chunk-G5HJC7PY.js');
5
5
 
6
6
  // src/adapters/ethers.ts
7
- var getAccount2 = (wallet) => _chunkZ54YSSBJjs.getAccount.call(void 0, {
7
+ var getAccount2 = (wallet) => _chunkG5HJC7PYjs.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(_chunkG5HJC7PYjs.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-FTVVJS5Q.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
  /**