This API allows you to add a whitelisted contract linked to a decentralized application (DApp) within a specified instance
Add Whitelisted Contract Linked to DApp
Add Whitelisted Contract Linked to DApp under the given instance.
{
"data": null,
"message": "Whitelisted contract created successfully",
"status": true
}
{
"message": "Invalid API key in request"
}
Take a look at how you might call this method using our official libraries, or via curl
curl --location 'https://api.krypcore.com/api/v0/gasless/addWhitelistedContractLinkedToDApp' \
--header 'Authorization: 03374415-xxxx-xxxx-xxxx-1277d243034e' \
--header 'Content-Type: application/json' \
--data '{
"contractAddress": "0x5443702dd8eb3e26c31a20b81fcfd292cfxxxxxx",
"contractName": "demo",
"linkedDAppId": "DEV_DEMO_PACE_46_xxxxxxxx",
"gasLimitConfigured": 0.5,
"chainId": 80001
}'
var myHeaders = new Headers();
myHeaders.append("Authorization", "03374415-xxxx-xxxx-xxxx-1277d243034e");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"contractAddress": "0x5443702dd8eb3e26c31a20b81fcfd292cfxxxxxx",
"contractName": "demo",
"linkedDAppId": "DEV_DEMO_PACE_46_xxxxxxxx",
"gasLimitConfigured": 0.5,
"chainId": 80001
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.krypcore.com/api/v0/gasless/addWhitelistedContractLinkedToDApp", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
import requests
import json
url = "https://api.krypcore.com/api/v0/gasless/addWhitelistedContractLinkedToDApp"
payload = json.dumps({
"contractAddress": "0x5443702dd8eb3e26c31a20b81fcfd292cfxxxxxx",
"contractName": "demo",
"linkedDAppId": "DEV_DEMO_PACE_46_xxxxxxxx",
"gasLimitConfigured": 0.5,
"chainId": 80001
})
headers = {
'Authorization': '03374415-xxxx-xxxx-xxxx-1277d243034e',
'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/gasless/addWhitelistedContractLinkedToDApp"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"contractAddress": "0x5443702dd8eb3e26c31a20b81fcfd292cfxxxxxx",`+"
"+`
"contractName": "demo",`+"
"+`
"linkedDAppId": "DEV_DEMO_PACE_46_xxxxxxxx",`+"
"+`
"gasLimitConfigured": 0.5,`+"
"+`
"chainId": 80001`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "03374415-xxxx-xxxx-xxxx-1277d243034e")
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))
}