pumpfun

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwapInstructions

func GetSwapInstructions(
	userAddress solana.PublicKey,
	swapType type_.SwapType,
	tokenAddress solana.PublicKey,
	tokenAmount string,
	isCloseUserAssociatedTokenAddress bool,
	virtualSolReserve string,
	virtualTokenReserve string,
	slippage uint64,
) ([]solana.Instruction, error)

Types

type AddLiqTxDataType added in v0.0.8

type AddLiqTxDataType struct {
	TxId                 string           `json:"txid"`
	TokenAddress         solana.PublicKey `json:"token_address"`
	InitSOLAmount        string           `json:"init_sol_amount"`
	InitTokenAmount      string           `json:"init_token_amount"`
	AMMAddress           solana.PublicKey `json:"amm_address"`
	PoolCoinTokenAccount solana.PublicKey `json:"pool_coin_token_account"`
	PoolPcTokenAccount   solana.PublicKey `json:"pool_pc_token_account"`

	FeeInfo *type_.FeeInfo `json:"fee_info"`
}

func ParseAddLiqTx added in v0.0.8

func ParseAddLiqTx(meta *rpc.TransactionMeta, transaction *solana.Transaction) (*AddLiqTxDataType, error)

type BondingCurveDataType

type BondingCurveDataType struct {
	BondingCurveAddress  string
	VirtualTokenReserves string
	VirtualSolReserves   string
	RealTokenReserves    string
	RealSolReserves      string
	TokenTotalSupply     string
	Complete             bool
}

func GetBondingCurveData

func GetBondingCurveData(
	rpcClient *rpc.Client,
	tokenAddress *solana.PublicKey,
	bondingCurveAddress *solana.PublicKey,
) (*BondingCurveDataType, error)

type CreateTxDataType

type CreateTxDataType struct {
	TxId                string           `json:"txid"`
	Name                string           `json:"name"`
	Symbol              string           `json:"symbol"`
	URI                 string           `json:"uri"`
	UserAddress         solana.PublicKey `json:"user_address"`
	BondingCurveAddress solana.PublicKey `json:"bonding_curve_address"`
	TokenAddress        solana.PublicKey `json:"token_address"`
	FeeInfo             *type_.FeeInfo   `json:"fee_info"`
}

func ParseCreateTx

func ParseCreateTx(meta *rpc.TransactionMeta, transaction *solana.Transaction) (*CreateTxDataType, error)

type ParseTxResult

type ParseTxResult struct {
	SwapTxData      *SwapTxDataType
	CreateTxData    *CreateTxDataType
	RemoveLiqTxData *RemoveLiqTxDataType
	AddLiqTxData    *AddLiqTxDataType
}

func ParseTx

func ParseTx(meta *rpc.TransactionMeta, transaction *solana.Transaction) (*ParseTxResult, error)

type RemoveLiqTxDataType

type RemoveLiqTxDataType struct {
	TxId                string           `json:"txid"`
	BondingCurveAddress solana.PublicKey `json:"bonding_curve_address"`
	TokenAddress        solana.PublicKey `json:"token_address"`
	FeeInfo             *type_.FeeInfo   `json:"fee_info"`
}

func ParseRemoveLiqTx

func ParseRemoveLiqTx(meta *rpc.TransactionMeta, transaction *solana.Transaction) (*RemoveLiqTxDataType, error)

上岸

type SwapDataType

type SwapDataType struct {
	TokenAddress       solana.PublicKey `json:"token_address"`
	SOLAmount          string           `json:"sol_amount"`
	TokenAmount        string           `json:"token_amount"`
	Type               type_.SwapType   `json:"type"`
	UserAddress        solana.PublicKey `json:"user_address"`
	ReserveSOLAmount   string           `json:"reserve_sol_amount"`
	ReserveTokenAmount string           `json:"reserve_token_amount"`
	UserTokenBalance   string           `json:"user_token_balance"` // 交易之后用户的余额
}

type SwapTxDataType

type SwapTxDataType struct {
	Swaps   []*SwapDataType
	FeeInfo *type_.FeeInfo
	TxId    string
}

func ParseSwapTx

func ParseSwapTx(meta *rpc.TransactionMeta, transaction *solana.Transaction) (*SwapTxDataType, error)

type TokenMetadata

type TokenMetadata struct {
	Name        string `json:"name"`
	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"`
}

func URIInfo

func URIInfo(logger i_logger.ILogger, uri string) (*TokenMetadata, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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