curl --request POST \
--url http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory \
--header 'Content-Type: application/json' \
--data '
{
"choiceArguments": {},
"excludeDebugFields": false
}
'import requests
url = "http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory"
payload = {
"choiceArguments": {},
"excludeDebugFields": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({choiceArguments: {}, excludeDebugFields: false})
};
fetch('http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory",
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([
'choiceArguments' => [
],
'excludeDebugFields' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory"
payload := strings.NewReader("{\n \"choiceArguments\": {},\n \"excludeDebugFields\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory")
.header("Content-Type", "application/json")
.body("{\n \"choiceArguments\": {},\n \"excludeDebugFields\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"choiceArguments\": {},\n \"excludeDebugFields\": false\n}"
response = http.request(request)
puts response.read_body{
"factoryId": "<string>",
"transferKind": "self",
"choiceContext": {
"choiceContextData": {},
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>",
"debugPackageName": "<string>",
"debugPayload": {},
"debugCreatedAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Post apitoken standardv0registrars registrytransfer instructionv2transfer factory
Get the factory and choice context for executing a direct transfer.
curl --request POST \
--url http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory \
--header 'Content-Type: application/json' \
--data '
{
"choiceArguments": {},
"excludeDebugFields": false
}
'import requests
url = "http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory"
payload = {
"choiceArguments": {},
"excludeDebugFields": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({choiceArguments: {}, excludeDebugFields: false})
};
fetch('http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory",
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([
'choiceArguments' => [
],
'excludeDebugFields' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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 := "http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory"
payload := strings.NewReader("{\n \"choiceArguments\": {},\n \"excludeDebugFields\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory")
.header("Content-Type", "application/json")
.body("{\n \"choiceArguments\": {},\n \"excludeDebugFields\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/token-standard/v0/registrars/{registrarParty}/registry/transfer-instruction/v2/transfer-factory")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"choiceArguments\": {},\n \"excludeDebugFields\": false\n}"
response = http.request(request)
puts response.read_body{
"factoryId": "<string>",
"transferKind": "self",
"choiceContext": {
"choiceContextData": {},
"disclosedContracts": [
{
"templateId": "<string>",
"contractId": "<string>",
"createdEventBlob": "<string>",
"synchronizerId": "<string>",
"debugPackageName": "<string>",
"debugPayload": {},
"debugCreatedAt": "2023-11-07T05:31:56Z"
}
]
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Body
The arguments that are intended to be passed to the choice provided by the factory.
To avoid repeating the Daml type definitions, they are specified as JSON objects.
However the concrete format is given by how the choice arguments are encoded using the Daml JSON API
(with the extraArgs.context and extraArgs.meta fields set to the empty object).
The choice arguments are provided so that the registry can also provide choice-argument specific contracts, e.g., the configuration for a specific instrument-id.
Response
ok
The transfer factory contract together with the choice context required to exercise the choice provided by the factory. Typically used to implement the generic initiation of on-ledger workflows via a Daml interface.
Clients SHOULD avoid reusing the same FactoryWithChoiceContext for exercising multiple choices,
as the choice context MAY be specific to the choice being exercised.
The kind of transfer workflow that will be used:
offer: offer a transfer to the receiver and only transfer if they acceptdirect: transfer directly to the receiver without asking them for approval. Only chosen if the receiver has pre-approved direct transfers.self: a self-transfer where the sender and receiver are the same party. No approval is required, and the transfer is typically immediate.
self, direct, offer