Submit a signed intent
Submits a signed intent to execute.
After generating an intent for a quote or limit order via /generate-intent and having the user sign it with their wallet, submit the signed intent through this endpoint.
The system validates the signature, processes the intent, and returns the intent hash upon successful submission.
Request Type Variants:
swap_transfer: Submit a signed swap intent (requires signedData object)
curl --request POST \
--url https://1click.chaindefuser.com/v0/submit-intent \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "swap_transfer",
"signedData": {
"payload": {
"message": "<string>",
"nonce": "<string>",
"recipient": "<string>",
"callbackUrl": "<string>"
},
"public_key": "<string>",
"signature": "<string>",
"standard": "nep413"
}
}
'import requests
url = "https://1click.chaindefuser.com/v0/submit-intent"
payload = {
"type": "swap_transfer",
"signedData": {
"payload": {
"message": "<string>",
"nonce": "<string>",
"recipient": "<string>",
"callbackUrl": "<string>"
},
"public_key": "<string>",
"signature": "<string>",
"standard": "nep413"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'swap_transfer',
signedData: {
payload: {
message: '<string>',
nonce: '<string>',
recipient: '<string>',
callbackUrl: '<string>'
},
public_key: '<string>',
signature: '<string>',
standard: 'nep413'
}
})
};
fetch('https://1click.chaindefuser.com/v0/submit-intent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://1click.chaindefuser.com/v0/submit-intent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'swap_transfer',
'signedData' => [
'payload' => [
'message' => '<string>',
'nonce' => '<string>',
'recipient' => '<string>',
'callbackUrl' => '<string>'
],
'public_key' => '<string>',
'signature' => '<string>',
'standard' => 'nep413'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://1click.chaindefuser.com/v0/submit-intent"
payload := strings.NewReader("{\n \"type\": \"swap_transfer\",\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://1click.chaindefuser.com/v0/submit-intent")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"swap_transfer\",\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1click.chaindefuser.com/v0/submit-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"swap_transfer\",\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}"
response = http.request(request)
puts response.read_body{
"intentHash": "44XpLRAuZKoVGs9T4qbSNv33MDKMePPAibA52geVLWFw",
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}{
"message": "error message"
}Authorizations
API key for partner authentication (recommended)
Body
The type of intent action
swap_transfer Assuming wallets want to interact with Intents protocol, besides preparing the data in a certain form, they have to have the capability to sign raw messages (off-chain signatures) using an algorithm we understand. This enum solves that problem.
For example, because we support ERC-191 and know how to verify messages with that standard, we can allow wallets, like Metamask, sign messages to perform intents without having to support new cryptographic primitives and signing standards.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://1click.chaindefuser.com/v0/submit-intent \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"type": "swap_transfer",
"signedData": {
"payload": {
"message": "<string>",
"nonce": "<string>",
"recipient": "<string>",
"callbackUrl": "<string>"
},
"public_key": "<string>",
"signature": "<string>",
"standard": "nep413"
}
}
'import requests
url = "https://1click.chaindefuser.com/v0/submit-intent"
payload = {
"type": "swap_transfer",
"signedData": {
"payload": {
"message": "<string>",
"nonce": "<string>",
"recipient": "<string>",
"callbackUrl": "<string>"
},
"public_key": "<string>",
"signature": "<string>",
"standard": "nep413"
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'swap_transfer',
signedData: {
payload: {
message: '<string>',
nonce: '<string>',
recipient: '<string>',
callbackUrl: '<string>'
},
public_key: '<string>',
signature: '<string>',
standard: 'nep413'
}
})
};
fetch('https://1click.chaindefuser.com/v0/submit-intent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://1click.chaindefuser.com/v0/submit-intent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => 'swap_transfer',
'signedData' => [
'payload' => [
'message' => '<string>',
'nonce' => '<string>',
'recipient' => '<string>',
'callbackUrl' => '<string>'
],
'public_key' => '<string>',
'signature' => '<string>',
'standard' => 'nep413'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://1click.chaindefuser.com/v0/submit-intent"
payload := strings.NewReader("{\n \"type\": \"swap_transfer\",\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://1click.chaindefuser.com/v0/submit-intent")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"swap_transfer\",\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://1click.chaindefuser.com/v0/submit-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"swap_transfer\",\n \"signedData\": {\n \"payload\": {\n \"message\": \"<string>\",\n \"nonce\": \"<string>\",\n \"recipient\": \"<string>\",\n \"callbackUrl\": \"<string>\"\n },\n \"public_key\": \"<string>\",\n \"signature\": \"<string>\",\n \"standard\": \"nep413\"\n }\n}"
response = http.request(request)
puts response.read_body{
"intentHash": "44XpLRAuZKoVGs9T4qbSNv33MDKMePPAibA52geVLWFw",
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}{
"message": "error message"
}