Skip to content
Daml

Post apiutilitiesv0registryburn mint instructionv0burn mint factory

POST
/
api
/
utilities
/
v0
/
registry
/
burn-mint-instruction
/
v0
/
burn-mint-factory
Try it
cURL

cURL

curl --request POST \
  --url https://api.utilities.digitalasset.com/api/utilities/v0/registry/burn-mint-instruction/v0/burn-mint-factory \
  --header 'Content-Type: application/json' \
  --data '
{
  "instrumentId": {
    "admin": "<string>",
    "id": "<string>"
  },
  "inputHoldingCids": [
    "<string>"
  ],
  "outputs": [
    {
      "owner": "<string>",
      "amount": "<string>"
    }
  ]
}
'
import requests

url = "https://api.utilities.digitalasset.com/api/utilities/v0/registry/burn-mint-instruction/v0/burn-mint-factory"

payload = {
"instrumentId": {
"admin": "<string>",
"id": "<string>"
},
"inputHoldingCids": ["<string>"],
"outputs": [
{
"owner": "<string>",
"amount": "<string>"
}
]
}
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({
instrumentId: {admin: '<string>', id: '<string>'},
inputHoldingCids: ['<string>'],
outputs: [{owner: '<string>', amount: '<string>'}]
})
};

fetch('https://api.utilities.digitalasset.com/api/utilities/v0/registry/burn-mint-instruction/v0/burn-mint-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_URL => "https://api.utilities.digitalasset.com/api/utilities/v0/registry/burn-mint-instruction/v0/burn-mint-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([
'instrumentId' => [
'admin' => '<string>',
'id' => '<string>'
],
'inputHoldingCids' => [
'<string>'
],
'outputs' => [
[
'owner' => '<string>',
'amount' => '<string>'
]
]
]),
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 := "https://api.utilities.digitalasset.com/api/utilities/v0/registry/burn-mint-instruction/v0/burn-mint-factory"

payload := strings.NewReader("{\n \"instrumentId\": {\n \"admin\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"inputHoldingCids\": [\n \"<string>\"\n ],\n \"outputs\": [\n {\n \"owner\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\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("https://api.utilities.digitalasset.com/api/utilities/v0/registry/burn-mint-instruction/v0/burn-mint-factory")
.header("Content-Type", "application/json")
.body("{\n \"instrumentId\": {\n \"admin\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"inputHoldingCids\": [\n \"<string>\"\n ],\n \"outputs\": [\n {\n \"owner\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.utilities.digitalasset.com/api/utilities/v0/registry/burn-mint-instruction/v0/burn-mint-factory")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"instrumentId\": {\n \"admin\": \"<string>\",\n \"id\": \"<string>\"\n },\n \"inputHoldingCids\": [\n \"<string>\"\n ],\n \"outputs\": [\n {\n \"owner\": \"<string>\",\n \"amount\": \"<string>\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
200
400
404
500
{
  "factoryId": "<string>",
  "choiceContext": {
    "choiceContextData": {},
    "disclosedContracts": [
      {
        "contractId": "<string>",
        "templateId": "<string>",
        "createdEventBlob": "<string>",
        "createdAt": "2023-11-07T05:31:56Z",
        "synchronizerId": "<string>",
        "domainId": "<string>"
      }
    ]
  }
}
{
"error": "unknown_error",
"error_description": "Something went wrong"
}
{
"error": "unknown_error",
"error_description": "Something went wrong"
}
{
"error": "unknown_error",
"error_description": "Something went wrong"
}

Body

application/json

The request to get the factory and choice context for burn and mint.

instrumentId
object
required

The identifier of the instrument.

Show child attributes

inputHoldingCids
string[]
required

Contract ids of Holdings to be used for the burn.

outputs
object[]
required

The list of specification of a holding to be minted.

Show child attributes

Response

200
application/json

ok

A 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.

factoryId
string
required

The contract ID of the contract of the factory which can be used to create instruction.

choiceContext
object
required

The context required to exercise a choice on a contract via an interface. Used to retrieve additional reference date that is passed in via disclosed contracts, which are in turn referred to via their contract ID in the choiceContextData.

Show child attributes