User operations
Create Custom User Operation
Creates a custom user operation
x-api-key<token>
In: header
chainIdnumber
operationsarray<object>
metadata?object
Custom metadata for the transaction. Key-value pairs with string values. Max 1KB size.
Empty Object
payGasFeeTokenAddressstring
Match
^0x[a-fA-F0-9]{40}$
walletAddressstring
Match
^0x[a-fA-F0-9]{40}$
Response Body
curl -X POST "https://api.notus.team/api/v1/crypto/custom-user-operation" \
-H "Content-Type: application/json" \
-d '{
"chainId": 0,
"operations": [
{
"address": "string",
"value": 0
}
],
"payGasFeeTokenAddress": "string",
"walletAddress": "string"
}'
const body = JSON.stringify({
"chainId": 0,
"operations": [
{
"address": "string",
"value": 0
}
],
"payGasFeeTokenAddress": "string",
"walletAddress": "string"
})
fetch("https://api.notus.team/api/v1/crypto/custom-user-operation", {
body
})
package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://api.notus.team/api/v1/crypto/custom-user-operation"
body := strings.NewReader(`{
"chainId": 0,
"operations": [
{
"address": "string",
"value": 0
}
],
"payGasFeeTokenAddress": "string",
"walletAddress": "string"
}`)
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/custom-user-operation"
body = {
"chainId": 0,
"operations": [
{
"address": "string",
"value": 0
}
],
"payGasFeeTokenAddress": "string",
"walletAddress": "string"
}
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("""{
"chainId": 0,
"operations": [
{
"address": "string",
"value": 0
}
],
"payGasFeeTokenAddress": "string",
"walletAddress": "string"
}""");
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://api.notus.team/api/v1/crypto/custom-user-operation"))
.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("""
{
"chainId": 0,
"operations": [
{
"address": "string",
"value": 0
}
],
"payGasFeeTokenAddress": "string",
"walletAddress": "string"
}
""", Encoding.UTF8, "application/json");
var client = new HttpClient();
var response = await client.PostAsync("https://api.notus.team/api/v1/crypto/custom-user-operation", body);
var responseBody = await response.Content.ReadAsStringAsync();
{
"userOperation": "0x2aac7a66d5331454eafc9b981be3596ad08a40dad24883e3b9c4a5362cd7f7e1"
}
Create a batch operation POST
You can create a batch operation including transfers and swaps.
Execute User Operation POST
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.