Biconomy Gasless SDK (EOA)
DashboardMediumWebsite
  • 🚀Getting Started
  • Introduction
    • 🤘Why Biconomy?
    • 🙂How we simplify transactions
  • Products
    • 💸Gasless Transactions
      • Choose An Approach to Enable Gasless
        • Standard EIP 2771 Approach
          • 1. Register Artifacts on the Dashboard
          • 2. Code Changes
            • Using SDK
            • Using API
        • Custom Implementation Approach
          • 1. Register Artifacts on the Dashboard
          • 2. Code Changes
            • Using SDK
            • Using API
        • Smart Contract Wallet Approach
          • Gnosis
        • Network Agnostic Transactions
          • EIP-2771 Approach
          • Custom Approach
      • Conditional Whitelisting
      • Gasless SDK (EOA) 3
      • Networks Supported
    • ↔️Hyphen - Instant Cross-Chain Transfers
      • SDK
        • DepositManager
        • TransferManager
        • TokenManager
      • APIs
      • Helper Methods
      • Migrating from Hyphen V1
      • Contract Addresses
      • Hyphen Widget
  • Guides
    • 💻Dashboard
      • DApp Statistics
    • ⛽Gas Tank Deposits
      • Via Dashboard
      • Via Smart Contract
  • api
    • 🔧Native Meta Transaction
      • Get Retried Hashes
    • 🌎Dashboard APIs
    • ⚪Whitelist API
      • Whitelist Destination Address
      • Whitelist Proxy Contracts
    • 〰️ Check Limits
    • 💿Biconomy Data API
      • 👨‍🚀Unique User Data
      • 🧑‍🔧Per User Limits Data
      • ⛽Gas Tank Balance Data
  • SDK
    • 📙Gasless SDK (EOA)
      • Configuration
  • Tutorials
    • 🔰Native Meta Transactions
      • How To Build Your First DApp
        • Write Your First Smart Contract
        • Initialize Web3 on Client Side
        • Executing First Blockchain Transaction
      • Enable Native Meta Transactions
        • Smart Contract
          • Describe Your Structs
          • Declare Your Variables
          • Modify Respective Function
        • Client Side
          • Design Your JSON structure
          • Design Your Domain Separator
          • Design Data Types
          • Define Data To Sign
          • Generate Signatures
      • Integrate Biconomy
        • Register On Dashboard
        • Integrate Gasless SDK (EOA)
      • Summary
  • BICO Staking
    • 🪁Safety Module
  • Get in touch
    • 👥Contact Us
  • Misc
    • 🧩Projects on Biconomy
    • 🌐Supported Networks
    • 📫Contract Addresses
    • ✔︎ Smart Contracts Audit
    • ❓FAQs
Powered by GitBook
On this page
  • Generate AUTH token
  • API to create a new dapp
  • API to add a new smart contract for a given dapp
  • API to delete a smart contract from dashboard for a given dapp
  • API to add a method for a given dapp and smart contract address
  • API to delete a method for a given dapp and smart contract address
  • You can register webhooks (post and get API calls) which would be executed before sending a transaction.
  • In case you want to activate or deactivate your current webhook
  • Dashboard APIs from backend
  • Adding a Dapp
  • Adding a smart contract
  • Deleting a smart contract
  • Adding a meta API
  • Deleting a meta API
  • Registering A Webhook
  • Updating A Webhook

Was this helpful?

  1. api

Dashboard APIs

Using these APIs you can perform actions that you can do on dashboard UI like creating or deleting smart contracts or a method of the contract without manually accessing the dashboard.

PreviousGet Retried HashesNextWhitelist API

Last updated 2 years ago

Was this helpful?

Generate AUTH token

  1. Register & Login to

  2. Go to the "Account" tab on left menu to view your Auth Token.

  3. You can regenerate you Auth Token by clicking on the Regenerate Token button.

API to create a new dapp

POST https://api.biconomy.io/api/v1/dapp/public-api/create-dapp

API lets you create a new dapp. Using the authToken generated from the Account section, one can add create a new dapp for given network id.

Headers

Name
Type
Description

authToken

string

Token unique to every user account

Request Body

Name
Type
Description

dappName*

String

Name of the dapp you want to set

networkId

String

Network id on which you want to register your dapp on

enableBiconomyWallet

String

Can be set as 'true' or 'false' is you want Biconomy Wallet feature (for SDK version 2.0.38)

{
  code: 200,
  message: 'Dapp registered successfully',
  data: {
    apiKey: 'UxTyLRqlJ.1cb6b15c-6351-4f30-9a56-30d7b143d167', // apiKey is used to init biconomy instance to relay transactions for this Dapp
    fundingKey: 1655702620000 // This funding key can be used to recharge gas tank 
  }
}
{ code: 401, message: 'Failure in authentication', responseCode: 401 }
{ code: 500, message: 'Something went wrong', responseCode: 500 }

API to add a new smart contract for a given dapp

POST https://api.biconomy.io/api/v1/smart-contract/public-api/addContract

API lets you add a new smart contract to an already registered dapp. Using the authToken generated from the Account section and the apiKey of a dapp, one can add a new smart contract for that dapp.

Headers

Name
Type
Description

authToken*

string

Token unique to every user account

apiKey*

string

Api Key unique to every dapp

Request Body

Name
Type
Description

contractName*

string

Name of the smart contract

contractAddress*

string

Address of the smart contract

abi*

string

Abi of the smart contract

contractType*

string

"SC" or "SCW" if it is a Smart Contract or Smart Contract Wallet

walletType*

string

For contractType "SCW", walletType is "GNOSIS", otherwise leave blank.

metaTransactionType*

string

"DEFAULT", "TRUSTED_FORWARDER", "ERC20_FORWARDER" based on type of meta transaction

{ "code" : 200, "message" : "SmartContract registered successfull", "responseCode" : 200 }
{ "code" : 400, "message" : "Enter valid abi (contract address)", responseCode : 400 }
{ "code" : 401, "message" : "Failure in authentication", "responseCode" 401 }
{ "code" : 144, "message" : "User Does Not Exist", responseCode: 143 }
{ "code" : 406, "message" : "Only one Smart Contract Wallet is allowed per Dapp", "responseCode" : 406 }
{ "code" : 409, "message" : "SmartContract already exists", "responseCode" : 409 }

API to delete a smart contract from dashboard for a given dapp

DELETE https://api.biconomy.io/api/v1/smart-contract/public-api/deleteContract

API lets you delete a smart contract. Using the authToken generated from the Account section and the apiKey of a dapp, one can delete a smart contract of that dapp.

Headers

Name
Type
Description

authToken*

string

Token unique to every user

apiKey*

string

Api Key unique to every dapp

Request Body

Name
Type
Description

contractType*

string

SC/SCW

contractAddress*

string

Address of the smart contract

{ "code" : 143, "message" : "Contract removed successfully", "responseCode": 143 }
{ "code" : 401, "message" : "Failure in authentication", "responseCode" 401 }
{ "code" : 144, "message" : "User Does Not Exist", responseCode: 143 }

API to add a method for a given dapp and smart contract address

POST https://api.biconomy.io/api/v1/meta-api/public-api/addMethod

Using the authToken generated from the Account section and the apiKey of a dapp and API lets you add a contract method of an already registered smart-contract.

Headers

Name
Type
Description

authToken*

string

Token unique to every user account

apiKey*

string

Api Key unique to every dapp

Request Body

Name
Type
Description

apiType*

string

native/custom

methodType*

string

"read"/"write" based on the method type

name*

string

Placeholder name

contractAddress*

string

contract address

method*

string

Method name on smart contract

{
  "code": 200,
  "message": "Api registered successfully",
  "apiIds": [
    {
      "apiId": "xxxdf764-13a9-4adc-9181-4db4bexxxxxx",
      "method": "setQuote",
      "name": "setQuote"
    }
  ]
}
{ "code" : 144, "message" : "Verify your email first", "responseCode" : 144 }
{ "code" : 401, "message" : "Failure in authentication", "responseCode" 401 }
{ "code" : 144, "message" : "Api name already exists", responseCode : 144 }

API to delete a method for a given dapp and smart contract address

DELETE https://api.biconomy.io/api/v1/meta-api/public-api/addMethod

Using authToken and the apiKey of a dapp and the contract address of a smart contract, API lets you delete an already registered method from the dashboard.

Headers

Name
Type
Description

authToken*

string

Token unique to every user account

apiKey*

string

Api-Key unique to every dapp

Request Body

Name
Type
Description

contractAddress*

string

Address of the smart contract

method*

string

Method name on the smart contract

{ "code": 143, "message" : "Api removed successfully", "responseCode" : 143 }
{ "code" : 401, "message" : "Failure in authentication", "responseCode" 401 }

You can register webhooks (post and get API calls) which would be executed before sending a transaction.

POST https://api.biconomy.io/api/v1/dapp/register-webhook

If webhook returns true the transaction goes through and in case of false the transaction fails.

Headers

Name
Type
Description

authToken*

String

Token unique to every user account

apiKey*

String

Api-Key unique to every dapp

Request Body

Name
Type
Description

webHook*

String

webHook url

requestType*

String

post/get

{
  code: 200,
  message: 'WebHook data: <YOUR WEBHOOK> saved for dappId: 62ea418f2945e82d28dc5d26 with webHookId: 0c225d23-cc1e-49cd-9d3d-0740962bc97d',
  responseCode: 200,
  data: { webHookId: '0c225d23-cc1e-49cd-9d3d-0740962bc97d' }
}
{ "code" : 401, "message" : "Failure in authentication", "responseCode" 401 }
{ code: 500, message: 'Something went wrong', responseCode: 500 }

In case you want to activate or deactivate your current webhook

PATCH https://api.biconomy.io/api/v1/dapp/update-webhook

Headers

Name
Type
Description

authToken*

String

Token unique to every user account

apiKey*

String

Api-Key unique to every dapp

Request Body

Name
Type
Description

webHookId*

String

webHookId that you got while registering your webHook

active*

String

'true' or 'false'

{
  code: 200,
  message: 'WebHook: <YOUR WEBHOOK> set to false for dappId: 62ea418f2945e82d28dc5d26 with webHookId: d9a6e587-0fea-4e06-a1ea-bce0e5b9c410',
  responseCode: 200
}
{ "code" : 401, "message" : "Failure in authentication", "responseCode" 401 }
{ code: 500, message: 'Something went wrong', responseCode: 500 }

Dashboard APIs from backend

Adding a Dapp

const fetch = require("node-fetch");
const authToken = <AUTH Token to be generated from dashboard>;
const apiKey = <Dapp's API Key>;
const url = "https://api.biconomy.io/api/v1/dapp/public-api/create-dapp";

let formData = new URLSearchParams({
  "dappName" : "dapp-test-2",
  "networkId" : "80001",
  "enableBiconomyWallet": true 
 })

 const requestOptions = {
  method: 'POST',
  headers: {  "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken },
  body: formData
};

fetch(url, requestOptions)
.then(response => response.json())
.then(data => console.log(data))     
.catch(error => console.error('Error:', error));

Adding a smart contract

const fetch = require("node-fetch");
const authToken = <AUTH Token to be generated from dashboard>;
const apiKey = <Dapp's API Key>;
const url = "https://api.biconomy.io/api/v1/smart-contract/public-api/addContract";
    
var abi = JSON.stringify(<Add your contract's ABI>);
    
var formData = new URLSearchParams({
  "contractName" : "<contract name>",
  "contractAddress" : "<contract address>",
  "abi" : abi,
  "contractType" : "<contract type>",
  "metaTransactionType": "<meta transaction type>"
});
 
 
 const requestOptions = {
  method: 'POST',
  headers: {  "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey },
  body: formData
};


fetch(url, requestOptions)
  .then(response => response.json())
  .then(data => console.log(data))     
  .catch(error => console.error('Error:', error));

Deleting a smart contract

const fetch = require("node-fetch");
const authToken = <AUTH Token to be generated from dashboard>;
const apiKey = <Dapp's API Key>;
const url = "https://api.biconomy.io/api/v1/smart-contract/public-api/deleteContract";
        
var formData = new URLSearchParams({
  "contractAddress" : "<contract address>",
  "contractType" : "<contract type>",
});
 
 
 const requestOptions = {
  method: 'DELETE',
  headers: {  "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey },
  body: formData
};

fetch(url, requestOptions)
  .then(response => response.json())
  .then(data => console.log(data))     
  .catch(error => console.error('Error:', error));

Adding a meta API

const fetch = require("node-fetch");
const authToken = <AUTH Token to be generated from dashboard>;
const apiKey = <Dapp's API Key>;
const url = "https://api.biconomy.io/api/v1/meta-api/public-api/addMethod";
    
let formData = new URLSearchParams({
  "apiType" : "<native/custom>",
  "methodType" : "<read/write>",
  "name": "<placeholder name for the method>",
  "contractAddress" : "<contract address>",
  "method" : "<contract's method name>"
 })

const requestOptions = {
  method: 'POST',
  headers: {  "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey },
  body: formData
};

fetch(url, requestOptions)
  .then(response => response.json())
  .then(data => console.log(data))     
  .catch(error => console.error('Error:', error));

Deleting a meta API

const fetch = require("node-fetch");
const authToken = <AUTH Token to be generated from dashboard>;
const apiKey = <Dapp's API Key>;
const url = "https://api.biconomy.io/api/v1/meta-api/public-api/deleteMethod";
    
let formData = new URLSearchParams({
  "contractAddress" : "<contract address>",
  "method" : "<contract's method name>"
 })

const requestOptions = {
  method: 'DELETE',
  headers: {  "Content-Type": "application/x-www-form-urlencoded", "authToken": authToken, "apiKey" : apiKey },
  body: formData
};

fetch(url, requestOptions)
  .then(response => response.json())
  .then(data => console.log(data))     
  .catch(error => console.error('Error:', error));

Registering A Webhook

const fetch = require("node-fetch");
const authToken = <AUTH Token to be generated from dashboard>;
const apiKey = <Dapp's API Key>;
const url = "https://api.biconomy.io/api/v1/dapp/register-webhook";

let formData = new URLSearchParams({
  "webHook" : "https://2j6v8c5ee6.execute-api.ap-south-1.amazonaws.com/v0/check",
  "requestType" : "post", // post or get
 })

 const requestOptions = {
  method: 'POST',
  headers: {  "Content-Type": "application/x-www-form-urlencoded", "authToken": '8ee71107-5ce2-4eba-8978-fe51df4bdce2', "apiKey": 'iMVt-8yws.b303c5bd-b405-4e1b-ac66-d1d6d40001b2' },
  body: formData
};

fetch(url, requestOptions)
 .then(response => response.json())
 .then(data => console.log(data))     
 .catch(error => console.error('Error:', error));

Updating A Webhook

const fetch = require("node-fetch");
const authToken = <AUTH Token to be generated from dashboard>;
const apiKey = <Dapp's API Key>;
const url = "https://api.biconomy.io/api/v1/dapp/update-webhook";

let formData = new URLSearchParams({
  "webHookId" : "d9a6e587-0fea-4e06-a1ea-bce0e5b9c410",
  "active": "false"
 })

 const requestOptions = {
  method: 'PATCH',
  headers: {  "Content-Type": "application/x-www-form-urlencoded", "authToken": '8ee71107-5ce2-4eba-8978-fe51df4bdce2', "apiKey": 'iMVt-8yws.b303c5bd-b405-4e1b-ac66-d1d6d40001b2' },
  body: formData
};

fetch(url, requestOptions)
 .then(response => response.json())
 .then(data => console.log(data))     
 .catch(error => console.error('Error:', error));
🌎
https://dashboard-gasless.biconomy.io/