Skip to content
CCPEDIAby Unity Nodes
Documentation/Canton Network Docs/Splice APIsScan APIsScan APIView on Canton Network Docs

POST /v0/open-and-issuing-mining-rounds

POST
/
api
/
scan
/
v0
/
open-and-issuing-mining-rounds
Try it
cURL
Python
JavaScript
PHP
Go
Java
Ruby
curl --request POST \
  --url 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds' \
  --header 'Content-Type: application/json' \
  --data '{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}'
import json
import requests

url = "https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds"
headers = {'Content-Type': 'application/json'}
payload = json.loads(r'''{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}''')
response = requests.request(
    "POST", url, headers=headers, json=payload
)

print(response.text)
const response = await fetch('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds', {
  method: 'POST',
  headers: {
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}),
});

console.log(await response.text());
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}
JSON,
    CURLOPT_HTTPHEADER => [
        "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://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds", bytes.NewBufferString(`{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}`))
  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://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}
"""))
    .build();
var response = HttpClient.newHttpClient().send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'

uri = URI('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds')
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
  http.request(request)
end
puts response.body
200
{
  "time_to_live_in_microseconds": 123,
  "open_mining_rounds": {},
  "issuing_mining_rounds": {}
}

All current open and issuing mining rounds, if the request is empty; passing contract IDs in the request can reduce the response data for polling/client-cache-update efficiency.

OpenAPI
cURL
Python
JavaScript
PHP
Go
Java
Ruby
curl --request POST \
  --url 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds' \
  --header 'Content-Type: application/json' \
  --data '{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}'
import json
import requests

url = "https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds"
headers = {'Content-Type': 'application/json'}
payload = json.loads(r'''{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}''')
response = requests.request(
    "POST", url, headers=headers, json=payload
)

print(response.text)
const response = await fetch('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds', {
  method: 'POST',
  headers: {
  "Content-Type": "application/json"
},
  body: JSON.stringify({
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}),
});

console.log(await response.text());
<?php
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => <<<'JSON'
{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}
JSON,
    CURLOPT_HTTPHEADER => [
        "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://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds", bytes.NewBufferString(`{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}`))
  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://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}
"""))
    .build();
var response = HttpClient.newHttpClient().send(
    request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'

uri = URI('https://scan.sv-1.global.canton.network.sync.global/api/scan/v0/open-and-issuing-mining-rounds')
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
  "cached_open_mining_round_contract_ids": [
    "<string>"
  ],
  "cached_issuing_round_contract_ids": [
    "<string>"
  ]
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
  http.request(request)
end
puts response.body
200
{
  "time_to_live_in_microseconds": 123,
  "open_mining_rounds": {},
  "issuing_mining_rounds": {}
}

Body

application/json
cached_open_mining_round_contract_ids
object[]
required
OpenAPI type: ContractId[].The contract IDs for open_mining_rounds in the response the caller knows about. If unsure, an empty array is fine; only a performance penalty is incurred.
cached_issuing_round_contract_ids
object[]
required
OpenAPI type: ContractId[].The contract IDs for issuing_mining_rounds in the response the caller knows about. If unsure, an empty array is fine; only a performance penalty is incurred.

Responses

200

ok
application/json
time_to_live_in_microseconds
integer
required
Suggested cache TTL for the response; this should expire before the opensAt of any open rounds that may not be in this response yet.
open_mining_rounds
MaybeCachedContractWithStateMap
required
Always created with respect to an input set of contract IDs. If an input contract ID is absent from the keys of this map, that contract should be considered removed by the caller; if present, contract may be empty, reflecting that the caller should already have the full contract data for that contract ID. Contracts not present in the input set will have full contract data. domain_id is always up-to-date; if undefined the contract is currently unassigned to a synchronizer, i.e. “in-flight”.
issuing_mining_rounds
MaybeCachedContractWithStateMap
required
Always created with respect to an input set of contract IDs. If an input contract ID is absent from the keys of this map, that contract should be considered removed by the caller; if present, contract may be empty, reflecting that the caller should already have the full contract data for that contract ID. Contracts not present in the input set will have full contract data. domain_id is always up-to-date; if undefined the contract is currently unassigned to a synchronizer, i.e. “in-flight”.