aave-js
aave-js copied to clipboard
RFC: less strict types & flattened props
Currently aave-js is super coupled to our graphql types & the aave user interface, but our users aren't necessarily. This introduces usage problems when data comes from other sources.
In the example of formatReserves
we expect:
- a full
ReserveData
item, although we only need a very small subset - the price to be nested for no reason
- the reference reserve to be an array of reserves containing an array of
paramsHistory
where the first item is expected to contain the30dagoData
.
I think the 30dago should not be part of that function, the input type should be as narrow as possible and the price should be flat. This would allow us much easier usage of the function even when data comes from the blockchain or other sources instead of thegraph.
Related to #116