Feat/refactor markets and tokens - #205
Conversation
aarmoa
commented
May 25, 2023
- Modeled the Markets (SpotMarket, DerivativeMarket and BinaryOptionMarket) and Token.
- AsynClient initializes list of all markets and tokens, and uses them to create Composer instances.
- Composer uses the markets and/or tokens instances to translate human-readable values into chain accepted format.
- Composer is still able to use the information from the configuration files with Denom instances if they are created without passing the list of markets and tokens. That will still be the default behavior for any current SDK user until they migrate their code to start getting the Composer instances from the AsyncClient.
- All example files have been updated to reflect the new way of creating Composer instances
…e human-readable values into chain format
…eing used for Binary Options
|
|
||
| def Trades(self, request, context): | ||
| """Trades gets the trades of a Derivative Market. | ||
| """Trades gets the trades of a Derivative SpotMarket. |
| ) | ||
| self.Market = channel.unary_unary( | ||
| '/injective_derivative_exchange_rpc.InjectiveDerivativeExchangeRPC/Market', | ||
| '/injective_derivative_exchange_rpc.InjectiveDerivativeExchangeRPC/SpotMarket', |
There was a problem hiding this comment.
Did you manually edit these files? These should be auto-generated afaik @aarmoa
…h for spot and derivative markets
…e human-readable values into chain format
|
I have analyzed the differences between the current production code (using the Denoms loaded from the .ini files) and the logic using the new Markets and Tokens in this branch in The differences founds are the following:
After this validation, I think that it is safe to merge this branch into the |
…info in the `utils` module
@aarmoa please run the examples to make sure there's backwards compatibility. We used this script: https://github.com/InjectiveLabs/sdk-python/blob/master/run-examples.sh a while back to run all examples - we can modify and use it moving forward. |
…e markets in the chain
… execution off all examples with the new code base
Thank you @achilleas-kal for spotting this. I was able to reproduce the issue and fix the problem, and added a unit tests for the scenario to avoid the same error happening again in the future. |
…uired and is causing problems during `pipenv install`
…e human-readable values into chain format
…eing used for Binary Options
…e human-readable values into chain format
…info in the `utils` module
…e markets in the chain
… execution off all examples with the new code base
…/InjectiveLabs/sdk-python into feat/refactor_markets_and_tokens
…tokens with repeated symbol but different denom as different tokens
…o feat/refactor_markets_and_tokens