This Sign and Submit Gasless Transaction using this method.
Sign and Submit Gasless Transaction
Sign and Submit Gasless Transaction under the given instance.
Take a look at how you might call this method using our official libraries, or via curl
:
curl --location 'http://localhost:8888/wallet/signAndSubmitGaslessTxn' \
--header 'Authorization: xxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"walletId": "aaad6fb4-0d6d-xxxxxxxxxxxxxxxxxxx",
"dAppId": "DEV_TEST_XENO_xxxxxxxxxxxxxx",
"chainId": 80001,
"to": "0x0E762313219aE4dD7xxxxxxxxxxxxxxxxxxxxxxxx",
"userId": "DEV_XENO_xxxxxxxxxxxxxxx",
"contractAbi": "",
"method": "mintNFT",
"params": []
}'
const axios = require('axios');
const url = 'http://localhost:8888/wallet/signAndSubmitGaslessTxn';
const data = {
walletId: 'aaad6fb4-0d6d-xxxxxxxxxxxxxxxxxxx',
dAppId: 'DEV_TEST_XENO_xxxxxxxxxxxxxx',
chainId: 80001,
to: '0x0E762313219aE4dD7xxxxxxxxxxxxxxxxxxxxxxxx',
userId: 'DEV_XENO_xxxxxxxxxxxxxxx',
contractAbi: '',
method: 'mintNFT',
params: [],
};
const config = {
headers: {
'Authorization': 'xxxxxxxxxxx',
'Content-Type': 'application/json',
},
};
axios.post(url, data, config)
.then(response => {
console.log('Response:', response.data);
})
.catch(error => {
console.error('Error:', error);
});
import requests
url = 'http://localhost:8888/wallet/signAndSubmitGaslessTxn'
headers = {
'Authorization': 'xxxxxxxxxxx',
'Content-Type': 'application/json',
}
data = {
'walletId': 'aaad6fb4-0d6d-xxxxxxxxxxxxxxxxxxx',
'dAppId': 'DEV_TEST_XENO_xxxxxxxxxxxxxx',
'chainId': 80001,
'to': '0x0E762313219aE4dD7xxxxxxxxxxxxxxxxxxxxxxxx',
'userId': 'DEV_XENO_xxxxxxxxxxxxxxx',
'contractAbi': '',
'method': 'mintNFT',
'params': [],
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 200:
print('Response:', response.json())
else:
print('Error:', response.text)
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "http://localhost:8888/wallet/signAndSubmitGaslessTxn"
payload := []byte(`{
"walletId": "aaad6fb4-0d6d-xxxxxxxxxxxxxxxxxxx",
"dAppId": "DEV_TEST_XENO_xxxxxxxxxxxxxx",
"chainId": 80001,
"to": "0x0E762313219aE4dD7xxxxxxxxxxxxxxxxxxxxxxxx",
"userId": "DEV_XENO_xxxxxxxxxxxxxxx",
"contractAbi": "",
"method": "mintNFT",
"params": []
}`)
req, err := http.NewRequest("POST", url, bytes.NewBuffer(payload))
if err != nil {
fmt.Println("Error creating HTTP request: ", err)
return
}
req.Header.Set("Authorization", "xxxxxxxxxxx")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request: ", err)
return
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}