Returns the token balance of an SPL Token account. Returns RPCResponse AmountObject with detailed balance information.
Modulesolana-haskell-sdk-1.3.0.0GHC2021
Network.Solana.RPC.HTTP.Token
This module provides access to Solana JSON-RPC methods related to SPL Token accounts. It includes queries for fetching token balances, owned accounts, delegated accounts, largest token holders, and token supply information.
It is useful for building wallets, explorers, or token dashboards that interact with SPL-compliant tokens deployed on the Solana blockchain.
- 3 types
- 12 values
- Packagesolana-haskell-sdk-1.3.0.0
- Exports15
- LanguageGHC2021
- LicenceApache-2.0
- SourceToken.hs
getTokenAccountBalance
3 declarationsReturns the token balance of an SPL Token account.
Contains SPL token balance details.
Constructors
AmountObjectamount :: StringThe raw balance without decimals, a string representation of Word64.
decimals :: Word8Number of base 10 digits to the right of the decimal place.
uiAmount :: Maybe DoubleThe balance using mint-prescribed decimals (deprecated).
uiAmountString :: StringThe balance as a string, using mint-prescribed decimals.
Instances5Eq, Show, Generic, FromJSON, Rep
Eq AmountObjectDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.TokenShow AmountObjectDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.TokenGeneric AmountObjectDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.TokenFromJSON AmountObjectDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.Tokentype Rep AmountObject = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.Token"AmountObject"
"Network.Solana.RPC.HTTP.Token"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"AmountObject"
'PrefixI 'True) ((S1 ('MetaSel ('Just"amount"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just"decimals"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8)) :*: (S1 ('MetaSel ('Just"uiAmount"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)) :*: S1 ('MetaSel ('Just"uiAmountString"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))
getTokenAccountsByDelegate
2 declarationsReturns all SPL Token accounts delegated to the provided delegate address, using the given configuration.
Returns all SPL Token accounts delegated to the provided delegate address, requesting base64 encoding.
getTokenAccountsByOwner
5 declarationsSpecifies either a mint or a program to filter token accounts.
Constructors
Instances3Generic, ToJSON, Rep
Generic SolanaPubKeyWithPurposeDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.TokenToJSON SolanaPubKeyWithPurposeDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.Tokentype Rep SolanaPubKeyWithPurpose = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.Token"SolanaPubKeyWithPurpose"
"Network.Solana.RPC.HTTP.Token"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"Mint"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)) :+: C1 ('MetaCons"Program"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)))
Returns all SPL Token accounts owned by the specified wallet.
Returns all SPL Token accounts owned by the specified wallet.
Returns all SPL Token accounts for the specified owner and mint address.
Returns all SPL Token accounts for the specified owner and program ID.
getTokenLargestAccounts
3 declarationsReturns the largest accounts for a given SPL Token mint, sorted by balance.
Returns RPCResponse [AmountObjectWithAddr].
Returns the largest accounts for a given SPL Token mint, sorted by balance.
Contains address and balance information for an SPL Token account.
Constructors
AmountObjectWithAddraddress' :: SolanaPublicKeyThe account address.
amount' :: StringThe raw balance without decimals, a string representation of Word64.
decimals' :: Word8Number of base 10 digits to the right of the decimal place.
uiAmount' :: Maybe DoubleThe balance using mint-prescribed decimals (deprecated).
uiAmountString' :: StringThe balance as a string, using mint-prescribed decimals.
Instances4Show, Generic, FromJSON, Rep
Show AmountObjectWithAddrDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.TokenGeneric AmountObjectWithAddrDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.TokenFromJSON AmountObjectWithAddrDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.Tokentype Rep AmountObjectWithAddr = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.RPC.HTTP.Token"AmountObjectWithAddr"
"Network.Solana.RPC.HTTP.Token"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"AmountObjectWithAddr"
'PrefixI 'True) ((S1 ('MetaSel ('Just"address'"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey) :*: S1 ('MetaSel ('Just"amount'"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just"decimals'"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8) :*: (S1 ('MetaSel ('Just"uiAmount'"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)) :*: S1 ('MetaSel ('Just"uiAmountString'"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))
getTokenSupply
2 declarationsReturns the total supply of an SPL Token. Returns RPCResponse AmountObject with the supply balance.
Returns the total supply of an SPL Token.