Native Meta Transaction

Send your transaction without paying gas fee using native meta transaction API. No extra signature and no Contract Wallets involved here.

Note:

Before using this API, make sure you have native meta transaction support in your smart contracts i.e., you have removed the dependency on msg.sender property from your smart contracts.

If your contracts do not support native meta transactions yet, check out How to enable native meta transactions in your smart contracts.

post
/api/v1/meta-tx/native

https://api.biconomy.io/api/v1/meta-tx/native
API lets you relay the transaction directly to your smart contract without having to pay the transaction fee by the user. Just register your DApp on the developer dashboard, upload your smart contracts and select your methods in which you want to enable native meta transaction support
Request
Response
Request
Headers
x-api-key
required
string
API key present on the dashboard for your DApp after DApp registration. This is specific to DApp registered.
Body Parameters
apiId
required
string
API id corresponding to the method you want to call in your smart contract. It can be found on the dashboard under 'Manage APIs' section.
params
required
array
Array of all the parameters required to call the method in the same order they appear in your Smart Contract.
userAddress
required
string
User client wallet public address who is supposed to be sending the transaction eg. metamask wallet address or portis wallet address.
gasPrice
optional
string
Gas price to be set in the transaction. It can be a decimal number or hexadecimal string. If omitted current gas price from the network will be set in the transaction.
gasLimit
optional
string
Gas limit to be set in the transaction. It can be a decimal number or hexadecimal string. If omitted web3 estimateGas method will be used to calculate the gasLimit for the transaction.
Response
200: OK
Transaction successfully sent.
{
"txHash": "0x84bc6f25b964f794f90c59b4f97a16aadc878ce53187703124b5e0ee52e15af9",
"log": "Meta transaction sent to blockchain",
"flag": 200
}
404: Not Found
Required Data not found
{
"log": "Api does not exist",
"flag": 404
}
500: Internal Server Error
Method call is invalid
{
"log": "Error while executing Blockchain Transactions",
"error": "Error: Invalid number of parameters for \"methodName\". Got 1 expected 0!",
"flag": 500
}

Example Curl Request

curl --request POST 'https://api.biconomy.io/api/v1/meta-tx/native' --header 'x-api-key: <api_key_from_dashboard>' --header 'Content-Type: application/json' --data-raw '{ "userAddress": "<user_public_address>", "apiId": "<api_id_from_dashboard>", "params": [<param1>,<param2>,...... ], "gasLimit":"0xF4240", "gasPrice":"0x3D0900" }'