pumpfun

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: BSD-3-Clause Imports: 21 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 int64,
) ([]solana.Instruction, error)

func IsRemoveLiqByLogs added in v0.4.8

func IsRemoveLiqByLogs(logs []string) (bool, 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 CreateDataType added in v0.4.8

type CreateDataType struct {
	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"`
}

func ParseCreateByLogs added in v0.4.8

func ParseCreateByLogs(logs []string) (*CreateDataType, error)

type CreateTxDataType

type CreateTxDataType struct {
	CreateDataType
	TxId    string         `json:"txid"`
	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"`
	Timestamp          uint64           `json:"timestamp"`
}

func ParseSwapByLogs added in v0.4.5

func ParseSwapByLogs(logs []string) ([]*SwapDataType, error)

type SwapTxDataType

type SwapTxDataType struct {
	Swaps             []*SwapDataType `json:"swaps"`
	FeeInfo           *type_.FeeInfo  `json:"fee_info"`
	TxId              string          `json:"tx_id"`
	UserBalance       string          `json:"user_balance"`
	BeforeUserBalance string          `json:"before_user_balance"`
}

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