Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Get Wallet Portfolio

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

Gets the portfolio for a given network and address.

PATH PARAMS
networkstringrequired
The network to query
addressstringrequired
The address of the token contract
QUERY PARAMS
nftMetadataboolean
Should NFT metadata be included in the result?
Responses
API KEY
import Moralis from 'moralis';

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

const response = Moralis.SolApi.account.getPortfolio({
"nftMetadata": true,
"network": "mainnet",
"address": "kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs"
});

console.log(response.raw);
} catch (e) {
console.error(e);
}
Response Example
{
"nativeBalance": {
"solana": "",
"lamports": ""
},
"nfts": {
"associatedTokenAddress": "",
"mint": "",
"name": "",
"symbol": ""
},
"tokens": {
"associatedTokenAddress": "",
"mint": "",
"name": "",
"symbol": "",
"amount": "",
"amountRaw": "",
"decimals": ""
}
}