oasisprotocol / sapphire-paratime

Oasis Sapphire - the confidential EVM-compatible ParaTime for the Oasis Network
https://oasisprotocol.org/sapphire
Apache License 2.0
39 stars 27 forks source link

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

Open matevz opened 2 months ago

matevz commented 2 months ago
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.