Skip to main content
GET
/
v1
/
spl
/
balance
Balance
curl --request GET \
  --url https://payments.magicblock.app/v1/spl/balance
import requests

url = "https://payments.magicblock.app/v1/spl/balance"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://payments.magicblock.app/v1/spl/balance', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://payments.magicblock.app/v1/spl/balance",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://payments.magicblock.app/v1/spl/balance"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://payments.magicblock.app/v1/spl/balance")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://payments.magicblock.app/v1/spl/balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "address": "Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L",
  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "ata": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
  "location": "base",
  "balance": "1000000"
}

Query Parameters

address
string
required

Owner wallet pubkey.

Example:

"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L"

mint
string
required

SPL mint pubkey.

Example:

"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

cluster

Optional. Use mainnet for BASE_RPC_URL and EPHEMERAL_RPC_URL, devnet for BASE_DEVNET_RPC_URL and EPHEMERAL_DEVNET_RPC_URL, or provide a custom http(s) RPC URL to override the base RPC while keeping the configured ephemeral RPC.

Available options:
mainnet,
devnet
Example:

"mainnet"

Response

Base-chain token balance

address
string
required
mint
string
required
ata
string
required
location
enum<string>
required
Available options:
base,
ephemeral
balance
string
required

Base-unit balance as a string.