Skip to content

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

@antazoey

Description

@antazoey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions