Get summary for the token contract
Returns the total number of unique addresses holding balances and the total supply for the specified contract.
GET
/
onchain_data
/
base_asset_id
/
{baseAssetId}
/
contract_address
/
{contractAddress}
/
summary
TypeScript
const response: Promise<FireblocksResponse<TokenContractSummaryResponse>> = fireblocks.onchainData.getContractBalancesSummary(onchainDataApiGetContractBalancesSummaryRequest);CompletableFuture<ApiResponse<TokenContractSummaryResponse>> response = fireblocks.onchainData().getContractBalancesSummary(baseAssetId, contractAddress);response = fireblocks.onchain_data.get_contract_balances_summary(base_asset_id, contract_address);curl --request GET \
--url https://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summaryconst options = {method: 'GET'};
fetch('https://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summary', 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://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summary",
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://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summary"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summary")
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{
"baseAssetId": "ETH",
"contractAddress": "0x1234567890123456789012345678901234567890",
"totalAddresses": 150,
"totalSupply": "1000000000000000000000"
}{
"message": "<string>",
"code": 123
}Path Parameters
The blockchain base assetId
The contract address
Response
Successfully retrieved the summary for the token contract
The base asset ID
Example:
"ETH"
The contract address
Example:
"0x1234567890123456789012345678901234567890"
Total number of addresses with balances
Example:
150
The total supply of the token
Example:
"1000000000000000000000"
Was this page helpful?
⌘I
TypeScript
const response: Promise<FireblocksResponse<TokenContractSummaryResponse>> = fireblocks.onchainData.getContractBalancesSummary(onchainDataApiGetContractBalancesSummaryRequest);CompletableFuture<ApiResponse<TokenContractSummaryResponse>> response = fireblocks.onchainData().getContractBalancesSummary(baseAssetId, contractAddress);response = fireblocks.onchain_data.get_contract_balances_summary(base_asset_id, contract_address);curl --request GET \
--url https://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summaryconst options = {method: 'GET'};
fetch('https://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summary', 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://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summary",
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://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summary"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/onchain_data/base_asset_id/{baseAssetId}/contract_address/{contractAddress}/summary")
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{
"baseAssetId": "ETH",
"contractAddress": "0x1234567890123456789012345678901234567890",
"totalAddresses": 150,
"totalSupply": "1000000000000000000000"
}{
"message": "<string>",
"code": 123
}