Documentation ¶
Index ¶
- Constants
- Variables
- func EthToGWei(eth *big.Float) (*big.Int, error)
- func EthToWei(eth *big.Float) (*big.Int, error)
- func GWeiToEth(gwei *big.Int) (*big.Float, error)
- func WeiToEth(wei *big.Int) (*big.Float, error)
- type Accounts
- type ETHClient
- func (e *ETHClient) BlocksRange(ctx context.Context, beg, end int) ([]*types.Block, error)
- func (e *ETHClient) SubscribeNewBlocks(ctx context.Context) (<-chan *types.Header, <-chan error, error)
- func (e *ETHClient) TransactionFrom(ctx context.Context, tx *types.Transaction) (string, error)
- func (e *ETHClient) TransferTokens(ctx context.Context, fromAddr, toAddr string, gasLimit, ethVal *big.Int) (txHash common.Hash, err error)
Constants ¶
View Source
const EtherDefaultGasLimit uint64 = 21_000
Default gas limit in ethereum network
Variables ¶
View Source
var ( ErrTranslation = errors.New("unable to translate values") ErrKeyNotECDSA = errors.New("error asserting type: publicKey is not of type *ecdsa.PublicKey") )
Functions ¶
Types ¶
type ETHClient ¶
ETHClient wraps *ethclient.Client
func (*ETHClient) BlocksRange ¶
BlocksRange returns blocks by range
func (*ETHClient) SubscribeNewBlocks ¶
func (e *ETHClient) SubscribeNewBlocks(ctx context.Context) ( <-chan *types.Header, <-chan error, error)
SubscribeNewBlocks subscribes to new block creation events. Works only with (ws/wss):// connection scheme
func (*ETHClient) TransactionFrom ¶
TransactionFrom returns transaction sender address
Click to show internal directories.
Click to hide internal directories.