@c7-digital/scan 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Build script for @c7-digital/scan
4
+ *
5
+ * Steps:
6
+ * 1. Parse --splice-version (default: 0.5.10)
7
+ * 2. If bundled spec doesn't exist, run download-spec.ts
8
+ * 3. Run openapi-typescript to generate types
9
+ * 4. Generate sdk-version.ts constant
10
+ * 5. Compile TypeScript (tsc + tsc-alias)
11
+ */
12
+ declare function build(): Promise<void>;
13
+ export { build };
@@ -0,0 +1,160 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Build script for @c7-digital/scan
4
+ *
5
+ * Steps:
6
+ * 1. Parse --splice-version (default: 0.5.10)
7
+ * 2. If bundled spec doesn't exist, run download-spec.ts
8
+ * 3. Run openapi-typescript to generate types
9
+ * 4. Generate sdk-version.ts constant
10
+ * 5. Compile TypeScript (tsc + tsc-alias)
11
+ */
12
+ import { join, dirname } from "path";
13
+ import { fileURLToPath } from "url";
14
+ import { exec } from "child_process";
15
+ import { promisify } from "util";
16
+ import { writeFile, mkdir, readdir } from "fs/promises";
17
+ import { existsSync } from "fs";
18
+ const execAsync = promisify(exec);
19
+ const __filename = fileURLToPath(import.meta.url);
20
+ const __dirname = dirname(__filename);
21
+ const projectRoot = join(__dirname, "..");
22
+ function getSpliceVersion() {
23
+ const args = process.argv.slice(2);
24
+ const versionArg = args.find(arg => arg.startsWith("--splice-version="));
25
+ if (versionArg) {
26
+ return versionArg.split("=")[1];
27
+ }
28
+ return "0.5.10";
29
+ }
30
+ async function discoverSpecFile(version) {
31
+ const specsDir = join(projectRoot, "specs");
32
+ if (version) {
33
+ const specFile = `scan_bundled_${version}.yaml`;
34
+ const specPath = join(specsDir, specFile);
35
+ if (existsSync(specPath)) {
36
+ console.log(`Found bundled spec: ${specFile}`);
37
+ return { specPath, version };
38
+ }
39
+ // Spec doesn't exist yet — run download script
40
+ console.log(`Bundled spec not found for ${version}, downloading...`);
41
+ try {
42
+ const { stdout, stderr } = await execAsync(`pnpm exec tsx "${join(projectRoot, "scripts", "download-spec.ts")}" --splice-version=${version}`, { cwd: projectRoot });
43
+ if (stdout)
44
+ console.log(stdout);
45
+ if (stderr)
46
+ console.warn(stderr);
47
+ }
48
+ catch (error) {
49
+ console.error("Failed to download spec:", error.stderr || error.message);
50
+ throw error;
51
+ }
52
+ if (!existsSync(specPath)) {
53
+ throw new Error(`Spec file still not found after download: ${specFile}`);
54
+ }
55
+ return { specPath, version };
56
+ }
57
+ // Auto-discover latest
58
+ const files = await readdir(specsDir);
59
+ const bundledSpecs = files
60
+ .filter(f => f.startsWith("scan_bundled_") && f.endsWith(".yaml"))
61
+ .sort()
62
+ .reverse();
63
+ if (bundledSpecs.length === 0) {
64
+ throw new Error("No bundled spec files found. Run download-spec.ts first or specify --splice-version.");
65
+ }
66
+ const latestSpec = bundledSpecs[0];
67
+ const match = latestSpec.match(/scan_bundled_(.+)\.yaml/);
68
+ const detectedVersion = match ? match[1] : "unknown";
69
+ console.log(`Auto-discovered spec: ${latestSpec} (version: ${detectedVersion})`);
70
+ return { specPath: join(specsDir, latestSpec), version: detectedVersion };
71
+ }
72
+ async function ensureGeneratedDirectory() {
73
+ const outputDir = join(projectRoot, "src", "generated");
74
+ await mkdir(outputDir, { recursive: true });
75
+ }
76
+ async function generateTypes(specPath) {
77
+ console.log("Generating OpenAPI types...");
78
+ const outputPath = join(projectRoot, "src", "generated", "api.ts");
79
+ try {
80
+ const { stdout, stderr } = await execAsync(`pnpm exec openapi-typescript "${specPath}" --output "${outputPath}"`, { cwd: projectRoot });
81
+ if (stderr && !stderr.includes("Warning")) {
82
+ console.warn("openapi-typescript warnings:", stderr);
83
+ }
84
+ if (stdout) {
85
+ console.log(stdout);
86
+ }
87
+ console.log("Generated OpenAPI types successfully.");
88
+ }
89
+ catch (error) {
90
+ console.error("Error generating OpenAPI types:", error.message);
91
+ throw error;
92
+ }
93
+ }
94
+ async function generateSpliceVersionFile(version) {
95
+ console.log("Generating Splice version constant...");
96
+ const outputDir = join(projectRoot, "src", "generated");
97
+ const outputPath = join(outputDir, "sdk-version.ts");
98
+ const content = `// Auto-generated file - do not edit manually
99
+ // Generated from Splice version: ${version}
100
+
101
+ export const SPLICE_VERSION = "${version}";
102
+ `;
103
+ await writeFile(outputPath, content, "utf-8");
104
+ console.log(`Generated Splice version constant: ${version}`);
105
+ }
106
+ async function compileTypeScript() {
107
+ console.log("Compiling TypeScript...");
108
+ try {
109
+ const tscCommand = `pnpm exec tsc -p ${join(projectRoot, "tsconfig.json")}`;
110
+ const aliasCommand = `pnpm exec tsc-alias -p ${join(projectRoot, "tsconfig.json")}`;
111
+ const { stdout: tscStdout, stderr: tscStderr } = await execAsync(tscCommand);
112
+ if (tscStderr) {
113
+ console.error("TypeScript compiler errors/warnings:");
114
+ console.error(tscStderr);
115
+ }
116
+ if (tscStdout) {
117
+ console.log(tscStdout);
118
+ }
119
+ const { stdout: aliasStdout, stderr: aliasStderr } = await execAsync(aliasCommand);
120
+ if (aliasStderr) {
121
+ console.warn("tsc-alias warnings:", aliasStderr);
122
+ }
123
+ if (aliasStdout) {
124
+ console.log(aliasStdout);
125
+ }
126
+ console.log("TypeScript compilation complete.");
127
+ }
128
+ catch (error) {
129
+ console.error("Error compiling TypeScript:");
130
+ if (error.stdout)
131
+ console.error(error.stdout);
132
+ if (error.stderr)
133
+ console.error(error.stderr);
134
+ throw error;
135
+ }
136
+ }
137
+ async function build() {
138
+ console.log("Starting @c7-digital/scan build...\n");
139
+ try {
140
+ const spliceVersion = getSpliceVersion();
141
+ const { specPath, version } = await discoverSpecFile(spliceVersion);
142
+ await ensureGeneratedDirectory();
143
+ // Generate types and version constant in parallel
144
+ await Promise.all([
145
+ generateTypes(specPath),
146
+ generateSpliceVersionFile(version),
147
+ ]);
148
+ // Compile TypeScript (depends on generated types)
149
+ await compileTypeScript();
150
+ console.log(`\nBuild completed successfully for Splice version: ${version}`);
151
+ }
152
+ catch (error) {
153
+ console.error("Build failed:", error.message);
154
+ process.exit(1);
155
+ }
156
+ }
157
+ if (process.argv[1] === fileURLToPath(import.meta.url)) {
158
+ build();
159
+ }
160
+ export { build };
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Downloads Scan API OpenAPI specs from the Splice repo and bundles them
4
+ * into a single resolved YAML file.
5
+ *
6
+ * The raw spec has $ref references to sibling files:
7
+ * - common-external.yaml (health endpoints, error responses)
8
+ * - common-internal.yaml (DSO schemas, validator license schemas)
9
+ *
10
+ * We download all three, then resolve all external $ref references into a
11
+ * single bundled YAML file. Schemas referenced via local #/components/schemas
12
+ * refs in external files are collected into the root document.
13
+ */
14
+ export {};
@@ -0,0 +1,283 @@
1
+ #!/usr/bin/env tsx
2
+ /**
3
+ * Downloads Scan API OpenAPI specs from the Splice repo and bundles them
4
+ * into a single resolved YAML file.
5
+ *
6
+ * The raw spec has $ref references to sibling files:
7
+ * - common-external.yaml (health endpoints, error responses)
8
+ * - common-internal.yaml (DSO schemas, validator license schemas)
9
+ *
10
+ * We download all three, then resolve all external $ref references into a
11
+ * single bundled YAML file. Schemas referenced via local #/components/schemas
12
+ * refs in external files are collected into the root document.
13
+ */
14
+ import { join, dirname, resolve } from "path";
15
+ import { fileURLToPath } from "url";
16
+ import { writeFile, mkdir, rm, readFile } from "fs/promises";
17
+ import { existsSync } from "fs";
18
+ import fetch from "cross-fetch";
19
+ import YAML from "yaml";
20
+ const __filename = fileURLToPath(import.meta.url);
21
+ const __dirname = dirname(__filename);
22
+ const projectRoot = join(__dirname, "..");
23
+ const GITHUB_RAW_BASE = "https://raw.githubusercontent.com/hyperledger-labs/splice";
24
+ const SCAN_SPEC = {
25
+ repoPath: "apps/scan/src/main/openapi",
26
+ filename: "scan.yaml",
27
+ };
28
+ const COMMON_SPECS = [
29
+ {
30
+ repoPath: "apps/common/src/main/openapi",
31
+ filename: "common-external.yaml",
32
+ },
33
+ {
34
+ repoPath: "apps/common/src/main/openapi",
35
+ filename: "common-internal.yaml",
36
+ },
37
+ ];
38
+ function getSpliceVersion() {
39
+ const args = process.argv.slice(2);
40
+ const versionArg = args.find(arg => arg.startsWith("--splice-version="));
41
+ if (versionArg) {
42
+ return versionArg.split("=")[1];
43
+ }
44
+ return "0.5.10";
45
+ }
46
+ async function downloadFile(url, destPath) {
47
+ console.log(` Downloading: ${url}`);
48
+ const response = await fetch(url);
49
+ if (!response.ok) {
50
+ throw new Error(`Failed to download ${url}: ${response.status} ${response.statusText}`);
51
+ }
52
+ const content = await response.text();
53
+ await mkdir(dirname(destPath), { recursive: true });
54
+ await writeFile(destPath, content, "utf-8");
55
+ }
56
+ async function downloadSpecs(version, tempDir) {
57
+ console.log(`\nDownloading Scan API specs for Splice ${version}...\n`);
58
+ const scanUrl = `${GITHUB_RAW_BASE}/${version}/${SCAN_SPEC.repoPath}/${SCAN_SPEC.filename}`;
59
+ const scanDest = join(tempDir, SCAN_SPEC.repoPath, SCAN_SPEC.filename);
60
+ await downloadFile(scanUrl, scanDest);
61
+ for (const spec of COMMON_SPECS) {
62
+ const url = `${GITHUB_RAW_BASE}/${version}/${spec.repoPath}/${spec.filename}`;
63
+ const dest = join(tempDir, spec.repoPath, spec.filename);
64
+ await downloadFile(url, dest);
65
+ }
66
+ return scanDest;
67
+ }
68
+ async function parseYamlFile(filePath) {
69
+ const content = await readFile(filePath, "utf-8");
70
+ return YAML.parse(content);
71
+ }
72
+ function parseRef(ref, currentFilePath) {
73
+ const hashIndex = ref.indexOf("#");
74
+ if (hashIndex === -1) {
75
+ return { filePath: resolve(dirname(currentFilePath), ref), pointer: "" };
76
+ }
77
+ const fileRef = ref.substring(0, hashIndex);
78
+ const pointer = ref.substring(hashIndex + 1);
79
+ if (!fileRef) {
80
+ return { filePath: currentFilePath, pointer };
81
+ }
82
+ return { filePath: resolve(dirname(currentFilePath), fileRef), pointer };
83
+ }
84
+ function resolvePointer(obj, pointer) {
85
+ if (!pointer || pointer === "/")
86
+ return obj;
87
+ const parts = pointer.split("/").filter(Boolean);
88
+ let current = obj;
89
+ for (const part of parts) {
90
+ const decoded = part.replace(/~1/g, "/").replace(/~0/g, "~");
91
+ if (current === undefined || current === null) {
92
+ throw new Error(`Cannot resolve pointer "${pointer}" — reached undefined at "${decoded}"`);
93
+ }
94
+ current = current[decoded];
95
+ }
96
+ return current;
97
+ }
98
+ const fileCache = new Map();
99
+ async function getFileContent(filePath) {
100
+ if (fileCache.has(filePath)) {
101
+ return fileCache.get(filePath);
102
+ }
103
+ const content = await parseYamlFile(filePath);
104
+ fileCache.set(filePath, content);
105
+ return content;
106
+ }
107
+ /**
108
+ * Track schemas to collect from external files.
109
+ * Maps schema name to its fully-resolved schema object.
110
+ */
111
+ const collectedSchemas = new Map();
112
+ /**
113
+ * Scan an object for local $ref patterns like "#/components/schemas/Foo"
114
+ */
115
+ function findLocalSchemaRefs(obj) {
116
+ const refs = new Set();
117
+ const seen = new Set();
118
+ function walk(node) {
119
+ if (node === null || node === undefined || typeof node !== "object")
120
+ return;
121
+ if (seen.has(node))
122
+ return;
123
+ seen.add(node);
124
+ if (Array.isArray(node)) {
125
+ for (const item of node)
126
+ walk(item);
127
+ return;
128
+ }
129
+ if ("$ref" in node && typeof node["$ref"] === "string") {
130
+ const ref = node["$ref"];
131
+ const match = ref.match(/^#\/components\/schemas\/(.+)$/);
132
+ if (match) {
133
+ refs.add(match[1]);
134
+ }
135
+ return;
136
+ }
137
+ for (const value of Object.values(node)) {
138
+ walk(value);
139
+ }
140
+ }
141
+ walk(obj);
142
+ return refs;
143
+ }
144
+ /**
145
+ * Fully resolve a schema from an external file, including all its external $refs.
146
+ * The resulting object only contains local #/ refs (pointing to our root schemas).
147
+ */
148
+ async function resolveSchemaDeep(schema, sourceFilePath, rootSchemas, processingSet) {
149
+ if (schema === null || schema === undefined)
150
+ return schema;
151
+ if (typeof schema !== "object")
152
+ return schema;
153
+ if (Array.isArray(schema)) {
154
+ const resolved = [];
155
+ for (const item of schema) {
156
+ resolved.push(await resolveSchemaDeep(item, sourceFilePath, rootSchemas, processingSet));
157
+ }
158
+ return resolved;
159
+ }
160
+ if ("$ref" in schema && typeof schema["$ref"] === "string") {
161
+ const refString = schema["$ref"];
162
+ // Local ref to #/components/schemas/X — check if we need to collect it
163
+ if (refString.startsWith("#/components/schemas/")) {
164
+ const schemaName = refString.substring("#/components/schemas/".length);
165
+ // If not in root schemas and not already collected, collect it
166
+ if (!rootSchemas[schemaName] && !collectedSchemas.has(schemaName) && !processingSet.has(schemaName)) {
167
+ const fileContent = await getFileContent(sourceFilePath);
168
+ const externalSchema = fileContent?.components?.schemas?.[schemaName];
169
+ if (externalSchema) {
170
+ processingSet.add(schemaName);
171
+ const resolved = await resolveSchemaDeep(externalSchema, sourceFilePath, rootSchemas, processingSet);
172
+ collectedSchemas.set(schemaName, resolved);
173
+ console.log(` Collected schema: ${schemaName}`);
174
+ }
175
+ }
176
+ // Keep as local ref
177
+ return schema;
178
+ }
179
+ // Other local refs — keep as-is
180
+ if (refString.startsWith("#")) {
181
+ return schema;
182
+ }
183
+ // External ref — resolve it
184
+ const { filePath, pointer } = parseRef(refString, sourceFilePath);
185
+ const fileContent = await getFileContent(filePath);
186
+ const resolved = resolvePointer(fileContent, pointer);
187
+ // Recursively resolve
188
+ return resolveSchemaDeep(resolved, filePath, rootSchemas, processingSet);
189
+ }
190
+ const result = {};
191
+ for (const [key, value] of Object.entries(schema)) {
192
+ result[key] = await resolveSchemaDeep(value, sourceFilePath, rootSchemas, processingSet);
193
+ }
194
+ return result;
195
+ }
196
+ /**
197
+ * Recursively resolve all external $ref references in the root document.
198
+ * When an external ref is inlined, any local schema refs it contains
199
+ * are collected into collectedSchemas.
200
+ */
201
+ async function resolveRefs(obj, currentFilePath, rootFilePath, rootSchemas) {
202
+ if (obj === null || obj === undefined)
203
+ return obj;
204
+ if (typeof obj !== "object")
205
+ return obj;
206
+ if (Array.isArray(obj)) {
207
+ const resolved = [];
208
+ for (const item of obj) {
209
+ resolved.push(await resolveRefs(item, currentFilePath, rootFilePath, rootSchemas));
210
+ }
211
+ return resolved;
212
+ }
213
+ if ("$ref" in obj && typeof obj["$ref"] === "string") {
214
+ const refString = obj["$ref"];
215
+ // Local refs — keep as-is
216
+ if (refString.startsWith("#")) {
217
+ return obj;
218
+ }
219
+ // External ref — fully resolve it (including nested external refs)
220
+ const { filePath, pointer } = parseRef(refString, currentFilePath);
221
+ const fileContent = await getFileContent(filePath);
222
+ const resolved = resolvePointer(fileContent, pointer);
223
+ // Deep-resolve: resolve all external refs and collect schemas
224
+ return resolveSchemaDeep(resolved, filePath, rootSchemas, new Set());
225
+ }
226
+ const result = {};
227
+ for (const [key, value] of Object.entries(obj)) {
228
+ result[key] = await resolveRefs(value, currentFilePath, rootFilePath, rootSchemas);
229
+ }
230
+ return result;
231
+ }
232
+ async function bundleSpec(scanSpecPath, outputPath) {
233
+ console.log(`\nBundling spec...`);
234
+ const scanDoc = await parseYamlFile(scanSpecPath);
235
+ // Get root schemas so we know what's already defined
236
+ const rootSchemas = scanDoc?.components?.schemas || {};
237
+ // Resolve all external $refs (this also collects external schemas)
238
+ const bundled = await resolveRefs(scanDoc, scanSpecPath, scanSpecPath, rootSchemas);
239
+ // Merge collected external schemas into the bundled document
240
+ if (collectedSchemas.size > 0) {
241
+ if (!bundled.components)
242
+ bundled.components = {};
243
+ if (!bundled.components.schemas)
244
+ bundled.components.schemas = {};
245
+ for (const [name, schema] of collectedSchemas) {
246
+ if (!bundled.components.schemas[name]) {
247
+ bundled.components.schemas[name] = schema;
248
+ }
249
+ }
250
+ }
251
+ const yamlOutput = YAML.stringify(bundled, { lineWidth: 0 });
252
+ await writeFile(outputPath, yamlOutput, "utf-8");
253
+ console.log(`\nBundled spec written to ${outputPath}`);
254
+ }
255
+ async function main() {
256
+ const version = getSpliceVersion();
257
+ const outputPath = join(projectRoot, "specs", `scan_bundled_${version}.yaml`);
258
+ if (existsSync(outputPath)) {
259
+ console.log(`Bundled spec already exists: ${outputPath}`);
260
+ console.log("Delete it first if you want to re-download.");
261
+ return;
262
+ }
263
+ const tempDir = join(projectRoot, ".tmp-splice-specs");
264
+ try {
265
+ if (existsSync(tempDir)) {
266
+ await rm(tempDir, { recursive: true });
267
+ }
268
+ await mkdir(tempDir, { recursive: true });
269
+ const scanSpecPath = await downloadSpecs(version, tempDir);
270
+ await mkdir(dirname(outputPath), { recursive: true });
271
+ await bundleSpec(scanSpecPath, outputPath);
272
+ console.log(`\nDone! Bundled spec: ${outputPath}`);
273
+ }
274
+ finally {
275
+ if (existsSync(tempDir)) {
276
+ await rm(tempDir, { recursive: true });
277
+ }
278
+ }
279
+ }
280
+ main().catch(error => {
281
+ console.error("Error:", error.message);
282
+ process.exit(1);
283
+ });
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Typed HTTP client for the Canton Network Scan API.
3
+ *
4
+ * Provides type-safe access to the Scan API endpoints for discovering
5
+ * party metadata, ANS entries, validator licenses, DSO info, and more.
6
+ */
7
+ import { Party } from "@daml/types";
8
+ import { operations, components } from "./generated/api.js";
9
+ /** ANS entry with `user` typed as Party (owner party ID). */
10
+ export type AnsEntry = Omit<components["schemas"]["AnsEntry"], "user"> & {
11
+ user: Party;
12
+ };
13
+ type ListAnsEntriesOperation = operations["listAnsEntries"];
14
+ type ListAnsEntriesParams = ListAnsEntriesOperation["parameters"]["query"];
15
+ type ListAnsEntriesResponse = {
16
+ entries: AnsEntry[];
17
+ };
18
+ type LookupAnsEntryByPartyResponse = {
19
+ entry: AnsEntry;
20
+ };
21
+ type LookupAnsEntryByNameResponse = {
22
+ entry: AnsEntry;
23
+ };
24
+ type GetPartyToParticipantOperation = operations["getPartyToParticipant"];
25
+ type GetPartyToParticipantResponse = GetPartyToParticipantOperation["responses"]["200"]["content"]["application/json"];
26
+ type GetDsoInfoOperation = operations["getDsoInfo"];
27
+ type GetDsoInfoResponseRaw = GetDsoInfoOperation["responses"]["200"]["content"]["application/json"];
28
+ /** DSO info with sv_party_id and dso_party_id typed as Party. */
29
+ type GetDsoInfoResponse = Omit<GetDsoInfoResponseRaw, "sv_party_id" | "dso_party_id"> & {
30
+ sv_party_id: Party;
31
+ dso_party_id: Party;
32
+ };
33
+ type GetDsoPartyIdResponse = {
34
+ dso_party_id: Party;
35
+ };
36
+ type ListDsoSequencersOperation = operations["listDsoSequencers"];
37
+ type ListDsoSequencersResponse = ListDsoSequencersOperation["responses"]["200"]["content"]["application/json"];
38
+ type ListDsoScansOperation = operations["listDsoScans"];
39
+ type ListDsoScansResponse = ListDsoScansOperation["responses"]["200"]["content"]["application/json"];
40
+ type ListValidatorLicensesOperation = operations["listValidatorLicenses"];
41
+ type ListValidatorLicensesParams = ListValidatorLicensesOperation["parameters"]["query"];
42
+ type ListValidatorLicensesResponse = ListValidatorLicensesOperation["responses"]["200"]["content"]["application/json"];
43
+ type GetValidatorFaucetsOperation = operations["getValidatorFaucetsByValidator"];
44
+ type GetValidatorFaucetsParams = GetValidatorFaucetsOperation["parameters"]["query"];
45
+ type GetValidatorFaucetsResponse = GetValidatorFaucetsOperation["responses"]["200"]["content"]["application/json"];
46
+ type GetUpdatesV2Operation = operations["getUpdateHistoryV2"];
47
+ type GetUpdatesV2Request = GetUpdatesV2Operation["requestBody"]["content"]["application/json"];
48
+ type GetUpdatesV2Response = GetUpdatesV2Operation["responses"]["200"]["content"]["application/json"];
49
+ type GetUpdateByIdV2Operation = operations["getUpdateByIdV2"];
50
+ type GetUpdateByIdV2Params = GetUpdateByIdV2Operation["parameters"]["query"];
51
+ type GetUpdateByIdV2Response = GetUpdateByIdV2Operation["responses"]["200"]["content"]["application/json"];
52
+ type GetAcsSnapshotOperation = operations["getAcsSnapshotAt"];
53
+ type GetAcsSnapshotRequest = GetAcsSnapshotOperation["requestBody"]["content"]["application/json"];
54
+ type GetAcsSnapshotResponse = GetAcsSnapshotOperation["responses"]["200"]["content"]["application/json"];
55
+ type GetAcsSnapshotTimestampOperation = operations["getDateOfMostRecentSnapshotBefore"];
56
+ type GetAcsSnapshotTimestampParams = GetAcsSnapshotTimestampOperation["parameters"]["query"];
57
+ type GetAcsSnapshotTimestampResponse = GetAcsSnapshotTimestampOperation["responses"]["200"]["content"]["application/json"];
58
+ type GetAcsSnapshotTimestampAfterOperation = operations["getDateOfFirstSnapshotAfter"];
59
+ type GetAcsSnapshotTimestampAfterParams = GetAcsSnapshotTimestampAfterOperation["parameters"]["query"];
60
+ type GetAcsSnapshotTimestampAfterResponse = GetAcsSnapshotTimestampAfterOperation["responses"]["200"]["content"]["application/json"];
61
+ type ForceAcsSnapshotOperation = operations["forceAcsSnapshotNow"];
62
+ type ForceAcsSnapshotResponse = ForceAcsSnapshotOperation["responses"]["200"]["content"]["application/json"];
63
+ type GetHoldingsStateOperation = operations["getHoldingsStateAt"];
64
+ type GetHoldingsStateRequest = GetHoldingsStateOperation["requestBody"]["content"]["application/json"];
65
+ type GetHoldingsStateResponse = GetHoldingsStateOperation["responses"]["200"]["content"]["application/json"];
66
+ type GetHoldingsSummaryOperation = operations["getHoldingsSummaryAt"];
67
+ type GetHoldingsSummaryRequest = GetHoldingsSummaryOperation["requestBody"]["content"]["application/json"];
68
+ type GetHoldingsSummaryResponse = GetHoldingsSummaryOperation["responses"]["200"]["content"]["application/json"];
69
+ type GetClosedRoundsOperation = operations["getClosedRounds"];
70
+ type GetClosedRoundsResponse = GetClosedRoundsOperation["responses"]["200"]["content"]["application/json"];
71
+ type GetOpenAndIssuingMiningRoundsOperation = operations["getOpenAndIssuingMiningRounds"];
72
+ type GetOpenAndIssuingMiningRoundsRequest = GetOpenAndIssuingMiningRoundsOperation["requestBody"]["content"]["application/json"];
73
+ type GetOpenAndIssuingMiningRoundsResponse = GetOpenAndIssuingMiningRoundsOperation["responses"]["200"]["content"]["application/json"];
74
+ type GetEventsOperation = operations["getEventHistory"];
75
+ type GetEventsRequest = GetEventsOperation["requestBody"]["content"]["application/json"];
76
+ type GetEventsResponse = GetEventsOperation["responses"]["200"]["content"]["application/json"];
77
+ type GetEventByIdOperation = operations["getEventById"];
78
+ type GetEventByIdParams = GetEventByIdOperation["parameters"]["query"];
79
+ type GetEventByIdResponse = GetEventByIdOperation["responses"]["200"]["content"]["application/json"];
80
+ type ListUnclaimedDevelopmentFundCouponsOperation = operations["listUnclaimedDevelopmentFundCoupons"];
81
+ type ListUnclaimedDevelopmentFundCouponsResponse = ListUnclaimedDevelopmentFundCouponsOperation["responses"]["200"]["content"]["application/json"];
82
+ type GetHealthStatusOperation = operations["getHealthStatus"];
83
+ type GetHealthStatusResponse = GetHealthStatusOperation["responses"]["200"]["content"]["application/json"];
84
+ type GetVersionOperation = operations["getVersion"];
85
+ type GetVersionResponse = GetVersionOperation["responses"]["200"]["content"]["application/json"];
86
+ export interface ScanClientConfig {
87
+ /** Base URL of the Scan API, e.g. "https://scan.example.com/api/scan" */
88
+ baseUrl: string;
89
+ /** Optional bearer token for authenticated endpoints */
90
+ token?: string;
91
+ }
92
+ export declare class ScanClient {
93
+ readonly baseUrl: string;
94
+ readonly token?: string;
95
+ constructor(config: ScanClientConfig);
96
+ private request;
97
+ listAnsEntries(params: ListAnsEntriesParams): Promise<ListAnsEntriesResponse>;
98
+ lookupAnsEntryByParty(party: Party): Promise<LookupAnsEntryByPartyResponse>;
99
+ lookupAnsEntryByName(name: string): Promise<LookupAnsEntryByNameResponse>;
100
+ getPartyToParticipant(domainId: string, partyId: Party): Promise<GetPartyToParticipantResponse>;
101
+ getDsoInfo(): Promise<GetDsoInfoResponse>;
102
+ getDsoPartyId(): Promise<GetDsoPartyIdResponse>;
103
+ getDsoSequencers(): Promise<ListDsoSequencersResponse>;
104
+ listScans(): Promise<ListDsoScansResponse>;
105
+ listValidatorLicenses(params?: ListValidatorLicensesParams): Promise<ListValidatorLicensesResponse>;
106
+ getValidatorFaucets(params: GetValidatorFaucetsParams): Promise<GetValidatorFaucetsResponse>;
107
+ getUpdates(body: GetUpdatesV2Request): Promise<GetUpdatesV2Response>;
108
+ getUpdateById(updateId: string, params?: GetUpdateByIdV2Params): Promise<GetUpdateByIdV2Response>;
109
+ getAcsSnapshot(body: GetAcsSnapshotRequest): Promise<GetAcsSnapshotResponse>;
110
+ getAcsSnapshotTimestamp(params: GetAcsSnapshotTimestampParams): Promise<GetAcsSnapshotTimestampResponse>;
111
+ getAcsSnapshotTimestampAfter(params: GetAcsSnapshotTimestampAfterParams): Promise<GetAcsSnapshotTimestampAfterResponse>;
112
+ forceAcsSnapshot(): Promise<ForceAcsSnapshotResponse>;
113
+ getHoldingsState(body: GetHoldingsStateRequest): Promise<GetHoldingsStateResponse>;
114
+ getHoldingsSummary(body: GetHoldingsSummaryRequest): Promise<GetHoldingsSummaryResponse>;
115
+ getClosedRounds(): Promise<GetClosedRoundsResponse>;
116
+ getOpenAndIssuingMiningRounds(body: GetOpenAndIssuingMiningRoundsRequest): Promise<GetOpenAndIssuingMiningRoundsResponse>;
117
+ getEvents(body: GetEventsRequest): Promise<GetEventsResponse>;
118
+ getEventById(updateId: string, params?: GetEventByIdParams): Promise<GetEventByIdResponse>;
119
+ getUnclaimedDevelopmentFundCoupons(): Promise<ListUnclaimedDevelopmentFundCouponsResponse>;
120
+ isReady(): Promise<boolean>;
121
+ isLive(): Promise<boolean>;
122
+ getStatus(): Promise<GetHealthStatusResponse>;
123
+ getVersion(): Promise<GetVersionResponse>;
124
+ }
125
+ export {};