# SubmitUserOp

Using "SubmitUserOp" on Krypcore, you may make it easier to communicate with your smart contract wallet. This function allows users to submit customised procedures, allowing for faster transaction processing and wallet settings updates. This simple submission method can help you streamline your digital asset management.

This deploys SubmitUserOp using this method.&#x20;

## API Specification

## SubmitUserOp Details

<mark style="color:green;">`POST`</mark> `https://web3-proxy-dev.krypcore.com/api/v0/scWallet/SubmitUserOp`

To get SubmitUserOp Details under the given instance.&#x20;

#### Headers

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

#### Request Body

| Name                                                   | Type   | Description              |
| ------------------------------------------------------ | ------ | ------------------------ |
| walletName<mark style="color:red;">\*</mark>           | String | Wallet Name              |
| userop<mark style="color:red;">\*</mark>               | String | User OP                  |
| callData<mark style="color:red;">\*</mark>             | String | Call Data                |
| callGasLimit<mark style="color:red;">\*</mark>         | String | Call Gas Limit           |
| initCode<mark style="color:red;">\*</mark>             | String | Init Code                |
| maxFeePerGas<mark style="color:red;">\*</mark>         | String | Max Fee Per  Gas         |
| maxPriorityFeePerGas<mark style="color:red;">\*</mark> | String | Max Priority Fee Per Gas |
| nonce<mark style="color:red;">\*</mark>                | String | Nonce                    |
| paymasterAndData<mark style="color:red;">\*</mark>     | String | PaymasterAndData         |
| preVerificationGas<mark style="color:red;">\*</mark>   | String | PreVerification Gas      |
| sender<mark style="color:red;">\*</mark>               | String | Sender                   |
| signature<mark style="color:red;">\*</mark>            | String | Signature                |
| verificationGasLimit<mark style="color:red;">\*</mark> | String | VerificationGasLimit     |

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

```javascript
{
    "Data": "******",
    "Message": "",
    "Status": "SUCCESS"
}
```

{% endtab %}

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

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

{% endtab %}

{% tab title="500: Internal Server Error Key values should be given" %}

```
{
    "message": "Internal Server Error"
}
```

{% 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://web3-proxy-dev.krypcore.com/api/v0/scWallet/SubmitUserOp' \
--header 'DappId: *****' \
--header 'Authorization: *****' \
--header 'Content-Type: application/json' \
--data '{
    "walletName":"ak10", "userOp": {"callData":"*****","callGasLimit":"0x34b8","initCode":"*****","maxFeePerGas":"0x6507a5c0","maxPriorityFeePerGas":"0x6507a5c0","nonce":"0x0","paymasterAndData":"0x","preVerificationGas":"0xc57e","sender":"*****","signature":"*****","verificationGasLimit":"0x53723"}
}'
```

{% endtab %}

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

```javascript

var myHeaders = new Headers();
myHeaders.append("DappId", "*****");
myHeaders.append("Authorization", "*****");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "walletName": "ak10",
  "userOp": {
    "callData": "*****",
    "callGasLimit": "0x34b8",
    "initCode": "*****",
    "maxFeePerGas": "0x6507a5c0",
    "maxPriorityFeePerGas": "0x6507a5c0",
    "nonce": "0x0",
    "paymasterAndData": "0x",
    "preVerificationGas": "0xc57e",
    "sender": "*****",
    "signature": "*****",
    "verificationGasLimit": "0x53723"
  }
});

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

fetch("https://web3-proxy-dev.krypcore.com/api/v0/scWallet/SubmitUserOp", 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://web3-proxy-dev.krypcore.com/api/v0/scWallet/SubmitUserOp"

payload = json.dumps({
  "walletName": "ak10",
  "userOp": {
    "callData": "*****",
    "callGasLimit": "0x34b8",
    "initCode": "*****",
    "maxFeePerGas": "0x6507a5c0",
    "maxPriorityFeePerGas": "0x6507a5c0",
    "nonce": "0x0",
    "paymasterAndData": "0x",
    "preVerificationGas": "0xc57e",
    "sender": "*****",
    "signature": "*****",
    "verificationGasLimit": "0x53723"
  }
})
headers = {
  'DappId': '*****',
  'Authorization': '*****',
  '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://web3-proxy-dev.krypcore.com/api/v0/scWallet/SubmitUserOp"
  method := "POST"

  payload := strings.NewReader(`{
    "walletName":"ak10", "userOp": {"callData":"*****","callGasLimit":"0x34b8","initCode":"*****","maxFeePerGas":"0x6507a5c0","maxPriorityFeePerGas":"0x6507a5c0","nonce":"0x0","paymasterAndData":"0x","preVerificationGas":"0xc57e","sender":"*****","signature":"*****","verificationGasLimit":"0x53723"}
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("DappId", "*****")
  req.Header.Add("Authorization", "*****")
  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 %}
