getTxAuthDataSignature
This method allows you to obtain a signature for transaction authentication data. It requires details such as chainId
, contractAbi
, contractAddress
, functionName
, args
, userAddress
, blockExpiration
, and nonce
.
Parameters
- chainId (string, required): Identifies the chain of the address. Example values:
1
,137
,80002
, etc. - contractAbi (object[], required): The ABI of the contract.
- contractAddress (string, required): The address of the contract.
- functionName (string, required): The name of the function to be called.
- args (array, required): The arguments for the function.
- userAddress (string, required): The address of the user.
- blockExpiration (integer, optional): The block number at which the signature expires.
- nonce (integer, optional): A nonce for the transaction.
Returns
A JSON object containing the signature, block expiration, and other related data.
Usage Example
const axios = require('axios');
let data = JSON.stringify({
"chainId": "1",
"contractAbi": [
{}
],
"contractAddress": "string",
"functionName": "string",
"args": [
null
],
"userAddress": "string",
"blockExpiration": 0,
"nonce": 0
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.nexera.id/customer-tx-auth-signature',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer <TOKEN>'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});