pumpfun

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwapInstructions

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

Types

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
	Name                string
	Symbol              string
	URI                 string
	UserAddress         solana.PublicKey
	BondingCurveAddress solana.PublicKey
	TokenAddress        solana.PublicKey
	FeeInfo             *util.FeeInfo
}

func ParseCreateTx

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

type ParseTxResult

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

func ParseTx

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

type RemoveLiqTxDataType

type RemoveLiqTxDataType struct {
	TxId                string
	BondingCurveAddress solana.PublicKey
	TokenAddress        solana.PublicKey
	FeeInfo             *util.FeeInfo
}

func ParseRemoveLiqTx

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

上岸

type SwapDataType

type SwapDataType struct {
	TokenAddress         solana.PublicKey
	SOLAmount            string
	TokenAmount          string
	Type                 SwapType
	UserAddress          solana.PublicKey
	Timestamp            uint64
	VirtualSolReserves   string
	VirtualTokenReserves string
	UserTokenBalance     string // 交易之后用户的余额
}

type SwapTxDataType

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

func ParseSwapTx

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

type SwapType

type SwapType string
const (
	SwapType_Buy  SwapType = "buy"
	SwapType_Sell SwapType = "sell"
)

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