helpers

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthData

func GetAuthData(privateKey *ecdsa.PrivateKey, chainId *big.Int, client *ethclient.Client) (*bind.TransactOpts, error)

func GetBaseTokenAddressesByChainId

func GetBaseTokenAddressesByChainId(chainId *big.Int) (map[string]string, error)

func GetBuyCoefficient

func GetBuyCoefficient(amount *big.Int, total *big.Int) *big.Float

func GetCurrentGasPrice

func GetCurrentGasPrice(client *ethclient.Client) (*big.Int, error)

func GetCurrentNonce

func GetCurrentNonce(client *ethclient.Client, account common.Address) (uint64, error)

func GetKeysWithPrefix

func GetKeysWithPrefix(rdb *redis.Client, prefix string) ([]string, error)

获取所有 redis 键

func InArray

func InArray(needle interface{}, haystack interface{}) (exists bool, index int)

InArray will search element inside array with any type. Will return boolean and index for matched element. True and index more than 0 if element is exist. needle is element to search, haystack is slice of value to be search.

func MultiplyIntFloat

func MultiplyIntFloat(x *big.Int, y *big.Float) *big.Int

func PercentageDifference

func PercentageDifference(x *big.Int, y *big.Int) (*big.Int, *big.Float)

计算两个值的差值和差值占x的系数 返回差值和系数

Types

This section is empty.

Jump to

Keyboard shortcuts

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