Documentation
¶
Index ¶
- func BuyToken(rpcClient *rpc.Client, wsClient *ws.Client, user solana.PrivateKey, ...) (string, error)
- func CreateToken(rpcClient *rpc.Client, wsClient *ws.Client, user solana.PrivateKey, ...) (string, error)
- func SellToken(rpcClient *rpc.Client, wsClient *ws.Client, user solana.PrivateKey, ...) (string, error)
- func SetDevnetMode()
- type BondingCurveData
- type BondingCurvePublicKeys
- type CreateTokenMetadataRequest
- type CreateTokenMetadataResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuyToken ¶
func BuyToken( rpcClient *rpc.Client, wsClient *ws.Client, user solana.PrivateKey, mint solana.PublicKey, buyAmountLamports uint64, slippageBasisPoint uint, ) (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 CreateToken ¶
func SetDevnetMode ¶
func SetDevnetMode()
SetDevnetMode sets the pump.fun program addresses to the devnet addresses. It is important to call this function if you are using the devnet.
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 CreateTokenMetadataResponse ¶
type CreateTokenMetadataResponse struct { Name string `json:"name"` Symbol string `json:"symbol"` Description string `json:"description"` ShowName bool `json:"showName"` CreatedOn string `json:"createdOn"` Twitter string `json:"twitter"` Telegram string `json:"telegram"` Website string `json:"website"` Image string `json:"image"` MetadataUri string `json:"metadataUri"` }
func CreateTokenMetadata ¶
func CreateTokenMetadata(client *http.Client, create CreateTokenMetadataRequest) (*CreateTokenMetadataResponse, error)
Click to show internal directories.
Click to hide internal directories.