Documentation ¶
Index ¶
- Variables
- func FlogTx(w io.Writer, msg string, tx *types.Transaction, logger log15.Logger)
- func IncNonce(nonce *big.Int) *big.Int
- func IncTxoNonce(txo *bind.TransactOpts, tx *types.Transaction)
- func IsZeroAddr(a common.Address) bool
- func LogTx(msg string, tx *types.Transaction, logger log15.Logger)
- func MustHaveEvents(e abi.ABI, logger log15.Logger, eventNames ...string)
- func MustParseABI(name string, ctrABI string, logger log15.Logger) abi.ABI
- func ParseAddress(addr string) (a common.Address, err errstack.E)
- func ParseAddressErrp(addr string, errp errstack.Putter) common.Address
- func SubscribeSimple(ctx context.Context, client *ethclient.Client, topics [][]common.Hash, ...) (<-chan types.Log, ethereum.Subscription, errstack.E)
- func UnmarshalEvent(dest interface{}, data []byte, e abi.Event) errstack.E
- type ContractFactory
- type KeySimple
- type NetSchema
- type PgtAddress
- type Schema
- type SchemaFactory
- type TxrFactory
Constants ¶
This section is empty.
Variables ¶
var ZeroAddress = common.HexToAddress("00")
ZeroAddress represents Ethereum unknown or invalid address
Functions ¶
func IncTxoNonce ¶
func IncTxoNonce(txo *bind.TransactOpts, tx *types.Transaction)
IncTxoNonce increments transaction options nonce
func IsZeroAddr ¶
IsZeroAddr check if `a` is zero or invalid address
func LogTx ¶
func LogTx(msg string, tx *types.Transaction, logger log15.Logger)
LogTx is a handy function to create debug log for successful transaction
func MustHaveEvents ¶
MustHaveEvents ensures that the ABI object has listed events
func MustParseABI ¶
MustParseABI parses abi string
func ParseAddress ¶
ParseAddress converts hex string to Ethereum address
func ParseAddressErrp ¶
ParseAddressErrp calls ToAddress and sets the error in the putter
Types ¶
type ContractFactory ¶
type ContractFactory interface { TxrFactory }
ContractFactory delivers methods to easily construct contracts
func NewContractFactory ¶
func NewContractFactory(c *ethclient.Client, sf SchemaFactory, txrF TxrFactory, isTestRPC bool) ContractFactory
NewContractFactory is a default contract provider based on truffle schema files.
type KeySimple ¶
KeySimple is a simple version of keystore.Key structure
func MustReadKeySimple ¶
MustReadKeySimple calls ReadKeySimple and panics if it get's an error
func ReadKeySimple ¶
ReadKeySimple reads the JSON key into the key object
func (*KeySimple) UnmarshalJSON ¶
UnmarshalJSON implement interface for json.Unmrashall
type PgtAddress ¶
PgtAddress is a ethereum Address wrapper to provide DB interface
func (*PgtAddress) Scan ¶
func (a *PgtAddress) Scan(src interface{}) error
Scan implements sql.Sanner interface
type Schema ¶
type Schema struct { Name string `json:"contractName"` Networks map[int]NetSchema SchemaVersion string `json:"schemaVersion"` UpdatedAt string `json:"updatedAt"` }
Schema is a type representing truffle-schema contract file
type SchemaFactory ¶
SchemaFactory is a structure which provides contract schema functions and data
func NewSchemaFactory ¶
func NewSchemaFactory(contractsPath string, network int, logger log15.Logger) (SchemaFactory, errstack.E)
NewSchemaFactory creates new SchemaFactory.
func (SchemaFactory) MustReadGetAddress ¶
func (sf SchemaFactory) MustReadGetAddress(name string) (Schema, common.Address)
MustReadGetAddress returns contract schema and address and panics on error
func (SchemaFactory) Read ¶
func (sf SchemaFactory) Read(name string) (s Schema, err errstack.E)
Read reads truffle-schema file. The name should not finish with ".json"
func (SchemaFactory) ReadGetAddress ¶
ReadGetAddress reads schema using `Read` and extract contract address using then network identifier.
type TxrFactory ¶
type TxrFactory interface { Txo() *bind.TransactOpts Addr() common.Address }
TxrFactory wraps parameters to create bind.TransactOpts
func NewJSONTxrFactory ¶
NewJSONTxrFactory creates TxrFactory using on JSON account file and passphrase
func NewPrivKeyTxrFactory ¶
func NewPrivKeyTxrFactory(hexkey string) (TxrFactory, errstack.E)
NewPrivKeyTxrFactory creates new transactor using a hex string of a ECDSA key.