# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.krypcore.com/dev-docs/api-reference/core-service-apis/wallet-manager/self-managed-wallet/sign-and-submit-gasless-transaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
