Git Product home page Git Product logo

py-tokenlists's Issues

Add support for loading lists via file path

Overview

I have a repo that makes it easy to build a tokenlist out of on-chain data. The output file is saved to disk.

Specification

Installation currently goes through requests.get

If we see it starts with "file://" we can load the file instead of using requests.

Dependencies

I don't think there are any.

ValueError for tokenlist not found is really long

Environment information

python
ape

What went wrong?

when getting a ValueError for tokenlist, not found, the repr of the list is really long.

it looks like from this line: https://github.com/ApeWorX/py-tokenlists/blob/main/tokenlists/manager.py#L129-L131

For some reason, it seems like tokenlist.name is a massive data object repr for some reason, but I am not sure, will have to investigate.

more info:
ApeWorX/ape-tokens#18

How can it be fixed?

Fill this in if you have ideas on how the bug could be fixed.

Upgrade tokenlists CLI

Overview

Would be nice if there was a way to upgrade a tokenlist

Specification

Probably need to add the original download URI to Tokenlist, so that it can be referenced for later (or in a separate section)

Then add tokenlists upgrade that will go through all the lists and update them to the latest

Dependencies

n/a

ValidationError on object-typed extension schema - nested level extensions do not work

Environment information

  • Python Version: 3.9.7
  • OS: macOS

Latest.

As per this PR: Uniswap/token-lists@74d8910,
object schemas are now supported in the schema for extensions.

However, when trying to use them, the package fails with a pydantic validation error: Incorrect extension field value: {...}

You will notice the tests fail for this reason too.

How can it be fixed?

Probably the best way is to build another model for the new extension schema and include the model in the Union of supported types.

Add index of lists from tokenlists.org

Overview

It'd be really nice to be able to have an index of installable lists from the index provided at https://tokenlists.org/.

This would also support installing via alias from that index, as well as the normal URI method

Specification

$ tokenlists list --all
Installed lists:
...

Available lists:
...

Dependencies

n/a

Warn instead of error if there are invalid token lists

Overview

I installed a list with invalid syntax. It installed without error, but the next time the process started, creating the manager erred with pydantic.error_wrappers.ValidationError: 63 validation errors for TokenList and a long list of the errors. It does not say what file it was processing.

Specification

If a file fails to load, instead of raising a ValidationError, a warning should be emitted with the name of the file.

Store default in data folder

The default choice could be stored in the data folder, making it possible for there to be an automatically detected default when loading the library

cross chain token list not working

Environment information

  • Python Version: 3.9
  • OS: macos

Python environment

$ pip freeze
# ...copy and paste result of above command here...

What went wrong?

Please include information like:

Tried to load this token lists: https://github.com/Uniswap/token-lists/blob/main/test/schema/example-crosschain.tokenlist.json
but it fails with ValidationError about extensions since it is dict and not one of the expected types

How can it be fixed?

Handle multi-chain bridge like extensions data structure (dictionary of sorts)

Upgrade version of `pyyaml`

Environment information

  • Python Version: 3.8
  • OS: linux

What went wrong?

ERROR: tokenlists 0.1.1 has requirement pyyaml<6,>=5.4.1, but you'll have pyyaml 6.0 which is incompatible

How can it be fixed?

Fill this in if you have ideas on how the bug could be fixed.

How to use?

Thanks for your work, but sry, I want to know how to use it?

case insensitive get_token_info

I was trying to load "dai" but I had to instead load "DAI". Should these checks be case-sensitive? It might make duplicates more common, but I doubt it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.