With this data API, one can find out the limits left for a particular user based on the values set on the dashboard
Fetches limit data for a particular user
{
"code": 200,
"message": "User limit data fetched successfully",
"responseCode": 200,
"userLimitData": {
"limitLeft": {
"signerAddress": "0x040a9cbC4453B0eeaE12f3210117B422B890C1ED",
"transactionLimitLeft": 9,
"transactionCount": 10,
"areLimitsConsumed": false,
"userTransactionLimit": 19
},
"limitType": "No of meta transactions left: 9",
"limitStartTime": 1644451200000,
"limitEndTime": 1644537600000,
"timePeriodInDays": 1
}
}
{
"code": 500,
"message": "Error while getting userLimits for dappId 61e66adf9256664fbc07c67d",
"responseCode": 500
}
{
code: 401,
message: 'Not Authorized',
responseCode: 401
}
const fetch = require("node-fetch");
const { URL, URLSearchParams } = require('url');
const authToken = "<Account's AUTH TOKEN>";
const apiKey = "<Dapp's API KEY>";
const getUserLimitsData = () => {
const url = new URL("https://data.biconomy.io/api/v1/dapp/user-limit");
const params = {
apiId : "10fc7db6-7899-4ed7-b5ec-22jd9b156640", // apiId unique to every method of a smart contract
signerAddress : "0x040a9cbC4453B0eeaE12f3210117B422B890C1ED"
}
url.search = new URLSearchParams(params).toString();
const requestOptions = {
method: 'GET',
headers: { "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey }
};
fetch(url, requestOptions)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
}
getUserLimitsData();