Skip to content

Commit

Permalink
feat: get token pairs list from indexer (#476)
Browse files Browse the repository at this point in the history
* feat: add indexer streaming class

* feat: abstract out IndexerStream class and add extended versions

* feat: abstract out indexer streaming classes into base and accumulator

    - allow single and dual data set accumulation classes

* feat: add general method to fetch streamed data from indexer

* feat: add hooks to use Indexer streams generally

* feat: ensure React state objects change when dataSet is updated

    - and not mutating Class state (as a minor concern to interfacing)

* feat: abstract out accumulation functions for streams can use mutation

    - includes sample use

* feat: allow passing of abortController to any Indexer stream function

    - for easy cancellation

* feat: allow numbers or strings in indexer payload Types

* feat: swap out useTokenPair logic from LCD to Indexer endpoint

* feat: sort and memoize liquidity pair data from indexer hook

* refactor: remove indexer timeseries abstractions:

    - they are small and not that helpful, they are just URL creators

* fix: remove abortIndexer option for React hook usage of indexer:

    - it gets too complicated
    - these hooks should not be used for the purpose of queries
      where we expect the request to end. that is much better suited
      to the fetchDataFromIndexer abstraction (which can be used in
      a hook like useQuery or useSWR if desired)

* feat: cache indexer requests when using indexer hooks

* feat: remove no longer needed "stream" query param

* fix: row data type could be an array or single value

* feat: simplify DataSet maps by removing duplicate data:

    - ID can just be the key, it doesn't need to be data
    - it is easy to put the ID back into an array with Array.from(map)

* docs: add note about easy error to make when using indexer streams

* fix: error event listener should also have same listenerOptions

* fix: datasets were not being saved inside class instances due to this

* feat: add long-polling mechanism as an indexer stream mechanism option

* feat: improve long-polling retry logic

* feat: add optional way to remove values from indexer accumulator maps

* refactor: extend callback types better
  • Loading branch information
dib542 authored Nov 25, 2023
1 parent a314d12 commit 59d2e0e
Show file tree
Hide file tree
Showing 3 changed files with 544 additions and 110 deletions.
Loading

0 comments on commit 59d2e0e

Please sign in to comment.