As many elements have been added recently, it would be useful to reorganize the contents of this file into modules, structures, and objects to achieve a more functional and idiomatic TypeScript implementation while preserving exactly the same functionalities.
Goals
Reorganize the transaction.ts file for better readability and maintainability.
Separate concerns by breaking down the file into modules, structures, and objects.
Ensure the code is idiomatic to TypeScript.
Preserve all existing functionalities.
Action Items
Modularization
Identify distinct functionalities and group them into appropriate modules.
Create separate files for different logical units.
Refactoring
Refactor functions to use TypeScript's features like interfaces, types, and classes.
Simplify complex functions for better readability.
Documentation
Add detailed comments and JSDoc for better understanding and maintainability.
Testing
Ensure all existing tests pass after refactoring.
Write new tests if necessary to cover any new code paths introduced during refactoring.
These action items are just ideas, feel free to challenge it and propose something better.
Describe the Enhancement Request
At the moment, our
transaction.ts
file contains a lot of different logic in multiple functions.https://github.com/kkrt-labs/kakarot-rpc/blob/main/indexer/src/types/transaction.ts
As many elements have been added recently, it would be useful to reorganize the contents of this file into modules, structures, and objects to achieve a more functional and idiomatic TypeScript implementation while preserving exactly the same functionalities.
Goals
transaction.ts
file for better readability and maintainability.Action Items
Modularization
Refactoring
Documentation
Testing
These action items are just ideas, feel free to challenge it and propose something better.