# Sign and Submit Gasless Transaction

This Sign and Submit Gasless Transaction using this method.&#x20;

## API Specification

## Sign and Submit Gasless Transaction

<mark style="color:green;">`POST`</mark> `http://localhost:8888/wallet/signAndSubmitGaslessTxn`

Sign and Submit Gasless Transaction under the given instance.&#x20;

#### Headers

| Name                                            | Type   | Description      |
| ----------------------------------------------- | ------ | ---------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Authorization id |

#### Request Body

| Name                                          | Type   | Description                                            |
| --------------------------------------------- | ------ | ------------------------------------------------------ |
| to<mark style="color:red;">\*</mark>          | String | The recipient's address                                |
| walletId<mark style="color:red;">\*</mark>    | String | The ID of the wallet.                                  |
| userId<mark style="color:red;">\*</mark>      | String | The user's ID                                          |
| method<mark style="color:red;">\*</mark>      | String | The method for the transaction                         |
| contractABI<mark style="color:red;">\*</mark> | String | The Application Binary Interface (ABI) of the contract |
| dappId<mark style="color:red;">\*</mark>      | String | Dapp Id                                                |
| chainId<mark style="color:red;">\*</mark>     | String | Chain Id                                               |
| params<mark style="color:red;">\*</mark>      |        | Additional parameters for the transaction              |

Take a look at how you might call this method using our official libraries, or via `curl`:

{% tabs %}
{% tab title="curl" %}

```bash
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": []
}'

```

{% endtab %}

{% tab title="Node.js (Fetch)" %}

```javascript
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);
  });

```

{% endtab %}

{% tab title="Python " %}

```python
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)

```

{% endtab %}

{% tab title="Golang" %}

```go
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)
}

```

{% endtab %}
{% endtabs %}
