chain

package
v0.0.0-...-e13bd63 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptKeyfile

func DecryptKeyfile(keyfile, password string) (*ecdsa.PrivateKey, error)

func EtherToWei

func EtherToWei(amount int64) *big.Int

func Has0xPrefix

func Has0xPrefix(str string) bool

func IsValidAddress

func IsValidAddress(address string, checksummed bool) bool

func LSKToWei

func LSKToWei(amount int64) *big.Int

func ResolveKeyfilePath

func ResolveKeyfilePath(keydir string) (string, error)

Types

type TxBuild

type TxBuild struct {
	// contains filtered or unexported fields
}

func (*TxBuild) GetContractInstance

func (b *TxBuild) GetContractInstance() *bindings.Token

func (*TxBuild) Sender

func (b *TxBuild) Sender() common.Address

func (*TxBuild) TransferERC20

func (b *TxBuild) TransferERC20(ctx context.Context, to string, value *big.Int, balance *big.Int) (common.Hash, error)

func (*TxBuild) TransferETH

func (b *TxBuild) TransferETH(ctx context.Context, to string, value *big.Int) (common.Hash, error)

type TxBuilder

type TxBuilder interface {
	Sender() common.Address
	GetContractInstance() *bindings.Token
	TransferETH(ctx context.Context, to string, value *big.Int) (common.Hash, error)
	TransferERC20(ctx context.Context, to string, value *big.Int, balance *big.Int) (common.Hash, error)
}

func NewTxBuilder

func NewTxBuilder(provider string, privateKey *ecdsa.PrivateKey, tokenAddress string, chainID *big.Int) (TxBuilder, error)

Jump to

Keyboard shortcuts

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