Notus API
User operations

Execute User Operation

This endpoint queues to execution a user operation on the blockchain, like a swap quote or a transfer. The execution occurs asynchronously as it waits to be included in a block. You can check the status by using the returned hash in the history endpoint or with our webhooks.

POST
/api/v1/crypto/execute-user-op
x-api-key<token>

In: header

quoteId?string

DEPRECATED: Use userOperationHash instead. Will be ignored if userOperationHash is used.

Match^0x[a-fA-F0-9]{64}$
userOperationHash?string

Unique identifier for the swap quote, required to execute the transaction.

Match^0x[a-fA-F0-9]{64}$
signaturestring

The signature of the transaction, required to execute the transaction.

Match^0x([a-fA-F0-9]{2})*$

Response Body

curl -X POST "https://api.notus.team/api/v1/crypto/execute-user-op" \
  -H "Content-Type: application/json" \
  -d '{
    "signature": "0xeecdd469465113db97d2d57949c581a080a4e7d7c528187ffc80e4f55ca68e083dcda2338666db182417608b971f5237c5807d67c7515e52f9ffe045e775ec791b"
  }'
const body = JSON.stringify({
  "signature": "0xeecdd469465113db97d2d57949c581a080a4e7d7c528187ffc80e4f55ca68e083dcda2338666db182417608b971f5237c5807d67c7515e52f9ffe045e775ec791b"
})

fetch("https://api.notus.team/api/v1/crypto/execute-user-op", {
  body
})
package main

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

func main() {
  url := "https://api.notus.team/api/v1/crypto/execute-user-op"
  body := strings.NewReader(`{
    "signature": "0xeecdd469465113db97d2d57949c581a080a4e7d7c528187ffc80e4f55ca68e083dcda2338666db182417608b971f5237c5807d67c7515e52f9ffe045e775ec791b"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.notus.team/api/v1/crypto/execute-user-op"
body = {
  "signature": "0xeecdd469465113db97d2d57949c581a080a4e7d7c528187ffc80e4f55ca68e083dcda2338666db182417608b971f5237c5807d67c7515e52f9ffe045e775ec791b"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.http.HttpRequest.BodyPublishers;

var body = BodyPublishers.ofString("""{
  "signature": "0xeecdd469465113db97d2d57949c581a080a4e7d7c528187ffc80e4f55ca68e083dcda2338666db182417608b971f5237c5807d67c7515e52f9ffe045e775ec791b"
}""");
HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://api.notus.team/api/v1/crypto/execute-user-op"))
  .header("Content-Type", "application/json")
  .POST(body)
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var body = new StringContent("""
{
  "signature": "0xeecdd469465113db97d2d57949c581a080a4e7d7c528187ffc80e4f55ca68e083dcda2338666db182417608b971f5237c5807d67c7515e52f9ffe045e775ec791b"
}
""", Encoding.UTF8, "application/json");

var client = new HttpClient();
var response = await client.PostAsync("https://api.notus.team/api/v1/crypto/execute-user-op", body);
var responseBody = await response.Content.ReadAsStringAsync();
{
  "userOpHash": "0x2aac7a66d5331454eafc9b981be3596ad08a40dad24883e3b9c4a5362cd7f7e1",
  "userOperationHash": "0x2aac7a66d5331454eafc9b981be3596ad08a40dad24883e3b9c4a5362cd7f7e1"
}
{
  "statusCode": 400,
  "id": "EXECUTE_USER_OP",
  "message": "Your User Operation has expired. Please, request a new one."
}
{
  "statusCode": 403,
  "id": "UNAVAILABLE_COMPUTE_UNITS",
  "message": "The project doesn't have enough compute units to perform this action. Please upgrade your plan."
}
{
  "statusCode": 404,
  "id": "USER_OPERATION_NOT_FOUND",
  "message": "Could not find the User Operation requested"
}
{
  "statusCode": 500,
  "id": "EXECUTE_USER_OP",
  "message": "Failed to execute user operation. Please try again later"
}