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)
- type BondingCurveData
- type BondingCurvePublicKeys
- type CreateTokenMetadataCommon
- type CreateTokenMetadataFromBlobRequest
- type CreateTokenMetadataRequestFromFile
- type CreateTokenMetadataRequestFromURL
- type CreateTokenMetadataResponse
- func CreateTokenMetadataFromBlob(client *http.Client, req CreateTokenMetadataFromBlobRequest) (*CreateTokenMetadataResponse, error)
- func CreateTokenMetadataFromFile(client *http.Client, req CreateTokenMetadataRequestFromFile) (*CreateTokenMetadataResponse, error)
- func CreateTokenMetadataFromURL(client *http.Client, req CreateTokenMetadataRequestFromURL) (*CreateTokenMetadataResponse, error)
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 ¶
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 CreateTokenMetadataCommon ¶
type CreateTokenMetadataCommon struct { Name string Symbol string Description string Twitter string Telegram string Website string ShowName bool }
Common struct for shared metadata fields
type CreateTokenMetadataFromBlobRequest ¶
type CreateTokenMetadataFromBlobRequest struct { File []byte CreateTokenMetadataCommon }
type CreateTokenMetadataRequestFromFile ¶
type CreateTokenMetadataRequestFromFile struct { Filename string CreateTokenMetadataCommon }
type CreateTokenMetadataRequestFromURL ¶
type CreateTokenMetadataRequestFromURL struct { // FileURL is the URL to fetch the file from FileURL string CreateTokenMetadataCommon }
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 CreateTokenMetadataFromBlob ¶
func CreateTokenMetadataFromBlob(client *http.Client, req CreateTokenMetadataFromBlobRequest) (*CreateTokenMetadataResponse, error)
func CreateTokenMetadataFromFile ¶
func CreateTokenMetadataFromFile(client *http.Client, req CreateTokenMetadataRequestFromFile) (*CreateTokenMetadataResponse, error)
func CreateTokenMetadataFromURL ¶
func CreateTokenMetadataFromURL(client *http.Client, req CreateTokenMetadataRequestFromURL) (*CreateTokenMetadataResponse, error)
Click to show internal directories.
Click to hide internal directories.