structs

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadyTrade added in v0.1.4

type ReadyTrade struct {
	Token0      string `json:"token0"`
	Token1      string `json:"token1"`
	DefiAddress string `json:"defi_address"`
	ChainId     string `json:"chain_id"`
	PrivateKey  string `json:"private_key"`
	Amount      string `json:"amount"`
	Account     string `json:"account"`
	IsBuy       bool   `json:"is_buy"`
}

type TradeSend added in v0.1.4

type TradeSend struct {
	Transaction *types.Transaction
	Token0      common.Address
	Token1      common.Address
	DefiAddress common.Address
	Price       *big.Float
	Setting     *UserBotSetting
	IsBuy       bool
	Error       error
}

type TransactionData

type TransactionData struct {
	ChainId     *big.Int
	Hash        common.Hash
	From        common.Address
	To          common.Address
	Value       *big.Int
	Gas         uint64
	GasPrice    *big.Int
	Data        string
	BlockNumber *big.Int
}

交易

func (TransactionData) MarshalJSON

func (t TransactionData) MarshalJSON() ([]byte, error)

func (*TransactionData) ToMessage

func (t *TransactionData) ToMessage() string

func (*TransactionData) UnmarshalJSON

func (t *TransactionData) UnmarshalJSON(data []byte) error

type UserBotSetting added in v0.1.2

type UserBotSetting struct {
	ID              int64          `json:"id"`
	WhaleAddress    common.Address `json:"whale_address"`
	WhaleName       string         `json:"whale_name"`
	ChainID         *big.Int       `json:"chain_id"`
	ListenBase      string         `json:"listen_base"`
	MinWethAmount   *big.Int       `json:"min_weth_amount"`
	MinBusdAmount   *big.Int       `json:"min_busd_amount"`
	MinUsdtAmount   *big.Int       `json:"min_usdt_amount"`
	MinUsdcAmount   *big.Int       `json:"min_usdc_amount"`
	SellAllWethLine *big.Int       `json:"sell_all_weth_line"`
	SellAllBusdLine *big.Int       `json:"sell_all_busd_line"`
	SellAllUsdtLine *big.Int       `json:"sell_all_usdt_line"`
	SellAllUsdcLine *big.Int       `json:"sell_all_usdc_line"`
	StopAt          int64          `json:"stop_at"`
	IsSellAll       int8           `json:"is_sell_all"`
	StopWin         int64          `json:"stop_win"`
	StopWinMin      int64          `json:"stop_win_min"`
	AvoidHoneyPot   int8           `json:"avoid_honey_pot"`
	IsZero          int8           `json:"is_zero"`
	PrivateKey      string         `json:"private_key"`
}

用户配置

func MapToUserBotSetting added in v0.1.4

func MapToUserBotSetting(setting map[string]string) (*UserBotSetting, error)

func (*UserBotSetting) AnalyzeTransaction added in v0.1.4

func (s *UserBotSetting) AnalyzeTransaction(t TransactionData, client *ethclient.Client, rds *redis.Client) (*ReadyTrade, error)

func (*UserBotSetting) UnmarshalJSON added in v0.1.2

func (s *UserBotSetting) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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