Returns the total supply of an SPL Token type.
const response = await fetch('https://api.1inch.com/web3/501', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${API_KEY}`,
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'getTokenSupply',
params: [],
id: 1,
}),
});
const data = await response.json();
console.log(data);
{
"context": {
"slot": 1114
},
"value": {
"amount": "100000",
"decimals": 2,
"uiAmount": 1000,
"uiAmountString": "1000"
}
}