@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,440 +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 ERC1155Interface extends Interface {
27
- getFunction(
28
- nameOrSignature:
29
- | "balanceOf"
30
- | "balanceOfBatch"
31
- | "isApprovedForAll"
32
- | "safeBatchTransferFrom"
33
- | "safeTransferFrom"
34
- | "setApprovalForAll"
35
- | "supportsInterface"
36
- | "uri"
37
- ): FunctionFragment;
38
-
39
- getEvent(
40
- nameOrSignatureOrTopic:
41
- | "ApprovalForAll"
42
- | "TransferBatch"
43
- | "TransferSingle"
44
- | "URI"
45
- ): EventFragment;
46
-
47
- encodeFunctionData(
48
- functionFragment: "balanceOf",
49
- values: [AddressLike, BigNumberish]
50
- ): string;
51
- encodeFunctionData(
52
- functionFragment: "balanceOfBatch",
53
- values: [AddressLike[], BigNumberish[]]
54
- ): string;
55
- encodeFunctionData(
56
- functionFragment: "isApprovedForAll",
57
- values: [AddressLike, AddressLike]
58
- ): string;
59
- encodeFunctionData(
60
- functionFragment: "safeBatchTransferFrom",
61
- values: [
62
- AddressLike,
63
- AddressLike,
64
- BigNumberish[],
65
- BigNumberish[],
66
- BytesLike
67
- ]
68
- ): string;
69
- encodeFunctionData(
70
- functionFragment: "safeTransferFrom",
71
- values: [AddressLike, AddressLike, BigNumberish, BigNumberish, BytesLike]
72
- ): string;
73
- encodeFunctionData(
74
- functionFragment: "setApprovalForAll",
75
- values: [AddressLike, boolean]
76
- ): string;
77
- encodeFunctionData(
78
- functionFragment: "supportsInterface",
79
- values: [BytesLike]
80
- ): string;
81
- encodeFunctionData(functionFragment: "uri", values: [BigNumberish]): string;
82
-
83
- decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
84
- decodeFunctionResult(
85
- functionFragment: "balanceOfBatch",
86
- data: BytesLike
87
- ): Result;
88
- decodeFunctionResult(
89
- functionFragment: "isApprovedForAll",
90
- data: BytesLike
91
- ): Result;
92
- decodeFunctionResult(
93
- functionFragment: "safeBatchTransferFrom",
94
- data: BytesLike
95
- ): Result;
96
- decodeFunctionResult(
97
- functionFragment: "safeTransferFrom",
98
- data: BytesLike
99
- ): Result;
100
- decodeFunctionResult(
101
- functionFragment: "setApprovalForAll",
102
- data: BytesLike
103
- ): Result;
104
- decodeFunctionResult(
105
- functionFragment: "supportsInterface",
106
- data: BytesLike
107
- ): Result;
108
- decodeFunctionResult(functionFragment: "uri", data: BytesLike): Result;
109
- }
110
-
111
- export namespace ApprovalForAllEvent {
112
- export type InputTuple = [
113
- account: AddressLike,
114
- operator: AddressLike,
115
- approved: boolean
116
- ];
117
- export type OutputTuple = [
118
- account: string,
119
- operator: string,
120
- approved: boolean
121
- ];
122
- export interface OutputObject {
123
- account: string;
124
- operator: string;
125
- approved: boolean;
126
- }
127
- export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
128
- export type Filter = TypedDeferredTopicFilter<Event>;
129
- export type Log = TypedEventLog<Event>;
130
- export type LogDescription = TypedLogDescription<Event>;
131
- }
132
-
133
- export namespace TransferBatchEvent {
134
- export type InputTuple = [
135
- operator: AddressLike,
136
- from: AddressLike,
137
- to: AddressLike,
138
- ids: BigNumberish[],
139
- values: BigNumberish[]
140
- ];
141
- export type OutputTuple = [
142
- operator: string,
143
- from: string,
144
- to: string,
145
- ids: bigint[],
146
- values: bigint[]
147
- ];
148
- export interface OutputObject {
149
- operator: string;
150
- from: string;
151
- to: string;
152
- ids: bigint[];
153
- values: bigint[];
154
- }
155
- export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
156
- export type Filter = TypedDeferredTopicFilter<Event>;
157
- export type Log = TypedEventLog<Event>;
158
- export type LogDescription = TypedLogDescription<Event>;
159
- }
160
-
161
- export namespace TransferSingleEvent {
162
- export type InputTuple = [
163
- operator: AddressLike,
164
- from: AddressLike,
165
- to: AddressLike,
166
- id: BigNumberish,
167
- value: BigNumberish
168
- ];
169
- export type OutputTuple = [
170
- operator: string,
171
- from: string,
172
- to: string,
173
- id: bigint,
174
- value: bigint
175
- ];
176
- export interface OutputObject {
177
- operator: string;
178
- from: string;
179
- to: string;
180
- id: bigint;
181
- value: 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 namespace URIEvent {
190
- export type InputTuple = [value: string, id: BigNumberish];
191
- export type OutputTuple = [value: string, id: bigint];
192
- export interface OutputObject {
193
- value: string;
194
- id: bigint;
195
- }
196
- export type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
197
- export type Filter = TypedDeferredTopicFilter<Event>;
198
- export type Log = TypedEventLog<Event>;
199
- export type LogDescription = TypedLogDescription<Event>;
200
- }
201
-
202
- export interface ERC1155 extends BaseContract {
203
- connect(runner?: ContractRunner | null): ERC1155;
204
- waitForDeployment(): Promise<this>;
205
-
206
- interface: ERC1155Interface;
207
-
208
- queryFilter<TCEvent extends TypedContractEvent>(
209
- event: TCEvent,
210
- fromBlockOrBlockhash?: string | number | undefined,
211
- toBlock?: string | number | undefined
212
- ): Promise<Array<TypedEventLog<TCEvent>>>;
213
- queryFilter<TCEvent extends TypedContractEvent>(
214
- filter: TypedDeferredTopicFilter<TCEvent>,
215
- fromBlockOrBlockhash?: string | number | undefined,
216
- toBlock?: string | number | undefined
217
- ): Promise<Array<TypedEventLog<TCEvent>>>;
218
-
219
- on<TCEvent extends TypedContractEvent>(
220
- event: TCEvent,
221
- listener: TypedListener<TCEvent>
222
- ): Promise<this>;
223
- on<TCEvent extends TypedContractEvent>(
224
- filter: TypedDeferredTopicFilter<TCEvent>,
225
- listener: TypedListener<TCEvent>
226
- ): Promise<this>;
227
-
228
- once<TCEvent extends TypedContractEvent>(
229
- event: TCEvent,
230
- listener: TypedListener<TCEvent>
231
- ): Promise<this>;
232
- once<TCEvent extends TypedContractEvent>(
233
- filter: TypedDeferredTopicFilter<TCEvent>,
234
- listener: TypedListener<TCEvent>
235
- ): Promise<this>;
236
-
237
- listeners<TCEvent extends TypedContractEvent>(
238
- event: TCEvent
239
- ): Promise<Array<TypedListener<TCEvent>>>;
240
- listeners(eventName?: string): Promise<Array<Listener>>;
241
- removeAllListeners<TCEvent extends TypedContractEvent>(
242
- event?: TCEvent
243
- ): Promise<this>;
244
-
245
- balanceOf: TypedContractMethod<
246
- [account: AddressLike, id: BigNumberish],
247
- [bigint],
248
- "view"
249
- >;
250
-
251
- balanceOfBatch: TypedContractMethod<
252
- [accounts: AddressLike[], ids: BigNumberish[]],
253
- [bigint[]],
254
- "view"
255
- >;
256
-
257
- isApprovedForAll: TypedContractMethod<
258
- [account: AddressLike, operator: AddressLike],
259
- [boolean],
260
- "view"
261
- >;
262
-
263
- safeBatchTransferFrom: TypedContractMethod<
264
- [
265
- from: AddressLike,
266
- to: AddressLike,
267
- ids: BigNumberish[],
268
- amounts: BigNumberish[],
269
- data: BytesLike
270
- ],
271
- [void],
272
- "nonpayable"
273
- >;
274
-
275
- safeTransferFrom: TypedContractMethod<
276
- [
277
- from: AddressLike,
278
- to: AddressLike,
279
- id: BigNumberish,
280
- amount: BigNumberish,
281
- data: BytesLike
282
- ],
283
- [void],
284
- "nonpayable"
285
- >;
286
-
287
- setApprovalForAll: TypedContractMethod<
288
- [operator: AddressLike, approved: boolean],
289
- [void],
290
- "nonpayable"
291
- >;
292
-
293
- supportsInterface: TypedContractMethod<
294
- [interfaceId: BytesLike],
295
- [boolean],
296
- "view"
297
- >;
298
-
299
- uri: TypedContractMethod<[arg0: BigNumberish], [string], "view">;
300
-
301
- getFunction<T extends ContractMethod = ContractMethod>(
302
- key: string | FunctionFragment
303
- ): T;
304
-
305
- getFunction(
306
- nameOrSignature: "balanceOf"
307
- ): TypedContractMethod<
308
- [account: AddressLike, id: BigNumberish],
309
- [bigint],
310
- "view"
311
- >;
312
- getFunction(
313
- nameOrSignature: "balanceOfBatch"
314
- ): TypedContractMethod<
315
- [accounts: AddressLike[], ids: BigNumberish[]],
316
- [bigint[]],
317
- "view"
318
- >;
319
- getFunction(
320
- nameOrSignature: "isApprovedForAll"
321
- ): TypedContractMethod<
322
- [account: AddressLike, operator: AddressLike],
323
- [boolean],
324
- "view"
325
- >;
326
- getFunction(
327
- nameOrSignature: "safeBatchTransferFrom"
328
- ): TypedContractMethod<
329
- [
330
- from: AddressLike,
331
- to: AddressLike,
332
- ids: BigNumberish[],
333
- amounts: BigNumberish[],
334
- data: BytesLike
335
- ],
336
- [void],
337
- "nonpayable"
338
- >;
339
- getFunction(
340
- nameOrSignature: "safeTransferFrom"
341
- ): TypedContractMethod<
342
- [
343
- from: AddressLike,
344
- to: AddressLike,
345
- id: BigNumberish,
346
- amount: BigNumberish,
347
- data: BytesLike
348
- ],
349
- [void],
350
- "nonpayable"
351
- >;
352
- getFunction(
353
- nameOrSignature: "setApprovalForAll"
354
- ): TypedContractMethod<
355
- [operator: AddressLike, approved: boolean],
356
- [void],
357
- "nonpayable"
358
- >;
359
- getFunction(
360
- nameOrSignature: "supportsInterface"
361
- ): TypedContractMethod<[interfaceId: BytesLike], [boolean], "view">;
362
- getFunction(
363
- nameOrSignature: "uri"
364
- ): TypedContractMethod<[arg0: BigNumberish], [string], "view">;
365
-
366
- getEvent(
367
- key: "ApprovalForAll"
368
- ): TypedContractEvent<
369
- ApprovalForAllEvent.InputTuple,
370
- ApprovalForAllEvent.OutputTuple,
371
- ApprovalForAllEvent.OutputObject
372
- >;
373
- getEvent(
374
- key: "TransferBatch"
375
- ): TypedContractEvent<
376
- TransferBatchEvent.InputTuple,
377
- TransferBatchEvent.OutputTuple,
378
- TransferBatchEvent.OutputObject
379
- >;
380
- getEvent(
381
- key: "TransferSingle"
382
- ): TypedContractEvent<
383
- TransferSingleEvent.InputTuple,
384
- TransferSingleEvent.OutputTuple,
385
- TransferSingleEvent.OutputObject
386
- >;
387
- getEvent(
388
- key: "URI"
389
- ): TypedContractEvent<
390
- URIEvent.InputTuple,
391
- URIEvent.OutputTuple,
392
- URIEvent.OutputObject
393
- >;
394
-
395
- filters: {
396
- "ApprovalForAll(address,address,bool)": TypedContractEvent<
397
- ApprovalForAllEvent.InputTuple,
398
- ApprovalForAllEvent.OutputTuple,
399
- ApprovalForAllEvent.OutputObject
400
- >;
401
- ApprovalForAll: TypedContractEvent<
402
- ApprovalForAllEvent.InputTuple,
403
- ApprovalForAllEvent.OutputTuple,
404
- ApprovalForAllEvent.OutputObject
405
- >;
406
-
407
- "TransferBatch(address,address,address,uint256[],uint256[])": TypedContractEvent<
408
- TransferBatchEvent.InputTuple,
409
- TransferBatchEvent.OutputTuple,
410
- TransferBatchEvent.OutputObject
411
- >;
412
- TransferBatch: TypedContractEvent<
413
- TransferBatchEvent.InputTuple,
414
- TransferBatchEvent.OutputTuple,
415
- TransferBatchEvent.OutputObject
416
- >;
417
-
418
- "TransferSingle(address,address,address,uint256,uint256)": TypedContractEvent<
419
- TransferSingleEvent.InputTuple,
420
- TransferSingleEvent.OutputTuple,
421
- TransferSingleEvent.OutputObject
422
- >;
423
- TransferSingle: TypedContractEvent<
424
- TransferSingleEvent.InputTuple,
425
- TransferSingleEvent.OutputTuple,
426
- TransferSingleEvent.OutputObject
427
- >;
428
-
429
- "URI(string,uint256)": TypedContractEvent<
430
- URIEvent.InputTuple,
431
- URIEvent.OutputTuple,
432
- URIEvent.OutputObject
433
- >;
434
- URI: TypedContractEvent<
435
- URIEvent.InputTuple,
436
- URIEvent.OutputTuple,
437
- URIEvent.OutputObject
438
- >;
439
- };
440
- }