blockchainutils

package
v0.0.0-...-81db2af Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL string
}

func (*Client) CleanHtml

func (c *Client) CleanHtml(htmlString string) (string, error)

func (*Client) SolanaAddress

func (c *Client) SolanaAddress() (string, error)

func (*Client) SolanaBalance

func (c *Client) SolanaBalance(addr string) (uint64, error)

func (*Client) SolanaBalanceByToken

func (c *Client) SolanaBalanceByToken(address, mint string) (*SolanaBalanceByToken, error)

func (*Client) SolanaBlockheight

func (c *Client) SolanaBlockheight() (int64, error)

func (*Client) SolanaComputeRaydiumToken

func (c *Client) SolanaComputeRaydiumToken(req *SolanaTradeRaydiumTokenReq) (*SolanaComputeRaydiumTokenResp, error)

func (*Client) SolanaCreatePumpfunToken

func (c *Client) SolanaCreatePumpfunToken(req *SolanaCreatePumpfunTokenReq) (*SolanaCreatePumpfunTokenResp, error)

func (*Client) SolanaGetTokenBalances

func (c *Client) SolanaGetTokenBalances(address string) ([]*SolanaTokenBalance, error)

func (*Client) SolanaTokenInfo

func (c *Client) SolanaTokenInfo(mint string) (*SolanaTokenInfoResp, error)

func (*Client) SolanaTokenMetaData

func (c *Client) SolanaTokenMetaData(mint string) (*SolanaTokenMetaDataResp, error)

func (*Client) SolanaTradePumpfunToken

func (c *Client) SolanaTradePumpfunToken(req *SolanaTradePumpfunTokenReq) (string, error)

func (*Client) SolanaTradeRaydiumToken

func (c *Client) SolanaTradeRaydiumToken(req *SolanaTradeRaydiumTokenReq) (*SolanaTradeRaydiumTokenResp, error)

func (*Client) SolanaTransfer

func (c *Client) SolanaTransfer(address string, req *SolanaTransferReq) (string, error)

func (*Client) SolanaValidateAddress

func (c *Client) SolanaValidateAddress(mint string) (bool, error)

type SolanaBalanceByToken

type SolanaBalanceByToken struct {
	Amount         string  `json:"amount"`
	Decimals       int     `json:"decimals"`
	UIAmount       float64 `json:"uiAmount"`
	UIAmountString string  `json:"uiAmountString"`
}

type SolanaComputeRaydiumTokenResp

type SolanaComputeRaydiumTokenResp struct {
	SwapType             string         `json:"swap_type"`
	InputMint            string         `json:"input_mint"`
	InputAmount          numeric.BigInt `json:"input_amount"`
	OutputMint           string         `json:"output_mint"`
	OutputAmount         numeric.BigInt `json:"output_amount"`
	OtherAmountThreshold numeric.BigInt `json:"other_amount_threshold"`
	SlippageBps          float64        `json:"slippage_bps"`
	PriceImpactPct       float64        `json:"price_impact_pct"`
	ReferrerAmount       numeric.BigInt `json:"referrer_amount"`
	RoutePlan            []struct {
		PoolID     string         `json:"pool_id"`
		InputMint  string         `json:"input_mint"`
		OutputMint string         `json:"output_mint"`
		FeeMint    string         `json:"fee_mint"`
		FeeRate    int            `json:"fee_rate"`
		FeeAmount  numeric.BigInt `json:"fee_amount"`
	} `json:"route_plan"`
}

type SolanaCreatePumpfunTokenReq

type SolanaCreatePumpfunTokenReq struct {
	Address     string  `json:"address"`
	Name        string  `json:"name"`
	Symbol      string  `json:"symbol"`
	Description string  `json:"description"`
	Twitter     string  `json:"twitter"`
	Telegram    string  `json:"telegram"`
	Website     string  `json:"website"`
	Amount      float64 `json:"amount"`
	ImageBase64 string  `json:"image_base64"`
}

type SolanaCreatePumpfunTokenResp

type SolanaCreatePumpfunTokenResp struct {
	Signature string `json:"signature"`
	Mint      string `json:"mint"`
}

type SolanaTokenBalance

type SolanaTokenBalance struct {
	IsNative    bool   `json:"is_native"`
	Mint        string `json:"mint"`
	Owner       string `json:"owner"`
	State       string `json:"state"`
	TokenAmount struct {
		Amount         numeric.BigInt `json:"amount"`
		Decimals       int            `json:"decimals"`
		UIAmount       float64        `json:"ui_amount"`
		UIAmountString string         `json:"ui_amount_string"`
	} `json:"token_amount"`
}

type SolanaTokenInfoResp

type SolanaTokenInfoResp struct {
	Data *struct {
		Parsed *struct {
			Info *struct {
				Decimals int `json:"decimals"`
			} `json:"info"`
		} `json:"parsed"`
	} `json:"data"`
}

type SolanaTokenMetaDataResp

type SolanaTokenMetaDataResp struct {
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
	Mint   string `json:"mint"`
}

type SolanaTradePumpfunTokenReq

type SolanaTradePumpfunTokenReq struct {
	Address string  `json:"address"`
	Action  string  `json:"action"`
	Mint    string  `json:"mint"`
	Amount  float64 `json:"amount"`
	Pool    string  `json:"pool"`
}

type SolanaTradeRaydiumTokenReq

type SolanaTradeRaydiumTokenReq struct {
	Address    string  `json:"address"`
	InputMint  string  `json:"input_mint"`
	OutputMint string  `json:"output_mint"`
	Slippage   float64 `json:"slippage"`
	Amount     uint64  `json:"amount"`
}

type SolanaTradeRaydiumTokenResp

type SolanaTradeRaydiumTokenResp struct {
	OutputAmount numeric.BigInt `json:"output_amount"`
	Signatures   []string       `json:"signatures"`
}

type SolanaTransferReq

type SolanaTransferReq struct {
	ToAddress string `json:"to_address"`
	Mint      string `json:"mint"`
	Amount    uint64 `json:"amount"`
}

Jump to

Keyboard shortcuts

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