pump

package
v0.0.0-...-6adbc1a Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDevnetMode

func SetDevnetMode()

SetDevnetMode sets the pumpidl.fun program addresses to the devnet addresses. It is important to call this function if you are using the devnet.

func SolToLamp

func SolToLamp(sol float64) uint64

Types

type BondingCurveData

type BondingCurveData struct {
	RealTokenReserves    *big.Int
	VirtualTokenReserves *big.Int
	VirtualSolReserves   *big.Int
}

BondingCurveData holds the relevant information decoded from the on-chain data.

func (*BondingCurveData) String

func (b *BondingCurveData) String() string

type BondingCurvePublicKeys

type BondingCurvePublicKeys struct {
	BondingCurve           solana.PublicKey
	AssociatedBondingCurve solana.PublicKey
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(agent kit.Agent) *Client

func (*Client) BuyToken

func (c *Client) BuyToken(mint solana.PublicKey, buyAmountSol float64, percentage float64) (string, error)

BuyToken buys a token from the bonding curve. The amount is the amount of tokens to buy, and the sol is the amount of SOL to pay. The mintAddr is the address of the mint of the token. This function will send a transaction to the network to buy the token. This function will return an error if the transaction fails.

func (*Client) CreateToken

func (c *Client) CreateToken(mint *solana.Wallet, name string, symbol string, uri string, buyAmountSol float64, percentage float64) (string, error)

func (*Client) SellToken

func (c *Client) SellToken(mint solana.PublicKey, sellTokenAmount uint64, percentage float64, all bool) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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