viem 0.0.1-alpha.9 → 0.0.1-cjs.10
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 +3 -2
- package/dist/actions/index.js +125 -124
- package/dist/actions/index.mjs +125 -0
- package/dist/chains.d.ts +2 -2
- package/dist/chains.js +75 -76
- package/dist/chains.mjs +133 -0
- package/dist/{chunk-26WUARDL.js → chunk-2FDH6XP5.mjs} +1314 -72
- package/dist/chunk-46ZFLVHC.js +1084 -0
- package/dist/chunk-5ZBNF5WM.js +2616 -0
- package/dist/{chunk-375SRM5R.js → chunk-CWCWWGBC.mjs} +1 -1
- package/dist/{chunk-6BXRN6CQ.js → chunk-HLVCJ7RV.mjs} +48 -11
- package/dist/chunk-SGTIBKHG.js +258 -0
- package/dist/clients/index.js +23 -23
- package/dist/clients/index.mjs +23 -0
- package/dist/index.d.ts +5 -7
- package/dist/index.js +374 -374
- package/dist/index.mjs +374 -0
- package/dist/{parseGwei-64031f5e.d.ts → parseGwei-7c87ff41.d.ts} +40 -118
- package/dist/transactionRequest-08d30731.d.ts +132 -0
- package/dist/utils/index.d.ts +38 -5
- package/dist/utils/index.js +148 -138
- package/dist/utils/index.mjs +148 -0
- package/dist/{watchAsset-dc7dcdd9.d.ts → watchAsset-bc6373f4.d.ts} +15 -3
- package/dist/window.js +1 -0
- package/dist/window.mjs +0 -0
- package/package.json +9 -3
- package/utils/package.json +1 -1
- package/window/package.json +1 -1
- package/dist/chunk-7H5SPKXN.js +0 -1113
- package/dist/transactionRequest-3e463099.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-HLVCJ7RV.mjs";
|
62
|
+
import {
|
63
|
+
createClient,
|
64
|
+
createPublicClient,
|
65
|
+
createTestClient,
|
66
|
+
createTransport,
|
67
|
+
createWalletClient,
|
68
|
+
custom,
|
69
|
+
fallback,
|
70
|
+
http,
|
71
|
+
webSocket
|
72
|
+
} from "./chunk-CWCWWGBC.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-2FDH6XP5.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,156 +1,78 @@
|
|
1
|
-
import {
|
1
|
+
import { AbiParameter, AbiParametersToPrimitiveTypes, Abi, ExtractAbiErrorNames, ExtractAbiEventNames } from 'abitype';
|
2
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';
|
3
4
|
|
4
|
-
type
|
5
|
-
name: string;
|
6
|
-
} ? {} : []> = TAbiParameters extends readonly [infer Head, ...infer Tail] ? Head extends {
|
7
|
-
indexed: true;
|
8
|
-
} ? Head extends AbiParameter ? Head extends {
|
9
|
-
name: infer Name;
|
10
|
-
} ? Name extends string ? {
|
11
|
-
[name in Name]?: AbiParameterToPrimitiveType<Head> | AbiParameterToPrimitiveType<Head>[] | null;
|
12
|
-
} & (Tail extends readonly [] ? {} : Tail extends readonly AbiParameter[] ? AbiEventParametersToPrimitiveTypes<Tail> : {}) : never : [
|
13
|
-
(AbiParameterToPrimitiveType<Head> | AbiParameterToPrimitiveType<Head>[] | null),
|
14
|
-
...(Tail extends readonly [] ? [] : Tail extends readonly AbiParameter[] ? AbiEventParametersToPrimitiveTypes<Tail> : [])
|
15
|
-
] : TBase : TBase : TBase;
|
16
|
-
type ExtractArgsFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiFunction extends AbiFunction & {
|
17
|
-
type: 'function';
|
18
|
-
} = TAbi extends Abi ? ExtractAbiFunction<TAbi, TFunctionName> : AbiFunction & {
|
19
|
-
type: 'function';
|
20
|
-
}, TArgs = AbiParametersToPrimitiveTypes<TAbiFunction['inputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
|
21
|
-
/**
|
22
|
-
* Arguments to pass contract method
|
23
|
-
*
|
24
|
-
* Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
|
25
|
-
*/
|
26
|
-
args?: readonly unknown[];
|
27
|
-
} : TArgs extends readonly [] ? {
|
28
|
-
args?: never;
|
29
|
-
} : {
|
30
|
-
/** Arguments to pass contract method */ args: TArgs;
|
31
|
-
};
|
32
|
-
type ExtractConstructorArgsFromAbi<TAbi extends Abi | readonly unknown[], TAbiFunction extends AbiFunction & {
|
33
|
-
type: 'constructor';
|
34
|
-
} = TAbi extends Abi ? Extract<TAbi[number], {
|
35
|
-
type: 'constructor';
|
36
|
-
}> : AbiFunction & {
|
37
|
-
type: 'constructor';
|
38
|
-
}, TArgs = AbiParametersToPrimitiveTypes<TAbiFunction['inputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
|
39
|
-
/**
|
40
|
-
* Arguments to pass contract method
|
41
|
-
*
|
42
|
-
* Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
|
43
|
-
*/
|
44
|
-
args?: readonly unknown[];
|
45
|
-
} : TArgs extends readonly [] ? {
|
46
|
-
args?: never;
|
47
|
-
} : {
|
48
|
-
/** Arguments to pass contract method */ args: TArgs;
|
49
|
-
};
|
50
|
-
type ExtractErrorArgsFromAbi<TAbi extends Abi | readonly unknown[], TErrorName extends string, TAbiError extends AbiError = TAbi extends Abi ? ExtractAbiError<TAbi, TErrorName> : AbiError, TArgs = AbiParametersToPrimitiveTypes<TAbiError['inputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
|
51
|
-
/**
|
52
|
-
* Arguments to pass contract method
|
53
|
-
*
|
54
|
-
* Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
|
55
|
-
*/
|
56
|
-
args?: readonly unknown[];
|
57
|
-
} : TArgs extends readonly [] ? {
|
58
|
-
args?: never;
|
59
|
-
} : {
|
60
|
-
/** Arguments to pass contract method */ args: TArgs;
|
61
|
-
};
|
62
|
-
type ExtractResultFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiFunction extends AbiFunction & {
|
63
|
-
type: 'function';
|
64
|
-
} = TAbi extends Abi ? ExtractAbiFunction<TAbi, TFunctionName> : AbiFunction & {
|
65
|
-
type: 'function';
|
66
|
-
}, TArgs = AbiParametersToPrimitiveTypes<TAbiFunction['outputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
|
67
|
-
/**
|
68
|
-
* Arguments to pass contract method
|
69
|
-
*
|
70
|
-
* Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
|
71
|
-
*/
|
72
|
-
result?: readonly unknown[];
|
73
|
-
} : TArgs extends readonly [] ? {
|
74
|
-
result?: never;
|
75
|
-
} : {
|
76
|
-
/** Arguments to pass contract method */ result: TArgs;
|
77
|
-
};
|
78
|
-
type ExtractEventArgsFromAbi<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TAbiEvent extends AbiEvent & {
|
79
|
-
type: 'event';
|
80
|
-
} = TAbi extends Abi ? ExtractAbiEvent<TAbi, TFunctionName> : AbiEvent & {
|
81
|
-
type: 'event';
|
82
|
-
}, TArgs = AbiEventParametersToPrimitiveTypes<TAbiEvent['inputs']>, FailedToParseArgs = ([TArgs] extends [never] ? true : false) | (readonly unknown[] extends TArgs ? true : false)> = true extends FailedToParseArgs ? {
|
83
|
-
/**
|
84
|
-
* Arguments to pass contract method
|
85
|
-
*
|
86
|
-
* Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference.
|
87
|
-
*/
|
88
|
-
args?: readonly unknown[];
|
89
|
-
} : TArgs extends readonly [] ? {
|
90
|
-
args?: never;
|
91
|
-
} : {
|
92
|
-
args?: TArgs;
|
93
|
-
};
|
94
|
-
|
95
|
-
declare function decodeAbi<TParams extends readonly AbiParameter[]>({ data, params, }: {
|
5
|
+
type DecodeAbiArgs<TParams extends readonly AbiParameter[]> = {
|
96
6
|
data: Hex;
|
97
7
|
params: TParams;
|
98
|
-
}
|
8
|
+
};
|
9
|
+
declare function decodeAbi<TParams extends readonly AbiParameter[]>({ data, params, }: DecodeAbiArgs<TParams>): AbiParametersToPrimitiveTypes<TParams> | undefined;
|
99
10
|
|
100
|
-
|
11
|
+
type DecodeErrorResultArgs = {
|
101
12
|
abi: Abi;
|
102
13
|
data: Hex;
|
103
|
-
}
|
14
|
+
};
|
15
|
+
declare function decodeErrorResult({ abi, data }: DecodeErrorResultArgs): {
|
104
16
|
errorName: string;
|
105
17
|
args: readonly unknown[] | undefined;
|
106
18
|
};
|
107
19
|
|
108
|
-
|
20
|
+
type DecodeFunctionDataArgs = {
|
109
21
|
abi: Abi;
|
110
22
|
data: Hex;
|
111
|
-
}
|
23
|
+
};
|
24
|
+
declare function decodeFunctionData({ abi, data }: DecodeFunctionDataArgs): {
|
112
25
|
functionName: string;
|
113
26
|
args: readonly unknown[] | undefined;
|
114
27
|
};
|
115
28
|
|
116
|
-
|
29
|
+
type DecodeFunctionResultArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any> = {
|
117
30
|
abi: TAbi;
|
118
|
-
functionName: TFunctionName
|
31
|
+
functionName: ExtractFunctionNameFromAbi<TAbi, TFunctionName>;
|
119
32
|
data: Hex;
|
120
|
-
}
|
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>;
|
121
36
|
|
37
|
+
type EncodeAbiArgs<TParams extends readonly AbiParameter[]> = {
|
38
|
+
params: TParams;
|
39
|
+
values: AbiParametersToPrimitiveTypes<TParams>;
|
40
|
+
};
|
122
41
|
/**
|
123
42
|
* @description Encodes a list of primitive values into an ABI-encoded hex value.
|
124
43
|
*/
|
125
|
-
declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: {
|
126
|
-
params: TParams;
|
127
|
-
values: AbiParametersToPrimitiveTypes<TParams>;
|
128
|
-
}): `0x${string}`;
|
44
|
+
declare function encodeAbi<TParams extends readonly AbiParameter[]>({ params, values, }: EncodeAbiArgs<TParams>): `0x${string}`;
|
129
45
|
|
130
|
-
|
46
|
+
type EncodeDeployDataArgs<TAbi extends Abi = Abi> = {
|
131
47
|
abi: TAbi;
|
132
48
|
bytecode: Hex;
|
133
|
-
} & ExtractConstructorArgsFromAbi<TAbi
|
49
|
+
} & ExtractConstructorArgsFromAbi<TAbi>;
|
50
|
+
declare function encodeDeployData<TAbi extends Abi = Abi>({ abi, args, bytecode, }: EncodeDeployDataArgs<TAbi>): `0x${string}`;
|
134
51
|
|
135
|
-
|
52
|
+
type EncodeErrorResultArgs<TAbi extends Abi = Abi, TErrorName extends ExtractAbiErrorNames<TAbi> = any> = {
|
136
53
|
abi: TAbi;
|
137
54
|
errorName: TErrorName;
|
138
|
-
} & ExtractErrorArgsFromAbi<TAbi, 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}`;
|
139
57
|
|
140
|
-
|
58
|
+
type EncodeEventTopicsArgs<TAbi extends Abi = Abi, TEventName extends ExtractAbiEventNames<TAbi> = any> = {
|
141
59
|
abi: TAbi;
|
142
60
|
eventName: TEventName;
|
143
|
-
} & ExtractEventArgsFromAbi<TAbi, 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}`[];
|
144
63
|
|
145
|
-
|
64
|
+
type EncodeFunctionDataArgs<TAbi extends Abi = Abi, TFunctionName extends string = any> = {
|
146
65
|
abi: TAbi;
|
147
|
-
functionName: TFunctionName
|
148
|
-
} & ExtractArgsFromAbi<TAbi, TFunctionName
|
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}`;
|
149
69
|
|
150
|
-
|
70
|
+
type EncodeFunctionResultArgs<TAbi extends Abi = Abi, TFunctionName extends string = any> = {
|
151
71
|
abi: TAbi;
|
152
|
-
functionName: TFunctionName
|
153
|
-
|
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}`;
|
154
76
|
|
155
77
|
declare function getAddress(address: Address): `0x${string}`;
|
156
78
|
|
@@ -353,4 +275,4 @@ declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
|
|
353
275
|
|
354
276
|
declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
|
355
277
|
|
356
|
-
export {
|
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 };
|