Number of ERC-20 token hold by an address can be found using this method. The weightage for this API is 5
Balance of an user's address can be gathered under the given instance.
{
"Data": 1000000000000000000,
"Message": "Balance fetched successfully",
"Status": "SUCCESS"
}
{
"Data": null,
"Message": "Mandatory params missing",
"Status": "FAILURE"
}
{
"message": "Missing API key found in request"
}
Take a look at how you might call this method using our official libraries, or via curl
:
curl --location --request POST 'https://api.krypcore.com/api/v0/ft-manager/balanceOf' \
--header 'Authorization: xxxxxxxxxxxxx' \
--header 'DappId: xxxxxxxxxxxxxx' \
--header 'ChainId: xxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"contractAddress":"0xa9BCB7E413FfE96575390c6F44F54607b44F030a",
"address":"0x688612BD8e65FF693070A875b6a49672502a0707"
}'
var axios = require('axios');
var data = JSON.stringify({
"contractAddress": "0xa9BCB7E413FfE96575390c6F44F54607b44F030a",
"address": "0x688612BD8e65FF693070A875b6a49672502a0707"
});
var config = {
method: 'post',
url: 'https://api.krypcore.com/api/v0/ft-manager/balanceOf',
headers: {
'Authorization': 'xxxxxxxxxxxxxx',
'DappId': 'xxxxxxxxxxxxxxxx',
'ChainId': 'xxxx',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://api.krypcore.com/api/v0/ft-manager/balanceOf"
payload = json.dumps({
"contractAddress": "0xa9BCB7E413FfE96575390c6F44F54607b44F030a",
"address": "0x688612BD8e65FF693070A875b6a49672502a0707"
})
headers = {
'Authorization': 'xxxxxxxxxxxxxxx',
'DappId': 'xxxxxxxxxxxxxxxx',
'ChainId': 'xxxx',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.krypcore.com/api/v0/ft-manager/balanceOf"
method := "POST"
payload := strings.NewReader(`{
"contractAddress":"0xa9BCB7E413FfE96575390c6F44F54607b44F030a",
"address":"0x688612BD8e65FF693070A875b6a49672502a0707"
}
`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "xxxxxxxxxxxxxxxx")
req.Header.Add("DappId", "xxxxxxxxxxxxxxxx")
req.Header.Add("ChainId", "xxxx")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}