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

ProviderAPI implementation using Geth/parity proxy [APE-780] #81

Open
antazoey opened this issue Mar 31, 2023 · 0 comments
Open

ProviderAPI implementation using Geth/parity proxy [APE-780] #81

antazoey opened this issue Mar 31, 2023 · 0 comments

Comments

@antazoey
Copy link
Member

Overview

One could implement a ProviderAPI using Etherscan's Geth/Parity proxy API: https://docs.etherscan.io/api-endpoints/geth-parity-proxy.

This is a good opportunity for a contributor to create a ProviderAPI implementation without having to make a whole new plugin!

Specification

Just an idea / psuedo-python (missing tons of things - this code wont work at all, just for demo, <3)

(ape_etherscan/provider.py)

from ape.api import ProviderAPI, BlockAPI

class EtherscanProvider(ProviderAPI):
    client_factory
    
    @cached_property
    def client(self) -> ProxyClient:
        ...
        
    def get_block(self, number):
        response = self.client.get_block(number)
        return BlockAPI.parse_obj(response)

Dependencies

Include links to any open issues that must be resolved before this feature can be implemented.

@NotPeopling2day NotPeopling2day changed the title ProviderAPI implementation using Geth/parity proxy ProviderAPI implementation using Geth/parity proxy [APE-780] Mar 31, 2023
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