Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌟 feat(domain-config): Domain config for Tokens/LendingProtocols etc #51

Merged
merged 19 commits into from
Oct 17, 2023

Conversation

zerotucks
Copy link
Contributor

@zerotucks zerotucks commented Oct 13, 2023

Changes πŸ‘·β€β™€οΈ

  • add Domain config
  • create shared directory for common domain level items and types
  • expose tokens, tokensByNetwork, lending protocols, networks and denomination symbols (for Subgraph/Token service)
  • add addresses to tokensByNetwork from addresses package
  • incorporate tokenSymbols into parts of OB config

Separate PR [Is out of date] -> (https://github.com/OasisDEX/oasis-borrow/pull/2973/files) have created a custom script to parse the config object and generate enums/interfaces for it.

@zerotucks zerotucks marked this pull request as draft October 13, 2023 08:44
@zerotucks zerotucks marked this pull request as ready for review October 13, 2023 09:56
Copy link
Contributor

@piotrwitek piotrwitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to propose improved naming conventions for better readibility and maintainability of the code.

  1. Enums usually use a singular form DenominationSymbol instead of DenominationSymbols, a lot of inconsistency here for example: LendingProtocol enum is singular but Networks enum is plurar
  1. Dictionaries usually use different conventions than arrays:
  • tokens - I would expect that to return and array of tokens, but in reality it returns a dictionary mapping symbols to tokens
  • I would like to propose to use clearer convention to name such dictionaries for example take a look at tokensByNetwork Which actually uses a pretty clear convention that on a first glance tell me that it contains a mapping of tokens with network as key
  • So I would rename tokens to tokenByTokenSymbol
  1. Also adding simple description comment for each dictionary object would be great but good name using convention should be enough

tsconfig.json Show resolved Hide resolved
shared/lending-protocols.ts Outdated Show resolved Hide resolved
shared/tokens.ts Outdated Show resolved Hide resolved
configs/domain/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@piotrwitek piotrwitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, docs looks solid now πŸ‘

configs/domain/index.ts Outdated Show resolved Hide resolved
configs/domain/index.ts Outdated Show resolved Hide resolved
configs/domain/index.ts Outdated Show resolved Hide resolved
@zerotucks zerotucks merged commit ede611e into main Oct 17, 2023
1 check passed
@zerotucks zerotucks deleted the feat/jt/token-config branch October 17, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants