Get Contract Metadata
Overview
The Get Contract Metadata endpoint gathers fundamental metadata associated with a specific ERC-20 contract, which is a required path parameter.
A successful request to the endpoint will return a JSON response containing metadata
for a particular ERC-20 contract, which will include fields such as total_supply_raw
,
total_supply_calculated
, and estimated_usd_price
.
📘️
The current calculation of total supply relies on transfers to
and from
the zeroth address.
This method might not yield accurate results for tokens with unique minting mechanics, such as USDT
or BNB.
Usage
The request below can give you the gist of how the endpoint operates looking up the PRQ contract's metadata.
import * as Parsiq from '@parsiq/parsiq.js';
const client = Parsiq.createClient(process.env.API_KEY, Parsiq.ChainId.ETH_MAINNET);
const metadata = await client.balances.getContractMetadata(`0x362bc847A3a9637d3af6624EeC853618a43ed7D2`);
console.log(metadata)
Output:
{
address: '0x362bc847A3a9637d3af6624EeC853618a43ed7D2',
symbol: 'PRQ',
name: 'Parsiq Token',
decimals: 18,
total_supply_raw: '310256872000000000000000000',
total_supply_calculated: '310256872',
estimated_usd_price: null
}
Parameters
Path params
chainId
string
REQUIRED
version
string
REQUIRED
contract
string
REQUIRED
Query params
estimate_cu
boolean