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 accountexecutable: boolean (
false) - whether the account is executablelamports: number (
10000) - the number of lamports in the accountowner: string (
"...") - the owner of the accountrentEpoch: number (
250) - the rent epochinfo (if
executableisfalse): object ({...}) - the parsed data of the accountprogram (if
executableisfalse): string (spl-token) - the program of the accountspace (if
executableisfalse): number (150) - the space of the accounttype (if
executableisfalse): 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 connectedSOL Pay SDK Fatal Error: No connection found. Use SOLPay.connectNetwork() to connect to the Solana network.- could not find a connection to the Solana networkSOL Pay SDK Fatal Error: Connection did not respond. Use SOLPay.connectNetwork() to connect to the Solana network.- did not receive response from Solana network
Last updated