Sign EIP-712 typed data with the agent's EVM key
Needs the typed data’s domain listed in native.evm.sign_typed_data: every field the domain carries (name, version, chainId, verifyingContract, salt) must match one listed entry exactly, and an extra or missing field is another domain. A listed entry with primary_types signs only those message types, so primaryType must be one of them; without it any message type is signed. That narrows the kind of message, never its fields: destinations and amounts inside the message are not checked. types.EIP712Domain may be omitted, and the API then derives it; when sent, it must declare exactly the domain’s fields in EIP-712 order with their standard types, since the signed digest covers only declared fields. message is at most 65536 bytes as canonical JSON. The record (status and history, type native) carries details.domain, the matched domain, and details.message_json, the signed message as canonical JSON. Signs as wallet.evm_account_id, the same address on every EVM chain. Typed data can authorize transfers (EIP-3009) and approvals (EIP-2612 Permit) of anything that address holds. Requires X-Grant-Token for a live grant and is refused while the agent is frozen; destinations, budget, timelock_ms, schedule and owner_approval do not apply. Recorded in history as type native.
curl --request POST \
--url https://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Grant-Token: <api-key>' \
--data '
{
"typed_data": {
"domain": {},
"types": {},
"primaryType": "<string>",
"message": {}
}
}
'import requests
url = "https://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data"
payload = { "typed_data": {
"domain": {},
"types": {},
"primaryType": "<string>",
"message": {}
} }
headers = {
"X-API-Key": "<api-key>",
"X-Grant-Token": "<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>',
'X-Grant-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({typed_data: {domain: {}, types: {}, primaryType: '<string>', message: {}}})
};
fetch('https://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data', 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://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data",
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([
'typed_data' => [
'domain' => [
],
'types' => [
],
'primaryType' => '<string>',
'message' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Grant-Token: <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://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data"
payload := strings.NewReader("{\n \"typed_data\": {\n \"domain\": {},\n \"types\": {},\n \"primaryType\": \"<string>\",\n \"message\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("X-Grant-Token", "<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://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data")
.header("X-API-Key", "<api-key>")
.header("X-Grant-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"typed_data\": {\n \"domain\": {},\n \"types\": {},\n \"primaryType\": \"<string>\",\n \"message\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data")
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["X-Grant-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"typed_data\": {\n \"domain\": {},\n \"types\": {},\n \"primaryType\": \"<string>\",\n \"message\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"correlation_id": "<string>",
"chain": "near",
"account_id": "<string>",
"signature": "<string>"
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}Authorizations
Token of the owner grant a delegated request runs under. The partner creates it and the owner signs its commitment; keep it on your backend.
Path Parameters
^[0-9a-f]{64}$Body
curl --request POST \
--url https://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--header 'X-Grant-Token: <api-key>' \
--data '
{
"typed_data": {
"domain": {},
"types": {},
"primaryType": "<string>",
"message": {}
}
}
'import requests
url = "https://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data"
payload = { "typed_data": {
"domain": {},
"types": {},
"primaryType": "<string>",
"message": {}
} }
headers = {
"X-API-Key": "<api-key>",
"X-Grant-Token": "<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>',
'X-Grant-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({typed_data: {domain: {}, types: {}, primaryType: '<string>', message: {}}})
};
fetch('https://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data', 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://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data",
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([
'typed_data' => [
'domain' => [
],
'types' => [
],
'primaryType' => '<string>',
'message' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>",
"X-Grant-Token: <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://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data"
payload := strings.NewReader("{\n \"typed_data\": {\n \"domain\": {},\n \"types\": {},\n \"primaryType\": \"<string>\",\n \"message\": {}\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("X-Grant-Token", "<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://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data")
.header("X-API-Key", "<api-key>")
.header("X-Grant-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"typed_data\": {\n \"domain\": {},\n \"types\": {},\n \"primaryType\": \"<string>\",\n \"message\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsonintents.com/v1/agents/{agent_id}/native/evm/sign-typed-data")
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["X-Grant-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"typed_data\": {\n \"domain\": {},\n \"types\": {},\n \"primaryType\": \"<string>\",\n \"message\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"correlation_id": "<string>",
"chain": "near",
"account_id": "<string>",
"signature": "<string>"
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}{
"errors": [
{
"status": "<string>",
"code": "<string>",
"layer": "request",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
},
"meta": {
"retryable": true,
"available_at": "2023-11-07T05:31:56Z",
"min_amount": "<string>",
"available_amount": "<string>"
}
}
],
"meta": {
"request_id": "<string>"
}
}