Skip to content

Feature Request: Batch Calls #12

@bh2smith

Description

@bh2smith

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions