How to use the hexbytes.main.HexBytes function in hexbytes

To help you get started, we’ve selected a few hexbytes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Lamden / clove / tests / constants.py View on Github external
'to': '0xce07aB9477BC20790B88B398A2A9e0F626c7D263',
    'transactionIndex': 1,
    'v': 28,
    'value': 1000000000000000
})

eth_unsupported_transaction = AttributeDict({
    'input': (
        '0xeb7ae1ed000000000000000000000000000000000000000000000000000000005abe25ea10ff9'
        '72f3d8181f603aa7f6b4bc172de730fec2b00000000000000000000000000000000000000000000'
        '0000d867f293ba129629a9f9355fa285b8d3711a9092'
    ),
})

eth_redeem_tranaction = AttributeDict({
    'blockHash': HexBytes('0x579c835eb257089492b99c44aae33660cd5efd83297036a4d0d6c11c8921ae8c'),
    'blockNumber': 8398155,
    'chainId': None,
    'condition': None,
    'creates': None,
    'from': '0xd867f293Ba129629a9f9355fa285B8D3711a9092',
    'gas': 100000,
    'gasPrice': 2000000000,
    'hash': HexBytes('0x65320e57b9d18ec08388896b029ad1495beb7a57c547440253a1dde01b4485f1'),
    'input': '0xeda1122cbc2424e1dcdd2e425c555bcea35a54fd27cf540e60f18366e153e3fb7cf4490c',
    'nonce': 146,
    'publicKey': HexBytes(
        '0x579c6126677857d4d5a227ed47efbd9742e26f60449e8ea6a536c0dd9b2fb6fb14e0fddc7cb06fd78d2c6c3ef4d1b72e48809650'
        '4817ed7ac252b2453cbfab56'
    ),
    'r': HexBytes('0xcde19e4d2d78e196ecc8dff5ba6e2c90bfc6be93241e8dd2584734e870e6b677'),
    'raw': HexBytes(
github Lamden / clove / tests / constants.py View on Github external
eth_initial_transaction = AttributeDict({
    'blockHash': HexBytes('0x111346453964a0df4fcd50ac759231f4f90a858c6ab62255e7c75089b22b0b40'),
    'blockNumber': 8388823,
    'chainId': None,
    'condition': None,
    'creates': None,
    'from': '0x999F348959E611F1E9eab2927c21E88E48e6Ef45',
    'gas': 140502,
    'gasPrice': 1000000000,
    'hash': HexBytes('0xcf64ef4d0449cf7a78d2be1c1f7225dffb11dded98a58d569ebcc6e883ce9f2b'),
    'input': '0x7337c993000000000000000000000000000000000000000000000000000000005b782cfaed2e6fe492005de2dd82e84d38448'
             '467d632e81c000000000000000000000000000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a90920000'
             '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
             '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    'nonce': 283,
    'publicKey': HexBytes(
        '0x76c4f5810736d1d9b9964863abc339dce70ace058db5c820e5fdec26e0840f36f9adcb150e5216213bc301f3a6b71a178'
        'c81ddd34a361d696c8cb03970590d4f'
    ),
    'r': HexBytes('0x68e2bbdd4cb4e989854a87aa8964c65b3bf28f68183f73f905ab8841db690cbb'),
    'raw': HexBytes(
        '0xf9013282011b843b9aca00830224d694ce07ab9477bc20790b88b398a2a9e0f626c7d26387038d7ea4c68000b8c47337c993000000'
        '000000000000000000000000000000000000000000000000005b782cfaed2e6fe492005de2dd82e84d38448467d632e81c0000000000'
        '00000000000000000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a9092000000000000000000000000000000'
        '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
        '0000000000000000000000000000000000000000000000000000001ca068e2bbdd4cb4e989854a87aa8964c65b3bf28f68183f73f905'
        'ab8841db690cbba0227712dc5c204041cc8c44facac023c457725acc905b2db311b1176cd53836e0'
    ),
    's': HexBytes('0x227712dc5c204041cc8c44facac023c457725acc905b2db311b1176cd53836e0'),
    'standardV': 1,
    'to': '0xce07aB9477BC20790B88B398A2A9e0F626c7D263',
    'transactionIndex': 1,
github Lamden / clove / tests / constants.py View on Github external
'r': HexBytes('0xcde19e4d2d78e196ecc8dff5ba6e2c90bfc6be93241e8dd2584734e870e6b677'),
    'raw': HexBytes(
        '0xf88981928477359400830186a094ce07ab9477bc20790b88b398a2a9e0f626c7d26380a4eda1122cbc2424e1dcdd2e425c555bce'
        'a35a54fd27cf540e60f18366e153e3fb7cf4490c1ba0cde19e4d2d78e196ecc8dff5ba6e2c90bfc6be93241e8dd2584734e870e6b6'
        '77a02fe805af66d13352198a8b19b53ee1dc27671b76a4626af8cead8211537ea7d9'
    ),
    's': HexBytes('0x2fe805af66d13352198a8b19b53ee1dc27671b76a4626af8cead8211537ea7d9'),
    'standardV': 0,
    'to': '0xce07aB9477BC20790B88B398A2A9e0F626c7D263',
    'transactionIndex': 0,
    'v': 27,
    'value': 0
})

token_initial_transaction = AttributeDict({
    'blockHash': HexBytes('0x0cc3bd2154a33a91362ff719c1f891aac2e3bb5ecd298878dd08bbd6c562a9e4'),
    'blockNumber': 8399513,
    'chainId': None,
    'condition': None,
    'creates': None,
    'from': '0x999F348959E611F1E9eab2927c21E88E48e6Ef45',
    'gas': 180590,
    'gasPrice': 1000000000,
    'hash': HexBytes('0x224818e4390e6d4e24b18e19a268825c0bbc649ab3e93dcb446328973dc7914b'),
    'input': '0x7337c993000000000000000000000000000000000000000000000000000000005b7962b834378f0187488d019d3e0151f2fe'
             '3d3672ca310e000000000000000000000000000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a909200'
             '000000000000000000000053e546387a0d054e7ff127923254c0a679da6dbf0000000000000000000000000000000000000000'
             '00000000000000000000000100000000000000000000000000000000000000000000003635c9adc5dea00000',
    'nonce': 287,
    'publicKey': HexBytes(
        '0x76c4f5810736d1d9b9964863abc339dce70ace058db5c820e5fdec26e0840f36f9adcb150e5216213bc301f3a6b71a178c81ddd34'
        'a361d696c8cb03970590d4f'
github Lamden / clove / tests / constants.py View on Github external
'from': '0x999F348959E611F1E9eab2927c21E88E48e6Ef45',
    'gas': 300000,
    'gasPrice': 4000000000,
    'hash': HexBytes('0x270cc74bf60fd0d37806b000a11da972ce240fa7478e38d8b44b6793ddd3284d'),
    'input': (
        '0x52f50db7000000000000000000000000000000000000000000000000000000005ae3085f7780c856405b3ce2e2c'
        '717857b3439c545316974000000000000000000000000000000000000000000000000d867f293ba129629a9f9355f'
        'a285b8d3711a909200000000000000000000000053e546387a0d054e7ff127923254c0a679da6dbf0000000000000'
        '000000000000000000000000000000000000853a0d2313c0000'
    ),
    'nonce': 58,
    'publicKey': HexBytes(
        '0x76c4f5810736d1d9b9964863abc339dce70ace058db5c820e5fdec26e0840f36f9adcb150e5216213bc301f3a6b'
        '71a178c81ddd34a361d696c8cb03970590d4f'
    ),
    'r': HexBytes('0x579ab66e7cab564d9c67e50c571b1e36afe0095d9d539d4cd3dd871893316201'),
    'raw': HexBytes(
        '0xf901093a84ee6b2800830493e0947657ca877fac31d20528b473162e39b6e152fd2e80b8a452f50db7000000000'
        '000000000000000000000000000000000000000000000005ae3085f7780c856405b3ce2e2c717857b3439c5453169'
        '74000000000000000000000000000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a9092000'
        '00000000000000000000053e546387a0d054e7ff127923254c0a679da6dbf00000000000000000000000000000000'
        '00000000000000000853a0d2313c00001ba0579ab66e7cab564d9c67e50c571b1e36afe0095d9d539d4cd3dd87189'
        '3316201a05a1a325b46b19eb5f43a2989daf5c92aac1ca48187866a3268ff47cc4e88911e'
    ),
    's': HexBytes('0x5a1a325b46b19eb5f43a2989daf5c92aac1ca48187866a3268ff47cc4e88911e'),
    'standardV': 0,
    'to': '0x7657Ca877Fac31D20528B473162E39B6E152fd2e',
    'transactionIndex': 0,
    'v': 27,
    'value': 0
})
github Lamden / clove / tests / constants.py View on Github external
'00000000000000000000000100000000000000000000000000000000000000000000003635c9adc5dea00000',
    'nonce': 287,
    'publicKey': HexBytes(
        '0x76c4f5810736d1d9b9964863abc339dce70ace058db5c820e5fdec26e0840f36f9adcb150e5216213bc301f3a6b71a178c81ddd34'
        'a361d696c8cb03970590d4f'
    ),
    'r': HexBytes('0xe184d8b211a07bd1fea3f7b373e18624e2973db797f512c004cf3dd131994fce'),
    'raw': HexBytes(
        '0xf9012b82011f843b9aca008302c16e94ce07ab9477bc20790b88b398a2a9e0f626c7d26380b8c47337c9930000000000000000000'
        '00000000000000000000000000000000000005b7962b834378f0187488d019d3e0151f2fe3d3672ca310e0000000000000000000000'
        '00000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a909200000000000000000000000053e546387a0d054e7'
        'ff127923254c0a679da6dbf000000000000000000000000000000000000000000000000000000000000000100000000000000000000'
        '000000000000000000000000003635c9adc5dea000001ba0e184d8b211a07bd1fea3f7b373e18624e2973db797f512c004cf3dd1319'
        '94fcea05bc5daa0d693604f2c645ed7d7cfa53f6ebe8f4f6bb3e45a98f57946050a5503'
    ),
    's': HexBytes('0x5bc5daa0d693604f2c645ed7d7cfa53f6ebe8f4f6bb3e45a98f57946050a5503'),
    'standardV': 0,
    'to': '0xce07aB9477BC20790B88B398A2A9e0F626c7D263',
    'transactionIndex': 11,
    'v': 27,
    'value': 0
})


etherscan_internal_transactions = {
    "message": "OK",
    "result": [
        {
            "blockNumber": "6628836",
            "contractAddress": "",
            "errCode": "",
            "from": "0x9f7e5402ed0858ea0c5914d44b900a42c89547b8",
github Lamden / clove / tests / constants.py View on Github external
'gas': 300000,
    'gasPrice': 4000000000,
    'hash': HexBytes('0x270cc74bf60fd0d37806b000a11da972ce240fa7478e38d8b44b6793ddd3284d'),
    'input': (
        '0x52f50db7000000000000000000000000000000000000000000000000000000005ae3085f7780c856405b3ce2e2c'
        '717857b3439c545316974000000000000000000000000000000000000000000000000d867f293ba129629a9f9355f'
        'a285b8d3711a909200000000000000000000000053e546387a0d054e7ff127923254c0a679da6dbf0000000000000'
        '000000000000000000000000000000000000853a0d2313c0000'
    ),
    'nonce': 58,
    'publicKey': HexBytes(
        '0x76c4f5810736d1d9b9964863abc339dce70ace058db5c820e5fdec26e0840f36f9adcb150e5216213bc301f3a6b'
        '71a178c81ddd34a361d696c8cb03970590d4f'
    ),
    'r': HexBytes('0x579ab66e7cab564d9c67e50c571b1e36afe0095d9d539d4cd3dd871893316201'),
    'raw': HexBytes(
        '0xf901093a84ee6b2800830493e0947657ca877fac31d20528b473162e39b6e152fd2e80b8a452f50db7000000000'
        '000000000000000000000000000000000000000000000005ae3085f7780c856405b3ce2e2c717857b3439c5453169'
        '74000000000000000000000000000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a9092000'
        '00000000000000000000053e546387a0d054e7ff127923254c0a679da6dbf00000000000000000000000000000000'
        '00000000000000000853a0d2313c00001ba0579ab66e7cab564d9c67e50c571b1e36afe0095d9d539d4cd3dd87189'
        '3316201a05a1a325b46b19eb5f43a2989daf5c92aac1ca48187866a3268ff47cc4e88911e'
    ),
    's': HexBytes('0x5a1a325b46b19eb5f43a2989daf5c92aac1ca48187866a3268ff47cc4e88911e'),
    'standardV': 0,
    'to': '0x7657Ca877Fac31D20528B473162E39B6E152fd2e',
    'transactionIndex': 0,
    'v': 27,
    'value': 0
})
github Lamden / clove / tests / constants.py View on Github external
'condition': None,
    'creates': None,
    'from': '0x999F348959E611F1E9eab2927c21E88E48e6Ef45',
    'gas': 140502,
    'gasPrice': 1000000000,
    'hash': HexBytes('0xcf64ef4d0449cf7a78d2be1c1f7225dffb11dded98a58d569ebcc6e883ce9f2b'),
    'input': '0x7337c993000000000000000000000000000000000000000000000000000000005b782cfaed2e6fe492005de2dd82e84d38448'
             '467d632e81c000000000000000000000000000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a90920000'
             '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
             '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
    'nonce': 283,
    'publicKey': HexBytes(
        '0x76c4f5810736d1d9b9964863abc339dce70ace058db5c820e5fdec26e0840f36f9adcb150e5216213bc301f3a6b71a178'
        'c81ddd34a361d696c8cb03970590d4f'
    ),
    'r': HexBytes('0x68e2bbdd4cb4e989854a87aa8964c65b3bf28f68183f73f905ab8841db690cbb'),
    'raw': HexBytes(
        '0xf9013282011b843b9aca00830224d694ce07ab9477bc20790b88b398a2a9e0f626c7d26387038d7ea4c68000b8c47337c993000000'
        '000000000000000000000000000000000000000000000000005b782cfaed2e6fe492005de2dd82e84d38448467d632e81c0000000000'
        '00000000000000000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a9092000000000000000000000000000000'
        '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
        '0000000000000000000000000000000000000000000000000000001ca068e2bbdd4cb4e989854a87aa8964c65b3bf28f68183f73f905'
        'ab8841db690cbba0227712dc5c204041cc8c44facac023c457725acc905b2db311b1176cd53836e0'
    ),
    's': HexBytes('0x227712dc5c204041cc8c44facac023c457725acc905b2db311b1176cd53836e0'),
    'standardV': 1,
    'to': '0xce07aB9477BC20790B88B398A2A9e0F626c7D263',
    'transactionIndex': 1,
    'v': 28,
    'value': 1000000000000000
})
github Lamden / clove / tests / constants.py View on Github external
'creates': None,
    'from': '0x999F348959E611F1E9eab2927c21E88E48e6Ef45',
    'gas': 180590,
    'gasPrice': 1000000000,
    'hash': HexBytes('0x224818e4390e6d4e24b18e19a268825c0bbc649ab3e93dcb446328973dc7914b'),
    'input': '0x7337c993000000000000000000000000000000000000000000000000000000005b7962b834378f0187488d019d3e0151f2fe'
             '3d3672ca310e000000000000000000000000000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a909200'
             '000000000000000000000053e546387a0d054e7ff127923254c0a679da6dbf0000000000000000000000000000000000000000'
             '00000000000000000000000100000000000000000000000000000000000000000000003635c9adc5dea00000',
    'nonce': 287,
    'publicKey': HexBytes(
        '0x76c4f5810736d1d9b9964863abc339dce70ace058db5c820e5fdec26e0840f36f9adcb150e5216213bc301f3a6b71a178c81ddd34'
        'a361d696c8cb03970590d4f'
    ),
    'r': HexBytes('0xe184d8b211a07bd1fea3f7b373e18624e2973db797f512c004cf3dd131994fce'),
    'raw': HexBytes(
        '0xf9012b82011f843b9aca008302c16e94ce07ab9477bc20790b88b398a2a9e0f626c7d26380b8c47337c9930000000000000000000'
        '00000000000000000000000000000000000005b7962b834378f0187488d019d3e0151f2fe3d3672ca310e0000000000000000000000'
        '00000000000000000000000000d867f293ba129629a9f9355fa285b8d3711a909200000000000000000000000053e546387a0d054e7'
        'ff127923254c0a679da6dbf000000000000000000000000000000000000000000000000000000000000000100000000000000000000'
        '000000000000000000000000003635c9adc5dea000001ba0e184d8b211a07bd1fea3f7b373e18624e2973db797f512c004cf3dd1319'
        '94fcea05bc5daa0d693604f2c645ed7d7cfa53f6ebe8f4f6bb3e45a98f57946050a5503'
    ),
    's': HexBytes('0x5bc5daa0d693604f2c645ed7d7cfa53f6ebe8f4f6bb3e45a98f57946050a5503'),
    'standardV': 0,
    'to': '0xce07aB9477BC20790B88B398A2A9e0F626c7D263',
    'transactionIndex': 11,
    'v': 27,
    'value': 0
})
github AndreMiras / EtherollApp / src / pyetheroll / etheroll.py View on Github external
def get_bets_logs(self, address, from_block, to_block='latest'):
        """
        Retrieves `address` last bets from event logs and returns the list
        of bets with decoded info. Does not return the actual roll result.
        """
        bets = []
        bet_events = self.get_log_bet_events(address, from_block, to_block)
        transaction_debugger = TransactionDebugger(self.contract_abi)
        for bet_event in bet_events:
            topics = [HexBytes(topic) for topic in bet_event['topics']]
            log_data = bet_event['data']
            decoded_method = transaction_debugger.decode_method(
                topics, log_data)
            call = decoded_method['call']
            bet_id = call['BetID'].hex()
            reward_value = call['RewardValue']
            reward_value_ether = round(
                reward_value / 1e18, ROUND_DIGITS)
            profit_value = call['ProfitValue']
            profit_value_ether = round(
                profit_value / 1e18, ROUND_DIGITS)
            bet_value = call['BetValue']
            bet_value_ether = round(bet_value / 1e18, ROUND_DIGITS)
            roll_under = call['PlayerNumber']
            timestamp = bet_event['timeStamp']
            date_time = datetime.utcfromtimestamp(int(timestamp, 16))

hexbytes

hexbytes: Python `bytes` subclass that decodes hex, with a readable console output

MIT
Latest version published 6 months ago

Package Health Score

83 / 100
Full package analysis

Popular hexbytes functions