crypto

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 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 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) 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 跌

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"`
	LockedDetail []LockedDetail `json:"locked_detail"`
}

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"`
}

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"`
}

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()

func (*Probe) KLineProbe

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

func (*Probe) ListKLineProbe

func (t *Probe) ListKLineProbe() 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"`
}

type TokenTxResp

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

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