get https://solana-gateway.moralis.io/account///balance
Gets the native balance owned by a given network and address.
Log in to see full request history
Responses
Gets the native balance owned by a given network and address.
xxxxxxxxxx
24import 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.getBalance({
network,
address,
});
​
console.log(response?.result);
} catch (e) {
console.error(e);
}
​
Try It!
to start a request and see the response here! Or choose an example: