moody API documentation

# Package `moody`

Expand source code

    # Token = namedtuple('Token', ['address', 'name', 'code_hash'], defaults=(None,) * 3)
    import sys
    from dataclasses import dataclass

    if sys.version_info < (3, 5):
        raise EnvironmentError("Python 3.5 or above is required")

    # __version__ = pkg_resources.get_distribution("moodyeth").version

    # __all__ = [
    #    '__version__',
    # ]

    @dataclass
    class Token:
        address: str = None
        name: str = None
        code_hash: str = None
        token_contract: str = None
        decimal: int = 0
        total_supply: int = 0
        spender: dict = None
        balance: dict = None

    @dataclass
    class Config:
        network_name: str
        rpc_url: str
        chain_id: int
        symbol: str
        block_explorer: str
        bridge: str = "",
        faucet: str = "",
        gas: int = 6000000,
        gasPrice: int = 1059100000
        one: int = 1000000000000000000
        wait_time: int = 6,
        # Oracle from Chainlink
        # https://docs.chain.link/docs/vrf-contracts/
        link_token: str = None,
        link_vrf_coordinator: str = None
        link_keyhash: str = None

    @dataclass
    class Key:
        private_key: str
        wallet_address: str
        token: str
        precision: int
        network: str

    class Bolors:
        OK = '\033[92m'  # GREEN
        WARNING = '\033[93m'  # YELLOW
        FAIL = '\033[91m'  # RED
        RESET = '\033[0m'  # RESET COLOR

## Sub-modules

`moody.bridge`
`moody.buildercompile`
`moody.bussen`
`moody.conf`
`moody.contracttool`
`moody.erc20`
`moody.libeb`
`moody.m`
`moody.openzeppelin`

  Generated wrapper for Timelock6h Solidity contract.

`moody.paths`

  Base wrapper class for accessing ethereum smart contracts.

## Classes

`class Bolors`
  Expand source code

      class Bolors:
          OK = '\033[92m'  # GREEN
          WARNING = '\033[93m'  # YELLOW
          FAIL = '\033[91m'  # RED
          RESET = '\033[0m'  # RESET COLOR

  ### Class variables

  `var FAIL`
  `var OK`
  `var RESET`
  `var WARNING`
`class Config (network_name: str, rpc_url: str, chain_id: int, symbol: str, block_explorer: str, bridge: str = ('',), faucet: str = ('',), gas: int = (6000000,), gasPrice: int = 1059100000, one: int = 1000000000000000000, wait_time: int = (6,), link_token: str = (None,), link_vrf_coordinator: str = None, link_keyhash: str = None)`

  Config(network_name: str, rpc_url: str, chain_id: int, symbol: str, block_explorer: str, bridge: str = ('',), faucet: str = ('',), gas: int = (6000000,), gasPrice: int = 1059100000, one: int = 1000000000000000000, wait_time: int = (6,), link_token: str = (None,), link_vrf_coordinator: str = None, link_keyhash: str = None)

  Expand source code

      class Config:
          network_name: str
          rpc_url: str
          chain_id: int
          symbol: str
          block_explorer: str
          bridge: str = "",
          faucet: str = "",
          gas: int = 6000000,
          gasPrice: int = 1059100000
          one: int = 1000000000000000000
          wait_time: int = 6,
          # Oracle from Chainlink
          # https://docs.chain.link/docs/vrf-contracts/
          link_token: str = None,
          link_vrf_coordinator: str = None
          link_keyhash: str = None

  ### Class variables

  `var block_explorer : str`
  `var bridge : str`
  `var chain_id : int`
  `var faucet : str`
  `var gas : int`
  `var gasPrice : int`
  `var link_keyhash : str`
  `var link_token : str`
  `var link_vrf_coordinator : str`
  `var network_name : str`
  `var one : int`
  `var rpc_url : str`
  `var symbol : str`
  `var wait_time : int`
`class Key (private_key: str, wallet_address: str, token: str, precision: int, network: str)`

  Key(private_key: str, wallet_address: str, token: str, precision: int, network: str)

  Expand source code

      class Key:
          private_key: str
          wallet_address: str
          token: str
          precision: int
          network: str

  ### Class variables

  `var network : str`
  `var precision : int`
  `var private_key : str`
  `var token : str`
  `var wallet_address : str`
`class Token (address: str = None, name: str = None, code_hash: str = None, token_contract: str = None, decimal: int = 0, total_supply: int = 0, spender: dict = None, balance: dict = None)`

  Token(address: str = None, name: str = None, code_hash: str = None, token_contract: str = None, decimal: int = 0, total_supply: int = 0, spender: dict = None, balance: dict = None)

  Expand source code

      class Token:
          address: str = None
          name: str = None
          code_hash: str = None
          token_contract: str = None
          decimal: int = 0
          total_supply: int = 0
          spender: dict = None
          balance: dict = None

  ### Subclasses

  - TokenActor

  ### Class variables

  `var address : str`
  `var balance : dict`
  `var code_hash : str`
  `var decimal : int`
  `var name : str`
  `var spender : dict`
  `var token_contract : str`
  `var total_supply : int`