Submitting a native transaction request
This method allows you to send a native transaction request.
Before requesting a transaction, ensure that you encode the value in hexadecimal format.
const amountToSend = BigInt("10000000000000000"); //0.1 NATIVE TOKEN (ETH/BNB/AVAX etc)
const value = "0x" + amountToSend.toString(16)
You also need to add the necessary parameters before requesting a transaction.
const from = userAddress //the address you're sending from (connected users address)
const to = "0x0000000000000000000000000000000000000000" // the address you're sending the transaction to
const data = "0x" // the data which is always 0x when sending a native transaction
Next, create the transaction object
const tx = {
from,
to,
data,
value,
},
Finally, obtain the chain ID, which can be found at the following URL: (https://chainlist.org)
const chainId = 1; // ETH chain id
POST
https://api.alturanft.com/api/alturaguard/request
Request Body
Name
Type
Description
token*
String
User token recieved when authenticating
reqParameters*
array
["transaction", tx, chainId]
requestId
Last updated