Biconomy SDK (Mexa), enables meta transactions or gasless transactions in your DApp out of the box.
It works alongside your existing Web3 library by acting as a Web3 provider that submits meta transactions to our relayer infrastructure - instead of directly to the network.
Get your API Key First
In order to integrate SDK, you will need an API Key. Check out how to get API key from the dashboard.
SDK Frontend Integration
1. Installing and importing SDK
Since mexa fetches data from Biconomy server in order to serve better. It's better to initialize your DApp or perform any action after the biconomy.READY event.
Or if there is some error while initializing Mexa, it's better to catch and log biconomy.ERROR event for better debugging.
// Initialize your dapp here like getting user accounts etc
// Handle error while initializing mexa
4. Call ExecuteMetaTransaction Method
Since we have enabled native meta transaction in a custom way, instead of calling your smart contract methods directly, we will call executeMetaTransaction method and pass the target method info as a parameter to this function.