import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("YOUR_API_KEY");
const resp = await client.BalanceService.getHistoricalBitcoinBalanceForWalletAddress({chainName: "chainName", walletAddress: "walletAddress"});
console.log(resp.data);
};
ApiServices();{
"address": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"quote_currency": "<string>",
"chain_id": 123,
"chain_name": "<string>",
"chain_tip_height": 123,
"chain_tip_signed_at": "2023-11-07T05:31:56Z",
"items": [
{
"contract_decimals": 123,
"contract_name": "<string>",
"contract_ticker_symbol": "<string>",
"contract_address": "<string>",
"supports_erc": [
"<string>"
],
"logo_url": "<string>",
"block_height": 123,
"last_transferred_block_height": 123,
"contract_display_name": "<string>",
"last_transferred_at": "2023-11-07T05:31:56Z",
"native_token": true,
"type": "<string>",
"is_spam": true,
"balance": "<string>",
"quote_rate": 123,
"quote": 123,
"pretty_quote": "<string>",
"protocol_metadata": {
"protocol_name": "<string>"
},
"nft_data": [
{
"token_id": "<string>",
"token_balance": "<string>",
"token_url": "<string>",
"supports_erc": [
"<string>"
],
"token_price_wei": "<string>",
"token_quote_rate_eth": "<string>",
"original_owner": "<string>",
"external_data": {
"name": "<string>",
"description": "<string>",
"image": "<string>",
"image_256": "<string>",
"image_512": "<string>",
"image_1024": "<string>",
"animation_url": "<string>",
"external_url": "<string>",
"attributes": [
{
"trait_type": "<string>",
"value": "<string>"
}
],
"thumbnails": {
"image_256": "<string>",
"image_512": "<string>",
"image_1024": "<string>",
"image_opengraph_url": "<string>",
"thumbhash": "<string>"
},
"image_preview": "<string>",
"asset_properties": {
"asset_width": 123,
"asset_height": 123,
"dominant_color": "<string>"
},
"owner": "<string>"
},
"owner": "<string>",
"owner_address": "<string>",
"burned": true
}
]
}
]
}Commonly used to fetch the historical Bitcoin balance held by an address at a given block height or date. Response includes daily prices and other metadata.
import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("YOUR_API_KEY");
const resp = await client.BalanceService.getHistoricalBitcoinBalanceForWalletAddress({chainName: "chainName", walletAddress: "walletAddress"});
console.log(resp.data);
};
ApiServices();{
"address": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"quote_currency": "<string>",
"chain_id": 123,
"chain_name": "<string>",
"chain_tip_height": 123,
"chain_tip_signed_at": "2023-11-07T05:31:56Z",
"items": [
{
"contract_decimals": 123,
"contract_name": "<string>",
"contract_ticker_symbol": "<string>",
"contract_address": "<string>",
"supports_erc": [
"<string>"
],
"logo_url": "<string>",
"block_height": 123,
"last_transferred_block_height": 123,
"contract_display_name": "<string>",
"last_transferred_at": "2023-11-07T05:31:56Z",
"native_token": true,
"type": "<string>",
"is_spam": true,
"balance": "<string>",
"quote_rate": 123,
"quote": 123,
"pretty_quote": "<string>",
"protocol_metadata": {
"protocol_name": "<string>"
},
"nft_data": [
{
"token_id": "<string>",
"token_balance": "<string>",
"token_url": "<string>",
"supports_erc": [
"<string>"
],
"token_price_wei": "<string>",
"token_quote_rate_eth": "<string>",
"original_owner": "<string>",
"external_data": {
"name": "<string>",
"description": "<string>",
"image": "<string>",
"image_256": "<string>",
"image_512": "<string>",
"image_1024": "<string>",
"animation_url": "<string>",
"external_url": "<string>",
"attributes": [
{
"trait_type": "<string>",
"value": "<string>"
}
],
"thumbnails": {
"image_256": "<string>",
"image_512": "<string>",
"image_1024": "<string>",
"image_opengraph_url": "<string>",
"thumbhash": "<string>"
},
"image_preview": "<string>",
"asset_properties": {
"asset_width": 123,
"asset_height": 123,
"dominant_color": "<string>"
},
"owner": "<string>"
},
"owner": "<string>",
"owner_address": "<string>",
"burned": true
}
]
}
]
}Bearer authentication header of the form: Bearer <token>, where <token> is your GoldRush API Key.
Only Bitcoin non-HD addresses are supported.
The currency to convert. Supports USD, CAD, EUR, SGD, INR, JPY, VND, CNY, KRW, RUB, TRY, NGN, ARS, AUD, CHF, and GBP.
Ending block to define a block range. Omitting this parameter defaults to the latest block height.
Ending date to define a block range (YYYY-MM-DD). Omitting this parameter defaults to the current date.
Successful response
The requested address.
The timestamp when the response was generated. Useful to show data staleness to users.
The requested quote currency eg: USD.
The requested chain ID eg: 1.
The requested chain name eg: eth-mainnet.
The latest block height of the blockchain at the time this response was provided.
The timestamp of the latest signed block at the time this response was provided.
List of response items.
Show child attributes
Use contract decimals to format the token balance for display purposes - divide the balance by 10^{contract_decimals}.
The string returned by the name() method.
The ticker symbol for this contract. This field is set by a developer and non-unique across a network.
Use the relevant contract_address to lookup prices, logos, token transfers, etc.
A list of supported standard ERC interfaces, eg: ERC20 and ERC721.
The contract logo URL.
The height of the block.
The block height when the token was last transferred.
The timestamp when the token was transferred.
Indicates if a token is the chain's native gas token, eg: ETH on Ethereum.
One of cryptocurrency, stablecoin, nft or dust.
Denotes whether the token is suspected spam.
b;The asset balance. Use contract_decimals to scale this balance for display purposes.
The exchange rate for the requested quote currency.
The current balance converted to fiat in quote-currency.
A prettier version of the quote for rendering purposes.
NFT-specific data.
Show child attributes
b;The token's id.
b;The count of the number of NFTs with this ID.
External URL for additional metadata.
A list of supported standard ERC interfaces, eg: ERC20 and ERC721.
b;The latest price value on chain of the token ID.
The latest quote_rate of the token ID denominated in unscaled ETH.
The address of the original owner of this NFT.
Show child attributes
Various thumbnails of the asset.
Show child attributes
Resized 256x256 image of the asset.
Resized 512x512 image of the asset.
Resized 1024x1024 image of the asset.
Resized image of the asset for OpenGraph.
Base64 encoded hash of the thumbnail.
The image preview URL.
The asset properties.
The current owner of this NFT.
The address of the current owner of this NFT.
When set to true, this NFT has been Burned.