viem 0.0.1-alpha.2 → 0.0.1-alpha.4

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.
@@ -1,9 +1,9 @@
1
1
  import {
2
- BaseError,
2
+ UrlRequiredError,
3
3
  buildRequest,
4
4
  getSocket,
5
5
  rpc
6
- } from "./chunk-3EOU525X.js";
6
+ } from "./chunk-COHLCIQM.js";
7
7
 
8
8
  // src/clients/transports/createTransport.ts
9
9
  function createTransport(config, value) {
@@ -13,18 +13,6 @@ function createTransport(config, value) {
13
13
  };
14
14
  }
15
15
 
16
- // src/clients/transports/errors.ts
17
- var UrlRequiredError = class extends BaseError {
18
- constructor() {
19
- super(
20
- "No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",
21
- {
22
- docsPath: "/TODO"
23
- }
24
- );
25
- }
26
- };
27
-
28
16
  // src/clients/transports/custom.ts
29
17
  function custom(provider, { key = "custom", name = "Custom Provider" } = {}) {
30
18
  return () => createTransport({
@@ -259,7 +247,6 @@ function createWalletClient({
259
247
 
260
248
  export {
261
249
  createTransport,
262
- UrlRequiredError,
263
250
  custom,
264
251
  fallback,
265
252
  http,
@@ -1,8 +1,7 @@
1
- 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';
2
- 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';
1
+ 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-15ad1601.js';
2
+ export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from '../webSocket-b55b0951.js';
3
3
  import '../chains.js';
4
- import '../rpc-655c0ba4.js';
4
+ import '../rpc-15b85963.js';
5
5
  import '@wagmi/chains';
6
- import '../eip1193-8f7c22ce.js';
7
- import '../BaseError-7688f84e.js';
8
- import '../rpc-3c0e3985.js';
6
+ import '../eip1193-8b4d90ce.js';
7
+ import '../rpc-26932bae.js';
@@ -1,5 +1,4 @@
1
1
  import {
2
- UrlRequiredError,
3
2
  createClient,
4
3
  createPublicClient,
5
4
  createTestClient,
@@ -9,10 +8,9 @@ import {
9
8
  fallback,
10
9
  http,
11
10
  webSocket
12
- } from "../chunk-YQRTXQ2G.js";
13
- import "../chunk-3EOU525X.js";
11
+ } from "../chunk-ZGVHEFCJ.js";
12
+ import "../chunk-COHLCIQM.js";
14
13
  export {
15
- UrlRequiredError,
16
14
  createClient,
17
15
  createPublicClient,
18
16
  createTestClient,
@@ -1,5 +1,5 @@
1
1
  import { Chain } from './chains.js';
2
- import { R as Requests, P as PublicRequests, T as TestRequests, S as SignableRequests, b as WalletRequests } from './eip1193-8f7c22ce.js';
2
+ import { R as Requests, P as PublicRequests, T as TestRequests, S as SignableRequests, b as WalletRequests } from './eip1193-8b4d90ce.js';
3
3
 
4
4
  type BaseRpcRequests = {
5
5
  request(...args: any): Promise<any>;
@@ -1,4 +1,4 @@
1
- import { A as Address, k as Hash, Q as Quantity, s as RpcTransactionRequest, m as RpcBlockNumber, d as BlockTag, l as RpcBlockIdentifier, H as Hex, P as RpcEstimateGasParameters, n as RpcFeeHistory, R as RpcBlock, p as RpcLog, q as RpcTransaction, r as RpcTransactionReceipt, u as RpcUncle } from './rpc-655c0ba4.js';
1
+ import { A as Address, H as Hash, Q as Quantity, s as RpcTransactionRequest, m as RpcBlockNumber, b as BlockTag, l as RpcBlockIdentifier, a as Hex, P as RpcEstimateGasParameters, n as RpcFeeHistory, R as RpcBlock, p as RpcLog, q as RpcTransaction, r as RpcTransactionReceipt, u as RpcUncle } from './rpc-15b85963.js';
2
2
 
3
3
  declare class RpcError extends Error {
4
4
  code: number;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,284 @@
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
- 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 { 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 encodeFunctionParams, C as encodeHex, D as encodeRlp, S as formatEther, a8 as formatGwei, a9 as formatUnit, F as getAddress, H as getContractAddress, N as getCreate2Address, K as getCreateAddress, O as getEventSignature, Q as getFunctionSignature, Y as hexToBigInt, Z as hexToBool, _ as hexToBytes, aa as hexToNumber, $ as hexToString, U as isAddress, V as isAddressEqual, W as isBytes, X as isHex, a0 as keccak256, a1 as numberToBytes, ab as numberToHex, a2 as pad, a3 as padBytes, a4 as padHex, a5 as parseEther, a6 as parseGwei, a7 as parseUnit, ac as size, ad as slice, ae as sliceBytes, af as sliceHex, ag as stringToBytes, ah as stringToHex, ai as trim } from './parseGwei-fd7a0f7d.js';
6
- export { B as BaseError } from './BaseError-7688f84e.js';
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
- export { H as HttpRequestError, R as RpcError, T as TimeoutError } from './rpc-3c0e3985.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-0c9d01e2.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-15ad1601.js';
3
+ export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig, W as WebSocketTransport, d as WebSocketTransportConfig, e as custom, f as fallback, h as http, w as webSocket } from './webSocket-b55b0951.js';
4
+ import { A as Address, H as Hash, B as ByteArray, a as Hex, b as BlockTag } from './rpc-15b85963.js';
5
+ export { c as AccessList, A as Address, d as Block, f as BlockIdentifier, h as BlockNumber, b as BlockTag, B as ByteArray, F as FeeHistory, i as FeeValues, j as FeeValuesEIP1559, k as FeeValuesLegacy, H as Hash, a 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-15b85963.js';
6
+ export { E as EncodeRlpResponse, G as GetContractAddressOptions, b as GetCreate2AddressOptions, a as GetCreateAddressOptions, e as boolToBytes, f as boolToHex, g as bytesToBigint, h as bytesToBool, c as bytesToHex, i as bytesToNumber, d as bytesToString, j as decodeAbi, k as decodeBytes, l as decodeFunctionData, m as decodeFunctionResult, n as decodeHex, o as decodeRlp, p as encodeAbi, q as encodeBytes, r as encodeFunctionData, s as encodeHex, t as encodeRlp, A as formatEther, T as formatGwei, U as formatUnit, u as getAddress, v as getContractAddress, x as getCreate2Address, w as getCreateAddress, y as getEventSignature, z as getFunctionSignature, H as hexToBigInt, I as hexToBool, J as hexToBytes, V as hexToNumber, K as hexToString, B as isAddress, C as isAddressEqual, D as isBytes, F as isHex, L as keccak256, M as numberToBytes, W as numberToHex, N as pad, O as padBytes, P as padHex, Q as parseEther, R as parseGwei, S as parseUnit, X as size, Y as slice, Z as sliceBytes, _ as sliceHex, $ as stringToBytes, a0 as stringToHex, a1 as trim } from './parseGwei-a952d720.js';
7
+ export { F as FormattedBlock, a as FormattedTransaction, b as FormattedTransactionRequest, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from './transactionRequest-f538ea86.js';
9
8
  import './chains.js';
10
9
  import '@wagmi/chains';
11
- import './eip1193-8f7c22ce.js';
10
+ import './eip1193-8b4d90ce.js';
11
+ import './rpc-26932bae.js';
12
12
  import 'abitype';
13
+
14
+ type BaseErrorArgs = {
15
+ docsPath?: string;
16
+ } & ({
17
+ cause?: never;
18
+ details?: string;
19
+ } | {
20
+ cause: BaseError | Error;
21
+ details?: never;
22
+ });
23
+ declare class BaseError extends Error {
24
+ humanMessage: string;
25
+ details: string;
26
+ docsPath?: string;
27
+ name: string;
28
+ constructor(humanMessage: string, args?: BaseErrorArgs);
29
+ }
30
+
31
+ declare class AbiDecodingDataSizeInvalidError extends BaseError {
32
+ name: string;
33
+ constructor(size: number);
34
+ }
35
+ declare class AbiEncodingArrayLengthMismatchError extends BaseError {
36
+ name: string;
37
+ constructor({ expectedLength, givenLength, type, }: {
38
+ expectedLength: number;
39
+ givenLength: number;
40
+ type: string;
41
+ });
42
+ }
43
+ declare class AbiEncodingLengthMismatchError extends BaseError {
44
+ name: string;
45
+ constructor({ expectedLength, givenLength, }: {
46
+ expectedLength: number;
47
+ givenLength: number;
48
+ });
49
+ }
50
+ declare class AbiFunctionNotFoundError extends BaseError {
51
+ name: string;
52
+ constructor(functionName: string);
53
+ }
54
+ declare class InvalidAbiEncodingTypeError extends BaseError {
55
+ name: string;
56
+ constructor(type: string);
57
+ }
58
+ declare class InvalidAbiDecodingTypeError extends BaseError {
59
+ name: string;
60
+ constructor(type: string);
61
+ }
62
+ declare class InvalidArrayError extends BaseError {
63
+ name: string;
64
+ constructor(value: unknown);
65
+ }
66
+ declare class InvalidDefinitionTypeError extends BaseError {
67
+ name: string;
68
+ constructor(type: string);
69
+ }
70
+
71
+ declare class InvalidAddressError extends BaseError {
72
+ name: string;
73
+ constructor({ address }: {
74
+ address: Address;
75
+ });
76
+ }
77
+
78
+ declare class BlockNotFoundError extends BaseError {
79
+ name: string;
80
+ constructor({ blockHash, blockNumber, }: {
81
+ blockHash?: Hash;
82
+ blockNumber?: bigint;
83
+ });
84
+ }
85
+
86
+ declare class SizeExceedsPaddingSizeError extends BaseError {
87
+ name: string;
88
+ constructor({ size, targetSize, type, }: {
89
+ size: number;
90
+ targetSize: number;
91
+ type: 'hex' | 'bytes';
92
+ });
93
+ }
94
+
95
+ declare class DataLengthTooLongError extends BaseError {
96
+ name: string;
97
+ constructor({ consumed, length }: {
98
+ consumed: number;
99
+ length: number;
100
+ });
101
+ }
102
+ declare class DataLengthTooShortError extends BaseError {
103
+ name: string;
104
+ constructor({ length, dataLength }: {
105
+ length: number;
106
+ dataLength: number;
107
+ });
108
+ }
109
+ declare class InvalidBytesBooleanError extends BaseError {
110
+ name: string;
111
+ constructor(bytes: ByteArray);
112
+ }
113
+ declare class InvalidHexBooleanError extends BaseError {
114
+ name: string;
115
+ constructor(hex: Hex);
116
+ }
117
+ declare class InvalidHexValueError extends BaseError {
118
+ name: string;
119
+ constructor(value: Hex);
120
+ }
121
+ declare class OffsetOutOfBoundsError extends BaseError {
122
+ name: string;
123
+ constructor({ nextOffset, offset }: {
124
+ nextOffset: number;
125
+ offset: number;
126
+ });
127
+ }
128
+
129
+ declare class HttpRequestError extends BaseError {
130
+ name: string;
131
+ status: number;
132
+ constructor({ body, details, status, url, }: {
133
+ body: {
134
+ [key: string]: unknown;
135
+ };
136
+ details: string;
137
+ status: number;
138
+ url: string;
139
+ });
140
+ }
141
+ declare class WebSocketRequestError extends BaseError {
142
+ name: string;
143
+ constructor({ body, details, url, }: {
144
+ body: {
145
+ [key: string]: unknown;
146
+ };
147
+ details: string;
148
+ url: string;
149
+ });
150
+ }
151
+ declare class RpcError extends BaseError {
152
+ code: number;
153
+ name: string;
154
+ constructor({ body, error, url, }: {
155
+ body: {
156
+ [key: string]: unknown;
157
+ };
158
+ error: {
159
+ code: number;
160
+ message: string;
161
+ };
162
+ url: string;
163
+ });
164
+ }
165
+ declare class TimeoutError extends BaseError {
166
+ name: string;
167
+ constructor({ body, url, }: {
168
+ body: {
169
+ [key: string]: unknown;
170
+ };
171
+ url: string;
172
+ });
173
+ }
174
+
175
+ declare class RequestError extends BaseError {
176
+ constructor(err: Error, { docsPath, humanMessage }: {
177
+ docsPath?: string;
178
+ humanMessage: string;
179
+ });
180
+ }
181
+ declare class RpcRequestError extends RequestError {
182
+ code: number;
183
+ constructor(err: RpcError, { docsPath, humanMessage }: {
184
+ docsPath?: string;
185
+ humanMessage: string;
186
+ });
187
+ }
188
+ declare class ParseRpcError extends RpcRequestError {
189
+ name: string;
190
+ code: number;
191
+ constructor(err: RpcError);
192
+ }
193
+ declare class InvalidRequestRpcError extends RpcRequestError {
194
+ name: string;
195
+ code: number;
196
+ constructor(err: RpcError);
197
+ }
198
+ declare class MethodNotFoundRpcError extends RpcRequestError {
199
+ name: string;
200
+ code: number;
201
+ constructor(err: RpcError);
202
+ }
203
+ declare class InvalidParamsRpcError extends RpcRequestError {
204
+ name: string;
205
+ code: number;
206
+ constructor(err: RpcError);
207
+ }
208
+ declare class InternalRpcError extends RpcRequestError {
209
+ name: string;
210
+ code: number;
211
+ constructor(err: RpcError);
212
+ }
213
+ declare class InvalidInputRpcError extends RpcRequestError {
214
+ name: string;
215
+ code: number;
216
+ constructor(err: RpcError);
217
+ }
218
+ declare class ResourceNotFoundRpcError extends RpcRequestError {
219
+ name: string;
220
+ code: number;
221
+ constructor(err: RpcError);
222
+ }
223
+ declare class ResourceUnavailableRpcError extends RpcRequestError {
224
+ name: string;
225
+ code: number;
226
+ constructor(err: RpcError);
227
+ }
228
+ declare class TransactionRejectedRpcError extends RpcRequestError {
229
+ name: string;
230
+ code: number;
231
+ constructor(err: RpcError);
232
+ }
233
+ declare class MethodNotSupportedRpcError extends RpcRequestError {
234
+ name: string;
235
+ code: number;
236
+ constructor(err: RpcError);
237
+ }
238
+ declare class LimitExceededRpcError extends RpcRequestError {
239
+ name: string;
240
+ code: number;
241
+ constructor(err: RpcError);
242
+ }
243
+ declare class JsonRpcVersionUnsupportedError extends RpcRequestError {
244
+ name: string;
245
+ code: number;
246
+ constructor(err: RpcError);
247
+ }
248
+ declare class UnknownRpcError extends RequestError {
249
+ name: string;
250
+ constructor(err: Error);
251
+ }
252
+
253
+ declare class InvalidGasArgumentsError extends BaseError {
254
+ name: string;
255
+ constructor();
256
+ }
257
+ declare class TransactionNotFoundError extends BaseError {
258
+ name: string;
259
+ constructor({ blockHash, blockNumber, blockTag, hash, index, }: {
260
+ blockHash?: Hash;
261
+ blockNumber?: bigint;
262
+ blockTag?: BlockTag;
263
+ hash?: Hash;
264
+ index?: number;
265
+ });
266
+ }
267
+ declare class TransactionReceiptNotFoundError extends BaseError {
268
+ name: string;
269
+ constructor({ hash }: {
270
+ hash: Hash;
271
+ });
272
+ }
273
+ declare class WaitForTransactionReceiptTimeoutError extends BaseError {
274
+ name: string;
275
+ constructor({ hash }: {
276
+ hash: Hash;
277
+ });
278
+ }
279
+
280
+ declare class UrlRequiredError extends BaseError {
281
+ constructor();
282
+ }
283
+
284
+ export { AbiDecodingDataSizeInvalidError, AbiEncodingArrayLengthMismatchError, AbiEncodingLengthMismatchError, AbiFunctionNotFoundError, BaseError, BlockNotFoundError, DataLengthTooLongError, DataLengthTooShortError, HttpRequestError, InternalRpcError, InvalidAbiDecodingTypeError, InvalidAbiEncodingTypeError, InvalidAddressError, InvalidArrayError, InvalidBytesBooleanError, InvalidDefinitionTypeError, InvalidGasArgumentsError, InvalidHexBooleanError, InvalidHexValueError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, OffsetOutOfBoundsError, ParseRpcError, RequestError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, RpcError, RpcRequestError, SizeExceedsPaddingSizeError, TimeoutError, TransactionNotFoundError, TransactionReceiptNotFoundError, TransactionRejectedRpcError, UnknownRpcError, UrlRequiredError, WaitForTransactionReceiptTimeoutError, WebSocketRequestError };
package/dist/index.js CHANGED
@@ -57,9 +57,8 @@ import {
57
57
  watchBlockNumber,
58
58
  watchBlocks,
59
59
  watchPendingTransactions
60
- } from "./chunk-4HNVS7AM.js";
60
+ } from "./chunk-43X52QQL.js";
61
61
  import {
62
- UrlRequiredError,
63
62
  createClient,
64
63
  createPublicClient,
65
64
  createTestClient,
@@ -69,25 +68,8 @@ import {
69
68
  fallback,
70
69
  http,
71
70
  webSocket
72
- } from "./chunk-YQRTXQ2G.js";
71
+ } from "./chunk-ZGVHEFCJ.js";
73
72
  import {
74
- BaseError,
75
- HttpRequestError,
76
- InternalRpcError,
77
- InvalidInputRpcError,
78
- InvalidParamsRpcError,
79
- InvalidRequestRpcError,
80
- JsonRpcVersionUnsupportedError,
81
- LimitExceededRpcError,
82
- MethodNotFoundRpcError,
83
- MethodNotSupportedRpcError,
84
- ParseRpcError,
85
- ResourceNotFoundRpcError,
86
- ResourceUnavailableRpcError,
87
- RpcError,
88
- RpcRequestError,
89
- TimeoutError,
90
- TransactionRejectedRpcError,
91
73
  boolToBytes,
92
74
  boolToHex,
93
75
  bytesToBigint,
@@ -97,11 +79,13 @@ import {
97
79
  bytesToString,
98
80
  decodeAbi,
99
81
  decodeBytes,
82
+ decodeFunctionData,
83
+ decodeFunctionResult,
100
84
  decodeHex,
101
85
  decodeRlp,
102
86
  encodeAbi,
103
87
  encodeBytes,
104
- encodeFunctionParams,
88
+ encodeFunctionData,
105
89
  encodeHex,
106
90
  encodeRlp,
107
91
  etherUnits,
@@ -145,11 +129,71 @@ import {
145
129
  transactionType,
146
130
  trim,
147
131
  weiUnits
148
- } from "./chunk-3EOU525X.js";
132
+ } from "./chunk-ROF2KQ2X.js";
133
+ import {
134
+ AbiDecodingDataSizeInvalidError,
135
+ AbiEncodingArrayLengthMismatchError,
136
+ AbiEncodingLengthMismatchError,
137
+ AbiFunctionNotFoundError,
138
+ BaseError,
139
+ BlockNotFoundError,
140
+ DataLengthTooLongError,
141
+ DataLengthTooShortError,
142
+ HttpRequestError,
143
+ InternalRpcError,
144
+ InvalidAbiDecodingTypeError,
145
+ InvalidAbiEncodingTypeError,
146
+ InvalidAddressError,
147
+ InvalidArrayError,
148
+ InvalidBytesBooleanError,
149
+ InvalidDefinitionTypeError,
150
+ InvalidGasArgumentsError,
151
+ InvalidHexBooleanError,
152
+ InvalidHexValueError,
153
+ InvalidInputRpcError,
154
+ InvalidParamsRpcError,
155
+ InvalidRequestRpcError,
156
+ JsonRpcVersionUnsupportedError,
157
+ LimitExceededRpcError,
158
+ MethodNotFoundRpcError,
159
+ MethodNotSupportedRpcError,
160
+ OffsetOutOfBoundsError,
161
+ ParseRpcError,
162
+ RequestError,
163
+ ResourceNotFoundRpcError,
164
+ ResourceUnavailableRpcError,
165
+ RpcError,
166
+ RpcRequestError,
167
+ SizeExceedsPaddingSizeError,
168
+ TimeoutError,
169
+ TransactionNotFoundError,
170
+ TransactionReceiptNotFoundError,
171
+ TransactionRejectedRpcError,
172
+ UnknownRpcError,
173
+ UrlRequiredError,
174
+ WaitForTransactionReceiptTimeoutError,
175
+ WebSocketRequestError
176
+ } from "./chunk-COHLCIQM.js";
149
177
  export {
178
+ AbiDecodingDataSizeInvalidError,
179
+ AbiEncodingArrayLengthMismatchError,
180
+ AbiEncodingLengthMismatchError,
181
+ AbiFunctionNotFoundError,
150
182
  BaseError,
183
+ BlockNotFoundError,
184
+ DataLengthTooLongError,
185
+ DataLengthTooShortError,
151
186
  HttpRequestError,
152
187
  InternalRpcError,
188
+ InvalidAbiDecodingTypeError,
189
+ InvalidAbiEncodingTypeError,
190
+ InvalidAddressError,
191
+ InvalidArrayError,
192
+ InvalidBytesBooleanError,
193
+ InvalidDefinitionTypeError,
194
+ InvalidGasArgumentsError,
195
+ InvalidHexBooleanError,
196
+ InvalidHexValueError,
153
197
  InvalidInputRpcError,
154
198
  InvalidParamsRpcError,
155
199
  InvalidRequestRpcError,
@@ -157,14 +201,22 @@ export {
157
201
  LimitExceededRpcError,
158
202
  MethodNotFoundRpcError,
159
203
  MethodNotSupportedRpcError,
204
+ OffsetOutOfBoundsError,
160
205
  ParseRpcError,
206
+ RequestError,
161
207
  ResourceNotFoundRpcError,
162
208
  ResourceUnavailableRpcError,
163
209
  RpcError,
164
210
  RpcRequestError,
211
+ SizeExceedsPaddingSizeError,
165
212
  TimeoutError,
213
+ TransactionNotFoundError,
214
+ TransactionReceiptNotFoundError,
166
215
  TransactionRejectedRpcError,
216
+ UnknownRpcError,
167
217
  UrlRequiredError,
218
+ WaitForTransactionReceiptTimeoutError,
219
+ WebSocketRequestError,
168
220
  addChain,
169
221
  boolToBytes,
170
222
  boolToHex,
@@ -184,12 +236,14 @@ export {
184
236
  custom,
185
237
  decodeAbi,
186
238
  decodeBytes,
239
+ decodeFunctionData,
240
+ decodeFunctionResult,
187
241
  decodeHex,
188
242
  decodeRlp,
189
243
  dropTransaction,
190
244
  encodeAbi,
191
245
  encodeBytes,
192
- encodeFunctionParams,
246
+ encodeFunctionData,
193
247
  encodeHex,
194
248
  encodeRlp,
195
249
  estimateGas,