Get Protocol Config using userId and ChainId
The "Get Protocol Config" API endpoint provided by Krypcore allows users to retrieve protocol configurations under a given instance based on the provided user ID and Chain ID.
API Specification
Get Protocol Config
POST https://api.krypcore.com/api/v0/gasless/getProtocolConfig/userIdAndChainId
Get Protocol Config under the given instance.
Headers
Name
Type
Description
Authorization*
String
User Auth key obtained
Request Body
Name
Type
Description
chainId*
String
Chain ID representing the blockchain protocol
dAppId*
String
Dapp ID associated with the application.
{
"data": null,
"message": "fetched protocol and gas config details",
"status": true
}Take a look at how you might call this method using our official libraries, or via curl
curl --location 'https://web3-proxy-dev.krypcore.com/api/v0/gasless/getProtocolConfig/userIdAndChainId' \
--header 'Authorization: 81d4a427-xxxx-xxxx-xxxx-f8482816e872' \
--header 'Content-Type: application/json' \
--data '{"userId":"DEV_GSTE_75_xxxxxxxx","chainId":80001}
'var myHeaders = new Headers();
myHeaders.append("Authorization", "81d4a427-xxxx-xxxx-xxxx-f8482816e872");
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"userId": "DEV_GSTE_75_xxxxxxxx",
"chainId": 80001
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://web3-proxy-dev.krypcore.com/api/v0/gasless/getProtocolConfig/userIdAndChainId", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));import requests
import json
url = "https://web3-proxy-dev.krypcore.com/api/v0/gasless/getProtocolConfig/userIdAndChainId"
payload = json.dumps({
"userId": "DEV_GSTE_75_xxxxxxxx",
"chainId": 80001
})
headers = {
'Authorization': '81d4a427-xxxx-xxxx-xxxx-f8482816e872',
'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://web3-proxy-dev.krypcore.com/api/v0/gasless/getProtocolConfig/userIdAndChainId"
method := "POST"
payload := strings.NewReader(`{"userId":"DEV_GSTE_75_xxxxxxxx","chainId":80001}`+"
"+`
`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "81d4a427-xxxx-xxxx-xxxx-f8482816e872")
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))
}Last updated
Was this helpful?