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

Feature Request: Batch Calls #12

Open
bh2smith opened this issue Jun 17, 2022 · 0 comments
Open

Feature Request: Batch Calls #12

bh2smith opened this issue Jun 17, 2022 · 0 comments

Comments

@bh2smith
Copy link

It would be super cool to facilitate the possibility of fetching token data (i.e. symbol, decimals) for a given list of token addresses and making a single batched eth_call in on request.

Similar work was done here: Basically input a list of addresses and making a list of request data before making the eth call:

https://github.com/cowprotocol/token-allocation/blob/b969f3e2ad48041f7459fed4d80527bb188f232f/src/fetch/contracts.py#L47-L75

The most relevant code block here was:

        for index, eth_address in enumerate(addresses):
            request_data.append({
                "jsonrpc": "2.0",
                "method": "eth_getCode",
                "params": [eth_address, "latest"],
                "id": index
            })
        response = requests.post(self.node_url, json=request_data)

I would volunteer to implement, but don't have time at the moment, recording this issue here in case someone wants to pick it up.

Cheers.

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

No branches or pull requests

1 participant