viem 0.0.1-alpha.1 → 0.0.1-alpha.11
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/actions/package.json +1 -1
- package/chains/package.json +1 -1
- package/clients/package.json +1 -1
- package/dist/actions/index.d.ts +6 -6
- package/dist/actions/index.js +125 -123
- package/dist/actions/index.mjs +125 -0
- package/dist/chains.d.ts +651 -21
- package/dist/chains.js +76 -75
- package/dist/chains.mjs +134 -0
- package/dist/chunk-35OJIFIW.js +2619 -0
- package/dist/{chunk-Z6LRV6XI.js → chunk-DY4MSK2M.mjs} +1052 -411
- package/dist/chunk-GXCYE2PD.js +258 -0
- package/dist/{chunk-LLYFXUSV.js → chunk-JXGK2LUM.mjs} +184 -198
- package/dist/chunk-PEAG3TIC.js +1084 -0
- package/dist/{chunk-OQTFTQTO.js → chunk-TP542F7H.mjs} +44 -63
- package/dist/clients/index.d.ts +5 -6
- package/dist/clients/index.js +23 -25
- package/dist/clients/index.mjs +23 -0
- package/dist/{createWalletClient-915223f3.d.ts → createWalletClient-3f9fa8b6.d.ts} +1 -1
- package/dist/{eip1193-8f7c22ce.d.ts → eip1193-c001fcd5.d.ts} +3 -3
- package/dist/index.d.ts +341 -10
- package/dist/index.js +374 -290
- package/dist/index.mjs +374 -0
- package/dist/{parseGwei-bbc055e4.d.ts → parseGwei-7c87ff41.d.ts} +70 -118
- package/dist/{rpc-3c0e3985.d.ts → rpc-26932bae.d.ts} +1 -38
- package/dist/{rpc-655c0ba4.d.ts → rpc-b77c5aee.d.ts} +1 -1
- package/dist/transactionRequest-08d30731.d.ts +132 -0
- package/dist/utils/index.d.ts +41 -7
- package/dist/utils/index.js +148 -154
- package/dist/utils/index.mjs +148 -0
- package/dist/{watchAsset-04ab8db5.d.ts → watchAsset-43255bfd.d.ts} +17 -16
- package/dist/{webSocket-c6e0d26f.d.ts → webSocket-3385e295.d.ts} +4 -9
- package/dist/window.d.ts +2 -2
- package/dist/window.js +1 -0
- package/dist/window.mjs +0 -0
- package/package.json +9 -62
- package/utils/package.json +1 -1
- package/window/package.json +1 -1
- package/dist/BaseError-7688f84e.d.ts +0 -18
- package/dist/transactionRequest-ade896ac.d.ts +0 -44
package/dist/index.mjs
ADDED
@@ -0,0 +1,374 @@
|
|
1
|
+
import {
|
2
|
+
addChain,
|
3
|
+
call,
|
4
|
+
callContract,
|
5
|
+
createBlockFilter,
|
6
|
+
createPendingTransactionFilter,
|
7
|
+
dropTransaction,
|
8
|
+
estimateGas,
|
9
|
+
getAccounts,
|
10
|
+
getAutomine,
|
11
|
+
getBalance,
|
12
|
+
getBlock,
|
13
|
+
getBlockNumber,
|
14
|
+
getBlockTransactionCount,
|
15
|
+
getChainId,
|
16
|
+
getFeeHistory,
|
17
|
+
getFilterChanges,
|
18
|
+
getFilterLogs,
|
19
|
+
getGasPrice,
|
20
|
+
getPermissions,
|
21
|
+
getTransaction,
|
22
|
+
getTransactionConfirmations,
|
23
|
+
getTransactionCount,
|
24
|
+
getTransactionReceipt,
|
25
|
+
getTxpoolContent,
|
26
|
+
getTxpoolStatus,
|
27
|
+
impersonateAccount,
|
28
|
+
increaseTime,
|
29
|
+
inspectTxpool,
|
30
|
+
mine,
|
31
|
+
removeBlockTimestampInterval,
|
32
|
+
requestAccounts,
|
33
|
+
requestPermissions,
|
34
|
+
reset,
|
35
|
+
revert,
|
36
|
+
sendTransaction,
|
37
|
+
sendUnsignedTransaction,
|
38
|
+
setAutomine,
|
39
|
+
setBalance,
|
40
|
+
setBlockGasLimit,
|
41
|
+
setBlockTimestampInterval,
|
42
|
+
setCode,
|
43
|
+
setCoinbase,
|
44
|
+
setIntervalMining,
|
45
|
+
setLoggingEnabled,
|
46
|
+
setMinGasPrice,
|
47
|
+
setNextBlockBaseFeePerGas,
|
48
|
+
setNextBlockTimestamp,
|
49
|
+
setNonce,
|
50
|
+
setStorageAt,
|
51
|
+
signMessage,
|
52
|
+
snapshot,
|
53
|
+
stopImpersonatingAccount,
|
54
|
+
switchChain,
|
55
|
+
uninstallFilter,
|
56
|
+
waitForTransactionReceipt,
|
57
|
+
watchAsset,
|
58
|
+
watchBlockNumber,
|
59
|
+
watchBlocks,
|
60
|
+
watchPendingTransactions
|
61
|
+
} from "./chunk-JXGK2LUM.mjs";
|
62
|
+
import {
|
63
|
+
createClient,
|
64
|
+
createPublicClient,
|
65
|
+
createTestClient,
|
66
|
+
createTransport,
|
67
|
+
createWalletClient,
|
68
|
+
custom,
|
69
|
+
fallback,
|
70
|
+
http,
|
71
|
+
webSocket
|
72
|
+
} from "./chunk-TP542F7H.mjs";
|
73
|
+
import {
|
74
|
+
AbiConstructorNotFoundError,
|
75
|
+
AbiConstructorParamsNotFoundError,
|
76
|
+
AbiDecodingDataSizeInvalidError,
|
77
|
+
AbiEncodingArrayLengthMismatchError,
|
78
|
+
AbiEncodingLengthMismatchError,
|
79
|
+
AbiErrorInputsNotFoundError,
|
80
|
+
AbiErrorNotFoundError,
|
81
|
+
AbiErrorSignatureNotFoundError,
|
82
|
+
AbiEventNotFoundError,
|
83
|
+
AbiFunctionNotFoundError,
|
84
|
+
AbiFunctionOutputsNotFoundError,
|
85
|
+
AbiFunctionSignatureNotFoundError,
|
86
|
+
BaseError,
|
87
|
+
BlockNotFoundError,
|
88
|
+
DataLengthTooLongError,
|
89
|
+
DataLengthTooShortError,
|
90
|
+
FilterTypeNotSupportedError,
|
91
|
+
HttpRequestError,
|
92
|
+
InternalRpcError,
|
93
|
+
InvalidAbiDecodingTypeError,
|
94
|
+
InvalidAbiEncodingTypeError,
|
95
|
+
InvalidAddressError,
|
96
|
+
InvalidArrayError,
|
97
|
+
InvalidBytesBooleanError,
|
98
|
+
InvalidDefinitionTypeError,
|
99
|
+
InvalidGasArgumentsError,
|
100
|
+
InvalidHexBooleanError,
|
101
|
+
InvalidHexValueError,
|
102
|
+
InvalidInputRpcError,
|
103
|
+
InvalidParamsRpcError,
|
104
|
+
InvalidRequestRpcError,
|
105
|
+
JsonRpcVersionUnsupportedError,
|
106
|
+
LimitExceededRpcError,
|
107
|
+
MethodNotFoundRpcError,
|
108
|
+
MethodNotSupportedRpcError,
|
109
|
+
OffsetOutOfBoundsError,
|
110
|
+
ParseRpcError,
|
111
|
+
RequestError,
|
112
|
+
ResourceNotFoundRpcError,
|
113
|
+
ResourceUnavailableRpcError,
|
114
|
+
RpcError,
|
115
|
+
RpcRequestError,
|
116
|
+
SizeExceedsPaddingSizeError,
|
117
|
+
TimeoutError,
|
118
|
+
TransactionNotFoundError,
|
119
|
+
TransactionReceiptNotFoundError,
|
120
|
+
TransactionRejectedRpcError,
|
121
|
+
UnknownRpcError,
|
122
|
+
UrlRequiredError,
|
123
|
+
WaitForTransactionReceiptTimeoutError,
|
124
|
+
WebSocketRequestError,
|
125
|
+
boolToBytes,
|
126
|
+
boolToHex,
|
127
|
+
bytesToBigint,
|
128
|
+
bytesToBool,
|
129
|
+
bytesToHex,
|
130
|
+
bytesToNumber,
|
131
|
+
bytesToString,
|
132
|
+
decodeAbi,
|
133
|
+
decodeBytes,
|
134
|
+
decodeErrorResult,
|
135
|
+
decodeFunctionData,
|
136
|
+
decodeFunctionResult,
|
137
|
+
decodeHex,
|
138
|
+
decodeRlp,
|
139
|
+
encodeAbi,
|
140
|
+
encodeBytes,
|
141
|
+
encodeDeployData,
|
142
|
+
encodeErrorResult,
|
143
|
+
encodeEventTopics,
|
144
|
+
encodeFunctionData,
|
145
|
+
encodeFunctionResult,
|
146
|
+
encodeHex,
|
147
|
+
encodeRlp,
|
148
|
+
etherUnits,
|
149
|
+
formatBlock,
|
150
|
+
formatEther,
|
151
|
+
formatGwei,
|
152
|
+
formatTransaction,
|
153
|
+
formatTransactionRequest,
|
154
|
+
formatUnit,
|
155
|
+
getAddress,
|
156
|
+
getContractAddress,
|
157
|
+
getCreate2Address,
|
158
|
+
getCreateAddress,
|
159
|
+
getEventSignature,
|
160
|
+
getFunctionSignature,
|
161
|
+
gweiUnits,
|
162
|
+
hexToBigInt,
|
163
|
+
hexToBool,
|
164
|
+
hexToBytes,
|
165
|
+
hexToNumber,
|
166
|
+
hexToString,
|
167
|
+
isAddress,
|
168
|
+
isAddressEqual,
|
169
|
+
isBytes,
|
170
|
+
isHex,
|
171
|
+
keccak256,
|
172
|
+
numberToBytes,
|
173
|
+
numberToHex,
|
174
|
+
pad,
|
175
|
+
padBytes,
|
176
|
+
padHex,
|
177
|
+
parseEther,
|
178
|
+
parseGwei,
|
179
|
+
parseUnit,
|
180
|
+
size,
|
181
|
+
slice,
|
182
|
+
sliceBytes,
|
183
|
+
sliceHex,
|
184
|
+
stringToBytes,
|
185
|
+
stringToHex,
|
186
|
+
transactionType,
|
187
|
+
trim,
|
188
|
+
weiUnits
|
189
|
+
} from "./chunk-DY4MSK2M.mjs";
|
190
|
+
export {
|
191
|
+
AbiConstructorNotFoundError,
|
192
|
+
AbiConstructorParamsNotFoundError,
|
193
|
+
AbiDecodingDataSizeInvalidError,
|
194
|
+
AbiEncodingArrayLengthMismatchError,
|
195
|
+
AbiEncodingLengthMismatchError,
|
196
|
+
AbiErrorInputsNotFoundError,
|
197
|
+
AbiErrorNotFoundError,
|
198
|
+
AbiErrorSignatureNotFoundError,
|
199
|
+
AbiEventNotFoundError,
|
200
|
+
AbiFunctionNotFoundError,
|
201
|
+
AbiFunctionOutputsNotFoundError,
|
202
|
+
AbiFunctionSignatureNotFoundError,
|
203
|
+
BaseError,
|
204
|
+
BlockNotFoundError,
|
205
|
+
DataLengthTooLongError,
|
206
|
+
DataLengthTooShortError,
|
207
|
+
FilterTypeNotSupportedError,
|
208
|
+
HttpRequestError,
|
209
|
+
InternalRpcError,
|
210
|
+
InvalidAbiDecodingTypeError,
|
211
|
+
InvalidAbiEncodingTypeError,
|
212
|
+
InvalidAddressError,
|
213
|
+
InvalidArrayError,
|
214
|
+
InvalidBytesBooleanError,
|
215
|
+
InvalidDefinitionTypeError,
|
216
|
+
InvalidGasArgumentsError,
|
217
|
+
InvalidHexBooleanError,
|
218
|
+
InvalidHexValueError,
|
219
|
+
InvalidInputRpcError,
|
220
|
+
InvalidParamsRpcError,
|
221
|
+
InvalidRequestRpcError,
|
222
|
+
JsonRpcVersionUnsupportedError,
|
223
|
+
LimitExceededRpcError,
|
224
|
+
MethodNotFoundRpcError,
|
225
|
+
MethodNotSupportedRpcError,
|
226
|
+
OffsetOutOfBoundsError,
|
227
|
+
ParseRpcError,
|
228
|
+
RequestError,
|
229
|
+
ResourceNotFoundRpcError,
|
230
|
+
ResourceUnavailableRpcError,
|
231
|
+
RpcError,
|
232
|
+
RpcRequestError,
|
233
|
+
SizeExceedsPaddingSizeError,
|
234
|
+
TimeoutError,
|
235
|
+
TransactionNotFoundError,
|
236
|
+
TransactionReceiptNotFoundError,
|
237
|
+
TransactionRejectedRpcError,
|
238
|
+
UnknownRpcError,
|
239
|
+
UrlRequiredError,
|
240
|
+
WaitForTransactionReceiptTimeoutError,
|
241
|
+
WebSocketRequestError,
|
242
|
+
addChain,
|
243
|
+
boolToBytes,
|
244
|
+
boolToHex,
|
245
|
+
bytesToBigint,
|
246
|
+
bytesToBool,
|
247
|
+
bytesToHex,
|
248
|
+
bytesToNumber,
|
249
|
+
bytesToString,
|
250
|
+
call,
|
251
|
+
callContract,
|
252
|
+
createBlockFilter,
|
253
|
+
createClient,
|
254
|
+
createPendingTransactionFilter,
|
255
|
+
createPublicClient,
|
256
|
+
createTestClient,
|
257
|
+
createTransport,
|
258
|
+
createWalletClient,
|
259
|
+
custom,
|
260
|
+
decodeAbi,
|
261
|
+
decodeBytes,
|
262
|
+
decodeErrorResult,
|
263
|
+
decodeFunctionData,
|
264
|
+
decodeFunctionResult,
|
265
|
+
decodeHex,
|
266
|
+
decodeRlp,
|
267
|
+
dropTransaction,
|
268
|
+
encodeAbi,
|
269
|
+
encodeBytes,
|
270
|
+
encodeDeployData,
|
271
|
+
encodeErrorResult,
|
272
|
+
encodeEventTopics,
|
273
|
+
encodeFunctionData,
|
274
|
+
encodeFunctionResult,
|
275
|
+
encodeHex,
|
276
|
+
encodeRlp,
|
277
|
+
estimateGas,
|
278
|
+
etherUnits,
|
279
|
+
fallback,
|
280
|
+
formatBlock,
|
281
|
+
formatEther,
|
282
|
+
formatGwei,
|
283
|
+
formatTransaction,
|
284
|
+
formatTransactionRequest,
|
285
|
+
formatUnit,
|
286
|
+
getAccounts,
|
287
|
+
getAddress,
|
288
|
+
getAutomine,
|
289
|
+
getBalance,
|
290
|
+
getBlock,
|
291
|
+
getBlockNumber,
|
292
|
+
getBlockTransactionCount,
|
293
|
+
getChainId,
|
294
|
+
getContractAddress,
|
295
|
+
getCreate2Address,
|
296
|
+
getCreateAddress,
|
297
|
+
getEventSignature,
|
298
|
+
getFeeHistory,
|
299
|
+
getFilterChanges,
|
300
|
+
getFilterLogs,
|
301
|
+
getFunctionSignature,
|
302
|
+
getGasPrice,
|
303
|
+
getPermissions,
|
304
|
+
getTransaction,
|
305
|
+
getTransactionConfirmations,
|
306
|
+
getTransactionCount,
|
307
|
+
getTransactionReceipt,
|
308
|
+
getTxpoolContent,
|
309
|
+
getTxpoolStatus,
|
310
|
+
gweiUnits,
|
311
|
+
hexToBigInt,
|
312
|
+
hexToBool,
|
313
|
+
hexToBytes,
|
314
|
+
hexToNumber,
|
315
|
+
hexToString,
|
316
|
+
http,
|
317
|
+
impersonateAccount,
|
318
|
+
increaseTime,
|
319
|
+
inspectTxpool,
|
320
|
+
isAddress,
|
321
|
+
isAddressEqual,
|
322
|
+
isBytes,
|
323
|
+
isHex,
|
324
|
+
keccak256,
|
325
|
+
mine,
|
326
|
+
numberToBytes,
|
327
|
+
numberToHex,
|
328
|
+
pad,
|
329
|
+
padBytes,
|
330
|
+
padHex,
|
331
|
+
parseEther,
|
332
|
+
parseGwei,
|
333
|
+
parseUnit,
|
334
|
+
removeBlockTimestampInterval,
|
335
|
+
requestAccounts,
|
336
|
+
requestPermissions,
|
337
|
+
reset,
|
338
|
+
revert,
|
339
|
+
sendTransaction,
|
340
|
+
sendUnsignedTransaction,
|
341
|
+
setAutomine,
|
342
|
+
setBalance,
|
343
|
+
setBlockGasLimit,
|
344
|
+
setBlockTimestampInterval,
|
345
|
+
setCode,
|
346
|
+
setCoinbase,
|
347
|
+
setIntervalMining,
|
348
|
+
setLoggingEnabled,
|
349
|
+
setMinGasPrice,
|
350
|
+
setNextBlockBaseFeePerGas,
|
351
|
+
setNextBlockTimestamp,
|
352
|
+
setNonce,
|
353
|
+
setStorageAt,
|
354
|
+
signMessage,
|
355
|
+
size,
|
356
|
+
slice,
|
357
|
+
sliceBytes,
|
358
|
+
sliceHex,
|
359
|
+
snapshot,
|
360
|
+
stopImpersonatingAccount,
|
361
|
+
stringToBytes,
|
362
|
+
stringToHex,
|
363
|
+
switchChain,
|
364
|
+
transactionType,
|
365
|
+
trim,
|
366
|
+
uninstallFilter,
|
367
|
+
waitForTransactionReceipt,
|
368
|
+
watchAsset,
|
369
|
+
watchBlockNumber,
|
370
|
+
watchBlocks,
|
371
|
+
watchPendingTransactions,
|
372
|
+
webSocket,
|
373
|
+
weiUnits
|
374
|
+
};
|
@@ -1,51 +1,78 @@
|
|
1
|
-
import { AbiParameter, AbiParametersToPrimitiveTypes } from 'abitype';
|
2
|
-
import { H as Hex, A as Address,
|
3
|
-
import {
|
4
|
-
import { R as RpcError } from './rpc-3c0e3985.js';
|
1
|
+
import { AbiParameter, AbiParametersToPrimitiveTypes, Abi, ExtractAbiErrorNames, ExtractAbiEventNames } from 'abitype';
|
2
|
+
import { H as Hex, A as Address, B as ByteArray } from './rpc-b77c5aee.js';
|
3
|
+
import { E as ExtractFunctionNameFromAbi, h as ExtractResultFromAbi, m as ExtractConstructorArgsFromAbi, n as ExtractErrorArgsFromAbi, o as ExtractEventArgsFromAbi, g as ExtractArgsFromAbi } from './transactionRequest-08d30731.js';
|
5
4
|
|
6
|
-
|
5
|
+
type DecodeAbiArgs<TParams extends readonly AbiParameter[]> = {
|
7
6
|
data: Hex;
|
8
7
|
params: TParams;
|
9
|
-
}
|
10
|
-
declare
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
};
|
9
|
+
declare function decodeAbi<TParams extends readonly AbiParameter[]>({ data, params, }: DecodeAbiArgs<TParams>): AbiParametersToPrimitiveTypes<TParams> | undefined;
|
10
|
+
|
11
|
+
type DecodeErrorResultArgs = {
|
12
|
+
abi: Abi;
|
13
|
+
data: Hex;
|
14
|
+
};
|
15
|
+
declare function decodeErrorResult({ abi, data }: DecodeErrorResultArgs): {
|
16
|
+
errorName: string;
|
17
|
+
args: readonly unknown[] | undefined;
|
18
|
+
};
|
19
|
+
|
20
|
+
type DecodeFunctionDataArgs = {
|
21
|
+
abi: Abi;
|
22
|
+
data: Hex;
|
23
|
+
};
|
24
|
+
declare function decodeFunctionData({ abi, data }: DecodeFunctionDataArgs): {
|
25
|
+
functionName: string;
|
26
|
+
args: readonly unknown[] | undefined;
|
27
|
+
};
|
28
|
+
|
29
|
+
type DecodeFunctionResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = {
|
30
|
+
abi: TAbi;
|
31
|
+
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
32
|
+
data: Hex;
|
33
|
+
};
|
34
|
+
type DecodeFunctionResultResponse<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = ExtractResultFromAbi<TAbi, TFunctionName>;
|
35
|
+
declare function decodeFunctionResult<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any>({ abi, functionName, data, }: DecodeFunctionResultArgs<TAbi, TFunctionName>): DecodeFunctionResultResponse<TAbi, TFunctionName>;
|
18
36
|
|
37
|
+
type EncodeAbiArgs<TParams extends readonly AbiParameter[]> = {
|
38
|
+
params: TParams;
|
39
|
+
values: AbiParametersToPrimitiveTypes<TParams>;
|
40
|
+
};
|
19
41
|
/**
|
20
42
|
* @description Encodes a list of primitive values into an ABI-encoded hex value.
|
21
43
|
*/
|
22
|
-
declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
declare
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: EncodeAbiArgs<TParams>): `0x${string}`;
|
45
|
+
|
46
|
+
type EncodeDeployDataArgs<TAbi extends Abi = Abi> = {
|
47
|
+
abi: TAbi;
|
48
|
+
bytecode: Hex;
|
49
|
+
} & ExtractConstructorArgsFromAbi<TAbi>;
|
50
|
+
declare function encodeDeployData<TAbi extends Abi = Abi>({ abi, args, bytecode, }: EncodeDeployDataArgs<TAbi>): `0x${string}`;
|
51
|
+
|
52
|
+
type EncodeErrorResultArgs<TAbi extends Abi = Abi, TErrorName extends ExtractAbiErrorNames<TAbi> = any> = {
|
53
|
+
abi: TAbi;
|
54
|
+
errorName: TErrorName;
|
55
|
+
} & ExtractErrorArgsFromAbi<TAbi, TErrorName>;
|
56
|
+
declare function encodeErrorResult<TAbi extends Abi = Abi, TErrorName extends ExtractAbiErrorNames<TAbi> = any>({ abi, errorName, args }: EncodeErrorResultArgs<TAbi, TErrorName>): `0x${string}`;
|
57
|
+
|
58
|
+
type EncodeEventTopicsArgs<TAbi extends Abi = Abi, TEventName extends ExtractAbiEventNames<TAbi> = any> = {
|
59
|
+
abi: TAbi;
|
60
|
+
eventName: TEventName;
|
61
|
+
} & ExtractEventArgsFromAbi<TAbi, TEventName>;
|
62
|
+
declare function encodeEventTopics<TAbi extends Abi = Abi, TEventName extends ExtractAbiEventNames<TAbi> = any>({ abi, eventName, args }: EncodeEventTopicsArgs<TAbi, TEventName>): `0x${string}`[];
|
63
|
+
|
64
|
+
type EncodeFunctionDataArgs<TAbi extends Abi = Abi, TFunctionName extends string = any> = {
|
65
|
+
abi: TAbi;
|
66
|
+
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
67
|
+
} & ExtractArgsFromAbi<TAbi, TFunctionName>;
|
68
|
+
declare function encodeFunctionData<TAbi extends Abi = Abi, TFunctionName extends string = any>({ abi, args, functionName }: EncodeFunctionDataArgs<TAbi, TFunctionName>): `0x${string}`;
|
69
|
+
|
70
|
+
type EncodeFunctionResultArgs<TAbi extends Abi = Abi, TFunctionName extends string = any> = {
|
71
|
+
abi: TAbi;
|
72
|
+
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
73
|
+
result?: ExtractResultFromAbi<TAbi, TFunctionName>;
|
74
|
+
};
|
75
|
+
declare function encodeFunctionResult<TAbi extends Abi = Abi, TFunctionName extends string = any>({ abi, functionName, result, }: EncodeFunctionResultArgs<TAbi, TFunctionName>): `0x${string}`;
|
49
76
|
|
50
77
|
declare function getAddress(address: Address): `0x${string}`;
|
51
78
|
|
@@ -71,81 +98,6 @@ declare function isAddress(address: Address): boolean;
|
|
71
98
|
|
72
99
|
declare function isAddressEqual(a: Address, b: Address): boolean;
|
73
100
|
|
74
|
-
declare function buildRequest<TRequest extends (args: any) => Promise<any>>(request: TRequest): TRequest;
|
75
|
-
declare class RequestError extends BaseError {
|
76
|
-
constructor(err: Error, { docsPath, humanMessage }: {
|
77
|
-
docsPath?: string;
|
78
|
-
humanMessage: string;
|
79
|
-
});
|
80
|
-
}
|
81
|
-
declare class RpcRequestError extends RequestError {
|
82
|
-
code: number;
|
83
|
-
constructor(err: RpcError, { docsPath, humanMessage }: {
|
84
|
-
docsPath?: string;
|
85
|
-
humanMessage: string;
|
86
|
-
});
|
87
|
-
}
|
88
|
-
declare class ParseRpcError extends RpcRequestError {
|
89
|
-
name: string;
|
90
|
-
code: number;
|
91
|
-
constructor(err: RpcError);
|
92
|
-
}
|
93
|
-
declare class InvalidRequestRpcError extends RpcRequestError {
|
94
|
-
name: string;
|
95
|
-
code: number;
|
96
|
-
constructor(err: RpcError);
|
97
|
-
}
|
98
|
-
declare class MethodNotFoundRpcError extends RpcRequestError {
|
99
|
-
name: string;
|
100
|
-
code: number;
|
101
|
-
constructor(err: RpcError);
|
102
|
-
}
|
103
|
-
declare class InvalidParamsRpcError extends RpcRequestError {
|
104
|
-
name: string;
|
105
|
-
code: number;
|
106
|
-
constructor(err: RpcError);
|
107
|
-
}
|
108
|
-
declare class InternalRpcError extends RpcRequestError {
|
109
|
-
name: string;
|
110
|
-
code: number;
|
111
|
-
constructor(err: RpcError);
|
112
|
-
}
|
113
|
-
declare class InvalidInputRpcError extends RpcRequestError {
|
114
|
-
name: string;
|
115
|
-
code: number;
|
116
|
-
constructor(err: RpcError);
|
117
|
-
}
|
118
|
-
declare class ResourceNotFoundRpcError extends RpcRequestError {
|
119
|
-
name: string;
|
120
|
-
code: number;
|
121
|
-
constructor(err: RpcError);
|
122
|
-
}
|
123
|
-
declare class ResourceUnavailableRpcError extends RpcRequestError {
|
124
|
-
name: string;
|
125
|
-
code: number;
|
126
|
-
constructor(err: RpcError);
|
127
|
-
}
|
128
|
-
declare class TransactionRejectedRpcError extends RpcRequestError {
|
129
|
-
name: string;
|
130
|
-
code: number;
|
131
|
-
constructor(err: RpcError);
|
132
|
-
}
|
133
|
-
declare class MethodNotSupportedRpcError extends RpcRequestError {
|
134
|
-
name: string;
|
135
|
-
code: number;
|
136
|
-
constructor(err: RpcError);
|
137
|
-
}
|
138
|
-
declare class LimitExceededRpcError extends RpcRequestError {
|
139
|
-
name: string;
|
140
|
-
code: number;
|
141
|
-
constructor(err: RpcError);
|
142
|
-
}
|
143
|
-
declare class JsonRpcVersionUnsupportedError extends RpcRequestError {
|
144
|
-
name: string;
|
145
|
-
code: number;
|
146
|
-
constructor(err: RpcError);
|
147
|
-
}
|
148
|
-
|
149
101
|
declare function isBytes(value: any): boolean;
|
150
102
|
|
151
103
|
declare function isHex(value: any): boolean;
|
@@ -305,7 +257,7 @@ declare function decodeRlp<TTo extends 'bytes' | 'hex'>(value: ByteArray | Hex,
|
|
305
257
|
|
306
258
|
declare const getEventSignature: (event: `${string}(${string})`) => `0x${string}`;
|
307
259
|
|
308
|
-
declare const getFunctionSignature: (fn: string) => string
|
260
|
+
declare const getFunctionSignature: (fn: string) => `0x${string}`;
|
309
261
|
|
310
262
|
type To = 'hex' | 'bytes';
|
311
263
|
type Keccak256Hash<TTo extends To> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
|
@@ -323,4 +275,4 @@ declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
|
|
323
275
|
|
324
276
|
declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
|
325
277
|
|
326
|
-
export { keccak256 as $,
|
278
|
+
export { keccak256 as $, encodeAbi as A, encodeBytes as B, encodeDeployData as C, DecodeAbiArgs as D, EncodeAbiArgs as E, encodeErrorResult as F, GetContractAddressOptions as G, encodeEventTopics as H, encodeFunctionData as I, encodeFunctionResult as J, encodeHex as K, encodeRlp as L, getAddress as M, getContractAddress as N, getCreateAddress as O, getCreate2Address as P, getEventSignature as Q, getFunctionSignature as R, formatEther as S, isAddress as T, isAddressEqual as U, isBytes as V, isHex as W, hexToBigInt as X, hexToBool as Y, hexToBytes as Z, hexToString as _, DecodeErrorResultArgs as a, numberToBytes as a0, pad as a1, padBytes as a2, padHex as a3, parseEther as a4, parseGwei as a5, parseUnit as a6, formatGwei as a7, formatUnit as a8, hexToNumber as a9, numberToHex as aa, size as ab, slice as ac, sliceBytes as ad, sliceHex as ae, stringToBytes as af, stringToHex as ag, trim as ah, DecodeFunctionDataArgs as b, DecodeFunctionResultArgs as c, DecodeFunctionResultResponse as d, EncodeDeployDataArgs as e, EncodeErrorResultArgs as f, EncodeEventTopicsArgs as g, EncodeFunctionDataArgs as h, EncodeFunctionResultArgs as i, GetCreateAddressOptions as j, GetCreate2AddressOptions as k, EncodeRlpResponse as l, bytesToHex as m, bytesToString as n, boolToBytes as o, boolToHex as p, bytesToBigint as q, bytesToBool as r, bytesToNumber as s, decodeAbi as t, decodeBytes as u, decodeErrorResult as v, decodeFunctionData as w, decodeFunctionResult as x, decodeHex as y, decodeRlp 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 };
|
@@ -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, 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, Hash 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 };
|