viem 0.0.1-alpha.0 → 0.0.1-alpha.1

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.
@@ -36,7 +36,7 @@ type Client<TTransport extends Transport = Transport, TChain extends Chain = Cha
36
36
  pollingInterval: number;
37
37
  /** Request function wrapped with friendly error handling */
38
38
  request: TRequests['request'];
39
- /** The RPC transport (http, webSocket, ethereumProvider, etc) */
39
+ /** The RPC transport (http, webSocket, custom, etc) */
40
40
  transport: ReturnType<TTransport>['config'] & ReturnType<TTransport>['value'];
41
41
  /** The type of client. */
42
42
  type: string;
@@ -96,9 +96,9 @@ type TestClient<TTransport extends Transport = Transport, TChain extends Chain =
96
96
  * `evm_mine`, etc).
97
97
  *
98
98
  * @example
99
+ * import { createTestClient, http } from 'viem'
99
100
  * import { local } from 'viem/chains'
100
- * import { createTestClient, http } from 'viem/clients'
101
- * const client = createTestClient(http({ chain: local }), { mode: 'anvil' })
101
+ * const client = createTestClient({ chain: local, mode: 'anvil', transport: http() })
102
102
  */
103
103
  declare function createTestClient<TTransport extends Transport, TChain extends Chain, TMode extends TestClientModes>({ chain, key, name, mode, pollingInterval, transport, }: TestClientConfig<TTransport, TChain, TMode>): TestClient<TTransport, TChain, TMode>;
104
104
 
@@ -120,9 +120,9 @@ type WalletClient<TTransport extends Transport = Transport, TChain extends Chain
120
120
  * (ie. `eth_sendTransaction`, `eth_requestAccounts`, etc).
121
121
  *
122
122
  * @example
123
- * import { createWalletClient, ethereumProvider } from 'viem/clients'
123
+ * import { createWalletClient, custom } from 'viem'
124
124
  * const client = createWalletClient(
125
- * ethereumProvider({ provider: window.ethereum })
125
+ * custom(window.ethereum)
126
126
  * )
127
127
  */
128
128
  declare function createWalletClient<TTransport extends Transport, TChain extends Chain>({ transport, key, name, pollingInterval, }: WalletClientConfig<TTransport, TChain>): WalletClient<TTransport, TChain>;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as GetGasPriceResponse, q as GetPermissionsResponse, r as GetTransactionArgs, s as GetTransactionConfirmationsArgs, t as GetTransactionConfirmationsResponse, u as GetTransactionCountArgs, v as GetTransactionCountResponse, x as GetTransactionReceiptArgs, y as GetTransactionReceiptResponse, w as GetTransactionResponse, I as ImpersonateAccountArgs, z as IncreaseTimeArgs, M as MineArgs, O as OnBlock, A as OnBlockNumber, B as OnBlockNumberResponse, F as OnBlockResponse, H as OnTransactions, J as OnTransactionsResponse, K as RequestPermissionsResponse, R as ResetArgs, L as RevertArgs, S as SendTransactionArgs, N as SendTransactionResponse, P as SendUnsignedTransactionArgs, Q as SendUnsignedTransactionResponse, T as SetBalanceArgs, U as SetBlockGasLimitArgs, Z as SetBlockTimestampIntervalArgs, V as SetCodeArgs, W as SetCoinbaseArgs, X as SetIntervalMiningArgs, Y as SetMinGasPriceArgs, $ as SetNextBlockBaseFeePerGasArgs, _ as SetNextBlockTimestampArgs, a0 as SetNonceArgs, a1 as SetStorageAtArgs, a2 as SignMessageArgs, a3 as SignMessageResponse, a4 as StopImpersonatingAccountArgs, a5 as SwitchChainArgs, a6 as UninstallFilterArgs, a7 as UninstallFilterResponse, a8 as WaitForTransactionReceiptArgs, a9 as WaitForTransactionReceiptResponse, aa as WatchAssetArgs, ab as WatchAssetResponse, ac as WatchBlockNumberArgs, ad as WatchBlocksArgs, ae as WatchPendingTransactionsArgs, af as addChain, ag as call, ah as createBlockFilter, ai as createPendingTransactionFilter, ak as dropTransaction, aj as estimateGas, al as getAutomine, am as getBalance, an as getBlock, ao as getBlockNumber, ap as getBlockTransactionCount, aq as getChainId, ar as getFeeHistory, as as getGasPrice, at as getPermissions, au as getTransaction, av as getTransactionConfirmations, aw as getTransactionCount, ax as getTransactionReceipt, ay as getTxpoolContent, az as getTxpoolStatus, aA as impersonateAccount, aB as increaseTime, aC as inspectTxpool, aD as mine, aE as removeBlockTimestampInterval, aG as requestAccounts, aH as requestPermissions, aF as reset, aI as revert, aJ as sendTransaction, aK as sendUnsignedTransaction, aL as setAutomine, aM as setBalance, aN as setBlockGasLimit, aO as setBlockTimestampInterval, aP as setCode, aQ as setCoinbase, aR as setIntervalMining, aS as setLoggingEnabled, aT as setMinGasPrice, aU as setNextBlockBaseFeePerGas, aV as setNextBlockTimestamp, aW as setNonce, aX as setStorageAt, aY as signMessage, aZ as snapshot, a_ as stopImpersonatingAccount, a$ as switchChain, b0 as uninstallFilter, b1 as waitForTransactionReceipt, b2 as watchAsset, b3 as watchBlockNumber, b4 as watchBlocks, b5 as watchPendingTransactions } from './watchAsset-bb30848d.js';
2
- export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from './createWalletClient-c40fef16.js';
3
- export { E as EthereumProviderTransport, a as EthereumProviderTransportConfig, H as HttpTransport, b as HttpTransportConfig, U as UrlRequiredError, W as WebSocketTransport, c as WebSocketTransportConfig, e as ethereumProvider, h as http, w as webSocket } from './webSocket-14584a7e.js';
1
+ export { C as CallArgs, a as CallResponse, b as CreateBlockFilterResponse, c as CreatePendingTransactionFilterResponse, D as DropTransactionArgs, E as EstimateGasArgs, d as EstimateGasResponse, G as GetBalanceArgs, e as GetBalanceResponse, f as GetBlockArgs, g as GetBlockNumberArgs, h as GetBlockNumberResponse, i as GetBlockResponse, j as GetBlockTransactionCountArgs, k as GetBlockTransactionCountResponse, l as GetFeeHistoryArgs, m as GetFeeHistoryResponse, n as GetFilterChangesArgs, o as GetFilterChangesResponse, p as GetFilterLogsArgs, q as GetFilterLogsResponse, r as GetGasPriceResponse, s as GetPermissionsResponse, t as GetTransactionArgs, u as GetTransactionConfirmationsArgs, v as GetTransactionConfirmationsResponse, w as GetTransactionCountArgs, x as GetTransactionCountResponse, z as GetTransactionReceiptArgs, A as GetTransactionReceiptResponse, y as GetTransactionResponse, I as ImpersonateAccountArgs, B as IncreaseTimeArgs, M as MineArgs, O as OnBlock, F as OnBlockNumber, H as OnBlockNumberResponse, J as OnBlockResponse, K as OnTransactions, L as OnTransactionsResponse, N as RequestPermissionsResponse, R as ResetArgs, P as RevertArgs, S as SendTransactionArgs, Q as SendTransactionResponse, T as SendUnsignedTransactionArgs, U as SendUnsignedTransactionResponse, V as SetBalanceArgs, W as SetBlockGasLimitArgs, $ as SetBlockTimestampIntervalArgs, X as SetCodeArgs, Y as SetCoinbaseArgs, Z as SetIntervalMiningArgs, _ as SetMinGasPriceArgs, a1 as SetNextBlockBaseFeePerGasArgs, a0 as SetNextBlockTimestampArgs, a2 as SetNonceArgs, a3 as SetStorageAtArgs, a4 as SignMessageArgs, a5 as SignMessageResponse, a6 as StopImpersonatingAccountArgs, a7 as SwitchChainArgs, a8 as UninstallFilterArgs, a9 as UninstallFilterResponse, aa as WaitForTransactionReceiptArgs, ab as WaitForTransactionReceiptResponse, ac as WatchAssetArgs, ad as WatchAssetResponse, ae as WatchBlockNumberArgs, af as WatchBlocksArgs, ag as WatchPendingTransactionsArgs, ah as addChain, ai as call, aj as createBlockFilter, ak as createPendingTransactionFilter, am as dropTransaction, al as estimateGas, an as getAccounts, ao as getAutomine, ap as getBalance, aq as getBlock, ar as getBlockNumber, as as getBlockTransactionCount, at as getChainId, au as getFeeHistory, av as getFilterChanges, aw as getFilterLogs, ax as getGasPrice, ay as getPermissions, az as getTransaction, aA as getTransactionConfirmations, aB as getTransactionCount, aC as getTransactionReceipt, aD as getTxpoolContent, aE as getTxpoolStatus, aF as impersonateAccount, aG as increaseTime, aH as inspectTxpool, aI as mine, aJ as removeBlockTimestampInterval, aL as requestAccounts, aM as requestPermissions, aK as reset, aN as revert, aO as sendTransaction, aP as sendUnsignedTransaction, aQ as setAutomine, aR as setBalance, aS as setBlockGasLimit, aT as setBlockTimestampInterval, aU as setCode, aV as setCoinbase, aW as setIntervalMining, aX as setLoggingEnabled, aY as setMinGasPrice, aZ as setNextBlockBaseFeePerGas, a_ as setNextBlockTimestamp, a$ as setNonce, b0 as setStorageAt, b1 as signMessage, b2 as snapshot, b3 as stopImpersonatingAccount, b4 as switchChain, b5 as uninstallFilter, b6 as waitForTransactionReceipt, b7 as watchAsset, b8 as watchBlockNumber, b9 as watchBlocks, ba as watchPendingTransactions } from './watchAsset-04ab8db5.js';
2
+ export { C as Client, a as ClientConfig, P as PublicClient, b as PublicClientConfig, T as TestClient, c as TestClientConfig, d as Transport, e as TransportConfig, W as WalletClient, f as WalletClientConfig, g as createClient, h as createPublicClient, i as createTestClient, j as createTransport, k as createWalletClient } from './createWalletClient-915223f3.js';
3
+ export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, U as UrlRequiredError, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-c6e0d26f.js';
4
4
  export { a as AccessList, A as Address, B as Block, b as BlockIdentifier, c as BlockNumber, d as BlockTag, f as ByteArray, F as FeeHistory, h as FeeValues, i as FeeValuesEIP1559, j as FeeValuesLegacy, k 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, u as RpcUncle, D as Transaction, E as TransactionBase, G as TransactionEIP1559, I as TransactionEIP2930, J as TransactionLegacy, T as TransactionReceipt, v as TransactionRequest, x as TransactionRequestBase, y as TransactionRequestEIP1559, z as TransactionRequestEIP2930, C as TransactionRequestLegacy, U as Uncle, e as etherUnits, g as gweiUnits, t as transactionType, w as weiUnits } from './rpc-655c0ba4.js';
5
- export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, I as InternalRpcError, c as InvalidInputRpcError, d as InvalidParamsRpcError, e as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, f as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, g as ResourceUnavailableRpcError, h as RpcRequestError, T as TransactionRejectedRpcError, k as boolToBytes, l as boolToHex, m as bytesToBigint, n as bytesToBool, i as bytesToHex, o as bytesToNumber, j as bytesToString, p as decodeBytes, q as decodeHex, r as decodeRlp, s as encodeBytes, t as encodeHex, u as encodeRlp, B as formatEther, $ as formatGwei, a0 as formatUnit, v as getAddress, w as getContractAddress, y as getCreate2Address, x as getCreateAddress, z as getEventSignature, A as getFunctionSignature, K as hexToBigInt, N as hexToBool, O as hexToBytes, a1 as hexToNumber, Q as hexToString, C as isAddress, D as isAddressEqual, F as isBytes, H as isHex, S as keccak256, U as numberToBytes, a2 as numberToHex, V as pad, W as padBytes, X as padHex, Y as parseEther, Z as parseGwei, _ as parseUnit, a3 as size, a4 as slice, a5 as sliceBytes, a6 as sliceHex, a7 as stringToBytes, a8 as stringToHex, a9 as trim } from './parseGwei-a7d0bcb2.js';
5
+ export { A as AbiDecodingDataSizeInvalidError, a as AbiEncodingArrayLengthMismatchError, b as AbiEncodingLengthMismatchError, E as EncodeRlpResponse, G as GetContractAddressOptions, d as GetCreate2AddressOptions, c as GetCreateAddressOptions, g as InternalRpcError, I as InvalidAbiDecodingTypeError, e as InvalidAbiEncodingTypeError, f as InvalidArrayError, h as InvalidInputRpcError, i as InvalidParamsRpcError, j as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, k as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, l as ResourceUnavailableRpcError, m as RpcRequestError, T as TransactionRejectedRpcError, p as boolToBytes, q as boolToHex, r as bytesToBigint, s as bytesToBool, n as bytesToHex, t as bytesToNumber, o as bytesToString, u as decodeAbi, v as decodeBytes, w as decodeHex, x as decodeRlp, y as encodeAbi, z as encodeBytes, B as encodeHex, C as encodeRlp, Q as formatEther, a7 as formatGwei, a8 as formatUnit, D as getAddress, F as getContractAddress, K as getCreate2Address, H as getCreateAddress, N as getEventSignature, O as getFunctionSignature, X as hexToBigInt, Y as hexToBool, Z as hexToBytes, a9 as hexToNumber, _ as hexToString, S as isAddress, U as isAddressEqual, V as isBytes, W as isHex, $ as keccak256, a0 as numberToBytes, aa as numberToHex, a1 as pad, a2 as padBytes, a3 as padHex, a4 as parseEther, a5 as parseGwei, a6 as parseUnit, ab as size, ac as slice, ad as sliceBytes, ae as sliceHex, af as stringToBytes, ag as stringToHex, ah as trim } from './parseGwei-bbc055e4.js';
6
6
  export { B as BaseError } from './BaseError-7688f84e.js';
7
7
  export { F as FormattedBlock, a as FormattedTransaction, b as FormattedTransactionRequest, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from './transactionRequest-ade896ac.js';
8
8
  export { H as HttpRequestError, R as RpcError, T as TimeoutError } from './rpc-3c0e3985.js';
9
9
  import './chains.js';
10
10
  import '@wagmi/chains';
11
11
  import './eip1193-8f7c22ce.js';
12
+ import 'abitype';
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  createPendingTransactionFilter,
6
6
  dropTransaction,
7
7
  estimateGas,
8
+ getAccounts,
8
9
  getAutomine,
9
10
  getBalance,
10
11
  getBlock,
@@ -12,6 +13,8 @@ import {
12
13
  getBlockTransactionCount,
13
14
  getChainId,
14
15
  getFeeHistory,
16
+ getFilterChanges,
17
+ getFilterLogs,
15
18
  getGasPrice,
16
19
  getPermissions,
17
20
  getTransaction,
@@ -54,7 +57,7 @@ import {
54
57
  watchBlockNumber,
55
58
  watchBlocks,
56
59
  watchPendingTransactions
57
- } from "./chunk-JSYJDK4W.js";
60
+ } from "./chunk-LLYFXUSV.js";
58
61
  import {
59
62
  UrlRequiredError,
60
63
  createClient,
@@ -62,10 +65,11 @@ import {
62
65
  createTestClient,
63
66
  createTransport,
64
67
  createWalletClient,
65
- ethereumProvider,
68
+ custom,
69
+ fallback,
66
70
  http,
67
71
  webSocket
68
- } from "./chunk-OPR6LKYX.js";
72
+ } from "./chunk-OQTFTQTO.js";
69
73
  import {
70
74
  BaseError,
71
75
  HttpRequestError,
@@ -91,9 +95,11 @@ import {
91
95
  bytesToHex,
92
96
  bytesToNumber,
93
97
  bytesToString,
98
+ decodeAbi,
94
99
  decodeBytes,
95
100
  decodeHex,
96
101
  decodeRlp,
102
+ encodeAbi,
97
103
  encodeBytes,
98
104
  encodeHex,
99
105
  encodeRlp,
@@ -138,7 +144,7 @@ import {
138
144
  transactionType,
139
145
  trim,
140
146
  weiUnits
141
- } from "./chunk-GI67STNV.js";
147
+ } from "./chunk-Z6LRV6XI.js";
142
148
  export {
143
149
  BaseError,
144
150
  HttpRequestError,
@@ -174,22 +180,26 @@ export {
174
180
  createTestClient,
175
181
  createTransport,
176
182
  createWalletClient,
183
+ custom,
184
+ decodeAbi,
177
185
  decodeBytes,
178
186
  decodeHex,
179
187
  decodeRlp,
180
188
  dropTransaction,
189
+ encodeAbi,
181
190
  encodeBytes,
182
191
  encodeHex,
183
192
  encodeRlp,
184
193
  estimateGas,
185
194
  etherUnits,
186
- ethereumProvider,
195
+ fallback,
187
196
  formatBlock,
188
197
  formatEther,
189
198
  formatGwei,
190
199
  formatTransaction,
191
200
  formatTransactionRequest,
192
201
  formatUnit,
202
+ getAccounts,
193
203
  getAddress,
194
204
  getAutomine,
195
205
  getBalance,
@@ -202,6 +212,8 @@ export {
202
212
  getCreateAddress,
203
213
  getEventSignature,
204
214
  getFeeHistory,
215
+ getFilterChanges,
216
+ getFilterLogs,
205
217
  getFunctionSignature,
206
218
  getGasPrice,
207
219
  getPermissions,
@@ -1,7 +1,52 @@
1
- import { A as Address, f as ByteArray, H as Hex } from './rpc-655c0ba4.js';
1
+ import { AbiParameter, AbiParametersToPrimitiveTypes } from 'abitype';
2
+ import { H as Hex, A as Address, f as ByteArray } from './rpc-655c0ba4.js';
2
3
  import { B as BaseError } from './BaseError-7688f84e.js';
3
4
  import { R as RpcError } from './rpc-3c0e3985.js';
4
5
 
6
+ declare function decodeAbi<TParams extends readonly AbiParameter[]>({ data, params, }: {
7
+ data: Hex;
8
+ params: TParams;
9
+ }): AbiParametersToPrimitiveTypes<TParams>;
10
+ declare class AbiDecodingDataSizeInvalidError extends BaseError {
11
+ name: string;
12
+ constructor(size: number);
13
+ }
14
+ declare class InvalidAbiDecodingTypeError extends BaseError {
15
+ name: string;
16
+ constructor(type: string);
17
+ }
18
+
19
+ /**
20
+ * @description Encodes a list of primitive values into an ABI-encoded hex value.
21
+ */
22
+ declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: {
23
+ params: TParams;
24
+ values: AbiParametersToPrimitiveTypes<TParams>;
25
+ }): `0x${string}`;
26
+ declare class AbiEncodingArrayLengthMismatchError extends BaseError {
27
+ name: string;
28
+ constructor({ expectedLength, givenLength, type, }: {
29
+ expectedLength: number;
30
+ givenLength: number;
31
+ type: string;
32
+ });
33
+ }
34
+ declare class AbiEncodingLengthMismatchError extends BaseError {
35
+ name: string;
36
+ constructor({ expectedLength, givenLength, }: {
37
+ expectedLength: number;
38
+ givenLength: number;
39
+ });
40
+ }
41
+ declare class InvalidAbiEncodingTypeError extends BaseError {
42
+ name: string;
43
+ constructor(type: string);
44
+ }
45
+ declare class InvalidArrayError extends BaseError {
46
+ name: string;
47
+ constructor(value: unknown);
48
+ }
49
+
5
50
  declare function getAddress(address: Address): `0x${string}`;
6
51
 
7
52
  type GetCreateAddressOptions = {
@@ -109,14 +154,16 @@ type PadOptions = {
109
154
  dir?: 'left' | 'right';
110
155
  size?: number;
111
156
  };
112
- declare function pad(hexOrBytes: Hex | ByteArray, { dir, size }?: PadOptions): `0x${string}` | Uint8Array;
157
+ type PadResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
158
+ declare function pad<TValue extends ByteArray | Hex>(hexOrBytes: TValue, { dir, size }?: PadOptions): PadResult<TValue>;
113
159
  declare function padHex(hex_: Hex, { dir, size }?: PadOptions): `0x${string}`;
114
160
  declare function padBytes(bytes: ByteArray, { dir, size }?: PadOptions): Uint8Array;
115
161
 
116
162
  type TrimOptions = {
117
163
  dir?: 'left' | 'right';
118
164
  };
119
- declare function trim(hexOrBytes: Hex | ByteArray, { dir }?: TrimOptions): string | Uint8Array;
165
+ type TrimResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
166
+ declare function trim<TValue extends ByteArray | Hex>(hexOrBytes: TValue, { dir }?: TrimOptions): TrimResult<TValue>;
120
167
 
121
168
  /**
122
169
  * @description Retrieves the size of the value (in bytes).
@@ -164,7 +211,7 @@ declare function bytesToHex(value: ByteArray): Hex;
164
211
  * @description Encodes a string, number, bigint, or ByteArray into a hex string
165
212
  */
166
213
  declare function encodeHex(value: string | number | bigint | boolean | ByteArray): Hex;
167
- type NumberToHexOpts = {
214
+ type NumberToHexOpts$1 = {
168
215
  signed?: boolean;
169
216
  size: number;
170
217
  } | {
@@ -174,7 +221,7 @@ type NumberToHexOpts = {
174
221
  /**
175
222
  * @description Encodes a number or bigint into a hex string
176
223
  */
177
- declare function numberToHex(value_: number | bigint, opts?: NumberToHexOpts): Hex;
224
+ declare function numberToHex(value_: number | bigint, opts?: NumberToHexOpts$1): Hex;
178
225
  /**
179
226
  * @description Encodes a UTF-8 string into a hex string
180
227
  */
@@ -193,7 +240,7 @@ declare function hexToBytes(hex_: Hex): ByteArray;
193
240
  /**
194
241
  * @description Encodes a number into a byte array.
195
242
  */
196
- declare function numberToBytes(value: bigint | number, opts?: NumberToHexOpts): Uint8Array;
243
+ declare function numberToBytes(value: bigint | number, opts?: NumberToHexOpts$1): Uint8Array;
197
244
  /**
198
245
  * @description Encodes a UTF-8 string into a byte array.
199
246
  */
@@ -232,18 +279,22 @@ type DecodeHexResponse<TTo> = TTo extends 'string' ? string : TTo extends 'bigin
232
279
  * @description Decodes a hex string into a string, number, bigint, boolean, or bytes32 array.
233
280
  */
234
281
  declare function decodeHex<TTo extends 'string' | 'bigint' | 'number' | 'bytes' | 'boolean'>(hex: Hex, to: TTo): DecodeHexResponse<TTo>;
282
+ type HexToBigIntOpts = {
283
+ signed?: boolean;
284
+ };
235
285
  /**
236
286
  * @description Decodes a hex string into a bigint.
237
287
  */
238
- declare function hexToBigInt(hex: Hex): bigint;
288
+ declare function hexToBigInt(hex: Hex, opts?: HexToBigIntOpts): bigint;
239
289
  /**
240
290
  * @description Decodes a hex string into a boolean.
241
291
  */
242
292
  declare function hexToBool(hex: Hex): boolean;
293
+ type NumberToHexOpts = HexToBigIntOpts;
243
294
  /**
244
295
  * @description Decodes a hex string into a number.
245
296
  */
246
- declare function hexToNumber(hex: Hex): number;
297
+ declare function hexToNumber(hex: Hex, opts?: NumberToHexOpts): number;
247
298
  /**
248
299
  * @description Decodes a hex string into a UTF-8 string.
249
300
  */
@@ -272,4 +323,4 @@ declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
272
323
 
273
324
  declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
274
325
 
275
- export { formatGwei as $, getFunctionSignature as A, formatEther as B, isAddress as C, isAddressEqual as D, EncodeRlpResponse as E, isBytes as F, GetContractAddressOptions as G, isHex as H, InternalRpcError as I, JsonRpcVersionUnsupportedError as J, hexToBigInt as K, LimitExceededRpcError as L, MethodNotFoundRpcError as M, hexToBool as N, hexToBytes as O, ParseRpcError as P, hexToString as Q, ResourceNotFoundRpcError as R, keccak256 as S, TransactionRejectedRpcError as T, numberToBytes as U, pad as V, padBytes as W, padHex as X, parseEther as Y, parseGwei as Z, parseUnit as _, GetCreateAddressOptions as a, formatUnit as a0, hexToNumber as a1, numberToHex as a2, size as a3, slice as a4, sliceBytes as a5, sliceHex as a6, stringToBytes as a7, stringToHex as a8, trim as a9, buildRequest as aa, GetCreate2AddressOptions as b, InvalidInputRpcError as c, InvalidParamsRpcError as d, InvalidRequestRpcError as e, MethodNotSupportedRpcError as f, ResourceUnavailableRpcError as g, RpcRequestError as h, bytesToHex as i, bytesToString as j, boolToBytes as k, boolToHex as l, bytesToBigint as m, bytesToBool as n, bytesToNumber as o, decodeBytes as p, decodeHex as q, decodeRlp as r, encodeBytes as s, encodeHex as t, encodeRlp as u, getAddress as v, getContractAddress as w, getCreateAddress as x, getCreate2Address as y, getEventSignature as z };
326
+ export { keccak256 as $, AbiDecodingDataSizeInvalidError as A, encodeHex as B, encodeRlp as C, getAddress as D, EncodeRlpResponse as E, getContractAddress as F, GetContractAddressOptions as G, getCreateAddress as H, InvalidAbiDecodingTypeError as I, JsonRpcVersionUnsupportedError as J, getCreate2Address as K, LimitExceededRpcError as L, MethodNotFoundRpcError as M, getEventSignature as N, getFunctionSignature as O, ParseRpcError as P, formatEther as Q, ResourceNotFoundRpcError as R, isAddress as S, TransactionRejectedRpcError as T, isAddressEqual as U, isBytes as V, isHex as W, hexToBigInt as X, hexToBool as Y, hexToBytes as Z, hexToString as _, AbiEncodingArrayLengthMismatchError as a, numberToBytes as a0, pad as a1, padBytes as a2, padHex as a3, parseEther as a4, parseGwei as a5, parseUnit as a6, formatGwei as a7, formatUnit as a8, hexToNumber as a9, numberToHex as aa, size as ab, slice as ac, sliceBytes as ad, sliceHex as ae, stringToBytes as af, stringToHex as ag, trim as ah, buildRequest as ai, AbiEncodingLengthMismatchError as b, GetCreateAddressOptions as c, GetCreate2AddressOptions as d, InvalidAbiEncodingTypeError as e, InvalidArrayError as f, InternalRpcError as g, InvalidInputRpcError as h, InvalidParamsRpcError as i, InvalidRequestRpcError as j, MethodNotSupportedRpcError as k, ResourceUnavailableRpcError as l, RpcRequestError as m, bytesToHex as n, bytesToString as o, boolToBytes as p, boolToHex as q, bytesToBigint as r, bytesToBool as s, bytesToNumber as t, decodeAbi as u, decodeBytes as v, decodeHex as w, decodeRlp as x, encodeAbi as y, encodeBytes as z };
@@ -1,7 +1,8 @@
1
- export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, I as InternalRpcError, c as InvalidInputRpcError, d as InvalidParamsRpcError, e as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, f as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, g as ResourceUnavailableRpcError, h as RpcRequestError, T as TransactionRejectedRpcError, k as boolToBytes, l as boolToHex, aa as buildRequest, m as bytesToBigint, n as bytesToBool, i as bytesToHex, o as bytesToNumber, j as bytesToString, p as decodeBytes, q as decodeHex, r as decodeRlp, s as encodeBytes, t as encodeHex, u as encodeRlp, B as formatEther, $ as formatGwei, a0 as formatUnit, v as getAddress, w as getContractAddress, y as getCreate2Address, x as getCreateAddress, z as getEventSignature, A as getFunctionSignature, K as hexToBigInt, N as hexToBool, O as hexToBytes, a1 as hexToNumber, Q as hexToString, C as isAddress, D as isAddressEqual, F as isBytes, H as isHex, S as keccak256, U as numberToBytes, a2 as numberToHex, V as pad, W as padBytes, X as padHex, Y as parseEther, Z as parseGwei, _ as parseUnit, a3 as size, a4 as slice, a5 as sliceBytes, a6 as sliceHex, a7 as stringToBytes, a8 as stringToHex, a9 as trim } from '../parseGwei-a7d0bcb2.js';
1
+ export { A as AbiDecodingDataSizeInvalidError, a as AbiEncodingArrayLengthMismatchError, b as AbiEncodingLengthMismatchError, E as EncodeRlpResponse, G as GetContractAddressOptions, d as GetCreate2AddressOptions, c as GetCreateAddressOptions, g as InternalRpcError, I as InvalidAbiDecodingTypeError, e as InvalidAbiEncodingTypeError, f as InvalidArrayError, h as InvalidInputRpcError, i as InvalidParamsRpcError, j as InvalidRequestRpcError, J as JsonRpcVersionUnsupportedError, L as LimitExceededRpcError, M as MethodNotFoundRpcError, k as MethodNotSupportedRpcError, P as ParseRpcError, R as ResourceNotFoundRpcError, l as ResourceUnavailableRpcError, m as RpcRequestError, T as TransactionRejectedRpcError, p as boolToBytes, q as boolToHex, ai as buildRequest, r as bytesToBigint, s as bytesToBool, n as bytesToHex, t as bytesToNumber, o as bytesToString, u as decodeAbi, v as decodeBytes, w as decodeHex, x as decodeRlp, y as encodeAbi, z as encodeBytes, B as encodeHex, C as encodeRlp, Q as formatEther, a7 as formatGwei, a8 as formatUnit, D as getAddress, F as getContractAddress, K as getCreate2Address, H as getCreateAddress, N as getEventSignature, O as getFunctionSignature, X as hexToBigInt, Y as hexToBool, Z as hexToBytes, a9 as hexToNumber, _ as hexToString, S as isAddress, U as isAddressEqual, V as isBytes, W as isHex, $ as keccak256, a0 as numberToBytes, aa as numberToHex, a1 as pad, a2 as padBytes, a3 as padHex, a4 as parseEther, a5 as parseGwei, a6 as parseUnit, ab as size, ac as slice, ad as sliceBytes, ae as sliceHex, af as stringToBytes, ag as stringToHex, ah as trim } from '../parseGwei-bbc055e4.js';
2
2
  export { B as BaseError } from '../BaseError-7688f84e.js';
3
3
  export { B as BlockFormatter, E as ExtractFormatter, e as Formatted, F as FormattedBlock, a as FormattedTransaction, h as FormattedTransactionReceipt, b as FormattedTransactionRequest, g as TransactionFormatter, i as TransactionReceiptFormatter, T as TransactionRequestFormatter, j as format, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from '../transactionRequest-ade896ac.js';
4
4
  export { H as HttpRequestError, R as RpcError, T as TimeoutError, r as rpc } from '../rpc-3c0e3985.js';
5
+ import 'abitype';
5
6
  import '../rpc-655c0ba4.js';
6
7
  import '../chains.js';
7
8
  import '@wagmi/chains';
@@ -24,9 +24,11 @@ import {
24
24
  bytesToHex,
25
25
  bytesToNumber,
26
26
  bytesToString,
27
+ decodeAbi,
27
28
  decodeBytes,
28
29
  decodeHex,
29
30
  decodeRlp,
31
+ encodeAbi,
30
32
  encodeBytes,
31
33
  encodeHex,
32
34
  encodeRlp,
@@ -72,7 +74,7 @@ import {
72
74
  stringToBytes,
73
75
  stringToHex,
74
76
  trim
75
- } from "../chunk-GI67STNV.js";
77
+ } from "../chunk-Z6LRV6XI.js";
76
78
  export {
77
79
  BaseError,
78
80
  HttpRequestError,
@@ -99,9 +101,11 @@ export {
99
101
  bytesToHex,
100
102
  bytesToNumber,
101
103
  bytesToString,
104
+ decodeAbi,
102
105
  decodeBytes,
103
106
  decodeHex,
104
107
  decodeRlp,
108
+ encodeAbi,
105
109
  encodeBytes,
106
110
  encodeHex,
107
111
  encodeRlp,
@@ -1,7 +1,7 @@
1
1
  import { Chain, Formatter } from './chains.js';
2
2
  import { H as Hex, d as BlockTag, M as MergeIntersectionProperties, v as TransactionRequest, K as EstimateGasParameters, A as Address, k as Hash, F as FeeHistory, L as Log, r as RpcTransactionReceipt, T as TransactionReceipt, N as TransactionType, D as Transaction, q as RpcTransaction, Q as Quantity, f as ByteArray } from './rpc-655c0ba4.js';
3
3
  import { T as TransactionRequestFormatter, e as Formatted, F as FormattedBlock, B as BlockFormatter, a as FormattedTransaction, g as TransactionFormatter, h as FormattedTransactionReceipt, i as TransactionReceiptFormatter, E as ExtractFormatter } from './transactionRequest-ade896ac.js';
4
- import { P as PublicClient, T as TestClient, W as WalletClient } from './createWalletClient-c40fef16.js';
4
+ import { P as PublicClient, T as TestClient, W as WalletClient } from './createWalletClient-915223f3.js';
5
5
  import { B as BaseError } from './BaseError-7688f84e.js';
6
6
  import { W as WalletPermission, a as WatchAssetParams } from './eip1193-8f7c22ce.js';
7
7
 
@@ -12,9 +12,8 @@ type Filter<TFilterType extends FilterType = 'event'> = {
12
12
  };
13
13
 
14
14
  type FormattedCall<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
15
- type CallArgs<TChain extends Chain = Chain> = {
15
+ type CallArgs<TChain extends Chain = Chain> = FormattedCall<TransactionRequestFormatter<TChain>> & {
16
16
  chain?: TChain;
17
- request: FormattedCall<TransactionRequestFormatter<TChain>>;
18
17
  } & ({
19
18
  /** The balance of the account at a block number. */
20
19
  blockNumber?: bigint;
@@ -27,7 +26,7 @@ type CallArgs<TChain extends Chain = Chain> = {
27
26
  type CallResponse = {
28
27
  data: Hex | undefined;
29
28
  };
30
- declare function call<TChain extends Chain>(client: PublicClient, { blockNumber, blockTag, chain, request }: CallArgs<TChain>): Promise<CallResponse>;
29
+ declare function call<TChain extends Chain>(client: PublicClient, { blockNumber, blockTag, chain, from, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest }: CallArgs<TChain>): Promise<CallResponse>;
31
30
 
32
31
  type CreatePendingTransactionFilterResponse = Filter<'transaction'>;
33
32
  declare function createPendingTransactionFilter(client: PublicClient): Promise<CreatePendingTransactionFilterResponse>;
@@ -35,9 +34,7 @@ declare function createPendingTransactionFilter(client: PublicClient): Promise<C
35
34
  type CreateBlockFilterResponse = Filter<'block'>;
36
35
  declare function createBlockFilter(client: PublicClient): Promise<CreateBlockFilterResponse>;
37
36
 
38
- type EstimateGasArgs = {
39
- request: EstimateGasParameters;
40
- } & ({
37
+ type EstimateGasArgs = EstimateGasParameters & ({
41
38
  /** The balance of the account at a block number. */
42
39
  blockNumber?: bigint;
43
40
  blockTag?: never;
@@ -50,7 +47,7 @@ type EstimateGasResponse = bigint;
50
47
  /**
51
48
  * @description Estimates the gas necessary to complete a transaction without submitting it to the network.
52
49
  */
53
- declare function estimateGas(client: PublicClient, { blockNumber, blockTag, request: { data, from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, value, }, }: EstimateGasArgs): Promise<EstimateGasResponse>;
50
+ declare function estimateGas(client: PublicClient, { blockNumber, blockTag, data, from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, value, }: EstimateGasArgs): Promise<EstimateGasResponse>;
54
51
 
55
52
  type GetBalanceArgs = {
56
53
  /** The address of the account. */
@@ -167,6 +164,12 @@ type GetFilterChangesArgs<TFilterType extends FilterType> = {
167
164
  type GetFilterChangesResponse<TFilterType extends FilterType> = TFilterType extends 'event' ? Log[] : Hash[];
168
165
  declare function getFilterChanges<TFilterType extends FilterType>(client: PublicClient, { filter }: GetFilterChangesArgs<TFilterType>): Promise<GetFilterChangesResponse<TFilterType>>;
169
166
 
167
+ type GetFilterLogsArgs = {
168
+ filter: Filter<'event'>;
169
+ };
170
+ type GetFilterLogsResponse = Log[];
171
+ declare function getFilterLogs<TFilterType extends FilterType>(client: PublicClient, { filter }: GetFilterLogsArgs): Promise<GetFilterLogsResponse>;
172
+
170
173
  type GetGasPriceResponse = bigint;
171
174
  /**
172
175
  * @description Returns the current price of gas (in wei).
@@ -391,13 +394,9 @@ type RevertArgs = {
391
394
  };
392
395
  declare function revert(client: TestClient, { id }: RevertArgs): Promise<void>;
393
396
 
394
- type SendUnsignedTransactionArgs = {
395
- request: TransactionRequest;
396
- };
397
- type SendUnsignedTransactionResponse = {
398
- hash: `0x${string}`;
399
- };
400
- declare function sendUnsignedTransaction(client: TestClient, { request }: SendUnsignedTransactionArgs): Promise<SendUnsignedTransactionResponse>;
397
+ type SendUnsignedTransactionArgs = TransactionRequest;
398
+ type SendUnsignedTransactionResponse = Hash;
399
+ declare function sendUnsignedTransaction(client: TestClient, request: SendUnsignedTransactionArgs): Promise<SendUnsignedTransactionResponse>;
401
400
 
402
401
  declare function setAutomine(client: TestClient, enabled: boolean): Promise<void>;
403
402
 
@@ -489,6 +488,8 @@ declare function stopImpersonatingAccount(client: TestClient, { address }: StopI
489
488
 
490
489
  declare function addChain(client: WalletClient, chain: Chain): Promise<void>;
491
490
 
491
+ declare function getAccounts(client: WalletClient): Promise<`0x${string}`[]>;
492
+
492
493
  type GetPermissionsResponse = WalletPermission[];
493
494
  declare function getPermissions(client: WalletClient): Promise<WalletPermission[]>;
494
495
 
@@ -503,14 +504,11 @@ type RequestPermissionsResponse = WalletPermission[];
503
504
  declare function requestPermissions(client: WalletClient, permissions: RequestPermissionsArgs): Promise<WalletPermission[]>;
504
505
 
505
506
  type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
506
- type SendTransactionArgs<TChain extends Chain = Chain> = {
507
+ type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionRequest<TransactionRequestFormatter<TChain>> & {
507
508
  chain?: TChain;
508
- request: FormattedTransactionRequest<TransactionRequestFormatter<TChain>>;
509
- };
510
- type SendTransactionResponse = {
511
- hash: `0x${string}`;
512
509
  };
513
- declare function sendTransaction<TChain extends Chain>(client: WalletClient, { chain, request }: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
510
+ type SendTransactionResponse = Hash;
511
+ declare function sendTransaction<TChain extends Chain>(client: WalletClient, { chain, from, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest }: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
514
512
  declare class InvalidGasArgumentsError extends BaseError {
515
513
  name: string;
516
514
  constructor();
@@ -532,4 +530,4 @@ type WatchAssetArgs = WatchAssetParams;
532
530
  type WatchAssetResponse = boolean;
533
531
  declare function watchAsset(client: WalletClient, params: WatchAssetParams): Promise<WatchAssetResponse>;
534
532
 
535
- export { SetNextBlockBaseFeePerGasArgs as $, OnBlockNumber as A, OnBlockNumberResponse as B, CallArgs as C, DropTransactionArgs as D, EstimateGasArgs as E, OnBlockResponse as F, GetBalanceArgs as G, OnTransactions as H, ImpersonateAccountArgs as I, OnTransactionsResponse as J, RequestPermissionsResponse as K, RevertArgs as L, MineArgs as M, SendTransactionResponse as N, OnBlock as O, SendUnsignedTransactionArgs as P, SendUnsignedTransactionResponse as Q, ResetArgs as R, SendTransactionArgs as S, SetBalanceArgs as T, SetBlockGasLimitArgs as U, SetCodeArgs as V, SetCoinbaseArgs as W, SetIntervalMiningArgs as X, SetMinGasPriceArgs as Y, SetBlockTimestampIntervalArgs as Z, SetNextBlockTimestampArgs as _, CallResponse as a, switchChain as a$, SetNonceArgs as a0, SetStorageAtArgs as a1, SignMessageArgs as a2, SignMessageResponse as a3, StopImpersonatingAccountArgs as a4, SwitchChainArgs as a5, UninstallFilterArgs as a6, UninstallFilterResponse as a7, WaitForTransactionReceiptArgs as a8, WaitForTransactionReceiptResponse as a9, impersonateAccount as aA, increaseTime as aB, inspectTxpool as aC, mine as aD, removeBlockTimestampInterval as aE, reset as aF, requestAccounts as aG, requestPermissions as aH, revert as aI, sendTransaction as aJ, sendUnsignedTransaction as aK, setAutomine as aL, setBalance as aM, setBlockGasLimit as aN, setBlockTimestampInterval as aO, setCode as aP, setCoinbase as aQ, setIntervalMining as aR, setLoggingEnabled as aS, setMinGasPrice as aT, setNextBlockBaseFeePerGas as aU, setNextBlockTimestamp as aV, setNonce as aW, setStorageAt as aX, signMessage as aY, snapshot as aZ, stopImpersonatingAccount as a_, WatchAssetArgs as aa, WatchAssetResponse as ab, WatchBlockNumberArgs as ac, WatchBlocksArgs as ad, WatchPendingTransactionsArgs as ae, addChain as af, call as ag, createBlockFilter as ah, createPendingTransactionFilter as ai, estimateGas as aj, dropTransaction as ak, getAutomine as al, getBalance as am, getBlock as an, getBlockNumber as ao, getBlockTransactionCount as ap, getChainId as aq, getFeeHistory as ar, getGasPrice as as, getPermissions as at, getTransaction as au, getTransactionConfirmations as av, getTransactionCount as aw, getTransactionReceipt as ax, getTxpoolContent as ay, getTxpoolStatus as az, CreateBlockFilterResponse as b, uninstallFilter as b0, waitForTransactionReceipt as b1, watchAsset as b2, watchBlockNumber as b3, watchBlocks as b4, watchPendingTransactions as b5, getBlockNumberCache as b6, getFilterChanges as b7, ReplacementReason as b8, ReplacementResponse as b9, WaitForTransactionReceiptTimeoutError as ba, FormattedTransactionRequest as bb, InvalidGasArgumentsError as bc, CreatePendingTransactionFilterResponse as c, EstimateGasResponse as d, GetBalanceResponse as e, GetBlockArgs as f, GetBlockNumberArgs as g, GetBlockNumberResponse as h, GetBlockResponse as i, GetBlockTransactionCountArgs as j, GetBlockTransactionCountResponse as k, GetFeeHistoryArgs as l, GetFeeHistoryResponse as m, GetFilterChangesArgs as n, GetFilterChangesResponse as o, GetGasPriceResponse as p, GetPermissionsResponse as q, GetTransactionArgs as r, GetTransactionConfirmationsArgs as s, GetTransactionConfirmationsResponse as t, GetTransactionCountArgs as u, GetTransactionCountResponse as v, GetTransactionResponse as w, GetTransactionReceiptArgs as x, GetTransactionReceiptResponse as y, IncreaseTimeArgs as z };
533
+ export { SetBlockTimestampIntervalArgs as $, GetTransactionReceiptResponse as A, IncreaseTimeArgs as B, CallArgs as C, DropTransactionArgs as D, EstimateGasArgs as E, OnBlockNumber as F, GetBalanceArgs as G, OnBlockNumberResponse as H, ImpersonateAccountArgs as I, OnBlockResponse as J, OnTransactions as K, OnTransactionsResponse as L, MineArgs as M, RequestPermissionsResponse as N, OnBlock as O, RevertArgs as P, SendTransactionResponse as Q, ResetArgs as R, SendTransactionArgs as S, SendUnsignedTransactionArgs as T, SendUnsignedTransactionResponse as U, SetBalanceArgs as V, SetBlockGasLimitArgs as W, SetCodeArgs as X, SetCoinbaseArgs as Y, SetIntervalMiningArgs as Z, SetMinGasPriceArgs as _, CallResponse as a, setNonce as a$, SetNextBlockTimestampArgs as a0, SetNextBlockBaseFeePerGasArgs as a1, SetNonceArgs as a2, SetStorageAtArgs as a3, SignMessageArgs as a4, SignMessageResponse as a5, StopImpersonatingAccountArgs as a6, SwitchChainArgs as a7, UninstallFilterArgs as a8, UninstallFilterResponse as a9, getTransactionConfirmations as aA, getTransactionCount as aB, getTransactionReceipt as aC, getTxpoolContent as aD, getTxpoolStatus as aE, impersonateAccount as aF, increaseTime as aG, inspectTxpool as aH, mine as aI, removeBlockTimestampInterval as aJ, reset as aK, requestAccounts as aL, requestPermissions as aM, revert as aN, sendTransaction as aO, sendUnsignedTransaction as aP, setAutomine as aQ, setBalance as aR, setBlockGasLimit as aS, setBlockTimestampInterval as aT, setCode as aU, setCoinbase as aV, setIntervalMining as aW, setLoggingEnabled as aX, setMinGasPrice as aY, setNextBlockBaseFeePerGas as aZ, setNextBlockTimestamp as a_, WaitForTransactionReceiptArgs as aa, WaitForTransactionReceiptResponse as ab, WatchAssetArgs as ac, WatchAssetResponse as ad, WatchBlockNumberArgs as ae, WatchBlocksArgs as af, WatchPendingTransactionsArgs as ag, addChain as ah, call as ai, createBlockFilter as aj, createPendingTransactionFilter as ak, estimateGas as al, dropTransaction as am, getAccounts as an, getAutomine as ao, getBalance as ap, getBlock as aq, getBlockNumber as ar, getBlockTransactionCount as as, getChainId as at, getFeeHistory as au, getFilterChanges as av, getFilterLogs as aw, getGasPrice as ax, getPermissions as ay, getTransaction as az, CreateBlockFilterResponse as b, setStorageAt as b0, signMessage as b1, snapshot as b2, stopImpersonatingAccount as b3, switchChain as b4, uninstallFilter as b5, waitForTransactionReceipt as b6, watchAsset as b7, watchBlockNumber as b8, watchBlocks as b9, watchPendingTransactions as ba, getBlockNumberCache as bb, ReplacementReason as bc, ReplacementResponse as bd, WaitForTransactionReceiptTimeoutError as be, FormattedTransactionRequest as bf, InvalidGasArgumentsError as bg, CreatePendingTransactionFilterResponse as c, EstimateGasResponse as d, GetBalanceResponse as e, GetBlockArgs as f, GetBlockNumberArgs as g, GetBlockNumberResponse as h, GetBlockResponse as i, GetBlockTransactionCountArgs as j, GetBlockTransactionCountResponse as k, GetFeeHistoryArgs as l, GetFeeHistoryResponse as m, GetFilterChangesArgs as n, GetFilterChangesResponse as o, GetFilterLogsArgs as p, GetFilterLogsResponse as q, GetGasPriceResponse as r, GetPermissionsResponse as s, GetTransactionArgs as t, GetTransactionConfirmationsArgs as u, GetTransactionConfirmationsResponse as v, GetTransactionCountArgs as w, GetTransactionCountResponse as x, GetTransactionResponse as y, GetTransactionReceiptArgs as z };
@@ -1,5 +1,5 @@
1
1
  import { B as BaseError } from './BaseError-7688f84e.js';
2
- import { e as TransportConfig, d as Transport, B as BaseRpcRequests } from './createWalletClient-c40fef16.js';
2
+ import { e as TransportConfig, d as Transport, B as BaseRpcRequests } from './createWalletClient-915223f3.js';
3
3
  import { k as Hash } from './rpc-655c0ba4.js';
4
4
  import { a as RpcResponse } from './rpc-3c0e3985.js';
5
5
 
@@ -10,27 +10,36 @@ declare class UrlRequiredError extends BaseError {
10
10
  type EthereumProvider = {
11
11
  request: BaseRpcRequests['request'];
12
12
  };
13
- type EthereumProviderTransportConfig<TProvider> = {
13
+ type CustomTransportConfig = {
14
14
  /** The key of the transport. */
15
15
  key?: TransportConfig['key'];
16
16
  /** The name of the transport. */
17
17
  name?: TransportConfig['name'];
18
- /** An EIP-1193 or equivalent provider with a "request" function. */
19
- provider: TProvider;
20
18
  };
21
- type EthereumProviderTransport = Transport<'ethereumProvider', EthereumProvider['request']>;
19
+ type CustomTransport = Transport<'custom', EthereumProvider['request']>;
22
20
  /**
23
- * @description Creates a transport based on an EIP-1193 provider (eg. `window.ethereum`).
21
+ * @description Creates a custom transport given an EIP-1193 compliant `request` attribute.
24
22
  */
25
- declare function ethereumProvider<TProvider extends EthereumProvider>({ key, name, provider, }: EthereumProviderTransportConfig<TProvider>): EthereumProviderTransport;
23
+ declare function custom<TProvider extends EthereumProvider>(
24
+ /** An Ethereum provider with an EIP-1193 "request" attribute. */
25
+ provider: TProvider, { key, name }?: CustomTransportConfig): CustomTransport;
26
+
27
+ type FallbackTransportConfig = {
28
+ /** The key of the Fallback transport. */
29
+ key?: TransportConfig['key'];
30
+ /** The name of the Fallback transport. */
31
+ name?: TransportConfig['name'];
32
+ };
33
+ type FallbackTransport = Transport<'fallback', {
34
+ transports: Transport[];
35
+ }>;
36
+ declare function fallback(transports: Transport[], { key, name }?: FallbackTransportConfig): FallbackTransport;
26
37
 
27
38
  type HttpTransportConfig = {
28
39
  /** The key of the HTTP transport. */
29
40
  key?: TransportConfig['key'];
30
41
  /** The name of the HTTP transport. */
31
42
  name?: TransportConfig['name'];
32
- /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
33
- url?: string;
34
43
  };
35
44
  type HttpTransport = Transport<'http', {
36
45
  url?: string;
@@ -38,7 +47,9 @@ type HttpTransport = Transport<'http', {
38
47
  /**
39
48
  * @description Creates a HTTP transport that connects to a JSON-RPC API.
40
49
  */
41
- declare function http({ key, name, url, }?: HttpTransportConfig): HttpTransport;
50
+ declare function http(
51
+ /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
52
+ url?: string, { key, name }?: HttpTransportConfig): HttpTransport;
42
53
 
43
54
  type WebSocketTransportSubscribeArgs = {
44
55
  onData: (data: RpcResponse) => void;
@@ -62,8 +73,6 @@ type WebSocketTransportConfig = {
62
73
  key?: TransportConfig['key'];
63
74
  /** The name of the WebSocket transport. */
64
75
  name?: TransportConfig['name'];
65
- /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
66
- url?: string;
67
76
  };
68
77
  type WebSocketTransport = Transport<'webSocket', {
69
78
  getSocket(): Promise<WebSocket>;
@@ -72,6 +81,8 @@ type WebSocketTransport = Transport<'webSocket', {
72
81
  /**
73
82
  * @description Creates a WebSocket transport that connects to a JSON-RPC API.
74
83
  */
75
- declare function webSocket({ key, name, url, }?: WebSocketTransportConfig): WebSocketTransport;
84
+ declare function webSocket(
85
+ /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
86
+ url?: string, { key, name, }?: WebSocketTransportConfig): WebSocketTransport;
76
87
 
77
- export { EthereumProviderTransport as E, HttpTransport as H, UrlRequiredError as U, WebSocketTransport as W, EthereumProviderTransportConfig as a, HttpTransportConfig as b, WebSocketTransportConfig as c, ethereumProvider as e, http as h, webSocket as w };
88
+ export { CustomTransport as C, FallbackTransport as F, HttpTransport as H, UrlRequiredError as U, WebSocketTransport as W, CustomTransportConfig as a, FallbackTransportConfig as b, HttpTransportConfig as c, WebSocketTransportConfig as d, custom as e, fallback as f, http as h, webSocket as w };