Documentation
¶
Index ¶
- func BuildPath(addresses []common.Address, fees []int) ([]byte, error)
- func GetAuthData(privateKey *ecdsa.PrivateKey, chainId *big.Int, client *ethclient.Client) (*bind.TransactOpts, error)
- func GetBaseTokenAddressesByChainId(chainId *big.Int, rdb *redis.Client) (result []common.Address, mainToken *common.Address, usdToken *common.Address, ...)
- func GetBuyCoefficient(amount *big.Int, total *big.Int) *big.Float
- func GetCurrentGasPrice(client *ethclient.Client) (*big.Int, error)
- func GetCurrentNonce(client *ethclient.Client, account common.Address) (uint64, error)
- func GetKeysWithPrefix(rdb *redis.Client, prefix string) ([]string, error)
- func GetPrice(defiAddress common.Address, tokenAddress common.Address, ...) (*big.Float, *big.Int, error)
- func InArray(needle interface{}, haystack interface{}) (exists bool, index int)
- func IsHoneypotToken(token common.Address, chainId *big.Int, rdb *redis.Client) bool
- func MultiplyIntFloat(x *big.Int, y *big.Float) *big.Int
- func ParsePath(path []byte) ([]common.Address, []int, error)
- func PercentageDifference(x *big.Int, y *big.Int) (*big.Int, *big.Float)
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 GetCurrentNonce ¶
func GetKeysWithPrefix ¶
获取所有 redis 键
func GetPrice ¶ added in v1.0.2
func GetPrice(defiAddress common.Address, tokenAddress common.Address, baseAddress common.Address, ec *ethclient.Client) (*big.Float, *big.Int, error)
price 除以基本币的小数位后的价格 price1 没除以小数位价格
func InArray ¶
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 IsHoneypotToken ¶ added in v1.0.2
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.