Documentation
¶
Index ¶
- Variables
- func DeriveAssociatedTokenAddress(owner solana.PublicKey, mint solana.PublicKey) (pubKey *solana.PublicKey, nonce uint8, err error)
- func JsonToBytes(js []byte) []byte
- type AssociatedTokenAccountResult
- type ChainID
- type Client
- func (c *Client) AddSigner(key solana.PrivateKey)
- func (c *Client) DeriveAndCheckTokenAccount(owner solana.PublicKey, mint solana.PublicKey) (pubKey *solana.PublicKey, nonce uint8, err error)
- func (c *Client) GetAssociatedTokenAccount(owner, mint string) (*AssociatedTokenAccountResult, error)
- func (c *Client) GetTokenBalanceOf(owner solana.PublicKey, mint solana.PublicKey) uint64
- func (c *Client) SignAndSendTx(b64 string) (*solana.Signature, error)
- type TokenExtensions
- type TokenMetadata
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoATAFound = errors.New("no ATA found")
View Source
var ErrTokenAccountNotFound = errors.New("associated token account not found")
Functions ¶
func JsonToBytes ¶
Types ¶
type AssociatedTokenAccountResult ¶
type AssociatedTokenAccountResult struct { PubKey string `json:"-"` Parsed struct { Info struct { IsNative bool `json:"isNative"` Mint string `json:"mint"` Owner string `json:"owner"` State string `json:"state"` TokenAmount struct { Amount string `json:"amount"` Decimals int `json:"decimals"` UiAmount float64 `json:"uiAmount"` UiAmountString string `json:"uiAmountString"` } `json:"tokenAmount"` } `json:"info"` Type string `json:"type"` } `json:"parsed"` Program string `json:"program"` Space int `json:"space"` }
func (*AssociatedTokenAccountResult) DecimalAmount ¶
func (ata *AssociatedTokenAccountResult) DecimalAmount() decimal.Decimal
func (*AssociatedTokenAccountResult) InexactFloatAmount ¶
func (ata *AssociatedTokenAccountResult) InexactFloatAmount() float64
func (*AssociatedTokenAccountResult) Uint64Amount ¶
func (ata *AssociatedTokenAccountResult) Uint64Amount() uint64
type Client ¶
func (*Client) DeriveAndCheckTokenAccount ¶
func (*Client) GetAssociatedTokenAccount ¶
func (c *Client) GetAssociatedTokenAccount(owner, mint string) (*AssociatedTokenAccountResult, error)
func (*Client) GetTokenBalanceOf ¶
func (*Client) SignAndSendTx ¶
type TokenExtensions ¶
type TokenMetadata ¶
type TokenMetadata struct { ChainId ChainID `json:"chainId"` Address string `json:"address"` Symbol string `json:"symbol"` Name string `json:"name"` Collection string `json:"collection"` Ticker string `json:"ticker"` Decimals int `json:"decimals"` Image string `json:"image"` Tags []string `json:"tags"` Extensions TokenExtensions `json:"extensions"` }
Click to show internal directories.
Click to hide internal directories.