@avalabs/evm-module 0.0.23 → 0.1.0

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.
Files changed (87) hide show
  1. package/LICENSE +9 -0
  2. package/package.json +7 -2
  3. package/.turbo/turbo-build.log +0 -22
  4. package/.turbo/turbo-lint.log +0 -4
  5. package/.turbo/turbo-test.log +0 -119
  6. package/CHANGELOG.md +0 -174
  7. package/jest.config.js +0 -9
  8. package/src/constants.ts +0 -1
  9. package/src/contracts/openzeppelin/ERC1155.ts +0 -440
  10. package/src/contracts/openzeppelin/ERC20.ts +0 -330
  11. package/src/contracts/openzeppelin/ERC721.ts +0 -420
  12. package/src/contracts/openzeppelin/common.ts +0 -131
  13. package/src/contracts/openzeppelin/factories/ERC1155__factory.ts +0 -388
  14. package/src/contracts/openzeppelin/factories/ERC20__factory.ts +0 -353
  15. package/src/contracts/openzeppelin/factories/ERC721__factory.ts +0 -413
  16. package/src/contracts/openzeppelin/factories/index.ts +0 -6
  17. package/src/contracts/openzeppelin/index.ts +0 -10
  18. package/src/env.ts +0 -25
  19. package/src/handlers/eth-send-transaction/eth-send-transaction.test.ts +0 -572
  20. package/src/handlers/eth-send-transaction/eth-send-transaction.ts +0 -189
  21. package/src/handlers/eth-send-transaction/schema.test.ts +0 -240
  22. package/src/handlers/eth-send-transaction/schema.ts +0 -20
  23. package/src/handlers/eth-sign/eth-sign.test.ts +0 -359
  24. package/src/handlers/eth-sign/eth-sign.ts +0 -158
  25. package/src/handlers/eth-sign/schemas/eth-sign-typed-data.ts +0 -65
  26. package/src/handlers/eth-sign/schemas/eth-sign.ts +0 -9
  27. package/src/handlers/eth-sign/schemas/parse-request-params/fixture.ts +0 -47
  28. package/src/handlers/eth-sign/schemas/parse-request-params/parse-request-params.test.ts +0 -284
  29. package/src/handlers/eth-sign/schemas/parse-request-params/parse-request-params.ts +0 -94
  30. package/src/handlers/eth-sign/schemas/personal-sign.ts +0 -12
  31. package/src/handlers/eth-sign/schemas/shared.ts +0 -5
  32. package/src/handlers/eth-sign/utils/beautify-message/beautify-message.test.ts +0 -29
  33. package/src/handlers/eth-sign/utils/beautify-message/beautify-message.ts +0 -134
  34. package/src/handlers/eth-sign/utils/is-typed-data-valid.ts +0 -26
  35. package/src/handlers/eth-sign/utils/typeguards.ts +0 -10
  36. package/src/handlers/forward-to-rpc-node/forward-to-rpc-node.test.ts +0 -90
  37. package/src/handlers/forward-to-rpc-node/forward-to-rpc-node.ts +0 -23
  38. package/src/handlers/get-address/get-address.ts +0 -26
  39. package/src/handlers/get-balances/evm-balance-service/get-erc20-balances.test.ts +0 -77
  40. package/src/handlers/get-balances/evm-balance-service/get-erc20-balances.ts +0 -81
  41. package/src/handlers/get-balances/evm-balance-service/get-native-token-balances.test.ts +0 -96
  42. package/src/handlers/get-balances/evm-balance-service/get-native-token-balances.ts +0 -53
  43. package/src/handlers/get-balances/get-balances.test.ts +0 -248
  44. package/src/handlers/get-balances/get-balances.ts +0 -123
  45. package/src/handlers/get-balances/glacier-balance-service/get-erc20-balances.test.ts +0 -71
  46. package/src/handlers/get-balances/glacier-balance-service/get-erc20-balances.ts +0 -106
  47. package/src/handlers/get-balances/glacier-balance-service/get-native-token-balances.test.ts +0 -59
  48. package/src/handlers/get-balances/glacier-balance-service/get-native-token-balances.ts +0 -48
  49. package/src/handlers/get-network-fee/get-network-fee.test.ts +0 -43
  50. package/src/handlers/get-network-fee/get-network-fee.ts +0 -59
  51. package/src/handlers/get-tokens/get-tokens.test.ts +0 -100
  52. package/src/handlers/get-tokens/get-tokens.ts +0 -18
  53. package/src/handlers/get-transaction-history/converters/etherscan-transaction-converter/convert-transaction-erc20.test.ts +0 -53
  54. package/src/handlers/get-transaction-history/converters/etherscan-transaction-converter/convert-transaction-erc20.ts +0 -49
  55. package/src/handlers/get-transaction-history/converters/etherscan-transaction-converter/convert-transaction-normal.test.ts +0 -57
  56. package/src/handlers/get-transaction-history/converters/etherscan-transaction-converter/convert-transaction-normal.ts +0 -57
  57. package/src/handlers/get-transaction-history/converters/etherscan-transaction-converter/get-transaction-from-etherscan.test.ts +0 -116
  58. package/src/handlers/get-transaction-history/converters/etherscan-transaction-converter/get-transaction-from-etherscan.ts +0 -73
  59. package/src/handlers/get-transaction-history/converters/evm-transaction-converter/convert-transaction.ts +0 -47
  60. package/src/handlers/get-transaction-history/converters/evm-transaction-converter/get-nft-metadata.ts +0 -35
  61. package/src/handlers/get-transaction-history/converters/evm-transaction-converter/get-sender-info.ts +0 -38
  62. package/src/handlers/get-transaction-history/converters/evm-transaction-converter/get-tokens.ts +0 -106
  63. package/src/handlers/get-transaction-history/converters/evm-transaction-converter/get-transaction-from-glacier.test.ts +0 -222
  64. package/src/handlers/get-transaction-history/converters/evm-transaction-converter/get-transactions-from-glacier.ts +0 -62
  65. package/src/handlers/get-transaction-history/converters/evm-transaction-converter/get-tx-type.ts +0 -52
  66. package/src/handlers/get-transaction-history/get-transaction-history.test.ts +0 -57
  67. package/src/handlers/get-transaction-history/get-transaction-history.ts +0 -55
  68. package/src/handlers/get-transaction-history/utils/get-explorer-address-by-network.ts +0 -7
  69. package/src/handlers/get-transaction-history/utils/get-small-image-for-nft.ts +0 -16
  70. package/src/handlers/get-transaction-history/utils/ipfs-resolver-with-fallback.ts +0 -18
  71. package/src/handlers/get-transaction-history/utils/is-ethereum-chain-id.ts +0 -15
  72. package/src/handlers/get-transaction-history/utils/resolve.ts +0 -7
  73. package/src/index.ts +0 -3
  74. package/src/module.ts +0 -141
  75. package/src/services/glacier-service/glacier-service.ts +0 -238
  76. package/src/types.ts +0 -25
  77. package/src/utils/estimate-gas-limit.ts +0 -27
  78. package/src/utils/get-chain-id.ts +0 -12
  79. package/src/utils/get-nonce.ts +0 -11
  80. package/src/utils/get-provider.ts +0 -46
  81. package/src/utils/parse-erc20-transaction-type.ts +0 -35
  82. package/src/utils/process-transaction-simulation.test.ts +0 -105
  83. package/src/utils/process-transaction-simulation.ts +0 -293
  84. package/src/utils/scan-transaction.ts +0 -63
  85. package/tsconfig.jest.json +0 -7
  86. package/tsconfig.json +0 -14
  87. package/tsup.config.ts +0 -4
@@ -1,420 +0,0 @@
1
- /* Autogenerated file. Do not edit manually. */
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- import type {
5
- BaseContract,
6
- BigNumberish,
7
- BytesLike,
8
- FunctionFragment,
9
- Result,
10
- Interface,
11
- EventFragment,
12
- AddressLike,
13
- ContractRunner,
14
- ContractMethod,
15
- Listener,
16
- } from "ethers";
17
- import type {
18
- TypedContractEvent,
19
- TypedDeferredTopicFilter,
20
- TypedEventLog,
21
- TypedLogDescription,
22
- TypedListener,
23
- TypedContractMethod,
24
- } from "./common";
25
-
26
- export interface ERC721Interface extends Interface {
27
- getFunction(
28
- nameOrSignature:
29
- | "approve"
30
- | "balanceOf"
31
- | "getApproved"
32
- | "isApprovedForAll"
33
- | "name"
34
- | "ownerOf"
35
- | "safeTransferFrom(address,address,uint256)"
36
- | "safeTransferFrom(address,address,uint256,bytes)"
37
- | "setApprovalForAll"
38
- | "supportsInterface"
39
- | "symbol"
40
- | "tokenURI"
41
- | "transferFrom"
42
- ): FunctionFragment;
43
-
44
- getEvent(
45
- nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer"
46
- ): EventFragment;
47
-
48
- encodeFunctionData(
49
- functionFragment: "approve",
50
- values: [AddressLike, BigNumberish]
51
- ): string;
52
- encodeFunctionData(
53
- functionFragment: "balanceOf",
54
- values: [AddressLike]
55
- ): string;
56
- encodeFunctionData(
57
- functionFragment: "getApproved",
58
- values: [BigNumberish]
59
- ): string;
60
- encodeFunctionData(
61
- functionFragment: "isApprovedForAll",
62
- values: [AddressLike, AddressLike]
63
- ): string;
64
- encodeFunctionData(functionFragment: "name", values?: undefined): string;
65
- encodeFunctionData(
66
- functionFragment: "ownerOf",
67
- values: [BigNumberish]
68
- ): string;
69
- encodeFunctionData(
70
- functionFragment: "safeTransferFrom(address,address,uint256)",
71
- values: [AddressLike, AddressLike, BigNumberish]
72
- ): string;
73
- encodeFunctionData(
74
- functionFragment: "safeTransferFrom(address,address,uint256,bytes)",
75
- values: [AddressLike, AddressLike, BigNumberish, BytesLike]
76
- ): string;
77
- encodeFunctionData(
78
- functionFragment: "setApprovalForAll",
79
- values: [AddressLike, boolean]
80
- ): string;
81
- encodeFunctionData(
82
- functionFragment: "supportsInterface",
83
- values: [BytesLike]
84
- ): string;
85
- encodeFunctionData(functionFragment: "symbol", values?: undefined): string;
86
- encodeFunctionData(
87
- functionFragment: "tokenURI",
88
- values: [BigNumberish]
89
- ): string;
90
- encodeFunctionData(
91
- functionFragment: "transferFrom",
92
- values: [AddressLike, AddressLike, BigNumberish]
93
- ): string;
94
-
95
- decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
96
- decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
97
- decodeFunctionResult(
98
- functionFragment: "getApproved",
99
- data: BytesLike
100
- ): Result;
101
- decodeFunctionResult(
102
- functionFragment: "isApprovedForAll",
103
- data: BytesLike
104
- ): Result;
105
- decodeFunctionResult(functionFragment: "name", data: BytesLike): Result;
106
- decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result;
107
- decodeFunctionResult(
108
- functionFragment: "safeTransferFrom(address,address,uint256)",
109
- data: BytesLike
110
- ): Result;
111
- decodeFunctionResult(
112
- functionFragment: "safeTransferFrom(address,address,uint256,bytes)",
113
- data: BytesLike
114
- ): Result;
115
- decodeFunctionResult(
116
- functionFragment: "setApprovalForAll",
117
- data: BytesLike
118
- ): Result;
119
- decodeFunctionResult(
120
- functionFragment: "supportsInterface",
121
- data: BytesLike
122
- ): Result;
123
- decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result;
124
- decodeFunctionResult(functionFragment: "tokenURI", data: BytesLike): Result;
125
- decodeFunctionResult(
126
- functionFragment: "transferFrom",
127
- data: BytesLike
128
- ): Result;
129
- }
130
-
131
- export namespace ApprovalEvent {
132
- export type InputTuple = [
133
- owner: AddressLike,
134
- approved: AddressLike,
135
- tokenId: BigNumberish
136
- ];
137
- export type OutputTuple = [owner: string, approved: string, tokenId: bigint];
138
- export interface OutputObject {
139
- owner: string;
140
- approved: string;
141
- tokenId: bigint;
142
- }
143
- export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
144
- export type Filter = TypedDeferredTopicFilter<Event>;
145
- export type Log = TypedEventLog<Event>;
146
- export type LogDescription = TypedLogDescription<Event>;
147
- }
148
-
149
- export namespace ApprovalForAllEvent {
150
- export type InputTuple = [
151
- owner: AddressLike,
152
- operator: AddressLike,
153
- approved: boolean
154
- ];
155
- export type OutputTuple = [
156
- owner: string,
157
- operator: string,
158
- approved: boolean
159
- ];
160
- export interface OutputObject {
161
- owner: string;
162
- operator: string;
163
- approved: boolean;
164
- }
165
- export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
166
- export type Filter = TypedDeferredTopicFilter<Event>;
167
- export type Log = TypedEventLog<Event>;
168
- export type LogDescription = TypedLogDescription<Event>;
169
- }
170
-
171
- export namespace TransferEvent {
172
- export type InputTuple = [
173
- from: AddressLike,
174
- to: AddressLike,
175
- tokenId: BigNumberish
176
- ];
177
- export type OutputTuple = [from: string, to: string, tokenId: bigint];
178
- export interface OutputObject {
179
- from: string;
180
- to: string;
181
- tokenId: bigint;
182
- }
183
- export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
184
- export type Filter = TypedDeferredTopicFilter<Event>;
185
- export type Log = TypedEventLog<Event>;
186
- export type LogDescription = TypedLogDescription<Event>;
187
- }
188
-
189
- export interface ERC721 extends BaseContract {
190
- connect(runner?: ContractRunner | null): ERC721;
191
- waitForDeployment(): Promise<this>;
192
-
193
- interface: ERC721Interface;
194
-
195
- queryFilter<TCEvent extends TypedContractEvent>(
196
- event: TCEvent,
197
- fromBlockOrBlockhash?: string | number | undefined,
198
- toBlock?: string | number | undefined
199
- ): Promise<Array<TypedEventLog<TCEvent>>>;
200
- queryFilter<TCEvent extends TypedContractEvent>(
201
- filter: TypedDeferredTopicFilter<TCEvent>,
202
- fromBlockOrBlockhash?: string | number | undefined,
203
- toBlock?: string | number | undefined
204
- ): Promise<Array<TypedEventLog<TCEvent>>>;
205
-
206
- on<TCEvent extends TypedContractEvent>(
207
- event: TCEvent,
208
- listener: TypedListener<TCEvent>
209
- ): Promise<this>;
210
- on<TCEvent extends TypedContractEvent>(
211
- filter: TypedDeferredTopicFilter<TCEvent>,
212
- listener: TypedListener<TCEvent>
213
- ): Promise<this>;
214
-
215
- once<TCEvent extends TypedContractEvent>(
216
- event: TCEvent,
217
- listener: TypedListener<TCEvent>
218
- ): Promise<this>;
219
- once<TCEvent extends TypedContractEvent>(
220
- filter: TypedDeferredTopicFilter<TCEvent>,
221
- listener: TypedListener<TCEvent>
222
- ): Promise<this>;
223
-
224
- listeners<TCEvent extends TypedContractEvent>(
225
- event: TCEvent
226
- ): Promise<Array<TypedListener<TCEvent>>>;
227
- listeners(eventName?: string): Promise<Array<Listener>>;
228
- removeAllListeners<TCEvent extends TypedContractEvent>(
229
- event?: TCEvent
230
- ): Promise<this>;
231
-
232
- approve: TypedContractMethod<
233
- [to: AddressLike, tokenId: BigNumberish],
234
- [void],
235
- "nonpayable"
236
- >;
237
-
238
- balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">;
239
-
240
- getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">;
241
-
242
- isApprovedForAll: TypedContractMethod<
243
- [owner: AddressLike, operator: AddressLike],
244
- [boolean],
245
- "view"
246
- >;
247
-
248
- name: TypedContractMethod<[], [string], "view">;
249
-
250
- ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">;
251
-
252
- "safeTransferFrom(address,address,uint256)": TypedContractMethod<
253
- [from: AddressLike, to: AddressLike, tokenId: BigNumberish],
254
- [void],
255
- "nonpayable"
256
- >;
257
-
258
- "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod<
259
- [
260
- from: AddressLike,
261
- to: AddressLike,
262
- tokenId: BigNumberish,
263
- data: BytesLike
264
- ],
265
- [void],
266
- "nonpayable"
267
- >;
268
-
269
- setApprovalForAll: TypedContractMethod<
270
- [operator: AddressLike, approved: boolean],
271
- [void],
272
- "nonpayable"
273
- >;
274
-
275
- supportsInterface: TypedContractMethod<
276
- [interfaceId: BytesLike],
277
- [boolean],
278
- "view"
279
- >;
280
-
281
- symbol: TypedContractMethod<[], [string], "view">;
282
-
283
- tokenURI: TypedContractMethod<[tokenId: BigNumberish], [string], "view">;
284
-
285
- transferFrom: TypedContractMethod<
286
- [from: AddressLike, to: AddressLike, tokenId: BigNumberish],
287
- [void],
288
- "nonpayable"
289
- >;
290
-
291
- getFunction<T extends ContractMethod = ContractMethod>(
292
- key: string | FunctionFragment
293
- ): T;
294
-
295
- getFunction(
296
- nameOrSignature: "approve"
297
- ): TypedContractMethod<
298
- [to: AddressLike, tokenId: BigNumberish],
299
- [void],
300
- "nonpayable"
301
- >;
302
- getFunction(
303
- nameOrSignature: "balanceOf"
304
- ): TypedContractMethod<[owner: AddressLike], [bigint], "view">;
305
- getFunction(
306
- nameOrSignature: "getApproved"
307
- ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">;
308
- getFunction(
309
- nameOrSignature: "isApprovedForAll"
310
- ): TypedContractMethod<
311
- [owner: AddressLike, operator: AddressLike],
312
- [boolean],
313
- "view"
314
- >;
315
- getFunction(
316
- nameOrSignature: "name"
317
- ): TypedContractMethod<[], [string], "view">;
318
- getFunction(
319
- nameOrSignature: "ownerOf"
320
- ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">;
321
- getFunction(
322
- nameOrSignature: "safeTransferFrom(address,address,uint256)"
323
- ): TypedContractMethod<
324
- [from: AddressLike, to: AddressLike, tokenId: BigNumberish],
325
- [void],
326
- "nonpayable"
327
- >;
328
- getFunction(
329
- nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)"
330
- ): TypedContractMethod<
331
- [
332
- from: AddressLike,
333
- to: AddressLike,
334
- tokenId: BigNumberish,
335
- data: BytesLike
336
- ],
337
- [void],
338
- "nonpayable"
339
- >;
340
- getFunction(
341
- nameOrSignature: "setApprovalForAll"
342
- ): TypedContractMethod<
343
- [operator: AddressLike, approved: boolean],
344
- [void],
345
- "nonpayable"
346
- >;
347
- getFunction(
348
- nameOrSignature: "supportsInterface"
349
- ): TypedContractMethod<[interfaceId: BytesLike], [boolean], "view">;
350
- getFunction(
351
- nameOrSignature: "symbol"
352
- ): TypedContractMethod<[], [string], "view">;
353
- getFunction(
354
- nameOrSignature: "tokenURI"
355
- ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">;
356
- getFunction(
357
- nameOrSignature: "transferFrom"
358
- ): TypedContractMethod<
359
- [from: AddressLike, to: AddressLike, tokenId: BigNumberish],
360
- [void],
361
- "nonpayable"
362
- >;
363
-
364
- getEvent(
365
- key: "Approval"
366
- ): TypedContractEvent<
367
- ApprovalEvent.InputTuple,
368
- ApprovalEvent.OutputTuple,
369
- ApprovalEvent.OutputObject
370
- >;
371
- getEvent(
372
- key: "ApprovalForAll"
373
- ): TypedContractEvent<
374
- ApprovalForAllEvent.InputTuple,
375
- ApprovalForAllEvent.OutputTuple,
376
- ApprovalForAllEvent.OutputObject
377
- >;
378
- getEvent(
379
- key: "Transfer"
380
- ): TypedContractEvent<
381
- TransferEvent.InputTuple,
382
- TransferEvent.OutputTuple,
383
- TransferEvent.OutputObject
384
- >;
385
-
386
- filters: {
387
- "Approval(address,address,uint256)": TypedContractEvent<
388
- ApprovalEvent.InputTuple,
389
- ApprovalEvent.OutputTuple,
390
- ApprovalEvent.OutputObject
391
- >;
392
- Approval: TypedContractEvent<
393
- ApprovalEvent.InputTuple,
394
- ApprovalEvent.OutputTuple,
395
- ApprovalEvent.OutputObject
396
- >;
397
-
398
- "ApprovalForAll(address,address,bool)": TypedContractEvent<
399
- ApprovalForAllEvent.InputTuple,
400
- ApprovalForAllEvent.OutputTuple,
401
- ApprovalForAllEvent.OutputObject
402
- >;
403
- ApprovalForAll: TypedContractEvent<
404
- ApprovalForAllEvent.InputTuple,
405
- ApprovalForAllEvent.OutputTuple,
406
- ApprovalForAllEvent.OutputObject
407
- >;
408
-
409
- "Transfer(address,address,uint256)": TypedContractEvent<
410
- TransferEvent.InputTuple,
411
- TransferEvent.OutputTuple,
412
- TransferEvent.OutputObject
413
- >;
414
- Transfer: TypedContractEvent<
415
- TransferEvent.InputTuple,
416
- TransferEvent.OutputTuple,
417
- TransferEvent.OutputObject
418
- >;
419
- };
420
- }
@@ -1,131 +0,0 @@
1
- /* Autogenerated file. Do not edit manually. */
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- import type {
5
- FunctionFragment,
6
- Typed,
7
- EventFragment,
8
- ContractTransaction,
9
- ContractTransactionResponse,
10
- DeferredTopicFilter,
11
- EventLog,
12
- TransactionRequest,
13
- LogDescription,
14
- } from "ethers";
15
-
16
- export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent>
17
- extends DeferredTopicFilter {}
18
-
19
- export interface TypedContractEvent<
20
- InputTuple extends Array<any> = any,
21
- OutputTuple extends Array<any> = any,
22
- OutputObject = any
23
- > {
24
- (...args: Partial<InputTuple>): TypedDeferredTopicFilter<
25
- TypedContractEvent<InputTuple, OutputTuple, OutputObject>
26
- >;
27
- name: string;
28
- fragment: EventFragment;
29
- getFragment(...args: Partial<InputTuple>): EventFragment;
30
- }
31
-
32
- type __TypechainAOutputTuple<T> = T extends TypedContractEvent<
33
- infer _U,
34
- infer W
35
- >
36
- ? W
37
- : never;
38
- type __TypechainOutputObject<T> = T extends TypedContractEvent<
39
- infer _U,
40
- infer _W,
41
- infer V
42
- >
43
- ? V
44
- : never;
45
-
46
- export interface TypedEventLog<TCEvent extends TypedContractEvent>
47
- extends Omit<EventLog, "args"> {
48
- args: __TypechainAOutputTuple<TCEvent> & __TypechainOutputObject<TCEvent>;
49
- }
50
-
51
- export interface TypedLogDescription<TCEvent extends TypedContractEvent>
52
- extends Omit<LogDescription, "args"> {
53
- args: __TypechainAOutputTuple<TCEvent> & __TypechainOutputObject<TCEvent>;
54
- }
55
-
56
- export type TypedListener<TCEvent extends TypedContractEvent> = (
57
- ...listenerArg: [
58
- ...__TypechainAOutputTuple<TCEvent>,
59
- TypedEventLog<TCEvent>,
60
- ...undefined[]
61
- ]
62
- ) => void;
63
-
64
- export type MinEthersFactory<C, ARGS> = {
65
- deploy(...a: ARGS[]): Promise<C>;
66
- };
67
-
68
- export type GetContractTypeFromFactory<F> = F extends MinEthersFactory<
69
- infer C,
70
- any
71
- >
72
- ? C
73
- : never;
74
- export type GetARGsTypeFromFactory<F> = F extends MinEthersFactory<any, any>
75
- ? Parameters<F["deploy"]>
76
- : never;
77
-
78
- export type StateMutability = "nonpayable" | "payable" | "view";
79
-
80
- export type BaseOverrides = Omit<TransactionRequest, "to" | "data">;
81
- export type NonPayableOverrides = Omit<
82
- BaseOverrides,
83
- "value" | "blockTag" | "enableCcipRead"
84
- >;
85
- export type PayableOverrides = Omit<
86
- BaseOverrides,
87
- "blockTag" | "enableCcipRead"
88
- >;
89
- export type ViewOverrides = Omit<TransactionRequest, "to" | "data">;
90
- export type Overrides<S extends StateMutability> = S extends "nonpayable"
91
- ? NonPayableOverrides
92
- : S extends "payable"
93
- ? PayableOverrides
94
- : ViewOverrides;
95
-
96
- export type PostfixOverrides<A extends Array<any>, S extends StateMutability> =
97
- | A
98
- | [...A, Overrides<S>];
99
- export type ContractMethodArgs<
100
- A extends Array<any>,
101
- S extends StateMutability
102
- > = PostfixOverrides<{ [I in keyof A]-?: A[I] | Typed }, S>;
103
-
104
- export type DefaultReturnType<R> = R extends Array<any> ? R[0] : R;
105
-
106
- // export interface ContractMethod<A extends Array<any> = Array<any>, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> {
107
- export interface TypedContractMethod<
108
- A extends Array<any> = Array<any>,
109
- R = any,
110
- S extends StateMutability = "payable"
111
- > {
112
- (...args: ContractMethodArgs<A, S>): S extends "view"
113
- ? Promise<DefaultReturnType<R>>
114
- : Promise<ContractTransactionResponse>;
115
-
116
- name: string;
117
-
118
- fragment: FunctionFragment;
119
-
120
- getFragment(...args: ContractMethodArgs<A, S>): FunctionFragment;
121
-
122
- populateTransaction(
123
- ...args: ContractMethodArgs<A, S>
124
- ): Promise<ContractTransaction>;
125
- staticCall(
126
- ...args: ContractMethodArgs<A, "view">
127
- ): Promise<DefaultReturnType<R>>;
128
- send(...args: ContractMethodArgs<A, S>): Promise<ContractTransactionResponse>;
129
- estimateGas(...args: ContractMethodArgs<A, S>): Promise<bigint>;
130
- staticCallResult(...args: ContractMethodArgs<A, "view">): Promise<R>;
131
- }