viem 0.0.1-alpha.2 → 0.0.1-alpha.3
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.
- package/dist/actions/index.d.ts +5 -6
- package/dist/actions/index.js +3 -2
- package/dist/chains.d.ts +2 -2
- package/dist/chains.js +2 -1
- package/dist/{chunk-3EOU525X.js → chunk-SRDTRROA.js} +61 -893
- package/dist/{chunk-YQRTXQ2G.js → chunk-TLEMV4T3.js} +2 -15
- package/dist/chunk-WZITKXV3.js +996 -0
- package/dist/{chunk-4HNVS7AM.js → chunk-YZEQFYZ3.js} +149 -200
- package/dist/clients/index.d.ts +5 -6
- package/dist/clients/index.js +2 -4
- package/dist/{createWalletClient-915223f3.d.ts → createWalletClient-15ad1601.d.ts} +1 -1
- package/dist/{eip1193-8f7c22ce.d.ts → eip1193-8b4d90ce.d.ts} +1 -1
- package/dist/index.d.ts +281 -9
- package/dist/index.js +75 -23
- package/dist/{parseGwei-fd7a0f7d.d.ts → parseGwei-0f85e8ca.d.ts} +12 -112
- package/dist/{rpc-655c0ba4.d.ts → rpc-15b85963.d.ts} +1 -1
- package/dist/{rpc-3c0e3985.d.ts → rpc-26932bae.d.ts} +1 -38
- package/dist/{transactionRequest-ade896ac.d.ts → transactionRequest-f538ea86.d.ts} +1 -1
- package/dist/utils/index.d.ts +7 -6
- package/dist/utils/index.js +9 -39
- package/dist/{watchAsset-04ab8db5.d.ts → watchAsset-0c9d01e2.d.ts} +5 -16
- package/dist/{webSocket-c6e0d26f.d.ts → webSocket-b55b0951.d.ts} +4 -9
- package/dist/window.d.ts +2 -2
- package/package.json +1 -1
- package/dist/BaseError-7688f84e.d.ts +0 -18
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-
|
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-
|
3
|
-
export { C as CustomTransport, a as CustomTransportConfig, F as FallbackTransport, b as FallbackTransportConfig, H as HttpTransport, c as HttpTransportConfig,
|
4
|
-
|
5
|
-
export {
|
6
|
-
export { B as
|
7
|
-
export { F as FormattedBlock, a as FormattedTransaction, b as FormattedTransactionRequest, f as formatBlock, c as formatTransaction, d as formatTransactionRequest } from './transactionRequest-
|
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 decodeHex, n as decodeRlp, o as encodeAbi, p as encodeBytes, q as encodeFunctionData, r as encodeHex, s as encodeRlp, z as formatEther, S as formatGwei, T as formatUnit, t as getAddress, u as getContractAddress, w as getCreate2Address, v as getCreateAddress, x as getEventSignature, y as getFunctionSignature, F as hexToBigInt, H as hexToBool, I as hexToBytes, U as hexToNumber, J as hexToString, A as isAddress, B as isAddressEqual, C as isBytes, D as isHex, K as keccak256, L as numberToBytes, V as numberToHex, M as pad, N as padBytes, O as padHex, P as parseEther, Q as parseGwei, R as parseUnit, W as size, X as slice, Y as sliceBytes, Z as sliceHex, _ as stringToBytes, $ as stringToHex, a0 as trim } from './parseGwei-0f85e8ca.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-
|
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-
|
60
|
+
} from "./chunk-YZEQFYZ3.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-
|
71
|
+
} from "./chunk-TLEMV4T3.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,12 @@ import {
|
|
97
79
|
bytesToString,
|
98
80
|
decodeAbi,
|
99
81
|
decodeBytes,
|
82
|
+
decodeFunctionData,
|
100
83
|
decodeHex,
|
101
84
|
decodeRlp,
|
102
85
|
encodeAbi,
|
103
86
|
encodeBytes,
|
104
|
-
|
87
|
+
encodeFunctionData,
|
105
88
|
encodeHex,
|
106
89
|
encodeRlp,
|
107
90
|
etherUnits,
|
@@ -145,11 +128,71 @@ import {
|
|
145
128
|
transactionType,
|
146
129
|
trim,
|
147
130
|
weiUnits
|
148
|
-
} from "./chunk-
|
131
|
+
} from "./chunk-SRDTRROA.js";
|
132
|
+
import {
|
133
|
+
AbiDecodingDataSizeInvalidError,
|
134
|
+
AbiEncodingArrayLengthMismatchError,
|
135
|
+
AbiEncodingLengthMismatchError,
|
136
|
+
AbiFunctionNotFoundError,
|
137
|
+
BaseError,
|
138
|
+
BlockNotFoundError,
|
139
|
+
DataLengthTooLongError,
|
140
|
+
DataLengthTooShortError,
|
141
|
+
HttpRequestError,
|
142
|
+
InternalRpcError,
|
143
|
+
InvalidAbiDecodingTypeError,
|
144
|
+
InvalidAbiEncodingTypeError,
|
145
|
+
InvalidAddressError,
|
146
|
+
InvalidArrayError,
|
147
|
+
InvalidBytesBooleanError,
|
148
|
+
InvalidDefinitionTypeError,
|
149
|
+
InvalidGasArgumentsError,
|
150
|
+
InvalidHexBooleanError,
|
151
|
+
InvalidHexValueError,
|
152
|
+
InvalidInputRpcError,
|
153
|
+
InvalidParamsRpcError,
|
154
|
+
InvalidRequestRpcError,
|
155
|
+
JsonRpcVersionUnsupportedError,
|
156
|
+
LimitExceededRpcError,
|
157
|
+
MethodNotFoundRpcError,
|
158
|
+
MethodNotSupportedRpcError,
|
159
|
+
OffsetOutOfBoundsError,
|
160
|
+
ParseRpcError,
|
161
|
+
RequestError,
|
162
|
+
ResourceNotFoundRpcError,
|
163
|
+
ResourceUnavailableRpcError,
|
164
|
+
RpcError,
|
165
|
+
RpcRequestError,
|
166
|
+
SizeExceedsPaddingSizeError,
|
167
|
+
TimeoutError,
|
168
|
+
TransactionNotFoundError,
|
169
|
+
TransactionReceiptNotFoundError,
|
170
|
+
TransactionRejectedRpcError,
|
171
|
+
UnknownRpcError,
|
172
|
+
UrlRequiredError,
|
173
|
+
WaitForTransactionReceiptTimeoutError,
|
174
|
+
WebSocketRequestError
|
175
|
+
} from "./chunk-WZITKXV3.js";
|
149
176
|
export {
|
177
|
+
AbiDecodingDataSizeInvalidError,
|
178
|
+
AbiEncodingArrayLengthMismatchError,
|
179
|
+
AbiEncodingLengthMismatchError,
|
180
|
+
AbiFunctionNotFoundError,
|
150
181
|
BaseError,
|
182
|
+
BlockNotFoundError,
|
183
|
+
DataLengthTooLongError,
|
184
|
+
DataLengthTooShortError,
|
151
185
|
HttpRequestError,
|
152
186
|
InternalRpcError,
|
187
|
+
InvalidAbiDecodingTypeError,
|
188
|
+
InvalidAbiEncodingTypeError,
|
189
|
+
InvalidAddressError,
|
190
|
+
InvalidArrayError,
|
191
|
+
InvalidBytesBooleanError,
|
192
|
+
InvalidDefinitionTypeError,
|
193
|
+
InvalidGasArgumentsError,
|
194
|
+
InvalidHexBooleanError,
|
195
|
+
InvalidHexValueError,
|
153
196
|
InvalidInputRpcError,
|
154
197
|
InvalidParamsRpcError,
|
155
198
|
InvalidRequestRpcError,
|
@@ -157,14 +200,22 @@ export {
|
|
157
200
|
LimitExceededRpcError,
|
158
201
|
MethodNotFoundRpcError,
|
159
202
|
MethodNotSupportedRpcError,
|
203
|
+
OffsetOutOfBoundsError,
|
160
204
|
ParseRpcError,
|
205
|
+
RequestError,
|
161
206
|
ResourceNotFoundRpcError,
|
162
207
|
ResourceUnavailableRpcError,
|
163
208
|
RpcError,
|
164
209
|
RpcRequestError,
|
210
|
+
SizeExceedsPaddingSizeError,
|
165
211
|
TimeoutError,
|
212
|
+
TransactionNotFoundError,
|
213
|
+
TransactionReceiptNotFoundError,
|
166
214
|
TransactionRejectedRpcError,
|
215
|
+
UnknownRpcError,
|
167
216
|
UrlRequiredError,
|
217
|
+
WaitForTransactionReceiptTimeoutError,
|
218
|
+
WebSocketRequestError,
|
168
219
|
addChain,
|
169
220
|
boolToBytes,
|
170
221
|
boolToHex,
|
@@ -184,12 +235,13 @@ export {
|
|
184
235
|
custom,
|
185
236
|
decodeAbi,
|
186
237
|
decodeBytes,
|
238
|
+
decodeFunctionData,
|
187
239
|
decodeHex,
|
188
240
|
decodeRlp,
|
189
241
|
dropTransaction,
|
190
242
|
encodeAbi,
|
191
243
|
encodeBytes,
|
192
|
-
|
244
|
+
encodeFunctionData,
|
193
245
|
encodeHex,
|
194
246
|
encodeRlp,
|
195
247
|
estimateGas,
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import { Abi, AbiFunction, ExtractAbiFunction, AbiParametersToPrimitiveTypes, AbiParameter, ExtractAbiFunctionNames } from 'abitype';
|
2
|
-
import {
|
3
|
-
import { B as BaseError } from './BaseError-7688f84e.js';
|
4
|
-
import { R as RpcError } from './rpc-3c0e3985.js';
|
2
|
+
import { a as Hex, A as Address, B as ByteArray } from './rpc-15b85963.js';
|
5
3
|
|
6
4
|
type ExtractArgsFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiFunction extends AbiFunction & {
|
7
5
|
type: 'function';
|
@@ -24,14 +22,14 @@ declare function decodeAbi<TParams extends readonly AbiParameter[]>({ data, para
|
|
24
22
|
data: Hex;
|
25
23
|
params: TParams;
|
26
24
|
}): AbiParametersToPrimitiveTypes<TParams>;
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
}
|
25
|
+
|
26
|
+
declare function decodeFunctionData({ abi, data }: {
|
27
|
+
abi: Abi;
|
28
|
+
data: Hex;
|
29
|
+
}): {
|
30
|
+
functionName: string;
|
31
|
+
args: readonly unknown[] | undefined;
|
32
|
+
};
|
35
33
|
|
36
34
|
/**
|
37
35
|
* @description Encodes a list of primitive values into an ABI-encoded hex value.
|
@@ -40,31 +38,8 @@ declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, va
|
|
40
38
|
params: TParams;
|
41
39
|
values: AbiParametersToPrimitiveTypes<TParams>;
|
42
40
|
}): `0x${string}` | undefined;
|
43
|
-
|
44
|
-
|
45
|
-
constructor({ expectedLength, givenLength, type, }: {
|
46
|
-
expectedLength: number;
|
47
|
-
givenLength: number;
|
48
|
-
type: string;
|
49
|
-
});
|
50
|
-
}
|
51
|
-
declare class AbiEncodingLengthMismatchError extends BaseError {
|
52
|
-
name: string;
|
53
|
-
constructor({ expectedLength, givenLength, }: {
|
54
|
-
expectedLength: number;
|
55
|
-
givenLength: number;
|
56
|
-
});
|
57
|
-
}
|
58
|
-
declare class InvalidAbiEncodingTypeError 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
|
-
|
67
|
-
declare function encodeFunctionParams<TAbi extends Abi = Abi, TFunctionName extends ExtractAbiFunctionNames<TAbi> = any>({ abi, args, functionName, }: {
|
41
|
+
|
42
|
+
declare function encodeFunctionData<TAbi extends Abi = Abi, TFunctionName extends ExtractAbiFunctionNames<TAbi> = any>({ abi, args, functionName, }: {
|
68
43
|
abi: TAbi;
|
69
44
|
functionName: TFunctionName;
|
70
45
|
} & ExtractArgsFromAbi<TAbi, TFunctionName>): `0x${string}`;
|
@@ -93,81 +68,6 @@ declare function isAddress(address: Address): boolean;
|
|
93
68
|
|
94
69
|
declare function isAddressEqual(a: Address, b: Address): boolean;
|
95
70
|
|
96
|
-
declare function buildRequest<TRequest extends (args: any) => Promise<any>>(request: TRequest): TRequest;
|
97
|
-
declare class RequestError extends BaseError {
|
98
|
-
constructor(err: Error, { docsPath, humanMessage }: {
|
99
|
-
docsPath?: string;
|
100
|
-
humanMessage: string;
|
101
|
-
});
|
102
|
-
}
|
103
|
-
declare class RpcRequestError extends RequestError {
|
104
|
-
code: number;
|
105
|
-
constructor(err: RpcError, { docsPath, humanMessage }: {
|
106
|
-
docsPath?: string;
|
107
|
-
humanMessage: string;
|
108
|
-
});
|
109
|
-
}
|
110
|
-
declare class ParseRpcError extends RpcRequestError {
|
111
|
-
name: string;
|
112
|
-
code: number;
|
113
|
-
constructor(err: RpcError);
|
114
|
-
}
|
115
|
-
declare class InvalidRequestRpcError extends RpcRequestError {
|
116
|
-
name: string;
|
117
|
-
code: number;
|
118
|
-
constructor(err: RpcError);
|
119
|
-
}
|
120
|
-
declare class MethodNotFoundRpcError extends RpcRequestError {
|
121
|
-
name: string;
|
122
|
-
code: number;
|
123
|
-
constructor(err: RpcError);
|
124
|
-
}
|
125
|
-
declare class InvalidParamsRpcError extends RpcRequestError {
|
126
|
-
name: string;
|
127
|
-
code: number;
|
128
|
-
constructor(err: RpcError);
|
129
|
-
}
|
130
|
-
declare class InternalRpcError extends RpcRequestError {
|
131
|
-
name: string;
|
132
|
-
code: number;
|
133
|
-
constructor(err: RpcError);
|
134
|
-
}
|
135
|
-
declare class InvalidInputRpcError extends RpcRequestError {
|
136
|
-
name: string;
|
137
|
-
code: number;
|
138
|
-
constructor(err: RpcError);
|
139
|
-
}
|
140
|
-
declare class ResourceNotFoundRpcError extends RpcRequestError {
|
141
|
-
name: string;
|
142
|
-
code: number;
|
143
|
-
constructor(err: RpcError);
|
144
|
-
}
|
145
|
-
declare class ResourceUnavailableRpcError extends RpcRequestError {
|
146
|
-
name: string;
|
147
|
-
code: number;
|
148
|
-
constructor(err: RpcError);
|
149
|
-
}
|
150
|
-
declare class TransactionRejectedRpcError extends RpcRequestError {
|
151
|
-
name: string;
|
152
|
-
code: number;
|
153
|
-
constructor(err: RpcError);
|
154
|
-
}
|
155
|
-
declare class MethodNotSupportedRpcError extends RpcRequestError {
|
156
|
-
name: string;
|
157
|
-
code: number;
|
158
|
-
constructor(err: RpcError);
|
159
|
-
}
|
160
|
-
declare class LimitExceededRpcError extends RpcRequestError {
|
161
|
-
name: string;
|
162
|
-
code: number;
|
163
|
-
constructor(err: RpcError);
|
164
|
-
}
|
165
|
-
declare class JsonRpcVersionUnsupportedError extends RpcRequestError {
|
166
|
-
name: string;
|
167
|
-
code: number;
|
168
|
-
constructor(err: RpcError);
|
169
|
-
}
|
170
|
-
|
171
71
|
declare function isBytes(value: any): boolean;
|
172
72
|
|
173
73
|
declare function isHex(value: any): boolean;
|
@@ -345,4 +245,4 @@ declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
|
|
345
245
|
|
346
246
|
declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
|
347
247
|
|
348
|
-
export {
|
248
|
+
export { stringToHex as $, isAddress as A, isAddressEqual as B, isBytes as C, isHex as D, EncodeRlpResponse as E, hexToBigInt as F, GetContractAddressOptions as G, hexToBool as H, hexToBytes as I, hexToString as J, keccak256 as K, numberToBytes as L, pad as M, padBytes as N, padHex as O, parseEther as P, parseGwei as Q, parseUnit as R, formatGwei as S, formatUnit as T, hexToNumber as U, numberToHex as V, size as W, slice as X, sliceBytes as Y, sliceHex as Z, stringToBytes as _, GetCreateAddressOptions as a, trim as a0, GetCreate2AddressOptions as b, bytesToHex as c, bytesToString as d, boolToBytes as e, boolToHex as f, bytesToBigint as g, bytesToBool as h, bytesToNumber as i, decodeAbi as j, decodeBytes as k, decodeFunctionData as l, decodeHex as m, decodeRlp as n, encodeAbi as o, encodeBytes as p, encodeFunctionData as q, encodeHex as r, encodeRlp as s, getAddress as t, getContractAddress as u, getCreateAddress as v, getCreate2Address as w, getEventSignature as x, getFunctionSignature as y, formatEther as z };
|
@@ -289,4 +289,4 @@ type RpcTransactionReceipt = TransactionReceipt<Quantity, Index, Status, Transac
|
|
289
289
|
type RpcTransactionRequest = TransactionRequest<Quantity, Index>;
|
290
290
|
type RpcTransaction = TransactionLegacy<Quantity, Index, '0x0'> | TransactionEIP2930<Quantity, Index, '0x1'> | TransactionEIP1559<Quantity, Index, '0x2'>;
|
291
291
|
|
292
|
-
export { Address as A,
|
292
|
+
export { Address as A, ByteArray as B, TransactionRequestLegacy as C, Transaction as D, TransactionBase as E, FeeHistory as F, TransactionEIP1559 as G, Hash 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, Hex as a, BlockTag as b, AccessList as c, Block as d, etherUnits as e, BlockIdentifier as f, gweiUnits as g, BlockNumber as h, FeeValues as i, FeeValuesEIP1559 as j, FeeValuesLegacy 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 };
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import { B as BaseError } from './BaseError-7688f84e.js';
|
2
|
-
|
3
1
|
type SuccessResult<T> = {
|
4
2
|
method?: never;
|
5
3
|
result: T;
|
@@ -59,40 +57,5 @@ declare const rpc: {
|
|
59
57
|
webSocket: typeof webSocket;
|
60
58
|
webSocketAsync: typeof webSocketAsync;
|
61
59
|
};
|
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
60
|
|
98
|
-
export {
|
61
|
+
export { RpcResponse as R, rpc as r };
|