Skip to main content

Get token balance by wallet

GEThttps://solana-gateway.moralis.io/account/:network/:address/tokens

Gets the token balances owned by a given network and address.

PATH PARAMS
networkstringrequired
The network to query
addressstringrequired
The address for which token balances will be checked
Responses
API KEY
import Moralis from 'moralis';
import { SolNetwork, SolAddress } from "@moralisweb3/sol-utils";

try {
await Moralis.start({
apiKey: 'YOUR_API_KEY',
});

const address = SolAddress.create(
"HsXZnF7Te7dZ5ijvGcDj3NWtxRBBaAuYQgh1oZLwAba2"
);

const network = SolNetwork.MAINNET;

const response = await Moralis.SolApi.account.getSPL({
network,
address,
});

console.log(response?.result);
} catch (e) {
console.error(e);
}
Response Example
Empty