eth_multi_transactions

package module
v0.0.0-...-a0c4ee5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Wei   = big.NewInt(1)
	GWei  = big.NewInt(1e9)
	Ether = big.NewInt(0).Mul(GWei, GWei) // 1ether = 1e18wei
)

Functions

func FromBigEndianBytes

func FromBigEndianBytes(s []byte) (uint64, error)

func FromBigEndianHex

func FromBigEndianHex(s string) (uint64, error)

func FromLittleEndianBytes

func FromLittleEndianBytes(s []byte) (uint64, error)

func FromLittleEndianHex

func FromLittleEndianHex(s string) (uint64, error)

func GetBalance

func GetBalance(c *ethclient.Client, addr string) (*big.Int, error)

func PollingTransaction

func PollingTransaction(ethc *ethclient.Client, txid string, threshold int64, timeout time.Duration) error

func SendEthTransaction

func SendEthTransaction(
	obj *DbWithdrawalObj,
	ethc *ethclient.Client,
	fromAddr common.Address,
	prvKey *ecdsa.PrivateKey,
	chainID *big.Int,
) (string, error)

func ToBigEndianBytes

func ToBigEndianBytes(source uint64) []byte

func ToBigEndianHex

func ToBigEndianHex(source uint64) string

func ToLittleEndianBytes

func ToLittleEndianBytes(source uint64) []byte

func ToLittleEndianHex

func ToLittleEndianHex(source uint64) string

Types

type DbWithdrawalObj

type DbWithdrawalObj struct {
	Id       uint64
	Address  string
	Amount   *big.Int
	Nonce    uint64
	Status   uint64
	Hash     string
	Created  uint64
	Modified uint64
}

type WdDB

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

func NewWithdrawalDB

func NewWithdrawalDB(db *leveldb.DB) *WdDB

func (*WdDB) BatchInsert

func (w *WdDB) BatchInsert(objs []*DbWithdrawalObj) error

func (*WdDB) CompareAndSwapStatus

func (w *WdDB) CompareAndSwapStatus(key []byte, from, to uint64) error

func (*WdDB) GetAndIncreasePrimaryKey

func (w *WdDB) GetAndIncreasePrimaryKey(tx *leveldb.Transaction) (uint64, error)

func (*WdDB) GetOrSet

func (w *WdDB) GetOrSet(key []byte, initValue []byte) error

func (*WdDB) GetRawDB

func (w *WdDB) GetRawDB() *leveldb.DB

func (*WdDB) GetUnhandledRecordsId

func (w *WdDB) GetUnhandledRecordsId() ([]uint64, error)

func (*WdDB) GetWdObjById

func (w *WdDB) GetWdObjById(id uint64) (*DbWithdrawalObj, error)

func (*WdDB) Insert

func (w *WdDB) Insert(
	address string,
	amount *big.Int,
	nonce uint64,
	status uint64,
	hash string,
	created uint64,
	modified uint64,
) error

Directories

Path Synopsis
cmd
common

Jump to

Keyboard shortcuts

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