cryptnox_cli.wallet.eth package

Submodules

cryptnox_cli.wallet.eth.api module

A basic Ethereum wallet library

cryptnox_cli.wallet.eth.api.address(public_key: str) str[source]
cryptnox_cli.wallet.eth.api.checksum_address(public_key: str) str[source]
class cryptnox_cli.wallet.eth.api.Api(endpoint: str, network: EthNetwork | str, api_key: str)[source]

Bases: object

PATH = "m/44'/60'/0'/0/0"
SYMBOL = 'eth'
__init__(endpoint: str, network: EthNetwork | str, api_key: str)[source]
property block_number
contract(address='', abi='')[source]
get_transaction_count(address: str, blocks: str = None) int[source]
get_balance(address: str) int[source]
property gas_price
property network
transaction_hash(transaction: Dict[str, Any], vrs: bool = False)[source]
push(transaction, signature, public_key)[source]
class cryptnox_cli.wallet.eth.api.EthValidator(endpoint: str = 'publicnode', network: str = 'sepolia', price: int = 8, limit: int = 2500, derivation: str = 'DERIVE', api_key='')[source]

Bases: object

Class defining Ethereum validators

__init__(endpoint: str = 'publicnode', network: str = 'sepolia', price: int = 8, limit: int = 2500, derivation: str = 'DERIVE', api_key='')[source]
endpoint

Validator to validate endpoints for the Ethereum network

network

Class for validating if value is part of the enum

price

Class for validating if value is integer

limit

Class for validating if value is integer

derivation

Class for validating if value is part of the enum

api_key
validate()[source]

cryptnox_cli.wallet.eth.endpoint module

Module for endpoints that can be used for working with the Ethereum network

class cryptnox_cli.wallet.eth.endpoint.EndpointValidator(valid_values: str = None)[source]

Bases: Validator

Validator to validate endpoints for the Ethereum network

__init__(valid_values: str = None)[source]
validate(value)[source]
Parameters:

value – Evaluated value

Returns:

None

Raises:

ValidationError – Validation criteria not satisfied

class cryptnox_cli.wallet.eth.endpoint.Endpoint(network: EthNetwork, api_key: str = '')[source]

Bases: object

Abstract base class for interface for endpoint implementations

__init__(network: EthNetwork, api_key: str = '')[source]
abstract property available_networks: List[EthNetwork]

Ethereum networks handled by the endpoint implementation :rtype: List[enums.EthNetwork]

Type:

return

abstract property domain: str

Domain that is used by the endpoint implementation :rtype: str

Type:

return

abstract property name: str

Name of the endpoint implementation :rtype: str

Type:

return

abstract property provider: str

Full URL that can be used as Web3 provider :rtype: str

Type:

return

class cryptnox_cli.wallet.eth.endpoint.InfuraEndpoint(network: EthNetwork, api_key: str = '')[source]

Bases: Endpoint

Implementation of the Infura endpoint

name = 'infura'
available_networks = ['MAINNET', 'KOVAN', 'GOERLI', 'RINKEBY', 'SEPOLIA']
__init__(network: EthNetwork, api_key: str = '')[source]
property domain: str

Domain that is used by the endpoint implementation :rtype: str

Type:

return

property provider: str

Full URL that can be used as Web3 provider :rtype: str

Type:

return

class cryptnox_cli.wallet.eth.endpoint.CryptnoxEndpoint(network: EthNetwork, api_key: str = '')[source]

Bases: Endpoint

Implementation of the Cryptnox endpoint

name = 'cryptnox'
available_networks = ['MAINNET', 'SEPOLIA']
property domain: str

Domain that is used by the endpoint implementation :rtype: str

Type:

return

property provider: str

Full URL that can be used as Web3 provider :rtype: str

Type:

return

class cryptnox_cli.wallet.eth.endpoint.PublicNodeEndpoint(network: EthNetwork, api_key: str = '')[source]

Bases: Endpoint

Implementation of the PublicNode public RPC endpoint (free, no API key required)

name = 'publicnode'
available_networks = ['MAINNET', 'SEPOLIA']
property domain: str

Domain that is used by the endpoint implementation :rtype: str

Type:

return

property provider: str

Full URL that can be used as Web3 provider :rtype: str

Type:

return

class cryptnox_cli.wallet.eth.endpoint.DirectEndpoint(url: str, network: EthNetwork)[source]

Bases: object

__init__(url: str, network: EthNetwork)[source]
property provider: str
cryptnox_cli.wallet.eth.endpoint.factory(endpoint: str, network: EthNetwork, api_key: str = '') Endpoint[source]

Factory method for Endpoint instances

Parameters:
  • endpoint – Name of the endpoint to use

  • network – Ethereum network to use

  • api_key – API key to use on the endpoint

Type:

str

Type:

enums.EthNetwork

Type:

str

Returns:

Return an Endpoint instance that can be used to get the urls

Return type:

Endpoint

Raises:

ValueError – In case endpoint with endpoint name wasn’t found

Module contents

Ethereum wallet utilities - aggregates and re-exports API components for easier imports.

The cryptnox_cli.wallet.eth package provides Ethereum wallet utilities and exports:

cryptnox_cli.wallet.eth.address(public_key)[source]

Generate an Ethereum address from a public key. See cryptnox_cli.wallet.eth.api.address() for details.

class cryptnox_cli.wallet.eth.Api[source]

Ethereum API interface. See cryptnox_cli.wallet.eth.api.Api for details.

cryptnox_cli.wallet.eth.checksum_address(address_str)[source]

Convert an address to checksummed format. See cryptnox_cli.wallet.eth.api.checksum_address() for details.

class cryptnox_cli.wallet.eth.EthValidator[source]

Ethereum address and transaction validator. See cryptnox_cli.wallet.eth.api.EthValidator for details.