Create Custom User Operation
Creates a custom user operation
In: header
Chain where the operation is to be started. Supported EVM chains:
- Arbitrum One: 42161
- Avalanche: 43114
- Base: 8453
- BNB Smart Chain: 56
- Ethereum: 1
- Gnosis: 100
- OP Mainnet: 10
- Polygon: 137{
List of operations to execute, the order here is the order of execution.
Custom metadata for the entity. Key-value pairs with string values. Max 1KB size.
Empty Object
Token that will be used to cover gas fees. This is required, the optional is only to support the deprecated field.
^0x[a-fA-F0-9]{40}$
DEPRECATED: use payGasFeeToken
instead.
^0x[a-fA-F0-9]{40}$
Smart wallet that will be executing these operations
^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": 42161,
"operations": [
{
"address": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"value": "10000000000000000000"
}
],
"walletAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464"
}'
const body = JSON.stringify({
"chainId": 42161,
"operations": [
{
"address": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"value": "10000000000000000000"
}
],
"walletAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464"
})
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": 42161,
"operations": [
{
"address": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"value": "10000000000000000000"
}
],
"walletAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464"
}`)
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": 42161,
"operations": [
{
"address": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"value": "10000000000000000000"
}
],
"walletAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464"
}
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": 42161,
"operations": [
{
"address": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"value": "10000000000000000000"
}
],
"walletAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464"
}""");
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": 42161,
"operations": [
{
"address": "0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6",
"value": "10000000000000000000"
}
],
"walletAddress": "0x6e397ddf51d9f15dbe0414538e7529f51f2e5464"
}
""", 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 Batch Operation POST
An operation that can join transfers and swaps into a single operation.
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.