Get a deposit address that funds the agent from another chain
Requires an API key, not an owner grant. Creates a NEAR Intents 1Click deposit address that credits the agent’s public or confidential balance, without spending agent funds or applying an execution delay. Send only origin_asset to fund the agent with any amount at or above details.min_amount until details.expires_at; add amount for an exact deposit. A failed or late deposit refunds into the agent’s own balance (details.refund_to); no request field chooses a refund address. The status reads PENDING_DEPOSIT with details.deposit_address (and details.memo where the chain needs one) until funds arrive; without amount it stays open 3 days, and an address still unpaid a day after details.expires_at ends FAILED with deposit_expired. History lists an address only once something was paid into it. Funds go only to that address. correlation_id (op_…) is a tracking id and never an address.
curl --request POST \
--url https://api.agentsonintents.com/v1/agents/{agent_id}/deposit \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"origin_asset": "<string>",
"destination_asset": "<string>",
"amount": "<string>",
"confidential": false
}
'import requests
url = "https://api.agentsonintents.com/v1/agents/{agent_id}/deposit"
payload = {
"origin_asset": "<string>",
"destination_asset": "<string>",
"amount": "<string>",
"confidential": False
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
origin_asset: '<string>',
destination_asset: '<string>',
amount: '<string>',
confidential: false
})
};
fetch('https://api.agentsonintents.com/v1/agents/{agent_id}/deposit', 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}/deposit",
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([
'origin_asset' => '<string>',
'destination_asset' => '<string>',
'amount' => '<string>',
'confidential' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"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://api.agentsonintents.com/v1/agents/{agent_id}/deposit"
payload := strings.NewReader("{\n \"origin_asset\": \"<string>\",\n \"destination_asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"confidential\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://api.agentsonintents.com/v1/agents/{agent_id}/deposit")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"origin_asset\": \"<string>\",\n \"destination_asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"confidential\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsonintents.com/v1/agents/{agent_id}/deposit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"origin_asset\": \"<string>\",\n \"destination_asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"confidential\": false\n}"
response = http.request(request)
puts response.read_body{
"correlation_id": "<string>",
"agent_id": "<string>",
"status": "PENDING_SIGNATURE",
"failure_code": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"dispatch_committed_at": "<string>",
"grant": {
"id": "<string>",
"label": "<string>"
},
"type": "agent_create",
"details": {
"revision": 4503599627370495,
"policy_hash": "<string>",
"transaction_hash": "<string>",
"agent_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>"
}
}{
"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
Headers
Stable key for one logical request. Replays with the same key and body return the original result; a different body is refused with idempotency_conflict.
8 - 128^[A-Za-z0-9._:-]+$Path Parameters
^[0-9a-f]{64}$Body
Response
Success
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
- Option 17
- Option 18
^op_[A-Za-z0-9_-]{43}$^[0-9a-f]{64}$PENDING_SIGNATURE, QUEUED, PENDING_APPROVAL, PENDING_DEPOSIT, PROCESSING, SUCCESS, REFUNDED, FAILED, UNCERTAIN, NEEDS_REVIEW Show child attributes
Show child attributes
"agent_create"Show child attributes
Show child attributes
curl --request POST \
--url https://api.agentsonintents.com/v1/agents/{agent_id}/deposit \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"origin_asset": "<string>",
"destination_asset": "<string>",
"amount": "<string>",
"confidential": false
}
'import requests
url = "https://api.agentsonintents.com/v1/agents/{agent_id}/deposit"
payload = {
"origin_asset": "<string>",
"destination_asset": "<string>",
"amount": "<string>",
"confidential": False
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"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: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
origin_asset: '<string>',
destination_asset: '<string>',
amount: '<string>',
confidential: false
})
};
fetch('https://api.agentsonintents.com/v1/agents/{agent_id}/deposit', 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}/deposit",
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([
'origin_asset' => '<string>',
'destination_asset' => '<string>',
'amount' => '<string>',
'confidential' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"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://api.agentsonintents.com/v1/agents/{agent_id}/deposit"
payload := strings.NewReader("{\n \"origin_asset\": \"<string>\",\n \"destination_asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"confidential\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://api.agentsonintents.com/v1/agents/{agent_id}/deposit")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"origin_asset\": \"<string>\",\n \"destination_asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"confidential\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsonintents.com/v1/agents/{agent_id}/deposit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"origin_asset\": \"<string>\",\n \"destination_asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"confidential\": false\n}"
response = http.request(request)
puts response.read_body{
"correlation_id": "<string>",
"agent_id": "<string>",
"status": "PENDING_SIGNATURE",
"failure_code": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"dispatch_committed_at": "<string>",
"grant": {
"id": "<string>",
"label": "<string>"
},
"type": "agent_create",
"details": {
"revision": 4503599627370495,
"policy_hash": "<string>",
"transaction_hash": "<string>",
"agent_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>"
}
}{
"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>"
}
}