SOL Pay
  • SOL Pay
  • Quick Start
  • Streams
  • Stake Pools
  • Reference
    • SDK Reference
      • connectNetwork
      • connectWallet
      • sendSolanaLamports
      • sendSolana
      • sendTokens
      • sendTokensDecimal
      • signTransaction
      • broadcastSerializedTransaction
      • streamLamports
      • backupStreamWallet
      • getStreamDetails
      • refillStream
      • pauseStream
      • resumeStream
      • closeStream
      • signMessage
      • getBalance
      • getTokenBalances
      • getAccountInfo
      • getAssociatedTokenAddress
      • getTokenBalance
      • tokens.getData
      • tokens.getTags
      • tokens.getToken
      • tokens.search
      • tokens.getRawUnvalidatedList
      • adapters
      • networks
    • API Reference
      • transaction.php
      • token_transaction.php
      • signature.php
  • Website
  • Source Code
Powered by GitBook
On this page
  • Parameters:
  • Returns:
  • Throws:
  1. Reference
  2. SDK Reference

tokens.getData

Gets the raw on-chain data for a token

(async() => {
    let token_data = await SOLPay.tokens.getData("TOKEN_ADDRESS"); // {...}
})();

Parameters:

  • address: string - the mint address of the token with which to get the data

Returns:

object ({...}) - the raw token data

  • data: Uint8Array (Uint8Array [...]) - the raw data from the blockchain

  • executable: boolean (false) - whether the token's account is executable

  • lamports: number (10000) - the number of lamports in the token's account

  • owner: string ("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA") - the owner of the token's account

  • rentEpoch: number (250) - the rent epoch

Throws:

  • SOL Pay SDK Fatal Error: Invalid address ${address}. - an invalid address was used

  • SOL Pay SDK Fatal Error: No connection found. Use SOLPay.connectNetwork() to connect to the Solana network. - could not find a connection to the Solana network

  • SOL Pay SDK Fatal Error: Connection did not respond. Use SOLPay.connectNetwork() to connect to the Solana network. - did not receive response from Solana network

PreviousgetTokenBalanceNexttokens.getTags

Last updated 3 years ago