Пример #1
0
 def __init__(self):
     from web3.version import Version
     self.keyfile = '0x49E93aA0CEBE448f1603e8AB932ecc04645dc9B9'
     self.keypasswd = '123456'
     ver = Version(wp3)
     self.ethNet = ver.network
     self.Jdata = '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xB8DC8bD7005b6EeBced32F80C2a541CB864EB6ae", "latest"],"id":1}'
     w3.eth.enable_unaudited_features()
     print("web3 version is : ", wp3.version.api)
Пример #2
0
    def __init__(self, provider):
        self._requestManager = RequestManager(provider)

        self.eth = Eth(self)
        self.db = Db(self)
        self.shh = Shh(self)
        self.net = Net(self)
        self.personal = Personal(self)
        self.version = Version(self)
        self.txpool = TxPool(self)
        self.miner = Miner(self)
        self.admin = Admin(self)
Пример #3
0
    def __init__(self, provider):
        self._requestManager = RequestManager(provider)
        self.currentProvider = provider

        self.eth = Eth(self)
        self.db = Db(self._requestManager)
        self.shh = Shh(self._requestManager)
        self.net = Net(self._requestManager)
        self.personal = Personal(self._requestManager)
        self.version = Version(self._requestManager)
        self.txpool = TxPool(self._requestManager)
        self.miner = Miner(self._requestManager)
        self.admin = Admin(self._requestManager)

        self.providers = {
            'RPCProvider': RPCProvider,
            'IPCProvider': IPCProvider,
            'TestRPCProvider': TestRPCProvider,
        }

        self.RPCProvider = RPCProvider
        self.IPCProvider = IPCProvider
        self.TestRPCProvider = TestRPCProvider

        # Encoding and Decoding
        self.toHex = to_hex
        self.toAscii = decode_hex
        self.toUtf8 = compose(decode_hex, force_text)
        self.fromAscii = encode_hex
        self.fromUtf8 = encode_hex
        self.toDecimal = to_decimal
        self.fromDecimal = from_decimal

        # Currency Utility
        self.toWei = to_wei
        self.fromWei = from_wei

        # Address Utility
        self.isAddress = is_address
        self.isChecksumAddress = is_checksum_address
        self.toChecksumAddress = to_checksum_address