curl --request POST \
--url 'https://example.com/api/validator/v0/wallet/transfer-offers' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}'
import json
import requests
url = "https://example.com/api/validator/v0/wallet/transfer-offers"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('https://example.com/api/validator/v0/wallet/transfer-offers', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://example.com/api/validator/v0/wallet/transfer-offers',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "https://example.com/api/validator/v0/wallet/transfer-offers", bytes.NewBufferString(`{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("https://example.com/api/validator/v0/wallet/transfer-offers"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('https://example.com/api/validator/v0/wallet/transfer-offers')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
{
"offer_contract_id": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
POST /v0/wallet/transfer-offers
Create an offer to directly transfer a given amount of Amulet to another party. Direct transfers are a three-step process: 1. The sender creates a transfer offer 2. The receiver accepts the offer 3. The sender’s wallet automation consumes the accepted offer and transfers the amount. Amulets are not locked for direct transfers. If the sender’s wallet does not have enough Amulet to fulfill the offer at this point, the transfer will fail.
curl --request POST \
--url 'https://example.com/api/validator/v0/wallet/transfer-offers' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}'
import json
import requests
url = "https://example.com/api/validator/v0/wallet/transfer-offers"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('https://example.com/api/validator/v0/wallet/transfer-offers', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://example.com/api/validator/v0/wallet/transfer-offers',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "https://example.com/api/validator/v0/wallet/transfer-offers", bytes.NewBufferString(`{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("https://example.com/api/validator/v0/wallet/transfer-offers"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('https://example.com/api/validator/v0/wallet/transfer-offers')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
{
"offer_contract_id": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
Create an offer to directly transfer a given amount of Amulet to another party. Direct transfers are a three-step process: 1. The sender creates a transfer offer 2. The receiver accepts the offer 3. The sender’s wallet automation consumes the accepted offer and transfers the amount. Amulets are not locked for direct transfers. If the sender’s wallet does not have enough Amulet to fulfill the offer at this point, the transfer will fail.
curl --request POST \
--url 'https://example.com/api/validator/v0/wallet/transfer-offers' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}'
import json
import requests
url = "https://example.com/api/validator/v0/wallet/transfer-offers"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('https://example.com/api/validator/v0/wallet/transfer-offers', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://example.com/api/validator/v0/wallet/transfer-offers',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "https://example.com/api/validator/v0/wallet/transfer-offers", bytes.NewBufferString(`{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("https://example.com/api/validator/v0/wallet/transfer-offers"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('https://example.com/api/validator/v0/wallet/transfer-offers')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"receiver_party_id": "<string>",
"amount": "<string>",
"description": "<string>",
"expires_at": 123,
"tracking_id": "<string>"
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
{
"offer_contract_id": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
Authorizations
walletUserAuth
Authorization: Bearer <token>. Bearer format: JWT. JWT token as described by the spliceAppBearerAuth security scheme. The subject of the token must be ledger API user of the user whose wallet the endpoint affects.Body
integer (int64).Expiry time of the transfer offer as unix timestamp in microseconds. After this time, the offer can no longer be accepted and automation in the wallet will eventually expire the transfer offer. Note that this time is compared against the ledger effective time of the Daml transaction accepting or expiring an offer, and can skew from the wall clock time measured on the caller’s machine. See https://docs.daml.com/concepts/time.html for how ledger effective time is bound to the record time of a transaction on a domain.