dapp

package
v0.0.0-...-197f041 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfBucketExistsOrCreateIt

func CheckIfBucketExistsOrCreateIt(db *bolt.DB, bucket []byte) error

func GetSOLPrice

func GetSOLPrice() (float64, error)

func GetUserKey

func GetUserKey(ctx tele.Context) []byte

func Join

func Join(ctx context.Context, client *telegram.Client)

Types

type ApiResponse

type ApiResponse struct {
	Data []Price `json:"data"`
}

type Client

type Client struct {
	*tele.Bot
	Database *bolt.DB
	Solana   *solana.Client
	Http     *resty.Client
	RPC      chan func() error

	MainMenu      tele.HandlerFunc
	TokenAddress  string
	TokenSymbol   string
	HoldingAmount uint
}

func NewApp

func NewApp(tokenAddress string, amount int, env string, debug string, buckets [][]byte, logo string) *Client

func (*Client) CheckIfWalletIsDuplicate

func (client *Client) CheckIfWalletIsDuplicate(walletAddress string, userKey string) (bool, error)

func (*Client) CheckInCache

func (client *Client) CheckInCache(publicKey string, tokenAddr string) (bool, uint64, uint64, error)

func (*Client) CheckUsersWallets

func (client *Client) CheckUsersWallets(buckets [][]byte)

func (*Client) CheckWallet

func (client *Client) CheckWallet(next tele.HandlerFunc) tele.HandlerFunc

func (*Client) GetSOLBalance

func (client *Client) GetSOLBalance(publicKey string) (uint64, error)

func (*Client) GetSolanaAndTokenBalance

func (client *Client) GetSolanaAndTokenBalance(publicKey string, tokenAddr string) (uint64, uint64, error)

func (*Client) GetTokenInformationFromDexScreener

func (client *Client) GetTokenInformationFromDexScreener(token string) ([]Pair, error)

func (*Client) GetTokenMetadata

func (client *Client) GetTokenMetadata(tokenAddress string) (*TokenMetadata, error)

func (*Client) GetURIFromCache

func (client *Client) GetURIFromCache(address string) (string, error)

func (*Client) OnData

func (client *Client) OnData(ctx tele.Context, work func(ctx tele.Context, userWallet string, walletAddress string, privateKey string, mnemonic string, balance uint64, tokenBalance uint64) error) error

func (*Client) RedirectToProfile

func (client *Client) RedirectToProfile(ctx tele.Context) error

func (Client) Run

func (client Client) Run(mainMenu tele.HandlerFunc)

func (*Client) SendMessageToEachSubscribedMemberOfBucket

func (client *Client) SendMessageToEachSubscribedMemberOfBucket(bucket []byte, meta *TokenMetadata, reply *tele.ReplyMarkup, caption string) error

func (*Client) ShowIt

func (client *Client) ShowIt(ctx tele.Context, wallet Wallet) error

func (*Client) ShowProfile

func (client *Client) ShowProfile(ctx tele.Context) error

func (*Client) SolanaRPCRateLimiter

func (client *Client) SolanaRPCRateLimiter()

func (*Client) StartSubscribingForBucket

func (client *Client) StartSubscribingForBucket(bucket []byte, ctx tele.Context, message string) error

func (*Client) StopSubscribingToBucket

func (client *Client) StopSubscribingToBucket(ctx tele.Context, bucket []byte, msg string) error

type DSNewPair

type DSNewPair struct {
	Chain        string
	Address      string
	PumpFun      bool
	PriceUSD     string
	PriceSOL     string
	FDV          string
	Liquidity    string
	Ticker       string
	PooledToken  string
	PooledSOL    string
	PooledSOLUSD string
}

func ParseDSNewPair

func ParseDSNewPair(message *tg.Message) (*DSNewPair, bool)

type Entity

type Entity struct {
	ID string
}

func NewEntity

func NewEntity(id string) *Entity

func (*Entity) Recipient

func (entity *Entity) Recipient() string

type Info

type Info struct {
	ImageUrl string      `json:"imageUrl"`
	Websites interface{} `json:"websites"`
	Socials  []Social    `json:"socials"`
}

type Liquidity

type Liquidity struct {
	USD   float32 `json:"usd"`
	Base  float32 `json:"base"`
	Quote float32 `json:"quote"`
}

type NewRaydiumPool

type NewRaydiumPool struct {
	Ticker     string
	CA         string
	RaydiumURL string
}

type NewTokenEvent

type NewTokenEvent struct {
	Address        string `json:"address"`
	CreatorAddress string `json:"creator_address"`
	BoughtSOL      string `json:"creator_bought"`
	Ticker         string `json:"ticker"`
}

type Pair

type Pair struct {
	ChainID       string      `json:"chainID"`
	DexID         string      `json:"dexId"`
	URL           string      `json:"url"`
	PairAddress   string      `json:"pairAddress"`
	BaseToken     Token       `json:"baseToken"`
	QuoteToken    Token       `json:"quoteToken"`
	PriceNative   string      `json:"priceNative"`
	PriceUsd      string      `json:"priceUsd"`
	Txns          Txns        `json:"txns"`
	DexVolume     Volume      `json:"volume"`
	PriceChange   PriceChange `json:"priceChange"`
	DexLiquidity  Liquidity   `json:"liquidity"`
	PairCreatedAt int         `json:"pairCreatedAt"`
	DexFDV        int64       `json:"fdv"`
}

type Price

type Price struct {
	PriceUSD          string `json:"priceUsd"`
	Time              int64  `json:"time"`
	CirculatingSupply string `json:"circulatingSupply"`
	Date              string `json:"date"`
}

type PriceChange

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

type Social

type Social struct {
	Type string `json:"type"`
	URL  string `json:"url"`
}

type Token

type Token struct {
	Address string `json:"address"`
	Name    string `json:"name"`
	Symbol  string `json:"symbol"`
	Info    Info   `json:"info"`
}

type TokenMetadata

type TokenMetadata struct {
	Name        string `json:"string"`
	Symbol      string `json:"symbol"`
	Description string `json:"description"`
	Image       string `json:"image"`
	ShowName    bool   `json:"showName"`
	CreatedOn   string `json:"createdOn"`
	Twitter     string `json:"twitter"`
	Telegram    string `json:"telegram"`
	Website     string `json:"website"`
}

type TokensResponse

type TokensResponse struct {
	SchemaVersion string `json:"schemaVersion"`
	Pairs         []Pair `json:"pairs"`
}

type Tx

type Tx struct {
	Buy  int `json:"buys"`
	Sell int `json:"sells"`
}

type Txns

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

type UserWallet

type UserWallet struct {
	WalletAddr []byte
	PrivateKey []byte
	Mnemonic   []byte
}

func GetUsersAddressesInBucket

func GetUsersAddressesInBucket(b *bolt.Bucket) (*UserWallet, error)

type Volume

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

type Wallet

type Wallet struct {
	FirstName           string
	WalletAddress       string
	PrivateKey          string
	Mnemonic            string
	ConfirmedUserWallet string
	BalanceSOL          string
	BalanceToken        string
	Backtick            string
	HoldingAmount       uint
	TokenName           string
}

Jump to

Keyboard shortcuts

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