ethereum

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 4 Imported by: 6 modules, 27 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Units = map[string]float64{
	"wei":   1,
	"gwei":  1e9,
	"ether": 1e18,
}

Units defines denominations of the Ether token.

Functions

This section is empty.

Types

type Config

type Config struct {
	ethlike.Config

	// MaxGasPrice specifies the maximum gas price the client is
	// willing to pay for the transaction to be mined. The offered transaction
	// gas price can not be higher than the max gas price value. If the maximum
	// allowed gas price is reached, no further resubmission attempts are
	// performed.
	MaxGasPrice *Wei

	// BalanceAlertThreshold defines a minimum value of the operator's
	// account balance below which an alert will be triggered.
	BalanceAlertThreshold *Wei
}

Config is a struct that contains the configuration needed to connect to an Ethereum node. This information will give access to an Ethereum network.

func (*Config) ContractAddress

func (c *Config) ContractAddress(contractName string) (common.Address, error)

ContractAddress finds a given contract's address configuration and returns it as Ethereum address.

type Wei added in v1.3.0

type Wei struct {
	ethlike.Token
}

Wei is a custom type to handle Ether value parsing in configuration files using BurntSushi/toml package. It supports wei, Gwei and ether units. The Ether value is kept as `wei` and `wei` is the default unit. The value can be provided in the text file as e.g.: `1 wei`, `200 Gwei` or `0.5 ether`.

func WrapWei added in v1.5.0

func WrapWei(value *big.Int) *Wei

WrapWei wraps the given integer value in order to represent it as Wei value.

func (*Wei) UnmarshalText added in v1.3.0

func (w *Wei) UnmarshalText(text []byte) error

UnmarshalText is a function used to parse a value of Ethers.

Directories

Path Synopsis
Package ethutil provides utilities used for dealing with Ethereum concerns in the context of implementing cross-chain interfaces defined in pkg/chain.
Package ethutil provides utilities used for dealing with Ethereum concerns in the context of implementing cross-chain interfaces defined in pkg/chain.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL