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

getAccountInfo

Gets the info of an account

(async() => {
    let account_info_1 = await SOLPay.getAccountInfo(); // {...}
    let account_info_2 = await SOLPay.getAccountInfo("ACCOUNT_ADDRESS"); // {...}
})();

Parameters:

  • address (optional, default: connected wallet address): string - the account address with which to get the info

Returns:

object ({...}) - the account info

  • raw_data: object ({...}) - the raw data of the account

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

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

  • owner: string ("...") - the owner of the account

  • rentEpoch: number (250) - the rent epoch

  • info (if executable is false): object ({...}) - the parsed data of the account

  • program (if executable is false): string (spl-token) - the program of the account

  • space (if executable is false): number (150) - the space of the account

  • type (if executable is false): string ("account") - the type of the account

Throws:

  • SOL Pay SDK Fatal Error: Invalid address ${address}, and no wallet was connected. Use SOLPay.connectWallet() to connect to a Solana wallet. - an invalid address was used, and no wallet was connected

  • 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

PreviousgetTokenBalancesNextgetAssociatedTokenAddress

Last updated 3 years ago