# Sign And Submit Gasless Txn Using (Dev wallet)

The "Sign And Submit Gasless Txn Using (Dev wallet)" API endpoint provided by Krypcore allows developers to sign and submit a gasless transaction using a developer wallet.

## API Specification

## &#x20;Sign And Submit Gasless Txn&#x20;

<mark style="color:green;">`POST`</mark> `https://api.krypcore.com/api/v0/devWallet/signAndSubmitGaslessTx`

Sign And Submit Gasless Txn under the given instance.&#x20;

#### Headers

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

#### Request Body

| Name                                          | Type   | Description                                                                              |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| privateKey<mark style="color:red;">\*</mark>  | String | The private key associated with the developer wallet for signing the transaction         |
| dAppId<mark style="color:red;">\*</mark>      | String | Dapp ID associated with the application                                                  |
| chainId<mark style="color:red;">\*</mark>     | String | Chain ID representing the blockchain protocol                                            |
| to<mark style="color:red;">\*</mark>          | String | Contract address to which the gasless transaction is being sent                          |
| contractAbi<mark style="color:red;">\*</mark> | String | The ABI (Application Binary Interface) of the contract                                   |
| method<mark style="color:red;">\*</mark>      | String | The specific method of the contract for which the gasless transaction is being initiated |
| params<mark style="color:red;">\*</mark>      | String | Parameters required for the specified contract method                                    |

{% tabs %}
{% tab title="200: OK SUCCESS" %}

```javascript
{
    "Data": {
        "message": "Tx submitted to network successfully",
        "txHash": "0xaf5b0a341bcd9efcfa1218a667f9c4b5fb0f5ddf3c86522xxxxxxxxxxxxxxxxxx"
    },
    "Message": "",
    "Status": "SUCCESS"
}
```

{% endtab %}

{% tab title="401: Unauthorized Failure in authentication" %}

```
{
    "message": "Invalid API key in request"
}
```

{% endtab %}
{% endtabs %}

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

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

```bash
curl --location 'https://api.krypcore.com/api/v0/devWallet/signAndSubmitGaslessTx' \
--header 'Authorization: 03374415-xxxx-xxxx-xxxx-1277d243034e' \
--header 'Content-Type: application/json' \
--data '{
    "privateKey": "0x8342922845efe725d5379f705e707c8a7cff9941f7a301362c9de36e59xxxxxx",
    "dAppId": "DEV_DEMO_PACE_46_xxxxxxxx",
    "chainId": 80001,
    "to": "0x362149525adee7A0B20212D76Fad073Cxxxxxx",
    "contractAbi": "Base64 ABI",
    "method": "transfer",
    "params": []
}'
```

{% endtab %}

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

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "03374415-xxxx-xxxx-xxxx-1277d243034e");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "privateKey": "0x8342922845efe725d5379f705e707c8a7cff9941f7a301362c9de36e59xxxxxx",
  "dAppId": "DEV_DEMO_PACE_46_xxxxxxxx",
  "chainId": 80001,
  "to": "0x362149525adee7A0B20212D76Fad073Cxxxxxx",
  "contractAbi": "Base64 ABI",
  "method": "transfer",
  "params": []
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.krypcore.com/api/v0/devWallet/signAndSubmitGaslessTx", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Python " %}

```python
import requests
import json

url = "https://api.krypcore.com/api/v0/devWallet/signAndSubmitGaslessTx"

payload = json.dumps({
  "privateKey": "0x8342922845efe725d5379f705e707c8a7cff9941f7a301362c9de36e59xxxxxx",
  "dAppId": "DEV_DEMO_PACE_46_xxxxxxxx",
  "chainId": 80001,
  "to": "0x362149525adee7A0B20212D76Fad073Cxxxxxx",
  "contractAbi": "Base64 ABI",
  "method": "transfer",
  "params": []
})
headers = {
  'Authorization': '03374415-xxxx-xxxx-xxxx-1277d243034e',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

{% endtab %}

{% tab title="Golang" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.krypcore.com/api/v0/devWallet/signAndSubmitGaslessTx"
  method := "POST"

  payload := strings.NewReader(`{`+"
"+`
    "privateKey": "0x8342922845efe725d5379f705e707c8a7cff9941f7a301362c9de36e59xxxxxx",`+"
"+`
    "dAppId": "DEV_DEMO_PACE_46_xxxxxxxx",`+"
"+`
    "chainId": 80001,`+"
"+`
    "to": "0x362149525adee7A0B20212D76Fad073Cxxxxxx",`+"
"+`
    "contractAbi": "Base64 ABI",`+"
"+`
    "method": "transfer",`+"
"+`
    "params": []`+"
"+`
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "03374415-xxxx-xxxx-xxxx-1277d243034e")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}
{% endtabs %}
