crypto

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BS

type BS struct {
	B int `json:"buys"`
	S int `json:"sells"`
}

type BaseToken

type BaseToken struct {
	Addr   string `json:"address"`
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
}

type ContractCreation added in v0.0.32

type ContractCreation struct {
	Address string `json:"contractAddress"`
	Creator string `json:"contractCreator"`
}

type ContractCreationResp added in v0.0.32

type ContractCreationResp struct {
	Status  string             `json:"status"`
	Message string             `json:"message"`
	Result  []ContractCreation `json:"result"`
}

type Crypto

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

func NewCrypto

func NewCrypto(api, secret string) *Crypto

func (*Crypto) FuturesPrice

func (t *Crypto) FuturesPrice(name string) (prices string)

func (*Crypto) HoneypotCheck added in v0.0.24

func (t *Crypto) HoneypotCheck(addr string) string

func (*Crypto) MemeCheck

func (t *Crypto) MemeCheck(query string, chain string) *MemeChecker

func (*Crypto) MemePrice

func (t *Crypto) MemePrice(query string, chain string) *Pair

func (*Crypto) Ping

func (t *Crypto) Ping() bool

func (*Crypto) Price

func (t *Crypto) Price(name ...string) (prices map[string]string)

func (*Crypto) UFutureKline

func (t *Crypto) UFutureKline(interval string, limit int, symbol string) []int

前3根k线的涨跌结果,1 涨 -1 跌

func (*Crypto) WhetherHoneypot added in v0.0.25

func (t *Crypto) WhetherHoneypot(addr string) bool

type CryptoMonitor

type CryptoMonitor struct {
	UTC sync.Map // id -> user  map[id]*user
	CTU sync.Map // crypto -> user map[id]

	C chan map[int64]map[string]string // id -> crypto -> price
	// contains filtered or unexported fields
}

func NewCryptoMonitor

func NewCryptoMonitor() *CryptoMonitor

func (*CryptoMonitor) AddHighMonitor

func (t *CryptoMonitor) AddHighMonitor(id int64, crypto, price string)

func (*CryptoMonitor) AddLowMonitor

func (t *CryptoMonitor) AddLowMonitor(id int64, crypto, price string)

func (*CryptoMonitor) Context

func (t *CryptoMonitor) Context()

func (*CryptoMonitor) DeleteMonitor

func (t *CryptoMonitor) DeleteMonitor(id int64, crypto ...string)

func (*CryptoMonitor) GetPrice

func (t *CryptoMonitor) GetPrice(id int64, crypto ...string) map[string]string

func (*CryptoMonitor) GetUFuturePrice

func (t *CryptoMonitor) GetUFuturePrice(id int64, crypto string) string

func (*CryptoMonitor) Start

func (t *CryptoMonitor) Start()

type Dex

type Dex struct {
	Name      string `json:"name"`
	Liquidity string `json:"liquidity"`
	Pair      string `json:"pair"`
}

type Holder

type Holder struct {
	Address    string `json:"address"`
	Tag        string `json:"tag"`
	IsContract int64  `json:"is_contract"`
	Balance    string `json:"balance"`
	Percent    string `json:"percent"`
	IsLocked   int64  `json:"is_locked"`
}

type Honeypot added in v0.0.24

type Honeypot struct {
	Is bool `json:"isHoneypot"`
}

type HoneypotResp added in v0.0.24

type HoneypotResp struct {
	Honeypot Honeypot `json:"honeypotResult"`
}

type Liquidity added in v0.0.24

type Liquidity struct {
	Usd float64 `json:"usd"`
}

type LockedDetail

type LockedDetail struct {
	Amount  string `json:"amount"`
	EndTime string `json:"end_time"`
	OptTime string `json:"opt_time"`
}

type Meme

type Meme struct {
	Pairs []*Pair `json:"pairs"`
}

type MemeChecker

type MemeChecker struct {
	AntiWhaleModifiable  string `json:"anti_whale_modifiable"`
	BuyTax               string `json:"buy_tax"`
	CanTakeBackOwnership string `json:"can_take_back_ownership"`
	//CannotBuy                  string   `json:"cannot_buy"`
	CannotSellAll  string `json:"cannot_sell_all"`
	CreatorAddress string `json:"creator_address"`
	CreatorBalance string `json:"creator_balance"`
	CreatorPercent string `json:"creator_percent"`
	//Dex                        []Dex    `json:"dex"`
	ExternalCall string `json:"external_call"`
	HiddenOwner  string `json:"hidden_owner"`
	HolderCount  string `json:"holder_count"`
	//Holders                    []Holder `json:"holders"`
	HoneypotWithSameCreator    string   `json:"honeypot_with_same_creator"`
	IsAntiWhale                string   `json:"is_anti_whale"`
	IsBlacklisted              string   `json:"is_blacklisted"`
	IsHoneypot                 string   `json:"is_honeypot"`
	IsInDex                    string   `json:"is_in_dex"`
	IsMintable                 string   `json:"is_mintable"`
	IsOpenSource               string   `json:"is_open_source"`
	IsProxy                    string   `json:"is_proxy"`
	IsWhitelisted              string   `json:"is_whitelisted"`
	LpHolderCount              string   `json:"lp_holder_count"`
	LpHolders                  []Holder `json:"lp_holders"`
	LpTotalSupply              string   `json:"lp_total_supply"`
	OwnerAddress               string   `json:"owner_address"`
	OwnerBalance               string   `json:"owner_balance"`
	OwnerChangeBalance         string   `json:"owner_change_balance"`
	OwnerPercent               string   `json:"owner_percent"`
	PersonalSlippageModifiable string   `json:"personal_slippage_modifiable"`
	Selfdestruct               string   `json:"selfdestruct"`
	SellTax                    string   `json:"sell_tax"`
	SlippageModifiable         string   `json:"slippage_modifiable"`
	TokenName                  string   `json:"token_name"`
	TokenSymbol                string   `json:"token_symbol"`
	TotalSupply                string   `json:"total_supply"`
	TradingCooldown            string   `json:"trading_cooldown"`
	TransferPausable           string   `json:"transfer_pausable"`
	LpLockedTotal              float64
}

type MemeCheckerResp

type MemeCheckerResp struct {
	Code         int64                   `json:"code"`
	Message      string                  `json:"message"`
	MemeCheckers map[string]*MemeChecker `json:"result"`
}

type Pair

type Pair struct {
	URL         string       `json:"url"`
	ChainId     string       `json:"chainId"`
	PairAddress string       `json:"pairAddress"`
	PriceNative string       `json:"priceNative"`
	PriceUsd    string       `json:"priceUsd"`
	BaseToken   *BaseToken   `json:"baseToken"`
	PriceChange *PriceChange `json:"priceChange"`
	Volume      *Volume      `json:"volume"`
	Txns        *Txn         `json:"txns"`
	Lp          *Liquidity   `json:"liquidity"`
}

type PriceChange

type PriceChange struct {
	M5  float64 `json:"m5"`
	H1  float64 `json:"h1"`
	H6  float64 `json:"h6"`
	H24 float64 `json:"h24"`
}

type Probe

type Probe struct {
	HighLine map[string]*line
	LowLine  map[string]*line
	C        chan map[string]string
	Kline    chan string
	Meme     chan string
	// contains filtered or unexported fields
}

func NewProbe

func NewProbe() *Probe

func (*Probe) AddKLineProbe

func (t *Probe) AddKLineProbe(crypto string)

func (*Probe) AddSmartAddr

func (t *Probe) AddSmartAddr(addr string)

func (*Probe) CloseMemeMonitor

func (p *Probe) CloseMemeMonitor(query string, chain string)

func (*Probe) DeleteSmartAddr

func (t *Probe) DeleteSmartAddr(addr string)

func (*Probe) DumpCron

func (t *Probe) DumpCron()

func (*Probe) DumpSmartAddrList

func (t *Probe) DumpSmartAddrList(tip bool)

func (*Probe) KLineProbe

func (t *Probe) KLineProbe(crypto string, ctx context.Context)

func (*Probe) ListKLineProbe

func (t *Probe) ListKLineProbe() string

func (*Probe) ListSmartAddr added in v0.0.28

func (t *Probe) ListSmartAddr(tip bool) string

func (*Probe) MemeDeclineMonitor

func (p *Probe) MemeDeclineMonitor(query string, chain string, price string)

func (*Probe) MemeGrowthMonitor

func (p *Probe) MemeGrowthMonitor(query string, chain string, price string)

func (*Probe) MemeMonitorList

func (p *Probe) MemeMonitorList()

func (*Probe) MemePrice

func (p *Probe) MemePrice(query string, chain string)

func (*Probe) SetSmartAddrProbeItv

func (t *Probe) SetSmartAddrProbeItv(itv string)

func (*Probe) SmartAddr

func (t *Probe) SmartAddr(addr string, offset string)

func (*Probe) SmartAddrProbe

func (t *Probe) SmartAddrProbe(ctx context.Context, addr string)

func (*Probe) StopKLineProbe

func (t *Probe) StopKLineProbe(crypto string)

type TokenTx

type TokenTx struct {
	TokenName       string `json:"tokenName"`
	TokenSymbol     string `json:"tokenSymbol"`
	ContractAddress string `json:"contractAddress"`
	Hash            string `json:"hash"`
	From            string `json:"from"`
	To              string `json:"to"`
	Value           string `json:"value"`
	Decimal         string `json:"tokenDecimal"`
	TimeStamp       string `json:"timeStamp"`
	Block           string `json:"blockNumber"`
}

type TokenTxResp

type TokenTxResp struct {
	Status  string    `json:"status"`
	Message string    `json:"message"`
	Result  []TokenTx `json:"result"`
}

type Track added in v0.0.25

type Track struct {
	C      chan string
	Newest map[string]string

	Task map[string]context.CancelFunc
	// contains filtered or unexported fields
}

func NewTrack added in v0.0.25

func NewTrack() *Track

func (*Track) CronTracking added in v0.0.25

func (t *Track) CronTracking(addr string)

func (*Track) DumpCron added in v0.0.30

func (t *Track) DumpCron()

func (*Track) DumpTrackingList added in v0.0.30

func (t *Track) DumpTrackingList(tip bool)

func (*Track) SmartAddrFinder added in v0.0.32

func (t *Track) SmartAddrFinder(token, offset, page string)

1. 拉取某个 token 最初的交易列表 2. 遍历列表, 查询所有 from 和 to 的地址在该 token 的交易记录 3. 过滤掉买卖数超过 6 的地址, 此类一般为夹子机器人 4. 对交易记录遍历查询内部交易, 对地址的买卖数收益记录

func (*Track) StopTracking added in v0.0.25

func (t *Track) StopTracking(addr string)

func (*Track) Tracking added in v0.0.25

func (t *Track) Tracking(addr string, ctx context.Context)

func (*Track) TrackingList added in v0.0.28

func (t *Track) TrackingList(tip bool) string

func (*Track) TransferList added in v0.0.32

func (t *Track) TransferList(addr, token string) []TokenTx

func (*Track) WalletTracking added in v0.0.25

func (t *Track) WalletTracking(addr string)

func (*Track) WalletTxAnalyze added in v0.0.26

func (t *Track) WalletTxAnalyze(addr string, offset string)

type Txn

type Txn struct {
	M5  *BS `json:"m5"`
	H1  *BS `json:"h1"`
	H6  *BS `json:"h6"`
	H24 *BS `json:"h24"`
}

type Volume

type Volume struct {
	M5  float64 `json:"m5"`
	H1  float64 `json:"h1"`
	H6  float64 `json:"h6"`
	H24 float64 `json:"h24"`
}

Jump to

Keyboard shortcuts

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