🌎
Dashboard APIs
Using these APIs one can create or delete a smart contract for a dapp. They can also create or delete a meta transaction api for a method of the contract without manually adding them on the dashboard.

Generate AUTH token

  1. 1.
    Register & Login to https://dashboard.biconomy.io/​
  2. 2.
    Go to the "Account" tab and select "Generate Token"
  3. 3.
    Copy "token" and use it in APIs to add/delete smart contract & methods
post
https://api.biconomy.io
/api/v1/smart-contract/public-api/addContract
/api/v1/smart-contract/public-api/addContract
delete
https://api.biconomy.io
/api/v1/smart-contract/public-api/deleteContract
/api/v1/smart-contract/public-api/deleteContract
post
https://api.biconomy.io
/api/v1/meta-api/public-api/addMethod
/api/v1/meta-api/public-api/addMethod
delete
https://api.biconomy.io
/api/v1/meta-api/public-api/addMethod
/api/v1/meta-api/public-api/deleteMethod
​

Dashboard APIs from backend

Adding a smart contract

1
const fetch = require("node-fetch");
2
const authToken = <AUTH Token to be generated from dashboard>;
3
const apiKey = <Dapp's API Key>;
4
const url = "https://api.biconomy.io/api/v1/smart-contract/public-api/addContract";
5
6
var abi = JSON.stringify(<Add your contract's ABI>);
7
8
var formData = new URLSearchParams({
9
"contractName" : "<contract name>",
10
"contractAddress" : "<contract address>",
11
"abi" : abi,
12
"contractType" : "<contract type>",
13
"metaTransactionType": "<meta transaction type>"
14
});
15
16
17
const requestOptions = {
18
method: 'POST',
19
headers: { "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey },
20
body: formData
21
};
22
​
23
​
24
fetch(url, requestOptions)
25
.then(response => response.json())
26
.then(data => console.log(data))
27
.catch(error => console.error('Error:', error));
Copied!

Deleting a smart contract

1
const fetch = require("node-fetch");
2
const authToken = <AUTH Token to be generated from dashboard>;
3
const apiKey = <Dapp's API Key>;
4
const url = "https://api.biconomy.io/api/v1/smart-contract/public-api/deleteContract";
5
6
var formData = new URLSearchParams({
7
"contractAddress" : "<contract address>",
8
"contractType" : "<contract type>",
9
});
10
11
12
const requestOptions = {
13
method: 'DELETE',
14
headers: { "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey },
15
body: formData
16
};
17
​
18
fetch(url, requestOptions)
19
.then(response => response.json())
20
.then(data => console.log(data))
21
.catch(error => console.error('Error:', error));
Copied!

Adding a meta API

1
const fetch = require("node-fetch");
2
const authToken = <AUTH Token to be generated from dashboard>;
3
const apiKey = <Dapp's API Key>;
4
const url = "https://api.biconomy.io/api/v1/meta-api/public-api/addMethod";
5
6
let formData = new URLSearchParams({
7
"apiType" : "<native/custom>",
8
"methodType" : "<read/write>",
9
"name": "<placeholder name for the method>",
10
"contractAddress" : "<contract address>",
11
"method" : "<contract's method name>"
12
})
13
​
14
const requestOptions = {
15
method: 'POST',
16
headers: { "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey },
17
body: formData
18
};
19
​
20
fetch(url, requestOptions)
21
.then(response => response.json())
22
.then(data => console.log(data))
23
.catch(error => console.error('Error:', error));
Copied!

Deleting a meta API

1
const fetch = require("node-fetch");
2
const authToken = <AUTH Token to be generated from dashboard>;
3
const apiKey = <Dapp's API Key>;
4
const url = "https://api.biconomy.io/api/v1/meta-api/public-api/deleteMethod";
5
6
let formData = new URLSearchParams({
7
"contractAddress" : "<contract address>",
8
"method" : "<contract's method name>"
9
})
10
​
11
const requestOptions = {
12
method: 'DELETE',
13
headers: { "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey },
14
body: formData
15
};
16
​
17
fetch(url, requestOptions)
18
.then(response => response.json())
19
.then(data => console.log(data))
20
.catch(error => console.error('Error:', error));
Copied!
Last modified 7d ago