viem 0.0.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.
@@ -0,0 +1,98 @@
1
+ import { B as BaseError } from './BaseError-7688f84e.js';
2
+
3
+ type SuccessResult<T> = {
4
+ method?: never;
5
+ result: T;
6
+ error?: never;
7
+ };
8
+ type ErrorResult<T> = {
9
+ method?: never;
10
+ result?: never;
11
+ error: T;
12
+ };
13
+ type Subscription<TResult, TError> = {
14
+ method: 'eth_subscription';
15
+ error?: never;
16
+ result?: never;
17
+ params: {
18
+ subscription: string;
19
+ } & ({
20
+ result: TResult;
21
+ error?: never;
22
+ } | {
23
+ result?: never;
24
+ error: TError;
25
+ });
26
+ };
27
+ type RpcRequest = {
28
+ method: string;
29
+ params?: any[];
30
+ };
31
+ type RpcResponse<TResult = any, TError = any> = {
32
+ jsonrpc: `${number}`;
33
+ id: number;
34
+ } & (SuccessResult<TResult> | ErrorResult<TError> | Subscription<TResult, TError>);
35
+ declare function http(url: string, { body, retryDelay, retryCount, timeout, }: {
36
+ body: RpcRequest;
37
+ retryDelay?: number;
38
+ retryCount?: number;
39
+ timeout?: number;
40
+ }): Promise<RpcResponse<any, any>>;
41
+ type Id = string | number;
42
+ type CallbackFn = (message: any) => void;
43
+ type CallbackMap = Map<Id, CallbackFn>;
44
+ type Socket = WebSocket & {
45
+ requests: CallbackMap;
46
+ subscriptions: CallbackMap;
47
+ };
48
+ declare function webSocket(socket: Socket, { body, onData, onError, }: {
49
+ body: RpcRequest;
50
+ onData?: (message: RpcResponse) => void;
51
+ onError?: (message: RpcResponse['error']) => void;
52
+ }): Socket;
53
+ declare function webSocketAsync(socket: Socket, { body, timeout, }: {
54
+ body: RpcRequest;
55
+ timeout?: number;
56
+ }): Promise<RpcResponse<any, any>>;
57
+ declare const rpc: {
58
+ http: typeof http;
59
+ webSocket: typeof webSocket;
60
+ webSocketAsync: typeof webSocketAsync;
61
+ };
62
+ declare class HttpRequestError extends BaseError {
63
+ name: string;
64
+ status: number;
65
+ constructor({ body, details, status, url, }: {
66
+ body: {
67
+ [key: string]: unknown;
68
+ };
69
+ details: string;
70
+ status: number;
71
+ url: string;
72
+ });
73
+ }
74
+ declare class RpcError extends BaseError {
75
+ code: number;
76
+ name: string;
77
+ constructor({ body, error, url, }: {
78
+ body: {
79
+ [key: string]: unknown;
80
+ };
81
+ error: {
82
+ code: number;
83
+ message: string;
84
+ };
85
+ url: string;
86
+ });
87
+ }
88
+ declare class TimeoutError extends BaseError {
89
+ name: string;
90
+ constructor({ body, url, }: {
91
+ body: {
92
+ [key: string]: unknown;
93
+ };
94
+ url: string;
95
+ });
96
+ }
97
+
98
+ export { HttpRequestError as H, RpcError as R, TimeoutError as T, RpcResponse as a, rpc as r };
@@ -0,0 +1,292 @@
1
+ declare const etherUnits: {
2
+ gwei: number;
3
+ wei: number;
4
+ };
5
+ declare const gweiUnits: {
6
+ ether: number;
7
+ wei: number;
8
+ };
9
+ declare const weiUnits: {
10
+ ether: number;
11
+ gwei: number;
12
+ };
13
+ declare const transactionType: {
14
+ readonly '0x0': "legacy";
15
+ readonly '0x1': "eip2930";
16
+ readonly '0x2': "eip1559";
17
+ };
18
+
19
+ type Address = `0x${string}`;
20
+ type ByteArray = Uint8Array;
21
+ type Hex = `0x${string}`;
22
+ type Hash = `0x${string}`;
23
+
24
+ type EstimateGasParameters<TQuantity = bigint> = {
25
+ /** Contract code or a hashed method call with encoded args */
26
+ data?: Hex;
27
+ /** Gas provided for transaction execution */
28
+ gas?: TQuantity;
29
+ /** Transaction sender */
30
+ from?: Address;
31
+ /** Transaction recipient */
32
+ to?: Address;
33
+ /** Value in wei sent with this transaction */
34
+ value?: TQuantity;
35
+ } & Partial<FeeValues<TQuantity>>;
36
+ type FeeHistory<TQuantity = bigint> = {
37
+ /**
38
+ * An array of block base fees per gas (in wei). This includes the next block after
39
+ * the newest of the returned range, because this value can be derived from the newest block.
40
+ * Zeroes are returned for pre-EIP-1559 blocks. */
41
+ baseFeePerGas: TQuantity[];
42
+ /** An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. */
43
+ gasUsedRatio: number[];
44
+ /** Lowest number block of the returned range. */
45
+ oldestBlock: TQuantity;
46
+ /** An array of effective priority fees (in wei) per gas data points from a single block. All zeroes are returned if the block is empty. */
47
+ reward?: TQuantity[][];
48
+ };
49
+ type FeeValuesLegacy<TQuantity = bigint> = {
50
+ /** Base fee per gas. */
51
+ gasPrice: TQuantity;
52
+ maxFeePerGas?: never;
53
+ maxPriorityFeePerGas?: never;
54
+ };
55
+ type FeeValuesEIP1559<TQuantity = bigint> = {
56
+ gasPrice?: never;
57
+ /** Total fee per gas in wei (gasPrice/baseFeePerGas + maxPriorityFeePerGas). */
58
+ maxFeePerGas: TQuantity;
59
+ /** Max priority fee per gas (in wei). */
60
+ maxPriorityFeePerGas: TQuantity;
61
+ };
62
+ type FeeValues<TQuantity = bigint> = FeeValuesLegacy<TQuantity> | FeeValuesEIP1559<TQuantity>;
63
+
64
+ type Log<TQuantity = bigint, TIndex = number> = {
65
+ /** The address from which this log originated */
66
+ address: Address;
67
+ /** Hash of block containing this log or `null` if pending */
68
+ blockHash: Hash | null;
69
+ /** Number of block containing this log or `null` if pending */
70
+ blockNumber: TQuantity | null;
71
+ /** Contains the non-indexed arguments of the log */
72
+ data: Hex;
73
+ /** Index of this log within its block or `null` if pending */
74
+ logIndex: TIndex | null;
75
+ /** Hash of the transaction that created this log or `null` if pending */
76
+ transactionHash: Hash | null;
77
+ /** Index of the transaction that created this log or `null` if pending */
78
+ transactionIndex: TIndex | null;
79
+ /** List of order-dependent topics */
80
+ topics: Hex[];
81
+ /** `true` if this filter has been destroyed and is invalid */
82
+ removed: boolean;
83
+ };
84
+
85
+ /**
86
+ * @description Merges the intersection properties of T and U.
87
+ *
88
+ * @example
89
+ * MergeIntersectionProperties<{ a: string, b: number }, { a: number, c: boolean }>
90
+ * => { a: number, b: number }
91
+ */
92
+ type MergeIntersectionProperties<T, U> = {
93
+ [K in keyof T as K extends keyof U ? U[K] extends void ? never : K : K]: K extends keyof U ? U[K] : T[K];
94
+ };
95
+ /**
96
+ * @description Makes nullable properties from T optional.
97
+ *
98
+ * @example
99
+ * OptionalNullable<{ a: string | undefined, c: number }>
100
+ * => { a?: string | undefined, c: number }
101
+ */
102
+ type OptionalNullable<T> = {
103
+ [K in keyof T as T[K] extends NonNullable<unknown> ? K : never]: T[K];
104
+ } & {
105
+ [K in keyof T as T[K] extends NonNullable<unknown> ? never : K]?: T[K];
106
+ };
107
+ /**
108
+ * @description Creates a type that extracts the values of T.
109
+ *
110
+ * @example
111
+ * ValueOf<{ a: string, b: number }>
112
+ * => string | number
113
+ */
114
+ type ValueOf<T> = T[keyof T];
115
+
116
+ type AccessList = Array<{
117
+ address: Address;
118
+ storageKeys: Array<Hex>;
119
+ }>;
120
+ type TransactionType$1 = ValueOf<typeof transactionType>;
121
+ type TransactionReceipt<TQuantity = bigint, TIndex = number, TStatus = 'success' | 'reverted', TType = TransactionType$1> = {
122
+ /** Hash of block containing this transaction */
123
+ blockHash: Hash;
124
+ /** Number of block containing this transaction */
125
+ blockNumber: TQuantity;
126
+ /** Address of new contract or `null` if no contract was created */
127
+ contractAddress: Address | null;
128
+ /** Gas used by this and all preceding transactions in this block */
129
+ cumulativeGasUsed: TQuantity;
130
+ /** Pre-London, it is equal to the transaction's gasPrice. Post-London, it is equal to the actual gas price paid for inclusion. */
131
+ effectiveGasPrice: TQuantity;
132
+ /** Transaction sender */
133
+ from: Address;
134
+ /** Gas used by this transaction */
135
+ gasUsed: TQuantity;
136
+ /** List of log objects generated by this transaction */
137
+ logs: Log<TQuantity, TIndex>[];
138
+ /** Logs bloom filter */
139
+ logsBloom: Hex;
140
+ /** `1` if this transaction was successful or `0` if it failed */
141
+ status: TStatus;
142
+ /** Transaction recipient or `null` if deploying a contract */
143
+ to: Address | null;
144
+ /** Hash of this transaction */
145
+ transactionHash: Hash;
146
+ /** Index of this transaction in the block */
147
+ transactionIndex: TIndex;
148
+ /** Transaction type */
149
+ type: TType;
150
+ };
151
+ type TransactionBase<TQuantity = bigint, TIndex = number> = {
152
+ /** Hash of block containing this transaction or `null` if pending */
153
+ blockHash: Hash | null;
154
+ /** Number of block containing this transaction or `null` if pending */
155
+ blockNumber: TQuantity | null;
156
+ /** Transaction sender */
157
+ from: Address;
158
+ /** Gas provided for transaction execution */
159
+ gas: TQuantity;
160
+ /** Hash of this transaction */
161
+ hash: Hash;
162
+ /** Contract code or a hashed method call */
163
+ input: Hex;
164
+ /** Unique number identifying this transaction */
165
+ nonce: TIndex;
166
+ /** ECDSA signature r */
167
+ r: Hex;
168
+ /** ECDSA signature s */
169
+ s: Hex;
170
+ /** Transaction recipient or `null` if deploying a contract */
171
+ to: Address | null;
172
+ /** Index of this transaction in the block or `null` if pending */
173
+ transactionIndex: TIndex | null;
174
+ /** ECDSA recovery ID */
175
+ v: TQuantity;
176
+ /** Value in wei sent with this transaction */
177
+ value: TQuantity;
178
+ };
179
+ type TransactionLegacy<TQuantity = bigint, TIndex = number, TType = 'legacy'> = TransactionBase<TQuantity, TIndex> & FeeValuesLegacy<TQuantity> & {
180
+ accessList?: never;
181
+ type: TType;
182
+ };
183
+ type TransactionEIP2930<TQuantity = bigint, TIndex = number, TType = 'eip2930'> = TransactionBase<TQuantity, TIndex> & FeeValuesLegacy<TQuantity> & {
184
+ accessList: AccessList;
185
+ type: TType;
186
+ };
187
+ type TransactionEIP1559<TQuantity = bigint, TIndex = number, TType = 'eip1559'> = TransactionBase<TQuantity, TIndex> & FeeValuesEIP1559<TQuantity> & {
188
+ accessList: AccessList;
189
+ type: TType;
190
+ };
191
+ type Transaction<TQuantity = bigint, TIndex = number> = TransactionLegacy<TQuantity, TIndex> | TransactionEIP2930<TQuantity, TIndex> | TransactionEIP1559<TQuantity, TIndex>;
192
+ type TransactionRequestBase<TQuantity = bigint, TIndex = number> = {
193
+ /** Contract code or a hashed method call with encoded args */
194
+ data?: Hex;
195
+ /** Transaction sender */
196
+ from: Address;
197
+ /** Gas provided for transaction execution */
198
+ gas?: TQuantity;
199
+ /** Unique number identifying this transaction */
200
+ nonce?: TIndex;
201
+ /** Transaction recipient */
202
+ to?: Address;
203
+ /** Value in wei sent with this transaction */
204
+ value?: TQuantity;
205
+ };
206
+ type TransactionRequestLegacy<TQuantity = bigint, TIndex = number> = TransactionRequestBase<TQuantity, TIndex> & Partial<FeeValuesLegacy<TQuantity>> & {
207
+ accessList?: never;
208
+ };
209
+ type TransactionRequestEIP2930<TQuantity = bigint, TIndex = number> = TransactionRequestBase<TQuantity, TIndex> & Partial<FeeValuesLegacy<TQuantity>> & {
210
+ accessList?: AccessList;
211
+ };
212
+ type TransactionRequestEIP1559<TQuantity = bigint, TIndex = number> = TransactionRequestBase<TQuantity, TIndex> & Partial<FeeValuesEIP1559<TQuantity>> & {
213
+ accessList?: AccessList;
214
+ };
215
+ type TransactionRequest<TQuantity = bigint, TIndex = number> = TransactionRequestLegacy<TQuantity, TIndex> | TransactionRequestEIP2930<TQuantity, TIndex> | TransactionRequestEIP1559<TQuantity, TIndex>;
216
+
217
+ type Block<TQuantity = bigint, TTransaction = Transaction> = {
218
+ /** Base fee per gas */
219
+ baseFeePerGas: TQuantity | null;
220
+ /** Difficulty for this block */
221
+ difficulty: TQuantity;
222
+ /** "Extra data" field of this block */
223
+ extraData: Hex;
224
+ /** Maximum gas allowed in this block */
225
+ gasLimit: TQuantity;
226
+ /** Total used gas by all transactions in this block */
227
+ gasUsed: TQuantity;
228
+ /** Block hash or `null` if pending */
229
+ hash: Hash | null;
230
+ /** Logs bloom filter or `null` if pending */
231
+ logsBloom: Hex | null;
232
+ /** Address that received this block’s mining rewards */
233
+ miner: Address;
234
+ /** Unique identifier for the block. */
235
+ mixHash: Hash;
236
+ /** Proof-of-work hash or `null` if pending */
237
+ nonce: Hex | null;
238
+ /** Block number or `null` if pending */
239
+ number: TQuantity | null;
240
+ /** Parent block hash */
241
+ parentHash: Hash;
242
+ /** Root of the this block’s receipts trie */
243
+ receiptsRoot: Hex;
244
+ sealFields: Hex[];
245
+ /** SHA3 of the uncles data in this block */
246
+ sha3Uncles: Hash;
247
+ /** Size of this block in bytes */
248
+ size: TQuantity;
249
+ /** Root of this block’s final state trie */
250
+ stateRoot: Hash;
251
+ /** Unix timestamp of when this block was collated */
252
+ timestamp: TQuantity;
253
+ /** Total difficulty of the chain until this block */
254
+ totalDifficulty: TQuantity | null;
255
+ /** List of transaction objects or hashes */
256
+ transactions: Hash[] | TTransaction[];
257
+ /** Root of this block’s transaction trie */
258
+ transactionsRoot: Hash;
259
+ /** List of uncle hashes */
260
+ uncles: Hash[];
261
+ };
262
+ type BlockIdentifier<TQuantity = bigint> = {
263
+ /** Whether or not to throw an error if the block is not in the canonical chain as described below. Only allowed in conjunction with the blockHash tag. Defaults to false. */
264
+ requireCanonical?: boolean;
265
+ } & ({
266
+ /** The block in the canonical chain with this number */
267
+ blockNumber: BlockNumber<TQuantity>;
268
+ } | {
269
+ /** The block uniquely identified by this hash. The `blockNumber` and `blockHash` properties are mutually exclusive; exactly one of them must be set. */
270
+ blockHash: Hash;
271
+ });
272
+ type BlockNumber<TQuantity = bigint> = TQuantity;
273
+ type BlockTag = 'latest' | 'earliest' | 'pending' | 'safe' | 'finalized';
274
+ type Uncle<TQuantity = bigint, TTransaction = Transaction> = Block<TQuantity, TTransaction>;
275
+
276
+ type Index = `0x${string}`;
277
+ type Quantity = `0x${string}`;
278
+ type Status = '0x0' | '0x1';
279
+ type TransactionType = '0x0' | '0x1' | '0x2';
280
+ type RpcBlock = Block<Quantity, RpcTransaction>;
281
+ type RpcBlockNumber = BlockNumber<Quantity>;
282
+ type RpcBlockIdentifier = BlockIdentifier<Quantity>;
283
+ type RpcEstimateGasParameters = EstimateGasParameters<Quantity>;
284
+ type RpcUncle = Uncle<Quantity>;
285
+ type RpcFeeHistory = FeeHistory<Quantity>;
286
+ type RpcFeeValues = FeeValues<Quantity>;
287
+ type RpcLog = Log<Quantity, Index>;
288
+ type RpcTransactionReceipt = TransactionReceipt<Quantity, Index, Status, TransactionType>;
289
+ type RpcTransactionRequest = TransactionRequest<Quantity, Index>;
290
+ type RpcTransaction = TransactionLegacy<Quantity, Index, '0x0'> | TransactionEIP2930<Quantity, Index, '0x1'> | TransactionEIP1559<Quantity, Index, '0x2'>;
291
+
292
+ export { Address as A, Block as B, TransactionRequestLegacy as C, Transaction as D, TransactionBase as E, FeeHistory as F, TransactionEIP1559 as G, Hex as H, TransactionEIP2930 as I, TransactionLegacy as J, EstimateGasParameters as K, Log as L, MergeIntersectionProperties as M, TransactionType$1 as N, OptionalNullable as O, RpcEstimateGasParameters as P, Quantity as Q, RpcBlock as R, TransactionReceipt as T, Uncle as U, AccessList as a, BlockIdentifier as b, BlockNumber as c, BlockTag as d, etherUnits as e, ByteArray as f, gweiUnits as g, FeeValues as h, FeeValuesEIP1559 as i, FeeValuesLegacy as j, Hash as k, RpcBlockIdentifier as l, RpcBlockNumber as m, RpcFeeHistory as n, RpcFeeValues as o, RpcLog as p, RpcTransaction as q, RpcTransactionReceipt as r, RpcTransactionRequest as s, transactionType as t, RpcUncle as u, TransactionRequest as v, weiUnits as w, TransactionRequestBase as x, TransactionRequestEIP1559 as y, TransactionRequestEIP2930 as z };
@@ -0,0 +1,44 @@
1
+ import { O as OptionalNullable, B as Block, R as RpcBlock, D as Transaction, q as RpcTransaction, T as TransactionReceipt, s as RpcTransactionRequest, v as TransactionRequest } from './rpc-655c0ba4.js';
2
+ import { Chain, Formatter, Formatters } from './chains.js';
3
+
4
+ type ExtractFormatter<TChain extends Chain, TKey extends keyof NonNullable<TChain['formatters']>, TFallbackFormatter extends Formatter = Formatter> = NonNullable<TChain['formatters']>[TKey] extends NonNullable<unknown> ? NonNullable<TChain['formatters']>[TKey] : TFallbackFormatter;
5
+ type FormatOptions<TSource, TTarget> = {
6
+ formatter: Formatter<TSource, TTarget>;
7
+ };
8
+ /**
9
+ * Creates a type that is the result of applying `TFormatter` to `TSource`.
10
+ *
11
+ * @example
12
+ * Formatted<() => { a: undefined, b: bigint }, { a: bigint }>
13
+ * => { a: undefined, b: bigint }
14
+ *
15
+ * @example
16
+ * Formatted<() => {}, { a: bigint }>
17
+ * => { a: bigint }
18
+ *
19
+ * @example
20
+ * Formatted<() => { a: bigint | undefined, b: bigint }, { a: bigint, b: bigint }, true>
21
+ * => { a?: bigint | undefined, b: bigint }
22
+ */
23
+ type Formatted<TFormatter, TFallback, TAllowOptional = false> = TFormatter extends Formatter ? ReturnType<TFormatter> extends Record<string, never> ? TFallback : TAllowOptional extends true ? OptionalNullable<ReturnType<TFormatter>> : ReturnType<TFormatter> : never;
24
+ /**
25
+ * @description Formats a data object using the given replacer and an optional formatter.
26
+ */
27
+ declare function format<TFormatter, TSource extends Record<string, any>, TTarget>(data: TSource, { formatter }: FormatOptions<TSource, TTarget>): Formatted<TFormatter, TTarget, false>;
28
+
29
+ type BlockFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'block', NonNullable<Formatters['block']>>;
30
+ type FormattedBlock<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, Block>;
31
+ declare function formatBlock(block: Partial<RpcBlock>): Block<bigint, Transaction<bigint, number>>;
32
+
33
+ type TransactionFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transaction', NonNullable<Formatters['transaction']>>;
34
+ type FormattedTransaction<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, Transaction>;
35
+ declare function formatTransaction(transaction: Partial<RpcTransaction>): Transaction<bigint, number>;
36
+
37
+ type TransactionReceiptFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionReceipt', NonNullable<Formatters['transactionReceipt']>>;
38
+ type FormattedTransactionReceipt<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, TransactionReceipt>;
39
+
40
+ type TransactionRequestFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionRequest', NonNullable<Formatters['transactionRequest']>>;
41
+ type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, RpcTransactionRequest>;
42
+ declare function formatTransactionRequest(transactionRequest: Partial<TransactionRequest>): RpcTransactionRequest;
43
+
44
+ export { BlockFormatter as B, ExtractFormatter as E, FormattedBlock as F, TransactionRequestFormatter as T, FormattedTransaction as a, FormattedTransactionRequest as b, formatTransaction as c, formatTransactionRequest as d, Formatted as e, formatBlock as f, TransactionFormatter as g, FormattedTransactionReceipt as h, TransactionReceiptFormatter as i, format as j };
@@ -0,0 +1,18 @@
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
+ export { B as BaseError } from '../BaseError-7688f84e.js';
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
+ export { H as HttpRequestError, R as RpcError, T as TimeoutError, r as rpc } from '../rpc-3c0e3985.js';
5
+ import 'abitype';
6
+ import '../rpc-655c0ba4.js';
7
+ import '../chains.js';
8
+ import '@wagmi/chains';
9
+
10
+ declare function extractFunctionName(def: string): string | undefined;
11
+ declare function extractFunctionParams(def: string): {
12
+ indexed?: boolean | undefined;
13
+ type: string;
14
+ name: string;
15
+ }[] | undefined;
16
+ declare function extractFunctionType(def: string): string | undefined;
17
+
18
+ export { extractFunctionName, extractFunctionParams, extractFunctionType };
@@ -0,0 +1,154 @@
1
+ import {
2
+ BaseError,
3
+ HttpRequestError,
4
+ InternalRpcError,
5
+ InvalidInputRpcError,
6
+ InvalidParamsRpcError,
7
+ InvalidRequestRpcError,
8
+ JsonRpcVersionUnsupportedError,
9
+ LimitExceededRpcError,
10
+ MethodNotFoundRpcError,
11
+ MethodNotSupportedRpcError,
12
+ ParseRpcError,
13
+ ResourceNotFoundRpcError,
14
+ ResourceUnavailableRpcError,
15
+ RpcError,
16
+ RpcRequestError,
17
+ TimeoutError,
18
+ TransactionRejectedRpcError,
19
+ boolToBytes,
20
+ boolToHex,
21
+ buildRequest,
22
+ bytesToBigint,
23
+ bytesToBool,
24
+ bytesToHex,
25
+ bytesToNumber,
26
+ bytesToString,
27
+ decodeAbi,
28
+ decodeBytes,
29
+ decodeHex,
30
+ decodeRlp,
31
+ encodeAbi,
32
+ encodeBytes,
33
+ encodeHex,
34
+ encodeRlp,
35
+ extractFunctionName,
36
+ extractFunctionParams,
37
+ extractFunctionType,
38
+ format,
39
+ formatBlock,
40
+ formatEther,
41
+ formatGwei,
42
+ formatTransaction,
43
+ formatTransactionRequest,
44
+ formatUnit,
45
+ getAddress,
46
+ getContractAddress,
47
+ getCreate2Address,
48
+ getCreateAddress,
49
+ getEventSignature,
50
+ getFunctionSignature,
51
+ hexToBigInt,
52
+ hexToBool,
53
+ hexToBytes,
54
+ hexToNumber,
55
+ hexToString,
56
+ isAddress,
57
+ isAddressEqual,
58
+ isBytes,
59
+ isHex,
60
+ keccak256,
61
+ numberToBytes,
62
+ numberToHex,
63
+ pad,
64
+ padBytes,
65
+ padHex,
66
+ parseEther,
67
+ parseGwei,
68
+ parseUnit,
69
+ rpc,
70
+ size,
71
+ slice,
72
+ sliceBytes,
73
+ sliceHex,
74
+ stringToBytes,
75
+ stringToHex,
76
+ trim
77
+ } from "../chunk-Z6LRV6XI.js";
78
+ export {
79
+ BaseError,
80
+ HttpRequestError,
81
+ InternalRpcError,
82
+ InvalidInputRpcError,
83
+ InvalidParamsRpcError,
84
+ InvalidRequestRpcError,
85
+ JsonRpcVersionUnsupportedError,
86
+ LimitExceededRpcError,
87
+ MethodNotFoundRpcError,
88
+ MethodNotSupportedRpcError,
89
+ ParseRpcError,
90
+ ResourceNotFoundRpcError,
91
+ ResourceUnavailableRpcError,
92
+ RpcError,
93
+ RpcRequestError,
94
+ TimeoutError,
95
+ TransactionRejectedRpcError,
96
+ boolToBytes,
97
+ boolToHex,
98
+ buildRequest,
99
+ bytesToBigint,
100
+ bytesToBool,
101
+ bytesToHex,
102
+ bytesToNumber,
103
+ bytesToString,
104
+ decodeAbi,
105
+ decodeBytes,
106
+ decodeHex,
107
+ decodeRlp,
108
+ encodeAbi,
109
+ encodeBytes,
110
+ encodeHex,
111
+ encodeRlp,
112
+ extractFunctionName,
113
+ extractFunctionParams,
114
+ extractFunctionType,
115
+ format,
116
+ formatBlock,
117
+ formatEther,
118
+ formatGwei,
119
+ formatTransaction,
120
+ formatTransactionRequest,
121
+ formatUnit,
122
+ getAddress,
123
+ getContractAddress,
124
+ getCreate2Address,
125
+ getCreateAddress,
126
+ getEventSignature,
127
+ getFunctionSignature,
128
+ hexToBigInt,
129
+ hexToBool,
130
+ hexToBytes,
131
+ hexToNumber,
132
+ hexToString,
133
+ isAddress,
134
+ isAddressEqual,
135
+ isBytes,
136
+ isHex,
137
+ keccak256,
138
+ numberToBytes,
139
+ numberToHex,
140
+ pad,
141
+ padBytes,
142
+ padHex,
143
+ parseEther,
144
+ parseGwei,
145
+ parseUnit,
146
+ rpc,
147
+ size,
148
+ slice,
149
+ sliceBytes,
150
+ sliceHex,
151
+ stringToBytes,
152
+ stringToHex,
153
+ trim
154
+ };