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

sapphire-py: Add networks RPC URLs to constant #380

Open
matevz opened this issue Sep 5, 2024 · 0 comments
Open

sapphire-py: Add networks RPC URLs to constant #380

matevz opened this issue Sep 5, 2024 · 0 comments
Assignees
Labels

Comments

@matevz
Copy link
Member

matevz commented Sep 5, 2024

SUMMARY

The map of network name -> RPC URL should be part of the Sapphire Py wrapper.

This is a typical snippet in the current python projects:

    def __init__(self, network_name: str):
        networks = {
            "sapphire": "https://sapphire.oasis.io",
            "sapphire-testnet": "https://testnet.sapphire.oasis.io",
            "sapphire-localnet": "http://localhost:8545",
        }
        self.w3 = setup_web3_middleware(networks.get(network_name), PRIVATE_KEY)

sapphire.NETWORKS constant should be used instead of networks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants