Skip to content

Latest commit

 

History

History
456 lines (289 loc) · 16.4 KB

api-brownie.rst

File metadata and controls

456 lines (289 loc) · 16.4 KB

Brownie API

brownie

The brownie package is the main package containing all of Brownie's functionality.

>>> from brownie import *
>>> dir()
['Gui', 'accounts', 'alert', 'brownie', 'check', 'compile_source', 'config', 'history', 'network', 'project', 'rpc', 'web3', 'wei']

brownie.convert

The convert module contains methods relating to data conversion.

Type Conversions

The following classes and methods are used to convert arguments supplied to ContractTx and ContractCall.

Type Classes

For certain types of contract data, Brownie uses subclasses to assist with conversion and comparison.

Internal Methods

Formatting Contract Data

The following methods are used to convert multiple values based on a contract ABI specification. Values are formatted via calls to the methods outlined under type conversions<type-conversions>, and where appropriate type classes<type-classes> are applied.

brownie.exceptions

The exceptions module contains all Brownie Exception classes.

brownie._config

The _config module handles all Brownie configuration settings. It is not designed to be accessed directly. If you wish to view or modify config settings while Brownie is running, import brownie.config which will return a ConfigDict with the active settings:

>>> from brownie import config
>>> type(config)
<class 'brownie._config.ConfigDict'>
>>> config['network_defaults']
{'name': 'development', 'gas_limit': False, 'gas_price': False}

ConfigDict

ConfigDict Internal Methods

brownie._singleton

Internal metaclass used to create singleton objects. Instantiating a class derived from this metaclass will always return the same instance, regardless of how the child class was imported.